cal-101-caldav-integration (#419)

* add generic calendar icon for caldav

* module for symmetric encrypt/decrypt

* caldav integration

* use Radix dialog

* Move caldav components to /caldav

* remove duplicate cancel button, unused function

* ensure app can connect to caldav server before adding

* fix calendar clients can possibly return null

* fix: add caldav dialog does not close when submitted

* safely attempt all caldav operations

* clarify variable name, fix typo

* use common helper for stripping html

* remove usage of request lib until "completed"

* add types and usage comments to crypto lib

* add encryption key to example env file
This commit is contained in:
Femi Odugbesan authored and GitHub committed 2021-08-14 20:53:59 -05:00
1 parent 21c709ee46
commit 65366b7c5b
13 files changed
+706 -30

No files matched your search

+4 -1
View File
@@ -9,6 +9,7 @@ import { EventResult } from "@lib/events/EventManager";
import logger from "@lib/logger";
const log = logger.getChildLogger({ prefix: ["[lib] calendarClient"] });
import { CalDavCalendar } from "./integrations/CalDav/CalDavCalendarAdapter";
// eslint-disable-next-line @typescript-eslint/no-var-requires
const { google } = require("googleapis");
@@ -516,6 +517,8 @@ const calendars = (withCredentials): CalendarApiAdapter[] =>
return GoogleCalendar(cred);
case "office365_calendar":
return MicrosoftOffice365Calendar(cred);
case "caldav_calendar":
return new CalDavCalendar(cred);
default:
return; // unknown credential, could be legacy? In any case, ignore
}
@@ -531,7 +534,7 @@ const getBusyCalendarTimes = (withCredentials, dateFrom, dateTo, selectedCalenda
const listCalendars = (withCredentials) =>
Promise.all(calendars(withCredentials).map((c) => c.listCalendars())).then((results) =>
results.reduce((acc, calendars) => acc.concat(calendars), [])
results.reduce((acc, calendars) => acc.concat(calendars), []).filter((c) => c != null)
);
const createEvent = async (