Skip to content
This repository was archived by the owner on Apr 2, 2021. It is now read-only.

Commit 3ca4176

Browse files
committed
Updated to the latest app shell
1 parent b63ca6c commit 3ca4176

10 files changed

+149
-171
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ after_deploy:
3030
- >
3131
if [[ "$TRAVIS_BRANCH" == "master" ]]; then
3232
echo "Updating import map to point to new version of @openmrs/esm-drugorder-app"
33-
statuscode=$(curl --output /dev/null --write-out %{http_code} -u $DEPLOYER_USERNAME:$DEPLOYER_PASSWORD -d '{ "service":"@openmrs/esm-drugorder-app","url":"https://spa-modules.nyc3.digitaloceanspaces.com/@openmrs/esm-drugorder-app/'$TRAVIS_COMMIT'/openmrs-esm-drugorder.js" }' -X PATCH $DEPLOYER_HOST/services\?env=prod -H "Accept:application/json" -H "Content-Type:application/json")
33+
statuscode=$(curl --output /dev/null --write-out %{http_code} -u $DEPLOYER_USERNAME:$DEPLOYER_PASSWORD -d '{ "service":"@openmrs/esm-drugorder-app","url":"https://spa-modules.nyc3.digitaloceanspaces.com/@openmrs/esm-drugorder-app/'$TRAVIS_COMMIT'/openmrs-esm-drugorder-app.js" }' -X PATCH $DEPLOYER_HOST/services\?env=prod -H "Accept:application/json" -H "Content-Type:application/json")
3434
echo "Deployment Status Code --> ${statuscode}"
3535
if [ "$statuscode" -ne 200 ]; then travis_terminate "$statuscode"; fi
3636
fi

package-lock.json

