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 { updateDisplayOptions } from '@utils/utilities';
import { appendAttributionOption } from '../../../utils/descriptions';
const properties: INodeProperties[] = [
// TODO: Add choice for text as text or html (maybe also from name)
@ -137,11 +138,7 @@ const properties: INodeProperties[] = [
default: {},
options: [
{
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
displayName: 'Append n8n Attribution',
name: 'appendAttribution',
type: 'boolean',
default: true,
...appendAttributionOption,
description:
'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 { appendAttributionOption } from '../../utils/descriptions';
export const webhookPath: INodeProperties = {
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 {
appendAttributionToForm,
formDescription,
formFields,
formRespondMode,
@ -116,15 +117,7 @@ const descriptionV2: INodeTypeDescription = {
placeholder: 'Add option',
default: {},
options: [
{
// 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',
},
appendAttributionToForm,
{
...respondWithOptions,
displayOptions: {

View file

@ -1,4 +1,5 @@
import type { INodeProperties } from 'n8n-workflow';
import { appendAttributionOption } from '../../../../utils/descriptions';
export const messageOperations: INodeProperties[] = [
{
@ -200,11 +201,7 @@ export const messageFields: INodeProperties[] = [
default: {},
options: [
{
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
displayName: 'Append n8n Attribution',
name: 'appendAttribution',
type: 'boolean',
default: true,
...appendAttributionOption,
description:
'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 { addAdditionalFields, apiRequest, getPropertyName } from './GenericFunctions';
import { appendAttributionOption } from '../../utils/descriptions';
export class Telegram implements INodeType {
description: INodeTypeDescription = {
@ -1508,11 +1509,7 @@ export class Telegram implements INodeType {
default: {},
options: [
{
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
displayName: 'Append n8n Attribution',
name: 'appendAttribution',
type: 'boolean',
default: true,
...appendAttributionOption,
description:
'Whether to include the phrase “This message was sent automatically with n8n” to the end of the message',
displayOptions: {

View file

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

View file

@ -41,6 +41,14 @@ export const looseTypeValidationProperty: INodeProperties = {
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[] = [
{
name: 'armscii8',