pull/294/head
Johan Girod 2018-07-12 10:09:41 +02:00 committed by Mael
parent b6ad5c92e0
commit 0e028cc843
183 changed files with 1470 additions and 2352 deletions

View File

@ -27,6 +27,8 @@ overrides:
files: "*.test.js"
env:
mocha: true
globals:
process: false
extends:
- eslint:recommended

View File

@ -21,6 +21,11 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe
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='^Selectors\(.*\)$' -> '<PROJECT_ROOT>/source/selectors\1'
module.name_mapper='^Règles\(.*\)$' -> '<PROJECT_ROOT>/source/règles\1'
module.name_mapper='^Ui\(.*\)$' -> '<PROJECT_ROOT>/source/components/ui\1'
module.name_mapper='^Components\(.*\)$' -> '<PROJECT_ROOT>/source/components\1'
module.name_mapper='^Selectors\(.*\)$' -> '<PROJECT_ROOT>/source/selectors\1'
module.name_mapper='^Reducers\(.*\)$' -> '<PROJECT_ROOT>/source/reducers\1'
module.name_mapper='^Actions\(.*\)$' -> '<PROJECT_ROOT>/source/actions\1'
module.name_mapper='^Types\(.*\)$' -> '<PROJECT_ROOT>/source/types\1'

View File

@ -1 +1 @@
web: yarn run live-server --entry-file=index.html dist
web: yarn run live-server --entry-file=infrance.html dist

View File

@ -26,7 +26,7 @@
<body>
<div id="js" />
<script src="https://use.fontawesome.com/1da10bbdec.js"></script>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=Intl.~locale.en,Intl.~locale.fr,IntersectionObserver&unknown=polyfill"></script>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=default,Intl.~locale.en,Intl.~locale.fr,IntersectionObserver,fetch&unknown=polyfill"></script>
</body>
</html>

View File

@ -8,52 +8,20 @@
"engines": {
"node": ">=8.10.0 <10.0.0"
},
"browserslist": ["> 1% in FR", "not ie < 11"],
"browserslist": [
"> 1% in FR",
"not ie < 11"
],
"dependencies": {
"@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.6.3",
"babel-eslint": "^8.2.5",
"babel-loader": "8.0.0-beta.2",
"babel-plugin-syntax-dynamic-import": "^6.18.0",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-decorators": "^6.24.1",
"babel-plugin-transform-do-expressions": "^6.22.0",
"babel-plugin-webpack-alias": "^2.1.2",
"classnames": "^2.2.5",
"color-convert": "^1.9.2",
"core-js": "^2.5.7",
"css-loader": "^0.28.11",
"csv-loader": "^2.1.1",
"daggy": "^1.2.0",
"dedent-js": "^1.0.1",
"express": "^4.16.3",
"file-loader": "^1.1.11",
"focus-trap-react": "^3.1.2",
"fuse.js": "^3.2.1",
"global": "^4.3.2",
"google-translate-api": "^2.3.0",
"html-loader": "^0.5.5",
"i18next": "^10.0.7",
"ignore-loader": "^0.1.2",
"js-yaml": "^3.12.0",
"jsdom": "^11.11.0",
"json-loader": "^0.5.7",
"live-server": "^1.2.0",
"marked": "^0.3.17",
"nearley": "^2.13.0",
"nearley-loader": "^2.0.0",
"npm-check-updates": "^2.14.2",
"postcss-loader": "^2.1.2",
"ramda": "^0.25.0",
"ramda-fantasy": "^0.8.0",
"rc-progress": "^2.2.5",
"react": "^16.3.1",
"react-addons-css-transition-group": "^15.6.2",
@ -62,7 +30,7 @@
"react-easy-emoji": "^1.2.0",
"react-helmet": "^5.2.0",
"react-highlight-words": "^0.11.0",
"react-hot-loader": "^4.0.0",
"react-hot-loader": "^4.3.3",
"react-i18next": "^7.5.0",
"react-redux": "^5.0.7",
"react-router": "^4.2.0",
@ -78,61 +46,86 @@
"redux": "^3.7.2",
"redux-form": "^7.4.2",
"reselect": "^3.0.1",
"screenfull": "^3.3.2",
"source-map-support": "^0.5.4",
"style-loader": "^0.20.3",
"url-loader": "^1.0.1",
"webpack": "^4.12.1",
"webpack-cli": "^3.0.8",
"webpack-dev-server": "^3.1.1",
"whatwg-fetch": "^2.0.3",
"yaml-loader": "^0.5.0"
"screenfull": "^3.3.2"
},
"scripts": {
"pretest":
"LIST=`git diff --name-only HEAD..HEAD^ | grep .*\\.js | grep -v json`; if [ \"$LIST\" ]; then eslint $LIST; fi && flow check",
"start": "node source/server.js",
"externalize": "node source/externalize.js",
"prepare": "flow-typed update-cache",
"compile": "webpack --config source/webpack.prod.js",
"test":
"mocha-webpack --webpack-config source/webpack.test.js --require source-map-support/register --include componentTestSetup.js --require test/helpers/browser.js \"./{,!(node_modules)/**/}!(webpack).test.js\"",
"test-watch":
"mocha-webpack --webpack-config source/webpack.test.js --require source-map-support/register --require test/helpers/browser.js \"test/**/*.test.js\" --watch",
"test-meca":
"mocha-webpack --webpack-config source/webpack.test.js --require source-map-support/register --require test/helpers/browser.js test/mecanisms.test.js --watch",
"test-rules":
"mocha-webpack --webpack-config source/webpack.test.js --require source-map-support/register --require test/helpers/browser.js test/real-rules.test.js --watch",
"test-inversions":
"mocha-webpack --webpack-config source/webpack.test.js --require source-map-support/register --require test/helpers/browser.js \"test/inversion.test.js\" --watch",
"test-components":
"mocha-webpack --webpack-config source/webpack.test.js --require source-map-support/register --include componentTestSetup.js --require test/helpers/browser.js \"source/components/**/*.test.js\" --watch",
"eslint-check": "eslint --print-config .eslintrc | eslint-config-prettier-check",
"eslint": "LIST=`git diff --cached --name-only --diff-filter=AMR HEAD | grep .*\\.js | grep -v json`; if [ \"$LIST\" ]; then eslint $LIST; fi",
"externalize": "node source/externalize.js",
"heroku-postbuild": "yarn install --production=false && yarn compile",
"eslint":
"LIST=`git diff --cached --name-only HEAD | grep .*\\.js | grep -v json`; if [ \"$LIST\" ]; then eslint $LIST; fi",
"eslint-check":
"eslint --print-config .eslintrc | eslint-config-prettier-check"
"prepare": "flow-typed update-cache",
"pretest": "LIST=`git diff --name-only --diff-filter=AMR HEAD^..HEAD | grep .*\\.js | grep -v json`; if [ \"$LIST\" ]; then eslint $LIST; fi && flow check",
"start": "webpack-serve ./source/webpack.dev.js",
"test-components": "mocha-webpack --webpack-config source/webpack.test.js --require source-map-support/register --include componentTestSetup.js --require test/helpers/browser.js \"source/components/**/*.test.js\" --watch",
"test-inversions": "mocha-webpack --webpack-config source/webpack.test.js --require source-map-support/register --require test/helpers/browser.js \"test/inversion.test.js\" --watch",
"test-meca": "mocha-webpack --webpack-config source/webpack.test.js --require source-map-support/register --require test/helpers/browser.js test/mecanisms.test.js --watch",
"test-rules": "mocha-webpack --webpack-config source/webpack.test.js --require source-map-support/register --require test/helpers/browser.js test/real-rules.test.js --watch",
"test-watch": "mocha-webpack --webpack-config source/webpack.test.js --require source-map-support/register --require test/helpers/browser.js \"test/**/*.test.js\" --watch",
"test": "mocha-webpack --webpack-config source/webpack.test.js --require source-map-support/register --include componentTestSetup.js --require test/helpers/browser.js \"./{,!(node_modules)/**/}!(webpack).test.js\""
},
"devDependencies": {
"@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-flow": "^7.0.0-beta.51",
"@babel/preset-react": "=7.0.0-beta.51",
"akh": "^3.1.2",
"autoprefixer": "^8.6.3",
"babel-eslint": "^8.2.5",
"babel-loader": "8.0.0-beta.2",
"babel-plugin-syntax-dynamic-import": "^6.18.0",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-decorators": "^6.24.1",
"babel-plugin-transform-do-expressions": "^6.22.0",
"babel-plugin-webpack-alias": "^2.1.2",
"chai": "^4.1.2",
"co-request": "^1.0.0",
"connect-history-api-fallback": "^1.5.0",
"copy-webpack-plugin": "^4.5.2",
"css-loader": "^0.28.11",
"csv-loader": "^2.1.1",
"daggy": "^1.2.0",
"dedent-js": "^1.0.1",
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.1",
"eslint": "^5.0.1",
"eslint-config-prettier": "^2.9.0",
"eslint-plugin-flowtype": "^2.46.3",
"eslint-plugin-react": "^7.10.0",
"file-loader": "^1.1.11",
"flow-bin": "^0.72.0",
"flow-typed": "^2.4.0",
"google-translate-api": "^2.3.0",
"html-loader": "^0.5.5",
"html-webpack-plugin": "^3.2.0",
"intl": "^1.2.5",
"intl-locales-supported": "^1.0.0",
"js-yaml": "^3.12.0",
"jsdom": "^11.11.0",
"json-loader": "^0.5.7",
"koa-connect": "^2.0.1",
"live-server": "^1.2.0",
"mocha": "^5.0.4",
"mocha-webpack": "^2.0.0-beta.0",
"nearley-loader": "^2.0.0",
"postcss-loader": "^2.1.2",
"ramda-fantasy": "^0.8.0",
"sinon": "^4.5.0",
"sinon-chai": "^3.0.0",
"source-map-support": "^0.5.4",
"style-loader": "^0.20.3",
"url-loader": "^1.0.1",
"webpack": "^4.12.1",
"webpack-cli": "^3.0.8",
"webpack-pwa-manifest": "^3.6.2",
"workbox-webpack-plugin": "^3.3.1"
"webpack-serve": "^2.0.2",
"webpack-serve-overlay": "^0.2.2",
"webpack-serve-waitpage": "^1.0.0",
"workbox-webpack-plugin": "^3.3.1",
"yaml-loader": "^0.5.0"
}
}

