Commit 5003b5eb authored by Phil Hughes's avatar Phil Hughes

Merge branch '212444-decouple-security-dashboard' into 'master'

Use the new Security Dashboard Layout

See merge request gitlab-org/gitlab!28106
parents fdab3c52 88bf6acb
<script> <script>
import { mapActions } from 'vuex'; import { mapActions } from 'vuex';
import { GlEmptyState } from '@gitlab/ui'; import { GlEmptyState } from '@gitlab/ui';
import SecurityDashboard from './security_dashboard.vue'; import SecurityDashboard from './security_dashboard_vuex.vue';
export default { export default {
name: 'GroupSecurityDashboard', name: 'GroupSecurityDashboard',
......
...@@ -3,7 +3,7 @@ import { mapActions, mapState } from 'vuex'; ...@@ -3,7 +3,7 @@ import { mapActions, mapState } from 'vuex';
import { GlButton, GlEmptyState, GlLink, GlLoadingIcon } from '@gitlab/ui'; import { GlButton, GlEmptyState, GlLink, GlLoadingIcon } from '@gitlab/ui';
import { s__ } from '~/locale'; import { s__ } from '~/locale';
import ProjectManager from './project_manager.vue'; import ProjectManager from './project_manager.vue';
import SecurityDashboard from './security_dashboard.vue'; import SecurityDashboard from './security_dashboard_vuex.vue';
export default { export default {
name: 'InstanceSecurityDashboard', name: 'InstanceSecurityDashboard',
......
<script> <script>
import { mapActions } from 'vuex'; import { mapActions } from 'vuex';
import { GlEmptyState } from '@gitlab/ui'; import { GlEmptyState } from '@gitlab/ui';
import SecurityDashboard from './security_dashboard.vue'; import SecurityDashboard from './security_dashboard_vuex.vue';
export default { export default {
name: 'PipelineSecurityDashboard', name: 'PipelineSecurityDashboard',
......
...@@ -5,7 +5,7 @@ import { s__ } from '~/locale'; ...@@ -5,7 +5,7 @@ import { s__ } from '~/locale';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
import UserAvatarLink from '~/vue_shared/components/user_avatar/user_avatar_link.vue'; import UserAvatarLink from '~/vue_shared/components/user_avatar/user_avatar_link.vue';
import TimeagoTooltip from '~/vue_shared/components/time_ago_tooltip.vue'; import TimeagoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
import SecurityDashboard from './security_dashboard.vue'; import SecurityDashboard from './security_dashboard_vuex.vue';
export default { export default {
name: 'ProjectSecurityDashboard', name: 'ProjectSecurityDashboard',
......
...@@ -3,6 +3,7 @@ import { isUndefined } from 'lodash'; ...@@ -3,6 +3,7 @@ import { isUndefined } from 'lodash';
import { mapActions, mapState, mapGetters } from 'vuex'; import { mapActions, mapState, mapGetters } from 'vuex';
import IssueModal from 'ee/vue_shared/security_reports/components/modal.vue'; import IssueModal from 'ee/vue_shared/security_reports/components/modal.vue';
import Filters from './filters.vue'; import Filters from './filters.vue';
import SecurityDashboardLayout from './security_dashboard_layout.vue';
import SecurityDashboardTable from './security_dashboard_table.vue'; import SecurityDashboardTable from './security_dashboard_table.vue';
import VulnerabilityChart from './vulnerability_chart.vue'; import VulnerabilityChart from './vulnerability_chart.vue';
import VulnerabilityCountList from './vulnerability_count_list.vue'; import VulnerabilityCountList from './vulnerability_count_list.vue';
...@@ -10,10 +11,10 @@ import VulnerabilitySeverity from './vulnerability_severity.vue'; ...@@ -10,10 +11,10 @@ import VulnerabilitySeverity from './vulnerability_severity.vue';
import LoadingError from './loading_error.vue'; import LoadingError from './loading_error.vue';
export default { export default {
name: 'SecurityDashboard',
components: { components: {
Filters, Filters,
IssueModal, IssueModal,
SecurityDashboardLayout,
SecurityDashboardTable, SecurityDashboardTable,
VulnerabilityChart, VulnerabilityChart,
VulnerabilityCountList, VulnerabilityCountList,
...@@ -159,29 +160,26 @@ export default { ...@@ -159,29 +160,26 @@ export default {
:illustrations="loadingErrorIllustrations" :illustrations="loadingErrorIllustrations"
/> />
<template v-else> <template v-else>
<security-dashboard-layout>
<template #header>
<vulnerability-count-list v-if="shouldShowCountList" /> <vulnerability-count-list v-if="shouldShowCountList" />
<header>
<filters /> <filters />
</header> </template>
<div class="row mt-4">
<article class="col" :class="{ 'col-xl-7': !isLockedToProject }">
<security-dashboard-table> <security-dashboard-table>
<template #emptyState> <template #emptyState>
<slot name="emptyState"></slot> <slot name="emptyState"></slot>
</template> </template>
</security-dashboard-table> </security-dashboard-table>
</article>
<aside v-if="shouldShowAside" class="col-xl-5"> <template v-if="shouldShowAside" #aside>
<vulnerability-chart v-if="shouldShowChart" class="mb-3" /> <vulnerability-chart v-if="shouldShowChart" class="mb-3" />
<vulnerability-severity <vulnerability-severity
v-if="shouldShowVulnerabilitySeverities" v-if="shouldShowVulnerabilitySeverities"
:endpoint="vulnerableProjectsEndpoint" :endpoint="vulnerableProjectsEndpoint"
/> />
</aside> </template>
</div> </security-dashboard-layout>
<issue-modal <issue-modal
:modal="modal" :modal="modal"
......
...@@ -2,7 +2,7 @@ import Vuex from 'vuex'; ...@@ -2,7 +2,7 @@ import Vuex from 'vuex';
import { GlEmptyState } from '@gitlab/ui'; import { GlEmptyState } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount, createLocalVue } from '@vue/test-utils';
import GroupSecurityDashboard from 'ee/security_dashboard/components/group_security_dashboard.vue'; import GroupSecurityDashboard from 'ee/security_dashboard/components/group_security_dashboard.vue';
import SecurityDashboard from 'ee/security_dashboard/components/security_dashboard.vue'; import SecurityDashboard from 'ee/security_dashboard/components/security_dashboard_vuex.vue';
const localVue = createLocalVue(); const localVue = createLocalVue();
localVue.use(Vuex); localVue.use(Vuex);
......
...@@ -2,7 +2,7 @@ import Vuex from 'vuex'; ...@@ -2,7 +2,7 @@ import Vuex from 'vuex';
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount, createLocalVue } from '@vue/test-utils';
import { GlEmptyState, GlLoadingIcon } from '@gitlab/ui'; import { GlEmptyState, GlLoadingIcon } from '@gitlab/ui';
import InstanceSecurityDashboard from 'ee/security_dashboard/components/instance_security_dashboard.vue'; import InstanceSecurityDashboard from 'ee/security_dashboard/components/instance_security_dashboard.vue';
import SecurityDashboard from 'ee/security_dashboard/components/security_dashboard.vue'; import SecurityDashboard from 'ee/security_dashboard/components/security_dashboard_vuex.vue';
import ProjectManager from 'ee/security_dashboard/components/project_manager.vue'; import ProjectManager from 'ee/security_dashboard/components/project_manager.vue';
const localVue = createLocalVue(); const localVue = createLocalVue();
......
...@@ -2,7 +2,7 @@ import Vuex from 'vuex'; ...@@ -2,7 +2,7 @@ import Vuex from 'vuex';
import { GlEmptyState } from '@gitlab/ui'; import { GlEmptyState } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount, createLocalVue } from '@vue/test-utils';
import PipelineSecurityDashboard from 'ee/security_dashboard/components/pipeline_security_dashboard.vue'; import PipelineSecurityDashboard from 'ee/security_dashboard/components/pipeline_security_dashboard.vue';
import SecurityDashboard from 'ee/security_dashboard/components/security_dashboard.vue'; import SecurityDashboard from 'ee/security_dashboard/components/security_dashboard_vuex.vue';
const localVue = createLocalVue(); const localVue = createLocalVue();
localVue.use(Vuex); localVue.use(Vuex);
......
...@@ -2,9 +2,10 @@ import { shallowMount } from '@vue/test-utils'; ...@@ -2,9 +2,10 @@ import { shallowMount } from '@vue/test-utils';
import MockAdapter from 'axios-mock-adapter'; import MockAdapter from 'axios-mock-adapter';
import { TEST_HOST } from 'helpers/test_constants'; import { TEST_HOST } from 'helpers/test_constants';
import SecurityDashboard from 'ee/security_dashboard/components/security_dashboard.vue'; import SecurityDashboard from 'ee/security_dashboard/components/security_dashboard_vuex.vue';
import Filters from 'ee/security_dashboard/components/filters.vue'; import Filters from 'ee/security_dashboard/components/filters.vue';
import SecurityDashboardTable from 'ee/security_dashboard/components/security_dashboard_table.vue'; import SecurityDashboardTable from 'ee/security_dashboard/components/security_dashboard_table.vue';
import SecurityDashboardLayout from 'ee/security_dashboard/components/security_dashboard_layout.vue';
import VulnerabilityChart from 'ee/security_dashboard/components/vulnerability_chart.vue'; import VulnerabilityChart from 'ee/security_dashboard/components/vulnerability_chart.vue';
import VulnerabilityCountList from 'ee/security_dashboard/components/vulnerability_count_list.vue'; import VulnerabilityCountList from 'ee/security_dashboard/components/vulnerability_count_list.vue';
import VulnerabilitySeverity from 'ee/security_dashboard/components/vulnerability_severity.vue'; import VulnerabilitySeverity from 'ee/security_dashboard/components/vulnerability_severity.vue';
...@@ -41,6 +42,9 @@ describe('Security Dashboard component', () => { ...@@ -41,6 +42,9 @@ describe('Security Dashboard component', () => {
store = createStore(); store = createStore();
wrapper = shallowMount(SecurityDashboard, { wrapper = shallowMount(SecurityDashboard, {
store, store,
stubs: {
SecurityDashboardLayout,
},
methods: { methods: {
lockFilter: lockFilterSpy, lockFilter: lockFilterSpy,
setPipelineId: setPipelineIdSpy, setPipelineId: setPipelineIdSpy,
......
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