diff --git a/packages/nc-gui/components/smartsheet/Form.vue b/packages/nc-gui/components/smartsheet/Form.vue index 9dbb379ce3..e7aa20daf9 100644 --- a/packages/nc-gui/components/smartsheet/Form.vue +++ b/packages/nc-gui/components/smartsheet/Form.vue @@ -214,12 +214,26 @@ async function submitForm() { submitted.value = true } +async function getPreFilledLink() { + if (isLocked.value || !isUIAllowed('dataInsert')) return + + const preFilledData = { ...formState, ...state.value } + + console.log('preFilled Data', preFilledData) + + for (const c of visibleColumns.value) { + if (c.title && preFilledData[c.title] && preFilledData[c.title].trim()) { + + } + } +} + async function clearForm() { if (isLocked.value || !isUIAllowed('dataInsert')) return formState = reactive>({}) state.value = {} - await formRef.value.clearValidate() + await formRef.value?.clearValidate() reloadEventHook.trigger() } @@ -566,6 +580,7 @@ watch(submitted, (v) => { const intvl = setInterval(() => { if (--secondsRemain.value < 0) { submitted.value = false + clearForm() clearInterval(intvl) } }, 1000) @@ -736,7 +751,16 @@ useEventListener(
- + {{ $t('activity.submitAnotherForm') }}
@@ -1289,18 +1313,31 @@ useEventListener( > {{ $t('activity.clearForm') }} - - {{ $t('general.submit') }} - +
+ + {{ $t('activity.getPreFilledLink') }} + + + {{ $t('general.submit') }} + +
diff --git a/packages/nc-gui/composables/useSharedFormViewStore.ts b/packages/nc-gui/composables/useSharedFormViewStore.ts index b37d6ac59a..072df3b768 100644 --- a/packages/nc-gui/composables/useSharedFormViewStore.ts +++ b/packages/nc-gui/composables/useSharedFormViewStore.ts @@ -349,7 +349,7 @@ const [useProvideSharedFormStore, useSharedFormStore] = useInjectionState((share if ( user?.id && user?.email && - queryOptions.includes(user.email) && + (queryOptions.includes(user.email) || queryOptions.includes(user.id)) && (limitOptions[user.id] ? limitOptions[user.id]?.show : parseProp(c.meta).isLimitOption diff --git a/packages/nc-gui/lang/en.json b/packages/nc-gui/lang/en.json index 92d2dbe81d..0d6151e040 100644 --- a/packages/nc-gui/lang/en.json +++ b/packages/nc-gui/lang/en.json @@ -934,7 +934,8 @@ "locked": "Lock pre-filled fields as read-only", "hidden": "Hide pre-filled fields", "lockedFieldTooltip": "Pre-filled value" - } + }, + "getPreFilledLink": "Get Pre-filled Link" }, "tooltip": { "reachedSourceLimit": "Limited to only one data source for the moment",