refactor: okta ui updates [ENG-2809]#7596
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
📝 WalkthroughWalkthroughThis PR refactors the infrastructure systems action-center to replace the "Add" action with an "Approve" action. Changes include updating the enum variant, component props, labels, icons, and related UI logic flows across tests, components, hooks, and utilities. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
99362c6 to
55f31cf
Compare
55f31cf to
a401f55
Compare
a401f55 to
03813df
Compare
03813df to
9d0c224
Compare
9d0c224 to
1b1e18c
Compare
1b1e18c to
2acfa7e
Compare
de3f49a to
ebde3f0
Compare
Greptile SummaryThis PR makes two focused UI changes to the infrastructure monitor view in the Action Center: it adds a dismissible informational Key changes:
Confidence Score: 4/5
Important Files Changed
Last reviewed commit: ebde3f0 |
...s/data-discovery-and-detection/action-center/tables/DiscoveredInfrastructureSystemsTable.tsx
Show resolved
Hide resolved
| ...(isIgnoredTab | ||
| ? [ | ||
| { | ||
| key: RESTORE, | ||
| label: "Restore", | ||
| onClick: () => onBulkAction(RESTORE), | ||
| disabled: isBulkActionInProgress, | ||
| }, | ||
| ] | ||
| : []), | ||
| ...(allowIgnore | ||
| ? [ | ||
| { | ||
| key: IGNORE, | ||
| label: "Ignore", | ||
| onClick: () => onBulkAction(IGNORE), | ||
| disabled: isBulkActionInProgress, | ||
| }, | ||
| ] | ||
| : []), |
There was a problem hiding this comment.
Implicit coupling between isIgnoredTab and allowIgnore
The old implementation explicitly prevented the IGNORE item from appearing on the ignored tab by using a separate code path for that branch. The refactored version relies on allowIgnore always being false when isIgnoredTab is true — an invariant enforced by shouldAllowIgnore returning false when DiffStatus.MUTED is in the active filters.
This is safe today, but the coupling is now implicit. If getBulkActionsMenuItems is ever called with isIgnoredTab: true and allowIgnore: true (e.g. from a new call site or a future filter change), the ignored tab would unexpectedly display all three actions: Approve, Restore, and Ignore.
Consider adding a comment above these spread blocks to make the invariant explicit — e.g. noting that RESTORE and IGNORE are mutually exclusive because shouldAllowIgnore always returns false when DiffStatus.MUTED is active, which is the same condition that sets isIgnoredTab.
There was a problem hiding this comment.
🧹 Nitpick comments (3)
clients/admin-ui/src/features/data-discovery-and-detection/action-center/components/InfrastructureSystemActionsCell.tsx (2)
186-190: Dead code: button text will never render.Since
approveIconhas a default value (<Icons.Checkmark />), the condition!approveIcon && "Approve"will always be falsy and the text "Approve" will never be displayed. If the icon-only button is intentional, consider removing the dead code. If text should sometimes appear, remove the default value or change the condition.🧹 Remove dead code
icon={approveIcon} aria-label="Approve" - > - {!approveIcon && "Approve"} - </Button> + />🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@clients/admin-ui/src/features/data-discovery-and-detection/action-center/components/InfrastructureSystemActionsCell.tsx` around lines 186 - 190, The JSX contains dead code: the Button child {!approveIcon && "Approve"} will never render because approveIcon has a default (Icons.Checkmark). Update InfrastructureSystemActionsCell to either remove the dead branch or make text conditional correctly: either delete the noop expression and keep the icon-only Button (remove {!approveIcon && "Approve"}), or change the prop/default so approveIcon can be undefined when you want text (remove the default value for approveIcon) and keep the conditional; locate the Button usage and the approveIcon default to apply the chosen fix.
135-137: Minor text inconsistency.The tooltip says "Restore systems before adding to the inventory" but the action is now labeled "Approve". Consider updating for consistency.
📝 Suggested fix
if (isApprove && isIgnored) { - return "Restore systems before adding to the inventory"; + return "Restore systems before approving"; }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@clients/admin-ui/src/features/data-discovery-and-detection/action-center/components/InfrastructureSystemActionsCell.tsx` around lines 135 - 137, Tooltip text in InfrastructureSystemActionsCell is inconsistent with the "Approve" action; update the string returned in the isApprove && isIgnored branch to match the action label (e.g., change "Restore systems before adding to the inventory" to "Approve systems before adding to the inventory") so the tooltip reflects the "Approve" action; locate the conditional in InfrastructureSystemActionsCell that checks isApprove and isIgnored and replace the message accordingly.changelog/7596.yaml (1)
1-4: Consider a more descriptive changelog entry.The description "Okta ux refactor" is quite generic. A clearer entry would help users understand what changed, e.g., "Changed 'Add' action labels to 'Approve' for infrastructure monitors and added informational banner."
📝 Suggested improvement
type: Changed # One of: Added, Changed, Developer Experience, Deprecated, Docs, Fixed, Removed, Security -description: Okta ux refactor +description: Updated infrastructure monitor action labels from "Add" to "Approve" and added dismissible informational banner pr: 7596 # PR number labels: [] # Optional: ["high-risk", "db-migration"]🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@changelog/7596.yaml` around lines 1 - 4, Update the changelog entry's description field to be more specific and user-facing: replace the generic "Okta ux refactor" with a concise summary of the user-visible changes (for example, "Changed 'Add' action labels to 'Approve' for infrastructure monitors and added an informational banner about Okta sign-in changes") and keep the pr: 7596 and other metadata intact; ensure the new description accurately reflects the UX changes implemented and is brief but descriptive.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@changelog/7596.yaml`:
- Around line 1-4: Update the changelog entry's description field to be more
specific and user-facing: replace the generic "Okta ux refactor" with a concise
summary of the user-visible changes (for example, "Changed 'Add' action labels
to 'Approve' for infrastructure monitors and added an informational banner about
Okta sign-in changes") and keep the pr: 7596 and other metadata intact; ensure
the new description accurately reflects the UX changes implemented and is brief
but descriptive.
In
`@clients/admin-ui/src/features/data-discovery-and-detection/action-center/components/InfrastructureSystemActionsCell.tsx`:
- Around line 186-190: The JSX contains dead code: the Button child
{!approveIcon && "Approve"} will never render because approveIcon has a default
(Icons.Checkmark). Update InfrastructureSystemActionsCell to either remove the
dead branch or make text conditional correctly: either delete the noop
expression and keep the icon-only Button (remove {!approveIcon && "Approve"}),
or change the prop/default so approveIcon can be undefined when you want text
(remove the default value for approveIcon) and keep the conditional; locate the
Button usage and the approveIcon default to apply the chosen fix.
- Around line 135-137: Tooltip text in InfrastructureSystemActionsCell is
inconsistent with the "Approve" action; update the string returned in the
isApprove && isIgnored branch to match the action label (e.g., change "Restore
systems before adding to the inventory" to "Approve systems before adding to the
inventory") so the tooltip reflects the "Approve" action; locate the conditional
in InfrastructureSystemActionsCell that checks isApprove and isIgnored and
replace the message accordingly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 71ce7f0a-1b79-4c97-a91a-f7ad6b9b1ca4
📒 Files selected for processing (7)
changelog/7596.yamlclients/admin-ui/cypress/e2e/action-center/infrastructure-systems.cy.tsclients/admin-ui/src/features/data-discovery-and-detection/action-center/components/InfrastructureSystemActionsCell.tsxclients/admin-ui/src/features/data-discovery-and-detection/action-center/constants.tsclients/admin-ui/src/features/data-discovery-and-detection/action-center/hooks/useInfrastructureSystemsBulkActions.tsxclients/admin-ui/src/features/data-discovery-and-detection/action-center/tables/DiscoveredInfrastructureSystemsTable.tsxclients/admin-ui/src/features/data-discovery-and-detection/action-center/utils/infrastructureSystemsBulkActionsMenu.tsx
lucanovera
left a comment
There was a problem hiding this comment.
Banner looks good and all the actions are labeled as approved. Code changes look good.
feat: basic alert message refactor: migrate more action labels fix: linting chore: update changelog fix: types chore: more updates after rebase refactor: alert text treatment fix: broken tests wip: style and text updates chore: revert styles that should come from global fix: linting fix: test updates
ebde3f0 to
5cea756
Compare
Ticket ENG-2809
Description Of Changes
Added a banner for infrastructure monitors in the action center explaining the content.
Updated all of the
Addactions to beApproveto match the other monitor type actions.Code Changes
Steps to Confirm
Addthe detected monitors are now labeled asApprovePre-Merge Checklist
CHANGELOG.mdupdatedmaindowngrade()migration is correct and worksSummary by CodeRabbit
Release Notes
New Features
Changed