Browse Source

fix: undo/redo expanded row on kanban view

Signed-off-by: mertmit <mertmit99@gmail.com>
pull/5332/head
mertmit 2 years ago
parent
commit
19c968fcfb
  1. 16
      packages/nc-gui/composables/useExpandedFormStore.ts

16
packages/nc-gui/composables/useExpandedFormStore.ts

@ -170,6 +170,10 @@ const [useProvideExpandedFormStore, useExpandedFormStore] = useInjectionState((m
const pkData = rowPkData(row.row, meta.value?.columns as ColumnType[]) const pkData = rowPkData(row.row, meta.value?.columns as ColumnType[])
row.row = { ...pkData, ...row.row } row.row = { ...pkData, ...row.row }
await $api.dbTableRow.create('noco', project.value.title as string, meta.value.title, row.row) await $api.dbTableRow.create('noco', project.value.title as string, meta.value.title, row.row)
if (activeView.value?.type === ViewTypes.KANBAN) {
const { loadKanbanData } = useKanbanViewStoreOrThrow()
await loadKanbanData()
}
reloadTrigger?.trigger() reloadTrigger?.trigger()
}, },
args: [clone(row.value)], args: [clone(row.value)],
@ -186,6 +190,10 @@ const [useProvideExpandedFormStore, useExpandedFormStore] = useInjectionState((m
if (res.message) { if (res.message) {
throw new Error(res.message) throw new Error(res.message)
} }
if (activeView.value?.type === ViewTypes.KANBAN) {
const { loadKanbanData } = useKanbanViewStoreOrThrow()
await loadKanbanData()
}
reloadTrigger?.trigger() reloadTrigger?.trigger()
}, },
args: [id], args: [id],
@ -223,6 +231,10 @@ const [useProvideExpandedFormStore, useExpandedFormStore] = useInjectionState((m
redo: { redo: {
fn: async (id: string, data: Record<string, any>) => { fn: async (id: string, data: Record<string, any>) => {
await $api.dbTableRow.update(NOCO, project.value.title as string, meta.value.title, id, data) await $api.dbTableRow.update(NOCO, project.value.title as string, meta.value.title, id, data)
if (activeView.value?.type === ViewTypes.KANBAN) {
const { loadKanbanData } = useKanbanViewStoreOrThrow()
await loadKanbanData()
}
reloadTrigger?.trigger() reloadTrigger?.trigger()
}, },
args: [id, clone(updateOrInsertObj)], args: [id, clone(updateOrInsertObj)],
@ -230,6 +242,10 @@ const [useProvideExpandedFormStore, useExpandedFormStore] = useInjectionState((m
undo: { undo: {
fn: async (id: string, data: Record<string, any>) => { fn: async (id: string, data: Record<string, any>) => {
await $api.dbTableRow.update(NOCO, project.value.title as string, meta.value.title, id, data) await $api.dbTableRow.update(NOCO, project.value.title as string, meta.value.title, id, data)
if (activeView.value?.type === ViewTypes.KANBAN) {
const { loadKanbanData } = useKanbanViewStoreOrThrow()
await loadKanbanData()
}
reloadTrigger?.trigger() reloadTrigger?.trigger()
}, },
args: [id, clone(undoObject)], args: [id, clone(undoObject)],

Loading…
Cancel
Save