Commit 41e90a72 authored by Phil Hughes's avatar Phil Hughes

Merge branch '350903-remove-sbom-survey-banner' into 'master'

Remove "Add Sbom Survey Banner"

See merge request gitlab-org/gitlab!82068
parents b1ea491d 58743554
---
name: sbom_survey
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/76446
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/348181
milestone: '14.6'
type: development
group: group::secure
default_enabled: false
......@@ -2,7 +2,6 @@
import { GlEmptyState, GlIcon, GlLoadingIcon, GlSprintf, GlLink } from '@gitlab/ui';
import { mapActions, mapGetters, mapState } from 'vuex';
import { __ } from '~/locale';
import SbomBanner from 'ee/sbom_banner/components/app.vue';
import { DEPENDENCY_LIST_TYPES } from '../store/constants';
import { REPORT_STATUS } from '../store/modules/list/constants';
import DependenciesActions from './dependencies_actions.vue';
......@@ -19,18 +18,11 @@ export default {
GlLoadingIcon,
GlSprintf,
GlLink,
SbomBanner,
DependencyListIncompleteAlert,
DependencyListJobFailedAlert,
PaginatedDependenciesTable,
},
inject: [
'sbomSurveySvgPath',
'emptyStateSvgPath',
'documentationPath',
'endpoint',
'supportDocumentationPath',
],
inject: ['emptyStateSvgPath', 'documentationPath', 'endpoint', 'supportDocumentationPath'],
data() {
return {
isIncompleteAlertDismissed: false,
......@@ -124,7 +116,6 @@ export default {
</gl-empty-state>
<section v-else>
<sbom-banner :sbom-survey-svg-path="sbomSurveySvgPath" />
<dependency-list-incomplete-alert
v-if="isIncomplete && !isIncompleteAlertDismissed"
@dismiss="dismissIncompleteListAlert"
......
......@@ -6,7 +6,6 @@ export default () => {
const el = document.querySelector('#js-dependencies-app');
const provide = {
sbomSurveySvgPath: el.dataset.sbomSurveySvgPath,
emptyStateSvgPath: el.dataset.emptyStateSvgPath,
documentationPath: el.dataset.documentationPath,
endpoint: el.dataset.endpoint,
......
......@@ -11,7 +11,6 @@ import {
} from '@gitlab/ui';
import { mapActions, mapState, mapGetters } from 'vuex';
import LicenseManagement from 'ee/vue_shared/license_compliance/license_management.vue';
import SbomBanner from 'ee/sbom_banner/components/app.vue';
import { LICENSE_MANAGEMENT } from 'ee/vue_shared/license_compliance/store/constants';
import { getLocationHash } from '~/lib/utils/url_utility';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
......@@ -32,11 +31,10 @@ export default {
GlTabs,
GlBadge,
GlAlert,
SbomBanner,
LicenseManagement,
},
mixins: [glFeatureFlagsMixin()],
inject: ['sbomSurveySvgPath', 'emptyStateSvgPath', 'documentationPath'],
inject: ['emptyStateSvgPath', 'documentationPath'],
data() {
return {
tabIndex: this.activeTabIndex(),
......@@ -112,7 +110,7 @@ export default {
)
}}
</gl-alert>
<sbom-banner :sbom-survey-svg-path="sbomSurveySvgPath" />
<header class="my-3">
<h2 class="h4 mb-1 gl-display-flex gl-align-items-center">
{{ s__('Licenses|License Compliance') }}
......
......@@ -29,7 +29,6 @@ export default () => {
const store = createStore(storeSettings);
const provide = {
sbomSurveySvgPath: el.dataset.sbomSurveySvgPath,
emptyStateSvgPath: el.dataset.emptyStateSvgPath,
documentationPath: el.dataset.documentationPath,
};
......
<script>
import {
SBOM_BANNER_LOCAL_STORAGE_KEY,
SBOM_BANNER_CURRENT_ID,
SBOM_SURVEY_LINK,
SBOM_SURVEY_DAYS_TO_ASK_LATER,
SBOM_SURVEY_TITLE,
SBOM_SURVEY_BUTTON_TEXT,
SBOM_SURVEY_DESCRIPTION,
SBOM_SURVEY_TOAST_MESSAGE,
} from 'ee/vue_shared/constants';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import SurveyBanner from 'ee/vue_shared/survey_banner/survey_banner.vue';
export default {
name: 'SbomBanner',
components: {
SurveyBanner,
},
mixins: [glFeatureFlagsMixin()],
props: {
sbomSurveySvgPath: {
type: String,
required: true,
},
},
computed: {
shouldShowSbomSurvey() {
return this.glFeatures.sbomSurvey;
},
},
storageKey: SBOM_BANNER_LOCAL_STORAGE_KEY,
bannerId: SBOM_BANNER_CURRENT_ID,
surveyLink: SBOM_SURVEY_LINK,
daysToAskLater: SBOM_SURVEY_DAYS_TO_ASK_LATER,
title: SBOM_SURVEY_TITLE,
buttonText: SBOM_SURVEY_BUTTON_TEXT,
description: SBOM_SURVEY_DESCRIPTION,
toastMessage: SBOM_SURVEY_TOAST_MESSAGE,
};
</script>
<template>
<survey-banner
v-if="shouldShowSbomSurvey"
:svg-path="sbomSurveySvgPath"
:survey-link="$options.surveyLink"
:days-to-ask-later="$options.daysToAskLater"
:title="$options.title"
:button-text="$options.buttonText"
:description="$options.description"
:toast-message="$options.toastMessage"
:storage-key="$options.storageKey"
:banner-id="$options.bannerId"
class="gl-mt-5"
/>
</template>
......@@ -51,7 +51,7 @@ export default {
</script>
<template>
<security-dashboard-layout :show-sbom-survey="false">
<security-dashboard-layout>
<template v-if="shouldShowEmptyState" #empty-state>
<report-not-configured />
</template>
......
<script>
import { s__ } from '~/locale';
import SbomBanner from 'ee/sbom_banner/components/app.vue';
import SurveyRequestBanner from './survey_request_banner.vue';
export default {
components: { SurveyRequestBanner, SbomBanner },
components: { SurveyRequestBanner },
i18n: {
title: s__('SecurityReports|Security Dashboard'),
},
inject: ['sbomSurveySvgPath'],
props: {
// this prop is needed since the sbom survey banner should not be shown
// on the instance security dashboard
showSbomSurvey: {
type: Boolean,
required: false,
default: true,
},
},
};
</script>
......@@ -25,10 +14,7 @@ export default {
<div>
<slot name="loading"></slot>
<survey-request-banner v-if="!$slots.loading" class="gl-mt-5" />
<sbom-banner
v-if="!$slots.loading && showSbomSurvey"
:sbom-survey-svg-path="sbomSurveySvgPath"
/>
<template v-if="$slots.default">
<h2 data-testid="title">{{ $options.i18n.title }}</h2>
<div class="security-charts gl-display-flex gl-flex-wrap">
......
......@@ -37,7 +37,6 @@ export default (el, dashboardType) => {
securityConfigurationPath: el.dataset.securityConfigurationPath,
surveyRequestSvgPath: el.dataset.surveyRequestSvgPath,
securityDashboardHelpPath: el.dataset.securityDashboardHelpPath,
sbomSurveySvgPath: el.dataset.sbomSurveySvgPath,
};
let component;
......
import { s__, __ } from '~/locale';
import { __ } from '~/locale';
export const noneEpic = {
id: 0,
......@@ -9,16 +9,3 @@ export const placeholderEpic = {
id: -1,
title: __('Select epic'),
};
export const SBOM_BANNER_LOCAL_STORAGE_KEY = 'sbom_survey_request';
export const SBOM_BANNER_CURRENT_ID = 'sbom1';
export const SBOM_SURVEY_LINK = 'https://gitlab.fra1.qualtrics.com/jfe/form/SV_es038rUv1VFqmXk';
export const SBOM_SURVEY_DAYS_TO_ASK_LATER = 7;
export const SBOM_SURVEY_TITLE = s__('SecurityReports|Software and container dependency survey');
export const SBOM_SURVEY_BUTTON_TEXT = s__('SecurityReports|Take survey');
export const SBOM_SURVEY_DESCRIPTION = s__(
`SecurityReports|The Composition Analysis group is planning significant updates to how we make available the list of software and container dependency information in your projects. Therefore, we ask that you assist us by taking a short -no longer than 5 minute- survey to help align our direction with your needs.`,
);
export const SBOM_SURVEY_TOAST_MESSAGE = s__(
'SecurityReports|Your feedback is important to us! We will ask again in 7 days.',
);
......@@ -6,7 +6,6 @@ class Groups::Security::DashboardController < Groups::ApplicationController
before_action do
push_frontend_feature_flag(:vulnerability_management_survey, type: :ops, default_enabled: :yaml)
push_frontend_feature_flag(:sbom_survey, @user, default_enabled: :yaml)
end
def show
......
......@@ -4,10 +4,6 @@ module Projects
class DependenciesController < Projects::ApplicationController
include SecurityAndCompliancePermissions
before_action do
push_frontend_feature_flag(:sbom_survey, @user, default_enabled: :yaml)
end
before_action :authorize_read_dependency_list!
feature_category :dependency_scanning
......
......@@ -4,10 +4,6 @@ module Projects
class LicensesController < Projects::ApplicationController
include SecurityAndCompliancePermissions
before_action do
push_frontend_feature_flag(:sbom_survey, @user, default_enabled: :yaml)
end
before_action :authorize_read_licenses!, only: [:index]
before_action :authorize_admin_software_license_policy!, only: [:create, :update]
......@@ -107,7 +103,6 @@ module Projects
write_license_policies_endpoint: write_license_policies_endpoint,
documentation_path: help_page_path('user/compliance/license_compliance/index'),
empty_state_svg_path: helpers.image_path('illustrations/Dependency-list-empty-state.svg'),
sbom_survey_svg_path: helpers.image_path('illustrations/monitoring/tracing.svg'),
software_licenses: SoftwareLicense.unclassified_licenses_for(project).pluck_names,
project_id: @project.id,
project_path: expose_path(api_v4_projects_path(id: @project.id)),
......
......@@ -11,7 +11,6 @@ module Projects
before_action only: [:index] do
push_frontend_feature_flag(:security_auto_fix, project, default_enabled: false)
push_frontend_feature_flag(:vulnerability_management_survey, type: :ops, default_enabled: :yaml)
push_frontend_feature_flag(:sbom_survey, @user, default_enabled: :yaml)
push_frontend_feature_flag(:secure_vulnerability_training, @project, default_enabled: :yaml)
end
......
......@@ -177,7 +177,6 @@ module EE
operational_empty_state_svg_path: image_path('illustrations/security-dashboard_empty.svg'),
operational_help_path: help_page_path('user/application_security/policies/index'),
survey_request_svg_path: image_path('illustrations/security-dashboard_empty.svg'),
sbom_survey_svg_path: image_path('illustrations/monitoring/tracing.svg'),
security_dashboard_help_path: help_page_path('user/application_security/security_dashboard/index'),
no_vulnerabilities_svg_path: image_path('illustrations/issues.svg'),
project_full_path: project.full_path,
......@@ -192,7 +191,6 @@ module EE
vulnerabilities_export_endpoint: api_v4_security_projects_vulnerability_exports_path(id: project.id),
empty_state_svg_path: image_path('illustrations/security-dashboard-empty-state.svg'),
survey_request_svg_path: image_path('illustrations/security-dashboard_empty.svg'),
sbom_survey_svg_path: image_path('illustrations/monitoring/tracing.svg'),
no_vulnerabilities_svg_path: image_path('illustrations/issues.svg'),
dashboard_documentation: help_page_path('user/application_security/security_dashboard/index'),
not_enabled_scanners_help_path: help_page_path('user/application_security/index', anchor: 'quick-start'),
......
......@@ -25,7 +25,6 @@ module Groups::SecurityFeaturesHelper
operational_empty_state_svg_path: image_path('illustrations/security-dashboard_empty.svg'),
operational_help_path: help_page_path('user/application_security/policies/index'),
survey_request_svg_path: image_path('illustrations/security-dashboard_empty.svg'),
sbom_survey_svg_path: image_path('illustrations/monitoring/tracing.svg'),
dashboard_documentation: help_page_path('user/application_security/security_dashboard/index'),
vulnerabilities_export_endpoint: expose_path(api_v4_security_groups_vulnerability_exports_path(id: group.id)),
scanners: VulnerabilityScanners::ListService.new(group).execute.to_json,
......
......@@ -28,7 +28,6 @@ module SecurityHelper
def security_dashboard_unavailable_view_data
{
empty_state_svg_path: image_path('illustrations/security-dashboard-empty-state.svg'),
sbom_survey_svg_path: image_path('illustrations/monitoring/tracing.svg'),
dashboard_documentation: help_page_path('user/application_security/security_dashboard/index'),
is_unavailable: "true"
}
......
......@@ -4,5 +4,4 @@
#js-dependencies-app{ data: { endpoint: project_dependencies_path(@project, format: :json),
documentation_path: help_page_path('user/application_security/dependency_list/index'),
support_documentation_path: help_page_path('user/application_security/dependency_scanning/index', anchor: 'supported-languages-and-package-managers'),
empty_state_svg_path: image_path('illustrations/Dependency-list-empty-state.svg'),
sbom_survey_svg_path: image_path('illustrations/monitoring/tracing.svg')} }
empty_state_svg_path: image_path('illustrations/Dependency-list-empty-state.svg') } }
import { GlEmptyState, GlLoadingIcon, GlLink } from '@gitlab/ui';
import { mount } from '@vue/test-utils';
import { nextTick } from 'vue';
import { extendedWrapper } from 'helpers/vue_test_utils_helper';
import DependenciesApp from 'ee/dependencies/components/app.vue';
import DependenciesActions from 'ee/dependencies/components/dependencies_actions.vue';
import DependencyListIncompleteAlert from 'ee/dependencies/components/dependency_list_incomplete_alert.vue';
......@@ -11,8 +12,6 @@ import { DEPENDENCY_LIST_TYPES } from 'ee/dependencies/store/constants';
import { REPORT_STATUS } from 'ee/dependencies/store/modules/list/constants';
import { TEST_HOST } from 'helpers/test_constants';
import { getDateInPast } from '~/lib/utils/datetime_utility';
import { extendedWrapper } from 'helpers/vue_test_utils_helper';
import SbomBanner from 'ee/sbom_banner/components/app.vue';
describe('DependenciesApp component', () => {
let store;
......@@ -22,7 +21,6 @@ describe('DependenciesApp component', () => {
const basicAppProps = {
endpoint: '/foo',
emptyStateSvgPath: '/bar.svg',
sbomSurveySvgPath: '/foo.svg',
documentationPath: TEST_HOST,
supportDocumentationPath: `${TEST_HOST}/dependency_scanning#supported-languages`,
};
......@@ -33,12 +31,6 @@ describe('DependenciesApp component', () => {
const stubs = Object.keys(DependenciesApp.components).filter((name) => name !== 'GlSprintf');
window.gon = {
features: {
sbomSurvey: true,
},
};
wrapper = extendedWrapper(
mount(DependenciesApp, {
store,
......@@ -47,7 +39,6 @@ describe('DependenciesApp component', () => {
provide: {
endpoint: '/foo',
emptyStateSvgPath: '/bar.svg',
sbomSurveySvgPath: '/foo.svg',
documentationPath: TEST_HOST,
supportDocumentationPath: `${TEST_HOST}/dependency_scanning#supported-languages`,
},
......@@ -114,7 +105,6 @@ describe('DependenciesApp component', () => {
const findJobFailedAlert = () => wrapper.find(DependencyListJobFailedAlert);
const findIncompleteListAlert = () => wrapper.find(DependencyListIncompleteAlert);
const findDependenciesTables = () => wrapper.findAll(PaginatedDependenciesTable);
const findSbomBanner = () => wrapper.findComponent(SbomBanner);
const findHeader = () => wrapper.find('section > header');
const findHeaderHelpLink = () => findHeader().find(GlLink);
......@@ -158,7 +148,6 @@ describe('DependenciesApp component', () => {
};
afterEach(() => {
window.gon = {};
wrapper.destroy();
});
......@@ -225,12 +214,6 @@ describe('DependenciesApp component', () => {
expectComponentWithProps(DependenciesActions, { namespace: allNamespace });
});
it('renders the SbomBannercomponent with the right props', () => {
const sbomBanner = findSbomBanner();
expect(sbomBanner.exists()).toBe(true);
expect(sbomBanner.props().sbomSurveySvgPath).toEqual(basicAppProps.sbomSurveySvgPath);
});
describe('given the user has public permissions', () => {
beforeEach(async () => {
store.state[allNamespace].reportInfo.generatedAt = '';
......
......@@ -19,7 +19,6 @@ import {
import setWindowLocation from 'helpers/set_window_location_helper';
import { stubTransition } from 'helpers/stub_transition';
import { TEST_HOST } from 'helpers/test_constants';
import SbomBanner from 'ee/sbom_banner/components/app.vue';
Vue.use(Vuex);
......@@ -30,7 +29,6 @@ const managedLicenses = [approvedLicense, blacklistedLicense];
const licenses = [{}, {}];
const emptyStateSvgPath = '/';
const documentationPath = '/';
const sbomSurveySvgPath = '/';
const noop = () => {};
......@@ -81,7 +79,6 @@ const createComponent = ({ state, props, options }) => {
store: fakeStore,
stubs: { transition: stubTransition() },
provide: {
sbomSurveySvgPath,
emptyStateSvgPath,
documentationPath,
},
......@@ -89,19 +86,9 @@ const createComponent = ({ state, props, options }) => {
};
const findByTestId = (testId) => wrapper.find(`[data-testid="${testId}"]`);
const findSbomBanner = () => wrapper.findComponent(SbomBanner);
describe('Project Licenses', () => {
beforeEach(() => {
window.gon = {
features: {
sbomSurvey: true,
},
};
});
afterEach(() => {
window.gon = {};
wrapper.destroy();
wrapper = null;
});
......@@ -189,12 +176,6 @@ describe('Project Licenses', () => {
expect(wrapper.findComponent(GlAlert).exists()).toBe(false);
});
it('renders the SbomBannercomponent with the right props', () => {
const sbomBanner = findSbomBanner();
expect(sbomBanner.exists()).toBe(true);
expect(sbomBanner.props().sbomSurveySvgPath).toEqual(sbomSurveySvgPath);
});
it('renders a "Detected in project" tab and a "Policies" tab', () => {
expect(wrapper.findComponent(GlTabs).exists()).toBe(true);
expect(wrapper.findComponent(GlTab).exists()).toBe(true);
......
import { mount } from '@vue/test-utils';
import { extendedWrapper } from 'helpers/vue_test_utils_helper';
import {
SBOM_BANNER_LOCAL_STORAGE_KEY,
SBOM_BANNER_CURRENT_ID,
SBOM_SURVEY_LINK,
SBOM_SURVEY_DAYS_TO_ASK_LATER,
SBOM_SURVEY_TITLE,
SBOM_SURVEY_BUTTON_TEXT,
SBOM_SURVEY_DESCRIPTION,
SBOM_SURVEY_TOAST_MESSAGE,
} from 'ee/vue_shared/constants';
import sbomBanner from 'ee/sbom_banner/components/app.vue';
import sharedSurveyBanner from 'ee/vue_shared/survey_banner/survey_banner.vue';
describe('Sbom Banner Component', () => {
let wrapper;
const findSharedSurveyBanner = () => wrapper.findComponent(sharedSurveyBanner);
const createComponent = (sbomSurvey = { sbomSurvey: true }) => {
wrapper = extendedWrapper(
mount(sbomBanner, {
propsData: {
sbomSurveySvgPath: 'foo.svg',
},
provide: { glFeatures: { ...sbomSurvey } },
}),
);
};
afterEach(() => {
wrapper.destroy();
});
describe('given a true sbom_survey flag', () => {
beforeEach(() => {
createComponent();
});
it('renders the SBOM Banner component with the right props', () => {
const surveyBanner = findSharedSurveyBanner();
expect(surveyBanner.exists()).toBe(true);
expect(surveyBanner.props()).toMatchObject({
bannerId: SBOM_BANNER_CURRENT_ID,
storageKey: SBOM_BANNER_LOCAL_STORAGE_KEY,
daysToAskLater: SBOM_SURVEY_DAYS_TO_ASK_LATER,
surveyLink: SBOM_SURVEY_LINK,
svgPath: wrapper.props().sbomSurveySvgPath,
title: SBOM_SURVEY_TITLE,
toastMessage: SBOM_SURVEY_TOAST_MESSAGE,
});
expect(surveyBanner.props('buttonText')).toContain(SBOM_SURVEY_BUTTON_TEXT);
expect(surveyBanner.props('description')).toContain(SBOM_SURVEY_DESCRIPTION);
});
});
describe('given a false sbom_survey flag', () => {
beforeEach(() => {
createComponent({ sbomSurvey: false });
});
it('does not render the SBOM Banner component', () => {
const surveyBanner = findSharedSurveyBanner();
expect(surveyBanner.exists()).toBe(false);
});
});
});
......@@ -24,8 +24,6 @@ describe('Group Security Dashboard component', () => {
let wrapper;
const groupFullPath = `${TEST_HOST}/group/5`;
// To be consumed by SecurityDashboardLayout
const sbomSurveySvgPath = '/';
const findSecurityChartsLayoutComponent = () => wrapper.findComponent(SecurityDashboardLayout);
const findLoadingIcon = () => wrapper.findComponent(GlLoadingIcon);
......@@ -45,7 +43,7 @@ describe('Group Security Dashboard component', () => {
},
},
},
provide: { groupFullPath, sbomSurveySvgPath },
provide: { groupFullPath },
stubs: {
SecurityDashboardLayout,
},
......
......@@ -46,10 +46,6 @@ describe('Instance Security Dashboard component', () => {
stubs: {
SecurityDashboardLayout,
},
provide: {
// to be consumed by SecurityDashboardLayout
sbomSurveySvgPath: '/',
},
});
};
......@@ -68,7 +64,6 @@ describe('Instance Security Dashboard component', () => {
const vulnerabilitySeverities = findVulnerabilitySeverities();
expect(securityChartsLayout.exists()).toBe(true);
expect(securityChartsLayout.props().showSbomSurvey).toBe(false);
expect(reportNotConfigured.exists()).toBe(false);
expect(loadingIcon.exists()).toBe(true);
expect(vulnerabilitiesOverTimeChart.exists()).toBe(false);
......@@ -85,7 +80,6 @@ describe('Instance Security Dashboard component', () => {
const vulnerabilitySeverities = findVulnerabilitySeverities();
expect(securityChartsLayout.exists()).toBe(true);
expect(securityChartsLayout.props().showSbomSurvey).toBe(false);
expect(reportNotConfigured.exists()).toBe(true);
expect(loadingIcon.exists()).toBe(false);
expect(vulnerabilitiesOverTimeChart.exists()).toBe(false);
......@@ -106,7 +100,6 @@ describe('Instance Security Dashboard component', () => {
const vulnerabilitySeverities = findVulnerabilitySeverities();
expect(securityChartsLayout.exists()).toBe(true);
expect(securityChartsLayout.props().showSbomSurvey).toBe(false);
expect(reportNotConfigured.exists()).toBe(false);
expect(loadingIcon.exists()).toBe(false);
expect(vulnerabilitiesOverTimeChart.props()).toEqual({ query: vulnerabilityHistoryQuery });
......
......@@ -53,8 +53,6 @@ describe('Project Security Dashboard component', () => {
...propsData,
},
provide: {
// To be consumed by SecurityDashboardLayout
sbomSurveySvgPath: '/',
projectFullPath: 'namespace/project',
glFeatures: {
secureVulnerabilityTraining: secureVulnerabilityTrainingEnabled,
......
......@@ -2,7 +2,6 @@ import { shallowMount } from '@vue/test-utils';
import SecurityDashboardLayout from 'ee/security_dashboard/components/shared/security_dashboard_layout.vue';
import SurveyRequestBanner from 'ee/security_dashboard/components/shared/survey_request_banner.vue';
import { extendedWrapper } from 'helpers/vue_test_utils_helper';
import SbomBanner from 'ee/sbom_banner/components/app.vue';
describe('Security Dashboard Layout component', () => {
let wrapper;
......@@ -15,33 +14,21 @@ describe('Security Dashboard Layout component', () => {
const findDummyComponent = () => wrapper.findComponent(DummyComponent);
const findTitle = () => wrapper.findByTestId('title');
const findSurveyBanner = () => wrapper.findComponent(SurveyRequestBanner);
const findSbomBanner = () => wrapper.findComponent(SbomBanner);
const createWrapper = (slots, props = { showSbomSurvey: true }) => {
wrapper = extendedWrapper(
shallowMount(SecurityDashboardLayout, {
provide: {
sbomSurveySvgPath: '/',
},
propsData: {
...props,
},
slots,
}),
);
const createWrapper = (slots) => {
wrapper = extendedWrapper(shallowMount(SecurityDashboardLayout, { slots }));
};
beforeEach(() => {
window.gon = {
features: {
sbomSurvey: true,
},
};
});
afterEach(() => {
wrapper.destroy();
window.gon = {};
});
it('should render the default slot and survey banner', () => {
createWrapper({ default: DummyComponent });
expect(findDummyComponent().exists()).toBe(true);
expect(findTitle().exists()).toBe(true);
expect(findSurveyBanner().exists()).toBe(true);
});
it('should render the empty-state slot and survey banner', () => {
......@@ -59,25 +46,4 @@ describe('Security Dashboard Layout component', () => {
expect(findTitle().exists()).toBe(false);
expect(findSurveyBanner().exists()).toBe(false);
});
describe('given a false showSbowmSurvey prop', () => {
beforeEach(() => {
createWrapper({}, { showSbomSurvey: false });
});
it('does not render the SBOM Banner component', () => {
const sbomBanner = findSbomBanner();
expect(sbomBanner.exists()).toBe(false);
});
});
describe('given a true showSbowmSurvey prop', () => {
beforeEach(() => {
createWrapper({}, { showSbomSurvey: true });
});
it('does not render the SBOM Banner component', () => {
const sbomBanner = findSbomBanner();
expect(sbomBanner.exists()).toBe(true);
expect(sbomBanner.props().sbomSurveySvgPath).toBe(wrapper.vm.sbomSurveySvgPath);
});
});
});
......@@ -10,7 +10,6 @@ const TEST_DATASET = {
svgPath: '/test/no_changes_state.svg',
dashboardDocumentation: '/test/dashboard_page',
emptyStateSvgPath: '/test/empty_state.svg',
sbomSurveySvgPath: '/',
};
describe('Security Dashboard', () => {
......
......@@ -72,7 +72,6 @@ RSpec.describe Groups::SecurityFeaturesHelper do
group_full_path: group.full_path,
no_vulnerabilities_svg_path: helper.image_path('illustrations/issues.svg'),
empty_state_svg_path: helper.image_path('illustrations/security-dashboard-empty-state.svg'),
sbom_survey_svg_path: helper.image_path('illustrations/monitoring/tracing.svg'),
operational_empty_state_svg_path: helper.image_path('illustrations/security-dashboard_empty.svg'),
operational_help_path: help_page_path('user/application_security/policies/index'),
survey_request_svg_path: helper.image_path('illustrations/security-dashboard_empty.svg'),
......
......@@ -193,7 +193,6 @@ RSpec.describe ProjectsHelper do
operational_empty_state_svg_path: kind_of(String),
operational_help_path: kind_of(String),
survey_request_svg_path: start_with('/assets/illustrations/security-dashboard_empty'),
sbom_survey_svg_path: start_with('/assets/illustrations/monitoring/tracing'),
security_dashboard_help_path: '/help/user/application_security/security_dashboard/index',
project_full_path: project.full_path,
no_vulnerabilities_svg_path: start_with('/assets/illustrations/issues-'),
......@@ -218,7 +217,6 @@ RSpec.describe ProjectsHelper do
operational_empty_state_svg_path: kind_of(String),
operational_help_path: kind_of(String),
survey_request_svg_path: start_with('/assets/illustrations/security-dashboard_empty'),
sbom_survey_svg_path: start_with('/assets/illustrations/monitoring/tracing'),
dashboard_documentation: '/help/user/application_security/security_dashboard/index',
false_positive_doc_url: help_page_path('user/application_security/vulnerabilities/index'),
security_dashboard_help_path: '/help/user/application_security/security_dashboard/index',
......
......@@ -33414,9 +33414,6 @@ msgstr ""
msgid "SecurityReports|Severity"
msgstr ""
msgid "SecurityReports|Software and container dependency survey"
msgstr ""
msgid "SecurityReports|Sometimes a scanner can't determine a finding's severity. Those findings may still be a potential source of risk though. Please review these manually."
msgstr ""
......@@ -33432,9 +33429,6 @@ msgstr ""
msgid "SecurityReports|Take survey"
msgstr ""
msgid "SecurityReports|The Composition Analysis group is planning significant updates to how we make available the list of software and container dependency information in your projects. Therefore, we ask that you assist us by taking a short -no longer than 5 minute- survey to help align our direction with your needs."
msgstr ""
msgid "SecurityReports|The Vulnerability Report shows the results of the latest successful pipeline on your project's default branch, as well as vulnerabilities from your latest container scan. %{linkStart}Learn more.%{linkEnd}"
msgstr ""
......@@ -33513,9 +33507,6 @@ msgstr ""
msgid "SecurityReports|You must sign in as an authorized user to see this report"
msgstr ""
msgid "SecurityReports|Your feedback is important to us! We will ask again in 7 days."
msgstr ""
msgid "SecurityReports|Your feedback is important to us! We will ask again in a week."
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