Browse Source

fix: missing undo/redo scopes

Signed-off-by: mertmit <mertmit99@gmail.com>
pull/5332/head
mertmit 2 years ago
parent
commit
7e8260c9a1
  1. 1
      packages/nc-gui/components/smartsheet/toolbar/FieldsMenu.vue
  2. 3
      packages/nc-gui/components/smartsheet/toolbar/StackedBy.vue
  3. 5
      packages/nc-gui/composables/useViewFilters.ts
  4. 5
      packages/nc-gui/composables/useViewSorts.ts

1
packages/nc-gui/components/smartsheet/toolbar/FieldsMenu.vue

@ -190,6 +190,7 @@ const coverImageColumnId = computed({
fn: await updateCoverImage,
args: [val],
},
scope: defineViewScope({ view: activeView.value }),
})
await updateCoverImage(val)

3
packages/nc-gui/components/smartsheet/toolbar/StackedBy.vue

@ -33,7 +33,7 @@ const { fields, loadViewColumns, metaColumnById } = useViewColumns(activeView, m
const { kanbanMetaData, loadKanbanMeta, loadKanbanData, updateKanbanMeta, groupingField } = useKanbanViewStoreOrThrow()
const { addUndo } = useUndoRedo()
const { addUndo, defineViewScope } = useUndoRedo()
const open = ref(false)
@ -71,6 +71,7 @@ const groupingFieldColumnId = computed({
fn: await updateGroupingField,
args: [val],
},
scope: defineViewScope({ view: activeView.value }),
})
await updateGroupingField(val)

5
packages/nc-gui/composables/useViewFilters.ts

@ -46,7 +46,7 @@ export function useViewFilters(
const { metas } = useMetas()
const { addUndo, clone } = useUndoRedo()
const { addUndo, clone, defineViewScope } = useUndoRedo()
const _filters = ref<Filter[]>([])
@ -274,6 +274,7 @@ export function useViewFilters(
},
args: [Object.keys(delta)[0], filter[Object.keys(delta)[0] as keyof Filter]],
},
scope: defineViewScope({ view: activeView.value }),
})
}
}
@ -327,6 +328,7 @@ export function useViewFilters(
},
args: [i],
},
scope: defineViewScope({ view: activeView.value }),
})
}
// if shared or sync permission not allowed simply remove it from array
@ -380,6 +382,7 @@ export function useViewFilters(
},
args: [],
},
scope: defineViewScope({ view: activeView.value }),
})
}

5
packages/nc-gui/composables/useViewSorts.ts

@ -27,7 +27,7 @@ export function useViewSorts(view: Ref<ViewType | undefined>, reloadData?: () =>
const { isSharedBase } = storeToRefs(useProject())
const { addUndo, clone } = useUndoRedo()
const { addUndo, clone, defineViewScope } = useUndoRedo()
const reloadHook = inject(ReloadViewDataHookInj)
@ -99,6 +99,7 @@ export function useViewSorts(view: Ref<ViewType | undefined>, reloadData?: () =>
},
args: [Object.keys(delta)[0], sort[Object.keys(delta)[0]]],
},
scope: defineViewScope({ view: view.value }),
})
}
}
@ -154,6 +155,7 @@ export function useViewSorts(view: Ref<ViewType | undefined>, reloadData?: () =>
},
args: [clone(sort), i],
},
scope: defineViewScope({ view: view.value }),
})
}
@ -193,6 +195,7 @@ export function useViewSorts(view: Ref<ViewType | undefined>, reloadData?: () =>
},
args: [],
},
scope: defineViewScope({ view: view.value }),
})
}

Loading…
Cancel
Save