Commit 2cb1b407 authored by Simon Knox's avatar Simon Knox Committed by Jarka Kadlecova

remove issue autocomplete for epic issues

parent da56ed43
......@@ -43,12 +43,15 @@ export default {
computed: {
inputPlaceholder() {
return 'Paste issue link or <#issue id>';
return `Paste issue link${this.allowAutoComplete ? ' or <#issue id>' : ''}`;
},
isSubmitButtonDisabled() {
return (this.inputValue.length === 0 && this.pendingReferences.length === 0)
|| this.isSubmitting;
},
allowAutoComplete() {
return Object.keys(this.autoCompleteSources).length > 0;
},
},
methods: {
......@@ -86,12 +89,14 @@ export default {
mounted() {
const $input = $(this.$refs.input);
this.gfmAutoComplete = new GfmAutoComplete(this.autoCompleteSources);
this.gfmAutoComplete.setup($input, {
issues: true,
});
$input.on('shown-issues.atwho', this.onAutoCompleteToggled.bind(this, true));
$input.on('hidden-issues.atwho', this.onAutoCompleteToggled.bind(this, false));
if (this.allowAutoComplete) {
this.gfmAutoComplete = new GfmAutoComplete(this.autoCompleteSources);
this.gfmAutoComplete.setup($input, {
issues: true,
});
$input.on('shown-issues.atwho', this.onAutoCompleteToggled.bind(this, true));
$input.on('hidden-issues.atwho', this.onAutoCompleteToggled.bind(this, false));
}
this.$refs.input.focus();
},
......
......@@ -55,6 +55,11 @@ export default {
required: false,
default: 'Related issues',
},
allowAutoComplete: {
type: Boolean,
required: false,
default: true,
},
},
data() {
......@@ -75,6 +80,7 @@ export default {
computed: {
autoCompleteSources() {
if (!this.allowAutoComplete) return {};
return gl.GfmAutoComplete && gl.GfmAutoComplete.dataSources;
},
},
......
......@@ -103,8 +103,8 @@
<related-issues-root
:endpoint="issuesEndpoint"
:can-add-related-issues="true"
:allow-auto-complete="false"
title="Issues"
help-path="/"
/>
</div>
</div>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment