From 76e77a6f5fef58dd2b89245f769fd8f423611f6a Mon Sep 17 00:00:00 2001 From: Fenris Wolf Date: Thu, 19 Sep 2024 01:40:12 +0200 Subject: [PATCH] [mod] --- data/{example.kal.json => example..json} | 49 +++- data/linke.json | 347 ----------------------- source/api/actions/events.ts | 18 +- source/repositories/resource.ts | 2 +- 4 files changed, 59 insertions(+), 357 deletions(-) rename data/{example.kal.json => example..json} (62%) delete mode 100644 data/linke.json diff --git a/data/example.kal.json b/data/example..json similarity index 62% rename from data/example.kal.json rename to data/example..json index 0bb0608..c07cbbc 100644 --- a/data/example.kal.json +++ b/data/example..json @@ -48,6 +48,36 @@ }, "location": "1st floor", "description": null + }, + { + "name": "clean bathroom", + "begin": { + "timezone_shift": 2, + "date": {"year": 2024, "month": 9, "day": 28}, + "time": {"hour": 10, "minute": 0, "second": 0} + }, + "end": { + "timezone_shift": 2, + "date": {"year": 2024, "month": 9, "day": 28}, + "time": {"hour": 11, "minute": 0, "second": 0} + }, + "location": "1st floor", + "description": null + }, + { + "name": "clean kitchen", + "begin": { + "timezone_shift": 2, + "date": {"year": 2024, "month": 10, "day": 5}, + "time": {"hour": 10, "minute": 0, "second": 0} + }, + "end": { + "timezone_shift": 2, + "date": {"year": 2024, "month": 10, "day": 5}, + "time": {"hour": 11, "minute": 0, "second": 0} + }, + "location": "1st floor", + "description": null } ] } @@ -75,16 +105,31 @@ "name": "garden party", "begin": { "timezone_shift": 2, - "date": {"year": 2024, "month": 9, "day": 21}, + "date": {"year": 2024, "month": 9, "day": 20}, "time": {"hour": 18, "minute": 0, "second": 0} }, "end": { "timezone_shift": 2, - "date": {"year": 2024, "month": 9, "day": 21}, + "date": {"year": 2024, "month": 9, "day": 20}, "time": {"hour": 23, "minute": 0, "second": 0} }, "location": "bob's garden", "description": null + }, + { + "name": "build bird's retreat", + "begin": { + "timezone_shift": 2, + "date": {"year": 2024, "month": 9, "day": 25}, + "time": {"hour": 18, "minute": 0, "second": 0} + }, + "end": { + "timezone_shift": 2, + "date": {"year": 2024, "month": 9, "day": 25}, + "time": {"hour": 23, "minute": 0, "second": 0} + }, + "location": "dorothy's garage", + "description": null } ] } diff --git a/data/linke.json b/data/linke.json deleted file mode 100644 index c6ab387..0000000 --- a/data/linke.json +++ /dev/null @@ -1,347 +0,0 @@ -{ - "users": [ - { - "id": 1, - "object": { - "name": "christian.frass" - } - }, - { - "id": 2, - "object": { - "name": "andre.weichert" - } - }, - { - "id": 3, - "object": { - "name": "steffen.doegnitz" - } - }, - { - "id": 4, - "object": { - "name": "frank.dietrich" - } - }, - { - "id": 5, - "object": { - "name": "michael.berger" - } - }, - { - "id": 6, - "object": { - "name": "roland.schroeder" - } - }, - { - "id": 7, - "object": { - "name": "rene.hahn" - } - }, - { - "id": 8, - "object": { - "name": "max.meierhof" - } - }, - { - "id": 9, - "object": { - "name": "klaus.kleba" - } - }, - { - "id": 10, - "object": { - "name": "tim.detzner" - } - } - ], - "calendars": [ - { - "id": 1, - "object": { - "kind": "concrete", - "data": { - "name": "BV", - "private": false, - "hue": 0.0000000000000000, - "users": [ - ], - "events": [ - { - "name": "9. Bundesparteitag | 1. Sitzung | Tag 1", - "begin": { - "timezone_shift": 2, - "date": {"year": 2024, "month": 10, "day": 18}, - "time": {"hour": 10, "minute": 0, "second": 0} - }, - "end": { - "timezone_shift": 2, - "date": {"year": 2024, "month": 10, "day": 18}, - "time": {"hour": 18, "minute": 0, "second": 0} - }, - "location": "Halle", - "description": null - }, - { - "name": "9. Bundesparteitag | 1. Sitzung | Tag 2", - "begin": { - "timezone_shift": 2, - "date": {"year": 2024, "month": 10, "day": 19}, - "time": {"hour": 10, "minute": 0, "second": 0} - }, - "end": { - "timezone_shift": 2, - "date": {"year": 2024, "month": 10, "day": 19}, - "time": {"hour": 18, "minute": 0, "second": 0} - }, - "location": "Halle", - "description": null - }, - { - "name": "9. Bundesparteitag | 1. Sitzung | Tag 3", - "begin": { - "timezone_shift": 2, - "date": {"year": 2024, "month": 10, "day": 20}, - "time": {"hour": 10, "minute": 0, "second": 0} - }, - "end": { - "timezone_shift": 2, - "date": {"year": 2024, "month": 10, "day": 20}, - "time": {"hour": 18, "minute": 0, "second": 0} - }, - "location": "Halle", - "description": null - } - ] - } - } - }, - { - "id": 2, - "object": { - "kind": "concrete", - "data": { - "name": "LV Sachsen", - "private": false, - "hue": 0.6180339887498949, - "users": [ - { - "id": 9, - "role": "editor" - } - ], - "events": [ - { - "name": "Sören Pellmann zu den Landtagswahlen im Osten", - "begin": { - "timezone_shift": 2, - "date": {"year": 2024, "month": 9, "day": 11}, - "time": {"hour": 18, "minute": 0, "second": 0} - }, - "end": null, - "location": "online: https://v2202002113208108062.supersrv.de/b/har-jbu-lxy-rx1", - "description": null - }, - { - "name": "Erinnern versammeln. Praktiken für die Zukünfte einer Gesellschaft der Vielen.", - "begin": { - "timezone_shift": 2, - "date": {"year": 2024, "month": 9, "day": 13}, - "time": {"hour": 17, "minute": 0, "second": 0} - }, - "end": { - "timezone_shift": 2, - "date": {"year": 2024, "month": 9, "day": 15}, - "time": null - }, - "location": "Weltecho, Annaberger Straße 24, 09111 Chemnitz", - "description": null - }, - { - "name": "Parteikonvent zur Auswertung des Wahljahres", - "begin": { - "timezone_shift": 2, - "date": {"year": 2024, "month": 9, "day": 14}, - "time": {"hour": 10, "minute": 0, "second": 0} - }, - "end": { - "timezone_shift": 2, - "date": {"year": 2024, "month": 9, "day": 14}, - "time": {"hour": 16, "minute": 30, "second": 0} - }, - "location": "Veranstaltungs- und Kulturforum STADTPARK | Hammertal 3 | 09669 Frankenberg/Sachsen", - "description": null - }, - { - "name": "Ist die extreme Rechte noch zu stoppen?", - "begin": { - "timezone_shift": 2, - "date": {"year": 2024, "month": 9, "day": 19}, - "time": {"hour": 19, "minute": 0, "second": 0} - }, - "end": { - "timezone_shift": 2, - "date": {"year": 2024, "month": 9, "day": 19}, - "time": {"hour": 21, "minute": 0, "second": 0} - }, - "location": "online: https://www.dielinke-sachsen.de/termine/?termin_ort=digital-internet-stream", - "description": null - } - ] - } - } - }, - { - "id": 3, - "object": { - "kind": "concrete", - "data": { - "name": "KV Zwickau", - "private": false, - "hue": 0.4721359549995796, - "events": [ - { - "name": "Vorstands-Sitzung", - "begin": { - "timezone_shift": 2, - "date": {"year": 2024, "month": 9, "day": 5}, - "time": {"hour": 18, "minute": 0, "second": 0} - }, - "end": { - "timezone_shift": 2, - "date": {"year": 2024, "month": 9, "day": 5}, - "time": {"hour": 21, "minute": 0, "second": 0} - }, - "location": "Zwickau, Innere Schneeberger Straße 17", - "description": null - } - ] - } - } - }, - { - "id": 4, - "object": { - "kind": "concrete", - "data": { - "name": "OV Glauchau", - "private": false, - "users": [ - { - "id": 1, - "role": "editor" - }, - { - "id": 5, - "role": "editor" - }, - { - "id": 6, - "role": "editor" - } - ], - "hue": 0.09016994374947451, - "events": [ - { - "name": "Kinderspieletag", - "begin": { - "timezone_shift": 2, - "date": {"year": 2024, "month": 9, "day": 8}, - "time": {"hour": 12, "minute": 0, "second": 0} - }, - "end": { - "timezone_shift": 2, - "date": {"year": 2024, "month": 9, "day": 8}, - "time": {"hour": 16, "minute": 0, "second": 0} - }, - "location": null, - "description": null - }, - { - "name": "Mitglieder-Sitzung", - "begin": { - "timezone_shift": 2, - "date": {"year": 2024, "month": 9, "day": 19}, - "time": {"hour": 17, "minute": 30, "second": 0} - }, - "end": { - "timezone_shift": 2, - "date": {"year": 2024, "month": 9, "day": 19}, - "time": {"hour": 19, "minute": 0, "second": 0} - }, - "location": null, - "description": null - } - ] - } - } - }, - { - "id": 5, - "object": { - "kind": "concrete", - "data": { - "name": "OV Zwickau", - "private": false, - "hue": 0.09016994374947451, - "users": [ - { - "id": 7, - "role": "editor" - }, - { - "id": 8, - "role": "viewer" - } - ], - "events": [ - { - "name": "4ter Christopher Street Day", - "begin": { - "timezone_shift": 2, - "date": {"year": 2024, "month": 8, "day": 31}, - "time": {"hour": 10, "minute": 0, "second": 0} - }, - "end": { - "timezone_shift": 2, - "date": {"year": 2024, "month": 8, "day": 31}, - "time": {"hour": 17, "minute": 0, "second": 0} - }, - "location": "Zwickau", - "description": null - }, - { - "name": "Regionaltreffen Westsachsen: Schule ohne Rassismus – Schule mit Courage", - "begin": { - "timezone_shift": 2, - "date": {"year": 2024, "month": 9, "day": 19}, - "time": {"hour": 9, "minute": 0, "second": 0} - }, - "end": null, - "location": null, - "description": null - } - ] - } - } - }, - { - "id": 6, - "object": { - "kind": "caldav", - "data": { - "name": "Lixer", - "private": true, - "url": "https://export.kalender.digital/ics/0/3e10dae66950379d4cc8/gesamterkalender.ics?past_months=3&future_months=36", - "read_only": true - } - } - } - ] -} diff --git a/source/api/actions/events.ts b/source/api/actions/events.ts index 713d01f..f4e4d5b 100644 --- a/source/api/actions/events.ts +++ b/source/api/actions/events.ts @@ -130,16 +130,20 @@ namespace _zeitbild.api .map((x : any) => x.id) ); const calendar_ids : Array<_zeitbild.type.calendar_id> = ( - (calendar_ids_wanted === null) - ? - calendar_ids_allowed - : ( - calendar_ids_wanted - .filter( - (calendar_id) => calendar_ids_allowed.includes(calendar_id) + (calendar_ids_wanted === null) + ? + calendar_ids_allowed + : + ( + calendar_ids_wanted + .filter( + (calendar_id) => calendar_ids_allowed.includes(calendar_id) + ) ) ) + // @ts-ignore + .toSorted() ); const data = await _zeitbild.service.calendar.gather_events( calendar_ids, diff --git a/source/repositories/resource.ts b/source/repositories/resource.ts index c57efe7..ea92e71 100644 --- a/source/repositories/resource.ts +++ b/source/repositories/resource.ts @@ -435,7 +435,7 @@ namespace _zeitbild.repository.resource "read_only": resource_object.data.read_only, } ); - const resource_id : _zeitbild.type.resource_id = await get_local_resource_core_store().create( + const resource_id : _zeitbild.type.resource_id = await get_resource_core_store().create( { "kind": "caldav", "sub_id": caldav_resource_id,