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
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/gfm_auto_complete.js')
-rw-r--r--app/assets/javascripts/gfm_auto_complete.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/app/assets/javascripts/gfm_auto_complete.js b/app/assets/javascripts/gfm_auto_complete.js
index f1e46262b2f..57c82d34548 100644
--- a/app/assets/javascripts/gfm_auto_complete.js
+++ b/app/assets/javascripts/gfm_auto_complete.js
@@ -22,6 +22,9 @@ const LABELS_ALIAS = 'labels';
const SNIPPETS_ALIAS = 'snippets';
const CONTACTS_ALIAS = 'contacts';
+const CADENCE_REFERENCE_PREFIX = '[cadence:';
+const ITERATION_REFERENCE_PREFIX = '*iteration:';
+
export const AT_WHO_ACTIVE_CLASS = 'at-who-active';
export const CONTACT_STATE_ACTIVE = 'active';
export const CONTACTS_ADD_COMMAND = '/add_contacts';
@@ -220,6 +223,11 @@ class GfmAutoComplete {
const match = regexp.exec(value.params);
if (match) {
[referencePrefix] = match;
+
+ // EE-ONLY; iteration quick action should autocomplete iteration reference only
+ if (referencePrefix === CADENCE_REFERENCE_PREFIX)
+ referencePrefix = ITERATION_REFERENCE_PREFIX;
+
tpl += '<%- referencePrefix %>';
} else {
[[referencePrefix]] = value.params;
@@ -227,7 +235,7 @@ class GfmAutoComplete {
tpl += '<%- referencePrefix %>';
} else if (/^[*]/.test(referencePrefix)) {
// EE-ONLY
- referencePrefix = '*iteration:';
+ referencePrefix = ITERATION_REFERENCE_PREFIX;
tpl += '<%- referencePrefix %>';
}
}