Browse Source

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

pull/7786/head
Ramesh Mane 10 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,
useViewsStore,
watch,
PreFilledMode,
} from '#imports'
import type { SharedViewMeta } from '#imports'
@ -65,6 +66,8 @@ const [useProvideSharedFormStore, useSharedFormStore] = useInjectionState((share
const { t } = useI18n()
const route = useRoute()
const formState = ref<Record<string, any>>({})
const { state: additionalState } = useProvideSmartsheetRowStore(
@ -79,9 +82,14 @@ const [useProvideSharedFormStore, useSharedFormStore] = useInjectionState((share
const fieldRequired = (fieldName = 'This field') =>
helpers.withMessage(t('msg.error.fieldRequired', { value: fieldName }), required)
const formColumns = computed(() =>
columns.value?.filter((c) => c.show).filter((col) => !isVirtualCol(col) || isLinksOrLTAR(col.uidt)),
)
const formColumns = computed(() => {
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 () => {
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 { Theme as AntTheme } from 'ant-design-vue/es/config-provider'
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'
interface User {
@ -115,6 +115,7 @@ interface SharedViewMeta extends Record<string, any> {
theme?: Partial<ThemeConfig>
allowCSVDownload?: boolean
rtl?: boolean
preFilledMode?: PreFilledMode
}
interface SharedView {

Loading…
Cancel
Save