Skip to content

Commit

Permalink
Feature: add tenant management page (#2483)
Browse files Browse the repository at this point in the history
* Initial commit: add tenant management page

* Update change log

* Add super admin role to side-nav test
  • Loading branch information
NatSquared authored May 2, 2024
1 parent 645728a commit 128b4b3
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## May 2, 2024

- **Feature** Added a new landing page for tenant management [🎟️ DESENG-591](https://apps.itsm.gov.bc.ca/jira/browse/DESENG-591)
- The page will be updated to list and manage tenants in upcoming tickets.

## April 30, 2024

- **Task** Dagster ETL error [DESENG-599](https://apps.itsm.gov.bc.ca/jira/browse/DESENG-599)
Expand Down
7 changes: 7 additions & 0 deletions met-web/src/components/layout/SideNav/SideNavElements.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,11 @@ export const Routes: Route[] = [
authenticated: true,
allowedRoles: [USER_ROLES.VIEW_FEEDBACKS],
},
{
name: 'Tenant Admin',
path: '/tenantadmin',
base: 'tenantadmin',
authenticated: true,
allowedRoles: [USER_ROLES.SUPER_ADMIN],
},
];
13 changes: 13 additions & 0 deletions met-web/src/components/tenantManagement/listing/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Box, Typography } from '@mui/material';
import React from 'react';

const TenantManagement = () => {
return (
<Box sx={{ padding: '2.1em', width: '100%' }}>
<Typography variant="subtitle1">This is the tenant management page!</Typography>
{/* todo: the rest of the page */}
</Box>
);
};

export default TenantManagement;
4 changes: 4 additions & 0 deletions met-web/src/routes/AuthenticatedRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import UserProfile from 'components/userManagement/userDetails';
import ScrollToTop from 'components/scrollToTop';
import ReportSettings from 'components/survey/report';
import FormioListener from 'components/FormioListener';
import TenantManagement from 'components/tenantManagement/listing';

const AuthenticatedRoutes = () => {
return (
Expand Down Expand Up @@ -61,6 +62,9 @@ const AuthenticatedRoutes = () => {
<Route path="/engagements/:engagementId/dashboard/:dashboardType" element={<PublicDashboard />} />
<Route path="/:slug/comments/:dashboardType" element={<EngagementComments />} />
<Route path="/metadatamanagement" element={<MetadataManagement />} />
<Route element={<AuthGate allowedRoles={[USER_ROLES.SUPER_ADMIN]} />}>
<Route path="/tenantadmin" element={<TenantManagement />} />
</Route>
<Route element={<AuthGate allowedRoles={[USER_ROLES.VIEW_FEEDBACKS]} />}>
<Route path="/feedback" element={<FeedbackListing />} />
</Route>
Expand Down
3 changes: 2 additions & 1 deletion met-web/tests/unit/components/sidenav.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jest.mock('@reduxjs/toolkit/query/react', () => ({
fetchBaseQuery: jest.fn(),
}));

jest.mock('axios')
jest.mock('axios');

jest.mock('react-redux', () => ({
...jest.requireActual('react-redux'),
Expand All @@ -25,6 +25,7 @@ jest.mock('react-redux', () => ({
USER_ROLES.VIEW_SURVEYS,
USER_ROLES.VIEW_USERS,
USER_ROLES.VIEW_FEEDBACKS,
USER_ROLES.SUPER_ADMIN,
];
}),
}));
Expand Down

0 comments on commit 128b4b3

Please sign in to comment.