🐛 Dans targetSelection on ignore les objectifs secondaires

pull/481/head
Mael 2019-07-02 15:57:43 +02:00
parent 58963303e2
commit 39fd915265
1 changed files with 7 additions and 3 deletions

View File

@ -37,7 +37,9 @@ export default compose(
analysis: analysisWithDefaultsSelector(state),
flatRules: flatRulesSelector(state),
activeInput: state.activeTargetInput,
objectifs: state.simulation?.config.objectifs || []
objectifs: state.simulation?.config.objectifs || [],
secondaryObjectives:
state.simulation?.config['objectifs secondaires'] || []
}),
dispatch => ({
setFormValue: (field, name) =>
@ -52,9 +54,11 @@ export default compose(
initialRender: true
}
getTargets() {
let { objectifs, analysis } = this.props
let { secondaryObjectives, analysis } = this.props
if (!analysis) return []
return objectifs.map(o => analysis.targets.find(t => t.dottedName === o))
return analysis.targets.filter(
t => !secondaryObjectives.includes(t.dottedName)
)
}
componentDidMount() {
const props = this.props