Skip to content

feat: move tags grid to mui#904

Open
priscila-moneo wants to merge 1 commit into
masterfrom
feature/move-tags-grid-to-mui
Open

feat: move tags grid to mui#904
priscila-moneo wants to merge 1 commit into
masterfrom
feature/move-tags-grid-to-mui

Conversation

@priscila-moneo
Copy link
Copy Markdown

@priscila-moneo priscila-moneo commented Apr 28, 2026

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

Summary by CodeRabbit

  • New Features

    • Tag creation and editing now accessible via a dialog interface within the tag list view
    • Enhanced search, pagination, and sorting controls for tag management
  • Refactor

    • Simplified tag management workflow and modernized user interface components
    • Optimized tag data fetching and state management

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 28, 2026

Warning

Rate limit exceeded

@priscila-moneo has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 54 minutes and 20 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 979a0239-ab79-485d-b9a4-ad0449f96eae

📥 Commits

Reviewing files that changed from the base of the PR and between ef307ac and 12e0f3d.

📒 Files selected for processing (8)
  • src/actions/tag-actions.js
  • src/components/forms/tag-form.js
  • src/i18n/en.json
  • src/layouts/tag-layout.js
  • src/pages/tags/edit-tag-page.js
  • src/pages/tags/tag-list-page.js
  • src/pages/tags/tags-popup.js
  • src/reducers/tags/tag-list-reducer.js
📝 Walkthrough

Walkthrough

This PR refactors tag management by eliminating a dedicated edit page and replacing it with a modal dialog approach. Redux action thunks are simplified, class components are converted to functional components with hooks, legacy UI libraries are replaced with Material-UI, and the reducer state structure is updated.

Changes

Cohort / File(s) Summary
Redux Actions Simplification
src/actions/tag-actions.js
Removed unused getState parameter from multiple thunk signatures, adjusted getTags to use DEFAULT_PER_PAGE constant, and simplified request parameter building. Return promises from update/create operations for better control flow.
Component Removal
src/components/forms/tag-form.js, src/pages/tags/edit-tag-page.js
Removed legacy TagForm class component and EditTagPage page component, eliminating the dedicated edit workflow in favor of modal-based editing.
Page & Layout Refactoring
src/pages/tags/tag-list-page.js, src/layouts/tag-layout.js
Converted TagListPage from class to functional component with hooks; replaced legacy UI libraries (FreeTextSearch, react-bootstrap, sweetalert2) with MUI components; changed routing in TagLayout to single base path matching; replaced "new tag" navigation with modal dialog flow.
Modal Dialog Creation
src/pages/tags/tags-popup.js
Added new TagsDialog component providing Material UI modal for tag creation and editing with inline validation and translated labels.
Reducer Update
src/reducers/tags/tag-list-reducer.js
Changed tags state from object to array structure and updated action handling to include perPage metadata.
Internationalization
src/i18n/en.json
Added new i18n entries for singular/plural tag list item labels.

Sequence Diagram

sequenceDiagram
    participant User
    participant TagListPage
    participant TagsDialog
    participant Redux as Redux<br/>(Actions)
    participant API

    User->>TagListPage: Click Add or Edit Tag
    TagListPage->>TagsDialog: Open Modal (with initialData)
    TagsDialog->>TagsDialog: Initialize local state from props
    User->>TagsDialog: Enter tag name & Click Save
    TagsDialog->>TagsDialog: Validate (non-empty)
    
    alt Validation Fails
        TagsDialog->>TagsDialog: Show error message
    else Validation Passes
        TagsDialog->>Redux: Dispatch saveTag(tag)
        Redux->>API: PUT/POST request
        API-->>Redux: Response
        Redux-->>TagListPage: State updated
        TagsDialog->>TagListPage: onClose (reset dialog)
        TagListPage->>Redux: Dispatch getTags (refresh)
        Redux->>API: GET tags request
        API-->>Redux: Tags list
        Redux-->>TagListPage: Updated tags state
        TagListPage->>User: Display updated list
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Suggested reviewers

  • smarcet
  • tomrndom

Poem

🐰 A modal hops where pages used to dance,
Redux thunks now leaner, freed from glance,
MUI paints fresh with Material grace,
Tags edit inline—a brighter place!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title 'feat: move tags grid to mui' clearly and concisely summarizes the main change—migrating the tag list UI components to Material UI (MUI), which is the primary objective reflected across multiple file changes.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/move-tags-grid-to-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
Review rate limit: 0/1 reviews remaining, refill in 54 minutes and 20 seconds.

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

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
src/pages/tags/tag-list-page.js (1)

47-49: Consider the useEffect dependency array.

