Skip to content

fix: replace item popup with shared item popup, adjust props and actions - #1034

Open
tomrndom wants to merge 1 commit into
masterfrom
fix/sponsor-global-manage-item-popup
Open

fix: replace item popup with shared item popup, adjust props and actions#1034
tomrndom wants to merge 1 commit into
masterfrom
fix/sponsor-global-manage-item-popup

Conversation

@tomrndom

@tomrndom tomrndom commented Aug 4, 2026

Copy link
Copy Markdown

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

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

Summary by CodeRabbit

  • New Features

    • Added configurable validation requiring a positive default quantity when creating or editing sponsor inventory items.
    • Unified sponsor inventory creation, editing, and inline updates through a consistent dialog experience.
    • Added distinct success feedback for newly created and updated items.
  • Bug Fixes

    • Improved required-field validation for sponsor item codes, names, and default quantities.
    • Prevented invalid quantity values from being submitted.

…in actions, add tests

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

coderabbitai Bot commented Aug 4, 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: Pro

Run ID: 964c1ebf-a778-4c66-a94b-279c8743d4d6

📥 Commits

Reviewing files that changed from the base of the PR and between 78ef677 and 1b3e483.

📒 Files selected for processing (7)
  • src/actions/sponsor-forms-actions.js
  • src/pages/sponsors-global/form-templates/__tests__/sponsor-inventory-popup.test.js
  • src/pages/sponsors-global/form-templates/sponsor-inventory-popup.js
  • src/pages/sponsors/sponsor-form-item-list-page/__tests__/sponsor-form-item-list-page.test.js
  • src/pages/sponsors/sponsor-form-item-list-page/components/sponsor-form-item-form.js
  • src/pages/sponsors/sponsor-form-item-list-page/components/sponsor-form-item-popup.js
  • src/pages/sponsors/sponsor-form-item-list-page/index.js
💤 Files with no reviewable changes (2)
  • src/pages/sponsors/sponsor-form-item-list-page/components/sponsor-form-item-form.js
  • src/pages/sponsors/sponsor-form-item-list-page/components/sponsor-form-item-popup.js

📝 Walkthrough

Walkthrough

The PR consolidates sponsor item creation and updates into saveSponsorFormItem, adds conditional default_quantity validation to SponsorItemDialog, and replaces the legacy sponsor item popup with the inventory dialog on the sponsor form item page.

Changes

Sponsor item CRUD

Layer / File(s) Summary
Unified sponsor item save action
src/actions/sponsor-forms-actions.js
saveSponsorFormItem uses POST for new items and PUT for existing items. It dispatches separate success notifications and always stops loading.
Inventory dialog quantity validation
src/pages/sponsors-global/form-templates/sponsor-inventory-popup.js, src/pages/sponsors-global/form-templates/__tests__/*
default_quantity is conditionally required through requireDefaultQuantity. Tests cover dialog modes, required fields, validation, and successful submission.
Sponsor item page integration
src/pages/sponsors/sponsor-form-item-list-page/index.js, src/pages/sponsors/sponsor-form-item-list-page/components/*, src/pages/sponsors/sponsor-form-item-list-page/__tests__/*
The page uses SponsorInventoryDialog and saveSponsorFormItem for CRUD and inline edits. The legacy form and popup components are removed. Tests use the shared save action.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: santipalenque, smarcet

🚥 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 summarizes the main changes: replacing the item popup and updating related props and actions.
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.
✨ 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-global-manage-item-popup

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

@tomrndom
tomrndom requested a review from smarcet August 5, 2026 22:00
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