From 42ebea09582de08d4725a8784fc0c3bf3b20f24a Mon Sep 17 00:00:00 2001 From: Maxime Quandalle Date: Thu, 22 Apr 2021 15:45:10 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Affichage=20des=20dates=20sur=20?= =?UTF-8?q?le=20simulateur=20IS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #1489 --- .../source/components/conversation/RuleInput.tsx | 7 ++++++- mon-entreprise/source/pages/Simulateurs/ISSimulation.tsx | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) 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)) }