Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
jabahum committed Jul 11, 2024
1 parent f3cba62 commit e701feb
Show file tree
Hide file tree
Showing 46 changed files with 299 additions and 73 deletions.
33 changes: 33 additions & 0 deletions src/approved-orders/print-order-results-menu-item.component.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import React, { useCallback } from "react";
import { OverflowMenuItem } from "@carbon/react";
import { Order } from "@openmrs/esm-patient-common-lib";
import { useTranslation } from "react-i18next";

interface PrintOrderResultsActionMenuProps {
order: Order;
closeModal: () => void;
}

const PrintResultsActionMenu: React.FC<PrintOrderResultsActionMenuProps> = ({
order,
}) => {
const { t } = useTranslation();
// const launchPickLabRequestModal = useCallback(() => {
// const dispose = showModal("add-to-worklist-dialog", {
// closeModal: () => dispose(),
// order,
// });
// }, [order]);

return (
<OverflowMenuItem
itemText={"Print Results"}
onClick={() => {}}
style={{
maxWidth: "100vw",
}}
/>
);
};

export default PrintResultsActionMenu;
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import ApprovedList from "../approved-orders/approved-list.component";
import ApprovedList from "../../approved-orders/approved-list.component";

const ApprovedComponent = () => {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import ReferredOrdersList from "../referred-orders/referred-orders.component";
import ReferredOrdersList from "../../referred-orders/referred-orders.component";

const ReferredComponent = () => {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import RejectedTestsList from "../reject-order/rejected-tests-list.component";
import RejectedTestsList from "../../rejected-order/rejected-list.component";

const RejectedComponent = () => {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import ReviewList from "../reviewed-orders/review-list.component";
import ReviewList from "../../reviewed-orders/review-list.component";

const ReviewComponent = () => {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import WorkList from "../worklist-orders/work-list.component";
import WorkList from "../../worklist-orders/work-list.component";

const WorkListComponent = () => {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {
} from "@openmrs/esm-framework";
import { Tab, Tabs, TabList, TabPanels, TabPanel, Search } from "@carbon/react";
import { useTranslation } from "react-i18next";
import styles from "./tests-ordered.scss";
import TestsOrderedList from "./tests-ordered-list.component";
import styles from "./laboratory-tabs.scss";
import TestsOrderedList from "../ordered-orders/tests-ordered-list.component";
import { ComponentContext } from "@openmrs/esm-framework/src/internal";

enum TabTypes {
Expand Down
14 changes: 14 additions & 0 deletions src/laboratory-tabs/laboratory-tabs.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@use '@carbon/styles/scss/spacing';
@use '@carbon/styles/scss/type';
@use '@carbon/styles/scss/colors';
@import "~@openmrs/esm-styleguide/src/vars";
@import '../root.scss';

.orderTabsContainer {
height: 100%;
width: 100%;

:global(.cds--tab-content) {
padding: 0 !important;
}
}
2 changes: 1 addition & 1 deletion src/laboratory.component.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import { LaboratoryHeader } from "./header/laboratory-header.component";
import LaboratorySummaryTiles from "./summary-tiles/laboratory-summary-tiles.component";
import LaboratoryOrdersList from "./ordered-orders/laboratory-tabs.component";
import LaboratoryOrdersList from "./laboratory-tabs/laboratory-tabs.component";
import Overlay from "./components/overlay/overlay.component";

const Laboratory: React.FC = () => {
Expand Down
35 changes: 0 additions & 35 deletions src/order-actions/reject-order.component.tsx

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/ordered-orders/lab-tests/lab-tests.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
import { ErrorState } from "@openmrs/esm-framework";
import { Encounter } from "../../types/patient-queues";
import styles from "../laboratory-queue.scss";
import PickLabRequestActionMenu from "../pick-lab-request-menu.component";
import PickLabRequestActionMenu from "../ordered-tests-actions/pick-test-order-menu.component";

interface LabTestsProps {
encounter: Encounter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { ExtensionSlot, useLayoutType } from "@openmrs/esm-framework";
import { usePatientLabOrders } from "../patient-test-orders/patient-test-orders.resource";
import styles from "./tests-ordered.scss";
import OrderCustomOverflowMenuComponent from "../ui-components/overflow-menu.component";
import ScheduleTestOrdersButton from "./schedule-test-orders.component";
import ScheduleTestOrdersButton from "./ordered-tests-actions/schedule-test-orders-button.component";

interface TestOrderProps {
patientUuid: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { OverflowMenuItem } from "@carbon/react";
import { showModal } from "@openmrs/esm-framework";
import { Order } from "@openmrs/esm-patient-common-lib";
import React, { useCallback } from "react";
import { useTranslation } from "react-i18next";
import { Order } from "../types/patient-queues";

interface PickLabRequestActionMenuProps {
order: Order;
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
TextInput,
} from "@carbon/react";
import { useTranslation } from "react-i18next";
import styles from "./add-to-worklist-dialog.scss";
import {
showNotification,
showSnackbar,
Expand All @@ -24,9 +23,10 @@ import {
extractLetters,
useReferralLocations,
useSpecimenTypes,
} from "./add-to-worklist-dialog.resource";
import { Order } from "../../types/patient-queues";
import { extractErrorMessagesFromResponse } from "../../utils/functions";
} from "./pick-order-dialog.resource";
import { extractErrorMessagesFromResponse } from "../../../utils/functions";
import styles from "./pick-order-dialog.scss";
import { Order } from "@openmrs/esm-patient-common-lib";

interface AddToWorklistDialogProps {
queueId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,19 @@ import {
} from "@carbon/react";
import { Order } from "@openmrs/esm-patient-common-lib";
import { useTranslation } from "react-i18next";
import styles from "./add-to-worklist-dialog.scss";
import styles from "../pick-orders-dialog/pick-order-dialog.scss";
import {
showNotification,
showSnackbar,
useLayoutType,
} from "@openmrs/esm-framework";

import { extractErrorMessagesFromResponse } from "../../../utils/functions";
import {
GenerateSpecimenId,
useReferralLocations,
useSpecimenTypes,
} from "./add-to-worklist-dialog.resource";
import { extractErrorMessagesFromResponse } from "../../utils/functions";
} from "../pick-orders-dialog/pick-order-dialog.resource";
interface ScheduleTestOrdersDialogProps {
orders: Order[];
closeModal: () => void;
Expand Down Expand Up @@ -172,7 +173,6 @@ const ScheduleTestOrdersDialog: React.FC<ScheduleTestOrdersDialogProps> = ({
rows={tableRows}
headers={tableHeaders}
size={isTablet ? "lg" : "sm"}
useZebraStyles
>
{({
rows,
Expand Down
2 changes: 1 addition & 1 deletion src/ordered-orders/tests-ordered-list.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
import styles from "./tests-ordered.scss";
import { usePatientQueuesList } from "./tests-ordered-list.resource";
import { formatWaitTime, trimVisitNumber } from "../utils/functions";
import TestOrders from "./patient-test-orders.component";
import TestOrders from "./ordered-test-orders.component";

const TestsOrderedList: React.FC = () => {
const { t } = useTranslation();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import React, { useCallback } from "react";
import { OverflowMenuItem } from "@carbon/react";
import { Order } from "@openmrs/esm-patient-common-lib";
import { useTranslation } from "react-i18next";

interface ReferredOrderActionMenuProps {
isEditing: boolean;
order: Order;
closeModal: () => void;
}

const ReferredOrderActionMenu: React.FC<ReferredOrderActionMenuProps> = ({
isEditing,
order,
}) => {
const { t } = useTranslation();
// const launchPickLabRequestModal = useCallback(() => {
// const dispose = showModal("add-to-worklist-dialog", {
// closeModal: () => dispose(),
// order,
// });
// }, [order]);

return (
<OverflowMenuItem
itemText={isEditing ? "Edit Results" : "Add Results"}
onClick={() => {}}
style={{
maxWidth: "100vw",
}}
/>
);
};

export default ReferredOrderActionMenu;
2 changes: 1 addition & 1 deletion src/referred-orders/referred-orders.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
import { getStatusColor } from "../utils/functions";
import styles from "./referred-orders.scss";
import { usePatientQueuesList } from "../ordered-orders/tests-ordered-list.resource";
import TestOrders from "../ordered-orders/patient-test-orders.component";
import TestOrders from "../ordered-orders/ordered-test-orders.component";
import ReferredTestOrders from "./referred-test-orders.component";

const ReferredList: React.FC = () => {
Expand Down
33 changes: 33 additions & 0 deletions src/referred-orders/reject-referred-order-menu-item.component.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import React, { useCallback } from "react";
import { OverflowMenuItem } from "@carbon/react";
import { Order } from "@openmrs/esm-patient-common-lib";
import { useTranslation } from "react-i18next";

interface RejectOrderActionMenuProps {
order: Order;
closeModal: () => void;
}

const RejectOrderActionMenu: React.FC<RejectOrderActionMenuProps> = ({
order,
}) => {
const { t } = useTranslation();
// const launchPickLabRequestModal = useCallback(() => {
// const dispose = showModal("add-to-worklist-dialog", {
// closeModal: () => dispose(),
// order,
// });
// }, [order]);

return (
<OverflowMenuItem
itemText={"Reject Order"}
onClick={() => {}}
style={{
maxWidth: "100vw",
}}
/>
);
};

export default RejectOrderActionMenu;
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ import {
} from "@carbon/react";
import { useTranslation } from "react-i18next";
import styles from "./reject-order-dialog.scss";
import { Result } from "../worklist-orders/work-list.resource";
import { RejectOrder } from "./reject-order-dialog.resource";
import { showNotification, showSnackbar } from "@openmrs/esm-framework";
import { Order } from "@openmrs/esm-patient-common-lib";
import { extractErrorMessagesFromResponse } from "../utils/functions";

interface RejectOrderDialogProps {
order: Result;
order: Order;
closeModal: () => void;
}

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import React, { useCallback } from "react";
import { OverflowMenuItem } from "@carbon/react";
import { Order } from "@openmrs/esm-patient-common-lib";
import { useTranslation } from "react-i18next";

interface ReviewOrEditOrderResultsActionMenuProps {
isEditing: boolean;
order: Order;
closeModal: () => void;
}

const AddOrderResultsActionMenu: React.FC<
ReviewOrEditOrderResultsActionMenuProps
> = ({ isEditing, order }) => {
const { t } = useTranslation();
// const launchPickLabRequestModal = useCallback(() => {
// const dispose = showModal("add-to-worklist-dialog", {
// closeModal: () => dispose(),
// order,
// });
// }, [order]);

return (
<OverflowMenuItem
itemText={isEditing ? "Edit Results" : "Approve Results"}
onClick={() => {}}
style={{
maxWidth: "100vw",
}}
/>
);
};

export default AddOrderResultsActionMenu;
2 changes: 1 addition & 1 deletion src/reviewed-orders/review-list.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {

import styles from "./review-list.scss";
import { usePatientQueuesList } from "../ordered-orders/tests-ordered-list.resource";
import TestOrders from "../ordered-orders/patient-test-orders.component";
import TestOrders from "../ordered-orders/ordered-test-orders.component";
import ReviewTestOrders from "./review-test-orders.components";

const ReviewList: React.FC = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
InlineLoading,
} from "@carbon/react";
import { useTranslation } from "react-i18next";
import styles from "../dialog/review-item.scss";
import styles from "./review-item.scss";
import {
GroupMember,
useGetEncounterById,
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/reviewed-orders/review-test-orders.components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const ReviewTestOrders: React.FC<TestOrderProps> = ({ patientUuid }) => {
<ExtensionSlot
className={styles.menuLink}
state={{ order: orders[index] }}
name="referred-order-actions-slot"
name="review-order-actions-slot"
/>
</OrderCustomOverflowMenuComponent>
),
Expand Down
Loading

0 comments on commit e701feb

Please sign in to comment.