FE: Clean up lint warnings part III - #44065
Conversation
| router.push(getPathWithQueryParams(PATHS.SOFTWARE_TITLES, queryParams)); | ||
| }; | ||
|
|
||
| const onClickPreviewEndUserExperience = () => { |
There was a problem hiding this comment.
We removed preview end user experience modal from this UI when we moved advanced options out of the add software flows. This is all now unused code.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #44065 +/- ##
==========================================
- Coverage 65.07% 65.06% -0.01%
==========================================
Files 2609 2616 +7
Lines 254482 254845 +363
Branches 9305 9540 +235
==========================================
+ Hits 165596 165814 +218
- Misses 76078 76220 +142
- Partials 12808 12811 +3
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:
|
| try { | ||
| const { | ||
| software_title_id: softwareAppStoreTitleId, | ||
| // Maybe this will return name and can render success message with the name? |
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.
There was a problem hiding this comment.
Pull request overview
This PR continues the frontend lint-warnings cleanup by removing unused imports/variables/props across several React components and tests.
Changes:
- Remove unused imports and unused destructured values from various components/tests.
- Remove an unused Android “preview end user experience” modal/state wiring.
- Simplify the Android configuration modal error helper (but currently introduces a TS call-site mismatch).
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| frontend/pages/queries/edit/components/EditQueryForm/EditQueryForm.tsx | Removes unused helper/component imports and unused AppContext values. |
| frontend/pages/hosts/details/cards/HostSummary/HostSummary.tsx | Removes unused constant import. |
| frontend/pages/hosts/details/HostQueryReport/HostQueryReport.tsx | Removes unused Link import. |
| frontend/pages/hosts/components/TransferHostModal/TransferHostModal.tests.tsx | Removes unused paths import. |
| frontend/pages/admin/TeamManagementPage/components/RenameTeamModal/RenameTeamModal.tests.tsx | Removes unused waitFor import. |
| frontend/pages/SoftwarePage/components/tables/SoftwareVulnerabilitiesTable/SoftwareVulnerabilitiesTable.tsx | Removes unused constants import. |
| frontend/pages/SoftwarePage/components/forms/SoftwareAndroidForm/SoftwareAndroidForm.tsx | Removes unused prop from the form props/interface. |
| frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/EditConfigurationModal/helpers.tsx | Changes getErrorMessage signature; currently inconsistent with caller usage. |
| frontend/pages/SoftwarePage/SoftwareAddPage/SoftwareAppStore/SoftwareAppStoreAndroid/SoftwareAppStoreAndroid.tsx | Removes unused imports/state and stops passing removed preview prop. |
| frontend/components/forms/fields/Checkbox/Checkbox.tsx | Removes unused destructured prop while still passing helpText through to FormField. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| // eslint-disable-next-line import/prefer-default-export | ||
| export const getErrorMessage = (err: unknown, software: IAppStoreApp) => { | ||
| export const getErrorMessage = (err: unknown) => { |
There was a problem hiding this comment.
getErrorMessage now only accepts one argument, but it’s still called with two args in EditConfigurationModal.tsx (e.g. getErrorMessage(e, softwareInstaller as IAppStoreApp)), which will fail TypeScript type-checking. Either update the call site(s) to pass only err, or keep the second parameter (e.g. make it optional and/or prefix with _ to satisfy lint) to preserve the existing API surface.
| export const getErrorMessage = (err: unknown) => { | |
| export const getErrorMessage = (err: unknown, _appStoreApp?: unknown) => { |
|
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)
WalkthroughThis pull request removes unused props, parameters, state, and imports across multiple frontend files. Notable changes: Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/EditConfigurationModal/helpers.tsx`:
- Line 9: Call sites still pass two arguments to getErrorMessage but its
signature was changed to accept only one; update the call in
EditConfigurationModal.tsx to call getErrorMessage(e) (remove the second arg:
softwareInstaller as IAppStoreApp) and then remove the now-unused IAppStoreApp
import from that file if it has no other references. Ensure the only usage of
getErrorMessage matches the single-parameter signature across the file.
🪄 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: 3d35f083-a1c1-48aa-89a7-0ba409493436
📒 Files selected for processing (10)
frontend/components/forms/fields/Checkbox/Checkbox.tsxfrontend/pages/SoftwarePage/SoftwareAddPage/SoftwareAppStore/SoftwareAppStoreAndroid/SoftwareAppStoreAndroid.tsxfrontend/pages/SoftwarePage/SoftwareTitleDetailsPage/EditConfigurationModal/helpers.tsxfrontend/pages/SoftwarePage/components/forms/SoftwareAndroidForm/SoftwareAndroidForm.tsxfrontend/pages/SoftwarePage/components/tables/SoftwareVulnerabilitiesTable/SoftwareVulnerabilitiesTable.tsxfrontend/pages/admin/TeamManagementPage/components/RenameTeamModal/RenameTeamModal.tests.tsxfrontend/pages/hosts/components/TransferHostModal/TransferHostModal.tests.tsxfrontend/pages/hosts/details/HostQueryReport/HostQueryReport.tsxfrontend/pages/hosts/details/cards/HostSummary/HostSummary.tsxfrontend/pages/queries/edit/components/EditQueryForm/EditQueryForm.tsx
💤 Files with no reviewable changes (4)
- frontend/pages/hosts/components/TransferHostModal/TransferHostModal.tests.tsx
- frontend/components/forms/fields/Checkbox/Checkbox.tsx
- frontend/pages/SoftwarePage/components/forms/SoftwareAndroidForm/SoftwareAndroidForm.tsx
- frontend/pages/SoftwarePage/SoftwareAddPage/SoftwareAppStore/SoftwareAppStoreAndroid/SoftwareAppStoreAndroid.tsx
|
|
||
| // eslint-disable-next-line import/prefer-default-export | ||
| export const getErrorMessage = (err: unknown, software: IAppStoreApp) => { | ||
| export const getErrorMessage = (err: unknown) => { |
There was a problem hiding this comment.
Call site not updated to match new signature.
getErrorMessage was narrowed to a single parameter, but the caller in EditConfigurationModal.tsx (lines 109-114 per the provided snippet) still invokes it as getErrorMessage(e, softwareInstaller as IAppStoreApp). This will fail TypeScript compilation (TS2554: expected 1 argument, got 2) and the related IAppStoreApp import there likely becomes unused as well.
🔧 Proposed fix in EditConfigurationModal.tsx
} catch (e) {
renderFlash(
"error",
- getErrorMessage(e, softwareInstaller as IAppStoreApp)
+ getErrorMessage(e)
);
}Also remove the now-unused IAppStoreApp import in EditConfigurationModal.tsx if no other references remain.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In
`@frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/EditConfigurationModal/helpers.tsx`
at line 9, Call sites still pass two arguments to getErrorMessage but its
signature was changed to accept only one; update the call in
EditConfigurationModal.tsx to call getErrorMessage(e) (remove the second arg:
softwareInstaller as IAppStoreApp) and then remove the now-unused IAppStoreApp
import from that file if it has no other references. Ensure the only usage of
getErrorMessage matches the single-parameter signature across the file.
Description
Summary by CodeRabbit
Refactor
Chores
Tests