@kenyaemr/esm-lab-manifest-app 5.2.1-pre.821
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 +39 -0
- package/LICENSE.md +401 -0
- package/README.md +5 -0
- package/dist/130.js +2 -0
- package/dist/130.js.LICENSE.txt +3 -0
- package/dist/130.js.map +1 -0
- package/dist/152.js +1 -0
- package/dist/152.js.map +1 -0
- package/dist/255.js +2 -0
- package/dist/255.js.LICENSE.txt +9 -0
- package/dist/255.js.map +1 -0
- package/dist/303.js +1 -0
- package/dist/303.js.map +1 -0
- package/dist/397.js +1 -0
- package/dist/397.js.map +1 -0
- package/dist/574.js +1 -0
- package/dist/589.js +1 -0
- package/dist/589.js.map +1 -0
- package/dist/591.js +2 -0
- package/dist/591.js.LICENSE.txt +32 -0
- package/dist/591.js.map +1 -0
- package/dist/712.js +1 -0
- package/dist/712.js.map +1 -0
- package/dist/729.js +1 -0
- package/dist/729.js.map +1 -0
- package/dist/784.js +2 -0
- package/dist/784.js.LICENSE.txt +9 -0
- package/dist/784.js.map +1 -0
- package/dist/803.js +1 -0
- package/dist/803.js.map +1 -0
- package/dist/883.js +1 -0
- package/dist/883.js.map +1 -0
- package/dist/896.js +1 -0
- package/dist/896.js.map +1 -0
- package/dist/949.js +1 -0
- package/dist/949.js.map +1 -0
- package/dist/975.js +2 -0
- package/dist/975.js.LICENSE.txt +50 -0
- package/dist/975.js.map +1 -0
- package/dist/kenyaemr-esm-lab-manifest-app.js +1 -0
- package/dist/kenyaemr-esm-lab-manifest-app.js.buildmanifest.json +526 -0
- package/dist/kenyaemr-esm-lab-manifest-app.js.map +1 -0
- package/dist/main.js +1 -0
- package/dist/main.js.map +1 -0
- package/dist/routes.json +1 -0
- package/jest.config.js +8 -0
- package/package.json +55 -0
- package/src/component/lab-manifest-detail.component.tsx +21 -0
- package/src/component/lab-manifest.component.tsx +18 -0
- package/src/component/left-panel-link.component.tsx +41 -0
- package/src/config-schema.ts +5 -0
- package/src/counties.json +1494 -0
- package/src/declarations.d.ts +6 -0
- package/src/forms/lab-manifest-form.scss +126 -0
- package/src/forms/lab-manifest-form.workspace.tsx +357 -0
- package/src/header/lab-manifest-detail-header.component.tsx +74 -0
- package/src/header/lab-manifest-header.component.tsx +36 -0
- package/src/header/lab-manifest-header.scss +105 -0
- package/src/header/lab-manifest-illustration.component.tsx +13 -0
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useActiveRequests.ts +26 -0
- package/src/hooks/useLabManifest.tsx +17 -0
- package/src/hooks/useLabManifests.ts +17 -0
- package/src/index.ts +36 -0
- package/src/lab-manifest.mock.ts +5 -0
- package/src/lab-manifest.resources.ts +108 -0
- package/src/metrics/lab-manifest-header.scss +22 -0
- package/src/metrics/lab-manifest-metric-value.component.tsx +25 -0
- package/src/metrics/lab-manifest-metrics-header.component.tsx +34 -0
- package/src/metrics/lab-manifest-metrics.component.tsx +27 -0
- package/src/metrics/lab-manifest-metrics.scss +17 -0
- package/src/root.component.tsx +19 -0
- package/src/root.scss +15 -0
- package/src/routes.json +33 -0
- package/src/setup-tests.ts +1 -0
- package/src/tables/lab-manifest-active-requests.component.tsx +161 -0
- package/src/tables/lab-manifest-samples.component.tsx +164 -0
- package/src/tables/lab-manifest-table.component.tsx +214 -0
- package/src/tables/lab-manifest-table.scss +49 -0
- package/src/tabs/lab-manifest-tabs-component.tsx +33 -0
- package/src/tabs/lab-manifest-tabs.scss +28 -0
- package/src/types/index.ts +75 -0
- package/translations/en.json +33 -0
- package/tsconfig.json +5 -0
- package/webpack.config.js +1 -0
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kenyaemr/esm-lab-manifest-app",
|
|
3
|
+
"version": "5.2.1-pre.821",
|
|
4
|
+
"description": "lab-manifest app for KenyaEMR",
|
|
5
|
+
"browser": "dist/kenyaemr-esm-lab-manifest-app.js",
|
|
6
|
+
"main": "src/index.ts",
|
|
7
|
+
"source": true,
|
|
8
|
+
"license": "MPL-2.0",
|
|
9
|
+
"homepage": "https://github.com/palladiumkenya/kenyaemr-esm-core#readme",
|
|
10
|
+
"scripts": {
|
|
11
|
+
"start": "openmrs develop",
|
|
12
|
+
"serve": "webpack serve --mode=development",
|
|
13
|
+
"debug": "npm run serve",
|
|
14
|
+
"build": "webpack --mode production",
|
|
15
|
+
"analyze": "webpack --mode=production --env.analyze=true",
|
|
16
|
+
"lint": "eslint src --ext ts,tsx",
|
|
17
|
+
"typescript": "tsc",
|
|
18
|
+
"extract-translations": "i18next 'src/**/*.component.tsx' 'src/index.ts' --config ../../tools/i18next-parser.config.js",
|
|
19
|
+
"test": "cross-env TZ=UTC jest --config jest.config.js --verbose false --passWithNoTests",
|
|
20
|
+
"test:watch": "cross-env TZ=UTC jest --watch --config jest.config.js",
|
|
21
|
+
"coverage": "yarn test --coverage"
|
|
22
|
+
},
|
|
23
|
+
"browserslist": [
|
|
24
|
+
"extends browserslist-config-openmrs"
|
|
25
|
+
],
|
|
26
|
+
"keywords": [
|
|
27
|
+
"openmrs"
|
|
28
|
+
],
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public"
|
|
31
|
+
},
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "git+https://github.com/palladiumkenya/kenyaemr-esm-core#readme"
|
|
35
|
+
},
|
|
36
|
+
"bugs": {
|
|
37
|
+
"url": "https://github.com/palladiumkenya/kenyaemr-esm-core/issues"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@carbon/react": "^1.42.1",
|
|
41
|
+
"lodash-es": "^4.17.15",
|
|
42
|
+
"react-to-print": "^2.14.13"
|
|
43
|
+
},
|
|
44
|
+
"peerDependencies": {
|
|
45
|
+
"@openmrs/esm-framework": "5.x",
|
|
46
|
+
"react": "^18.1.0",
|
|
47
|
+
"react-i18next": "11.x",
|
|
48
|
+
"react-router-dom": "6.x",
|
|
49
|
+
"swr": "2.x"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"webpack": "^5.74.0"
|
|
53
|
+
},
|
|
54
|
+
"gitHead": "e7a9eb79c5bd99bd6364c930fc598bf3d91e4240"
|
|
55
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import { useParams } from 'react-router-dom';
|
|
4
|
+
import LabManifestDetailHeader from '../header/lab-manifest-detail-header.component';
|
|
5
|
+
import { LabManifestHeader } from '../header/lab-manifest-header.component';
|
|
6
|
+
import { LabManifestTabs } from '../tabs/lab-manifest-tabs-component';
|
|
7
|
+
|
|
8
|
+
const LabManifestDetail = () => {
|
|
9
|
+
const { manifestUuid } = useParams();
|
|
10
|
+
const { t } = useTranslation();
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<div>
|
|
14
|
+
<LabManifestHeader title={t('labManifest', 'Lab Manifest')} />
|
|
15
|
+
<LabManifestDetailHeader manifestUuid={manifestUuid} />
|
|
16
|
+
<LabManifestTabs manifestUuid={manifestUuid} />
|
|
17
|
+
</div>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default LabManifestDetail;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import { LabManifestHeader } from '../header/lab-manifest-header.component';
|
|
4
|
+
import LabManifestMetrics from '../metrics/lab-manifest-metrics.component';
|
|
5
|
+
import LabManifestsTable from '../tables/lab-manifest-table.component';
|
|
6
|
+
|
|
7
|
+
const LabManifestComponent: React.FC = () => {
|
|
8
|
+
const { t } = useTranslation();
|
|
9
|
+
return (
|
|
10
|
+
<div className={`omrs-main-content`}>
|
|
11
|
+
<LabManifestHeader title={t('labManifest', 'Lab Manifest')} />
|
|
12
|
+
<LabManifestMetrics />
|
|
13
|
+
<LabManifestsTable />
|
|
14
|
+
</div>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default LabManifestComponent;
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
|
|
6
|
+
export interface LinkConfig {
|
|
7
|
+
name: string;
|
|
8
|
+
title: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function LinkExtension({ config }: { config: LinkConfig }) {
|
|
12
|
+
const { name, title } = config;
|
|
13
|
+
const location = useLocation();
|
|
14
|
+
const spaBasePath = window.getOpenmrsSpaBase() + 'home';
|
|
15
|
+
|
|
16
|
+
let urlSegment = useMemo(() => decodeURIComponent(last(location.pathname.split('/'))!), [location.pathname]);
|
|
17
|
+
|
|
18
|
+
const isUUID = (value) => {
|
|
19
|
+
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}$/;
|
|
20
|
+
return regex.test(value);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
if (isUUID(urlSegment)) {
|
|
24
|
+
urlSegment = 'lab-manifest';
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<ConfigurableLink
|
|
29
|
+
to={spaBasePath + '/' + name}
|
|
30
|
+
className={`cds--side-nav__link ${name === urlSegment && 'active-left-nav-link'}`}>
|
|
31
|
+
{title}
|
|
32
|
+
</ConfigurableLink>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const createLeftPanelLink = (config: LinkConfig) => () =>
|
|
37
|
+
(
|
|
38
|
+
<BrowserRouter>
|
|
39
|
+
<LinkExtension config={config} />
|
|
40
|
+
</BrowserRouter>
|
|
41
|
+
);
|