Skip to content

LabelForm: replace 'teams' with 'fleets'#44770

Open
nulmete wants to merge 4 commits intomainfrom
nulmete/label-form-use-fleets-and-reports
Open

LabelForm: replace 'teams' with 'fleets'#44770
nulmete wants to merge 4 commits intomainfrom
nulmete/label-form-use-fleets-and-reports

Conversation

@nulmete
Copy link
Copy Markdown
Member

@nulmete nulmete commented May 5, 2026

Ad-hoc issue detected when reviewing #44410

Checklist for submitter

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

Testing

  • Added/updated automated tests

  • QA'd all new/changed functionality manually

Before

Screenshot 2026-05-05 at 9 35 13 PM

After

Screenshot 2026-05-05 at 9 50 26 PM

Summary by CodeRabbit

  • New Features

    • Updated label form to use "fleets" terminology in fields and immutability messaging.
  • Tests

    • Updated test cases to reflect fleet-based labeling behavior.

Copilot AI review requested due to automatic review settings May 5, 2026 19:55
@nulmete nulmete requested a review from a team as a code owner May 5, 2026 19:55
Copy link
Copy Markdown

@claude claude Bot left a comment

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
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 5, 2026

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: 47bc39da-dba0-47be-8ef8-d7d613375154

📥 Commits

Reviewing files that changed from the base of the PR and between a30b4b2 and 7fc7786.

📒 Files selected for processing (3)
  • changes/labelform-use-fleets-instead-of-teams
  • frontend/pages/labels/components/DynamicLabelForm/DynamicLabelForm.tsx
  • frontend/pages/labels/components/LabelForm/LabelForm.tests.tsx
✅ Files skipped from review due to trivial changes (1)
  • changes/labelform-use-fleets-instead-of-teams

Walkthrough

This pull request updates label form components to use "fleets" terminology instead of "teams". The changes include: marking "fleets" as immutable in DynamicLabelForm when teamName is provided; updating LabelForm test cases to verify immutable help text with "fleet" field names; modifying ManualLabelForm to pass immutableFields with "fleets" instead of "teams"; and updating TeamNameField to use "Fleet" as the label and "fleet_name" as the field name. A changelog entry documents the terminology update.

Possibly related PRs

  • fleetdm/fleet#44216: Modifies ManualLabelForm component behavior alongside the label editing flow that this PR updates.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: replacing 'teams' with 'fleets' in the LabelForm component across multiple files.
Description check ✅ Passed The description includes the required changes file checkbox, testing checkboxes with QA confirmation, and visual before/after screenshots demonstrating the terminology changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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 nulmete/label-form-use-fleets-and-reports

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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
frontend/pages/labels/components/LabelForm/LabelForm.tests.tsx (1)

106-125: 💤 Low value

Remove the vacuous immutableFields.length assertion.

Line 124 asserts the length of a locally declared constant (const immutableFields = ["reports", "platforms"]), which always passes and tests the test fixture rather than the component under test. It provides no signal about LabelForm's behaviour.

🧹 Proposed cleanup
     expect(
       screen.getByText(
         "Label reports and platforms are immutable. To make changes, delete this label and create a new one."
       )
     ).toBeInTheDocument();
-
-    expect(immutableFields.length).toBe(2);
   });
