Skip to content

Commit 37d55e4

Browse files
committed
[PRMP-788] Admin Console
1 parent c12a66c commit 37d55e4

File tree

7 files changed

+23
-45
lines changed

7 files changed

+23
-45
lines changed

app/cypress/support/feature_flags.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ export const defaultFeatureFlags: FeatureFlags = {
77
uploadArfWorkflowEnabled: true,
88
uploadLambdaEnabled: true,
99
uploadDocumentIteration2Enabled: true,
10-
uploadDocumentIteration3Enabled: false,
10+
uploadDocumentIteration3Enabled: true,
1111
};
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { JSX } from 'react';
2+
import { Routes, Route } from 'react-router';
3+
import { AdminPage } from '../adminPage/AdminPage';
4+
import { routeChildren } from '../../types/generic/routes';
5+
import { getLastURLPath } from '../../helpers/utils/urlManipulations';
6+
7+
export const AdminRoutesPage = (): JSX.Element => {
8+
return (
9+
<Routes>
10+
<Route path={getLastURLPath(routeChildren.ADMIN_REVIEW)} element={<></>} />
11+
<Route path="*" element={<AdminPage />} />
12+
</Routes>
13+
);
14+
};

app/src/pages/admin/adminPage/AdminPage.test.tsx renamed to app/src/pages/adminPage/AdminPage.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { render, screen } from '@testing-library/react';
22
import { AdminPage } from './AdminPage';
3-
import { runAxeTest } from '../../../helpers/test/axeTestHelper';
3+
import { runAxeTest } from '../../helpers/test/axeTestHelper';
44
import { describe, expect, it, vi } from 'vitest';
5-
import { routeChildren } from '../../../types/generic/routes';
5+
import { routeChildren } from '../../types/generic/routes';
66

77
vi.mock('../../../helpers/hooks/useTitle');
88

app/src/pages/admin/adminPage/AdminPage.tsx renamed to app/src/pages/adminPage/AdminPage.tsx

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { Card } from 'nhsuk-react-components';
22
import { JSX } from 'react';
3-
import useTitle from '../../../helpers/hooks/useTitle';
4-
import { routeChildren } from '../../../types/generic/routes';
5-
import { ReactComponent as RightCircleIcon } from '../../../styles/right-chevron-circle.svg';
3+
import useTitle from '../../helpers/hooks/useTitle';
4+
import { routeChildren } from '../../types/generic/routes';
5+
import { ReactComponent as RightCircleIcon } from '../../styles/right-chevron-circle.svg';
66

77
export const AdminPage = (): JSX.Element => {
88
useTitle({ pageTitle: 'Admin console' });
@@ -31,26 +31,6 @@ export const AdminPage = (): JSX.Element => {
3131
</Card.Content>
3232
</Card>
3333
</Card.GroupItem>
34-
<Card.GroupItem width="one-half">
35-
{/* Download a report */}
36-
<Card clickable cardType="primary">
37-
<Card.Content>
38-
<Card.Heading className="nhsuk-heading-m">
39-
<Card.Link
40-
data-testid="admin-download-report-btn" // TODO: Report button
41-
// href={`${routes.REPORT_DOWNLOAD}?reportType=${REPORT_TYPE.ODS_PATIENT_SUMMARY}`}
42-
>
43-
Download a report
44-
</Card.Link>
45-
</Card.Heading>
46-
<Card.Description>
47-
This report shows the list of Lloyd George records stored for your
48-
organisation.
49-
</Card.Description>
50-
<RightCircleIcon />
51-
</Card.Content>
52-
</Card>
53-
</Card.GroupItem>
5434
</Card.Group>
5535
</>
5636
);

app/src/router/AdminRouter.tsx

Lines changed: 0 additions & 13 deletions
This file was deleted.

app/src/router/AppRouter.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import NonAuthGuard from './guards/notAuthGuard/NonAuthGuard';
2727
import PatientAccessAuditPage from '../pages/patientAccessAuditPage/PatientAccessAuditPage';
2828
import MockLoginPage from '../pages/mockLoginPage/MockLoginPage';
2929
import DocumentUploadPage from '../pages/documentUploadPage/DocumentUploadPage';
30-
import { AdminRouter } from './AdminRouter';
30+
import { AdminRoutesPage } from '../pages/AdminRoutesPage/AdminRoutesPage';
3131

3232
const {
3333
START,
@@ -227,12 +227,11 @@ export const routeMap: Routes = {
227227
type: ROUTE_TYPE.PRIVATE,
228228
},
229229
[ADMIN_ROUTE]: {
230-
// TODO: Do we want a route_type.admin?
231-
page: <AdminRouter />,
230+
page: <AdminRoutesPage />,
232231
type: ROUTE_TYPE.PRIVATE,
233232
},
234233
[ADMIN_ROUTE_WILDCARD]: {
235-
page: <AdminRouter />,
234+
page: <AdminRoutesPage />,
236235
type: ROUTE_TYPE.PRIVATE,
237236
},
238237

app/src/types/generic/routes.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ export enum routeChildren {
5656
DOCUMENT_UPLOAD_FILE_ERRORS = '/patient/document-upload/file-errors',
5757

5858
ADMIN_REVIEW = '/admin/reviews',
59-
60-
REVIEWS = 'reviews/*',
6159
}
6260

6361
export enum ROUTE_TYPE {

0 commit comments

Comments
 (0)