diff --git a/cypress/e2e/assets_spec/assets_creation.cy.ts b/cypress/e2e/assets_spec/assets_creation.cy.ts index f8edc2bb172..cd3489a14d8 100644 --- a/cypress/e2e/assets_spec/assets_creation.cy.ts +++ b/cypress/e2e/assets_spec/assets_creation.cy.ts @@ -160,12 +160,10 @@ describe("Asset", () => { assetPage.interceptAssetCreation(); assetPage.clickCreateAsset(); assetPage.verifyAssetCreation(); - assetSearchPage.typeSearchKeyword("New Test Asset Vital"); assetSearchPage.pressEnter(); - assetPage.openCreatedAsset(); - assetPage.configureVitalAsset("Host name", "192.168.1.64"); + assetPage.configureVitalAsset("Host name", "192.168.1.20"); assetPage.clickConfigureVital(); }); diff --git a/src/Components/ABDM/LinkABHANumberModal.tsx b/src/Components/ABDM/LinkABHANumberModal.tsx index fe789e6c909..d7dfc9f60c1 100644 --- a/src/Components/ABDM/LinkABHANumberModal.tsx +++ b/src/Components/ABDM/LinkABHANumberModal.tsx @@ -194,12 +194,12 @@ const ScanABHAQRSection = ({ body: { patientId, hidn: abha?.hidn, - phr: abha?.hid, + phr: (abha?.phr ?? abha?.hid) as string, name: abha?.name, gender: abha?.gender, dob: abha?.dob.replace(/\//g, "-"), address: abha?.address, - "dist name": abha?.district_name, + "dist name": abha?.["dist name"] ?? abha?.district_name, "state name": abha?.["state name"], }, }); diff --git a/src/Components/ABDM/models.ts b/src/Components/ABDM/models.ts index 957dc9c2d17..9dc362f5cac 100644 --- a/src/Components/ABDM/models.ts +++ b/src/Components/ABDM/models.ts @@ -123,10 +123,12 @@ export interface ILinkViaQRBody { export interface ABHAQRContent { address: string; distlgd: string; - district_name: string; + district_name?: string; dob: string; - gender: "M"; - hid: string; + gender: "M" | "F" | "O"; + hid?: string; + phr?: string; + "dist name"?: string; hidn: string; mobile: string; name: string; diff --git a/src/Components/Facility/Consultations/DailyRounds/LogUpdateCardAttribute.tsx b/src/Components/Facility/Consultations/DailyRounds/LogUpdateCardAttribute.tsx index 3afed28dda8..4e5b7408266 100644 --- a/src/Components/Facility/Consultations/DailyRounds/LogUpdateCardAttribute.tsx +++ b/src/Components/Facility/Consultations/DailyRounds/LogUpdateCardAttribute.tsx @@ -62,6 +62,18 @@ const LogUpdateCardAttribute = ({ ); + case "rounds_type": + return ( +
+ + + {(attributeValue as string) === "VENTILATOR" + ? "CRITICAL CARE" + : (attributeValue as string)} + +
+ ); + default: return (
diff --git a/src/Components/Form/FormFields/TextFormField.tsx b/src/Components/Form/FormFields/TextFormField.tsx index b2a84e51595..8f1ee341e34 100644 --- a/src/Components/Form/FormFields/TextFormField.tsx +++ b/src/Components/Form/FormFields/TextFormField.tsx @@ -100,7 +100,7 @@ const TextFormField = forwardRef((props: TextFormFieldProps, ref) => { ); const _trailing = trailing === trailingFocused ? ( -
+
{trailing}
) : ( diff --git a/src/Components/Notifications/NotificationsList.tsx b/src/Components/Notifications/NotificationsList.tsx index 02cb1f4fa8b..c9e6720e6ad 100644 --- a/src/Components/Notifications/NotificationsList.tsx +++ b/src/Components/Notifications/NotificationsList.tsx @@ -46,6 +46,16 @@ const NotificationTile = ({ setIsMarkingAsRead(false); }; + const handleMarkAsUnRead = async () => { + setIsMarkingAsRead(true); + await request(routes.markNotificationAsUnRead, { + pathParams: { id: result.id }, + body: { read_at: null }, + }); + setResult({ ...result, read_at: null }); + setIsMarkingAsRead(false); + }; + const resultUrl = (event: string, data: any) => { switch (event) { case "PATIENT_CREATED": @@ -107,24 +117,33 @@ const NotificationTile = ({
{ event.stopPropagation(); - handleMarkAsRead(); + if (result.read_at) { + handleMarkAsUnRead(); + } else { + handleMarkAsRead(); + } }} > - {t("mark_as_read")} + + {result.read_at ? t("mark_as_unread") : t("mark_as_read")} + { ); }; - if (isLoading) { + if (isLoading || !sampleDetails) { return ; } diff --git a/src/Locale/en/Notifications.json b/src/Locale/en/Notifications.json index 8c6255ca850..ad8dc0e20f1 100644 --- a/src/Locale/en/Notifications.json +++ b/src/Locale/en/Notifications.json @@ -1,6 +1,7 @@ { "no_notices_for_you": "No notices for you.", "mark_as_read": "Mark as Read", + "mark_as_unread": "Mark as Unread", "subscribe": "Subscribe", "subscribe_on_this_device": "Subscribe on this device", "show_unread_notifications": "Show Unread", diff --git a/src/Redux/api.tsx b/src/Redux/api.tsx index 7445cd3352f..4dd3480ec8c 100644 --- a/src/Redux/api.tsx +++ b/src/Redux/api.tsx @@ -1062,6 +1062,11 @@ const routes = { method: "PATCH", TRes: Type(), }, + markNotificationAsUnRead: { + path: "/api/v1/notification/{id}/", + method: "PATCH", + TRes: Type(), + }, getPublicKey: { path: "/api/v1/notification/public_key/", method: "GET",