Skip to content

Feature: new sponsor cart grid - #1000

Merged
smarcet merged 6 commits into
masterfrom
feature/new-sponsor-cart-grid
Jul 10, 2026
Merged

Feature: new sponsor cart grid#1000
smarcet merged 6 commits into
masterfrom
feature/new-sponsor-cart-grid

Conversation

@santipalenque

@santipalenque santipalenque commented Jul 1, 2026

Copy link
Copy Markdown

https://app.clickup.com/t/9014802374/86ban7rdx

Summary by CodeRabbit

  • Chores
    • Updated a project dependency to a newer version.
  • Bug Fixes
    • Streamlined the sponsor cart edit form by removing item notes/settings modal actions and the additional-items validation/error display.
    • Simplified form validation/submission behavior so submission is prevented when validation fails.
  • Tests
    • Updated sponsor cart edit form tests to match the simplified item table and revised validation assertions.

@coderabbitai

coderabbitai Bot commented Jul 1, 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: 7423d362-c3b9-49ee-a592-88724c115441

📥 Commits

Reviewing files that changed from the base of the PR and between 78b92d4 and 13a6bb7.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (1)
  • package.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • package.json

📝 Walkthrough

Walkthrough

Removes notes and settings modal handling from the sponsor cart edit form, simplifies validation messaging and value parsing, updates the matching tests, and bumps the foundation dependency version.

Changes

Sponsor Cart Edit Form Simplification

Layer / File(s) Summary
Simplify parsing and validation
src/pages/sponsors/sponsor-page/tabs/sponsor-cart-tab/components/edit-form/index.js
Normalizes radio, combo, and checkbox-list values and replaces translated validation messages with placeholder or simplified schemas.
Remove modal and error handling
src/pages/sponsors/sponsor-page/tabs/sponsor-cart-tab/components/edit-form/index.js
Removes notes/settings state, modal components, table callbacks, and additional-item error rendering, while adding noValidate to the form.
Update edit-form tests
src/pages/sponsors/sponsor-page/tabs/sponsor-cart-tab/components/edit-form/__tests__/edit-cart-form.test.js
Simplifies the table mock, checks item and button rendering without dialogs, and verifies invalid submissions do not update the cart.
Bump foundation dependency
package.json
Updates openstack-uicore-foundation from 5.0.38 to 5.0.40.

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

Possibly related PRs

Suggested reviewers: 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 matches the main change: a new sponsor cart grid feature.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/new-sponsor-cart-grid

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

package.json

Parsing error: Missing semicolon. (2:8)


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

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🧹 Nitpick comments (2)
src/pages/sponsors/sponsor-page/tabs/sponsor-cart-tab/components/edit-form/__tests__/edit-cart-form.test.js (2)

53-77: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Remove now-unused notes/settings modal mocks.

