Fleet UI: show custom host vital row actions disabled with GitOps tooltip - #49506
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #49506 +/- ##
==========================================
- Coverage 68.07% 68.07% -0.01%
==========================================
Files 3882 3882
Lines 246392 246400 +8
Branches 13132 13138 +6
==========================================
+ Hits 167742 167746 +4
- Misses 63509 63513 +4
Partials 15141 15141
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR makes the Custom host vitals table’s per-row edit/delete actions consistent with the existing GitOps-mode behavior of the “Add vital” button: actions remain visible in GitOps mode but are disabled and show the standard GitOps tooltip. It also removes the now-unneeded gitOpsModeEnabled prop/hook plumbing.
Changes:
- Show row edit/delete icons for write roles even in GitOps mode, but disable them via
GitOpsModeTooltipWrapperso the tooltip appears. - Remove
useGitOpsModeusage and thegitOpsModeEnabledparameter from the table header generator.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| frontend/pages/ManageControlsPage/Variables/cards/CustomHostVitalsTab/CustomHostVitalsTableConfig.tsx | Wraps row action buttons with GitOpsModeTooltipWrapper and removes the GitOps prop from header generation. |
| frontend/pages/ManageControlsPage/Variables/cards/CustomHostVitalsTab/CustomHostVitalsTab.tsx | Removes useGitOpsMode and stops passing GitOps state into table header generation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <div className="custom-host-vitals-tab__actions"> | ||
| <Button | ||
| variant="icon" | ||
| onClick={() => onEdit(vital)} | ||
| ariaLabel={`Edit ${vital.name}`} | ||
| > | ||
| <Icon name="pencil" color="ui-fleet-black-75" /> | ||
| </Button> | ||
| <Button | ||
| variant="icon" | ||
| onClick={() => onDelete(vital)} | ||
| ariaLabel={`Delete ${vital.name}`} | ||
| > | ||
| <Icon name="trash" color="ui-fleet-black-75" /> | ||
| </Button> | ||
| <GitOpsModeTooltipWrapper | ||
| renderChildren={(disableChildren) => ( | ||
| <> | ||
| <Button | ||
| variant="icon" | ||
| disabled={disableChildren} | ||
| onClick={() => onEdit(vital)} | ||
| ariaLabel={`Edit ${vital.name}`} | ||
| > | ||
| <Icon name="pencil" color="ui-fleet-black-75" /> | ||
| </Button> | ||
| <Button | ||
| variant="icon" | ||
| disabled={disableChildren} | ||
| onClick={() => onDelete(vital)} | ||
| ariaLabel={`Delete ${vital.name}`} | ||
| > | ||
| <Icon name="trash" color="ui-fleet-black-75" /> | ||
| </Button> | ||
| </> | ||
| )} | ||
| /> | ||
| </div> |
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
Wrap the actions cell's GitOpsModeTooltipWrapper around the container and add fixedPositionStrategy + position=top so the tooltip renders on top (escaping the table row's overflow clipping) instead of flipping left.
Related issue: Relates to #44954
In GitOps mode, the Custom host vitals tab hid the row edit/delete icons entirely, while the "Add vital" button was shown disabled with the standard GitOps tooltip — an inconsistency. This makes the edit/delete icons behave like the Add button: shown but disabled with the GitOps tooltip (wrapped in
GitOpsModeTooltipWrapper, which reads GitOps mode from context). The now-unusedgitOpsModeEnabledprop/hook is removed.This fixes something I've missed from the parent's story UI Test Plan section:
Checklist for submitter
changes/,orbit/changes/oree/fleetd-chrome/changes.See Changes files for more information.
Already added as part of the feature which is in main.
Testing
Summary by CodeRabbit