Skip to content

Commit

Permalink
Replace showToast to use showSnackbar (#42)
Browse files Browse the repository at this point in the history
* Replace showToast to use showSnackbar

* fix package.json
  • Loading branch information
sherrif10 authored Jan 22, 2024
1 parent 4030ebb commit e1f17d8
Show file tree
Hide file tree
Showing 6 changed files with 254 additions and 497 deletions.
243 changes: 122 additions & 121 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,123 +1,124 @@
{
"name": "@openmrs/esm-laboratory-app",
"version": "1.0.0",
"license": "MPL-2.0",
"description": "Laboratory microfrontend for OpenMRS 3.x",
"browser": "dist/openmrs-esm-laboratory-app.js",
"main": "src/index.ts",
"source": true,
"scripts": {
"start": "openmrs develop",
"serve": "webpack serve --mode=development",
"build": "webpack --mode production",
"analyze": "webpack --mode=production --env analyze=true",
"lint": "TIMING=1 eslint src --ext js,jsx,ts,tsx",
"prettier": "prettier --write \"src/**/*.{ts,tsx}\"",
"typescript": "tsc",
"test": "jest --config jest.config.js --passWithNoTests",
"verify": "turbo lint typescript test",
"extract-translations": "i18next 'src/**/*.component.tsx' --config ./i18next-parser.config.js",
"coverage": "yarn test -- --coverage",
"prepare": "husky install"
},
"husky": {
"hooks": {
"pre-commit": "pretty-quick --staged && yarn verify"
}
},
"browserslist": [
"extends browserslist-config-openmrs"
],
"keywords": [
"openmrs",
"microfrontends",
"laboratory"
],
"repository": {
"type": "git",
"url": "git+https://github.com/openmrs/openmrs-esm-laboratory.git"
},
"homepage": "https://github.com/openmrs/openmrs-esm-laboratory#readme",
"publishConfig": {
"access": "public"
},
"bugs": {
"url": "https://github.com/openmrs/openmrs-esm-laboratory/issues"
},
"dependencies": {
"@carbon/react": "^1.14.0",
"@hookform/resolvers": "^3.3.4",
"lodash-es": "^4.17.21",
"react-hook-form": "^7.49.3",
"react-to-print": "^2.14.15",
"zod": "^3.22.4"
},
"peerDependencies": {
"@openmrs/esm-framework": "*",
"dayjs": "1.x",
"react": "18.x",
"react-i18next": "11.x",
"react-router-dom": "6.x",
"rxjs": "6.x"
},
"devDependencies": {
"@ohri/openmrs-esm-ohri-commons-lib": "next",
"@openmrs/esm-extensions": "next",
"@openmrs/esm-framework": "next",
"@openmrs/esm-patient-common-lib": "next",
"@openmrs/esm-react-utils": "next",
"@openmrs/esm-styleguide": "next",
"@swc/cli": "^0.1.62",
"@swc/core": "^1.3.62",
"@swc/jest": "^0.2.26",
"@testing-library/dom": "^8.20.0",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^14.4.3",
"@types/jest": "^28.1.8",
"@types/react": "^18.2.8",
"@types/react-dom": "^18.2.4",
"@types/react-router": "^5.1.20",
"@types/react-router-dom": "^5.3.3",
"@types/webpack-env": "^1.18.1",
"@typescript-eslint/parser": "^5.59.9",
"carbon-components-react": "^8.34.0",
"concurrently": "^7.6.0",
"css-loader": "^6.8.1",
"dayjs": "^1.11.9",
"eslint": "^8.42.0",
"eslint-config-prettier": "^8.8.0",
"eslint-config-ts-react-important-stuff": "^3.0.0",
"eslint-plugin-prettier": "^4.2.1",
"file-saver": "^2.0.5",
"husky": "^8.0.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^28.1.3",
"jest-cli": "^28.1.3",
"jest-environment-jsdom": "^28.1.3",
"lerna": "^5.6.1",
"openmrs": "next",
"plotly.js": "^2.24.3",
"prettier": "^2.8.8",
"pretty-quick": "^3.1.3",
"raw-loader": "^4.0.2",
"react": "^18.2.0",
"react-csv": "^2.2.2",
"react-dom": "^18.2.0",
"react-i18next": "^11.18.6",
"react-pivottable": "^0.11.0",
"react-plotly.js": "^2.0.0",
"react-router-dom": "^6.11.2",
"react-table": "^7.8.0",
"rxjs": "^6.6.7",
"swc-loader": "^0.2.3",
"turbo": "^1.10.12",
"typescript": "^4.9.5",
"webpack": "^5.88.1",
"webpack-cli": "^5.1.3"
},
"resolutions": {
"@carbon/react": "1.14.0"
},
"packageManager": "[email protected]"

"name": "@openmrs/esm-laboratory-app",
"version": "1.0.0",
"license": "MPL-2.0",
"description": "Laboratory microfrontend for OpenMRS 3.x",
"browser": "dist/openmrs-esm-laboratory-app.js",
"main": "src/index.ts",
"source": true,
"scripts": {
"start": "openmrs develop",
"serve": "webpack serve --mode=development",
"build": "webpack --mode production",
"analyze": "webpack --mode=production --env analyze=true",
"lint": "TIMING=1 eslint src --ext js,jsx,ts,tsx",
"prettier": "prettier --write \"src/**/*.{ts,tsx}\"",
"typescript": "tsc",
"test": "jest --config jest.config.js --passWithNoTests",
"verify": "turbo lint typescript test",
"extract-translations": "i18next 'src/**/*.component.tsx' --config ./i18next-parser.config.js",
"coverage": "yarn test -- --coverage",
"prepare": "husky install"
},
"husky": {
"hooks": {
"pre-commit": "pretty-quick --staged && yarn verify"
}
},
"browserslist": [
"extends browserslist-config-openmrs"
],
"keywords": [
"openmrs",
"microfrontends",
"laboratory"
],
"repository": {
"type": "git",
"url": "git+https://github.com/openmrs/openmrs-esm-laboratory.git"
},
"homepage": "https://github.com/openmrs/openmrs-esm-laboratory#readme",
"publishConfig": {
"access": "public"
},
"bugs": {
"url": "https://github.com/openmrs/openmrs-esm-laboratory/issues"
},
"dependencies": {
"@carbon/react": "^1.14.0",
"@hookform/resolvers": "^3.3.4",
"lodash-es": "^4.17.21",
"react-hook-form": "^7.49.3",
"react-to-print": "^2.14.15",
"zod": "^3.22.4"
},
"peerDependencies": {
"@openmrs/esm-framework": "*",
"dayjs": "1.x",
"react": "18.x",
"react-i18next": "11.x",
"react-router-dom": "6.x",
"rxjs": "6.x"
},
"devDependencies": {
"@ohri/openmrs-esm-ohri-commons-lib": "next",
"@openmrs/esm-extensions": "next",
"@openmrs/esm-framework": "next",
"@openmrs/esm-patient-common-lib": "next",
"@openmrs/esm-react-utils": "next",
"@openmrs/esm-styleguide": "next",
"@swc/cli": "^0.1.62",
"@swc/core": "^1.3.62",
"@swc/jest": "^0.2.26",
"@testing-library/dom": "^8.20.0",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^14.4.3",
"@types/jest": "^28.1.8",
"@types/react": "^18.2.8",
"@types/react-dom": "^18.2.4",
"@types/react-router": "^5.1.20",
"@types/react-router-dom": "^5.3.3",
"@types/webpack-env": "^1.18.1",
"@typescript-eslint/parser": "^5.59.9",
"carbon-components-react": "^8.34.0",
"concurrently": "^7.6.0",
"css-loader": "^6.8.1",
"dayjs": "^1.11.9",
"eslint": "^8.42.0",
"eslint-config-prettier": "^8.8.0",
"eslint-config-ts-react-important-stuff": "^3.0.0",
"eslint-plugin-prettier": "^4.2.1",
"file-saver": "^2.0.5",
"husky": "^8.0.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^28.1.3",
"jest-cli": "^28.1.3",
"jest-environment-jsdom": "^28.1.3",
"lerna": "^5.6.1",
"openmrs": "next",
"plotly.js": "^2.24.3",
"prettier": "^2.8.8",
"pretty-quick": "^3.1.3",
"raw-loader": "^4.0.2",
"react": "^18.2.0",
"react-csv": "^2.2.2",
"react-dom": "^18.2.0",
"react-i18next": "^11.18.6",
"react-pivottable": "^0.11.0",
"react-plotly.js": "^2.0.0",
"react-router-dom": "^6.11.2",
"react-table": "^7.8.0",
"rxjs": "^6.6.7",
"swc-loader": "^0.2.3",
"turbo": "^1.10.12",
"typescript": "^4.9.5",
"webpack": "^5.88.1",
"webpack-cli": "^5.1.3"
},
"resolutions": {
"@carbon/react": "1.14.0"
},
"packageManager": "[email protected]"
}
14 changes: 7 additions & 7 deletions src/queue-list/lab-dialogs/add-to-worklist-dialog.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import styles from "./add-to-worklist-dialog.scss";
import {
navigate,
showNotification,
showToast,
showSnackbar,
useLocations,
useSession,
} from "@openmrs/esm-framework";
Expand Down Expand Up @@ -121,11 +121,11 @@ const AddToWorklistDialog: React.FC<AddToWorklistDialogProps> = ({

UpdateOrder(order.uuid, body).then(
() => {
showToast({
critical: true,
showSnackbar({
isLowContrast: true,
title: t("pickedAnOrder", "Picked an order"),
kind: "success",
description: t(
subtitle: t(
"pickSuccessfully",
"You have successfully picked an Order"
),
Expand Down Expand Up @@ -153,11 +153,11 @@ const AddToWorklistDialog: React.FC<AddToWorklistDialogProps> = ({
GenerateSpecimenId(order.uuid).then(
(resp) => {
setSpecimenID(resp.data.results[0].sampleId);
showToast({
critical: true,
showSnackbar({
isLowContrast: true,
title: t("generatesampleID", "Generate Sample Id"),
kind: "success",
description: t(
subtitle: t(
"generateSuccessfully",
"You have successfully generated a Sample Id"
),
Expand Down
8 changes: 4 additions & 4 deletions src/reject-order/reject-order-dialog.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { useTranslation } from "react-i18next";
import styles from "./reject-order-dialog.scss";
import { Result } from "../work-list/work-list.resource";
import { RejectOrder } from "./reject-order-dialog.resource";
import { showNotification, showToast } from "@openmrs/esm-framework";
import { showNotification, showSnackbar } from "@openmrs/esm-framework";

interface RejectOrderDialogProps {
order: Result;
Expand All @@ -44,11 +44,11 @@ const RejectOrderDialog: React.FC<RejectOrderDialogProps> = ({
};
RejectOrder(order.uuid, payload).then(
(resp) => {
showToast({
critical: true,
showSnackbar({
isLowContrast: true,
title: t("rejectOrder", "Rejected Order"),
kind: "success",
description: t(
subtitle: t(
"successfullyrejected",
`You have successfully rejected an Order with OrderNumber ${order.orderNumber} `
),
Expand Down
8 changes: 4 additions & 4 deletions src/results/result-form.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { closeOverlay } from "../components/overlay/hook";
import {
ExtensionSlot,
showNotification,
showToast,
showSnackbar,
usePatient,
} from "@openmrs/esm-framework";
import {
Expand Down Expand Up @@ -130,11 +130,11 @@ const ResultForm: React.FC<ResultFormProps> = ({ order, patientUuid }) => {
orderDiscontinuationPayload
).then(
() => {
showToast({
critical: true,
showSnackbar({
isLowContrast: true,
title: t("updateEncounter", "Update lab results"),
kind: "success",
description: t(
subtitle: t(
"generateSuccessfully",
"You have successfully updated test results"
),
Expand Down
8 changes: 4 additions & 4 deletions src/review-list/dialog/review-item.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import styles from "../review-list.scss";
import { GroupMember } from "../../patient-chart/laboratory-order.resource";
import { useGetConceptById } from "../../patient-chart/results-summary/results-summary.resource";
import { ApproverOrder } from "./review-item.resource";
import { showNotification, showToast } from "@openmrs/esm-framework";
import { showNotification, showSnackbar } from "@openmrs/esm-framework";

interface ReviewItemDialogProps {
encounterUuid: string;
Expand Down Expand Up @@ -80,11 +80,11 @@ const ReviewItem: React.FC<ReviewItemDialogProps> = ({

ApproverOrder(payload).then(
() => {
showToast({
critical: true,
showSnackbar({
isLowContrast: true,
title: t("approveOrder", "Approve Order"),
kind: "success",
description: t(
subtitle: t(
"successfullyApproved",
`You have successfully approved Order `
),
Expand Down
Loading

0 comments on commit e1f17d8

Please sign in to comment.