Repository navigation
fix(web): allow profile settings to save with empty last name (#10122) - #10125
siddiqueirshad wants to merge 1 commit into
Conversation
|
|
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Add and use optional name validation packages/utils/src/validation.ts, apps/web/components/settings/profile/content/pages/general/form.tsx |
The new validateOptionalPersonName accepts missing or whitespace-only values and delegates non-empty values to validatePersonName. The last-name field uses the new validator; first-name validation is unchanged. |
Priority:
Estimated code review effort: 2 (Simple) | ~5 minutes
Change: Bug fix · Severity of issue fixed: Medium
Suggested reviewers: prateekshourya29
Merge Risk: 
Minimal · up to a11b8
-
The profile form change matches the requested behavior and is mergeable.
Pre-merge checks: 
5
-
Full details: Description check
-
Explanation
The description clearly explains the issue, root cause, implementation, and preserved validation behavior. It does not select a Type of Change checkbox or provide explicit test scenarios, but the required change is documented in sufficient detail.
Full details: Linked Issues check
-
Explanation
Issue [
#10122] requires an empty or whitespace-only last name to pass in Profile settings and requires validation for a provided last name.validateOptionalPersonNamereturnstruefor empty or whitespace-only input and delegates non-empty input tovalidatePersonName, which preserves length and character checks.GeneralProfileSettingsFormuses this validator forlast_name; first-name validation remains unchanged.
Full details: Docstring Coverage
-
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 2 files.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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 @coderabbitai help to get the list of available commands.
Description
Fixes #10122
In Profile settings → General, the "Last name" field is optional (unlike first name which is required with an asterisk
*), but submitting a profile with an empty or cleared last name was blocked becauserules={{ validate: validatePersonName }}returned"Name is required"for empty or whitespace-only inputs.Changes
@plane/utils(packages/utils/src/validation.ts): Added and exportedvalidateOptionalPersonName(name?: string | null): boolean | string, which returnstruewhen the name is empty or whitespace-only, and delegates non-empty strings tovalidatePersonName(name).apps/web/components/settings/profile/content/pages/general/form.tsx: Updated the Controller rule forlast_nameto usevalidateOptionalPersonName, allowing users to save their profile with an empty last name while preserving validation (length and forbidden characters) when a last name is provided.Summary by CodeRabbit