From 8b28e2410283db90337058f18c9e8346f62c8646 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Thu, 15 Sep 2022 19:38:12 +0800 Subject: [PATCH] feat(nc-gui): delete stack modal + integrate with deleteStack function --- .../nc-gui/components/smartsheet/Kanban.vue | 39 +++++++++++++------ 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/packages/nc-gui/components/smartsheet/Kanban.vue b/packages/nc-gui/components/smartsheet/Kanban.vue index a1117c728c..e9b23af0ba 100644 --- a/packages/nc-gui/components/smartsheet/Kanban.vue +++ b/packages/nc-gui/components/smartsheet/Kanban.vue @@ -23,14 +23,23 @@ interface Attachment { } const meta = inject(MetaInj) + const view = inject(ActiveViewInj) + const reloadViewDataHook = inject(ReloadViewDataHookInj) + const openNewRecordFormHook = inject(OpenNewRecordFormHookInj, createEventHook()) const expandedFormDlg = ref(false) + const expandedFormRow = ref() + const expandedFormRowState = ref>() +const deleteStackVModel = ref(false) + +const stackToBeDeleted = ref('') + const { loadKanbanData, loadMoreKanbanData, @@ -44,6 +53,7 @@ const { groupingField, groupingFieldColumn, countByStack, + deleteStack, } = useKanbanViewData(meta, view as any) const { isUIAllowed } = useUIPermission() @@ -169,19 +179,23 @@ const kanbanListRef = (kanbanListElement: HTMLElement) => { } } -const collapseStack = () => { - // TODO: +const handleDeleteStackClick = (stackTitle: string) => { + deleteStackVModel.value = true + stackToBeDeleted.value = stackTitle } -const renameStack = () => { - // TODO: +const handleDeleteStackConfirmClick = async () => { + await deleteStack(stackToBeDeleted.value) + deleteStackVModel.value = false } -const deleteStack = () => { +const collapseStack = () => { // TODO: } -const deleteStackVModel = ref(false) +const renameStack = () => { + // TODO: +} openNewRecordFormHook?.on(async () => { const newRow = await addEmptyRow() @@ -190,6 +204,7 @@ openNewRecordFormHook?.on(async () => {
- Deleting this stack will also remove the select option from the `{{ groupingField }}`. The records will move to the - uncategorized stack. + Deleting this stack will also remove the select option `{{ stackToBeDeleted }}` from the `{{ groupingField }}`. The records + will move to the uncategorized stack.