Commit 9556078
authored
refactor(auth): update Google connection UI and logic (#1591)
* refactor(auth): update Google connection UI and logic
- Changed sidebar status icons to use a unified "DotIcon" for various Google Calendar connection states, enhancing visual consistency.
- Introduced a new `StatusDotPopover` component to manage repair dialogs, improving user interaction during repair processes.
- Updated tests to reflect changes in icon usage and dialog behavior, ensuring comprehensive coverage of the new UI flow.
- Enhanced the `getGoogleConnectionConfig` function to include `dotColor` and dialog properties for better state representation.
* refactor(auth): update Google connection UI and logic
- Changed sidebar status icons to use a unified "DotIcon" across various connection states, enhancing visual consistency.
- Introduced a new `StatusDotPopover` component for improved user interaction during repair actions, providing a dialog with repair options.
- Updated the `useConnectGoogle` hook to return an `isRepairing` state, allowing the UI to reflect ongoing repair processes.
- Enhanced tests to cover new UI behaviors and ensure proper functionality of the updated components and hooks.
* refactor(sync): enhance StatusDotPopover for improved user feedback
- Introduced a dynamic display title in the StatusDotPopover to reflect the repairing state, enhancing user awareness during calendar repairs.
- Updated the aria-label and title properties to utilize the new display title, improving accessibility.
- Conditionally rendered the description based on the repairing state, streamlining the UI during repair processes.
- Added logic to prevent rendering the SyncStatusDot when user attention is not needed, optimizing performance and user experience.
* feat(auth): implement anonymous calendar change sign-up prompt
- Introduced functionality to manage the sign-up prompt for users making anonymous calendar changes, enhancing user engagement and retention.
- Updated the authentication state management to include flags for prompting sign-up after anonymous calendar changes.
- Enhanced the `useCompleteAuthentication` hook to clear the sign-up prompt when a user is authenticated.
- Added tests to ensure the correct behavior of the sign-up prompt logic during event creation and editing.
- Refactored related components and hooks to utilize the new sign-up prompt functionality, improving overall user experience.
* fix(auth): update tooltip message for Google Calendar repair status
- Changed the tooltip message in the sidebar status from "Google Calendar needs repair. Click to repair." to "Repairing Google Calendar in the background." to better reflect the current state during repairs.
- Updated the corresponding test to ensure the new tooltip message is correctly asserted in the `useConnectGoogle` hook tests.
* feat(sync): add sync dot pulse animation and update component logic
- Introduced a new animation for the sync dot with a pulse effect to enhance visual feedback during synchronization.
- Updated the `SyncStatusDot` component to conditionally apply the new animation based on the anonymous sign-up prompt state.
- Enhanced the `useSyncStatusDotState` hook to manage the new `isAnonymousSignUpPrompt` state, improving user engagement.
- Added tests to verify the correct application of the new animation and its behavior in different states.
* refactor(auth): remove AccountIcon component and related tests
- Deleted the `AccountIcon` component as part of the refactoring process to streamline the authentication modal.
- Removed associated tests from `AuthModal.test.tsx` to reflect the component's removal.
- Updated `Header` components in both Calendar and Day views to eliminate references to `AccountIcon`, ensuring a cleaner codebase.
* refactor(calendar): simplify Header component structure and remove unused styles
- Refactored the `Header` component in the Calendar view to streamline its structure by replacing styled components with utility classes.
- Removed unused styled components and associated styles from the `styled.ts` file, enhancing code clarity and maintainability.
- Updated the layout to utilize flexbox for better alignment and responsiveness, improving the overall user interface.
* refactor(calendar): streamline Header component by removing styled components
- Simplified the `Header` component in the Calendar view by replacing styled components with utility classes for better maintainability.
- Removed unused styled components from `styled.ts`, enhancing code clarity.
- Updated the layout to utilize standard HTML elements and flexbox for improved alignment and responsiveness.
* refactor(calendar): replace styled components with utility classes in DayLabels
- Updated the `DayLabels` component in the Calendar view to eliminate styled components, enhancing maintainability and readability.
- Replaced `StyledWeekDaysFlex` and `StyledWeekDayFlex` with standard HTML elements and utility classes for improved layout and responsiveness.
- Removed the now-unnecessary `styled.ts` file, streamlining the codebase.
* refactor(sync): separate StatusDotPopover into its own component
- Extracted the `StatusDotPopover` from the `SyncStatusDot` component to improve modularity and maintainability.
- Updated the tooltip message for the anonymous sign-up prompt to be more concise.
- Adjusted tests to reflect changes in the component structure and updated tooltip text.
* refactor(calendar): remove Info icon component and update SubCalendarList structure
- Deleted the `Info` icon component to streamline the codebase.
- Refactored the `SubCalendarList` component to incorporate a tooltip for temporary account information, enhancing user experience.
- Updated the layout to utilize utility classes, improving maintainability and readability.
- Added tests for the `SubCalendarList` component to ensure correct rendering and functionality.
* refactor(auth): update Google connection status handling and introduce HeaderInfoIcon component
- Renamed `dotColor` to `iconColor` in the Google connection types and related components for consistency.
- Updated the `useConnectGoogle` hook and associated tests to reflect the new naming convention.
- Introduced the `HeaderInfoIcon` component to display connection status with improved tooltip handling and user prompts.
- Replaced `SyncStatusDot` with `HeaderInfoIcon` in the Calendar and Day view headers for enhanced user feedback.
- Added tests for the new `HeaderInfoIcon` component to ensure correct rendering and functionality.
* refactor(auth): remove icon references from Google connection handling
- Eliminated `icon` property from the sidebar status in the Google connection types and related components to streamline the state management.
- Updated tests in the `useConnectGoogle` hook to reflect the removal of icon assertions.
- Adjusted the `HeaderInfoIcon` component to remove icon references, ensuring consistency across the application.
* refactor(auth): enhance UserProvider and HeaderInfoIcon components for improved user experience
- Updated the `UserProvider` to utilize the `useSession` hook for managing authentication state and profile loading.
- Added a new test case in `UserProvider.test.tsx` to verify profile fetching behavior based on authentication state.
- Enhanced the `HeaderInfoIcon` component to display a spinner during background calendar imports, improving user feedback.
- Refactored `useHeaderInfo` to include background import state, ensuring accurate rendering in the `HeaderInfoIcon`.
- Adjusted tests in `SidebarIconRow` to confirm the spinner is not rendered when importing is in progress.
* refactor(auth): streamline UserProvider and introduce useLoadProfile hook
- Refactored the `UserProvider` to utilize the new `useLoadProfile` hook for improved profile loading and state management.
- Removed unnecessary state variables and effects related to user loading, enhancing code clarity.
- Updated the `UserContext` to reflect changes in the user profile structure.
- Added tests for the new `useLoadProfile` hook to ensure correct profile fetching behavior.
- Simplified the integration with PostHog for user identification through the `useIdentifyUser` hook.
* feat(auth): implement Google authentication flow and enhance session management
- Introduced `useCompleteAuthentication` hook to streamline the Google authentication process, managing user state and metadata refresh.
- Added `useConnectGoogle` hook to handle Google Calendar connection, including error handling and user prompts.
- Created `useGoogleAuth` and `useGoogleAuthWithOverlay` hooks for improved Google login experience with overlay support.
- Implemented tests for new hooks to ensure correct functionality and error handling during authentication.
- Refactored related components and utilities for better integration with the new authentication flow.
* feat(tests): enhance e2e tests for Google Calendar connection status
- Added new rules in ESLint configuration for TypeScript files in e2e tests to accommodate Playwright usage.
- Updated the sidebar connection status tests to improve clarity and accuracy, including renaming helper functions and adjusting assertions.
- Introduced a new utility function to assert Google connection state in Redux, enhancing test reliability.
- Refactored existing tests to focus on Redux state management and UI visibility for connection states.
* feat(sync): enhance Google Calendar import handling and introduce auto-import logic
- Added `triggerAutoImport` action to the sync slice to initiate non-forced imports without showing a spinner.
- Updated `useConnectGoogle` hook to dispatch the new `request` action for active imports and `triggerAutoImport` for RESTART state.
- Introduced utility functions `isGoogleCalendarImportActive` and `isGoogleCalendarAutoImportNeeded` to manage import states effectively.
- Implemented tests to validate the behavior of auto-import logic and spinner visibility during different import states.
- Refactored related components and tests to ensure consistent handling of Google Calendar import states.
* feat(sync): enhance Google Calendar import handling with new operation types
- Introduced `ImportOperation` type to support both "INCREMENTAL" and "REPAIR" operations in import summaries.
- Updated `parseImportResult` function to accept operation type as a parameter, improving flexibility in handling import results.
- Refactored sync service and controller tests to utilize the new operation types, ensuring consistent behavior across import scenarios.
- Enhanced user metadata handling to reconcile import states based on metadata updates, improving user experience during Google Calendar imports.
- Updated tests to validate the new import operation logic and ensure accurate state management during imports.
* feat(sync): enhance Google Calendar metadata handling and user feedback
- Updated `UserMetadataService` to return "ATTENTION" state when a restart is pending, improving user awareness of synchronization status.
- Added a new test case to validate the "ATTENTION" state functionality in `user-metadata.service.test.ts`.
- Refactored Google Calendar import logic to streamline state management and improve user experience during metadata refresh.
- Removed deprecated import state handling from various components and tests, ensuring cleaner code and better maintainability.
- Enhanced `useConnectGoogle` and related hooks to improve error handling and user prompts during Google Calendar connection processes.
* feat(sync): improve Google Calendar sync handling and UI feedback
- Added logic to ignore duplicate restart requests while a full sync is in progress, enhancing user experience by preventing unnecessary operations.
- Introduced a new test case to validate the behavior of duplicate restart requests in `sync.service.test.ts`.
- Updated `SyncService` to manage active full sync restarts, ensuring proper state handling during synchronization.
- Refactored Google Sync UI state management to utilize a more descriptive indicator for syncing states, improving clarity in the user interface.
- Enhanced tests across various components to ensure accurate handling of sync states and user feedback during Google Calendar operations.
* fix(sync): correct promise handling in sync service tests
- Updated the test for `fetchMetadataDeferred` to await the promise directly, ensuring proper synchronization in the test execution.
- This change enhances the reliability of the test case by accurately reflecting the intended asynchronous behavior.
* refactor(auth): reorganize Google authentication utilities and state management
- Updated import paths for Google authentication utilities to improve code organization and clarity.
- Refactored Google sync state management to utilize a dedicated state module, enhancing maintainability.
- Introduced new utility functions for handling Google authentication errors and revocation states.
- Added tests for new utility functions to ensure correct behavior in various scenarios.
- Improved overall structure of Google authentication-related code for better readability and maintainability.
* feat(auth): implement session management and user profile loading
- Introduced `SessionProvider` and `useSession` hook to manage user authentication state and session handling.
- Added `UserProvider` and `useLoadProfile` hook for fetching user profile data based on authentication status.
- Created utility functions for session management and user state updates, enhancing overall user experience.
- Implemented comprehensive tests for session and user profile functionalities to ensure reliability and correctness.
- Refactored existing components to integrate with the new session and user management structure, improving code organization and maintainability.
* fix(auth): update Google OAuth error utility imports and add tests
- Updated import paths for the Google OAuth error utility to improve consistency and clarity.
- Introduced a new utility file for handling Google popup closed errors, enhancing error management.
- Added comprehensive tests for the new error utility to ensure correct behavior across various scenarios.
* feat(auth): add Posthog utility function and integrate into CompassProvider
- Introduced a new utility function `isPosthogEnabled` to check Posthog configuration based on environment variables.
- Removed the redundant local implementation of `isPosthogEnabled` from `CompassProvider` and replaced it with the new utility import, improving code organization and maintainability.1 parent 6a3eae1 commit 9556078
122 files changed
Lines changed: 2685 additions & 2386 deletions
File tree
- e2e
- oauth
- utils
- packages
- backend/src
- sync
- controllers
- services
- user/services
- web/src
- __tests__
- __mocks__
- state
- utils/state
- auth
- compass
- hooks
- schemas
- session
- state
- user
- context
- hooks
- util
- context
- google
- hooks
- useConnectGoogle
- useGoogleAuthWithOverlay
- useGoogleAuth
- useGoogleLogin
- state
- util
- hooks/google/useConnectGoogle
- posthog
- common
- apis
- constants
- hooks
- repositories/event
- types
- utils
- draft
- event
- overlap
- components
- AuthModal
- forms
- hooks
- CompassProvider
- HeaderInfoIcon
- Icons
- ducks/events
- sagas
- selectors
- slices
- sse
- hooks
- provider
- store
- views
- Calendar
- components
- Draft/sidebar/hooks
- Header
- Sidebar
- MonthTab/SubCalendarList
- SidebarIconRow
- CmdPalette
- Day/components
- Header
- Forms/hooks
- Now/components
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | | - | |
| 13 | + | |
13 | 14 | | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
27 | 18 | | |
28 | 19 | | |
29 | 20 | | |
| |||
35 | 26 | | |
36 | 27 | | |
37 | 28 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
| 29 | + | |
| 30 | + | |
42 | 31 | | |
43 | 32 | | |
44 | 33 | | |
| |||
50 | 39 | | |
51 | 40 | | |
52 | 41 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
61 | 46 | | |
62 | 47 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
69 | 51 | | |
70 | 52 | | |
71 | | - | |
72 | 53 | | |
73 | 54 | | |
74 | 55 | | |
75 | | - | |
76 | 56 | | |
77 | | - | |
78 | 57 | | |
79 | 58 | | |
80 | 59 | | |
81 | | - | |
82 | 60 | | |
83 | 61 | | |
84 | 62 | | |
85 | 63 | | |
86 | 64 | | |
87 | 65 | | |
88 | 66 | | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
| 67 | + | |
| 68 | + | |
95 | 69 | | |
96 | 70 | | |
97 | 71 | | |
| |||
118 | 92 | | |
119 | 93 | | |
120 | 94 | | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | 95 | | |
127 | 96 | | |
128 | 97 | | |
| |||
133 | 102 | | |
134 | 103 | | |
135 | 104 | | |
136 | | - | |
| 105 | + | |
137 | 106 | | |
138 | 107 | | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
146 | 114 | | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
153 | 119 | | |
154 | 120 | | |
155 | 121 | | |
| |||
165 | 131 | | |
166 | 132 | | |
167 | 133 | | |
168 | | - | |
169 | 134 | | |
170 | 135 | | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
177 | 141 | | |
178 | 142 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
203 | | - | |
204 | | - | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
205 | 212 | | |
206 | 213 | | |
207 | 214 | | |
208 | | - | |
209 | | - | |
| 215 | + | |
| 216 | + | |
210 | 217 | | |
211 | 218 | | |
212 | 219 | | |
| |||
221 | 228 | | |
222 | 229 | | |
223 | 230 | | |
224 | | - | |
225 | | - | |
226 | | - | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
227 | 262 | | |
228 | 263 | | |
229 | 264 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
114 | 123 | | |
115 | 124 | | |
116 | 125 | | |
| |||
Lines changed: 7 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | | - | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
| 56 | + | |
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
58 | | - | |
| 60 | + | |
59 | 61 | | |
60 | 62 | | |
61 | 63 | | |
| |||
607 | 609 | | |
608 | 610 | | |
609 | 611 | | |
610 | | - | |
| 612 | + | |
611 | 613 | | |
612 | 614 | | |
613 | 615 | | |
| |||
643 | 645 | | |
644 | 646 | | |
645 | 647 | | |
646 | | - | |
| 648 | + | |
647 | 649 | | |
648 | 650 | | |
649 | 651 | | |
| |||
683 | 685 | | |
684 | 686 | | |
685 | 687 | | |
686 | | - | |
| 688 | + | |
687 | 689 | | |
688 | 690 | | |
689 | 691 | | |
| |||
0 commit comments