⬆️ Upgrade dependancies & fix flox & react errors and warning
parent
416d6978a6
commit
7689928bc1
|
@ -21,4 +21,5 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowIssue
|
|||
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
|
||||
|
||||
module.name_mapper='^Components\(.*\)$' -> '<PROJECT_ROOT>/source/components\1'
|
||||
module.name_mapper='^Engine\(.*\)$' -> '<PROJECT_ROOT>/source/engine\1'
|
||||
module.name_mapper='^Engine\(.*\)$' -> '<PROJECT_ROOT>/source/engine\1'
|
||||
module.name_mapper='^Selectors\(.*\)$' -> '<PROJECT_ROOT>/source/selectors\1'
|
17
package.json
17
package.json
|
@ -13,13 +13,13 @@
|
|||
"not ie < 11"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/core": "=7.0.0-beta.46",
|
||||
"@babel/plugin-proposal-decorators": "=7.0.0-beta.46",
|
||||
"@babel/plugin-proposal-object-rest-spread": "=7.0.0-beta.46",
|
||||
"@babel/plugin-syntax-decorators": "=7.0.0-beta.46",
|
||||
"@babel/polyfill": "=7.0.0-beta.46",
|
||||
"@babel/preset-env": "=7.0.0-beta.46",
|
||||
"@babel/preset-react": "=7.0.0-beta.46",
|
||||
"@babel/core": "=7.0.0-beta.51",
|
||||
"@babel/plugin-proposal-decorators": "=7.0.0-beta.51",
|
||||
"@babel/plugin-proposal-object-rest-spread": "=7.0.0-beta.51",
|
||||
"@babel/plugin-syntax-decorators": "=7.0.0-beta.51",
|
||||
"@babel/polyfill": "=7.0.0-beta.51",
|
||||
"@babel/preset-env": "=7.0.0-beta.51",
|
||||
"@babel/preset-react": "=7.0.0-beta.51",
|
||||
"@researchgate/react-intersection-observer": "^0.7.3",
|
||||
"akh": "^3.1.2",
|
||||
"autoprefixer": "^8.1.0",
|
||||
|
@ -80,7 +80,6 @@
|
|||
"reduce-reducers": "^0.1.2",
|
||||
"redux": "^3.7.2",
|
||||
"redux-form": "^7.3.0",
|
||||
"redux-persist": "^5.9.1",
|
||||
"reselect": "^3.0.1",
|
||||
"screenfull": "^3.3.2",
|
||||
"source-map-support": "^0.5.4",
|
||||
|
@ -109,7 +108,7 @@
|
|||
"eslint-check": "eslint --print-config .eslintrc | eslint-config-prettier-check"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/preset-flow": "^7.0.0-beta.47",
|
||||
"@babel/preset-flow": "^7.0.0-beta.51",
|
||||
"chai": "^4.1.2",
|
||||
"enzyme": "^3.3.0",
|
||||
"enzyme-adapter-react-16": "^1.1.1",
|
||||
|
|
|
@ -5,18 +5,16 @@ import React, { Component } from 'react'
|
|||
import emoji from 'react-easy-emoji'
|
||||
import { Trans } from 'react-i18next'
|
||||
import { connect } from 'react-redux'
|
||||
import { Spring, config } from 'react-spring'
|
||||
import { config, Spring } from 'react-spring'
|
||||
import { compose } from 'redux'
|
||||
import withColours from '../withColours'
|
||||
import './Distribution.css'
|
||||
import './PaySlip'
|
||||
import { répartitionSelector } from './selectors'
|
||||
import Montant from './Montant'
|
||||
import './PaySlip'
|
||||
import RuleLink from './RuleLink'
|
||||
import { répartitionSelector } from './selectors'
|
||||
|
||||
import withColours from '../withColours';
|
||||
import { compose } from 'redux';
|
||||
import type
|
||||
{ Répartition, Branche } from './types'
|
||||
|
||||
import type { Répartition, Branche } from './types'
|
||||
|
||||
const brancheToEmoji: { [Branche]: string } = {
|
||||
retraite: '👵',
|
||||
|
@ -35,7 +33,7 @@ const brancheToLabel: { [Branche]: string } = {
|
|||
}
|
||||
|
||||
type Props = Répartition & {
|
||||
colours: {colour: string}
|
||||
colours: { colour: string }
|
||||
}
|
||||
type State = {
|
||||
branchesInViewport: Array<Branche>
|
||||
|
@ -58,7 +56,14 @@ class Distribution extends Component<Props, State> {
|
|||
}
|
||||
|
||||
render() {
|
||||
const { répartition, cotisationMaximum, total, salaireChargé, salaireNet, colours: {colour} } = this.props;
|
||||
const {
|
||||
répartition,
|
||||
cotisationMaximum,
|
||||
total,
|
||||
salaireChargé,
|
||||
salaireNet,
|
||||
colours: { colour }
|
||||
} = this.props
|
||||
return (
|
||||
<>
|
||||
<div className="distribution-chart__container">
|
||||
|
@ -79,7 +84,7 @@ class Distribution extends Component<Props, State> {
|
|||
width: (100 * montant) / cotisationMaximum + '%',
|
||||
opacity: montant ? 1 : 0
|
||||
}}>
|
||||
{(styles) => (
|
||||
{styles => (
|
||||
<div
|
||||
className="distribution-chart__item"
|
||||
style={{
|
||||
|
@ -112,18 +117,26 @@ class Distribution extends Component<Props, State> {
|
|||
})}
|
||||
</div>
|
||||
<div className="distribution-chart__total">
|
||||
<span/><RuleLink {...salaireNet}/><Montant>{salaireNet.montant}</Montant>
|
||||
<span>+</span><Trans>Cotisations</Trans><Montant>{total.partPatronale + total.partSalariale}</Montant>
|
||||
<span/><div className="distribution-chart__total-border" />
|
||||
<span>=</span><RuleLink {...salaireChargé}/><Montant>{salaireChargé.montant}</Montant>
|
||||
<span />
|
||||
<RuleLink {...salaireNet} />
|
||||
<Montant>{salaireNet.montant}</Montant>
|
||||
<span>+</span>
|
||||
<Trans>Cotisations</Trans>
|
||||
<Montant>{total.partPatronale + total.partSalariale}</Montant>
|
||||
<span />
|
||||
<div className="distribution-chart__total-border" />
|
||||
<span>=</span>
|
||||
<RuleLink {...salaireChargé} />
|
||||
<Montant>{salaireChargé.montant}</Montant>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
}
|
||||
export default
|
||||
compose(withColours,
|
||||
export default compose(
|
||||
withColours,
|
||||
connect(
|
||||
répartitionSelector,
|
||||
{}
|
||||
))(Distribution)
|
||||
)
|
||||
)(Distribution)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* @flow */
|
||||
import { compose } from 'ramda'
|
||||
import React from 'react'
|
||||
import React, {Fragment} from 'react'
|
||||
import { Trans } from 'react-i18next'
|
||||
import { connect } from 'react-redux'
|
||||
import withColours from '../withColours'
|
||||
|
@ -8,6 +8,7 @@ import Montant from './Montant'
|
|||
import './PaySlip.css'
|
||||
import RuleLink from './RuleLink'
|
||||
import { ficheDePaieSelector } from './selectors'
|
||||
|
||||
import type { FicheDePaie } from './types'
|
||||
|
||||
type ConnectedPropTypes = FicheDePaie & {
|
||||
|
@ -63,12 +64,12 @@ const PaySlip = ({
|
|||
<Trans>Part salariale</Trans>
|
||||
</h4>
|
||||
{cotisations.map(([section, cotisationList]) => (
|
||||
<>
|
||||
<Fragment key={section}>
|
||||
<h5 className="payslip__cotisationTitle">
|
||||
<Trans>{section}</Trans>
|
||||
</h5>
|
||||
{cotisationList.map(cotisation => (
|
||||
<>
|
||||
<Fragment key={cotisation.lien}>
|
||||
<RuleLink
|
||||
style={{ backgroundColor: lightestColour }}
|
||||
{...cotisation}
|
||||
|
@ -79,9 +80,9 @@ const PaySlip = ({
|
|||
<Montant style={{ backgroundColor: lightestColour }}>
|
||||
{cotisation.montant.partSalariale}
|
||||
</Montant>
|
||||
</>
|
||||
</Fragment>
|
||||
))}
|
||||
</>
|
||||
</Fragment>
|
||||
))}
|
||||
<h5 className="payslip__cotisationTitle">
|
||||
<Trans>Réductions</Trans>
|
||||
|
|
|
@ -53,6 +53,9 @@ class ResultView extends PureComponent<Props, State> {
|
|||
}
|
||||
}
|
||||
|
||||
export default connect(state => ({
|
||||
conversationStarted: state.conversationStarted
|
||||
}))(ResultView)
|
||||
export default connect(
|
||||
state => ({
|
||||
conversationStarted: state.conversationStarted
|
||||
}),
|
||||
{}
|
||||
)(ResultView)
|
||||
|
|
|
@ -298,11 +298,11 @@ const répartition = (ficheDePaie: FicheDePaie): Répartition => {
|
|||
reduce(mergeWith(add), 0),
|
||||
Object.values
|
||||
)(rawRépartition),
|
||||
// $FlowFixMe
|
||||
cotisationMaximum: compose(
|
||||
reduce(max, 0),
|
||||
map(montant => montant.partPatronale + montant.partSalariale),
|
||||
values
|
||||
// $FlowFixMe
|
||||
)(rawRépartition),
|
||||
salaireNet,
|
||||
salaireChargé
|
||||
|
|
Loading…
Reference in New Issue