Commit 58743554 authored by Fernando Arias's avatar Fernando Arias Committed by Phil Hughes

Revert "Add Sbom Survey Banner"

- This reverts commit 3c70b090.
- Manually resolve merge conflicts

Changelog: removed
parent cf6d1a58
---
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 @@ ...@@ -2,7 +2,6 @@
import { GlEmptyState, GlIcon, GlLoadingIcon, GlSprintf, GlLink } from '@gitlab/ui'; import { GlEmptyState, GlIcon, GlLoadingIcon, GlSprintf, GlLink } from '@gitlab/ui';
import { mapActions, mapGetters, mapState } from 'vuex'; import { mapActions, mapGetters, mapState } from 'vuex';
import { __ } from '~/locale'; import { __ } from '~/locale';
import SbomBanner from 'ee/sbom_banner/components/app.vue';
import { DEPENDENCY_LIST_TYPES } from '../store/constants'; import { DEPENDENCY_LIST_TYPES } from '../store/constants';
import { REPORT_STATUS } from '../store/modules/list/constants'; import { REPORT_STATUS } from '../store/modules/list/constants';
import DependenciesActions from './dependencies_actions.vue'; import DependenciesActions from './dependencies_actions.vue';
...@@ -19,18 +18,11 @@ export default { ...@@ -19,18 +18,11 @@ export default {
GlLoadingIcon, GlLoadingIcon,
GlSprintf, GlSprintf,
GlLink, GlLink,
SbomBanner,
DependencyListIncompleteAlert, DependencyListIncompleteAlert,
DependencyListJobFailedAlert, DependencyListJobFailedAlert,
PaginatedDependenciesTable, PaginatedDependenciesTable,
}, },
inject: [ inject: ['emptyStateSvgPath', 'documentationPath', 'endpoint', 'supportDocumentationPath'],
'sbomSurveySvgPath',
'emptyStateSvgPath',
'documentationPath',
'endpoint',
'supportDocumentationPath',
],
data() { data() {
return { return {
isIncompleteAlertDismissed: false, isIncompleteAlertDismissed: false,
...@@ -124,7 +116,6 @@ export default { ...@@ -124,7 +116,6 @@ export default {
</gl-empty-state> </gl-empty-state>
<section v-else> <section v-else>
<sbom-banner :sbom-survey-svg-path="sbomSurveySvgPath" />
<dependency-list-incomplete-alert <dependency-list-incomplete-alert
v-if="isIncomplete && !isIncompleteAlertDismissed" v-if="isIncomplete && !isIncompleteAlertDismissed"
@dismiss="dismissIncompleteListAlert" @dismiss="dismissIncompleteListAlert"
......
...@@ -6,7 +6,6 @@ export default () => { ...@@ -6,7 +6,6 @@ export default () => {
const el = document.querySelector('#js-dependencies-app'); const el = document.querySelector('#js-dependencies-app');
const provide = { const provide = {
sbomSurveySvgPath: el.dataset.sbomSurveySvgPath,
emptyStateSvgPath: el.dataset.emptyStateSvgPath, emptyStateSvgPath: el.dataset.emptyStateSvgPath,
documentationPath: el.dataset.documentationPath, documentationPath: el.dataset.documentationPath,
endpoint: el.dataset.endpoint, endpoint: el.dataset.endpoint,
......
...@@ -11,7 +11,6 @@ import { ...@@ -11,7 +11,6 @@ import {
} from '@gitlab/ui'; } from '@gitlab/ui';
import { mapActions, mapState, mapGetters } from 'vuex'; import { mapActions, mapState, mapGetters } from 'vuex';
import LicenseManagement from 'ee/vue_shared/license_compliance/license_management.vue'; 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 { LICENSE_MANAGEMENT } from 'ee/vue_shared/license_compliance/store/constants';
import { getLocationHash } from '~/lib/utils/url_utility'; import { getLocationHash } from '~/lib/utils/url_utility';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
...@@ -32,11 +31,10 @@ export default { ...@@ -32,11 +31,10 @@ export default {
GlTabs, GlTabs,
GlBadge, GlBadge,
GlAlert, GlAlert,
SbomBanner,
LicenseManagement, LicenseManagement,
}, },
mixins: [glFeatureFlagsMixin()], mixins: [glFeatureFlagsMixin()],
inject: ['sbomSurveySvgPath', 'emptyStateSvgPath', 'documentationPath'], inject: ['emptyStateSvgPath', 'documentationPath'],
data() { data() {
return { return {
tabIndex: this.activeTabIndex(), tabIndex: this.activeTabIndex(),
...@@ -112,7 +110,7 @@ export default { ...@@ -112,7 +110,7 @@ export default {
) )
}} }}
</gl-alert> </gl-alert>
<sbom-banner :sbom-survey-svg-path="sbomSurveySvgPath" />
<header class="my-3"> <header class="my-3">
<h2 class="h4 mb-1 gl-display-flex gl-align-items-center"> <h2 class="h4 mb-1 gl-display-flex gl-align-items-center">
{{ s__('Licenses|License Compliance') }} {{ s__('Licenses|License Compliance') }}
......
...@@ -29,7 +29,6 @@ export default () => { ...@@ -29,7 +29,6 @@ export default () => {
const store = createStore(storeSettings); const store = createStore(storeSettings);
const provide = { const provide = {
sbomSurveySvgPath: el.dataset.sbomSurveySvgPath,
emptyStateSvgPath: el.dataset.emptyStateSvgPath, emptyStateSvgPath: el.dataset.emptyStateSvgPath,
documentationPath: el.dataset.documentationPath, 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 { ...@@ -51,7 +51,7 @@ export default {
</script> </script>
<template> <template>
<security-dashboard-layout :show-sbom-survey="false"> <security-dashboard-layout>
<template v-if="shouldShowEmptyState" #empty-state> <template v-if="shouldShowEmptyState" #empty-state>
<report-not-configured /> <report-not-configured />
</template> </template>
......
<script> <script>
import { s__ } from '~/locale'; import { s__ } from '~/locale';
import SbomBanner from 'ee/sbom_banner/components/app.vue';
import SurveyRequestBanner from './survey_request_banner.vue'; import SurveyRequestBanner from './survey_request_banner.vue';
export default { export default {
components: { SurveyRequestBanner, SbomBanner }, components: { SurveyRequestBanner },
i18n: { i18n: {
title: s__('SecurityReports|Security Dashboard'), 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> </script>
...@@ -25,10 +14,7 @@ export default { ...@@ -25,10 +14,7 @@ export default {
<div> <div>
<slot name="loading"></slot> <slot name="loading"></slot>
<survey-request-banner v-if="!$slots.loading" class="gl-mt-5" /> <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"> <template v-if="$slots.default">
<h2 data-testid="title">{{ $options.i18n.title }}</h2> <h2 data-testid="title">{{ $options.i18n.title }}</h2>
<div class="security-charts gl-display-flex gl-flex-wrap"> <div class="security-charts gl-display-flex gl-flex-wrap">
......
...@@ -37,7 +37,6 @@ export default (el, dashboardType) => { ...@@ -37,7 +37,6 @@ export default (el, dashboardType) => {
securityConfigurationPath: el.dataset.securityConfigurationPath, securityConfigurationPath: el.dataset.securityConfigurationPath,
surveyRequestSvgPath: el.dataset.surveyRequestSvgPath, surveyRequestSvgPath: el.dataset.surveyRequestSvgPath,
securityDashboardHelpPath: el.dataset.securityDashboardHelpPath, securityDashboardHelpPath: el.dataset.securityDashboardHelpPath,
sbomSurveySvgPath: el.dataset.sbomSurveySvgPath,
}; };
let component; let component;
......
import { s__, __ } from '~/locale'; import { __ } from '~/locale';
export const noneEpic = { export const noneEpic = {
id: 0, id: 0,
...@@ -9,16 +9,3 @@ export const placeholderEpic = { ...@@ -9,16 +9,3 @@ export const placeholderEpic = {
id: -1, id: -1,
title: __('Select epic'), 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 ...@@ -6,7 +6,6 @@ class Groups::Security::DashboardController < Groups::ApplicationController
before_action do before_action do
push_frontend_feature_flag(:vulnerability_management_survey, type: :ops, default_enabled: :yaml) push_frontend_feature_flag(:vulnerability_management_survey, type: :ops, default_enabled: :yaml)
push_frontend_feature_flag(:sbom_survey, @user, default_enabled: :yaml)
end end
def show def show
......
...@@ -4,10 +4,6 @@ module Projects ...@@ -4,10 +4,6 @@ module Projects
class DependenciesController < Projects::ApplicationController class DependenciesController < Projects::ApplicationController
include SecurityAndCompliancePermissions include SecurityAndCompliancePermissions
before_action do
push_frontend_feature_flag(:sbom_survey, @user, default_enabled: :yaml)
end
before_action :authorize_read_dependency_list! before_action :authorize_read_dependency_list!
feature_category :dependency_scanning feature_category :dependency_scanning
......
...@@ -4,10 +4,6 @@ module Projects ...@@ -4,10 +4,6 @@ module Projects
class LicensesController < Projects::ApplicationController class LicensesController < Projects::ApplicationController
include SecurityAndCompliancePermissions 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_read_licenses!, only: [:index]
before_action :authorize_admin_software_license_policy!, only: [:create, :update] before_action :authorize_admin_software_license_policy!, only: [:create, :update]
...@@ -107,7 +103,6 @@ module Projects ...@@ -107,7 +103,6 @@ module Projects
write_license_policies_endpoint: write_license_policies_endpoint, write_license_policies_endpoint: write_license_policies_endpoint,
documentation_path: help_page_path('user/compliance/license_compliance/index'), documentation_path: help_page_path('user/compliance/license_compliance/index'),
empty_state_svg_path: helpers.image_path('illustrations/Dependency-list-empty-state.svg'), 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, software_licenses: SoftwareLicense.unclassified_licenses_for(project).pluck_names,
project_id: @project.id, project_id: @project.id,
project_path: expose_path(api_v4_projects_path(id: @project.id)), project_path: expose_path(api_v4_projects_path(id: @project.id)),
......
...@@ -11,7 +11,6 @@ module Projects ...@@ -11,7 +11,6 @@ module Projects
before_action only: [:index] do before_action only: [:index] do
push_frontend_feature_flag(:security_auto_fix, project, default_enabled: false) 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(: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) push_frontend_feature_flag(:secure_vulnerability_training, @project, default_enabled: :yaml)
end end
......
...@@ -177,7 +177,6 @@ module EE ...@@ -177,7 +177,6 @@ module EE
operational_empty_state_svg_path: image_path('illustrations/security-dashboard_empty.svg'), operational_empty_state_svg_path: image_path('illustrations/security-dashboard_empty.svg'),
operational_help_path: help_page_path('user/application_security/policies/index'), operational_help_path: help_page_path('user/application_security/policies/index'),
survey_request_svg_path: image_path('illustrations/security-dashboard_empty.svg'), 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'), security_dashboard_help_path: help_page_path('user/application_security/security_dashboard/index'),
no_vulnerabilities_svg_path: image_path('illustrations/issues.svg'), no_vulnerabilities_svg_path: image_path('illustrations/issues.svg'),
project_full_path: project.full_path, project_full_path: project.full_path,
...@@ -192,7 +191,6 @@ module EE ...@@ -192,7 +191,6 @@ module EE
vulnerabilities_export_endpoint: api_v4_security_projects_vulnerability_exports_path(id: project.id), 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'), empty_state_svg_path: image_path('illustrations/security-dashboard-empty-state.svg'),
survey_request_svg_path: image_path('illustrations/security-dashboard_empty.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'), no_vulnerabilities_svg_path: image_path('illustrations/issues.svg'),
dashboard_documentation: help_page_path('user/application_security/security_dashboard/index'), 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'), not_enabled_scanners_help_path: help_page_path('user/application_security/index', anchor: 'quick-start'),
......
...@@ -25,7 +25,6 @@ module Groups::SecurityFeaturesHelper ...@@ -25,7 +25,6 @@ module Groups::SecurityFeaturesHelper
operational_empty_state_svg_path: image_path('illustrations/security-dashboard_empty.svg'), operational_empty_state_svg_path: image_path('illustrations/security-dashboard_empty.svg'),
operational_help_path: help_page_path('user/application_security/policies/index'), operational_help_path: help_page_path('user/application_security/policies/index'),
survey_request_svg_path: image_path('illustrations/security-dashboard_empty.svg'), 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'), 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)), vulnerabilities_export_endpoint: expose_path(api_v4_security_groups_vulnerability_exports_path(id: group.id)),
scanners: VulnerabilityScanners::ListService.new(group).execute.to_json, scanners: VulnerabilityScanners::ListService.new(group).execute.to_json,
......
...@@ -28,7 +28,6 @@ module SecurityHelper ...@@ -28,7 +28,6 @@ module SecurityHelper
def security_dashboard_unavailable_view_data def security_dashboard_unavailable_view_data
{ {
empty_state_svg_path: image_path('illustrations/security-dashboard-empty-state.svg'), 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'), dashboard_documentation: help_page_path('user/application_security/security_dashboard/index'),
is_unavailable: "true" is_unavailable: "true"
} }
......
...@@ -4,5 +4,4 @@ ...@@ -4,5 +4,4 @@
#js-dependencies-app{ data: { endpoint: project_dependencies_path(@project, format: :json), #js-dependencies-app{ data: { endpoint: project_dependencies_path(@project, format: :json),
documentation_path: help_page_path('user/application_security/dependency_list/index'), 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'), 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'), empty_state_svg_path: image_path('illustrations/Dependency-list-empty-state.svg') } }
sbom_survey_svg_path: image_path('illustrations/monitoring/tracing.svg')} }
import { GlEmptyState, GlLoadingIcon, GlLink } from '@gitlab/ui'; import { GlEmptyState, GlLoadingIcon, GlLink } from '@gitlab/ui';
import { mount } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import { nextTick } from 'vue'; import { nextTick } from 'vue';
import { extendedWrapper } from 'helpers/vue_test_utils_helper';
import DependenciesApp from 'ee/dependencies/components/app.vue'; import DependenciesApp from 'ee/dependencies/components/app.vue';
import DependenciesActions from 'ee/dependencies/components/dependencies_actions.vue'; import DependenciesActions from 'ee/dependencies/components/dependencies_actions.vue';
import DependencyListIncompleteAlert from 'ee/dependencies/components/dependency_list_incomplete_alert.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'; ...@@ -11,8 +12,6 @@ import { DEPENDENCY_LIST_TYPES } from 'ee/dependencies/store/constants';
import { REPORT_STATUS } from 'ee/dependencies/store/modules/list/constants'; import { REPORT_STATUS } from 'ee/dependencies/store/modules/list/constants';
import { TEST_HOST } from 'helpers/test_constants'; import { TEST_HOST } from 'helpers/test_constants';
import { getDateInPast } from '~/lib/utils/datetime_utility'; 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', () => { describe('DependenciesApp component', () => {
let store; let store;
...@@ -22,7 +21,6 @@ describe('DependenciesApp component', () => { ...@@ -22,7 +21,6 @@ describe('DependenciesApp component', () => {
const basicAppProps = { const basicAppProps = {
endpoint: '/foo', endpoint: '/foo',
emptyStateSvgPath: '/bar.svg', emptyStateSvgPath: '/bar.svg',
sbomSurveySvgPath: '/foo.svg',
documentationPath: TEST_HOST, documentationPath: TEST_HOST,
supportDocumentationPath: `${TEST_HOST}/dependency_scanning#supported-languages`, supportDocumentationPath: `${TEST_HOST}/dependency_scanning#supported-languages`,
}; };
...@@ -33,12 +31,6 @@ describe('DependenciesApp component', () => { ...@@ -33,12 +31,6 @@ describe('DependenciesApp component', () => {
const stubs = Object.keys(DependenciesApp.components).filter((name) => name !== 'GlSprintf'); const stubs = Object.keys(DependenciesApp.components).filter((name) => name !== 'GlSprintf');
window.gon = {
features: {
sbomSurvey: true,
},
};
wrapper = extendedWrapper( wrapper = extendedWrapper(
mount(DependenciesApp, { mount(DependenciesApp, {
store, store,
...@@ -47,7 +39,6 @@ describe('DependenciesApp component', () => { ...@@ -47,7 +39,6 @@ describe('DependenciesApp component', () => {
provide: { provide: {
endpoint: '/foo', endpoint: '/foo',
emptyStateSvgPath: '/bar.svg', emptyStateSvgPath: '/bar.svg',
sbomSurveySvgPath: '/foo.svg',
documentationPath: TEST_HOST, documentationPath: TEST_HOST,
supportDocumentationPath: `${TEST_HOST}/dependency_scanning#supported-languages`, supportDocumentationPath: `${TEST_HOST}/dependency_scanning#supported-languages`,
}, },
...@@ -114,7 +105,6 @@ describe('DependenciesApp component', () => { ...@@ -114,7 +105,6 @@ describe('DependenciesApp component', () => {
const findJobFailedAlert = () => wrapper.find(DependencyListJobFailedAlert); const findJobFailedAlert = () => wrapper.find(DependencyListJobFailedAlert);
const findIncompleteListAlert = () => wrapper.find(DependencyListIncompleteAlert); const findIncompleteListAlert = () => wrapper.find(DependencyListIncompleteAlert);
const findDependenciesTables = () => wrapper.findAll(PaginatedDependenciesTable); const findDependenciesTables = () => wrapper.findAll(PaginatedDependenciesTable);
const findSbomBanner = () => wrapper.findComponent(SbomBanner);
const findHeader = () => wrapper.find('section > header'); const findHeader = () => wrapper.find('section > header');
const findHeaderHelpLink = () => findHeader().find(GlLink); const findHeaderHelpLink = () => findHeader().find(GlLink);
...@@ -158,7 +148,6 @@ describe('DependenciesApp component', () => { ...@@ -158,7 +148,6 @@ describe('DependenciesApp component', () => {
}; };
afterEach(() => { afterEach(() => {
window.gon = {};
wrapper.destroy(); wrapper.destroy();
}); });
...@@ -225,12 +214,6 @@ describe('DependenciesApp component', () => { ...@@ -225,12 +214,6 @@ describe('DependenciesApp component', () => {
expectComponentWithProps(DependenciesActions, { namespace: allNamespace }); 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', () => { describe('given the user has public permissions', () => {
beforeEach(async () => { beforeEach(async () => {
store.state[allNamespace].reportInfo.generatedAt = ''; store.state[allNamespace].reportInfo.generatedAt = '';
......
...@@ -19,7 +19,6 @@ import { ...@@ -19,7 +19,6 @@ import {
import setWindowLocation from 'helpers/set_window_location_helper'; import setWindowLocation from 'helpers/set_window_location_helper';
import { stubTransition } from 'helpers/stub_transition'; import { stubTransition } from 'helpers/stub_transition';
import { TEST_HOST } from 'helpers/test_constants'; import { TEST_HOST } from 'helpers/test_constants';
import SbomBanner from 'ee/sbom_banner/components/app.vue';
Vue.use(Vuex); Vue.use(Vuex);
...@@ -30,7 +29,6 @@ const managedLicenses = [approvedLicense, blacklistedLicense]; ...@@ -30,7 +29,6 @@ const managedLicenses = [approvedLicense, blacklistedLicense];
const licenses = [{}, {}]; const licenses = [{}, {}];
const emptyStateSvgPath = '/'; const emptyStateSvgPath = '/';
const documentationPath = '/'; const documentationPath = '/';
const sbomSurveySvgPath = '/';
const noop = () => {}; const noop = () => {};
...@@ -81,7 +79,6 @@ const createComponent = ({ state, props, options }) => { ...@@ -81,7 +79,6 @@ const createComponent = ({ state, props, options }) => {
store: fakeStore, store: fakeStore,
stubs: { transition: stubTransition() }, stubs: { transition: stubTransition() },
provide: { provide: {
sbomSurveySvgPath,
emptyStateSvgPath, emptyStateSvgPath,
documentationPath, documentationPath,
}, },
...@@ -89,19 +86,9 @@ const createComponent = ({ state, props, options }) => { ...@@ -89,19 +86,9 @@ const createComponent = ({ state, props, options }) => {
}; };
const findByTestId = (testId) => wrapper.find(`[data-testid="${testId}"]`); const findByTestId = (testId) => wrapper.find(`[data-testid="${testId}"]`);
const findSbomBanner = () => wrapper.findComponent(SbomBanner);
describe('Project Licenses', () => { describe('Project Licenses', () => {
beforeEach(() => {
window.gon = {
features: {
sbomSurvey: true,
},
};
});
afterEach(() => { afterEach(() => {
window.gon = {};
wrapper.destroy(); wrapper.destroy();
wrapper = null; wrapper = null;
}); });
...@@ -189,12 +176,6 @@ describe('Project Licenses', () => { ...@@ -189,12 +176,6 @@ describe('Project Licenses', () => {
expect(wrapper.findComponent(GlAlert).exists()).toBe(false); 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', () => { it('renders a "Detected in project" tab and a "Policies" tab', () => {
expect(wrapper.findComponent(GlTabs).exists()).toBe(true); expect(wrapper.findComponent(GlTabs).exists()).toBe(true);
expect(wrapper.findComponent(GlTab).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', () => { ...@@ -24,8 +24,6 @@ describe('Group Security Dashboard component', () => {
let wrapper; let wrapper;
const groupFullPath = `${TEST_HOST}/group/5`; const groupFullPath = `${TEST_HOST}/group/5`;
// To be consumed by SecurityDashboardLayout
const sbomSurveySvgPath = '/';
const findSecurityChartsLayoutComponent = () => wrapper.findComponent(SecurityDashboardLayout); const findSecurityChartsLayoutComponent = () => wrapper.findComponent(SecurityDashboardLayout);
const findLoadingIcon = () => wrapper.findComponent(GlLoadingIcon); const findLoadingIcon = () => wrapper.findComponent(GlLoadingIcon);
...@@ -45,7 +43,7 @@ describe('Group Security Dashboard component', () => { ...@@ -45,7 +43,7 @@ describe('Group Security Dashboard component', () => {
}, },
}, },
}, },
provide: { groupFullPath, sbomSurveySvgPath }, provide: { groupFullPath },
stubs: { stubs: {
SecurityDashboardLayout, SecurityDashboardLayout,
}, },
......
...@@ -46,10 +46,6 @@ describe('Instance Security Dashboard component', () => { ...@@ -46,10 +46,6 @@ describe('Instance Security Dashboard component', () => {
stubs: { stubs: {
SecurityDashboardLayout, SecurityDashboardLayout,
}, },
provide: {
// to be consumed by SecurityDashboardLayout
sbomSurveySvgPath: '/',
},
}); });
}; };
...@@ -68,7 +64,6 @@ describe('Instance Security Dashboard component', () => { ...@@ -68,7 +64,6 @@ describe('Instance Security Dashboard component', () => {
const vulnerabilitySeverities = findVulnerabilitySeverities(); const vulnerabilitySeverities = findVulnerabilitySeverities();
expect(securityChartsLayout.exists()).toBe(true); expect(securityChartsLayout.exists()).toBe(true);
expect(securityChartsLayout.props().showSbomSurvey).toBe(false);
expect(reportNotConfigured.exists()).toBe(false); expect(reportNotConfigured.exists()).toBe(false);
expect(loadingIcon.exists()).toBe(true); expect(loadingIcon.exists()).toBe(true);
expect(vulnerabilitiesOverTimeChart.exists()).toBe(false); expect(vulnerabilitiesOverTimeChart.exists()).toBe(false);
...@@ -85,7 +80,6 @@ describe('Instance Security Dashboard component', () => { ...@@ -85,7 +80,6 @@ describe('Instance Security Dashboard component', () => {
const vulnerabilitySeverities = findVulnerabilitySeverities(); const vulnerabilitySeverities = findVulnerabilitySeverities();
expect(securityChartsLayout.exists()).toBe(true); expect(securityChartsLayout.exists()).toBe(true);
expect(securityChartsLayout.props().showSbomSurvey).toBe(false);
expect(reportNotConfigured.exists()).toBe(true); expect(reportNotConfigured.exists()).toBe(true);
expect(loadingIcon.exists()).toBe(false); expect(loadingIcon.exists()).toBe(false);
expect(vulnerabilitiesOverTimeChart.exists()).toBe(false); expect(vulnerabilitiesOverTimeChart.exists()).toBe(false);
...@@ -106,7 +100,6 @@ describe('Instance Security Dashboard component', () => { ...@@ -106,7 +100,6 @@ describe('Instance Security Dashboard component', () => {
const vulnerabilitySeverities = findVulnerabilitySeverities(); const vulnerabilitySeverities = findVulnerabilitySeverities();
expect(securityChartsLayout.exists()).toBe(true); expect(securityChartsLayout.exists()).toBe(true);
expect(securityChartsLayout.props().showSbomSurvey).toBe(false);
expect(reportNotConfigured.exists()).toBe(false); expect(reportNotConfigured.exists()).toBe(false);
expect(loadingIcon.exists()).toBe(false); expect(loadingIcon.exists()).toBe(false);
expect(vulnerabilitiesOverTimeChart.props()).toEqual({ query: vulnerabilityHistoryQuery }); expect(vulnerabilitiesOverTimeChart.props()).toEqual({ query: vulnerabilityHistoryQuery });
......
...@@ -53,8 +53,6 @@ describe('Project Security Dashboard component', () => { ...@@ -53,8 +53,6 @@ describe('Project Security Dashboard component', () => {
...propsData, ...propsData,
}, },
provide: { provide: {
// To be consumed by SecurityDashboardLayout
sbomSurveySvgPath: '/',
projectFullPath: 'namespace/project', projectFullPath: 'namespace/project',
glFeatures: { glFeatures: {
secureVulnerabilityTraining: secureVulnerabilityTrainingEnabled, secureVulnerabilityTraining: secureVulnerabilityTrainingEnabled,
......
...@@ -2,7 +2,6 @@ import { shallowMount } from '@vue/test-utils'; ...@@ -2,7 +2,6 @@ import { shallowMount } from '@vue/test-utils';
import SecurityDashboardLayout from 'ee/security_dashboard/components/shared/security_dashboard_layout.vue'; 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 SurveyRequestBanner from 'ee/security_dashboard/components/shared/survey_request_banner.vue';
import { extendedWrapper } from 'helpers/vue_test_utils_helper'; import { extendedWrapper } from 'helpers/vue_test_utils_helper';
import SbomBanner from 'ee/sbom_banner/components/app.vue';
describe('Security Dashboard Layout component', () => { describe('Security Dashboard Layout component', () => {
let wrapper; let wrapper;
...@@ -15,33 +14,21 @@ describe('Security Dashboard Layout component', () => { ...@@ -15,33 +14,21 @@ describe('Security Dashboard Layout component', () => {
const findDummyComponent = () => wrapper.findComponent(DummyComponent); const findDummyComponent = () => wrapper.findComponent(DummyComponent);
const findTitle = () => wrapper.findByTestId('title'); const findTitle = () => wrapper.findByTestId('title');
const findSurveyBanner = () => wrapper.findComponent(SurveyRequestBanner); const findSurveyBanner = () => wrapper.findComponent(SurveyRequestBanner);
const findSbomBanner = () => wrapper.findComponent(SbomBanner);
const createWrapper = (slots, props = { showSbomSurvey: true }) => { const createWrapper = (slots) => {
wrapper = extendedWrapper( wrapper = extendedWrapper(shallowMount(SecurityDashboardLayout, { slots }));
shallowMount(SecurityDashboardLayout, {
provide: {
sbomSurveySvgPath: '/',
},
propsData: {
...props,
},
slots,
}),
);
}; };
beforeEach(() => {
window.gon = {
features: {
sbomSurvey: true,
},
};
});
afterEach(() => { afterEach(() => {
wrapper.destroy(); 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', () => { it('should render the empty-state slot and survey banner', () => {
...@@ -59,25 +46,4 @@ describe('Security Dashboard Layout component', () => { ...@@ -59,25 +46,4 @@ describe('Security Dashboard Layout component', () => {
expect(findTitle().exists()).toBe(false); expect(findTitle().exists()).toBe(false);
expect(findSurveyBanner().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 = { ...@@ -10,7 +10,6 @@ const TEST_DATASET = {
svgPath: '/test/no_changes_state.svg', svgPath: '/test/no_changes_state.svg',
dashboardDocumentation: '/test/dashboard_page', dashboardDocumentation: '/test/dashboard_page',
emptyStateSvgPath: '/test/empty_state.svg', emptyStateSvgPath: '/test/empty_state.svg',
sbomSurveySvgPath: '/',
}; };
describe('Security Dashboard', () => { describe('Security Dashboard', () => {
......
...@@ -72,7 +72,6 @@ RSpec.describe Groups::SecurityFeaturesHelper do ...@@ -72,7 +72,6 @@ RSpec.describe Groups::SecurityFeaturesHelper do
group_full_path: group.full_path, group_full_path: group.full_path,
no_vulnerabilities_svg_path: helper.image_path('illustrations/issues.svg'), no_vulnerabilities_svg_path: helper.image_path('illustrations/issues.svg'),
empty_state_svg_path: helper.image_path('illustrations/security-dashboard-empty-state.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_empty_state_svg_path: helper.image_path('illustrations/security-dashboard_empty.svg'),
operational_help_path: help_page_path('user/application_security/policies/index'), operational_help_path: help_page_path('user/application_security/policies/index'),
survey_request_svg_path: helper.image_path('illustrations/security-dashboard_empty.svg'), survey_request_svg_path: helper.image_path('illustrations/security-dashboard_empty.svg'),
......
...@@ -193,7 +193,6 @@ RSpec.describe ProjectsHelper do ...@@ -193,7 +193,6 @@ RSpec.describe ProjectsHelper do
operational_empty_state_svg_path: kind_of(String), operational_empty_state_svg_path: kind_of(String),
operational_help_path: kind_of(String), operational_help_path: kind_of(String),
survey_request_svg_path: start_with('/assets/illustrations/security-dashboard_empty'), 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', security_dashboard_help_path: '/help/user/application_security/security_dashboard/index',
project_full_path: project.full_path, project_full_path: project.full_path,
no_vulnerabilities_svg_path: start_with('/assets/illustrations/issues-'), no_vulnerabilities_svg_path: start_with('/assets/illustrations/issues-'),
...@@ -218,7 +217,6 @@ RSpec.describe ProjectsHelper do ...@@ -218,7 +217,6 @@ RSpec.describe ProjectsHelper do
operational_empty_state_svg_path: kind_of(String), operational_empty_state_svg_path: kind_of(String),
operational_help_path: kind_of(String), operational_help_path: kind_of(String),
survey_request_svg_path: start_with('/assets/illustrations/security-dashboard_empty'), 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', dashboard_documentation: '/help/user/application_security/security_dashboard/index',
false_positive_doc_url: help_page_path('user/application_security/vulnerabilities/index'), false_positive_doc_url: help_page_path('user/application_security/vulnerabilities/index'),
security_dashboard_help_path: '/help/user/application_security/security_dashboard/index', security_dashboard_help_path: '/help/user/application_security/security_dashboard/index',
......
...@@ -33414,9 +33414,6 @@ msgstr "" ...@@ -33414,9 +33414,6 @@ msgstr ""
msgid "SecurityReports|Severity" msgid "SecurityReports|Severity"
msgstr "" 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." 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 "" msgstr ""
...@@ -33432,9 +33429,6 @@ msgstr "" ...@@ -33432,9 +33429,6 @@ msgstr ""
msgid "SecurityReports|Take survey" msgid "SecurityReports|Take survey"
msgstr "" 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}" 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 "" msgstr ""
...@@ -33513,9 +33507,6 @@ msgstr "" ...@@ -33513,9 +33507,6 @@ msgstr ""
msgid "SecurityReports|You must sign in as an authorized user to see this report" msgid "SecurityReports|You must sign in as an authorized user to see this report"
msgstr "" 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." msgid "SecurityReports|Your feedback is important to us! We will ask again in a week."
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