feat: move email templates list to mui#936
Conversation
📝 WalkthroughWalkthroughThe email template list feature adds pagination support and migrates the UI from React-Bootstrap to MUI. The action layer now passes ChangesEmail Template Pagination and UI Migration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/emails/email-template-list-page.js`:
- Around line 81-83: The delete handler expects a row object but the MuiTable
onDelete callback passes the row id primitive; change the handler signature from
(row) to (id) and call removeEmailTemplate(id) instead of
removeEmailTemplate(row.id). Update every place that currently reads row.id
(including the other delete handler instance that mirrors
handleDeleteEmailTemplate) to accept the id primitive and forward it to
removeEmailTemplate.
🪄 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: 0943f768-e6dd-473b-9212-324d2a42b809
📒 Files selected for processing (3)
src/actions/email-actions.jssrc/pages/emails/email-template-list-page.jssrc/reducers/emails/email-template-list-reducer.js
| const handleDeleteEmailTemplate = (row) => { | ||
| removeEmailTemplate(row.id); | ||
| }; |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# First, locate the MuiTable component
fd -t f "table" -p | grep -i mui | head -20Repository: fntechgit/summit-admin
Length of output: 162
🏁 Script executed:
# Search for MuiTable component in the codebase
rg "MuiTable|export.*Table" --type ts --type tsx --type js --type jsx | grep -i component | head -20Repository: fntechgit/summit-admin
Length of output: 94
🏁 Script executed:
# Search for the openstack-uicore-foundation import path mentioned in the review
rg "openstack-uicore-foundation" --type ts --type tsx --type js --type jsxRepository: fntechgit/summit-admin
Length of output: 94
🏁 Script executed:
# Read the email template list page to see how MuiTable is imported and used
cat -n src/pages/emails/email-template-list-page.js | head -100Repository: fntechgit/summit-admin
Length of output: 3510
🏁 Script executed:
# Search for MuiTable import without tsx filter
rg "MuiTable|from.*table" src/pages/emails/email-template-list-page.jsRepository: fntechgit/summit-admin
Length of output: 163
🏁 Script executed:
# Look for the component being used in the file
rg "const.*MuiTable|import.*MuiTable" --type jsRepository: fntechgit/summit-admin
Length of output: 4412
🏁 Script executed:
# Read the MuiTable usage in the email template page around line 168
cat -n src/pages/emails/email-template-list-page.js | sed -n '150,180p'Repository: fntechgit/summit-admin
Length of output: 1129
🏁 Script executed:
# Check similar usage patterns in other files with onDelete
rg -A 3 "onDelete=" src/pages/sponsors/sponsor-list-page.jsRepository: fntechgit/summit-admin
Length of output: 255
🏁 Script executed:
# Look at another similar file to understand the pattern
cat -n src/pages/sponsors/sponsor-list-page.js | grep -A 30 "const handleDelete"Repository: fntechgit/summit-admin
Length of output: 1157
🏁 Script executed:
# Check another file to confirm the pattern
cat -n src/pages/sponsors/sponsor-forms-list-page/index.js | grep -A 2 "const handleDelete"Repository: fntechgit/summit-admin
Length of output: 48
🏁 Script executed:
# Check one more for consistency
rg -B 2 -A 2 "const handleDelete.*\(.*Id\)" src/pages/ | head -30Repository: fntechgit/summit-admin
Length of output: 2178
Fix MuiTable delete callback parameter handling.
The onDelete callback receives the row identifier as a primitive value, not the full row object. With the current handler expecting row.id, the delete call will pass undefined as the template id.
Proposed fix
- const handleDeleteEmailTemplate = (row) => {
- removeEmailTemplate(row.id);
+ const handleDeleteEmailTemplate = (templateId) => {
+ removeEmailTemplate(templateId);
};Also applies to: Line 168
🤖 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/emails/email-template-list-page.js` around lines 81 - 83, The
delete handler expects a row object but the MuiTable onDelete callback passes
the row id primitive; change the handler signature from (row) to (id) and call
removeEmailTemplate(id) instead of removeEmailTemplate(row.id). Update every
place that currently reads row.id (including the other delete handler instance
that mirrors handleDeleteEmailTemplate) to accept the id primitive and forward
it to removeEmailTemplate.
ref: https://app.clickup.com/t/86b9xbm8u
Summary by CodeRabbit
Release Notes