Commit ec0fc9cf authored by Mark Florian's avatar Mark Florian

Merge branch '320953-follow-up-from-create-jira-issue-button' into 'master'

Use v-bind instead of individual props

See merge request gitlab-org/gitlab!57708
parents 92ec12f0 43998b98
<script> <script>
import { GlButton, GlIcon } from '@gitlab/ui'; import { GlButton } from '@gitlab/ui';
import DismissButton from 'ee/vue_shared/security_reports/components/dismiss_button.vue'; import DismissButton from 'ee/vue_shared/security_reports/components/dismiss_button.vue';
import SplitButton from 'ee/vue_shared/security_reports/components/split_button.vue'; import SplitButton from 'ee/vue_shared/security_reports/components/split_button.vue';
import { s__ } from '~/locale'; import { s__ } from '~/locale';
...@@ -9,7 +9,6 @@ export default { ...@@ -9,7 +9,6 @@ export default {
DismissButton, DismissButton,
GlButton, GlButton,
SplitButton, SplitButton,
GlIcon,
}, },
props: { props: {
modal: { modal: {
...@@ -75,15 +74,16 @@ export default { ...@@ -75,15 +74,16 @@ export default {
const issueButton = { const issueButton = {
name: this.createIssueButtonText, name: this.createIssueButtonText,
tagline: s__('ciReport|Investigate this vulnerability by creating an issue'), tagline: s__('ciReport|Investigate this vulnerability by creating an issue'),
isLoading: this.isCreatingIssue, icon: this.vulnerability.create_jira_issue_url ? 'external-link' : undefined,
loading: this.isCreatingIssue,
target: this.vulnerability.create_jira_issue_url ? '_blank' : undefined,
action: this.vulnerability.create_jira_issue_url ? undefined : 'createNewIssue', action: this.vulnerability.create_jira_issue_url ? undefined : 'createNewIssue',
href: this.vulnerability.create_jira_issue_url, href: this.vulnerability.create_jira_issue_url,
icon: this.vulnerability.create_jira_issue_url ? 'external-link' : undefined,
}; };
const MRButton = { const MRButton = {
name: s__('ciReport|Resolve with merge request'), name: s__('ciReport|Resolve with merge request'),
tagline: s__('ciReport|Automatically apply the patch in a new branch'), tagline: s__('ciReport|Automatically apply the patch in a new branch'),
isLoading: this.isCreatingMergeRequest, loading: this.isCreatingMergeRequest,
action: 'createMergeRequest', action: 'createMergeRequest',
}; };
const DownloadButton = { const DownloadButton = {
...@@ -139,21 +139,14 @@ export default { ...@@ -139,21 +139,14 @@ export default {
<gl-button <gl-button
v-else-if="actionButtons.length > 0" v-else-if="actionButtons.length > 0"
:loading="actionButtons[0].isLoading" v-bind="actionButtons[0]"
:disabled="disabled" :disabled="disabled"
variant="success" variant="success"
category="secondary" category="secondary"
data-testid="create-issue-button" data-testid="create-issue-button"
data-qa-selector="create_issue_button" data-qa-selector="create_issue_button"
:target="actionButtons[0].href ? '_blank' : undefined"
:href="actionButtons[0].href"
@click="$emit(actionButtons[0].action)" @click="$emit(actionButtons[0].action)"
> >
<gl-icon
v-if="actionButtons[0].icon"
:name="actionButtons[0].icon"
class="gl-vertical-align-middle"
/>
{{ __(actionButtons[0].name) }} {{ __(actionButtons[0].name) }}
</gl-button> </gl-button>
</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