From c201b04012ec47f478702f343a263e92db81a01d Mon Sep 17 00:00:00 2001 From: Mael Date: Wed, 21 Mar 2018 12:02:24 +0100 Subject: [PATCH] :sparkles: Nettoyage de TargetSelection --- source/components/TargetSelection.css | 6 - source/components/TargetSelection.js | 122 ++++++++---------- .../components/conversation/FormDecorator.js | 9 +- source/components/pages/Home.js | 1 - source/containers/App.dev.js | 3 + 5 files changed, 65 insertions(+), 76 deletions(-) diff --git a/source/components/TargetSelection.css b/source/components/TargetSelection.css index 8fd4797b4..60cfa049c 100644 --- a/source/components/TargetSelection.css +++ b/source/components/TargetSelection.css @@ -109,11 +109,5 @@ border: none; font-size: 120%; vertical-align: middle; } -#targetSelection .valueTypeIcon { - display: none; - margin: 0 0.4em; - font-size: 80%; - opacity: 0.5; -} /* Autre idée pour styler les checkboxes https://codepen.io/KenanYusuf/pen/PZKEKd */ diff --git a/source/components/TargetSelection.js b/source/components/TargetSelection.js index 4bbd5078c..442a01e0d 100644 --- a/source/components/TargetSelection.js +++ b/source/components/TargetSelection.js @@ -1,28 +1,15 @@ import React, { Component } from 'react' import { Trans, translate } from 'react-i18next' -import { connect } from 'react-redux' +import formValueTypes from 'Components/conversation/formValueTypes' import { rules, findRuleByName } from 'Engine/rules' -import { - reject, - propEq, - curry, - pipe, - equals, - filter, - contains, - length, - without, - append, - ifElse -} from 'ramda' -import { Link } from 'react-router-dom' +import { propEq, contains, without, curry, append, ifElse } from 'ramda' import './TargetSelection.css' import BlueButton from './BlueButton' import { Field, reduxForm, formValueSelector } from 'redux-form' import { connect } from 'react-redux' import { RuleValue } from './rule/RuleValueVignette' import classNames from 'classnames' - +import { buildValidationFunction } from './conversation/FormDecorator' export let salaries = ['salaire total', 'salaire de base', 'salaire net'] export let popularTargetNames = [...salaries, 'aides employeur'] @@ -91,7 +78,6 @@ export default class TargetSelection extends Component { renderOutputList() { let popularTargets = popularTargetNames.map(curry(findRuleByName)(flatRules)), { - targets, conversationTargetNames, textColourOnWhite, setConversationTargets @@ -157,55 +143,15 @@ export default class TargetSelection extends Component { } {s.title || s.name} - - {this.state.activeInput === s.dottedName ? ( - <> - - {this.props.targets.length > 0 && ( -