From 985e5d352793d1b3e1981d004b6f494bfbb049bf Mon Sep 17 00:00:00 2001 From: Fabio Di Stasio Date: Tue, 19 Jul 2022 17:48:51 +0200 Subject: [PATCH] feat: context menu option to duplicate a table row --- src/renderer/components/ForeignKeySelect.vue | 8 +- src/renderer/components/ModalFakerRows.vue | 77 +++++++++++-------- .../components/WorkspaceTabQueryTable.vue | 18 ++++- .../WorkspaceTabQueryTableContext.vue | 27 ++++++- src/renderer/components/WorkspaceTabTable.vue | 8 +- 5 files changed, 100 insertions(+), 38 deletions(-) diff --git a/src/renderer/components/ForeignKeySelect.vue b/src/renderer/components/ForeignKeySelect.vue index 906308e5..0e126584 100644 --- a/src/renderer/components/ForeignKeySelect.vue +++ b/src/renderer/components/ForeignKeySelect.vue @@ -13,7 +13,7 @@ diff --git a/src/renderer/components/WorkspaceTabTable.vue b/src/renderer/components/WorkspaceTabTable.vue index ee58bca4..57492e91 100644 --- a/src/renderer/components/WorkspaceTabTable.vue +++ b/src/renderer/components/WorkspaceTabTable.vue @@ -153,12 +153,14 @@ :element-type="elementType" @update-field="updateField" @delete-selected="deleteSelected" + @duplicate-row="showFakerModal" @hard-sort="hardSort" /> { return getWorkspace(props.connection.uid); @@ -329,13 +332,16 @@ const pageChange = (direction: 'prev' | 'next') => { page.value--; }; -const showFakerModal = () => { +// eslint-disable-next-line @typescript-eslint/no-explicit-any +const showFakerModal = (row?: any) => { if (isQuering.value) return; isFakerModal.value = true; + rowToDuplicate.value = row; }; const hideFakerModal = () => { isFakerModal.value = false; + rowToDuplicate.value = null; }; const onKey = (e: KeyboardEvent) => {