Browse Source

fix(nc-gui): small changes in share form store

pull/7786/head
Ramesh Mane 9 months ago
parent
commit
d7729b5de5
  1. 14
      packages/nc-gui/composables/useSharedFormViewStore.ts
  2. 3
      packages/nc-gui/lib/types.ts

14
packages/nc-gui/composables/useSharedFormViewStore.ts

@ -30,6 +30,7 @@ import {
useProvideSmartsheetRowStore, useProvideSmartsheetRowStore,
useViewsStore, useViewsStore,
watch, watch,
PreFilledMode,
} from '#imports' } from '#imports'
import type { SharedViewMeta } from '#imports' import type { SharedViewMeta } from '#imports'
@ -65,6 +66,8 @@ const [useProvideSharedFormStore, useSharedFormStore] = useInjectionState((share
const { t } = useI18n() const { t } = useI18n()
const route = useRoute()
const formState = ref<Record<string, any>>({}) const formState = ref<Record<string, any>>({})
const { state: additionalState } = useProvideSmartsheetRowStore( const { state: additionalState } = useProvideSmartsheetRowStore(
@ -79,9 +82,14 @@ const [useProvideSharedFormStore, useSharedFormStore] = useInjectionState((share
const fieldRequired = (fieldName = 'This field') => const fieldRequired = (fieldName = 'This field') =>
helpers.withMessage(t('msg.error.fieldRequired', { value: fieldName }), required) helpers.withMessage(t('msg.error.fieldRequired', { value: fieldName }), required)
const formColumns = computed(() => const formColumns = computed(() => {
columns.value?.filter((c) => c.show).filter((col) => !isVirtualCol(col) || isLinksOrLTAR(col.uidt)), const filterdFormColumns = columns.value?.filter((c) => c.show).filter((col) => !isVirtualCol(col) || isLinksOrLTAR(col.uidt))
) // if (Object.keys(route.query).length && sharedViewMeta.value.preFilledMode !== PreFilledMode.Disabled) {
// }
return filterdFormColumns
})
const loadSharedView = async () => { const loadSharedView = async () => {
passwordError.value = null passwordError.value = null

3
packages/nc-gui/lib/types.ts

@ -2,7 +2,7 @@ import type { BaseType, ColumnType, FilterType, MetaType, PaginatedType, Roles,
import type { I18n } from 'vue-i18n' import type { I18n } from 'vue-i18n'
import type { Theme as AntTheme } from 'ant-design-vue/es/config-provider' import type { Theme as AntTheme } from 'ant-design-vue/es/config-provider'
import type { UploadFile } from 'ant-design-vue' import type { UploadFile } from 'ant-design-vue'
import type { ImportSource, ImportType, TabType } from './enums' import type { ImportSource, ImportType, PreFilledMode, TabType } from './enums'
import type { rolePermissions } from './acl' import type { rolePermissions } from './acl'
interface User { interface User {
@ -115,6 +115,7 @@ interface SharedViewMeta extends Record<string, any> {
theme?: Partial<ThemeConfig> theme?: Partial<ThemeConfig>
allowCSVDownload?: boolean allowCSVDownload?: boolean
rtl?: boolean rtl?: boolean
preFilledMode?: PreFilledMode
} }
interface SharedView { interface SharedView {

Loading…
Cancel
Save