refactor: sso-provider-table hook architecture#248
Conversation
🚀 Preview deploymentBranch: 📝 Preview URL: https://auth0-universal-components-7cl2f6quv-ui-components-217de888.vercel.app Updated at 2026-04-17T07:54:00.093Z |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #248 +/- ##
==========================================
- Coverage 89.41% 89.41% -0.01%
==========================================
Files 159 160 +1
Lines 13334 13313 -21
Branches 1828 1359 -469
==========================================
- Hits 11923 11904 -19
+ Misses 1411 1409 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…nto refactor/sso-provider-table-hook-architecture
…nto refactor/sso-provider-table-hook-architecture
66b6fda to
ed1450d
Compare
|
Why |
| import type { UseSsoProviderTableServiceReturn } from '@/types/my-organization/idp-management/sso-provider/sso-provider-table-types'; | ||
|
|
||
| export const ssoProviderQueryKeys = { | ||
| all: ['sso-providers'] as const, |
There was a problem hiding this comment.
since tanstack query is framework agnostic we can move these to core
There was a problem hiding this comment.
its moved to core
| const { coreClient } = useCoreClient(); | ||
| const queryClient = useQueryClient(); | ||
| const handleError = useErrorHandler(); | ||
| const hasShownProvidersError = useRef(false); |
There was a problem hiding this comment.
Yes. It prevents the same error toast from showing multiple times when the useEffect re-runs. Without it, users could see duplicate error notifications.
…nto refactor/sso-provider-table-hook-architecture
…nto refactor/sso-provider-table-hook-architecture
|
|
||
| import { | ||
| OrganizationDetailsMappers, | ||
| SsoProviderMappers, |
There was a problem hiding this comment.
The service should just throw, and the public hook handles all feedback — success toasts and error toasts — consistently in one place. so useErrorHandler and showToast should be in use-sso-provider-table hook, this should be a pure data layer
Summary
Restructures sso-provider-table hooks to follow the single public hook architecture with an internal service layer.
Why
The component was manually wiring two separate hooks (useSsoProviderTable + useSsoProviderTableLogic), leaking internal concerns into the component layer.
What
Packages
Testing
Please describe how this can be tested by reviewers. Be specific about anything not tested and reasons why. If this library has unit and tests should be added for new functionality and existing tests should complete without errors.
Checklist