The effect uses term from props but doesn't include it in the dependency array. While this appears intentional (search is triggered explicitly via Enter key), it means component won't re-fetch if term prop changes externally. If this is the intended behavior, consider adding a comment for clarity.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/pages/tags/tag-list-page.js` around lines 47 - 49, The useEffect that
calls getTags(term, currentPage, perPage, order, orderDir) references term but
does not include it in the dependency array ([currentPage, perPage, order,
orderDir]); decide whether to add term to the dependency array so the effect
re-runs when term prop changes, or if omission is intentional (search only on
Enter) add a concise explanatory comment above the useEffect referencing
useEffect and getTags to state that term is intentionally excluded to avoid
automatic re-fetches; update accordingly.
src/actions/tag-actions.js (1)

275-311: Missing return statement in saveTagGroup for the update path.

The update branch (lines 276-287) doesn't return the promise from putRequest, while the create branch similarly doesn't return. This is inconsistent with how saveTag was refactored to return promises. While this may not cause immediate issues if callers don't chain on the result, it's a potential source of bugs.

Suggested fix
   if (entity.id) {
-    putRequest(
+    return putRequest(
       createAction(UPDATE_TAG_GROUP),
       createAction(TAG_GROUP_UPDATED),
       `${window.API_BASE_URL}/api/v1/summits/${currentSummit.id}/track-tag-groups/${entity.id}`,
       normalizedEntity,
       authErrorHandler,
       entity
     )(params)(dispatch).then(() => {
       dispatch(
         showSuccessMessage(T.translate("edit_tag_group.tag_group_saved"))
       );
     });
   } else {
     // ...
-    postRequest(
+    return postRequest(
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/actions/tag-actions.js` around lines 275 - 311, The update branch in
saveTagGroup doesn't return the promise from putRequest (and the create branch
also doesn't return the postRequest promise), which prevents callers from
chaining; fix by adding a return before the putRequest(...) call (and likewise
before postRequest(...) for consistency) so saveTagGroup returns the promise
from putRequest/postRequest; locate saveTagGroup and modify the branches that
call putRequest and postRequest to return those call results.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/pages/tags/tag-list-page.js`:
- Around line 167-187: The onEdit prop currently names its parameter (id) but
MuiTable passes the full row object; update the onEdit callback to use a
descriptive parameter name like (row) and forward that to handleEditTag (i.e.,
change the onEdit handler from using (id) to (row) => handleEditTag(row)) so the
parameter matches the actual value passed by MuiTable and mirrors the pattern
used by onDelete and other handlers.

In `@src/pages/tags/tags-popup.js`:
- Around line 24-30: handleSave calls setError with
T.translate("edit_tag.name_required") but that i18n key is missing; add an
"name_required" entry under the edit_tag section in the English translations
(src/i18n/en.json) so T.translate("edit_tag.name_required") returns a
user-friendly string (e.g., "Name is required") and then re-run to confirm
setError shows the localized message when handleSave detects an empty tag.

---

Nitpick comments:
In `@src/actions/tag-actions.js`:
- Around line 275-311: The update branch in saveTagGroup doesn't return the
promise from putRequest (and the create branch also doesn't return the
postRequest promise), which prevents callers from chaining; fix by adding a
return before the putRequest(...) call (and likewise before postRequest(...) for
consistency) so saveTagGroup returns the promise from putRequest/postRequest;
locate saveTagGroup and modify the branches that call putRequest and postRequest
to return those call results.

In `@src/pages/tags/tag-list-page.js`:
- Around line 47-49: The useEffect that calls getTags(term, currentPage,
perPage, order, orderDir) references term but does not include it in the
dependency array ([currentPage, perPage, order, orderDir]); decide whether to
add term to the dependency array so the effect re-runs when term prop changes,
or if omission is intentional (search only on Enter) add a concise explanatory
comment above the useEffect referencing useEffect and getTags to state that term
is intentionally excluded to avoid automatic re-fetches; update accordingly.
🪄 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: 244d5413-3233-4aa7-ad2c-d6c203d0f5be

📥 Commits

Reviewing files that changed from the base of the PR and between 21d1443 and ef307ac.

📒 Files selected for processing (8)
  • src/actions/tag-actions.js
  • src/components/forms/tag-form.js
  • src/i18n/en.json
  • src/layouts/tag-layout.js
  • src/pages/tags/edit-tag-page.js
  • src/pages/tags/tag-list-page.js
  • src/pages/tags/tags-popup.js
  • src/reducers/tags/tag-list-reducer.js
💤 Files with no reviewable changes (2)
  • src/components/forms/tag-form.js
  • src/pages/tags/edit-tag-page.js

Comment thread src/pages/tags/tag-list-page.js
Comment thread src/pages/tags/tags-popup.js Outdated
Comment thread src/actions/tag-actions.js Outdated
authErrorHandler,
entity
)(params)(dispatch).then((payload) => {
)(params)(dispatch).then((response) => {
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 change is redundant

Comment thread src/pages/tags/tag-list-page.js Outdated
gap={1}
sx={{ justifyContent: "flex-end", alignItems: "center" }}
>
<TextField
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

we now have a mui search input in uicore, lets use that please

Comment thread src/pages/tags/tag-list-page.js Outdated
onEdit={(id) => handleEditTag(id)}
onDelete={(id) => handleDeleteTag(id)}
getName={(row) => row.tag}
deleteConfirmTitle={T.translate("general.are_you_sure")}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

the prop is deleteDialogTitle, and this value is the default

Comment thread src/pages/tags/tags-popup.js Outdated

const handleSave = () => {
if (!tag.trim()) {
setError(T.translate("edit_tag.name_required"));
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

is this translation missing ?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

also lets use formik validation please

@priscila-moneo priscila-moneo force-pushed the feature/move-tags-grid-to-mui branch from fe32552 to 24cce78 Compare May 4, 2026 19:30
@priscila-moneo priscila-moneo force-pushed the feature/move-tags-grid-to-mui branch from 24cce78 to 12e0f3d Compare May 4, 2026 19:32
Copy link
Copy Markdown

@santipalenque santipalenque left a comment

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