Skip to content

Commit

Permalink
fix(Wait Node): Append n8n attribution option (#10585)
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-radency authored Aug 30, 2024
1 parent ccb553a commit 81f4322
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 26 deletions.
7 changes: 2 additions & 5 deletions packages/nodes-base/nodes/EmailSend/v2/send.operation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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',
},
Expand Down
6 changes: 6 additions & 0 deletions packages/nodes-base/nodes/Form/common.descriptions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { INodeProperties } from 'n8n-workflow';
import { appendAttributionOption } from '../../utils/descriptions';

export const webhookPath: INodeProperties = {
displayName: 'Form Path',
Expand Down Expand Up @@ -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',
};
11 changes: 2 additions & 9 deletions packages/nodes-base/nodes/Form/v2/FormTriggerV2.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {

import { formWebhook } from '../utils';
import {
appendAttributionToForm,
formDescription,
formFields,
formRespondMode,
Expand Down Expand Up @@ -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: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { INodeProperties } from 'n8n-workflow';
import { appendAttributionOption } from '../../../../utils/descriptions';

export const messageOperations: INodeProperties[] = [
{
Expand Down Expand Up @@ -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',
},
Expand Down
7 changes: 2 additions & 5 deletions packages/nodes-base/nodes/Telegram/Telegram.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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: {
Expand Down
5 changes: 3 additions & 2 deletions packages/nodes-base/nodes/Wait/Wait.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
respondWithOptions,
formRespondMode,
formTitle,
appendAttributionToForm,
} from '../Form/common.descriptions';
import { formWebhook } from '../Form/utils';
import { updateDisplayOptions } from '../../utils/utilities';
Expand Down Expand Up @@ -436,7 +437,7 @@ export class Wait extends Webhook {
responseMode: ['responseNode'],
},
},
options: [respondWithOptions, webhookSuffix],
options: [appendAttributionToForm, respondWithOptions, webhookSuffix],
},
{
displayName: 'Options',
Expand All @@ -452,7 +453,7 @@ export class Wait extends Webhook {
responseMode: ['onReceived', 'lastNode'],
},
},
options: [webhookSuffix],
options: [appendAttributionToForm, webhookSuffix],
},
],
};
Expand Down
8 changes: 8 additions & 0 deletions packages/nodes-base/utils/descriptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 81f4322

Please sign in to comment.