Skip to content

Commit

Permalink
fix(Notion Node): Fix broken Notion node parameters (#7864)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
OlegIvaniv and michael-radency committed Nov 29, 2023
1 parent 6d9342e commit 51d1f5b
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 17 deletions.
8 changes: 6 additions & 2 deletions packages/nodes-base/nodes/Notion/DatabaseDescription.ts
Expand Up @@ -8,9 +8,11 @@ export const databaseOperations: INodeProperties[] = [
noDataExpression: true,
displayOptions: {
show: {
'@version': [2],
resource: ['database'],
},
hide: {
'@version': [1],
},
},
options: [
{
Expand Down Expand Up @@ -178,10 +180,12 @@ export const databaseFields: INodeProperties[] = [
type: 'boolean',
displayOptions: {
show: {
'@version': [2],
resource: ['database'],
operation: ['getAll', 'get'],
},
hide: {
'@version': [1],
},
},
default: true,
description: 'Whether to return a simplified version of the response instead of the raw data',
Expand Down
28 changes: 21 additions & 7 deletions packages/nodes-base/nodes/Notion/DatabasePageDescription.ts
Expand Up @@ -14,9 +14,11 @@ export const databasePageOperations: INodeProperties[] = [
noDataExpression: true,
displayOptions: {
show: {
'@version': [2],
resource: ['databasePage'],
},
hide: {
'@version': [1],
},
},
options: [
{
Expand Down Expand Up @@ -161,10 +163,12 @@ export const databasePageFields: INodeProperties[] = [
default: '',
displayOptions: {
show: {
'@version': [2],
resource: ['databasePage'],
operation: ['create'],
},
hide: {
'@version': [1],
},
},
description: 'Page title. Appears at the top of the page and can be found via Quick Find.',
},
Expand Down Expand Up @@ -502,9 +506,11 @@ export const databasePageFields: INodeProperties[] = [
},
displayOptions: {
show: {
'@version': [2],
type: ['files'],
},
hide: {
'@version': [1],
},
},
default: {},
options: [
Expand Down Expand Up @@ -969,9 +975,11 @@ export const databasePageFields: INodeProperties[] = [
},
displayOptions: {
show: {
'@version': [2],
type: ['files'],
},
hide: {
'@version': [1],
},
},
default: {},
options: [
Expand Down Expand Up @@ -1097,10 +1105,12 @@ export const databasePageFields: INodeProperties[] = [
],
displayOptions: {
show: {
'@version': [2],
resource: ['databasePage'],
operation: ['get'],
},
hide: {
'@version': [1],
},
},
description: 'The Notion Database Page to get',
},
Expand All @@ -1110,10 +1120,12 @@ export const databasePageFields: INodeProperties[] = [
type: 'boolean',
displayOptions: {
show: {
'@version': [2],
resource: ['databasePage'],
operation: ['get'],
},
hide: {
'@version': [1],
},
},
default: true,
description: 'Whether to return a simplified version of the response instead of the raw data',
Expand Down Expand Up @@ -1254,10 +1266,12 @@ export const databasePageFields: INodeProperties[] = [
type: 'boolean',
displayOptions: {
show: {
'@version': [2],
'/resource': ['databasePage'],
'/operation': ['getAll'],
},
hide: {
'@version': [1],
},
},
default: false,
description: "Whether to download a file if a database's field contains it",
Expand Down
20 changes: 15 additions & 5 deletions packages/nodes-base/nodes/Notion/GenericFunctions.ts
Expand Up @@ -936,10 +936,12 @@ export function getSearchFilters(resource: string) {
],
displayOptions: {
show: {
'@version': [2],
resource: [resource],
operation: ['getAll'],
},
hide: {
'@version': [1],
},
},
default: 'none',
},
Expand All @@ -959,11 +961,13 @@ export function getSearchFilters(resource: string) {
],
displayOptions: {
show: {
'@version': [2],
resource: [resource],
operation: ['getAll'],
filterType: ['manual'],
},
hide: {
'@version': [1],
},
},
default: 'anyFilter',
},
Expand All @@ -976,11 +980,13 @@ export function getSearchFilters(resource: string) {
},
displayOptions: {
show: {
'@version': [2],
resource: [resource],
operation: ['getAll'],
filterType: ['manual'],
},
hide: {
'@version': [1],
},
},
default: {},
placeholder: 'Add Condition',
Expand All @@ -999,11 +1005,13 @@ export function getSearchFilters(resource: string) {
type: 'notice',
displayOptions: {
show: {
'@version': [2],
resource: [resource],
operation: ['getAll'],
filterType: ['json'],
},
hide: {
'@version': [1],
},
},
default: '',
},
Expand All @@ -1013,11 +1021,13 @@ export function getSearchFilters(resource: string) {
type: 'string',
displayOptions: {
show: {
'@version': [2],
resource: [resource],
operation: ['getAll'],
filterType: ['json'],
},
hide: {
'@version': [1],
},
},
default: '',
},
Expand Down
12 changes: 9 additions & 3 deletions packages/nodes-base/nodes/Notion/PageDescription.ts
Expand Up @@ -43,9 +43,11 @@ export const pageOperations: INodeProperties[] = [
noDataExpression: true,
displayOptions: {
show: {
'@version': [2],
resource: ['page'],
},
hide: {
'@version': [1],
},
},
options: [
{
Expand Down Expand Up @@ -127,10 +129,12 @@ export const pageFields: INodeProperties[] = [
],
displayOptions: {
show: {
'@version': [2],
resource: ['page'],
operation: ['archive'],
},
hide: {
'@version': [1],
},
},
description: 'The Notion Page to archive',
},
Expand All @@ -140,10 +144,12 @@ export const pageFields: INodeProperties[] = [
type: 'boolean',
displayOptions: {
show: {
'@version': [2],
resource: ['page'],
operation: ['archive'],
},
hide: {
'@version': [1],
},
},
default: true,
description: 'Whether to return a simplified version of the response instead of the raw data',
Expand Down

0 comments on commit 51d1f5b

Please sign in to comment.