Conversation
There was a problem hiding this comment.
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.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
WalkthroughThis PR makes targeted frontend cleanup and type-safety changes: removes unused imports, state, props, and test helpers; tightens TypeScript typings (replacing Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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/hosts/ManageHostsPage/components/HostsFilterBlock/HostsFilterBlock.tsx (1)
66-68: Normalize upstream query params before passing to HostsFilterBlock.Line 66 and Line 68 now require
number/MacSettingsStatusQueryParam, butpolicyIdandmacSettingsStatusare extracted directly fromqueryParamswithout parsing or validation (ManageHostsPage.tsx lines 257 and 259–260). URL query parameters are strings by nature and can be invalid; they should be parsed/validated before passing to this component to enforce type safety at runtime.For example:
policyIdshould useparseInt()likesoftwareId,softwareVersionId, andsoftwareTitleIddo.macSettingsStatusshould validate against"latest" | "pending" | "failing"likesoftwareStatusvalidates withisValidSoftwareAggregateStatus().🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@frontend/pages/hosts/ManageHostsPage/components/HostsFilterBlock/HostsFilterBlock.tsx` around lines 66 - 68, The component expects policyId:number and macSettingsStatus:MacSettingsStatusQueryParam but ManageHostsPage currently passes raw string query params; update the extraction logic in ManageHostsPage where policyId and macSettingsStatus are read (the same area that parses softwareId/softwareVersionId/softwareTitleId) to normalize/validate them: use parseInt() for policyId (falling back to undefined on NaN) and validate macSettingsStatus against the allowed values ("latest"|"pending"|"failing") similar to isValidSoftwareAggregateStatus(), converting to the MacSettingsStatusQueryParam enum/type or setting undefined if invalid before passing into HostsFilterBlock.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In
`@frontend/pages/hosts/ManageHostsPage/components/HostsFilterBlock/HostsFilterBlock.tsx`:
- Around line 66-68: The component expects policyId:number and
macSettingsStatus:MacSettingsStatusQueryParam but ManageHostsPage currently
passes raw string query params; update the extraction logic in ManageHostsPage
where policyId and macSettingsStatus are read (the same area that parses
softwareId/softwareVersionId/softwareTitleId) to normalize/validate them: use
parseInt() for policyId (falling back to undefined on NaN) and validate
macSettingsStatus against the allowed values ("latest"|"pending"|"failing")
similar to isValidSoftwareAggregateStatus(), converting to the
MacSettingsStatusQueryParam enum/type or setting undefined if invalid before
passing into HostsFilterBlock.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 7cf3c010-bae7-4280-9047-912728f344d1
📒 Files selected for processing (23)
frontend/components/TeamsDropdown/TeamsDropdown.tsxfrontend/pages/ManageControlsPage/OSUpdates/components/EndUserOSRequirementPreview/EndUserOSRequirementPreview.tsxfrontend/pages/ManageControlsPage/Scripts/ScriptBatchDetailsPage/components/ScriptBatchHostsTable/ScriptBatchHostsTableConfig.tsxfrontend/pages/ManageControlsPage/Secrets/Secrets.tests.tsxfrontend/pages/ManageControlsPage/SetupExperience/cards/BootstrapPackage/components/BootstrapPackageUploader/BootstrapPackageUploader.tsxfrontend/pages/SoftwarePage/SoftwarePage.tsxfrontend/pages/SoftwarePage/SoftwareTitleDetailsPage/EditIconModal/EditIconModal.tsxfrontend/pages/SoftwarePage/SoftwareTitleDetailsPage/EditSoftwareModal/EditSoftwareModal.tsxfrontend/pages/SoftwarePage/SoftwareTitleDetailsPage/SoftwareSummaryCard/SoftwareSummaryCard.tsxfrontend/pages/SoftwarePage/SoftwareTitles/SoftwareTitles.tsxfrontend/pages/hosts/ManageHostsPage/components/FilterPill/FilterPill.tsxfrontend/pages/hosts/ManageHostsPage/components/HostsFilterBlock/HostsFilterBlock.tsxfrontend/pages/hosts/details/cards/HostSoftwareLibrary/HostSoftwareLibrary.tsxfrontend/pages/hosts/details/cards/Queries/ReportUpdatedCell/ReportUpdatedCell.tests.tsxfrontend/pages/hosts/details/cards/Software/SelfService/components/UpdatesCard/UpdateSoftwareItem/UpdateSoftwareItem.tsxfrontend/pages/packs/ManagePacksPage/components/PacksTable/PacksTable.tsxfrontend/pages/policies/ManagePoliciesPage/components/PoliciesTable/PoliciesTable.tests.tsxfrontend/pages/policies/edit/components/PolicyResults/PolicyResults.tsxfrontend/pages/queries/ManageQueriesPage/components/QueriesTable/QueriesTable.tsxfrontend/pages/queries/details/QueryDetailsPage/QueryDetailsPage.tsxfrontend/services/entities/scripts.tsfrontend/services/entities/software.tsfrontend/services/entities/users.ts
💤 Files with no reviewable changes (9)
- frontend/pages/ManageControlsPage/SetupExperience/cards/BootstrapPackage/components/BootstrapPackageUploader/BootstrapPackageUploader.tsx
- frontend/pages/hosts/ManageHostsPage/components/FilterPill/FilterPill.tsx
- frontend/pages/hosts/details/cards/HostSoftwareLibrary/HostSoftwareLibrary.tsx
- frontend/pages/SoftwarePage/SoftwarePage.tsx
- frontend/pages/policies/edit/components/PolicyResults/PolicyResults.tsx
- frontend/pages/SoftwarePage/SoftwareTitles/SoftwareTitles.tsx
- frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/SoftwareSummaryCard/SoftwareSummaryCard.tsx
- frontend/services/entities/software.ts
- frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/EditSoftwareModal/EditSoftwareModal.tsx
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #43491 +/- ##
========================================
Coverage 66.90% 66.90%
========================================
Files 2596 2596
Lines 208220 208220
Branches 9208 9321 +113
========================================
Hits 139313 139313
Misses 56237 56237
Partials 12670 12670
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Part II of the frontend lint cleanup effort, primarily removing unused code, tightening types, and aligning React hook dependencies.
Changes:
- Removed unused imports/props/state and cleaned up tests to eliminate unused variables.
- Improved TypeScript typings in several service/entity and component interfaces (e.g., request payloads, table query data, react-table cell props).
- Fixed/adjusted React hook dependency arrays and a missing
returnin an OS requirement image switch.
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| frontend/services/entities/users.ts | Tightened typing for resetPassword and setup request payloads. |
| frontend/services/entities/software.ts | Removed unused addedSoftwareToken from query-key interfaces. |
| frontend/services/entities/scripts.ts | Removed unused mock imports; improved filter typing (status). |
| frontend/pages/queries/details/QueryDetailsPage/QueryDetailsPage.tsx | Updated useEffect dependency array for team selection side effect. |
| frontend/pages/queries/ManageQueriesPage/components/QueriesTable/QueriesTable.tsx | Corrected memo/callback dependencies for platform filter rendering. |
| frontend/pages/policies/edit/components/PolicyResults/PolicyResults.tsx | Removed unused variable. |
| frontend/pages/policies/ManagePoliciesPage/components/PoliciesTable/PoliciesTable.tests.tsx | Removed unused container from test render result. |
| frontend/pages/packs/ManagePacksPage/components/PacksTable/PacksTable.tsx | Replaced any with ITableQueryData for onQueryChange. |
| frontend/pages/hosts/details/cards/Software/SelfService/components/UpdatesCard/UpdateSoftwareItem/UpdateSoftwareItem.tsx | Removed unused destructured field. |
| frontend/pages/hosts/details/cards/Queries/ReportUpdatedCell/ReportUpdatedCell.tests.tsx | Removed unused import from RTL. |
| frontend/pages/hosts/details/cards/HostSoftwareLibrary/HostSoftwareLibrary.tsx | Removed unused import. |
| frontend/pages/hosts/ManageHostsPage/components/HostsFilterBlock/HostsFilterBlock.tsx | Tightened param typing for policyId and macSettingsStatus. |
| frontend/pages/hosts/ManageHostsPage/components/FilterPill/FilterPill.tsx | Removed unused lodash import. |
| frontend/pages/SoftwarePage/SoftwareTitles/SoftwareTitles.tsx | Removed unused addedSoftwareToken prop plumbing from queries. |
| frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/SoftwareSummaryCard/SoftwareSummaryCard.tsx | Removed unused router prop passed to modal. |
| frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/EditSoftwareModal/EditSoftwareModal.tsx | Removed unused prop types/props and import cleanup. |
| frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/EditIconModal/EditIconModal.tsx | Memoized resetIconState, updated effect deps, removed unused items. |
| frontend/pages/SoftwarePage/SoftwarePage.tsx | Removed unused addedSoftwareToken state and prop passing. |
| frontend/pages/ManageControlsPage/SetupExperience/cards/BootstrapPackage/components/BootstrapPackageUploader/BootstrapPackageUploader.tsx | Removed unused import. |
| frontend/pages/ManageControlsPage/Secrets/Secrets.tests.tsx | Removed unused test imports/variables. |
| frontend/pages/ManageControlsPage/Scripts/ScriptBatchDetailsPage/components/ScriptBatchHostsTable/ScriptBatchHostsTableConfig.tsx | Replaced any cell props with CellProps<IScriptBatchHostResult>. |
| frontend/pages/ManageControlsPage/OSUpdates/components/EndUserOSRequirementPreview/EndUserOSRequirementPreview.tsx | Fixed missing return in default image case. |
| frontend/components/TeamsDropdown/TeamsDropdown.tsx | Strengthened react-select generic typing; removed unused lodash import. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
frontend/pages/hosts/ManageHostsPage/components/HostsFilterBlock/HostsFilterBlock.tsx
Outdated
Show resolved
Hide resolved
…ck/HostsFilterBlock.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Issue
Description
Testing
Summary by CodeRabbit
Bug Fixes
Refactor