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