Skip to content

fix: adjust validations for sponsor, disable add button if no sponsor#834

Merged
smarcet merged 1 commit intomasterfrom
fix/sponsor-user-edit-validation
Mar 24, 2026
Merged

fix: adjust validations for sponsor, disable add button if no sponsor#834
smarcet merged 1 commit intomasterfrom
fix/sponsor-user-edit-validation

Conversation

@tomrndom
Copy link
Copy Markdown

@tomrndom tomrndom commented Mar 20, 2026

image

ref: https://app.clickup.com/t/86b84dha5

Signed-off-by: Tomás Castillo tcastilloboireau@gmail.com

Summary by CodeRabbit

  • Bug Fixes

    • Corrected spelling error in sponsor validation error message key.
    • Improved sponsor validation to prevent adding new entries until the current sponsor is fully selected.
  • Chores

    • Enhanced sponsor field validation with stricter schema requirements for data consistency.

… is selected

Signed-off-by: Tomás Castillo <tcastilloboireau@gmail.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 20, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b946b12e-6099-49af-b533-18b38be88aa2

📥 Commits

Reviewing files that changed from the base of the PR and between 3465f40 and 5fa3055.

📒 Files selected for processing (4)
  • src/i18n/en.json
  • src/pages/sponsors/sponsor-users-list-page/components/edit-user-popup/access-rights-lists.js
  • src/pages/sponsors/sponsor-users-list-page/components/edit-user-popup/sponsor-section.js
  • src/pages/sponsors/sponsor-users-list-page/components/edit-user-popup/sponsor-user-form.js

📝 Walkthrough

Walkthrough

This pull request fixes a typo in i18n keys, enhances sponsor field validation in a user form by replacing a permissive predicate with a strict object schema, and adds logic to prevent adding new sponsor entries when existing ones lack valid sponsor selections.

Changes

Cohort / File(s) Summary
Internationalization
src/i18n/en.json
Corrected misspelled i18n key from error_misssing_sponsor to error_missing_sponsor.
Sponsor Validation & UI Control
src/pages/sponsors/sponsor-users-list-page/components/edit-user-popup/access-rights-lists.js, src/pages/sponsors/sponsor-users-list-page/components/edit-user-popup/sponsor-section.js, src/pages/sponsors/sponsor-users-list-page/components/edit-user-popup/sponsor-user-form.js
Tightened sponsor field validation from a custom predicate to an explicit object schema requiring id (number) and name (string); added computed flag to detect incomplete sponsors; wired prop to disable "add" button when sponsors are incomplete.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • smarcet

Poem

🐰 A typo fixed with careful grace,
Validation tightened in its place,
No incomplete sponsors shall sneak through,
The form now guards what sponsors do!
hoppy hops

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changes: fixing sponsor validations and disabling the add button when no sponsor is selected, which aligns with the core modifications across multiple files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/sponsor-user-edit-validation
📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

@tomrndom tomrndom requested a review from smarcet March 20, 2026 13:36
Copy link
Copy Markdown

@smarcet smarcet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@smarcet smarcet merged commit a90c64b into master Mar 24, 2026
9 checks passed
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