Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Remove unused import #419

Merged
merged 1 commit into from
Sep 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion public/components/main/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import React, { Fragment, useState, useEffect } from 'react';

Check failure on line 6 in public/components/main/main.tsx

View workflow job for this annotation

GitHub Actions / Lint

'Fragment' is defined but never used. Allowed unused vars must match /^_/u
import { i18n } from '@osd/i18n';
import {
EuiFlexGroup,
Expand All @@ -23,12 +23,11 @@
addReportsTableContent,
addReportDefinitionsTableContent,
} from './main_utils';
import CSS from 'csstype';

Check failure on line 26 in public/components/main/main.tsx

View workflow job for this annotation

GitHub Actions / Lint

`csstype` import should occur before import of `./reports_table`
import {
permissionsMissingToast,
permissionsMissingActions,
} from '../utils/utils';
import { EuiHeader } from '@opensearch-project/oui';

const reportCountStyles: CSS.Properties = {
color: 'gray',
Expand Down Expand Up @@ -235,7 +234,7 @@
}, 1000);
}
window.location.href = 'reports-dashboards#/';
}, []);

Check warning on line 237 in public/components/main/main.tsx

View workflow job for this annotation

GitHub Actions / Lint

React Hook useEffect has missing dependencies: 'handleCreateReportDefinitionSuccessToast', 'handleDeleteReportDefinitionSuccessToast', 'handleEditReportDefinitionSuccessToast', 'props', 'refreshReportsDefinitionsTable', and 'refreshReportsTable'. Either include them or remove the dependency array. However, 'props' will change when *any* prop changes, so the preferred fix is to destructure the 'props' object outside of the useEffect call and refer to those specific props inside useEffect

const refreshReportsTable = async () => {
const { httpClient } = props;
Expand Down Expand Up @@ -278,16 +277,16 @@
<div>
<EuiTitle size="l">
<h1>
{!getNavGroupEnabled && i18n.translate('opensearch.reporting.title', {

Check failure on line 280 in public/components/main/main.tsx

View workflow job for this annotation

GitHub Actions / Lint

Insert `⏎···········`
defaultMessage: 'Reporting',

Check failure on line 281 in public/components/main/main.tsx

View workflow job for this annotation

GitHub Actions / Lint

Insert `··`
})}

Check failure on line 282 in public/components/main/main.tsx

View workflow job for this annotation

GitHub Actions / Lint

Insert `··`
</h1>
</EuiTitle>
{!getNavGroupEnabled && <EuiSpacer size='s' />}

Check failure on line 285 in public/components/main/main.tsx

View workflow job for this annotation

GitHub Actions / Lint

Replace `'s'` with `"s"`
<EuiPanel paddingSize={'m'}>
<EuiFlexGroup justifyContent="spaceEvenly">
<EuiFlexItem>
<EuiText size='s'>

Check failure on line 289 in public/components/main/main.tsx

View workflow job for this annotation

GitHub Actions / Lint

Replace `'s'` with `"s"`
<h3>
{i18n.translate('opensearch.reports.main.title.reports', {
defaultMessage: 'Reports',
Expand All @@ -309,11 +308,11 @@
</EuiSmallButton>
</EuiFlexItem>
</EuiFlexGroup>
<EuiHorizontalRule margin='s' />

Check failure on line 311 in public/components/main/main.tsx

View workflow job for this annotation

GitHub Actions / Lint

Replace `'s'` with `"s"`
<ReportsTable
pagination={pagination}
reportsTableItems={reportsTableContent}
httpClient={props['httpClient']}

Check failure on line 315 in public/components/main/main.tsx

View workflow job for this annotation

GitHub Actions / Lint

["httpClient"] is better written in dot notation
handleSuccessToast={handleOnDemandDownloadSuccessToast}
handleErrorToast={handleOnDemandDownloadErrorToast}
handlePermissionsMissingToast={handlePermissionsMissingDownloadToast}
Expand All @@ -323,7 +322,7 @@
<EuiPanel paddingSize={'m'}>
<EuiFlexGroup justifyContent="spaceEvenly">
<EuiFlexItem>
<EuiText size='s'>

Check failure on line 325 in public/components/main/main.tsx

View workflow job for this annotation

GitHub Actions / Lint

Replace `'s'` with `"s"`
<h3>
{i18n.translate(
'opensearch.reports.main.title.reportDefinitions',
Expand Down
Loading