From e647d5ced8d649f75fca02cf583f86b104eb8375 Mon Sep 17 00:00:00 2001 From: NathanViaud <nathan.viaud@inria.fr> Date: Wed, 7 Jun 2023 13:28:13 +0200 Subject: [PATCH] Add repeat input action type --- src/shared/interfaces/undoRedo.interface.ts | 33 +++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/src/shared/interfaces/undoRedo.interface.ts b/src/shared/interfaces/undoRedo.interface.ts index 12bdb780..9480c72f 100644 --- a/src/shared/interfaces/undoRedo.interface.ts +++ b/src/shared/interfaces/undoRedo.interface.ts @@ -1,7 +1,8 @@ import { GraphEdge } from '@vue-flow/core'; +import { Form } from './form.interface'; export interface UndoRedoAction { - type: 'nodeMoved' | 'nodeAdded' | 'nodeRemoved' | 'nodeUpdated' | 'edgeAdded' | 'edgeUpdated' | 'edgeRemoved' | 'formUpdated'; + type: 'nodeMoved' | 'nodeAdded' | 'nodeRemoved' | 'nodeUpdated' | 'edgeAdded' | 'edgeUpdated' | 'edgeRemoved' | 'formUpdated' | 'formRepeatUpdated'; } export interface NodeMovedAction extends UndoRedoAction { @@ -40,4 +41,32 @@ export interface FormUpdatedAction extends UndoRedoAction { formValueId: string; oldValue: string; newValue: string; -} \ No newline at end of file +} + +export interface FormRepeatUpdatedAction { + type: 'formRepeatUpdated'; + nodeId: string; + elementId: string; + formValueId: string; + repeatId: string; + updateType: 'change' | 'add' | 'remove' | 'move'; +} + +export interface FormRepeatChangeAction extends FormRepeatUpdatedAction { + updateType: 'change'; + oldValue: string; + newValue: string; + index: number; +} + +export interface FormRepeatMutateAction extends FormRepeatUpdatedAction { + updateType: 'add' | 'remove'; + value: string; + index: number; +} + +export interface FormRepeatMoveAction extends FormRepeatUpdatedAction { + updateType: 'move'; + oldIndex: number; + newIndex: number; +} -- GitLab