mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 12:44:07 -08:00
feat(n8n Form Trigger Node): Add text area and password input types (#7474)
Signed-off-by: yoshino-s <cy-cui@outlook.com>
This commit is contained in:
parent
ce14f6266b
commit
b72040aa54
|
@ -283,6 +283,20 @@
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
{{#if isTextarea}}
|
||||||
|
<div class='form-group'>
|
||||||
|
<label class='form-label' for='{{id}}'>{{label}}</label>
|
||||||
|
<textarea
|
||||||
|
class='form-input {{inputRequired}}'
|
||||||
|
id='{{id}}'
|
||||||
|
name='{{id}}'
|
||||||
|
></textarea>
|
||||||
|
<p class='{{errorId}} error-hidden'>
|
||||||
|
This field is required
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
{{#if isInput}}
|
{{#if isInput}}
|
||||||
<div class='form-group'>
|
<div class='form-group'>
|
||||||
<label class='form-label' for='{{id}}'>{{label}}</label>
|
<label class='form-label' for='{{id}}'>{{label}}</label>
|
||||||
|
|
|
@ -106,14 +106,6 @@ export class FormTrigger implements INodeType {
|
||||||
default: 'text',
|
default: 'text',
|
||||||
description: 'The type of field to add to the form',
|
description: 'The type of field to add to the form',
|
||||||
options: [
|
options: [
|
||||||
{
|
|
||||||
name: 'Text',
|
|
||||||
value: 'text',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Number',
|
|
||||||
value: 'number',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: 'Date',
|
name: 'Date',
|
||||||
value: 'date',
|
value: 'date',
|
||||||
|
@ -122,6 +114,22 @@ export class FormTrigger implements INodeType {
|
||||||
name: 'Dropdown List',
|
name: 'Dropdown List',
|
||||||
value: 'dropdown',
|
value: 'dropdown',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'Number',
|
||||||
|
value: 'number',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Password',
|
||||||
|
value: 'password',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Text',
|
||||||
|
value: 'text',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Textarea',
|
||||||
|
value: 'textarea',
|
||||||
|
},
|
||||||
],
|
],
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
|
|
@ -9,6 +9,7 @@ export type FormField = {
|
||||||
export type FormTriggerInput = {
|
export type FormTriggerInput = {
|
||||||
isSelect?: boolean;
|
isSelect?: boolean;
|
||||||
isMultiSelect?: boolean;
|
isMultiSelect?: boolean;
|
||||||
|
isTextarea?: boolean;
|
||||||
isInput?: boolean;
|
isInput?: boolean;
|
||||||
labbel: string;
|
labbel: string;
|
||||||
id: string;
|
id: string;
|
||||||
|
|
|
@ -52,6 +52,8 @@ export const prepareFormData = (
|
||||||
input.isSelect = true;
|
input.isSelect = true;
|
||||||
const fieldOptions = field.fieldOptions?.values ?? [];
|
const fieldOptions = field.fieldOptions?.values ?? [];
|
||||||
input.selectOptions = fieldOptions.map((e) => e.option);
|
input.selectOptions = fieldOptions.map((e) => e.option);
|
||||||
|
} else if (fieldType === 'textarea') {
|
||||||
|
input.isTextarea = true;
|
||||||
} else {
|
} else {
|
||||||
input.isInput = true;
|
input.isInput = true;
|
||||||
input.type = fieldType as 'text' | 'number' | 'date';
|
input.type = fieldType as 'text' | 'number' | 'date';
|
||||||
|
|
Loading…
Reference in a new issue