Commit f4dd4492 authored by Sean McGivern's avatar Sean McGivern

Merge branch '12601-security-dashboard-help-link' into 'master'

Replaces dashboard help link in project helper

Closes #12601

See merge request gitlab-org/gitlab-ee!14669
parents 00828144 df720542
...@@ -157,7 +157,7 @@ module EE ...@@ -157,7 +157,7 @@ module EE
if pipeline.nil? if pipeline.nil?
{ {
empty_state_illustration_path: image_path('illustrations/security-dashboard_empty.svg'), empty_state_illustration_path: image_path('illustrations/security-dashboard_empty.svg'),
security_dashboard_help_path: help_page_path("user/project/security_dashboard"), security_dashboard_help_path: help_page_path('user/application_security/security_dashboard'),
has_pipeline_data: "false" has_pipeline_data: "false"
} }
else else
...@@ -169,6 +169,7 @@ module EE ...@@ -169,6 +169,7 @@ module EE
vulnerability_feedback_help_path: help_page_path("user/application_security/index", anchor: "interacting-with-the-vulnerabilities"), vulnerability_feedback_help_path: help_page_path("user/application_security/index", anchor: "interacting-with-the-vulnerabilities"),
empty_state_svg_path: image_path('illustrations/security-dashboard-empty-state.svg'), empty_state_svg_path: image_path('illustrations/security-dashboard-empty-state.svg'),
dashboard_documentation: help_page_path('user/application_security/security_dashboard/index'), dashboard_documentation: help_page_path('user/application_security/security_dashboard/index'),
security_dashboard_help_path: help_page_path('user/application_security/security_dashboard'),
pipeline_id: pipeline.id, pipeline_id: pipeline.id,
user_path: user_url(pipeline.user), user_path: user_url(pipeline.user),
user_avatar_path: pipeline.user.avatar_url, user_avatar_path: pipeline.user.avatar_url,
......
---
title: Updates the security dashboard documentation link
merge_request: 14669
author:
type: other
...@@ -96,4 +96,36 @@ describe ProjectsHelper do ...@@ -96,4 +96,36 @@ describe ProjectsHelper do
end end
end end
end end
describe '#project_security_dashboard_config' do
let(:user) { create(:user) }
let(:group) { create(:group).tap { |g| g.add_owner(user) } }
let(:project) { create(:project, :repository, group: group) }
let(:pipeline) do
create(:ee_ci_pipeline,
:with_sast_report,
user: user,
project: project,
ref: project.default_branch,
sha: project.commit.sha)
end
context 'project without pipeline' do
subject { helper.project_security_dashboard_config(project, nil) }
it 'returns simple config' do
expect(subject[:security_dashboard_help_path]).to eq '/help/user/application_security/security_dashboard'
expect(subject[:has_pipeline_data]).to eq 'false'
end
end
context 'project with pipeline' do
subject { helper.project_security_dashboard_config(project, pipeline) }
it 'returns config containing pipeline details' do
expect(subject[:security_dashboard_help_path]).to eq '/help/user/application_security/security_dashboard'
expect(subject[:has_pipeline_data]).to eq 'true'
end
end
end
end end
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