diff --git a/source/components/conversation/IndicationSalaireEquivalentTempsPlein.js b/source/components/conversation/IndicationSalaireEquivalentTempsPlein.js new file mode 100644 index 000000000..a08aa61a1 --- /dev/null +++ b/source/components/conversation/IndicationSalaireEquivalentTempsPlein.js @@ -0,0 +1,20 @@ +import { React } from 'Components' +import { analysisWithDefaultsSelector } from 'Selectors/analyseSelectors' +import { connect } from 'react-redux' + +export default connect(state => ({ + analysis: analysisWithDefaultsSelector(state) +}))(({ analysis }) => { + let cache = analysis.cache + let salaire = cache['contrat salarié . salaire . brut de base'], + quotité = cache['contrat salarié . quotité de travail'], + équivalentTempsPlein = Math.round(salaire.nodeValue / quotité.nodeValue) + if (quotité.nodeValue === 1) return null + return ( +
+ Soit {équivalentTempsPlein} € bruts par mois en équivalent temps plein +
+ ) +}) diff --git a/source/components/conversation/Input.js b/source/components/conversation/Input.js index ccd5b813b..9cdff3ac5 100644 --- a/source/components/conversation/Input.js +++ b/source/components/conversation/Input.js @@ -9,6 +9,7 @@ import InputSuggestions from './InputSuggestions' import SendButton from './SendButton' import { connect } from 'react-redux' import { formValueSelector } from 'redux-form' +import IndicationSalaireEquivalentTempsPlein from 'Components/conversation/IndicationSalaireEquivalentTempsPlein' export default compose( FormDecorator('input'), @@ -81,6 +82,11 @@ export default compose( rulePeriod={this.props.rulePeriod} /> {inputError && {error}} + {dottedName === + 'contrat salarié . temps partiel . heures par semaine' && ( + + // If the need for this kind of computed indication to help the user answer the question correctly is encountered for other kind of questions, it should be abstracted in the engine + )} ) }