From 39fd915265f3606211069c3e0ae1f49c4e4efc32 Mon Sep 17 00:00:00 2001 From: Mael Date: Tue, 2 Jul 2019 15:57:43 +0200 Subject: [PATCH] :bug: Dans targetSelection on ignore les objectifs secondaires --- source/components/TargetSelection.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/source/components/TargetSelection.js b/source/components/TargetSelection.js index cf3a8238c..412942f0e 100644 --- a/source/components/TargetSelection.js +++ b/source/components/TargetSelection.js @@ -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