diff --git a/mon-entreprise/source/components/conversation/RuleInput.tsx b/mon-entreprise/source/components/conversation/RuleInput.tsx index 43e9202ff..6d76771fb 100644 --- a/mon-entreprise/source/components/conversation/RuleInput.tsx +++ b/mon-entreprise/source/components/conversation/RuleInput.tsx @@ -29,6 +29,10 @@ type Props = Omit< // a build-in logic in the engine, by setting the "applicability" of // suggestions. showSuggestions?: boolean + // TODO: having an option seems undesirable, but it's the easier way to + // implement this behavior currently + // cf .https://github.com/betagouv/mon-entreprise/issues/1489#issuecomment-823058710 + showDefaultDateValue?: boolean useSwitch?: boolean isTarget?: boolean onSubmit?: (source: string) => void @@ -58,6 +62,7 @@ export default function RuleInput({ isTarget = false, showSuggestions = true, onSubmit = () => null, + showDefaultDateValue = false, modifiers = {}, ...props }: Props) { @@ -69,7 +74,7 @@ export default function RuleInput({ const commonProps: InputProps = { dottedName, value, - missing: !!evaluation.missingVariables[dottedName], + missing: !showDefaultDateValue && !!evaluation.missingVariables[dottedName], onChange, title: rule.title, id: props.id ?? dottedName, diff --git a/mon-entreprise/source/pages/Simulateurs/ISSimulation.tsx b/mon-entreprise/source/pages/Simulateurs/ISSimulation.tsx index 4f63ad610..0ab8fe365 100644 --- a/mon-entreprise/source/pages/Simulateurs/ISSimulation.tsx +++ b/mon-entreprise/source/pages/Simulateurs/ISSimulation.tsx @@ -77,6 +77,7 @@ function ExerciceDate() { Exercice du{' '} dispatch(updateSituation('entreprise . exercice . début', x)) } @@ -84,6 +85,7 @@ function ExerciceDate() { au{' '} dispatch(updateSituation('entreprise . exercice . fin', x)) }