Commit 66e586b1 authored by Jacques Erasmus's avatar Jacques Erasmus

Merge branch '293648-clarify-crossed-out-vulnerabilities-in-security-mr-widget' into 'master'

Remove strike-through and add badge to dismissed vulnerabilities

See merge request gitlab-org/gitlab!69943
parents 210167ef acc26917
...@@ -53,11 +53,7 @@ export default { ...@@ -53,11 +53,7 @@ export default {
}; };
</script> </script>
<template> <template>
<li <li class="report-block-list-issue align-items-center" data-qa-selector="report_item_row">
:class="{ 'is-dismissed': issue.isDismissed }"
class="report-block-list-issue align-items-center"
data-qa-selector="report_item_row"
>
<component <component
:is="iconComponent" :is="iconComponent"
v-if="showReportSectionStatusIcon" v-if="showReportSectionStatusIcon"
......
...@@ -49,11 +49,6 @@ ...@@ -49,11 +49,6 @@
display: flex; display: flex;
} }
.is-dismissed .report-block-list-issue-description,
.is-dismissed .vulnerability-name-button {
text-decoration: line-through;
}
.report-block-list-issue-description-text::after { .report-block-list-issue-description-text::after {
content: '\00a0'; content: '\00a0';
} }
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
* Scanning, Secret Scanning) body text * Scanning, Secret Scanning) body text
* [severity-badge] [name] in [link]:[line] * [severity-badge] [name] in [link]:[line]
*/ */
import { GlBadge } from '@gitlab/ui';
import ModalOpenName from 'ee/reports/components/modal_open_name.vue'; import ModalOpenName from 'ee/reports/components/modal_open_name.vue';
import ReportLink from '~/reports/components/report_link.vue'; import ReportLink from '~/reports/components/report_link.vue';
import SeverityBadge from './severity_badge.vue'; import SeverityBadge from './severity_badge.vue';
...@@ -11,6 +12,7 @@ import SeverityBadge from './severity_badge.vue'; ...@@ -11,6 +12,7 @@ import SeverityBadge from './severity_badge.vue';
export default { export default {
name: 'SecurityIssueBody', name: 'SecurityIssueBody',
components: { components: {
GlBadge,
ReportLink, ReportLink,
ModalOpenName, ModalOpenName,
SeverityBadge, SeverityBadge,
...@@ -38,10 +40,13 @@ export default { ...@@ -38,10 +40,13 @@ export default {
<div class="report-block-list-issue-description-text gl-display-flex gl-w-full"> <div class="report-block-list-issue-description-text gl-display-flex gl-w-full">
<severity-badge <severity-badge
v-if="issue.severity" v-if="issue.severity"
class="d-inline-block gl-mr-1" class="gl-display-inline-flex gl-align-items-center gl-mr-1"
:severity="issue.severity" :severity="issue.severity"
/> />
<modal-open-name :issue="issue" :status="status" /> <modal-open-name :issue="issue" :status="status" />
<gl-badge v-if="issue.isDismissed" class="gl-ml-3" data-testid="dismissed-badge">
{{ __('Dismissed') }}
</gl-badge>
</div> </div>
<report-link v-if="showReportLink && issue.path" :issue="issue" /> <report-link v-if="showReportLink && issue.path" :issue="issue" />
</div> </div>
......
...@@ -7,6 +7,7 @@ import { ...@@ -7,6 +7,7 @@ import {
} from 'ee/security_dashboard/store/modules/vulnerabilities/constants'; } from 'ee/security_dashboard/store/modules/vulnerabilities/constants';
import SecurityIssueBody from 'ee/vue_shared/security_reports/components/security_issue_body.vue'; import SecurityIssueBody from 'ee/vue_shared/security_reports/components/security_issue_body.vue';
import SeverityBadge from 'ee/vue_shared/security_reports/components/severity_badge.vue'; import SeverityBadge from 'ee/vue_shared/security_reports/components/severity_badge.vue';
import { extendedWrapper } from 'helpers/vue_test_utils_helper';
import ReportLink from '~/reports/components/report_link.vue'; import ReportLink from '~/reports/components/report_link.vue';
import { STATUS_FAILED } from '~/reports/constants'; import { STATUS_FAILED } from '~/reports/constants';
import { import {
...@@ -23,12 +24,14 @@ describe('Security Issue Body', () => { ...@@ -23,12 +24,14 @@ describe('Security Issue Body', () => {
const findReportLink = () => wrapper.find(ReportLink); const findReportLink = () => wrapper.find(ReportLink);
const createComponent = (issue) => { const createComponent = (issue) => {
wrapper = shallowMount(SecurityIssueBody, { wrapper = extendedWrapper(
propsData: { shallowMount(SecurityIssueBody, {
issue, propsData: {
status: STATUS_FAILED, issue,
}, status: STATUS_FAILED,
}); },
}),
);
}; };
afterEach(() => { afterEach(() => {
...@@ -60,5 +63,14 @@ describe('Security Issue Body', () => { ...@@ -60,5 +63,14 @@ describe('Security Issue Body', () => {
it(`does ${hasReportLink ? '' : 'not '}render report link`, () => { it(`does ${hasReportLink ? '' : 'not '}render report link`, () => {
expect(findReportLink().exists()).toBe(hasReportLink); expect(findReportLink().exists()).toBe(hasReportLink);
}); });
it.each([true, false])(
`shows a "dismissed" info correctly when the vulnerability's "isDismissed" property is set to "%s`,
(isDismissed) => {
createComponent({ ...vuln, isDismissed });
expect(wrapper.findByTestId('dismissed-badge').exists()).toBe(isDismissed);
},
);
}); });
}); });
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