Skip to content

refactor(react): sso-provider-create hook service separation#314

Draft
harishsundar-okta wants to merge 1 commit into
mainfrom
refactor/hook-architecture-sso-provider-create
Draft

refactor(react): sso-provider-create hook service separation#314
harishsundar-okta wants to merge 1 commit into
mainfrom
refactor/hook-architecture-sso-provider-create

Conversation

@harishsundar-okta
Copy link
Copy Markdown
Contributor

@harishsundar-okta harishsundar-okta commented May 28, 2026

Summary

Refactors the useSsoProviderCreate hook to follow the two-layer hook architecture (service + public hook).

Why

The SSO provider create hooks did not follow the established hook architecture pattern where a single public hook consumes an internal service hook. Previously, the logic was split across use-sso-provider-create (service/API) and use-sso-provider-create-logic (UI state), which is the inverse of the agreed-upon convention.

What

  • Moved API/mutation logic from use-sso-provider-create to shared/services/use-sso-provider-create-service.ts as an internal service hook
  • Merged use-sso-provider-create-logic into use-sso-provider-create as the single public hook that consumes the service internally
  • Updated sso-provider-create component to use the unified public hook
  • Moved service tests to shared/tests/use-sso-provider-create-service.test.ts
  • Deleted use-sso-provider-create-logic.ts

Packages

  • packages/core
  • packages/react
  • examples

References

Testing

How can this be verified? Note anything intentionally not covered by tests and why.

  • This change adds unit test coverage
  • Tested for both SPA and RWA flows, all example apps working
  • All existing and new tests complete without errors

Checklist

  • Breaking change
  • Requires docs update
  • Backward compatible

Contributing

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.79518% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.47%. Comparing base (aecf241) to head (250db63).

Files with missing lines Patch % Lines
...shared/services/use-sso-provider-create-service.ts 98.05% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main     #314    +/-   ##
========================================
  Coverage   89.47%   89.47%            
========================================
  Files         156      156            
  Lines       13070    13074     +4     
  Branches     1419     1805   +386     
========================================
+ Hits        11694    11698     +4     
  Misses       1376     1376            

☔ 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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants