From 1c7883d165fecd9dc063298e380306f4e223679a Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Thu, 15 Sep 2022 09:44:34 +0200 Subject: [PATCH] refactor(nc-gui): pass `showLoading` as prop to ColumnFilter --- .../components/smartsheet-toolbar/ColumnFilter.vue | 5 +++-- packages/nc-gui/components/webhook/Editor.vue | 8 +++++++- packages/nc-gui/composables/useViewFilters.ts | 10 +++++----- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/packages/nc-gui/components/smartsheet-toolbar/ColumnFilter.vue b/packages/nc-gui/components/smartsheet-toolbar/ColumnFilter.vue index 9094b60422..3a845b81d0 100644 --- a/packages/nc-gui/components/smartsheet-toolbar/ColumnFilter.vue +++ b/packages/nc-gui/components/smartsheet-toolbar/ColumnFilter.vue @@ -21,10 +21,11 @@ interface Props { parentId?: string autoSave: boolean hookId?: string + showLoading?: boolean modelValue?: Filter[] } -const { nested = false, parentId, autoSave = true, hookId = null, modelValue } = defineProps() +const { nested = false, parentId, autoSave = true, hookId = null, modelValue, showLoading = true } = defineProps() const emit = defineEmits(['update:filtersLength']) @@ -46,7 +47,7 @@ const { filters, deleteFilter, saveOrUpdate, loadFilters, addFilter, addFilterGr activeView, parentId, computed(() => autoSave), - reloadDataHook.trigger, + () => reloadDataHook.trigger(showLoading), modelValue || nestedFilters.value, !modelValue, ) diff --git a/packages/nc-gui/components/webhook/Editor.vue b/packages/nc-gui/components/webhook/Editor.vue index 9abdf91bc0..ec7ba57b89 100644 --- a/packages/nc-gui/components/webhook/Editor.vue +++ b/packages/nc-gui/components/webhook/Editor.vue @@ -606,7 +606,13 @@ onMounted(async () => { On Condition - + diff --git a/packages/nc-gui/composables/useViewFilters.ts b/packages/nc-gui/composables/useViewFilters.ts index 374bb6d701..45863e1a46 100644 --- a/packages/nc-gui/composables/useViewFilters.ts +++ b/packages/nc-gui/composables/useViewFilters.ts @@ -19,7 +19,7 @@ export function useViewFilters( view: Ref, parentId?: string, autoApply?: ComputedRef, - reloadData?: (showLoading?: boolean) => void, + reloadData?: () => void, currentFilters?: Filter[], isNestedRoot?: boolean, ) { @@ -110,7 +110,7 @@ export function useViewFilters( } } - reloadData?.(false) + reloadData?.() } catch (e: any) { console.log(e) message.error(await extractSdkResponseErrorMsg(e)) @@ -122,7 +122,7 @@ export function useViewFilters( if (nestedMode.value) { filters.value.splice(i, 1) filters.value = [...filters.value] - reloadData?.(false) + reloadData?.() } else { if (filter.id) { // if auto-apply disabled mark it as disabled @@ -133,7 +133,7 @@ export function useViewFilters( try { await $api.dbTableFilter.delete(filter.id) - reloadData?.(false) + reloadData?.() filters.value.splice(i, 1) } catch (e: any) { @@ -179,7 +179,7 @@ export function useViewFilters( message.error(await extractSdkResponseErrorMsg(e)) } - reloadData?.(false) + reloadData?.() } const addFilter = () => {