From 54e57d896d2d255fa135b552f941a72ca650bcd7 Mon Sep 17 00:00:00 2001 From: "Aditya @ArchLinux" <132184385+adityadeshlahre@users.noreply.github.com> Date: Mon, 26 Aug 2024 23:55:59 +0530 Subject: [PATCH] fix(redndering): range[ELEMENTS] rendering fixed --- .../admin/testManagementConfigMenu/TestAdd.js | 172 ++++++++++++++++-- 1 file changed, 157 insertions(+), 15 deletions(-) diff --git a/frontend/src/components/admin/testManagementConfigMenu/TestAdd.js b/frontend/src/components/admin/testManagementConfigMenu/TestAdd.js index 06b80858a6..6bfdcb4ff0 100644 --- a/frontend/src/components/admin/testManagementConfigMenu/TestAdd.js +++ b/frontend/src/components/admin/testManagementConfigMenu/TestAdd.js @@ -29,6 +29,9 @@ import { Tag, UnorderedList, ListItem, + NumberInput, + RadioButtonGroup, + RadioButton, } from "@carbon/react"; import { getFromOpenElisServer, @@ -72,6 +75,8 @@ function TestAdd() { const [isLoading, setIsLoading] = useState(false); const [lonic, setLonic] = useState(""); const [testAdd, setTestAdd] = useState({}); + const [ageRangeList, setAgeRangeList] = useState([]); + const [gotSelectedAgeRangeList, setGotSelectedAgeRangeList] = useState([]); const [labUnitList, setLabUnitList] = useState([]); const [selectedLabUnitList, setSelectedLabUnitList] = useState({}); const [panelList, setPanelList] = useState([]); @@ -209,6 +214,10 @@ function TestAdd() { { id: "0", value: "Select Multiple" }, ...(testAdd.dictionaryList || []), ]); + setAgeRangeList([ + { id: "0", value: "" }, + ...(testAdd.ageRangeList || []), + ]); } }, [testAdd]); @@ -324,13 +333,6 @@ function TestAdd() { } } - function handelPanelListSelect(e) { - setJsonWad((prev) => ({ - ...prev, - panels: [...prev.panels, e.target.value], - })); - } - function handelUomSelect(e) { setJsonWad((prev) => ({ ...prev, uom: e.target.value })); @@ -405,14 +407,26 @@ function TestAdd() { })); } - function nextButton() { + function handleSampleTypeSetup() { setSampleTypeSetupPage(true); } - function finalButton() { + function handleRangeSetup() { setRangeSetupPage(true); } + function handleOnResultType() { + setOnResultType(true); + } + + function handleExistingTestSetup() { + setExistingTestSetupPage(true); + } + + function handleFinalSaveConfirmation() { + setFinalSaveConfirmation(true); + } + const handelPanelSelectSetTag = (e) => { const selectedId = e.target.value; const selectedValue = e.target.options[e.target.selectedIndex].text; @@ -871,7 +885,7 @@ function TestAdd() {

- {" "} {" "} {" "} + +

@@ -1168,6 +1200,42 @@ function TestAdd() {
+
+ } + // onChange={() => {}} + /> + {/* render male & female on checkbox*/} + + + + + + + +
+
+
@@ -1185,6 +1253,7 @@ function TestAdd() { hideLabel required /> + {/* render two extra fields for TextInput on Click of Check box */} @@ -1243,6 +1312,51 @@ function TestAdd() {
+ + + +
+
+
+ + + {" : "} + +
+
+
+
+ + + +
+
+
+ + + {" "} + + + +


@@ -1298,6 +1412,25 @@ function TestAdd() { ))}
+ + + {" "} + + + +


@@ -1318,6 +1451,7 @@ function TestAdd() { {" : "} {jsonWad?.testNameFrench}
+

@@ -1328,20 +1462,19 @@ function TestAdd() { {" : "} {jsonWad?.reportingTestNameFr}
+
{" : "} {selectedLabUnitList?.value}
+
{" : "} {/* map the {panelList[0].value} in and there values in line*/} {panelListTag.length > 0 ? ( {panelListTag.map((tag) => ( -
+
{tag.value}
))} @@ -1350,37 +1483,46 @@ function TestAdd() { <> )}
+
{" : "} {selectedUomList?.value}
+
{" : "} {jsonWad?.loinc}
+
{" : "} {selectedResultTypeList.value}
+
{" : "} {jsonWad?.antimicrobialResistance}
+
{" : "} {jsonWad?.active}
+
{" : "} {jsonWad?.orderable}
+
{" : "} {jsonWad?.notifyResults}
+
{" : "} {jsonWad?.inLabOnly} +