From e2eeeb7901c55ad6b8ed8d941325d1220e441b09 Mon Sep 17 00:00:00 2001 From: Frederic Stahel Date: Thu, 18 Jan 2024 08:08:21 +0100 Subject: [PATCH 1/8] Update maxHeight of completion content --- src/client/src/commons/form/borehole/completion/backfill.js | 3 ++- .../src/commons/form/borehole/completion/instrumentation.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/client/src/commons/form/borehole/completion/backfill.js b/src/client/src/commons/form/borehole/completion/backfill.js index 0559fdae8..4d5752f4f 100644 --- a/src/client/src/commons/form/borehole/completion/backfill.js +++ b/src/client/src/commons/form/borehole/completion/backfill.js @@ -124,6 +124,7 @@ const Backfill = ({ isEditable, completionId }) => { textTransform: "none", color: "rgba(0, 0, 0, 0.8)", borderColor: "rgba(0, 0, 0, 0.8)", + marginBottom: "10px", }}> {t("addFilling")} @@ -143,7 +144,7 @@ const Backfill = ({ isEditable, completionId }) => { padding: "10px 10px 5px 10px", marginBottom: "10px", overflow: "auto", - maxHeight: "85vh", + maxHeight: "65vh", }}> {displayedBackfills?.length > 0 ? displayedBackfills diff --git a/src/client/src/commons/form/borehole/completion/instrumentation.js b/src/client/src/commons/form/borehole/completion/instrumentation.js index c704e92d4..151169201 100644 --- a/src/client/src/commons/form/borehole/completion/instrumentation.js +++ b/src/client/src/commons/form/borehole/completion/instrumentation.js @@ -93,6 +93,7 @@ const Instrumentation = ({ isEditable, completionId }) => { textTransform: "none", color: "rgba(0, 0, 0, 0.8)", borderColor: "rgba(0, 0, 0, 0.8)", + marginBottom: "10px", }}> {t("addInstrument")} @@ -112,7 +113,7 @@ const Instrumentation = ({ isEditable, completionId }) => { padding: "10px 10px 5px 10px", marginBottom: "10px", overflow: "auto", - maxHeight: "85vh", + maxHeight: "65vh", }}> {displayedInstrumentations?.length > 0 ? ( displayedInstrumentations From 57cf5804b64dceed68b8e25e9c4270ec54cb85b4 Mon Sep 17 00:00:00 2001 From: Frederic Stahel Date: Mon, 22 Jan 2024 07:03:39 +0100 Subject: [PATCH 2/8] Use borehole id from url as input for hydrogeology components --- src/client/src/commons/form/borehole/boreholeForm.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/client/src/commons/form/borehole/boreholeForm.js b/src/client/src/commons/form/borehole/boreholeForm.js index 37000c8fb..6f0ef7508 100644 --- a/src/client/src/commons/form/borehole/boreholeForm.js +++ b/src/client/src/commons/form/borehole/boreholeForm.js @@ -406,7 +406,7 @@ class BoreholeForm extends React.Component { render={() => ( )} /> @@ -419,7 +419,7 @@ class BoreholeForm extends React.Component { render={() => ( )} /> @@ -432,7 +432,7 @@ class BoreholeForm extends React.Component { render={() => ( )} /> @@ -442,7 +442,7 @@ class BoreholeForm extends React.Component { render={() => ( )} /> @@ -455,7 +455,7 @@ class BoreholeForm extends React.Component { render={() => ( )} /> From 60faac559872c50c72f70d0fb3b07f06be7e5c56 Mon Sep 17 00:00:00 2001 From: Frederic Stahel Date: Mon, 22 Jan 2024 07:05:37 +0100 Subject: [PATCH 3/8] Update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae7a73f2f..dad618c04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,10 @@ - Removed the functionality to edit user details (first name, surname and password) since they are now managed by the IAM. - Removed middle name from user details because it was not used until now. +### Fixed + +- Ensure hydrogeology components are loaded properly when refreshed. + ## v2.0.506 - 2023-12-21 ### Added From 631218277a7d57ac4884fc6899cdc8d114b6c3be Mon Sep 17 00:00:00 2001 From: Frederic Stahel Date: Mon, 22 Jan 2024 08:16:44 +0100 Subject: [PATCH 4/8] Improve flaky display layer test --- src/client/cypress/e2e/viewer/displayLayer.cy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/cypress/e2e/viewer/displayLayer.cy.js b/src/client/cypress/e2e/viewer/displayLayer.cy.js index c151c6303..e088900a1 100644 --- a/src/client/cypress/e2e/viewer/displayLayer.cy.js +++ b/src/client/cypress/e2e/viewer/displayLayer.cy.js @@ -142,7 +142,7 @@ describe("Test for the borehole form.", () => { // Click on layer cy.get('[data-cy="stratigraphy-layer-0"]').scrollIntoView(); - cy.get('[data-cy="stratigraphy-layer-0"]').click(); + cy.get('[data-cy="stratigraphy-layer-0"]').click({ force: true }); // Three detail rows are displayed - two by default plus one that was selected as default field. cy.get('[data-cy="stratigraphy-layer-details"] h6').should( From 90815613bc01ccec59ccf857942feffc998958f9 Mon Sep 17 00:00:00 2001 From: tschumpr Date: Mon, 22 Jan 2024 08:41:22 +0100 Subject: [PATCH 5/8] Use same grid styling for all completion tab contents --- .../form/borehole/completion/backfill.js | 19 +++----------- .../form/borehole/completion/casing.js | 19 +++----------- .../borehole/completion/instrumentation.js | 19 +++----------- .../borehole/completion/styledComponents.js | 25 +++++++++++++++++++ 4 files changed, 34 insertions(+), 48 deletions(-) diff --git a/src/client/src/commons/form/borehole/completion/backfill.js b/src/client/src/commons/form/borehole/completion/backfill.js index cda0b8d69..62b308e8a 100644 --- a/src/client/src/commons/form/borehole/completion/backfill.js +++ b/src/client/src/commons/form/borehole/completion/backfill.js @@ -8,7 +8,7 @@ import { Tooltip, Typography, } from "@mui/material"; -import { AddButton } from "./styledComponents"; +import { AddButton, CompletionGrid } from "./styledComponents"; import { getBackfills, addBackfill, @@ -122,20 +122,7 @@ const Backfill = ({ isEditable, completionId }) => { )} - + {displayedBackfills?.length > 0 ? displayedBackfills ?.sort((a, b) => a.fromDepthM - b.fromDepthM) @@ -198,7 +185,7 @@ const Backfill = ({ isEditable, completionId }) => { )} - + ); }; diff --git a/src/client/src/commons/form/borehole/completion/casing.js b/src/client/src/commons/form/borehole/completion/casing.js index 31252b980..146ea783e 100644 --- a/src/client/src/commons/form/borehole/completion/casing.js +++ b/src/client/src/commons/form/borehole/completion/casing.js @@ -8,7 +8,7 @@ import { Tooltip, Typography, } from "@mui/material"; -import { AddButton } from "./styledComponents"; +import { AddButton, CompletionGrid } from "./styledComponents"; import { getCasings, addCasing, @@ -122,20 +122,7 @@ const Casing = ({ isEditable, completionId }) => { )} - + {displayedCasings?.length > 0 ? displayedCasings ?.sort((a, b) => a.fromDepthM - b.fromDepthM) @@ -198,7 +185,7 @@ const Casing = ({ isEditable, completionId }) => { )} - + ); }; diff --git a/src/client/src/commons/form/borehole/completion/instrumentation.js b/src/client/src/commons/form/borehole/completion/instrumentation.js index cf1bc2747..fd02d479f 100644 --- a/src/client/src/commons/form/borehole/completion/instrumentation.js +++ b/src/client/src/commons/form/borehole/completion/instrumentation.js @@ -8,7 +8,7 @@ import { Tooltip, Typography, } from "@mui/material"; -import { AddButton } from "./styledComponents"; +import { AddButton, CompletionGrid } from "./styledComponents"; import { useInstrumentationMutations, useInstrumentations, @@ -91,20 +91,7 @@ const Instrumentation = ({ isEditable, completionId }) => { )} - + {displayedInstrumentations?.length > 0 ? ( displayedInstrumentations ?.sort((a, b) => a.fromDepthM - b.fromDepthM) @@ -158,7 +145,7 @@ const Instrumentation = ({ isEditable, completionId }) => { )} - + ); }; diff --git a/src/client/src/commons/form/borehole/completion/styledComponents.js b/src/client/src/commons/form/borehole/completion/styledComponents.js index 55f29f8e6..c984f9095 100644 --- a/src/client/src/commons/form/borehole/completion/styledComponents.js +++ b/src/client/src/commons/form/borehole/completion/styledComponents.js @@ -2,6 +2,7 @@ import React, { forwardRef } from "react"; import { Box, Button, + Grid, IconButton, Stack, Tabs, @@ -119,3 +120,27 @@ export const CompletionTab = styled(props => )( }, }), ); + +export const CompletionGrid = forwardRef((props, ref) => { + const StyledGrid = styled(Grid)(() => ({ + width: "100%", + borderWidth: "1px", + borderColor: "black", + padding: "10px 10px 5px 10px", + marginBottom: "10px", + overflow: "auto", + maxHeight: "65vh", + alignItems: "stretch", + })); + + return ( + + {props.children} + + ); +}); From e4b1e8987dc1345a62d9ff4ec193321d30ac0f26 Mon Sep 17 00:00:00 2001 From: tschumpr Date: Mon, 22 Jan 2024 08:42:30 +0100 Subject: [PATCH 6/8] Remove unnecessary nesting --- .../borehole/completion/completionContent.js | 76 ++++++++----------- 1 file changed, 32 insertions(+), 44 deletions(-) diff --git a/src/client/src/commons/form/borehole/completion/completionContent.js b/src/client/src/commons/form/borehole/completion/completionContent.js index 4de486ad1..e23b10211 100644 --- a/src/client/src/commons/form/borehole/completion/completionContent.js +++ b/src/client/src/commons/form/borehole/completion/completionContent.js @@ -29,51 +29,39 @@ const CompletionContent = ({ completion, isEditable }) => { }; return ( - <> - - - - {tabTitels.map((item, index) => { - return ( - - ); - })} - - - <> - - {(state.index === 0 && ( - - )) || - (state.index === 1 && ( - - )) || - (state.index === 2 && ( - - ))} - - + + + + {tabTitels.map((item, index) => { + return ( + + ); + })} + - + + {(state.index === 0 && ( + + )) || + (state.index === 1 && ( + + )) || + (state.index === 2 && ( + + ))} + + ); }; From 8ca61b393bae6884291e7d462e0b94f78d6e0287 Mon Sep 17 00:00:00 2001 From: tschumpr Date: Mon, 22 Jan 2024 08:43:37 +0100 Subject: [PATCH 7/8] Fix button placing --- src/client/src/commons/form/borehole/completion/completion.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/client/src/commons/form/borehole/completion/completion.js b/src/client/src/commons/form/borehole/completion/completion.js index 66543ffe2..4ee29d184 100644 --- a/src/client/src/commons/form/borehole/completion/completion.js +++ b/src/client/src/commons/form/borehole/completion/completion.js @@ -199,6 +199,7 @@ const Completion = props => { {isEditable && ( {t("addCompletion")} From ea57306cc01e7dd29937c5fc6b2b56596d45ab11 Mon Sep 17 00:00:00 2001 From: tschumpr Date: Mon, 22 Jan 2024 09:14:54 +0100 Subject: [PATCH 8/8] Delete empty space --- src/client/src/commons/form/borehole/completion/completion.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/src/commons/form/borehole/completion/completion.js b/src/client/src/commons/form/borehole/completion/completion.js index 4ee29d184..58af6c0e8 100644 --- a/src/client/src/commons/form/borehole/completion/completion.js +++ b/src/client/src/commons/form/borehole/completion/completion.js @@ -199,7 +199,7 @@ const Completion = props => { {isEditable && ( {t("addCompletion")}