Skip to content

feat: move activity type list to mui#969

Open
priscila-moneo wants to merge 3 commits into
masterfrom
feature/move-activity-types-grid-mui
Open

feat: move activity type list to mui#969
priscila-moneo wants to merge 3 commits into
masterfrom
feature/move-activity-types-grid-mui

Conversation

@priscila-moneo

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

Copy link
Copy Markdown

ref: https://app.clickup.com/t/86bac70mf

image

Summary by CodeRabbit

  • New Features
    • Event type lists now support search, sorting, and pagination.
    • Create and edit event types now happen in a dialog popup (instead of separate pages).
  • Bug Fixes
    • After deleting or seeding event types, the list refreshes correctly and removes deleted items.
    • List counts, page indicators, and sorting/search criteria stay in sync with displayed results.
  • Documentation
    • Updated the delete confirmation text for activity types.

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Event type screens now use parameterized list fetching, richer list state, a dialog-based create/edit flow, updated delete copy, and a simplified layout that routes only to the list page.

Changes

Event Type Flow

Layer / File(s) Summary
List data flow
src/actions/event-type-actions.js, src/reducers/events/event-type-list-reducer.js
The event type list action now accepts search, paging, and sort inputs, and the reducer stores request parameters, pagination, totals, and seeded counts.
Dialog save flow
src/pages/events/components/event-type-dialog.js, src/components/forms/event-type-form.js
The event type dialog manages local saving state, closes only after successful saves, and passes save and media-upload handlers into the form while disabling the form save button during submission.
Page wiring and copy
src/pages/events/event-type-list-page.js, src/i18n/en.json
The list page now uses hooks, MuiTable, SearchInput, dialog-based edit and add actions, delete confirmation props, updated prop contracts, and refreshed delete-warning text.
Layout routing
src/layouts/event-type-layout.js
The event type layout is now a functional component with prop types and routes only the list page plus the fallback page.

Sequence Diagram(s)

sequenceDiagram
  participant EventTypeListPage
  participant EventTypeDialog
  participant EventTypeForm
  participant saveEventType
  EventTypeListPage->>EventTypeDialog: open for add/edit
  EventTypeDialog->>EventTypeForm: render with isSaving and handlers
  EventTypeForm->>saveEventType: submit entity data
  saveEventType-->>EventTypeDialog: resolve or reject
  EventTypeDialog-->>EventTypeListPage: close on success
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Suggested reviewers

  • smarcet
  • martinquiroga-exo
  • santipalenque

Poem

Hoppity-hop through lists I go,
With search and sort and totals to show.
A dialog pops, I save with care,
And lists stay tidy, neat, and fair.
🐇✨

🚥 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: moving the activity type list page 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-activity-types-grid-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.