View File

@ -1,24 +1,19 @@
/* global process: false */
import ReactPiwik from 'Components/Tracker'
import { defaultTracker, TrackerProvider } from 'Components/utils/withTracker'
import createHistory from 'history/createBrowserHistory'
import i18next from 'i18next'
import React from 'react'
import { render } from 'react-dom'
import { AppContainer } from 'react-hot-loader'
import React, { PureComponent } from 'react'
import { I18nextProvider } from 'react-i18next'
import { Provider } from 'react-redux'
import { Router } from 'react-router-dom'
import reducers from 'Reducers/rootReducer'
import { applyMiddleware, compose, createStore } from 'redux'
import Layout from './components/inFranceApp/routes'
import computeThemeColours from './components/themeColours'
import { defaultTracker, TrackerProvider } from './components/withTracker'
import computeThemeColours from 'Ui/themeColours'
import trackDomainActions from './middlewares/trackDomainActions'
import reducers from './reducers/reducers'
import {
persistSimulation,
retrievePersistedSimulation
} from './storage/persist'
import ReactPiwik from './Tracker'
import { getIframeOption, getUrl } from './utils'
let tracker = defaultTracker
@ -29,13 +24,14 @@ if (process.env.NODE_ENV === 'production') {
trackErrors: true
})
}
if (process.env.NODE_ENV === 'production') {
let integratorUrl = getIframeOption('integratorUrl')
ReactPiwik.push([
'setCustomVariable',
1,
'urlPartenaire',
decodeURIComponent(integratorUrl || 'https://embauche.beta.gouv.fr'),
decodeURIComponent(integratorUrl || location.origin),
'visit'
])
}
@ -50,38 +46,8 @@ const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose
let enhancer = composeEnhancers(applyMiddleware(trackDomainActions(tracker)))
let store = createStore(reducers, initialStore, enhancer)
let anchor = document.querySelector('#js')
persistSimulation(store)
const history = createHistory()
let App = ({ store }) => (
<Provider store={store}>
<TrackerProvider value={tracker}>
<I18nextProvider i18n={i18next}>
<Router history={tracker.connectToHistory(history)}>
<Layout />
</Router>
</I18nextProvider>
</TrackerProvider>
</Provider>
)
render(<App store={store} />, anchor)
if (process.env.NODE_ENV !== 'production' && module.hot) {
module.hot.accept('./components/inFranceApp/routes', () => {
render(
<AppContainer>
<App store={store} />
</AppContainer>,
anchor
)
})
}
export { anchor }
if ('serviceWorker' in navigator) {
if (process.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
window.addEventListener('load', () => {
navigator.serviceWorker
.register('/sw.js')
@ -93,3 +59,24 @@ if ('serviceWorker' in navigator) {
})
})
}
export default class Layout extends PureComponent {
state = {
history: createHistory({
basename: process.env.NODE_ENV === 'production' ? '' : this.props.basename
})
}
render() {
return (
<Provider store={store}>
<TrackerProvider value={tracker}>
<I18nextProvider i18n={i18next}>
<Router history={tracker.connectToHistory(this.state.history)}>
<>{this.props.children}</>
</Router>
</I18nextProvider>
</TrackerProvider>
</Provider>
)
}
}

View File

