Commit 61b8062a authored by Dmytro Zaporozhets (DZ)'s avatar Dmytro Zaporozhets (DZ)

Merge branch '233449-aqualls-enCAPSulate' into 'master'

Revise the navbar to use sentence case

See merge request gitlab-org/gitlab!60324
parents 542e8c90 9e677ac0
- navbar_links = links.sort_by(&:title) - navbar_links = links.sort_by(&:title)
- all_paths = navbar_links.map(&:path) - all_paths = navbar_links.map(&:path)
- analytics_link = navbar_links.find { |link| link.title == _('Value Stream') } || navbar_links.first - analytics_link = navbar_links.find { |link| link.title == _('Value stream') } || navbar_links.first
- if navbar_links.any? - if navbar_links.any?
= nav_link(path: all_paths) do = nav_link(path: all_paths) do
......
...@@ -28,7 +28,7 @@ module EE ...@@ -28,7 +28,7 @@ module EE
return unless group_sidebar_link?(:merge_request_analytics) # rubocop: disable Lint/UnreachableCode return unless group_sidebar_link?(:merge_request_analytics) # rubocop: disable Lint/UnreachableCode
navbar_sub_item( navbar_sub_item(
title: _('Merge Request'), title: _('Merge request'),
path: 'groups/analytics/merge_request_analytics#show', path: 'groups/analytics/merge_request_analytics#show',
link: group_analytics_merge_request_analytics_path(group) link: group_analytics_merge_request_analytics_path(group)
) )
...@@ -38,7 +38,7 @@ module EE ...@@ -38,7 +38,7 @@ module EE
return unless group_sidebar_link?(:cycle_analytics) return unless group_sidebar_link?(:cycle_analytics)
navbar_sub_item( navbar_sub_item(
title: _('Value Stream'), title: _('Value stream'),
path: 'groups/analytics/cycle_analytics#show', path: 'groups/analytics/cycle_analytics#show',
link: group_analytics_cycle_analytics_path(group) link: group_analytics_cycle_analytics_path(group)
) )
...@@ -48,7 +48,7 @@ module EE ...@@ -48,7 +48,7 @@ module EE
return unless group_sidebar_link?(:group_devops_adoption) return unless group_sidebar_link?(:group_devops_adoption)
navbar_sub_item( navbar_sub_item(
title: _('DevOps Adoption'), title: _('DevOps adoption'),
path: 'groups/analytics/devops_adoption#show', path: 'groups/analytics/devops_adoption#show',
link: group_analytics_devops_adoption_path(group) link: group_analytics_devops_adoption_path(group)
) )
......
...@@ -44,7 +44,7 @@ module EE ...@@ -44,7 +44,7 @@ module EE
end end
::Sidebars::MenuItem.new( ::Sidebars::MenuItem.new(
title: _('Code Review'), title: _('Code review'),
link: project_analytics_code_reviews_path(context.project), link: project_analytics_code_reviews_path(context.project),
active_routes: { path: 'projects/analytics/code_reviews#index' }, active_routes: { path: 'projects/analytics/code_reviews#index' },
item_id: :code_review item_id: :code_review
...@@ -76,7 +76,7 @@ module EE ...@@ -76,7 +76,7 @@ module EE
end end
::Sidebars::MenuItem.new( ::Sidebars::MenuItem.new(
title: _('Merge Request'), title: _('Merge request'),
link: project_analytics_merge_request_analytics_path(context.project), link: project_analytics_merge_request_analytics_path(context.project),
active_routes: { path: 'projects/analytics/merge_request_analytics#show' }, active_routes: { path: 'projects/analytics/merge_request_analytics#show' },
item_id: :merge_requests item_id: :merge_requests
......
...@@ -52,7 +52,7 @@ RSpec.describe Projects::Analytics::MergeRequestAnalyticsController do ...@@ -52,7 +52,7 @@ RSpec.describe Projects::Analytics::MergeRequestAnalyticsController do
end end
it 'renders the side navigation with the correct submenu set as active' do it 'renders the side navigation with the correct submenu set as active' do
expect(response.body).to have_active_sub_navigation('Merge Request') expect(response.body).to have_active_sub_navigation('Merge request')
end end
end end
end end
......
...@@ -28,7 +28,7 @@ RSpec.describe 'Group navbar' do ...@@ -28,7 +28,7 @@ RSpec.describe 'Group navbar' do
insert_after_sub_nav_item( insert_after_sub_nav_item(
_('Contribution'), _('Contribution'),
within: _('Analytics'), within: _('Analytics'),
new_sub_nav_item_name: _('DevOps Adoption') new_sub_nav_item_name: _('DevOps adoption')
) )
visit group_path(group) visit group_path(group)
...@@ -60,7 +60,7 @@ RSpec.describe 'Group navbar' do ...@@ -60,7 +60,7 @@ RSpec.describe 'Group navbar' do
insert_after_sub_nav_item( insert_after_sub_nav_item(
_('Contribution'), _('Contribution'),
within: _('Analytics'), within: _('Analytics'),
new_sub_nav_item_name: _('Value Stream') new_sub_nav_item_name: _('Value stream')
) )
visit group_path(group) visit group_path(group)
......
...@@ -30,7 +30,7 @@ RSpec.describe 'Project active tab' do ...@@ -30,7 +30,7 @@ RSpec.describe 'Project active tab' do
end end
it_behaves_like 'page has active tab', _('Analytics') it_behaves_like 'page has active tab', _('Analytics')
it_behaves_like 'page has active sub tab', _('Code Review') it_behaves_like 'page has active sub tab', _('Code review')
end end
context 'on project CI/CD' do context 'on project CI/CD' do
......
...@@ -23,7 +23,7 @@ RSpec.describe 'Project navbar' do ...@@ -23,7 +23,7 @@ RSpec.describe 'Project navbar' do
stub_licensed_features(issues_analytics: true) stub_licensed_features(issues_analytics: true)
insert_after_sub_nav_item( insert_after_sub_nav_item(
_('Code Review'), _('Code review'),
within: _('Analytics'), within: _('Analytics'),
new_sub_nav_item_name: _('Issue') new_sub_nav_item_name: _('Issue')
) )
......
...@@ -93,7 +93,7 @@ RSpec.describe 'layouts/nav/sidebar/_group' do ...@@ -93,7 +93,7 @@ RSpec.describe 'layouts/nav/sidebar/_group' do
it 'is visible' do it 'is visible' do
render render
expect(rendered).to have_text 'DevOps Adoption' expect(rendered).to have_text 'DevOps adoption'
end end
end end
...@@ -105,7 +105,7 @@ RSpec.describe 'layouts/nav/sidebar/_group' do ...@@ -105,7 +105,7 @@ RSpec.describe 'layouts/nav/sidebar/_group' do
it 'is not visible' do it 'is not visible' do
render render
expect(rendered).not_to have_text 'DevOps Adoption' expect(rendered).not_to have_text 'DevOps adoption'
end end
end end
end end
......
...@@ -282,7 +282,7 @@ RSpec.describe 'layouts/nav/sidebar/_project' do ...@@ -282,7 +282,7 @@ RSpec.describe 'layouts/nav/sidebar/_project' do
it 'has a link to the Code Review analytics page' do it 'has a link to the Code Review analytics page' do
render render
expect(rendered).to have_link('Code Review', href: project_analytics_code_reviews_path(project)) expect(rendered).to have_link('Code review', href: project_analytics_code_reviews_path(project))
end end
context 'when user does not have access' do context 'when user does not have access' do
...@@ -291,7 +291,7 @@ RSpec.describe 'layouts/nav/sidebar/_project' do ...@@ -291,7 +291,7 @@ RSpec.describe 'layouts/nav/sidebar/_project' do
it 'does not have a link to the Code Review analytics page' do it 'does not have a link to the Code Review analytics page' do
render render
expect(rendered).not_to have_link('Code Review', href: project_analytics_code_reviews_path(project)) expect(rendered).not_to have_link('Code review', href: project_analytics_code_reviews_path(project))
end end
end end
end end
...@@ -340,7 +340,7 @@ RSpec.describe 'layouts/nav/sidebar/_project' do ...@@ -340,7 +340,7 @@ RSpec.describe 'layouts/nav/sidebar/_project' do
end end
end end
describe 'Merge Request' do describe 'Merge request' do
before do before do
stub_licensed_features(project_merge_request_analytics: true) stub_licensed_features(project_merge_request_analytics: true)
end end
...@@ -348,7 +348,7 @@ RSpec.describe 'layouts/nav/sidebar/_project' do ...@@ -348,7 +348,7 @@ RSpec.describe 'layouts/nav/sidebar/_project' do
it 'has a link to the merge request analytics page' do it 'has a link to the merge request analytics page' do
render render
expect(rendered).to have_link('Merge Request', href: project_analytics_merge_request_analytics_path(project)) expect(rendered).to have_link('Merge request', href: project_analytics_merge_request_analytics_path(project))
end end
context 'when user does not have access' do context 'when user does not have access' do
...@@ -357,7 +357,7 @@ RSpec.describe 'layouts/nav/sidebar/_project' do ...@@ -357,7 +357,7 @@ RSpec.describe 'layouts/nav/sidebar/_project' do
it 'does not have a link to the merge request analytics page' do it 'does not have a link to the merge request analytics page' do
render render
expect(rendered).not_to have_link('Merge Request', href: project_analytics_merge_request_analytics_path(project)) expect(rendered).not_to have_link('Merge request', href: project_analytics_merge_request_analytics_path(project))
end end
end end
end end
......
...@@ -79,7 +79,7 @@ module Sidebars ...@@ -79,7 +79,7 @@ module Sidebars
end end
::Sidebars::MenuItem.new( ::Sidebars::MenuItem.new(
title: _('Value Stream'), title: _('Value stream'),
link: project_cycle_analytics_path(context.project), link: project_cycle_analytics_path(context.project),
container_html_options: { class: 'shortcuts-project-cycle-analytics' }, container_html_options: { class: 'shortcuts-project-cycle-analytics' },
active_routes: { path: 'cycle_analytics#show' }, active_routes: { path: 'cycle_analytics#show' },
......
...@@ -7741,6 +7741,9 @@ msgstr "" ...@@ -7741,6 +7741,9 @@ msgstr ""
msgid "Code owners" msgid "Code owners"
msgstr "" msgstr ""
msgid "Code review"
msgstr ""
msgid "Code snippet copied. Insert it in the correct location in the YAML file." msgid "Code snippet copied. Insert it in the correct location in the YAML file."
msgstr "" msgstr ""
...@@ -11069,6 +11072,9 @@ msgstr "" ...@@ -11069,6 +11072,9 @@ msgstr ""
msgid "DevOps Report" msgid "DevOps Report"
msgstr "" msgstr ""
msgid "DevOps adoption"
msgstr ""
msgid "DevopsAdoption|Add Group" msgid "DevopsAdoption|Add Group"
msgstr "" msgstr ""
...@@ -35673,9 +35679,6 @@ msgstr "" ...@@ -35673,9 +35679,6 @@ msgstr ""
msgid "Value" msgid "Value"
msgstr "" msgstr ""
msgid "Value Stream"
msgstr ""
msgid "Value Stream Analytics" msgid "Value Stream Analytics"
msgstr "" msgstr ""
...@@ -35685,6 +35688,9 @@ msgstr "" ...@@ -35685,6 +35688,9 @@ msgstr ""
msgid "Value Stream Analytics gives an overview of how much time it takes to go from idea to production in your project." msgid "Value Stream Analytics gives an overview of how much time it takes to go from idea to production in your project."
msgstr "" msgstr ""
msgid "Value stream"
msgstr ""
msgid "ValueStreamAnalyticsStage|We don't have enough data to show this stage." msgid "ValueStreamAnalyticsStage|We don't have enough data to show this stage."
msgstr "" msgstr ""
......
...@@ -138,9 +138,9 @@ RSpec.describe 'Project active tab' do ...@@ -138,9 +138,9 @@ RSpec.describe 'Project active tab' do
visit project_cycle_analytics_path(project) visit project_cycle_analytics_path(project)
end end
context 'on project Analytics/Value Stream Analytics' do context 'on project Analytics/Value stream Analytics' do
it_behaves_like 'page has active tab', _('Analytics') it_behaves_like 'page has active tab', _('Analytics')
it_behaves_like 'page has active sub tab', _('Value Stream') it_behaves_like 'page has active sub tab', _('Value stream')
end end
context 'on project Analytics/"CI/CD"' do context 'on project Analytics/"CI/CD"' do
......
...@@ -95,10 +95,10 @@ RSpec.shared_context 'project navbar structure' do ...@@ -95,10 +95,10 @@ RSpec.shared_context 'project navbar structure' do
nav_item: _('Analytics'), nav_item: _('Analytics'),
nav_sub_items: [ nav_sub_items: [
_('CI/CD'), _('CI/CD'),
(_('Code Review') if Gitlab.ee?), (_('Code review') if Gitlab.ee?),
(_('Merge Request') if Gitlab.ee?), (_('Merge request') if Gitlab.ee?),
_('Repository'), _('Repository'),
_('Value Stream') _('Value stream')
] ]
}, },
{ {
......
...@@ -695,11 +695,11 @@ RSpec.describe 'layouts/nav/sidebar/_project' do ...@@ -695,11 +695,11 @@ RSpec.describe 'layouts/nav/sidebar/_project' do
end end
end end
describe 'Value Stream' do describe 'Value stream' do
it 'has a link to the value stream page' do it 'has a link to the value stream page' do
render render
expect(rendered).to have_link('Value Stream', href: project_cycle_analytics_path(project)) expect(rendered).to have_link('Value stream', href: project_cycle_analytics_path(project))
end end
context 'when user does not have access' do context 'when user does not have access' do
...@@ -708,7 +708,7 @@ RSpec.describe 'layouts/nav/sidebar/_project' do ...@@ -708,7 +708,7 @@ RSpec.describe 'layouts/nav/sidebar/_project' do
it 'does not have a link to the value stream page' do it 'does not have a link to the value stream page' do
render render
expect(rendered).not_to have_link('Value Stream', href: project_cycle_analytics_path(project)) expect(rendered).not_to have_link('Value stream', href: project_cycle_analytics_path(project))
end 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