From 2a85f4715a36ea14dfb7af6d06eb2c5e4278b219 Mon Sep 17 00:00:00 2001 From: Timothy Deakin Date: Thu, 14 Mar 2024 17:55:55 +0000 Subject: [PATCH] refactor: update material ui imports Signed-off-by: Timothy Deakin --- plugins/catalog-import/dev/index.tsx | 5 ++++- .../src/components/Buttons/index.tsx | 3 ++- .../DefaultImportPage/DefaultImportPage.tsx | 4 +++- .../EntityListComponent/EntityListComponent.tsx | 16 +++++++--------- .../components/ImportInfoCard/ImportInfoCard.tsx | 3 ++- .../components/ImportStepper/ImportStepper.tsx | 4 +++- .../src/components/ImportStepper/defaults.tsx | 16 +++++++--------- .../StepFinishImportLocation.tsx | 3 ++- .../StepInitAnalyzeUrl/StepInitAnalyzeUrl.tsx | 4 +++- .../AutocompleteTextField.tsx | 5 +++-- .../PreparePullRequestForm.test.tsx | 3 ++- .../PreviewCatalogInfoComponent.test.tsx | 2 +- .../PreviewCatalogInfoComponent.tsx | 4 +++- .../PreviewPullRequestComponent.test.tsx | 2 +- .../PreviewPullRequestComponent.tsx | 4 +++- .../StepPrepareCreatePullRequest.test.tsx | 2 +- .../StepPrepareCreatePullRequest.tsx | 5 ++++- .../StepPrepareSelectLocations.tsx | 14 ++++++-------- .../StepReviewLocation/StepReviewLocation.tsx | 4 +++- 19 files changed, 60 insertions(+), 43 deletions(-) diff --git a/plugins/catalog-import/dev/index.tsx b/plugins/catalog-import/dev/index.tsx index e2e5e1d22c..b35dc2a298 100644 --- a/plugins/catalog-import/dev/index.tsx +++ b/plugins/catalog-import/dev/index.tsx @@ -18,7 +18,10 @@ import { CatalogApi } from '@backstage/catalog-client'; import { Entity, CompoundEntityRef } from '@backstage/catalog-model'; import { createDevApp } from '@backstage/dev-utils'; import { catalogApiRef } from '@backstage/plugin-catalog-react'; -import { Grid, ListItem, ListItemIcon, ListItemText } from '@material-ui/core'; +import Grid from '@material-ui/core/Grid'; +import ListItem from '@material-ui/core/ListItem'; +import ListItemIcon from '@material-ui/core/ListItemIcon'; +import ListItemText from '@material-ui/core/ListItemText'; import AlarmIcon from '@material-ui/icons/Alarm'; import LocationOnIcon from '@material-ui/icons/LocationOn'; import React from 'react'; diff --git a/plugins/catalog-import/src/components/Buttons/index.tsx b/plugins/catalog-import/src/components/Buttons/index.tsx index 4b9043cd6d..cdcb2169a6 100644 --- a/plugins/catalog-import/src/components/Buttons/index.tsx +++ b/plugins/catalog-import/src/components/Buttons/index.tsx @@ -15,7 +15,8 @@ */ import { LinkButton } from '@backstage/core-components'; -import { Button, CircularProgress } from '@material-ui/core'; +import Button from '@material-ui/core/Button'; +import CircularProgress from '@material-ui/core/CircularProgress'; import { makeStyles } from '@material-ui/core/styles'; import React, { ComponentProps } from 'react'; diff --git a/plugins/catalog-import/src/components/DefaultImportPage/DefaultImportPage.tsx b/plugins/catalog-import/src/components/DefaultImportPage/DefaultImportPage.tsx index aad6e8686e..680ce16ae4 100644 --- a/plugins/catalog-import/src/components/DefaultImportPage/DefaultImportPage.tsx +++ b/plugins/catalog-import/src/components/DefaultImportPage/DefaultImportPage.tsx @@ -22,7 +22,9 @@ import { SupportButton, } from '@backstage/core-components'; import { configApiRef, useApi } from '@backstage/core-plugin-api'; -import { Grid, useMediaQuery, useTheme } from '@material-ui/core'; +import Grid from '@material-ui/core/Grid'; +import useMediaQuery from '@material-ui/core/useMediaQuery'; +import { useTheme } from '@material-ui/core/styles'; import React from 'react'; import { ImportInfoCard } from '../ImportInfoCard'; import { ImportStepper } from '../ImportStepper'; diff --git a/plugins/catalog-import/src/components/EntityListComponent/EntityListComponent.tsx b/plugins/catalog-import/src/components/EntityListComponent/EntityListComponent.tsx index 86030758a7..ef57fad204 100644 --- a/plugins/catalog-import/src/components/EntityListComponent/EntityListComponent.tsx +++ b/plugins/catalog-import/src/components/EntityListComponent/EntityListComponent.tsx @@ -20,15 +20,13 @@ import { EntityRefLink, humanizeEntityRef, } from '@backstage/plugin-catalog-react'; -import { - Collapse, - IconButton, - List, - ListItem, - ListItemIcon, - ListItemSecondaryAction, - ListItemText, -} from '@material-ui/core'; +import Collapse from '@material-ui/core/Collapse'; +import IconButton from '@material-ui/core/IconButton'; +import List from '@material-ui/core/List'; +import ListItem from '@material-ui/core/ListItem'; +import ListItemIcon from '@material-ui/core/ListItemIcon'; +import ListItemSecondaryAction from '@material-ui/core/ListItemSecondaryAction'; +import ListItemText from '@material-ui/core/ListItemText'; import { makeStyles } from '@material-ui/core/styles'; import ExpandLessIcon from '@material-ui/icons/ExpandLess'; import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; diff --git a/plugins/catalog-import/src/components/ImportInfoCard/ImportInfoCard.tsx b/plugins/catalog-import/src/components/ImportInfoCard/ImportInfoCard.tsx index 26b6b8eb52..be8a457572 100644 --- a/plugins/catalog-import/src/components/ImportInfoCard/ImportInfoCard.tsx +++ b/plugins/catalog-import/src/components/ImportInfoCard/ImportInfoCard.tsx @@ -16,7 +16,8 @@ import { InfoCard } from '@backstage/core-components'; import { configApiRef, useApi } from '@backstage/core-plugin-api'; -import { Chip, Typography } from '@material-ui/core'; +import Chip from '@material-ui/core/Chip'; +import Typography from '@material-ui/core/Typography'; import React from 'react'; import { catalogImportApiRef } from '../../api'; import { useCatalogFilename } from '../../hooks'; diff --git a/plugins/catalog-import/src/components/ImportStepper/ImportStepper.tsx b/plugins/catalog-import/src/components/ImportStepper/ImportStepper.tsx index b2638e582e..38c33a02e4 100644 --- a/plugins/catalog-import/src/components/ImportStepper/ImportStepper.tsx +++ b/plugins/catalog-import/src/components/ImportStepper/ImportStepper.tsx @@ -16,7 +16,9 @@ import { InfoCard, InfoCardVariants } from '@backstage/core-components'; import { useApi } from '@backstage/core-plugin-api'; -import { Step, StepContent, Stepper } from '@material-ui/core'; +import Step from '@material-ui/core/Step'; +import StepContent from '@material-ui/core/StepContent'; +import Stepper from '@material-ui/core/Stepper'; import { makeStyles } from '@material-ui/core/styles'; import React, { useMemo } from 'react'; import { catalogImportApiRef } from '../../api'; diff --git a/plugins/catalog-import/src/components/ImportStepper/defaults.tsx b/plugins/catalog-import/src/components/ImportStepper/defaults.tsx index 94dff39d0f..0acde07a39 100644 --- a/plugins/catalog-import/src/components/ImportStepper/defaults.tsx +++ b/plugins/catalog-import/src/components/ImportStepper/defaults.tsx @@ -14,15 +14,13 @@ * limitations under the License. */ -import { - Box, - Checkbox, - FormControlLabel, - FormHelperText, - StepLabel, - TextField, - Typography, -} from '@material-ui/core'; +import Box from '@material-ui/core/Box'; +import Checkbox from '@material-ui/core/Checkbox'; +import FormControlLabel from '@material-ui/core/FormControlLabel'; +import FormHelperText from '@material-ui/core/FormHelperText'; +import StepLabel from '@material-ui/core/StepLabel'; +import TextField from '@material-ui/core/TextField'; +import Typography from '@material-ui/core/Typography'; import React from 'react'; import { BackButton } from '../Buttons'; import { asInputRef } from '../helpers'; diff --git a/plugins/catalog-import/src/components/StepFinishImportLocation/StepFinishImportLocation.tsx b/plugins/catalog-import/src/components/StepFinishImportLocation/StepFinishImportLocation.tsx index 9e19eea6d2..47cee21045 100644 --- a/plugins/catalog-import/src/components/StepFinishImportLocation/StepFinishImportLocation.tsx +++ b/plugins/catalog-import/src/components/StepFinishImportLocation/StepFinishImportLocation.tsx @@ -14,7 +14,8 @@ * limitations under the License. */ -import { Grid, Typography } from '@material-ui/core'; +import Grid from '@material-ui/core/Grid'; +import Typography from '@material-ui/core/Typography'; import LocationOnIcon from '@material-ui/icons/LocationOn'; import React from 'react'; import { BackButton, ViewComponentButton } from '../Buttons'; diff --git a/plugins/catalog-import/src/components/StepInitAnalyzeUrl/StepInitAnalyzeUrl.tsx b/plugins/catalog-import/src/components/StepInitAnalyzeUrl/StepInitAnalyzeUrl.tsx index 588217974c..2cf4e58ee9 100644 --- a/plugins/catalog-import/src/components/StepInitAnalyzeUrl/StepInitAnalyzeUrl.tsx +++ b/plugins/catalog-import/src/components/StepInitAnalyzeUrl/StepInitAnalyzeUrl.tsx @@ -15,7 +15,9 @@ */ import { errorApiRef, useApi } from '@backstage/core-plugin-api'; -import { FormHelperText, Grid, TextField } from '@material-ui/core'; +import FormHelperText from '@material-ui/core/FormHelperText'; +import Grid from '@material-ui/core/Grid'; +import TextField from '@material-ui/core/TextField'; import React, { useCallback, useState } from 'react'; import { useForm } from 'react-hook-form'; import { AnalyzeResult, catalogImportApiRef } from '../../api'; diff --git a/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/AutocompleteTextField.tsx b/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/AutocompleteTextField.tsx index 2e163be2aa..1e28b973db 100644 --- a/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/AutocompleteTextField.tsx +++ b/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/AutocompleteTextField.tsx @@ -14,9 +14,10 @@ * limitations under the License. */ -import { CircularProgress, TextField } from '@material-ui/core'; +import CircularProgress from '@material-ui/core/CircularProgress'; +import TextField from '@material-ui/core/TextField'; import { TextFieldProps } from '@material-ui/core/TextField/TextField'; -import { Autocomplete } from '@material-ui/lab'; +import Autocomplete from '@material-ui/lab/Autocomplete'; import React from 'react'; import { Controller, FieldErrors } from 'react-hook-form'; diff --git a/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/PreparePullRequestForm.test.tsx b/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/PreparePullRequestForm.test.tsx index 54d5c27993..bee641ca68 100644 --- a/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/PreparePullRequestForm.test.tsx +++ b/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/PreparePullRequestForm.test.tsx @@ -14,7 +14,8 @@ * limitations under the License. */ -import { FormHelperText, TextField } from '@material-ui/core'; +import FormHelperText from '@material-ui/core/FormHelperText'; +import TextField from '@material-ui/core/TextField'; import Button from '@material-ui/core/Button'; import { act, render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; diff --git a/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/PreviewCatalogInfoComponent.test.tsx b/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/PreviewCatalogInfoComponent.test.tsx index 4e737bd115..1ed8026a2b 100644 --- a/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/PreviewCatalogInfoComponent.test.tsx +++ b/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/PreviewCatalogInfoComponent.test.tsx @@ -17,7 +17,7 @@ import { Entity } from '@backstage/catalog-model'; import { configApiRef } from '@backstage/core-plugin-api'; import { MockConfigApi, TestApiProvider } from '@backstage/test-utils'; -import { makeStyles } from '@material-ui/core'; +import { makeStyles } from '@material-ui/core/styles'; import { render, screen } from '@testing-library/react'; import { renderHook } from '@testing-library/react'; import React from 'react'; diff --git a/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/PreviewCatalogInfoComponent.tsx b/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/PreviewCatalogInfoComponent.tsx index a16276f90b..a5e3c58448 100644 --- a/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/PreviewCatalogInfoComponent.tsx +++ b/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/PreviewCatalogInfoComponent.tsx @@ -15,7 +15,9 @@ */ import { Entity } from '@backstage/catalog-model'; -import { Card, CardContent, CardHeader } from '@material-ui/core'; +import Card from '@material-ui/core/Card'; +import CardContent from '@material-ui/core/CardContent'; +import CardHeader from '@material-ui/core/CardHeader'; import React from 'react'; import YAML from 'yaml'; import { CodeSnippet } from '@backstage/core-components'; diff --git a/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/PreviewPullRequestComponent.test.tsx b/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/PreviewPullRequestComponent.test.tsx index 53485bedb5..0d0660a543 100644 --- a/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/PreviewPullRequestComponent.test.tsx +++ b/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/PreviewPullRequestComponent.test.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { makeStyles } from '@material-ui/core'; +import { makeStyles } from '@material-ui/core/styles'; import { render, screen } from '@testing-library/react'; import { renderHook } from '@testing-library/react'; import React from 'react'; diff --git a/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/PreviewPullRequestComponent.tsx b/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/PreviewPullRequestComponent.tsx index e8a54489a0..dea1243202 100644 --- a/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/PreviewPullRequestComponent.tsx +++ b/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/PreviewPullRequestComponent.tsx @@ -14,7 +14,9 @@ * limitations under the License. */ -import { Card, CardContent, CardHeader } from '@material-ui/core'; +import Card from '@material-ui/core/Card'; +import CardContent from '@material-ui/core/CardContent'; +import CardHeader from '@material-ui/core/CardHeader'; import React from 'react'; import { MarkdownContent } from '@backstage/core-components'; diff --git a/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/StepPrepareCreatePullRequest.test.tsx b/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/StepPrepareCreatePullRequest.test.tsx index 079b010ec6..ec7762f50f 100644 --- a/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/StepPrepareCreatePullRequest.test.tsx +++ b/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/StepPrepareCreatePullRequest.test.tsx @@ -17,7 +17,7 @@ import { configApiRef, errorApiRef } from '@backstage/core-plugin-api'; import { catalogApiRef } from '@backstage/plugin-catalog-react'; import { TestApiProvider, MockConfigApi } from '@backstage/test-utils'; -import { TextField } from '@material-ui/core'; +import TextField from '@material-ui/core/TextField'; import { render, screen, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import React from 'react'; diff --git a/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/StepPrepareCreatePullRequest.tsx b/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/StepPrepareCreatePullRequest.tsx index 1cbdfce355..580f21b16f 100644 --- a/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/StepPrepareCreatePullRequest.tsx +++ b/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/StepPrepareCreatePullRequest.tsx @@ -21,7 +21,10 @@ import { catalogApiRef, humanizeEntityRef, } from '@backstage/plugin-catalog-react'; -import { Box, FormHelperText, Grid, Typography } from '@material-ui/core'; +import Box from '@material-ui/core/Box'; +import FormHelperText from '@material-ui/core/FormHelperText'; +import Grid from '@material-ui/core/Grid'; +import Typography from '@material-ui/core/Typography'; import { makeStyles } from '@material-ui/core/styles'; import React, { useCallback, useEffect, useState } from 'react'; import { UnpackNestedValue, UseFormReturn } from 'react-hook-form'; diff --git a/plugins/catalog-import/src/components/StepPrepareSelectLocations/StepPrepareSelectLocations.tsx b/plugins/catalog-import/src/components/StepPrepareSelectLocations/StepPrepareSelectLocations.tsx index 210b49d188..9ba7904fe4 100644 --- a/plugins/catalog-import/src/components/StepPrepareSelectLocations/StepPrepareSelectLocations.tsx +++ b/plugins/catalog-import/src/components/StepPrepareSelectLocations/StepPrepareSelectLocations.tsx @@ -14,14 +14,12 @@ * limitations under the License. */ -import { - Checkbox, - Grid, - ListItem, - ListItemIcon, - ListItemText, - Typography, -} from '@material-ui/core'; +import Checkbox from '@material-ui/core/Checkbox'; +import Grid from '@material-ui/core/Grid'; +import ListItem from '@material-ui/core/ListItem'; +import ListItemIcon from '@material-ui/core/ListItemIcon'; +import ListItemText from '@material-ui/core/ListItemText'; +import Typography from '@material-ui/core/Typography'; import LocationOnIcon from '@material-ui/icons/LocationOn'; import React, { useCallback, useState } from 'react'; import { AnalyzeResult } from '../../api'; diff --git a/plugins/catalog-import/src/components/StepReviewLocation/StepReviewLocation.tsx b/plugins/catalog-import/src/components/StepReviewLocation/StepReviewLocation.tsx index b0db174787..c0c3b2c428 100644 --- a/plugins/catalog-import/src/components/StepReviewLocation/StepReviewLocation.tsx +++ b/plugins/catalog-import/src/components/StepReviewLocation/StepReviewLocation.tsx @@ -15,7 +15,9 @@ */ import { catalogApiRef } from '@backstage/plugin-catalog-react'; -import { FormHelperText, Grid, Typography } from '@material-ui/core'; +import FormHelperText from '@material-ui/core/FormHelperText'; +import Grid from '@material-ui/core/Grid'; +import Typography from '@material-ui/core/Typography'; import LocationOnIcon from '@material-ui/icons/LocationOn'; import React, { useCallback, useState } from 'react'; import { BackButton, NextButton } from '../Buttons';