From 089d91a84c4f4f52a0960b2e00f5c2606a5badc2 Mon Sep 17 00:00:00 2001 From: Teddy Cornaut Date: Mon, 31 Aug 2020 13:18:39 +0200 Subject: [PATCH] Suppression des options OK + CSS --- .../OptionsSection.tsx | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/client/src/components/DecisionSupportFilePage/OptionsSection.tsx b/client/src/components/DecisionSupportFilePage/OptionsSection.tsx index 766eb0f..a87e4a7 100644 --- a/client/src/components/DecisionSupportFilePage/OptionsSection.tsx +++ b/client/src/components/DecisionSupportFilePage/OptionsSection.tsx @@ -65,6 +65,14 @@ export const OptionsSection: FunctionComponent = ({ dsf, up setState(state => ({ ...state, changed: true, section: { ...state.section, options }})); }; + const onRemoveOptionClick = (id: string, evt: MouseEvent) => { + if(confirm('Voulez-vous supprimer cette option ?')){ + var options = JSON.parse(JSON.stringify(state.section.options)) + options.splice(id, 1); + setState(state => ({ ...state, changed: true, section: { ...state.section, options }})); + } + }; + return (

Explorer les options

@@ -86,7 +94,7 @@ export const OptionsSection: FunctionComponent = ({ dsf, up @@ -100,7 +108,7 @@ export const OptionsSection: FunctionComponent = ({ dsf, up - -