Commit ffc662fa authored by charlie ablett's avatar charlie ablett

Merge branch '336405-runner-list-group-links' into 'master'

Update group runner links

See merge request gitlab-org/gitlab!81010
parents 70f434db eabac662
- breadcrumb_title _('Edit')
- page_title _('Edit'), "##{@runner.id} (#{@runner.short_sha})"
- add_to_breadcrumbs _('CI/CD Settings'), group_settings_ci_cd_path(@group)
- if Feature.enabled?(:runner_list_group_view_vue_ui, @group, default_enabled: :yaml)
- add_to_breadcrumbs _('Runners'), group_runners_path(@group)
- else
- add_to_breadcrumbs _('CI/CD Settings'), group_settings_ci_cd_path(@group)
- add_to_breadcrumbs "#{@runner.short_sha}", group_runner_path(@group, @runner)
%h2.page-title
= s_('Runners|Runner #%{runner_id}' % { runner_id: @runner.id })
= render 'shared/runners/runner_type_badge', runner: @runner
......
- add_to_breadcrumbs _('CI/CD Settings'), group_settings_ci_cd_path(@group)
- if Feature.enabled?(:runner_list_group_view_vue_ui, @group, default_enabled: :yaml)
- add_to_breadcrumbs _('Runners'), group_runners_path(@group)
- else
- add_to_breadcrumbs _('CI/CD Settings'), group_settings_ci_cd_path(@group)
= render 'shared/runners/runner_details', runner: @runner
......@@ -28,7 +28,11 @@
= _('This group does not have any group runners yet.')
- if can?(current_user, :admin_group_runners, @project.group)
- group_link = link_to _("group's CI/CD settings."), group_settings_ci_cd_path(@project.group)
- if Feature.enabled?(:runner_list_group_view_vue_ui, @group, default_enabled: :yaml)
- register_runners_path = group_runners_path(@project.group)
- else
- register_runners_path = group_settings_ci_cd_path(@project.group)
- group_link = link_to _("group's CI/CD settings."), register_runners_path
= _('Group owners can register group runners in the %{link}').html_safe % { link: group_link }
- else
= _('Ask your group owner to set up a group runner.')
......
......@@ -29,7 +29,7 @@ module Sidebars
::Sidebars::MenuItem.new(
title: _('Runners'),
link: group_runners_path(context.group),
active_routes: { path: 'groups/runners#index' },
active_routes: { controller: 'groups/runners' },
item_id: :runners
)
end
......
......@@ -89,10 +89,16 @@ module Sidebars
end
def ci_cd_menu_item
active_routes_path = if Feature.enabled?(:runner_list_group_view_vue_ui, context.group, default_enabled: :yaml)
'ci_cd#show'
else
%w[ci_cd#show groups/runners#show groups/runners#edit]
end
::Sidebars::MenuItem.new(
title: _('CI/CD'),
link: group_settings_ci_cd_path(context.group),
active_routes: { path: %w[ci_cd#show groups/runners#show groups/runners#edit] },
active_routes: { path: active_routes_path },
item_id: :ci_cd
)
end
......
......@@ -72,6 +72,18 @@ RSpec.describe Sidebars::Groups::Menus::SettingsMenu do
let(:item_id) { :ci_cd }
it_behaves_like 'access rights checks'
describe 'when runner list group view is disabled' do
before do
stub_feature_flags(runner_list_group_view_vue_ui: false)
end
it_behaves_like 'access rights checks'
it 'has group runners as active_routes' do
expect(subject.active_routes[:path]).to match_array %w[ci_cd#show groups/runners#show groups/runners#edit]
end
end
end
describe 'Applications menu' do
......
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