Skip to content

feat: move event category groups to mui#978

Open
priscila-moneo wants to merge 2 commits into
masterfrom
feature/move-event-category-groups-mui
Open

feat: move event category groups to mui#978
priscila-moneo wants to merge 2 commits into
masterfrom
feature/move-event-category-groups-mui

Conversation

@priscila-moneo

@priscila-moneo priscila-moneo commented Jun 12, 2026

Copy link
Copy Markdown

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

image

Summary by CodeRabbit

  • New Features

    • Added search functionality for filtering event category groups by term
    • Enabled sorting and pagination controls for the groups list
  • Improvements

    • Modernized the event category groups list with a refreshed table experience and updated column behaviors
    • Enhanced list state to persist term, pagination, and sorting parameters across requests
  • UI/Style Updates

    • Updated the list header layout and improved the color display using visual swatches
    • Refined deletion copy and updated the delete flow to refresh the list after removal
  • Bug Fixes

    • Adjusted server-side query construction for safer filtering and correct ordering

@coderabbitai

coderabbitai Bot commented Jun 12, 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: af2aa3af-6b3a-43ac-9d5b-c38a97e9b3b2

📥 Commits

Reviewing files that changed from the base of the PR and between 2d543dc and f9057ba.

📒 Files selected for processing (4)
  • src/actions/event-category-actions.js
  • src/i18n/en.json
  • src/pages/events/event-category-group-list-page.js
  • src/reducers/events/event-category-group-list-reducer.js
✅ Files skipped from review due to trivial changes (1)
  • src/i18n/en.json
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/reducers/events/event-category-group-list-reducer.js
  • src/actions/event-category-actions.js
  • src/pages/events/event-category-group-list-page.js

📝 Walkthrough

Walkthrough

Event category groups listing now supports search, pagination, and sorting through parameterized fetching, reducer-backed query state, and a hooks-based page using MUI table controls. The list strings were also updated.

Changes

Event Category Groups List Refactor

Layer / File(s) Summary
Action API and fetch parameters
src/actions/event-category-actions.js
getEventCategoryGroups now accepts term, page, per-page, order, and direction inputs, escapes the search term, and passes query context to the request.
Reducer query state and response mapping
src/reducers/events/event-category-group-list-reducer.js
The reducer now stores list-query fields in default state, persists them on request, maps raw color values from responses, tracks pagination totals, and decrements totals on delete.
Page hooks and table wiring
src/pages/events/event-category-group-list-page.js
The page component moved to hooks, loads data with useEffect, wires search/sort/pagination handlers to the parameterized action, and refreshes after delete without the confirmation flow.
List translations
src/i18n/en.json
The event category group list strings now use the updated title, groups label, and delete confirmation text.

Sequence Diagram(s)

sequenceDiagram
  participant EventCategoryGroupListPage
  participant getEventCategoryGroups
  participant event_category_group_list_reducer as event-category-group-list-reducer
  participant MuiTable

  EventCategoryGroupListPage->>getEventCategoryGroups: getEventCategoryGroups(term, page, perPage, order, orderDir)
  getEventCategoryGroupListPage->>event_category_group_list_reducer: REQUEST_EVENT_CATEGORY_GROUPS
  getEventCategoryGroupListPage->>event_category_group_list_reducer: RECEIVE_EVENT_CATEGORY_GROUPS
  event_category_group_list_reducer->>EventCategoryGroupListPage: updated rows and pagination state
  EventCategoryGroupListPage->>MuiTable: render rows, sorting, paging, delete actions
  MuiTable->>EventCategoryGroupListPage: sort/page/delete callbacks
  EventCategoryGroupListPage->>getEventCategoryGroups: refresh with current query state
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • santipalenque
  • martinquiroga-exo
  • smarcet

Poem

🐰 I hopped through filters, page by page,
With MUI buttons on the stage.
My carrots sorted neat and bright,
And colors swatched in rabbit light.
A tiny whisker-twitching cheer —
The list is lively, crisp, and clear.

🚥 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 accurately summarizes the main change: migrating the event category groups UI to MUI.
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 feature/move-event-category-groups-mui

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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.

🧹 Nitpick comments (3)
src/pages/events/event-category-group-list-page.js (2)

