fix(Wait Node): Append n8n attribution option (#10585)

This commit is contained in:
Michael Kret 2024-08-30 16:28:25 +03:00 committed by GitHub
parent ccb553a550
commit 81f4322d45
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 25 additions and 26 deletions

View file

@ -14,6 +14,7 @@ import { createTransport } from 'nodemailer';
import type SMTPTransport from 'nodemailer/lib/smtp-transport'; import type SMTPTransport from 'nodemailer/lib/smtp-transport';
import { updateDisplayOptions } from '@utils/utilities'; import { updateDisplayOptions } from '@utils/utilities';
import { appendAttributionOption } from '../../../utils/descriptions';
const properties: INodeProperties[] = [ const properties: INodeProperties[] = [
// TODO: Add choice for text as text or html (maybe also from name) // TODO: Add choice for text as text or html (maybe also from name)
@ -137,11 +138,7 @@ const properties: INodeProperties[] = [
default: {}, default: {},
options: [ options: [
{ {
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased ...appendAttributionOption,
displayName: 'Append n8n Attribution',
name: 'appendAttribution',
type: 'boolean',
default: true,
description: description:
'Whether to include the phrase “This email was sent automatically with n8n” to the end of the email', 'Whether to include the phrase “This email was sent automatically with n8n” to the end of the email',
}, },

View file

@ -1,4 +1,5 @@
import type { INodeProperties } from 'n8n-workflow'; import type { INodeProperties } from 'n8n-workflow';
import { appendAttributionOption } from '../../utils/descriptions';
export const webhookPath: INodeProperties = { export const webhookPath: INodeProperties = {
displayName: 'Form Path', displayName: 'Form Path',
@ -314,3 +315,8 @@ export const respondWithOptions: INodeProperties = {
}, },
], ],
}; };
export const appendAttributionToForm: INodeProperties = {
...appendAttributionOption,
description: 'Whether to include the link “Form automated with n8n” at the bottom of the form',
};

View file

@ -10,6 +10,7 @@ import {
import { formWebhook } from '../utils'; import { formWebhook } from '../utils';
import { import {
appendAttributionToForm,
formDescription, formDescription,
formFields, formFields,
formRespondMode, formRespondMode,
@ -116,15 +117,7 @@ const descriptionV2: INodeTypeDescription = {
placeholder: 'Add option', placeholder: 'Add option',
default: {}, default: {},
options: [ options: [
{ appendAttributionToForm,
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
displayName: 'Append n8n Attribution',
name: 'appendAttribution',
type: 'boolean',
default: true,
description:
'Whether to include the link “Form automated with n8n” at the bottom of the form',
},
{ {
...respondWithOptions, ...respondWithOptions,
displayOptions: { displayOptions: {

View file

@ -1,4 +1,5 @@
import type { INodeProperties } from 'n8n-workflow'; import type { INodeProperties } from 'n8n-workflow';
import { appendAttributionOption } from '../../../../utils/descriptions';
export const messageOperations: INodeProperties[] = [ export const messageOperations: INodeProperties[] = [
{ {
@ -200,11 +201,7 @@ export const messageFields: INodeProperties[] = [
default: {}, default: {},
options: [ options: [
{ {
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased ...appendAttributionOption,
displayName: 'Append n8n Attribution',
name: 'appendAttribution',
type: 'boolean',
default: true,
description: description:
'Whether to include the phrase “This email was sent automatically with n8n” to the end of the email', 'Whether to include the phrase “This email was sent automatically with n8n” to the end of the email',
}, },

View file

@ -11,6 +11,7 @@ import type {
import { BINARY_ENCODING, NodeConnectionType, NodeOperationError } from 'n8n-workflow'; import { BINARY_ENCODING, NodeConnectionType, NodeOperationError } from 'n8n-workflow';
import { addAdditionalFields, apiRequest, getPropertyName } from './GenericFunctions'; import { addAdditionalFields, apiRequest, getPropertyName } from './GenericFunctions';
import { appendAttributionOption } from '../../utils/descriptions';
export class Telegram implements INodeType { export class Telegram implements INodeType {
description: INodeTypeDescription = { description: INodeTypeDescription = {
@ -1508,11 +1509,7 @@ export class Telegram implements INodeType {
default: {}, default: {},
options: [ options: [
{ {
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased ...appendAttributionOption,
displayName: 'Append n8n Attribution',
name: 'appendAttribution',
type: 'boolean',
default: true,
description: description:
'Whether to include the phrase “This message was sent automatically with n8n” to the end of the message', 'Whether to include the phrase “This message was sent automatically with n8n” to the end of the message',
displayOptions: { displayOptions: {

View file

@ -27,6 +27,7 @@ import {
respondWithOptions, respondWithOptions,
formRespondMode, formRespondMode,
formTitle, formTitle,
appendAttributionToForm,
} from '../Form/common.descriptions'; } from '../Form/common.descriptions';
import { formWebhook } from '../Form/utils'; import { formWebhook } from '../Form/utils';
import { updateDisplayOptions } from '../../utils/utilities'; import { updateDisplayOptions } from '../../utils/utilities';
@ -436,7 +437,7 @@ export class Wait extends Webhook {
responseMode: ['responseNode'], responseMode: ['responseNode'],
}, },
}, },
options: [respondWithOptions, webhookSuffix], options: [appendAttributionToForm, respondWithOptions, webhookSuffix],
}, },
{ {
displayName: 'Options', displayName: 'Options',
@ -452,7 +453,7 @@ export class Wait extends Webhook {
responseMode: ['onReceived', 'lastNode'], responseMode: ['onReceived', 'lastNode'],
}, },
}, },
options: [webhookSuffix], options: [appendAttributionToForm, webhookSuffix],
}, },
], ],
}; };

View file

@ -41,6 +41,14 @@ export const looseTypeValidationProperty: INodeProperties = {
default: true, default: true,
}; };
export const appendAttributionOption: INodeProperties = {
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
displayName: 'Append n8n Attribution',
name: 'appendAttribution',
type: 'boolean',
default: true,
};
export const encodeDecodeOptions: INodePropertyOptions[] = [ export const encodeDecodeOptions: INodePropertyOptions[] = [
{ {
name: 'armscii8', name: 'armscii8',