@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

};
} else {
return state;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

totalEventTypes is not updated here. The new page renders a count badge ({totalEventTypes} Activity Types) that will show the pre-seed number after seeding completes.

Suggested fix:

case EVENT_TYPES_SEEDED: {
  const eventTypesAdded = payload.response.data;
  if (eventTypesAdded.length > 0) {
    return {
      ...state,
      eventTypes: [...state.eventTypes, ...eventTypesAdded],
      totalEventTypes: state.totalEventTypes + eventTypesAdded.length
    };
  }
  return state;
}

@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-activity-types-grid-mui branch from 77cea30 to 6872754 Compare June 24, 2026 21:57
@priscila-moneo priscila-moneo requested a review from smarcet June 24, 2026 21:57

@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: 3

🤖 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 `@src/pages/events/event-type-list-page.js`:
- Around line 45-47: The initial mount fetch in the event type list page is
passing a null search term into state, which then propagates to SearchInput and
paging/sorting handlers. Update the getEventTypes flow in
event-type-list-page.js so the first load uses the current term value or an
empty string instead of null, and ensure the reducer state.term stays normalized
to a string. Use the getEventTypes call inside useEffect and the
SearchInput/handlePageChange/handleSort path as the key places to verify the
fix.
- Around line 75-77: Sorting in handleSort keeps the existing currentPage, which
can leave the list on a later page after a new sort. Update handleSort in
event-type-list-page.js to call getEventTypes with DEFAULT_CURRENT_PAGE instead
of currentPage so sorting always restarts from the first page.
- Around line 124-136: The seed action in event-type-list-page is updating the
store without refreshing the server-paginated table, so the current page can
show extra rows and become out of sync. Update the seed button flow in
event-type-list-page to use a handler similar to handleDelete: await dispatching
seedEventTypes, then trigger a fresh page-1 fetch so the list resets to the
server state. Keep the fix centered around the seedEventTypes click handler and
the existing pagination fetch logic used by handleDelete/currentPage/perPage.
🪄 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: 94243037-e829-4dfe-b4ec-f4f93d3a1e3a

📥 Commits

Reviewing files that changed from the base of the PR and between d3f018b and 6872754.

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

Comment on lines +75 to +77
const handleSort = (key, dir) => {
getEventTypes(term, currentPage, perPage, key, dir);
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Sorting retains the current page.

handleSort passes currentPage instead of resetting to DEFAULT_CURRENT_PAGE. Re-sorting while on a later page can leave the user on a page that no longer reflects the new ordering's first results. Resetting to page 1 on sort is the typical expectation.

♻️ Proposed fix
   const handleSort = (key, dir) => {
-    getEventTypes(term, currentPage, perPage, key, dir);
+    getEventTypes(term, DEFAULT_CURRENT_PAGE, perPage, key, dir);
   };
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const handleSort = (key, dir) => {
getEventTypes(term, currentPage, perPage, key, dir);
};
const handleSort = (key, dir) => {
getEventTypes(term, DEFAULT_CURRENT_PAGE, perPage, key, dir);
};
🤖 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-type-list-page.js` around lines 75 - 77, Sorting in
handleSort keeps the existing currentPage, which can leave the list on a later
page after a new sort. Update handleSort in event-type-list-page.js to call
getEventTypes with DEFAULT_CURRENT_PAGE instead of currentPage so sorting always
restarts from the first page.

Comment on lines +124 to +136
<Button
variant="outlined"
onClick={seedEventTypes}
sx={{
height: "36px",
padding: "6px 16px",
fontSize: "1.4rem",
lineHeight: "2.4rem",
letterSpacing: "0.4px"
}}
>
{T.translate("event_type_list.seed_event_types")}
</Button>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Seeding does not refresh the paginated list.

onClick={seedEventTypes} dispatches the seed thunk directly. The reducer appends the seeded items to eventTypes and bumps totalEventTypes, but since the table is server-paginated (totalRows/onPageChange), the appended rows extend the currently displayed page instead of re-fetching page 1. This can render more than perPage rows and desync currentPage/lastPage. Refetch after seeding, mirroring handleDelete.

♻️ Proposed fix
+  const handleSeed = () => {
+    seedEventTypes().then(() =>
+      getEventTypes(term, DEFAULT_CURRENT_PAGE, perPage, order, orderDir)
+    );
+  };
-            onClick={seedEventTypes}
+            onClick={handleSeed}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<Button
variant="outlined"
onClick={seedEventTypes}
sx={{
height: "36px",
padding: "6px 16px",
fontSize: "1.4rem",
lineHeight: "2.4rem",
letterSpacing: "0.4px"
}}
>
{T.translate("event_type_list.seed_event_types")}
</Button>
const handleSeed = () => {
seedEventTypes().then(() =>
getEventTypes(term, DEFAULT_CURRENT_PAGE, perPage, order, orderDir)
);
};
<Button
variant="outlined"
onClick={handleSeed}
sx={{
height: "36px",
padding: "6px 16px",
fontSize: "1.4rem",
lineHeight: "2.4rem",
letterSpacing: "0.4px"
}}
>
{T.translate("event_type_list.seed_event_types")}
</Button>
🤖 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-type-list-page.js` around lines 124 - 136, The seed
action in event-type-list-page is updating the store without refreshing the
server-paginated table, so the current page can show extra rows and become out
of sync. Update the seed button flow in event-type-list-page to use a handler
similar to handleDelete: await dispatching seedEventTypes, then trigger a fresh
page-1 fetch so the list resets to the server state. Keep the fix centered
around the seedEventTypes click handler and the existing pagination fetch logic
used by handleDelete/currentPage/perPage.

* feat: move activity types new and edit to mui

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

* fix: feedback from PR

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

---------

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

@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: 2

🤖 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 `@src/pages/events/event-type-list-page.js`:
- Around line 53-55: The `useEffect` in `event-type-list-page` currently calls
`getEventTypes()` on mount before `currentSummit.id` is available, which can
trigger a fetch with an undefined summit id and leave stale data. Update the
effect to wait until `currentSummit.id` is present, and include that id in the
dependency list so `getEventTypes` reruns when the summit becomes available; use
the existing `getEventTypes` and `currentSummit.id` references to place the fix.
- Around line 66-69: The success path in handleSave should not depend on the
follow-up refresh request, because EventTypeDialog only closes when onSave
resolves. Update handleSave in event-type-list-page.js so it awaits
saveEventType(eventTypeEntity) first and resolves immediately on success, then
trigger getEventTypes(...) separately with its own error handling or
fire-and-forget behavior. Keep the save completion independent from the list
refresh while preserving the existing refresh call after save.
🪄 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: 08db461c-3f17-4d10-b879-a849c7afd3ab

📥 Commits

Reviewing files that changed from the base of the PR and between 6872754 and 09d60d6.

📒 Files selected for processing (6)
  • src/actions/event-type-actions.js
  • src/components/forms/event-type-form.js
  • src/layouts/event-type-layout.js
  • src/pages/events/components/event-type-dialog.js
  • src/pages/events/edit-event-type-page.js
  • src/pages/events/event-type-list-page.js
💤 Files with no reviewable changes (1)
  • src/pages/events/edit-event-type-page.js

Comment on lines +53 to +55
useEffect(() => {
getEventTypes();
}, []);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Wait for currentSummit.id before fetching.

The render path handles a missing summit id, but this effect still fires once and never reruns, so a direct load can request /summits/undefined/event-types and leave the list stale.

Proposed fix
   useEffect(() => {
-    getEventTypes();
-  }, []);
+    if (!currentSummit.id) return;
+    getEventTypes();
+  }, [currentSummit.id, getEventTypes]);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
useEffect(() => {
getEventTypes();
}, []);
useEffect(() => {
if (!currentSummit.id) return;
getEventTypes();
}, [currentSummit.id, getEventTypes]);
🤖 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-type-list-page.js` around lines 53 - 55, The
`useEffect` in `event-type-list-page` currently calls `getEventTypes()` on mount
before `currentSummit.id` is available, which can trigger a fetch with an
undefined summit id and leave stale data. Update the effect to wait until
`currentSummit.id` is present, and include that id in the dependency list so
`getEventTypes` reruns when the summit becomes available; use the existing
`getEventTypes` and `currentSummit.id` references to place the fix.

Comment on lines +66 to +69
const handleSave = (eventTypeEntity) =>
saveEventType(eventTypeEntity).then(() =>
getEventTypes(term, DEFAULT_CURRENT_PAGE, perPage, order, orderDir)
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Don’t make dialog success depend on the refresh request.

EventTypeDialog closes only when onSave resolves. If saveEventType succeeds but the follow-up list refresh fails, the dialog stays open as if the save failed, which can invite duplicate create retries.

Proposed fix
   const handleSave = (eventTypeEntity) =>
-    saveEventType(eventTypeEntity).then(() =>
-      getEventTypes(term, DEFAULT_CURRENT_PAGE, perPage, order, orderDir)
-    );
+    saveEventType(eventTypeEntity).then(() => {
+      getEventTypes(term, DEFAULT_CURRENT_PAGE, perPage, order, orderDir);
+    });
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const handleSave = (eventTypeEntity) =>
saveEventType(eventTypeEntity).then(() =>
getEventTypes(term, DEFAULT_CURRENT_PAGE, perPage, order, orderDir)
);
const handleSave = (eventTypeEntity) =>
saveEventType(eventTypeEntity).then(() => {
getEventTypes(term, DEFAULT_CURRENT_PAGE, perPage, order, orderDir);
});
🤖 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-type-list-page.js` around lines 66 - 69, The success
path in handleSave should not depend on the follow-up refresh request, because
EventTypeDialog only closes when onSave resolves. Update handleSave in
event-type-list-page.js so it awaits saveEventType(eventTypeEntity) first and
resolves immediately on success, then trigger getEventTypes(...) separately with
its own error handling or fire-and-forget behavior. Keep the save completion
independent from the list refresh while preserving the existing refresh call
after save.

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.

3 participants