Browse Source

feat(nc-gui): reset state to avoid from showing the previous stacks when switching kanban views

pull/3818/head
Wing-Kam Wong 2 years ago
parent
commit
f2340424e0
  1. 13
      packages/nc-gui/components/smartsheet/Kanban.vue

13
packages/nc-gui/components/smartsheet/Kanban.vue

@ -12,6 +12,7 @@ import {
OpenNewRecordFormHookInj,
ReadonlyInj,
inject,
onMounted,
provide,
useKanbanViewData,
} from '#imports'
@ -161,9 +162,9 @@ const handleCollapseStack = async (stackIdx: number) => {
const handleExpandedFormCancel = () => {
// remove the empty record
formattedData.value['Uncategorized'].pop()
formattedData.value.Uncategorized.pop()
// decrease total count by 1
countByStack.value['Uncategorized'] -= 1
countByStack.value.Uncategorized -= 1
}
openNewRecordFormHook?.on(async (stackTitle) => {
@ -173,10 +174,16 @@ openNewRecordFormHook?.on(async (stackTitle) => {
[groupingField.value]: stackTitle,
}
// increase total count by 1
countByStack.value['Uncategorized'] += 1
countByStack.value.Uncategorized += 1
// open the expanded form
expandForm(newRow)
})
onMounted(() => {
// reset state to avoid from showing the previous stacks when switching kanban views
groupingFieldColOptions.value = []
formattedData.value = {}
})
</script>
<template>

Loading…
Cancel
Save