Auto-resize iframes, fix custom code, fix create form initial properties
This commit is contained in:
30
client/composables/forms/initForm.js
vendored
30
client/composables/forms/initForm.js
vendored
@@ -1,11 +1,12 @@
|
||||
import {generateUUID} from "~/lib/utils.js";
|
||||
|
||||
export const initForm = (defaultValue = {}) => {
|
||||
export const initForm = (defaultValue = {}, withDefaultProperties = false) => {
|
||||
return useForm({
|
||||
title: 'My Form',
|
||||
description: null,
|
||||
visibility: 'public',
|
||||
workspace_id: null,
|
||||
properties: [],
|
||||
properties: withDefaultProperties ? getDefaultProperties() :[],
|
||||
|
||||
notifies: false,
|
||||
slack_notifies: false,
|
||||
@@ -52,3 +53,28 @@ export const initForm = (defaultValue = {}) => {
|
||||
...defaultValue
|
||||
})
|
||||
}
|
||||
|
||||
function getDefaultProperties () {
|
||||
return [
|
||||
{
|
||||
name: 'Name',
|
||||
type: 'text',
|
||||
hidden: false,
|
||||
required: true,
|
||||
id: generateUUID()
|
||||
},
|
||||
{
|
||||
name: 'Email',
|
||||
type: 'email',
|
||||
hidden: false,
|
||||
id: generateUUID()
|
||||
},
|
||||
{
|
||||
name: 'Message',
|
||||
type: 'text',
|
||||
hidden: false,
|
||||
multi_lines: true,
|
||||
id: generateUUID()
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user