-
Notifications
You must be signed in to change notification settings - Fork 84
refactor: static actions and renaming #6832
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Greptile Overview
Greptile Summary
This PR refactors the action center field actions to use static lists instead of dynamically filtering available actions. Actions are now always displayed but conditionally disabled based on the resource's diff status.
Key changes:
- Inline actions now display
ClassifyandConfirmbuttons for all list items, disabled when not applicable - Details drawer actions show
ApproveandConfirmbuttons, disabled when not applicable - Renamed "Un-mute" label to "Restore" for better UX
- Added
disabledproperty toDetailsActiontype and implemented in footer component
Issue found:
- Syntax error in page.tsx:334 where
.map()wraps elements in unnecessary brackets, creating nested arrays instead of a flat array
Confidence Score: 2/5
- This PR has a critical syntax error that will cause runtime issues with list item rendering
- The nested array syntax error in page.tsx line 334 will cause the list item actions to render incorrectly, breaking the UI. This must be fixed before merge.
- page.tsx requires immediate attention to fix the nested array syntax error on line 334
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| clients/admin-ui/src/features/data-discovery-and-detection/action-center/fields/page.tsx | 2/5 | Refactored to use static action lists with disabled states; found syntax error creating nested arrays in list item actions |
4 files reviewed, 1 comment
| ] | ||
| : [], | ||
| ) | ||
| ? LIST_ITEM_ACTIONS.map((action) => [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syntax: Wrapping the Tooltip in brackets creates nested arrays since .map() already returns an array. Change [<Tooltip>...] to (<Tooltip>...) on this line and line 354.
9300382 to
4a30dc5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Greptile Overview
Greptile Summary
This refactor improves the action center UI by standardizing how actions are displayed and enabled/disabled based on resource status. Instead of dynamically filtering actions, the code now shows a static list of actions that are conditionally disabled.
Key changes:
- Static action arrays (
LIST_ITEM_ACTIONS,DRAWER_ACTIONS,DROPDOWN_ACTIONS) define which actions appear in each context - Actions are now conditionally disabled based on
AVAILABLE_ACTIONS[status]lookup rather than filtered from the DOM - "Un-mute" label renamed to "Restore" for better UX clarity
Minor issue identified:
- Unnecessary spread operators used in two places when checking if actions are included in
AVAILABLE_ACTIONSarrays
Confidence Score: 4/5
- Safe to merge with minor style improvements recommended
- The refactoring follows good patterns by moving from dynamic action filtering to static actions with disabled states. The logic is sound and aligns with the PR's stated goals. Two minor style issues with unnecessary spread operators don't affect functionality.
- No files require special attention
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| clients/admin-ui/src/features/data-discovery-and-detection/action-center/fields/FieldActions.const.tsx | 5/5 | Added static action arrays (DRAWER_ACTIONS, DROPDOWN_ACTIONS, LIST_ITEM_ACTIONS) and renamed "Un-mute" to "Restore" |
| clients/admin-ui/src/features/data-discovery-and-detection/action-center/fields/page.tsx | 4/5 | Refactored to use static action lists with dynamic disabled states; unnecessary spread operators in includes() checks |
4 files reviewed, 2 comments
clients/admin-ui/src/features/data-discovery-and-detection/action-center/fields/page.tsx
Show resolved
Hide resolved
clients/admin-ui/src/features/data-discovery-and-detection/action-center/fields/page.tsx
Show resolved
Hide resolved
fix: removed brackets
4a30dc5 to
d9db86b
Compare
Description Of Changes
ClassifyandConfirmthat are disabled if not availableApproveandConfirmthat are disabled if not availableUn-mutelabel was renamed toRestoreCode Changes
Steps to Confirm
ClassifyandConfirmaction that are appropriately enabled and disabled based on statusApproveandConfirmbuttons that are appropriately enabled and disabled based on status.Restoreis visible andUn-muteis notPre-Merge Checklist
CHANGELOG.mdupdatedmaindowngrade()migration is correct and works