Skip to content

Commit

Permalink
fix: add Admin Settings to NavigationTabbar (ET-194) (#9423)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnkim-det authored May 28, 2024
1 parent 00bbda6 commit 515c135
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions webui/react/src/components/NavigationTabbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const NavigationTabbar: React.FC = () => {

const showNavigation = isAuthenticated && ui.showChrome;

const { canCreateWorkspace } = usePermissions();
const { canCreateWorkspace, canAdministrateUsers } = usePermissions();

const WorkspaceCreateModal = useModal(WorkspaceCreateModalComponent);

Expand Down Expand Up @@ -139,19 +139,27 @@ const NavigationTabbar: React.FC = () => {
</div>
),
},
];

if (canAdministrateUsers) {
overflowActionsTop.push({
icon: 'group',
label: 'Admin Settings',
onClick: (e: AnyMouseEvent) => handlePathUpdate(e, paths.admin()),
});
}

const overflowActionsBottom: OverflowActionProps[] = [
{
icon: 'settings',
label: 'Settings',
label: 'User Settings',
onClick: () => setShowSettings(true),
},
{
icon: 'user',
label: 'Sign out',
onClick: (e: AnyMouseEvent) => handlePathUpdate(e, paths.logout()),
},
];

const overflowActionsBottom: OverflowActionProps[] = [
{
external: true,
icon: 'docs',
Expand Down

0 comments on commit 515c135

Please sign in to comment.