fix(Google Tasks Node): Fix "Show Completed" option and hide title field where not needed (#2741)

* 🐛 Google Tasks: Fix showCompleted

*  Improvements

Co-authored-by: ricardo <ricardoespinoza105@gmail.com>
This commit is contained in:
Tom 2022-04-01 08:32:41 +02:00 committed by GitHub
parent 97ed5f8c1e
commit 9d703e366b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 13 deletions

View file

@ -171,7 +171,7 @@ export class GoogleTasks implements INodeType {
//https://developers.google.com/tasks/v1/reference/tasks/list //https://developers.google.com/tasks/v1/reference/tasks/list
const returnAll = this.getNodeParameter('returnAll', i) as boolean; const returnAll = this.getNodeParameter('returnAll', i) as boolean;
const taskListId = this.getNodeParameter('task', i) as string; const taskListId = this.getNodeParameter('task', i) as string;
const options = this.getNodeParameter( const { showCompleted = true, showDeleted = false, showHidden = false, ...options } = this.getNodeParameter(
'additionalFields', 'additionalFields',
i, i,
) as IDataObject; ) as IDataObject;
@ -187,15 +187,11 @@ export class GoogleTasks implements INodeType {
if (options.dueMax) { if (options.dueMax) {
qs.dueMax = options.dueMax as string; qs.dueMax = options.dueMax as string;
} }
if (options.showCompleted) {
qs.showCompleted = options.showCompleted as boolean; qs.showCompleted = showCompleted;
} qs.showDeleted = showDeleted;
if (options.showDeleted) { qs.showHidden = showHidden;
qs.showDeleted = options.showDeleted as boolean;
}
if (options.showHidden) {
qs.showHidden = options.showHidden as boolean;
}
if (options.updatedMin) { if (options.updatedMin) {
qs.updatedMin = options.updatedMin as string; qs.updatedMin = options.updatedMin as string;
} }

View file

@ -76,6 +76,16 @@ export const taskFields: INodeProperties[] = [
type: 'string', type: 'string',
default: '', default: '',
description: 'Title of the task.', description: 'Title of the task.',
displayOptions: {
show: {
operation: [
'create',
],
resource: [
'task',
],
},
},
}, },
{ {
displayName: 'Additional Fields', displayName: 'Additional Fields',
@ -350,21 +360,21 @@ export const taskFields: INodeProperties[] = [
name: 'showCompleted', name: 'showCompleted',
type: 'boolean', type: 'boolean',
default: true, default: true,
description: 'Flag indicating whether completed tasks are returned in the result', description: 'Flag indicating whether completed tasks are returned in the result. <strong>Show Hidden</strong> must also be True to show tasks completed in first party clients such as the web UI or Google\'s mobile apps.',
}, },
{ {
displayName: 'Show Deleted', displayName: 'Show Deleted',
name: 'showDeleted', name: 'showDeleted',
type: 'boolean', type: 'boolean',
default: false, default: false,
description: 'Flag indicating whether deleted tasks are returned in the result', description: 'Flag indicating whether deleted tasks are returned in the result.',
}, },
{ {
displayName: 'Show Hidden', displayName: 'Show Hidden',
name: 'showHidden', name: 'showHidden',
type: 'boolean', type: 'boolean',
default: false, default: false,
description: 'Flag indicating whether hidden tasks are returned in the result', description: 'Flag indicating whether hidden tasks are returned in the result.',
}, },
{ {
displayName: 'Updated Min', displayName: 'Updated Min',