index.js no longer imports notes-modal or item-settings-modal (per this cohort's summary), so these two jest.mock blocks are dead weight kept alive only by the "does not render any dialog by default" test's queryByRole("dialog") check, which would pass without them too since nothing renders a dialog.

♻️ Suggested cleanup
-// Mock sub-components used directly by index.js
-jest.mock("openstack-uicore-foundation/lib/components/mui/notes-modal", () => {
-  const React = require("react");
-  return {
-    __esModule: true,
-    default: ({ open, onClose }) =>
-      open ? (
-        <div role="dialog">
-          <button aria-label="close" onClick={onClose} type="button">
-            close
-          </button>
-        </div>
-      ) : null
-  };
-});
-
-jest.mock(
-  "openstack-uicore-foundation/lib/components/mui/item-settings-modal",
-  () => {
-    const React = require("react");
-    return {
-      __esModule: true,
-      default: ({ open }) => (open ? <div role="dialog">Settings</div> : null)
-    };
-  }
-);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/pages/sponsors/sponsor-page/tabs/sponsor-cart-tab/components/edit-form/__tests__/edit-cart-form.test.js`
around lines 53 - 77, Remove the now-unused `jest.mock` blocks for `notes-modal`
and `item-settings-modal` in `edit-cart-form.test.js`; `EditCartForm` no longer
imports those components, so the mocks are dead code. Keep the existing `does
not render any dialog by default` test in place, but drop the
`openstack-uicore-foundation/lib/components/mui/notes-modal` and
`.../item-settings-modal` mocks since the `queryByRole("dialog")` assertion does
not depend on them.

480-496: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Vacuous assertion no longer tests anything meaningful.

Since all validation messages were replaced with " " throughout index.js, the literal string "validation.additional_items" can never be rendered anymore, so expect(screen.queryByText("validation.additional_items")).not.toBeInTheDocument() always trivially passes regardless of whether validation actually succeeded/failed. Consider asserting on mockUpdateCartForm having been called with the expected payload, or dropping this now-meaningless check.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/pages/sponsors/sponsor-page/tabs/sponsor-cart-tab/components/edit-form/__tests__/edit-cart-form.test.js`
around lines 480 - 496, The assertion in edit-cart-form.test.js is vacuous
because `validation.additional_items` can no longer render after the `index.js`
validation messages were changed to blank strings. Update the `does not show
error message when no Item fields have validation errors` test to verify
meaningful behavior instead, such as asserting `mockUpdateCartForm` was called
with the expected payload from `renderWithStore`/`userEvent.click`, or remove
the obsolete `screen.queryByText("validation.additional_items")` check entirely.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@package.json`:
- Line 96: The dependency pin for openstack-uicore-foundation is still on the
beta release, so update the package manifest to use the stable 5.0.38 version
once it is available and keep the edit-form-related change isolated. Locate the
version entry in package.json and replace the beta version with the non-beta
release, ensuring no other dependency versions are unnecessarily changed.

---

Nitpick comments:
In
`@src/pages/sponsors/sponsor-page/tabs/sponsor-cart-tab/components/edit-form/__tests__/edit-cart-form.test.js`:
- Around line 53-77: Remove the now-unused `jest.mock` blocks for `notes-modal`
and `item-settings-modal` in `edit-cart-form.test.js`; `EditCartForm` no longer
imports those components, so the mocks are dead code. Keep the existing `does
not render any dialog by default` test in place, but drop the
`openstack-uicore-foundation/lib/components/mui/notes-modal` and
`.../item-settings-modal` mocks since the `queryByRole("dialog")` assertion does
not depend on them.
- Around line 480-496: The assertion in edit-cart-form.test.js is vacuous
because `validation.additional_items` can no longer render after the `index.js`
validation messages were changed to blank strings. Update the `does not show
error message when no Item fields have validation errors` test to verify
meaningful behavior instead, such as asserting `mockUpdateCartForm` was called
with the expected payload from `renderWithStore`/`userEvent.click`, or remove
the obsolete `screen.queryByText("validation.additional_items")` check entirely.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 36dd7fb8-a7b8-45ec-a4c8-69d7a18986bd

📥 Commits

Reviewing files that changed from the base of the PR and between cfc6779 and 9e480d2.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (3)
  • package.json
  • src/pages/sponsors/sponsor-page/tabs/sponsor-cart-tab/components/edit-form/__tests__/edit-cart-form.test.js
  • src/pages/sponsors/sponsor-page/tabs/sponsor-cart-tab/components/edit-form/index.js

Comment thread package.json Outdated

@smarcet smarcet 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

Signed-off-by: sebastian marcet <smarcet@gmail.com>
@smarcet
smarcet merged commit 571aea4 into master Jul 10, 2026
9 checks passed
smarcet added a commit that referenced this pull request Jul 16, 2026
* feat: new sponsor cart grid design

* fix: tests

* fix: cast value as string

* chore: update uicore

* chore(deps): update uicore to 5.0.40

---------

Signed-off-by: sebastian marcet <smarcet@gmail.com>
Co-authored-by: smarcet <smarcet@gmail.com>
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