Commit Graph

145 Commits

Author SHA1 Message Date
Ryan Mwangi be6d378890 style: refactor async functions to use traditional function declaration syntax
- Converted async arrow functions to traditional function declarations for consistency
- Updated  and  to use  syntax
- Maintained overall functionality while improving readability and alignment with preferred style
2024-11-08 15:49:33 +03:00
Ryan Mwangi 11a4efe30b fix: ensure valid date-time handling in event components
- Resolved calendar merging error where ICAL.js rejected formatted date-time strings by refactoring  and  initialization to use  for accurate timezone conversion.
- Updated  and  to receive ICAL.Time objects directly, ensuring proper format consistency and timezone handling in event components.
2024-11-08 14:23:30 +03:00
Ryan Mwangi db78a0121e refactor: Refactor addEventsToCalendar to properly handle date validation and usage
- Updated the handling of start and end dates in the addEventsToCalendar function.
- Added validation checks directly on startDate and endDate to ensure they are valid before updating event properties.
- Improved logging for better traceability of event addition and date handling.

Note: The changes are intended to enhance the handling of date properties, but further testing is required to ensure full functionality.
2024-11-08 02:21:22 +03:00
Ryan Mwangi 1bb1db7326 logging: log result.data as I debug. correct synta as wellx 2024-11-07 20:37:23 +03:00
Ryan Mwangi 73135dd9d4 refactor: use ical.js to generate calendar merged and refreshed calendars 2024-11-07 20:27:43 +03:00
Ryan Mwangi 8e143df754 refactor: replace event addition with ical.js
- transition event processing from ical-generator to ical.js
- add logging for event addition to calendar component
- preserve event details (uid, summary, start, end) in new event components
2024-11-07 20:11:48 +03:00
Ryan Mwangi b32696f14c refactor: refactor endpoint to serve refreshed merge calendars 2024-11-07 14:43:41 +03:00
Ryan Mwangi cdc25981b5 refactor: streamline calendar refresh logic with refreshCalendarData helper 2024-11-07 14:35:25 +03:00
Ryan Mwangi 1dde451f9d refactor: refactor endpoint to merge calendars 2024-11-07 14:33:24 +03:00
Ryan Mwangi 00f5fedb2a refactor: encapsulate calendar file saving with saveCalendarFile helper 2024-11-07 14:25:02 +03:00
Ryan Mwangi 1bc7119b08 refactor: modularize event merging with mergeCalendarEvents helper 2024-11-07 14:23:24 +03:00
Ryan Mwangi 0c61cb0e7c refactor: centralize calendar data retrieval with fetchCalendarData helper 2024-11-07 14:20:56 +03:00
Ryan Mwangi af74d809c4 refactor: refactor sanitizeFilename utility that ensures valid file names 2024-11-07 14:18:18 +03:00
Ryan Mwangi cf10a62049 refactor: streamline static file serving 2024-11-07 14:11:09 +03:00
xeruf 495557e6c2 refactor: add starter script 2024-11-07 10:28:11 +01:00
xeruf 8eb44e18f6 fix(server.js): properly propagate errors 2024-11-07 10:15:37 +01:00
Ryan Mwangi 6c9fb1139f fix(tests): ensure calendar file path is correct
- Updated file path in merge date-based calendar test to point to the 'calendar' directory within TEST_MERGED_CALENDARS_DIR.
2024-11-07 03:44:11 +03:00
xeruf 2a9af9c1d5 test: rearrange test directories
WIP - need to adjust code to use proper working directory
2024-11-06 20:58:29 +01:00
Ryan Mwangi f5ff331f2f fix: Ensure correct merged calendars directory path based on environment
- Updated MERGED_CALENDARS_DIR to use path.join for consistent path resolution.
- Ensured that the directory is correctly set to 'temp_test_calendar' during tests and 'calendar' in production.
2024-11-06 15:20:24 +03:00
Ryan Mwangi a2468b7dfb test(calendar.test.js):set us snapshot testing 2024-11-05 15:19:34 +03:00
Ryan Mwangi 6abaa4bd4b fix(server.js): Determine the merged calendars directory based on the environment 2024-11-05 14:47:25 +03:00
Ryan Mwangi f50c7a603b test (calendar.test.js): define temp_test_calendar in server 2024-11-05 14:41:39 +03:00
Ryan Mwangi 996623b3d7 test (calendar.test.js): Add logging 2024-11-05 14:32:53 +03:00
Ryan Mwangi 5cfd0955f1 chore(server.js):Update Server Code to Use Environment Variable 2024-11-04 21:14:31 +03:00
Ryan Mwangi 4d58b51458 remove previous code for parsing calendar data using ical 2024-11-04 15:26:36 +03:00
Ryan Mwangi a752485d5e check if calendar is date based or event based in calendar/:name endpoint 2024-11-04 15:24:33 +03:00
Ryan Mwangi c264c6b842 parse calendar data in calendar/:name endpoint with ICAL 2024-11-04 15:23:21 +03:00
Ryan Mwangi c78b0501ea import ICAL from ical.js 2024-11-04 15:21:13 +03:00
Ryan Mwangi 79c5183971 check if calendar is date based or event based 2024-11-04 15:15:47 +03:00
Ryan Mwangi 698494dc27 import ical from ical.js in server.js 2024-11-04 15:08:47 +03:00
Ryan Mwangi 55287b9a75 Conditional Server Start in server.js for Test Environment 2024-11-04 14:23:09 +03:00
Ryan Mwangi 1631ba3478 Fetch calendar data from URL 2024-11-04 13:56:48 +03:00
Ryan Mwangi f677014cb1 add logging for catch error block 2024-11-04 13:51:49 +03:00
Ryan Mwangi d2f3afd9fa Read calendar data from local file 2024-11-04 13:51:00 +03:00
Ryan Mwangi 978ddb9ebc Check if calendar URL is a file path or a URL 2024-11-04 13:46:44 +03:00
Ryan Mwangi 46b24b724a add logging to ensure file merging logic is working 2024-10-31 15:27:46 +03:00
Ryan Mwangi 3f2fb01bf1 add logging to ensure file saving logic is working 2024-10-31 15:26:36 +03:00
Ryan Mwangi 88ab9c53a1 add logging to ensure file creation logic is working 2024-10-31 15:24:02 +03:00
Ryan Mwangi 3d62557fa3 sanitize linkgroup name to replace spaces with underscores 2024-10-30 16:01:10 +03:00
Ryan Mwangi 5583224c33 ensure server only starts on the server side code when it's not a test 2024-10-30 15:44:16 +03:00
Ryan Mwangi 87c4d4686f Ensure that event.start is a string before calling includes. If it's a Date object, convert it to a string using toISOString(). 2024-10-30 15:35:44 +03:00
Ryan Mwangi b86d96b4d6 export app from server.js 2024-10-29 21:49:34 +03:00
Ryan Mwangi a77279273a for date based events use the date part only in the /calendar/:name endpoint 2024-10-29 15:47:58 +03:00
Ryan Mwangi c6300bd68f for date based events use the date part only 2024-10-29 15:44:49 +03:00
Ryan Mwangi 8ba0bae716 add time and date based events as test code in /calendar/:name endpoint 2024-10-29 15:38:50 +03:00
Ryan Mwangi ba597a2556 check if the event is date-based or time-based 2024-10-29 15:32:17 +03:00
Ryan Mwangi e2d40b3fc5 get rid of the updateMergedCalendars function 2024-10-29 02:36:18 +03:00
Ryan Mwangi 7c01cfc964 get rid of end point to refresh merged calender using the refresh button 2024-10-29 02:35:10 +03:00
Ryan Mwangi 8031333bce save the calendar to a file 2024-10-29 02:31:58 +03:00
Ryan Mwangi 8927cc1cd3 parse calendar data using ical-generator 2024-10-29 02:31:00 +03:00