diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-07 18:08:44 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-07 18:08:44 +0300 |
commit | 06c9acad67a086a66f1d63aa1b79fc77a19cc646 (patch) | |
tree | b2c642197d4a9e549417dadfb050d2645ec7ffa7 /app/assets/javascripts/gfm_auto_complete.js | |
parent | 01f48ebf027baee9f845cecbf094e91a98c9a324 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/gfm_auto_complete.js')
-rw-r--r-- | app/assets/javascripts/gfm_auto_complete.js | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/app/assets/javascripts/gfm_auto_complete.js b/app/assets/javascripts/gfm_auto_complete.js index 9e7006bb6e7..a9e7b853cd2 100644 --- a/app/assets/javascripts/gfm_auto_complete.js +++ b/app/assets/javascripts/gfm_auto_complete.js @@ -393,13 +393,16 @@ class GfmAutoComplete { if (command === MEMBER_COMMAND.ASSIGN) { // Only include members which are not assigned to Issuable currently return data.filter((member) => !assignees.includes(member.search)); - } else if (command === MEMBER_COMMAND.UNASSIGN) { + } + if (command === MEMBER_COMMAND.UNASSIGN) { // Only include members which are assigned to Issuable currently return data.filter((member) => assignees.includes(member.search)); - } else if (command === MEMBER_COMMAND.ASSIGN_REVIEWER) { + } + if (command === MEMBER_COMMAND.ASSIGN_REVIEWER) { // Only include members which are not assigned as a reviewer to Issuable currently return data.filter((member) => !reviewers.includes(member.search)); - } else if (command === MEMBER_COMMAND.UNASSIGN_REVIEWER) { + } + if (command === MEMBER_COMMAND.UNASSIGN_REVIEWER) { // Only include members which are not assigned as a reviewer to Issuable currently return data.filter((member) => reviewers.includes(member.search)); } @@ -642,7 +645,8 @@ class GfmAutoComplete { if (command === LABEL_COMMAND.LABEL || command === LABEL_COMMAND.LABELS) { // Return labels with set: undefined. return data.filter((label) => !label.set); - } else if (command === LABEL_COMMAND.UNLABEL) { + } + if (command === LABEL_COMMAND.UNLABEL) { // Return labels with set: true. return data.filter((label) => label.set); } @@ -751,7 +755,8 @@ class GfmAutoComplete { if (command === CONTACTS_ADD_COMMAND) { // Return contacts that are active and not already on the issue return data.filter((contact) => contact.state === CONTACT_STATE_ACTIVE && !contact.set); - } else if (command === CONTACTS_REMOVE_COMMAND) { + } + if (command === CONTACTS_REMOVE_COMMAND) { // Return contacts already on the issue return data.filter((contact) => contact.set); } @@ -779,10 +784,8 @@ class GfmAutoComplete { if (GfmAutoComplete.isLoading(data)) { self.fetchData(this.$inputor, this.at); return data; - } else if ( - GfmAutoComplete.isTypeWithBackendFiltering(this.at) && - self.previousQuery !== query - ) { + } + if (GfmAutoComplete.isTypeWithBackendFiltering(this.at) && self.previousQuery !== query) { self.fetchData(this.$inputor, this.at, query); self.previousQuery = query; return data; |