Commit 730286e5 authored by huzaifaiftikhar1's avatar huzaifaiftikhar1

Move "Deleted projects" shortcut at the bottom in the navigation menu

parent 14c87fa1
...@@ -252,14 +252,14 @@ module Nav ...@@ -252,14 +252,14 @@ module Nav
} }
end end
def projects_submenu(builder) def projects_submenu(builder, should_build = true)
# These project links come from `app/views/layouts/nav/projects_dropdown/_show.html.haml` # These project links come from `app/views/layouts/nav/projects_dropdown/_show.html.haml`
builder.add_primary_menu_item(id: 'your', title: _('Your projects'), href: dashboard_projects_path) builder.add_primary_menu_item(id: 'your', title: _('Your projects'), href: dashboard_projects_path)
builder.add_primary_menu_item(id: 'starred', title: _('Starred projects'), href: starred_dashboard_projects_path) builder.add_primary_menu_item(id: 'starred', title: _('Starred projects'), href: starred_dashboard_projects_path)
builder.add_primary_menu_item(id: 'explore', title: _('Explore projects'), href: explore_root_path) builder.add_primary_menu_item(id: 'explore', title: _('Explore projects'), href: explore_root_path)
builder.add_primary_menu_item(id: 'topics', title: _('Explore topics'), href: topics_explore_projects_path) builder.add_primary_menu_item(id: 'topics', title: _('Explore topics'), href: topics_explore_projects_path)
builder.add_secondary_menu_item(id: 'create', title: _('Create new project'), href: new_project_path) builder.add_secondary_menu_item(id: 'create', title: _('Create new project'), href: new_project_path)
builder.build builder.build if should_build
end end
def groups_submenu def groups_submenu
......
...@@ -52,12 +52,14 @@ module EE ...@@ -52,12 +52,14 @@ module EE
end end
override :projects_submenu override :projects_submenu
def projects_submenu(builder) def projects_submenu(builder, should_build = true)
super(builder, false)
if License.feature_available?(:adjourned_deletion_for_projects_and_groups) if License.feature_available?(:adjourned_deletion_for_projects_and_groups)
builder.add_primary_menu_item(id: 'deleted', title: _('Deleted projects'), href: removed_dashboard_projects_path) builder.add_primary_menu_item(id: 'deleted', title: _('Deleted projects'), href: removed_dashboard_projects_path)
end end
super builder.build if should_build
end end
end end
end end
......
...@@ -132,11 +132,6 @@ RSpec.describe Nav::TopNavHelper do ...@@ -132,11 +132,6 @@ RSpec.describe Nav::TopNavHelper do
it 'has expected :linksPrimary' do it 'has expected :linksPrimary' do
expected_links_primary = [ expected_links_primary = [
::Gitlab::Nav::TopNavMenuItem.build(
href: '/dashboard/projects/removed',
id: 'deleted',
title: 'Deleted projects'
),
::Gitlab::Nav::TopNavMenuItem.build( ::Gitlab::Nav::TopNavMenuItem.build(
href: '/dashboard/projects', href: '/dashboard/projects',
id: 'your', id: 'your',
...@@ -156,6 +151,11 @@ RSpec.describe Nav::TopNavHelper do ...@@ -156,6 +151,11 @@ RSpec.describe Nav::TopNavHelper do
href: '/explore/projects/topics', href: '/explore/projects/topics',
id: 'topics', id: 'topics',
title: 'Explore topics' title: 'Explore topics'
),
::Gitlab::Nav::TopNavMenuItem.build(
href: '/dashboard/projects/removed',
id: 'deleted',
title: 'Deleted projects'
) )
] ]
expect(projects_view[:linksPrimary]).to eq(expected_links_primary) expect(projects_view[:linksPrimary]).to eq(expected_links_primary)
......
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