Skip to content

BYOF: Frontend changes - #47523

Merged
MagnusHJensen merged 8 commits into
mainfrom
45601-byof-frontend
Jun 17, 2026
Merged

BYOF: Frontend changes#47523
MagnusHJensen merged 8 commits into
mainfrom
45601-byof-frontend

Conversation

@MagnusHJensen

@MagnusHJensen MagnusHJensen commented Jun 12, 2026

Copy link
Copy Markdown
Member

Related issue: Resolves #45601

Responsiveness:

Screen.Recording.2026-06-17.at.16.16.06.mov

Removed border from Action header:
image

Checklist for submitter

If some of the following don't apply, delete the relevant line.

  • Changes file added for user-visible changes in changes/, orbit/changes/ or ee/fleetd-chrome/changes.
    See Changes files for more information. In another PR

  • Input data is properly validated, SELECT * is avoided, SQL injection is prevented (using placeholders for values in statements), JS inline code is prevented especially for url redirects, and untrusted data interpolated into shell scripts/commands is validated against shell metacharacters.

  • Timeouts are implemented and retries are limited to avoid infinite loops

  • If paths of existing endpoints are modified without backwards compatibility, checked the frontend/CLI for any necessary changes

Testing

  • Added/updated automated tests
  • QA'd all new/changed functionality manually

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Added client-side search by organization name in the Apple Business Manager table.
    • Enabled BYOD fleet selection in Apple Business Manager fleet editing and saving.
  • Bug Fixes

    • Standardized enrollment status text to consistently show “On (BYOD)” for BYOD/personal cases.
  • Improvements

    • Enhanced ABM table sorting and responsive column visibility.
    • Updated Apple Business Manager modal layout, wording, and success messaging.
    • Prevented renew-date tooltips from relying on missing configuration.
  • Tests

    • Updated MDM/BYOD status and fleet modal tests for the new labels and BYOD handling.

@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.21%. Comparing base (dcf5029) to head (266a2e3).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...components/EditTeamsAbmModal/EditTeamsAbmModal.tsx 0.00% 2 Missing ⚠️
...ettings/components/RenewDateCell/RenewDateCell.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #47523      +/-   ##
==========================================
- Coverage   67.21%   67.21%   -0.01%     
==========================================
  Files        3631     3632       +1     
  Lines      229542   229558      +16     
  Branches    11957    11815     -142     
==========================================
+ Hits       154298   154300       +2     
- Misses      61378    61393      +15     
+ Partials    13866    13865       -1     
Flag Coverage Δ
frontend 58.07% <0.00%> (-0.03%) ⬇️

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

☔ View full report in Codecov by Harness.
📢 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.

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

This PR updates the Apple Business Manager (ABM) admin UI to support displaying and selecting a BYOD fleet alongside the existing macOS/iOS/iPadOS fleets, and improves the ABM tokens table UX (sorting + search).

Changes:

  • Add BYOD fleet support in ABM table (new column + tooltip) and ABM “Edit fleets” modal (new BYOD dropdown + additional token details).
  • Enable sorting for several ABM table columns (including renew date).
  • Add client-side search to filter ABM tokens by organization name.

Reviewed changes

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

Show a summary per file
File Description
frontend/pages/admin/IntegrationsPage/cards/MdmSettings/components/RenewDateCell/RenewDateCell.tsx Makes statusConfig optional to allow reuse without tooltips.
frontend/pages/admin/IntegrationsPage/cards/MdmSettings/AppleBusinessManagerPage/components/EditTeamsAbmModal/EditTeamsAbmModal.tsx Updates modal layout and adds BYOD fleet dropdown.
frontend/pages/admin/IntegrationsPage/cards/MdmSettings/AppleBusinessManagerPage/components/EditTeamsAbmModal/EditTeamsAbmModal.tests.ts Updates helper test data for selected team mapping.
frontend/pages/admin/IntegrationsPage/cards/MdmSettings/AppleBusinessManagerPage/components/AppleBusinessManagerTable/AppleBusinessManagerTableConfig.tsx Adds BYOD column and enables sorting on multiple columns.
frontend/pages/admin/IntegrationsPage/cards/MdmSettings/AppleBusinessManagerPage/components/AppleBusinessManagerTable/AppleBusinessManagerTable.tsx Adds search UI wiring and client-side filtering.
frontend/pages/admin/IntegrationsPage/cards/MdmSettings/AppleBusinessManagerPage/components/AppleBusinessManagerTable/_styles.scss Adjusts column widths and responsive hide rules for the new column set.
frontend/pages/admin/IntegrationsPage/cards/MdmSettings/AppleBusinessManagerPage/AppleBusinessManagerPage.tsx Updates descriptive copy for BYOD wording.
frontend/interfaces/mdm.ts Extends IMdmAbToken with byod_fleet and updates enrollment status display text.

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

