Commit a3b93e17 authored by Coung Ngo's avatar Coung Ngo Committed by Fatih Acet

Update sidebar to differentiate between groups, subgroups, and projects

Before, the sidebar displayed the text "Overview" when the user was in
a group, subgroup, or project. This meant it was not immediately clear
whether the user was in a group, subgroup, or project page. This commit
fixes this problem.
parent ad5498e9
......@@ -16,13 +16,19 @@
.nav-icon-container
= sprite_icon('home')
%span.nav-item-name
= _('Overview')
- if @group.subgroup?
= _('Subgroup overview')
- else
= _('Group overview')
%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
= _('Overview')
- if @group.subgroup?
= _('Subgroup overview')
- else
= _('Group overview')
%li.divider.fly-out-top-item
= nav_link(path: ['groups#show', 'groups#details', 'groups#subgroups'], html_options: { class: 'home' }) do
......
......@@ -13,13 +13,13 @@
.nav-icon-container
= sprite_icon('home')
%span.nav-item-name
= _('Project')
= _('Project overview')
%ul.sidebar-sub-level-items
= nav_link(path: 'projects#show', html_options: { class: "fly-out-top-item" } ) do
= link_to project_path(@project) do
%strong.fly-out-top-item-name
= _('Project')
= _('Project overview')
%li.divider.fly-out-top-item
= nav_link(path: 'projects#show') do
= link_to project_path(@project), title: _('Project details'), class: 'shortcuts-project' do
......
---
title: Update sidebar to differentiate between groups, subgroups, and projects
merge_request: 19158
author:
type: added
......@@ -8273,6 +8273,9 @@ msgstr ""
msgid "Group name"
msgstr ""
msgid "Group overview"
msgstr ""
msgid "Group overview content"
msgstr ""
......@@ -12737,6 +12740,9 @@ msgstr ""
msgid "Project name"
msgstr ""
msgid "Project overview"
msgstr ""
msgid "Project slug"
msgstr ""
......@@ -15847,6 +15853,9 @@ msgstr ""
msgid "StorageSize|Unknown"
msgstr ""
msgid "Subgroup overview"
msgstr ""
msgid "SubgroupCreationLevel|Allowed to create subgroups"
msgstr ""
......
......@@ -15,7 +15,7 @@ describe 'The group page' do
def expect_all_sidebar_links
within('.nav-sidebar') do
expect(page).to have_link('Overview')
expect(page).to have_link('Group overview')
expect(page).to have_link('Details')
expect(page).to have_link('Activity')
expect(page).to have_link('Issues')
......@@ -44,7 +44,7 @@ describe 'The group page' do
visit group_path(group)
within('.nav-sidebar') do
expect(page).to have_link('Overview')
expect(page).to have_link('Group overview')
expect(page).to have_link('Details')
expect(page).not_to have_link('Activity')
expect(page).not_to have_link('Contribution Analytics')
......
......@@ -237,14 +237,28 @@ describe 'Group' do
let!(:group) { create(:group) }
let!(:nested_group) { create(:group, parent: group) }
let!(:project) { create(:project, namespace: group) }
let!(:path) { group_path(group) }
it 'renders projects and groups on the page' do
visit path
visit group_path(group)
wait_for_requests
expect(page).to have_content(nested_group.name)
expect(page).to have_content(project.name)
expect(page).to have_link('Group overview')
end
it 'renders subgroup page with the text "Subgroup overview"' do
visit group_path(nested_group)
wait_for_requests
expect(page).to have_link('Subgroup overview')
end
it 'renders project page with the text "Project overview"' do
visit project_path(project)
wait_for_requests
expect(page).to have_link('Project overview')
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