Rétabli l'ancienne version de l'affichage des valeurs par défaut dans ruleInput
fix #2107pull/2109/head v1.22.0
parent
c9d7d221d6
commit
abf177d959
|
@ -22,13 +22,13 @@ import './commands'
|
|||
|
||||
const resizeObserverLoopErrRe = /^[^(ResizeObserver loop limit exceeded)]/
|
||||
Cypress.on('uncaught:exception', (err) => {
|
||||
/*
|
||||
/*
|
||||
The error 'ResizeObserver loop limit exceeded' is benigne
|
||||
Returning false here prevents Cypress from failing the test
|
||||
|
||||
cf https://stackoverflow.com/questions/49384120/resizeobserver-loop-limit-exceeded
|
||||
*/
|
||||
if (resizeObserverLoopErrRe.test(err.message)) {
|
||||
return false
|
||||
}
|
||||
if (resizeObserverLoopErrRe.test(err.message)) {
|
||||
return false
|
||||
}
|
||||
})
|
||||
|
|
|
@ -12,7 +12,6 @@ import Engine, {
|
|||
reduceAST,
|
||||
RuleNode,
|
||||
} from 'publicodes'
|
||||
import { isEmpty } from 'ramda'
|
||||
import React, { useContext } from 'react'
|
||||
import { Choice, MultipleAnswerInput, OuiNonInput } from './ChoicesInput'
|
||||
import DateInput from './DateInput'
|
||||
|
@ -81,12 +80,13 @@ export default function RuleInput<Names extends string = DottedName>({
|
|||
const rule = engine.getRule(dottedName)
|
||||
const evaluation = engine.evaluate({ valeur: dottedName, ...modifiers })
|
||||
const value = evaluation.nodeValue
|
||||
console.log(missing, evaluation.missingVariables)
|
||||
const commonProps: InputProps<Names> = {
|
||||
dottedName,
|
||||
value,
|
||||
missing:
|
||||
missing ??
|
||||
(!showDefaultDateValue && !isEmpty(evaluation.missingVariables)),
|
||||
(!showDefaultDateValue && dottedName in evaluation.missingVariables),
|
||||
onChange: (value: PublicodesExpression | undefined) =>
|
||||
onChange(value, dottedName),
|
||||
title: rule.title,
|
||||
|
|
|
@ -16,6 +16,7 @@ import { evaluateQuestion, getMeta } from '@/utils'
|
|||
import { useSSRSafeId } from '@react-aria/ssr'
|
||||
import { DottedName } from 'modele-social'
|
||||
import { RuleNode } from 'publicodes'
|
||||
import { isEmpty } from 'ramda'
|
||||
import { useCallback, useContext } from 'react'
|
||||
import { useDispatch, useSelector } from 'react-redux'
|
||||
import styled from 'styled-components'
|
||||
|
@ -132,6 +133,7 @@ export function SimpleField({
|
|||
aria-labelledby={displayedQuestion ? labelId : undefined}
|
||||
label={displayedLabel}
|
||||
required={meta.requis === 'oui'}
|
||||
missing={!isEmpty(evaluation.missingVariables)}
|
||||
onChange={dispatchValue}
|
||||
showSuggestions={showSuggestions}
|
||||
/>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import { DottedName } from '@/../../modele-social'
|
||||
import { resetSimulation } from '@/actions/actions'
|
||||
import { resetCompany } from '@/actions/companyActions'
|
||||
import { TrackPage } from '@/ATInternetTracking'
|
||||
import { CompanyDetails } from '@/components/company/Details'
|
||||
|
@ -106,7 +107,14 @@ export default function Accueil() {
|
|||
<WhenAlreadyDefined dottedName="entreprise . SIREN">
|
||||
<CompanyDetails />
|
||||
|
||||
<Button size="XS" light onPress={() => dispatch(resetCompany())}>
|
||||
<Button
|
||||
size="XS"
|
||||
light
|
||||
onPress={() => {
|
||||
dispatch(resetSimulation())
|
||||
dispatch(resetCompany())
|
||||
}}
|
||||
>
|
||||
<Trans>Modifier l'entreprise</Trans>
|
||||
</Button>
|
||||
</WhenAlreadyDefined>
|
||||
|
|
Loading…
Reference in New Issue