+
diff --git a/packages/nc-gui/components/smartsheet/toolbar/FieldsMenu.vue b/packages/nc-gui/components/smartsheet/toolbar/FieldsMenu.vue
index 07fa87a44d..d2b6eda8cb 100644
--- a/packages/nc-gui/components/smartsheet/toolbar/FieldsMenu.vue
+++ b/packages/nc-gui/components/smartsheet/toolbar/FieldsMenu.vue
@@ -16,6 +16,7 @@ import {
resolveComponent,
useMenuCloseOnEsc,
useNuxtApp,
+ useSmartsheetStoreOrThrow,
useViewColumns,
watch,
} from '#imports'
@@ -46,8 +47,17 @@ const {
hideAll,
saveOrUpdate,
metaColumnById,
+ loadViewColumns,
} = useViewColumns(activeView, meta, () => reloadDataHook.trigger())
+const { eventBus } = useSmartsheetStoreOrThrow()
+
+eventBus.on((event) => {
+ if (event === SmartsheetStoreEvents.FIELD_RELOAD) {
+ loadViewColumns()
+ }
+})
+
watch(
sortedAndFilteredFields,
(v) => {
@@ -56,7 +66,7 @@ watch(
{ immediate: true },
)
-const isAnyFieldHidden = computed(() => filteredFieldList.value?.some((field) => !field.show))
+const numberOfHiddenFields = computed(() => filteredFieldList.value?.filter((field) => !field.show)?.length)
const onMove = (_event: { moved: { newIndex: number } }) => {
// todo : sync with server
@@ -128,7 +138,7 @@ useMenuCloseOnEsc(open)
-
+
diff --git a/packages/nc-gui/components/smartsheet/toolbar/SortListMenu.vue b/packages/nc-gui/components/smartsheet/toolbar/SortListMenu.vue
index 26f3791611..c49310ea12 100644
--- a/packages/nc-gui/components/smartsheet/toolbar/SortListMenu.vue
+++ b/packages/nc-gui/components/smartsheet/toolbar/SortListMenu.vue
@@ -10,6 +10,7 @@ import {
inject,
ref,
useMenuCloseOnEsc,
+ useSmartsheetStoreOrThrow,
useViewSorts,
watch,
} from '#imports'
@@ -19,8 +20,16 @@ const view = inject(ActiveViewInj, ref())
const isLocked = inject(IsLockedInj, ref(false))
const reloadDataHook = inject(ReloadViewDataHookInj)
+const { eventBus } = useSmartsheetStoreOrThrow()
+
const { sorts, saveOrUpdate, loadSorts, addSort, deleteSort } = useViewSorts(view, () => reloadDataHook?.trigger())
+eventBus.on((event) => {
+ if (event === SmartsheetStoreEvents.SORT_RELOAD) {
+ loadSorts()
+ }
+})
+
const columns = computed(() => meta.value?.columns || [])
const columnByID = computed(() =>
@@ -54,6 +63,8 @@ useMenuCloseOnEsc(open)
{{ $t('activity.sort') }}
+
+
{{ sorts.length }}
diff --git a/packages/nc-gui/composables/useColumnCreateStore.ts b/packages/nc-gui/composables/useColumnCreateStore.ts
index c51f40bdb1..047e127dd9 100644
--- a/packages/nc-gui/composables/useColumnCreateStore.ts
+++ b/packages/nc-gui/composables/useColumnCreateStore.ts
@@ -1,5 +1,5 @@
import clone from 'just-clone'
-import type { ColumnType, TableType } from 'nocodb-sdk'
+import type { ColumnReqType, ColumnType, TableType } from 'nocodb-sdk'
import { UITypes } from 'nocodb-sdk'
import type { Ref } from 'vue'
import {
@@ -191,7 +191,7 @@ const [useProvideColumnCreateStore, useColumnCreateStore] = createInjectionState
if (cdf) formState.value.cdf = formState.value.cdf || null
}
- const addOrUpdate = async (onSuccess: () => void) => {
+ const addOrUpdate = async (onSuccess: () => void, columnPosition?: Pick