Skip to content

Commit

Permalink
Merge pull request #1253 from shraddha761/durationOption
Browse files Browse the repository at this point in the history
#1219 | DEA fail is no duration option is provided
  • Loading branch information
vinayvenu authored Jun 18, 2024
2 parents deacab1 + 04b51cc commit c9290c2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/formDesigner/components/FormElementDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 && (
<div style={{ color: "red", fontSize: "13px" }}>Duration options must be selected.</div>
)}

{["Date", "Duration"].includes(props.formElementData.concept.dataType) && (
<Grid container item sm={12}>
<AvniFormLabel
Expand Down
9 changes: 9 additions & 0 deletions src/formDesigner/views/FormDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down

0 comments on commit c9290c2

Please sign in to comment.