Skip to content
Snippets Groups Projects
Verified Commit 39e800f4 authored by Magdalena Frankiewicz's avatar Magdalena Frankiewicz :speech_balloon:
Browse files

Add link to change failure rate chart from tile

Changelog: added
parent 7934c7eb
No related branches found
No related tags found
1 merge request!92529Add link to change failure rate chart from tile
......@@ -27,11 +27,26 @@ def value
def links
helpers = Gitlab::Routing.url_helpers
dashboard_link =
if @stage.parent.is_a?(::Group)
helpers.group_analytics_ci_cd_analytics_path(@stage.parent, tab: 'change-failure-rate')
else
helpers.charts_project_pipelines_path(@stage.parent, chart: 'change-failure-rate')
end
[
{ "name" => _('Change Failure Rate'),
{
"name" => _('Change Failure Rate'),
"url" => dashboard_link,
"label" => s_('ValueStreamAnalytics|Dashboard')
},
{
"name" => _('Change Failure Rate'),
"url" => helpers.help_page_path('user/analytics/index', anchor: 'change-failure-rate'),
"docs_link" => true,
"label" => s_('ValueStreamAnalytics|Go to docs') }
"label" => s_('ValueStreamAnalytics|Go to docs')
}
]
end
......
......@@ -48,15 +48,22 @@
describe '#links' do
subject { described_class.new(stage: stage, current_user: user, options: options).links }
it 'displays documentation link' do
it 'displays documentation link and group dashboard link' do
helpers = Gitlab::Routing.url_helpers
expect(subject).to match_array(
[
{ "name" => _('Change Failure Rate'),
{
"name" => _('Change Failure Rate'),
"url" => helpers.group_analytics_ci_cd_analytics_path(stage.parent, tab: 'change-failure-rate'),
"label" => s_('ValueStreamAnalytics|Dashboard')
},
{
"name" => _('Change Failure Rate'),
"url" => helpers.help_page_path('user/analytics/index', anchor: 'change-failure-rate'),
"docs_link" => true,
"label" => s_('ValueStreamAnalytics|Go to docs') }
"label" => s_('ValueStreamAnalytics|Go to docs')
}
]
)
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment