From 4ce51ab0f1374290947f3741bf7d9e69ea7f7a1b Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Thu, 30 Dec 2021 12:00:06 +0100 Subject: [PATCH] use precise imports of react-use Signed-off-by: Patrik Oldsberg --- .changeset/short-sloths-tell.md | 55 +++++++++++++++++++ .../ExampleFetchComponent.md | 2 +- docs/tutorials/quickstart-app-plugin.md | 2 +- .../ExampleFetchComponent.tsx.hbs | 2 +- packages/core-app-api/src/app/AppManager.tsx | 2 +- .../core-app-api/src/app/AppThemeProvider.tsx | 2 +- .../CopyTextButton/CopyTextButton.test.tsx | 12 ++-- .../CopyTextButton/CopyTextButton.tsx | 2 +- .../DismissableBanner/DismissableBanner.tsx | 2 +- .../LogViewer/useLogViewerSearch.tsx | 2 +- .../LogViewer/useLogViewerSelection.tsx | 2 +- .../OAuthRequestDialog/OAuthRequestDialog.tsx | 2 +- .../OverflowTooltip/OverflowTooltip.tsx | 2 +- .../src/components/Tabs/Tabs.tsx | 2 +- .../src/hooks/useQueryParamState.ts | 2 +- .../src/layout/Sidebar/Intro.tsx | 2 +- .../src/layout/SignInPage/SignInPage.tsx | 2 +- .../src/devApp/SidebarThemeSwitcher.tsx | 2 +- .../AllureReportComponent.tsx | 2 +- .../DagTableComponent/DagTableComponent.tsx | 2 +- .../StatusComponent/StatusComponent.tsx | 2 +- .../VersionComponent/VersionComponent.tsx | 2 +- plugins/azure-devops/src/hooks/useAllTeams.ts | 2 +- .../src/hooks/useDashboardPullRequests.ts | 3 +- .../azure-devops/src/hooks/usePullRequests.ts | 2 +- .../azure-devops/src/hooks/useRepoBuilds.ts | 2 +- .../src/components/EntityBadgesDialog.tsx | 2 +- .../EntityBazaarInfoCard.tsx | 2 +- .../EntityBazaarInfoContent.tsx | 2 +- .../HomePageBazaarInfoCard.tsx | 2 +- .../src/components/SortView/SortView.tsx | 2 +- .../components/useBitriseArtifactDetails.ts | 2 +- .../src/components/useBitriseArtifacts.ts | 2 +- .../src/hooks/useBitriseBuildWorkflows.ts | 3 +- plugins/bitrise/src/hooks/useBitriseBuilds.ts | 3 +- .../CatalogGraphPage/useCatalogGraphPage.ts | 2 +- .../useEntityRelationNodesAndEdges.ts | 2 +- .../EntityRelationsGraph/useEntityStore.ts | 2 +- .../StepPrepareCreatePullRequest.tsx | 2 +- .../EntitySearchBar/EntitySearchBar.tsx | 2 +- .../useUnregisterEntityDialogState.ts | 2 +- plugins/catalog-react/src/hooks/useEntity.tsx | 2 +- .../catalog-react/src/hooks/useEntityKinds.ts | 2 +- .../src/hooks/useEntityListProvider.tsx | 4 +- .../src/hooks/useEntityOwnership.ts | 2 +- .../src/hooks/useEntityTypeFilter.tsx | 2 +- plugins/catalog-react/src/hooks/useOwnUser.ts | 3 +- .../src/hooks/useOwnedEntities.ts | 2 +- .../src/hooks/useRelatedEntities.ts | 2 +- .../src/hooks/useStarredEntities.ts | 2 +- .../EntityProcessingErrorsPanel.tsx | 2 +- .../components/EntitySwitch/EntitySwitch.tsx | 2 +- .../SystemDiagramCard/SystemDiagramCard.tsx | 2 +- .../circleci/src/state/useBuildWithSteps.ts | 2 +- plugins/circleci/src/state/useBuilds.ts | 2 +- .../WorkflowRunDetails/useWorkflowRunJobs.ts | 2 +- .../useWorkflowRunsDetails.ts | 2 +- .../src/components/useProjectName.ts | 2 +- .../src/components/useWorkflowRuns.ts | 2 +- .../CoverageHistoryChart.tsx | 2 +- .../components/FileExplorer/FileContent.tsx | 2 +- .../components/FileExplorer/FileExplorer.tsx | 2 +- .../ConfigSchemaPage/ConfigSchemaPage.tsx | 2 +- .../CopyUrlToClipboard/CopyUrlToClipboard.tsx | 2 +- .../DomainExplorerContent.tsx | 2 +- .../GroupsExplorerContent/GroupsDiagram.tsx | 2 +- .../ToolExplorerContent.tsx | 2 +- .../src/components/serviceAnalytics.ts | 2 +- .../src/components/serviceDetails.ts | 2 +- .../src/components/FossaCard/FossaCard.tsx | 2 +- .../src/components/FossaPage/FossaPage.tsx | 3 +- .../ProjectDetailsPage/ProjectDetailsPage.tsx | 2 +- .../ProjectListPage/ProjectListPage.tsx | 2 +- .../src/GitReleaseManager.tsx | 2 +- .../hooks/useCreateReleaseCandidate.ts | 3 +- .../src/features/Patch/PatchBody.tsx | 2 +- .../src/features/Patch/hooks/usePatch.ts | 2 +- .../features/Patch/hooks/usePatchDryRun.tsx | 3 +- .../features/PromoteRc/hooks/usePromoteRc.ts | 3 +- .../src/features/RepoDetailsForm/Owner.tsx | 2 +- .../src/features/RepoDetailsForm/Repo.tsx | 2 +- .../Stats/Info/hooks/useGetReleaseTimes.tsx | 3 +- .../Stats/Row/RowCollapsed/ReleaseTime.tsx | 2 +- .../src/features/Stats/hooks/useGetStats.ts | 2 +- .../src/hooks/useGetGitBatchInfo.ts | 2 +- .../WorkflowRunDetails/useWorkflowRunJobs.ts | 2 +- .../useWorkflowRunsDetails.ts | 2 +- .../useDownloadWorkflowRunLogs.ts | 2 +- .../src/components/useProjectName.ts | 2 +- .../src/components/useWorkflowRuns.ts | 2 +- .../src/components/GithubDeploymentsCard.tsx | 2 +- .../components/ClusterList/ClusterList.tsx | 2 +- .../ProfileCatalog/ProfileCatalog.tsx | 2 +- .../components/GraphiQLPage/GraphiQLPage.tsx | 2 +- .../WelcomeTitle/WelcomeTitle.tsx | 2 +- plugins/ilert/src/hooks/useAlertSource.ts | 2 +- .../ilert/src/hooks/useAlertSourceOnCalls.ts | 2 +- plugins/ilert/src/hooks/useAssignIncident.ts | 2 +- plugins/ilert/src/hooks/useIncidentActions.ts | 2 +- plugins/ilert/src/hooks/useIncidents.ts | 2 +- plugins/ilert/src/hooks/useNewIncident.ts | 2 +- plugins/ilert/src/hooks/useOnCallSchedules.ts | 2 +- plugins/ilert/src/hooks/useShiftOverride.ts | 2 +- plugins/ilert/src/hooks/useUptimeMonitors.ts | 2 +- .../src/components/useBuildWithSteps.ts | 2 +- plugins/jenkins/src/components/useBuilds.ts | 2 +- .../useConsumerGroupsOffsetsForEntity.ts | 2 +- .../src/hooks/useKubernetesObjects.ts | 2 +- .../components/AuditList/AuditListTable.tsx | 2 +- .../src/components/AuditList/index.tsx | 3 +- .../src/components/AuditView/index.tsx | 2 +- .../lighthouse/src/components/Intro/index.tsx | 2 +- .../src/hooks/useWebsiteForEntity.ts | 2 +- .../NewRelicDashboard/DashboardEntityList.tsx | 2 +- .../DashboardSnapshot.tsx | 2 +- .../DashboardSnapshotList.tsx | 2 +- .../NewRelicFetchComponent.tsx | 2 +- .../Group/MembersList/MembersListCard.tsx | 2 +- .../Cards/OwnershipCard/OwnershipCard.tsx | 2 +- .../components/ChangeEvents/ChangeEvents.tsx | 2 +- .../Escalation/EscalationPolicy.tsx | 2 +- .../src/components/Incident/Incidents.tsx | 2 +- .../src/components/PagerDutyCard/index.tsx | 2 +- .../TriggerDialog/TriggerDialog.tsx | 2 +- .../src/hooks/usePermission.ts | 2 +- plugins/rollbar/src/hooks/useCatalogEntity.ts | 2 +- .../rollbar/src/hooks/useRollbarEntities.ts | 2 +- .../rollbar/src/hooks/useTopActiveItems.ts | 2 +- .../components/ActionsPage/ActionsPage.tsx | 2 +- .../src/components/TaskPage/TaskPage.tsx | 2 +- .../components/TemplatePage/TemplatePage.tsx | 2 +- .../fields/EntityPicker/EntityPicker.tsx | 2 +- .../fields/RepoUrlPicker/RepoUrlPicker.tsx | 2 +- .../LegacySearchPage/LegacySearchPage.tsx | 2 +- .../LegacySearchPage/LegacySearchResult.tsx | 2 +- .../src/components/SearchBar/SearchBar.tsx | 2 +- .../SearchContext/SearchContext.tsx | 4 +- .../src/components/SearchPage/SearchPage.tsx | 2 +- .../src/components/SearchType/SearchType.tsx | 2 +- .../SentryIssuesWidget/SentryIssuesWidget.tsx | 2 +- plugins/shortcuts/src/Shortcuts.tsx | 2 +- .../SonarQubeCard/SonarQubeCard.tsx | 2 +- .../src/components/EntitySplunkOnCallCard.tsx | 2 +- .../Escalation/EscalationPolicy.tsx | 2 +- .../components/Incident/IncidentListItem.tsx | 2 +- .../src/components/Incident/Incidents.tsx | 2 +- .../TriggerDialog/TriggerDialog.tsx | 2 +- .../ScorecardsOverview/ScorecardsOverview.tsx | 2 +- .../src/components/RadarComponent.tsx | 2 +- .../src/home/components/DocsTable.tsx | 2 +- .../home/components/EntityListDocsTable.tsx | 2 +- .../home/components/TechDocsCustomHome.tsx | 2 +- .../reader/components/LegacyTechDocsPage.tsx | 2 +- .../src/reader/components/TechDocsPage.tsx | 2 +- .../src/reader/components/TechDocsSearch.tsx | 2 +- .../src/reader/components/useRawPage.ts | 2 +- .../src/reader/components/useReaderState.ts | 3 +- .../General/UserSettingsThemeToggle.tsx | 2 +- .../src/components/useUserProfileInfo.ts | 2 +- .../components/BuildDetails/BuildDetails.tsx | 2 +- .../BuildListFilter/BuildListFilter.tsx | 2 +- .../src/components/Overview/Overview.tsx | 2 +- .../OverviewTrends/OverviewTrends.tsx | 2 +- .../src/components/StatusCell/StatusCell.tsx | 2 +- .../components/StatusMatrix/StatusMatrix.tsx | 3 +- 165 files changed, 235 insertions(+), 174 deletions(-) create mode 100644 .changeset/short-sloths-tell.md diff --git a/.changeset/short-sloths-tell.md b/.changeset/short-sloths-tell.md new file mode 100644 index 0000000000..1e62303703 --- /dev/null +++ b/.changeset/short-sloths-tell.md @@ -0,0 +1,55 @@ +--- +'@backstage/cli': patch +'@backstage/core-app-api': patch +'@backstage/core-components': patch +'@backstage/dev-utils': patch +'@backstage/plugin-allure': patch +'@backstage/plugin-apache-airflow': patch +'@backstage/plugin-azure-devops': patch +'@backstage/plugin-badges': patch +'@backstage/plugin-bazaar': patch +'@backstage/plugin-bitrise': patch +'@backstage/plugin-catalog': patch +'@backstage/plugin-catalog-graph': patch +'@backstage/plugin-catalog-import': patch +'@backstage/plugin-catalog-react': patch +'@backstage/plugin-circleci': patch +'@backstage/plugin-cloudbuild': patch +'@backstage/plugin-code-coverage': patch +'@backstage/plugin-config-schema': patch +'@backstage/plugin-cost-insights': patch +'@backstage/plugin-explore': patch +'@backstage/plugin-firehydrant': patch +'@backstage/plugin-fossa': patch +'@backstage/plugin-gcp-projects': patch +'@backstage/plugin-git-release-manager': patch +'@backstage/plugin-github-actions': patch +'@backstage/plugin-github-deployments': patch +'@backstage/plugin-gitops-profiles': patch +'@backstage/plugin-graphiql': patch +'@backstage/plugin-home': patch +'@backstage/plugin-ilert': patch +'@backstage/plugin-jenkins': patch +'@backstage/plugin-kafka': patch +'@backstage/plugin-kubernetes': patch +'@backstage/plugin-lighthouse': patch +'@backstage/plugin-newrelic': patch +'@backstage/plugin-newrelic-dashboard': patch +'@backstage/plugin-org': patch +'@backstage/plugin-pagerduty': patch +'@backstage/plugin-permission-react': patch +'@backstage/plugin-rollbar': patch +'@backstage/plugin-scaffolder': patch +'@backstage/plugin-search': patch +'@backstage/plugin-sentry': patch +'@backstage/plugin-shortcuts': patch +'@backstage/plugin-sonarqube': patch +'@backstage/plugin-splunk-on-call': patch +'@backstage/plugin-tech-insights': patch +'@backstage/plugin-tech-radar': patch +'@backstage/plugin-techdocs': patch +'@backstage/plugin-user-settings': patch +'@backstage/plugin-xcmetrics': patch +--- + +Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. diff --git a/contrib/docs/tutorials/quickstart-app-plugin/ExampleFetchComponent.md b/contrib/docs/tutorials/quickstart-app-plugin/ExampleFetchComponent.md index 086175a0ce..f45b70cdb1 100644 --- a/contrib/docs/tutorials/quickstart-app-plugin/ExampleFetchComponent.md +++ b/contrib/docs/tutorials/quickstart-app-plugin/ExampleFetchComponent.md @@ -4,7 +4,7 @@ ExampleFetchComponent.tsx reference ```tsx import React from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import Alert from '@material-ui/lab/Alert'; import { githubAuthApiRef, useApi } from '@backstage/core-plugin-api'; import { Table, TableColumn, Progress } from '@backstage/core-components'; diff --git a/docs/tutorials/quickstart-app-plugin.md b/docs/tutorials/quickstart-app-plugin.md index 938a57198a..d1ca61a11f 100644 --- a/docs/tutorials/quickstart-app-plugin.md +++ b/docs/tutorials/quickstart-app-plugin.md @@ -135,7 +135,7 @@ changes, let's start by wiping this component clean. ```tsx import React from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import Alert from '@material-ui/lab/Alert'; import { Table, TableColumn, Progress } from '@backstage/core-components'; import { githubAuthApiRef, useApi } from '@backstage/core-plugin-api'; diff --git a/packages/cli/templates/default-plugin/src/components/ExampleFetchComponent/ExampleFetchComponent.tsx.hbs b/packages/cli/templates/default-plugin/src/components/ExampleFetchComponent/ExampleFetchComponent.tsx.hbs index a7663567d9..159fcd70c5 100644 --- a/packages/cli/templates/default-plugin/src/components/ExampleFetchComponent/ExampleFetchComponent.tsx.hbs +++ b/packages/cli/templates/default-plugin/src/components/ExampleFetchComponent/ExampleFetchComponent.tsx.hbs @@ -2,7 +2,7 @@ import React from 'react'; import { makeStyles } from '@material-ui/core/styles'; import { Table, TableColumn, Progress } from '@backstage/core-components'; import Alert from '@material-ui/lab/Alert'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; const useStyles = makeStyles({ avatar: { diff --git a/packages/core-app-api/src/app/AppManager.tsx b/packages/core-app-api/src/app/AppManager.tsx index 21940c08d5..7cdc06a094 100644 --- a/packages/core-app-api/src/app/AppManager.tsx +++ b/packages/core-app-api/src/app/AppManager.tsx @@ -24,7 +24,7 @@ import React, { useState, } from 'react'; import { Route, Routes } from 'react-router-dom'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { ApiProvider, ApiRegistry, diff --git a/packages/core-app-api/src/app/AppThemeProvider.tsx b/packages/core-app-api/src/app/AppThemeProvider.tsx index b2c800f673..2ff8e493fe 100644 --- a/packages/core-app-api/src/app/AppThemeProvider.tsx +++ b/packages/core-app-api/src/app/AppThemeProvider.tsx @@ -16,7 +16,7 @@ import React, { useMemo, useEffect, useState, PropsWithChildren } from 'react'; import { useApi, appThemeApiRef, AppTheme } from '@backstage/core-plugin-api'; -import { useObservable } from 'react-use'; +import useObservable from 'react-use/lib/useObservable'; // This tries to find the most accurate match, but also falls back to less // accurate results in order to avoid errors. diff --git a/packages/core-components/src/components/CopyTextButton/CopyTextButton.test.tsx b/packages/core-components/src/components/CopyTextButton/CopyTextButton.test.tsx index ecb784f951..462bfb36cb 100644 --- a/packages/core-components/src/components/CopyTextButton/CopyTextButton.test.tsx +++ b/packages/core-components/src/components/CopyTextButton/CopyTextButton.test.tsx @@ -19,7 +19,7 @@ import { act, fireEvent } from '@testing-library/react'; import { renderInTestApp, TestApiProvider } from '@backstage/test-utils'; import { CopyTextButton } from './CopyTextButton'; import { errorApiRef } from '@backstage/core-plugin-api'; -import { useCopyToClipboard } from 'react-use'; +import useCopyToClipboard from 'react-use/lib/useCopyToClipboard'; jest.mock('popper.js', () => { const PopperJS = jest.requireActual('popper.js'); @@ -32,14 +32,12 @@ jest.mock('popper.js', () => { }; }); -jest.mock('react-use', () => { - const original = jest.requireActual('react-use'); +jest.mock('react-use/lib/useCopyToClipboard', () => { + const original = jest.requireActual('react-use/lib/useCopyToClipboard'); return { - ...original, - useCopyToClipboard: jest - .fn() - .mockImplementation(original.useCopyToClipboard), + __esModule: true, + default: jest.fn().mockImplementation(original.default), }; }); diff --git a/packages/core-components/src/components/CopyTextButton/CopyTextButton.tsx b/packages/core-components/src/components/CopyTextButton/CopyTextButton.tsx index fdf0868197..670c21f10c 100644 --- a/packages/core-components/src/components/CopyTextButton/CopyTextButton.tsx +++ b/packages/core-components/src/components/CopyTextButton/CopyTextButton.tsx @@ -19,7 +19,7 @@ import IconButton from '@material-ui/core/IconButton'; import Tooltip from '@material-ui/core/Tooltip'; import CopyIcon from '@material-ui/icons/FileCopy'; import React, { MouseEventHandler, useEffect, useState } from 'react'; -import { useCopyToClipboard } from 'react-use'; +import useCopyToClipboard from 'react-use/lib/useCopyToClipboard'; /** * Properties for {@link CopyTextButton} diff --git a/packages/core-components/src/components/DismissableBanner/DismissableBanner.tsx b/packages/core-components/src/components/DismissableBanner/DismissableBanner.tsx index 92b449f705..566b326cb5 100644 --- a/packages/core-components/src/components/DismissableBanner/DismissableBanner.tsx +++ b/packages/core-components/src/components/DismissableBanner/DismissableBanner.tsx @@ -16,7 +16,7 @@ import React, { ReactNode, useState, useEffect } from 'react'; import { useApi, storageApiRef } from '@backstage/core-plugin-api'; -import { useObservable } from 'react-use'; +import useObservable from 'react-use/lib/useObservable'; import classNames from 'classnames'; import { makeStyles } from '@material-ui/core/styles'; import { BackstageTheme } from '@backstage/theme'; diff --git a/packages/core-components/src/components/LogViewer/useLogViewerSearch.tsx b/packages/core-components/src/components/LogViewer/useLogViewerSearch.tsx index 4462a3ff50..7f0069bc44 100644 --- a/packages/core-components/src/components/LogViewer/useLogViewerSearch.tsx +++ b/packages/core-components/src/components/LogViewer/useLogViewerSearch.tsx @@ -15,7 +15,7 @@ */ import { useMemo, useState } from 'react'; -import { useToggle } from 'react-use'; +import useToggle from 'react-use/lib/useToggle'; import { AnsiLine } from './AnsiProcessor'; export function applySearchFilter(lines: AnsiLine[], searchText: string) { diff --git a/packages/core-components/src/components/LogViewer/useLogViewerSelection.tsx b/packages/core-components/src/components/LogViewer/useLogViewerSelection.tsx index a41f5e7159..f73bf22d5e 100644 --- a/packages/core-components/src/components/LogViewer/useLogViewerSelection.tsx +++ b/packages/core-components/src/components/LogViewer/useLogViewerSelection.tsx @@ -16,7 +16,7 @@ import { errorApiRef, useApi } from '@backstage/core-plugin-api'; import { useEffect, useState } from 'react'; -import { useCopyToClipboard } from 'react-use'; +import useCopyToClipboard from 'react-use/lib/useCopyToClipboard'; import { AnsiLine } from './AnsiProcessor'; export function useLogViewerSelection(lines: AnsiLine[]) { diff --git a/packages/core-components/src/components/OAuthRequestDialog/OAuthRequestDialog.tsx b/packages/core-components/src/components/OAuthRequestDialog/OAuthRequestDialog.tsx index 5378fa6c15..b11821803a 100644 --- a/packages/core-components/src/components/OAuthRequestDialog/OAuthRequestDialog.tsx +++ b/packages/core-components/src/components/OAuthRequestDialog/OAuthRequestDialog.tsx @@ -22,7 +22,7 @@ import DialogTitle from '@material-ui/core/DialogTitle'; import List from '@material-ui/core/List'; import Button from '@material-ui/core/Button'; import React, { useMemo, useState } from 'react'; -import { useObservable } from 'react-use'; +import useObservable from 'react-use/lib/useObservable'; import LoginRequestListItem from './LoginRequestListItem'; import { useApi, oauthRequestApiRef } from '@backstage/core-plugin-api'; diff --git a/packages/core-components/src/components/OverflowTooltip/OverflowTooltip.tsx b/packages/core-components/src/components/OverflowTooltip/OverflowTooltip.tsx index d0aebb4462..69952d487a 100644 --- a/packages/core-components/src/components/OverflowTooltip/OverflowTooltip.tsx +++ b/packages/core-components/src/components/OverflowTooltip/OverflowTooltip.tsx @@ -18,7 +18,7 @@ import { makeStyles } from '@material-ui/core/styles'; import Tooltip, { TooltipProps } from '@material-ui/core/Tooltip'; import React, { useState } from 'react'; import TextTruncate, { TextTruncateProps } from 'react-text-truncate'; -import { useMountedState } from 'react-use'; +import useMountedState from 'react-use/lib/useMountedState'; type Props = { text: TextTruncateProps['text']; diff --git a/packages/core-components/src/components/Tabs/Tabs.tsx b/packages/core-components/src/components/Tabs/Tabs.tsx index 31bf1d2027..1d08f24bb0 100644 --- a/packages/core-components/src/components/Tabs/Tabs.tsx +++ b/packages/core-components/src/components/Tabs/Tabs.tsx @@ -21,7 +21,7 @@ import { makeStyles } from '@material-ui/core/styles'; import NavigateBeforeIcon from '@material-ui/icons/NavigateBefore'; import NavigateNextIcon from '@material-ui/icons/NavigateNext'; import { chunkArray } from './utils'; -import { useWindowSize } from 'react-use'; +import useWindowSize from 'react-use/lib/useWindowSize'; /* Import Components */ diff --git a/packages/core-components/src/hooks/useQueryParamState.ts b/packages/core-components/src/hooks/useQueryParamState.ts index 57fcdc22c0..72ccafd99f 100644 --- a/packages/core-components/src/hooks/useQueryParamState.ts +++ b/packages/core-components/src/hooks/useQueryParamState.ts @@ -18,7 +18,7 @@ import { isEqual } from 'lodash'; import qs from 'qs'; import { useEffect, useState } from 'react'; import { useSearchParams } from 'react-router-dom'; -import { useDebounce } from 'react-use'; +import useDebounce from 'react-use/lib/useDebounce'; function stringify(queryParams: any): string { // Even though these setting don't look nice (e.g. escaped brackets), we should keep diff --git a/packages/core-components/src/layout/Sidebar/Intro.tsx b/packages/core-components/src/layout/Sidebar/Intro.tsx index 511a51fd9c..7b2c5fa4d7 100644 --- a/packages/core-components/src/layout/Sidebar/Intro.tsx +++ b/packages/core-components/src/layout/Sidebar/Intro.tsx @@ -21,7 +21,7 @@ import { makeStyles } from '@material-ui/core/styles'; import Typography from '@material-ui/core/Typography'; import CloseIcon from '@material-ui/icons/Close'; import React, { useContext, useState } from 'react'; -import { useLocalStorage } from 'react-use'; +import useLocalStorage from 'react-use/lib/useLocalStorage'; import { sidebarConfig, SidebarContext, diff --git a/packages/core-components/src/layout/SignInPage/SignInPage.tsx b/packages/core-components/src/layout/SignInPage/SignInPage.tsx index 304e427f33..2eac16cbf4 100644 --- a/packages/core-components/src/layout/SignInPage/SignInPage.tsx +++ b/packages/core-components/src/layout/SignInPage/SignInPage.tsx @@ -25,7 +25,7 @@ import Button from '@material-ui/core/Button'; import Grid from '@material-ui/core/Grid'; import Typography from '@material-ui/core/Typography'; import React, { useState } from 'react'; -import { useMount } from 'react-use'; +import useMount from 'react-use/lib/useMount'; import { Progress } from '../../components/Progress'; import { Content } from '../Content/Content'; import { ContentHeader } from '../ContentHeader/ContentHeader'; diff --git a/packages/dev-utils/src/devApp/SidebarThemeSwitcher.tsx b/packages/dev-utils/src/devApp/SidebarThemeSwitcher.tsx index e13554bbf7..585fef2db4 100644 --- a/packages/dev-utils/src/devApp/SidebarThemeSwitcher.tsx +++ b/packages/dev-utils/src/devApp/SidebarThemeSwitcher.tsx @@ -18,7 +18,7 @@ import { appThemeApiRef, useApi } from '@backstage/core-plugin-api'; import { ListItemIcon, ListItemText, Menu, MenuItem } from '@material-ui/core'; import AutoIcon from '@material-ui/icons/BrightnessAuto'; import React, { cloneElement, useCallback, useState } from 'react'; -import { useObservable } from 'react-use'; +import useObservable from 'react-use/lib/useObservable'; type ThemeIconProps = { active?: boolean; diff --git a/plugins/allure/src/components/AllureReportComponent/AllureReportComponent.tsx b/plugins/allure/src/components/AllureReportComponent/AllureReportComponent.tsx index 2ca3e87691..e7564dd097 100644 --- a/plugins/allure/src/components/AllureReportComponent/AllureReportComponent.tsx +++ b/plugins/allure/src/components/AllureReportComponent/AllureReportComponent.tsx @@ -26,7 +26,7 @@ import { MissingAnnotationEmptyState, Progress, } from '@backstage/core-components'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { Entity } from '@backstage/catalog-model'; const AllureReport = (props: { entity: Entity }) => { diff --git a/plugins/apache-airflow/src/components/DagTableComponent/DagTableComponent.tsx b/plugins/apache-airflow/src/components/DagTableComponent/DagTableComponent.tsx index 13122ca552..cf343a596e 100644 --- a/plugins/apache-airflow/src/components/DagTableComponent/DagTableComponent.tsx +++ b/plugins/apache-airflow/src/components/DagTableComponent/DagTableComponent.tsx @@ -31,7 +31,7 @@ import Typography from '@material-ui/core/Typography'; import OpenInBrowserIcon from '@material-ui/icons/OpenInBrowser'; import Alert from '@material-ui/lab/Alert'; import React from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { apacheAirflowApiRef } from '../../api'; import { Dag } from '../../api/types'; import { ScheduleIntervalLabel } from '../ScheduleIntervalLabel'; diff --git a/plugins/apache-airflow/src/components/StatusComponent/StatusComponent.tsx b/plugins/apache-airflow/src/components/StatusComponent/StatusComponent.tsx index 326be4b450..4d3f3258c8 100644 --- a/plugins/apache-airflow/src/components/StatusComponent/StatusComponent.tsx +++ b/plugins/apache-airflow/src/components/StatusComponent/StatusComponent.tsx @@ -22,7 +22,7 @@ import { import { useApi } from '@backstage/core-plugin-api'; import Alert from '@material-ui/lab/Alert'; import React from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { apacheAirflowApiRef } from '../../api'; import { InstanceStatus } from '../../api/types'; diff --git a/plugins/apache-airflow/src/components/VersionComponent/VersionComponent.tsx b/plugins/apache-airflow/src/components/VersionComponent/VersionComponent.tsx index 482d1ff0a7..c82f0ee43e 100644 --- a/plugins/apache-airflow/src/components/VersionComponent/VersionComponent.tsx +++ b/plugins/apache-airflow/src/components/VersionComponent/VersionComponent.tsx @@ -22,7 +22,7 @@ import { import { useApi } from '@backstage/core-plugin-api'; import Alert from '@material-ui/lab/Alert'; import React from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { apacheAirflowApiRef } from '../../api'; import { InstanceVersion } from '../../api/types'; diff --git a/plugins/azure-devops/src/hooks/useAllTeams.ts b/plugins/azure-devops/src/hooks/useAllTeams.ts index d32aa5e136..03885e4999 100644 --- a/plugins/azure-devops/src/hooks/useAllTeams.ts +++ b/plugins/azure-devops/src/hooks/useAllTeams.ts @@ -17,7 +17,7 @@ import { Team } from '@backstage/plugin-azure-devops-common'; import { azureDevOpsApiRef } from '../api'; import { useApi } from '@backstage/core-plugin-api'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; export function useAllTeams(): { teams?: Team[]; diff --git a/plugins/azure-devops/src/hooks/useDashboardPullRequests.ts b/plugins/azure-devops/src/hooks/useDashboardPullRequests.ts index 1b2333ba1c..95c97b002e 100644 --- a/plugins/azure-devops/src/hooks/useDashboardPullRequests.ts +++ b/plugins/azure-devops/src/hooks/useDashboardPullRequests.ts @@ -15,7 +15,8 @@ */ import { errorApiRef, useApi } from '@backstage/core-plugin-api'; -import { useAsyncRetry, useInterval } from 'react-use'; +import useAsyncRetry from 'react-use/lib/useAsyncRetry'; +import useInterval from 'react-use/lib/useInterval'; import { DashboardPullRequest } from '@backstage/plugin-azure-devops-common'; import { azureDevOpsApiRef } from '../api'; diff --git a/plugins/azure-devops/src/hooks/usePullRequests.ts b/plugins/azure-devops/src/hooks/usePullRequests.ts index 178bf0495f..9ddca9650b 100644 --- a/plugins/azure-devops/src/hooks/usePullRequests.ts +++ b/plugins/azure-devops/src/hooks/usePullRequests.ts @@ -24,7 +24,7 @@ import { AZURE_DEVOPS_DEFAULT_TOP } from '../constants'; import { Entity } from '@backstage/catalog-model'; import { azureDevOpsApiRef } from '../api'; import { useApi } from '@backstage/core-plugin-api'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { useProjectRepoFromEntity } from './useProjectRepoFromEntity'; export function usePullRequests( diff --git a/plugins/azure-devops/src/hooks/useRepoBuilds.ts b/plugins/azure-devops/src/hooks/useRepoBuilds.ts index af2d181c34..e0fe8c2093 100644 --- a/plugins/azure-devops/src/hooks/useRepoBuilds.ts +++ b/plugins/azure-devops/src/hooks/useRepoBuilds.ts @@ -23,7 +23,7 @@ import { AZURE_DEVOPS_DEFAULT_TOP } from '../constants'; import { Entity } from '@backstage/catalog-model'; import { azureDevOpsApiRef } from '../api'; import { useApi } from '@backstage/core-plugin-api'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { useProjectRepoFromEntity } from './useProjectRepoFromEntity'; export function useRepoBuilds( diff --git a/plugins/badges/src/components/EntityBadgesDialog.tsx b/plugins/badges/src/components/EntityBadgesDialog.tsx index 75caca2d9d..1ae5f69326 100644 --- a/plugins/badges/src/components/EntityBadgesDialog.tsx +++ b/plugins/badges/src/components/EntityBadgesDialog.tsx @@ -27,7 +27,7 @@ import { useTheme, } from '@material-ui/core'; import React from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { badgesApiRef } from '../api'; import { diff --git a/plugins/bazaar/src/components/EntityBazaarInfoCard/EntityBazaarInfoCard.tsx b/plugins/bazaar/src/components/EntityBazaarInfoCard/EntityBazaarInfoCard.tsx index 685d400d3e..5007dbdc89 100644 --- a/plugins/bazaar/src/components/EntityBazaarInfoCard/EntityBazaarInfoCard.tsx +++ b/plugins/bazaar/src/components/EntityBazaarInfoCard/EntityBazaarInfoCard.tsx @@ -15,7 +15,7 @@ */ import React, { useState, useEffect } from 'react'; -import { useAsyncFn } from 'react-use'; +import useAsyncFn from 'react-use/lib/useAsyncFn'; import { useApi } from '@backstage/core-plugin-api'; import { stringifyEntityRef } from '@backstage/catalog-model'; import { useEntity } from '@backstage/plugin-catalog-react'; diff --git a/plugins/bazaar/src/components/EntityBazaarInfoContent/EntityBazaarInfoContent.tsx b/plugins/bazaar/src/components/EntityBazaarInfoContent/EntityBazaarInfoContent.tsx index f2c005abd1..470dc824b6 100644 --- a/plugins/bazaar/src/components/EntityBazaarInfoContent/EntityBazaarInfoContent.tsx +++ b/plugins/bazaar/src/components/EntityBazaarInfoContent/EntityBazaarInfoContent.tsx @@ -30,7 +30,7 @@ import { useApi, identityApiRef } from '@backstage/core-plugin-api'; import { BazaarProject, Member } from '../../types'; import { bazaarApiRef } from '../../api'; import { Alert } from '@material-ui/lab'; -import { useAsyncFn } from 'react-use'; +import useAsyncFn from 'react-use/lib/useAsyncFn'; import ExitToAppIcon from '@material-ui/icons/ExitToApp'; import { parseEntityRef } from '@backstage/catalog-model'; import { ConfirmationDialog } from '../ConfirmationDialog'; diff --git a/plugins/bazaar/src/components/HomePageBazaarInfoCard/HomePageBazaarInfoCard.tsx b/plugins/bazaar/src/components/HomePageBazaarInfoCard/HomePageBazaarInfoCard.tsx index daca0aec1d..05fadc6709 100644 --- a/plugins/bazaar/src/components/HomePageBazaarInfoCard/HomePageBazaarInfoCard.tsx +++ b/plugins/bazaar/src/components/HomePageBazaarInfoCard/HomePageBazaarInfoCard.tsx @@ -37,7 +37,7 @@ import { import { Member, BazaarProject } from '../../types'; import { bazaarApiRef } from '../../api'; import { Alert } from '@material-ui/lab'; -import { useAsyncFn } from 'react-use'; +import useAsyncFn from 'react-use/lib/useAsyncFn'; import { catalogApiRef, catalogRouteRef, diff --git a/plugins/bazaar/src/components/SortView/SortView.tsx b/plugins/bazaar/src/components/SortView/SortView.tsx index e42c51784b..a7f99625e5 100644 --- a/plugins/bazaar/src/components/SortView/SortView.tsx +++ b/plugins/bazaar/src/components/SortView/SortView.tsx @@ -19,7 +19,7 @@ import { Content, SupportButton } from '@backstage/core-components'; import { AddProjectDialog } from '../AddProjectDialog'; import { ProjectPreview } from '../ProjectPreview/ProjectPreview'; import { Button, makeStyles } from '@material-ui/core'; -import { useAsyncFn } from 'react-use'; +import useAsyncFn from 'react-use/lib/useAsyncFn'; import { Entity, stringifyEntityRef } from '@backstage/catalog-model'; import { useApi } from '@backstage/core-plugin-api'; import { catalogApiRef } from '@backstage/plugin-catalog-react'; diff --git a/plugins/bitrise/src/components/useBitriseArtifactDetails.ts b/plugins/bitrise/src/components/useBitriseArtifactDetails.ts index 3370f3c600..e00c8cc8e7 100644 --- a/plugins/bitrise/src/components/useBitriseArtifactDetails.ts +++ b/plugins/bitrise/src/components/useBitriseArtifactDetails.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { BitriseBuildArtifactDetails } from '../api/bitriseApi.model'; import { bitriseApiRef } from '../plugin'; import { useApi } from '@backstage/core-plugin-api'; diff --git a/plugins/bitrise/src/components/useBitriseArtifacts.ts b/plugins/bitrise/src/components/useBitriseArtifacts.ts index 16f03c5805..0f7423c921 100644 --- a/plugins/bitrise/src/components/useBitriseArtifacts.ts +++ b/plugins/bitrise/src/components/useBitriseArtifacts.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { BitriseBuildArtifact } from '../api/bitriseApi.model'; import { bitriseApiRef } from '../plugin'; import { useApi } from '@backstage/core-plugin-api'; diff --git a/plugins/bitrise/src/hooks/useBitriseBuildWorkflows.ts b/plugins/bitrise/src/hooks/useBitriseBuildWorkflows.ts index fe56dc5480..122968d6ea 100644 --- a/plugins/bitrise/src/hooks/useBitriseBuildWorkflows.ts +++ b/plugins/bitrise/src/hooks/useBitriseBuildWorkflows.ts @@ -14,9 +14,8 @@ * limitations under the License. */ -import { useAsync } from 'react-use'; +import useAsync, { AsyncState } from 'react-use/lib/useAsync'; import { bitriseApiRef } from '../plugin'; -import { AsyncState } from 'react-use/lib/useAsync'; import { BitriseApp } from '../api/bitriseApi.model'; import { useApi } from '@backstage/core-plugin-api'; diff --git a/plugins/bitrise/src/hooks/useBitriseBuilds.ts b/plugins/bitrise/src/hooks/useBitriseBuilds.ts index a13b2db25f..13869c27a0 100644 --- a/plugins/bitrise/src/hooks/useBitriseBuilds.ts +++ b/plugins/bitrise/src/hooks/useBitriseBuilds.ts @@ -14,14 +14,13 @@ * limitations under the License. */ -import { useAsync } from 'react-use'; +import useAsync, { AsyncState } from 'react-use/lib/useAsync'; import { BitriseApp, BitriseBuildListResponse, BitriseQueryParams, } from '../api/bitriseApi.model'; import { bitriseApiRef } from '../plugin'; -import { AsyncState } from 'react-use/lib/useAsync'; import { useApi } from '@backstage/core-plugin-api'; export const useBitriseBuilds = ( diff --git a/plugins/catalog-graph/src/components/CatalogGraphPage/useCatalogGraphPage.ts b/plugins/catalog-graph/src/components/CatalogGraphPage/useCatalogGraphPage.ts index e802a672c6..198cbd397f 100644 --- a/plugins/catalog-graph/src/components/CatalogGraphPage/useCatalogGraphPage.ts +++ b/plugins/catalog-graph/src/components/CatalogGraphPage/useCatalogGraphPage.ts @@ -28,7 +28,7 @@ import { useState, } from 'react'; import { useLocation } from 'react-router'; -import { usePrevious } from 'react-use'; +import usePrevious from 'react-use/lib/usePrevious'; import { Direction } from '../EntityRelationsGraph'; export type CatalogGraphPageValue = { diff --git a/plugins/catalog-graph/src/components/EntityRelationsGraph/useEntityRelationNodesAndEdges.ts b/plugins/catalog-graph/src/components/EntityRelationsGraph/useEntityRelationNodesAndEdges.ts index 4fc00c5353..2f78fd9c17 100644 --- a/plugins/catalog-graph/src/components/EntityRelationsGraph/useEntityRelationNodesAndEdges.ts +++ b/plugins/catalog-graph/src/components/EntityRelationsGraph/useEntityRelationNodesAndEdges.ts @@ -18,7 +18,7 @@ import { stringifyEntityRef, } from '@backstage/catalog-model'; import { MouseEvent, useState } from 'react'; -import { useDebounce } from 'react-use'; +import useDebounce from 'react-use/lib/useDebounce'; import { RelationPairs, ALL_RELATION_PAIRS } from './relations'; import { EntityEdge, EntityNode } from './types'; import { useEntityRelationGraph } from './useEntityRelationGraph'; diff --git a/plugins/catalog-graph/src/components/EntityRelationsGraph/useEntityStore.ts b/plugins/catalog-graph/src/components/EntityRelationsGraph/useEntityStore.ts index 476c10b84f..b5ec3bef19 100644 --- a/plugins/catalog-graph/src/components/EntityRelationsGraph/useEntityStore.ts +++ b/plugins/catalog-graph/src/components/EntityRelationsGraph/useEntityStore.ts @@ -18,7 +18,7 @@ import { useApi } from '@backstage/core-plugin-api'; import { catalogApiRef } from '@backstage/plugin-catalog-react'; import limiterFactory from 'p-limit'; import { Dispatch, useCallback, useRef, useState } from 'react'; -import { useAsyncFn } from 'react-use'; +import useAsyncFn from 'react-use/lib/useAsyncFn'; // TODO: This is a good use case for a graphql API, once it is available in the // future. diff --git a/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/StepPrepareCreatePullRequest.tsx b/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/StepPrepareCreatePullRequest.tsx index f441554119..077d99c4ba 100644 --- a/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/StepPrepareCreatePullRequest.tsx +++ b/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/StepPrepareCreatePullRequest.tsx @@ -25,7 +25,7 @@ import { Box, FormHelperText, Grid, Typography } from '@material-ui/core'; import { makeStyles } from '@material-ui/core/styles'; import React, { useCallback, useEffect, useState } from 'react'; import { UnpackNestedValue, UseFormReturn } from 'react-hook-form'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import YAML from 'yaml'; import { AnalyzeResult, catalogImportApiRef } from '../../api'; import { PartialEntity } from '../../types'; diff --git a/plugins/catalog-react/src/components/EntitySearchBar/EntitySearchBar.tsx b/plugins/catalog-react/src/components/EntitySearchBar/EntitySearchBar.tsx index 3a848591a3..1f577c43e6 100644 --- a/plugins/catalog-react/src/components/EntitySearchBar/EntitySearchBar.tsx +++ b/plugins/catalog-react/src/components/EntitySearchBar/EntitySearchBar.tsx @@ -25,7 +25,7 @@ import { import Clear from '@material-ui/icons/Clear'; import Search from '@material-ui/icons/Search'; import React, { useState } from 'react'; -import { useDebounce } from 'react-use'; +import useDebounce from 'react-use/lib/useDebounce'; import { useEntityListProvider } from '../../hooks/useEntityListProvider'; import { EntityTextFilter } from '../../filters'; diff --git a/plugins/catalog-react/src/components/UnregisterEntityDialog/useUnregisterEntityDialogState.ts b/plugins/catalog-react/src/components/UnregisterEntityDialog/useUnregisterEntityDialogState.ts index ae0a323d36..7f75016e16 100644 --- a/plugins/catalog-react/src/components/UnregisterEntityDialog/useUnregisterEntityDialogState.ts +++ b/plugins/catalog-react/src/components/UnregisterEntityDialog/useUnregisterEntityDialogState.ts @@ -22,7 +22,7 @@ import { } from '@backstage/catalog-model'; import { catalogApiRef } from '../../api'; import { useCallback } from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { useApi } from '@backstage/core-plugin-api'; /** diff --git a/plugins/catalog-react/src/hooks/useEntity.tsx b/plugins/catalog-react/src/hooks/useEntity.tsx index bcb38bb807..6ad61a5d81 100644 --- a/plugins/catalog-react/src/hooks/useEntity.tsx +++ b/plugins/catalog-react/src/hooks/useEntity.tsx @@ -28,7 +28,7 @@ import React, { Context, } from 'react'; import { useNavigate } from 'react-router'; -import { useAsyncRetry } from 'react-use'; +import useAsyncRetry from 'react-use/lib/useAsyncRetry'; import { catalogApiRef } from '../api'; import { useEntityCompoundName } from './useEntityCompoundName'; diff --git a/plugins/catalog-react/src/hooks/useEntityKinds.ts b/plugins/catalog-react/src/hooks/useEntityKinds.ts index 082e4a207d..1d5b2fec52 100644 --- a/plugins/catalog-react/src/hooks/useEntityKinds.ts +++ b/plugins/catalog-react/src/hooks/useEntityKinds.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { useApi } from '@backstage/core-plugin-api'; import { catalogApiRef } from '../api'; diff --git a/plugins/catalog-react/src/hooks/useEntityListProvider.tsx b/plugins/catalog-react/src/hooks/useEntityListProvider.tsx index a4e5f6b2ee..fb8eb7279f 100644 --- a/plugins/catalog-react/src/hooks/useEntityListProvider.tsx +++ b/plugins/catalog-react/src/hooks/useEntityListProvider.tsx @@ -25,7 +25,9 @@ import React, { useMemo, useState, } from 'react'; -import { useAsyncFn, useDebounce, useMountedState } from 'react-use'; +import useAsyncFn from 'react-use/lib/useAsyncFn'; +import useDebounce from 'react-use/lib/useDebounce'; +import useMountedState from 'react-use/lib/useMountedState'; import { catalogApiRef } from '../api'; import { EntityKindFilter, diff --git a/plugins/catalog-react/src/hooks/useEntityOwnership.ts b/plugins/catalog-react/src/hooks/useEntityOwnership.ts index 54e9e0ff99..672b41cf33 100644 --- a/plugins/catalog-react/src/hooks/useEntityOwnership.ts +++ b/plugins/catalog-react/src/hooks/useEntityOwnership.ts @@ -30,7 +30,7 @@ import { } from '@backstage/core-plugin-api'; import jwtDecoder from 'jwt-decode'; import { useMemo } from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { catalogApiRef } from '../api'; import { getEntityRelations } from '../utils/getEntityRelations'; diff --git a/plugins/catalog-react/src/hooks/useEntityTypeFilter.tsx b/plugins/catalog-react/src/hooks/useEntityTypeFilter.tsx index bf5777becc..5c0139dd26 100644 --- a/plugins/catalog-react/src/hooks/useEntityTypeFilter.tsx +++ b/plugins/catalog-react/src/hooks/useEntityTypeFilter.tsx @@ -15,7 +15,7 @@ */ import { useEffect, useMemo, useRef, useState } from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import isEqual from 'lodash/isEqual'; import { useApi } from '@backstage/core-plugin-api'; import { catalogApiRef } from '../api'; diff --git a/plugins/catalog-react/src/hooks/useOwnUser.ts b/plugins/catalog-react/src/hooks/useOwnUser.ts index f630549b0d..3df51f885f 100644 --- a/plugins/catalog-react/src/hooks/useOwnUser.ts +++ b/plugins/catalog-react/src/hooks/useOwnUser.ts @@ -15,8 +15,7 @@ */ import { UserEntity } from '@backstage/catalog-model'; -import { useAsync } from 'react-use'; -import { AsyncState } from 'react-use/lib/useAsync'; +import useAsync, { AsyncState } from 'react-use/lib/useAsync'; import { catalogApiRef } from '../api'; import { identityApiRef, useApi } from '@backstage/core-plugin-api'; diff --git a/plugins/catalog-react/src/hooks/useOwnedEntities.ts b/plugins/catalog-react/src/hooks/useOwnedEntities.ts index f9191364cb..ffe64830f4 100644 --- a/plugins/catalog-react/src/hooks/useOwnedEntities.ts +++ b/plugins/catalog-react/src/hooks/useOwnedEntities.ts @@ -21,7 +21,7 @@ import { import { identityApiRef, useApi } from '@backstage/core-plugin-api'; import { Entity, RELATION_OWNED_BY } from '@backstage/catalog-model'; import { CatalogListResponse } from '@backstage/catalog-client'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { useMemo } from 'react'; /** diff --git a/plugins/catalog-react/src/hooks/useRelatedEntities.ts b/plugins/catalog-react/src/hooks/useRelatedEntities.ts index d15211f158..942941e3d5 100644 --- a/plugins/catalog-react/src/hooks/useRelatedEntities.ts +++ b/plugins/catalog-react/src/hooks/useRelatedEntities.ts @@ -16,7 +16,7 @@ import { Entity, EntityRelation } from '@backstage/catalog-model'; import { useApi } from '@backstage/core-plugin-api'; import { chunk, groupBy } from 'lodash'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { catalogApiRef } from '../api'; const BATCH_SIZE = 20; diff --git a/plugins/catalog-react/src/hooks/useStarredEntities.ts b/plugins/catalog-react/src/hooks/useStarredEntities.ts index 8f6b09614f..066040bf02 100644 --- a/plugins/catalog-react/src/hooks/useStarredEntities.ts +++ b/plugins/catalog-react/src/hooks/useStarredEntities.ts @@ -21,7 +21,7 @@ import { } from '@backstage/catalog-model'; import { useApi } from '@backstage/core-plugin-api'; import { useCallback } from 'react'; -import { useObservable } from 'react-use'; +import useObservable from 'react-use/lib/useObservable'; import { starredEntitiesApiRef } from '../apis'; function getEntityRef(entityOrRef: Entity | EntityName | string): string { diff --git a/plugins/catalog/src/components/EntityProcessingErrorsPanel/EntityProcessingErrorsPanel.tsx b/plugins/catalog/src/components/EntityProcessingErrorsPanel/EntityProcessingErrorsPanel.tsx index 0efc9d5b03..8469c7d4e4 100644 --- a/plugins/catalog/src/components/EntityProcessingErrorsPanel/EntityProcessingErrorsPanel.tsx +++ b/plugins/catalog/src/components/EntityProcessingErrorsPanel/EntityProcessingErrorsPanel.tsx @@ -33,7 +33,7 @@ import { ENTITY_STATUS_CATALOG_PROCESSING_TYPE, } from '@backstage/catalog-client'; import { useApi, ApiHolder } from '@backstage/core-plugin-api'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { SerializedError } from '@backstage/errors'; const errorFilter = (i: UNSTABLE_EntityStatusItem) => diff --git a/plugins/catalog/src/components/EntitySwitch/EntitySwitch.tsx b/plugins/catalog/src/components/EntitySwitch/EntitySwitch.tsx index 5c50c2507c..87ee81c5f4 100644 --- a/plugins/catalog/src/components/EntitySwitch/EntitySwitch.tsx +++ b/plugins/catalog/src/components/EntitySwitch/EntitySwitch.tsx @@ -23,7 +23,7 @@ import { useElementFilter, ApiHolder, } from '@backstage/core-plugin-api'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; const ENTITY_SWITCH_KEY = 'core.backstage.entitySwitch'; diff --git a/plugins/catalog/src/components/SystemDiagramCard/SystemDiagramCard.tsx b/plugins/catalog/src/components/SystemDiagramCard/SystemDiagramCard.tsx index 984ae9f982..6c17e4ee67 100644 --- a/plugins/catalog/src/components/SystemDiagramCard/SystemDiagramCard.tsx +++ b/plugins/catalog/src/components/SystemDiagramCard/SystemDiagramCard.tsx @@ -32,7 +32,7 @@ import { import { Box, makeStyles, Typography, useTheme } from '@material-ui/core'; import ZoomOutMap from '@material-ui/icons/ZoomOutMap'; import React from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { BackstageTheme } from '@backstage/theme'; import { diff --git a/plugins/circleci/src/state/useBuildWithSteps.ts b/plugins/circleci/src/state/useBuildWithSteps.ts index eb3c0c1506..4ba189f9d2 100644 --- a/plugins/circleci/src/state/useBuildWithSteps.ts +++ b/plugins/circleci/src/state/useBuildWithSteps.ts @@ -14,7 +14,7 @@ * limitations under the License. */ import { useCallback, useMemo } from 'react'; -import { useAsyncRetry } from 'react-use'; +import useAsyncRetry from 'react-use/lib/useAsyncRetry'; import { circleCIApiRef } from '../api'; import { useAsyncPolling } from './useAsyncPolling'; import { useProjectSlugFromEntity, mapVcsType } from './useBuilds'; diff --git a/plugins/circleci/src/state/useBuilds.ts b/plugins/circleci/src/state/useBuilds.ts index 521a55e922..760c57d764 100644 --- a/plugins/circleci/src/state/useBuilds.ts +++ b/plugins/circleci/src/state/useBuilds.ts @@ -18,7 +18,7 @@ import { useEntity } from '@backstage/plugin-catalog-react'; import { BuildSummary, GitType } from 'circleci-api'; import { getOr } from 'lodash/fp'; import { useCallback, useEffect, useState } from 'react'; -import { useAsyncRetry } from 'react-use'; +import useAsyncRetry from 'react-use/lib/useAsyncRetry'; import { circleCIApiRef } from '../api'; import type { CITableBuildInfo } from '../components/BuildsPage/lib/CITable'; import { CIRCLECI_ANNOTATION } from '../constants'; diff --git a/plugins/cloudbuild/src/components/WorkflowRunDetails/useWorkflowRunJobs.ts b/plugins/cloudbuild/src/components/WorkflowRunDetails/useWorkflowRunJobs.ts index 0450d3d613..7b7ee2f407 100644 --- a/plugins/cloudbuild/src/components/WorkflowRunDetails/useWorkflowRunJobs.ts +++ b/plugins/cloudbuild/src/components/WorkflowRunDetails/useWorkflowRunJobs.ts @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { ActionsListWorkflowRunsForRepoResponseData } from '../../api/types'; export const useWorkflowRunJobs = (jobsUrl?: string) => { diff --git a/plugins/cloudbuild/src/components/WorkflowRunDetails/useWorkflowRunsDetails.ts b/plugins/cloudbuild/src/components/WorkflowRunDetails/useWorkflowRunsDetails.ts index c074a24a86..0b244f8b69 100644 --- a/plugins/cloudbuild/src/components/WorkflowRunDetails/useWorkflowRunsDetails.ts +++ b/plugins/cloudbuild/src/components/WorkflowRunDetails/useWorkflowRunsDetails.ts @@ -14,7 +14,7 @@ * limitations under the License. */ import { useParams } from 'react-router-dom'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { cloudbuildApiRef } from '../../api'; import { useApi } from '@backstage/core-plugin-api'; diff --git a/plugins/cloudbuild/src/components/useProjectName.ts b/plugins/cloudbuild/src/components/useProjectName.ts index a0d19ba7dd..3f314aaa47 100644 --- a/plugins/cloudbuild/src/components/useProjectName.ts +++ b/plugins/cloudbuild/src/components/useProjectName.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { Entity } from '@backstage/catalog-model'; export const CLOUDBUILD_ANNOTATION = 'google.com/cloudbuild-project-slug'; diff --git a/plugins/cloudbuild/src/components/useWorkflowRuns.ts b/plugins/cloudbuild/src/components/useWorkflowRuns.ts index 3c4810d4f6..f2e107ea3f 100644 --- a/plugins/cloudbuild/src/components/useWorkflowRuns.ts +++ b/plugins/cloudbuild/src/components/useWorkflowRuns.ts @@ -14,7 +14,7 @@ * limitations under the License. */ import { useState } from 'react'; -import { useAsyncRetry } from 'react-use'; +import useAsyncRetry from 'react-use/lib/useAsyncRetry'; import { cloudbuildApiRef } from '../api/CloudbuildApi'; import { ActionsListWorkflowRunsForRepoResponseData, diff --git a/plugins/code-coverage/src/components/CoverageHistoryChart/CoverageHistoryChart.tsx b/plugins/code-coverage/src/components/CoverageHistoryChart/CoverageHistoryChart.tsx index e713eb7c6e..1e5341eb50 100644 --- a/plugins/code-coverage/src/components/CoverageHistoryChart/CoverageHistoryChart.tsx +++ b/plugins/code-coverage/src/components/CoverageHistoryChart/CoverageHistoryChart.tsx @@ -30,7 +30,7 @@ import TrendingUpIcon from '@material-ui/icons/TrendingUp'; import { Alert } from '@material-ui/lab'; import { ClassNameMap } from '@material-ui/styles'; import React from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { CartesianGrid, Legend, diff --git a/plugins/code-coverage/src/components/FileExplorer/FileContent.tsx b/plugins/code-coverage/src/components/FileExplorer/FileContent.tsx index 06dbd19999..ac132c5a56 100644 --- a/plugins/code-coverage/src/components/FileExplorer/FileContent.tsx +++ b/plugins/code-coverage/src/components/FileExplorer/FileContent.tsx @@ -18,7 +18,7 @@ import { useEntity } from '@backstage/plugin-catalog-react'; import { makeStyles, Paper } from '@material-ui/core'; import { Alert } from '@material-ui/lab'; import React from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { codeCoverageApiRef } from '../../api'; import { FileEntry } from '../../types'; import { CodeRow } from './CodeRow'; diff --git a/plugins/code-coverage/src/components/FileExplorer/FileExplorer.tsx b/plugins/code-coverage/src/components/FileExplorer/FileExplorer.tsx index 5f492edf70..790de6e00f 100644 --- a/plugins/code-coverage/src/components/FileExplorer/FileExplorer.tsx +++ b/plugins/code-coverage/src/components/FileExplorer/FileExplorer.tsx @@ -26,7 +26,7 @@ import { import DescriptionIcon from '@material-ui/icons/Description'; import { Alert } from '@material-ui/lab'; import React, { Fragment, useEffect, useState } from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { codeCoverageApiRef } from '../../api'; import { FileEntry } from '../../types'; import { FileContent } from './FileContent'; diff --git a/plugins/config-schema/src/components/ConfigSchemaPage/ConfigSchemaPage.tsx b/plugins/config-schema/src/components/ConfigSchemaPage/ConfigSchemaPage.tsx index 2eae3805c2..5fb39c6ae3 100644 --- a/plugins/config-schema/src/components/ConfigSchemaPage/ConfigSchemaPage.tsx +++ b/plugins/config-schema/src/components/ConfigSchemaPage/ConfigSchemaPage.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ import React, { useMemo } from 'react'; -import { useObservable } from 'react-use'; +import useObservable from 'react-use/lib/useObservable'; import { configSchemaApiRef } from '../../api'; import { SchemaViewer } from '../SchemaViewer'; import { Typography } from '@material-ui/core'; diff --git a/plugins/cost-insights/src/components/CopyUrlToClipboard/CopyUrlToClipboard.tsx b/plugins/cost-insights/src/components/CopyUrlToClipboard/CopyUrlToClipboard.tsx index 67ea368def..bef6f159de 100644 --- a/plugins/cost-insights/src/components/CopyUrlToClipboard/CopyUrlToClipboard.tsx +++ b/plugins/cost-insights/src/components/CopyUrlToClipboard/CopyUrlToClipboard.tsx @@ -16,7 +16,7 @@ import React, { useEffect, useState } from 'react'; import { useLocation } from 'react-router-dom'; -import { useCopyToClipboard } from 'react-use'; +import useCopyToClipboard from 'react-use/lib/useCopyToClipboard'; import { Tooltip, IconButton } from '@material-ui/core'; import AssignmentOutlinedIcon from '@material-ui/icons/AssignmentOutlined'; import AssignmentTurnedInOutlinedIcon from '@material-ui/icons/AssignmentTurnedInOutlined'; diff --git a/plugins/explore/src/components/DomainExplorerContent/DomainExplorerContent.tsx b/plugins/explore/src/components/DomainExplorerContent/DomainExplorerContent.tsx index 781d21bd91..ba495f6492 100644 --- a/plugins/explore/src/components/DomainExplorerContent/DomainExplorerContent.tsx +++ b/plugins/explore/src/components/DomainExplorerContent/DomainExplorerContent.tsx @@ -17,7 +17,7 @@ import { DomainEntity } from '@backstage/catalog-model'; import { catalogApiRef } from '@backstage/plugin-catalog-react'; import { Button } from '@material-ui/core'; import React from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { DomainCard } from '../DomainCard'; import { diff --git a/plugins/explore/src/components/GroupsExplorerContent/GroupsDiagram.tsx b/plugins/explore/src/components/GroupsExplorerContent/GroupsDiagram.tsx index 49a9481b15..36788ed1b6 100644 --- a/plugins/explore/src/components/GroupsExplorerContent/GroupsDiagram.tsx +++ b/plugins/explore/src/components/GroupsExplorerContent/GroupsDiagram.tsx @@ -39,7 +39,7 @@ import { makeStyles, Typography, useTheme } from '@material-ui/core'; import ZoomOutMap from '@material-ui/icons/ZoomOutMap'; import classNames from 'classnames'; import React from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; const useStyles = makeStyles((theme: BackstageTheme) => ({ graph: { diff --git a/plugins/explore/src/components/ToolExplorerContent/ToolExplorerContent.tsx b/plugins/explore/src/components/ToolExplorerContent/ToolExplorerContent.tsx index ec532f3004..db07bd0665 100644 --- a/plugins/explore/src/components/ToolExplorerContent/ToolExplorerContent.tsx +++ b/plugins/explore/src/components/ToolExplorerContent/ToolExplorerContent.tsx @@ -16,7 +16,7 @@ import { exploreToolsConfigRef } from '@backstage/plugin-explore-react'; import React from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { ToolCard } from '../ToolCard'; import { diff --git a/plugins/firehydrant/src/components/serviceAnalytics.ts b/plugins/firehydrant/src/components/serviceAnalytics.ts index ba88af86da..c37319d5ea 100644 --- a/plugins/firehydrant/src/components/serviceAnalytics.ts +++ b/plugins/firehydrant/src/components/serviceAnalytics.ts @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { useAsyncRetry } from 'react-use'; +import useAsyncRetry from 'react-use/lib/useAsyncRetry'; import { fireHydrantApiRef } from '../api'; import { errorApiRef, useApi } from '@backstage/core-plugin-api'; diff --git a/plugins/firehydrant/src/components/serviceDetails.ts b/plugins/firehydrant/src/components/serviceDetails.ts index b8cac2736a..9c12677577 100644 --- a/plugins/firehydrant/src/components/serviceDetails.ts +++ b/plugins/firehydrant/src/components/serviceDetails.ts @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { useAsyncRetry } from 'react-use'; +import useAsyncRetry from 'react-use/lib/useAsyncRetry'; import { fireHydrantApiRef } from '../api'; import { errorApiRef, useApi } from '@backstage/core-plugin-api'; diff --git a/plugins/fossa/src/components/FossaCard/FossaCard.tsx b/plugins/fossa/src/components/FossaCard/FossaCard.tsx index 58ab3163fd..bbd5594fbc 100644 --- a/plugins/fossa/src/components/FossaCard/FossaCard.tsx +++ b/plugins/fossa/src/components/FossaCard/FossaCard.tsx @@ -19,7 +19,7 @@ import { Grid, Tooltip } from '@material-ui/core'; import { makeStyles } from '@material-ui/core/styles'; import { DateTime } from 'luxon'; import React, { PropsWithChildren } from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { fossaApiRef } from '../../api'; import { FOSSA_PROJECT_NAME_ANNOTATION, diff --git a/plugins/fossa/src/components/FossaPage/FossaPage.tsx b/plugins/fossa/src/components/FossaPage/FossaPage.tsx index fbdaf85717..1b53546ccd 100644 --- a/plugins/fossa/src/components/FossaPage/FossaPage.tsx +++ b/plugins/fossa/src/components/FossaPage/FossaPage.tsx @@ -31,7 +31,8 @@ import { Skeleton } from '@material-ui/lab'; import { DateTime } from 'luxon'; import * as React from 'react'; import { useMemo, useState } from 'react'; -import { useAsync, useDeepCompareEffect } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; +import useDeepCompareEffect from 'react-use/lib/useDeepCompareEffect'; import { FindingSummary, fossaApiRef } from '../../api'; import { getProjectName } from '../getProjectName'; diff --git a/plugins/gcp-projects/src/components/ProjectDetailsPage/ProjectDetailsPage.tsx b/plugins/gcp-projects/src/components/ProjectDetailsPage/ProjectDetailsPage.tsx index 446ef0ec5c..36247ac492 100644 --- a/plugins/gcp-projects/src/components/ProjectDetailsPage/ProjectDetailsPage.tsx +++ b/plugins/gcp-projects/src/components/ProjectDetailsPage/ProjectDetailsPage.tsx @@ -27,7 +27,7 @@ import { Typography, } from '@material-ui/core'; import React from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { gcpApiRef } from '../../api'; import { diff --git a/plugins/gcp-projects/src/components/ProjectListPage/ProjectListPage.tsx b/plugins/gcp-projects/src/components/ProjectListPage/ProjectListPage.tsx index b37dc2fa50..d5a57432b3 100644 --- a/plugins/gcp-projects/src/components/ProjectListPage/ProjectListPage.tsx +++ b/plugins/gcp-projects/src/components/ProjectListPage/ProjectListPage.tsx @@ -18,7 +18,7 @@ import { Button, LinearProgress, Tooltip, Typography } from '@material-ui/core'; import React from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { gcpApiRef, Project } from '../../api'; import { diff --git a/plugins/git-release-manager/src/GitReleaseManager.tsx b/plugins/git-release-manager/src/GitReleaseManager.tsx index bca19b9b13..8ac99a356c 100644 --- a/plugins/git-release-manager/src/GitReleaseManager.tsx +++ b/plugins/git-release-manager/src/GitReleaseManager.tsx @@ -15,7 +15,7 @@ */ import React from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { Alert } from '@material-ui/lab'; import { Box } from '@material-ui/core'; import { useApi } from '@backstage/core-plugin-api'; diff --git a/plugins/git-release-manager/src/features/CreateReleaseCandidate/hooks/useCreateReleaseCandidate.ts b/plugins/git-release-manager/src/features/CreateReleaseCandidate/hooks/useCreateReleaseCandidate.ts index 4030d9370f..51080570c3 100644 --- a/plugins/git-release-manager/src/features/CreateReleaseCandidate/hooks/useCreateReleaseCandidate.ts +++ b/plugins/git-release-manager/src/features/CreateReleaseCandidate/hooks/useCreateReleaseCandidate.ts @@ -15,7 +15,8 @@ */ import { useEffect, useState } from 'react'; -import { useAsync, useAsyncFn } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; +import useAsyncFn from 'react-use/lib/useAsyncFn'; import { GetLatestReleaseResult, GetRepositoryResult, diff --git a/plugins/git-release-manager/src/features/Patch/PatchBody.tsx b/plugins/git-release-manager/src/features/Patch/PatchBody.tsx index 2a2692bb22..98303890c8 100644 --- a/plugins/git-release-manager/src/features/Patch/PatchBody.tsx +++ b/plugins/git-release-manager/src/features/Patch/PatchBody.tsx @@ -15,7 +15,7 @@ */ import React, { useState } from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { Alert, AlertTitle } from '@material-ui/lab'; import { Box, diff --git a/plugins/git-release-manager/src/features/Patch/hooks/usePatch.ts b/plugins/git-release-manager/src/features/Patch/hooks/usePatch.ts index 188ffbca2e..73684a8f16 100644 --- a/plugins/git-release-manager/src/features/Patch/hooks/usePatch.ts +++ b/plugins/git-release-manager/src/features/Patch/hooks/usePatch.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { useEffect, useState } from 'react'; import { diff --git a/plugins/git-release-manager/src/features/Patch/hooks/usePatchDryRun.tsx b/plugins/git-release-manager/src/features/Patch/hooks/usePatchDryRun.tsx index 3bd69b1028..a11ca55b4d 100644 --- a/plugins/git-release-manager/src/features/Patch/hooks/usePatchDryRun.tsx +++ b/plugins/git-release-manager/src/features/Patch/hooks/usePatchDryRun.tsx @@ -15,7 +15,8 @@ */ import { useApi } from '@backstage/core-plugin-api'; -import { useAsync, useAsyncFn } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; +import useAsyncFn from 'react-use/lib/useAsyncFn'; import React from 'react'; import { CalverTagParts } from '../../../helpers/tagParts/getCalverTagParts'; diff --git a/plugins/git-release-manager/src/features/PromoteRc/hooks/usePromoteRc.ts b/plugins/git-release-manager/src/features/PromoteRc/hooks/usePromoteRc.ts index 7ebc4fed54..e6f7545c71 100644 --- a/plugins/git-release-manager/src/features/PromoteRc/hooks/usePromoteRc.ts +++ b/plugins/git-release-manager/src/features/PromoteRc/hooks/usePromoteRc.ts @@ -15,7 +15,8 @@ */ import { useState, useEffect } from 'react'; -import { useAsync, useAsyncFn } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; +import useAsyncFn from 'react-use/lib/useAsyncFn'; import { CardHook, ComponentConfig, diff --git a/plugins/git-release-manager/src/features/RepoDetailsForm/Owner.tsx b/plugins/git-release-manager/src/features/RepoDetailsForm/Owner.tsx index 2774bfbc5e..08f8ddeadb 100644 --- a/plugins/git-release-manager/src/features/RepoDetailsForm/Owner.tsx +++ b/plugins/git-release-manager/src/features/RepoDetailsForm/Owner.tsx @@ -16,7 +16,7 @@ import React from 'react'; import { useNavigate } from 'react-router'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { FormControl, FormHelperText, diff --git a/plugins/git-release-manager/src/features/RepoDetailsForm/Repo.tsx b/plugins/git-release-manager/src/features/RepoDetailsForm/Repo.tsx index 2b3ebb5058..c4a338bdf2 100644 --- a/plugins/git-release-manager/src/features/RepoDetailsForm/Repo.tsx +++ b/plugins/git-release-manager/src/features/RepoDetailsForm/Repo.tsx @@ -15,7 +15,7 @@ */ import React from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { useNavigate } from 'react-router'; import { FormControl, diff --git a/plugins/git-release-manager/src/features/Stats/Info/hooks/useGetReleaseTimes.tsx b/plugins/git-release-manager/src/features/Stats/Info/hooks/useGetReleaseTimes.tsx index 35cb3bc411..b87433b303 100644 --- a/plugins/git-release-manager/src/features/Stats/Info/hooks/useGetReleaseTimes.tsx +++ b/plugins/git-release-manager/src/features/Stats/Info/hooks/useGetReleaseTimes.tsx @@ -15,7 +15,8 @@ */ import { useEffect, useState } from 'react'; -import { useAsync, useAsyncFn } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; +import useAsyncFn from 'react-use/lib/useAsyncFn'; import { DateTime } from 'luxon'; import { getReleaseCommitPairs } from '../helpers/getReleaseCommitPairs'; diff --git a/plugins/git-release-manager/src/features/Stats/Row/RowCollapsed/ReleaseTime.tsx b/plugins/git-release-manager/src/features/Stats/Row/RowCollapsed/ReleaseTime.tsx index d05240a652..7a3dac37cc 100644 --- a/plugins/git-release-manager/src/features/Stats/Row/RowCollapsed/ReleaseTime.tsx +++ b/plugins/git-release-manager/src/features/Stats/Row/RowCollapsed/ReleaseTime.tsx @@ -15,7 +15,7 @@ */ import React from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { DateTime } from 'luxon'; import { Box, Typography } from '@material-ui/core'; import { Alert } from '@material-ui/lab'; diff --git a/plugins/git-release-manager/src/features/Stats/hooks/useGetStats.ts b/plugins/git-release-manager/src/features/Stats/hooks/useGetStats.ts index 0af0dcb343..e2dbdc0876 100644 --- a/plugins/git-release-manager/src/features/Stats/hooks/useGetStats.ts +++ b/plugins/git-release-manager/src/features/Stats/hooks/useGetStats.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { gitReleaseManagerApiRef } from '../../../api/serviceApiRef'; import { useProjectContext } from '../../../contexts/ProjectContext'; diff --git a/plugins/git-release-manager/src/hooks/useGetGitBatchInfo.ts b/plugins/git-release-manager/src/hooks/useGetGitBatchInfo.ts index 83c513a1e4..dbd24f5ec5 100644 --- a/plugins/git-release-manager/src/hooks/useGetGitBatchInfo.ts +++ b/plugins/git-release-manager/src/hooks/useGetGitBatchInfo.ts @@ -15,7 +15,7 @@ */ import { useEffect } from 'react'; -import { useAsyncFn } from 'react-use'; +import useAsyncFn from 'react-use/lib/useAsyncFn'; import { GitReleaseApi } from '../api/GitReleaseClient'; import { Project } from '../contexts/ProjectContext'; diff --git a/plugins/github-actions/src/components/WorkflowRunDetails/useWorkflowRunJobs.ts b/plugins/github-actions/src/components/WorkflowRunDetails/useWorkflowRunJobs.ts index a27e3725f2..002d379ed1 100644 --- a/plugins/github-actions/src/components/WorkflowRunDetails/useWorkflowRunJobs.ts +++ b/plugins/github-actions/src/components/WorkflowRunDetails/useWorkflowRunJobs.ts @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { githubActionsApiRef } from '../../api'; import { buildRouteRef } from '../../routes'; import { useApi, useRouteRefParams } from '@backstage/core-plugin-api'; diff --git a/plugins/github-actions/src/components/WorkflowRunDetails/useWorkflowRunsDetails.ts b/plugins/github-actions/src/components/WorkflowRunDetails/useWorkflowRunsDetails.ts index e62b4f1529..ef9b4f7ccf 100644 --- a/plugins/github-actions/src/components/WorkflowRunDetails/useWorkflowRunsDetails.ts +++ b/plugins/github-actions/src/components/WorkflowRunDetails/useWorkflowRunsDetails.ts @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { githubActionsApiRef } from '../../api'; import { buildRouteRef } from '../../routes'; import { useApi, useRouteRefParams } from '@backstage/core-plugin-api'; diff --git a/plugins/github-actions/src/components/WorkflowRunLogs/useDownloadWorkflowRunLogs.ts b/plugins/github-actions/src/components/WorkflowRunLogs/useDownloadWorkflowRunLogs.ts index e1717509f5..3e80d0e2bb 100644 --- a/plugins/github-actions/src/components/WorkflowRunLogs/useDownloadWorkflowRunLogs.ts +++ b/plugins/github-actions/src/components/WorkflowRunLogs/useDownloadWorkflowRunLogs.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { githubActionsApiRef } from '../../api'; import { useApi } from '@backstage/core-plugin-api'; diff --git a/plugins/github-actions/src/components/useProjectName.ts b/plugins/github-actions/src/components/useProjectName.ts index dd666fa599..b9be7a49c9 100644 --- a/plugins/github-actions/src/components/useProjectName.ts +++ b/plugins/github-actions/src/components/useProjectName.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { Entity } from '@backstage/catalog-model'; export const GITHUB_ACTIONS_ANNOTATION = 'github.com/project-slug'; diff --git a/plugins/github-actions/src/components/useWorkflowRuns.ts b/plugins/github-actions/src/components/useWorkflowRuns.ts index eb343601bd..0d855e44fb 100644 --- a/plugins/github-actions/src/components/useWorkflowRuns.ts +++ b/plugins/github-actions/src/components/useWorkflowRuns.ts @@ -14,7 +14,7 @@ * limitations under the License. */ import { useState } from 'react'; -import { useAsyncRetry } from 'react-use'; +import useAsyncRetry from 'react-use/lib/useAsyncRetry'; import { githubActionsApiRef } from '../api/GithubActionsApi'; import { useApi, errorApiRef } from '@backstage/core-plugin-api'; diff --git a/plugins/github-deployments/src/components/GithubDeploymentsCard.tsx b/plugins/github-deployments/src/components/GithubDeploymentsCard.tsx index c1c33607a1..901e20a899 100644 --- a/plugins/github-deployments/src/components/GithubDeploymentsCard.tsx +++ b/plugins/github-deployments/src/components/GithubDeploymentsCard.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ import React from 'react'; -import { useAsyncRetry } from 'react-use'; +import useAsyncRetry from 'react-use/lib/useAsyncRetry'; import { GithubDeployment, githubDeploymentsApiRef } from '../api'; import { useEntity } from '@backstage/plugin-catalog-react'; import { diff --git a/plugins/gitops-profiles/src/components/ClusterList/ClusterList.tsx b/plugins/gitops-profiles/src/components/ClusterList/ClusterList.tsx index 401a6d00d0..e55ae0ef29 100644 --- a/plugins/gitops-profiles/src/components/ClusterList/ClusterList.tsx +++ b/plugins/gitops-profiles/src/components/ClusterList/ClusterList.tsx @@ -18,7 +18,7 @@ import React, { useState } from 'react'; import ClusterTable from '../ClusterTable/ClusterTable'; import { Button } from '@material-ui/core'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { gitOpsApiRef } from '../../api'; import { Alert } from '@material-ui/lab'; diff --git a/plugins/gitops-profiles/src/components/ProfileCatalog/ProfileCatalog.tsx b/plugins/gitops-profiles/src/components/ProfileCatalog/ProfileCatalog.tsx index 79ab73afdc..caab33217d 100644 --- a/plugins/gitops-profiles/src/components/ProfileCatalog/ProfileCatalog.tsx +++ b/plugins/gitops-profiles/src/components/ProfileCatalog/ProfileCatalog.tsx @@ -19,7 +19,7 @@ import { TextField, List, ListItem, Link } from '@material-ui/core'; import ClusterTemplateCardList from '../ClusterTemplateCardList'; import ProfileCardList from '../ProfileCardList'; -import { useLocalStorage } from 'react-use'; +import useLocalStorage from 'react-use/lib/useLocalStorage'; import { gitOpsApiRef, Status } from '../../api'; import { diff --git a/plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.tsx b/plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.tsx index 58cf332615..e987ee10fa 100644 --- a/plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.tsx +++ b/plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.tsx @@ -15,7 +15,7 @@ */ import React from 'react'; import { useApi } from '@backstage/core-plugin-api'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import 'graphiql/graphiql.css'; import { graphQlBrowseApiRef } from '../../lib/api'; import { GraphiQLBrowser } from '../GraphiQLBrowser'; diff --git a/plugins/home/src/homePageComponents/WelcomeTitle/WelcomeTitle.tsx b/plugins/home/src/homePageComponents/WelcomeTitle/WelcomeTitle.tsx index 9cb18bd430..40a5361f43 100644 --- a/plugins/home/src/homePageComponents/WelcomeTitle/WelcomeTitle.tsx +++ b/plugins/home/src/homePageComponents/WelcomeTitle/WelcomeTitle.tsx @@ -20,7 +20,7 @@ import { } from '@backstage/core-plugin-api'; import { Tooltip } from '@material-ui/core'; import React, { useEffect, useMemo } from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { getTimeBasedGreeting } from './timeUtil'; export const WelcomeTitle = () => { diff --git a/plugins/ilert/src/hooks/useAlertSource.ts b/plugins/ilert/src/hooks/useAlertSource.ts index 4e74b9e857..279150a724 100644 --- a/plugins/ilert/src/hooks/useAlertSource.ts +++ b/plugins/ilert/src/hooks/useAlertSource.ts @@ -16,7 +16,7 @@ import React from 'react'; import { ilertApiRef } from '../api'; import { AuthenticationError } from '@backstage/errors'; -import { useAsyncRetry } from 'react-use'; +import useAsyncRetry from 'react-use/lib/useAsyncRetry'; import { AlertSource, UptimeMonitor } from '../types'; import { useApi, errorApiRef } from '@backstage/core-plugin-api'; diff --git a/plugins/ilert/src/hooks/useAlertSourceOnCalls.ts b/plugins/ilert/src/hooks/useAlertSourceOnCalls.ts index c4aeb59527..5a804e37fd 100644 --- a/plugins/ilert/src/hooks/useAlertSourceOnCalls.ts +++ b/plugins/ilert/src/hooks/useAlertSourceOnCalls.ts @@ -16,7 +16,7 @@ import React from 'react'; import { ilertApiRef } from '../api'; import { AuthenticationError } from '@backstage/errors'; -import { useAsyncRetry } from 'react-use'; +import useAsyncRetry from 'react-use/lib/useAsyncRetry'; import { AlertSource, OnCall } from '../types'; import { useApi, errorApiRef } from '@backstage/core-plugin-api'; diff --git a/plugins/ilert/src/hooks/useAssignIncident.ts b/plugins/ilert/src/hooks/useAssignIncident.ts index 2b6935fc8c..b760f31e9c 100644 --- a/plugins/ilert/src/hooks/useAssignIncident.ts +++ b/plugins/ilert/src/hooks/useAssignIncident.ts @@ -16,7 +16,7 @@ import React from 'react'; import { ilertApiRef } from '../api'; import { AuthenticationError } from '@backstage/errors'; -import { useAsyncRetry } from 'react-use'; +import useAsyncRetry from 'react-use/lib/useAsyncRetry'; import { Incident, IncidentResponder } from '../types'; import { useApi, errorApiRef } from '@backstage/core-plugin-api'; diff --git a/plugins/ilert/src/hooks/useIncidentActions.ts b/plugins/ilert/src/hooks/useIncidentActions.ts index 4e20e3b56a..75621f67c3 100644 --- a/plugins/ilert/src/hooks/useIncidentActions.ts +++ b/plugins/ilert/src/hooks/useIncidentActions.ts @@ -16,7 +16,7 @@ import React from 'react'; import { ilertApiRef } from '../api'; import { AuthenticationError } from '@backstage/errors'; -import { useAsyncRetry } from 'react-use'; +import useAsyncRetry from 'react-use/lib/useAsyncRetry'; import { Incident, IncidentAction } from '../types'; import { useApi, errorApiRef } from '@backstage/core-plugin-api'; diff --git a/plugins/ilert/src/hooks/useIncidents.ts b/plugins/ilert/src/hooks/useIncidents.ts index 286c53a5c5..45f28937c5 100644 --- a/plugins/ilert/src/hooks/useIncidents.ts +++ b/plugins/ilert/src/hooks/useIncidents.ts @@ -16,7 +16,7 @@ import React from 'react'; import { GetIncidentsOpts, ilertApiRef, TableState } from '../api'; import { AuthenticationError } from '@backstage/errors'; -import { useAsyncRetry } from 'react-use'; +import useAsyncRetry from 'react-use/lib/useAsyncRetry'; import { ACCEPTED, PENDING, diff --git a/plugins/ilert/src/hooks/useNewIncident.ts b/plugins/ilert/src/hooks/useNewIncident.ts index af812ec060..f2bb3a8cd3 100644 --- a/plugins/ilert/src/hooks/useNewIncident.ts +++ b/plugins/ilert/src/hooks/useNewIncident.ts @@ -16,7 +16,7 @@ import React from 'react'; import { ilertApiRef } from '../api'; import { AuthenticationError } from '@backstage/errors'; -import { useAsyncRetry } from 'react-use'; +import useAsyncRetry from 'react-use/lib/useAsyncRetry'; import { AlertSource } from '../types'; import { useApi, errorApiRef } from '@backstage/core-plugin-api'; diff --git a/plugins/ilert/src/hooks/useOnCallSchedules.ts b/plugins/ilert/src/hooks/useOnCallSchedules.ts index c11327ffe8..2c033067dd 100644 --- a/plugins/ilert/src/hooks/useOnCallSchedules.ts +++ b/plugins/ilert/src/hooks/useOnCallSchedules.ts @@ -16,7 +16,7 @@ import React from 'react'; import { ilertApiRef } from '../api'; import { AuthenticationError } from '@backstage/errors'; -import { useAsyncRetry } from 'react-use'; +import useAsyncRetry from 'react-use/lib/useAsyncRetry'; import { Schedule } from '../types'; import { useApi, errorApiRef } from '@backstage/core-plugin-api'; diff --git a/plugins/ilert/src/hooks/useShiftOverride.ts b/plugins/ilert/src/hooks/useShiftOverride.ts index 33470f9607..018bdf497a 100644 --- a/plugins/ilert/src/hooks/useShiftOverride.ts +++ b/plugins/ilert/src/hooks/useShiftOverride.ts @@ -16,7 +16,7 @@ import React from 'react'; import { ilertApiRef } from '../api'; import { AuthenticationError } from '@backstage/errors'; -import { useAsyncRetry } from 'react-use'; +import useAsyncRetry from 'react-use/lib/useAsyncRetry'; import { User, Shift } from '../types'; import { useApi, errorApiRef } from '@backstage/core-plugin-api'; diff --git a/plugins/ilert/src/hooks/useUptimeMonitors.ts b/plugins/ilert/src/hooks/useUptimeMonitors.ts index fc4707c2a4..c71d5f02af 100644 --- a/plugins/ilert/src/hooks/useUptimeMonitors.ts +++ b/plugins/ilert/src/hooks/useUptimeMonitors.ts @@ -16,7 +16,7 @@ import React from 'react'; import { ilertApiRef, TableState } from '../api'; import { AuthenticationError } from '@backstage/errors'; -import { useAsyncRetry } from 'react-use'; +import useAsyncRetry from 'react-use/lib/useAsyncRetry'; import { UptimeMonitor } from '../types'; import { useApi, errorApiRef } from '@backstage/core-plugin-api'; diff --git a/plugins/jenkins/src/components/useBuildWithSteps.ts b/plugins/jenkins/src/components/useBuildWithSteps.ts index 64b3bf2535..202d8b5275 100644 --- a/plugins/jenkins/src/components/useBuildWithSteps.ts +++ b/plugins/jenkins/src/components/useBuildWithSteps.ts @@ -14,7 +14,7 @@ * limitations under the License. */ import { useCallback } from 'react'; -import { useAsyncRetry } from 'react-use'; +import useAsyncRetry from 'react-use/lib/useAsyncRetry'; import { jenkinsApiRef } from '../api'; import { useAsyncPolling } from './useAsyncPolling'; import { errorApiRef, useApi } from '@backstage/core-plugin-api'; diff --git a/plugins/jenkins/src/components/useBuilds.ts b/plugins/jenkins/src/components/useBuilds.ts index b0959671e1..a4afeb351f 100644 --- a/plugins/jenkins/src/components/useBuilds.ts +++ b/plugins/jenkins/src/components/useBuilds.ts @@ -14,7 +14,7 @@ * limitations under the License. */ import { useState } from 'react'; -import { useAsyncRetry } from 'react-use'; +import useAsyncRetry from 'react-use/lib/useAsyncRetry'; import { jenkinsApiRef } from '../api'; import { errorApiRef, useApi } from '@backstage/core-plugin-api'; import { useEntity } from '@backstage/plugin-catalog-react'; diff --git a/plugins/kafka/src/components/ConsumerGroupOffsets/useConsumerGroupsOffsetsForEntity.ts b/plugins/kafka/src/components/ConsumerGroupOffsets/useConsumerGroupsOffsetsForEntity.ts index 866b63b8bf..0be098c3f9 100644 --- a/plugins/kafka/src/components/ConsumerGroupOffsets/useConsumerGroupsOffsetsForEntity.ts +++ b/plugins/kafka/src/components/ConsumerGroupOffsets/useConsumerGroupsOffsetsForEntity.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { useAsyncRetry } from 'react-use'; +import useAsyncRetry from 'react-use/lib/useAsyncRetry'; import { kafkaApiRef } from '../../api/types'; import { useConsumerGroupsForEntity } from './useConsumerGroupsForEntity'; import { errorApiRef, useApi } from '@backstage/core-plugin-api'; diff --git a/plugins/kubernetes/src/hooks/useKubernetesObjects.ts b/plugins/kubernetes/src/hooks/useKubernetesObjects.ts index 8a8ec260fa..d9aca875c7 100644 --- a/plugins/kubernetes/src/hooks/useKubernetesObjects.ts +++ b/plugins/kubernetes/src/hooks/useKubernetesObjects.ts @@ -18,7 +18,7 @@ import { Entity } from '@backstage/catalog-model'; import { kubernetesApiRef } from '../api/types'; import { kubernetesAuthProvidersApiRef } from '../kubernetes-auth-provider/types'; import { useEffect, useState } from 'react'; -import { useInterval } from 'react-use'; +import useInterval from 'react-use/lib/useInterval'; import { KubernetesRequestBody, ObjectsByEntityResponse, diff --git a/plugins/lighthouse/src/components/AuditList/AuditListTable.tsx b/plugins/lighthouse/src/components/AuditList/AuditListTable.tsx index 541bc0e22d..4701ae157f 100644 --- a/plugins/lighthouse/src/components/AuditList/AuditListTable.tsx +++ b/plugins/lighthouse/src/components/AuditList/AuditListTable.tsx @@ -15,7 +15,7 @@ */ import React, { useState, useEffect } from 'react'; import { Website, lighthouseApiRef } from '../../api'; -import { useInterval } from 'react-use'; +import useInterval from 'react-use/lib/useInterval'; import { formatTime, CATEGORIES, diff --git a/plugins/lighthouse/src/components/AuditList/index.tsx b/plugins/lighthouse/src/components/AuditList/index.tsx index 94398bb794..c433bb1900 100644 --- a/plugins/lighthouse/src/components/AuditList/index.tsx +++ b/plugins/lighthouse/src/components/AuditList/index.tsx @@ -18,7 +18,8 @@ import { Button, Grid } from '@material-ui/core'; import Pagination from '@material-ui/lab/Pagination'; import React, { ChangeEvent, ReactNode, useMemo, useState } from 'react'; import { useNavigate } from 'react-router-dom'; -import { useAsync, useLocalStorage } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; +import useLocalStorage from 'react-use/lib/useLocalStorage'; import { lighthouseApiRef } from '../../api'; import { useQuery } from '../../utils'; import LighthouseIntro, { LIGHTHOUSE_INTRO_LOCAL_STORAGE } from '../Intro'; diff --git a/plugins/lighthouse/src/components/AuditView/index.tsx b/plugins/lighthouse/src/components/AuditView/index.tsx index 30f7b61eb9..e377894c90 100644 --- a/plugins/lighthouse/src/components/AuditView/index.tsx +++ b/plugins/lighthouse/src/components/AuditView/index.tsx @@ -32,7 +32,7 @@ import { useNavigate, useParams, } from 'react-router-dom'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { Audit, lighthouseApiRef, Website } from '../../api'; import { formatTime } from '../../utils'; import AuditStatusIcon from '../AuditStatusIcon'; diff --git a/plugins/lighthouse/src/components/Intro/index.tsx b/plugins/lighthouse/src/components/Intro/index.tsx index 509f9e468a..57609476b8 100644 --- a/plugins/lighthouse/src/components/Intro/index.tsx +++ b/plugins/lighthouse/src/components/Intro/index.tsx @@ -17,7 +17,7 @@ import { Button, Grid, makeStyles, Tab, Tabs } from '@material-ui/core'; import CloseIcon from '@material-ui/icons/Close'; import React, { useState } from 'react'; -import { useLocalStorage } from 'react-use'; +import useLocalStorage from 'react-use/lib/useLocalStorage'; import LighthouseSupportButton from '../SupportButton'; import { ContentHeader, diff --git a/plugins/lighthouse/src/hooks/useWebsiteForEntity.ts b/plugins/lighthouse/src/hooks/useWebsiteForEntity.ts index 1ea1e3f8e4..3f7709fee0 100644 --- a/plugins/lighthouse/src/hooks/useWebsiteForEntity.ts +++ b/plugins/lighthouse/src/hooks/useWebsiteForEntity.ts @@ -14,7 +14,7 @@ * limitations under the License. */ import { useEntity } from '@backstage/plugin-catalog-react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { LIGHTHOUSE_WEBSITE_URL_ANNOTATION } from '../../constants'; import { lighthouseApiRef } from '../api'; import { errorApiRef, useApi } from '@backstage/core-plugin-api'; diff --git a/plugins/newrelic-dashboard/src/components/NewRelicDashboard/DashboardEntityList.tsx b/plugins/newrelic-dashboard/src/components/NewRelicDashboard/DashboardEntityList.tsx index 005bc42151..a9e6e39a0d 100644 --- a/plugins/newrelic-dashboard/src/components/NewRelicDashboard/DashboardEntityList.tsx +++ b/plugins/newrelic-dashboard/src/components/NewRelicDashboard/DashboardEntityList.tsx @@ -17,7 +17,7 @@ import React from 'react'; import { Box, makeStyles, Typography } from '@material-ui/core'; import { newRelicDashboardApiRef } from '../../api'; import { useApi } from '@backstage/core-plugin-api'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { Progress, InfoCard, diff --git a/plugins/newrelic-dashboard/src/components/NewRelicDashboard/DashboardSnapshotList/DashboardSnapshot.tsx b/plugins/newrelic-dashboard/src/components/NewRelicDashboard/DashboardSnapshotList/DashboardSnapshot.tsx index 95de46df2c..0b6a676f52 100644 --- a/plugins/newrelic-dashboard/src/components/NewRelicDashboard/DashboardSnapshotList/DashboardSnapshot.tsx +++ b/plugins/newrelic-dashboard/src/components/NewRelicDashboard/DashboardSnapshotList/DashboardSnapshot.tsx @@ -16,7 +16,7 @@ import React from 'react'; import { Box, Grid } from '@material-ui/core'; import { useApi } from '@backstage/core-plugin-api'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { InfoCard, Progress, diff --git a/plugins/newrelic-dashboard/src/components/NewRelicDashboard/DashboardSnapshotList/DashboardSnapshotList.tsx b/plugins/newrelic-dashboard/src/components/NewRelicDashboard/DashboardSnapshotList/DashboardSnapshotList.tsx index c839a43ac2..87f2334bf7 100644 --- a/plugins/newrelic-dashboard/src/components/NewRelicDashboard/DashboardSnapshotList/DashboardSnapshotList.tsx +++ b/plugins/newrelic-dashboard/src/components/NewRelicDashboard/DashboardSnapshotList/DashboardSnapshotList.tsx @@ -17,7 +17,7 @@ import React, { useState } from 'react'; import { Grid, Tab, Tabs, makeStyles } from '@material-ui/core'; import { newRelicDashboardApiRef } from '../../../api'; import { useApi } from '@backstage/core-plugin-api'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { Progress, ErrorPanel } from '@backstage/core-components'; import { DashboardSnapshot } from './DashboardSnapshot'; import { DashboardEntitySummary } from '../../../api/NewRelicDashboardApi'; diff --git a/plugins/newrelic/src/components/NewRelicFetchComponent/NewRelicFetchComponent.tsx b/plugins/newrelic/src/components/NewRelicFetchComponent/NewRelicFetchComponent.tsx index 40f82d4beb..e626e6a6d2 100644 --- a/plugins/newrelic/src/components/NewRelicFetchComponent/NewRelicFetchComponent.tsx +++ b/plugins/newrelic/src/components/NewRelicFetchComponent/NewRelicFetchComponent.tsx @@ -16,7 +16,7 @@ import React from 'react'; import Alert from '@material-ui/lab/Alert'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { newRelicApiRef, NewRelicApplications } from '../../api'; import { Progress, Table, TableColumn } from '@backstage/core-components'; diff --git a/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.tsx b/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.tsx index 7a15bd2122..f27fd52515 100644 --- a/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.tsx +++ b/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.tsx @@ -35,7 +35,7 @@ import { import Pagination from '@material-ui/lab/Pagination'; import React from 'react'; import { generatePath } from 'react-router-dom'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { Avatar, diff --git a/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.tsx b/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.tsx index e8d7c44816..d3a90d63e3 100644 --- a/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.tsx +++ b/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.tsx @@ -41,7 +41,7 @@ import { import qs from 'qs'; import React from 'react'; import pluralize from 'pluralize'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; type EntityTypeProps = { kind: string; diff --git a/plugins/pagerduty/src/components/ChangeEvents/ChangeEvents.tsx b/plugins/pagerduty/src/components/ChangeEvents/ChangeEvents.tsx index 8848612303..58b4dd6acf 100644 --- a/plugins/pagerduty/src/components/ChangeEvents/ChangeEvents.tsx +++ b/plugins/pagerduty/src/components/ChangeEvents/ChangeEvents.tsx @@ -18,7 +18,7 @@ import React, { useEffect } from 'react'; import { List, ListSubheader } from '@material-ui/core'; import { ChangeEventListItem } from './ChangeEventListItem'; import { ChangeEventEmptyState } from './ChangeEventEmptyState'; -import { useAsyncFn } from 'react-use'; +import useAsyncFn from 'react-use/lib/useAsyncFn'; import { pagerDutyApiRef } from '../../api'; import { useApi } from '@backstage/core-plugin-api'; import { Progress } from '@backstage/core-components'; diff --git a/plugins/pagerduty/src/components/Escalation/EscalationPolicy.tsx b/plugins/pagerduty/src/components/Escalation/EscalationPolicy.tsx index 9cbdddca17..704887be58 100644 --- a/plugins/pagerduty/src/components/Escalation/EscalationPolicy.tsx +++ b/plugins/pagerduty/src/components/Escalation/EscalationPolicy.tsx @@ -18,7 +18,7 @@ import React from 'react'; import { List, ListSubheader } from '@material-ui/core'; import { EscalationUsersEmptyState } from './EscalationUsersEmptyState'; import { EscalationUser } from './EscalationUser'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { pagerDutyApiRef } from '../../api'; import { Alert } from '@material-ui/lab'; diff --git a/plugins/pagerduty/src/components/Incident/Incidents.tsx b/plugins/pagerduty/src/components/Incident/Incidents.tsx index d7ce1b13a3..06dd50bdaa 100644 --- a/plugins/pagerduty/src/components/Incident/Incidents.tsx +++ b/plugins/pagerduty/src/components/Incident/Incidents.tsx @@ -18,7 +18,7 @@ import React, { useEffect } from 'react'; import { List, ListSubheader } from '@material-ui/core'; import { IncidentListItem } from './IncidentListItem'; import { IncidentsEmptyState } from './IncidentEmptyState'; -import { useAsyncFn } from 'react-use'; +import useAsyncFn from 'react-use/lib/useAsyncFn'; import { pagerDutyApiRef } from '../../api'; import { Alert } from '@material-ui/lab'; diff --git a/plugins/pagerduty/src/components/PagerDutyCard/index.tsx b/plugins/pagerduty/src/components/PagerDutyCard/index.tsx index adb47e0b4b..bbade09e51 100644 --- a/plugins/pagerduty/src/components/PagerDutyCard/index.tsx +++ b/plugins/pagerduty/src/components/PagerDutyCard/index.tsx @@ -18,7 +18,7 @@ import { Entity } from '@backstage/catalog-model'; import { Card, CardHeader, Divider, CardContent } from '@material-ui/core'; import { Incidents } from '../Incident'; import { EscalationPolicy } from '../Escalation'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { Alert } from '@material-ui/lab'; import { pagerDutyApiRef, UnauthorizedError } from '../../api'; import AlarmAddIcon from '@material-ui/icons/AlarmAdd'; diff --git a/plugins/pagerduty/src/components/TriggerDialog/TriggerDialog.tsx b/plugins/pagerduty/src/components/TriggerDialog/TriggerDialog.tsx index c5b62de15a..7e1a602bc8 100644 --- a/plugins/pagerduty/src/components/TriggerDialog/TriggerDialog.tsx +++ b/plugins/pagerduty/src/components/TriggerDialog/TriggerDialog.tsx @@ -25,7 +25,7 @@ import { Typography, CircularProgress, } from '@material-ui/core'; -import { useAsyncFn } from 'react-use'; +import useAsyncFn from 'react-use/lib/useAsyncFn'; import { pagerDutyApiRef } from '../../api'; import { Alert } from '@material-ui/lab'; import { usePagerdutyEntity } from '../../hooks'; diff --git a/plugins/permission-react/src/hooks/usePermission.ts b/plugins/permission-react/src/hooks/usePermission.ts index 129904d7df..45136d6697 100644 --- a/plugins/permission-react/src/hooks/usePermission.ts +++ b/plugins/permission-react/src/hooks/usePermission.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { useApi } from '@backstage/core-plugin-api'; import { permissionApiRef } from '../apis'; import { diff --git a/plugins/rollbar/src/hooks/useCatalogEntity.ts b/plugins/rollbar/src/hooks/useCatalogEntity.ts index b64369af7b..468d0e8c50 100644 --- a/plugins/rollbar/src/hooks/useCatalogEntity.ts +++ b/plugins/rollbar/src/hooks/useCatalogEntity.ts @@ -18,7 +18,7 @@ import { catalogApiRef, useEntityCompoundName, } from '@backstage/plugin-catalog-react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { useApi } from '@backstage/core-plugin-api'; export function useCatalogEntity() { diff --git a/plugins/rollbar/src/hooks/useRollbarEntities.ts b/plugins/rollbar/src/hooks/useRollbarEntities.ts index 150b611fae..60799e3916 100644 --- a/plugins/rollbar/src/hooks/useRollbarEntities.ts +++ b/plugins/rollbar/src/hooks/useRollbarEntities.ts @@ -15,7 +15,7 @@ */ import { catalogApiRef } from '@backstage/plugin-catalog-react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { ROLLBAR_ANNOTATION } from '../constants'; import { configApiRef, useApi } from '@backstage/core-plugin-api'; diff --git a/plugins/rollbar/src/hooks/useTopActiveItems.ts b/plugins/rollbar/src/hooks/useTopActiveItems.ts index 1277678af7..04b65eb8cb 100644 --- a/plugins/rollbar/src/hooks/useTopActiveItems.ts +++ b/plugins/rollbar/src/hooks/useTopActiveItems.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { Entity } from '@backstage/catalog-model'; import { rollbarApiRef } from '../api'; import { RollbarTopActiveItem } from '../api/types'; diff --git a/plugins/scaffolder/src/components/ActionsPage/ActionsPage.tsx b/plugins/scaffolder/src/components/ActionsPage/ActionsPage.tsx index caddadfd2e..4542979e73 100644 --- a/plugins/scaffolder/src/components/ActionsPage/ActionsPage.tsx +++ b/plugins/scaffolder/src/components/ActionsPage/ActionsPage.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ import React from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { scaffolderApiRef } from '../../api'; import { Typography, diff --git a/plugins/scaffolder/src/components/TaskPage/TaskPage.tsx b/plugins/scaffolder/src/components/TaskPage/TaskPage.tsx index b27f116b96..9f5dad2adc 100644 --- a/plugins/scaffolder/src/components/TaskPage/TaskPage.tsx +++ b/plugins/scaffolder/src/components/TaskPage/TaskPage.tsx @@ -45,7 +45,7 @@ import { DateTime, Interval } from 'luxon'; import qs from 'qs'; import React, { memo, useEffect, useMemo, useState } from 'react'; import { generatePath, useNavigate, useParams } from 'react-router'; -import { useInterval } from 'react-use'; +import useInterval from 'react-use/lib/useInterval'; import { rootRouteRef } from '../../routes'; import { Status, TaskOutput } from '../../types'; import { useTaskEventStream } from '../hooks/useEventStream'; diff --git a/plugins/scaffolder/src/components/TemplatePage/TemplatePage.tsx b/plugins/scaffolder/src/components/TemplatePage/TemplatePage.tsx index 9d1e7a3e2d..8ce7ecf6b3 100644 --- a/plugins/scaffolder/src/components/TemplatePage/TemplatePage.tsx +++ b/plugins/scaffolder/src/components/TemplatePage/TemplatePage.tsx @@ -20,7 +20,7 @@ import qs from 'qs'; import React, { useCallback, useState } from 'react'; import { generatePath, Navigate, useNavigate } from 'react-router'; import { useParams } from 'react-router-dom'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { scaffolderApiRef } from '../../api'; import { CustomFieldValidator, FieldExtensionOptions } from '../../extensions'; import { rootRouteRef } from '../../routes'; diff --git a/plugins/scaffolder/src/components/fields/EntityPicker/EntityPicker.tsx b/plugins/scaffolder/src/components/fields/EntityPicker/EntityPicker.tsx index c9c20e25eb..959e7883c0 100644 --- a/plugins/scaffolder/src/components/fields/EntityPicker/EntityPicker.tsx +++ b/plugins/scaffolder/src/components/fields/EntityPicker/EntityPicker.tsx @@ -23,7 +23,7 @@ import FormControl from '@material-ui/core/FormControl'; import Autocomplete from '@material-ui/lab/Autocomplete'; import { FieldProps, UiSchema } from '@rjsf/core'; import React, { useCallback, useEffect } from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; export const allowArbitraryValues = (uiSchema: UiSchema): boolean => (uiSchema['ui:options']?.allowArbitraryValues as boolean) ?? true; diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx index 92261b6cac..85fe992935 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx @@ -27,7 +27,7 @@ import Input from '@material-ui/core/Input'; import InputLabel from '@material-ui/core/InputLabel'; import { FieldProps } from '@rjsf/core'; import React, { useCallback, useEffect } from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { scaffolderApiRef } from '../../../api'; function splitFormData(url: string | undefined, allowedOwners?: string[]) { diff --git a/plugins/search/src/components/LegacySearchPage/LegacySearchPage.tsx b/plugins/search/src/components/LegacySearchPage/LegacySearchPage.tsx index ec0fc3acb9..09a33b9b74 100644 --- a/plugins/search/src/components/LegacySearchPage/LegacySearchPage.tsx +++ b/plugins/search/src/components/LegacySearchPage/LegacySearchPage.tsx @@ -16,7 +16,7 @@ import { Grid } from '@material-ui/core'; import React, { useEffect, useState } from 'react'; -import { useDebounce } from 'react-use'; +import useDebounce from 'react-use/lib/useDebounce'; import { SearchBar } from './LegacySearchBar'; import { SearchResult } from './LegacySearchResult'; import { diff --git a/plugins/search/src/components/LegacySearchPage/LegacySearchResult.tsx b/plugins/search/src/components/LegacySearchPage/LegacySearchResult.tsx index c5c3783819..f48ffb61d7 100644 --- a/plugins/search/src/components/LegacySearchPage/LegacySearchResult.tsx +++ b/plugins/search/src/components/LegacySearchPage/LegacySearchResult.tsx @@ -16,7 +16,7 @@ import { Divider, Grid, makeStyles, Typography } from '@material-ui/core'; import { Alert } from '@material-ui/lab'; import React, { useEffect, useState } from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { catalogApiRef } from '@backstage/plugin-catalog-react'; import { Filters, FiltersButton, FiltersState } from './Filters'; diff --git a/plugins/search/src/components/SearchBar/SearchBar.tsx b/plugins/search/src/components/SearchBar/SearchBar.tsx index aa4b1e728a..88142c1843 100644 --- a/plugins/search/src/components/SearchBar/SearchBar.tsx +++ b/plugins/search/src/components/SearchBar/SearchBar.tsx @@ -21,7 +21,7 @@ import React, { useEffect, useCallback, } from 'react'; -import { useDebounce } from 'react-use'; +import useDebounce from 'react-use/lib/useDebounce'; import { configApiRef, useApi } from '@backstage/core-plugin-api'; import { InputBase, diff --git a/plugins/search/src/components/SearchContext/SearchContext.tsx b/plugins/search/src/components/SearchContext/SearchContext.tsx index 300a191983..336041bf1f 100644 --- a/plugins/search/src/components/SearchContext/SearchContext.tsx +++ b/plugins/search/src/components/SearchContext/SearchContext.tsx @@ -25,8 +25,8 @@ import React, { useEffect, useState, } from 'react'; -import { useAsync, usePrevious } from 'react-use'; -import { AsyncState } from 'react-use/lib/useAsync'; +import useAsync, { AsyncState } from 'react-use/lib/useAsync'; +import usePrevious from 'react-use/lib/usePrevious'; import { searchApiRef } from '../../apis'; type SearchContextValue = { diff --git a/plugins/search/src/components/SearchPage/SearchPage.tsx b/plugins/search/src/components/SearchPage/SearchPage.tsx index a0738b3466..e4e1e49d57 100644 --- a/plugins/search/src/components/SearchPage/SearchPage.tsx +++ b/plugins/search/src/components/SearchPage/SearchPage.tsx @@ -15,7 +15,7 @@ */ import React, { useEffect } from 'react'; -import { usePrevious } from 'react-use'; +import usePrevious from 'react-use/lib/usePrevious'; import qs from 'qs'; import { useLocation, useOutlet } from 'react-router'; import { SearchContextProvider, useSearch } from '../SearchContext'; diff --git a/plugins/search/src/components/SearchType/SearchType.tsx b/plugins/search/src/components/SearchType/SearchType.tsx index f42802819a..930ab4b55b 100644 --- a/plugins/search/src/components/SearchType/SearchType.tsx +++ b/plugins/search/src/components/SearchType/SearchType.tsx @@ -24,7 +24,7 @@ import { Select, } from '@material-ui/core'; import React, { ChangeEvent } from 'react'; -import { useEffectOnce } from 'react-use'; +import useEffectOnce from 'react-use/lib/useEffectOnce'; import { SearchTypeAccordion, SearchTypeAccordionProps, diff --git a/plugins/sentry/src/components/SentryIssuesWidget/SentryIssuesWidget.tsx b/plugins/sentry/src/components/SentryIssuesWidget/SentryIssuesWidget.tsx index 00f7ad0b0b..54fc940074 100644 --- a/plugins/sentry/src/components/SentryIssuesWidget/SentryIssuesWidget.tsx +++ b/plugins/sentry/src/components/SentryIssuesWidget/SentryIssuesWidget.tsx @@ -16,7 +16,7 @@ import { Entity } from '@backstage/catalog-model'; import React, { useEffect } from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { sentryApiRef } from '../../api'; import SentryIssuesTable from '../SentryIssuesTable/SentryIssuesTable'; import { diff --git a/plugins/shortcuts/src/Shortcuts.tsx b/plugins/shortcuts/src/Shortcuts.tsx index 69ab6a48ac..8b7e1628d3 100644 --- a/plugins/shortcuts/src/Shortcuts.tsx +++ b/plugins/shortcuts/src/Shortcuts.tsx @@ -15,7 +15,7 @@ */ import React, { useMemo } from 'react'; -import { useObservable } from 'react-use'; +import useObservable from 'react-use/lib/useObservable'; import PlayListAddIcon from '@material-ui/icons/PlaylistAdd'; import { ShortcutItem } from './ShortcutItem'; import { AddShortcut } from './AddShortcut'; diff --git a/plugins/sonarqube/src/components/SonarQubeCard/SonarQubeCard.tsx b/plugins/sonarqube/src/components/SonarQubeCard/SonarQubeCard.tsx index dede699203..ca3ddbda76 100644 --- a/plugins/sonarqube/src/components/SonarQubeCard/SonarQubeCard.tsx +++ b/plugins/sonarqube/src/components/SonarQubeCard/SonarQubeCard.tsx @@ -23,7 +23,7 @@ import LockOpen from '@material-ui/icons/LockOpen'; import Security from '@material-ui/icons/Security'; import SentimentVeryDissatisfied from '@material-ui/icons/SentimentVeryDissatisfied'; import React, { useMemo } from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { sonarQubeApiRef } from '../../api'; import { SONARQUBE_PROJECT_KEY_ANNOTATION, diff --git a/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx b/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx index 5a645f0559..bca53a3b0a 100644 --- a/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx +++ b/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ import React, { useCallback, useState } from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { Entity } from '@backstage/catalog-model'; import { useEntity } from '@backstage/plugin-catalog-react'; import { diff --git a/plugins/splunk-on-call/src/components/Escalation/EscalationPolicy.tsx b/plugins/splunk-on-call/src/components/Escalation/EscalationPolicy.tsx index 066fa954ad..9718aeacb7 100644 --- a/plugins/splunk-on-call/src/components/Escalation/EscalationPolicy.tsx +++ b/plugins/splunk-on-call/src/components/Escalation/EscalationPolicy.tsx @@ -24,7 +24,7 @@ import { } from '@material-ui/core'; import { EscalationUsersEmptyState } from './EscalationUsersEmptyState'; import { EscalationUser } from './EscalationUser'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { splunkOnCallApiRef } from '../../api'; import { Alert } from '@material-ui/lab'; import { User } from '../types'; diff --git a/plugins/splunk-on-call/src/components/Incident/IncidentListItem.tsx b/plugins/splunk-on-call/src/components/Incident/IncidentListItem.tsx index 21bc7c35d2..570b47483f 100644 --- a/plugins/splunk-on-call/src/components/Incident/IncidentListItem.tsx +++ b/plugins/splunk-on-call/src/components/Incident/IncidentListItem.tsx @@ -31,7 +31,7 @@ import { DateTime, Duration } from 'luxon'; import { Incident, IncidentPhase } from '../types'; import OpenInBrowserIcon from '@material-ui/icons/OpenInBrowser'; import { splunkOnCallApiRef } from '../../api/client'; -import { useAsyncFn } from 'react-use'; +import useAsyncFn from 'react-use/lib/useAsyncFn'; import { TriggerAlarmRequest } from '../../api/types'; import { diff --git a/plugins/splunk-on-call/src/components/Incident/Incidents.tsx b/plugins/splunk-on-call/src/components/Incident/Incidents.tsx index 7dd95179dd..3c557773fd 100644 --- a/plugins/splunk-on-call/src/components/Incident/Incidents.tsx +++ b/plugins/splunk-on-call/src/components/Incident/Incidents.tsx @@ -24,7 +24,7 @@ import { } from '@material-ui/core'; import { IncidentListItem } from './IncidentListItem'; import { IncidentsEmptyState } from './IncidentEmptyState'; -import { useAsyncFn } from 'react-use'; +import useAsyncFn from 'react-use/lib/useAsyncFn'; import { splunkOnCallApiRef } from '../../api'; import { Alert } from '@material-ui/lab'; diff --git a/plugins/splunk-on-call/src/components/TriggerDialog/TriggerDialog.tsx b/plugins/splunk-on-call/src/components/TriggerDialog/TriggerDialog.tsx index 4d2c60f7b2..82dd2da74d 100644 --- a/plugins/splunk-on-call/src/components/TriggerDialog/TriggerDialog.tsx +++ b/plugins/splunk-on-call/src/components/TriggerDialog/TriggerDialog.tsx @@ -32,7 +32,7 @@ import { FormControl, InputLabel, } from '@material-ui/core'; -import { useAsyncFn } from 'react-use'; +import useAsyncFn from 'react-use/lib/useAsyncFn'; import { splunkOnCallApiRef } from '../../api'; import { Alert } from '@material-ui/lab'; import { TriggerAlarmRequest } from '../../api/types'; diff --git a/plugins/tech-insights/src/components/ScorecardsOverview/ScorecardsOverview.tsx b/plugins/tech-insights/src/components/ScorecardsOverview/ScorecardsOverview.tsx index 92a57bd643..ecd9deffcc 100644 --- a/plugins/tech-insights/src/components/ScorecardsOverview/ScorecardsOverview.tsx +++ b/plugins/tech-insights/src/components/ScorecardsOverview/ScorecardsOverview.tsx @@ -16,7 +16,7 @@ import React from 'react'; import { useParams } from 'react-router-dom'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { Progress } from '@backstage/core-components'; import { useApi } from '@backstage/core-plugin-api'; import { ChecksOverview } from './ChecksOverview'; diff --git a/plugins/tech-radar/src/components/RadarComponent.tsx b/plugins/tech-radar/src/components/RadarComponent.tsx index b439fb4d08..e26d44aa1a 100644 --- a/plugins/tech-radar/src/components/RadarComponent.tsx +++ b/plugins/tech-radar/src/components/RadarComponent.tsx @@ -17,7 +17,7 @@ import { Progress } from '@backstage/core-components'; import { errorApiRef, useApi } from '@backstage/core-plugin-api'; import React, { useEffect } from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { RadarEntry, techRadarApiRef, TechRadarLoaderResponse } from '../api'; import Radar from '../components/Radar'; import { Entry } from '../utils/types'; diff --git a/plugins/techdocs/src/home/components/DocsTable.tsx b/plugins/techdocs/src/home/components/DocsTable.tsx index 83d6f05788..a00d608b0f 100644 --- a/plugins/techdocs/src/home/components/DocsTable.tsx +++ b/plugins/techdocs/src/home/components/DocsTable.tsx @@ -15,7 +15,7 @@ */ import React from 'react'; -import { useCopyToClipboard } from 'react-use'; +import useCopyToClipboard from 'react-use/lib/useCopyToClipboard'; import { useRouteRef, useApi, configApiRef } from '@backstage/core-plugin-api'; import { Entity, RELATION_OWNED_BY } from '@backstage/catalog-model'; diff --git a/plugins/techdocs/src/home/components/EntityListDocsTable.tsx b/plugins/techdocs/src/home/components/EntityListDocsTable.tsx index b94e7adace..4d136591ff 100644 --- a/plugins/techdocs/src/home/components/EntityListDocsTable.tsx +++ b/plugins/techdocs/src/home/components/EntityListDocsTable.tsx @@ -15,7 +15,7 @@ */ import React from 'react'; -import { useCopyToClipboard } from 'react-use'; +import useCopyToClipboard from 'react-use/lib/useCopyToClipboard'; import { capitalize } from 'lodash'; import { CodeSnippet, diff --git a/plugins/techdocs/src/home/components/TechDocsCustomHome.tsx b/plugins/techdocs/src/home/components/TechDocsCustomHome.tsx index 9400ca3205..b32cadaa05 100644 --- a/plugins/techdocs/src/home/components/TechDocsCustomHome.tsx +++ b/plugins/techdocs/src/home/components/TechDocsCustomHome.tsx @@ -15,7 +15,7 @@ */ import React, { useState } from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { makeStyles } from '@material-ui/core'; import { CSSProperties } from '@material-ui/styles'; import { diff --git a/plugins/techdocs/src/reader/components/LegacyTechDocsPage.tsx b/plugins/techdocs/src/reader/components/LegacyTechDocsPage.tsx index cf4a751296..f3384e21b3 100644 --- a/plugins/techdocs/src/reader/components/LegacyTechDocsPage.tsx +++ b/plugins/techdocs/src/reader/components/LegacyTechDocsPage.tsx @@ -16,7 +16,7 @@ import React, { useCallback, useState } from 'react'; import { useParams } from 'react-router-dom'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { techdocsApiRef } from '../../api'; import { TechDocsNotFound } from './TechDocsNotFound'; import { useApi } from '@backstage/core-plugin-api'; diff --git a/plugins/techdocs/src/reader/components/TechDocsPage.tsx b/plugins/techdocs/src/reader/components/TechDocsPage.tsx index a8db3e1d15..aae88d406e 100644 --- a/plugins/techdocs/src/reader/components/TechDocsPage.tsx +++ b/plugins/techdocs/src/reader/components/TechDocsPage.tsx @@ -17,7 +17,7 @@ import React, { useCallback, useState } from 'react'; import { useOutlet } from 'react-router'; import { useParams } from 'react-router-dom'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { techdocsApiRef } from '../../api'; import { TechDocsNotFound } from './TechDocsNotFound'; import { LegacyTechDocsPage } from './LegacyTechDocsPage'; diff --git a/plugins/techdocs/src/reader/components/TechDocsSearch.tsx b/plugins/techdocs/src/reader/components/TechDocsSearch.tsx index 5bc1947ed6..0760eb47f8 100644 --- a/plugins/techdocs/src/reader/components/TechDocsSearch.tsx +++ b/plugins/techdocs/src/reader/components/TechDocsSearch.tsx @@ -27,7 +27,7 @@ import SearchIcon from '@material-ui/icons/Search'; import Autocomplete from '@material-ui/lab/Autocomplete'; import React, { ChangeEvent, useEffect, useState } from 'react'; import { useNavigate } from 'react-router'; -import { useDebounce } from 'react-use'; +import useDebounce from 'react-use/lib/useDebounce'; import { DocsResultListItem } from '../../components/DocsResultListItem'; type TechDocsSearchProps = { diff --git a/plugins/techdocs/src/reader/components/useRawPage.ts b/plugins/techdocs/src/reader/components/useRawPage.ts index 377a2d23ef..61b04a5a82 100644 --- a/plugins/techdocs/src/reader/components/useRawPage.ts +++ b/plugins/techdocs/src/reader/components/useRawPage.ts @@ -14,7 +14,7 @@ * limitations under the License. */ import { EntityName } from '@backstage/catalog-model'; -import { useAsyncRetry } from 'react-use'; +import useAsyncRetry from 'react-use/lib/useAsyncRetry'; import { AsyncState } from 'react-use/lib/useAsync'; import { techdocsStorageApiRef } from '../../api'; import { useApi } from '@backstage/core-plugin-api'; diff --git a/plugins/techdocs/src/reader/components/useReaderState.ts b/plugins/techdocs/src/reader/components/useReaderState.ts index 07bd338de9..8bccb3cdb8 100644 --- a/plugins/techdocs/src/reader/components/useReaderState.ts +++ b/plugins/techdocs/src/reader/components/useReaderState.ts @@ -16,7 +16,8 @@ import { useApi } from '@backstage/core-plugin-api'; import { useMemo, useReducer, useRef } from 'react'; -import { useAsync, useAsyncRetry } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; +import useAsyncRetry from 'react-use/lib/useAsyncRetry'; import { techdocsStorageApiRef } from '../../api'; /** diff --git a/plugins/user-settings/src/components/General/UserSettingsThemeToggle.tsx b/plugins/user-settings/src/components/General/UserSettingsThemeToggle.tsx index 35850b9d82..333050f2a4 100644 --- a/plugins/user-settings/src/components/General/UserSettingsThemeToggle.tsx +++ b/plugins/user-settings/src/components/General/UserSettingsThemeToggle.tsx @@ -15,7 +15,7 @@ */ import React, { cloneElement } from 'react'; -import { useObservable } from 'react-use'; +import useObservable from 'react-use/lib/useObservable'; import AutoIcon from '@material-ui/icons/BrightnessAuto'; import ToggleButton from '@material-ui/lab/ToggleButton'; import ToggleButtonGroup from '@material-ui/lab/ToggleButtonGroup'; diff --git a/plugins/user-settings/src/components/useUserProfileInfo.ts b/plugins/user-settings/src/components/useUserProfileInfo.ts index 6f9b5c154e..f893520cd2 100644 --- a/plugins/user-settings/src/components/useUserProfileInfo.ts +++ b/plugins/user-settings/src/components/useUserProfileInfo.ts @@ -21,7 +21,7 @@ import { useApi, } from '@backstage/core-plugin-api'; import { useEffect } from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; export const useUserProfile = () => { const identityApi = useApi(identityApiRef); diff --git a/plugins/xcmetrics/src/components/BuildDetails/BuildDetails.tsx b/plugins/xcmetrics/src/components/BuildDetails/BuildDetails.tsx index 8732bd92d8..949f430ce2 100644 --- a/plugins/xcmetrics/src/components/BuildDetails/BuildDetails.tsx +++ b/plugins/xcmetrics/src/components/BuildDetails/BuildDetails.tsx @@ -18,7 +18,7 @@ import React from 'react'; import { BuildResponse, xcmetricsApiRef } from '../../api'; import { Progress, StructuredMetadataTable } from '@backstage/core-components'; import { Alert } from '@material-ui/lab'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { useApi } from '@backstage/core-plugin-api'; import { formatDuration, formatStatus, formatTime } from '../../utils'; import { StatusIcon } from '../StatusIcon'; diff --git a/plugins/xcmetrics/src/components/BuildListFilter/BuildListFilter.tsx b/plugins/xcmetrics/src/components/BuildListFilter/BuildListFilter.tsx index 8c1334f928..9a2b759235 100644 --- a/plugins/xcmetrics/src/components/BuildListFilter/BuildListFilter.tsx +++ b/plugins/xcmetrics/src/components/BuildListFilter/BuildListFilter.tsx @@ -20,7 +20,7 @@ import FilterList from '@material-ui/icons/FilterList'; import { InfoCard, Select } from '@backstage/core-components'; import { BackstageTheme } from '@backstage/theme'; import { useApi } from '@backstage/core-plugin-api'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { BuildFilters, BuildStatus, xcmetricsApiRef } from '../../api'; import { DatePicker } from '../DatePicker'; diff --git a/plugins/xcmetrics/src/components/Overview/Overview.tsx b/plugins/xcmetrics/src/components/Overview/Overview.tsx index e7a9a1d705..22fd3185a0 100644 --- a/plugins/xcmetrics/src/components/Overview/Overview.tsx +++ b/plugins/xcmetrics/src/components/Overview/Overview.tsx @@ -24,7 +24,7 @@ import { } from '@backstage/core-components'; import { useApi } from '@backstage/core-plugin-api'; import { xcmetricsApiRef } from '../../api'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { Alert } from '@material-ui/lab'; import { StatusMatrix } from '../StatusMatrix'; import { Grid } from '@material-ui/core'; diff --git a/plugins/xcmetrics/src/components/OverviewTrends/OverviewTrends.tsx b/plugins/xcmetrics/src/components/OverviewTrends/OverviewTrends.tsx index 8b16d689bb..4c791688be 100644 --- a/plugins/xcmetrics/src/components/OverviewTrends/OverviewTrends.tsx +++ b/plugins/xcmetrics/src/components/OverviewTrends/OverviewTrends.tsx @@ -19,7 +19,7 @@ import { Progress, Select } from '@backstage/core-components'; import { Trend } from '../Trend'; import { Alert, AlertTitle } from '@material-ui/lab'; import { xcmetricsApiRef } from '../../api'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { useApi } from '@backstage/core-plugin-api'; import { DataValueGridItem } from '../DataValue'; import { diff --git a/plugins/xcmetrics/src/components/StatusCell/StatusCell.tsx b/plugins/xcmetrics/src/components/StatusCell/StatusCell.tsx index 2cdb5c9d39..387879b3a0 100644 --- a/plugins/xcmetrics/src/components/StatusCell/StatusCell.tsx +++ b/plugins/xcmetrics/src/components/StatusCell/StatusCell.tsx @@ -18,7 +18,7 @@ import React from 'react'; import { BackstageTheme } from '@backstage/theme'; import { BuildStatus, BuildStatusResult, xcmetricsApiRef } from '../../api'; import { cn, formatDuration, formatStatus } from '../../utils'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { useApi } from '@backstage/core-plugin-api'; import { Progress } from '@backstage/core-components'; diff --git a/plugins/xcmetrics/src/components/StatusMatrix/StatusMatrix.tsx b/plugins/xcmetrics/src/components/StatusMatrix/StatusMatrix.tsx index e7f3294e6d..6e78c822ad 100644 --- a/plugins/xcmetrics/src/components/StatusMatrix/StatusMatrix.tsx +++ b/plugins/xcmetrics/src/components/StatusMatrix/StatusMatrix.tsx @@ -17,7 +17,8 @@ import React from 'react'; import { makeStyles } from '@material-ui/core'; import { BackstageTheme } from '@backstage/theme'; import { xcmetricsApiRef } from '../../api'; -import { useAsync, useMeasure } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; +import useMeasure from 'react-use/lib/useMeasure'; import { cn } from '../../utils'; import { useApi } from '@backstage/core-plugin-api'; import { Alert } from '@material-ui/lab';