Skip to content

Commit

Permalink
fix(Google Calendar Node): Make it work with public calendars and cle…
Browse files Browse the repository at this point in the history
…an up (#3283)
  • Loading branch information
michael-radency committed May 14, 2022
1 parent a14d85e commit a7d960c
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 39 deletions.
Expand Up @@ -7,6 +7,7 @@ export const calendarOperations: INodeProperties[] = [
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: [
Expand All @@ -22,7 +23,6 @@ export const calendarOperations: INodeProperties[] = [
},
],
default: 'availability',
description: 'The operation to perform.',
},
];

Expand Down
72 changes: 36 additions & 36 deletions packages/nodes-base/nodes/Google/Calendar/EventDescription.ts
Expand Up @@ -7,6 +7,7 @@ export const eventOperations: INodeProperties[] = [
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: [
Expand Down Expand Up @@ -42,7 +43,6 @@ export const eventOperations: INodeProperties[] = [
},
],
default: 'create',
description: 'The operation to perform.',
},
];

Expand Down Expand Up @@ -284,12 +284,6 @@ export const eventFields: INodeProperties[] = [
],
default: '',
},
{
displayName: 'Repeat Until',
name: 'repeatUntil',
type: 'dateTime',
default: '',
},
{
displayName: 'Repeat How Many Times?',
name: 'repeatHowManyTimes',
Expand All @@ -299,6 +293,12 @@ export const eventFields: INodeProperties[] = [
},
default: 1,
},
{
displayName: 'Repeat Until',
name: 'repeatUntil',
type: 'dateTime',
default: '',
},
{
displayName: 'RRULE',
name: 'rrule',
Expand Down Expand Up @@ -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',
Expand All @@ -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',
Expand Down Expand Up @@ -607,7 +607,7 @@ export const eventFields: INodeProperties[] = [
minValue: 1,
maxValue: 500,
},
default: 100,
default: 50,
description: 'Max number of results to return',
},
{
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -895,12 +895,6 @@ export const eventFields: INodeProperties[] = [
],
default: '',
},
{
displayName: 'Repeat Until',
name: 'repeatUntil',
type: 'dateTime',
default: '',
},
{
displayName: 'Repeat How Many Times?',
name: 'repeatHowManyTimes',
Expand All @@ -910,20 +904,19 @@ export const eventFields: INodeProperties[] = [
},
default: 1,
},
{
displayName: 'Repeat Until',
name: 'repeatUntil',
type: 'dateTime',
default: '',
},
{
displayName: 'RRULE',
name: 'rrule',
type: 'string',
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',
Expand All @@ -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',
Expand All @@ -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',
Expand Down
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit a7d960c

Please sign in to comment.