🤖 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/labels/components/LabelForm/LabelForm.tests.tsx` around lines
106 - 125, The test "should render correct immutable help text for two fields
(DynamicLabelForm without fleet)" declares immutableFields and then asserts
immutableFields.length, which is vacuous; remove the line
expect(immutableFields.length).toBe(2) from LabelForm.tests.tsx so the test only
asserts the rendered output from the LabelForm component (keep the render call
and the screen.getByText assertion that checks the immutable help text).
frontend/pages/labels/components/TeamNameField/TeamNameField.tsx (1)

9-15: 💤 Low value

Consider renaming TeamNameField to FleetNameField for consistency.

The component file name and export TeamNameField render a "Fleet" label, creating a semantic mismatch. Since this is a display-only component, there's no runtime impact, but the naming inconsistency will confuse maintainers. The rename is straightforward—only one file imports this component (LabelForm.tsx), making it genuinely low-effort.

🤖 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/labels/components/TeamNameField/TeamNameField.tsx` around
lines 9 - 15, Rename the TeamNameField component and its props interface to
FleetNameField (e.g., change TeamNameField -> FleetNameField and
ITeamNameFieldProps -> IFleetNameFieldProps) and update its export, the
component declaration, and the single import site in LabelForm.tsx so the
displayed label and file name match; ensure any prop usages (the name prop)
remain unchanged and update the filename to TeamNameField.tsx ->
FleetNameField.tsx to keep module identity consistent.
🤖 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/labels/components/LabelForm/LabelForm.tests.tsx`:
- Around line 106-125: The test "should render correct immutable help text for
two fields (DynamicLabelForm without fleet)" declares immutableFields and then
asserts immutableFields.length, which is vacuous; remove the line
expect(immutableFields.length).toBe(2) from LabelForm.tests.tsx so the test only
asserts the rendered output from the LabelForm component (keep the render call
and the screen.getByText assertion that checks the immutable help text).

In `@frontend/pages/labels/components/TeamNameField/TeamNameField.tsx`:
- Around line 9-15: Rename the TeamNameField component and its props interface
to FleetNameField (e.g., change TeamNameField -> FleetNameField and
ITeamNameFieldProps -> IFleetNameFieldProps) and update its export, the
component declaration, and the single import site in LabelForm.tsx so the
displayed label and file name match; ensure any prop usages (the name prop)
remain unchanged and update the filename to TeamNameField.tsx ->
FleetNameField.tsx to keep module identity consistent.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9dc62fd9-9e40-4e83-a4ad-09e7c25ff23f

📥 Commits

Reviewing files that changed from the base of the PR and between e102904 and 858c2b6.

📒 Files selected for processing (5)
  • changes/labelform-use-fleets-and-reports
  • frontend/pages/labels/components/DynamicLabelForm/DynamicLabelForm.tsx
  • frontend/pages/labels/components/LabelForm/LabelForm.tests.tsx
  • frontend/pages/labels/components/ManualLabelForm/ManualLabelForm.tsx
  • frontend/pages/labels/components/TeamNameField/TeamNameField.tsx

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 label edit/create UI copy to use newer product terminology in the shared label form, mainly replacing user-facing references to teams with fleets and queries with reports.

Changes:

  • Renamed the label form’s team field label from “Team” to “Fleet”.
  • Updated immutable-help-text inputs so manual labels refer to “fleets” and dynamic labels refer to “reports”.
  • Updated label form tests and added a changelog entry for the terminology change.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
frontend/pages/labels/components/TeamNameField/TeamNameField.tsx Renames the displayed field label from Team to Fleet.
frontend/pages/labels/components/ManualLabelForm/ManualLabelForm.tsx Changes manual-label immutable copy token from teams to fleets.
frontend/pages/labels/components/LabelForm/LabelForm.tests.tsx Updates expectations for the new immutable-help-text wording.
frontend/pages/labels/components/DynamicLabelForm/DynamicLabelForm.tsx Changes dynamic-label immutable copy tokens from queries to reports, and teams to fleets.
changes/labelform-use-fleets-and-reports Records the user-visible copy change in the changelog.

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

Comment thread frontend/pages/labels/components/DynamicLabelForm/DynamicLabelForm.tsx Outdated
@nulmete nulmete changed the title LabelForm: replace 'teams' with 'fleets' and 'queries' with 'reports' LabelForm: replace 'teams' with 'fleets' May 5, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 5, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 66.67%. Comparing base (e102904) to head (7fc7786).

Files with missing lines Patch % Lines
...s/components/DynamicLabelForm/DynamicLabelForm.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #44770      +/-   ##
==========================================
- Coverage   66.67%   66.67%   -0.01%     
==========================================
  Files        2664     2664              
  Lines      214655   214654       -1     
  Branches     9878     9756     -122     
==========================================
- Hits       143125   143124       -1     
  Misses      58500    58500              
  Partials    13030    13030              
Flag Coverage Δ
frontend 54.25% <50.00%> (-0.01%) ⬇️

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.

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