Commit 5d3fe210 authored by Andrew Fontaine's avatar Andrew Fontaine

Merge branch '338217-dast-security-tab' into 'master'

Change DAST url download text to button

See merge request gitlab-org/gitlab!70280
parents ad203a8f a5494666
...@@ -6,7 +6,6 @@ import { ...@@ -6,7 +6,6 @@ import {
GlCollapseToggleDirective, GlCollapseToggleDirective,
GlSprintf, GlSprintf,
GlModalDirective, GlModalDirective,
GlLink,
} from '@gitlab/ui'; } from '@gitlab/ui';
import { COLLAPSE_SECURITY_REPORTS_SUMMARY_LOCAL_STORAGE_KEY as LOCAL_STORAGE_KEY } from 'ee/security_dashboard/constants'; import { COLLAPSE_SECURITY_REPORTS_SUMMARY_LOCAL_STORAGE_KEY as LOCAL_STORAGE_KEY } from 'ee/security_dashboard/constants';
import { getFormattedSummary } from 'ee/security_dashboard/helpers'; import { getFormattedSummary } from 'ee/security_dashboard/helpers';
...@@ -25,7 +24,6 @@ export default { ...@@ -25,7 +24,6 @@ export default {
GlCollapse, GlCollapse,
GlSprintf, GlSprintf,
Modal, Modal,
GlLink,
SecurityReportDownloadDropdown, SecurityReportDownloadDropdown,
}, },
directives: { directives: {
...@@ -118,18 +116,17 @@ export default { ...@@ -118,18 +116,17 @@ export default {
n__('%d vulnerability', '%d vulnerabilities', scanSummary.vulnerabilitiesCount) n__('%d vulnerability', '%d vulnerabilities', scanSummary.vulnerabilitiesCount)
" "
/> />
</div>
<div class="col-4">
<template v-if="scanSummary.scannedResourcesCount !== undefined"> <template v-if="scanSummary.scannedResourcesCount !== undefined">
<gl-button <gl-button
v-if="hasScannedResources(scanSummary)" v-if="hasScannedResources(scanSummary)"
v-gl-modal.dastUrl v-gl-modal.dastUrl
variant="link" icon="download"
size="small"
data-testid="modal-button" data-testid="modal-button"
> >
(<gl-sprintf {{ s__('SecurityReports|Download scanned URLs') }}
:message="
n__('%d URL scanned', '%d URLs scanned', scanSummary.scannedResourcesCount)
"
/>)
</gl-button> </gl-button>
<template v-else> <template v-else>
...@@ -147,19 +144,21 @@ export default { ...@@ -147,19 +144,21 @@ export default {
:download-link="downloadLink(scanSummary)" :download-link="downloadLink(scanSummary)"
/> />
</template> </template>
<template v-else-if="scanSummary.scannedResourcesCsvPath"> <template v-else-if="scanSummary.scannedResourcesCsvPath">
<gl-link <gl-button
download icon="download"
size="small"
:href="downloadLink(scanSummary)" :href="downloadLink(scanSummary)"
class="gl-ml-1" class="gl-ml-1"
data-testid="download-link" data-testid="download-link"
> >
({{ s__('SecurityReports|Download scanned resources') }}) {{ s__('SecurityReports|Download scanned URLs') }}
</gl-link> </gl-button>
</template> </template>
</div>
<div class="col-4">
<security-report-download-dropdown <security-report-download-dropdown
v-else
:text="s__('SecurityReports|Download results')" :text="s__('SecurityReports|Download results')"
:artifacts="findArtifacts(scanType)" :artifacts="findArtifacts(scanType)"
/> />
......
...@@ -224,11 +224,9 @@ describe('Security reports summary component', () => { ...@@ -224,11 +224,9 @@ describe('Security reports summary component', () => {
expect(modal.attributes('modalid')).toBe('dastUrl'); expect(modal.attributes('modalid')).toBe('dastUrl');
}); });
it('should contain a link with Scanned URLs count', () => { it('should contain a button with Scanned URLs', () => {
expect(findModalButton().exists()).toBe(true); expect(findModalButton().exists()).toBe(true);
expect(findModalButton().text()).toContain( expect(findModalButton().text()).toContain('Download scanned URLs');
`(${dastProps.scannedResourcesCount} URLs scanned)`,
);
}); });
it('should link it to the given modal', () => { it('should link it to the given modal', () => {
......
...@@ -30085,6 +30085,9 @@ msgstr "" ...@@ -30085,6 +30085,9 @@ msgstr ""
msgid "SecurityReports|Download results" msgid "SecurityReports|Download results"
msgstr "" msgstr ""
msgid "SecurityReports|Download scanned URLs"
msgstr ""
msgid "SecurityReports|Download scanned resources" msgid "SecurityReports|Download scanned resources"
msgstr "" msgstr ""
......
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