1
0
Fork 0
mirror of https://github.com/betagouv/mon-entreprise synced 2025-02-09 05:15:02 +00:00
mon-entreprise/containers/Explorer.js
Mael Thomas 27357ec394 Traverser le graphe
Limitations :
- Nous nous arrêtons quand la variable n'est pas trouvée, il faudrait utiliser l'API actuel
- En fonction de la situation du state (variables d'input), il faut évaluer les conditions à la traversée du graphe pour éliminer les variables non appelables : rendre la traversée fainéante.

Sinon :
Introduction du mot clef 'exception' dans maladie pour le cas de l'Aslace Moselle agricole
2016-11-15 18:27:43 +01:00

41 lines
1.2 KiB
JavaScript

import React from 'react'
import {connect} from 'react-redux'
import TagNavigation from '../components/TagNavigation'
import Variables from '../components/Variables'
import * as actions from '../actions'
import {bindActionCreators} from 'redux'
import {tagsToSelectSelector, variablesSelector} from '../selectors/selectors'
class Explorer extends React.Component {
render() {
let {variables, selectedTags, selectedVariable, tagsToSelect, actions: {selectTag, resetTags, selectVariable}} = this.props
return (
<div>
<h1>Les prélèvements sociaux sur les salaires</h1>
<TagNavigation selectedTags={selectedTags} tagsToSelect={tagsToSelect} selectTag={selectTag} resetTags={resetTags}/>
<Variables variables={variables}
selectedTags={selectedTags} selectedVariable={selectedVariable}
selectVariable={selectVariable}/>
</div>
)
}
}
const mapStateToProps = state => (
{
selectedTags: state.selectedTags,
tagsToSelect: tagsToSelectSelector(state),
variables: variablesSelector(state),
selectedVariable: state.selectedVariable
}
)
const actionsToProps = dispatch => ({
actions: bindActionCreators(actions, dispatch)
})
const VariableExplorer = connect(mapStateToProps, actionsToProps)(Explorer)
export default VariableExplorer