diff --git a/packages/nc-gui/components/smartsheet/toolbar/ShareView.vue b/packages/nc-gui/components/smartsheet/toolbar/ShareView.vue index 9c241003f3..d5c0cb367a 100644 --- a/packages/nc-gui/components/smartsheet/toolbar/ShareView.vue +++ b/packages/nc-gui/components/smartsheet/toolbar/ShareView.vue @@ -16,21 +16,7 @@ import { useUIPermission, watch, } from '#imports' -import type { ThemeConfig } from '~/lib' - -interface SharedViewMeta extends Record { - surveyMode?: boolean - theme?: Partial - allowCSVDownload?: boolean -} - -interface SharedView { - uuid?: string - id: string - password?: string - type?: ViewTypes - meta: SharedViewMeta -} +import type { SharedView } from '~/lib' const { theme } = useTheme() @@ -73,7 +59,10 @@ const surveyMode = computed({ const viewTheme = computed({ get: () => !!shared.value.meta.theme, set: (hasTheme) => { - shared.value.meta = { ...shared.value.meta, theme: hasTheme ? { ...theme.value } : undefined } + shared.value.meta = { + ...shared.value.meta, + theme: hasTheme ? { ...theme.value } : undefined, + } saveTheme() }, }) diff --git a/packages/nc-gui/composables/useSharedFormViewStore.ts b/packages/nc-gui/composables/useSharedFormViewStore.ts index 6ef566ce8b..3e220dd844 100644 --- a/packages/nc-gui/composables/useSharedFormViewStore.ts +++ b/packages/nc-gui/composables/useSharedFormViewStore.ts @@ -18,6 +18,7 @@ import { useProvideSmartsheetRowStore, watch, } from '#imports' +import type { SharedViewMeta } from '~/lib' const [useProvideSharedFormStore, useSharedFormStore] = useInjectionState((sharedViewId: string) => { const progress = ref(false) @@ -34,7 +35,7 @@ const [useProvideSharedFormStore, useSharedFormStore] = useInjectionState((share const sharedFormView = ref() const meta = ref() const columns = ref<(ColumnType & { required?: boolean; show?: boolean; label?: string })[]>() - const sharedViewMeta = ref({}) + const sharedViewMeta = ref({}) const formResetHook = createEventHook() const { api, isLoading } = useApi() diff --git a/packages/nc-gui/lib/types.ts b/packages/nc-gui/lib/types.ts index fecfd97e68..7635873cb8 100644 --- a/packages/nc-gui/lib/types.ts +++ b/packages/nc-gui/lib/types.ts @@ -1,4 +1,4 @@ -import type { FilterType } from 'nocodb-sdk' +import type { FilterType, ViewTypes } from 'nocodb-sdk' import type { I18n } from 'vue-i18n' import type { Theme as AntTheme } from 'ant-design-vue/es/config-provider' import type { ProjectRole, Role, TabType } from './enums' @@ -70,3 +70,17 @@ export interface TabItem { viewTitle?: string viewId?: string } + +export interface SharedViewMeta extends Record { + surveyMode?: boolean + theme?: Partial + allowCSVDownload?: boolean +} + +export interface SharedView { + uuid?: string + id: string + password?: string + type?: ViewTypes + meta: SharedViewMeta +}