⚙️ Réintroduit les alias, réorganise certains imports

pull/18/head
Laurent Bossavit 2017-07-02 19:12:02 +02:00
parent fcb55ec0bf
commit faa5353318
15 changed files with 54 additions and 49 deletions

View File

@ -42,6 +42,7 @@
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-do-expressions": "^6.22.0",
"babel-plugin-transform-object-rest-spread": "^6.23.0",
"babel-plugin-webpack-alias": "^2.1.2",
"babel-polyfill": "^6.23.0",
"babel-preset-env": "^1.4.0",
"babel-preset-react": "^6.24.1",

View File

@ -12,6 +12,7 @@
"transform-decorators-legacy",
"transform-do-expressions",
"transform-object-rest-spread",
"transform-class-properties"
"transform-class-properties",
["webpack-alias", { "config": "./source/webpack.config.js" }]
]
}

View File

@ -1,10 +1,12 @@
import React, {Component} from 'react'
import {connect} from 'react-redux'
import {rules, findRuleByDottedName} from '../engine/rules'
import './Aide.css'
import marked from 'Engine/marked'
import {rules, findRuleByDottedName} from 'Engine/rules'
import {EXPLAIN_VARIABLE} from '../actions'
import References from './rule/References'
import marked from '../engine/marked'
import './Aide.css'
@connect(
state =>

View File

@ -1,7 +1,7 @@
import R from 'ramda'
import React, { Component } from 'react'
import ReactDOM from 'react-dom'
import R from 'ramda'
import marked from '../engine/marked'
import marked from 'Engine/marked'
// On ajoute à la section la possibilité d'ouvrir un panneau d'explication des termes.
// Il suffit à la section d'appeler une fonction fournie en lui donnant du JSX

View File

@ -1,8 +1,8 @@
import React, {Component} from 'react'
import './HomeSyso.css'
import {searchRules, encodeRuleName} from '../engine/rules.js'
import {Link} from 'react-router-dom'
import R from 'ramda'
import React, {Component} from 'react'
import {Link} from 'react-router-dom'
import {searchRules, encodeRuleName} from 'Engine/rules.js'
import './HomeSyso.css'
export default class Home extends Component {
state = {

View File

@ -1,13 +1,14 @@
import R from 'ramda'
import React, { Component } from 'react'
import classNames from 'classnames'
import {Link} from 'react-router-dom'
import {connect} from 'react-redux'
import { withRouter } from 'react-router'
import R from 'ramda'
import './Results.css'
import {capitalise0} from '../utils'
import {computeRuleValue} from '../engine/traverse'
import {encodeRuleName, getObjectives} from '../engine/rules'
import {computeRuleValue} from 'Engine/traverse'
import {encodeRuleName, getObjectives} from 'Engine/rules'
let fmt = new Intl.NumberFormat('fr-FR').format
let humanFigure = decimalDigits => value => fmt(value.toFixed(decimalDigits))

View File

@ -1,18 +1,19 @@
import R from 'ramda'
import React, {Component} from 'react'
import Helmet from 'react-helmet'
import {reduxForm, formValueSelector, reset} from 'redux-form'
import {connect} from 'react-redux'
import {START_CONVERSATION} from '../actions'
import R from 'ramda'
import {Redirect, Link, withRouter} from 'react-router-dom'
import classNames from 'classnames'
import {START_CONVERSATION} from '../actions'
import Aide from './Aide'
import {createMarkdownDiv} from '../engine/marked'
import {rules, findRuleByName, decodeRuleName} from '../engine/rules'
import {createMarkdownDiv} from 'Engine/marked'
import {rules, findRuleByName, decodeRuleName} from 'Engine/rules'
import './conversation/conversation.css'
import './Simulateur.css'
import classNames from 'classnames'
import {capitalise0} from '../utils'
import Satisfaction from './Satisfaction'
import Helmet from 'react-helmet'
let situationSelector = formValueSelector('conversation')

View File

@ -4,7 +4,7 @@ import './Explicable.css'
import HoverDecorator from '../HoverDecorator'
import {connect} from 'react-redux'
import {EXPLAIN_VARIABLE} from '../../actions'
import {rules, findRuleByDottedName} from '../../engine/rules'
import {rules, findRuleByDottedName} from 'Engine/rules'
@connect(state => ({explained: state.explainedVariable}), dispatch => ({

View File

@ -2,8 +2,8 @@ import React from 'react'
import classNames from 'classnames'
import R from 'ramda'
import {AttachDictionary} from '../AttachDictionary'
import knownMecanisms from '../../engine/known-mecanisms.yaml'
import marked from '../../engine/marked'
import knownMecanisms from 'Engine/known-mecanisms.yaml'
import marked from 'Engine/marked'
@AttachDictionary(knownMecanisms)
export default class Algorithm extends React.Component {

View File

@ -5,8 +5,8 @@ import {
rules,
decodeRuleName,
disambiguateRuleReference
} from "../../engine/rules.js"
import { analyseSituation } from "../../engine/traverse"
} from "Engine/rules.js"
import { analyseSituation } from "Engine/traverse"
import "./Examples.css"
export default class Examples extends Component {

View File

@ -1,7 +1,7 @@
import React from 'react'
import R from 'ramda'
import references from '../../../règles/ressources/références/références.yaml'
import './References.css'
import references from 'Règles/ressources/références/références.yaml'
export default ({refs}) => (
<ul className="references">
@ -18,7 +18,7 @@ export default ({refs}) => (
<span className="url">
{domain}
{refData.image &&
<img src={require('../../../règles/ressources/références/' + refData.image)}/> }
<img src={require('Règles/ressources/références/' + refData.image)}/> }
</span>
</span>
<a href={link} target="_blank">

View File

@ -4,11 +4,11 @@ import {connect} from 'react-redux'
import {formValueSelector} from 'redux-form'
import R from 'ramda'
import './Rule.css'
import {rules, decodeRuleName} from '../../engine/rules.js'
import mockSituation from '../../engine/mockSituation.yaml'
import {analyseSituation} from '../../engine/traverse'
import {rules, decodeRuleName} from 'Engine/rules.js'
import mockSituation from 'Engine/mockSituation.yaml'
import {analyseSituation} from 'Engine/traverse'
import {START_CONVERSATION} from '../../actions'
import possiblesDestinataires from '../../../règles/ressources/destinataires/destinataires.yaml'
import possiblesDestinataires from 'Règles/ressources/destinataires/destinataires.yaml'
import {capitalise0} from '../../utils'
import References from './References'
import Algorithm from './Algorithm'
@ -89,7 +89,7 @@ export default class Rule extends Component {
: <div>
<a href={destinataireData.lien} target="_blank">
{destinataireData.image &&
<img src={require('../../../règles/ressources/destinataires/' + destinataireData.image)} /> }
<img src={require('Règles/ressources/destinataires/' + destinataireData.image)} /> }
{!destinataireData.image &&
<div id="calligraphy">{destinataire}</div>
}

View File

@ -2,13 +2,13 @@ import React, { Component } from 'react'
import './Layout.css'
import './reset.css'
import {Link, Route, BrowserRouter as Router, Switch} from 'react-router-dom'
import HomeEmbauche from '../components/HomeEmbauche'
import HomeSyso from '../components/HomeSyso'
import Rule from '../components/rule/Rule'
import Route404 from '../components/Route404'
import Contact from '../components/Contact'
import Simulateur from '../components/Simulateur'
import Results from '../components/Results'
import HomeEmbauche from 'Components/HomeEmbauche'
import HomeSyso from 'Components/HomeSyso'
import Rule from 'Components/rule/Rule'
import Route404 from 'Components/Route404'
import Contact from 'Components/Contact'
import Simulateur from 'Components/Simulateur'
import Results from 'Components/Results'
export default class Layout extends Component {

View File

@ -1,9 +1,11 @@
import React from 'react'
import Explicable from '../components/conversation/Explicable'
import R from 'ramda'
import Question from '../components/conversation/Question'
import Input from '../components/conversation/Input'
import formValueTypes from '../components/conversation/formValueTypes'
import Explicable from 'Components/conversation/Explicable'
import Question from 'Components/conversation/Question'
import Input from 'Components/conversation/Input'
import formValueTypes from 'Components/conversation/formValueTypes'
import {analyseSituation} from './traverse'
import {formValueSelector} from 'redux-form'
import { STEP_ACTION, START_CONVERSATION} from '../actions'

View File

@ -1,15 +1,13 @@
import R from 'ramda'
import React from 'react'
import { combineReducers } from 'redux'
import reduceReducers from 'reduce-reducers'
import {reducer as formReducer, formValueSelector} from 'redux-form'
import { euro, months } from './components/conversation/formValueTypes.js'
import {reduceSteps, generateGridQuestions, generateSimpleQuestions} from 'Engine/generateQuestions'
import { euro, months } from 'Components/conversation/formValueTypes.js'
import computeThemeColours from 'Components/themeColours'
import { EXPLAIN_VARIABLE, POINT_OUT_OBJECTIVES} from './actions'
import R from 'ramda'
import {reduceSteps, generateGridQuestions, generateSimpleQuestions} from './engine/generateQuestions'
import computeThemeColours from './components/themeColours'
function themeColours(state = computeThemeColours(), {type, colour}) {
if (type == 'CHANGE_THEME_COLOUR')
@ -35,7 +33,6 @@ function pointedOutObjectives(state=[], {type, objectives}) {
}
}
export default reduceReducers(
combineReducers({
sessionId: (id = Math.floor(Math.random() * 1000000000000) + '') => id,