Merge pull request #464 from betagouv/bug

🐛 Résolution d'une page blanche au clic sur un exemple dans /doc
pull/472/head
Mael 2019-02-13 18:08:56 +01:00 committed by GitHub
commit e99f44c709
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 44 additions and 31 deletions

View File

@ -1,28 +1,37 @@
import { T } from "Components";
import withColours from 'Components/utils/withColours';
import withLanguage from 'Components/utils/withLanguage';
import withSitePaths from 'Components/utils/withSitePaths';
import { getInputComponent } from 'Engine/generateQuestions';
import knownMecanisms from 'Engine/known-mecanisms.yaml';
import { createMarkdownDiv } from 'Engine/marked';
import { encodeRuleName, findRuleByDottedName, findRuleByNamespace } from 'Engine/rules';
import { compose, isEmpty, isNil } from 'ramda';
import React, { Component, Suspense } from 'react';
import emoji from 'react-easy-emoji';
import Helmet from 'react-helmet';
import { Trans, withTranslation } from 'react-i18next';
import { connect } from 'react-redux';
import { Link } from 'react-router-dom';
import { reduxForm } from 'redux-form';
import { exampleAnalysisSelector, flatRulesSelector, noUserInputSelector, ruleAnalysisSelector } from 'Selectors/analyseSelectors';
import Animate from 'Ui/animate';
import Montant from 'Ui/Montant';
import { AttachDictionary } from '../AttachDictionary';
import Algorithm from './Algorithm';
import Examples from './Examples';
import RuleHeader from './Header';
import References from './References';
import './Rule.css';
import { T } from 'Components'
import withColours from 'Components/utils/withColours'
import withLanguage from 'Components/utils/withLanguage'
import withSitePaths from 'Components/utils/withSitePaths'
import { getInputComponent } from 'Engine/generateQuestions'
import knownMecanisms from 'Engine/known-mecanisms.yaml'
import { createMarkdownDiv } from 'Engine/marked'
import {
encodeRuleName,
findRuleByDottedName,
findRuleByNamespace
} from 'Engine/rules'
import { compose, isEmpty, isNil } from 'ramda'
import React, { Component, Suspense } from 'react'
import emoji from 'react-easy-emoji'
import Helmet from 'react-helmet'
import { Trans, withTranslation } from 'react-i18next'
import { connect } from 'react-redux'
import { Link } from 'react-router-dom'
import { reduxForm } from 'redux-form'
import {
exampleAnalysisSelector,
flatRulesSelector,
noUserInputSelector,
ruleAnalysisSelector
} from 'Selectors/analyseSelectors'
import Animate from 'Ui/animate'
import Montant from 'Ui/Montant'
import { AttachDictionary } from '../AttachDictionary'
import Algorithm from './Algorithm'
import Examples from './Examples'
import RuleHeader from './Header'
import References from './References'
import './Rule.css'
let LazySource = React.lazy(() => import('./RuleSource'))
@ -49,7 +58,7 @@ export default compose(
valuesToShow,
sitePaths,
analysedExample,
analysedRule,
analysedRule
} = this.props,
flatRule = findRuleByDottedName(flatRules, dottedName)
let { type, name, title, description, question, ns, icon } = flatRule,
@ -69,10 +78,15 @@ export default compose(
) : (
<div id="rule">
<Animate.fromBottom>
<Helmet>
<title>{title}</title>
<meta name="description" content={description} />
</Helmet>
<Helmet
title={title}
meta={[
{
name: 'description',
content: description
}
]}
/>
<RuleHeader
{...{
ns,

View File

@ -122,7 +122,6 @@ let Tranche = ({
language
}) => {
let activated = trancheValue > 0
console.log(trancheValue, min, max)
return (
<tr className={classNames('tranche', { activated })}>
<td key="tranche">