Skip to content

Use new MDM status on hosts page and show tooltip; show "Not supported" for Linux - #46377

Merged
spalmesano0 merged 8 commits into
mainfrom
update-mdm-status
Jun 1, 2026
Merged

Use new MDM status on hosts page and show tooltip; show "Not supported" for Linux#46377
spalmesano0 merged 8 commits into
mainfrom
update-mdm-status

Conversation

@spalmesano0

@spalmesano0 spalmesano0 commented May 28, 2026

Copy link
Copy Markdown
Member

Related issue: Resolves #46066

Checklist for submitter

  • Changes file added for user-visible changes in changes/, orbit/changes/ or ee/fleetd-chrome/changes.

Testing

  • QA'd all new/changed functionality manually

Summary by CodeRabbit

  • Bug Fixes

    • Corrected MDM status label in the hosts table so enrollment states display accurately.
    • Fixed platform handling so "Not supported" appears appropriately for Chrome and Linux hosts.
  • New Features

    • Added a hover tooltip on the MDM status in the hosts table to show additional context.
  • Style

    • Improved tooltip text wrapping to keep status names on a single line.

We now use "company-owned" instead of "automatic". Instead of taking the raw
value from the API, we should map it to the new user-facing value.
@spalmesano0 spalmesano0 self-assigned this May 28, 2026
Copilot AI review requested due to automatic review settings May 28, 2026 18:41
@spalmesano0
spalmesano0 requested a review from a team as a code owner May 28, 2026 18:41

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the host table MDM Status column so the API value "On (automatic)" is displayed as "On (company-owned)" via the existing MDM_ENROLLMENT_STATUS_UI_MAP, and renders the MDM_STATUS_TOOLTIP text on hover with a no-wrap style.

Changes:

  • Map raw enrollment status to its UI display name before rendering.
  • Wrap the displayed status in TooltipWrapper when a tooltip is defined for that status.
  • Add CSS to keep the status name on a single line within the tooltip wrapper.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
frontend/components/TableContainer/DataTable/HostMdmStatusCell/HostMdmStatusCell.tsx Resolves displayName via MDM_ENROLLMENT_STATUS_UI_MAP and conditionally renders a tooltip from MDM_STATUS_TOOLTIP.
frontend/components/TableContainer/DataTable/HostMdmStatusCell/_styles.scss Adds white-space: nowrap on the tooltip wrapper element to prevent wrapping.
changes/46066-fix-on-automatic-mdm-status-display Changelog entry describing the user-visible fix and new tooltip.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

This PR updates HostMdmStatusCell to map raw MDM enrollment values to user-facing labels using MDM_ENROLLMENT_STATUS_UI_MAP, broadens the unsupported-platform guard, and conditionally wraps the display label in a TooltipWrapper when MDM_STATUS_TOOLTIP exists. It adds a CSS rule to prevent tooltip text wrapping and includes tests covering multiple platforms and enrollment statuses.

Possibly related issues

  • #46245: The component changes add and correct MDM status text and render a tooltip for MDM status in HostMdmStatusCell, which aligns with that issue's goal of clarifying MDM status tooltips.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title directly summarizes the main changes: updating MDM status display (with tooltip) and adding 'Not supported' for Linux, which aligns with the changeset.
Description check ✅ Passed The PR description covers the key requirements from the template (changes file added, manual QA completed) but omits unchecked items like automated tests, which the changeset includes.
Linked Issues check ✅ Passed All objectives from #46066 are met: MDM status terminology updated, tooltip added, Linux marked as 'Not supported', and tests added as suggested by reviewers.
Out of Scope Changes check ✅ Passed All changes directly support the linked issue objectives: updating MDM display text, adding tooltips, handling Linux platform support, and comprehensive testing.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch update-mdm-status

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

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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
`@frontend/components/TableContainer/DataTable/HostMdmStatusCell/HostMdmStatusCell.tsx`:
- Line 2: The import statements for DEFAULT_EMPTY_CELL_VALUE and
MDM_STATUS_TOOLTIP (and the other multiline import around line 9) are not
formatted to satisfy Prettier/ESLint; reformat the imports to follow Prettier
rules (e.g., break the named imports into properly indented multiline braces or
run Prettier to auto-fix) so the import of DEFAULT_EMPTY_CELL_VALUE,
MDM_STATUS_TOOLTIP (and the second multiline import referenced on line 9) is
correctly split/indented and passes linting.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 437282fc-e135-4716-b159-9bdf728980bf

📥 Commits

Reviewing files that changed from the base of the PR and between 7b7b89a and d1e464b.

📒 Files selected for processing (3)
  • changes/46066-fix-on-automatic-mdm-status-display
  • frontend/components/TableContainer/DataTable/HostMdmStatusCell/HostMdmStatusCell.tsx
  • frontend/components/TableContainer/DataTable/HostMdmStatusCell/_styles.scss

@codecov

