@kenyaemr/esm-bed-management-app 1.0.1-pre.7 → 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.
Files changed (176) hide show
  1. package/.turbo/turbo-build.log +36 -0
  2. package/README.md +6 -38
  3. package/dist/130.js +2 -0
  4. package/dist/{800.js.LICENSE.txt → 130.js.LICENSE.txt} +2 -0
  5. package/dist/130.js.map +1 -0
  6. package/dist/148.js +1 -0
  7. package/dist/148.js.map +1 -0
  8. package/dist/169.js +1 -0
  9. package/dist/169.js.map +1 -0
  10. package/dist/271.js +1 -0
  11. package/dist/319.js +1 -0
  12. package/dist/325.js +1 -0
  13. package/dist/325.js.map +1 -0
  14. package/dist/339.js +1 -0
  15. package/dist/339.js.map +1 -0
  16. package/dist/455.js +1 -1
  17. package/dist/455.js.LICENSE.txt +6 -0
  18. package/dist/455.js.map +1 -1
  19. package/dist/460.js +1 -0
  20. package/dist/501.js +1 -0
  21. package/dist/501.js.map +1 -0
  22. package/dist/542.js +1 -0
  23. package/dist/542.js.map +1 -0
  24. package/dist/574.js +1 -1
  25. package/dist/591.js +2 -0
  26. package/dist/{26.js.LICENSE.txt → 591.js.LICENSE.txt} +3 -3
  27. package/dist/591.js.map +1 -0
  28. package/dist/644.js +1 -0
  29. package/dist/757.js +1 -0
  30. package/dist/766.js +2 -0
  31. package/dist/{330.js.LICENSE.txt → 766.js.LICENSE.txt} +0 -9
  32. package/dist/766.js.map +1 -0
  33. package/dist/{294.js → 784.js} +2 -2
  34. package/dist/{294.js.map → 784.js.map} +1 -1
  35. package/dist/788.js +1 -0
  36. package/dist/807.js +1 -0
  37. package/dist/833.js +1 -0
  38. package/dist/main.js +1 -1
  39. package/dist/main.js.map +1 -1
  40. package/dist/openmrs-esm-bed-management-app.js +1 -0
  41. package/dist/{esm-kenyaemr-bed-management-app.js.buildmanifest.json → openmrs-esm-bed-management-app.js.buildmanifest.json} +202 -155
  42. package/dist/openmrs-esm-bed-management-app.js.map +1 -0
  43. package/dist/routes.json +1 -1
  44. package/jest.config.js +3 -0
  45. package/package-lock.json +5893 -0
  46. package/package.json +25 -83
  47. package/src/__mocks__/react-i18next.js +18 -14
  48. package/src/admin-card-link.component.tsx +7 -10
  49. package/src/bed-administration/bed-administration-form.component.tsx +65 -99
  50. package/src/bed-administration/bed-administration-table.component.tsx +68 -127
  51. package/src/bed-administration/bed-administration-table.scss +12 -16
  52. package/src/bed-administration/bed-administration.resource.ts +16 -18
  53. package/src/bed-administration/edit-bed-form.component.tsx +20 -31
  54. package/src/bed-administration/new-bed-form.component.tsx +28 -44
  55. package/src/{bed-admission/bed-tag → bed-tag}/bed-tag-administration-table.component.tsx +35 -60
  56. package/src/{bed-admission/bed-tag → bed-tag}/bed-tags-admin-form.component.tsx +30 -34
  57. package/src/{bed-admission/bed-tag → bed-tag}/edit-tag-form.component.tsx +17 -25
  58. package/src/{bed-admission/bed-tag → bed-tag}/new-tag-form.component.tsx +20 -27
  59. package/src/{bed-admission/bed-type → bed-type}/bed-type-admin-form.component.tsx +37 -44
  60. package/src/{bed-admission/bed-type → bed-type}/bed-type-administration-table.component.tsx +36 -60
  61. package/src/{bed-admission/bed-type → bed-type}/edit-bed-type.component.tsx +17 -25
  62. package/src/{bed-admission/bed-type → bed-type}/new-bed-type-form.component.tsx +21 -28
  63. package/src/card-header/card-header.component.tsx +20 -0
  64. package/src/card-header/card-header.scss +45 -0
  65. package/src/config-schema.ts +9 -17
  66. package/src/declarations.d.ts +5 -5
  67. package/src/empty-state/empty-state.component.tsx +6 -21
  68. package/src/empty-state/empty-state.scss +10 -10
  69. package/src/header/header.component.tsx +14 -23
  70. package/src/header/header.scss +11 -11
  71. package/src/header/illustration.component.tsx +3 -3
  72. package/src/home.component.tsx +4 -4
  73. package/src/index.ts +21 -48
  74. package/src/left-panel/left-panel.component.tsx +7 -17
  75. package/src/left-panel/left-panel.scss +8 -7
  76. package/src/left-panel-link.component.tsx +14 -24
  77. package/src/root.component.tsx +12 -12
  78. package/src/root.scss +2 -2
  79. package/src/routes.json +12 -12
  80. package/src/setup-tests.ts +1 -1
  81. package/src/summary/summary.component.tsx +16 -30
  82. package/src/summary/summary.resource.ts +116 -95
  83. package/src/summary/summary.scss +31 -29
  84. package/src/types.ts +50 -40
  85. package/src/ward-card/ward-card.component.tsx +5 -12
  86. package/src/ward-card/ward-card.scss +2 -2
  87. package/src/ward-with-beds/ward-with-beds.component.tsx +28 -47
  88. package/src/ward-with-beds/ward-with-beds.scss +5 -5
  89. package/translations/am.json +51 -0
  90. package/translations/ar.json +51 -0
  91. package/translations/en.json +48 -4
  92. package/translations/es.json +51 -0
  93. package/translations/fr.json +51 -0
  94. package/translations/he.json +51 -0
  95. package/translations/km.json +51 -0
  96. package/translations/zh.json +51 -0
  97. package/translations/zh_CN.json +51 -0
  98. package/tsconfig.json +3 -21
  99. package/webpack.config.js +1 -1
  100. package/.editorconfig +0 -12
  101. package/.eslintignore +0 -2
  102. package/.eslintrc +0 -37
  103. package/.husky/pre-commit +0 -4
  104. package/.idea/inspectionProfiles/Project_Default.xml +0 -6
  105. package/.idea/modules.xml +0 -8
  106. package/.idea/vcs.xml +0 -6
  107. package/.prettierignore +0 -14
  108. package/.turbo.json +0 -18
  109. package/.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs +0 -541
  110. package/.yarn/plugins/@yarnpkg/plugin-version.cjs +0 -550
  111. package/.yarn/versions/cb9a89ac.yml +0 -0
  112. package/LICENSE +0 -373
  113. package/dist/187.js +0 -1
  114. package/dist/187.js.map +0 -1
  115. package/dist/207.js +0 -1
  116. package/dist/207.js.map +0 -1
  117. package/dist/26.js +0 -2
  118. package/dist/26.js.map +0 -1
  119. package/dist/283.js +0 -1
  120. package/dist/283.js.map +0 -1
  121. package/dist/330.js +0 -2
  122. package/dist/330.js.map +0 -1
  123. package/dist/352.js +0 -1
  124. package/dist/352.js.map +0 -1
  125. package/dist/404.js +0 -1
  126. package/dist/404.js.map +0 -1
  127. package/dist/558.js +0 -2
  128. package/dist/558.js.LICENSE.txt +0 -14
  129. package/dist/558.js.map +0 -1
  130. package/dist/629.js +0 -1
  131. package/dist/629.js.map +0 -1
  132. package/dist/707.js +0 -1
  133. package/dist/707.js.map +0 -1
  134. package/dist/800.js +0 -2
  135. package/dist/800.js.map +0 -1
  136. package/dist/850.js +0 -1
  137. package/dist/850.js.map +0 -1
  138. package/dist/884.js +0 -1
  139. package/dist/884.js.map +0 -1
  140. package/dist/933.js +0 -1
  141. package/dist/933.js.map +0 -1
  142. package/dist/esm-kenyaemr-bed-management-app.js +0 -1
  143. package/dist/esm-kenyaemr-bed-management-app.js.map +0 -1
  144. package/i18next-parser.config.js +0 -89
  145. package/src/assets/landing-page.png +0 -0
  146. package/src/assets/logo.svg +0 -1
  147. package/src/bed-admission/active-patients/active-patients-table.component.tsx +0 -299
  148. package/src/bed-admission/active-patients/active-visits.resource.ts +0 -171
  149. package/src/bed-admission/active-patients/admission-action-button-styles.scss +0 -0
  150. package/src/bed-admission/active-patients/admission-action-button.component.tsx +0 -26
  151. package/src/bed-admission/active-patients/index.tsx +0 -15
  152. package/src/bed-admission/active-patients/patient-queues.resource.ts +0 -136
  153. package/src/bed-admission/active-patients/styles.scss +0 -284
  154. package/src/bed-admission/active-patients/view-action-menu.component.tsx +0 -33
  155. package/src/bed-admission/admitted-patients/active-admissions.resource.ts +0 -121
  156. package/src/bed-admission/admitted-patients/admitted-patients-table.component.tsx +0 -280
  157. package/src/bed-admission/admitted-patients/admitted-patients.component.tsx +0 -22
  158. package/src/bed-admission/admitted-patients/location-combo-box.component.tsx +0 -55
  159. package/src/bed-admission/admitted-patients/styles.scss +0 -284
  160. package/src/bed-admission/bed-admission-tabs-styles.scss +0 -30
  161. package/src/bed-admission/bed-admission-tabs.component.tsx +0 -69
  162. package/src/bed-admission/bed-admission.component.tsx +0 -15
  163. package/src/bed-admission/bed-admission.resource.ts +0 -35
  164. package/src/bed-admission/bed-layout/bed-layout-list.component.tsx +0 -101
  165. package/src/bed-admission/bed-layout/bed-layout.component.tsx +0 -64
  166. package/src/bed-admission/bed-layout/bed-layout.scss +0 -118
  167. package/src/bed-admission/bed-layout/min-bed-layout.component.tsx +0 -26
  168. package/src/bed-admission/createDashboardLink.tsx +0 -47
  169. package/src/bed-admission/discharged-patients/discharged-patients.componet.tsx +0 -19
  170. package/src/bed-admission/helpers/functions.ts +0 -102
  171. package/src/bed-admission/types.ts +0 -133
  172. package/src/workspace/allocate-bed-workspace.component.tsx +0 -141
  173. package/src/workspace/allocate-bed.scss +0 -117
  174. package/src/workspace/overlay.component.tsx +0 -55
  175. package/src/workspace/overlay.scss +0 -96
  176. /package/dist/{294.js.LICENSE.txt → 784.js.LICENSE.txt} +0 -0
