pull/445/head
Johan Girod 2019-01-08 20:43:57 +01:00
parent 72de05bde5
commit fd280b2e06
7 changed files with 36 additions and 29 deletions

View File

@ -1,18 +1,18 @@
import React from 'react'
import {
flatRulesSelector,
analysisWithDefaultsSelector
} from 'Selectors/analyseSelectors'
import { connect } from 'react-redux'
import './ComparativeTargets.css'
import withColours from 'Components/utils/withColours'
import { Link } from 'react-router-dom'
import emoji from 'react-easy-emoji'
import { compose } from 'ramda'
import AnimatedTargetValue from './AnimatedTargetValue'
import PeriodSwitch from 'Components/PeriodSwitch'
import withColours from 'Components/utils/withColours'
import { findRuleByDottedName } from 'Engine/rules'
import { compose } from 'ramda'
import React from 'react'
import emoji from 'react-easy-emoji'
import { connect } from 'react-redux'
import { Link } from 'react-router-dom'
import { formValueSelector } from 'redux-form'
import {
analysisListWithDefaultsSelector,
flatRulesSelector
} from 'Selectors/analyseSelectors'
import AnimatedTargetValue from './AnimatedTargetValue'
import './ComparativeTargets.css'
export default compose(
connect(
state => ({
@ -21,7 +21,7 @@ export default compose(
state.simulationConfig?.objectifs[0]
),
simulationBranches: state.simulationConfig?.branches,
analyses: analysisWithDefaultsSelector(state),
analyses: analysisListWithDefaultsSelector(state),
chiffreAffaires: formValueSelector('conversation')(
state,
"entreprise . chiffre d'affaires"
@ -43,8 +43,8 @@ export default compose(
chiffreAffaires,
simulationBranches
} = this.props
if(!simulationBranches) {
return null;
if (!simulationBranches) {
return null
}
return (
<div id="comparative-targets">

View File

@ -84,7 +84,7 @@ export default compose(
conversationStarted,
activeInput,
setActiveInput,
analysis,
analysis: analysis,
noUserInput,
blockingInputControls,
match

View File

@ -1,11 +1,11 @@
import React from 'react'
import { analysisWithDefaultsSelector } from 'Selectors/analyseSelectors'
import { connect } from 'react-redux'
import './Targets.css'
import withColours from 'Components/utils/withColours'
import { Link } from 'react-router-dom'
import emoji from 'react-easy-emoji'
import { compose } from 'ramda'
import React from 'react'
import emoji from 'react-easy-emoji'
import { connect } from 'react-redux'
import { Link } from 'react-router-dom'
import { analysisWithDefaultsSelector } from 'Selectors/analyseSelectors'
import './Targets.css'
export default compose(
connect(state => ({ analysis: analysisWithDefaultsSelector(state) })),
withColours
@ -17,7 +17,7 @@ export default compose(
nodeValue,
unité: unit,
dottedName
} = this.props.analysis.targets[0]
} = this.props.analysis[0].targets[0]
return (
<div id="targets">
<span className="icon"></span>

View File

@ -1,5 +1,8 @@
objectifs:
objectifs:
- contrat salarié . rémunération . total
- contrat salarié . salaire . brut de base
- contrat salarié . salaire . net
- contrat salarié . salaire . net après impôt
situation:
contrat salarié: non
contrat salarié . assimilé salarié: non

View File

@ -177,9 +177,14 @@ let makeAnalysisSelector = situationSelector =>
}
)
export let analysisWithDefaultsSelector = makeAnalysisSelector(
export let analysisListWithDefaultsSelector = makeAnalysisSelector(
situationsWithDefaultsSelector
)
export let analysisWithDefaultsSelector = createSelector(
[analysisListWithDefaultsSelector],
analysisList => analysisList[0]
)
let analysisValidatedOnlySelector = makeAnalysisSelector(
validatedSituationBranchesSelector
)

View File

@ -77,8 +77,7 @@ function brancheSelector(variable: VariableWithCotisation): Branche {
].map(p => path(p, variable))
return (
// $FlowFixMe
'protection sociale . ' +
(branches.filter(Boolean)[0] || 'autres')
'protection sociale . ' + (branches.filter(Boolean)[0] || 'autres')
)
}
@ -157,7 +156,7 @@ function analysisToFicheDePaie(
règleAvecMontant,
règleAvecValeur,
règleLocalisée,
analysis
[analysis]
): ?FicheDePaie {
if (!analysis.cache) {
return null

View File

@ -50,7 +50,7 @@ export const règleValeurSelector = createSelector(
analysisWithDefaultsSelector,
validatedSituationBranchesSelector,
règleLocaliséeSelector,
(analysis: Analysis, situations, règleLocalisée: string => Règle) => (
([analysis]: Analysis, situations, règleLocalisée: string => Règle) => (
dottedName: string
): RègleValeur => {
if (!analysis || !analysis.cache) {