Skip to content

Commit

Permalink
feat: mandatory rule initial
Browse files Browse the repository at this point in the history
9sneha-n committed Jun 14, 2024
1 parent 307f500 commit 300ca36
Showing 3 changed files with 10 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/domain/entities/Questionnaire/QuestionnaireQuestion.ts
Original file line number Diff line number Diff line change
@@ -252,6 +252,13 @@ export class QuestionnaireQuestion {
if (rule.parsedResult === true)
return { errorMsg: action.content, dataElementId: action.dataElement?.id };
else return;
} else if (action.programRuleActionType === "SETMANDATORYFIELD") {
if (rule.parsedResult === true) {
return {
errorMsg: "This field is mandatory",
dataElementId: action.dataElement?.id,
};
} else return;
}
});
});
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ const NumberWidget: React.FC<NumberWidgetProps> = props => {
return (
<>
<Input
type="number"
type={"number"}
onBlur={notifyChange}
onChange={updateState}
value={stateValue || ""}
2 changes: 2 additions & 0 deletions src/webapp/components/survey/SurveyForm.tsx
Original file line number Diff line number Diff line change
@@ -102,6 +102,7 @@ export const SurveyForm: React.FC<SurveyFormProps> = props => {
<PaddedDiv>
<Typography>{i18n.t(`Stage - Profile`)}</Typography>
<SurveySection
key={questionnaire.entity.code}
title={questionnaire.entity.title}
updateQuestion={updateQuestion}
questions={questionnaire.entity.questions}
@@ -140,6 +141,7 @@ export const SurveyForm: React.FC<SurveyFormProps> = props => {
if (section.isSpeciesSection)
return (
<GridSection
key={section.code}
speciesSection={section}
antibioticStage={stage}
updateQuestion={question =>

0 comments on commit 300ca36

Please sign in to comment.