@kenyaemr/esm-version-app 4.1.1-pre.52
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 +43 -0
- package/LICENSE.md +401 -0
- package/dist/150.js +1 -0
- package/dist/150.js.map +1 -0
- package/dist/34.js +2 -0
- package/dist/34.js.LICENSE.txt +32 -0
- package/dist/34.js.map +1 -0
- package/dist/390.js +2 -0
- package/dist/390.js.LICENSE.txt +9 -0
- package/dist/390.js.map +1 -0
- package/dist/435.js +1 -0
- package/dist/435.js.map +1 -0
- package/dist/574.js +1 -0
- package/dist/709.js +1 -0
- package/dist/709.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/858.js +2 -0
- package/dist/858.js.LICENSE.txt +3 -0
- package/dist/858.js.map +1 -0
- package/dist/870.js +1 -0
- package/dist/870.js.map +1 -0
- package/dist/main.js +1 -0
- package/dist/main.js.map +1 -0
- package/dist/openmrs-esm-patient-verification-app.js +1 -0
- package/dist/openmrs-esm-patient-verification-app.js.buildmanifest.json +308 -0
- package/dist/openmrs-esm-patient-verification-app.js.map +1 -0
- package/dist/openmrs-esm-patient-verification-app.old +1 -0
- package/increment-version.js +16 -0
- package/package.json +51 -0
- package/src/about/about.component.tsx +49 -0
- package/src/about/about.scss +51 -0
- package/src/about-link.component.tsx +10 -0
- package/src/config-schema.ts +1 -0
- package/src/declarations.d.ts +2 -0
- package/src/hooks/useModules.tsx +16 -0
- package/src/hooks/useSystemSetting.tsx +25 -0
- package/src/index.ts +40 -0
- package/src/release-version.js +16 -0
- package/src/root.component.tsx +13 -0
- package/src/root.scss +19 -0
- package/src/types/index.ts +0 -0
- package/src/version.js +27 -0
- package/translations/en.json +43 -0
- package/tsconfig.json +5 -0
- package/webpack.config.js +1 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styles from './about.scss';
|
|
3
|
+
import { useModules } from '../hooks/useModules';
|
|
4
|
+
import { useDefaultFacility, useSystemSetting } from '../hooks/useSystemSetting';
|
|
5
|
+
import { formatDatetime } from '@openmrs/esm-framework';
|
|
6
|
+
const packageInfo = require('../release-version.js');
|
|
7
|
+
|
|
8
|
+
interface AboutProps {}
|
|
9
|
+
|
|
10
|
+
const About: React.FC<AboutProps> = () => {
|
|
11
|
+
const { modules, isLoading } = useModules();
|
|
12
|
+
const kenyaEMR = modules.find(({ uuid }) => uuid === 'kenyaemr');
|
|
13
|
+
const { mflCodeResource } = useSystemSetting('facility.mflcode');
|
|
14
|
+
const mflCode = mflCodeResource ? `(${mflCodeResource?.value ?? ''})` : '';
|
|
15
|
+
const facilityName = useDefaultFacility();
|
|
16
|
+
const { title, container, aboutBody, aboutPage } = styles;
|
|
17
|
+
const { VERSION } = packageInfo;
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<div className={aboutPage}>
|
|
21
|
+
<div className={container}>
|
|
22
|
+
<div className={title}>
|
|
23
|
+
<div>
|
|
24
|
+
<h3>Government of Kenya</h3>
|
|
25
|
+
<h4>Ministry of Health</h4>
|
|
26
|
+
</div>
|
|
27
|
+
<img
|
|
28
|
+
src="/openmrs/ms/uiframework/resource/kenyaemr/images/logos/moh.png"
|
|
29
|
+
alt="court_of_arms"
|
|
30
|
+
width="50"
|
|
31
|
+
height="50"
|
|
32
|
+
/>
|
|
33
|
+
</div>
|
|
34
|
+
<div className={aboutBody}>
|
|
35
|
+
<p>KenyaEMR Version</p>
|
|
36
|
+
<p>{`v${kenyaEMR?.version}`}</p>
|
|
37
|
+
<p>SPA Version</p>
|
|
38
|
+
<p>{`v${VERSION.version}`}</p>
|
|
39
|
+
<p>Build date time</p>
|
|
40
|
+
<p>{formatDatetime(new Date(VERSION.buildDate), { mode: 'standard' })}</p>
|
|
41
|
+
<p>Facility code</p>
|
|
42
|
+
<p>{mflCode}</p>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export default About;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
@use '@carbon/styles/scss/spacing';
|
|
2
|
+
@use '@carbon/styles/scss/type';
|
|
3
|
+
@use '@carbon/styles/scss/colors';
|
|
4
|
+
|
|
5
|
+
.aboutPage {
|
|
6
|
+
display: flex;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.container {
|
|
11
|
+
display: flex;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
margin: 1rem;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
align-items: center;
|
|
16
|
+
border: 0.5px solid colors.$gray-30;
|
|
17
|
+
width: 23rem;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.title {
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
padding-bottom: 0.25rem;
|
|
24
|
+
margin-bottom: 0.25rem;
|
|
25
|
+
border-bottom: 0.5px solid colors.$gray-30;
|
|
26
|
+
width: 100%;
|
|
27
|
+
justify-content: center;
|
|
28
|
+
|
|
29
|
+
h3 {
|
|
30
|
+
@include type.type-style('body-compact-02');
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
h4 {
|
|
34
|
+
@include type.type-style('body-compact-01');
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
img {
|
|
38
|
+
margin-left: 0.25rem;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.aboutBody {
|
|
43
|
+
display: grid;
|
|
44
|
+
grid-template-columns: 1fr 1fr;
|
|
45
|
+
column-gap: 0.25rem;
|
|
46
|
+
|
|
47
|
+
& p {
|
|
48
|
+
@include type.type-style('label-01');
|
|
49
|
+
margin-bottom: 0.25rem;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ConfigurableLink } from '@openmrs/esm-framework';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
|
|
5
|
+
const AboutLink = () => {
|
|
6
|
+
const { t } = useTranslation();
|
|
7
|
+
return <ConfigurableLink to={`\${openmrsSpaBase}/about`}>{t('systemInfo', 'System Info')}</ConfigurableLink>;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export default AboutLink;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const configSchema = {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { OpenmrsResource, openmrsFetch } from '@openmrs/esm-framework';
|
|
2
|
+
import useSWRImmutable from 'swr/immutable';
|
|
3
|
+
|
|
4
|
+
interface Modules extends OpenmrsResource {
|
|
5
|
+
version: string;
|
|
6
|
+
name: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function useModules() {
|
|
10
|
+
const { data, isLoading } = useSWRImmutable<{ data: { results: Array<Modules> } }>(
|
|
11
|
+
'ws/rest/v1/module?v=custom:(uuid,name,version)',
|
|
12
|
+
openmrsFetch,
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
return { modules: data?.data?.results ?? [], isLoading };
|
|
16
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { OpenmrsResource, openmrsFetch, useSession } from '@openmrs/esm-framework';
|
|
2
|
+
import useSWRImmutable from 'swr/immutable';
|
|
3
|
+
import useSWR from 'swr';
|
|
4
|
+
|
|
5
|
+
export function useSystemSetting(key: string) {
|
|
6
|
+
const { data, isLoading } = useSWRImmutable<{ data: { results: Array<OpenmrsResource> } }>(
|
|
7
|
+
`/ws/rest/v1/systemsetting?q=${key}&v=full`,
|
|
8
|
+
openmrsFetch,
|
|
9
|
+
{
|
|
10
|
+
revalidateOnFocus: false,
|
|
11
|
+
revalidateOnReconnect: false,
|
|
12
|
+
},
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
const mflCodeResource = data?.data?.results?.find((resource) => resource.property === 'facility.mflcode');
|
|
16
|
+
|
|
17
|
+
return { mflCodeResource, isLoading };
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function useDefaultFacility() {
|
|
21
|
+
const { authenticated } = useSession();
|
|
22
|
+
const url = '/ws/rest/v1/kenyaemr/default-facility';
|
|
23
|
+
const { data } = useSWR<{ data: OpenmrsResource }>(authenticated ? url : null, openmrsFetch, {});
|
|
24
|
+
return data?.data ?? ({} as OpenmrsResource);
|
|
25
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { defineConfigSchema, getAsyncLifecycle, getSyncLifecycle } from '@openmrs/esm-framework';
|
|
2
|
+
import { configSchema } from './config-schema';
|
|
3
|
+
|
|
4
|
+
const importTranslation = require.context('../translations', false, /.json$/, 'lazy');
|
|
5
|
+
|
|
6
|
+
const backendDependencies = {
|
|
7
|
+
kenyaemr: '^18.2.0',
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
function setupOpenMRS() {
|
|
11
|
+
const moduleName = '@kenyaemr/esm-version-app';
|
|
12
|
+
|
|
13
|
+
const options = {
|
|
14
|
+
featureName: 'esm-version-app',
|
|
15
|
+
moduleName,
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
defineConfigSchema(moduleName, configSchema);
|
|
19
|
+
|
|
20
|
+
return {
|
|
21
|
+
pages: [
|
|
22
|
+
{
|
|
23
|
+
route: 'about',
|
|
24
|
+
load: getAsyncLifecycle(() => import('./root.component'), options),
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
extensions: [
|
|
28
|
+
{
|
|
29
|
+
name: 'about--link',
|
|
30
|
+
slot: 'app-menu-slot',
|
|
31
|
+
load: getAsyncLifecycle(() => import('./about-link.component'), options),
|
|
32
|
+
online: true,
|
|
33
|
+
offline: false,
|
|
34
|
+
order: 0,
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export { backendDependencies, importTranslation, setupOpenMRS };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
|
|
2
|
+
// IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN!
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
export const VERSION = {
|
|
5
|
+
"dirty": true,
|
|
6
|
+
"raw": "ec0aa99-dirty",
|
|
7
|
+
"hash": "ec0aa99",
|
|
8
|
+
"distance": null,
|
|
9
|
+
"tag": null,
|
|
10
|
+
"semver": null,
|
|
11
|
+
"suffix": "ec0aa99-dirty",
|
|
12
|
+
"semverString": null,
|
|
13
|
+
"version": "1.0.3",
|
|
14
|
+
"buildDate": "2023-05-17T21:00:27.406Z"
|
|
15
|
+
};
|
|
16
|
+
/* tslint:enable */
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BrowserRouter } from 'react-router-dom';
|
|
3
|
+
import About from './about/about.component';
|
|
4
|
+
export const spaRoot = window['getOpenmrsSpaBase']();
|
|
5
|
+
|
|
6
|
+
const Root: React.FC = () => {
|
|
7
|
+
return (
|
|
8
|
+
<BrowserRouter basename={spaRoot}>
|
|
9
|
+
<About />
|
|
10
|
+
</BrowserRouter>
|
|
11
|
+
);
|
|
12
|
+
};
|
|
13
|
+
export default Root;
|
package/src/root.scss
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
@use '@carbon/type';
|
|
2
|
+
@use '@carbon/colors';
|
|
3
|
+
|
|
4
|
+
.container {
|
|
5
|
+
position: fixed;
|
|
6
|
+
bottom: 0;
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
margin: 0.5rem;
|
|
10
|
+
background-color: transparent;
|
|
11
|
+
|
|
12
|
+
& p {
|
|
13
|
+
@include type.type-style('label-01');
|
|
14
|
+
& > span {
|
|
15
|
+
@include type.type-style('helper-text-01');
|
|
16
|
+
color: colors.$gray-50;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
File without changes
|
package/src/version.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const { gitDescribeSync } = require('git-describe');
|
|
2
|
+
const { version } = require('../package.json');
|
|
3
|
+
const { resolve, relative } = require('path');
|
|
4
|
+
const { writeFileSync } = require('fs-extra');
|
|
5
|
+
|
|
6
|
+
const gitInfo = gitDescribeSync({
|
|
7
|
+
dirtyMark: false,
|
|
8
|
+
dirtySemver: false,
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
gitInfo.version = version;
|
|
12
|
+
gitInfo.buildDate = new Date();
|
|
13
|
+
const file = resolve(__dirname, 'release-version.js');
|
|
14
|
+
const fileContent = `
|
|
15
|
+
// IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN!
|
|
16
|
+
/* tslint:disable */
|
|
17
|
+
export const VERSION = ${JSON.stringify(gitInfo, null, 4)};
|
|
18
|
+
/* tslint:enable */
|
|
19
|
+
`;
|
|
20
|
+
|
|
21
|
+
try {
|
|
22
|
+
writeFileSync(file, fileContent, { encoding: 'utf-8' });
|
|
23
|
+
// eslint-disable-next-line no-console
|
|
24
|
+
console.log(`Wrote version info ${gitInfo.raw} to ${relative(resolve(__dirname), file)}`);
|
|
25
|
+
} catch (error) {
|
|
26
|
+
console.error('Error writing version file:', error);
|
|
27
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"actions": "Actions",
|
|
3
|
+
"address": "Address",
|
|
4
|
+
"age": "Age",
|
|
5
|
+
"any": "Any",
|
|
6
|
+
"apply": "Apply",
|
|
7
|
+
"clear": "Clear",
|
|
8
|
+
"clearSearch": "Clear",
|
|
9
|
+
"contactDetails": "Contact Details",
|
|
10
|
+
"countOfFiltersApplied": "filters applied",
|
|
11
|
+
"day": "Day",
|
|
12
|
+
"error": "Error",
|
|
13
|
+
"errorCopy": "Sorry, there was a an error. You can try to reload this page, or contact the site administrator and quote the error code above.",
|
|
14
|
+
"female": "Female",
|
|
15
|
+
"filtersAppliedText": "search queries added",
|
|
16
|
+
"male": "Male",
|
|
17
|
+
"month": "Month",
|
|
18
|
+
"nextPage": "Next page",
|
|
19
|
+
"noPatientChartsFoundMessage": "Sorry, no patient charts have been found",
|
|
20
|
+
"orPatientName": "OR the patient's name(s)",
|
|
21
|
+
"other": "Other",
|
|
22
|
+
"phoneNumber": "Phone number",
|
|
23
|
+
"postcode": "Postcode",
|
|
24
|
+
"previousPage": "Previous page",
|
|
25
|
+
"refineSearch": "Refine search",
|
|
26
|
+
"refineSearchHeaderText": "Add additional search criteria",
|
|
27
|
+
"refineSearchTabletBannerText": "Can't find who you're looking for?",
|
|
28
|
+
"relationships": "Relationships",
|
|
29
|
+
"resetFields": "Reset fields",
|
|
30
|
+
"seachResultsSmall": "search results",
|
|
31
|
+
"search": "Search",
|
|
32
|
+
"searchForPatient": "Search for a patient by name or identifier number",
|
|
33
|
+
"searchingText": "Searching...",
|
|
34
|
+
"searchPatient": "Search Patient",
|
|
35
|
+
"searchResults": "Search Results",
|
|
36
|
+
"searchResultsText": "search results",
|
|
37
|
+
"sex": "Sex",
|
|
38
|
+
"showAllDetails": "Show all details",
|
|
39
|
+
"showLess": "Show less",
|
|
40
|
+
"trySearchWithPatientUniqueID": "Try searching with the patient's unique ID number",
|
|
41
|
+
"unknown": "Unknown",
|
|
42
|
+
"year": "Year"
|
|
43
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('openmrs/default-webpack-config');
|