From 2fc1657c0d5dc278527deaf1a7cac58a575b68fe Mon Sep 17 00:00:00 2001 From: tschumpr Date: Wed, 14 Feb 2024 17:02:41 +0100 Subject: [PATCH 1/3] Fix saving optional condition --- .../commons/form/borehole/hydrogeology/waterIngressInput.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/client/src/commons/form/borehole/hydrogeology/waterIngressInput.js b/src/client/src/commons/form/borehole/hydrogeology/waterIngressInput.js index 6777fe6a8..61d7ab4b6 100644 --- a/src/client/src/commons/form/borehole/hydrogeology/waterIngressInput.js +++ b/src/client/src/commons/form/borehole/hydrogeology/waterIngressInput.js @@ -21,6 +21,9 @@ const WaterIngressInput = props => { if (data.casingId == null) { data.casingId = item.casingId; } + if (data.conditionsId === "") { + data.conditionsId = null; + } return data; }; @@ -53,7 +56,6 @@ const WaterIngressInput = props => { fieldName="conditionsId" label="conditions" selected={item.conditionsId} - required={true} values={domains?.data ?.filter( d => From bd4035f372778c3cd6f43a15c71efb3117554b75 Mon Sep 17 00:00:00 2001 From: tschumpr Date: Wed, 14 Feb 2024 17:39:40 +0100 Subject: [PATCH 2/3] Update test --- src/client/cypress/e2e/editor/waterIngress.cy.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/cypress/e2e/editor/waterIngress.cy.js b/src/client/cypress/e2e/editor/waterIngress.cy.js index 658445814..18b0cc450 100644 --- a/src/client/cypress/e2e/editor/waterIngress.cy.js +++ b/src/client/cypress/e2e/editor/waterIngress.cy.js @@ -70,7 +70,6 @@ describe("Tests for the wateringress editor.", () => { cy.wait("@casing_GET"); setSelect("quantityId", 2); - setSelect("conditionsId", 2); setSelect("reliabilityId", 1); setSelect("casingId", 1); setInput("startTime", "2012-11-14T12:06"); @@ -79,15 +78,16 @@ describe("Tests for the wateringress editor.", () => { saveForm(); evaluateDisplayValue("quantity", "viel (> 120 l/min)"); - evaluateDisplayValue("conditions", "frei/ungespannt"); evaluateDisplayValue("reliability", "fraglich"); evaluateDisplayValue("casingName", "casing-1"); // edit wateringress startEditing(); setSelect("quantityId", 1); + setSelect("conditionsId", 3); saveForm(); evaluateDisplayValue("quantity", "mittel (30 - 120 l/min)"); + evaluateDisplayValue("conditions", "frei/ungespannt"); evaluateDisplayValue("casingName", "casing-1"); // delete wateringress From 55fb56bef87aae05c1705b9f13db1e59d4819824 Mon Sep 17 00:00:00 2001 From: tschumpr Date: Thu, 15 Feb 2024 10:12:21 +0100 Subject: [PATCH 3/3] Update valid borehole Ids Fix from https://github.com/geoadmin/suite-bdms/pull/1025/commits/fb5b01e40a1eaa1a947befd12dc0d9823b958c0a --- src/client/cypress/e2e/helpers/testHelpers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/cypress/e2e/helpers/testHelpers.js b/src/client/cypress/e2e/helpers/testHelpers.js index dbb55958b..11e775530 100644 --- a/src/client/cypress/e2e/helpers/testHelpers.js +++ b/src/client/cypress/e2e/helpers/testHelpers.js @@ -257,7 +257,7 @@ export const loginAndResetState = () => { auth: bearerAuth(token), }).then(response => { response.body.data - .filter(id => id > 1009999) // max id in seed data. + .filter(id => id > 1002999) // max id in seed data. .forEach(id => { deleteBorehole(id); });