Commit 1664c740 authored by Kev's avatar Kev

Add canCreateIssue computed value

parent 8c5ff0fd
...@@ -59,6 +59,9 @@ export default { ...@@ -59,6 +59,9 @@ export default {
isIssueAlreadyCreated() { isIssueAlreadyCreated() {
return Boolean(this.state.relatedIssues.find(i => i.lockIssueRemoval)); return Boolean(this.state.relatedIssues.find(i => i.lockIssueRemoval));
}, },
canCreateIssue() {
return !this.isIssueAlreadyCreated && !this.isFetching && Boolean(this.createIssueUrl);
},
}, },
inject: { inject: {
vulnerabilityId: { vulnerabilityId: {
...@@ -261,7 +264,7 @@ export default { ...@@ -261,7 +264,7 @@ export default {
<template #headerText> <template #headerText>
{{ $options.i18n.relatedIssues }} {{ $options.i18n.relatedIssues }}
</template> </template>
<template v-if="!isIssueAlreadyCreated && !isFetching && createIssueUrl" #headerActions> <template v-if="canCreateIssue" #headerActions>
<gl-button <gl-button
ref="createIssue" ref="createIssue"
variant="success" variant="success"
......
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