diff --git a/.env b/.env index da48755037b..528b49e2b8d 100644 --- a/.env +++ b/.env @@ -1,7 +1,7 @@ # Whitelabelling envs REACT_APP_TITLE=CARE -REACT_APP_META_DESCRIPTION=CoronaSafe Network is an open-source public utility designed by a multi-disciplinary team of innovators and volunteers. CoronaSafe Care is a Digital Public Good recognised by United Nations. +REACT_APP_META_DESCRIPTION=Revolutionizing EMR with AI: Open Healthcare Network develops free, open-source tools to enhance efficiency in global healthcare delivery. Our EMR system is recognized as a Digital Public Good by the United Nations. REACT_APP_COVER_IMAGE=https://cdn.coronasafe.network/care_logo.svg REACT_APP_COVER_IMAGE_ALT=https://cdn.coronasafe.network/care_logo.svg REACT_PUBLIC_URL=https://care.coronasafe.in diff --git a/.eslintrc.json b/.eslintrc.json index a2f7b667856..0fc2f64ddaf 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -12,7 +12,6 @@ "extends": [ "eslint:recommended", "plugin:react-hooks/recommended", - "plugin:prettier/recommended", "plugin:@typescript-eslint/eslint-recommended", "plugin:@typescript-eslint/recommended", "plugin:i18next/recommended", diff --git a/cypress/e2e/patient_spec/patient_discharge.cy.ts b/cypress/e2e/patient_spec/patient_discharge.cy.ts index 34ad423d1e8..242c936730d 100644 --- a/cypress/e2e/patient_spec/patient_discharge.cy.ts +++ b/cypress/e2e/patient_spec/patient_discharge.cy.ts @@ -36,6 +36,7 @@ describe("Patient Discharge based on multiple reason", () => { patientDischarge.clickDischarge(); patientDischarge.selectDischargeReason(patientDischargeReason4); cy.submitButton("Confirm Discharge"); + cy.submitButton("Acknowledge & Submit"); cy.verifyNotification("Patient Discharged Successfully"); cy.closeNotification(); // Verify the consultation dashboard reflection @@ -53,6 +54,7 @@ describe("Patient Discharge based on multiple reason", () => { patientDischarge.typeDischargeNote(patientDeathCause); patientDischarge.typeDoctorName(doctorName); cy.submitButton("Confirm Discharge"); + cy.submitButton("Acknowledge & Submit"); cy.verifyNotification("Patient Discharged Successfully"); cy.closeNotification(); // Verify the consultation dashboard reflection @@ -77,6 +79,7 @@ describe("Patient Discharge based on multiple reason", () => { patientDischarge.typeReferringFacility(referringFreetextFacility); cy.wait(2000); cy.submitButton("Confirm Discharge"); + cy.submitButton("Acknowledge & Submit"); cy.wait(2000); cy.verifyNotification("Patient Discharged Successfully"); cy.closeNotification(); @@ -108,6 +111,7 @@ describe("Patient Discharge based on multiple reason", () => { cy.closeNotification(); // submit the discharge pop-up cy.submitButton("Confirm Discharge"); + cy.submitButton("Acknowledge & Submit"); cy.wait(2000); cy.verifyNotification("Patient Discharged Successfully"); cy.closeNotification(); diff --git a/cypress/e2e/patient_spec/patient_registration.cy.ts b/cypress/e2e/patient_spec/patient_registration.cy.ts index 17c9b0b3679..f94dbbe46cd 100644 --- a/cypress/e2e/patient_spec/patient_registration.cy.ts +++ b/cypress/e2e/patient_spec/patient_registration.cy.ts @@ -254,7 +254,7 @@ describe("Patient Creation with consultation", () => { }); it("Patient Registration using the transfer with no consultation", () => { - // transfer the patient and no consulation + // transfer the patient with no consulation and verify the transfer to a new facility patientPage.createPatient(); patientPage.selectFacility(patientTransferFacility); patientPage.patientformvisibility(); @@ -264,9 +264,10 @@ describe("Patient Creation with consultation", () => { patientTransfer.clickTransferPatientNameList(patientTransferName); patientTransfer.clickTransferPatientYOB(yearOfBirth); patientTransfer.clickTransferSubmitButton(); - patientTransfer.verifyFacilitySuccessfullMessage(); + cy.verifyNotification( + "Patient Dummy Patient 10 (Male) transferred successfully", + ); patientTransfer.clickConsultationCancelButton(); - cy.wait(3000); // allow the transfer button of a patient patientTransfer.clickAllowPatientTransferButton(); // Verify the patient error message for the same facility @@ -280,7 +281,9 @@ describe("Patient Creation with consultation", () => { patientTransfer.clickTransferPatientNameList(patientTransferName); patientTransfer.clickTransferPatientYOB(yearOfBirth); patientTransfer.clickTransferSubmitButton(); - patientTransfer.verifyFacilityErrorMessage(); + cy.verifyNotification( + "Patient - Patient transfer cannot be completed because the patient has an active consultation in the same facility", + ); }); it("Patient Registration using External Result Import", () => { diff --git a/cypress/pageobject/Patient/PatientPrescription.ts b/cypress/pageobject/Patient/PatientPrescription.ts index 8e006465e08..108fedbd676 100644 --- a/cypress/pageobject/Patient/PatientPrescription.ts +++ b/cypress/pageobject/Patient/PatientPrescription.ts @@ -28,7 +28,7 @@ export class PatientPrescription { } clickAdministerButton() { - cy.get("#administer-medicine").should("be.visible"); + cy.get("#administer-medicine").scrollIntoView().should("be.visible"); cy.verifyAndClickElement("#administer-medicine", "Administer"); } diff --git a/cypress/pageobject/Patient/PatientTransfer.ts b/cypress/pageobject/Patient/PatientTransfer.ts index 4c884ee2427..0bdd55e9880 100644 --- a/cypress/pageobject/Patient/PatientTransfer.ts +++ b/cypress/pageobject/Patient/PatientTransfer.ts @@ -19,44 +19,18 @@ class PatientTransfer { clickTransferSubmitButton() { cy.get("#submit-transferpatient").click(); + cy.wait(2000); } clickConsultationCancelButton() { cy.get("#cancel").scrollIntoView(); cy.get("#cancel").click(); + cy.wait(2000); } clickAllowPatientTransferButton() { cy.get("#patient-allow-transfer").click(); } - - verifyFacilitySuccessfullMessage() { - cy.get(".pnotify") - .should("exist") - .within(() => { - cy.get(".pnotify-text") - .invoke("text") - .then((text) => { - expect(text.trim()).to.match( - /^Patient Dummy Patient 10 \(Male\) transferred successfully$/i, - ); - }); - }); - } - - verifyFacilityErrorMessage() { - cy.get(".pnotify") - .should("exist") - .within(() => { - cy.get(".pnotify-text") - .invoke("text") - .then((text) => { - expect(text).to.match( - /Patient - Patient transfer cannot be completed because the patient has an active consultation in the same facility/, - ); - }); - }); - } } export default PatientTransfer; diff --git a/cypress/support/index.ts b/cypress/support/index.ts index 9ddfd0c819a..c9af6a02c96 100644 --- a/cypress/support/index.ts +++ b/cypress/support/index.ts @@ -1,3 +1,4 @@ +/// import "./commands"; declare global { diff --git a/package-lock.json b/package-lock.json index b0027f9c7be..2458c891d41 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31,7 +31,7 @@ "echarts-for-react": "^3.0.2", "eslint-mdx": "^3.1.5", "events": "^3.3.0", - "glob": "^10.3.15", + "glob": "^10.4.2", "hi-profiles": "^1.0.6", "i18next": "^23.11.4", "i18next-browser-languagedetector": "^7.2.1", @@ -43,7 +43,7 @@ "react-copy-to-clipboard": "^5.1.0", "react-dnd": "^16.0.1", "react-dnd-html5-backend": "^16.0.1", - "react-dnd-scrolling": "^1.3.7", + "react-dnd-scrolling": "^1.3.8", "react-dom": "18.3.1", "react-google-recaptcha": "^3.1.0", "react-i18next": "^13.0.1", @@ -72,6 +72,7 @@ "@tailwindcss/container-queries": "^0.1.1", "@tailwindcss/forms": "^0.5.7", "@tailwindcss/typography": "^0.5.13", + "@types/cypress": "^1.1.3", "@types/echarts": "^4.9.22", "@types/google.maps": "^3.55.8", "@types/lodash-es": "^4.17.12", @@ -87,7 +88,7 @@ "@typescript-eslint/parser": "^5.61.0", "@vitejs/plugin-react-swc": "^3.6.0", "autoprefixer": "^10.4.19", - "cypress": "^13.9.0", + "cypress": "^13.13.1", "cypress-localstorage-commands": "^2.2.5", "cypress-split": "^1.23.2", "eslint": "^8.44.0", @@ -6222,6 +6223,16 @@ "@types/node": "*" } }, + "node_modules/@types/cypress": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@types/cypress/-/cypress-1.1.3.tgz", + "integrity": "sha512-OXe0Gw8LeCflkG1oPgFpyrYWJmEKqYncBsD/J0r17r0ETx/TnIGDNLwXt/pFYSYuYTpzcq1q3g62M9DrfsBL4g==", + "deprecated": "This is a stub types definition for cypress (https://cypress.io). cypress provides its own type definitions, so you don't need @types/cypress installed!", + "dev": true, + "dependencies": { + "cypress": "*" + } + }, "node_modules/@types/debug": { "version": "4.1.12", "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz", @@ -9129,9 +9140,9 @@ "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==" }, "node_modules/cypress": { - "version": "13.9.0", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.9.0.tgz", - "integrity": "sha512-atNjmYfHsvTuCaxTxLZr9xGoHz53LLui3266WWxXJHY7+N6OdwJdg/feEa3T+buez9dmUXHT1izCOklqG82uCQ==", + "version": "13.13.1", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.13.1.tgz", + "integrity": "sha512-8F9UjL5MDUdgC/S5hr8CGLHbS5gGht5UOV184qc2pFny43fnkoaKxlzH/U6//zmGu/xRTaKimNfjknLT8+UDFg==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -9174,7 +9185,7 @@ "request-progress": "^3.0.0", "semver": "^7.5.3", "supports-color": "^8.1.1", - "tmp": "~0.2.1", + "tmp": "~0.2.3", "untildify": "^4.0.0", "yauzl": "^2.10.0" }, @@ -13772,15 +13783,16 @@ "dev": true }, "node_modules/glob": { - "version": "10.3.15", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.15.tgz", - "integrity": "sha512-0c6RlJt1TICLyvJYIApxb8GsXoai0KUP7AxKKAtsYXdgJR1mGEUa7DgwShbdk1nly0PYoZj01xd4hzbq3fsjpw==", + "version": "10.4.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.2.tgz", + "integrity": "sha512-GwMlUF6PkPo3Gk21UxkCohOv0PLcIXVtKyLlpEI28R/cO/4eNOdmLk3CMW1wROV/WR/EsZOWAfBbBOqYvs88/w==", "dependencies": { "foreground-child": "^3.1.0", - "jackspeak": "^2.3.6", - "minimatch": "^9.0.1", - "minipass": "^7.0.4", - "path-scurry": "^1.11.0" + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" }, "bin": { "glob": "dist/esm/bin.mjs" @@ -15439,9 +15451,9 @@ } }, "node_modules/jackspeak": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz", - "integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.0.tgz", + "integrity": "sha512-JVYhQnN59LVPFCEcVa2C3CrEKYacvjRfqIQl+h8oi91aLYQVWRYbxjPcv1bUiUy/kLmQaANrYfNMCO3kuEDHfw==", "dependencies": { "@isaacs/cliui": "^8.0.2" }, @@ -18160,9 +18172,9 @@ } }, "node_modules/minipass": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.0.tgz", - "integrity": "sha512-oGZRv2OT1lO2UF1zUcwdTb3wqUwI0kBGTgt/T7OdSj6M6N5m3o5uPf0AIW6lVxGGoiWUR7e2AwTE+xiwK8WQig==", + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", "engines": { "node": ">=16 || 14 >=14.17" } @@ -18959,6 +18971,11 @@ "node": ">=6" } }, + "node_modules/package-json-from-dist": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.0.tgz", + "integrity": "sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw==" + }, "node_modules/pako": { "version": "0.2.9", "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", @@ -19056,15 +19073,15 @@ "dev": true }, "node_modules/path-scurry": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.0.tgz", - "integrity": "sha512-LNHTaVkzaYaLGlO+0u3rQTz7QrHTFOuKyba9JMTQutkmtNew8dw8wOD7mTU/5fCPZzCWpfW0XnQKzY61P0aTaw==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", "dependencies": { "lru-cache": "^10.2.0", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" }, "engines": { - "node": ">=16 || 14 >=14.17" + "node": ">=16 || 14 >=14.18" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -20019,9 +20036,9 @@ } }, "node_modules/react-dnd-scrolling": { - "version": "1.3.7", - "resolved": "https://registry.npmjs.org/react-dnd-scrolling/-/react-dnd-scrolling-1.3.7.tgz", - "integrity": "sha512-iLMziS6A4fxiCBpheb+B5T3I8SnZtAeAJszADLavkCvCX+gWt0ElL7Z895c1xLZOlFTWvHPfeCMYtP5ELqV8zQ==", + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/react-dnd-scrolling/-/react-dnd-scrolling-1.3.8.tgz", + "integrity": "sha512-XcvmrTsQrPNry7jkY8RkNAZ2HZIiLiUzOSUltkW6eOhNjkKfivnPEhkj9hZf1JP4C32zxDsjN26xoBy7puZXoA==", "dependencies": { "hoist-non-react-statics": "3.x", "lodash.throttle": "^4.1.1", diff --git a/package.json b/package.json index e23c97fd517..aa8d3f5df01 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "echarts-for-react": "^3.0.2", "eslint-mdx": "^3.1.5", "events": "^3.3.0", - "glob": "^10.3.15", + "glob": "^10.4.2", "hi-profiles": "^1.0.6", "i18next": "^23.11.4", "i18next-browser-languagedetector": "^7.2.1", @@ -83,7 +83,7 @@ "react-copy-to-clipboard": "^5.1.0", "react-dnd": "^16.0.1", "react-dnd-html5-backend": "^16.0.1", - "react-dnd-scrolling": "^1.3.7", + "react-dnd-scrolling": "^1.3.8", "react-dom": "18.3.1", "react-google-recaptcha": "^3.1.0", "react-i18next": "^13.0.1", @@ -112,6 +112,7 @@ "@tailwindcss/container-queries": "^0.1.1", "@tailwindcss/forms": "^0.5.7", "@tailwindcss/typography": "^0.5.13", + "@types/cypress": "^1.1.3", "@types/echarts": "^4.9.22", "@types/google.maps": "^3.55.8", "@types/lodash-es": "^4.17.12", @@ -127,7 +128,7 @@ "@typescript-eslint/parser": "^5.61.0", "@vitejs/plugin-react-swc": "^3.6.0", "autoprefixer": "^10.4.19", - "cypress": "^13.9.0", + "cypress": "^13.13.1", "cypress-localstorage-commands": "^2.2.5", "cypress-split": "^1.23.2", "eslint": "^8.44.0", diff --git a/src/CAREUI/display/Count.tsx b/src/CAREUI/display/Count.tsx index 3b889b10e9b..997b58794eb 100644 --- a/src/CAREUI/display/Count.tsx +++ b/src/CAREUI/display/Count.tsx @@ -19,11 +19,11 @@ export default function CountBlock(props: Props) {
-
+
{props.text}
{props.loading ? ( -
+
) : (
{props.count} diff --git a/src/CAREUI/display/FilterBadge.tsx b/src/CAREUI/display/FilterBadge.tsx index a4cd743b86a..0259439a4b8 100644 --- a/src/CAREUI/display/FilterBadge.tsx +++ b/src/CAREUI/display/FilterBadge.tsx @@ -16,13 +16,13 @@ const FilterBadge = ({ name, value, onRemove }: FilterBadgeProps) => { data-testid={name} className={`${ !value && "hidden" - } flex flex-row items-center rounded-full border border-gray-300 bg-white px-3 py-1 text-xs font-medium leading-4 text-gray-600`} + } flex flex-row items-center rounded-full border border-secondary-300 bg-white px-3 py-1 text-xs font-medium leading-4 text-secondary-600`} > {`${name}: ${value}`} diff --git a/src/CAREUI/display/NetworkSignal.tsx b/src/CAREUI/display/NetworkSignal.tsx index 1d5f2d49623..d241a37674a 100644 --- a/src/CAREUI/display/NetworkSignal.tsx +++ b/src/CAREUI/display/NetworkSignal.tsx @@ -26,7 +26,7 @@ export default function NetworkSignal({ strength, children }: Props) { strength === 3 && "text-primary-500", )} > -
+
{strength === undefined ? ( i ? "bg-current" : "bg-zinc-600", + strength > i ? "bg-current" : "bg-zinc-500/30", )} /> )) @@ -53,7 +53,7 @@ export default function NetworkSignal({ strength, children }: Props) { {!!strength && strength < 2 && ( )}
diff --git a/src/CAREUI/display/SubHeading.tsx b/src/CAREUI/display/SubHeading.tsx index a9024e83687..1161ecd8e55 100644 --- a/src/CAREUI/display/SubHeading.tsx +++ b/src/CAREUI/display/SubHeading.tsx @@ -13,11 +13,11 @@ export default function SubHeading(props: Props) { return (
- + {props.title} {props.lastModified && ( -
+
diff --git a/src/CAREUI/display/Timeline.tsx b/src/CAREUI/display/Timeline.tsx index 3414a792398..bbbf5e24859 100644 --- a/src/CAREUI/display/Timeline.tsx +++ b/src/CAREUI/display/Timeline.tsx @@ -62,7 +62,7 @@ export const TimelineNode = (props: TimelineNodeProps) => { "absolute left-0 top-0 flex w-6 justify-center", )} > -
+
{ {props.title || (
-

+

{props.event.by && ( - + {props.event.by.username.startsWith("asset") ? t("virtual_nursing_assistant") : `${formatName(props.event.by)} ${ @@ -101,7 +101,7 @@ export const TimelineNode = (props: TimelineNodeProps) => { {props.actions} )}

@@ -131,13 +131,13 @@ export const TimelineNodeTitle = (props: TimelineNodeTitleProps) => {