Commit Graph

77 Commits

Author SHA1 Message Date
Camille Moussu f40165d2e2 559 delegation create event in another user calendar (#561)
* [#559] added delegated calendars in user selector
* [#559] selector for calendar display delegated and personal separatly

Co-authored-by: Camille Moussu <cmoussu@linagora.com>
2026-02-20 23:14:48 +01:00
Camille Moussu d6e464afad [#421] added eslint check to CI (#534)
Co-authored-by: Camille Moussu <cmoussu@linagora.com>
2026-02-10 10:41:37 +01:00
Yadd 6014681f29 Refactor: centralize timezone utilities in src/utils/timezone.ts (#491)
Deduplicate resolveTimezone, resolveTimezoneId, convertEventDateTimeToISO,
and getTimezoneOffset into a single canonical module, removing copies from
EventApi, eventUtils, TimezoneSelector, EventUpdateModal, and calendarUtils.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 11:20:12 +01:00
Camille Moussu 00742119be [#446] removed direct state update (#468) 2026-01-21 15:17:49 +01:00
Camille Moussu 23d50f250d Refactor imports (#470) 2026-01-20 17:33:30 +01:00
lenhanphung 462ad6d250 chore: update twake-mui dependency and use radius.lg for create event button 2026-01-08 11:41:37 +07:00
lenhanphung 5f0479e34a implement twake mui 2026-01-08 11:40:40 +07:00
Camille Moussu 9ff75056c7 [#397 bis] added participation management on event from thunderbird (#432)
Co-authored-by: Camille Moussu <cmoussu@linagora.com>
2026-01-07 11:45:17 +01:00
lenhanphung a935d2bc43 372 drag and drop multiple days event to use normal mode instead of extended mode (#407)
- When dragging from allday slot: open normal mode with allday checked, show start date and end date
- When dragging from week/month view grid: open normal mode with allday checked, show 4 fields (start date, start time, end date, end time)
- Update DateTimeFields logic to support displaying time fields when allday=true and hasEndDateChanged=true for multiple days events

Add setHasEndDateChanged(false) to resetAllStateToDefault function to prevent stale state when:
- User creates multi-day event from grid (sets hasEndDateChanged = true)
- Closes the modal
- Opens modal again for a single-day event

This ensures hasEndDateChanged is properly reset to false when modal is closed or reset.

Fix drag and drop logic: keep allday=false when dragging from week view

- Remove setAllDay(true) when dragging multiple days from week view grid
- Keep allday=false to show time fields for week view drag scenarios
- Add comprehensive test cases for drag and drop scenarios
- Test cases cover allday slot and week view drag scenarios
- Prevent regressions with test coverage for display logic
2025-12-17 10:28:11 +01:00
lenhanphung 627e9bf44b feat(DateTimeFields): implement free typing time input with dropdown
- Replace default TimePicker field with custom EditableTimeField
- Allow free typing with multiple formats (HH:mm, HHmm, H, etc.)
- Show dropdown on click while maintaining typing capability
- Center-align time input text
2025-12-15 15:33:07 +01:00
Camille Moussu 2f2ee369fc [#525] adopted twake-i18n (#404)
* [#525] adopted twake-i18n 

Co-authored-by: Camille Moussu <cmoussu@linagora.com>
2025-12-09 11:10:44 +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
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 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 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 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 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 01f79553c0 refactor: Split EventFormFields.tsx into smaller modules
- Extract helper functions to utils/dateTimeHelpers.ts and utils/dateTimeFormatters.ts
- Extract validation logic to utils/formValidation.ts
- Extract FieldWithLabel component to components/FieldWithLabel.tsx
- Extract DateTimeFields component to components/DateTimeFields.tsx
- Extract all-day toggle logic to hooks/useAllDayToggle.ts
- Update imports in EventModal.tsx, EventUpdateModal.tsx, EventDisplay.tsx, eventHandlers.ts
- Maintain all existing functionality without breaking changes
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 2cf20e9655 [#269] fix selection error (#273)
Co-authored-by: Camille Moussu <cmoussu@linagora.com>
2025-11-03 14:35:05 +01:00
Camille Moussu 39d8085766 [#205] added calendar list component (#258)
Co-authored-by: Camille Moussu <cmoussu@linagora.com>
2025-10-31 04:44:54 +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 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
Camille Moussu e99c56f03f Handle long descriptions (#228)
Co-authored-by: Camille Moussu <cmoussu@linagora.com>
2025-10-21 12:17:36 +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 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 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
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
lenhanphung f99b3fb223 css: fix prettier and hidden slot minor 2025-10-03 17:31:24 +07:00
lenhanphung 4ef3a887ee fix: resolve infinite loop and week calculation issues in EventModal
- Fix infinite loop in EventModal useEffect by using useRef for userPersonnalCalendars
- Fix weekStart calculation in putEventAsync to use Monday as first day (consistent with FullCalendar firstDay=1)
- Add computeWeekRange utility function for consistent week calculations
- Improve state reset logic when closing EventModal popup
- Ensure repeat checkbox state is properly reset to prevent stale repetition data
2025-10-03 17:22:19 +07:00
lenhanphung f245991816 feat: improve video conference UI in EventModal
- Replace 'Meeting link generated' text with 'Join Visio conference' button
- Button opens video conference link in new tab when clicked
- Use contained variant styling to match Save button appearance
- Maintain copy and delete functionality for meeting links
2025-10-03 14:51:40 +07:00
lenhanphung cea576e5e8 fix: improve video conference link positioning and null safety
- Fix calendarUtils.ts null safety for calendars[id] access
- Update video conference link to be added on line 2 instead of line 3
- Update regex in handleDeleteVideoConference to match new format
- Update all test cases for videoConferenceUtils to match new format
- Add null checks in updateCalsDetails function
2025-10-03 10:46:34 +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 298b69b3e1 feat: add video conference meeting link generation to event modal
- Add video conference utility functions for generating random meeting IDs
- Implement video meeting button with camera icon in EventModal
- Add copy and delete functionality with IconButton components
- Support X-OPENPAAS-VIDEOCONFERENCE field in CalendarEvent type
- Handle state management for editing events with/without video conference
- Add meeting link footer to event description
- Include comprehensive test suite for video conference utilities

Features:
- Generate random meeting links (format: xxx-xxxx-xxx)
- Copy meeting link to clipboard
- Remove video conference from events
- Proper state sync when editing different events
- Integration with existing JCal/ICS conversion
2025-10-02 16:16:04 +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 3261479874 refactor: improve EventModal UI labels and visibility controls
- Rename 'Alarm' to 'Notification' for better clarity
- Rename 'Attendees' to 'Participants' with updated placeholder text
- Replace 'Visibility' dropdown with 'Visible to' toggle buttons (All/Participants)
- Remove CONFIDENTIAL option, keep only PUBLIC and PRIVATE
- Add icons (PublicIcon/LockIcon) with fixed sizing for toggle buttons
- Rename 'Show as' to 'Show me as'
- Fix ResponsiveDialog scroll bar positioning in expanded mode
- Update PeopleSearch placeholder to 'Start typing a name or email'
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
lenhanphung 3870bceb6d feat: prepare project for cozy-ui migration (#157)
* feat: prepare project for cozy-ui migration

Build Configuration
- Add Stylus support via @rsbuild/plugin-stylus
- Add SVGR support via @rsbuild/plugin-svgr
- Update rsbuild.config.ts with custom configuration
- Add historyApiFallback for SPA routing

ESLint Configuration
- Create .eslintrc.json with react-app configuration
- Remove eslintConfig from package.json

CSS to Stylus Migration
Convert all 5 CSS files to Stylus (.styl) format:
  - src/App.css to src/App.styl
  - src/index.css to src/index.styl
  - src/components/Calendar/Calendar.css to src/components/Calendar/Calendar.styl
  - src/components/Calendar/CustomCalendar.css to src/components/Calendar/CustomCalendar.styl
  - src/components/Menubar/Menubar.css to src/components/Menubar/Menubar.styl
- Update all imports from .css to .styl
- Preserve all styling rules and values

MUI Styling Cleanup
- Replace all MUI sx props with standard style props across 15+ components
- Convert MUI spacing units (mr: 2 to marginRight: 16px)
- Convert MUI shorthand props (p: 2 to padding: 16px, mb: 1 to marginBottom: 8px)
- Remove MUI-specific syntax (&.Mui-checked selectors)
- Maintain exact visual appearance

FullCalendar Fixes
- Comment out problematic CSS rule in CustomCalendar.styl
- Fix display issues with timegrid slot labels

Files Modified
- Config: rsbuild.config.ts, .eslintrc.json, package.json
- Styling: 5 CSS to Stylus conversions, 15+ component sx to style updates
- Components: All components using MUI sx props updated

Development Workflow
- Continue using existing development commands
- Stylus files are now the source of truth for styling
- MUI components work with standard style props
- ESLint uses familiar react-app rules

Dependencies Added
- @rsbuild/plugin-stylus
- @rsbuild/plugin-svgr
2025-10-01 17:31:18 +02:00
lenhanphung 7b8a2e74a5 fix prettier 2025-09-25 17:16:12 +07:00
lenhanphung b9d7a8fa6b feat: enhance calendar with view sync, Redux fixes, and dynamic slot label dimming
- Sync calendar view state between Calendar and Menubar components
- Fix Redux serialization errors by using string dates instead of Date objects
- Add null checks for eventResize handler to prevent undefined errors
- Implement dynamic slot label dimming near current time indicator
- Slot labels fade to opacity 0.2 when now indicator is within 15 minutes
- Add smooth CSS transitions for better user experience
- Handle edge cases around midnight for proper time calculation
- Update slot label visibility on view changes and time updates
2025-09-25 17:12:07 +07: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