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_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 a049f0727cf..7edab217325 100644 --- a/package-lock.json +++ b/package-lock.json @@ -73,6 +73,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", @@ -89,7 +90,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", @@ -6229,6 +6230,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", @@ -9142,9 +9153,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": { @@ -9187,7 +9198,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" }, diff --git a/package.json b/package.json index 5a658d6d510..4d3feedc920 100644 --- a/package.json +++ b/package.json @@ -113,6 +113,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", @@ -129,7 +130,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..91ce6b58b4c 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 ? ( )}
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) => {