Skip to content

Feature: new sponsor cart grid#1000

Open
santipalenque wants to merge 4 commits into
masterfrom
feature/new-sponsor-cart-grid
Open

Feature: new sponsor cart grid#1000
santipalenque wants to merge 4 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 beta version.
  • Bug Fixes
    • Streamlined the sponsor cart edit form by removing notes/settings modal actions and per-item error display.
    • Simplified form behavior and validation handling so submission is blocked when validation fails, without redundant messaging.
  • 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: 5bd4271a-32a2-4f8f-bcbd-5f77936e23c6

📥 Commits

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

⛔ 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 due to trivial 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 one dependency version.

Changes

Sponsor Cart Edit Form Simplification

Layer / File(s) Summary
Remove modal imports and state
src/pages/sponsors/sponsor-page/tabs/sponsor-cart-tab/components/edit-form/index.js
Removes React state and modal imports used for notes and settings dialogs.
Strip translated validation messages
src/pages/sponsors/sponsor-page/tabs/sponsor-cart-tab/components/edit-form/index.js
Simplifies parse/validation handling by replacing translated messages with placeholders and adjusting schema branches.
Remove error display and modal rendering
src/pages/sponsors/sponsor-page/tabs/sponsor-cart-tab/components/edit-form/index.js
Removes the extra item-error block, callback wiring, noValidate-related form changes, and modal rendering.
Update edit-cart-form tests
src/pages/sponsors/sponsor-page/tabs/sponsor-cart-tab/components/edit-form/__tests__/edit-cart-form.test.js
Updates the mock and assertions to match the removed modal interactions and revised validation behavior.
Bump openstack-uicore-foundation dependency
package.json
Updates the dependency version in package.json.

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 reflects the main sponsor cart grid feature work and is concise and specific.
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

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