From 31e8e072f8eb0e8291877a183a78ccb7b37f79f5 Mon Sep 17 00:00:00 2001 From: MiraGeowerkstatt Date: Thu, 19 Dec 2024 17:24:02 +0100 Subject: [PATCH 1/5] wip --- src/client/src/components/buttons/buttonSelect.tsx | 2 +- src/client/src/components/form/formCoordinate.tsx | 2 +- src/client/src/components/form/formDisplay.tsx | 2 +- src/client/src/components/form/formInput.tsx | 2 +- src/client/src/components/form/formMultiSelect.tsx | 4 ++-- src/client/src/components/form/formSelect.tsx | 2 +- .../src/pages/detail/form/borehole/boreholeForm.tsx | 8 ++++---- .../pages/detail/form/completion/casingDisplay.jsx | 4 ++-- .../form/hydrogeology/fieldMeasurementDisplay.jsx | 4 ++-- .../detail/form/hydrogeology/hydrotestDisplay.jsx | 2 +- .../detail/form/location/coordinatesSegment.tsx | 4 ++-- .../pages/detail/form/location/elevationSegment.tsx | 4 ++-- .../detail/form/location/identifierSegment.tsx | 2 +- .../pages/detail/form/location/locationPanel.tsx | 8 ++++---- .../src/pages/detail/form/location/nameSegment.tsx | 13 ++++--------- .../descriptionLayers/descriptionInput.jsx | 2 +- .../sidePanelContent/commons/workgroupSelect.tsx | 2 +- 17 files changed, 31 insertions(+), 36 deletions(-) diff --git a/src/client/src/components/buttons/buttonSelect.tsx b/src/client/src/components/buttons/buttonSelect.tsx index 42256f67d..8758871e3 100644 --- a/src/client/src/components/buttons/buttonSelect.tsx +++ b/src/client/src/components/buttons/buttonSelect.tsx @@ -57,7 +57,7 @@ export const ButtonSelect: FC = ({ onClick={handleClick} startIcon={startIcon} endIcon={anchorEl ? : } - className={`${isOpen ? "Mui-active" : ""} ${className || ""}`} + className={`${isOpen ? "Mui-active" : ""} ${className ?? ""}`} data-cy={`${fieldName}-button-select`} sx={{ ...sx }}> {selectedItem?.value} diff --git a/src/client/src/components/form/formCoordinate.tsx b/src/client/src/components/form/formCoordinate.tsx index 18e461da0..58b705433 100644 --- a/src/client/src/components/form/formCoordinate.tsx +++ b/src/client/src/components/form/formCoordinate.tsx @@ -62,7 +62,7 @@ export const FormCoordinate: FC = ({ required={required || false} error={!className?.includes("ai") && !disabled && getFormFieldError(fieldName, formState.errors)} sx={{ ...sx }} - className={`${readonly ? "readonly" : ""} ${className || ""}`} + className={`${readonly ? "readonly" : ""} ${className ?? ""}`} label={t(`location_${direction.toLowerCase()}_${referenceSystem}`)} {...register(fieldName, { required: required || false, diff --git a/src/client/src/components/form/formDisplay.tsx b/src/client/src/components/form/formDisplay.tsx index 2d91b57f7..dd7cfff88 100644 --- a/src/client/src/components/form/formDisplay.tsx +++ b/src/client/src/components/form/formDisplay.tsx @@ -67,7 +67,7 @@ export const FormDisplay: FC = ({ prefix, label, value, type, ...sx, }}> {t(label)} - + {formatValue(value)} diff --git a/src/client/src/components/form/formInput.tsx b/src/client/src/components/form/formInput.tsx index d076e29c6..a86bab1ae 100644 --- a/src/client/src/components/form/formInput.tsx +++ b/src/client/src/components/form/formInput.tsx @@ -61,7 +61,7 @@ export const FormInput: FC = ({ required={required || false} error={getFormFieldError(fieldName, formState.errors)} sx={{ ...sx }} - className={`${readonly ? "readonly" : ""} ${className || ""}`} + className={`${readonly ? "readonly" : ""} ${className ?? ""}`} type={type || FormValueType.Text} multiline={multiline || false} rows={rows} diff --git a/src/client/src/components/form/formMultiSelect.tsx b/src/client/src/components/form/formMultiSelect.tsx index 5af12bf3c..c8c7fdb2c 100644 --- a/src/client/src/components/form/formMultiSelect.tsx +++ b/src/client/src/components/form/formMultiSelect.tsx @@ -103,7 +103,7 @@ export const FormMultiSelect: FC = ({ InputProps={{ readOnly: readonly, disabled: disabled }} required={required || false} sx={{ ...sx }} - className={`${readonly ? "readonly" : ""} ${className || ""}`} + className={`${readonly ? "readonly" : ""} ${className ?? ""}`} label={t(label)} {...register(fieldName, { required: required || false, @@ -135,7 +135,7 @@ export const FormMultiSelect: FC = ({ required={required || false} error={getFormFieldError(fieldName, formState.errors)} sx={{ ...sx }} - className={`${readonly ? "readonly" : ""} ${className || ""}`} + className={`${readonly ? "readonly" : ""} ${className ?? ""}`} label={t(label)} {...register(fieldName, { required: required || false, diff --git a/src/client/src/components/form/formSelect.tsx b/src/client/src/components/form/formSelect.tsx index 87b944323..e6a109d06 100644 --- a/src/client/src/components/form/formSelect.tsx +++ b/src/client/src/components/form/formSelect.tsx @@ -82,7 +82,7 @@ export const FormSelect: FC = ({ required={required ?? false} error={getFormFieldError(fieldName, formState.errors)} sx={{ ...sx }} - className={`${readonly ? "readonly" : ""} ${className || ""}`} + className={`${readonly ? "readonly" : ""} ${className ?? ""}`} label={t(label)} name={field.name} onChange={field.onChange} diff --git a/src/client/src/pages/detail/form/borehole/boreholeForm.tsx b/src/client/src/pages/detail/form/borehole/boreholeForm.tsx index de0add108..d1c5461c3 100644 --- a/src/client/src/pages/detail/form/borehole/boreholeForm.tsx +++ b/src/client/src/pages/detail/form/borehole/boreholeForm.tsx @@ -124,7 +124,7 @@ export const BoreholeForm = forwardRef(({ borehole, editingEnabled, onSubmit }: @@ -142,7 +142,7 @@ export const BoreholeForm = forwardRef(({ borehole, editingEnabled, onSubmit }: @@ -156,7 +156,7 @@ export const BoreholeForm = forwardRef(({ borehole, editingEnabled, onSubmit }: @@ -202,7 +202,7 @@ export const BoreholeForm = forwardRef(({ borehole, editingEnabled, onSubmit }: fieldName={"remarks"} multiline={true} label={"remarks"} - value={borehole?.remarks || ""} + value={borehole?.remarks} readonly={!editingEnabled} /> diff --git a/src/client/src/pages/detail/form/completion/casingDisplay.jsx b/src/client/src/pages/detail/form/completion/casingDisplay.jsx index a0339f5a4..4d872f830 100644 --- a/src/client/src/pages/detail/form/completion/casingDisplay.jsx +++ b/src/client/src/pages/detail/form/completion/casingDisplay.jsx @@ -55,10 +55,10 @@ const CasingDisplay = props => { {element.toDepth} - {domains?.data?.find(d => d.id === element.kindId)?.[i18n.language] || ""} + {domains?.data?.find(d => d.id === element.kindId)?.[i18n.language] ?? ""} - {domains?.data?.find(d => d.id === element.materialId)?.[i18n.language] || ""} + {domains?.data?.find(d => d.id === element.materialId)?.[i18n.language] ?? ""} {element.innerDiameter} diff --git a/src/client/src/pages/detail/form/hydrogeology/fieldMeasurementDisplay.jsx b/src/client/src/pages/detail/form/hydrogeology/fieldMeasurementDisplay.jsx index 9b34099e3..93d9f2758 100644 --- a/src/client/src/pages/detail/form/hydrogeology/fieldMeasurementDisplay.jsx +++ b/src/client/src/pages/detail/form/hydrogeology/fieldMeasurementDisplay.jsx @@ -27,7 +27,7 @@ const FieldMeasurementDisplay = props => { renderBody={(result, index, styles) => ( <> - {domains?.data?.find(d => d.id === result.sampleTypeId)?.[i18n.language] || ""} + {domains?.data?.find(d => d.id === result.sampleTypeId)?.[i18n.language] ?? ""} { minWidth: "200px", }} data-cy={`fieldMeasurementResult.${index}.parameter-formDisplay`}> - {domains?.data?.find(d => d.id === result.parameterId)?.[i18n.language] || ""} + {domains?.data?.find(d => d.id === result.parameterId)?.[i18n.language] ?? ""} {result?.value && ( diff --git a/src/client/src/pages/detail/form/hydrogeology/hydrotestDisplay.jsx b/src/client/src/pages/detail/form/hydrogeology/hydrotestDisplay.jsx index 654ed3d79..505d4491a 100644 --- a/src/client/src/pages/detail/form/hydrogeology/hydrotestDisplay.jsx +++ b/src/client/src/pages/detail/form/hydrogeology/hydrotestDisplay.jsx @@ -51,7 +51,7 @@ const HydrotestDisplay = props => { minWidth: "200px", }} data-cy={`hydrotestResult.${index}.parameter-formDisplay`}> - {domains?.data?.find(d => d.id === result.parameterId)?.[i18n.language] || ""} + {domains?.data?.find(d => d.id === result.parameterId)?.[i18n.language] ?? ""} {result?.value && ( diff --git a/src/client/src/pages/detail/form/location/coordinatesSegment.tsx b/src/client/src/pages/detail/form/location/coordinatesSegment.tsx index 2263ed1e4..9eaa3642c 100644 --- a/src/client/src/pages/detail/form/location/coordinatesSegment.tsx +++ b/src/client/src/pages/detail/form/location/coordinatesSegment.tsx @@ -44,8 +44,8 @@ const CoordinatesSegment: React.FC = ({ // --- Utility functions --- const updateFormValues = useCallback( (refSystem: string, locationX: number | null, locationY: number | null, precisionX: number, precisionY: number) => { - const locationXString = (locationX && locationX?.toFixed(precisionX)) || ""; - const locationYString = (locationY && locationY?.toFixed(precisionY)) || ""; + const locationXString = (locationX && locationX?.toFixed(precisionX)) ?? ""; + const locationYString = (locationY && locationY?.toFixed(precisionY)) ?? ""; setValuesForReferenceSystem(refSystem, locationXString, locationYString); }, [setValuesForReferenceSystem], diff --git a/src/client/src/pages/detail/form/location/elevationSegment.tsx b/src/client/src/pages/detail/form/location/elevationSegment.tsx index 7991800df..7ad0777f8 100644 --- a/src/client/src/pages/detail/form/location/elevationSegment.tsx +++ b/src/client/src/pages/detail/form/location/elevationSegment.tsx @@ -23,7 +23,7 @@ const ElevationSegment: FC = ({ borehole, editingEnabled, fieldName={"elevationZ"} label={"elevation_z"} value={borehole.elevationZ} - controlledValue={formMethods.watch("elevationZ") || ""} + controlledValue={formMethods.watch("elevationZ") ?? ""} withThousandSeparator={true} readonly={!editingEnabled} /> @@ -39,7 +39,7 @@ const ElevationSegment: FC = ({ borehole, editingEnabled, diff --git a/src/client/src/pages/detail/form/location/identifierSegment.tsx b/src/client/src/pages/detail/form/location/identifierSegment.tsx index ca8603cf8..f6ced4a30 100644 --- a/src/client/src/pages/detail/form/location/identifierSegment.tsx +++ b/src/client/src/pages/detail/form/location/identifierSegment.tsx @@ -74,7 +74,7 @@ const IdentifierSegment = ({ borehole, editingEnabled, formMethods }: Identifier fieldName={`boreholeCodelists.${index}.value`} readonly={!editingEnabled} label="borehole_identifier_value" - value={field.value || ""} + value={field.value} type={FormValueType.Text} /> diff --git a/src/client/src/pages/detail/form/location/locationPanel.tsx b/src/client/src/pages/detail/form/location/locationPanel.tsx index b02abcbe9..7e25bcba9 100644 --- a/src/client/src/pages/detail/form/location/locationPanel.tsx +++ b/src/client/src/pages/detail/form/location/locationPanel.tsx @@ -30,10 +30,10 @@ export const LocationPanel = forwardRef( country: borehole.country, canton: borehole.canton, municipality: borehole.municipality, - locationX: borehole.locationX?.toFixed(borehole.precisionLocationX) || "", - locationY: borehole.locationY?.toFixed(borehole.precisionLocationY) || "", - locationXLV03: borehole.locationXLV03?.toFixed(borehole.precisionLocationXLV03) || "", - locationYLV03: borehole.locationYLV03?.toFixed(borehole.precisionLocationYLV03) || "", + locationX: borehole.locationX?.toFixed(borehole.precisionLocationX) ?? "", + locationY: borehole.locationY?.toFixed(borehole.precisionLocationY) ?? "", + locationXLV03: borehole.locationXLV03?.toFixed(borehole.precisionLocationXLV03) ?? "", + locationYLV03: borehole.locationYLV03?.toFixed(borehole.precisionLocationYLV03) ?? "", locationPrecisionId: borehole.locationPrecisionId, originalReferenceSystem: borehole.originalReferenceSystem, boreholeCodelists: borehole?.boreholeCodelists, diff --git a/src/client/src/pages/detail/form/location/nameSegment.tsx b/src/client/src/pages/detail/form/location/nameSegment.tsx index a068b0015..6c97d33ee 100644 --- a/src/client/src/pages/detail/form/location/nameSegment.tsx +++ b/src/client/src/pages/detail/form/location/nameSegment.tsx @@ -30,7 +30,7 @@ const NameSegment = ({ borehole, editingEnabled, formMethods }: NameSegmentProps )} - + diff --git a/src/client/src/pages/detail/form/stratigraphy/lithology/lithologyLayers/descriptionLayers/descriptionInput.jsx b/src/client/src/pages/detail/form/stratigraphy/lithology/lithologyLayers/descriptionLayers/descriptionInput.jsx index 9587b7ada..4c3dbd6c9 100644 --- a/src/client/src/pages/detail/form/stratigraphy/lithology/lithologyLayers/descriptionLayers/descriptionInput.jsx +++ b/src/client/src/pages/detail/form/stratigraphy/lithology/lithologyLayers/descriptionLayers/descriptionInput.jsx @@ -98,7 +98,7 @@ const DescriptionInput = props => { variant="outlined" size="small" label={t("description_quality")} - defaultValue={item.descriptionQualityId || ""} + defaultValue={item.descriptionQualityId ?? ""} data-cy="qt-decription-select" InputLabelProps={{ shrink: true }} onChange={e => { diff --git a/src/client/src/pages/overview/sidePanelContent/commons/workgroupSelect.tsx b/src/client/src/pages/overview/sidePanelContent/commons/workgroupSelect.tsx index f364251f5..825e1c79c 100644 --- a/src/client/src/pages/overview/sidePanelContent/commons/workgroupSelect.tsx +++ b/src/client/src/pages/overview/sidePanelContent/commons/workgroupSelect.tsx @@ -38,7 +38,7 @@ const WorkgroupSelect = ({ workgroupId, enabledWorkgroups, setWorkgroupId, sx, h data-cy="workgroup-formSelect" value={workgroupId} onChange={e => setWorkgroupId(e.target.value as string)} - renderValue={selected => options.find(o => o.value === selected)?.text || ""}> + renderValue={selected => options.find(o => o.value === selected)?.text ?? ""}> {options.map(o => ( {o.text} From 215d05a7fa9ce625ecbf6821d5bda4fb7df2de2c Mon Sep 17 00:00:00 2001 From: MiraGeowerkstatt Date: Thu, 19 Dec 2024 17:44:54 +0100 Subject: [PATCH 2/5] Fix typescript error --- .../src/pages/detail/form/location/coordinatesSegment.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/src/pages/detail/form/location/coordinatesSegment.tsx b/src/client/src/pages/detail/form/location/coordinatesSegment.tsx index 9eaa3642c..2263ed1e4 100644 --- a/src/client/src/pages/detail/form/location/coordinatesSegment.tsx +++ b/src/client/src/pages/detail/form/location/coordinatesSegment.tsx @@ -44,8 +44,8 @@ const CoordinatesSegment: React.FC = ({ // --- Utility functions --- const updateFormValues = useCallback( (refSystem: string, locationX: number | null, locationY: number | null, precisionX: number, precisionY: number) => { - const locationXString = (locationX && locationX?.toFixed(precisionX)) ?? ""; - const locationYString = (locationY && locationY?.toFixed(precisionY)) ?? ""; + const locationXString = (locationX && locationX?.toFixed(precisionX)) || ""; + const locationYString = (locationY && locationY?.toFixed(precisionY)) || ""; setValuesForReferenceSystem(refSystem, locationXString, locationYString); }, [setValuesForReferenceSystem], From 9d7e3cd12c3a0b729bfeafaca73aebc0221e7fe4 Mon Sep 17 00:00:00 2001 From: MiraGeowerkstatt Date: Fri, 20 Dec 2024 13:21:08 +0100 Subject: [PATCH 3/5] Add cy test --- .../cypress/e2e/detailPage/boreholeform.cy.js | 29 +++++++++++++++++++ .../detail/form/borehole/boreholeForm.tsx | 4 +++ 2 files changed, 33 insertions(+) diff --git a/src/client/cypress/e2e/detailPage/boreholeform.cy.js b/src/client/cypress/e2e/detailPage/boreholeform.cy.js index 708d59996..40f38ea5f 100644 --- a/src/client/cypress/e2e/detailPage/boreholeform.cy.js +++ b/src/client/cypress/e2e/detailPage/boreholeform.cy.js @@ -3,6 +3,7 @@ import { clickOnRowWithText, showTableAndWaitForData, sortBy } from "../helpers/ import { evaluateInput, evaluateSelect, isDisabled, setInput, setSelect } from "../helpers/formHelpers"; import { createBorehole, + getElementByDataCy, goToRouteAndAcceptTerms, handlePrompt, newEditableBorehole, @@ -212,6 +213,34 @@ describe("Test for the borehole form.", () => { }); }); + it("displays 0 in input fields", () => { + // create borehole with 0 in all numeric inputs + createBorehole({ + "extended.original_name": "AAA_RINO", + "custom.alternate_name": "AAA_RINO", + total_depth: 0, + "extended.top_bedrock_fresh_md": 0.0, + "custom.top_bedrock_weathered_md": 0.0, + elevation_z: 0, + reference_elevation: 0.0, + }).as("borehole_id"); + cy.get("@borehole_id").then(id => { + goToRouteAndAcceptTerms(`/${id}/location`); + evaluateInput("elevationZ", "0"); + evaluateInput("referenceElevation", "0"); + + getElementByDataCy("borehole-menu-item").click(); + + evaluateInput("totalDepth", "0"); + evaluateInput("topBedrockWeatheredMd", "0"); + evaluateInput("topBedrockFreshMd", "0"); + + evaluateInput("total_depth_tvd", "0"); + evaluateInput("top_bedrock_fresh_tvd", "0"); + evaluateInput("top_bedrock_weathered_tvd", "0"); + }); + }); + it("stops editing when going back to overview", () => { createBorehole({ "extended.original_name": "AAA_HIPPOPOTHAMUS", "custom.alternate_name": "AAA_HIPPOPOTHAMUS" }).as( "borehole_id", diff --git a/src/client/src/pages/detail/form/borehole/boreholeForm.tsx b/src/client/src/pages/detail/form/borehole/boreholeForm.tsx index d1c5461c3..0fe43d09c 100644 --- a/src/client/src/pages/detail/form/borehole/boreholeForm.tsx +++ b/src/client/src/pages/detail/form/borehole/boreholeForm.tsx @@ -52,6 +52,10 @@ export const BoreholeForm = forwardRef(({ borehole, editingEnabled, onSubmit }: const fetchDepthTVD = useCallback( async (fieldValue: number | null) => { + // check if fieldValue is effectively zero + if (fieldValue !== null && Math.abs(fieldValue) === 0) { + return fieldValue; + } if (!fieldValue) return null; const getDepthTVD = async (depthMD: number | null) => { if (depthMD == null) { From 6eaf72748fd716ee705cbdd6ca308856d9f4e058 Mon Sep 17 00:00:00 2001 From: MiraGeowerkstatt Date: Fri, 20 Dec 2024 15:53:10 +0100 Subject: [PATCH 4/5] Add release notes --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf9c055b4..bd60eb2cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ ### Fixed - Observations were not included in exported borehole JSON file. +- Fixed bug where values of 0 were not displayed in numeric input fields. ## v2.1.993 - 2024-12-13 From ecf80c07881ff15bac1c3f998eb323e4a548f885 Mon Sep 17 00:00:00 2001 From: MiraGeowerkstatt Date: Fri, 20 Dec 2024 16:12:26 +0100 Subject: [PATCH 5/5] Fix code duplication --- .../form/formResultTableDisplay.tsx | 11 +--------- .../form/formResultTableDisplayStyles.ts | 22 +++++++++++++++++++ .../hydrogeology/fieldMeasurementDisplay.jsx | 10 ++------- .../form/hydrogeology/hydrotestDisplay.jsx | 10 ++------- 4 files changed, 27 insertions(+), 26 deletions(-) create mode 100644 src/client/src/components/form/formResultTableDisplayStyles.ts diff --git a/src/client/src/components/form/formResultTableDisplay.tsx b/src/client/src/components/form/formResultTableDisplay.tsx index 0c423429d..f143293c8 100644 --- a/src/client/src/components/form/formResultTableDisplay.tsx +++ b/src/client/src/components/form/formResultTableDisplay.tsx @@ -3,6 +3,7 @@ import { useTranslation } from "react-i18next"; import { Table, TableBody, TableContainer, TableHead, TableRow, Typography } from "@mui/material"; import { FieldMeasurementResult } from "../../pages/detail/form/hydrogeology/FieldMeasurementInterface.ts"; import { HydrotestResult } from "../../pages/detail/form/hydrogeology/HydrotestInterface.ts"; +import { tableCellStyles, tableHeaderStyles } from "./formResultTableDisplayStyles.ts"; interface FormResultTableDisplayProps { title: string; @@ -23,16 +24,6 @@ export const FormResultTableDisplay: React.FC = ({ }) => { const { t } = useTranslation(); - const tableCellStyles: React.CSSProperties = { - width: "20%", - maxWidth: "20%", - }; - - const tableHeaderStyles: React.CSSProperties = { - width: "20%", - maxWidth: "20%", - }; - return ( <> {t(title)} diff --git a/src/client/src/components/form/formResultTableDisplayStyles.ts b/src/client/src/components/form/formResultTableDisplayStyles.ts new file mode 100644 index 000000000..a74211232 --- /dev/null +++ b/src/client/src/components/form/formResultTableDisplayStyles.ts @@ -0,0 +1,22 @@ +import React from "react"; + +export const parameterTableHeaderStyles = { + "& .MuiFormControl-root": { + minWidth: "100%", + maxWidth: "100%", + }, + pr: "3px", + pl: "3px", + maxWidth: "200px", + minWidth: "200px", +}; + +export const tableCellStyles: React.CSSProperties = { + width: "20%", + maxWidth: "20%", +}; + +export const tableHeaderStyles: React.CSSProperties = { + width: "20%", + maxWidth: "20%", +}; diff --git a/src/client/src/pages/detail/form/hydrogeology/fieldMeasurementDisplay.jsx b/src/client/src/pages/detail/form/hydrogeology/fieldMeasurementDisplay.jsx index 93d9f2758..3590accbe 100644 --- a/src/client/src/pages/detail/form/hydrogeology/fieldMeasurementDisplay.jsx +++ b/src/client/src/pages/detail/form/hydrogeology/fieldMeasurementDisplay.jsx @@ -3,6 +3,7 @@ import { TableCell } from "@mui/material"; import { deleteFieldMeasurement, useDomains } from "../../../../api/fetchApiV2.js"; import DataDisplayCard from "../../../../components/dataCard/dataDisplayCard.jsx"; import { FormResultTableDisplay } from "../../../../components/form/formResultTableDisplay"; +import { parameterTableHeaderStyles } from "../../../../components/form/formResultTableDisplayStyles"; import ObservationDisplay from "./observationDisplay.tsx"; import { getFieldMeasurementParameterUnits } from "./parameterUnits"; @@ -34,14 +35,7 @@ const FieldMeasurementDisplay = props => { scope="row" sx={{ ...styles, - "& .MuiFormControl-root": { - minWidth: "100%", - maxWidth: "100%", - }, - pr: "3px", - pl: "3px", - maxWidth: "200px", - minWidth: "200px", + ...parameterTableHeaderStyles, }} data-cy={`fieldMeasurementResult.${index}.parameter-formDisplay`}> {domains?.data?.find(d => d.id === result.parameterId)?.[i18n.language] ?? ""} diff --git a/src/client/src/pages/detail/form/hydrogeology/hydrotestDisplay.jsx b/src/client/src/pages/detail/form/hydrogeology/hydrotestDisplay.jsx index 505d4491a..fc4a244ba 100644 --- a/src/client/src/pages/detail/form/hydrogeology/hydrotestDisplay.jsx +++ b/src/client/src/pages/detail/form/hydrogeology/hydrotestDisplay.jsx @@ -4,6 +4,7 @@ import { deleteHydrotest, useDomains } from "../../../../api/fetchApiV2.js"; import DataDisplayCard from "../../../../components/dataCard/dataDisplayCard.jsx"; import { FormContainer, FormDisplay, FormValueType } from "../../../../components/form/form"; import { FormResultTableDisplay } from "../../../../components/form/formResultTableDisplay"; +import { parameterTableHeaderStyles } from "../../../../components/form/formResultTableDisplayStyles"; import ObservationDisplay from "./observationDisplay.tsx"; import { getHydrotestParameterUnits } from "./parameterUnits"; @@ -41,14 +42,7 @@ const HydrotestDisplay = props => { scope="row" sx={{ ...styles, - "& .MuiFormControl-root": { - minWidth: "100%", - maxWidth: "100%", - }, - pr: "3px", - pl: "3px", - maxWidth: "200px", - minWidth: "200px", + ...parameterTableHeaderStyles, }} data-cy={`hydrotestResult.${index}.parameter-formDisplay`}> {domains?.data?.find(d => d.id === result.parameterId)?.[i18n.language] ?? ""}