From f0cedef39d825727486578c20c773f7d453be377 Mon Sep 17 00:00:00 2001 From: NathanViaud <nathan.viaud@inria.fr> Date: Thu, 8 Jun 2023 09:13:29 +0200 Subject: [PATCH] Adding checkbox inside cards to undo actions --- .../forms/components/inputs/RepeatInput.vue | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/features/forms/components/inputs/RepeatInput.vue b/src/features/forms/components/inputs/RepeatInput.vue index eafaa298..6dd1c70b 100644 --- a/src/features/forms/components/inputs/RepeatInput.vue +++ b/src/features/forms/components/inputs/RepeatInput.vue @@ -20,7 +20,7 @@ const emit = defineEmits<{ type: string, id: string, index: number, - value: { oldValue: string, newValue: string } + value: { oldValue: string | boolean, newValue: string | boolean } }) }>(); @@ -93,6 +93,16 @@ function onCheck(value, id: string, index: number) { id, index }); + + emit('add-undo-action', { + type: 'change', + value: { + oldValue: !value, + newValue: value + }, + id, + index + }); } function onClick(index: number, action: SideAction | null) { @@ -104,7 +114,7 @@ function onClick(index: number, action: SideAction | null) { } } -function onAddUndoAction(value: { oldValue: string, newValue: string }, id: string, index: number) { +function onAddUndoAction(value: { oldValue: string | boolean, newValue: string | boolean }, id: string, index: number) { emit('add-undo-action', { type: 'change', value, -- GitLab