@@ -1,6 +1,6 @@
1
1
  @use '@carbon/colors';
2
2
  @use '@carbon/layout';
3
- @use "@carbon/type";
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: 8px;
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: 0.5rem;
27
- padding-top: 0.75rem;
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: 1rem;
36
+ margin: layout.$spacing-05;
37
37
  }
38
38
 
39
39
  .middot {
40
- margin: 0 0.5rem;
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: 1rem;
47
+ margin-right: layout.$spacing-05;
48
48
  }
49
49
 
50
50
  .value {
51
- margin-left: 0.25rem;
51
+ margin-left: layout.$spacing-02;
52
52
  }
53
53
 
54
54
  .middot {
55
- margin: 0 0.5rem;
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: 72px;
70
- height: 72px;
69
+ width: 4.5rem;
70
+ height: 4.5rem;
71
71
  fill: var(--brand-03);
72
72
  }
@@ -1,6 +1,6 @@
1
- import React from "react";
2
- import styles from "./header.scss";
3
- import { Stethoscope } from "@carbon/react/icons";
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 (
@@ -1,7 +1,7 @@
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";
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,78 +1,51 @@
1
- import {
2
- getAsyncLifecycle,
3
- defineConfigSchema,
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 = "@kenyaemr/esm-bed-management-app";
5
+ const moduleName = '@ugandaemr/esm-bed-management-app';
11
6
 
12
7
  const options = {
13
- featureName: "bed-management",
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
- );
32
-
33
- export const bedAdmission = getAsyncLifecycle(
34
- () => import("./bed-admission/bed-admission.component"),
35
- options
36
- );
18
+ export const root = getAsyncLifecycle(() => import('./root.component'), options);
37
19
 
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: "bed-management",
46
- title: "Summary",
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: "administration",
54
- title: "Ward Allocation",
32
+ name: 'administration',
33
+ title: 'Ward Allocation',
55
34
  }),
