Skip to content

Conversation

@santipalenque
Copy link

@santipalenque santipalenque commented Jan 12, 2026

https://app.clickup.com/t/86b66n5kb

Summary by CodeRabbit

  • New Features

    • Added sponsor cart management tab with search, form creation, and cart item management capabilities
    • Added lock/unlock functionality for sponsor cart forms
    • Added payment options (Credit Card and Invoice) for sponsor carts
    • Enhanced table component to support custom rows and improved pagination controls
  • Localization

    • Added translation strings for cart-related UI elements

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 12, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

This PR introduces a sponsor cart feature, adding Redux actions and reducers to manage sponsor cart operations (fetch, delete, lock/unlock forms), new Material-UI table row components (TotalRow, NotesRow), a SponsorCartTab component for cart management, i18n translations, and updated API scopes for cart operations.

Changes

Cohort / File(s) Summary
Configuration & Internationalization
.env.example, src/i18n/en.json
Added customized-form/write, customized-form/read, carts/read, carts/write scopes to PURCHASES_API_SCOPES; added cart_tab object with cart-related UI strings and total field in mui_table section.
Redux Actions
src/actions/sponsor-cart-actions.js
New module exporting action types (REQUEST_SPONSOR_CART, RECEIVE_SPONSOR_CART, SPONSOR_CART_FORM_DELETED, SPONSOR_CART_FORM_LOCKED) and async action creators: getSponsorCart(), deleteSponsorCartForm(), lockSponsorCartForm(), unlockSponsorCartForm() with custom error handling.
Redux Reducer
src/reducers/sponsors/sponsor-page-cart-list-reducer.js
New reducer managing cart state with handlers for cart fetch, form deletion, and lock/unlock operations; normalizes amounts and computes totals.
Table Components
src/components/mui/table/extra-rows/NotesRow.jsx, src/components/mui/table/extra-rows/TotalRow.jsx, src/components/mui/table/extra-rows/index.js
Two new simple table row components: NotesRow displays centered notes, TotalRow displays computed totals aligned to a target column; index.js re-exports both.
Table Base Component
src/components/mui/table/mui-table.js
Added support for children prop to render custom rows in table body; made pagination conditional based on prop availability.
Sponsor Cart Tab
src/pages/sponsors/sponsor-cart-tab/index.js
New Redux-connected component managing sponsor cart UI: displays cart forms in table with code/name/amount columns, provides actions to manage items, delete forms, and toggle lock status; includes payment options and total row.
Page Integration
src/pages/sponsors/edit-sponsor-page.js
Added SponsorCartTab import and new tab panel (index 5) to sponsor edit page.
Utilities
src/store.js, src/utils/methods.js
Registered new sponsorPageCartListReducer in root store; reordered imports in methods.js.

Sequence Diagram

sequenceDiagram
    participant User
    participant SponsorCartTab
    participant Redux Store
    participant API
    participant Server

    User->>SponsorCartTab: Mount/View Cart
    SponsorCartTab->>Redux Store: dispatch(getSponsorCart)
    Redux Store->>Redux Store: REQUEST_SPONSOR_CART
    Redux Store->>API: GET /sponsor-cart
    API->>Server: Fetch sponsor cart
    Server-->>API: Cart data
    API-->>Redux Store: Cart response
    Redux Store->>Redux Store: RECEIVE_SPONSOR_CART (normalize amounts)
    Redux Store-->>SponsorCartTab: Update state
    SponsorCartTab->>User: Render cart table

    User->>SponsorCartTab: Delete Form
    SponsorCartTab->>Redux Store: dispatch(deleteSponsorCartForm)
    Redux Store->>API: DELETE /form
    API->>Server: Delete form
    Server-->>API: Success
    API-->>Redux Store: Response
    Redux Store->>Redux Store: SPONSOR_CART_FORM_DELETED
    Redux Store->>Redux Store: dispatch(getSponsorCart) refresh
    Redux Store-->>SponsorCartTab: Updated state
    SponsorCartTab->>User: Render updated cart
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • feat: sponsor cart view #748 — Implements complementary sponsor cart feature with identical PURCHASES_API_SCOPES modifications and likely related backend endpoint integration.

Suggested reviewers

  • smarcet

Poem

🐰 A cart for sponsors, oh what delight!
New forms and locks, and tables so bright,
With totals and rows, all laid out just right,
The rabbit hops joy at this feature's sight! 🎉

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c9ae9ce and 19202f7.

📒 Files selected for processing (12)
  • .env.example
  • src/actions/sponsor-cart-actions.js
  • src/components/mui/table/extra-rows/NotesRow.jsx
  • src/components/mui/table/extra-rows/TotalRow.jsx
  • src/components/mui/table/extra-rows/index.js
  • src/components/mui/table/mui-table.js
  • src/i18n/en.json
  • src/pages/sponsors/edit-sponsor-page.js
  • src/pages/sponsors/sponsor-cart-tab/index.js
  • src/reducers/sponsors/sponsor-page-cart-list-reducer.js
  • src/store.js
  • src/utils/methods.js

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

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