fix(clerk-js,ui,shared): Display enterprise connection icon on account linking dropdown#8203
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 70f5273 The changes in this PR will be included in the next version bump. This PR includes changesets to release 21 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
c1ab77b to
3786999
Compare
8310f2b to
62d4812
Compare
62d4812 to
fcf8917
Compare
fcf8917 to
dee595e
Compare
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThe pull request adds 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
@clerk/agent-toolkit
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@clerk/expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/ui/src/components/UserProfile/EnterpriseAccountsSection.tsx`:
- Around line 54-55: Add regression tests for EnterpriseAccountsSection to cover
the new provider normalization and logo fallback behavior: write unit/tests that
render the component (or call the helper logic) with connection.provider values
like "oauth_google", "saml_okta", and bare provider names to assert
providerIconId is normalized correctly, and tests that provide
connection.logoPublicUrl as a non-empty string and as empty/undefined to assert
providerIconUrl falls back to the expected empty string or default path; target
the code paths referenced by providerIconId and providerIconUrl (and the similar
logic around lines 76-83) so OAuth/SAML normalization and empty-logo fallback
are covered.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro
Run ID: cf45c294-5e82-4ab4-882e-e20b33e3b2d8
📒 Files selected for processing (5)
.changeset/cozy-lands-grow.md.changeset/polite-camels-chew.mdpackages/clerk-js/src/core/resources/EnterpriseConnection.tspackages/shared/src/types/enterpriseConnection.tspackages/ui/src/components/UserProfile/EnterpriseAccountsSection.tsx
| const providerIconId = connection.provider.replace(/(oauth_|saml_)/, '').trim() as OAuthProvider; | ||
| const providerIconUrl = connection.logoPublicUrl?.trim() || ''; |
There was a problem hiding this comment.
Add regression tests for the new enterprise icon resolution path before merge.
This introduces new runtime behavior (connection.provider normalization + connection.logoPublicUrl icon source) but no tests were added/updated to cover OAuth/SAML provider values and empty-logo fallback, which leaves this UI path unprotected against regressions.
As per coding guidelines, "**/*: If there are no tests added or modified as part of the PR, please suggest that tests be added to cover the changes."
Also applies to: 76-83
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@packages/ui/src/components/UserProfile/EnterpriseAccountsSection.tsx` around
lines 54 - 55, Add regression tests for EnterpriseAccountsSection to cover the
new provider normalization and logo fallback behavior: write unit/tests that
render the component (or call the helper logic) with connection.provider values
like "oauth_google", "saml_okta", and bare provider names to assert
providerIconId is normalized correctly, and tests that provide
connection.logoPublicUrl as a non-empty string and as empty/undefined to assert
providerIconUrl falls back to the expected empty string or default path; target
the code paths referenced by providerIconId and providerIconUrl (and the similar
logic around lines 76-83) so OAuth/SAML normalization and empty-logo fallback
are covered.
5f41aa2 to
ef9d201
Compare
ef9d201 to
70f5273
Compare
Description
This PR adds
providerandlogoPublicUrltoEnterpriseConnectionresource and uses it on the enterprise connections dropdown withinUserProfileChecklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
Summary by CodeRabbit
New Features
Updates
Tests