mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
feat(Telegram Node): New operation sendAndWait (#12771)
This commit is contained in:
@@ -137,6 +137,11 @@ export function getSendAndWaitProperties(
|
||||
targetProperties: INodeProperties[],
|
||||
resource: string = 'message',
|
||||
additionalProperties: INodeProperties[] = [],
|
||||
options?: {
|
||||
noButtonStyle?: boolean;
|
||||
defaultApproveLabel?: string;
|
||||
defaultDisapproveLabel?: string;
|
||||
},
|
||||
) {
|
||||
const buttonStyle: INodeProperties = {
|
||||
displayName: 'Button Style',
|
||||
@@ -154,6 +159,77 @@ export function getSendAndWaitProperties(
|
||||
},
|
||||
],
|
||||
};
|
||||
const approvalOptionsValues = [
|
||||
{
|
||||
displayName: 'Type of Approval',
|
||||
name: 'approvalType',
|
||||
type: 'options',
|
||||
placeholder: 'Add option',
|
||||
default: 'single',
|
||||
options: [
|
||||
{
|
||||
name: 'Approve Only',
|
||||
value: 'single',
|
||||
},
|
||||
{
|
||||
name: 'Approve and Disapprove',
|
||||
value: 'double',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
displayName: 'Approve Button Label',
|
||||
name: 'approveLabel',
|
||||
type: 'string',
|
||||
default: options?.defaultApproveLabel || 'Approve',
|
||||
displayOptions: {
|
||||
show: {
|
||||
approvalType: ['single', 'double'],
|
||||
},
|
||||
},
|
||||
},
|
||||
...[
|
||||
options?.noButtonStyle
|
||||
? ({} as INodeProperties)
|
||||
: {
|
||||
...buttonStyle,
|
||||
displayName: 'Approve Button Style',
|
||||
name: 'buttonApprovalStyle',
|
||||
displayOptions: {
|
||||
show: {
|
||||
approvalType: ['single', 'double'],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
{
|
||||
displayName: 'Disapprove Button Label',
|
||||
name: 'disapproveLabel',
|
||||
type: 'string',
|
||||
default: options?.defaultDisapproveLabel || 'Decline',
|
||||
displayOptions: {
|
||||
show: {
|
||||
approvalType: ['double'],
|
||||
},
|
||||
},
|
||||
},
|
||||
...[
|
||||
options?.noButtonStyle
|
||||
? ({} as INodeProperties)
|
||||
: {
|
||||
...buttonStyle,
|
||||
displayName: 'Disapprove Button Style',
|
||||
name: 'buttonDisapprovalStyle',
|
||||
default: 'secondary',
|
||||
displayOptions: {
|
||||
show: {
|
||||
approvalType: ['double'],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
].filter((p) => Object.keys(p).length) as INodeProperties[];
|
||||
|
||||
const sendAndWait: INodeProperties[] = [
|
||||
...targetProperties,
|
||||
{
|
||||
@@ -216,68 +292,7 @@ export function getSendAndWaitProperties(
|
||||
{
|
||||
displayName: 'Values',
|
||||
name: 'values',
|
||||
values: [
|
||||
{
|
||||
displayName: 'Type of Approval',
|
||||
name: 'approvalType',
|
||||
type: 'options',
|
||||
placeholder: 'Add option',
|
||||
default: 'single',
|
||||
options: [
|
||||
{
|
||||
name: 'Approve Only',
|
||||
value: 'single',
|
||||
},
|
||||
{
|
||||
name: 'Approve and Disapprove',
|
||||
value: 'double',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
displayName: 'Approve Button Label',
|
||||
name: 'approveLabel',
|
||||
type: 'string',
|
||||
default: 'Approve',
|
||||
displayOptions: {
|
||||
show: {
|
||||
approvalType: ['single', 'double'],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
...buttonStyle,
|
||||
displayName: 'Approve Button Style',
|
||||
name: 'buttonApprovalStyle',
|
||||
displayOptions: {
|
||||
show: {
|
||||
approvalType: ['single', 'double'],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Disapprove Button Label',
|
||||
name: 'disapproveLabel',
|
||||
type: 'string',
|
||||
default: 'Decline',
|
||||
displayOptions: {
|
||||
show: {
|
||||
approvalType: ['double'],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
...buttonStyle,
|
||||
displayName: 'Disapprove Button Style',
|
||||
name: 'buttonDisapprovalStyle',
|
||||
default: 'secondary',
|
||||
displayOptions: {
|
||||
show: {
|
||||
approvalType: ['double'],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
values: approvalOptionsValues,
|
||||
},
|
||||
],
|
||||
displayOptions: {
|
||||
|
||||
Reference in New Issue
Block a user