diff options
Diffstat (limited to 'app/views/layouts/nav/sidebar')
-rw-r--r-- | app/views/layouts/nav/sidebar/_admin.html.haml | 10 | ||||
-rw-r--r-- | app/views/layouts/nav/sidebar/_group.html.haml | 30 | ||||
-rw-r--r-- | app/views/layouts/nav/sidebar/_profile.html.haml | 2 | ||||
-rw-r--r-- | app/views/layouts/nav/sidebar/_project.html.haml | 37 | ||||
-rw-r--r-- | app/views/layouts/nav/sidebar/_project_security_link.html.haml | 21 |
5 files changed, 54 insertions, 46 deletions
diff --git a/app/views/layouts/nav/sidebar/_admin.html.haml b/app/views/layouts/nav/sidebar/_admin.html.haml index da16be707eb..f887d335807 100644 --- a/app/views/layouts/nav/sidebar/_admin.html.haml +++ b/app/views/layouts/nav/sidebar/_admin.html.haml @@ -1,4 +1,4 @@ -.nav-sidebar.qa-admin-sidebar{ class: ("sidebar-collapsed-desktop" if collapsed_sidebar?) } +%aside.nav-sidebar.qa-admin-sidebar{ class: ("sidebar-collapsed-desktop" if collapsed_sidebar?), 'aria-label': _('Admin navigation') } .nav-sidebar-inner-scroll .context-header = link_to admin_root_path, title: _('Admin Overview') do @@ -65,10 +65,6 @@ = link_to admin_dev_ops_report_path, title: _('DevOps Report') do %span = _('DevOps Report') - = nav_link(controller: :cohorts) do - = link_to admin_cohorts_path, title: _('Cohorts') do - %span - = _('Cohorts') - if Feature.enabled?(:instance_statistics, default_enabled: true) = nav_link(controller: :instance_statistics) do = link_to admin_instance_statistics_path, title: _('Usage Trends') do @@ -251,6 +247,7 @@ = _('Settings') %ul.sidebar-sub-level-items{ data: { qa_selector: 'admin_sidebar_settings_submenu_content' } } + -# This active_nav_link check is also used in `app/views/layouts/admin.html.haml` = nav_link(controller: [:application_settings, :integrations], html_options: { class: "fly-out-top-item" } ) do = link_to general_admin_application_settings_path do %strong.fly-out-top-item-name @@ -260,6 +257,9 @@ = link_to general_admin_application_settings_path, title: _('General'), class: 'qa-admin-settings-general-item' do %span = _('General') + + = render_if_exists 'layouts/nav/sidebar/advanced_search', class: 'qa-admin-settings-advanced-search' + - if instance_level_integrations? = nav_link(path: ['application_settings#integrations', 'integrations#edit']) do = link_to integrations_admin_application_settings_path, title: _('Integrations'), data: { qa_selector: 'integration_settings_link' } do diff --git a/app/views/layouts/nav/sidebar/_group.html.haml b/app/views/layouts/nav/sidebar/_group.html.haml index 473a0d131b8..e99b2f443be 100644 --- a/app/views/layouts/nav/sidebar/_group.html.haml +++ b/app/views/layouts/nav/sidebar/_group.html.haml @@ -1,7 +1,9 @@ -- issues_count = group_issues_count(state: 'opened') +- issues_count = group_open_issues_count(@group) - merge_requests_count = group_merge_requests_count(state: 'opened') +- aside_title = @group.subgroup? ? _('Subgroup navigation') : _('Group navigation') +- overview_title = @group.subgroup? ? _('Subgroup overview') : _('Group overview') -.nav-sidebar{ class: ("sidebar-collapsed-desktop" if collapsed_sidebar?), **tracking_attrs('groups_side_navigation', 'render', 'groups_side_navigation') } +%aside.nav-sidebar{ class: ("sidebar-collapsed-desktop" if collapsed_sidebar?), **tracking_attrs('groups_side_navigation', 'render', 'groups_side_navigation'), 'aria-label': aside_title } .nav-sidebar-inner-scroll .context-header = link_to group_path(@group), title: @group.name do @@ -19,19 +21,13 @@ .nav-icon-container = sprite_icon('home') %span.nav-item-name - - if @group.subgroup? - = _('Subgroup overview') - - else - = _('Group overview') + = overview_title %ul.sidebar-sub-level-items = nav_link(path: ['groups#show', 'groups#details', 'groups#activity', 'groups#subgroups'], html_options: { class: "fly-out-top-item" } ) do = link_to group_path(@group) do %strong.fly-out-top-item-name - - if @group.subgroup? - = _('Subgroup overview') - - else - = _('Group overview') + = overview_title %li.divider.fly-out-top-item = nav_link(path: ['groups#show', 'groups#details', 'groups#subgroups'], html_options: { class: 'home' }) do @@ -54,14 +50,14 @@ = sprite_icon('issues') %span.nav-item-name = _('Issues') - %span.badge.badge-pill.count= number_with_delimiter(issues_count) + %span.badge.badge-pill.count= issues_count %ul.sidebar-sub-level-items{ data: { qa_selector: 'group_issues_sidebar_submenu'} } = nav_link(path: ['groups#issues', 'labels#index', 'milestones#index', 'iterations#index'], html_options: { class: "fly-out-top-item" } ) do = link_to issues_group_path(@group) do %strong.fly-out-top-item-name = _('Issues') - %span.badge.badge-pill.count.issue_counter.fly-out-badge= number_with_delimiter(issues_count) + %span.badge.badge-pill.count.issue_counter.fly-out-badge= issues_count %li.divider.fly-out-top-item = nav_link(path: 'groups#issues', html_options: { class: 'home' }) do @@ -121,7 +117,7 @@ %strong.fly-out-top-item-name = _('Kubernetes') - = render_if_exists 'groups/sidebar/packages' + = render 'groups/sidebar/packages' = render 'layouts/nav/sidebar/analytics_links', links: group_analytics_navbar_links(@group, current_user) @@ -141,7 +137,7 @@ %strong.fly-out-top-item-name = _('Members') - = render_if_exists 'groups/invite_members_side_nav_link', group: @group + = content_for :invite_members_sidebar - if group_sidebar_link?(:settings) = nav_link(path: group_settings_nav_link_paths) do @@ -181,11 +177,7 @@ %span = _('CI / CD') - - if Feature.enabled?(:packages_and_registries_group_settings, @group) - = nav_link(controller: :packages_and_registries) do - = link_to group_settings_packages_and_registries_path(@group), title: _('Packages & Registries') do - %span - = _('Packages & Registries') + = render 'groups/sidebar/packages_settings' = render_if_exists "groups/ee/settings_nav" diff --git a/app/views/layouts/nav/sidebar/_profile.html.haml b/app/views/layouts/nav/sidebar/_profile.html.haml index dadab554c02..a66110f28e8 100644 --- a/app/views/layouts/nav/sidebar/_profile.html.haml +++ b/app/views/layouts/nav/sidebar/_profile.html.haml @@ -1,4 +1,4 @@ -.nav-sidebar{ class: ("sidebar-collapsed-desktop" if collapsed_sidebar?), **tracking_attrs('user_side_navigation', 'render', 'user_side_navigation') } +%aside.nav-sidebar{ class: ("sidebar-collapsed-desktop" if collapsed_sidebar?), **tracking_attrs('user_side_navigation', 'render', 'user_side_navigation'), 'aria-label': _('User settings') } .nav-sidebar-inner-scroll .context-header = link_to profile_path, title: _('Profile Settings') do diff --git a/app/views/layouts/nav/sidebar/_project.html.haml b/app/views/layouts/nav/sidebar/_project.html.haml index e02b8333c60..8bb009bfd17 100644 --- a/app/views/layouts/nav/sidebar/_project.html.haml +++ b/app/views/layouts/nav/sidebar/_project.html.haml @@ -1,4 +1,4 @@ -.nav-sidebar{ class: ("sidebar-collapsed-desktop" if collapsed_sidebar?), **tracking_attrs('projects_side_navigation', 'render', 'projects_side_navigation') } +%aside.nav-sidebar{ class: ("sidebar-collapsed-desktop" if collapsed_sidebar?), **tracking_attrs('projects_side_navigation', 'render', 'projects_side_navigation'), 'aria-label': _('Project navigation') } .nav-sidebar-inner-scroll .context-header = link_to project_path(@project), title: @project.name do @@ -33,6 +33,13 @@ = link_to project_releases_path(@project), title: _('Releases'), class: 'shortcuts-project-releases' do %span= _('Releases') + - if project_nav_tab? :learn_gitlab + = nav_link(controller: :learn_gitlab, html_options: { class: 'home' }) do + = link_to project_learn_gitlab_path(@project) do + .nav-icon-container + = sprite_icon('home') + %span.nav-item-name + = _('Learn GitLab') - if project_nav_tab? :files = nav_link(controller: sidebar_repository_paths, unless: -> { current_path?('projects/graphs#charts') }) do @@ -212,7 +219,8 @@ = render_if_exists "layouts/nav/test_cases_link", project: @project - = render_if_exists 'layouts/nav/sidebar/project_security_link' # EE-specific + - if project_nav_tab? :security_and_compliance + = render_if_exists 'layouts/nav/sidebar/project_security_link' # EE-specific - if project_nav_tab? :operations = nav_link(controller: sidebar_operations_paths) do @@ -283,27 +291,14 @@ %span = _('Kubernetes') - if show_cluster_hint - .feature-highlight.js-feature-highlight{ disabled: true, + .js-feature-highlight{ disabled: true, data: { trigger: 'manual', container: 'body', placement: 'right', highlight: UserCalloutsHelper::GKE_CLUSTER_INTEGRATION, highlight_priority: UserCallout.feature_names[:GKE_CLUSTER_INTEGRATION], - dismiss_endpoint: user_callouts_path } } - - if show_cluster_hint - .feature-highlight-popover-content - = image_tag 'illustrations/cluster_popover.svg', class: 'feature-highlight-illustration', lazy: false, alt: _('Kubernetes popover') - .feature-highlight-popover-sub-content - %p= _('Allows you to add and manage Kubernetes clusters.') - %p - = _('Protip:') - = link_to _('Auto DevOps'), help_page_path('topics/autodevops/index.md') - %span= _('uses Kubernetes clusters to deploy your code!') - %hr - %button.gl-button.btn.btn-success.btn-sm.dismiss-feature-highlight{ type: 'button' } - %span.gl-mr-2= _("Got it!") - = sprite_icon('thumb-up') - + dismiss_endpoint: user_callouts_path, + auto_devops_help_path: help_page_path('topics/autodevops/index.md') } } - if project_nav_tab? :environments = nav_link(controller: :environments, action: [:index, :folder, :show, :new, :edit, :create, :update, :stop, :terminal]) do = link_to project_environments_path(@project), title: _('Environments'), class: 'shortcuts-environments qa-operations-environments-link' do @@ -383,7 +378,7 @@ %strong.fly-out-top-item-name = _('Members') - = render_if_exists 'projects/invite_members_side_nav_link', project: @project + = content_for :invite_members_sidebar - if project_nav_tab? :settings = nav_link(path: sidebar_settings_paths) do @@ -438,8 +433,6 @@ %span = _('Pages') - = render 'shared/sidebar_toggle_button' - -# Shortcut to Project > Activity %li.hidden = link_to activity_project_path(@project), title: _('Activity'), class: 'shortcuts-project-activity' do @@ -474,3 +467,5 @@ - if project_nav_tab?(:issues) %li.hidden = link_to _('Issue Boards'), project_boards_path(@project), title: _('Issue Boards'), class: 'shortcuts-issue-boards' + + = render 'shared/sidebar_toggle_button' diff --git a/app/views/layouts/nav/sidebar/_project_security_link.html.haml b/app/views/layouts/nav/sidebar/_project_security_link.html.haml new file mode 100644 index 00000000000..426845639e3 --- /dev/null +++ b/app/views/layouts/nav/sidebar/_project_security_link.html.haml @@ -0,0 +1,21 @@ +- top_level_link = project_security_configuration_path(@project) +- top_level_qa_selector = 'security_configuration_link' +- if any_project_nav_tab?([:security_configuration]) + = nav_link(path: sidebar_security_paths) do + = link_to top_level_link, data: { qa_selector: top_level_qa_selector } do + .nav-icon-container + = sprite_icon('shield') + %span.nav-item-name + = _('Security & Compliance') + + %ul.sidebar-sub-level-items + = nav_link(path: sidebar_security_paths, html_options: { class: "fly-out-top-item" } ) do + = link_to top_level_link do + %strong.fly-out-top-item-name + = _('Security & Compliance') + + %li.divider.fly-out-top-item + - if project_nav_tab?(:security_configuration) + = nav_link(path: sidebar_security_configuration_paths) do + = link_to project_security_configuration_path(@project), title: _('Configuration'), data: { qa_selector: 'security_configuration_link'} do + %span= _('Configuration') |