Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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',
ShireenMissi marked this conversation as resolved.
Show resolved Hide resolved
};
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 @@ -9,6 +9,7 @@ import type {

import { formWebhook } from '../utils';
import {
appendAttributionToForm,
formDescription,
formFields,
formRespondMode,
Expand Down Expand Up @@ -115,15 +116,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, 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
Loading