mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
fix(Google Drive Node): Process all input items with List operation (#3525)
* Fix: process all input items in GDrive list * ⚡ linter fixes * ⚡ added versioning * ⚡ fix option naming * ⚡ removed option for choosing list operation behavior * ⚡ Improvement Co-authored-by: Yann Jouanique <yann.jouanique@gmail.com> Co-authored-by: ricardo <ricardoespinoza105@gmail.com>
This commit is contained in:
parent
ce06d9bb3e
commit
ece1836c45
|
@ -21,7 +21,7 @@ export class GoogleDrive implements INodeType {
|
||||||
name: 'googleDrive',
|
name: 'googleDrive',
|
||||||
icon: 'file:googleDrive.svg',
|
icon: 'file:googleDrive.svg',
|
||||||
group: ['input'],
|
group: ['input'],
|
||||||
version: 1,
|
version: [1, 2],
|
||||||
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
||||||
description: 'Access data on Google Drive',
|
description: 'Access data on Google Drive',
|
||||||
defaults: {
|
defaults: {
|
||||||
|
@ -475,7 +475,7 @@ export class GoogleDrive implements INodeType {
|
||||||
minValue: 1,
|
minValue: 1,
|
||||||
maxValue: 1000,
|
maxValue: 1000,
|
||||||
},
|
},
|
||||||
default: 100,
|
default: 50,
|
||||||
description: 'Max number of results to return',
|
description: 'Max number of results to return',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -951,7 +951,7 @@ export class GoogleDrive implements INodeType {
|
||||||
type: 'multiOptions',
|
type: 'multiOptions',
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
name: '*',
|
name: '[All]',
|
||||||
value: '*',
|
value: '*',
|
||||||
description: 'All fields',
|
description: 'All fields',
|
||||||
},
|
},
|
||||||
|
@ -1404,7 +1404,7 @@ export class GoogleDrive implements INodeType {
|
||||||
},
|
},
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
name: '*',
|
name: '[All]',
|
||||||
value: '*',
|
value: '*',
|
||||||
description: 'All spaces',
|
description: 'All spaces',
|
||||||
},
|
},
|
||||||
|
@ -2268,6 +2268,7 @@ export class GoogleDrive implements INodeType {
|
||||||
// Create a shallow copy of the binary data so that the old
|
// Create a shallow copy of the binary data so that the old
|
||||||
// data references which do not get changed still stay behind
|
// data references which do not get changed still stay behind
|
||||||
// but the incoming data does not get changed.
|
// but the incoming data does not get changed.
|
||||||
|
// @ts-ignore
|
||||||
Object.assign(newItem.binary, items[i].binary);
|
Object.assign(newItem.binary, items[i].binary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2365,7 +2366,13 @@ export class GoogleDrive implements INodeType {
|
||||||
|
|
||||||
const files = response!.files;
|
const files = response!.files;
|
||||||
|
|
||||||
|
const version = this.getNode().typeVersion;
|
||||||
|
|
||||||
|
if (version === 1) {
|
||||||
return [this.helpers.returnJsonArray(files as IDataObject[])];
|
return [this.helpers.returnJsonArray(files as IDataObject[])];
|
||||||
|
} else {
|
||||||
|
returnData.push(...files);
|
||||||
|
}
|
||||||
|
|
||||||
} else if (operation === 'upload') {
|
} else if (operation === 'upload') {
|
||||||
// ----------------------------------
|
// ----------------------------------
|
||||||
|
|
Loading…
Reference in a new issue