Commit Graph

271 Commits

Author SHA1 Message Date
Camille Moussu cdaed8a7c1 [#254] fixed regression on other calendar display while no calendar available (#257)
Co-authored-by: Camille Moussu <cmoussu@linagora.com>
2025-10-27 11:41:35 +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
lenhanphung 4774e78543 feat: Update Event Preview Modal UI with custom MUI theme (#240)
- Add custom MUI theme
- Update ResponsiveDialog with actionsBorderTop prop for modal footer border
- Redesign EventDisplayPreview modal with improved typography and spacing
- Replace ButtonGroup with individual RSVP buttons (Accept/Maybe/Decline)
- Add pill-shaped buttons for RSVP actions
- Ensure backward compatibility with existing modals
2025-10-27 06:23:42 +01:00
lenhanphung 51c9d68be2 fix #252: sidebar width shift when hover (#255) 2025-10-27 06:15:56 +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
lenhanphung 1c8826facc Form validation for event create/update (#218)
* refactor: migrate EventModal to use shared EventFormFields component

* feat: add form validation for event create/update

- Validate title is required
- Validate end datetime must be after start datetime
- Disable save button when form is invalid
- Show error messages below invalid fields with red highlight (MUI)
- Title validation in create mode only shows error after field is touched
- Track touched state to avoid showing errors on initial load

* feat: improve event modal UX with auto-focus and default times

- Auto-focus title field when opening create/update event modal
- Set default datetime when creating event without selecting range:
  * Start time = current time + 1 hour (rounded to :00)
  * End time = start time + 1 hour
- Applied duplicate event to display datetime from original event
- Fix logic to detect empty event object vs valid event with uid

* fix: improve validation UX and add required field indicator

- Only show validation errors when modal is open (isOpen check)
- Add red asterisk (*) to Title label to indicate required field
- Prevent validation error flash when closing modal
- Fix TypeScript errors in EventUpdateModal
- Keep validation behavior: only show error after user types and deletes

* feat: auto-focus title field when toggling between normal and extended mode in event modal


* update: only validation when click on save button

* fix: prevent form data loss and validation errors in event modals

Fixes:
1. Form fields no longer clear when changing start/end dates
2. Extended mode stays active when modifying dates
3. No validation errors shown after successful save
2025-10-22 11:52:38 +02:00
lenhanphung a7a4bb4507 fix: double scrollbar left side (#236) 2025-10-22 11:48:06 +02:00
Camille Moussu 89ea554b1f [#142] prefill event creation for any way of creating (#226)
Co-authored-by: Camille Moussu <cmoussu@linagora.com>
2025-10-21 14:12:08 +02:00
Camille Moussu e99c56f03f Handle long descriptions (#228)
Co-authored-by: Camille Moussu <cmoussu@linagora.com>
2025-10-21 12:17:36 +02:00
Camille Moussu aa1dddc7ba Month view Revamp (#221)
Co-authored-by: Camille Moussu <cmoussu@linagora.com>
2025-10-21 12:16:30 +02:00
lenhanphung c27a52f479 Calendar sidebar: padding via MUI, sticky Create Event button; DateCalendar width 100%; Create button full width (#227) 2025-10-21 12:16:08 +02:00
Camille Moussu 6411ed636b [#197] added missing infos 2025-10-20 14:03:42 +02:00
lenhanphung ed8bb41ca9 fix: resolve timezone properly in TimezoneSelector and EventModal
- Resolve timezone alias to main timezone in TimezoneSelector before passing to TimezoneAutocomplete
- Resolve timezone in EventModal useState initialization to ensure correct timezone display
- Sync resolved timezone when modal opens or Redux timezone changes
- Ensure timezone is always resolved in resetAllStateToDefault callback
- Fix issue where TimezoneAutocomplete doesn't show correct timezone on first load
2025-10-20 07:22:00 +02:00
lenhanphung 6421f53a8d refactor: extract reusable TimezoneAutocomplete component
- Create new TimezoneAutocomplete component for shared timezone selection logic
- Update TimezoneSelector to use the new component
- Replace inline Autocomplete in EventFormFields with TimezoneAutocomplete
- Replace inline Autocomplete in EventModal with TimezoneAutocomplete
- Reduce code duplication and improve maintainability
2025-10-20 07:22:00 +02:00
lenhanphung 2ab7c448bf refactor: replace timezone Select with Autocomplete
- Replace timezone Select field with Autocomplete in EventModal and EventFormFields
- Add search functionality for timezones with text input
- Add timezone icon to match PeopleSearch component style
- Remove 'Mark as important' checkbox from EventModal (re showup when rebase)
- Remove gap space in description when desc field show up
2025-10-20 07:22:00 +02:00
Camille Moussu adbb77fe8a [#222] removed malformed param (#225)
Co-authored-by: Camille Moussu <cmoussu@linagora.com>
2025-10-17 15:38:40 +02:00
lenhanphung 58977af1b1 fix: prevent crash when deleting calendar
- Add safety check for calendar.events access to prevent undefined error
- Auto-remove deleted calendars from selectedCalendars state
- Fixes TypeError: Cannot read properties of undefined (reading 'events')
2025-10-17 11:50:28 +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
Camille Moussu 0f82711d7d [#83] Change minicalendar lib to MUI (#211)
Co-authored-by: Camille Moussu <cmoussu@linagora.com>
2025-10-16 10:36:59 +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 4936b89e8b fix: add timezone offset display to EventDisplayPreview for non-allday events 2025-10-15 08:29: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 af47923478 fix: recurring events edit all instances issues
- Fix master event detection in getEvent() to find VEVENT without recurrence-id
- Add removeOverrides parameter to updateSeries() to control override deletion
- Fetch master event when editing 'all events' to preserve original start date
- Combine master's date with form's time when updating all instances
- Detect time changes separately from date changes to preserve optimistic updates
- Only remove overrides when date/time/timezone/repeat rules change
- Keep overrides when only properties (title, description, etc) change

Fixes:
1. Old UI not cleared when editing all events
2. Start date not preserved when editing from different instance
3. Solo overrides incorrectly removed when only properties changed
4. Optimistic updates lost when editing recurring events
2025-10-15 08:29:28 +02:00
lenhanphung 5017c1bd6b fix: improve event editing UX and allday toggle behavior
- Fix allday toggle: when unchecking allday, set end date = start date with rounded time (30min intervals)
- Fix ResponsiveDialog CSS: set height only for expanded mode, remove maxHeight from normal mode
- Show repeat info when editing solo instance of recurring event (checkbox checked and disabled)
- Clear old event UI when updating recurring event allday status
2025-10-15 08:29:28 +02:00
lenhanphung a31825ce3a fix: set timezone changes as repetition rule changes for recurring events 2025-10-15 08:29:28 +02:00
lenhanphung 16317356fb feat: optimize recurring event updates with smart cache management 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 59e7992cfe refactor: implement optimistic updates for recurring event edits
- Replace refreshCalendars() with optimistic Redux updates for update all instances
- Add rollback mechanism: revert to old data if API fails
- Add notification placeholder function (ready for future toast implementation)
- Update single instance also uses optimistic update + rollback pattern
- Remove unnecessary refreshCalendars and getCalendarRange imports
- No view reload, instant UI updates, smooth UX

Performance improvements:
- API calls reduced from N+1 to 1 (eliminated fetch for all calendars)
- UI update time reduced from ~1s to <50ms
- Consistent behavior across all update operations
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 456271da32 style: adjust ResponsiveDialog Modal height to avoid flict 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 40f0179be6 fix: directly delete recurring events when converting to non-recurring
- Use direct API call to delete recurring events instead of going through Redux store
- Construct event URL directly for more reliable deletion
- Add error handling and small delay to ensure complete deletion
- Clean up all instances from store after deletion
2025-10-15 08:29:28 +02:00
lenhanphung 2ba80fcdb6 fix: handle converting recurring events to non-recurring events in edit all mode 2025-10-15 08:29:28 +02:00
lenhanphung 474ff22cab fix: properly handle recurring events in EventUpdateModal
- Fix handling of solo vs. all event updates for recurring events
- Add calendar refresh for update all events
- Disable repeat option when editing a single occurrence (solo mode)
- Fix event recurrence editing in modals to match main branch
- Properly link EventDisplayPreview with EventUpdateModal for 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 601c75db33 feat: integrate main's EventDisplayPreview UI with EventUpdateModal
1. Replace old EventDisplayPreview with main's new Figma UI
   - Use ResponsiveDialog instead of Popover
   - Keep file at features/Events/ location (not components/Event/)
   - Integrate InfoRow, EditModeDialog components from main
   - Fix all imports to work with new location

2. Add EventUpdateModal integration
   - Edit icon now opens EventUpdateModal instead of EventDisplayModal
   - EventUpdateModal uses shared EventFormFields component

3. Fix imports and exports
   - Use default import for ResponsiveDialog
   - Use named import for EditModeDialog
   - Fix anchorPosition to be optional with default value

4. Performance improvement
   - Open EventUpdateModal immediately without waiting for API
   - Let modal fetch fresh data in background via useEffect

5. Fix Checkbox styling warning
   - Use sx prop instead of style for nested MUI selectors
   - Fix 'Unsupported style property &.Mui-checked' console warning
2025-10-15 08:29:28 +02:00