Skip to content

Commit

Permalink
⚡ Add filters to all getAll operations to Salesforce Node (#1292)
Browse files Browse the repository at this point in the history
* ⚡ Add filters to all get:All operations

* ⚡ Small fix

* ⚡Add description to condition fields

* ⚡ Minor improvements to Salesforce-Node

Co-authored-by: Harshil <ghagrawal17@gmail.com>
Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
  • Loading branch information
3 people authored Jan 13, 2021
1 parent 6759e2e commit 63a459a
Show file tree
Hide file tree
Showing 20 changed files with 1,131 additions and 323 deletions.
123 changes: 95 additions & 28 deletions packages/nodes-base/nodes/Salesforce/AccountDescription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ export const accountOperations = [

export const accountFields = [

/* -------------------------------------------------------------------------- */
/* account:create */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
/* account:create */
/* -------------------------------------------------------------------------- */
{
displayName: 'Name',
name: 'name',
Expand Down Expand Up @@ -104,7 +104,7 @@ export const accountFields = [
loadOptionsMethod: 'getAccountSources',
},
default: '',
description: 'The source of the account record',
description: 'The source of the account record.',
},
{
displayName: 'Annual Revenue',
Expand Down Expand Up @@ -209,7 +209,7 @@ export const accountFields = [
name: 'jigsaw',
type: 'string',
default: '',
description: 'references the ID of a company in Data.com',
description: 'References the ID of a company in Data.com',
},
{
displayName: 'Industry',
Expand Down Expand Up @@ -262,7 +262,7 @@ export const accountFields = [
description: 'Type of account',
},
{
displayName: 'Parent Id',
displayName: 'Parent ID',
name: 'parentId',
type: 'string',
default: '',
Expand Down Expand Up @@ -312,9 +312,10 @@ export const accountFields = [
},
],
},
/* -------------------------------------------------------------------------- */
/* account:update */
/* -------------------------------------------------------------------------- */

/* -------------------------------------------------------------------------- */
/* account:update */
/* -------------------------------------------------------------------------- */
{
displayName: 'Account ID',
name: 'accountId',
Expand All @@ -331,7 +332,7 @@ export const accountFields = [
],
},
},
description: 'Id of account that needs to be fetched',
description: 'ID of account that needs to be fetched.',
},
{
displayName: 'Update Fields',
Expand All @@ -358,7 +359,7 @@ export const accountFields = [
loadOptionsMethod: 'getAccountSources',
},
default: '',
description: 'The source of the account record',
description: 'The source of the account record.',
},
{
displayName: 'Annual Revenue',
Expand Down Expand Up @@ -470,7 +471,7 @@ export const accountFields = [
name: 'jigsaw',
type: 'string',
default: '',
description: 'references the ID of a company in Data.com',
description: 'References the ID of a company in Data.com',
},
{
displayName: 'Owner',
Expand Down Expand Up @@ -514,7 +515,7 @@ export const accountFields = [
description: 'Number of employees',
},
{
displayName: 'Parent Id',
displayName: 'Parent ID',
name: 'parentId',
type: 'string',
default: '',
Expand Down Expand Up @@ -574,9 +575,9 @@ export const accountFields = [
],
},

/* -------------------------------------------------------------------------- */
/* account:get */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
/* account:get */
/* -------------------------------------------------------------------------- */
{
displayName: 'Account ID',
name: 'accountId',
Expand All @@ -593,11 +594,12 @@ export const accountFields = [
],
},
},
description: 'Id of account that needs to be fetched',
description: 'ID of account that needs to be fetched.',
},
/* -------------------------------------------------------------------------- */
/* account:delete */
/* -------------------------------------------------------------------------- */

/* -------------------------------------------------------------------------- */
/* account:delete */
/* -------------------------------------------------------------------------- */
{
displayName: 'Account ID',
name: 'accountId',
Expand All @@ -614,11 +616,12 @@ export const accountFields = [
],
},
},
description: 'Id of account that needs to be fetched',
description: 'ID of account that needs to be fetched.',
},
/* -------------------------------------------------------------------------- */
/* account:getAll */
/* -------------------------------------------------------------------------- */

/* -------------------------------------------------------------------------- */
/* account:getAll */
/* -------------------------------------------------------------------------- */
{
displayName: 'Return All',
name: 'returnAll',
Expand Down Expand Up @@ -684,11 +687,75 @@ export const accountFields = [
default: '',
description: 'Fields to include separated by ,',
},
{
displayName: 'Conditions',
name: 'conditionsUi',
placeholder: 'Add Condition',
type: 'fixedCollection',
typeOptions: {
multipleValues: true,
},
description: 'The condition to set.',
default: {},
options: [
{
name: 'conditionValues',
displayName: 'Condition',
values: [
{
displayName: 'Field',
name: 'field',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getAccountFields',
},
default: '',
description: 'For date, number, or boolean, please use expressions',
},
{
displayName: 'Operation',
name: 'operation',
type: 'options',
options: [
{
name: '=',
value: 'equal',
},
{
name: '>',
value: '>',
},
{
name: '<',
value: '<',
},
{
name: '>=',
value: '>=',
},
{
name: '<=',
value: '<=',
},
],
default: 'equal',
},
{
displayName: 'Value',
name: 'value',
type: 'string',
default: '',
},
],
},
],
},
],
},
/* -------------------------------------------------------------------------- */
/* account:addNote */
/* -------------------------------------------------------------------------- */

