From 59a64d65732d3dd74d08b6bcc545f1d6e94f3b88 Mon Sep 17 00:00:00 2001 From: Mael Thomas Date: Mon, 25 Jul 2016 21:58:11 +0200 Subject: [PATCH] Display higher order variables only, filterable by tag Use Ramda.js [data] Rename values to historique Introduce the selectedVariable full screen view --- .eslintrc | 1 + actions.js | 8 +- components/SelectedVariable.js | 30 +++++ components/TagNavigation.js | 2 +- components/Variables.js | 43 ++++--- containers/App.css | 30 ++++- containers/Explorer.js | 16 +-- model.js | 106 ++++++++++-------- package.json | 1 + .../cdd/majoration_chomage.yaml | 2 +- .../cotisations/agff.yaml | 20 ++-- .../cotisations/agirc.yaml | 4 +- .../cotisations/ags.yaml | 2 +- .../cotisations/apec.yaml | 8 +- .../cotisations/arrco.yaml | 14 +-- .../cotisations/chomage.yaml | 19 +++- .../contribution_solidarité_autonomie.yaml | 2 +- .../cotisation_exceptionnelle_temporaire.yaml | 4 +- .../cotisations/maladie.yaml | 8 +- .../participation_effort_construction.yaml | 2 +- .../cotisations/taxe_apprentissage.yaml | 18 +-- .../cotisations/vieillesse.yaml | 13 ++- reducers.js | 14 ++- selectors.js | 48 +++++--- 24 files changed, 267 insertions(+), 148 deletions(-) create mode 100644 components/SelectedVariable.js diff --git a/.eslintrc b/.eslintrc index f89062a03..bb5289c87 100644 --- a/.eslintrc +++ b/.eslintrc @@ -24,6 +24,7 @@ parser: babel-eslint env: browser: true commonjs: true + es6: true extends: - eslint:recommended - plugin:react/recommended diff --git a/actions.js b/actions.js index 74949ba98..4411336ef 100644 --- a/actions.js +++ b/actions.js @@ -1,5 +1,11 @@ -export const SELECT_TAG = 'SELECT_TAG' +export let SELECT_TAG = 'SELECT_TAG' export function selectTag(tagName, tagValue) { return {type: SELECT_TAG, tagName, tagValue} } + +export let SELECT_VARIABLE = 'SELECT_VARIABLE' + +export function selectVariable(name) { + return {type: SELECT_VARIABLE, name} +} diff --git a/components/SelectedVariable.js b/components/SelectedVariable.js new file mode 100644 index 000000000..4836036ee --- /dev/null +++ b/components/SelectedVariable.js @@ -0,0 +1,30 @@ +import React, { Component } from 'react' + +export default class SelectedVariable extends Component { + render() { + let { + variable: { + name, + first: { + description + }, + tags + }, + selectedTags + } = this.props + return ( +
+

{name}

+

{description}

+ +
) + } +} diff --git a/components/TagNavigation.js b/components/TagNavigation.js index 2a2fdd5e6..5c1f77da2 100644 --- a/components/TagNavigation.js +++ b/components/TagNavigation.js @@ -8,7 +8,7 @@ export default class TagNavigation extends React.Component {
{selectedTags.length > 0 &&