@MagnusHJensen

Copy link
Copy Markdown
Member Author

@coderabbitai review once

@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Get PR details
gh pr view 47523 --repo fleetdm/fleet --json title,body,files,additions,deletions,baseRefName,headRefName

echo "---FILES---"
gh pr diff 47523 --repo fleetdm/fleet

Length of output: 23808



@MagnusHJensen: I'll review the PR now.


Review of PR #47523 — BYOF: Frontend changes

Summary

This PR renames "personal" enrollment branding to "BYOD" across the UI, adds a byod_fleet column to the ABM table (removing the apple_id column), enables sorting and searching in the ABM table, and refactors EditTeamsAbmModal to show Apple ID / renew date inline.


Issues

1. Redundant handler function in AppleBusinessManagerTable.tsx

handleSearchQueryChange is an unnecessary wrapper — it just calls setSearchQuery. Then onQueryChange calls handleSearchQueryChange. This adds indirection without value.

// Current
const handleSearchQueryChange = (query: string) => {
  setSearchQuery(query);
};

const onQueryChange = (queryData: ITableQueryData) => {
  handleSearchQueryChange(queryData.searchQuery);
};

// Simplified
const onQueryChange = (queryData: ITableQueryData) => {
  setSearchQuery(queryData.searchQuery);
};

2. macos_team column is never hidden at any breakpoint (_styles.scss)

Previously, macos_team was hidden at $break-md. The new responsive cascade is:

Breakpoint Column hidden
$break-lg byod_team
1230px ipados_team
$break-md ios_team
(never) macos_teamnever hidden

With 5 columns now (org name, renew date, macOS fleet, iOS fleet, iPadOS fleet, BYOD fleet — 6 including the actions column), the table may overflow on narrow screens since macos_team has no hide rule. This may be intentional if macOS is the most important column, but it's worth verifying on narrow viewports.


3. RenewDateCell in EditTeamsAbmModal — no tooltip on warning/error dates

RenewDateCell is now used in the modal without statusConfig:

<RenewDateCell
  value={token.renew_date}
  className="abm-renew-date-cell"
/>

statusConfig was made optional (good), but the consequence is that when the renew date is in a warning or error state, the status indicator will show (colored dot) but there will be no tooltip text explaining what action to take. The original table usage passes a statusConfig with tooltip text. Consider either passing a statusConfig here or adding a fallback tooltip message.


4. Removed helpful tooltips from macOS/iOS/iPadOS dropdowns in EditTeamsAbmModal

The tooltips explaining how hosts are automatically added to fleets on ABM sync were removed:

// Removed from macOS, iOS, and iPadOS dropdowns:
tooltip={
  <>
    macOS hosts are automatically added to this fleet on initial sync
    from ABM. ...
  </>
}

No equivalent tooltip was added for the new BYOD fleet dropdown either. While the modal is less cluttered now, admins lose context about how fleet assignment works. Consider keeping this guidance somewhere — perhaps as a single descriptive paragraph above the dropdowns rather than per-field tooltips.


5. byod_fleet required in IMdmAbToken — potential runtime risk

export interface IMdmAbToken {
  macos_fleet: ITokenFleet;
  ios_fleet: ITokenFleet;
  ipados_fleet: ITokenFleet;
  byod_fleet: ITokenFleet; // required
}

If any existing ABM tokens in the backend don't yet include byod_fleet in the API response (e.g., older server versions or staged rollout), accessing originalRow.byod_fleet in the table accessor will throw. Consider making this optional (byod_fleet?: ITokenFleet) with a safe fallback in getFleetDisplayName, at least until the backend change is fully deployed.


