BigW Consortium Gitlab

Commit 20295b3d by Filipa Lacerda

Merge branch 'revert-sidebar-title-attribute' into 'master'

Remove title attribute from sidebar elements See merge request gitlab-org/gitlab-ce!14140
parents 6663db29 8a2ca763
...@@ -15,7 +15,6 @@ export default class NewNavSidebar { ...@@ -15,7 +15,6 @@ export default class NewNavSidebar {
this.$openSidebar = $('.toggle-mobile-nav'); this.$openSidebar = $('.toggle-mobile-nav');
this.$closeSidebar = $('.close-nav-button'); this.$closeSidebar = $('.close-nav-button');
this.$sidebarToggle = $('.js-toggle-sidebar'); this.$sidebarToggle = $('.js-toggle-sidebar');
this.$topLevelLinks = $('.sidebar-top-level-items > li > a');
} }
bindEvents() { bindEvents() {
...@@ -56,10 +55,6 @@ export default class NewNavSidebar { ...@@ -56,10 +55,6 @@ export default class NewNavSidebar {
this.$page.toggleClass('page-with-icon-sidebar', breakpoint === 'sm' ? true : collapsed); this.$page.toggleClass('page-with-icon-sidebar', breakpoint === 'sm' ? true : collapsed);
} }
NewNavSidebar.setCollapsedCookie(collapsed); NewNavSidebar.setCollapsedCookie(collapsed);
this.$topLevelLinks.attr('title', function updateTopLevelTitle() {
return collapsed ? this.getAttribute('aria-label') : '';
});
} }
render() { render() {
......
...@@ -119,8 +119,4 @@ module TabHelper ...@@ -119,8 +119,4 @@ module TabHelper
'active' if current_controller?('oauth/applications') 'active' if current_controller?('oauth/applications')
end end
def sidebar_link(href, title: nil, css: nil, &block)
link_to capture(&block), href, title: (title if collapsed_sidebar?), class: css, aria: { label: title }
end
end end
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
.sidebar-context-title Admin Area .sidebar-context-title Admin Area
%ul.sidebar-top-level-items %ul.sidebar-top-level-items
= nav_link(controller: %w(dashboard admin projects users groups jobs runners cohorts conversational_development_index), html_options: {class: 'home'}) do = nav_link(controller: %w(dashboard admin projects users groups jobs runners cohorts conversational_development_index), html_options: {class: 'home'}) do
= sidebar_link admin_root_path, title: _('Overview'), css: 'shortcuts-tree' do = link_to admin_root_path, class: 'shortcuts-tree' do
.nav-icon-container .nav-icon-container
= custom_icon('overview') = custom_icon('overview')
%span.nav-item-name %span.nav-item-name
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
ConvDev Index ConvDev Index
= nav_link(controller: %w(system_info background_jobs logs health_check requests_profiles)) do = nav_link(controller: %w(system_info background_jobs logs health_check requests_profiles)) do
= sidebar_link admin_system_info_path, title: _('Monitoring') do = link_to admin_system_info_path do
.nav-icon-container .nav-icon-container
= custom_icon('monitoring') = custom_icon('monitoring')
%span.nav-item-name %span.nav-item-name
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
Requests Profiles Requests Profiles
= nav_link(controller: :broadcast_messages) do = nav_link(controller: :broadcast_messages) do
= sidebar_link admin_broadcast_messages_path, title: _('Messages') do = link_to admin_broadcast_messages_path do
.nav-icon-container .nav-icon-container
= custom_icon('messages') = custom_icon('messages')
%span.nav-item-name %span.nav-item-name
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
#{ _('Messages') } #{ _('Messages') }
= nav_link(controller: [:hooks, :hook_logs]) do = nav_link(controller: [:hooks, :hook_logs]) do
= sidebar_link admin_hooks_path, title: _('Hooks') do = link_to admin_hooks_path do
.nav-icon-container .nav-icon-container
= custom_icon('system_hooks') = custom_icon('system_hooks')
%span.nav-item-name %span.nav-item-name
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,7 @@
#{ _('System Hooks') } #{ _('System Hooks') }
= nav_link(controller: :applications) do = nav_link(controller: :applications) do
= sidebar_link admin_applications_path, title: _('Applications') do = link_to admin_applications_path do
.nav-icon-container .nav-icon-container
= custom_icon('applications') = custom_icon('applications')
%span.nav-item-name %span.nav-item-name
...@@ -123,7 +123,7 @@ ...@@ -123,7 +123,7 @@
#{ _('Applications') } #{ _('Applications') }
= nav_link(controller: :abuse_reports) do = nav_link(controller: :abuse_reports) do
= sidebar_link admin_abuse_reports_path, title: _("Abuse Reports") do = link_to admin_abuse_reports_path do
.nav-icon-container .nav-icon-container
= custom_icon('abuse_reports') = custom_icon('abuse_reports')
%span.nav-item-name %span.nav-item-name
...@@ -138,7 +138,7 @@ ...@@ -138,7 +138,7 @@
- if akismet_enabled? - if akismet_enabled?
= nav_link(controller: :spam_logs) do = nav_link(controller: :spam_logs) do
= sidebar_link admin_spam_logs_path, title: _("Spam Logs") do = link_to admin_spam_logs_path do
.nav-icon-container .nav-icon-container
= custom_icon('spam_logs') = custom_icon('spam_logs')
%span.nav-item-name %span.nav-item-name
...@@ -150,7 +150,7 @@ ...@@ -150,7 +150,7 @@
#{ _('Spam Logs') } #{ _('Spam Logs') }
= nav_link(controller: :deploy_keys) do = nav_link(controller: :deploy_keys) do
= sidebar_link admin_deploy_keys_path, title: _('Deploy Keys') do = link_to admin_deploy_keys_path do
.nav-icon-container .nav-icon-container
= custom_icon('key') = custom_icon('key')
%span.nav-item-name %span.nav-item-name
...@@ -162,7 +162,7 @@ ...@@ -162,7 +162,7 @@
#{ _('Deploy Keys') } #{ _('Deploy Keys') }
= nav_link(controller: :services) do = nav_link(controller: :services) do
= sidebar_link admin_application_settings_services_path, title: _('Service Templates') do = link_to admin_application_settings_services_path do
.nav-icon-container .nav-icon-container
= custom_icon('service_templates') = custom_icon('service_templates')
%span.nav-item-name %span.nav-item-name
...@@ -174,7 +174,7 @@ ...@@ -174,7 +174,7 @@
#{ _('Service Templates') } #{ _('Service Templates') }
= nav_link(controller: :labels) do = nav_link(controller: :labels) do
= sidebar_link admin_labels_path, title: _('Labels') do = link_to admin_labels_path do
.nav-icon-container .nav-icon-container
= custom_icon('labels') = custom_icon('labels')
%span.nav-item-name %span.nav-item-name
...@@ -186,7 +186,7 @@ ...@@ -186,7 +186,7 @@
#{ _('Labels') } #{ _('Labels') }
= nav_link(controller: :appearances) do = nav_link(controller: :appearances) do
= sidebar_link admin_appearances_path, title: _('Appearances') do = link_to admin_appearances_path do
.nav-icon-container .nav-icon-container
= custom_icon('appearance') = custom_icon('appearance')
%span.nav-item-name %span.nav-item-name
...@@ -198,7 +198,7 @@ ...@@ -198,7 +198,7 @@
#{ _('Appearance') } #{ _('Appearance') }
= nav_link(controller: :application_settings) do = nav_link(controller: :application_settings) do
= sidebar_link admin_application_settings_path, title: _('Settings') do = link_to admin_application_settings_path do
.nav-icon-container .nav-icon-container
= custom_icon('settings') = custom_icon('settings')
%span.nav-item-name %span.nav-item-name
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
= @group.name = @group.name
%ul.sidebar-top-level-items %ul.sidebar-top-level-items
= nav_link(path: ['groups#show', 'groups#activity', 'groups#subgroups'], html_options: { class: 'home' }) do = nav_link(path: ['groups#show', 'groups#activity', 'groups#subgroups'], html_options: { class: 'home' }) do
= sidebar_link group_path(@group), title: _('Group overview') do = link_to group_path(@group) do
.nav-icon-container .nav-icon-container
= custom_icon('project') = custom_icon('project')
%span.nav-item-name %span.nav-item-name
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
Activity Activity
= nav_link(path: ['groups#issues', 'labels#index', 'milestones#index']) do = nav_link(path: ['groups#issues', 'labels#index', 'milestones#index']) do
= sidebar_link issues_group_path(@group), title: _('Issues') do = link_to issues_group_path(@group) do
.nav-icon-container .nav-icon-container
= custom_icon('issues') = custom_icon('issues')
%span.nav-item-name %span.nav-item-name
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
Milestones Milestones
= nav_link(path: 'groups#merge_requests') do = nav_link(path: 'groups#merge_requests') do
= sidebar_link merge_requests_group_path(@group), title: _('Merge Requests') do = link_to merge_requests_group_path(@group) do
.nav-icon-container .nav-icon-container
= custom_icon('mr_bold') = custom_icon('mr_bold')
%span.nav-item-name %span.nav-item-name
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
#{ _('Merge Requests') } #{ _('Merge Requests') }
%span.badge.count.merge_counter.js-merge-counter.fly-out-badge= number_with_delimiter(merge_requests.count) %span.badge.count.merge_counter.js-merge-counter.fly-out-badge= number_with_delimiter(merge_requests.count)
= nav_link(path: 'group_members#index') do = nav_link(path: 'group_members#index') do
= sidebar_link group_group_members_path(@group), title: _('Members') do = link_to group_group_members_path(@group) do
.nav-icon-container .nav-icon-container
= custom_icon('members') = custom_icon('members')
%span.nav-item-name %span.nav-item-name
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
#{ _('Members') } #{ _('Members') }
- if current_user && can?(current_user, :admin_group, @group) - if current_user && can?(current_user, :admin_group, @group)
= nav_link(path: %w[groups#projects groups#edit ci_cd#show]) do = nav_link(path: %w[groups#projects groups#edit ci_cd#show]) do
= sidebar_link edit_group_path(@group), title: _('Settings') do = link_to edit_group_path(@group) do
.nav-icon-container .nav-icon-container
= custom_icon('settings') = custom_icon('settings')
%span.nav-item-name %span.nav-item-name
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
.sidebar-context-title User Settings .sidebar-context-title User Settings
%ul.sidebar-top-level-items %ul.sidebar-top-level-items
= nav_link(path: 'profiles#show', html_options: {class: 'home'}) do = nav_link(path: 'profiles#show', html_options: {class: 'home'}) do
= sidebar_link profile_path, title: _('Profile Settings') do = link_to profile_path do
.nav-icon-container .nav-icon-container
= custom_icon('profile') = custom_icon('profile')
%span.nav-item-name %span.nav-item-name
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
%strong.fly-out-top-item-name %strong.fly-out-top-item-name
#{ _('Profile') } #{ _('Profile') }
= nav_link(controller: [:accounts, :two_factor_auths]) do = nav_link(controller: [:accounts, :two_factor_auths]) do
= sidebar_link profile_account_path, title: _('Account') do = link_to profile_account_path do
.nav-icon-container .nav-icon-container
= custom_icon('account') = custom_icon('account')
%span.nav-item-name %span.nav-item-name
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#{ _('Account') } #{ _('Account') }
- if current_application_settings.user_oauth_applications? - if current_application_settings.user_oauth_applications?
= nav_link(controller: 'oauth/applications') do = nav_link(controller: 'oauth/applications') do
= sidebar_link applications_profile_path, title: _('Applications') do = link_to applications_profile_path do
.nav-icon-container .nav-icon-container
= custom_icon('applications') = custom_icon('applications')
%span.nav-item-name %span.nav-item-name
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
%strong.fly-out-top-item-name %strong.fly-out-top-item-name
#{ _('Applications') } #{ _('Applications') }
= nav_link(controller: :chat_names) do = nav_link(controller: :chat_names) do
= sidebar_link profile_chat_names_path, title: _('Chat') do = link_to profile_chat_names_path do
.nav-icon-container .nav-icon-container
= custom_icon('chat') = custom_icon('chat')
%span.nav-item-name %span.nav-item-name
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
%strong.fly-out-top-item-name %strong.fly-out-top-item-name
#{ _('Chat') } #{ _('Chat') }
= nav_link(controller: :personal_access_tokens) do = nav_link(controller: :personal_access_tokens) do
= sidebar_link profile_personal_access_tokens_path, title: _('Access Tokens') do = link_to profile_personal_access_tokens_path do
.nav-icon-container .nav-icon-container
= custom_icon('access_tokens') = custom_icon('access_tokens')
%span.nav-item-name %span.nav-item-name
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
%strong.fly-out-top-item-name %strong.fly-out-top-item-name
#{ _('Access Tokens') } #{ _('Access Tokens') }
= nav_link(controller: :emails) do = nav_link(controller: :emails) do
= sidebar_link profile_emails_path, title: _('Emails') do = link_to profile_emails_path do
.nav-icon-container .nav-icon-container
= custom_icon('emails') = custom_icon('emails')
%span.nav-item-name %span.nav-item-name
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
#{ _('Emails') } #{ _('Emails') }
- unless current_user.ldap_user? - unless current_user.ldap_user?
= nav_link(controller: :passwords) do = nav_link(controller: :passwords) do
= sidebar_link edit_profile_password_path, title: _('Password') do = link_to edit_profile_password_path do
.nav-icon-container .nav-icon-container
= custom_icon('lock') = custom_icon('lock')
%span.nav-item-name %span.nav-item-name
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
%strong.fly-out-top-item-name %strong.fly-out-top-item-name
#{ _('Password') } #{ _('Password') }
= nav_link(controller: :notifications) do = nav_link(controller: :notifications) do
= sidebar_link profile_notifications_path, title: _('Notifications') do = link_to profile_notifications_path do
.nav-icon-container .nav-icon-container
= custom_icon('notifications') = custom_icon('notifications')
%span.nav-item-name %span.nav-item-name
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
%strong.fly-out-top-item-name %strong.fly-out-top-item-name
#{ _('Notifications') } #{ _('Notifications') }
= nav_link(controller: :keys) do = nav_link(controller: :keys) do
= sidebar_link profile_keys_path, title: _('SSH Keys') do = link_to profile_keys_path do
.nav-icon-container .nav-icon-container
= custom_icon('key') = custom_icon('key')
%span.nav-item-name %span.nav-item-name
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
%strong.fly-out-top-item-name %strong.fly-out-top-item-name
#{ _('SSH Keys') } #{ _('SSH Keys') }
= nav_link(controller: :gpg_keys) do = nav_link(controller: :gpg_keys) do
= sidebar_link profile_gpg_keys_path, title: _('GPG Keys') do = link_to profile_gpg_keys_path do
.nav-icon-container .nav-icon-container
= custom_icon('key_2') = custom_icon('key_2')
%span.nav-item-name %span.nav-item-name
...@@ -119,7 +119,7 @@ ...@@ -119,7 +119,7 @@
%strong.fly-out-top-item-name %strong.fly-out-top-item-name
#{ _('GPG Keys') } #{ _('GPG Keys') }
= nav_link(controller: :preferences) do = nav_link(controller: :preferences) do
= sidebar_link profile_preferences_path, title: _('Preferences') do = link_to profile_preferences_path do
.nav-icon-container .nav-icon-container
= custom_icon('preferences') = custom_icon('preferences')
%span.nav-item-name %span.nav-item-name
...@@ -130,7 +130,7 @@ ...@@ -130,7 +130,7 @@
%strong.fly-out-top-item-name %strong.fly-out-top-item-name
#{ _('Preferences') } #{ _('Preferences') }
= nav_link(path: 'profiles#audit_log') do = nav_link(path: 'profiles#audit_log') do
= sidebar_link audit_log_profile_path, title: _('Authentication log') do = link_to audit_log_profile_path do
.nav-icon-container .nav-icon-container
= custom_icon('authentication_log') = custom_icon('authentication_log')
%span.nav-item-name %span.nav-item-name
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
= @project.name = @project.name
%ul.sidebar-top-level-items %ul.sidebar-top-level-items
= nav_link(path: ['projects#show', 'projects#activity', 'cycle_analytics#show'], html_options: { class: 'home' }) do = nav_link(path: ['projects#show', 'projects#activity', 'cycle_analytics#show'], html_options: { class: 'home' }) do
= sidebar_link project_path(@project), title: _('Project overview'), css: 'shortcuts-project' do = link_to project_path(@project), class: 'shortcuts-project' do
.nav-icon-container .nav-icon-container
= custom_icon('project') = custom_icon('project')
%span.nav-item-name %span.nav-item-name
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
- if project_nav_tab? :files - if project_nav_tab? :files
= nav_link(controller: %w(tree blob blame edit_tree new_tree find_file commit commits compare projects/repositories tags branches releases graphs network)) do = nav_link(controller: %w(tree blob blame edit_tree new_tree find_file commit commits compare projects/repositories tags branches releases graphs network)) do
= sidebar_link project_tree_path(@project), title: _('Repository'), css: 'shortcuts-tree' do = link_to project_tree_path(@project), class: 'shortcuts-tree' do
.nav-icon-container .nav-icon-container
= custom_icon('doc_text') = custom_icon('doc_text')
%span.nav-item-name %span.nav-item-name
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
- if project_nav_tab? :container_registry - if project_nav_tab? :container_registry
= nav_link(controller: %w[projects/registry/repositories]) do = nav_link(controller: %w[projects/registry/repositories]) do
= sidebar_link project_container_registry_index_path(@project), title: _('Container Registry'), css: 'shortcuts-container-registry' do = link_to project_container_registry_index_path(@project), class: 'shortcuts-container-registry' do
.nav-icon-container .nav-icon-container
= custom_icon('container_registry') = custom_icon('container_registry')
%span.nav-item-name %span.nav-item-name
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
- if project_nav_tab? :issues - if project_nav_tab? :issues
= nav_link(controller: @project.issues_enabled? ? [:issues, :labels, :milestones, :boards] : :issues) do = nav_link(controller: @project.issues_enabled? ? [:issues, :labels, :milestones, :boards] : :issues) do
= sidebar_link project_issues_path(@project), title: _('Issues'), css: 'shortcuts-issues' do = link_to project_issues_path(@project), class: 'shortcuts-issues' do
.nav-icon-container .nav-icon-container
= custom_icon('issues') = custom_icon('issues')
%span.nav-item-name %span.nav-item-name
...@@ -144,7 +144,7 @@ ...@@ -144,7 +144,7 @@
- if project_nav_tab? :merge_requests - if project_nav_tab? :merge_requests
= nav_link(controller: @project.issues_enabled? ? :merge_requests : [:merge_requests, :labels, :milestones]) do = nav_link(controller: @project.issues_enabled? ? :merge_requests : [:merge_requests, :labels, :milestones]) do
= sidebar_link project_merge_requests_path(@project), title: _('Merge Requests'), css: 'shortcuts-merge_requests' do = link_to project_merge_requests_path(@project), class: 'shortcuts-merge_requests' do
.nav-icon-container .nav-icon-container
= custom_icon('mr_bold') = custom_icon('mr_bold')
%span.nav-item-name %span.nav-item-name
...@@ -161,7 +161,7 @@ ...@@ -161,7 +161,7 @@
- if project_nav_tab? :pipelines - if project_nav_tab? :pipelines
= nav_link(controller: [:pipelines, :builds, :jobs, :pipeline_schedules, :environments, :artifacts]) do = nav_link(controller: [:pipelines, :builds, :jobs, :pipeline_schedules, :environments, :artifacts]) do
= sidebar_link project_pipelines_path(@project), title: _('CI / CD'), css: 'shortcuts-pipelines' do = link_to project_pipelines_path(@project), class: 'shortcuts-pipelines' do
.nav-icon-container .nav-icon-container
= custom_icon('pipeline') = custom_icon('pipeline')
%span.nav-item-name %span.nav-item-name
...@@ -205,7 +205,7 @@ ...@@ -205,7 +205,7 @@
- if project_nav_tab? :wiki - if project_nav_tab? :wiki
= nav_link(controller: :wikis) do = nav_link(controller: :wikis) do
= sidebar_link get_project_wiki_path(@project), title: _('Wiki'), css: 'shortcuts-wiki' do = link_to get_project_wiki_path(@project), class: 'shortcuts-wiki' do
.nav-icon-container .nav-icon-container
= custom_icon('wiki') = custom_icon('wiki')
%span.nav-item-name %span.nav-item-name
...@@ -218,7 +218,7 @@ ...@@ -218,7 +218,7 @@
- if project_nav_tab? :snippets - if project_nav_tab? :snippets
= nav_link(controller: :snippets) do = nav_link(controller: :snippets) do
= sidebar_link project_snippets_path(@project), title: _('Snippets'), css: 'shortcuts-snippets' do = link_to project_snippets_path(@project), class: 'shortcuts-snippets' do
.nav-icon-container .nav-icon-container
= custom_icon('snippets') = custom_icon('snippets')
%span.nav-item-name %span.nav-item-name
...@@ -231,7 +231,7 @@ ...@@ -231,7 +231,7 @@
- if project_nav_tab? :settings - if project_nav_tab? :settings
= nav_link(path: %w[projects#edit project_members#index integrations#show services#edit repository#show ci_cd#show pages#show]) do = nav_link(path: %w[projects#edit project_members#index integrations#show services#edit repository#show ci_cd#show pages#show]) do
= sidebar_link edit_project_path(@project), title: _('Settings'), css: 'shortcuts-tree' do = link_to edit_project_path(@project), class: 'shortcuts-tree' do
.nav-icon-container .nav-icon-container
= custom_icon('settings') = custom_icon('settings')
%span.nav-item-name %span.nav-item-name
......
...@@ -25,7 +25,7 @@ feature 'Group merge requests page' do ...@@ -25,7 +25,7 @@ feature 'Group merge requests page' do
end end
it 'ignores archived merge request count badges in navbar' do it 'ignores archived merge request count badges in navbar' do
expect( page.find('[aria-label="Merge Requests"] span.badge.count').text).to eq("1") expect(first(:link, text: 'Merge Requests').find('.badge').text).to eq("1")
end end
it 'ignores archived merge request count badges in state-filters' do it 'ignores archived merge request count badges in state-filters' 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