Commit 7b196922 authored by Daniel Tian's avatar Daniel Tian Committed by Mikołaj Wawrzyniak

Add vulnerability survey request feature flag and SVG image [RUN ALL RSPEC] [RUN AS-IF-FOSS]

parent 0e8dfef6
......@@ -34,6 +34,7 @@ export default (el, dashboardType) => {
emptyStateSvgPath: el.dataset.emptyStateSvgPath,
groupFullPath: el.dataset.groupFullPath,
securityConfigurationPath: el.dataset.securityConfigurationPath,
surveyRequestSvgPath: el.dataset.surveyRequestSvgPath,
};
let component;
......
......@@ -39,6 +39,7 @@ export default (el, dashboardType) => {
pipelineSecurityBuildsFailedPath,
hasJiraVulnerabilitiesIntegrationEnabled,
securityConfigurationPath,
surveyRequestSvgPath,
} = el.dataset;
if (isUnavailable) {
......@@ -63,6 +64,7 @@ export default (el, dashboardType) => {
noPipelineRunScannersHelpPath,
groupFullPath,
securityConfigurationPath,
surveyRequestSvgPath,
hasVulnerabilities: parseBoolean(hasVulnerabilities),
scanners: scanners ? JSON.parse(scanners) : [],
hasJiraVulnerabilitiesIntegrationEnabled: parseBoolean(
......
......@@ -4,6 +4,10 @@ class Groups::Security::DashboardController < Groups::ApplicationController
feature_category :vulnerability_management
before_action do
push_frontend_feature_flag(:vulnerability_management_survey, type: :ops, default_enabled: :yaml)
end
def show
render :unavailable unless dashboard_available?
end
......
......@@ -7,6 +7,7 @@ module Groups
before_action do
push_frontend_feature_flag(:custom_security_scanners, current_user)
push_frontend_feature_flag(:vulnerability_management_survey, type: :ops, default_enabled: :yaml)
end
feature_category :vulnerability_management
......
......@@ -10,6 +10,7 @@ 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)
end
feature_category :static_application_security_testing
......
......@@ -8,6 +8,7 @@ module Projects
before_action do
push_frontend_feature_flag(:custom_security_scanners, current_user)
push_frontend_feature_flag(:vulnerability_management_survey, type: :ops, default_enabled: :yaml)
end
feature_category :vulnerability_management
......
......@@ -7,6 +7,7 @@ module Security
before_action :check_feature_enabled!
before_action do
push_frontend_feature_flag(:instance_security_dashboard, default_enabled: true)
push_frontend_feature_flag(:vulnerability_management_survey, type: :ops, default_enabled: :yaml)
end
feature_category :vulnerability_management
......
......@@ -6,6 +6,7 @@ module Security
before_action do
push_frontend_feature_flag(:custom_security_scanners, current_user)
push_frontend_feature_flag(:vulnerability_management_survey, type: :ops, default_enabled: :yaml)
end
end
end
......@@ -251,6 +251,7 @@ module EE
has_vulnerabilities: 'false',
has_jira_vulnerabilities_integration_enabled: project.configured_to_create_issues_from_vulnerabilities?.to_s,
empty_state_svg_path: image_path('illustrations/security-dashboard_empty.svg'),
survey_request_svg_path: image_path('illustrations/security-dashboard_empty.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,
......@@ -264,6 +265,7 @@ module EE
project_full_path: project.full_path,
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'),
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'),
......
......@@ -43,6 +43,7 @@ module Groups::SecurityFeaturesHelper
group_full_path: group.full_path,
no_vulnerabilities_svg_path: image_path('illustrations/issues.svg'),
empty_state_svg_path: image_path('illustrations/security-dashboard-empty-state.svg'),
survey_request_svg_path: image_path('illustrations/security-dashboard_empty.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
......
......@@ -7,6 +7,7 @@ module SecurityHelper
no_vulnerabilities_svg_path: image_path('illustrations/issues.svg'),
empty_dashboard_state_svg_path: image_path('illustrations/security-dashboard-empty-state.svg'),
empty_state_svg_path: image_path('illustrations/operations-dashboard_empty.svg'),
survey_request_svg_path: image_path('illustrations/security-dashboard_empty.svg'),
project_add_endpoint: security_projects_path,
project_list_endpoint: security_projects_path,
instance_dashboard_settings_path: settings_security_dashboard_path,
......
---
name: vulnerability_management_survey
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/56620
rollout_issue_url:
milestone: '13.11'
type: ops
group: group::threat insights
default_enabled: false
......@@ -160,6 +160,7 @@ RSpec.describe Groups::SecurityFeaturesHelper do
group_full_path: group.full_path,
no_vulnerabilities_svg_path: '/images/illustrations/issues.svg',
empty_state_svg_path: '/images/illustrations/security-dashboard-empty-state.svg',
survey_request_svg_path: '/images/illustrations/security-dashboard_empty.svg',
dashboard_documentation: '/help/user/application_security/security_dashboard/index',
vulnerabilities_export_endpoint: "/api/v4/security/groups/#{group.id}/vulnerability_exports",
scanners: '[]'
......
......@@ -135,6 +135,7 @@ RSpec.describe ProjectsHelper do
has_vulnerabilities: 'false',
has_jira_vulnerabilities_integration_enabled: 'true',
empty_state_svg_path: start_with('/assets/illustrations/security-dashboard_empty'),
survey_request_svg_path: start_with('/assets/illustrations/security-dashboard_empty'),
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-'),
......@@ -155,6 +156,7 @@ RSpec.describe ProjectsHelper do
vulnerabilities_export_endpoint: "/api/v4/security/projects/#{project.id}/vulnerability_exports",
no_vulnerabilities_svg_path: start_with('/assets/illustrations/issues-'),
empty_state_svg_path: start_with('/assets/illustrations/security-dashboard-empty-state'),
survey_request_svg_path: start_with('/assets/illustrations/security-dashboard_empty'),
dashboard_documentation: '/help/user/application_security/security_dashboard/index',
security_dashboard_help_path: '/help/user/application_security/security_dashboard/index',
not_enabled_scanners_help_path: help_page_path('user/application_security/index', anchor: 'quick-start'),
......
......@@ -14,6 +14,7 @@ RSpec.describe SecurityHelper do
no_vulnerabilities_svg_path: image_path('illustrations/issues.svg'),
empty_dashboard_state_svg_path: image_path('illustrations/security-dashboard-empty-state.svg'),
empty_state_svg_path: image_path('illustrations/operations-dashboard_empty.svg'),
survey_request_svg_path: image_path('illustrations/security-dashboard_empty.svg'),
project_add_endpoint: security_projects_path,
project_list_endpoint: security_projects_path,
instance_dashboard_settings_path: settings_security_dashboard_path,
......
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