diff --git a/source/actions/actions.js b/source/actions/actions.js
index f2f28a058..5bf3178f3 100644
--- a/source/actions/actions.js
+++ b/source/actions/actions.js
@@ -2,7 +2,8 @@
import type {
ResetSimulationAction,
LoadPreviousSimulationAction,
- DeletePreviousSimulationAction
+ DeletePreviousSimulationAction,
+ StartConversationAction
} from 'Types/ActionsTypes'
export function resetSimulation(): ResetSimulationAction {
@@ -17,6 +18,13 @@ export function deletePreviousSimulation(): DeletePreviousSimulationAction {
}
}
+export function startConversation(question: ?string): StartConversationAction {
+ return {
+ type: 'START_CONVERSATION',
+ ...(question ? { question } : {})
+ }
+}
+
// $FlowFixMe
export function setExample(name, situation, dottedName) {
return { type: 'SET_EXAMPLE', name, situation, dottedName }
diff --git a/source/components/QuickLink.js b/source/components/QuickLink.js
new file mode 100644
index 000000000..2240ffc64
--- /dev/null
+++ b/source/components/QuickLink.js
@@ -0,0 +1,40 @@
+/* @flow */
+import { startConversation } from 'Actions/actions'
+import React from 'react'
+import { connect } from 'react-redux'
+type Props = {
+ startConversation: (?string) => void
+}
+const QuickLink = ({ startConversation }: Props) => (
+ <>
+
+
+
+
+
+ >
+)
+export default connect(
+ null,
+ {
+ startConversation
+ }
+)(QuickLink)
diff --git a/source/components/Simu.js b/source/components/Simu.js
index 6afb9116a..f97cfbdbc 100644
--- a/source/components/Simu.js
+++ b/source/components/Simu.js
@@ -13,6 +13,7 @@ import * as Animate from 'Ui/animate'
import Conversation from './conversation/Conversation'
import Distribution from './Distribution'
import PaySlip from './PaySlip'
+import QuickLink from './QuickLink'
import './Simu.css'
import TargetSelection from './TargetSelection'
@@ -25,7 +26,7 @@ import TargetSelection from './TargetSelection'
nextSteps: state.conversationStarted && nextStepsSelector(state)
}),
{
- onSimulationContinued: () => ({ type: 'START_CONVERSATION' })
+ startConversation: () => ({ type: 'START_CONVERSATION' })
}
)
export default class Simu extends Component {
@@ -35,7 +36,7 @@ export default class Simu extends Component {
conversationStarted,
noUserInput,
nextSteps,
- onSimulationContinued,
+ startConversation,
blockingInputControls
} = this.props
const firstValidInputEntered =
@@ -64,50 +65,23 @@ export default class Simu extends Component {
fontSize: '110%',
justifyContent: 'space-evenly'
}}>
-
-
-
-
-
+
-
diff --git a/source/components/rule/Algorithm.css b/source/components/rule/Algorithm.css index 6ffed0288..c11fb40e9 100644 --- a/source/components/rule/Algorithm.css +++ b/source/components/rule/Algorithm.css @@ -4,6 +4,7 @@ .situationValue { display: none; + font-size: 110%; border-bottom-left-radius: 3px; font-weight: 400; color: black; @@ -31,7 +32,6 @@ #rule-rules .inlineExpression:not(.comparison):not(.negation) > .situationValue { - font-size: 90%; margin-left: 0.3em; margin-bottom: 0.6em; margin-top: 0.3em; @@ -44,9 +44,6 @@ margin: 1em 0; } -#rule-content { - font-size: 90%; -} #rule-rules #ruleValue { font-weight: 400; @@ -76,7 +73,7 @@ display: block; background: #34495e; color: white !important; - font-weight: 600; + font-weight: 500; border-bottom-right-radius: 3px; } .mecanism > .nodeHead .name::first-letter { @@ -86,7 +83,7 @@ bottom: 0; right: 0; position: absolute; - padding: 0.2em 1em; + padding: 0.2rem 1rem; border: 1px solid; border-color: inherit; font-weight: 600; @@ -109,7 +106,6 @@ } .mecanism .properties .key { - font-weight: 600; display: inline-block; margin-bottom: 0.6em; margin-right: 0.8em; @@ -131,7 +127,7 @@ .maximum .description, .composanteName { - font-weight: 600; + font-weight: 500; margin-bottom: 0.4em; margin-left: 1em; } @@ -165,8 +161,7 @@ .percentage .name { - font-size: 110%; - font-weight: 600; + font-weight: 500; } .inlineExpression .operator { @@ -199,7 +194,7 @@ padding: 0.1em 0.4em; } .barème table tr:first-child { - font-weight: 600; + font-weight: 500; } .barème table tr:nth-child(2n) { background: #f1f1f1; @@ -301,7 +296,6 @@ .inlineExpression.comparison > .situationValue, .inlineExpression.negation > .situationValue { order: -1; - font-size: 110% !important; } .mecanism.cond *:not(.nodeContent) > .variable .name > .situationValue, @@ -314,6 +308,5 @@ > .situationValue { margin-bottom: -5px; background-color: white; - font-size: 130% !important; margin-left: 0 !important; } diff --git a/source/components/rule/Rule.css b/source/components/rule/Rule.css index ff9155977..9bb683bd8 100644 --- a/source/components/rule/Rule.css +++ b/source/components/rule/Rule.css @@ -1,5 +1,4 @@ #rule { - font-size: 110%; height: 100%; padding-bottom: 10%; max-width: 45em; diff --git a/source/components/ui/Typography.css b/source/components/ui/Typography.css index c9779b409..041f2c412 100644 --- a/source/components/ui/Typography.css +++ b/source/components/ui/Typography.css @@ -42,6 +42,7 @@ h5, h6 { font-family: 'IBM Plex Sans', sans-serif; font-weight: normal; + line-height: initial; } h1, @@ -54,15 +55,10 @@ button { font-weight: normal; } -p, -ul { +body { line-height: 1.7rem; } -li { - margin-bottom: 1rem; -} - a { border: none; display: inline-block; diff --git a/source/components/ui/index.css b/source/components/ui/index.css index 3e8342785..8cda9b4d1 100644 --- a/source/components/ui/index.css +++ b/source/components/ui/index.css @@ -5,10 +5,10 @@ body { overflow-x: hidden; } -.ui__.container { - max-width: 800px; - margin: 0 auto; - padding: 1rem; + +button { + border: none; + border-radius: 0; } .ui__.answer-group { @@ -27,7 +27,8 @@ body { .ui__.container { max-width: 45em; - margin: 0 auto; + margin-right: auto; + margin-left: auto; padding: 0 0.6em; } diff --git a/source/engine/mecanismViews/Somme.css b/source/engine/mecanismViews/Somme.css index e17aee1f2..b2f56f841 100644 --- a/source/engine/mecanismViews/Somme.css +++ b/source/engine/mecanismViews/Somme.css @@ -31,7 +31,6 @@ padding: 0 0.4em; font-weight: 600; border: none !important; - font-size: 120%; color: black; } .somme .operator + .element { @@ -59,56 +58,10 @@ border-bottom: 1px solid rgba(51, 51, 80, 0.15); } -/* Specific to ResultsGrid.css. Somme.js and ResultsGrid.js should be merged */ -.resultsGrid table { - font-size: 90%; -} -.resultsGrid table a { - color: inherit; -} -.resultsGrid td { - line-height: 1.6em; - border: 1px solid #e3e3ee; -} -.resultsGrid .operator { - border-right-color: transparent; - margin-right: 0.4em; -} -.resultsGrid .element.category { - font-weight: 600; - font-size: 100%; -} -.resultsGrid .detailsRow .name { - padding-left: 1.2em; -} -.resultsGrid .detailsRow .name:hover { - color: #111; - text-decoration: underline; -} - -.resultsGrid .name { - font-size: 90%; -} -.resultsGrid .value { - font-weight: 700; - color: #031bd6; -} #sommeBase { text-align: center; } -.resultsGrid .annotation { - color: #333350; - border: 1px solid #333350; - background: #031bd61a; - font-weight: 600; - font-size: 95%; - padding: 0 0.6em; - margin-left: 0.3em; - border-radius: 0.2em; - white-space: nowrap; -} - .detailsRow { background: rgba(51, 51, 80, 0.02); } @@ -179,5 +132,4 @@ .nested .mecanism-somme__row { padding-left: 2em; border-top: 1px dashed rgba(51, 51, 80, 0.15); - font-size: 90%; } diff --git a/source/reducers/rootReducer.js b/source/reducers/rootReducer.js index 147c7e9d3..c3ca06601 100644 --- a/source/reducers/rootReducer.js +++ b/source/reducers/rootReducer.js @@ -1,12 +1,17 @@ +/* @flow */ + import { popularTargetNames } from 'Components/TargetSelection' import { defaultTo, without } from 'ramda' +// $FlowFixMe import reduceReducers from 'reduce-reducers' import { combineReducers } from 'redux' +// $FlowFixMe import { reducer as formReducer } from 'redux-form' import computeThemeColours from 'Ui/themeColours' import defaultLang from '../i18n' import inFranceAppReducer from './inFranceAppReducer' import storageReducer from './storageReducer' +import type { Action } from 'Types/ActionsTypes' // TODO : use context API instead function themeColours(state = computeThemeColours(), { type, colour }) { @@ -32,8 +37,8 @@ function currentExample(state = null, { type, situation, name, dottedName }) { } } -function conversationStarted(state = false, { type }) { - switch (type) { +function conversationStarted(state = false, action: Action) { + switch (action.type) { case 'START_CONVERSATION': return true case 'RESET_SIMULATION': @@ -62,13 +67,22 @@ function lang(state = defaultLang, { type, lang }) { } } -function conversationSteps( - state = { foldedSteps: [], currentQuestion: null }, - { type, name, step } -) { - if (type === 'RESET_SIMULATION') return { foldedSteps: [], unfolded: null } - if (type !== 'STEP_ACTION') return state +type ConversationSteps = {| + +foldedSteps: Array