diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
commit | 8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca (patch) | |
tree | 544930fb309b30317ae9797a9683768705d664c4 /app/assets/javascripts/filtered_search | |
parent | 4b1de649d0168371549608993deac953eb692019 (diff) |
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc42
Diffstat (limited to 'app/assets/javascripts/filtered_search')
5 files changed, 31 insertions, 2 deletions
diff --git a/app/assets/javascripts/filtered_search/add_extra_tokens_for_merge_requests.js b/app/assets/javascripts/filtered_search/add_extra_tokens_for_merge_requests.js index 7d4df25816b..38a5bdd4a71 100644 --- a/app/assets/javascripts/filtered_search/add_extra_tokens_for_merge_requests.js +++ b/app/assets/javascripts/filtered_search/add_extra_tokens_for_merge_requests.js @@ -1,6 +1,18 @@ import { __ } from '~/locale'; export default (IssuableTokenKeys, disableTargetBranchFilter = false) => { + const reviewerToken = { + formattedKey: __('Reviewer'), + key: 'reviewer', + type: 'string', + param: 'username', + symbol: '@', + icon: 'user', + tag: '@reviewer', + }; + IssuableTokenKeys.tokenKeys.splice(2, 0, reviewerToken); + IssuableTokenKeys.tokenKeysWithAlternative.splice(2, 0, reviewerToken); + const draftToken = { token: { formattedKey: __('Draft'), @@ -91,7 +103,7 @@ export default (IssuableTokenKeys, disableTargetBranchFilter = false) => { ], }; - const tokenPosition = 2; + const tokenPosition = 3; IssuableTokenKeys.tokenKeys.splice(tokenPosition, 0, ...[approvedBy.token]); IssuableTokenKeys.tokenKeysWithAlternative.splice(tokenPosition, 0, ...[approvedBy.token]); IssuableTokenKeys.conditions.push(...approvedBy.condition); diff --git a/app/assets/javascripts/filtered_search/available_dropdown_mappings.js b/app/assets/javascripts/filtered_search/available_dropdown_mappings.js index d7645f96406..77491d1556b 100644 --- a/app/assets/javascripts/filtered_search/available_dropdown_mappings.js +++ b/app/assets/javascripts/filtered_search/available_dropdown_mappings.js @@ -71,6 +71,11 @@ export default class AvailableDropdownMappings { gl: DropdownUser, element: this.container.querySelector('#js-dropdown-assignee'), }, + reviewer: { + reference: null, + gl: DropdownUser, + element: this.container.querySelector('#js-dropdown-reviewer'), + }, 'approved-by': { reference: null, gl: DropdownUser, diff --git a/app/assets/javascripts/filtered_search/constants.js b/app/assets/javascripts/filtered_search/constants.js index 6cd6f9c9906..08736b09407 100644 --- a/app/assets/javascripts/filtered_search/constants.js +++ b/app/assets/javascripts/filtered_search/constants.js @@ -1,4 +1,4 @@ -export const USER_TOKEN_TYPES = ['author', 'assignee', 'approved-by']; +export const USER_TOKEN_TYPES = ['author', 'assignee', 'approved-by', 'reviewer']; export const DROPDOWN_TYPE = { hint: 'hint', diff --git a/app/assets/javascripts/filtered_search/issuable_filtered_search_token_keys.js b/app/assets/javascripts/filtered_search/issuable_filtered_search_token_keys.js index d2ac80fa190..f9388e9c5d8 100644 --- a/app/assets/javascripts/filtered_search/issuable_filtered_search_token_keys.js +++ b/app/assets/javascripts/filtered_search/issuable_filtered_search_token_keys.js @@ -86,6 +86,16 @@ export const conditions = flattenDeep( value: __('Any'), }, { + url: 'reviewer_id=None', + tokenKey: 'reviewer', + value: __('None'), + }, + { + url: 'reviewer_id=Any', + tokenKey: 'reviewer', + value: __('Any'), + }, + { url: 'author_username=support-bot', tokenKey: 'author', value: 'support-bot', diff --git a/app/assets/javascripts/filtered_search/recent_searches_storage_keys.js b/app/assets/javascripts/filtered_search/recent_searches_storage_keys.js index 7e9b809e9b2..54d49821d92 100644 --- a/app/assets/javascripts/filtered_search/recent_searches_storage_keys.js +++ b/app/assets/javascripts/filtered_search/recent_searches_storage_keys.js @@ -1,4 +1,6 @@ export default { issues: 'issue-recent-searches', merge_requests: 'merge-request-recent-searches', + group_members: 'group-members-recent-searches', + group_invited_members: 'group-invited-members-recent-searches', }; |