Commit Graph

104 Commits

Author SHA1 Message Date
lenhanphung bd33a93040 feat: #339 Add email notification toggle setting and update tests (#387) 2025-12-08 10:54:24 +01:00
Camille Moussu 1056220719 [#339] added API calls to timezone selectors (#396)
Co-authored-by: Camille Moussu <cmoussu@linagora.com>
2025-12-07 07:43:00 +01:00
Camille Moussu 193c1a7166 [#337] added timezone loading from backend (#386)
* [#337] added timezone loading from backend

* [#337] changed data structure to allow patching timezone while keeping other datetime params value

* [#337] fixed gap, event create modale sync with settings and added checkbox

* [#337] isBrowserDefaultTimezone is set to true when API return null timezone

Co-authored-by: Camille Moussu <cmoussu@linagora.com>
2025-12-04 15:14:43 +01:00
Camille Moussu 325d33caef [#361] Improve search result page (#375)
* [#361] added back button

* [#361] greatly improved looks of results

* [#361] added popup on click

* [#361] removed classnames with \!important replaced with style in component

---------

Co-authored-by: Camille Moussu <cmoussu@linagora.com>
2025-12-02 15:26:00 +01:00
lenhanphung c408e1818f feat: #333 load language from backend configuration (#377)
* feat: #333 load language from backend configuration

* feat(settings): sync language with user configs api

* Update __test__/features/Settings/SettingsPage.test.tsx

Co-authored-by: Lê Nhân Phụng <lenhanphung@Phung-Mac-M4.local>
Co-authored-by: Benoit TELLIER <btellier@linagora.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-12-02 10:06:11 +01:00
Camille Moussu ae17ac2bd6 #12 topbar search (#371)
- added search in topbar
 - added skeleton search results page
 - added tests
 - set personal calendars as default search in and allow to select personal and shared as a search in option

---------

Co-authored-by: Camille Moussu <cmoussu@linagora.com>
2025-11-28 14:54:13 +01:00
lenhanphung 1a85afc57d UI: #334 add config page language setting (#374)
* UI: #334 add config page language setting

* temporary remove logout button

* Unify fullscreen view class for dialog expanded and settings view

- Replace dialog-expanded and settings-view with single fullscreen-view class
- Update ResponsiveDialog to use fullscreen-view class
- Update CalendarLayout to use fullscreen-view class for settings view
- Consolidate CSS rules in Menubar.styl to use fullscreen-view
- Update test cases to use new class name

---------

Co-authored-by: Lê Nhân Phụng <lenhanphung@Phung-Mac-M4.local>
2025-11-28 14:25:06 +01:00
Benoit TELLIER 65c26f7627 [#318] implement SEQUENCE field for ICS events (#362)
- Add SEQUENCE property to ICS generation (starts at 1 for new events)
- Increment SEQUENCE on event updates (modal, drag & drop, resize)
- Handle SEQUENCE independently for recurring event instances
- Add comprehensive tests for SEQUENCE generation and incrementation
- Ensure proper event ordering for remote calendar participants

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-11-27 08:58:31 +01:00
lenhanphung 9151ff5563 fix: preserve form data on API error and fix test cases (#338)
- Add temp storage utility (eventFormTempStorage.ts) to save/restore form data
- Implement error handling: close modal immediately, reopen on API failure with saved data
- Add event listeners in Calendar.tsx and EventDisplayPreview.tsx to reopen modals on error
- Fix calendar change logic in EventUpdateModal: use oldCalendar for update before move
- Update all test mocks to support .unwrap() method for Redux thunks
- Add sessionStorage.clear() in test beforeEach hooks
- Fix test timing issues with act() wrappers and increased timeouts
- Mock putEventAsync in TempUpdate test to ensure updateTempCalendar is called

- Fix update modal not reopening when API fails for recurring events (solo/all)
- Move update modal reopen logic from EventDisplayPreview to Calendar.tsx
- Use sessionStorage to persist update modal info across component unmounts
- Handle typeOfAction matching for recurring events (undefined vs solo/all)
- Fix error handling in updateEventInstanceAsync and updateSeriesAsync
- Ensure all API failures properly dispatch eventModalError event
2025-11-25 15:30:58 +01:00
lenhanphung ffe14b6b6c refactor: #331 use Snackbar for event errors and add tests (#351)
Co-authored-by: Lê Nhân Phụng <lenhanphung@Phung-Mac-M4.local>
2025-11-25 11:17:06 +01:00
Camille Moussu fd588b4749 [#326] fixed attendees preview string + extensive tests (#357)
Co-authored-by: Camille Moussu <cmoussu@linagora.com>
2025-11-25 11:15:47 +01:00
Camille Moussu 531d29f2ce [#313] removed withRights (#354)
Co-authored-by: Camille Moussu <cmoussu@linagora.com>
2025-11-24 21:32:15 +01:00
lenhanphung 007266e7b0 Fix: #319 attendee role: use REQ-PARTICIPANT instead of CHAIR for nor… (#349)
- Change role from CHAIR to REQ-PARTICIPANT when adding attendees via PeopleSearch
- Keep CHAIR role only for organizers
2025-11-20 12:00:17 +01:00
lenhanphung bff1af31bd Fix: Preserve timezone used in create and update modal (#301)
- Fix timezone field display in event modals to show original timezone from server
- Fix formatDateToICal to use moment.utc(date).tz(timezone) for correct UTC instant preservation
- Fix parseCalendarEvent to convert event.start/end to ISO UTC strings after parsing
- Fix eventToFullCalendarFormat to ensure event times are ISO UTC before passing to FullCalendar
- Fix getEvent to normalize event.start/end to ISO UTC strings
- Ensure event.timezone is always set (defaults to Etc/UTC if not detected)
- Update eventUtils.test.ts to match new timezone conversion logic
- Fix event time shift issue on calendar grid display

This ensures:
- Events display in correct time slots on calendar grid
- Event times are correctly converted between timezones
- Original timezone from server is preserved and displayed
- All event times are stored as ISO UTC strings internally

* refactor: eliminate datetime format detection code duplication

- Add constants for datetime format strings and magic number (DATETIME_WITH_SECONDS_LENGTH, DATETIME_FORMAT_WITH_SECONDS, DATETIME_FORMAT_WITHOUT_SECONDS)
- Create shared detectDateTimeFormat() function to replace duplicated format detection logic
- Refactor convertFormDateTimeToISO, convertEventDateTimeToISO, and convertDateTimeStringToISO to use shared helper
- Add console.warn logging when invalid datetime is encountered (addresses silent fallback issue)
- Add comprehensive test coverage for dateTimeHelpers with full test suite
2025-11-20 09:32:15 +01:00
Camille Moussu ca2e8a479a [#309] homogenized add add Desc button (#345)
Co-authored-by: Camille Moussu <cmoussu@linagora.com>
2025-11-19 15:23:37 +01:00
Camille Moussu cb69455a9b [#239] refresh is triggered only on save (#329)
Co-authored-by: Camille Moussu <cmoussu@linagora.com>
2025-11-18 10:41:58 +01:00
lenhanphung ffe204d60b refactor: stabilize calendar loading effects and menubar redirect
- Memoize calendar range strings and stabilize effect deps
- Guard updateDarkColor to avoid dispatch loops
- Add resilient cache-clear handling with refs
- Memoize calendar/temp ids to prevent rerenders
- Update event handler hooks with missing deps
- Add guards and dependency fixes across Calendar effects
2025-11-18 10:40:19 +01:00
Camille Moussu 1bc9b0c160 [#268] changed timezone offset calculation (#306)
Co-authored-by: Camille Moussu <cmoussu@linagora.com>
2025-11-14 08:52:02 +01:00
Camille Moussu 85ccf8e14d [#271] abort truly goes through when removing user in cal search (#295)
Co-authored-by: Camille Moussu <cmoussu@linagora.com>
2025-11-13 09:24:34 +01:00
Camille Moussu 6305f55d1a [#67] added export calendar functionnality (#294)
Co-authored-by: Camille Moussu <cmoussu@linagora.com>
2025-11-12 20:42:35 +01:00
Camille Moussu f886846a2b [#265] prefills title + trad + test (#293)
Co-authored-by: Camille Moussu <cmoussu@linagora.com>
2025-11-12 20:42:05 +01:00
Camille Moussu daed6d97ed [#69] added secret link for calendars (#284)
Co-authored-by: Camille Moussu <cmoussu@linagora.com>
Co-authored-by: Benoit TELLIER <btellier@linagora.com>
2025-11-07 08:30:47 +01:00
Camille Moussu e085e4c893 [#276] remove false from all day date subtitle (#289)
Co-authored-by: Camille Moussu <cmoussu@linagora.com>
2025-11-07 08:08:16 +01:00
Camille Moussu 36bc027d6d [#82] added cozy-ui for internationnalisation (#267)
Co-authored-by: Camille Moussu <cmoussu@linagora.com>
2025-11-06 15:46:58 +01:00
lenhanphung c1f37e3ebd feat: improve date/time fields UI and logic
- Change 'Start Date' label to 'Date' when only single date field is visible in normal mode
- Fix all-day slot display: show correct start/end dates for single click and multi-day drag
- Update API save logic: add +1 day to end date for all-day events (API requirement)
- Migrate from moment to dayjs for date handling with AdapterDayjs
- Remove manual date clamping logic - MUI/dayjs handles invalid dates automatically
- Add validation guard to prevent invalid dates from clearing field values
- Update test case to match new all-day event API behavior
2025-11-05 10:25:41 +01:00
lenhanphung 41b4c41215 Event form UX improvements:
- Add long date format display (Monday, April 23, 2024)
- Use 24h time format
- Show/hide time fields based on all-day state
- Remove auto-update of end date when start date changes
- Fix validation for all-day events
- Auto-expand for multi-day events
- Set default time when toggling off all-day from all-day slot
2025-11-05 10:25:41 +01:00
lenhanphung 5078128e10 test: fix test cases for MUI DatePicker and TimePicker migration
- Add data-testid attributes to DatePicker and TimePicker components in DateTimeFields
- Update test queries from getByLabelText to getByTestId for date/time inputs
- Fix assertions to use toHaveAttribute instead of toHaveValue for MUI pickers
- Add data-testid to occurrences-input in EventRepeat component
- Update RepeatEvent test to use data-testid for occurrences input
- Fix radio button queries using getAllByLabelText with type filter
2025-11-05 10:25:41 +01:00
lenhanphung 701f2f2b71 feat: Split datetime fields
- Replace single datetime-local field with 4 separate fields:

- Add helper functions:
  * splitDateTime(): Split datetime string into date and time parts
  * combineDateTime(): Combine date and time into datetime string

- Implement internal state management:
  * startDate, startTime, endDate, endTime internal states
  * Sync effects to update internal states from start/end props
  * Change handlers for each field that combine values and call parent handlers

- Fix test cases:
  * Update EventModal.test.tsx, EventUpdateModal.test.tsx to use new field labels
  * Change from 'Start'/'End' to 'Start Date'/'Start Time'/'End Time'/'End Date'
2025-11-05 10:25:41 +01:00
Camille Moussu 2d0803090a [#278] fixed unprefilled calendar and added test (#279)
Co-authored-by: Camille Moussu <cmoussu@linagora.com>
2025-11-04 14:14:29 +01:00
Camille Moussu 42f5d8e1a9 #204 Error management (#237)
* added error snackbar for api fails
* improved error page to be shown only for userdata errors and to allow retrying
* fixed test breaking only in local because of timezone and reduced warnings for easier reading of tests results
* added error management for failure inside calendars imports
* added error snackbar for api fails
* improved error page to be shown only for userdata errors and to allow retrying
* added error management for failure inside calendars imports

Co-authored-by: Camille Moussu <cmoussu@linagora.com>
2025-10-27 11:23:38 +01:00
Camille Moussu 9c5abb7fbd [#242] fixed calendar color creation API call (#243)
Co-authored-by: Camille Moussu <cmoussu@linagora.com>
2025-10-24 13:14:19 +02:00
Camille Moussu 8813bff48c Calendar subscription naming (#235)
Co-authored-by: Camille Moussu <cmoussu@linagora.com>
2025-10-24 12:47:18 +02:00
Camille Moussu 34363562cc Color picker rework (#232)
Co-authored-by: Camille Moussu <cmoussu@linagora.com>
2025-10-24 01:20:56 +02:00
lenhanphung 8681e88390 fix: preserve recurrence exceptions when RSVP to recurring events (#234)
When an attendee accepts/rejects/tentative a recurring event with
exceptions, only update the PARTSTAT without removing exception events.

Add removeOverrides: false parameter to updateSeriesAsync call in
handleRSVP function to preserve all recurrence exceptions.

Fixes: Recurrence exceptions being deleted when accepting/rejecting
all events in a recurring series

* fix: update PARTSTAT on all VEVENTs when RSVP to recurring events

When an attendee accepts/rejects/tentative a recurring event with exceptions,
update PARTSTAT on ALL VEVENTs (master + exceptions) to reflect the correct
attendance status across the entire series.

Changes:
- Add updateSeriesPartstat() in EventApi.ts to update PARTSTAT on all VEVENTs
- Update handleRSVP() to use new function instead of updateSeriesAsync
- Preserve exception times while updating PARTSTAT consistently
- Update test to verify new function is called correctly

Fixes: Exception events not accepting when user chooses 'Accept all events'
2025-10-23 05:36:34 +02:00
Camille Moussu 6411ed636b [#197] added missing infos 2025-10-20 14:03:42 +02:00
Camille Moussu f278caf041 [#168] changed temp calendar reload to reload only thoses that are impacted 2025-10-17 11:26:50 +02:00
Camille Moussu 29f984b347 [#168] added refresh to temp calendars when updating 2025-10-17 11:26:50 +02:00
lenhanphung b9905cbb7a refactor(tests): use getByRole instead of getByText for interactive elements
- Refactor ~47 test cases across 7 test files to use getByRole
- Improve accessibility testing coverage following Testing Library best practices
- Make tests more robust against text changes (i18n, copy updates)
- Test elements as users (especially screen readers) interact with them
2025-10-16 10:36:28 +02:00
lenhanphung 4c18bf3a52 feat: Update event modal UI with header icons and improved actions layout
- Add expand and close icons to ResponsiveDialog header in normal mode
- Change 'Show More' button to 'More options' with Add icon
- Hide Cancel button in normal mode, show only in extended mode
- Add showHeaderActions prop to ResponsiveDialog for UI control
- Preserve EventDisplayPreview modal with old UI (no header icons)
- Update all affected test cases to match new UI behavior
2025-10-16 10:36:28 +02:00
lenhanphung 882f4a9fd1 fix: update EventDisplayPreview import path in TimezoneInGrid test 2025-10-15 08:29:28 +02:00
lenhanphung 5c38b2fd99 refactor: extract complex logic from EventUpdateModal to testable helpers
- Add combineMasterDateWithFormTime helper for date/time combination
- Add detectRecurringEventChanges helper for change detection
- Add normalizeRepetition and normalizeTimezone utilities
- Reduce EventUpdateModal complexity
- Add 18 unit tests for new helpers
2025-10-15 08:29:28 +02:00
lenhanphung 192ab17789 test: fix timezone issues in EventDisplay tests
- Set explicit UTC timezone globally in jest.config.ts and setupTests.ts
- Mock Intl.DateTimeFormat to use UTC by default while preserving prototype
- Replace regex patterns with exact values for declarative assertions
- Remove complex date formatting computations in tests
- Use fixed dates (2025-01-15T10:00:00.000Z) for consistent test results
- Fix EventDisplay.test.tsx to use exact time values instead of regex
2025-10-15 08:29:28 +02:00
lenhanphung 942b203b0f fix: correct recurring to non-recurring event update logic
- Fix bug where updating recurring event to non-recurring created duplicate events
- Deduplicate URLs before deletion to avoid multiple delete calls on same file
- Add onCloseAll prop to close both preview and update modals after save
- Adjust smooth UI

Resolves issue where repeat->no-repeat conversion left old recurring events visible
2025-10-15 08:29:28 +02:00
lenhanphung 757060946f test: add non-regression tests for recurring to non-recurring conversion
- Add comprehensive integration test for happy path conversion flow
- Test verifies deleteEvent API called with correct URL
- Test verifies new event created without repetition and with new UID
- Test verifies store cleanup removes all old instances
- Test verifies refreshCalendars called after conversion
- Add test for error handling when API deletion fails
- Add test to verify calendar refresh mechanism
2025-10-15 08:29:28 +02:00
lenhanphung 2932607afb test: improve test assertions with exact value matching
- Replace regex patterns with exact equality assertions where possible
- Update 'toggle all-day' test to use exact date value instead of regex
- Keep regex for time range in preview as format varies by implementation
- Address Ben concern about meaningful test assertions
2025-10-15 08:29:28 +02:00
lenhanphung 4d346751bf style: fix prettier 2025-10-15 08:29:28 +02:00
lenhanphung 8160ed459a feat: restore logging for status 201 in putEvent as requested in PR #54
- Restore test case to verify logging behavior
2025-10-15 08:29:28 +02:00
lenhanphung faa1060949 refactor: improve test fixed timezone usage
- Agree with Ben concern about meaningful test assertions
2025-10-15 08:29:28 +02:00
lenhanphung 9b0e3446aa test: add timezone handling test cases as requested by chibenwa
- Add test for EventDisplay showing event in user local timezone
- Add test for EventUpdateModal displaying time in original event timezone
- Test verifies event at 2PM UTC+7 is displayed as 2PM in Asia/Bangkok when editing
- Create new test file EventUpdateModal.test.tsx for update modal specific tests
2025-10-15 08:29:28 +02:00
lenhanphung f88639951b test: put back test case for recurring event update with typeOfAction 2025-10-15 08:29:28 +02:00