Skip to content

fix: add validation for sponsorship types on show pages#939

Open
tomrndom wants to merge 1 commit into
masterfrom
fix/show-page-sponsorship-ddl-required
Open

fix: add validation for sponsorship types on show pages#939
tomrndom wants to merge 1 commit into
masterfrom
fix/show-page-sponsorship-ddl-required

Conversation

@tomrndom
Copy link
Copy Markdown

@tomrndom tomrndom commented May 14, 2026

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

image

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

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced the sponsorship selection form with improved validation and error handling. Users now receive clear, contextual feedback when required sponsorship selections are missing, helping them understand what needs to be selected. The better validation messaging improves the overall user experience and reduces form submission errors significantly.

Review Change Stack

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

coderabbitai Bot commented May 14, 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: d198f30f-818f-40b4-8ce2-f499f782f015

📥 Commits

Reviewing files that changed from the base of the PR and between 81351ea and d5a184a.

📒 Files selected for processing (1)
  • src/pages/sponsors-global/page-templates/page-template-popup/index.js

📝 Walkthrough

Walkthrough

A popup form component for sponsor templates adds client-side validation for sponsorship type selection. The component now requires at least one sponsorship type to be selected when sponsorships are displayed, and surfaces validation errors in the UI via MUI FormControl and FormHelperText components.

Changes

Sponsorship Types Validation and Error Display

Layer / File(s) Summary
Sponsorship types validation schema and error display
src/pages/sponsors-global/page-templates/page-template-popup/index.js
Formik validation schema extends to conditionally require non-empty sponsorship_types array when showSponsorships is true. The sponsorship checkbox selector is wrapped in FormControl that sets error state from Formik validation, renders FormHelperText with validation feedback, and imports FormControl and FormHelperText from MUI.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • fntechgit/summit-admin#924: Both PRs modify sponsor-related form validation to enforce correct checkbox/array selection rules and surface validation errors in the UI.
  • fntechgit/summit-admin#799: Both PRs modify the sponsorship types dropdown behavior in the same popup component file, feeding sponsorship data and adding validation/error state display.
  • fntechgit/summit-admin#823: Both PRs update sponsor-template handling for sponsorship_types field—this PR adds Formik validation and UI error display, while the related PR normalizes payload/selection logic for those fields.

Suggested reviewers

  • smarcet

Poem

🐰 A checkbox that knows what it needs,
Sponsorship types now validated with care,
Error messages bloom when rules aren't met,
FormControl whispers the truth that was there. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: add validation for sponsorship types on show pages' directly and clearly matches the main change: adding validation for sponsorship types in the popup component.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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/show-page-sponsorship-ddl-required

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


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

@tomrndom tomrndom requested a review from smarcet May 14, 2026 21:45
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.

1 participant