From dd5d0ffc7bade421a12777b69babbc4c7ee1ffec Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 9 Dec 2021 16:29:22 +0000 Subject: [PATCH] Add output context to duplicate row action --- .../PropertyControls/EventsEditor/actions/index.js | 6 ++++++ packages/client/src/utils/buttonActions.js | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/index.js b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/index.js index 286dc677c6..3931ebfaaf 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/index.js +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/index.js @@ -37,6 +37,12 @@ export const getAvailableActions = (getAllActions = false) => { { name: "Duplicate Row", component: DuplicateRow, + context: [ + { + label: "Duplicated row", + value: "row", + }, + ], }, { name: "Delete Row", diff --git a/packages/client/src/utils/buttonActions.js b/packages/client/src/utils/buttonActions.js index 3a8ac63411..b5441bc8b6 100644 --- a/packages/client/src/utils/buttonActions.js +++ b/packages/client/src/utils/buttonActions.js @@ -46,7 +46,10 @@ const duplicateRowHandler = async (action, context) => { } delete draft._id delete draft._rev - await saveRow(draft) + const row = await saveRow(draft) + return { + row, + } } }