Commit 098fbac7 authored by Savas Vedova's avatar Savas Vedova

Add external link to create jira issue button

- Add changelog
parent 7c9add3b
<script> <script>
import { GlButton } from '@gitlab/ui'; import { GlButton, GlIcon } 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,6 +9,7 @@ export default { ...@@ -9,6 +9,7 @@ export default {
DismissButton, DismissButton,
GlButton, GlButton,
SplitButton, SplitButton,
GlIcon,
}, },
props: { props: {
modal: { modal: {
...@@ -77,6 +78,7 @@ export default { ...@@ -77,6 +78,7 @@ export default {
isLoading: this.isCreatingIssue, isLoading: this.isCreatingIssue,
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'),
...@@ -147,6 +149,11 @@ export default { ...@@ -147,6 +149,11 @@ export default {
:href="actionButtons[0].href" :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>
......
---
title: Add external link to create jira issue button
merge_request: 54310
author:
type: changed
import { GlIcon } from '@gitlab/ui';
import { mount } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
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 component from 'ee/vue_shared/security_reports/components/modal_footer.vue'; import component from 'ee/vue_shared/security_reports/components/modal_footer.vue';
...@@ -74,6 +75,10 @@ describe('Security Reports modal footer', () => { ...@@ -74,6 +75,10 @@ describe('Security Reports modal footer', () => {
it('has the correct text', () => { it('has the correct text', () => {
expect(findActionButton().text()).toBe('Create Jira issue'); expect(findActionButton().text()).toBe('Create Jira issue');
}); });
it('has the external-link icon', () => {
expect(findActionButton().find(GlIcon).props('name')).toBe('external-link');
});
}); });
describe('can only create merge request', () => { describe('can only create merge request', () => {
......
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