codecov Bot commented May 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.92%. Comparing base (bac2a70) to head (1cb80fb).
⚠️ Report is 118 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #46377      +/-   ##
==========================================
+ Coverage   66.89%   66.92%   +0.02%     
==========================================
  Files        2782     2798      +16     
  Lines      221734   221896     +162     
  Branches    11221    11316      +95     
==========================================
+ Hits       148334   148495     +161     
+ Misses      60000    59998       -2     
- Partials    13400    13403       +3     
Flag Coverage Δ
frontend 56.51% <100.00%> (+0.22%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@MagnusHJensen MagnusHJensen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, happy to approve with a couple of changes and lint fixes

@spalmesano0

Copy link
Copy Markdown
Member Author

Thanks @MagnusHJensen! Just made those changes.

While looking at this again, would it be worth it to use NotSupported with the Linux platforms as well? We're only doing that for ChromeOS today.

@MagnusHJensen

MagnusHJensen commented May 29, 2026

Copy link
Copy Markdown
Member

Thanks @spalmesano0

Yeah I think that is a good callout, let's add that in as well, now we're here, maybe a small test case for Linux as well.

@spalmesano0
spalmesano0 marked this pull request as draft May 30, 2026 00:20
@spalmesano0 spalmesano0 changed the title Use new MDM status on hosts page and show tooltip Use new MDM status on hosts page and show tooltip; show "Not supported" for Linux Jun 1, 2026
@spalmesano0 spalmesano0 removed their assignment Jun 1, 2026
@spalmesano0
spalmesano0 marked this pull request as ready for review June 1, 2026 17:07

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
frontend/components/TableContainer/DataTable/HostMdmStatusCell/HostMdmStatusCell.tests.tsx (1)

15-59: ⚡ Quick win

Consider adding tests for tooltip rendering.

The PR objectives mention "Adds a tooltip for the MDM status on the Hosts page," but there are no tests verifying that tooltips are rendered when expected. Adding tests to check for tooltip presence would help prevent regressions of this new feature.

Example test for tooltip
+ it("renders tooltip for supported MDM status values", () => {
+   renderCell("darwin", "On (automatic)");
+   const tooltip = screen.getByRole("tooltip") || screen.queryByTestId("tooltip-wrapper");
+   expect(tooltip).toBeInTheDocument();
+ });

Note: The exact query selector depends on how TooltipWrapper is implemented. Adjust based on the component's actual structure or add a test-id to the TooltipWrapper.

🤖 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
`@frontend/components/TableContainer/DataTable/HostMdmStatusCell/HostMdmStatusCell.tests.tsx`
around lines 15 - 59, Add tests in HostMdmStatusCell.tests.tsx to assert the new
tooltip is rendered for statuses that should show it: use the existing
renderCell helper to render rows with MDM statuses that trigger tooltips (e.g.,
"On (manual)", "On (automatic)", pending states), then simulate hover
(userEvent.hover or fireEvent.mouseOver) on the rendered status element and
assert the TooltipWrapper output appears (query by role="tooltip",
aria-describedby on the status, or a test-id on TooltipWrapper). If the
TooltipWrapper has no test hook, add a data-testid to TooltipWrapper in
HostMdmStatusCell so tests can reliably query it and then assert tooltip text
content and visibility after hover.
🤖 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.

Nitpick comments:
In
`@frontend/components/TableContainer/DataTable/HostMdmStatusCell/HostMdmStatusCell.tests.tsx`:
- Around line 15-59: Add tests in HostMdmStatusCell.tests.tsx to assert the new
tooltip is rendered for statuses that should show it: use the existing
renderCell helper to render rows with MDM statuses that trigger tooltips (e.g.,
"On (manual)", "On (automatic)", pending states), then simulate hover
(userEvent.hover or fireEvent.mouseOver) on the rendered status element and
assert the TooltipWrapper output appears (query by role="tooltip",
aria-describedby on the status, or a test-id on TooltipWrapper). If the
TooltipWrapper has no test hook, add a data-testid to TooltipWrapper in
HostMdmStatusCell so tests can reliably query it and then assert tooltip text
content and visibility after hover.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1019ccb0-e7dd-46f8-a440-0bb46ef9faa2

📥 Commits

Reviewing files that changed from the base of the PR and between 2ba3a8a and 1cb80fb.

📒 Files selected for processing (2)
  • frontend/components/TableContainer/DataTable/HostMdmStatusCell/HostMdmStatusCell.tests.tsx
  • frontend/components/TableContainer/DataTable/HostMdmStatusCell/HostMdmStatusCell.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/components/TableContainer/DataTable/HostMdmStatusCell/HostMdmStatusCell.tsx

@spalmesano0
spalmesano0 merged commit b993da7 into main Jun 1, 2026
25 checks passed
@spalmesano0
spalmesano0 deleted the update-mdm-status branch June 1, 2026 18:16
This was referenced Jun 17, 2026
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.

Update MDM status on host table for "automatic" to new "company-owned" language

3 participants