Skip to content

Commit

Permalink
feat: added compensation routes
Browse files Browse the repository at this point in the history
  • Loading branch information
akovylyaeva committed Dec 5, 2023
1 parent ba56248 commit 21a48a6
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/features/compensations/routes.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { ReactComponent as IconProfile } from '../../assets/icons/icon-profile.svg';
import { ReactComponent as IconProfileActive } from '../../assets/icons/icon-profile-active.svg';

export const compensationsSidebarRoutes = [
{
isWindowRedirectNecessary: true,
path: '/compensations',
label: 'Compensations',
icon: <IconProfile />,
iconActive: <IconProfileActive />,
},
];
5 changes: 5 additions & 0 deletions src/routes/adminRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
rolesSidebarRoutes,
sidebarAccountManagement,
} from '../features/account-management/routers';
import { compensationsSidebarRoutes } from '../features/compensations/routes';

export function getAdminRoutes(accessPermissions: Map<keyof typeof Permission, boolean>) {
const routes: {
Expand Down Expand Up @@ -58,6 +59,10 @@ export function getSidebarRoutes(accessPermissions: Map<keyof typeof Permission,
routes.push(...employeesSidebarRoutes);
}

if (accessPermissions.get('ViewPersonalCompensations') || accessPermissions.get('CanManageCompensations')) {
routes.push(...compensationsSidebarRoutes);
}

if (accessPermissions.get('ViewAccounts') && accessPermissions.get('ViewRoles')) {
copyAccountManagement.routes = [accountsSidebarRoutes, rolesSidebarRoutes];

Expand Down
2 changes: 2 additions & 0 deletions src/routes/state/AccessBasedOnPemissionsState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ export enum Permission {
ManageAccounts = 'ManageAccounts',
ViewRoles = 'ViewRoles',
ManageRoles = 'ManageRoles',
ViewPersonalCompensations = 'ViewPersonalCompensations',
CanManageCompensations = 'CanManageCompensations',
}

class AccessBasedOnPemissionsState {
Expand Down

0 comments on commit 21a48a6

Please sign in to comment.