From 33a6591488fba4543b17a27066bca980bbc9908b Mon Sep 17 00:00:00 2001 From: shraddha761 <106100728+shraddha761@users.noreply.github.com> Date: Mon, 17 Jun 2024 10:38:52 +0530 Subject: [PATCH 1/2] "#1219|DEA fails if no options provided for Duration" --- src/formDesigner/components/FormElementDetails.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/formDesigner/components/FormElementDetails.js b/src/formDesigner/components/FormElementDetails.js index b083a407c..720ab4583 100644 --- a/src/formDesigner/components/FormElementDetails.js +++ b/src/formDesigner/components/FormElementDetails.js @@ -705,6 +705,10 @@ function FormElementDetails({ userInfo, ...props }) { {props.formElementData.concept.dataType === "Date" && showPicker("date", cssClasses, props, disableFormElement)} + {props.formElementData.errorMessage && props.formElementData.errorMessage.durationOptions && ( +
Duration options must be selected.
+ )} + {["Date", "Duration"].includes(props.formElementData.concept.dataType) && ( Date: Mon, 17 Jun 2024 10:41:00 +0530 Subject: [PATCH 2/2] #1219|DEA fail if no duration option is provided --- src/formDesigner/views/FormDetails.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/formDesigner/views/FormDetails.js b/src/formDesigner/views/FormDetails.js index 519c42f1c..a2428b50b 100644 --- a/src/formDesigner/views/FormDetails.js +++ b/src/formDesigner/views/FormDetails.js @@ -714,6 +714,15 @@ class FormDetails extends Component { if (!_.isEmpty(validationError)) { fe.errorMessage.ruleError = validationError; } + } else if ( + (fe.concept.dataType === "Date" || fe.concept.dataType === "Duration") && + (!fe.keyValues.durationOptions || fe.keyValues.durationOptions.length === 0) + ) { + fe.error = true; + fe.expanded = true; + fe.errorMessage.durationOptions = true; + flag = groupError = true; + numberElementError += 1; } else if (!declarativeRuleHolder.isEmpty()) { fe.rule = declarativeRuleHolder.generateViewFilterRule(this.getEntityNameForRules()); }