Skip to content

Commit

Permalink
upgrade referrals queue to O3 v5
Browse files Browse the repository at this point in the history
  • Loading branch information
mogoodrich committed Jul 11, 2023
1 parent b62bf5b commit 43d2c63
Show file tree
Hide file tree
Showing 5 changed files with 1,685 additions and 665 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"devDependencies": {
"@carbon/icons-react": "^10.18.0",
"@carbon/react": "1.9.0",
"@openmrs/esm-framework": "next",
"@openmrs/esm-framework": "^5.0.3-pre.878",
"@swc/core": "^1.2.203",
"@swc/jest": "^0.2.21",
"@testing-library/dom": "^7.20.0",
Expand All @@ -83,7 +83,7 @@
"jest": "^27.0.4",
"jest-cli": "^27.0.4",
"mockdate": "^3.0.5",
"openmrs": "next",
"openmrs": "^5.0.3-pre.878",
"prettier": "^2.3.0",
"pretty-quick": "^3.1.0",
"react": "^18.2.0",
Expand Down
4 changes: 4 additions & 0 deletions src/declarations.d.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ declare type Observable<T> = import("rxjs").Observable<T>;

declare module "*.css";
declare module "*.scss";
declare module "@carbon/react";
declare type SideNavProps = {};



type Referral = {
details: string;
Expand Down
64 changes: 11 additions & 53 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,72 +12,30 @@ import {
} from "@openmrs/esm-framework";
import { configSchema } from "./config-schema";

/**
* This tells the app shell the version of this app. We inject this variable
* via the Webpack DefinePlugin, so first, in order to keep TypeScript happy,
* we need to tell it that this is an available variable in this scope. At
* build-time the __VERSION__ variable is replaced with the version from
* package.json
*/
declare var __VERSION__: string;
const version = __VERSION__;
const moduleName = "@pih/esm-referrals-queue-app";
const options = {
featureName: "referrals-queue",
moduleName,
};

/**
* This tells the app shell how to obtain translation files: that they
* are JSON files in the directory `../translations` (which you should
* see in the directory structure).
*/
const importTranslation = require.context(
export const importTranslation = require.context(
"../translations",
false,
/.json$/,
"lazy"
);

/**
* This tells the app shell what versions of what OpenMRS backend modules
* are expected. Warnings will appear if suitable modules are not
* installed. The keys are the part of the module name after
* `openmrs-module-`; e.g., `openmrs-module-fhir2` becomes `fhir2`.
*/
const backendDependencies = {};

/**
* This function performs any setup that should happen at microfrontend
* load-time (such as defining the config schema) and then returns an
* object which describes how the React application(s) should be
* rendered.
*
* In this example, our return object contains a single page definition.
* It tells the app shell that the default export of `greeter.tsx`
* should be rendered when the route matches `hello`. The full route
* will be `openmrsSpaBase() + 'hello'`, which is usually
* `/openmrs/spa/hello`.
*/
function setupOpenMRS() {
const moduleName = "@pih/esm-referrals-queue-app";
const options = {
featureName: "referrals-queue",
moduleName,
};
export const root = getAsyncLifecycle(
() => import("./root.component"),
options
);

export function startupApp() {
defineConfigSchema(moduleName, configSchema);

registerBreadcrumbs([
{
path: `${window.spaBase}/referrals-queue`,
title: "Referrals Queue",
},
]);

return {
pages: [
{
load: getAsyncLifecycle(() => import("./root.component"), options),
route: "referrals-queue",
},
],
};
}

export { backendDependencies, importTranslation, setupOpenMRS, version };
9 changes: 9 additions & 0 deletions src/routes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "https://json.openmrs.org/routes.schema.json",
"pages": [
{
"component": "root",
"route": "referrals-queue"
}
]
}
Loading

0 comments on commit 43d2c63

Please sign in to comment.