Déplacement de l'affichage de la valeur de la règle

pull/337/head
Mael 2018-09-07 17:14:58 +02:00
parent 1cbc931df7
commit a93d3a1b34
4 changed files with 25 additions and 23 deletions

View File

@ -44,15 +44,6 @@
margin: 1em 0;
}
#rule-rules #ruleValue {
font-weight: 400;
text-align: center;
font-size: 200%;
color: inherit;
margin-bottom: 2em;
margin-top: 0.4em;
}
#declenchement > ul {
padding: 0;
list-style-type: none;

View File

@ -24,15 +24,6 @@ export default class Algorithm extends React.Component {
return (
<div id="algorithm">
<section id="rule-rules" className={classNames({ showValues })}>
{showValues && rule.nodeValue ? (
<div id="ruleValue">
<i className="fa fa-calculator" aria-hidden="true" />{' '}
{Intl.NumberFormat(language, {
style: 'currency',
currency: 'EUR'
}).format(rule.nodeValue)}
</div>
) : null}
<ShowValuesProvider value={showValues}>
{do {
// TODO ce let est incompréhensible !

View File

@ -25,3 +25,12 @@
h2 small {
font-size: 75%;
}
#rule #ruleValue {
font-weight: 400;
text-align: center;
font-size: 200%;
color: inherit;
margin-bottom: 1em;
margin-top: 0.4em;
}

View File

@ -24,6 +24,7 @@ import RuleHeader from './Header'
import References from './References'
import './Rule.css'
import { reduxForm } from 'redux-form'
import withLanguage from 'Components/utils/withLanguage'
@connect((state, props) => ({
currentExample: state.currentExample,
@ -33,6 +34,7 @@ import { reduxForm } from 'redux-form'
analysedExample: exampleAnalysisSelector(state, props)
}))
@translate()
@withLanguage
export default class Rule extends Component {
render() {
let {
@ -41,7 +43,8 @@ export default class Rule extends Component {
flatRules,
valuesToShow,
analysedExample,
analysedRule
analysedRule,
language
} = this.props,
flatRule = findRuleByDottedName(flatRules, dottedName)
@ -49,6 +52,7 @@ export default class Rule extends Component {
namespaceRules = findRuleByNamespace(flatRules, dottedName)
let displayedRule = analysedExample || analysedRule
let showValues = valuesToShow || currentExample
return (
<div id="rule">
@ -71,12 +75,19 @@ export default class Rule extends Component {
/>
<section id="rule-content">
{showValues && displayedRule.nodeValue ? (
<div id="ruleValue">
<i className="fa fa-calculator" aria-hidden="true" />{' '}
{Intl.NumberFormat(language, {
style: 'currency',
currency: 'EUR'
}).format(displayedRule.nodeValue)}
</div>
) : null}
{flatRule.question && <UserInput {...{ flatRules, dottedName }} />}
{flatRule.ns && (
<Algorithm
rule={displayedRule}
showValues={valuesToShow || currentExample}
/>
<Algorithm rule={displayedRule} showValues={showValues} />
)}
{flatRule.note && (
<section id="notes">