mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 04:34:06 -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>
|
||||
{{/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}}
|
||||
<div class='form-group'>
|
||||
<label class='form-label' for='{{id}}'>{{label}}</label>
|
||||
|
|
|
@ -106,14 +106,6 @@ export class FormTrigger implements INodeType {
|
|||
default: 'text',
|
||||
description: 'The type of field to add to the form',
|
||||
options: [
|
||||
{
|
||||
name: 'Text',
|
||||
value: 'text',
|
||||
},
|
||||
{
|
||||
name: 'Number',
|
||||
value: 'number',
|
||||
},
|
||||
{
|
||||
name: 'Date',
|
||||
value: 'date',
|
||||
|
@ -122,6 +114,22 @@ export class FormTrigger implements INodeType {
|
|||
name: 'Dropdown List',
|
||||
value: 'dropdown',
|
||||
},
|
||||
{
|
||||
name: 'Number',
|
||||
value: 'number',
|
||||
},
|
||||
{
|
||||
name: 'Password',
|
||||
value: 'password',
|
||||
},
|
||||
{
|
||||
name: 'Text',
|
||||
value: 'text',
|
||||
},
|
||||
{
|
||||
name: 'Textarea',
|
||||
value: 'textarea',
|
||||
},
|
||||
],
|
||||
required: true,
|
||||
},
|
||||
|
|
|
@ -9,6 +9,7 @@ export type FormField = {
|
|||
export type FormTriggerInput = {
|
||||
isSelect?: boolean;
|
||||
isMultiSelect?: boolean;
|
||||
isTextarea?: boolean;
|
||||
isInput?: boolean;
|
||||
labbel: string;
|
||||
id: string;
|
||||
|
|
|
@ -52,6 +52,8 @@ export const prepareFormData = (
|
|||
input.isSelect = true;
|
||||
const fieldOptions = field.fieldOptions?.values ?? [];
|
||||
input.selectOptions = fieldOptions.map((e) => e.option);
|
||||
} else if (fieldType === 'textarea') {
|
||||
input.isTextarea = true;
|
||||
} else {
|
||||
input.isInput = true;
|
||||
input.type = fieldType as 'text' | 'number' | 'date';
|
||||
|
|
Loading…
Reference in a new issue