@@ -222,25 +238,15 @@ let make = (~id, ~facilityId, ~patientId, ~consultationId, ~dailyRound) => {
className="bg-white px-2 md:px-6 py-5 border-b border-gray-200 sm:px-6 max-w-5xl mx-auto border mt-4 shadow rounded-lg">
{str("Record Updates")}
- {basicEditor(~facilityId, ~patientId, ~consultationId, ~id)} {Js.Array.map(editor => {
+ {basicEditor(~facilityId, ~patientId, ~consultationId, ~id)}
+ {Js.Array.map(editor => {
editorToggle(editor, state, send)
- }, [
- HemodynamicParametersEditor,
- NeurologicalMonitoringEditor,
- VentilatorParametersEditor,
- ArterialBloodGasAnalysisEditor,
- BloodSugarEditor,
- IOBalanceEditor,
- DialysisEditor,
- PressureSoreEditor,
- NursingCareEditor,
- ])->React.array}
+ }, sections)->React.array}
diff --git a/src/Components/Patient/DailyRounds.tsx b/src/Components/Patient/DailyRounds.tsx
index 2bb544327be..97ee038362b 100644
--- a/src/Components/Patient/DailyRounds.tsx
+++ b/src/Components/Patient/DailyRounds.tsx
@@ -343,11 +343,7 @@ export const DailyRounds = (props: any) => {
Notification.Success({
msg: `${t(obj.rounds_type as string)} log updated successfully`,
});
- if (
- ["NORMAL", "TELEMEDICINE", "DOCTORS_LOG"].includes(
- state.form.rounds_type,
- )
- ) {
+ if (["NORMAL", "TELEMEDICINE"].includes(state.form.rounds_type)) {
navigate(
`/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}`,
);
@@ -369,11 +365,7 @@ export const DailyRounds = (props: any) => {
msg: `${t(state.form.rounds_type)} log created successfully`,
});
- if (
- ["NORMAL", "TELEMEDICINE", "DOCTORS_LOG"].includes(
- state.form.rounds_type,
- )
- ) {
+ if (["NORMAL", "TELEMEDICINE"].includes(state.form.rounds_type)) {
navigate(
`/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}`,
);
From 0f5b54cab4fc29ac23568e005682afbba59375e4 Mon Sep 17 00:00:00 2001
From: Dev-Harwani <131504127+Dev-Harwani@users.noreply.github.com>
Date: Tue, 9 Jul 2024 22:55:31 +0530
Subject: [PATCH 6/6] Fix multi-select dropdown for facilities in user creation
module (#8086)
* Fix multi-select dropdown for facilities in user creation module
* if NOptions is undefined then all the facilities will be shown.If not then that particular number will be shown.
* Apply suggestions from code review
---------
Co-authored-by: Mohammed Nihal <57055998+nihal467@users.noreply.github.com>
Co-authored-by: Rithvik Nishad
---
src/Components/Common/FacilitySelect.tsx | 5 +++--
src/Components/Form/AutoCompleteAsync.tsx | 14 +++++++++-----
2 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/src/Components/Common/FacilitySelect.tsx b/src/Components/Common/FacilitySelect.tsx
index 2b820b40d6a..526bf6d68ac 100644
--- a/src/Components/Common/FacilitySelect.tsx
+++ b/src/Components/Common/FacilitySelect.tsx
@@ -17,7 +17,7 @@ interface FacilitySelectProps {
district?: string;
state?: string;
showAll?: boolean;
- showNOptions?: number;
+ showNOptions?: number | undefined;
freeText?: boolean;
selected?: FacilityModel | FacilityModel[] | null;
setSelected: (selected: FacilityModel | FacilityModel[] | null) => void;
@@ -34,7 +34,7 @@ export const FacilitySelect = (props: FacilitySelectProps) => {
searchAll,
disabled = false,
showAll = true,
- showNOptions = 10,
+ showNOptions,
className = "",
facilityType,
district,
@@ -65,6 +65,7 @@ export const FacilitySelect = (props: FacilitySelectProps) => {
data?.results?.push({
name: text,
});
+
return data?.results;
},
[searchAll, showAll, facilityType, district, exclude_user, freeText],
diff --git a/src/Components/Form/AutoCompleteAsync.tsx b/src/Components/Form/AutoCompleteAsync.tsx
index b66cf16b800..b9caa512137 100644
--- a/src/Components/Form/AutoCompleteAsync.tsx
+++ b/src/Components/Form/AutoCompleteAsync.tsx
@@ -18,7 +18,7 @@ interface Props {
onChange: (selected: any) => void;
optionLabel?: (option: any) => string;
optionLabelChip?: (option: any) => string;
- showNOptions?: number;
+ showNOptions?: number | undefined;
multiple?: boolean;
compareBy?: string;
debounceTime?: number;
@@ -40,7 +40,7 @@ const AutoCompleteAsync = (props: Props) => {
onChange,
optionLabel = (option: any) => option.label,
optionLabelChip = (option: any) => option.label,
- showNOptions = 10,
+ showNOptions,
multiple = false,
compareBy,
debounceTime = 300,
@@ -62,8 +62,13 @@ const AutoCompleteAsync = (props: Props) => {
() =>
debounce(async (query: string) => {
setLoading(true);
- const data = await fetchData(query);
- setData(data?.slice(0, showNOptions) || []);
+ const data = (await fetchData(query)) || [];
+
+ if (showNOptions !== undefined) {
+ setData(data.slice(0, showNOptions));
+ } else {
+ setData(data);
+ }
setLoading(false);
}, debounceTime),
[fetchData, showNOptions, debounceTime],
@@ -102,7 +107,6 @@ const AutoCompleteAsync = (props: Props) => {
onChange={({ target }) => setQuery(target.value)}
onFocus={props.onFocus}
onBlur={() => {
- setQuery("");
props.onBlur?.();
}}
autoComplete="off"