Nitpicks / Positive notes

  • ✅ Renaming "On (personal)" → "On (BYOD)" is clean and consistent across tests, UI map, and display.
  • ✅ Making statusConfig optional in RenewDateCell with a proper guard (&& statusConfig) is the right approach.
  • ✅ Client-side search filtering in AppleBusinessManagerTable is straightforward and avoids unnecessary API calls.
  • ✅ Enabling sorting on the ABM table columns (sortType: "caseInsensitive", sortType: "dateStrings") is a good UX improvement.
  • ✅ Moving Apple ID into the modal rather than the table keeps the table focused on actionable fleet assignments.

@MagnusHJensen

MagnusHJensen commented Jun 17, 2026

Copy link
Copy Markdown
Member Author

Checked coderabbit's response, and fixed the first one, the rest seems not really relevant.

@MagnusHJensen
MagnusHJensen marked this pull request as ready for review June 17, 2026 11:55
@MagnusHJensen
MagnusHJensen requested a review from a team as a code owner June 17, 2026 11:55

@claude claude Bot left a comment

Copy link
Copy Markdown

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 commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c25df8c7-770a-4447-aa86-78918ae90f7e

📥 Commits

Reviewing files that changed from the base of the PR and between 69417da and 266a2e3.

📒 Files selected for processing (1)
  • frontend/pages/admin/IntegrationsPage/cards/MdmSettings/AppleBusinessManagerPage/components/AppleBusinessManagerTable/_styles.scss
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/pages/admin/IntegrationsPage/cards/MdmSettings/AppleBusinessManagerPage/components/AppleBusinessManagerTable/_styles.scss

Walkthrough

The PR adds BYOD fleet support to the Apple Business Manager frontend. IMdmAbToken gains a byod_fleet field, editTeams API params accept byod_fleet_id, and the MDM enrollment status UI map renames "On (personal)" to "On (BYOD)". The EditTeamsAbmModal is reworked to add a BYOD fleet dropdown, display Apple ID and renew date via FormField/RenewDateCell, and set the modal title to the org name. RenewDateCell.statusConfig is made optional. The ABM table gains client-side org-name search and sortable columns (including the new byod_team column), with responsive style breakpoints updated accordingly. All affected tests are updated.

Possibly related PRs

  • fleetdm/fleet#46657: Extends the same Apple Business token model introduced in the retrieved PR by adding byod_fleet/byod_fleet_id to IMdmAbToken and its editTeams mapping.
  • fleetdm/fleet#47506: Updates backend and GitOps plumbing to accept and persist BYOD team/fleet assignments (byodTeamID/byod_fleet), synchronized with this PR's frontend wiring of byod_fleet_id.
  • fleetdm/fleet#46377: Directly affects HostMdmStatusCell's user-facing MDM enrollment text via MDM_ENROLLMENT_STATUS_UI_MAP, the same mapping that this PR renames to "On (BYOD)".
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive Title 'BYOF: Frontend changes' is vague and uses a non-descriptive acronym without context. Consider a more specific title like 'Add BYOD fleet support to Apple Business Manager UI' that clarifies the main change.
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed PR description references issue #45601 and includes testing evidence, but the checklist is incomplete.
Linked Issues check ✅ Passed Changes successfully implement BYOD fleet support: renaming 'personal' to 'BYOD', adding byod_fleet field to token interface, updating modal UI with BYOD dropdown, enabling sorting/search, and adding tests.
Out of Scope Changes check ✅ Passed All changes are directly related to BYOD fleet support from #45601: MDM status updates, token interface extensions, modal refactoring, table restructuring with search/sort, and responsive styling.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 45601-byof-frontend

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

🧹 Nitpick comments (1)
frontend/pages/admin/IntegrationsPage/cards/MdmSettings/AppleBusinessManagerPage/components/AppleBusinessManagerTable/AppleBusinessManagerTable.tsx (1)

35-37: ⚡ Quick win

Simplify by removing the redundant wrapper function.

The handleSearchQueryChange function simply calls setSearchQuery without any additional logic. This creates unnecessary indirection.

