Skip to content

Commit

Permalink
Remove 'My Organization' link for superadmins that are also org admins
Browse files Browse the repository at this point in the history
  • Loading branch information
jp524 committed May 22, 2024
1 parent 6ba8161 commit ef20ccd
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 42 deletions.
9 changes: 0 additions & 9 deletions app/views/layouts/_lte_admin_sidebar.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,4 @@
</li>
<% end %>

<% if (current_user.organization.present?) %>
<li class="nav-item">
<%= link_to(dashboard_path, class: "nav-link") do %>
<i class="nav-icon fas fa-home"></i>
<p>My Organization</p>
<% end %>
</li>
<% end %>

</ul>
3 changes: 1 addition & 2 deletions app/views/layouts/_lte_navbar.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@
<i class="fa fa-repeat text-aqua"></i><%= "Switch to: #{role.resource&.name || "Super Admin"}" %>
<% end %>
<% end %>
<% if current_organization.id.present? &&
(current_user.has_role?(Role::SUPER_ADMIN) || current_user.has_role?(Role::ORG_ADMIN, current_organization)) %>
<% if current_user.has_role?(Role::ORG_ADMIN, current_organization) %>
<div class="dropdown-divider"></div>
<%= link_to users_path, class:"dropdown-item" do %>
<i class="fas fa-users mr-2"></i> My Co-Workers
Expand Down
30 changes: 0 additions & 30 deletions spec/system/admin/dashboard_system_spec.rb

This file was deleted.

2 changes: 1 addition & 1 deletion spec/system/navigation_system_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@

context "with superadmin user" do
let(:user) { create(:super_admin) }
let(:links) { ["Admin Dashboard", "Barcode Items", "Base Items", "Organizations", "Partners", "Users", "Announcements", "Account Requests", "FAQ", "My Organization"] }
let(:links) { ["Admin Dashboard", "Barcode Items", "Base Items", "Organizations", "Partners", "Users", "Announcements", "Account Requests", "FAQ"] }

it "shows navigation options" do
sidebar = page.find(".sidebar")
Expand Down

0 comments on commit ef20ccd

Please sign in to comment.