|
|
@ -106,8 +106,10 @@ function isDbRequired(column: Record<string, any>) { |
|
|
|
// primary column |
|
|
|
// primary column |
|
|
|
(column.pk && !column.ai && !column.cdf) |
|
|
|
(column.pk && !column.ai && !column.cdf) |
|
|
|
if (column.uidt === UITypes.LinkToAnotherRecord && column.colOptions.type === RelationTypes.BELONGS_TO) { |
|
|
|
if (column.uidt === UITypes.LinkToAnotherRecord && column.colOptions.type === RelationTypes.BELONGS_TO) { |
|
|
|
const col = columns.value.find((c: Record<string, any>) => c.id === column.colOptions.fk_child_column_id) as Record<string, |
|
|
|
const col = columns.value.find((c: Record<string, any>) => c.id === column.colOptions.fk_child_column_id) as Record< |
|
|
|
any> |
|
|
|
string, |
|
|
|
|
|
|
|
any |
|
|
|
|
|
|
|
> |
|
|
|
if (col.rqd && !col.default) { |
|
|
|
if (col.rqd && !col.default) { |
|
|
|
isRequired = true |
|
|
|
isRequired = true |
|
|
|
} |
|
|
|
} |
|
|
@ -209,8 +211,7 @@ function setFormData() { |
|
|
|
let data: Record<string, boolean> = {} |
|
|
|
let data: Record<string, boolean> = {} |
|
|
|
try { |
|
|
|
try { |
|
|
|
data = JSON.parse(formViewData.value.email as string) || {} |
|
|
|
data = JSON.parse(formViewData.value.email as string) || {} |
|
|
|
} catch (e) { |
|
|
|
} catch (e) {} |
|
|
|
} |
|
|
|
|
|
|
|
data[state.user.value?.email as string] = emailMe.value |
|
|
|
data[state.user.value?.email as string] = emailMe.value |
|
|
|
formViewData.value.email = JSON.stringify(data) |
|
|
|
formViewData.value.email = JSON.stringify(data) |
|
|
|
checkSMTPStatus() |
|
|
|
checkSMTPStatus() |
|
|
@ -237,8 +238,10 @@ function isRequired(_columnObj: Record<string, any>, required = false) { |
|
|
|
columnObj.colOptions && |
|
|
|
columnObj.colOptions && |
|
|
|
columnObj.colOptions.type === RelationTypes.BELONGS_TO |
|
|
|
columnObj.colOptions.type === RelationTypes.BELONGS_TO |
|
|
|
) { |
|
|
|
) { |
|
|
|
columnObj = columns.value.find((c: Record<string, any>) => c.id === columnObj.colOptions.fk_child_column_id) as Record<string, |
|
|
|
columnObj = columns.value.find((c: Record<string, any>) => c.id === columnObj.colOptions.fk_child_column_id) as Record< |
|
|
|
any> |
|
|
|
string, |
|
|
|
|
|
|
|
any |
|
|
|
|
|
|
|
> |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return required || (columnObj && columnObj.rqd && !columnObj.cdf) |
|
|
|
return required || (columnObj && columnObj.rqd && !columnObj.cdf) |
|
|
@ -395,8 +398,7 @@ onMounted(async () => { |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</a-button> |
|
|
|
</a-button> |
|
|
|
<template #overlay> |
|
|
|
<template #overlay> |
|
|
|
<SmartsheetColumnEditOrAdd ref="editOrAddRef" @submit="submitCallback" |
|
|
|
<SmartsheetColumnEditOrAdd ref="editOrAddRef" @submit="submitCallback" @cancel="showColumnDropdown = false" /> |
|
|
|
@cancel="showColumnDropdown = false"/> |
|
|
|
|
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</a-dropdown> |
|
|
|
</a-dropdown> |
|
|
|
</template> |
|
|
|
</template> |
|
|
@ -445,8 +447,7 @@ onMounted(async () => { |
|
|
|
@end="drag = false" |
|
|
|
@end="drag = false" |
|
|
|
> |
|
|
|
> |
|
|
|
<template #item="{ element, index }"> |
|
|
|
<template #item="{ element, index }"> |
|
|
|
<div class="nc-editable item cursor-pointer hover:bg-primary/10 pa-3" |
|
|
|
<div class="nc-editable item cursor-pointer hover:bg-primary/10 pa-3" @click="activeRow = element.title"> |
|
|
|
@click="activeRow = element.title"> |
|
|
|
|
|
|
|
<div class="flex"> |
|
|
|
<div class="flex"> |
|
|
|
<div class="flex flex-1"> |
|
|
|
<div class="flex flex-1"> |
|
|
|
<div class="flex flex-row"> |
|
|
|
<div class="flex flex-row"> |
|
|
@ -503,8 +504,8 @@ onMounted(async () => { |
|
|
|
</a-form-item> |
|
|
|
</a-form-item> |
|
|
|
<a-form-item class="mt-2 mb-0 w-1/2"> |
|
|
|
<a-form-item class="mt-2 mb-0 w-1/2"> |
|
|
|
<a-input |
|
|
|
<a-input |
|
|
|
size="small" |
|
|
|
|
|
|
|
v-model:value="element.description" |
|
|
|
v-model:value="element.description" |
|
|
|
|
|
|
|
size="small" |
|
|
|
class="form-meta-input !bg-[#dbdbdb] text-sm" |
|
|
|
class="form-meta-input !bg-[#dbdbdb] text-sm" |
|
|
|
:placeholder="$t('msg.info.formHelpText')" |
|
|
|
:placeholder="$t('msg.info.formHelpText')" |
|
|
|
@change="updateColMeta(element)" |
|
|
|
@change="updateColMeta(element)" |
|
|
@ -512,8 +513,7 @@ onMounted(async () => { |
|
|
|
</a-form-item> |
|
|
|
</a-form-item> |
|
|
|
<div class="items-center flex"> |
|
|
|
<div class="items-center flex"> |
|
|
|
<span class="text-sm text-gray-500 mr-2">{{ $t('general.required') }}</span> |
|
|
|
<span class="text-sm text-gray-500 mr-2">{{ $t('general.required') }}</span> |
|
|
|
<a-switch size="small" v-model:checked="element.required" class="my-2" |
|
|
|
<a-switch v-model:checked="element.required" size="small" class="my-2" @change="updateColMeta(element)" /> |
|
|
|
@change="updateColMeta(element)"/> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<span class="text-gray-500">{{ element.description }}</span> |
|
|
|
<span class="text-gray-500">{{ element.description }}</span> |
|
|
@ -535,14 +535,10 @@ onMounted(async () => { |
|
|
|
{{ $t('general.submit') }} |
|
|
|
{{ $t('general.submit') }} |
|
|
|
</a-button> |
|
|
|
</a-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
</a-card> |
|
|
|
</a-card> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</a-form> |
|
|
|
</a-form> |
|
|
|
|
|
|
|
|
|
|
|
<div class="mx-10 px-10"> |
|
|
|
<div class="mx-10 px-10"> |
|
|
|
|
|
|
|
|
|
|
|
<!-- After form is submitted --> |
|
|
|
<!-- After form is submitted --> |
|
|
|
<div class="text-gray-500 mt-4 mb-2"> |
|
|
|
<div class="text-gray-500 mt-4 mb-2"> |
|
|
|
{{ $t('msg.info.afterFormSubmitted') }} |
|
|
|
{{ $t('msg.info.afterFormSubmitted') }} |
|
|
@ -555,9 +551,10 @@ onMounted(async () => { |
|
|
|
<div class="mt-4"> |
|
|
|
<div class="mt-4"> |
|
|
|
<div class="my-4"> |
|
|
|
<div class="my-4"> |
|
|
|
<!-- Show "Submit Another Form" button --> |
|
|
|
<!-- Show "Submit Another Form" button --> |
|
|
|
<a-switch size="small" |
|
|
|
<a-switch |
|
|
|
v-model:checked="formViewData.submit_another_form" |
|
|
|
v-model:checked="formViewData.submit_another_form" |
|
|
|
v-t="[`a:form-view:submit-another-form`]" |
|
|
|
v-t="[`a:form-view:submit-another-form`]" |
|
|
|
|
|
|
|
size="small" |
|
|
|
@change="updateView" |
|
|
|
@change="updateView" |
|
|
|
/> |
|
|
|
/> |
|
|
|
<span class="ml-4">{{ $t('msg.info.submitAnotherForm') }}</span> |
|
|
|
<span class="ml-4">{{ $t('msg.info.submitAnotherForm') }}</span> |
|
|
@ -565,21 +562,19 @@ onMounted(async () => { |
|
|
|
|
|
|
|
|
|
|
|
<div class="my-4"> |
|
|
|
<div class="my-4"> |
|
|
|
<!-- Show a blank form after 5 seconds --> |
|
|
|
<!-- Show a blank form after 5 seconds --> |
|
|
|
<a-switch size="small" |
|
|
|
<a-switch |
|
|
|
v-model:checked="formViewData.show_blank_form" |
|
|
|
v-model:checked="formViewData.show_blank_form" |
|
|
|
v-t="[`a:form-view:show-blank-form`]" |
|
|
|
v-t="[`a:form-view:show-blank-form`]" |
|
|
|
|
|
|
|
size="small" |
|
|
|
@change="updateView" |
|
|
|
@change="updateView" |
|
|
|
/> |
|
|
|
/> |
|
|
|
<span class="ml-4">{{ $t('msg.info.showBlankForm') }}</span> |
|
|
|
<span class="ml-4">{{ $t('msg.info.showBlankForm') }}</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="my-4"> |
|
|
|
<div class="my-4"> |
|
|
|
<a-switch size="small" v-model:checked="emailMe" v-t="[`a:form-view:email-me`]" |
|
|
|
<a-switch v-model:checked="emailMe" v-t="[`a:form-view:email-me`]" size="small" @change="onEmailChange" /> |
|
|
|
@change="onEmailChange"/> |
|
|
|
|
|
|
|
<!-- Email me at <email> --> |
|
|
|
<!-- Email me at <email> --> |
|
|
|
<span class="ml-4"> |
|
|
|
<span class="ml-4"> |
|
|
|
{{ $t('msg.info.emailForm') }} <span class="text-bold text-gray-600">{{ |
|
|
|
{{ $t('msg.info.emailForm') }} <span class="text-bold text-gray-600">{{ state.user.value?.email }}</span> |
|
|
|
state.user.value?.email |
|
|
|
|
|
|
|
}}</span> |
|
|
|
|
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|