Skip to content

feat: move event category groups to mui#978

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

feat: move event category groups to mui#978
priscila-moneo wants to merge 1 commit 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 to find event category groups by term
    • Introduced sorting and pagination controls for the groups list
  • Improvements

    • Modernized the event category groups list interface with an enhanced table component
    • Improved state management to track search parameters, pagination, and sort order
  • UI/Style Updates

    • Updated list layout with improved visual styling and color swatches for category groups

Signed-off-by: Priscila Moneo <priscila_moneo@hotmail.com.ar>
@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Event category groups list now supports search, pagination, and sorting. The action fetches groups with parameterized filters; the reducer tracks query state and pagination metadata; the page component migrated from class to hooks; and the table UI switched from legacy components to MUI Table with dynamic column configuration.

Changes

Event Category Groups List: Pagination, Filtering, Sorting Refactor

Layer / File(s) Summary
Action API: Parameterized group fetching
src/actions/event-category-actions.js
getEventCategoryGroups now accepts term, page, perPage, order, orderDir parameters; imports updated to use escapeFilterValue and new pagination constants instead of legacy HUNDRED_PER_PAGE.
Reducer: Query and pagination state
src/reducers/events/event-category-group-list-reducer.js
State expanded to store term, order, orderDir, currentPage, lastPage, perPage, totalEventCategoryGroups; REQUEST case persists query metadata; RECEIVE case maps color values directly and sets pagination fields from response.
Page component: Hooks migration and handlers
src/pages/events/event-category-group-list-page.js
Converted from class component to function with useEffect for initial load; new handlers (handleSearch, handleSort, handlePageChange) call parameterized action with current state; delete flow simplified to direct deletion and list refresh.
Table UI: MUI migration and column configuration
src/pages/events/event-category-group-list-page.js
Table switched from legacy openstack-uicore-foundation to MuiTable; columns use object definitions with translated headers, widths, and sortability; color column renders styled Box swatch; page header uses MUI Grid2, Button, and SearchInput.
Internationalization: UI labels and messages
src/i18n/en.json
Updated event category groups list translations: title → "Activity Category Groups List", label → "Groups", delete warning message text changed.

Sequence Diagram(s)

sequenceDiagram
  participant Page as EventCategoryGroupListPage
  participant Action as getEventCategoryGroups
  participant Reducer as event-category-group-list-reducer
  participant UI as MuiTable + SearchInput

  Page->>Page: useEffect on mount<br/>(currentSummit exists)
  Page->>Action: getEventCategoryGroups(term, page, perPage, order, orderDir)
  Action->>Reducer: REQUEST_EVENT_CATEGORY_GROUPS<br/>(payload with query params)
  Reducer->>Reducer: store term, order, orderDir,<br/>perPage in state
  Action->>Reducer: RECEIVE_EVENT_CATEGORY_GROUPS<br/>(groups array + pagination metadata)
  Reducer->>Reducer: map groups with color,<br/>set currentPage, lastPage,<br/>totalEventCategoryGroups
  Reducer->>Page: updated state with<br/>eventCategoryGroups + pagination
  Page->>UI: render MuiTable with rows,<br/>handlers for sort/paginate
  UI->>Page: handleSort(column, direction)<br/>or handlePageChange(page, perPage)
  Page->>Action: getEventCategoryGroups(term, newPage, newPerPage, column, direction)
  Action->>Reducer: REQUEST / RECEIVE cycle
  Reducer->>Page: updated rows and pagination
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • smarcet
  • martinquiroga-exo

Poem

🐰 With whiskers twitched and paws aligned,
We've sorted lists and searches refined!
From class to hooks, the components now flow,
MUI tables make pagination glow, 🎉
Filters and pages in harmony blend,
A refactor complete, from start to the end!

🚥 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 component to Material-UI (MUI), which is the primary focus across multiple files.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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

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.

ESLint install failed due to a network error.


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 and usage tips.

@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

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