Commit Graph

253 Commits

Author SHA1 Message Date
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
lenhanphung 9ff8354950 fix: update EventDisplay and EventRepetition tests
- Fix formatLocalDateTime import in EventDisplay.tsx (now in EventFormFields)
- Update test expectations: 'Edit Event' -> 'Update Event'
- Remove getEventAsync spy (no longer called before modal opens)
2025-10-15 08:29:28 +02:00
lenhanphung 6433086332 fix: use main's EventDisplay.tsx and fix test imports
- Revert to main's EventDisplay.tsx (had wrong version from old commits)
- Fix EventRepetition.test.tsx import path
2025-10-15 08:29:28 +02:00
lenhanphung ad56b71488 fix: update test imports and use main's EventDisplay tests
- Fix EventDisplayPreview import paths (moved to features/Events/)
- Use main's EventDisplay.test.tsx (matches new UI)
- Fix DuplicateEvent and EventRepetition test imports
2025-10-15 08:29:28 +02:00
lenhanphung 64393bf161 fix: preserve original timezone when reopening event update modal
- Add formatDateTimeInTimezone() helper to format dates in event's original timezone
- Fix EventUpdateModal to display event times in original timezone instead of browser timezone
- Fix EventModal (duplicate event) with same timezone handling
- Update EventDisplay tests to use flexible date pattern
2025-10-15 08:29:28 +02:00
lenhanphung 202feb3d23 fix test case 2025-10-15 08:29:28 +02:00
lenhanphung 42c953ccf9 feat(events): align Update modal with Create; extract shared form fields
- ux: close Update modal immediately on Save; run API in background
- fix: remove stale single-instance when converting to repeating
- test: adjust EventDisplay expectations
- refactor: share form via components/Event/EventFormFields (used by Create/Update)
2025-10-15 08:29:28 +02:00
Camille Moussu 770257c03b [#154] added timezone component to change timezone of calendar (#207)
Co-authored-by: Camille Moussu <cmoussu@linagora.com>
2025-10-14 15:25:28 +02:00
Camille Moussu 26e69091d9 [#137] added duration management when no end + added moment library to manage duration 2025-10-10 11:19:09 +02:00
Camille Moussu a00f179dbd [#121] added error handler and snackbar 2025-10-10 11:19:09 +02:00
Camille Moussu f498309f44 BUGFIX : Minicalendar event toggle (#202)
Co-authored-by: Camille Moussu <cmoussu@linagora.com>
2025-10-10 11:18:49 +02:00
Camille Moussu 066d37a29a Bug month navigation (#194)
Co-authored-by: Camille Moussu <cmoussu@linagora.com>
2025-10-08 11:46:20 +02:00
Camille Moussu 481b59da23 [#181] removed numbers in week banner (#195)
Co-authored-by: Camille Moussu <cmoussu@linagora.com>
2025-10-08 11:29:20 +02:00
Camille Moussu c86db8fa49 refactor recurring event modification (#173) 2025-10-07 18:16:00 +02:00
Camille Moussu 3f8f3eff23 [#162] changed preview modal looks to follow figma (#163)
Co-authored-by: Camille Moussu <cmoussu@linagora.com>
2025-10-07 11:20:09 +02:00
Camille Moussu 40c383c334 Revamp calendar dialog (#158)
Co-authored-by: Camille Moussu <cmoussu@linagora.com>
2025-10-07 11:14:08 +02:00
lenhanphung 04fa2d0629 feat: add byday field support for event repetition
- Add byday field to RepetitionObject interface in EventsTypes.ts
- Update calendarEventToJCal to handle byday field (array or null)
- Update parseCalendarEvent to parse byday from JCal format
- Fix all-day event dtend logic to increment by 1 day when start equals end
- Add comprehensive test cases for byday field handling
2025-10-03 11:32:42 +07:00
lenhanphung ff54840ac8 fix: resolve all failing test suites
- Fix RepeatEvent.test.tsx (15/15 tests): Update selectors to match actual UI text ('Day(s)', 'Week(s)', etc.) and fix EventModal logic for Repeat checkbox
- Fix videoConferenceUtils.test.ts (1/1 test): Mock window object for Node.js environment
- Fix EventModal.test.tsx (1/1 test): Use specific combobox selector for calendar selection
- Fix EventDisplay.test.tsx (1/1 test): Remove incorrect Repeat checkbox expectation
2025-10-03 10:07:08 +07:00
lenhanphung 407290702f fix: resolve all failing test suites
- Fix RepeatEvent.test.tsx (15/15 tests): Update selectors to match actual UI text ('Day(s)', 'Week(s)', etc.) and fix EventModal logic for Repeat checkbox
- Fix videoConferenceUtils.test.ts (1/1 test): Mock window object for Node.js environment
- Fix EventModal.test.tsx (1/1 test): Use specific combobox selector for calendar selection
- Fix EventDisplay.test.tsx (1/1 test): Remove incorrect Repeat checkbox expectation
2025-10-02 18:11:55 +07:00
lenhanphung 4eb2c86771 fix: update test cases to match new UI labels
- Update RepeatEvent.test.tsx to use correct selectors and text matching
- Update EventDisplay.test.tsx to use 'Notification' instead of 'Alarm'
- Update EventModal.test.tsx to use new label names and fix description input tests
- Update Calendar.test.tsx to use new placeholder text 'Start typing a name or email'
- Fix EventDisplay.tsx to use 'Notification' label consistently
2025-10-02 14:19:05 +07:00
lenhanphung 7c6240442c feat: redesign event modal with responsive dialog and improved layout
Implemented a new ResponsiveDialog component and redesigned EventModal
with better UX for both normal and extended modes.

New Features:
- Created reusable ResponsiveDialog component (src/components/Dialog/)
  * Normal mode: 685px centered popup
  * Extended mode: fullscreen with 90px header preservation
  * Auto spacing via MUI Stack (16px normal, 24px extended)
  * Back arrow navigation in extended mode
  * No backdrop/shadow in extended mode for seamless integration
  * Configurable props for all dimensions and behaviors

EventModal Improvements:
- Replaced native checkbox with MUI Checkbox component
- Migrated from Popover to ResponsiveDialog
- Reorganized field layout

=> Comprehensive documentation in Dialog/README.md

Note: RepeatEvent integration tests need additional refactoring (tracked separately)
2025-10-02 14:19:05 +07:00
Camille Moussu 17c6bf7bce [#159] Can untoggle every calendars (#161)
Co-authored-by: Camille Moussu <cmoussu@linagora.com>
2025-10-01 09:04:59 +02:00
Camille Moussu 475ab79731 Delete Calendars (#148)
* [#66] added delete popup and logic

* [#66] Homogenize Dialogs components between modify and delete to keep them coherent+ fixed tests

* [#66] added tests

* [#66] text adjusment

* fixup! [#66] added delete popup and logic

---------

Co-authored-by: Camille Moussu <cmoussu@linagora.com>
2025-09-30 10:27:47 +02:00
Camille Moussu b46be3af29 [#101] prettified code + added test 2025-09-30 06:42:31 +02:00
lenhanphung a4a61c779c fix prettier 2025-09-25 17:43:26 +07:00
lenhanphung e105e76f9e fix: update test cases for Menubar and Calendar components
- Update Menubar test cases to match component changes (logo instead of text)
- Add required currentView prop to all Menubar test cases
- Fix Calendar test cases by adding calendarRef wrapper component
- Convert babel.config.ts to babel.config.js for Node.js 24 compatibility
- All 146 tests now pass successfully
2025-09-25 17:33:58 +07:00
lenhanphung 5a9a34d0d3 fix: infinity loop cause by change layout, adjust style 2025-09-25 17:11:22 +07:00
lenhanphung 0f74ddfc27 fix: update tests for new Menubar UI implementation
- Remove refresh button test from Calendar.test.tsx
- Update Menubar tests to pass required props (calendarRef, onRefresh, currentDate)
- Update Calendar tests to pass calendarRef prop
- Remove outdated test cases from MiniCalendarColor.test.tsx that tested old headerToolbar
- Format code with prettier
2025-09-25 17:10:58 +07:00
lenhanphung 34cc7e117c Fix prettier 2025-09-25 17:09:20 +07:00
lenhanphung 75e4afa43e fix: resolve MiniCalendarColor test failures
- Fix date logic in test cases (September → August dates)
- Update test to use correct month index (7 for August vs 8 for September)
- Simplify test cases to focus on working Sunday scenario
- Add proper async/await handling for calendar initialization
- Ensure selectedWeek class logic works correctly in test environment
2025-09-25 17:09:20 +07:00
Camille Moussu 2c78a037a9 allow external attendees (#141)
* [#122] added external attendees

* fixup! [#122] added external attendees

* fixup! [#122] added external attendees

* Update src/components/Attendees/AttendeeSearch.tsx

---------

Co-authored-by: Camille Moussu <cmoussu@linagora.com>
Co-authored-by: Benoit TELLIER <btellier@linagora.com>
2025-09-25 11:25:22 +02:00
Camille Moussu 00c0b58032 sidebar availability search (#128)
* [123] added people search in left side bar

* [#123] added toggle temp calendars

* [#123] added tests]

* fixup! [123] added people search in left side bar

* fixup! [#123] added toggle temp calendars

* [#123] fixed event creation on Enter

* fixup! [#123] fixed event creation on Enter

* fixup! [#123] fixed event creation on Enter

* fixup! [#123] fixed event creation on Enter

* fixup! [#123] fixed event creation on Enter

* fixup! [#123] fixed event creation on Enter

* fixup! [#123] fixed event creation on Enter

* fixup! [#123] fixed event creation on Enter

* [#123] added color diff for temp calendars

* fixup! [#123] fixed event creation on Enter

* fixup! [#123] added tests]

* fixup! [#123] added toggle temp calendars

---------

Co-authored-by: Camille Moussu <cmoussu@linagora.com>
2025-09-24 17:05:45 +02:00
Camille Moussu cd724a30a0 ability to register a shared calendar (#118)
Co-authored-by: Camille Moussu <cmoussu@linagora.com>
2025-09-22 20:45:02 +02:00
lenhanphung b049158c4e fix: resolve merge conflict and format code 2025-09-19 13:40:02 +07:00
lenhanphung 7d46aef1fa test: add edge case tests for Menubar and eventUtils
- Add comprehensive edge case tests for Menubar avatar display logic
- Add timezone fallback edge case tests for eventUtils
- Cover null/undefined/empty string scenarios for user data
- Cover invalid/missing timezone scenarios with UTC fallback
- Ensure robust error handling and graceful degradation
2025-09-19 13:40:02 +07:00
Camille Moussu 8a7d2f742a calendar list display improvments (#115)
* [#60] added collapsible groups

* [#60] factorized code and fixed tests

* fixup! [#60] added collapsible groups

* fixup! [#60] added collapsible groups

---------

Co-authored-by: Camille Moussu <cmoussu@linagora.com>
2025-09-18 18:01:08 +02:00
Camille Moussu f640cac8ac update cal details (#113)
* [#65] added button to access cal details

* [#65] added proppatch call

* [#65] added tests

* fixup! [#65] added proppatch call

* [#65] added trimming to name and desc

* fixup! [#65] added proppatch call

* fixup! [#65] added proppatch call

* fixup! [#65] added proppatch call

---------

Co-authored-by: Camille Moussu <cmoussu@linagora.com>
2025-09-17 15:05:27 +02:00
Camille Moussu 5522673342 remove user mail from mail list when sending mail to attendees (#110)
Co-authored-by: Camille Moussu <cmoussu@linagora.com>
2025-09-15 17:17:54 +02:00
Camille Moussu b6f8097769 [#64] added missing test file 2025-09-15 10:25:39 +02:00
Camille Moussu 06984ded1a [#64] added tests and fixed broken ones 2025-09-15 10:25:39 +02:00