Skip to content

fix: adjust extra questions types on sponsor badge scan save or add - #1059

Open
tomrndom wants to merge 3 commits into
masterfrom
fix/sponsor-badge-scans-extra-question
Open

fix: adjust extra questions types on sponsor badge scan save or add#1059
tomrndom wants to merge 3 commits into
masterfrom
fix/sponsor-badge-scans-extra-question

Conversation

@tomrndom

@tomrndom tomrndom commented Sep 2, 2026

Copy link
Copy Markdown

ref: https://app.clickup.com/t/9014802374/86bbr3c43

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

Summary by CodeRabbit

  • Bug Fixes
    • Improved extra-question answer handling when submitting badge scans and sponsor badge forms.
    • Answers are now formatted according to their question type, including checkbox values and multi-select responses.
    • Unchecked checkboxes are submitted correctly as “false,” while numeric zero values are preserved.
    • Empty or unavailable answers are excluded from submissions to prevent invalid or incomplete data.

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

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Essentials

Run ID: b147eb9b-5b13-4a0a-a380-4edae4cbd985

📥 Commits

Reviewing files that changed from the base of the PR and between 77ababf and 01de57f.

📒 Files selected for processing (1)
  • src/pages/sponsors/sponsor-page/tabs/sponsor-badge-scans/__tests__/edit-badge-scan-popup.test.js

Included review availability: 3 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.


📝 Walkthrough

Walkthrough

Extra-question submission now uses a shared formatter. The formatter serializes arrays, checkbox values, and nullish values. QR badge and badge-scan submissions resolve question types before formatting and omit empty formatted answers.

Changes

Extra-question submission formatting

Layer / File(s) Summary
Answer serialization contract
src/utils/extra-questions.js
Adds formatAnswerForSubmit to serialize arrays, checkbox booleans, and nullish values for API submission.
Submission flow integration
src/components/mui/mui-qr-badge-popup.js, src/pages/sponsors/sponsor-page/tabs/sponsor-badge-scans/edit-badge-scan-popup.js
Both submission flows resolve each question’s type, format its answer, and omit entries whose formatted answer is an empty string.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 01de5

This change adjusts extra-question handling for sponsor badge scans and adds focused tests; no actionable merge-blocking risk remains beyond normal checks and review.

Suggested reviewers: santipalenque

🚥 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 clearly describes the main change: adjusting extra-question types when saving or adding sponsor badge scans. The wording is concise and related to the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 6…
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.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 6 files.

✨ 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-badge-scans-extra-question

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

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

@santipalenque santipalenque left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

@smarcet
smarcet requested a review from romanetar September 3, 2026 17:08

@romanetar romanetar left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

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.

3 participants