42-46: ⚡ Quick win

Missing dependencies in useEffect hook.

The useEffect hook has an empty dependency array but uses currentSummit and getEventCategoryGroups inside. According to React hooks rules, all values from the component scope used inside the effect should be included in the dependency array.

While the current code may work (since Redux connect stabilizes action creators and route changes likely remount the component), this violates React hooks best practices and may cause issues if the component behavior changes.

♻️ Add missing dependencies
  useEffect(() => {
    if (currentSummit) {
      getEventCategoryGroups();
    }
- }, []);
+ }, [currentSummit, getEventCategoryGroups]);

Note: If currentSummit.id is the actual dependency (not the entire object), you could use:

- }, []);
+ }, [currentSummit?.id, getEventCategoryGroups]);
🤖 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/events/event-category-group-list-page.js` around lines 42 - 46, The
useEffect currently reads currentSummit and calls getEventCategoryGroups but has
an empty dependency array; update the effect to include the real dependencies
(e.g., include getEventCategoryGroups and the summit identifier such as
currentSummit or currentSummit.id) so the effect re-runs correctly when the
summit changes, and keep the existing null-check (if (currentSummit) ...) to
avoid calling the action with no summit; reference the useEffect, currentSummit
(or currentSummit.id) and getEventCategoryGroups symbols when making the change.

58-68: ⚡ Quick win

Consider adding error handling to the delete operation.

The handleDelete function has no error handling. If deleteEventCategoryGroup fails (network error, server error, etc.), the user receives no feedback, and the list won't refresh. This could leave the UI in an inconsistent state.

🛡️ Add error handling
  const handleDelete = (groupId) => {
-   deleteEventCategoryGroup(groupId).then(() =>
+   deleteEventCategoryGroup(groupId)
+     .then(() =>
        getEventCategoryGroups(
          term,
          DEFAULT_CURRENT_PAGE,
          perPage,
          order,
          orderDir
        )
-   );
+     )
+     .catch((err) => {
+       console.error("Failed to delete group:", err);
+       // Optionally show a user-facing error message
+     });
  };
🤖 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/events/event-category-group-list-page.js` around lines 58 - 68,
handleDelete currently calls deleteEventCategoryGroup without handling failures;
update handleDelete to handle errors (e.g., make it async and use try/catch or
attach .catch) so that on success you call getEventCategoryGroups(term,
DEFAULT_CURRENT_PAGE, perPage, order, orderDir) to refresh the list, and on
failure you surface an error to the user (toast/alert) and/or log the error
(include the caught error from deleteEventCategoryGroup). Ensure
getEventCategoryGroups is only invoked after a successful delete and include
references to handleDelete, deleteEventCategoryGroup, getEventCategoryGroups,
DEFAULT_CURRENT_PAGE, term, perPage, order, and orderDir.
src/actions/event-category-actions.js (1)

421-424: 💤 Low value

Minor inconsistency with codebase pattern for order direction.

This code uses an empty string "" for ascending sort (when orderDir === 1), whereas src/actions/attendee-actions.js uses "+" for the same case. Both are typically valid API syntax, but maintaining consistency across the codebase improves readability.

