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 { ...@@ -92,7 +92,7 @@ export default {
<template> <template>
<div> <div>
<filters :dashboard-documentation="dashboardDocumentation" /> <filters />
<vulnerability-count-list /> <vulnerability-count-list />
<vulnerability-chart /> <vulnerability-chart />
......
...@@ -2,13 +2,11 @@ ...@@ -2,13 +2,11 @@
import { mapGetters, mapActions } from 'vuex'; import { mapGetters, mapActions } from 'vuex';
import { GlDropdown, GlDropdownItem } from '@gitlab/ui'; import { GlDropdown, GlDropdownItem } from '@gitlab/ui';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
import ReportTypePopover from './report_type_popover.vue';
export default { export default {
components: { components: {
GlDropdown, GlDropdown,
GlDropdownItem, GlDropdownItem,
ReportTypePopover,
Icon, Icon,
}, },
props: { props: {
...@@ -16,10 +14,6 @@ export default { ...@@ -16,10 +14,6 @@ export default {
type: String, type: String,
required: true, required: true,
}, },
dashboardDocumentation: {
type: String,
required: true,
},
}, },
computed: { computed: {
...mapGetters('filters', ['getFilter', 'getSelectedOptions', 'getSelectedOptionNames']), ...mapGetters('filters', ['getFilter', 'getSelectedOptions', 'getSelectedOptionNames']),
...@@ -51,10 +45,6 @@ export default { ...@@ -51,10 +45,6 @@ export default {
<template> <template>
<div class="dashboard-filter"> <div class="dashboard-filter">
<strong class="js-name">{{ filter.name }}</strong> <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"> <gl-dropdown class="d-block mt-1">
<template slot="button-content"> <template slot="button-content">
<span class="text-truncate"> <span class="text-truncate">
......
...@@ -6,12 +6,6 @@ export default { ...@@ -6,12 +6,6 @@ export default {
components: { components: {
DashboardFilter, DashboardFilter,
}, },
props: {
dashboardDocumentation: {
type: String,
required: true,
},
},
computed: { computed: {
...mapState('filters', ['filters']), ...mapState('filters', ['filters']),
}, },
...@@ -26,7 +20,6 @@ export default { ...@@ -26,7 +20,6 @@ export default {
:key="filter.id" :key="filter.id"
class="col-sm-6 col-md-4 col-lg-2 p-2 js-filter" class="col-sm-6 col-md-4 col-lg-2 p-2 js-filter"
:filter-id="filter.id" :filter-id="filter.id"
:dashboard-documentation="dashboardDocumentation"
/> />
</div> </div>
</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 = { ...@@ -23,6 +23,7 @@ export const CONFIDENCE_LEVELS = {
export const REPORT_TYPES = { export const REPORT_TYPES = {
container_scanning: s__('ciReport|Container Scanning'), container_scanning: s__('ciReport|Container Scanning'),
dast: s__('ciReport|DAST'),
dependency_scanning: s__('ciReport|Dependency Scanning'), dependency_scanning: s__('ciReport|Dependency Scanning'),
sast: s__('ciReport|SAST'), 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', () => { ...@@ -11,7 +11,7 @@ describe('Filter component', () => {
describe('severity', () => { describe('severity', () => {
beforeEach(() => { beforeEach(() => {
props = { filterId: 'severity', dashboardDocumentation: '' }; props = { filterId: 'severity' };
vm = mountComponentWithStore(Component, { store, props }); vm = mountComponentWithStore(Component, { store, props });
}); });
...@@ -30,20 +30,5 @@ describe('Filter component', () => { ...@@ -30,20 +30,5 @@ describe('Filter component', () => {
it('should display "Severity" as the option name', () => { it('should display "Severity" as the option name', () => {
expect(vm.$el.querySelector('.js-name').textContent).toContain('Severity'); 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 ...@@ -5,13 +5,12 @@ import { mountComponentWithStore } from 'spec/helpers/vue_mount_component_helper
describe('Filter component', () => { describe('Filter component', () => {
let vm; let vm;
const props = { dashboardDocumentation: '' };
const store = createStore(); const store = createStore();
const Component = Vue.extend(component); const Component = Vue.extend(component);
describe('severity', () => { describe('severity', () => {
beforeEach(() => { beforeEach(() => {
vm = mountComponentWithStore(Component, { store, props }); vm = mountComponentWithStore(Component, { store });
}); });
afterEach(() => { afterEach(() => {
......
...@@ -9206,9 +9206,6 @@ msgstr "" ...@@ -9206,9 +9206,6 @@ msgstr ""
msgid "Security Dashboard|Issue Created" msgid "Security Dashboard|Issue Created"
msgstr "" msgstr ""
msgid "Security Reports|At this time, the security dashboard only supports SAST and dependency scanning."
msgstr ""
msgid "Security Reports|Create issue" msgid "Security Reports|Create issue"
msgstr "" msgstr ""
...@@ -9224,9 +9221,6 @@ msgstr "" ...@@ -9224,9 +9221,6 @@ msgstr ""
msgid "Security Reports|No Vulnerabilities" msgid "Security Reports|No Vulnerabilities"
msgstr "" msgstr ""
msgid "Security Reports|Security dashboard documentation"
msgstr ""
msgid "Security Reports|There was an error creating the issue." msgid "Security Reports|There was an error creating the issue."
msgstr "" msgstr ""
...@@ -12665,9 +12659,6 @@ msgstr "" ...@@ -12665,9 +12659,6 @@ msgstr ""
msgid "group" msgid "group"
msgstr "" msgstr ""
msgid "help"
msgstr ""
msgid "here" msgid "here"
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