Fleet UI: Align technician empty state with EmptyState styling on configuration profiles and assets - #50952
Conversation
…figuration profiles and assets Closes #49461 (technician follow-up)
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #50952 +/- ##
=======================================
Coverage 68.53% 68.53%
=======================================
Files 3980 3980
Lines 256351 256361 +10
Branches 13661 13671 +10
=======================================
+ Hits 175688 175700 +12
+ Misses 65026 65022 -4
- Partials 15637 15639 +2
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.
Warning
- Copilot's review of this pull request may be incomplete because some of the changed files are excluded by your Copilot content exclusion settings. See Excluding content from Copilot for details.
Pull request overview
Aligns the OS Settings “Configuration profiles” and “Assets” empty states so Technician users see the same EmptyState variant="header-list" styling as other roles, resolving the remaining styling inconsistency described in #49461.
Changes:
- Replaced Technician-only
<Card>empty states with the sharedEmptyStatein both Profiles and Assets tabs, omitting the “Add” CTA for technicians. - Introduced role-capability flags (
canAddConfigurationProfile,canAddAsset) to centralize the “can add” decision. - Added targeted tests for Technician empty states and removed now-unused Card imports and SCSS rules.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/pages/ManageControlsPage/OSSettings/cards/ConfigurationProfiles/ConfigurationProfiles.tsx | Uses EmptyState for empty profiles for all roles; hides Add CTA for technicians via canAddConfigurationProfile. |
| frontend/pages/ManageControlsPage/OSSettings/cards/ConfigurationProfiles/ConfigurationProfiles.tests.tsx | Adds regression test ensuring technicians see EmptyState heading + info without Add profile CTA. |
| frontend/pages/ManageControlsPage/OSSettings/cards/ConfigurationProfiles/components/AssetsTab/AssetsTab.tsx | Uses EmptyState for empty assets for all roles; hides Add CTA for technicians via canAddAsset. |
| frontend/pages/ManageControlsPage/OSSettings/cards/ConfigurationProfiles/components/AssetsTab/AssetsTab.tests.tsx | Adds regression test ensuring technicians see EmptyState heading + info without Add asset CTA. |
| frontend/pages/ManageControlsPage/OSSettings/cards/ConfigurationProfiles/components/AssetsTab/_styles.scss | Removes obsolete .empty-assets styling (no longer used). |
| frontend/pages/ManageControlsPage/OSSettings/cards/ConfigurationProfiles/_styles.scss | Removes obsolete .empty-profiles styling (no longer used). |
Files excluded by content exclusion policy (1)
- changes/49461-technician-empty-state
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
WalkthroughConfiguration profiles and assets now use the shared Possibly related PRs
🚥 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
frontend/pages/ManageControlsPage/OSSettings/cards/ConfigurationProfiles/ConfigurationProfiles.tests.tsx (1)
109-134: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winCover both technician role paths.
Both tests cover only
isGlobalTechnician, while production code also supportsisTeamTechnician.
frontend/pages/ManageControlsPage/OSSettings/cards/ConfigurationProfiles/ConfigurationProfiles.tests.tsx#L109-L134: add a team-technician case.frontend/pages/ManageControlsPage/OSSettings/cards/ConfigurationProfiles/components/AssetsTab/AssetsTab.tests.tsx#L119-L143: add a team-technician case.🤖 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/ManageControlsPage/OSSettings/cards/ConfigurationProfiles/ConfigurationProfiles.tests.tsx` around lines 109 - 134, Extend the technician-role coverage in ConfigurationProfiles.tests.tsx at lines 109-134 by adding an equivalent empty-state test for isTeamTechnician, preserving the existing assertions that the heading and message render without an Add profile button. Add the corresponding team-technician case in AssetsTab.tests.tsx at lines 119-143, using the existing AssetsTab test setup and assertions.
🤖 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/pages/ManageControlsPage/OSSettings/cards/ConfigurationProfiles/ConfigurationProfiles.tests.tsx`:
- Around line 109-134: Extend the technician-role coverage in
ConfigurationProfiles.tests.tsx at lines 109-134 by adding an equivalent
empty-state test for isTeamTechnician, preserving the existing assertions that
the heading and message render without an Add profile button. Add the
corresponding team-technician case in AssetsTab.tests.tsx at lines 119-143,
using the existing AssetsTab test setup and assertions.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 6b5a1076-3a7d-460e-af36-d944af97edb5
📒 Files selected for processing (7)
changes/49461-technician-empty-statefrontend/pages/ManageControlsPage/OSSettings/cards/ConfigurationProfiles/ConfigurationProfiles.tests.tsxfrontend/pages/ManageControlsPage/OSSettings/cards/ConfigurationProfiles/ConfigurationProfiles.tsxfrontend/pages/ManageControlsPage/OSSettings/cards/ConfigurationProfiles/_styles.scssfrontend/pages/ManageControlsPage/OSSettings/cards/ConfigurationProfiles/components/AssetsTab/AssetsTab.tests.tsxfrontend/pages/ManageControlsPage/OSSettings/cards/ConfigurationProfiles/components/AssetsTab/AssetsTab.tsxfrontend/pages/ManageControlsPage/OSSettings/cards/ConfigurationProfiles/components/AssetsTab/_styles.scss
💤 Files with no reviewable changes (2)
- frontend/pages/ManageControlsPage/OSSettings/cards/ConfigurationProfiles/_styles.scss
- frontend/pages/ManageControlsPage/OSSettings/cards/ConfigurationProfiles/components/AssetsTab/_styles.scss
Issue
Closes #49461
Description
EmptyStateon the Profiles and Assets tabs but kept Technicians on the old plain<Card>message, so Technicians still saw the inconsistent styling the issue was originally filed for.EmptyState variant="header-list"with the "No configuration profiles" / "No assets" heading. The prior technician copy ("No X have been added.") is preserved as theinfoprop, and the Add button is omitted since technicians can't add.canAddConfigurationProfileandcanAddAssetrole-capability variables (mirroring the existingcanTurnOnMdmpattern) so widening beyond!isTechnicianlater is a one-line change.Cardimports and orphaned.empty-profiles/.empty-assetsSCSS rules.Screenrecording
Screen.Recording.2026-08-11.at.10.09.37.AM.mov
Testing
Summary by CodeRabbit
Improvements
Tests