-
-
Notifications
You must be signed in to change notification settings - Fork 738
Set default values on the invite and new env var forms to fix an issue after updating conform #2084
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…e after updating conform
|
WalkthroughThe changes introduce explicit default values for form fields in two separate components. In the invitation form, the ✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.environment-variables.new/route.tsx (1)
360-360
: Consider aligning default values between form configuration and useList initialization.The
useList
hook at line 360 initializes with the same default value as you've added to the form config. To maintain consistency and prevent potential issues if these values ever diverge, consider referencing a shared constant or extracting this default initialization into a variable.- const { items, append, update, delete: remove, insertAfter } = useList<Variable>([{ key: "", value: "" }]); + const defaultVariables = [{ key: "", value: "" }]; + const { items, append, update, delete: remove, insertAfter } = useList<Variable>(defaultVariables);And then use this same constant in the form's defaultValue.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
📒 Files selected for processing (2)
apps/webapp/app/routes/_app.orgs.$organizationSlug.invite/route.tsx
(1 hunks)apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.environment-variables.new/route.tsx
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (2)
apps/webapp/app/routes/_app.orgs.$organizationSlug.invite/route.tsx (1)
137-139
: Good fix - properly initializes the form with a default empty email field.Adding the default empty email value ensures the form is consistently initialized with one empty input field, fixing an issue that likely occurred after updating the conform library. This aligns with the form's behavior which expects an array of email strings.
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.environment-variables.new/route.tsx (1)
200-202
: Good fix - properly initializes the env var form with a default empty key-value pair.Adding the default empty key-value pair ensures the form starts with one variable entry, fixing an issue that likely occurred after updating the conform library. This also makes the form behavior consistent with the UI expectation set by the "Add another" button at line 429.
No description provided.