Skip to content

fix: migrate room booking list page into mui/uicore components - #1129

Open
tomrndom wants to merge 2 commits into
masterfrom
fix/room-booking-list-mui
Open

tomrndom wants to merge 2 commits into
masterfrom
fix/room-booking-list-mui

Conversation

@tomrndom

@tomrndom tomrndom commented Oct 15, 2026 •

Copy link
Copy Markdown

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

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

Summary by CodeRabbit

  • New Features
    • Added a refund dialog showing booking details and allowing users to enter a refund amount. Refunds require a non-negative whole number; the dialog stays open if saving fails.
    • Added email filtering to the room booking list, with options to match, exclude, or exactly match an email address. Filters work alongside search and update the list automatically.
  • Updates
    • Cancellation now proceeds without a separate confirmation prompt.
    • Booking and refund dialogs display booking-specific details, including the owner, room, and payment amounts.

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

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Review in 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: b86dd9d8-fdbd-42c3-95a2-ee5a36704082
📥 Commits

Reviewing files that changed from the base of the PR and between e4213b0 and b3492ba.

📒 Files selected for processing: 3
  • src/pages/room_bookings/__tests__/room-booking-list-page.helpers.test.js
  • src/pages/room_bookings/helpers.js
  • src/pages/room_bookings/room-booking-list-page.js
💤 Files with no reviewable changes: 1
  • src/pages/room_bookings/helpers.js

Included review availability: This review used your included allowance. 4 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.

📝 Walkthrough

The room-booking list now uses grid-based filters and MUI components. Booking-list requests guard against stale responses. Refund and cancellation actions use updated loading and error handling, and refunds use a dedicated popup.

Changes: Room Booking Management

Layer / File(s) Summary
Booking request sequencing and state
src/utils/methods.js, src/actions/room-booking-actions.js, src/actions/sponsor-reports-actions.js, src/actions/__tests__/room-booking-actions.test.js, src/reducers/room_bookings/room-booking-list-reducer.js
A shared sequenced helper now guards booking-list requests, and sponsor-report actions use that helper. Booking requests pass perPage metadata, the reducer stores it, and tests cover stale responses.
Booking list filters and interface
src/pages/room_bookings/room-booking-list-page.helpers.js, src/pages/room_bookings/room-booking-list-page.js, src/pages/room_bookings/__tests__/*, src/components/inputs/email-filter/*, src/i18n/en.json
The list uses grid filters and MUI table controls. Helpers map email filter operators to query operators. The previous email-filter component and related labels were removed; tests cover filter construction and requests.
Refund and cancellation handling
src/actions/room-booking-actions.js, src/pages/room_bookings/components/refund-booking-popup.js, src/pages/room_bookings/__tests__/refund-booking-popup.test.js, src/actions/__tests__/room-booking-actions.test.js
Refund and cancellation actions stop loading after rejected requests. The refund popup validates non-negative integer amounts, blocks closing while saving, and closes after a successful save.

Priority: ➖ Normal

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant RoomBookingListPage
  participant useGridFilter
  participant getRoomBookings
  participant RequestAPI
  participant RoomBookingListReducer
  RoomBookingListPage->>useGridFilter: Read parsed filters
  useGridFilter-->>RoomBookingListPage: Return filters and values
  RoomBookingListPage->>getRoomBookings: Fetch bookings with filters and page
  getRoomBookings->>RequestAPI: Request booking list
  RequestAPI-->>getRoomBookings: Return bookings response
  getRoomBookings->>RoomBookingListReducer: Dispatch received bookings
Loading

Suggested reviewers: smarcet

Merge Risk: ⚪ Minimal · up to b3492

The updated booking list and refund/cancellation flows have no verified user-facing regression that requires delaying merge.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly identifies the primary change: migrating the room booking list page to MUI and UIcore components. This matches the main implementation changes.
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 1…
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 12 files.

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@tomrndom tomrndom self-assigned this Oct 15, 2026
@tomrndom
tomrndom marked this pull request as ready for review October 15, 2026 21:27

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

good job @tomrndom , just a couple of nit picks

const { currentSummitState } = getState();
const accessToken = await getAccessTokenSafely();
if (!isCurrent()) return Promise.resolve();
guardedDispatch(startLoading());

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

this is not repo standard

* limitations under the License.
* */

import T from "i18n-react/dist/i18n-react";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

lets just call this helpers.js , the directory gives the context

const handleRefund = (booking, amount) =>
refundRoomBooking(booking.room_id, booking.id, amount);

if (!currentSummit.id) return <div />;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

summitIdLayout already guards this, remove

Signed-off-by: Tomás Castillo <tcastilloboireau@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