fix(Agile CRM Node): Fix issue with company address not working (#6997)

This commit is contained in:
Jon 2023-08-23 16:04:57 +01:00 committed by GitHub
parent 0e89a65b38
commit 2f81652400
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 117 additions and 22 deletions

View file

@ -298,12 +298,16 @@ export class AgileCrm implements INodeType {
} as IDataObject);
}
if (additionalFields.address) {
if (additionalFields.addressOptions) {
//@ts-ignore
additionalFields.addressOptions.addressProperties.map((property) => {
properties.push({
type: 'SYSTEM',
subtype: property.subtype as string,
name: 'address',
value: additionalFields.address as string,
value: property.address as string,
} as IDataObject);
});
}
if (additionalFields.phone) {
@ -313,6 +317,14 @@ export class AgileCrm implements INodeType {
value: additionalFields.phone as string,
} as IDataObject);
}
if (additionalFields.name) {
properties.push({
type: 'SYSTEM',
name: 'name',
value: additionalFields.name as string,
} as IDataObject);
}
}
if (additionalFields.websiteOptions) {
@ -321,7 +333,7 @@ export class AgileCrm implements INodeType {
properties.push({
type: 'SYSTEM',
subtype: property.subtype as string,
name: 'webiste',
name: 'website',
value: property.url as string,
} as IDataObject);
});
@ -450,12 +462,16 @@ export class AgileCrm implements INodeType {
} as IDataObject);
}
if (additionalFields.address) {
if (additionalFields.addressOptions) {
//@ts-ignore
additionalFields.addressOptions.addressProperties.map((property) => {
properties.push({
type: 'SYSTEM',
subtype: property.subtype as string,
name: 'address',
value: additionalFields.address as string,
value: property.address as string,
} as IDataObject);
});
}
if (additionalFields.phone) {
@ -473,11 +489,18 @@ export class AgileCrm implements INodeType {
properties.push({
type: 'SYSTEM',
subtype: property.subtype as string,
name: 'webiste',
name: 'website',
value: property.url as string,
} as IDataObject);
});
}
if (additionalFields.name) {
properties.push({
type: 'SYSTEM',
name: 'name',
value: additionalFields.name as string,
} as IDataObject);
}
if (additionalFields.customProperties) {
//@ts-ignore
additionalFields.customProperties.customProperty.map((property) => {

View file

@ -379,11 +379,47 @@ export const companyFields: INodeProperties[] = [
options: [
{
displayName: 'Address',
name: 'email',
type: 'string',
placeholder: 'name@email.com',
default: '',
name: 'addressOptions',
type: 'fixedCollection',
default: {},
description: 'Company address',
typeOptions: {
multipleValues: true,
},
options: [
{
displayName: 'Address Properties',
name: 'addressProperties',
values: [
{
displayName: 'Type',
name: 'subtype',
type: 'options',
required: true,
default: '',
description: 'Type of address',
options: [
{
name: 'Postal',
value: 'postal',
},
{
name: 'Office',
value: 'office',
},
],
},
{
displayName: 'Address',
name: 'address',
type: 'string',
required: true,
default: '',
description: 'Full address',
},
],
},
],
},
{
displayName: 'Email',
@ -655,11 +691,47 @@ export const companyFields: INodeProperties[] = [
options: [
{
displayName: 'Address',
name: 'email',
type: 'string',
placeholder: 'name@email.com',
default: '',
name: 'addressOptions',
type: 'fixedCollection',
default: {},
description: 'Company address',
typeOptions: {
multipleValues: true,
},
options: [
{
displayName: 'Address Properties',
name: 'addressProperties',
values: [
{
displayName: 'Type',
name: 'subtype',
type: 'options',
required: true,
default: '',
description: 'Type of address',
options: [
{
name: 'Postal',
value: 'postal',
},
{
name: 'Office',
value: 'office',
},
],
},
{
displayName: 'Address',
name: 'address',
type: 'string',
required: true,
default: '',
description: 'Full address',
},
],
},
],
},
{
displayName: 'Email',