Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-10-17 09:10:33 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-10-17 09:10:33 +0300
commit7118851f0272b099335a34d8ca18a045aa5de51d (patch)
tree4ef50130a82a7b544936b9a298eb2c0e4968ec2e /app
parentb24742b7ed7add26a843d31207113610774fed4c (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/boards/components/board_filtered_search.vue14
-rw-r--r--app/assets/javascripts/boards/index.js1
-rw-r--r--app/assets/javascripts/issues/list/constants.js2
-rw-r--r--app/assets/javascripts/vue_shared/components/filtered_search_bar/constants.js6
-rw-r--r--app/models/integrations/harbor.rb69
5 files changed, 44 insertions, 48 deletions
diff --git a/app/assets/javascripts/boards/components/board_filtered_search.vue b/app/assets/javascripts/boards/components/board_filtered_search.vue
index fa0c798ca9d..11a5d89cc8c 100644
--- a/app/assets/javascripts/boards/components/board_filtered_search.vue
+++ b/app/assets/javascripts/boards/components/board_filtered_search.vue
@@ -8,6 +8,7 @@ import { __ } from '~/locale';
import {
FILTERED_SEARCH_TERM,
FILTER_ANY,
+ TOKEN_TYPE_HEALTH,
} from '~/vue_shared/components/filtered_search_bar/constants';
import FilteredSearch from '~/vue_shared/components/filtered_search_bar/filtered_search_bar_root.vue';
import { AssigneeFilterType } from '~/boards/constants';
@@ -55,6 +56,7 @@ export default {
myReactionEmoji,
releaseTag,
confidential,
+ healthStatus,
} = this.filterParams;
const filteredSearchValue = [];
@@ -154,6 +156,13 @@ export default {
});
}
+ if (healthStatus) {
+ filteredSearchValue.push({
+ type: TOKEN_TYPE_HEALTH,
+ value: { data: healthStatus, operator: '=' },
+ });
+ }
+
if (this.filterParams['not[authorUsername]']) {
filteredSearchValue.push({
type: 'author',
@@ -248,6 +257,7 @@ export default {
iterationCadenceId,
releaseTag,
confidential,
+ healthStatus,
} = this.filterParams;
let iteration = iterationId;
let cadence = iterationCadenceId;
@@ -292,6 +302,7 @@ export default {
my_reaction_emoji: myReactionEmoji,
release_tag: releaseTag,
confidential,
+ [TOKEN_TYPE_HEALTH]: healthStatus,
},
(value) => {
if (value || value === false) {
@@ -390,6 +401,9 @@ export default {
case 'filtered-search-term':
if (filter.value.data) plainText.push(filter.value.data);
break;
+ case TOKEN_TYPE_HEALTH:
+ filterParams.healthStatus = filter.value.data;
+ break;
default:
break;
}
diff --git a/app/assets/javascripts/boards/index.js b/app/assets/javascripts/boards/index.js
index 854717ed4c4..a7003edba47 100644
--- a/app/assets/javascripts/boards/index.js
+++ b/app/assets/javascripts/boards/index.js
@@ -86,6 +86,7 @@ function mountBoardApp(el) {
milestoneListsAvailable: parseBoolean(el.dataset.milestoneListsAvailable),
assigneeListsAvailable: parseBoolean(el.dataset.assigneeListsAvailable),
iterationListsAvailable: parseBoolean(el.dataset.iterationListsAvailable),
+ healthStatusFeatureAvailable: parseBoolean(el.dataset.healthStatusFeatureAvailable),
allowScopedLabels: parseBoolean(el.dataset.scopedLabels),
swimlanesFeatureAvailable: gon.licensed_features?.swimlanes,
multipleIssueBoardsAvailable: parseBoolean(el.dataset.multipleBoardsAvailable),
diff --git a/app/assets/javascripts/issues/list/constants.js b/app/assets/javascripts/issues/list/constants.js
index 747a56299b1..9fe8899ab39 100644
--- a/app/assets/javascripts/issues/list/constants.js
+++ b/app/assets/javascripts/issues/list/constants.js
@@ -7,6 +7,7 @@ import {
FILTER_UPCOMING,
OPERATOR_IS,
OPERATOR_IS_NOT,
+ TOKEN_TYPE_HEALTH,
} from '~/vue_shared/components/filtered_search_bar/constants';
import {
WORK_ITEM_TYPE_ENUM_INCIDENT,
@@ -148,7 +149,6 @@ export const TOKEN_TYPE_EPIC = 'epic_id';
export const TOKEN_TYPE_WEIGHT = 'weight';
export const TOKEN_TYPE_CONTACT = 'crm_contact';
export const TOKEN_TYPE_ORGANIZATION = 'crm_organization';
-export const TOKEN_TYPE_HEALTH = 'health_status';
export const TYPE_TOKEN_TASK_OPTION = { icon: 'issue-type-task', title: 'task', value: 'task' };
diff --git a/app/assets/javascripts/vue_shared/components/filtered_search_bar/constants.js b/app/assets/javascripts/vue_shared/components/filtered_search_bar/constants.js
index ffe09634a3b..4873996d357 100644
--- a/app/assets/javascripts/vue_shared/components/filtered_search_bar/constants.js
+++ b/app/assets/javascripts/vue_shared/components/filtered_search_bar/constants.js
@@ -56,3 +56,9 @@ export const TOKEN_TITLE_MY_REACTION = __('My-Reaction');
export const TOKEN_TITLE_ORGANIZATION = s__('Crm|Organization');
export const TOKEN_TITLE_RELEASE = __('Release');
export const TOKEN_TITLE_TYPE = __('Type');
+
+// As health status gets reused between issue lists and boards
+// this is in the shared constants. Until we have not decoupled the EE filtered search bar
+// from the CE component, we need to keep this in the CE code.
+// https://gitlab.com/gitlab-org/gitlab/-/issues/377838
+export const TOKEN_TYPE_HEALTH = 'health_status';
diff --git a/app/models/integrations/harbor.rb b/app/models/integrations/harbor.rb
index 53e53335683..01a04743d5d 100644
--- a/app/models/integrations/harbor.rb
+++ b/app/models/integrations/harbor.rb
@@ -3,14 +3,33 @@ require 'uri'
module Integrations
class Harbor < Integration
- prop_accessor :url, :project_name, :username, :password
-
validates :url, public_url: true, presence: true, addressable_url: { allow_localhost: false, allow_local_network: false }, if: :activated?
validates :project_name, presence: true, if: :activated?
validates :username, presence: true, if: :activated?
validates :password, format: { with: ::Ci::Maskable::REGEX }, if: :activated?
- before_validation :reset_username_and_password
+ field :url,
+ title: -> { s_('HarborIntegration|Harbor URL') },
+ placeholder: 'https://demo.goharbor.io',
+ help: -> { s_('HarborIntegration|Base URL of the Harbor instance.') },
+ exposes_secrets: true,
+ required: true
+
+ field :project_name,
+ title: -> { s_('HarborIntegration|Harbor project name') },
+ help: -> { s_('HarborIntegration|The name of the project in Harbor.') }
+
+ field :username,
+ title: -> { s_('HarborIntegration|Harbor username') },
+ required: true
+
+ field :password,
+ type: 'password',
+ title: -> { s_('HarborIntegration|Harbor password') },
+ help: -> { s_('HarborIntegration|Password for your Harbor username.') },
+ non_empty_password_title: -> { s_('HarborIntegration|Enter new Harbor password') },
+ non_empty_password_help: -> { s_('HarborIntegration|Leave blank to use your current password.') },
+ required: true
def title
'Harbor'
@@ -46,40 +65,6 @@ module Integrations
client.ping
end
- def fields
- [
- {
- type: 'text',
- name: 'url',
- title: s_('HarborIntegration|Harbor URL'),
- placeholder: 'https://demo.goharbor.io',
- help: s_('HarborIntegration|Base URL of the Harbor instance.'),
- required: true
- },
- {
- type: 'text',
- name: 'project_name',
- title: s_('HarborIntegration|Harbor project name'),
- help: s_('HarborIntegration|The name of the project in Harbor.')
- },
- {
- type: 'text',
- name: 'username',
- title: s_('HarborIntegration|Harbor username'),
- required: true
- },
- {
- type: 'password',
- name: 'password',
- title: s_('HarborIntegration|Harbor password'),
- help: s_('HarborIntegration|Password for your Harbor username.'),
- non_empty_password_title: s_('HarborIntegration|Enter new Harbor password'),
- non_empty_password_help: s_('HarborIntegration|Leave blank to use your current password.'),
- required: true
- }
- ]
- end
-
def ci_variables
return [] unless activated?
@@ -100,15 +85,5 @@ module Integrations
def client
@client ||= ::Gitlab::Harbor::Client.new(self)
end
-
- def reset_username_and_password
- if url_changed? && !password_touched?
- self.password = nil
- end
-
- if url_changed? && !username_touched?
- self.username = nil
- end
- end
end
end