diff --git a/mon-entreprise/source/components/conversation/RuleInput.tsx b/mon-entreprise/source/components/conversation/RuleInput.tsx index 62b43633f..9a6f1599d 100644 --- a/mon-entreprise/source/components/conversation/RuleInput.tsx +++ b/mon-entreprise/source/components/conversation/RuleInput.tsx @@ -87,6 +87,7 @@ export default function RuleInput({ required: true, } if (getVariant(engine.getParsedRules()[dottedName])) { + console.log(buildVariantTree(engine.getParsedRules(), dottedName)) return ( ( const node = allRules[path] if (!node) throw new Error(`La règle ${path} est introuvable`) const variant = getVariant(node) - const canGiveUp = variant && !variant['choix obligatoire'] + const canGiveUp = + variant && + (!variant['choix obligatoire'] || variant['choix obligatoire'] === 'non') return Object.assign( node, variant diff --git a/publicodes/source/mecanisms/one-possibility.ts b/publicodes/source/mecanisms/one-possibility.ts index 0ddf0c7ce..8027f292e 100644 --- a/publicodes/source/mecanisms/one-possibility.ts +++ b/publicodes/source/mecanisms/one-possibility.ts @@ -5,7 +5,7 @@ import { Context } from '../parsePublicodes' export type PossibilityNode = { explanation: Array - 'choix obligatoire'?: 'oui' + 'choix obligatoire'?: 'oui' | 'non' context: string nodeKind: 'une possibilité' }