♻️ Proposed simplification
-  const handleSearchQueryChange = (query: string) => {
-    setSearchQuery(query);
-  };
-
   const onSelectAction = (action: string, abmToken: IMdmAbToken) => {
   const onQueryChange = (queryData: ITableQueryData) => {
-    handleSearchQueryChange(queryData.searchQuery);
+    setSearchQuery(queryData.searchQuery);
   };

Also applies to: 61-63

🤖 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/pages/admin/IntegrationsPage/cards/MdmSettings/AppleBusinessManagerPage/components/AppleBusinessManagerTable/AppleBusinessManagerTable.tsx`
around lines 35 - 37, Remove the redundant `handleSearchQueryChange` wrapper
function that simply passes its argument to `setSearchQuery` without any
additional logic. Instead, pass `setSearchQuery` directly to any component or
callback that currently uses `handleSearchQueryChange`. Apply the same
simplification to the similar wrapper function referenced at lines 61-63 that
wraps another state setter in the same way, eliminating unnecessary function
indirection throughout the component.
🤖 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/pages/admin/IntegrationsPage/cards/MdmSettings/AppleBusinessManagerPage/components/EditTeamsAbmModal/EditTeamsAbmModal.tests.ts`:
- Around line 34-40: The test in EditTeamsAbmModal.tests.ts only validates the
assigned BYOD team case (byod_fleet_id: 3) but does not test the unassigned
scenario required by the API contract. Add a second test case that calls
getSelectedTeamIds with byod_team set to "Unassigned" and asserts that
byod_fleet_id in the returned object equals null, ensuring the contract for
unassigned BYOD teams sending null payloads is explicitly validated and prevents
future API contract drift.

---

Nitpick comments:
In
`@frontend/pages/admin/IntegrationsPage/cards/MdmSettings/AppleBusinessManagerPage/components/AppleBusinessManagerTable/AppleBusinessManagerTable.tsx`:
- Around line 35-37: Remove the redundant `handleSearchQueryChange` wrapper
function that simply passes its argument to `setSearchQuery` without any
additional logic. Instead, pass `setSearchQuery` directly to any component or
callback that currently uses `handleSearchQueryChange`. Apply the same
simplification to the similar wrapper function referenced at lines 61-63 that
wraps another state setter in the same way, eliminating unnecessary function
indirection throughout the component.
🪄 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: a981175e-5b35-4ae1-9417-9996792239a6

📥 Commits

Reviewing files that changed from the base of the PR and between dcf5029 and 8abd9a1.

📒 Files selected for processing (11)
  • frontend/components/TableContainer/DataTable/HostMdmStatusCell/HostMdmStatusCell.tests.tsx
  • frontend/interfaces/mdm.ts
  • frontend/pages/DashboardPage/cards/MDM/MDM.tests.tsx
  • frontend/pages/admin/IntegrationsPage/cards/MdmSettings/AppleBusinessManagerPage/AppleBusinessManagerPage.tsx
  • frontend/pages/admin/IntegrationsPage/cards/MdmSettings/AppleBusinessManagerPage/components/AppleBusinessManagerTable/AppleBusinessManagerTable.tsx
  • frontend/pages/admin/IntegrationsPage/cards/MdmSettings/AppleBusinessManagerPage/components/AppleBusinessManagerTable/AppleBusinessManagerTableConfig.tsx
  • frontend/pages/admin/IntegrationsPage/cards/MdmSettings/AppleBusinessManagerPage/components/AppleBusinessManagerTable/_styles.scss
  • frontend/pages/admin/IntegrationsPage/cards/MdmSettings/AppleBusinessManagerPage/components/EditTeamsAbmModal/EditTeamsAbmModal.tests.ts
  • frontend/pages/admin/IntegrationsPage/cards/MdmSettings/AppleBusinessManagerPage/components/EditTeamsAbmModal/EditTeamsAbmModal.tsx
  • frontend/pages/admin/IntegrationsPage/cards/MdmSettings/components/RenewDateCell/RenewDateCell.tsx
  • frontend/services/entities/mdm_apple_bm.ts

cdcme
cdcme previously approved these changes Jun 17, 2026

@cdcme cdcme 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.

Clean! ✨

@RachelElysia

Copy link
Copy Markdown
Member

@MagnusHJensen any chance you can screenrecord the responsive design?

@RachelElysia RachelElysia 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.

¡ gracias !

@MagnusHJensen
MagnusHJensen merged commit aa24188 into main Jun 17, 2026
27 checks passed
@MagnusHJensen
MagnusHJensen deleted the 45601-byof-frontend branch June 17, 2026 15:23
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.

BYOF: Frontend support for BYOD fleet

4 participants