@ -3,7 +3,7 @@ import type {
ResetSimulationAction,
LoadPreviousSimulationAction,
DeletePreviousSimulationAction
} from './types/Actions'
} from 'Types/ActionsTypes'
export function resetSimulation(): ResetSimulationAction {
return {

View File

@ -5,7 +5,7 @@ import type {
CompanyHaveMultipleAssociateAction,
DirectorStatus,
DefineDirectorStatusAction
} from './types'
} from 'Types/companyStatusTypes'
export function chooseCompanyLegalSetup(
setup: CompanyLegalSetup

View File

@ -1,12 +1,12 @@
import { EXPLAIN_VARIABLE } from 'Actions/actions'
import withColours from 'Components/utils/withColours'
import marked from 'Engine/marked'
import { findRuleByDottedName } from 'Engine/rules'
import React, { Component } from 'react'
import { connect } from 'react-redux'
import { flatRulesSelector } from 'Selectors/analyseSelectors'
import { EXPLAIN_VARIABLE } from '../actions'
import './Aide.css'
import References from './rule/References'
import withColours from './withColours'
@connect(
state => ({
explained: state.explainedVariable,

View File

@ -1,6 +1,8 @@
import marked from 'Engine/marked'
import { path } from 'ramda'
import React, { Component } from 'react'
import React, {
Component
} from 'react'
import ReactDOM from 'react-dom'
import './Dictionary.css'
import Overlay from './Overlay'

View File

@ -11,7 +11,6 @@
.banner p {
text-align: center;
color: #4b4b66;
font-size: 85%;
}
.banner i {

View File

@ -1,12 +1,12 @@
/* @flow */
import React from 'react'
import type { Node } from 'react'
import { connect } from 'react-redux'
import withColours from 'Components/utils/withColours'
import { compose } from 'ramda'
import withColours from './withColours'
import React from 'react'
import { connect } from 'react-redux'
import './Banner.css'
import type { State } from '../types/State'
import type { Node } from 'react'
import type { State } from 'Types/State'
type PropTypes = {
hidden: boolean,

View File

@ -1,8 +1,8 @@
/* @flow */
import { toPairs } from 'ramda'
import React from 'react'
import { connect } from 'react-redux'
import * as Animate from './animate'
import { toPairs } from 'ramda'
import * as Animate from 'Ui/animate'
import './Checklist.css'
type Props = {
@ -10,7 +10,13 @@ type Props = {
onChecklistItemChange: (string, string, boolean) => void
}
export default ({ name: checklistName, title, subtitle, items, conclusion }) =>
export default ({
name: checklistName,
title,
subtitle,
items,
conclusion
}: any) =>
connect(
state => ({
data: state.inFranceApp.checklists[checklistName]

View File

@ -65,7 +65,6 @@
}
.distribution-chart__branche-name {
padding-left: 0.4em;
font-size: inherit !important;
}
}
@ -85,16 +84,13 @@
.distribution-chart__branche-name {
font-weight: 500;
text-transform: capitalize;
}
.distribution-chart__icon {
font-size: 200%;
height: 1.2em;
}
.distribution-chart__branche-name::first-letter {
text-transform: capitalize;
}
.distribution-chart__total {
border-top: 1px dotted rgba(0, 0, 0, 0.7);
color: black;

View File

@ -1,21 +1,20 @@
/* @flow */
import Observer from '@researchgate/react-intersection-observer'
import withColours from 'Components/utils/withColours'
import React, { Component } from 'react'
import emoji from 'react-easy-emoji'
import { Trans } from 'react-i18next'
import { connect } from 'react-redux'
import { config, Spring } from 'react-spring'
import { compose } from 'redux'
import { capitalise0 } from '../../utils'
import withColours from '../withColours'
import répartitionSelector from 'Selectors/repartitionSelector'
import './Distribution.css'
import Montant from './Montant'
import './PaySlip'
import RuleLink from './RuleLink'
import répartitionSelector from './RépartitionSelector'
import type { Répartition, Branche } from './types'
import type { Répartition, Branche } from 'Types/ResultViewTypes.js'
const brancheToEmoji: { [Branche]: string } = {
retraite: '👵',
@ -112,9 +111,7 @@ class Distribution extends Component<Props, State> {
<div className="distribution-chart__item-content">
<p className="distribution-chart__counterparts">
<span className="distribution-chart__branche-name">
<Trans>
{capitalise0(brancheToLabel[branche] || branche)}
</Trans>
<Trans>{brancheToLabel[branche] || branche}</Trans>
</span>
{'. '}
{brancheToCounterparts[branche]}

View File

@ -1,10 +1,10 @@
import withColours from 'Components/utils/withColours'
import withTracker from 'Components/utils/withTracker'
import React, { Component } from 'react'
import { Trans, translate } from 'react-i18next'
import { Element, scroller } from 'react-scroll'
import { LinkButton } from 'Ui/Button'
import './conversation/conversation.css'
import { SimpleButton } from './ui/Button'
import withColours from './withColours'
import withTracker from './withTracker'
@translate()
@withColours
@ -21,12 +21,12 @@ export default class GoToExplanation extends Component {
render() {
return (
<Element name="resultsScrollElement" id="resultsScrollElement">
<SimpleButton
<LinkButton
className="scrollIndication down"
onClick={this.handleScrollToResults}>
<i className="fa fa-long-arrow-down" aria-hidden="true" />
&nbsp;<Trans i18nKey="details">Comprendre mes résultats</Trans>
</SimpleButton>
</LinkButton>
</Element>
)
}

View File

@ -1,6 +1,6 @@
/* @flow */
import withLanguage from 'Components/utils/withLanguage'
import React from 'react'
import withLanguage from '../withLanguage'
import './Montant.css'
type Props = {

View File

@ -1,7 +1,7 @@
import FocusTrap from 'focus-trap-react'
import React, { Component } from 'react'
import { LinkButton } from 'Ui/Button'
import './Overlay.css'
import { SimpleButton } from './ui/Button'
export default class Overlay extends Component {
render() {
@ -21,12 +21,12 @@ export default class Overlay extends Component {
e.stopPropagation()
}}>
{children}
<SimpleButton
<LinkButton
aria-label="close"
onClick={onClose}
id="overlayCloseButton">
x
</SimpleButton>
</LinkButton>
</div>
</FocusTrap>
</div>

View File

@ -1,11 +1,11 @@
/* @flow */
import type { FicheDePaie } from './types'
import type { FicheDePaie } from 'Types/ResultViewTypes'
import withColours from 'Components/utils/withColours'
import { compose } from 'ramda'
import React, { Fragment } from 'react'
import { Trans } from 'react-i18next'
import { connect } from 'react-redux'
import withColours from '../withColours'
import ficheDePaieSelector from './FicheDePaieSelector'
import FicheDePaieSelectors from 'Selectors/ficheDePaieSelectors'
import Montant from './Montant'
import './PaySlip.css'
import RuleLink from './RuleLink'
@ -157,7 +157,7 @@ const PaySlip = ({
export default compose(
withColours,
connect(
ficheDePaieSelector,
FicheDePaieSelectors,
{}
)
)(PaySlip)

View File

@ -1,33 +1,39 @@
/* @flow */
import {
deletePreviousSimulation,
loadPreviousSimulation
} from 'Actions/actions'
import { compose } from 'ramda'
import React from 'react'
import { Trans, translate } from 'react-i18next'
import { connect } from 'react-redux'
import { deletePreviousSimulation, loadPreviousSimulation } from '../actions'
import { noUserInputSelector } from 'Selectors/analyseSelectors'
import { LinkButton } from 'Ui/Button'
import Banner from './Banner'
import { LinkButton } from './ui/Button'
import type { SavedSimulation } from '../types/State'
import type { SavedSimulation } from 'Types/State'
type ConnectedPropTypes = {
previousSimulation: SavedSimulation,
loadPreviousSimulation: () => void,
newSimulationStarted: boolean,
deletePreviousSimulation: () => void
}
const PreviousSimulationBanner = ({
previousSimulation,
deletePreviousSimulation,
newSimulationStarted,
loadPreviousSimulation
}: ConnectedPropTypes) => (
<Banner hidden={!previousSimulation}>
<Banner hidden={!previousSimulation || newSimulationStarted}>
<Trans i18nKey="previousSimulationBanner.info">
Votre précédente simulation a été sauvegardée.
</Trans>
</Trans>{' '}
<LinkButton onClick={loadPreviousSimulation}>
<Trans i18nKey="previousSimulationBanner.retrieveButton">
Retrouver ma simulation
</Trans>
</LinkButton>
</LinkButton>.{' '}
<LinkButton onClick={deletePreviousSimulation}>
<Trans>Effacer</Trans>
</LinkButton>
@ -37,7 +43,10 @@ const PreviousSimulationBanner = ({
export default compose(
translate(),
connect(
({ previousSimulation }) => ({ previousSimulation }),
state => ({
previousSimulation: state.previousSimulation,
newSimulationStarted: !noUserInputSelector(state)
}),
{
loadPreviousSimulation,
deletePreviousSimulation

View File

@ -1,7 +1,7 @@
import { Circle } from 'rc-progress/lib'
import React from 'react'
import { Circle } from 'rc-progress'
import { targetCompletionRatioSelector } from './selector'
import { connect } from 'react-redux'
import { targetCompletionRatioSelector } from 'Selectors/progressCircleSelectors'
let ProgressCircle = ({ ratio, isActiveInput }) => (
<span

View File

@ -1,9 +1,9 @@
/* @flow */
import withColours from 'Components/utils/withColours'
import React from 'react'
import { Link } from 'react-router-dom'
import withColours from '../withColours'
import './RuleLink.css'
import type { Règle } from './types'
import type { Règle } from 'Types/ResultViewTypes'
type Props = Règle
const RuleLink = ({
lien,

View File

@ -1,3 +1,4 @@
import { setExample } from 'Actions/actions'
import { encodeRuleName } from 'Engine/rules'
import {
decodeRuleName,
@ -15,10 +16,8 @@ import {
flatRulesSelector,
noUserInputSelector
} from 'Selectors/analyseSelectors'
import { setExample } from '../actions'
import Namespace from './rule/Namespace'
import Rule from './rule/Rule'
import './RulePage.css'
import SearchButton from './SearchButton'
@connect(state => ({

View File

@ -1,6 +1,6 @@
import HoverDecorator from 'Components/utils/HoverDecorator'
import withColours from 'Components/utils/withColours'
import React, { Component } from 'react'
import withColours from './withColours'
import HoverDecorator from './HoverDecorator'
import './SatisfactionSmiley.css'
@withColours
@HoverDecorator

View File

@ -1,45 +1,24 @@
import React, { Component } from 'react'
import { translate } from 'react-i18next'
import PropTypes from 'prop-types'
import { connect } from 'react-redux'
import { encodeRuleName } from 'Engine/rules.js'
import { Link } from 'react-router-dom'
import './RulesList.css'
import './Pages.css'
import { capitalise0 } from '../../utils'
import Fuse from 'fuse.js'
import PropTypes from 'prop-types'
import { pick } from 'ramda'
import React from 'react'
import Highlighter from 'react-highlight-words'
import { translate } from 'react-i18next'
import { Link, Redirect } from 'react-router-dom'
import Select from 'react-select'
import 'react-select/dist/react-select.css'
import Fuse from 'fuse.js'
import { Redirect } from 'react-router-dom'
import Highlighter from 'react-highlight-words'
import { pick } from 'ramda'
import { flatRulesSelector } from 'Selectors/analyseSelectors'
@connect(state => ({
flatRules: flatRulesSelector(state)
}))
export default class RulesList extends Component {
render() {
let { flatRules } = this.props
return (
<div id="RulesList" className="page">
<h1>Explorez notre base de règles</h1>
<SearchBar showDefaultList={true} rules={flatRules} />
</div>
)
}
}
import { capitalise0 } from '../utils'
@translate()
export class SearchBar extends React.Component {
export default class SearchBar extends React.Component {
static contextTypes = {
i18n: PropTypes.object.isRequired
}
componentDidMount() {
this.inputElement.focus()
}
componentWillMount() {
UNSAFE_componentWillMount() {
let { rules } = this.props
var options = {
keys: [

View File

@ -2,10 +2,10 @@ import React, { Component } from 'react'
import { Trans, translate } from 'react-i18next'
import { connect } from 'react-redux'
import { flatRulesSelector } from 'Selectors/analyseSelectors'
import { LinkButton } from 'Ui/Button'
import Overlay from './Overlay'
import { SearchBar } from './pages/RulesList'
import SearchBar from './SearchBar'
import './SearchButton.css'
import { SimpleButton } from './ui/Button'
@connect(state => ({
flatRules: flatRulesSelector(state)
@ -46,7 +46,7 @@ export default class SearchButton extends Component {
/>
</Overlay>
) : (
<SimpleButton
<LinkButton
onClick={() => this.setState({ visible: true })}
className={this.props.className}
style={this.props.style}>
@ -58,7 +58,7 @@ export default class SearchButton extends Component {
<span>
<Trans>Rechercher</Trans>
</span>
</SimpleButton>
</LinkButton>
)
}
}

View File

@ -1,4 +1,5 @@
#simu {
margin-top: 2rem;
margin: 0 auto;
max-width: 40em;
}

View File

@ -1,4 +1,6 @@
import withColours from 'Components/utils/withColours'
import React, { Component } from 'react'
import { Trans } from 'react-i18next'
import { connect } from 'react-redux'
import { Link } from 'react-router-dom'
import { animated, Spring } from 'react-spring'
@ -7,13 +9,12 @@ import {
nextStepsSelector,
noUserInputSelector
} from 'Selectors/analyseSelectors'
import * as Animate from 'Ui/animate'
import Conversation from './conversation/Conversation'
import * as Animate from './inFranceApp/animate'
import Distribution from './ResultView/Distribution'
import PaySlip from './ResultView/PaySlip'
import Distribution from './Distribution'
import PaySlip from './PaySlip'
import './Simu.css'
import TargetSelection from './TargetSelection'
import withColours from './withColours'
@withColours
@connect(
@ -54,7 +55,7 @@ export default class Simu extends Component {
native>
{styles => (
<animated.div
className="ui__ button-container"
className="ui__ button-container"
style={{
...styles,
display: 'flex',
@ -66,44 +67,51 @@ export default class Simu extends Component {
<button
className="ui__ link-button"
onClick={onSimulationContinued}>
Permanent/Fixed term contract
<Trans>CDD</Trans>
</button>
<button
className="ui__ link-button"
onClick={onSimulationContinued}>
Part-time
CDI
</button>
<button
className="ui__ link-button"
onClick={onSimulationContinued}>
Cadre status
<Trans>Cadre</Trans>
</button>
<button
className="ui__ link-button"
onClick={onSimulationContinued}>
Other
<Trans>Temps partiel</Trans>
</button>
<button
className="ui__ link-button"
onClick={onSimulationContinued}>
<Trans>Autres situations</Trans>
</button>
</animated.div>
)}
</Spring>
{conversationStarted &&
!nextSteps.length && (
<>
<h1> No more questions left!</h1>
<p>
This is the most precise estimate that you can get. However,
some special reglementations rules can impact this result. You can
read more about it{' '}
<button className="ui__ link-button">here.</button>
</p>
<p> Want to make your hiring project a reality? </p>
<div style={{ textAlign: 'center' }}>
<Link className="ui__ button" to="/hiring-process">
Go to the hiring process
</Link>
</div>
</>
)}
{conversationStarted &&
!nextSteps.length && (
<>
<h1>
<Trans>Plus de questions restantes!</Trans>
</h1>
<p>
<Trans>
Vous avez atteint l&apos;estimation la plus précise. Vous
pouvez maintenant concrétiser votre projet, et apprendre les
démarches à suivre pour
</Trans>
</p>
<div style={{ textAlign: 'center' }}>
<Link className="ui__ button" to="/hiring-process">
Connaître les démarches
</Link>
</div>
</>
)}
<div id="focusZone">
{displayConversation && (
<>
@ -120,12 +128,12 @@ export default class Simu extends Component {
</Link>
</div>
)}
{simulationCompleted && (
<Animate.fromBottom>
<h2>Detailed payslip</h2>
<PaySlip />
</Animate.fromBottom>
)}
{simulationCompleted && (
<Animate.fromBottom>
<h2>Detailed payslip</h2>
<PaySlip />
</Animate.fromBottom>
)}
</div>
{firstValidInputEntered && (

View File

@ -10,9 +10,9 @@ import Smiley from './SatisfactionSmiley'
import './Sondage.css'
import ReactPiwik from './Tracker'
import TypeFormEmbed from './TypeFormEmbed'
import { SimpleButton } from './ui/Button'
import withColours from './withColours'
import withLanguage from './withLanguage'
import { LinkButton } from 'Ui/Button'
import withColours from 'Components/utils/withColours'
import withLanguage from 'Components/utils/withLanguage'
@connect(state => ({
conversationStarted: state.conversationStarted,
@ -101,12 +101,12 @@ export default class Sondage extends Component {
hoverColor="#f39c12"
onClick={this.onSmileyClick}
/>
<SimpleButton
<LinkButton
className="sondage__closeButton"
onClick={this.handleClose}
aria-label="close">
X
</SimpleButton>
</LinkButton>
</div>
</div>
)}

View File

@ -1,5 +1,6 @@
import classNames from 'classnames'
import InputSuggestions from 'Components/conversation/InputSuggestions'
import withLanguage from 'Components/utils/withLanguage'
import { findRuleByDottedName } from 'Engine/rules'
import { propEq } from 'ramda'
import React, { Component } from 'react'
@ -15,10 +16,9 @@ import {
} from 'Selectors/analyseSelectors'
import Controls from './Controls'
import CurrencyInput from './CurrencyInput/CurrencyInput'
import ProgressCircle from './ProgressCircle/ProgressCircle'
import AnimatedTargetValue from './AnimatedTargetValue'
import ProgressCircle from './ProgressCircle'
import './TargetSelection.css'
import withLanguage from './withLanguage'
let salaries = [
'contrat salarié . salaire . total',

View File

@ -7,8 +7,8 @@ import {
currentQuestionSelector,
flatRulesSelector
} from 'Selectors/analyseSelectors'
import * as Animate from 'Ui/animate'
import Aide from '../Aide'
import * as Animate from '../inFranceApp/animate'
import './conversation.css'
@reduxForm({

View File

@ -1,10 +1,10 @@
import { EXPLAIN_VARIABLE } from 'Actions/actions'
import classNames from 'classnames'
import { findRuleByDottedName } from 'Engine/rules'
import React from 'react'
import { connect } from 'react-redux'
import { flatRulesSelector } from 'Selectors/analyseSelectors'
import { EXPLAIN_VARIABLE } from '../../actions'
import withTracker from '../withTracker'
import withTracker from '../utils/withTracker'
import './Explicable.css'
@connect(

View File

@ -1,13 +1,13 @@
import React from 'react'
import { findRuleByDottedName } from 'Engine/rules'
import { capitalise0 } from '../../utils'
import { connect } from 'react-redux'
import React from 'react'
import { Trans, translate } from 'react-i18next'
import { connect } from 'react-redux'
import {
flatRulesSelector,
validatedSituationSelector
} from 'Selectors/analyseSelectors'
import { LinkButton } from 'Components/ui/Button'
import { LinkButton } from 'Ui/Button'
import { capitalise0 } from '../../utils'
@translate()
@connect(

View File

@ -1,3 +1,5 @@
import { resetSimulation } from 'Actions/actions'
import withTracker from 'Components/utils/withTracker'
import { isEmpty } from 'ramda'
import React, { Component } from 'react'
import { Trans } from 'react-i18next'
@ -5,9 +7,7 @@ import { connect } from 'react-redux'
import { animateScroll, Element, scroller } from 'react-scroll'
import { reset } from 'redux-form'
import { flatRulesSelector } from 'Selectors/analyseSelectors'
import { resetSimulation } from '../../actions'
import { LinkButton, SimpleButton } from '../ui/Button'
import withTracker from './../withTracker'
import { LinkButton } from 'Ui/Button'
import './conversation.css'
import FoldedStep from './FoldedStep'
@ -82,7 +82,7 @@ export class GoToAnswers extends Component {
render() {
return (
<Element name="myScrollToElement" id="myScrollToElement">
<SimpleButton
<LinkButton
onClick={this.handleScrollToAnswers}
className="scrollIndication up"
style={{
@ -90,7 +90,7 @@ export class GoToAnswers extends Component {
}}>
<i className="fa fa-long-arrow-up" aria-hidden="true" />
&nbsp;<Trans i18nKey="change">Modifier mes réponses</Trans>
</SimpleButton>
</LinkButton>
</Element>
)
}

View File

@ -1,4 +1,4 @@
import HoverDecorator from 'Components/HoverDecorator'
import HoverDecorator from 'Components/utils/HoverDecorator'
import React, { Component } from 'react'
import { Trans, translate } from 'react-i18next'
import './IgnoreStepButton.css'

View File

@ -1,7 +1,7 @@
import classnames from 'classnames'
import withColours from 'Components/utils/withColours'
import React, { Component } from 'react'
import { translate } from 'react-i18next'
import withColours from '../withColours'
import { FormDecorator } from './FormDecorator'
import InputSuggestions from './InputSuggestions'
import SendButton from './SendButton'

View File

@ -1,8 +1,8 @@
import React, { Component } from 'react'
import './InputSuggestions.css'
import withColours from '../withColours'
import withColours from 'Components/utils/withColours'
import { toPairs } from 'ramda'
import React, { Component } from 'react'
import { translate } from 'react-i18next'
import './InputSuggestions.css'
@withColours
@translate()

View File

@ -1,8 +1,8 @@
import HoverDecorator from 'Components/utils/HoverDecorator'
import withColours from 'Components/utils/withColours'
import { is } from 'ramda'
import React, { Component } from 'react'
import { Trans, translate } from 'react-i18next'
import HoverDecorator from '../HoverDecorator'
import withColours from '../withColours'
import Explicable from './Explicable'
import { FormDecorator } from './FormDecorator'
import './Question.css'

View File

@ -1,7 +1,7 @@
import HoverDecorator from 'Components/HoverDecorator'
import HoverDecorator from 'Components/utils/HoverDecorator'
import withColours from 'Components/utils/withColours'
import React, { Component } from 'react'
import { Trans, translate } from 'react-i18next'
import withColours from '../withColours'
@HoverDecorator
@translate()

View File

@ -1,40 +0,0 @@
import React, { Component } from 'react'
import { Route, Switch } from 'react-router-dom'
import '../../containers/reset.css'
import RulePage from '../RulePage'
import withTracker from '../withTracker'
import Landing from './Landing'
import CreateMyCompany from './Steps/Company/index'
import CostsBenefits from './Steps/Costs and benefits'
import StepsHeader from './Steps/Header/StepsHeader'
import HiringProcess from './Steps/HiringProcess'
import './ui/index.css'
class Layout extends Component {
componentDidMount() {
if (typeof sessionStorage !== 'undefined') {
sessionStorage['lang'] = 'en'
}
this.props.tracker.push(['trackPageView'])
}
render() {
return (
<>
<Switch>
<Route exact path="/" component={Landing} />
<>
{/* Passing location down to prevent update blocking */}
<StepsHeader location={location} />
<div className="ui__ container">
<Route path="/règle/:name" component={RulePage} />
<Route path="/my-company" component={CreateMyCompany} />
<Route path="/social-security" component={CostsBenefits} />
<Route path="/hiring-process" component={HiringProcess} />
</div>
</>
</Switch>
</>
)
}
}
export default withTracker(Layout)

View File

@ -1,125 +0,0 @@
.ui__.inverted-button:active,
.ui__.button:active {
animation: push-button-down 0.1s ease-out alternate-reverse 2;
}
.ui__.button,
.ui__.inverted-button,
.ui__.skip-button {
font-size: 1.1rem;
padding: 0.8rem 1.6rem;
text-decoration: none;
border: 1px solid;
/* outline: none; */
display: inline-block;
border-radius: 0.6rem;
transition: all 0.15s;
margin: 0.8rem 0;
margin-right: 1.6em;
text-transform: uppercase;
font-family: 'Roboto', sans-serif;
}
.ui__.button:disabled,
.ui__.inverted-button:disabled,
.ui__.skip-button:disabled {
opacity: 0.7;
cursor: not-allowed;
}
.ui__.button {
border-color: rgb(41, 117, 209);
color: rgb(41, 117, 209);
background: linear-gradient(
45deg,
rgba(39, 69, 195, 0.87) 5%,
rgba(41, 117, 209, 1) 50%,
rgba(255, 255, 255, 0.52) 55%
);
background-size: 250%;
background-position-x: 99%;
}
.ui__.button:not(:disabled):hover,
.ui__.button.selected {
background-position-x: 0%;
border-color: white;
color: white;
}
.ui__.button.cta,
.ui__.inverted-button.cta {
margin: 3em auto;
display: inline-block;
align-self: center;
font-size: 120%;
}
.ui__.inverted-button {
color: white;
border-color: white;
}
.ui__.inverted-button:not(:disabled):hover {
background-color: rgba(255, 255, 255, 0.9);
color: rgb(41, 117, 209);
border-color: rgb(41, 117, 209);
}
.ui__.link-button {
border: none;
display: inline-block;
font-size: inherit;
text-decoration: underline;
font-family: inherit;
padding: 0;
margin: 0;
color: rgb(41, 117, 209);
}
.ui__.link-button:not(:disabled):hover {
opacity: 0.8;
}
.ui__.button_next {
color: rgb(41, 117, 209);
}
.ui__.skip-button {
opacity: 0.6;
border-color: black;
color: black;
}
.ui__.skip-button:not(:disabled):hover {
opacity: 0.8;
transform: translateX(3px);
}
.ui__.skip-button:active {
animation: push-button-right 0.1s ease-out alternate-reverse 2;
}
.ui__.small.button {
font-size: 80%;
padding: 0.4rem 0.8rem;
border-radius: 0.3rem;
}
.ui__.button-container > * {
margin-top: 0.5rem;
}
.ui__.button-container > :not(:last-child) {
margin-right: 0.5rem;
}
@keyframes push-button-down {
from {
transform: translateY(3px);
}
to {
transform: translate3d(0);
}
}
@keyframes push-button-right {
from {
transform: translate3d(5px, 0, 0);
}
to {
transform: translate3d(3px, 0, 0);
}
}

View File

@ -1,8 +0,0 @@
/* @flow */
import * as React from 'react'
import './button.css'
export const SkipButton = (props: React.ElementConfig<'button'>) => (
<button className="ui__ skip-button" {...props}>
{props.children || 'Skip '}
</button>
)

View File

@ -1,24 +0,0 @@
.page {
max-width: 45em;
margin: 0 auto;
padding: 0 0.6em;
}
.page p {
}
.page h1 {
margin: 1em 0.6em;
text-align: center;
color: #3c4963;
font-size: 220%;
}
.page em {
font-weight: 600;
font-style: normal;
}
.page a {
color: #1548af;
}

View File

@ -5,7 +5,7 @@ import { path, values } from 'ramda'
import React from 'react'
import { Trans, translate } from 'react-i18next'
import { AttachDictionary } from '../AttachDictionary'
import withLanguage from '../withLanguage'
import withLanguage from 'Components/utils/withLanguage'
import './Algorithm.css'
@AttachDictionary(knownMecanisms)

View File

@ -4,7 +4,7 @@ import { compose } from 'ramda'
import classNames from 'classnames'
import { connect } from 'react-redux'
import './Examples.css'
import { setExample } from '../../actions'
import { setExample } from 'Actions/actions'
import { capitalise0 } from '../../utils'
@connect(

View File

@ -1,11 +1,11 @@
import React from 'react'
import Namespace from './Namespace'
import { createMarkdownDiv } from 'Engine/marked'
import { path } from 'ramda'
import Destinataire from './Destinataire'
import React from 'react'
import { Trans } from 'react-i18next'
import { capitalise0 } from '../../utils'
import Destinataire from './Destinataire'
import './Header.css'
import Namespace from './Namespace'
let RuleHeader = ({
ns,

View File

@ -1,8 +1,8 @@
import withColours from 'Components/utils/withColours'
import { encodeRuleName, findRuleByDottedName } from 'Engine/rules'
import React from 'react'
import { Link } from 'react-router-dom'
import { capitalise0 } from '../../utils'
import withColours from '../withColours'
import './Namespace.css'
let Namespace = ({ ns, flatRules, colours }) => (

View File

@ -1,9 +1,9 @@
import { groupBy, toPairs } from 'ramda'
import React from 'react'
import { Trans, translate } from 'react-i18next'
import { toPairs, groupBy } from 'ramda'
import './References.css'
import references from 'Règles/ressources/références/références.yaml'
import { capitalise0 } from '../../utils'
import './References.css'
@translate()
export default class References extends React.Component {
@ -13,7 +13,7 @@ export default class References extends React.Component {
render() {
let { refs } = this.props,
{ complementary, official = [] } = groupBy(
([name, link]) => (this.findRefKey(link) ? 'official' : 'complementary')
([, link]) => (this.findRefKey(link) ? 'official' : 'complementary')
)(toPairs(refs)),
showComplementary = this.state.showComplementary,
showComplementaryButton = !this.state.showComplementary && complementary
@ -32,13 +32,12 @@ export default class References extends React.Component {
<li id="complementary" key="compl">
<a
href="#/"
onClick={() => this.setState({ showComplementary: true })}
>
onClick={() => this.setState({ showComplementary: true })}>
<i className="fa fa-eye" aria-hidden="true" />
<Trans>afficher les sources complémentaires</Trans>
</a>
</li>
]
]
: []),
...(showComplementary ? complementary.map(this.renderRef) : [])
]}

View File

@ -1,27 +1,27 @@
import React, { Component } from 'react'
import { Trans, translate } from 'react-i18next'
import { isEmpty } from 'ramda'
import { connect } from 'react-redux'
import './Rule.css'
import References from './References'
import Algorithm from './Algorithm'
import Examples from './Examples'
import Helmet from 'react-helmet'
import withColours from 'Components/utils/withColours'
import { createMarkdownDiv } from 'Engine/marked'
import RuleHeader from './Header'
import {
encodeRuleName,
findRuleByDottedName,
findRuleByNamespace
} from 'Engine/rules'
import { isEmpty } from 'ramda'
import React, { Component } from 'react'
import Helmet from 'react-helmet'
import { Trans, translate } from 'react-i18next'
import { connect } from 'react-redux'
import { Link } from 'react-router-dom'
import {
findRuleByNamespace,
encodeRuleName,
findRuleByDottedName
} from 'Engine/rules'
import withColours from '../withColours'
import {
noUserInputSelector,
exampleAnalysisSelector,
flatRulesSelector,
ruleAnalysisSelector,
exampleAnalysisSelector
noUserInputSelector,
ruleAnalysisSelector
} from 'Selectors/analyseSelectors'
import Algorithm from './Algorithm'
import Examples from './Examples'
import RuleHeader from './Header'
import References from './References'
import './Rule.css'
@connect((state, props) => ({
currentExample: state.currentExample,

View File

@ -1,8 +1,8 @@
import withLanguage from 'Components/utils/withLanguage'
import { encodeRuleName } from 'Engine/rules'
import React, { Component } from 'react'
import ReactCSSTransitionGroup from 'react-addons-css-transition-group'
import { Link } from 'react-router-dom'
import withLanguage from '../withLanguage'
import './RuleValueVignette.css'
let RuleValueVignette = ({ name, title, nodeValue: ruleValue }) => (

View File

@ -1,25 +0,0 @@
.blueButton {
color: white;
display: block;
padding: 0.3em 1em;
font-size: 200%;
min-width: 8em;
margin: 0 auto;
border: none;
box-shadow: 0px 9px 14px 0px rgba(0, 0, 0, 0.1);
opacity: 0.95;
border-radius: 0.2em;
transition: background 0.3s;
}
.blueButton:hover {
box-shadow: none;
opacity: 1;
}
.blueButton:disabled {
background: #4b4b6633 !important;
box-shadow: none;
}
.blueButton a {
color: inherit;
}

View File

@ -1,15 +0,0 @@
import React from 'react'
import withColours from '../../withColours'
import './BlueButton.css'
export default withColours(
({ colours, children, disabled, style, onClick }) => (
<button
disabled={disabled}
onClick={onClick}
className="blueButton"
style={{ ...style, background: colours.colour }}>
{children}
</button>
)
)

View File

@ -1,22 +1,126 @@
.ui-unstyledButton {
color: inherit;
padding: 0.3em 1em;
font-weight: inherit;
font-family: inherit;
border: none;
border-radius: 0;
font-size: inherit;
.ui__.inverted-button:active,
.ui__.button:active {
animation: push-button-down 0.1s ease-out alternate-reverse 2;
}
.ui-unstyledButton:hover {
.ui__.button,
.ui__.inverted-button,
.ui__.skip-button {
font-size: 1.1rem;
padding: 0.8rem 1.6rem;
text-decoration: none;
border: 1px solid;
/* outline: none; */
display: inline-block;
border-radius: 0.6rem;
transition: all 0.15s;
margin: 0.8rem 0;
margin-right: 1.6em;
text-transform: uppercase;
font-family: 'Roboto', sans-serif;
font-weight: normal;
cursor: pointer;
}
.ui__.button:disabled,
.ui__.inverted-button:disabled,
.ui__.skip-button:disabled {
opacity: 0.7;
cursor: not-allowed;
}
.ui__.button {
border-color: rgb(41, 117, 209);
color: rgb(41, 117, 209);
background: linear-gradient(
45deg,
rgba(39, 69, 195, 0.87) 5%,
rgba(41, 117, 209, 1) 50%,
rgba(255, 255, 255, 0.52) 55%
);
background-size: 250%;
background-position-x: 99%;
}
.ui__.button:not(:disabled):hover,
.ui__.button.selected {
background-position-x: 0%;
border-color: white;
color: white;
}
.ui__.button.cta,
.ui__.inverted-button.cta {
margin: 3em auto;
display: inline-block;
align-self: center;
font-size: 120%;
}
.ui__.inverted-button {
color: white;
border-color: white;
}
.ui__.inverted-button:not(:disabled):hover {
background-color: rgba(255, 255, 255, 0.9);
color: rgb(41, 117, 209);
border-color: rgb(41, 117, 209);
}
.ui__.link-button {
border: none;
display: inline-block;
font-size: inherit;
text-decoration: underline;
font-family: inherit;
padding: 0;
margin: 0;
color: rgb(41, 117, 209);
}
.ui__.link-button:not(:disabled):hover {
opacity: 0.8;
}
.ui-linkButton {
text-decoration: underline;
opacity: 1;
.ui__.button_next {
color: rgb(41, 117, 209);
}
.ui-defaultButton {
border-radius: 0.3em;
border: 1px solid;
.ui__.skip-button {
opacity: 0.6;
border-color: black;
color: black;
}
.ui__.skip-button:not(:disabled):hover {
opacity: 0.8;
transform: translateX(3px);
}
.ui__.skip-button:active {
animation: push-button-right 0.1s ease-out alternate-reverse 2;
}
.ui__.small.button {
font-size: 80%;
padding: 0.4rem 0.8rem;
border-radius: 0.3rem;
}
.ui__.button-container > * {
margin-top: 0.5rem;
}
.ui__.button-container > :not(:last-child) {
margin-right: 0.5rem;
}
@keyframes push-button-down {
from {
transform: translateY(3px);
}
to {
transform: translate3d(0);
}
}
@keyframes push-button-right {
from {
transform: translate3d(5px, 0, 0);
}
to {
transform: translate3d(3px, 0, 0);
}
}

View File

@ -1,32 +1,16 @@
/* @flow */
import React from 'react'
import withColours from '../../withColours'
import * as React from 'react'
import './button.css'
const buttonCreator = (buttonClassName, coloursToStyle) =>
withColours(({ className = '', style = {}, colours, ...props }) => (
<button
{...props}
style={{
...coloursToStyle(colours),
...style
}}
className={buttonClassName + ' ' + className}
/>
))
export const LinkButton = buttonCreator(
'ui-unstyledButton ui-linkButton',
colours => ({ color: colours.textColourOnWhite })
export const SkipButton = (props: React.ElementConfig<'button'>) => (
<button className="ui__ skip-button" {...props}>
{props.children || 'Skip '}
</button>
)
export const SimpleButton = buttonCreator('ui-unstyledButton', colours => ({
color: colours.textColourOnWhite
}))
const Button = buttonCreator('ui-unstyledButton ui-defaultButton', colours => ({
color: colours.textColourOnWhite,
borderColor: colours.colour
}))
export { default as BlueButton } from './BlueButton'
export const LinkButton = (props: React.ElementConfig<'button'>) => (
<button className="ui__ link-button" {...props} />
)
export default Button
export const Button = (props: React.ElementConfig<'button'>) => (
<button className="ui__ button" {...props} />
)

View File

@ -13,7 +13,7 @@ body {
h1 {
font-size: 2.8rem;
margin-top: 1rem;
margin-top: 1.5rem;
margin-bottom: 2rem;
}
h2 {

View File

@ -1,5 +1,6 @@
@import './Button/button.css';
@import './Typography.css';
@import './reset.css';
body {
overflow-x: hidden;
@ -24,6 +25,12 @@ body {
margin-right: 2em;
}
.ui__.container {
max-width: 45em;
margin: 0 auto;
padding: 0 0.6em;
}
ul.ui__.no-bullet {
list-style: none;
}

View File

@ -1,7 +1,7 @@
import React, { Component } from 'react'
export default DecoratedComponent =>
class extends Component {
class withHover extends Component {
state = {
hover: false
}

View File

@ -1,41 +0,0 @@
body {
font-size: calc(13px + 0.2vw);
background: white;
}
#js,
#dev {
height: 100%;
}
a {
color: inherit;
text-decoration: none;
}
h1,
h2 {
font-weight: 400;
}
#page-type {
display: inline-block;
position: fixed;
right: 3%;
top: 9%;
opacity: 0.4;
color: #333350;
opacity: 0.8;
}
#page-type span {
text-transform: uppercase;
font-size: 100%;
font-weight: bold;
}
.centeredMessage {
color: #333350;
margin: 10% auto;
width: 20em;
textalign: center;
}

View File

@ -1,12 +1,12 @@
import classNames from 'classnames'
import withLanguage from 'Components/utils/withLanguage'
import { contains } from 'ramda'
import React, { Component } from 'react'
import { Trans } from 'react-i18next'
import { connect } from 'react-redux'
import { Link } from 'react-router-dom'
import { flatRulesSelector } from 'Selectors/analyseSelectors'
import { SimpleButton } from '../../components/ui/Button'
import withLanguage from '../../components/withLanguage'
import { LinkButton } from 'Ui/Button'
import { capitalise0 } from '../../utils'
import { encodeRuleName, findRuleByDottedName } from '../rules'
@ -40,11 +40,9 @@ export class Node extends Component {
<div className={classNames(classes, 'node')}>
{name && (
<span className="nodeHead">
<SimpleButton
className="name"
data-term-definition={termDefinition}>
<LinkButton className="name" data-term-definition={termDefinition}>
<Trans>{name}</Trans>
</SimpleButton>
</LinkButton>
<NodeValuePointer data={value} />
</span>
)}

View File

@ -1,8 +1,7 @@
import i18next from 'i18next'
import queryString from 'query-string'
import { getIframeOption, parseDataAttributes } from './utils'
import enTranslations from './locales/en.yaml'
import { getIframeOption, parseDataAttributes } from './utils'
let getFromSessionStorage = where =>
typeof sessionStorage !== 'undefined' ? sessionStorage[where] : null
@ -18,6 +17,7 @@ let lang =
queryString.parse(location.search)['lang'] ||
parseDataAttributes(getFromSessionStorage('lang')) ||
'fr'
console.log('i18n', lang)
setToSessionStorage('lang', lang)
i18next.init(

View File

@ -7,20 +7,15 @@ import {
formattedSituationSelector
} from 'Selectors/analyseSelectors'
import { debounce } from '../utils'
import type { State } from '../types/State'
import type { Tracker } from '../components/withTracker'
// Todo : type all actions
type Action = any
import type { Tracker } from 'Components/utils/withTracker'
export default (tracker: Tracker) => {
const debouncedUserInputTracking = debounce(1000, action =>
tracker.push(['trackEvent', 'input', action.meta.field, action.payload])
)
return ({ getState }: Store<State>) => (next: Action => void) => (
action: Action
) => {
// $FlowFixMe
return ({ getState }) => next => action => {
next(action)
const newState = getState()
if (action.type == 'STEP_ACTION' && action.name == 'fold') {

View File

@ -1,7 +1,11 @@
/* @flow */
import { combineReducers } from 'redux'
import type { Action, CompanyLegalStatus, State } from './types'
import type {
Action,
CompanyLegalStatus,
State
} from 'Types/companyStatusTypes'
function companyLegalStatus(
state: CompanyLegalStatus = {},
@ -49,6 +53,7 @@ function existingCompanyDetails(
}
}
// $FlowFixMe
export default (combineReducers({
companyLegalStatus,
checklists,

View File

@ -1,13 +1,14 @@
import inFranceApp from 'Components/inFranceApp/reducers'
import { popularTargetNames } from 'Components/TargetSelection'
import computeThemeColours from 'Components/themeColours'
import { defaultTo, without } from 'ramda'
import reduceReducers from 'reduce-reducers'
import { combineReducers } from 'redux'
import { reducer as formReducer } from 'redux-form'
import computeThemeColours from 'Ui/themeColours'
import defaultLang from '../i18n'
import storageReducer from '../storage/reducer'
import inFranceAppReducer from './inFranceAppReducer'
import storageReducer from './storageReducer'
// TODO : use context API instead
function themeColours(state = computeThemeColours(), { type, colour }) {
if (type == 'CHANGE_THEME_COLOUR') return computeThemeColours(colour)
else return state
@ -104,6 +105,6 @@ export default reduceReducers(
currentExample,
conversationStarted,
activeTargetInput,
inFranceApp
inFranceApp: inFranceAppReducer
})
)

View File

@ -1,11 +1,11 @@
/* @flow */
import type { State } from '../types/State'
import type { Action } from '../types/Actions'
import type { State } from 'Types/State'
import type { Action } from 'Types/ActionsTypes'
import {
createStateFromSavedSimulation,
currentSimulationSelector
} from './selectors'
} from 'Selectors/storageSelectors'
export default (state: State, action: Action): State => {
switch (action.type) {

View File

@ -1,6 +1,10 @@
/* @flow */
import type { State, CompanyLegalStatus, DirectorStatus } from '../../types'
import type {
State,
CompanyLegalStatus,
DirectorStatus
} from 'Types/companyStatusTypes'
import { map, whereEq } from 'ramda'
const LEGAL_STATUS_DETAILS: { [status: string]: CompanyLegalStatus } = {

View File

@ -23,8 +23,8 @@ import {
flatRulesSelector
} from 'Selectors/analyseSelectors'
import type { FlatRules } from '../../types/State'
import type { Analysis } from '../../types/Analysis'
import type { FlatRules } from 'Types/State'
import type { Analysis } from 'Types/Analysis'
import type {
VariableWithCotisation,
Cotisation,
@ -33,7 +33,7 @@ import type {
Règle,
RègleAvecMontant,
FicheDePaie
} from './types'
} from 'Types/ResultViewTypes'
export const COTISATION_BRANCHE_ORDER: Array<Branche> = [
'santé',

View File

@ -1,5 +1,6 @@
/* @flow */
import { createSelector } from 'reselect'
import {
add,
compose,
@ -16,11 +17,10 @@ import {
sort,
without
} from 'ramda'
import { createSelector } from 'reselect'
import ficheDePaieSelector, {
import FicheDePaieSelectors, {
BLANK_COTISATION,
mergeCotisations
} from './FicheDePaieSelector'
} from './ficheDePaieSelectors'
import type {
Cotisation,
@ -29,7 +29,7 @@ import type {
RègleAvecMontant,
FicheDePaie,
Répartition
} from './types'
} from 'Types/ResultViewTypes'
const totalCotisations = (cotisations: Array<Cotisation>): MontantPartagé =>
cotisations.reduce(mergeCotisations, BLANK_COTISATION).montant
@ -149,4 +149,4 @@ const répartition = (ficheDePaie: FicheDePaie): Répartition => {
}
}
export default createSelector(ficheDePaieSelector, répartition)
export default createSelector(FicheDePaieSelectors, répartition)

View File

@ -1,6 +1,6 @@
/* @flow */
import type { Situation } from '../types/Situation.js'
import type { SavedSimulation, State } from '../types/State.js'
import type { Situation } from 'Types/Situation.js'
import type { SavedSimulation, State } from 'Types/State.js'
const situationSelector: State => Situation = state =>
state.form.conversation.values
@ -22,7 +22,7 @@ export const createStateFromSavedSimulation: (
}
},
conversationSteps: {
foldedSteps: simulation.foldedSteps
foldedSteps: simulation.foldedSteps
},
conversationStarted: true,
previousSimulation: null

View File

@ -1,31 +0,0 @@
var webpack = require('webpack')
var WebpackDevServer = require('webpack-dev-server')
var config = require('./webpack.dev')
const PORT = process.env.PORT || 3000
new WebpackDevServer(webpack(config), {
disableHostCheck: true,
publicPath: config.output.publicPath,
hot: true,
headers: { 'Access-Control-Allow-Origin': '*' }, //for hot reloading
historyApiFallback: true,
// It suppress error shown in console, so it has to be set to false.
quiet: false,
// It suppress everything except error, so it has to be set to false as well
// to see success build.
noInfo: false,
stats: {
// Config for minimal console.log mess.
assets: false,
colors: true,
version: false,
hash: false,
timings: false,
chunks: false,
chunkModules: false
}
}).listen(PORT, '0.0.0.0', function(err) {
if (err) console.log(err) //eslint-disable-line no-console
console.log('Bonjour ! Je vous sers sur localhost:' + PORT) //eslint-disable-line no-console
})

View File

@ -1,26 +1,26 @@
import Contact from 'Components/Contact'
import Mecanisms from 'Components/Mecanisms'
import About from 'Components/pages/About'
import Contribution from 'Components/pages/Contribution'
import { Header } from 'Components/pages/Header'
import Home from 'Components/pages/Home'
import Integration from 'Components/pages/Integration'
import RulesList from 'Components/pages/RulesList'
import Route404 from 'Components/Route404'
import RulePage from 'Components/RulePage'
import withTracker from 'Components/utils/withTracker'
import React, { Component } from 'react'
import { Redirect, Route, Switch } from 'react-router-dom'
import withTracker from '../components/withTracker'
import './Layout.css'
import './reset.css'
class Layout extends Component {
import 'Ui/index.css'
import Provider from '../../Provider'
import About from './pages/About'
import Contact from './pages/Contact'
import Contribution from './pages/Contribution'
import { Header } from './pages/Header'
import Home from './pages/Home'
import Integration from './pages/Integration'
import Route404 from './pages/Route404'
import RulesList from './pages/RulesList'
@withTracker
class EmbaucheRoute extends Component {
componentDidMount() {
this.props.tracker.push(['trackPageView'])
}
render() {
return (
<>
<Provider basename="embauche">
<Header />
<Switch>
<Route exact path="/" component={Home} />
@ -36,9 +36,16 @@ class Layout extends Component {
<Redirect from="/couleur.html" to="/" />
<Route component={Route404} />
</Switch>
</>
</Provider>
)
}
}
export default withTracker(Layout)
let ExportedApp = EmbaucheRoute
if (process.env.NODE_ENV !== 'production') {
const { hot } = require('react-hot-loader')
ExportedApp = hot(module)(EmbaucheRoute)
}
export default ExportedApp

View File

@ -1,4 +1,3 @@
import 'core-js/fn/promise'
import React from 'react'
import { SliderPicker } from 'react-color'
import { render } from 'react-dom'

View File

@ -0,0 +1,6 @@
import React from 'react'
import { render } from 'react-dom'
import App from './App'
let anchor = document.querySelector('#js')
render(<App />, anchor)

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View File

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

View File

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 76 KiB

View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 78 KiB

View File

Before

Width:  |  Height:  |  Size: 88 KiB

After

Width:  |  Height:  |  Size: 88 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Some files were not shown because too many files have changed in this diff Show More