Browse Source

fix(gui-v2): allow shared form view publicly

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/3188/head
Pranav C 2 years ago
parent
commit
4fcae289b6
  1. 3
      packages/nc-gui-v2/composables/useSharedFormViewStore.ts
  2. 3
      packages/nc-gui-v2/middleware/auth.global.ts
  3. 2
      packages/nc-gui-v2/pages/[projectType]/form/[viewId].vue

3
packages/nc-gui-v2/composables/useSharedFormViewStore.ts

@ -113,10 +113,9 @@ const [useProvideSharedFormStore, useSharedFormStore] = useInjectionState((share
}
progress.value = true
const data:Record<string,any> = { ...(formState?.value ?? {}), ...(additionalState?.value || {}) }
const data: Record<string, any> = { ...(formState?.value ?? {}), ...(additionalState?.value || {}) }
const attachment: Record<string, any> = {}
for (const col of metas?.value?.[sharedFormView?.value?.fk_model_id as string]?.columns ?? []) {
if (col.uidt === UITypes.Attachment) {
attachment[`_${col.title}`] = data[col.title!]

3
packages/nc-gui-v2/middleware/auth.global.ts

@ -23,6 +23,9 @@ import { useGlobal } from '#imports'
export default defineNuxtRouteMiddleware((to, from) => {
const state = useGlobal()
/** if public allow */
if (to.meta.public) return
/** if shred base allow without validating */
if (to.params?.projectType === 'base') return

2
packages/nc-gui-v2/pages/[projectType]/form/[viewId].vue

@ -6,7 +6,7 @@ import { ActiveViewInj, FieldsInj, IsFormInj, IsPublicInj, MetaInj, ReloadViewDa
import { createEventHook, definePageMeta, provide, ref, useProvideSmartsheetStore, useRoute } from '#imports'
definePageMeta({
requiresAuth: false,
public: true,
})
const route = useRoute()

Loading…
Cancel
Save