♻️ Align with existing pattern
-      const orderDirSign = orderDir === 1 ? "" : "-";
+      const orderDirSign = orderDir === 1 ? "+" : "-";
🤖 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/actions/event-category-actions.js` around lines 421 - 424, The sort
direction assignment in the block that sets params.order uses an empty string
for ascending (orderDir === 1); change it to use "+" to match the codebase
pattern used in attendee-actions.js—update the orderDirSign logic (the variable
orderDirSign and the params.order assignment) so ascending maps to "+" and
descending to "-" before setting params.order.
🤖 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.

Nitpick comments:
In `@src/actions/event-category-actions.js`:
- Around line 421-424: The sort direction assignment in the block that sets
params.order uses an empty string for ascending (orderDir === 1); change it to
use "+" to match the codebase pattern used in attendee-actions.js—update the
orderDirSign logic (the variable orderDirSign and the params.order assignment)
so ascending maps to "+" and descending to "-" before setting params.order.

In `@src/pages/events/event-category-group-list-page.js`:
- Around line 42-46: The useEffect currently reads currentSummit and calls
getEventCategoryGroups but has an empty dependency array; update the effect to
include the real dependencies (e.g., include getEventCategoryGroups and the
summit identifier such as currentSummit or currentSummit.id) so the effect
re-runs correctly when the summit changes, and keep the existing null-check (if
(currentSummit) ...) to avoid calling the action with no summit; reference the
useEffect, currentSummit (or currentSummit.id) and getEventCategoryGroups
symbols when making the change.
- Around line 58-68: handleDelete currently calls deleteEventCategoryGroup
without handling failures; update handleDelete to handle errors (e.g., make it
async and use try/catch or attach .catch) so that on success you call
getEventCategoryGroups(term, DEFAULT_CURRENT_PAGE, perPage, order, orderDir) to
refresh the list, and on failure you surface an error to the user (toast/alert)
and/or log the error (include the caught error from deleteEventCategoryGroup).
Ensure getEventCategoryGroups is only invoked after a successful delete and
include references to handleDelete, deleteEventCategoryGroup,
getEventCategoryGroups, DEFAULT_CURRENT_PAGE, term, perPage, order, and
orderDir.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e540225a-5efe-492f-9179-3b3ea7dda4c5

📥 Commits

Reviewing files that changed from the base of the PR and between 2f1f3b3 and 2d543dc.

📒 Files selected for processing (4)
  • src/actions/event-category-actions.js
  • src/i18n/en.json
  • src/pages/events/event-category-group-list-page.js
  • src/reducers/events/event-category-group-list-reducer.js

@priscila-moneo priscila-moneo requested a review from smarcet June 12, 2026 15:43

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

LGTM

Copilot AI 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.

Pull request overview

This PR modernizes the Event Category Groups list view by migrating it to the MUI table components and adds server-driven list controls (search/sort/pagination) backed by updated Redux state and API parameters.

Changes:

  • Updated getEventCategoryGroups to support term filtering, sorting, and pagination, including escaping filter values.
  • Expanded the event category group list reducer to track term/order/paging metadata from requests and responses.
  • Replaced the legacy table UI with MuiTable + SearchInput, including a color swatch renderer and updated copy.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/reducers/events/event-category-group-list-reducer.js Tracks term/sort/paging state and parses paginated responses for the groups list.
src/pages/events/event-category-group-list-page.js Migrates the list UI to MUI components and wires up search/sort/pagination handlers.
src/i18n/en.json Updates list title/labels and delete warning copy.
src/actions/event-category-actions.js Adds query params for filtering/sorting/paging when fetching category groups.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/pages/events/event-category-group-list-page.js Outdated
Comment thread src/i18n/en.json Outdated
Comment thread src/actions/event-category-actions.js Outdated
createAction(RECEIVE_EVENT_CATEGORY_GROUPS),
`${window.API_BASE_URL}/api/v1/summits/${currentSummit.id}/track-groups`,
authErrorHandler,
{ order, orderDir, term, perPage }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@priscila-moneo page is missing from this REQUEST payload — only order, orderDir, term, and perPage are included. The reducer's REQUEST_EVENT_CATEGORY_GROUPS case can't update currentPage optimistically, so the pagination component keeps the old page highlighted until the API response arrives. Consider adding currentPage: page here and destructuring it in the reducer's REQUEST case.

}
case EVENT_CATEGORY_GROUP_DELETED: {
let { groupId } = payload;
const { groupId } = payload;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@priscila-moneo When an item is deleted, totalEventCategoryGroups is not decremented — only the array is filtered. The count shown above the table ("N Groups") stays stale until the full server reload in handleDelete completes. Adding totalEventCategoryGroups: state.totalEventCategoryGroups - 1 to this return would keep it in sync immediately after deletion.

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

@priscila-moneo please review

Signed-off-by: Priscila Moneo <priscila_moneo@hotmail.com.ar>
Signed-off-by: Priscila Moneo <priscila_moneo@hotmail.com.ar>
@priscila-moneo priscila-moneo force-pushed the feature/move-event-category-groups-mui branch from 2d543dc to f9057ba Compare June 25, 2026 23:00
@priscila-moneo priscila-moneo requested a review from smarcet June 25, 2026 23:01
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.

4 participants