@kenyaemr/esm-lab-manifest-app 5.4.2-pre.2580 → 5.4.2-pre.2589
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +2 -2
- package/dist/114.js +1 -0
- package/dist/114.js.map +1 -0
- package/dist/127.js +1 -1
- package/dist/150.js +1 -0
- package/dist/150.js.map +1 -0
- package/dist/152.js +2 -2
- package/dist/152.js.map +1 -1
- package/dist/191.js +1 -0
- package/dist/191.js.map +1 -0
- package/dist/346.js +1 -0
- package/dist/346.js.map +1 -0
- package/dist/361.js +1 -0
- package/dist/361.js.map +1 -0
- package/dist/40.js +1 -1
- package/dist/430.js +1 -1
- package/dist/430.js.map +1 -1
- package/dist/511.js +1 -0
- package/dist/511.js.map +1 -0
- package/dist/{185.js → 532.js} +8 -8
- package/dist/532.js.map +1 -0
- package/dist/558.js +1 -0
- package/dist/558.js.map +1 -0
- package/dist/569.js +1 -1
- package/dist/569.js.map +1 -1
- package/dist/588.js +1 -0
- package/dist/588.js.map +1 -0
- package/dist/608.js +1 -0
- package/dist/608.js.map +1 -0
- package/dist/611.js +1 -1
- package/dist/611.js.map +1 -1
- package/dist/{548.js → 613.js} +1 -1
- package/dist/613.js.map +1 -0
- package/dist/675.js +1 -0
- package/dist/675.js.map +1 -0
- package/dist/729.js +1 -0
- package/dist/729.js.map +1 -0
- package/dist/798.js +1 -1
- package/dist/798.js.map +1 -1
- package/dist/810.js +1 -1
- package/dist/810.js.map +1 -1
- package/dist/{607.js → 889.js} +1 -1
- package/dist/889.js.map +1 -0
- package/dist/{419.js → 911.js} +5 -5
- package/dist/911.js.map +1 -0
- package/dist/916.js +1 -1
- package/dist/924.js +1 -0
- package/dist/924.js.map +1 -0
- package/dist/946.js +1 -0
- package/dist/946.js.map +1 -0
- package/dist/988.js +1 -0
- package/dist/988.js.map +1 -0
- package/dist/kenyaemr-esm-lab-manifest-app.js +3 -3
- package/dist/kenyaemr-esm-lab-manifest-app.js.buildmanifest.json +345 -187
- package/dist/kenyaemr-esm-lab-manifest-app.js.map +1 -1
- package/dist/main.js +5 -5
- package/dist/main.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/config-schema.ts +8 -1
- package/src/dashboard/dashboard-view.component.tsx +12 -0
- package/src/dashboard/dashboard-view.scss +5 -0
- package/src/dashboard/home-dashboard.component.tsx +35 -0
- package/src/dashboard/home-dashboard.scss +28 -0
- package/src/dashboard.meta.ts +11 -0
- package/src/header/lab-manifest-detail-header.component.tsx +1 -1
- package/src/index.ts +17 -29
- package/src/nav/left-panel-link.component.tsx +83 -31
- package/src/nav/left-panel.scss +26 -0
- package/src/root.component.tsx +41 -13
- package/src/routes.json +27 -22
- package/src/side-menu/side-menu.component.tsx +6 -0
- package/src/tables/lab-manifest-table.component.tsx +49 -47
- package/translations/am.json +3 -0
- package/translations/en.json +3 -0
- package/translations/sw.json +3 -0
- package/dist/136.js +0 -1
- package/dist/136.js.map +0 -1
- package/dist/185.js.map +0 -1
- package/dist/290.js +0 -1
- package/dist/290.js.map +0 -1
- package/dist/333.js +0 -1
- package/dist/333.js.map +0 -1
- package/dist/419.js.map +0 -1
- package/dist/543.js +0 -1
- package/dist/543.js.map +0 -1
- package/dist/548.js.map +0 -1
- package/dist/581.js +0 -1
- package/dist/581.js.map +0 -1
- package/dist/607.js.map +0 -1
- package/dist/638.js +0 -1
- package/dist/638.js.map +0 -1
- package/dist/642.js +0 -1
- package/dist/642.js.map +0 -1
- package/dist/786.js +0 -1
- package/dist/786.js.map +0 -1
package/package.json
CHANGED
package/src/config-schema.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Type, validator } from '@openmrs/esm-framework';
|
|
1
|
+
import { Type, validator, validators } from '@openmrs/esm-framework';
|
|
2
2
|
|
|
3
3
|
export const configSchema = {
|
|
4
4
|
labmanifestTypes: {
|
|
@@ -39,6 +39,12 @@ export const configSchema = {
|
|
|
39
39
|
kdodIdentifierType: 'b51ffe55-3e76-44f8-89a2-14f5eaf11079',
|
|
40
40
|
},
|
|
41
41
|
},
|
|
42
|
+
leftNavMode: {
|
|
43
|
+
_type: Type.String,
|
|
44
|
+
_description: 'Sets the left nav mode for the home app.',
|
|
45
|
+
_validators: [validators.oneOf(['normal', 'collapsed', 'hidden'])],
|
|
46
|
+
_default: 'normal',
|
|
47
|
+
},
|
|
42
48
|
};
|
|
43
49
|
export interface LabManifestConfig {
|
|
44
50
|
labmanifestTypes: Array<{ id: number; type: string }>;
|
|
@@ -47,4 +53,5 @@ export interface LabManifestConfig {
|
|
|
47
53
|
cccNumberIdentifierType: string;
|
|
48
54
|
kdodIdentifierType: string;
|
|
49
55
|
};
|
|
56
|
+
leftNavMode: 'normal' | 'collapsed' | 'hidden';
|
|
50
57
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ExtensionSlot } from '@openmrs/esm-framework';
|
|
3
|
+
|
|
4
|
+
const DashboardView: React.FC<{ dashboardSlot: string; title: string }> = ({ dashboardSlot, title }) => {
|
|
5
|
+
return (
|
|
6
|
+
<>
|
|
7
|
+
<ExtensionSlot name={dashboardSlot} state={{ dashboardTitle: title }} />
|
|
8
|
+
</>
|
|
9
|
+
);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default DashboardView;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useParams } from 'react-router-dom';
|
|
3
|
+
import { ExtensionSlot, WorkspaceContainer, isDesktop, useExtensionStore, useLayoutType } from '@openmrs/esm-framework';
|
|
4
|
+
import DashboardView from './dashboard-view.component';
|
|
5
|
+
import styles from './home-dashboard.scss';
|
|
6
|
+
|
|
7
|
+
interface DashboardConfig {
|
|
8
|
+
name: string;
|
|
9
|
+
slot: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default function Dashboard() {
|
|
13
|
+
const params = useParams();
|
|
14
|
+
const extensionStore = useExtensionStore();
|
|
15
|
+
|
|
16
|
+
const layout = useLayoutType();
|
|
17
|
+
const ungroupedDashboards =
|
|
18
|
+
extensionStore.slots['lab-manifest-page-dashboard-slot']?.assignedExtensions
|
|
19
|
+
.map((e) => e.meta)
|
|
20
|
+
.filter((e) => Object.keys(e).length) || [];
|
|
21
|
+
const dashboards = ungroupedDashboards as Array<DashboardConfig>;
|
|
22
|
+
const activeDashboard = dashboards.find((dashboard) => dashboard.name === params?.dashboard) || dashboards[0];
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<>
|
|
26
|
+
<div cllabs-manifest-page-dasassName={styles.homePageWrapper}>
|
|
27
|
+
<section className={isDesktop(layout) ? styles.dashboardContainer : styles.dashboardContainerTablet}>
|
|
28
|
+
{isDesktop(layout) && <ExtensionSlot name="lab-manifest-side-nav-slot" key={layout} />}
|
|
29
|
+
<DashboardView title={activeDashboard?.name} dashboardSlot={activeDashboard?.slot} />
|
|
30
|
+
</section>
|
|
31
|
+
<WorkspaceContainer overlay contextKey="lab-manifest" />
|
|
32
|
+
</div>
|
|
33
|
+
</>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
@use '@carbon/colors';
|
|
2
|
+
@use '@carbon/layout';
|
|
3
|
+
|
|
4
|
+
.homePageWrapper {
|
|
5
|
+
display: flex;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.dashboardContainer {
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-grow: 1;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
margin: 0;
|
|
13
|
+
margin-left: 16rem;
|
|
14
|
+
background-color: colors.$gray-10;
|
|
15
|
+
|
|
16
|
+
& a {
|
|
17
|
+
width: 100%;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.dashboardContainerTablet {
|
|
22
|
+
flex-grow: 1;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.logoSection {
|
|
26
|
+
display: flex;
|
|
27
|
+
justify-content: center;
|
|
28
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const labManifestDashboardMeta = {
|
|
2
|
+
name: 'lab-manifest',
|
|
3
|
+
slot: 'lab-manifest-page-dashboard-slot',
|
|
4
|
+
title: 'Lab Manifest',
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export const manifestDashboardMeta = {
|
|
8
|
+
name: 'overview',
|
|
9
|
+
slot: 'lab-manifest-page-dashboard-slot',
|
|
10
|
+
title: 'Manifest Overview',
|
|
11
|
+
};
|
|
@@ -21,7 +21,7 @@ const LabManifestDetailHeader: React.FC<LabManifestDetailHeaderProps> = ({ manif
|
|
|
21
21
|
const { t } = useTranslation();
|
|
22
22
|
|
|
23
23
|
const handleGoBack = () => {
|
|
24
|
-
navigate({ to: window.getOpenmrsSpaBase() + `
|
|
24
|
+
navigate({ to: window.getOpenmrsSpaBase() + `lab-manifest` });
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
const handleEditManifest = () => {
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { getAsyncLifecycle, defineConfigSchema, getSyncLifecycle, registerBreadcrumbs } from '@openmrs/esm-framework';
|
|
2
2
|
import { configSchema } from './config-schema';
|
|
3
|
-
import
|
|
3
|
+
import SideNav from './side-menu/side-menu.component';
|
|
4
|
+
import { labManifestDashboardMeta, manifestDashboardMeta } from './dashboard.meta';
|
|
5
|
+
import { createDashboardLink } from './nav/left-panel-link.component';
|
|
4
6
|
|
|
5
7
|
const moduleName = '@kenyaemr/esm-lab-manifest-app';
|
|
6
8
|
|
|
@@ -12,24 +14,19 @@ const options = {
|
|
|
12
14
|
export const importTranslation = require.context('../translations', false, /.json$/, 'lazy');
|
|
13
15
|
|
|
14
16
|
export function startupApp() {
|
|
15
|
-
const labManifestBasepath = `${window.spaBase}/
|
|
17
|
+
const labManifestBasepath = `${window.spaBase}/lab-manifest`;
|
|
16
18
|
|
|
17
19
|
defineConfigSchema(moduleName, configSchema);
|
|
18
20
|
registerBreadcrumbs([
|
|
19
21
|
{
|
|
20
22
|
title: 'lab-manifest',
|
|
21
23
|
path: labManifestBasepath,
|
|
22
|
-
parent: `${window.spaBase}
|
|
24
|
+
parent: `${window.spaBase}`,
|
|
23
25
|
},
|
|
24
26
|
]);
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
export const root = getAsyncLifecycle(() => import('./root.component'), options);
|
|
28
|
-
export const labManifestOverview = getAsyncLifecycle(
|
|
29
|
-
() => import('./component/lab-manifest-overview.component'),
|
|
30
|
-
options,
|
|
31
|
-
);
|
|
32
|
-
|
|
33
30
|
export const labManifestForm = getAsyncLifecycle(() => import('./forms/lab-manifest-form.workspace'), options);
|
|
34
31
|
export const labManifestOrderToManifestForm = getAsyncLifecycle(
|
|
35
32
|
() => import('./forms/lab-manifest-orders-to-manifest.modal'),
|
|
@@ -47,26 +44,17 @@ export const requeueLabManifestConfirmModal = getAsyncLifecycle(
|
|
|
47
44
|
() => import('./forms/lab-manifest-requeue-confirm.modal'),
|
|
48
45
|
options,
|
|
49
46
|
);
|
|
50
|
-
|
|
51
|
-
//
|
|
52
|
-
|
|
53
|
-
//
|
|
54
|
-
|
|
55
|
-
//
|
|
56
|
-
|
|
57
|
-
//
|
|
58
|
-
|
|
59
|
-
export const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
title: 'Manifest overview',
|
|
63
|
-
}),
|
|
64
|
-
options,
|
|
65
|
-
);
|
|
66
|
-
export const manifestsDashboardLink = getSyncLifecycle(
|
|
67
|
-
createLeftPanelLink({
|
|
68
|
-
name: 'lab-manifest',
|
|
69
|
-
title: 'Lab manifests',
|
|
70
|
-
}),
|
|
47
|
+
|
|
48
|
+
// t('labManifestSideNav', 'Lab ManifestSideNav')
|
|
49
|
+
export const labManifestSideNav = getSyncLifecycle(SideNav, options);
|
|
50
|
+
// t('labManifestDashboard', 'Lab Manifest Dashboard')
|
|
51
|
+
export const labsManifestsDashboardLink = getSyncLifecycle(createDashboardLink(labManifestDashboardMeta), options);
|
|
52
|
+
// t('manifestOverviewDashboard', 'Manifest Overview Dashboard')
|
|
53
|
+
export const manifestOverviewDashboardLink = getSyncLifecycle(createDashboardLink(manifestDashboardMeta), options);
|
|
54
|
+
// t('labManifestComponent', 'Lab Manifest Component')
|
|
55
|
+
export const labManifestComponent = getAsyncLifecycle(() => import('./component/lab-manifest.component'), options);
|
|
56
|
+
export const labManifestDetail = getAsyncLifecycle(() => import('./component/lab-manifest-detail.component'), options);
|
|
57
|
+
export const labManifestOverview = getAsyncLifecycle(
|
|
58
|
+
() => import('./component/lab-manifest-overview.component'),
|
|
71
59
|
options,
|
|
72
60
|
);
|
|
@@ -1,43 +1,95 @@
|
|
|
1
|
-
import React, { useMemo } from 'react';
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import React, { useMemo, useEffect, useState } from 'react';
|
|
2
|
+
import { ConfigurableLink, MaybeIcon, navigate } from '@openmrs/esm-framework';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import { type CarbonIconType } from '@carbon/react/icons';
|
|
5
|
+
import styles from './left-panel.scss';
|
|
5
6
|
|
|
6
|
-
export interface
|
|
7
|
+
export interface DashboardLinkConfig {
|
|
7
8
|
name: string;
|
|
8
9
|
title: string;
|
|
10
|
+
icon?: string | CarbonIconType;
|
|
9
11
|
}
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
const {
|
|
13
|
-
const
|
|
14
|
-
const
|
|
13
|
+
const DashboardLink = ({ dashboardLinkConfig }: { dashboardLinkConfig: DashboardLinkConfig }) => {
|
|
14
|
+
const { t } = useTranslation();
|
|
15
|
+
const { name, title, icon } = dashboardLinkConfig;
|
|
16
|
+
const [currentPath, setCurrentPath] = useState(window.location.pathname);
|
|
15
17
|
|
|
16
|
-
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
const handlePathChange = () => {
|
|
20
|
+
setCurrentPath(window.location.pathname);
|
|
21
|
+
};
|
|
17
22
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
23
|
+
window.addEventListener('popstate', handlePathChange);
|
|
24
|
+
|
|
25
|
+
const originalPushState = history.pushState;
|
|
26
|
+
const originalReplaceState = history.replaceState;
|
|
27
|
+
|
|
28
|
+
history.pushState = function (...args) {
|
|
29
|
+
originalPushState.apply(history, args);
|
|
30
|
+
handlePathChange();
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
history.replaceState = function (...args) {
|
|
34
|
+
originalReplaceState.apply(history, args);
|
|
35
|
+
handlePathChange();
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
return () => {
|
|
39
|
+
window.removeEventListener('popstate', handlePathChange);
|
|
40
|
+
history.pushState = originalPushState;
|
|
41
|
+
history.replaceState = originalReplaceState;
|
|
42
|
+
};
|
|
43
|
+
}, []);
|
|
44
|
+
|
|
45
|
+
const IconComp = typeof icon !== 'string' ? (icon as CarbonIconType) : null;
|
|
46
|
+
|
|
47
|
+
const isActive = useMemo(() => {
|
|
48
|
+
const relativePath = currentPath.replace('/openmrs/spa', '');
|
|
49
|
+
|
|
50
|
+
if (name === 'lab-manifest') {
|
|
51
|
+
return relativePath === '/lab-manifest' || relativePath === '/lab-manifest/';
|
|
52
|
+
}
|
|
22
53
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
54
|
+
if (name === 'overview') {
|
|
55
|
+
return relativePath === `/lab-manifest/${name}` || relativePath === `/lab-manifest/${name}/`;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return relativePath === `/lab-manifest/${name}` || relativePath === `/lab-manifest/${name}/`;
|
|
59
|
+
}, [name, currentPath]);
|
|
60
|
+
|
|
61
|
+
const linkUrl = useMemo(() => {
|
|
62
|
+
const basePath = '/openmrs/spa/lab-manifest';
|
|
63
|
+
if (name === 'lab-manifest') {
|
|
64
|
+
return basePath;
|
|
65
|
+
}
|
|
66
|
+
return `${basePath}/${name}`;
|
|
67
|
+
}, [name]);
|
|
68
|
+
|
|
69
|
+
const handleClick = (e: React.MouseEvent) => {
|
|
70
|
+
e.preventDefault();
|
|
71
|
+
navigate({ to: linkUrl });
|
|
72
|
+
};
|
|
28
73
|
|
|
29
74
|
return (
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
{
|
|
34
|
-
|
|
75
|
+
<a
|
|
76
|
+
href={linkUrl}
|
|
77
|
+
onClick={handleClick}
|
|
78
|
+
className={`cds--side-nav__link ${styles.dashboardLink} ${
|
|
79
|
+
isActive ? `${styles.active} active-left-nav-link` : ''
|
|
80
|
+
}`}>
|
|
81
|
+
{typeof icon === 'string' ? (
|
|
82
|
+
<MaybeIcon icon={icon} className={styles.icon} size={16} />
|
|
83
|
+
) : (
|
|
84
|
+
IconComp && <IconComp className={styles.icon} />
|
|
85
|
+
)}
|
|
86
|
+
<span>{t(title)}</span>
|
|
87
|
+
</a>
|
|
35
88
|
);
|
|
36
|
-
}
|
|
89
|
+
};
|
|
37
90
|
|
|
38
|
-
export const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
);
|
|
91
|
+
export const createDashboardLink = (dashboardLinkConfig: DashboardLinkConfig) => () => {
|
|
92
|
+
return <DashboardLink dashboardLinkConfig={dashboardLinkConfig} />;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export default DashboardLink;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
@use '@carbon/colors';
|
|
2
|
+
@use '@carbon/layout';
|
|
3
|
+
|
|
4
|
+
.menu {
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.icon {
|
|
11
|
+
margin-right: layout.$spacing-05;
|
|
12
|
+
fill: colors.$gray-70;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.dashboardLink {
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
text-decoration: none;
|
|
19
|
+
background-color: transparent;
|
|
20
|
+
color: var(--cds-text-secondary);
|
|
21
|
+
|
|
22
|
+
&.active {
|
|
23
|
+
background-color: var(--cds-background-active);
|
|
24
|
+
color: var(--cds-text-primary);
|
|
25
|
+
}
|
|
26
|
+
}
|
package/src/root.component.tsx
CHANGED
|
@@ -1,20 +1,48 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { BrowserRouter, Route, Routes } from 'react-router-dom';
|
|
3
|
-
import LabManifestComponent from './component/lab-manifest.component';
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { BrowserRouter, Route, Routes, useLocation } from 'react-router-dom';
|
|
4
3
|
import LabManifestDetail from './component/lab-manifest-detail.component';
|
|
5
|
-
import
|
|
4
|
+
import { useConfig, useLeftNav } from '@openmrs/esm-framework';
|
|
5
|
+
import { LabManifestConfig } from './config-schema';
|
|
6
|
+
import Dashboard from './dashboard/home-dashboard.component';
|
|
6
7
|
|
|
7
|
-
const
|
|
8
|
-
const
|
|
8
|
+
const LeftNavController: React.FC<{ children: React.ReactNode }> = ({ children }) => {
|
|
9
|
+
const location = useLocation();
|
|
10
|
+
const spaBasePath = `${window.spaBase}/lab-manifest`;
|
|
11
|
+
const { leftNavMode: configLeftNavMode } = useConfig<LabManifestConfig>();
|
|
12
|
+
const [currentLeftNavMode, setCurrentLeftNavMode] = useState<'normal' | 'collapsed' | 'hidden'>(configLeftNavMode);
|
|
13
|
+
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
const isDetailPage = location.pathname.includes('/lab-manifest/detail/');
|
|
16
|
+
|
|
17
|
+
if (isDetailPage) {
|
|
18
|
+
setCurrentLeftNavMode('hidden');
|
|
19
|
+
} else {
|
|
20
|
+
setCurrentLeftNavMode(configLeftNavMode);
|
|
21
|
+
}
|
|
22
|
+
}, [location.pathname, configLeftNavMode]);
|
|
23
|
+
|
|
24
|
+
useLeftNav({
|
|
25
|
+
name: 'lab-manifest-page-dashboard-slot',
|
|
26
|
+
basePath: spaBasePath,
|
|
27
|
+
mode: currentLeftNavMode,
|
|
28
|
+
});
|
|
9
29
|
|
|
30
|
+
return <>{children}</>;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const Root: React.FC = () => {
|
|
10
34
|
return (
|
|
11
|
-
<
|
|
12
|
-
<
|
|
13
|
-
<
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
35
|
+
<main>
|
|
36
|
+
<BrowserRouter basename={window.spaBase}>
|
|
37
|
+
<LeftNavController>
|
|
38
|
+
<Routes>
|
|
39
|
+
<Route path="/lab-manifest/detail/:manifestUuid" element={<LabManifestDetail />} />
|
|
40
|
+
<Route path="/lab-manifest/:dashboard" element={<Dashboard />} />
|
|
41
|
+
<Route path="/lab-manifest" element={<Dashboard />} />
|
|
42
|
+
</Routes>
|
|
43
|
+
</LeftNavController>
|
|
44
|
+
</BrowserRouter>
|
|
45
|
+
</main>
|
|
18
46
|
);
|
|
19
47
|
};
|
|
20
48
|
|
package/src/routes.json
CHANGED
|
@@ -5,12 +5,28 @@
|
|
|
5
5
|
},
|
|
6
6
|
"extensions": [
|
|
7
7
|
{
|
|
8
|
-
"
|
|
9
|
-
"
|
|
8
|
+
"name": "lab-manifest-side-nav",
|
|
9
|
+
"slot": "lab-manifest-side-nav-slot",
|
|
10
|
+
"component": "labManifestSideNav"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"name": "lab-manifest-dashboard-db-link",
|
|
14
|
+
"slot": "lab-manifest-page-dashboard-slot",
|
|
15
|
+
"component": "labsManifestsDashboardLink",
|
|
10
16
|
"meta": {
|
|
11
17
|
"name": "lab-manifest",
|
|
12
|
-
"title": "Lab manifest
|
|
13
|
-
"slot": "
|
|
18
|
+
"title": "Lab manifest",
|
|
19
|
+
"slot": "labs-manifest-homepage-dashboard-slot"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"name": "manifest-overview-dashboard-db-link",
|
|
24
|
+
"slot": "lab-manifest-page-dashboard-slot",
|
|
25
|
+
"component": "manifestOverviewDashboardLink",
|
|
26
|
+
"meta": {
|
|
27
|
+
"name": "overview",
|
|
28
|
+
"title": "Manifest Overview",
|
|
29
|
+
"slot": "labs-overview-homepage-dashboard-slot"
|
|
14
30
|
}
|
|
15
31
|
},
|
|
16
32
|
{
|
|
@@ -19,21 +35,14 @@
|
|
|
19
35
|
"slot": "lab-manifest-slot"
|
|
20
36
|
},
|
|
21
37
|
{
|
|
22
|
-
"component": "
|
|
23
|
-
"name": "lab-manifest-
|
|
24
|
-
"slot": "
|
|
38
|
+
"component": "labManifestComponent",
|
|
39
|
+
"name": "lab-manifest-dashboard",
|
|
40
|
+
"slot": "labs-manifest-homepage-dashboard-slot"
|
|
25
41
|
},
|
|
26
42
|
{
|
|
27
|
-
"component": "
|
|
28
|
-
"name": "manifest-overview
|
|
29
|
-
"
|
|
30
|
-
"slot": "diagnostics-group-nav-slot"
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"component": "manifestsDashboardLink",
|
|
34
|
-
"name": "manifests-dashboard-link",
|
|
35
|
-
"order": 2,
|
|
36
|
-
"slot": "diagnostics-group-nav-slot"
|
|
43
|
+
"component": "labManifestOverview",
|
|
44
|
+
"name": "lab-manifest-overview",
|
|
45
|
+
"slot": "labs-overview-homepage-dashboard-slot"
|
|
37
46
|
},
|
|
38
47
|
{
|
|
39
48
|
"name": "lab-manifest-form",
|
|
@@ -52,7 +61,7 @@
|
|
|
52
61
|
"component": "manifestStatusChangeConfirmModal"
|
|
53
62
|
},
|
|
54
63
|
{
|
|
55
|
-
"name": "lab-manifest-requeue-
|
|
64
|
+
"name": "lab-manifest-requeue-confirm-modal",
|
|
56
65
|
"component": "requeueLabManifestConfirmModal"
|
|
57
66
|
}
|
|
58
67
|
],
|
|
@@ -60,10 +69,6 @@
|
|
|
60
69
|
{
|
|
61
70
|
"component": "root",
|
|
62
71
|
"route": "lab-manifest"
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
"component": "labManifestOverview",
|
|
66
|
-
"route": "lab-manifest-overview"
|
|
67
72
|
}
|
|
68
73
|
]
|
|
69
74
|
}
|
|
@@ -104,7 +104,7 @@ const LabManifestsTable = () => {
|
|
|
104
104
|
);
|
|
105
105
|
|
|
106
106
|
const handleViewManifestSamples = (manifestUuid: string) => {
|
|
107
|
-
navigate({ to: window.getOpenmrsSpaBase() + `
|
|
107
|
+
navigate({ to: window.getOpenmrsSpaBase() + `lab-manifest/detail/${manifestUuid}` });
|
|
108
108
|
};
|
|
109
109
|
|
|
110
110
|
const handleEditManifest = (manifest: MappedLabManifest) => {
|
|
@@ -221,53 +221,55 @@ const LabManifestsTable = () => {
|
|
|
221
221
|
}
|
|
222
222
|
return (
|
|
223
223
|
<div className={styles.widgetContainer}>
|
|
224
|
-
<
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
<
|
|
234
|
-
<
|
|
235
|
-
<
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
</TableHead>
|
|
247
|
-
<TableBody>
|
|
248
|
-
{rows.map((row) => (
|
|
249
|
-
<TableRow key={row.id}>
|
|
250
|
-
{row.cells.map((cell) => {
|
|
251
|
-
const value = cell.value instanceof Date ? formatDate(cell.value) : cell.value;
|
|
252
|
-
return <TableCell key={cell.id}>{value}</TableCell>;
|
|
253
|
-
})}
|
|
224
|
+
<main className="omrs-main-content">
|
|
225
|
+
<LabManifestTableFilterHeader filter={currFilter} onFilterChange={setCurrFilter} title={headerTitle} />
|
|
226
|
+
<DataTable
|
|
227
|
+
useZebraStyles
|
|
228
|
+
size="sm"
|
|
229
|
+
rows={tableRows ?? []}
|
|
230
|
+
sortRow={customSortRow}
|
|
231
|
+
headers={headers}
|
|
232
|
+
render={({ rows, headers, getHeaderProps, getTableProps, getTableContainerProps }) => (
|
|
233
|
+
<TableContainer {...getTableContainerProps()}>
|
|
234
|
+
<Table {...getTableProps()}>
|
|
235
|
+
<TableHead>
|
|
236
|
+
<TableRow>
|
|
237
|
+
{headers.map((header) => (
|
|
238
|
+
<TableHeader
|
|
239
|
+
{...getHeaderProps({
|
|
240
|
+
header,
|
|
241
|
+
isSortable: true,
|
|
242
|
+
})}>
|
|
243
|
+
{header.header}
|
|
244
|
+
</TableHeader>
|
|
245
|
+
))}
|
|
254
246
|
</TableRow>
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
247
|
+
</TableHead>
|
|
248
|
+
<TableBody>
|
|
249
|
+
{rows.map((row) => (
|
|
250
|
+
<TableRow key={row.id}>
|
|
251
|
+
{row.cells.map((cell) => {
|
|
252
|
+
const value = cell.value instanceof Date ? formatDate(cell.value) : cell.value;
|
|
253
|
+
return <TableCell key={cell.id}>{value}</TableCell>;
|
|
254
|
+
})}
|
|
255
|
+
</TableRow>
|
|
256
|
+
))}
|
|
257
|
+
</TableBody>
|
|
258
|
+
</Table>
|
|
259
|
+
</TableContainer>
|
|
260
|
+
)}
|
|
261
|
+
/>
|
|
262
|
+
<Pagination
|
|
263
|
+
page={currentPage}
|
|
264
|
+
pageSize={pageSize}
|
|
265
|
+
pageSizes={pageSizes}
|
|
266
|
+
totalItems={manifests.length}
|
|
267
|
+
onChange={({ page, pageSize }) => {
|
|
268
|
+
goTo(page);
|
|
269
|
+
setPageSize(pageSize);
|
|
270
|
+
}}
|
|
271
|
+
/>
|
|
272
|
+
</main>
|
|
271
273
|
</div>
|
|
272
274
|
);
|
|
273
275
|
};
|
package/translations/am.json
CHANGED
|
@@ -17,10 +17,13 @@
|
|
|
17
17
|
"errorRemovingSample": "ናሙና {{sample}} ከማኒፌስት በማስወገድ ላይ ስህተት",
|
|
18
18
|
"lab Manifest": "የላብራቶሪ ማኒፌስት",
|
|
19
19
|
"labManifest": "የላብራቶሪ ማኒፌስት",
|
|
20
|
+
"labManifestComponent": "Lab Manifest Component",
|
|
20
21
|
"labManifestDashboard": "የላብራቶሪ ማኒፌስት ዳሽቦርድ",
|
|
21
22
|
"labManifestSamples": "የላብራቶሪ ማኒፌስት ናሙናዎች",
|
|
23
|
+
"labManifestSideNav": "Lab ManifestSideNav",
|
|
22
24
|
"labPersonContact": "የላብራቶሪ ሰው ግንኙነት",
|
|
23
25
|
"manifestId": "የማኒፌስት መለያ",
|
|
26
|
+
"manifestOverviewDashboard": "Manifest Overview Dashboard",
|
|
24
27
|
"manifestSamples": "የማኒፌስት ናሙናዎች",
|
|
25
28
|
"notLabManifetToDisplay": "ምንም {{status}} የላብራቶሪ ማኒፌስት ዳታ የለም።",
|
|
26
29
|
"patient": "ታካሚ",
|