/* -------------------------------------------------------------------------- */
/* account:addNote */
/* -------------------------------------------------------------------------- */
{
displayName: 'Account ID',
name: 'accountId',
Expand All @@ -705,7 +772,7 @@ export const accountFields = [
],
},
},
description: 'Id of account that needs to be fetched',
description: 'ID of account that needs to be fetched.',
},
{
displayName: 'Title',
Expand Down
2 changes: 1 addition & 1 deletion packages/nodes-base/nodes/Salesforce/AccountInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface IAccount {
Description?: string;
BillingState?: string;
ShippingStreet?: string;
ShippingCity?:string;
ShippingCity?: string;
AccountSource?: string;
AnnualRevenue?: number;
BillingStreet?: string;
Expand Down
104 changes: 85 additions & 19 deletions packages/nodes-base/nodes/Salesforce/AttachmentDescription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ export const attachmentOperations = [

export const attachmentFields = [

/* -------------------------------------------------------------------------- */
/* attachment:create */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
/* attachment:create */
/* -------------------------------------------------------------------------- */
{
displayName: 'Parent ID',
name: 'parentId',
Expand Down Expand Up @@ -152,9 +152,10 @@ export const attachmentFields = [
},
],
},
/* -------------------------------------------------------------------------- */
/* attachment:update */
/* -------------------------------------------------------------------------- */

/* -------------------------------------------------------------------------- */
/* attachment:update */
/* -------------------------------------------------------------------------- */
{
displayName: 'Attachment ID',
name: 'attachmentId',
Expand All @@ -171,7 +172,7 @@ export const attachmentFields = [
],
},
},
description: 'Id of attachment that needs to be fetched',
description: 'ID of attachment that needs to be fetched.',
},
{
displayName: 'Update Fields',
Expand Down Expand Up @@ -224,17 +225,17 @@ export const attachmentFields = [
name: 'owner',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getUsers',
loadOptionsMethod: 'getUsers',
},
default: '',
description: 'ID of the User who owns the attachment.',
},
],
},

/* -------------------------------------------------------------------------- */
/* attachment:get */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
/* attachment:get */
/* -------------------------------------------------------------------------- */
{
displayName: 'Attachment ID',
name: 'attachmentId',
Expand All @@ -251,11 +252,12 @@ export const attachmentFields = [
],
},
},
description: 'Id of attachment that needs to be fetched',
description: 'ID of attachment that needs to be fetched.',
},
/* -------------------------------------------------------------------------- */
/* attachment:delete */
/* -------------------------------------------------------------------------- */

/* -------------------------------------------------------------------------- */
/* attachment:delete */
/* -------------------------------------------------------------------------- */
{
displayName: 'Attachment ID',
name: 'attachmentId',
Expand All @@ -272,11 +274,12 @@ export const attachmentFields = [
],
},
},
description: 'Id of attachment that needs to be fetched',
description: 'ID of attachment that needs to be fetched.',
},
/* -------------------------------------------------------------------------- */
/* attachment:getAll */
/* -------------------------------------------------------------------------- */

/* -------------------------------------------------------------------------- */
/* attachment:getAll */
/* -------------------------------------------------------------------------- */
{
displayName: 'Return All',
name: 'returnAll',
Expand Down Expand Up @@ -335,6 +338,69 @@ export const attachmentFields = [
},
},
options: [
{
displayName: 'Conditions',
name: 'conditionsUi',
placeholder: 'Add Condition',
type: 'fixedCollection',
typeOptions: {
multipleValues: true,
},
description: 'The condition to set.',
default: {},
options: [
{
name: 'conditionValues',
displayName: 'Condition',
values: [
{
displayName: 'Field',
name: 'field',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getAtachmentFields',
},
default: '',
description: 'For date, number, or boolean, please use expressions.',
},
{
displayName: 'Operation',
name: 'operation',
type: 'options',
options: [
{
name: '=',
value: 'equal',
},
{
name: '>',
value: '>',
},
{
name: '<',
value: '<',
},
{
name: '>=',
value: '>=',
},
{
name: '<=',
value: '<=',
},
],
default: 'equal',
},
{
displayName: 'Value',
name: 'value',
type: 'string',
default: '',
},
],
},
],
},
{
displayName: 'Fields',
name: 'fields',
Expand Down
Loading

0 comments on commit 63a459a

Please sign in to comment.