Skip to content

refactor: sso-provider-table hook architecture#248

Open
harishsundar-okta wants to merge 10 commits intomainfrom
refactor/sso-provider-table-hook-architecture
Open

refactor: sso-provider-table hook architecture#248
harishsundar-okta wants to merge 10 commits intomainfrom
refactor/sso-provider-table-hook-architecture

Conversation

@harishsundar-okta
Copy link
Copy Markdown
Contributor

@harishsundar-okta harishsundar-okta commented Apr 8, 2026

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

  • Moved data-fetching/CRUD logic to internal service hook (shared/services/use-sso-provider-table-service.ts)
  • Merged UI logic into public useSsoProviderTable hook; deleted use-sso-provider-table-logic.ts
  • Simplified sso-provider-table.tsx from two hook calls to a single useSsoProviderTable({...}) call
  • Moved ssoProviderQueryKeys to @auth0/universal-components-core (framework-agnostic)
  • Updated types: added UseSsoProviderTableServiceReturn, UseSsoProviderTableOptions; removed UseSsoProviderTableLogicOptions, UseSsoProviderTableLogicResult
  • Split tests: service tests for data/API layer, public hook tests for UI logic

Packages

  • packages/core
  • packages/react

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.

  • image
  • image

Checklist

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 8, 2026

🚀 Preview deployment

Branch: refs/pull/248/merge
Commit: 1ad2245

📝 Preview URL: https://auth0-universal-components-7cl2f6quv-ui-components-217de888.vercel.app


Updated at 2026-04-17T07:54:00.093Z

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 8, 2026

Codecov Report

❌ Patch coverage is 97.46193% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.70%. Comparing base (a29ae8e) to head (624e927).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
.../shared/services/use-sso-provider-table-service.ts 95.45% 10 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main     #248    +/-   ##
========================================
  Coverage   88.70%   88.70%            
========================================
  Files         155      156     +1     
  Lines       13142    13126    -16     
  Branches     1401     1788   +387     
========================================
- Hits        11657    11643    -14     
+ Misses       1485     1483     -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…nto refactor/sso-provider-table-hook-architecture
@harishsundar-okta harishsundar-okta marked this pull request as ready for review April 15, 2026 11:57
@harishsundar-okta harishsundar-okta force-pushed the refactor/sso-provider-table-hook-architecture branch from 66b6fda to ed1450d Compare April 17, 2026 06:43
Comment thread packages/react/src/components/auth0/my-organization/sso-provider-table.tsx Outdated
Comment thread packages/react/src/components/auth0/my-organization/sso-provider-table.tsx Outdated
Comment thread docs-site/public/r/sso-provider-table.json
Comment thread packages/react/src/hooks/my-organization/use-sso-provider-table.ts Outdated
@NaveenChand755
Copy link
Copy Markdown
Contributor

Why packages/react/src/hooks/my-organization/shared ?

@harishsundar-okta harishsundar-okta added refactor Restructuring existing code and logic to reduce technical debt and improve quality Gen AI Indicates that the most of the code in this PR were generated or assisted by generative AI tools. labels Apr 17, 2026
rax7389
rax7389 previously approved these changes Apr 18, 2026
import type { UseSsoProviderTableServiceReturn } from '@/types/my-organization/idp-management/sso-provider/sso-provider-table-types';

export const ssoProviderQueryKeys = {
all: ['sso-providers'] as const,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since tanstack query is framework agnostic we can move these to core

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its moved to core

const { coreClient } = useCoreClient();
const queryClient = useQueryClient();
const handleError = useErrorHandler();
const hasShownProvidersError = useRef(false);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Gen AI Indicates that the most of the code in this PR were generated or assisted by generative AI tools. refactor Restructuring existing code and logic to reduce technical debt and improve quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants