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