Skip to content

Commit

Permalink
[TM-1629] add conditional default for questions
Browse files Browse the repository at this point in the history
  • Loading branch information
pachonjcl committed Jan 22, 2025
1 parent 5f61878 commit b9cb33d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const ConditionalInput = (props: ConditionalInputProps) => {
values[fieldChildren.name]?.length > 0 &&
field.value == null
) {
field.onChange(true);
field.onChange(fieldChildren.conditional_default);
}
});
if (field.value == null) {
Expand Down
1 change: 1 addition & 0 deletions src/components/extensive/WizardForm/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ interface FormFieldBase {
placeholder?: string;
condition?: boolean;
feedbackRequired?: boolean;
conditional_default?: boolean;
}

type FieldProps<T> = Omit<T, "label" | "description" | "placeholder" | "name">;
Expand Down
1 change: 1 addition & 0 deletions src/helpers/customForms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ export const apiFormQuestionToFormField = (
placeholder: question.placeholder,
validation,
condition: question.show_on_parent_condition,
conditional_default: question.conditional_default,
feedbackRequired
};

Expand Down

0 comments on commit b9cb33d

Please sign in to comment.