fix(Notion Node): Fix broken Notion node parameters (#7864)

We've introduced a new version(`2.1` of Notion node in #7791 but not all
`diplayOptions` conditions were updated. This would effectively prevent
most of the required Notion fields from loading.
This PR adds the new version to all `@version` display conditions which
contain version `2`.


https://github.com/n8n-io/n8n/assets/12657221/4254c646-43b6-46b3-adcc-1b17746901da


Github issue / Community forum post (link here to close automatically):

---------

Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
Co-authored-by: Michael Kret <michael.k@radency.com>
This commit is contained in:
oleg 2023-11-29 15:11:54 +01:00 committed by GitHub
parent 6d9342e676
commit 51d1f5b820
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 51 additions and 17 deletions

View file

@ -8,9 +8,11 @@ export const databaseOperations: INodeProperties[] = [
noDataExpression: true, noDataExpression: true,
displayOptions: { displayOptions: {
show: { show: {
'@version': [2],
resource: ['database'], resource: ['database'],
}, },
hide: {
'@version': [1],
},
}, },
options: [ options: [
{ {
@ -178,10 +180,12 @@ export const databaseFields: INodeProperties[] = [
type: 'boolean', type: 'boolean',
displayOptions: { displayOptions: {
show: { show: {
'@version': [2],
resource: ['database'], resource: ['database'],
operation: ['getAll', 'get'], operation: ['getAll', 'get'],
}, },
hide: {
'@version': [1],
},
}, },
default: true, default: true,
description: 'Whether to return a simplified version of the response instead of the raw data', description: 'Whether to return a simplified version of the response instead of the raw data',

View file

@ -14,9 +14,11 @@ export const databasePageOperations: INodeProperties[] = [
noDataExpression: true, noDataExpression: true,
displayOptions: { displayOptions: {
show: { show: {
'@version': [2],
resource: ['databasePage'], resource: ['databasePage'],
}, },
hide: {
'@version': [1],
},
}, },
options: [ options: [
{ {
@ -161,10 +163,12 @@ export const databasePageFields: INodeProperties[] = [
default: '', default: '',
displayOptions: { displayOptions: {
show: { show: {
'@version': [2],
resource: ['databasePage'], resource: ['databasePage'],
operation: ['create'], operation: ['create'],
}, },
hide: {
'@version': [1],
},
}, },
description: 'Page title. Appears at the top of the page and can be found via Quick Find.', description: 'Page title. Appears at the top of the page and can be found via Quick Find.',
}, },
@ -502,9 +506,11 @@ export const databasePageFields: INodeProperties[] = [
}, },
displayOptions: { displayOptions: {
show: { show: {
'@version': [2],
type: ['files'], type: ['files'],
}, },
hide: {
'@version': [1],
},
}, },
default: {}, default: {},
options: [ options: [
@ -969,9 +975,11 @@ export const databasePageFields: INodeProperties[] = [
}, },
displayOptions: { displayOptions: {
show: { show: {
'@version': [2],
type: ['files'], type: ['files'],
}, },
hide: {
'@version': [1],
},
}, },
default: {}, default: {},
options: [ options: [
@ -1097,10 +1105,12 @@ export const databasePageFields: INodeProperties[] = [
], ],
displayOptions: { displayOptions: {
show: { show: {
'@version': [2],
resource: ['databasePage'], resource: ['databasePage'],
operation: ['get'], operation: ['get'],
}, },
hide: {
'@version': [1],
},
}, },
description: 'The Notion Database Page to get', description: 'The Notion Database Page to get',
}, },
@ -1110,10 +1120,12 @@ export const databasePageFields: INodeProperties[] = [
type: 'boolean', type: 'boolean',
displayOptions: { displayOptions: {
show: { show: {
'@version': [2],
resource: ['databasePage'], resource: ['databasePage'],
operation: ['get'], operation: ['get'],
}, },
hide: {
'@version': [1],
},
}, },
default: true, default: true,
description: 'Whether to return a simplified version of the response instead of the raw data', description: 'Whether to return a simplified version of the response instead of the raw data',
@ -1254,10 +1266,12 @@ export const databasePageFields: INodeProperties[] = [
type: 'boolean', type: 'boolean',
displayOptions: { displayOptions: {
show: { show: {
'@version': [2],
'/resource': ['databasePage'], '/resource': ['databasePage'],
'/operation': ['getAll'], '/operation': ['getAll'],
}, },
hide: {
'@version': [1],
},
}, },
default: false, default: false,
description: "Whether to download a file if a database's field contains it", description: "Whether to download a file if a database's field contains it",

View file

@ -936,10 +936,12 @@ export function getSearchFilters(resource: string) {
], ],
displayOptions: { displayOptions: {
show: { show: {
'@version': [2],
resource: [resource], resource: [resource],
operation: ['getAll'], operation: ['getAll'],
}, },
hide: {
'@version': [1],
},
}, },
default: 'none', default: 'none',
}, },
@ -959,11 +961,13 @@ export function getSearchFilters(resource: string) {
], ],
displayOptions: { displayOptions: {
show: { show: {
'@version': [2],
resource: [resource], resource: [resource],
operation: ['getAll'], operation: ['getAll'],
filterType: ['manual'], filterType: ['manual'],
}, },
hide: {
'@version': [1],
},
}, },
default: 'anyFilter', default: 'anyFilter',
}, },
@ -976,11 +980,13 @@ export function getSearchFilters(resource: string) {
}, },
displayOptions: { displayOptions: {
show: { show: {
'@version': [2],
resource: [resource], resource: [resource],
operation: ['getAll'], operation: ['getAll'],
filterType: ['manual'], filterType: ['manual'],
}, },
hide: {
'@version': [1],
},
}, },
default: {}, default: {},
placeholder: 'Add Condition', placeholder: 'Add Condition',
@ -999,11 +1005,13 @@ export function getSearchFilters(resource: string) {
type: 'notice', type: 'notice',
displayOptions: { displayOptions: {
show: { show: {
'@version': [2],
resource: [resource], resource: [resource],
operation: ['getAll'], operation: ['getAll'],
filterType: ['json'], filterType: ['json'],
}, },
hide: {
'@version': [1],
},
}, },
default: '', default: '',
}, },
@ -1013,11 +1021,13 @@ export function getSearchFilters(resource: string) {
type: 'string', type: 'string',
displayOptions: { displayOptions: {
show: { show: {
'@version': [2],
resource: [resource], resource: [resource],
operation: ['getAll'], operation: ['getAll'],
filterType: ['json'], filterType: ['json'],
}, },
hide: {
'@version': [1],
},
}, },
default: '', default: '',
}, },

View file

@ -43,9 +43,11 @@ export const pageOperations: INodeProperties[] = [
noDataExpression: true, noDataExpression: true,
displayOptions: { displayOptions: {
show: { show: {
'@version': [2],
resource: ['page'], resource: ['page'],
}, },
hide: {
'@version': [1],
},
}, },
options: [ options: [
{ {
@ -127,10 +129,12 @@ export const pageFields: INodeProperties[] = [
], ],
displayOptions: { displayOptions: {
show: { show: {
'@version': [2],
resource: ['page'], resource: ['page'],
operation: ['archive'], operation: ['archive'],
}, },
hide: {
'@version': [1],
},
}, },
description: 'The Notion Page to archive', description: 'The Notion Page to archive',
}, },
@ -140,10 +144,12 @@ export const pageFields: INodeProperties[] = [
type: 'boolean', type: 'boolean',
displayOptions: { displayOptions: {
show: { show: {
'@version': [2],
resource: ['page'], resource: ['page'],
operation: ['archive'], operation: ['archive'],
}, },
hide: {
'@version': [1],
},
}, },
default: true, default: true,
description: 'Whether to return a simplified version of the response instead of the raw data', description: 'Whether to return a simplified version of the response instead of the raw data',