Commit 540088f7 authored by Juan J. Ramirez's avatar Juan J. Ramirez Committed by Miguel Rincon

Replacing button with GitLab UI

Import fixes and linting
parent 9a1a4e25
---
title: Replacing View Full Report button with GitLab UI
merge_request: 37236
author:
type: changed
...@@ -7,12 +7,11 @@ import ReportSection from '~/reports/components/report_section.vue'; ...@@ -7,12 +7,11 @@ import ReportSection from '~/reports/components/report_section.vue';
import SummaryRow from '~/reports/components/summary_row.vue'; import SummaryRow from '~/reports/components/summary_row.vue';
import Tracking from '~/tracking'; import Tracking from '~/tracking';
import GroupedIssuesList from '~/reports/components/grouped_issues_list.vue'; import GroupedIssuesList from '~/reports/components/grouped_issues_list.vue';
import Icon from '~/vue_shared/components/icon.vue';
import IssueModal from './components/modal.vue'; import IssueModal from './components/modal.vue';
import DastModal from './components/dast_modal.vue'; import DastModal from './components/dast_modal.vue';
import securityReportsMixin from './mixins/security_report_mixin'; import securityReportsMixin from './mixins/security_report_mixin';
import createStore from './store'; import createStore from './store';
import { GlSprintf, GlLink, GlModalDirective } from '@gitlab/ui'; import { GlButton, GlSprintf, GlLink, GlModalDirective } from '@gitlab/ui';
import { mrStates } from '~/mr_popover/constants'; import { mrStates } from '~/mr_popover/constants';
import { trackMrSecurityReportDetails } from 'ee/vue_shared/security_reports/store/constants'; import { trackMrSecurityReportDetails } from 'ee/vue_shared/security_reports/store/constants';
import { fetchPolicies } from '~/lib/graphql'; import { fetchPolicies } from '~/lib/graphql';
...@@ -27,10 +26,10 @@ export default { ...@@ -27,10 +26,10 @@ export default {
SummaryRow, SummaryRow,
SecuritySummary, SecuritySummary,
IssueModal, IssueModal,
Icon,
GlSprintf, GlSprintf,
GlLink, GlLink,
DastModal, DastModal,
GlButton,
}, },
directives: { directives: {
'gl-modal': GlModalDirective, 'gl-modal': GlModalDirective,
...@@ -368,12 +367,14 @@ export default { ...@@ -368,12 +367,14 @@ export default {
</template> </template>
<template v-if="pipelinePath" #actionButtons> <template v-if="pipelinePath" #actionButtons>
<div> <gl-button
<a :href="securityTab" target="_blank" class="btn btn-default btn-sm float-right gl-mr-3"> :href="securityTab"
<span>{{ s__('ciReport|View full report') }}</span> target="_blank"
<icon :size="16" name="external-link" /> icon="external-link"
</a> class="gl-mr-3 report-btn"
</div> >
{{ s__('ciReport|View full report') }}
</gl-button>
</template> </template>
<template v-if="isMRActive && isBaseSecurityReportOutOfDate" #subHeading> <template v-if="isMRActive && isBaseSecurityReportOutOfDate" #subHeading>
......
...@@ -355,7 +355,14 @@ describe('Grouped security reports app', () => { ...@@ -355,7 +355,14 @@ describe('Grouped security reports app', () => {
}); });
it('should calculate the security tab path', () => { it('should calculate the security tab path', () => {
expect(wrapper.vm.securityTab).toEqual(`${pipelinePath}/security`); const button = wrapper.find('.report-btn');
expect(button.attributes('target')).toBe('_blank');
expect(button.attributes('href')).toBe(`${pipelinePath}/security`);
});
it('should render view full report button', () => {
const button = wrapper.find('.report-btn');
expect(button.exists()).toBe(true);
}); });
}); });
......
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