Skip to content

Fleet UI: Self-service categories follow-ups - #46860

Merged
jkatz01 merged 7 commits into
feat/39018-self-service-categoriesfrom
jk-39018-categories-fixes
Jun 5, 2026
Merged

Fleet UI: Self-service categories follow-ups#46860
jkatz01 merged 7 commits into
feat/39018-self-service-categoriesfrom
jk-39018-categories-fixes

Conversation

@cdcme

@cdcme cdcme commented Jun 4, 2026

Copy link
Copy Markdown
Member

Related issue: Resolves #39018

Follow-ups to the self-service custom categories work, landing on feat/39018-self-service-categories:

  1. Match categories by full name (with emoji). Drops the client-side emoji-prefix stripping in helpers.ts. Both sides of the comparison (custom category and software's categories) carry the emoji prefix, so lowercase exact match works.
  2. Render installed_all_self_service_software activity. New host activity item + global feed template, matching the BE contract (self_service_category_id|name, software_titles_count). Falls back to an un-scoped "End user installed all the software in self-service." when the install-all wasn't category-scoped.
  3. VPP edit modal: dynamic custom categories. EditSoftwareModal now passes teamId through SoftwareVppFormSoftwareOptionsSelector, so the VPP edit modal fetches custom categories from the API instead of falling back to the hardcoded list. teamId === 0 (no team) is covered.

Checklist for submitter

  • Input data is properly validated, SELECT * is avoided, SQL injection is prevented...

Testing

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

jkatz01 and others added 6 commits June 4, 2026 14:24
The self-service category filter stripped the emoji prefix from the
selected category name but not from the item's category names, so a
custom category like "🌎 Foos" never matched its own software and the
category page showed no installers. Both sides come from the same
software_categories rows, so compare the full names case-insensitively
instead of stripping.
This roll-up activity had no frontend renderer, so it fell through to the
generic fallback ("<host> installed all self service software"). Add a
renderer for both the host activity card and the global activity feed:
"End user installed all the software in self-service." when un-scoped, and
"End user selected the Install all option in the self-service <category>
category." when category-scoped. The actor is dropped in favor of "End
user" since self-service can be triggered by anyone on the My device page.
The emoji-prefixed custom category names in these mocks aren't part of the
SoftwareCategory literal union, so make generate (webpack ForkTsChecker)
failed even though jest passed (babel skips type checking). Cast the mock
categories, since custom-category names legitimately appear in this field
at runtime.
Thread teamId from EditSoftwareModal through SoftwareVppForm to
SoftwareOptionsSelector, matching the custom-package modal (#46601), so the
VPP edit modal fetches this fleet's custom self-service categories instead
of the hardcoded list.
- Soften the category mock casts to 'as string[] as SoftwareCategory[]',
  matching the existing services/entities/software.ts idiom, instead of
  routing through 'as unknown'.
- Drop the redundant optional chain on activity.details (non-optional on
  IHostPastActivity) in the install-all activity item.
- Cover the null self_service_category_name case (un-scoped roll-up) in
  both the host-card and global-feed activity tests.
- Add a teamId 0 (no team) test proving the VPP/category selector still
  fetches dynamically rather than using the hardcoded fallback.
@cdcme

cdcme commented Jun 4, 2026

Copy link
Copy Markdown
Member Author

@claude review once

@codecov

codecov Bot commented Jun 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (feat/39018-self-service-categories@1036719). Learn more about missing BASE report.

Additional details and impacted files
@@                          Coverage Diff                          @@
##             feat/39018-self-service-categories   #46860   +/-   ##
=====================================================================
  Coverage                                      ?   66.88%           
=====================================================================
  Files                                         ?     2813           
  Lines                                         ?   223908           
  Branches                                      ?    11575           
=====================================================================
  Hits                                          ?   149772           
  Misses                                        ?    60586           
  Partials                                      ?    13550           
Flag Coverage Δ
frontend 57.15% <100.00%> (?)

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.

@cdcme
cdcme marked this pull request as ready for review June 4, 2026 22:00
@cdcme
cdcme requested a review from a team as a code owner June 4, 2026 22:00

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

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

worked great

@jkatz01
jkatz01 merged commit 09bccef into feat/39018-self-service-categories Jun 5, 2026
17 checks passed
@jkatz01
jkatz01 deleted the jk-39018-categories-fixes branch June 5, 2026 19:40
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.

3 participants