mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
display pipeline, owner and stage as default in create deal
This commit is contained in:
parent
4cbbdda8c1
commit
51a6b47985
|
@ -575,6 +575,57 @@ export class ActiveCampaign implements INodeType {
|
||||||
options: returnAllCurrencyOptions(),
|
options: returnAllCurrencyOptions(),
|
||||||
description: 'The currency of the deal in 3-character ISO format',
|
description: 'The currency of the deal in 3-character ISO format',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
displayName: 'Deal pipeline ID',
|
||||||
|
name: 'pipeline',
|
||||||
|
type: 'string',
|
||||||
|
default: '',
|
||||||
|
displayOptions: {
|
||||||
|
show: {
|
||||||
|
operation: [
|
||||||
|
'create',
|
||||||
|
],
|
||||||
|
resource: [
|
||||||
|
'deal',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
description: 'The pipeline ID of the deal',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
displayName: 'Deal stage ID',
|
||||||
|
name: 'stage',
|
||||||
|
type: 'string',
|
||||||
|
default: '',
|
||||||
|
displayOptions: {
|
||||||
|
show: {
|
||||||
|
operation: [
|
||||||
|
'create',
|
||||||
|
],
|
||||||
|
resource: [
|
||||||
|
'deal',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
description: 'The stage ID of the deal',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
displayName: 'Deal owner ID',
|
||||||
|
name: 'owner',
|
||||||
|
type: 'string',
|
||||||
|
default: '',
|
||||||
|
displayOptions: {
|
||||||
|
show: {
|
||||||
|
operation: [
|
||||||
|
'create',
|
||||||
|
],
|
||||||
|
resource: [
|
||||||
|
'deal',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
description: 'The owner ID of the deal',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Additional Fields',
|
displayName: 'Additional Fields',
|
||||||
name: 'additionalFields',
|
name: 'additionalFields',
|
||||||
|
@ -599,27 +650,7 @@ export class ActiveCampaign implements INodeType {
|
||||||
default: '',
|
default: '',
|
||||||
description: 'The description of the deal',
|
description: 'The description of the deal',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
displayName: 'Deal group ID',
|
|
||||||
name: 'group',
|
|
||||||
type: 'string',
|
|
||||||
default: '',
|
|
||||||
description: 'The group ID of the deal',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
displayName: 'Deal stage ID',
|
|
||||||
name: 'stage',
|
|
||||||
type: 'string',
|
|
||||||
default: '',
|
|
||||||
description: 'The stage ID of the deal',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
displayName: 'Deal owner ID',
|
|
||||||
name: 'owner',
|
|
||||||
type: 'string',
|
|
||||||
default: '',
|
|
||||||
description: 'The owner ID of the deal',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
displayName: 'Deal percentage',
|
displayName: 'Deal percentage',
|
||||||
name: 'percent',
|
name: 'percent',
|
||||||
|
@ -713,11 +744,11 @@ export class ActiveCampaign implements INodeType {
|
||||||
description: 'The description of the deal',
|
description: 'The description of the deal',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Deal group ID',
|
displayName: 'Deal pipeline ID',
|
||||||
name: 'group',
|
name: 'pipeline',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
default: '',
|
default: '',
|
||||||
description: 'The group ID of the deal',
|
description: 'The pipeline ID of the deal',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Deal stage ID',
|
displayName: 'Deal stage ID',
|
||||||
|
@ -1059,13 +1090,27 @@ export class ActiveCampaign implements INodeType {
|
||||||
value: this.getNodeParameter('value', i) as number,
|
value: this.getNodeParameter('value', i) as number,
|
||||||
} as IDataObject;
|
} as IDataObject;
|
||||||
|
|
||||||
let currency = this.getNodeParameter('currency', i).toString().toLowerCase() as string
|
const group = this.getNodeParameter('pipeline', i) as string
|
||||||
|
if(group !== ''){
|
||||||
|
addAdditionalFields(body.deal as IDataObject, { group })
|
||||||
|
}
|
||||||
|
|
||||||
|
const owner = this.getNodeParameter('owner', i) as string
|
||||||
|
if(owner !== ''){
|
||||||
|
addAdditionalFields(body.deal as IDataObject, { owner })
|
||||||
|
}
|
||||||
|
|
||||||
|
const stage = this.getNodeParameter('stage', i) as string
|
||||||
|
if(stage !== ''){
|
||||||
|
addAdditionalFields(body.deal as IDataObject, { stage })
|
||||||
|
}
|
||||||
|
|
||||||
|
const currency = this.getNodeParameter('currency', i) as string
|
||||||
addAdditionalFields(body.deal as IDataObject, { currency })
|
addAdditionalFields(body.deal as IDataObject, { currency })
|
||||||
|
|
||||||
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
||||||
addAdditionalFields(body.deal as IDataObject, additionalFields);
|
addAdditionalFields(body.deal as IDataObject, additionalFields);
|
||||||
|
|
||||||
|
|
||||||
} else if (operation === 'update') {
|
} else if (operation === 'update') {
|
||||||
// ----------------------------------
|
// ----------------------------------
|
||||||
// deal:update
|
// deal:update
|
||||||
|
|
Loading…
Reference in a new issue