Skip to content

Commit

Permalink
Fix breaking launch workspace issue (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
makombe authored Jun 4, 2024
1 parent 1c5f7c9 commit 76d6e42
Show file tree
Hide file tree
Showing 5 changed files with 188 additions and 131 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ import classNames from "classnames";
import { useTranslation } from "react-i18next";
import { Button, Tile } from "@carbon/react";
import { Add, ChevronDown, ChevronUp } from "@carbon/react/icons";
import { useLayoutType } from "@openmrs/esm-framework";
import { useLayoutType, closeWorkspace } from "@openmrs/esm-framework";
import {
launchPatientWorkspace,
type OrderBasketItem,
useOrderBasket,
closeWorkspace,
} from "@openmrs/esm-patient-common-lib";
import { RadiologyOrderBasketItemTile } from "./radiology-order-basket-item-tile.component";
import { prepRadiologyOrderPostData } from "../api";
Expand Down
25 changes: 8 additions & 17 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
translateFrom,

Check warning on line 5 in src/index.ts

View workflow job for this annotation

GitHub Actions / build

'translateFrom' is defined but never used
} from "@openmrs/esm-framework";
import { configSchema } from "./config-schema";
import { registerWorkspace } from "@openmrs/esm-patient-common-lib";

import { createLeftPanelLink } from "./left-panel-link";
import worklistTile from "./metrics-tiles/worklist-tile.component";
Expand Down Expand Up @@ -87,19 +86,11 @@ export const radiologyRejectReasonModalComponent = getSyncLifecycle(
);

// t('addRadiologyOrderWorkspaceTitle', 'Add Radiology order')
registerWorkspace({
name: "add-radiology-order",
type: "order",
title: translateFrom(
moduleName,
"addRadiologyOrderWorkspaceTitle",
"Add radiology order"
),
load: getAsyncLifecycle(
() =>
import(
"./form/radiology-orders/add-radiology-order/add-radiology-order.workspace"
),
options
),
});

export const addRadiologyOrderWorkspace = getAsyncLifecycle(
() =>
import(
"./form/radiology-orders/add-radiology-order/add-radiology-order.workspace"
),
options
);
8 changes: 8 additions & 0 deletions src/routes.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,14 @@
"component": "radiologyRejectReasonModalComponent"
}
],
"workspaces": [
{
"name": "add-radiology-order",
"title": "addRadiologyOrderWorkspaceTitle",
"component": "addRadiologyOrderWorkspace",
"type": "order"
}
],
"pages": [
{
"component": "root",
Expand Down
1 change: 1 addition & 0 deletions src/summary-tiles/radiology-summary-tiles.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const RadiologySummaryTiles: React.FC = () => {
<ComponentContext.Provider
key={extension.id}
value={{
featureName: extension.meta.featureName,
moduleName: extension.moduleName,
extension: {
extensionId: extension.id,
Expand Down
Loading

0 comments on commit 76d6e42

Please sign in to comment.