diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 07:08:36 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 07:08:36 +0000 |
commit | 48aff82709769b098321c738f3444b9bdaa694c6 (patch) | |
tree | e00c7c43e2d9b603a5a6af576b1685e400410dee /app/assets/javascripts/filtered_search/available_dropdown_mappings.js | |
parent | 879f5329ee916a948223f8f43d77fba4da6cd028 (diff) | |
download | gitlab-ce-48aff82709769b098321c738f3444b9bdaa694c6.tar.gz |
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc42
Diffstat (limited to 'app/assets/javascripts/filtered_search/available_dropdown_mappings.js')
-rw-r--r-- | app/assets/javascripts/filtered_search/available_dropdown_mappings.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/app/assets/javascripts/filtered_search/available_dropdown_mappings.js b/app/assets/javascripts/filtered_search/available_dropdown_mappings.js index 49bd3cda127..d7645f96406 100644 --- a/app/assets/javascripts/filtered_search/available_dropdown_mappings.js +++ b/app/assets/javascripts/filtered_search/available_dropdown_mappings.js @@ -15,6 +15,7 @@ export default class AvailableDropdownMappings { labelsEndpoint, milestonesEndpoint, releasesEndpoint, + environmentsEndpoint, groupsOnly, includeAncestorGroups, includeDescendantGroups, @@ -24,6 +25,7 @@ export default class AvailableDropdownMappings { this.labelsEndpoint = labelsEndpoint; this.milestonesEndpoint = milestonesEndpoint; this.releasesEndpoint = releasesEndpoint; + this.environmentsEndpoint = environmentsEndpoint; this.groupsOnly = groupsOnly; this.includeAncestorGroups = includeAncestorGroups; this.includeDescendantGroups = includeDescendantGroups; @@ -69,6 +71,11 @@ export default class AvailableDropdownMappings { gl: DropdownUser, element: this.container.querySelector('#js-dropdown-assignee'), }, + 'approved-by': { + reference: null, + gl: DropdownUser, + element: this.container.querySelector('#js-dropdown-approved-by'), + }, milestone: { reference: null, gl: DropdownNonUser, @@ -144,6 +151,16 @@ export default class AvailableDropdownMappings { }, element: this.container.querySelector('#js-dropdown-target-branch'), }, + environment: { + reference: null, + gl: DropdownNonUser, + extraArguments: { + endpoint: this.getEnvironmentsEndpoint(), + symbol: '', + preprocessing: data => data.map(env => ({ title: env })), + }, + element: this.container.querySelector('#js-dropdown-environment'), + }, }; } @@ -189,6 +206,10 @@ export default class AvailableDropdownMappings { return mergeUrlParams(params, endpoint); } + getEnvironmentsEndpoint() { + return `${this.environmentsEndpoint}.json`; + } + getGroupId() { return this.filteredSearchInput.getAttribute('data-group-id') || ''; } |