@kenyaemr/esm-bed-management-app 1.0.1-pre.4 → 8.0.2
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 +36 -0
- package/README.md +6 -38
- package/dist/130.js +2 -0
- package/dist/{800.js.LICENSE.txt → 130.js.LICENSE.txt} +2 -0
- package/dist/130.js.map +1 -0
- package/dist/148.js +1 -0
- package/dist/148.js.map +1 -0
- package/dist/169.js +1 -0
- package/dist/169.js.map +1 -0
- package/dist/271.js +1 -0
- package/dist/319.js +1 -0
- package/dist/325.js +1 -0
- package/dist/325.js.map +1 -0
- package/dist/339.js +1 -0
- package/dist/339.js.map +1 -0
- package/dist/455.js +1 -1
- package/dist/455.js.LICENSE.txt +6 -0
- package/dist/455.js.map +1 -1
- package/dist/460.js +1 -0
- package/dist/501.js +1 -0
- package/dist/501.js.map +1 -0
- package/dist/542.js +1 -0
- package/dist/542.js.map +1 -0
- package/dist/574.js +1 -1
- package/dist/591.js +2 -0
- package/dist/{26.js.LICENSE.txt → 591.js.LICENSE.txt} +3 -3
- package/dist/591.js.map +1 -0
- package/dist/644.js +1 -0
- package/dist/757.js +1 -0
- package/dist/766.js +2 -0
- package/dist/{330.js.LICENSE.txt → 766.js.LICENSE.txt} +0 -9
- package/dist/766.js.map +1 -0
- package/dist/{294.js → 784.js} +2 -2
- package/dist/{294.js.map → 784.js.map} +1 -1
- package/dist/788.js +1 -0
- package/dist/807.js +1 -0
- package/dist/833.js +1 -0
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/openmrs-esm-bed-management-app.js +1 -0
- package/dist/{esm-kenyaemr-bed-management-app.js.buildmanifest.json → openmrs-esm-bed-management-app.js.buildmanifest.json} +202 -155
- package/dist/openmrs-esm-bed-management-app.js.map +1 -0
- package/dist/routes.json +1 -1
- package/jest.config.js +3 -0
- package/package-lock.json +5893 -0
- package/package.json +25 -83
- package/src/__mocks__/react-i18next.js +18 -14
- package/src/admin-card-link.component.tsx +7 -10
- package/src/bed-administration/bed-administration-form.component.tsx +65 -99
- package/src/bed-administration/bed-administration-table.component.tsx +68 -127
- package/src/bed-administration/bed-administration-table.scss +12 -16
- package/src/bed-administration/bed-administration-types.ts +8 -0
- package/src/bed-administration/bed-administration.resource.ts +16 -18
- package/src/bed-administration/edit-bed-form.component.tsx +20 -31
- package/src/bed-administration/new-bed-form.component.tsx +28 -44
- package/src/bed-tag/bed-tag-administration-table.component.tsx +192 -0
- package/src/bed-tag/bed-tags-admin-form.component.tsx +127 -0
- package/src/bed-tag/edit-tag-form.component.tsx +72 -0
- package/src/bed-tag/new-tag-form.component.tsx +76 -0
- package/src/bed-type/bed-type-admin-form.component.tsx +166 -0
- package/src/bed-type/bed-type-administration-table.component.tsx +198 -0
- package/src/bed-type/edit-bed-type.component.tsx +72 -0
- package/src/bed-type/new-bed-type-form.component.tsx +80 -0
- package/src/card-header/card-header.component.tsx +20 -0
- package/src/card-header/card-header.scss +45 -0
- package/src/config-schema.ts +9 -17
- package/src/declarations.d.ts +5 -5
- package/src/empty-state/empty-state.component.tsx +6 -21
- package/src/empty-state/empty-state.scss +10 -10
- package/src/header/header.component.tsx +14 -23
- package/src/header/header.scss +11 -11
- package/src/header/illustration.component.tsx +3 -3
- package/src/home.component.tsx +4 -4
- package/src/index.ts +26 -40
- package/src/left-panel/left-panel.component.tsx +7 -17
- package/src/left-panel/left-panel.scss +8 -7
- package/src/left-panel-link.component.tsx +14 -24
- package/src/root.component.tsx +14 -10
- package/src/root.scss +2 -2
- package/src/routes.json +12 -2
- package/src/setup-tests.ts +1 -1
- package/src/summary/summary.component.tsx +16 -30
- package/src/summary/summary.resource.ts +169 -60
- package/src/summary/summary.scss +31 -29
- package/src/types.ts +50 -29
- package/src/ward-card/ward-card.component.tsx +5 -12
- package/src/ward-card/ward-card.scss +2 -2
- package/src/ward-with-beds/ward-with-beds.component.tsx +28 -47
- package/src/ward-with-beds/ward-with-beds.scss +5 -5
- package/translations/am.json +51 -0
- package/translations/ar.json +51 -0
- package/translations/en.json +48 -4
- package/translations/es.json +51 -0
- package/translations/fr.json +51 -0
- package/translations/he.json +51 -0
- package/translations/km.json +51 -0
- package/translations/zh.json +51 -0
- package/translations/zh_CN.json +51 -0
- package/tsconfig.json +3 -21
- package/webpack.config.js +1 -1
- package/.editorconfig +0 -12
- package/.eslintignore +0 -2
- package/.eslintrc +0 -37
- package/.husky/pre-commit +0 -4
- package/.idea/inspectionProfiles/Project_Default.xml +0 -6
- package/.idea/modules.xml +0 -8
- package/.idea/vcs.xml +0 -6
- package/.prettierignore +0 -14
- package/.turbo.json +0 -18
- package/.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs +0 -541
- package/.yarn/plugins/@yarnpkg/plugin-version.cjs +0 -550
- package/.yarn/versions/6816f0d4.yml +0 -0
- package/LICENSE +0 -373
- package/dist/187.js +0 -1
- package/dist/187.js.map +0 -1
- package/dist/207.js +0 -1
- package/dist/207.js.map +0 -1
- package/dist/26.js +0 -2
- package/dist/26.js.map +0 -1
- package/dist/283.js +0 -1
- package/dist/283.js.map +0 -1
- package/dist/330.js +0 -2
- package/dist/330.js.map +0 -1
- package/dist/352.js +0 -1
- package/dist/352.js.map +0 -1
- package/dist/404.js +0 -1
- package/dist/404.js.map +0 -1
- package/dist/558.js +0 -2
- package/dist/558.js.LICENSE.txt +0 -14
- package/dist/558.js.map +0 -1
- package/dist/629.js +0 -1
- package/dist/629.js.map +0 -1
- package/dist/707.js +0 -1
- package/dist/707.js.map +0 -1
- package/dist/800.js +0 -2
- package/dist/800.js.map +0 -1
- package/dist/884.js +0 -1
- package/dist/884.js.map +0 -1
- package/dist/933.js +0 -1
- package/dist/933.js.map +0 -1
- package/dist/959.js +0 -1
- package/dist/959.js.map +0 -1
- package/dist/esm-kenyaemr-bed-management-app.js +0 -1
- package/dist/esm-kenyaemr-bed-management-app.js.map +0 -1
- package/i18next-parser.config.js +0 -89
- package/src/assets/landing-page.png +0 -0
- package/src/assets/logo.svg +0 -1
- package/src/bed-admission/active-patients/active-patients-table.component.tsx +0 -299
- package/src/bed-admission/active-patients/active-visits.resource.ts +0 -171
- package/src/bed-admission/active-patients/admission-action-button-styles.scss +0 -0
- package/src/bed-admission/active-patients/admission-action-button.component.tsx +0 -26
- package/src/bed-admission/active-patients/index.tsx +0 -15
- package/src/bed-admission/active-patients/patient-queues.resource.ts +0 -136
- package/src/bed-admission/active-patients/styles.scss +0 -284
- package/src/bed-admission/active-patients/view-action-menu.component.tsx +0 -33
- package/src/bed-admission/admitted-patients/active-admissions.resource.ts +0 -121
- package/src/bed-admission/admitted-patients/admitted-patients-table.component.tsx +0 -280
- package/src/bed-admission/admitted-patients/admitted-patients.component.tsx +0 -22
- package/src/bed-admission/admitted-patients/location-combo-box.component.tsx +0 -55
- package/src/bed-admission/admitted-patients/styles.scss +0 -284
- package/src/bed-admission/bed-admission-tabs-styles.scss +0 -30
- package/src/bed-admission/bed-admission-tabs.component.tsx +0 -69
- package/src/bed-admission/bed-admission.component.tsx +0 -15
- package/src/bed-admission/bed-admission.resource.ts +0 -35
- package/src/bed-admission/bed-layout/bed-layout-list.component.tsx +0 -101
- package/src/bed-admission/bed-layout/bed-layout.component.tsx +0 -64
- package/src/bed-admission/bed-layout/bed-layout.scss +0 -118
- package/src/bed-admission/bed-layout/min-bed-layout.component.tsx +0 -26
- package/src/bed-admission/createDashboardLink.tsx +0 -47
- package/src/bed-admission/discharged-patients/discharged-patients.componet.tsx +0 -19
- package/src/bed-admission/helpers/functions.ts +0 -102
- package/src/bed-admission/types.ts +0 -133
- package/src/workspace/allocate-bed-workspace.component.tsx +0 -141
- package/src/workspace/allocate-bed.scss +0 -117
- package/src/workspace/overlay.component.tsx +0 -55
- package/src/workspace/overlay.scss +0 -96
- /package/dist/{294.js.LICENSE.txt → 784.js.LICENSE.txt} +0 -0
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
@use '@carbon/colors';
|
|
2
2
|
@use '@carbon/layout';
|
|
3
|
-
@use
|
|
3
|
+
@use '@carbon/type';
|
|
4
4
|
|
|
5
5
|
.desktopHeading {
|
|
6
6
|
h4 {
|
|
7
|
-
@include type.type-style(
|
|
7
|
+
@include type.type-style('heading-compact-02');
|
|
8
8
|
color: colors.$gray-70;
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
.tabletHeading {
|
|
13
13
|
h4 {
|
|
14
|
-
@include type.type-style(
|
|
14
|
+
@include type.type-style('heading-03');
|
|
15
15
|
color: colors.$gray-70;
|
|
16
16
|
}
|
|
17
17
|
}
|
|
@@ -23,26 +23,26 @@
|
|
|
23
23
|
margin-bottom: layout.$spacing-05;
|
|
24
24
|
|
|
25
25
|
h4:after {
|
|
26
|
-
content:
|
|
26
|
+
content: '';
|
|
27
27
|
display: block;
|
|
28
|
-
width:
|
|
28
|
+
width: layout.$spacing-07;
|
|
29
29
|
padding-top: 0.188rem;
|
|
30
30
|
border-bottom: 0.375rem solid var(--brand-03);
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
.heading:after {
|
|
35
|
-
content:
|
|
35
|
+
content: '';
|
|
36
36
|
display: block;
|
|
37
|
-
width:
|
|
37
|
+
width: layout.$spacing-07;
|
|
38
38
|
padding-top: 0.188rem;
|
|
39
39
|
border-bottom: 0.375rem solid var(--brand-03);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
.tile {
|
|
43
|
-
padding:
|
|
43
|
+
padding: layout.$spacing-07;
|
|
44
44
|
border: 1px solid colors.$gray-20;
|
|
45
|
-
margin:
|
|
45
|
+
margin: layout.$spacing-06;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
.layer {
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
.content {
|
|
53
|
-
@include type.type-style(
|
|
53
|
+
@include type.type-style('heading-compact-02');
|
|
54
54
|
color: colors.$gray-70;
|
|
55
55
|
margin-top: layout.$spacing-05;
|
|
56
56
|
margin-bottom: layout.$spacing-03;
|
|
@@ -1,47 +1,38 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import { useTranslation } from "react-i18next";
|
|
8
|
-
import { Calendar, Location } from "@carbon/react/icons";
|
|
9
|
-
import Illustration from "./illustration.component";
|
|
10
|
-
import styles from "./header.scss";
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ConfigurableLink, formatDate, useSession } from '@openmrs/esm-framework';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import { Calendar, Location } from '@carbon/react/icons';
|
|
5
|
+
import Illustration from './illustration.component';
|
|
6
|
+
import styles from './header.scss';
|
|
11
7
|
|
|
12
8
|
type HeaderProps = {
|
|
13
9
|
route: string;
|
|
14
10
|
headerTitle?: string;
|
|
15
11
|
};
|
|
16
12
|
|
|
17
|
-
const Header: React.FC<HeaderProps> = ({
|
|
18
|
-
route,
|
|
19
|
-
headerTitle = "Bed Management",
|
|
20
|
-
}) => {
|
|
13
|
+
const Header: React.FC<HeaderProps> = ({ route, headerTitle = 'Bed Management' }) => {
|
|
21
14
|
const { t } = useTranslation();
|
|
22
15
|
const userSession = useSession();
|
|
23
16
|
const userLocation = userSession?.sessionLocation?.display;
|
|
24
17
|
|
|
25
18
|
return (
|
|
26
19
|
<div className={styles.header}>
|
|
27
|
-
<div className={styles[
|
|
20
|
+
<div className={styles['left-justified-items']}>
|
|
28
21
|
<ConfigurableLink to={`${window.getOpenmrsSpaBase()}bed-management`}>
|
|
29
22
|
<Illustration />
|
|
30
23
|
</ConfigurableLink>
|
|
31
|
-
<div className={styles[
|
|
32
|
-
<p>{t(
|
|
33
|
-
<p className={styles[
|
|
24
|
+
<div className={styles['page-labels']}>
|
|
25
|
+
<p>{t('headerTitle', headerTitle)}</p>
|
|
26
|
+
<p className={styles['page-name']}>{route}</p>
|
|
34
27
|
</div>
|
|
35
28
|
</div>
|
|
36
|
-
<div className={styles[
|
|
37
|
-
<div className={styles[
|
|
29
|
+
<div className={styles['right-justified-items']}>
|
|
30
|
+
<div className={styles['date-and-location']}>
|
|
38
31
|
<Location size={16} />
|
|
39
32
|
<span className={styles.value}>{userLocation}</span>
|
|
40
33
|
<span className={styles.middot}>·</span>
|
|
41
34
|
<Calendar size={16} />
|
|
42
|
-
<span className={styles.value}>
|
|
43
|
-
{formatDate(new Date(), { mode: "standard" })}
|
|
44
|
-
</span>
|
|
35
|
+
<span className={styles.value}>{formatDate(new Date(), { mode: 'standard' })}</span>
|
|
45
36
|
</div>
|
|
46
37
|
</div>
|
|
47
38
|
</div>
|
package/src/header/header.scss
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
@use '@carbon/colors';
|
|
2
2
|
@use '@carbon/layout';
|
|
3
|
-
@use
|
|
3
|
+
@use '@carbon/type';
|
|
4
4
|
|
|
5
5
|
.header {
|
|
6
6
|
@include type.type-style('body-compact-02');
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
height: layout.$spacing-12;
|
|
9
9
|
background-color: colors.$white-0;
|
|
10
10
|
display: flex;
|
|
11
|
-
padding-left:
|
|
11
|
+
padding-left: layout.$spacing-03;
|
|
12
12
|
justify-content: space-between;
|
|
13
13
|
border-bottom: 1px solid colors.$gray-20;
|
|
14
14
|
}
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
.right-justified-items {
|
|
24
24
|
@include type.type-style('body-compact-02');
|
|
25
25
|
color: colors.$gray-70;
|
|
26
|
-
margin:
|
|
27
|
-
padding-top:
|
|
26
|
+
margin: layout.$spacing-03;
|
|
27
|
+
padding-top: layout.$spacing-04;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
.page-name {
|
|
@@ -33,26 +33,26 @@
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
.page-labels {
|
|
36
|
-
margin:
|
|
36
|
+
margin: layout.$spacing-05;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
.middot {
|
|
40
|
-
margin: 0
|
|
40
|
+
margin: 0 layout.$spacing-03;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
.date-and-location {
|
|
44
44
|
display: flex;
|
|
45
45
|
justify-content: flex-end;
|
|
46
46
|
align-items: center;
|
|
47
|
-
margin-right:
|
|
47
|
+
margin-right: layout.$spacing-05;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
.value {
|
|
51
|
-
margin-left:
|
|
51
|
+
margin-left: layout.$spacing-02;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
.middot {
|
|
55
|
-
margin: 0
|
|
55
|
+
margin: 0 layout.$spacing-03;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
.view {
|
|
@@ -66,7 +66,7 @@ svg.iconOverrides {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
.svgContainer svg {
|
|
69
|
-
width:
|
|
70
|
-
height:
|
|
69
|
+
width: 4.5rem;
|
|
70
|
+
height: 4.5rem;
|
|
71
71
|
fill: var(--brand-03);
|
|
72
72
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import styles from
|
|
3
|
-
import { Stethoscope } from
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styles from './header.scss';
|
|
3
|
+
import { Stethoscope } from '@carbon/react/icons';
|
|
4
4
|
|
|
5
5
|
const Illustration: React.FC = () => {
|
|
6
6
|
return (
|
package/src/home.component.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import BedManagementSummary from
|
|
3
|
-
import Header from
|
|
4
|
-
import styles from
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import BedManagementSummary from './summary/summary.component';
|
|
3
|
+
import Header from './header/header.component';
|
|
4
|
+
import styles from './home.scss';
|
|
5
5
|
|
|
6
6
|
const Home: React.FC = () => {
|
|
7
7
|
return (
|
package/src/index.ts
CHANGED
|
@@ -1,65 +1,51 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
getSyncLifecycle,
|
|
5
|
-
} from "@openmrs/esm-framework";
|
|
6
|
-
import { configSchema } from "./config-schema";
|
|
7
|
-
import { createLeftPanelLink } from "./left-panel-link.component";
|
|
8
|
-
import { createDashboardLink } from "./bed-admission/createDashboardLink";
|
|
1
|
+
import { getAsyncLifecycle, defineConfigSchema, getSyncLifecycle } from '@openmrs/esm-framework';
|
|
2
|
+
import { configSchema } from './config-schema';
|
|
3
|
+
import { createLeftPanelLink } from './left-panel-link.component';
|
|
9
4
|
|
|
10
|
-
const moduleName =
|
|
5
|
+
const moduleName = '@ugandaemr/esm-bed-management-app';
|
|
11
6
|
|
|
12
7
|
const options = {
|
|
13
|
-
featureName:
|
|
8
|
+
featureName: 'bed-management',
|
|
14
9
|
moduleName,
|
|
15
10
|
};
|
|
16
11
|
|
|
17
|
-
export const importTranslation = require.context(
|
|
18
|
-
"../translations",
|
|
19
|
-
false,
|
|
20
|
-
/.json$/,
|
|
21
|
-
"lazy"
|
|
22
|
-
);
|
|
12
|
+
export const importTranslation = require.context('../translations', false, /.json$/, 'lazy');
|
|
23
13
|
|
|
24
14
|
export function startupApp() {
|
|
25
15
|
defineConfigSchema(moduleName, configSchema);
|
|
26
16
|
}
|
|
27
17
|
|
|
28
|
-
export const root = getAsyncLifecycle(
|
|
29
|
-
() => import("./root.component"),
|
|
30
|
-
options
|
|
31
|
-
);
|
|
18
|
+
export const root = getAsyncLifecycle(() => import('./root.component'), options);
|
|
32
19
|
|
|
33
|
-
export const
|
|
34
|
-
() => import("./bed-admission/bed-admission.component"),
|
|
35
|
-
options
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
export const adminCardLink = getAsyncLifecycle(
|
|
39
|
-
() => import("./admin-card-link.component"),
|
|
40
|
-
options
|
|
41
|
-
);
|
|
20
|
+
export const adminCardLink = getAsyncLifecycle(() => import('./admin-card-link.component'), options);
|
|
42
21
|
|
|
43
22
|
export const summaryLeftPanelLink = getSyncLifecycle(
|
|
44
23
|
createLeftPanelLink({
|
|
45
|
-
name:
|
|
46
|
-
title:
|
|
24
|
+
name: 'bed-management',
|
|
25
|
+
title: 'Summary',
|
|
47
26
|
}),
|
|
48
|
-
options
|
|
27
|
+
options,
|
|
49
28
|
);
|
|
50
29
|
|
|
51
30
|
export const adminLeftPanelLink = getSyncLifecycle(
|
|
52
31
|
createLeftPanelLink({
|
|
53
|
-
name:
|
|
54
|
-
title:
|
|
32
|
+
name: 'administration',
|
|
33
|
+
title: 'Ward Allocation',
|
|
55
34
|
}),
|
|
56
|
-
options
|
|
35
|
+
options,
|
|
57
36
|
);
|
|
58
37
|
|
|
59
|
-
export const
|
|
60
|
-
|
|
61
|
-
name:
|
|
62
|
-
title:
|
|
38
|
+
export const bedTypeLeftPanelLink = getSyncLifecycle(
|
|
39
|
+
createLeftPanelLink({
|
|
40
|
+
name: 'bed-type',
|
|
41
|
+
title: 'Bed Type',
|
|
42
|
+
}),
|
|
43
|
+
options,
|
|
44
|
+
);
|
|
45
|
+
export const bedTagLeftPanelLink = getSyncLifecycle(
|
|
46
|
+
createLeftPanelLink({
|
|
47
|
+
name: 'bed-tag',
|
|
48
|
+
title: 'Bed Tag',
|
|
63
49
|
}),
|
|
64
|
-
options
|
|
50
|
+
options,
|
|
65
51
|
);
|
|
@@ -1,29 +1,19 @@
|
|
|
1
|
-
import React, { useEffect } from
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
ExtensionSlot,
|
|
6
|
-
isDesktop,
|
|
7
|
-
useLayoutType,
|
|
8
|
-
} from "@openmrs/esm-framework";
|
|
9
|
-
import { SideNav } from "@carbon/react";
|
|
10
|
-
import styles from "./left-panel.scss";
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import { attach, detach, ExtensionSlot, isDesktop, useLayoutType } from '@openmrs/esm-framework';
|
|
3
|
+
import { SideNav } from '@carbon/react';
|
|
4
|
+
import styles from './left-panel.scss';
|
|
11
5
|
|
|
12
6
|
const LeftPanel: React.FC = () => {
|
|
13
7
|
const layout = useLayoutType();
|
|
14
8
|
|
|
15
9
|
useEffect(() => {
|
|
16
|
-
attach(
|
|
17
|
-
return () => detach(
|
|
10
|
+
attach('nav-menu-slot', 'bed-management-left-panel');
|
|
11
|
+
return () => detach('nav-menu-slot', 'bed-management-left-panel');
|
|
18
12
|
}, []);
|
|
19
13
|
|
|
20
14
|
return (
|
|
21
15
|
isDesktop(layout) && (
|
|
22
|
-
<SideNav
|
|
23
|
-
aria-label="Bed management left panel"
|
|
24
|
-
className={styles.leftPanel}
|
|
25
|
-
expanded
|
|
26
|
-
>
|
|
16
|
+
<SideNav aria-label="Bed management left panel" className={styles.leftPanel} expanded>
|
|
27
17
|
<ExtensionSlot name="bed-management-left-panel-slot" />
|
|
28
18
|
</SideNav>
|
|
29
19
|
)
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
@use '@carbon/colors';
|
|
2
|
-
@use
|
|
2
|
+
@use '@carbon/layout';
|
|
3
|
+
@use '@carbon/type';
|
|
3
4
|
|
|
4
5
|
.leftPanel {
|
|
5
6
|
border-right: 1px solid colors.$gray-20;
|
|
6
|
-
padding-top:
|
|
7
|
+
padding-top: layout.$spacing-05;
|
|
7
8
|
|
|
8
9
|
// Left nav menu item
|
|
9
10
|
:global(.cds--side-nav__link) {
|
|
10
11
|
color: colors.$gray-70;
|
|
11
|
-
@include type.type-style(
|
|
12
|
+
@include type.type-style('heading-compact-01');
|
|
12
13
|
|
|
13
14
|
&:focus,
|
|
14
15
|
&:hover {
|
|
@@ -18,9 +19,9 @@
|
|
|
18
19
|
// Active menu item
|
|
19
20
|
&:global(.active-left-nav-link) {
|
|
20
21
|
color: colors.$gray-100;
|
|
21
|
-
border-left:
|
|
22
|
+
border-left: layout.$spacing-02 solid var(--brand-01);
|
|
22
23
|
outline: none;
|
|
23
|
-
padding: 0
|
|
24
|
+
padding: 0 layout.$spacing-04;
|
|
24
25
|
background-color: colors.$gray-20;
|
|
25
26
|
}
|
|
26
27
|
}
|
|
@@ -29,13 +30,13 @@
|
|
|
29
30
|
/* Desktop */
|
|
30
31
|
:global(.omrs-breakpoint-gt-tablet) {
|
|
31
32
|
:global(.cds--side-nav__link) {
|
|
32
|
-
height:
|
|
33
|
+
height: layout.$spacing-07;
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
/* Tablet */
|
|
37
38
|
:global(.omrs-breakpoint-lt-desktop) {
|
|
38
39
|
:global(.cds--side-nav__link) {
|
|
39
|
-
height:
|
|
40
|
+
height: layout.$spacing-09;
|
|
40
41
|
}
|
|
41
42
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React, { useMemo } from
|
|
2
|
-
import last from
|
|
3
|
-
import { BrowserRouter, useLocation } from
|
|
4
|
-
import { ConfigurableLink } from
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import last from 'lodash-es/last';
|
|
3
|
+
import { BrowserRouter, useLocation } from 'react-router-dom';
|
|
4
|
+
import { ConfigurableLink } from '@openmrs/esm-framework';
|
|
5
5
|
|
|
6
6
|
export interface LinkConfig {
|
|
7
7
|
name: string;
|
|
@@ -12,38 +12,28 @@ function LinkExtension({ config }: { config: LinkConfig }) {
|
|
|
12
12
|
const { name, title } = config;
|
|
13
13
|
const location = useLocation();
|
|
14
14
|
|
|
15
|
-
let urlSegment = useMemo(
|
|
16
|
-
() => decodeURIComponent(last(location.pathname.split("/"))),
|
|
17
|
-
[location.pathname]
|
|
18
|
-
);
|
|
15
|
+
let urlSegment = useMemo(() => decodeURIComponent(last(location.pathname.split('/'))), [location.pathname]);
|
|
19
16
|
|
|
20
17
|
const isUUID = (value) => {
|
|
21
|
-
const regex =
|
|
22
|
-
/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/;
|
|
18
|
+
const regex = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/;
|
|
23
19
|
return regex.test(value);
|
|
24
20
|
};
|
|
25
21
|
|
|
26
22
|
if (isUUID(urlSegment)) {
|
|
27
|
-
urlSegment =
|
|
23
|
+
urlSegment = 'summary';
|
|
28
24
|
}
|
|
29
25
|
|
|
30
26
|
return (
|
|
31
27
|
<ConfigurableLink
|
|
32
|
-
to={`${window.getOpenmrsSpaBase()}bed-management${
|
|
33
|
-
|
|
34
|
-
}`}
|
|
35
|
-
className={`cds--side-nav__link ${
|
|
36
|
-
name === urlSegment && "active-left-nav-link"
|
|
37
|
-
}`}
|
|
38
|
-
>
|
|
28
|
+
to={`${window.getOpenmrsSpaBase()}bed-management${name && name !== 'bed-management' ? `/${name}` : ''}`}
|
|
29
|
+
className={`cds--side-nav__link ${name === urlSegment && 'active-left-nav-link'}`}>
|
|
39
30
|
{title}
|
|
40
31
|
</ConfigurableLink>
|
|
41
32
|
);
|
|
42
33
|
}
|
|
43
34
|
|
|
44
|
-
export const createLeftPanelLink = (config: LinkConfig) => () =>
|
|
45
|
-
|
|
46
|
-
<
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
);
|
|
35
|
+
export const createLeftPanelLink = (config: LinkConfig) => () => (
|
|
36
|
+
<BrowserRouter>
|
|
37
|
+
<LinkExtension config={config} />
|
|
38
|
+
</BrowserRouter>
|
|
39
|
+
);
|
package/src/root.component.tsx
CHANGED
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
import React, { useEffect } from
|
|
2
|
-
import { BrowserRouter, Route, Routes } from
|
|
3
|
-
import { setLeftNav, unsetLeftNav } from
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import { BrowserRouter, Route, Routes } from 'react-router-dom';
|
|
3
|
+
import { setLeftNav, unsetLeftNav } from '@openmrs/esm-framework';
|
|
4
|
+
import Home from './home.component';
|
|
5
|
+
import LeftPanel from './left-panel/left-panel.component';
|
|
6
|
+
import WardWithBeds from './ward-with-beds/ward-with-beds.component';
|
|
7
|
+
import BedAdministrationTable from './bed-administration/bed-administration-table.component';
|
|
8
|
+
import BedTagAdministrationTable from './bed-tag/bed-tag-administration-table.component';
|
|
9
|
+
import BedTypeAdministrationTable from './bed-type/bed-type-administration-table.component';
|
|
10
|
+
import styles from './root.scss';
|
|
9
11
|
|
|
10
12
|
const Root: React.FC = () => {
|
|
11
13
|
const spaBasePath = window.spaBase;
|
|
12
14
|
|
|
13
15
|
useEffect(() => {
|
|
14
16
|
setLeftNav({
|
|
15
|
-
name:
|
|
17
|
+
name: 'bed-management-left-panel-slot',
|
|
16
18
|
basePath: spaBasePath,
|
|
17
19
|
});
|
|
18
|
-
return () => unsetLeftNav(
|
|
20
|
+
return () => unsetLeftNav('bed-management-left-panel-slot');
|
|
19
21
|
}, [spaBasePath]);
|
|
20
22
|
|
|
21
23
|
return (
|
|
@@ -26,6 +28,8 @@ const Root: React.FC = () => {
|
|
|
26
28
|
<Route path="/" element={<Home />} />
|
|
27
29
|
<Route path="/location/:location" element={<WardWithBeds />} />
|
|
28
30
|
<Route path="/administration" element={<BedAdministrationTable />} />
|
|
31
|
+
<Route path="/bed-tag" element={<BedTagAdministrationTable />} />
|
|
32
|
+
<Route path="/bed-type" element={<BedTypeAdministrationTable />} />
|
|
29
33
|
</Routes>
|
|
30
34
|
</main>
|
|
31
35
|
</BrowserRouter>
|
package/src/root.scss
CHANGED
package/src/routes.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.openmrs.org/routes.schema.json",
|
|
3
3
|
"backendDependencies": {
|
|
4
|
-
"fhir2": "
|
|
4
|
+
"fhir2": ">=1.2",
|
|
5
5
|
"webservices.rest": "^2.24.0"
|
|
6
6
|
},
|
|
7
7
|
"pages": [
|
|
@@ -21,6 +21,16 @@
|
|
|
21
21
|
"name": "bed-administration-left-panel-link",
|
|
22
22
|
"slot": "bed-management-left-panel-slot"
|
|
23
23
|
},
|
|
24
|
+
{
|
|
25
|
+
"component": "bedTypeLeftPanelLink",
|
|
26
|
+
"name": "bed-type-left-panel-link",
|
|
27
|
+
"slot": "bed-management-left-panel-slot"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"component": "bedTagLeftPanelLink",
|
|
31
|
+
"name": "bed-tag-left-panel-link",
|
|
32
|
+
"slot": "bed-management-left-panel-slot"
|
|
33
|
+
},
|
|
24
34
|
{
|
|
25
35
|
"component": "summaryLeftPanelLink",
|
|
26
36
|
"name": "bed-management-home-dashboard-link",
|
|
@@ -43,4 +53,4 @@
|
|
|
43
53
|
}
|
|
44
54
|
}
|
|
45
55
|
]
|
|
46
|
-
}
|
|
56
|
+
}
|
package/src/setup-tests.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
@@ -1,21 +1,16 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { DataTableSkeleton } from
|
|
3
|
-
import { ArrowRight } from
|
|
4
|
-
import { useTranslation } from
|
|
5
|
-
import { ConfigurableLink } from
|
|
6
|
-
import { useAdmissionLocations } from
|
|
7
|
-
import EmptyState from
|
|
8
|
-
import WardCard from
|
|
9
|
-
import styles from
|
|
10
|
-
import { ErrorState } from "@openmrs/esm-patient-common-lib";
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DataTableSkeleton } from '@carbon/react';
|
|
3
|
+
import { ArrowRight } from '@carbon/react/icons';
|
|
4
|
+
import { useTranslation } from 'react-i18next';
|
|
5
|
+
import { ConfigurableLink, ErrorState } from '@openmrs/esm-framework';
|
|
6
|
+
import { useAdmissionLocations } from './summary.resource';
|
|
7
|
+
import EmptyState from '../empty-state/empty-state.component';
|
|
8
|
+
import WardCard from '../ward-card/ward-card.component';
|
|
9
|
+
import styles from './summary.scss';
|
|
11
10
|
|
|
12
11
|
const Summary: React.FC = () => {
|
|
13
12
|
const { t } = useTranslation();
|
|
14
|
-
const {
|
|
15
|
-
data: admissionLocations,
|
|
16
|
-
isLoading,
|
|
17
|
-
error,
|
|
18
|
-
} = useAdmissionLocations();
|
|
13
|
+
const { data: admissionLocations, isLoading, error } = useAdmissionLocations();
|
|
19
14
|
|
|
20
15
|
if (isLoading) {
|
|
21
16
|
return (
|
|
@@ -29,20 +24,17 @@ const Summary: React.FC = () => {
|
|
|
29
24
|
return (
|
|
30
25
|
<div className={styles.cardContainer}>
|
|
31
26
|
{admissionLocations.map((admissionLocation) => {
|
|
32
|
-
const routeSegment = `${window.getOpenmrsSpaBase()}bed-management/location/${
|
|
33
|
-
admissionLocation.ward.uuid
|
|
34
|
-
}`;
|
|
27
|
+
const routeSegment = `${window.getOpenmrsSpaBase()}bed-management/location/${admissionLocation.ward.uuid}`;
|
|
35
28
|
|
|
36
29
|
return (
|
|
37
30
|
<WardCard
|
|
38
31
|
headerLabel={admissionLocation.ward.display}
|
|
39
|
-
label={t(
|
|
40
|
-
value={admissionLocation?.totalBeds}
|
|
41
|
-
>
|
|
32
|
+
label={t('beds', 'Beds')}
|
|
33
|
+
value={admissionLocation?.totalBeds}>
|
|
42
34
|
{admissionLocation?.totalBeds && (
|
|
43
35
|
<div className={styles.link}>
|
|
44
36
|
<ConfigurableLink className={styles.link} to={routeSegment}>
|
|
45
|
-
{t(
|
|
37
|
+
{t('viewBeds', 'View beds')}
|
|
46
38
|
</ConfigurableLink>
|
|
47
39
|
<ArrowRight size={16} />
|
|
48
40
|
</div>
|
|
@@ -55,18 +47,12 @@ const Summary: React.FC = () => {
|
|
|
55
47
|
}
|
|
56
48
|
|
|
57
49
|
if (!isLoading && admissionLocations?.length === 0 && !error) {
|
|
58
|
-
return <EmptyState msg="No data to display" helper={
|
|
50
|
+
return <EmptyState msg="No data to display" helper={''} />;
|
|
59
51
|
}
|
|
60
52
|
|
|
61
53
|
if (error) {
|
|
62
54
|
return (
|
|
63
|
-
<ErrorState
|
|
64
|
-
headerTitle={t(
|
|
65
|
-
"errorFetchingbedInformation",
|
|
66
|
-
"Error fetching bed information"
|
|
67
|
-
)}
|
|
68
|
-
error={error}
|
|
69
|
-
/>
|
|
55
|
+
<ErrorState headerTitle={t('errorFetchingbedInformation', 'Error fetching bed information')} error={error} />
|
|
70
56
|
);
|
|
71
57
|
}
|
|
72
58
|
};
|