Lines changed: 120 additions & 97 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "@openmrs/esm-drugorder-app",
3-
"version": "0.3.2",
3+
"version": "0.4.0",
44
"description": "Drug order microfrontend for the OpenMRS SPA",
5-
"main": "dist/openmrs-esm-drugorder.js",
5+
"main": "dist/openmrs-esm-drugorder-app.js",
66
"types": "src/index.ts",
77
"license": "MIT",
88
"homepage": "https://github.com/openmrs/openmrs-esm-drugorder#readme",
@@ -38,21 +38,18 @@
3838
},
3939
"dependencies": {
4040
"@carbon/icons-react": "^10.18.0",
41-
"@openmrs/react-root-decorator": "^3.3.1",
4241
"carbon-components-react": "^7.19.0",
4342
"dayjs": "^1.8.16",
44-
"lodash": "^4.17.19",
4543
"lodash-es": "^4.17.15",
46-
"single-spa-react": "^2.10.2",
4744
"systemjs-webpack-interop": "^1.1.0"
4845
},
4946
"peerDependencies": {
50-
"@openmrs/esm-api": "^3.0.8",
51-
"@openmrs/esm-config": "^3.0.8",
52-
"@openmrs/esm-context": "^3.0.8",
53-
"@openmrs/esm-error-handling": "^3.0.8",
54-
"@openmrs/esm-extensions": "^3.0.8",
55-
"@openmrs/esm-styleguide": "^3.0.8",
47+
"@openmrs/esm-api": "^3.1.5",
48+
"@openmrs/esm-config": "^3.1.5",
49+
"@openmrs/esm-error-handling": "^3.1.5",
50+
"@openmrs/esm-extensions": "^3.1.5",
51+
"@openmrs/esm-react-utils": "^3.1.5",
52+
"@openmrs/esm-styleguide": "^3.1.5",
5653
"carbon-components": "^10.19.0",
5754
"carbon-icons": "^7.0.7",
5855
"i18next": "^19.4.2",
@@ -67,12 +64,12 @@
6764
"@babel/preset-env": "^7.5.5",
6865
"@babel/preset-react": "^7.0.0",
6966
"@babel/preset-typescript": "^7.3.3",
70-
"@openmrs/esm-api": "^3.0.8",
71-
"@openmrs/esm-config": "^3.0.8",
72-
"@openmrs/esm-context": "^3.0.8",
73-
"@openmrs/esm-error-handling": "^3.0.8",
74-
"@openmrs/esm-extensions": "^3.0.8",
75-
"@openmrs/esm-styleguide": "^3.0.8",
67+
"@openmrs/esm-api": "^3.1.5",
68+
"@openmrs/esm-config": "^3.1.5",
69+
"@openmrs/esm-error-handling": "^3.1.5",
70+
"@openmrs/esm-extensions": "^3.1.5",
71+
"@openmrs/esm-react-utils": "^3.1.5",
72+
"@openmrs/esm-styleguide": "^3.1.5",
7673
"@testing-library/jest-dom": "^5.7.0",
7774
"@testing-library/react": "^9.5.0",
7875
"@types/carbon-components-react": "^7.10.9",
@@ -103,7 +100,7 @@
103100
"jest": "^24.9.0",
104101
"jest-cli": "^24.9.0",
105102
"node-sass": "^4.14.1",
106-
"openmrs": "^3.0.8",
103+
"openmrs": "^3.1.5",
107104
"prettier": "^1.18.2",
108105
"pretty-quick": "^1.11.1",
109106
"react": "^16.9.0",

src/index.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,31 @@
1+
import { getAsyncLifecycle } from '@openmrs/esm-react-utils';
12
import { backendDependencies } from './openmrs-backend-dependencies';
23

34
const importTranslation = require.context('../translations', false, /.json$/, 'lazy');
45

6+
const options = {
7+
featureName: 'drugorder',
8+
moduleName: '@openmrs/esm-drugorder-app',
9+
};
10+
511
function setupOpenMRS() {
612
return {
713
pages: [
814
{
9-
load: () => import('./spa-order-basket-app'),
15+
load: getAsyncLifecycle(() => import('./root-order-basket'), options),
1016
route: /^patient\/.+\/drugorder\/basket/,
1117
},
1218
],
1319
extensions: [
1420
{
1521
id: 'drugorder-widget',
1622
slot: 'patient-chart-dashboard-medications',
17-
load: () => import('./spa-medication-summary-extension'),
23+
load: getAsyncLifecycle(() => import('./root-medication-summary'), options),
1824
},
1925
{
2026
id: 'order-basket-workspace',
2127
slot: '/patient/:patientUuid/drugorder/basket',
22-
load: () => import('./spa-order-basket-extension'),
28+
load: getAsyncLifecycle(() => import('./root-order-basket'), options),
2329
},
2430
],
2531
};

src/root-medication-summary.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React from 'react';
22
import { BrowserRouter, Route, Switch } from 'react-router-dom';
33
import { defineConfigSchema } from '@openmrs/esm-config';
4-
import openmrsRootDecorator from '@openmrs/react-root-decorator';
54
import MedicationsSummary from './medications-summary/medications-summary.component';
65
import styles from './root.scss';
76
import { Provider } from 'unistore/react';
@@ -13,7 +12,7 @@ export interface RootMedicationSummaryProps {
1312
patientUuid: string;
1413
}
1514

16-
function RootMedicationSummary({ patientUuid }: RootMedicationSummaryProps) {
15+
export default function RootMedicationSummary({ patientUuid }: RootMedicationSummaryProps) {
1716
return (
1817
<div className={styles.resetPatientChartWidgetContainer}>
1918
<BrowserRouter basename={window['getOpenmrsSpaBase']()}>
@@ -28,8 +27,3 @@ function RootMedicationSummary({ patientUuid }: RootMedicationSummaryProps) {
2827
</div>
2928
);
3029
}
31-
32-
export default openmrsRootDecorator({
33-
featureName: 'drugorder',
34-
moduleName: '@openmrs/esm-drugorder-app',
35-
})(RootMedicationSummary);

src/root-order-basket.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import React from 'react';
22
import { defineConfigSchema } from '@openmrs/esm-config';
3-
import openmrsRootDecorator from '@openmrs/react-root-decorator';
43
import { BrowserRouter } from 'react-router-dom';
54
import { Provider } from 'unistore/react';
65
import { orderBasketStore } from './order-basket-store';
76
import OrderBasket from './order-basket/order-basket.component';
87
import { switchTo } from '@openmrs/esm-extensions';
9-
import { useCurrentPatient } from '@openmrs/esm-api';
8+
import { useCurrentPatient } from '@openmrs/esm-react-utils';
109

1110
defineConfigSchema('@openmrs/esm-drugorder-app', {});
1211

@@ -15,7 +14,7 @@ export interface RootOrderBasketProps {
1514
closeWorkspace?: () => void;
1615
}
1716

18-
function RootOrderBasket({ patientUuid, closeWorkspace: closeWorkspace }: RootOrderBasketProps) {
17+
export default function RootOrderBasket({ patientUuid, closeWorkspace: closeWorkspace }: RootOrderBasketProps) {
1918
const [, , fallbackPatientUuid] = useCurrentPatient();
2019
patientUuid = patientUuid ?? fallbackPatientUuid;
2120
closeWorkspace = closeWorkspace ?? (() => switchTo('link', ''));
@@ -28,8 +27,3 @@ function RootOrderBasket({ patientUuid, closeWorkspace: closeWorkspace }: RootOr
2827
</BrowserRouter>
2928
);
3029
}
31-
32-
export default openmrsRootDecorator({
33-
featureName: 'drugorder',
34-
moduleName: '@openmrs/esm-drugorder-app',
35-
})(RootOrderBasket);

src/spa-medication-summary-extension.tsx

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/spa-order-basket-app.tsx

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/spa-order-basket-extension.tsx

Lines changed: 0 additions & 12 deletions
This file was deleted.

webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module.exports = {
1818
path.resolve(__dirname, "src/index.ts"),
1919
],
2020
output: {
21-
filename: 'openmrs-esm-drugorder.js',
21+
filename: 'openmrs-esm-drugorder-app.js',
2222
libraryTarget: 'system',
2323
path: path.resolve(__dirname, 'dist'),
2424
jsonpFunction: 'webpackJsonp_openmrs_esm_drugorder',

0 commit comments

Comments
 (0)