56
- options
35
+ options,
57
36
  );
37
+
58
38
  export const bedTypeLeftPanelLink = getSyncLifecycle(
59
39
  createLeftPanelLink({
60
- name: "bed-type",
61
- title: "Bed Type",
40
+ name: 'bed-type',
41
+ title: 'Bed Type',
62
42
  }),
63
- options
43
+ options,
64
44
  );
65
45
  export const bedTagLeftPanelLink = getSyncLifecycle(
66
46
  createLeftPanelLink({
67
- name: "bed-tag",
68
- title: "Bed Tag",
69
- }),
70
- options
71
- );
72
- export const bedAdmissionDashboardLink = getSyncLifecycle(
73
- createDashboardLink({
74
- name: "bed-admission",
75
- title: "In Patient",
47
+ name: 'bed-tag',
48
+ title: 'Bed Tag',
76
49
  }),
77
- options
50
+ options,
78
51
  );
@@ -1,29 +1,19 @@
1
- import React, { useEffect } from "react";
2
- import {
3
- attach,
4
- detach,
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("nav-menu-slot", "bed-management-left-panel");
17
- return () => detach("nav-menu-slot", "bed-management-left-panel");
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 "@carbon/type";
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: 1rem;
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("heading-compact-01");
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: 0.25rem solid var(--brand-01);
22
+ border-left: layout.$spacing-02 solid var(--brand-01);
22
23
  outline: none;
23
- padding: 0 0.75rem;
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: 2rem;
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: 3rem;
40
+ height: layout.$spacing-09;
40
41
  }
