Repository navigation
Scoped PAT: clean up RHF usage - #48485
Conversation
…coped-token-creation-tests
|
The latest updates on your projects. Learn more about Vercel for GitHub.
5 Skipped Deployments
|
📝 WalkthroughWalkthroughScoped token form components now use ChangesScoped token form state
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
🎭 Playwright Test Results (next)Details
Skipped testsFeatures › auth-users.spec.ts › should show web3 users as enabled when the matching web3 provider is enabled |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
🧹 Nitpick comments (2)
apps/studio/components/interfaces/Account/AccessTokens/Scoped/Form/NewScopedTokenForm.tsx (1)
52-53: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse a boolean-prefixed state name.
Rename
showMissingPermissionsWarningtoshouldShowMissingPermissionsWarningand update its setter/usages. As per coding guidelines, booleans should use anis,has,can, orshouldprefix.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/studio/components/interfaces/Account/AccessTokens/Scoped/Form/NewScopedTokenForm.tsx` around lines 52 - 53, Rename the boolean state variable showMissingPermissionsWarning to shouldShowMissingPermissionsWarning in NewScopedTokenForm, rename its setter consistently, and update every reference to both state values throughout the component.Source: Coding guidelines
apps/studio/components/interfaces/Account/AccessTokens/Scoped/Form/TokenDetails.tsx (1)
39-40: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAvoid casting the Select value into the form union.
Validate
valueagainstEXPIRY_OPTIONSand pass the matched option value tosetValue; the cast can admit an invalid string and violates the repository’s TypeScript guidance. As per coding guidelines, “Avoid TypeScriptascasts.”🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/studio/components/interfaces/Account/AccessTokens/Scoped/Form/TokenDetails.tsx` around lines 39 - 40, Update handleExpiryChange to validate the incoming value against EXPIRY_OPTIONS, locate the matching option, and pass its value to setValue with shouldValidate enabled. Remove the TypeScript as cast and preserve the existing behavior for valid expiry selections.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In
`@apps/studio/components/interfaces/Account/AccessTokens/Scoped/Form/NewScopedTokenForm.tsx`:
- Around line 52-53: Rename the boolean state variable
showMissingPermissionsWarning to shouldShowMissingPermissionsWarning in
NewScopedTokenForm, rename its setter consistently, and update every reference
to both state values throughout the component.
In
`@apps/studio/components/interfaces/Account/AccessTokens/Scoped/Form/TokenDetails.tsx`:
- Around line 39-40: Update handleExpiryChange to validate the incoming value
against EXPIRY_OPTIONS, locate the matching option, and pass its value to
setValue with shouldValidate enabled. Remove the TypeScript as cast and preserve
the existing behavior for valid expiry selections.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 723b7da1-05be-4a9f-8d15-c306b3c02e47
📒 Files selected for processing (3)
apps/studio/components/interfaces/Account/AccessTokens/Scoped/Form/NewScopedTokenForm.tsxapps/studio/components/interfaces/Account/AccessTokens/Scoped/Form/ResourceAccessStep.tsxapps/studio/components/interfaces/Account/AccessTokens/Scoped/Form/TokenDetails.tsx
We don't follow good practices using react-hook-form for the scoped PAT.
This PR aims to fix that:
controlandsetValueinstead offormuseWatchinstead ofform.watchNo functional nor visual changes
Summary by CodeRabbit