Commit ea2709d5 authored by Clement Ho's avatar Clement Ho

Merge branch '8483-add-dast-to-report-type-filter' into 'master'

Add DAST as filter option in the Group Security Dashboard

Closes #8483

See merge request gitlab-org/gitlab-ee!10271
parents cd285362 bcd70e13
......@@ -92,7 +92,7 @@ export default {
<template>
<div>
<filters :dashboard-documentation="dashboardDocumentation" />
<filters />
<vulnerability-count-list />
<vulnerability-chart />
......
......@@ -2,13 +2,11 @@
import { mapGetters, mapActions } from 'vuex';
import { GlDropdown, GlDropdownItem } from '@gitlab/ui';
import Icon from '~/vue_shared/components/icon.vue';
import ReportTypePopover from './report_type_popover.vue';
export default {
components: {
GlDropdown,
GlDropdownItem,
ReportTypePopover,
Icon,
},
props: {
......@@ -16,10 +14,6 @@ export default {
type: String,
required: true,
},
dashboardDocumentation: {
type: String,
required: true,
},
},
computed: {
...mapGetters('filters', ['getFilter', 'getSelectedOptions', 'getSelectedOptionNames']),
......@@ -51,10 +45,6 @@ export default {
<template>
<div class="dashboard-filter">
<strong class="js-name">{{ filter.name }}</strong>
<report-type-popover
v-if="filterId === 'report_type'"
:dashboard-documentation="dashboardDocumentation"
/>
<gl-dropdown class="d-block mt-1">
<template slot="button-content">
<span class="text-truncate">
......
......@@ -6,12 +6,6 @@ export default {
components: {
DashboardFilter,
},
props: {
dashboardDocumentation: {
type: String,
required: true,
},
},
computed: {
...mapState('filters', ['filters']),
},
......@@ -26,7 +20,6 @@ export default {
:key="filter.id"
class="col-sm-6 col-md-4 col-lg-2 p-2 js-filter"
:filter-id="filter.id"
:dashboard-documentation="dashboardDocumentation"
/>
</div>
</div>
......
<script>
import { GlPopover } from '@gitlab/ui';
import { s__ } from '~/locale';
import Icon from '~/vue_shared/components/icon.vue';
export default {
components: {
GlPopover,
Icon,
},
props: {
dashboardDocumentation: {
type: String,
required: true,
},
},
linkTitle: s__('Security Reports|Security dashboard documentation'),
};
</script>
<template>
<span class="vertical-align-middle text-muted js-help">
<icon id="reports-info" name="question" :aria-label="__('help')" />
<gl-popover
target="reports-info"
placement="right"
triggers="click"
:title="
s__(
'Security Reports|At this time, the security dashboard only supports SAST and dependency scanning.',
)
"
>
<a
v-if="dashboardDocumentation"
target="_blank"
rel="noopener noreferrer"
:title="$options.linkTitle"
:href="dashboardDocumentation"
>
<span class="vertical-align-middle">{{ $options.linkTitle }}</span>
<icon name="external-link" :size="16" class="vertical-align-middle" />
</a>
</gl-popover>
</span>
</template>
......@@ -23,6 +23,7 @@ export const CONFIDENCE_LEVELS = {
export const REPORT_TYPES = {
container_scanning: s__('ciReport|Container Scanning'),
dast: s__('ciReport|DAST'),
dependency_scanning: s__('ciReport|Dependency Scanning'),
sast: s__('ciReport|SAST'),
};
---
title: Show DAST vulnerabilities in the Group Security Dashboard.
merge_request: 10271
author:
type: added
......@@ -11,7 +11,7 @@ describe('Filter component', () => {
describe('severity', () => {
beforeEach(() => {
props = { filterId: 'severity', dashboardDocumentation: '' };
props = { filterId: 'severity' };
vm = mountComponentWithStore(Component, { store, props });
});
......@@ -30,20 +30,5 @@ describe('Filter component', () => {
it('should display "Severity" as the option name', () => {
expect(vm.$el.querySelector('.js-name').textContent).toContain('Severity');
});
it('should not display the help popover', () => {
expect(vm.$el.querySelector('.js-help')).toBeNull();
});
});
describe('Report type', () => {
beforeEach(() => {
props = { filterId: 'report_type', dashboardDocumentation: '' };
vm = mountComponentWithStore(Component, { store, props });
});
it('should display the help popover', () => {
expect(vm.$el.querySelector('.js-help')).not.toBeNull();
});
});
});
......@@ -5,13 +5,12 @@ import { mountComponentWithStore } from 'spec/helpers/vue_mount_component_helper
describe('Filter component', () => {
let vm;
const props = { dashboardDocumentation: '' };
const store = createStore();
const Component = Vue.extend(component);
describe('severity', () => {
beforeEach(() => {
vm = mountComponentWithStore(Component, { store, props });
vm = mountComponentWithStore(Component, { store });
});
afterEach(() => {
......
......@@ -9206,9 +9206,6 @@ msgstr ""
msgid "Security Dashboard|Issue Created"
msgstr ""
msgid "Security Reports|At this time, the security dashboard only supports SAST and dependency scanning."
msgstr ""
msgid "Security Reports|Create issue"
msgstr ""
......@@ -9224,9 +9221,6 @@ msgstr ""
msgid "Security Reports|No Vulnerabilities"
msgstr ""
msgid "Security Reports|Security dashboard documentation"
msgstr ""
msgid "Security Reports|There was an error creating the issue."
msgstr ""
......@@ -12665,9 +12659,6 @@ msgstr ""
msgid "group"
msgstr ""
msgid "help"
msgstr ""
msgid "here"
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