41
42
  }
@@ -1,7 +1,7 @@
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";
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 = "summary";
23
+ urlSegment = 'summary';
28
24
  }
29
25
 
30
26
  return (
31
27
  <ConfigurableLink
32
- to={`${window.getOpenmrsSpaBase()}bed-management${
33
- name && name !== "bed-management" ? `/${name}` : ""
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
- <BrowserRouter>
47
- <LinkExtension config={config} />
48
- </BrowserRouter>
49
- );
35
+ export const createLeftPanelLink = (config: LinkConfig) => () => (
36
+ <BrowserRouter>
37
+ <LinkExtension config={config} />
38
+ </BrowserRouter>
39
+ );
@@ -1,23 +1,23 @@
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 BedAdministrationTable from "./bed-administration/bed-administration-table.component";
5
- import Home from "./home.component";
6
- import LeftPanel from "./left-panel/left-panel.component";
7
- import WardWithBeds from "./ward-with-beds/ward-with-beds.component";
8
- import styles from "./root.scss";
9
- import BedTagAdministrationTable from "./bed-admission/bed-tag/bed-tag-administration-table.component";
10
- import BedTypeAdministrationTable from "./bed-admission/bed-type/bed-type-administration-table.component";
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';
11
11
 
12
12
  const Root: React.FC = () => {
13
13
  const spaBasePath = window.spaBase;
14
14
 
15
15
  useEffect(() => {
16
16
  setLeftNav({
17
- name: "bed-management-left-panel-slot",
17
+ name: 'bed-management-left-panel-slot',
18
18
  basePath: spaBasePath,
19
19
  });
20
- return () => unsetLeftNav("bed-management-left-panel-slot");
20
+ return () => unsetLeftNav('bed-management-left-panel-slot');
21
21
  }, [spaBasePath]);
22
22
 
23
23
  return (
package/src/root.scss CHANGED
@@ -1,9 +1,9 @@
1
1
  @use '@carbon/colors';
2
- @use "@carbon/type";
2
+ @use '@carbon/layout';
3
3
 
4
4
  .container {
5
5
  background-color: colors.$white-0;
6
- height: calc(100vh - 3rem);
6
+ height: calc(100vh - layout.$spacing-09);
7
7
  }
8
8
 
9
9
  :global(.omrs-breakpoint-gt-tablet) .container {
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": "^1.2.0",
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",
@@ -32,16 +42,6 @@
32
42
  "name": "bed-admission-dashboard",
33
43
  "slot": "bed-admission-dashboard-slot"
34
44
  },
35
- {
36
- "component": "bedTypeLeftPanelLink",
37
- "name": "bed-type-left-panel-link",
38
- "slot": "bed-management-left-panel-slot"
39
- },
40
- {
41
- "component": "bedTagLeftPanelLink",
42
- "name": "bed-tag-left-panel-link",
43
- "slot": "bed-management-left-panel-slot"
44
- },
45
45
  {
46
46
  "name": "bed-admission-dashboard-link",
47
47
  "component": "bedAdmissionDashboardLink",
@@ -53,4 +53,4 @@
53
53
  }
54
54
  }
55
55
  ]
56
- }
56
+ }
@@ -1 +1 @@
1
- import "@testing-library/jest-dom/extend-expect";
1
+ import '@testing-library/jest-dom/extend-expect';
@@ -1,21 +1,16 @@
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 } 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";
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("beds", "Beds")}
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("viewBeds", "View beds")}
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
  };