fix(Google Calendar Node): Make it work with public calendars and clean up (#3283)

This commit is contained in:
Michael Kret 2022-05-14 11:44:19 +03:00 committed by GitHub
parent a14d85ea48
commit a7d960c561
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 38 additions and 39 deletions

View file

@ -7,6 +7,7 @@ export const calendarOperations: INodeProperties[] = [
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: [
@ -22,7 +23,6 @@ export const calendarOperations: INodeProperties[] = [
},
],
default: 'availability',
description: 'The operation to perform.',
},
];

View file

@ -7,6 +7,7 @@ export const eventOperations: INodeProperties[] = [
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: [
@ -42,7 +43,6 @@ export const eventOperations: INodeProperties[] = [
},
],
default: 'create',
description: 'The operation to perform.',
},
];
@ -284,12 +284,6 @@ export const eventFields: INodeProperties[] = [
],
default: '',
},
{
displayName: 'Repeat Until',
name: 'repeatUntil',
type: 'dateTime',
default: '',
},
{
displayName: 'Repeat How Many Times?',
name: 'repeatHowManyTimes',
@ -299,6 +293,12 @@ export const eventFields: INodeProperties[] = [
},
default: 1,
},
{
displayName: 'Repeat Until',
name: 'repeatUntil',
type: 'dateTime',
default: '',
},
{
displayName: 'RRULE',
name: 'rrule',
@ -330,13 +330,6 @@ export const eventFields: INodeProperties[] = [
description: 'Whether to send notifications about the creation of the new event',
default: '',
},
{
displayName: 'Summary',
name: 'summary',
type: 'string',
default: '',
description: 'Title of the event',
},
{
displayName: 'Show Me As',
name: 'showMeAs',
@ -356,6 +349,13 @@ export const eventFields: INodeProperties[] = [
default: 'opaque',
description: 'Whether the event blocks time on the calendar',
},
{
displayName: 'Summary',
name: 'summary',
type: 'string',
default: '',
description: 'Title of the event',
},
{
displayName: 'Visibility',
name: 'visibility',
@ -607,7 +607,7 @@ export const eventFields: INodeProperties[] = [
minValue: 1,
maxValue: 500,
},
default: 100,
default: 50,
description: 'Max number of results to return',
},
{
@ -649,7 +649,7 @@ export const eventFields: INodeProperties[] = [
{
name: 'Start Time',
value: 'startTime',
description: 'Order by the start date/time (ascending). This is only available when querying single events (i.e. the parameter singleEvents is True)',
description: 'Order by the start date/time (ascending). This is only available when querying single events (i.e. the parameter singleEvents is True).',
},
{
name: 'Updated',
@ -895,12 +895,6 @@ export const eventFields: INodeProperties[] = [
],
default: '',
},
{
displayName: 'Repeat Until',
name: 'repeatUntil',
type: 'dateTime',
default: '',
},
{
displayName: 'Repeat How Many Times?',
name: 'repeatHowManyTimes',
@ -910,6 +904,12 @@ export const eventFields: INodeProperties[] = [
},
default: 1,
},
{
displayName: 'Repeat Until',
name: 'repeatUntil',
type: 'dateTime',
default: '',
},
{
displayName: 'RRULE',
name: 'rrule',
@ -917,13 +917,6 @@ export const eventFields: INodeProperties[] = [
default: '',
description: 'Recurrence rule. When set, the parameters Repeat Frecuency, Repeat How Many Times and Repeat Until are ignored.',
},
{
displayName: 'Start',
name: 'start',
type: 'dateTime',
default: '',
description: 'Start time of the event',
},
{
displayName: 'Send Updates',
name: 'sendUpdates',
@ -948,13 +941,6 @@ export const eventFields: INodeProperties[] = [
description: 'Whether to send notifications about the creation of the new event',
default: '',
},
{
displayName: 'Summary',
name: 'summary',
type: 'string',
default: '',
description: 'Title of the event',
},
{
displayName: 'Show Me As',
name: 'showMeAs',
@ -974,6 +960,20 @@ export const eventFields: INodeProperties[] = [
default: 'opaque',
description: 'Whether the event blocks time on the calendar',
},
{
displayName: 'Start',
name: 'start',
type: 'dateTime',
default: '',
description: 'Start time of the event',
},
{
displayName: 'Summary',
name: 'summary',
type: 'string',
default: '',
description: 'Title of the event',
},
{
displayName: 'Visibility',
name: 'visibility',

View file

@ -36,7 +36,6 @@ import {
import moment from 'moment-timezone';
import { v4 as uuid } from 'uuid';
import { moveMessagePortToContext } from 'worker_threads';
export class GoogleCalendar implements INodeType {
description: INodeTypeDescription = {
@ -125,7 +124,7 @@ export class GoogleCalendar implements INodeType {
);
for (const calendar of calendars) {
const calendarName = calendar.summary;
const calendarId = calendar.id;
const calendarId = encodeURIComponent(calendar.id);
returnData.push({
name: calendarName,
value: calendarId,