From 6716d2c5f2da4ec9570ff1312d74516458abac77 Mon Sep 17 00:00:00 2001 From: Rithvik Nishad Date: Fri, 24 Nov 2023 08:20:00 +0530 Subject: [PATCH 1/7] fixes #6697; add missing wrarranty validity filters (#6698) --- src/Components/Assets/AssetsList.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Components/Assets/AssetsList.tsx b/src/Components/Assets/AssetsList.tsx index df6326c6e79..447bff1c1d0 100644 --- a/src/Components/Assets/AssetsList.tsx +++ b/src/Components/Assets/AssetsList.tsx @@ -63,6 +63,10 @@ const AssetsList = () => { asset_class: qParams.asset_class || "", location: qParams.facility ? qParams.location || "" : "", status: qParams.status || "", + warranty_amc_end_of_validity_before: + qParams.warranty_amc_end_of_validity_before || "", + warranty_amc_end_of_validity_after: + qParams.warranty_amc_end_of_validity_after || "", }; const { loading } = useQuery(routes.listAssets, { From b9c7021afe3509e0f7f86f44efd33fbd4888cf16 Mon Sep 17 00:00:00 2001 From: Ashesh <3626859+Ashesh3@users.noreply.github.com> Date: Fri, 24 Nov 2023 11:41:45 +0530 Subject: [PATCH 2/7] Fix cypress for doctor notes (#6703) --- cypress/pageobject/Patient/PatientConsultation.ts | 3 ++- src/Components/Facility/PatientNotesSlideover.tsx | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cypress/pageobject/Patient/PatientConsultation.ts b/cypress/pageobject/Patient/PatientConsultation.ts index 7d2be8734dd..4fb299a4965 100644 --- a/cypress/pageobject/Patient/PatientConsultation.ts +++ b/cypress/pageobject/Patient/PatientConsultation.ts @@ -203,12 +203,13 @@ export class PatientConsultationPage { } addDoctorsNotes(notes: string) { + cy.get("#expand_doctor_notes").click(); cy.get("#doctor_notes_textarea").type(notes); } postDoctorNotes() { cy.intercept("POST", "**/api/v1/patient/*/notes").as("postDoctorNotes"); - cy.get("#submit").contains("Post Your Note").click(); + cy.get("#add_doctor_note_button").click(); cy.wait("@postDoctorNotes").its("response.statusCode").should("eq", 201); } diff --git a/src/Components/Facility/PatientNotesSlideover.tsx b/src/Components/Facility/PatientNotesSlideover.tsx index a04fac93526..27a961b9d9b 100644 --- a/src/Components/Facility/PatientNotesSlideover.tsx +++ b/src/Components/Facility/PatientNotesSlideover.tsx @@ -79,6 +79,7 @@ export default function PatientNotesSlideover(props: PatientNotesProps) { )}
setNoteField(e.value)} @@ -139,6 +141,7 @@ export default function PatientNotesSlideover(props: PatientNotesProps) { disabled={!patientActive} /> Date: Fri, 24 Nov 2023 11:48:00 +0530 Subject: [PATCH 3/7] Revert buggy replacement of useDispatch with useQuery in Live Feed (#6707) --- .../Facility/Consultations/LiveFeed.tsx | 79 ++++++++++--------- 1 file changed, 42 insertions(+), 37 deletions(-) diff --git a/src/Components/Facility/Consultations/LiveFeed.tsx b/src/Components/Facility/Consultations/LiveFeed.tsx index 4f6c3391c43..cd3f055921e 100644 --- a/src/Components/Facility/Consultations/LiveFeed.tsx +++ b/src/Components/Facility/Consultations/LiveFeed.tsx @@ -1,8 +1,11 @@ -import { useEffect, useRef, useState } from "react"; +import { useEffect, useState, useRef } from "react"; import { useDispatch } from "react-redux"; -import routes from "../../../Redux/api"; -import request from "../../../Utils/request/request"; import useKeyboardShortcut from "use-keyboard-shortcut"; +import { + listAssetBeds, + partialUpdateAssetBed, + deleteAssetBed, +} from "../../../Redux/actions"; import { getCameraPTZ } from "../../../Common/constants"; import { StreamStatus, @@ -109,30 +112,28 @@ const LiveFeed = (props: any) => { }; const getBedPresets = async (id: any) => { - const { data } = await request(routes.listAssetBeds, { - pathParams: { asset: id }, - body: { + const bedAssets = await dispatch( + listAssetBeds({ + asset: id, limit: page.limit, offset: page.offset, - }, - }); - setBedPresets(data?.results); + }) + ); + setBedPresets(bedAssets?.data?.results); setPage({ ...page, - count: data?.count || 0, + count: bedAssets?.data?.count, }); }; const deletePreset = async (id: any) => { - const { res, data } = await request(routes.deleteAssetBed, { - pathParams: { id }, - }); + const res = await dispatch(deleteAssetBed(id)); if (res?.status === 204) { Notification.Success({ msg: "Preset deleted successfully" }); getBedPresets(cameraAsset.id); } else { Notification.Error({ - msg: "Error while deleting Preset: " + (data?.detail || ""), + msg: "Error while deleting Preset: " + (res?.data?.detail || ""), }); } setToDelete(null); @@ -143,18 +144,20 @@ const LiveFeed = (props: any) => { bed_id: bed.id, preset_name: preset, }; - const { res } = await request(routes.partialUpdateAssetBed, { - pathParams: { id: currentPreset.id }, - body: { - asset: currentPreset.asset_object.id, - bed: bed.id, - meta: { - ...currentPreset.meta, - ...data, + const response = await dispatch( + partialUpdateAssetBed( + { + asset: currentPreset.asset_object.id, + bed: bed.id, + meta: { + ...currentPreset.meta, + ...data, + }, }, - }, - }); - if (res && res.status === 200) { + currentPreset?.id + ) + ); + if (response && response.status === 200) { Notification.Success({ msg: "Preset Updated" }); } else { Notification.Error({ msg: "Something Went Wrong" }); @@ -255,19 +258,20 @@ const LiveFeed = (props: any) => { if (currentPreset?.asset_object?.id && data?.position) { setLoading(option.loadingLabel); console.log("Updating Preset"); - const { res } = await request(routes.partialUpdateAssetBed, { - pathParams: { id: currentPreset.id }, - body: { - asset: currentPreset.asset_object.id, - bed: currentPreset.bed_object.id, - meta: { - ...currentPreset.meta, - position: data?.position, + const response = await dispatch( + partialUpdateAssetBed( + { + asset: currentPreset.asset_object.id, + bed: currentPreset.bed_object.id, + meta: { + ...currentPreset.meta, + position: data?.position, + }, }, - }, - }); - - if (res && res.status === 200) { + currentPreset?.id + ) + ); + if (response && response.status === 200) { Notification.Success({ msg: "Preset Updated" }); getBedPresets(cameraAsset?.id); fetchCameraPresets(); @@ -624,4 +628,5 @@ const LiveFeed = (props: any) => { ); }; + export default LiveFeed; From 392fbd5b18e8c368fc995ad9906c1ad972e6a0a6 Mon Sep 17 00:00:00 2001 From: Ashesh <3626859+Ashesh3@users.noreply.github.com> Date: Fri, 24 Nov 2023 17:03:21 +0530 Subject: [PATCH 4/7] Fix layout issue in DailyRoundsList component (#6709) --- src/Components/Facility/Consultations/DailyRoundsList.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Components/Facility/Consultations/DailyRoundsList.tsx b/src/Components/Facility/Consultations/DailyRoundsList.tsx index da4b8201495..8d08cea2f95 100644 --- a/src/Components/Facility/Consultations/DailyRoundsList.tsx +++ b/src/Components/Facility/Consultations/DailyRoundsList.tsx @@ -28,7 +28,7 @@ export const DailyRoundsList = (props: any) => { }} > {(_) => ( -
+
@@ -42,7 +42,7 @@ export const DailyRoundsList = (props: any) => { ))} - className="my-8 flex grow flex-col gap-3 lg:mx-8"> + className="flex grow flex-col gap-3"> {(item, items) => { if (item.rounds_type === "AUTOMATED") { return ( From 83b6d1f94009c524c32c397350aacbcf85aee90f Mon Sep 17 00:00:00 2001 From: Khavin Shankar Date: Fri, 24 Nov 2023 17:03:49 +0530 Subject: [PATCH 5/7] sandbox iframe in fileupload (#6691) --- src/Components/Common/FilePreviewDialog.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Components/Common/FilePreviewDialog.tsx b/src/Components/Common/FilePreviewDialog.tsx index b7eda93930e..90dde50a249 100644 --- a/src/Components/Common/FilePreviewDialog.tsx +++ b/src/Components/Common/FilePreviewDialog.tsx @@ -192,6 +192,7 @@ const FilePreviewDialog = (props: FilePreviewProps) => { /> ) : (