diff --git a/.changeset/eight-eggs-deny.md b/.changeset/eight-eggs-deny.md new file mode 100644 index 0000000000..2e2253e079 --- /dev/null +++ b/.changeset/eight-eggs-deny.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-kubernetes-react': patch +--- + +Added the `no-top-level-material-ui-4-imports` ESLint rule to aid with the migration to Material UI v5 diff --git a/plugins/kubernetes-react/.eslintrc.js b/plugins/kubernetes-react/.eslintrc.js index e2a53a6ad2..e487f765b2 100644 --- a/plugins/kubernetes-react/.eslintrc.js +++ b/plugins/kubernetes-react/.eslintrc.js @@ -1 +1,5 @@ -module.exports = require('@backstage/cli/config/eslint-factory')(__dirname); +module.exports = require('@backstage/cli/config/eslint-factory')(__dirname, { + rules: { + '@backstage/no-top-level-material-ui-4-imports': 'error', + }, +}); diff --git a/plugins/kubernetes-react/src/components/Cluster/Cluster.tsx b/plugins/kubernetes-react/src/components/Cluster/Cluster.tsx index d713b9a873..76661d5a47 100644 --- a/plugins/kubernetes-react/src/components/Cluster/Cluster.tsx +++ b/plugins/kubernetes-react/src/components/Cluster/Cluster.tsx @@ -15,13 +15,11 @@ */ import React from 'react'; -import { - Accordion, - AccordionDetails, - AccordionSummary, - Grid, - Typography, -} from '@material-ui/core'; +import Accordion from '@material-ui/core/Accordion'; +import AccordionDetails from '@material-ui/core/AccordionDetails'; +import AccordionSummary from '@material-ui/core/AccordionSummary'; +import Grid from '@material-ui/core/Grid'; +import Typography from '@material-ui/core/Typography'; import { ClientPodStatus, ClusterObjects, diff --git a/plugins/kubernetes-react/src/components/CronJobsAccordions/CronJobsAccordions.tsx b/plugins/kubernetes-react/src/components/CronJobsAccordions/CronJobsAccordions.tsx index e724c14fdf..7f718ea466 100644 --- a/plugins/kubernetes-react/src/components/CronJobsAccordions/CronJobsAccordions.tsx +++ b/plugins/kubernetes-react/src/components/CronJobsAccordions/CronJobsAccordions.tsx @@ -14,13 +14,11 @@ * limitations under the License. */ import React, { useContext } from 'react'; -import { - Accordion, - AccordionDetails, - AccordionSummary, - Grid, - Typography, -} from '@material-ui/core'; +import Accordion from '@material-ui/core/Accordion'; +import AccordionDetails from '@material-ui/core/AccordionDetails'; +import AccordionSummary from '@material-ui/core/AccordionSummary'; +import Grid from '@material-ui/core/Grid'; +import Typography from '@material-ui/core/Typography'; import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; import { V1CronJob, V1Job } from '@kubernetes/client-node'; import { JobsAccordions } from '../JobsAccordions'; diff --git a/plugins/kubernetes-react/src/components/CronJobsAccordions/CronJobsDrawer.tsx b/plugins/kubernetes-react/src/components/CronJobsAccordions/CronJobsDrawer.tsx index 45242af307..818108fc42 100644 --- a/plugins/kubernetes-react/src/components/CronJobsAccordions/CronJobsDrawer.tsx +++ b/plugins/kubernetes-react/src/components/CronJobsAccordions/CronJobsDrawer.tsx @@ -16,7 +16,9 @@ import React from 'react'; import { V1CronJob } from '@kubernetes/client-node'; import { KubernetesStructuredMetadataTableDrawer } from '../KubernetesDrawer'; -import { Typography, Grid, Chip } from '@material-ui/core'; +import Typography from '@material-ui/core/Typography'; +import Grid from '@material-ui/core/Grid'; +import Chip from '@material-ui/core/Chip'; export const CronJobDrawer = ({ cronJob, diff --git a/plugins/kubernetes-react/src/components/CustomResources/ArgoRollouts/Rollout.tsx b/plugins/kubernetes-react/src/components/CustomResources/ArgoRollouts/Rollout.tsx index 91039ec314..65749c2ea2 100644 --- a/plugins/kubernetes-react/src/components/CustomResources/ArgoRollouts/Rollout.tsx +++ b/plugins/kubernetes-react/src/components/CustomResources/ArgoRollouts/Rollout.tsx @@ -15,13 +15,11 @@ */ import React, { useContext } from 'react'; -import { - Accordion, - AccordionDetails, - AccordionSummary, - Grid, - Typography, -} from '@material-ui/core'; +import Accordion from '@material-ui/core/Accordion'; +import AccordionDetails from '@material-ui/core/AccordionDetails'; +import AccordionSummary from '@material-ui/core/AccordionSummary'; +import Grid from '@material-ui/core/Grid'; +import Typography from '@material-ui/core/Typography'; import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; import { V1Pod, V1HorizontalPodAutoscaler } from '@kubernetes/client-node'; import { PodsTable } from '../../Pods'; diff --git a/plugins/kubernetes-react/src/components/CustomResources/ArgoRollouts/RolloutDrawer.tsx b/plugins/kubernetes-react/src/components/CustomResources/ArgoRollouts/RolloutDrawer.tsx index 150f3bc186..304c8bdf78 100644 --- a/plugins/kubernetes-react/src/components/CustomResources/ArgoRollouts/RolloutDrawer.tsx +++ b/plugins/kubernetes-react/src/components/CustomResources/ArgoRollouts/RolloutDrawer.tsx @@ -16,7 +16,8 @@ import React from 'react'; import { KubernetesStructuredMetadataTableDrawer } from '../../KubernetesDrawer'; -import { Typography, Grid } from '@material-ui/core'; +import Typography from '@material-ui/core/Typography'; +import Grid from '@material-ui/core/Grid'; export const RolloutDrawer = ({ rollout, diff --git a/plugins/kubernetes-react/src/components/CustomResources/ArgoRollouts/StepsProgress.tsx b/plugins/kubernetes-react/src/components/CustomResources/ArgoRollouts/StepsProgress.tsx index c93ab41d1d..8885877e09 100644 --- a/plugins/kubernetes-react/src/components/CustomResources/ArgoRollouts/StepsProgress.tsx +++ b/plugins/kubernetes-react/src/components/CustomResources/ArgoRollouts/StepsProgress.tsx @@ -15,7 +15,9 @@ */ import React from 'react'; -import { Step, StepLabel, Stepper } from '@material-ui/core'; +import Step from '@material-ui/core/Step'; +import StepLabel from '@material-ui/core/StepLabel'; +import Stepper from '@material-ui/core/Stepper'; import Typography from '@material-ui/core/Typography'; import { ArgoRolloutCanaryStep, diff --git a/plugins/kubernetes-react/src/components/CustomResources/DefaultCustomResource.tsx b/plugins/kubernetes-react/src/components/CustomResources/DefaultCustomResource.tsx index 22629a1d6e..ee484ecda8 100644 --- a/plugins/kubernetes-react/src/components/CustomResources/DefaultCustomResource.tsx +++ b/plugins/kubernetes-react/src/components/CustomResources/DefaultCustomResource.tsx @@ -15,12 +15,10 @@ */ import React from 'react'; -import { - Accordion, - AccordionDetails, - AccordionSummary, - Grid, -} from '@material-ui/core'; +import Accordion from '@material-ui/core/Accordion'; +import AccordionDetails from '@material-ui/core/AccordionDetails'; +import AccordionSummary from '@material-ui/core/AccordionSummary'; +import Grid from '@material-ui/core/Grid'; import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; import { DefaultCustomResourceDrawer } from './DefaultCustomResourceDrawer'; import { StructuredMetadataTable } from '@backstage/core-components'; diff --git a/plugins/kubernetes-react/src/components/CustomResources/DefaultCustomResourceDrawer.tsx b/plugins/kubernetes-react/src/components/CustomResources/DefaultCustomResourceDrawer.tsx index 82dcd0746f..ccbc4b41ca 100644 --- a/plugins/kubernetes-react/src/components/CustomResources/DefaultCustomResourceDrawer.tsx +++ b/plugins/kubernetes-react/src/components/CustomResources/DefaultCustomResourceDrawer.tsx @@ -16,7 +16,8 @@ import React from 'react'; import { KubernetesStructuredMetadataTableDrawer } from '../KubernetesDrawer'; -import { Typography, Grid } from '@material-ui/core'; +import Typography from '@material-ui/core/Typography'; +import Grid from '@material-ui/core/Grid'; const capitalize = (str: string) => str.charAt(0).toLocaleUpperCase('en-US') + str.slice(1); diff --git a/plugins/kubernetes-react/src/components/DaemonSetsAccordions/DaemonSetsAccordions.tsx b/plugins/kubernetes-react/src/components/DaemonSetsAccordions/DaemonSetsAccordions.tsx index 834a86e837..cd9c0b8702 100644 --- a/plugins/kubernetes-react/src/components/DaemonSetsAccordions/DaemonSetsAccordions.tsx +++ b/plugins/kubernetes-react/src/components/DaemonSetsAccordions/DaemonSetsAccordions.tsx @@ -15,12 +15,10 @@ */ import React, { useContext } from 'react'; -import { - Accordion, - AccordionDetails, - AccordionSummary, - Grid, -} from '@material-ui/core'; +import Accordion from '@material-ui/core/Accordion'; +import AccordionDetails from '@material-ui/core/AccordionDetails'; +import AccordionSummary from '@material-ui/core/AccordionSummary'; +import Grid from '@material-ui/core/Grid'; import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; import { V1Pod, V1DaemonSet } from '@kubernetes/client-node'; import { PodsTable } from '../Pods'; diff --git a/plugins/kubernetes-react/src/components/DaemonSetsAccordions/DaemonSetsDrawer.tsx b/plugins/kubernetes-react/src/components/DaemonSetsAccordions/DaemonSetsDrawer.tsx index e0f64ed679..c03fb5bace 100644 --- a/plugins/kubernetes-react/src/components/DaemonSetsAccordions/DaemonSetsDrawer.tsx +++ b/plugins/kubernetes-react/src/components/DaemonSetsAccordions/DaemonSetsDrawer.tsx @@ -17,7 +17,9 @@ import React from 'react'; import { V1DaemonSet } from '@kubernetes/client-node'; import { KubernetesStructuredMetadataTableDrawer } from '../KubernetesDrawer'; -import { Typography, Grid, Chip } from '@material-ui/core'; +import Typography from '@material-ui/core/Typography'; +import Grid from '@material-ui/core/Grid'; +import Chip from '@material-ui/core/Chip'; export const DaemonSetDrawer = ({ daemonset, diff --git a/plugins/kubernetes-react/src/components/DeploymentsAccordions/DeploymentDrawer.tsx b/plugins/kubernetes-react/src/components/DeploymentsAccordions/DeploymentDrawer.tsx index 0fc8463f73..aff771a349 100644 --- a/plugins/kubernetes-react/src/components/DeploymentsAccordions/DeploymentDrawer.tsx +++ b/plugins/kubernetes-react/src/components/DeploymentsAccordions/DeploymentDrawer.tsx @@ -18,7 +18,9 @@ import React from 'react'; import { V1Deployment } from '@kubernetes/client-node'; import { KubernetesStructuredMetadataTableDrawer } from '../KubernetesDrawer'; import { renderCondition } from '../../utils/pod'; -import { Typography, Grid, Chip } from '@material-ui/core'; +import Typography from '@material-ui/core/Typography'; +import Grid from '@material-ui/core/Grid'; +import Chip from '@material-ui/core/Chip'; export const DeploymentDrawer = ({ deployment, diff --git a/plugins/kubernetes-react/src/components/DeploymentsAccordions/DeploymentsAccordions.tsx b/plugins/kubernetes-react/src/components/DeploymentsAccordions/DeploymentsAccordions.tsx index 8432b9d133..3d048f22df 100644 --- a/plugins/kubernetes-react/src/components/DeploymentsAccordions/DeploymentsAccordions.tsx +++ b/plugins/kubernetes-react/src/components/DeploymentsAccordions/DeploymentsAccordions.tsx @@ -15,13 +15,11 @@ */ import React, { useContext } from 'react'; -import { - Accordion, - AccordionDetails, - AccordionSummary, - Grid, - Typography, -} from '@material-ui/core'; +import Accordion from '@material-ui/core/Accordion'; +import AccordionDetails from '@material-ui/core/AccordionDetails'; +import AccordionSummary from '@material-ui/core/AccordionSummary'; +import Grid from '@material-ui/core/Grid'; +import Typography from '@material-ui/core/Typography'; import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; import { V1Deployment, diff --git a/plugins/kubernetes-react/src/components/ErrorPanel/ErrorPanel.tsx b/plugins/kubernetes-react/src/components/ErrorPanel/ErrorPanel.tsx index 7109849b8e..58832b553c 100644 --- a/plugins/kubernetes-react/src/components/ErrorPanel/ErrorPanel.tsx +++ b/plugins/kubernetes-react/src/components/ErrorPanel/ErrorPanel.tsx @@ -15,7 +15,7 @@ */ import React from 'react'; -import { Typography } from '@material-ui/core'; +import Typography from '@material-ui/core/Typography'; import { ClusterObjects } from '@backstage/plugin-kubernetes-common'; import { WarningPanel } from '@backstage/core-components'; diff --git a/plugins/kubernetes-react/src/components/IngressesAccordions/IngressDrawer.tsx b/plugins/kubernetes-react/src/components/IngressesAccordions/IngressDrawer.tsx index 5881f6d6c4..0590546bbd 100644 --- a/plugins/kubernetes-react/src/components/IngressesAccordions/IngressDrawer.tsx +++ b/plugins/kubernetes-react/src/components/IngressesAccordions/IngressDrawer.tsx @@ -17,7 +17,8 @@ import React from 'react'; import { V1Ingress } from '@kubernetes/client-node'; import { KubernetesStructuredMetadataTableDrawer } from '../KubernetesDrawer'; -import { Typography, Grid } from '@material-ui/core'; +import Typography from '@material-ui/core/Typography'; +import Grid from '@material-ui/core/Grid'; export const IngressDrawer = ({ ingress, diff --git a/plugins/kubernetes-react/src/components/IngressesAccordions/IngressesAccordions.tsx b/plugins/kubernetes-react/src/components/IngressesAccordions/IngressesAccordions.tsx index 28aa5d42e4..5962e78f59 100644 --- a/plugins/kubernetes-react/src/components/IngressesAccordions/IngressesAccordions.tsx +++ b/plugins/kubernetes-react/src/components/IngressesAccordions/IngressesAccordions.tsx @@ -15,12 +15,10 @@ */ import React, { useContext } from 'react'; -import { - Accordion, - AccordionDetails, - AccordionSummary, - Grid, -} from '@material-ui/core'; +import Accordion from '@material-ui/core/Accordion'; +import AccordionDetails from '@material-ui/core/AccordionDetails'; +import AccordionSummary from '@material-ui/core/AccordionSummary'; +import Grid from '@material-ui/core/Grid'; import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; import { V1Ingress } from '@kubernetes/client-node'; import { IngressDrawer } from './IngressDrawer'; diff --git a/plugins/kubernetes-react/src/components/JobsAccordions/JobsAccordions.tsx b/plugins/kubernetes-react/src/components/JobsAccordions/JobsAccordions.tsx index 460d0b80c0..894c273528 100644 --- a/plugins/kubernetes-react/src/components/JobsAccordions/JobsAccordions.tsx +++ b/plugins/kubernetes-react/src/components/JobsAccordions/JobsAccordions.tsx @@ -14,12 +14,10 @@ * limitations under the License. */ import React, { useContext } from 'react'; -import { - Accordion, - AccordionDetails, - AccordionSummary, - Grid, -} from '@material-ui/core'; +import Accordion from '@material-ui/core/Accordion'; +import AccordionDetails from '@material-ui/core/AccordionDetails'; +import AccordionSummary from '@material-ui/core/AccordionSummary'; +import Grid from '@material-ui/core/Grid'; import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; import { V1Job, V1Pod } from '@kubernetes/client-node'; import { PodsTable } from '../Pods'; diff --git a/plugins/kubernetes-react/src/components/JobsAccordions/JobsDrawer.tsx b/plugins/kubernetes-react/src/components/JobsAccordions/JobsDrawer.tsx index c60153e77f..c001a0fd73 100644 --- a/plugins/kubernetes-react/src/components/JobsAccordions/JobsDrawer.tsx +++ b/plugins/kubernetes-react/src/components/JobsAccordions/JobsDrawer.tsx @@ -16,7 +16,8 @@ import React from 'react'; import { V1Job } from '@kubernetes/client-node'; import { KubernetesStructuredMetadataTableDrawer } from '../KubernetesDrawer'; -import { Typography, Grid } from '@material-ui/core'; +import Typography from '@material-ui/core/Typography'; +import Grid from '@material-ui/core/Grid'; export const JobDrawer = ({ job, diff --git a/plugins/kubernetes-react/src/components/KubernetesDialog/KubernetesDialog.tsx b/plugins/kubernetes-react/src/components/KubernetesDialog/KubernetesDialog.tsx index cd5802f464..fa5c1906b7 100644 --- a/plugins/kubernetes-react/src/components/KubernetesDialog/KubernetesDialog.tsx +++ b/plugins/kubernetes-react/src/components/KubernetesDialog/KubernetesDialog.tsx @@ -14,16 +14,12 @@ * limitations under the License. */ -import { - Button, - Dialog, - DialogContent, - DialogTitle, - IconButton, - Theme, - createStyles, - makeStyles, -} from '@material-ui/core'; +import Button from '@material-ui/core/Button'; +import Dialog from '@material-ui/core/Dialog'; +import DialogContent from '@material-ui/core/DialogContent'; +import DialogTitle from '@material-ui/core/DialogTitle'; +import IconButton from '@material-ui/core/IconButton'; +import { Theme, createStyles, makeStyles } from '@material-ui/core/styles'; import CloseIcon from '@material-ui/icons/Close'; import React, { useState } from 'react'; diff --git a/plugins/kubernetes-react/src/components/KubernetesDrawer/KubernetesDrawer.tsx b/plugins/kubernetes-react/src/components/KubernetesDrawer/KubernetesDrawer.tsx index 598dac4fe8..b27e628508 100644 --- a/plugins/kubernetes-react/src/components/KubernetesDrawer/KubernetesDrawer.tsx +++ b/plugins/kubernetes-react/src/components/KubernetesDrawer/KubernetesDrawer.tsx @@ -16,19 +16,19 @@ import React, { ChangeEvent, useState } from 'react'; import { IObjectMeta } from '@kubernetes-models/apimachinery/apis/meta/v1/ObjectMeta'; +import Drawer from '@material-ui/core/Drawer'; +import Grid from '@material-ui/core/Grid'; +import IconButton from '@material-ui/core/IconButton'; +import Switch from '@material-ui/core/Switch'; +import Typography from '@material-ui/core/Typography'; +import Button from '@material-ui/core/Button'; +import FormControlLabel from '@material-ui/core/FormControlLabel'; import { createStyles, - Drawer, makeStyles, Theme, - Grid, - IconButton, - Switch, - Typography, - Button, withStyles, - FormControlLabel, -} from '@material-ui/core'; +} from '@material-ui/core/styles'; import CloseIcon from '@material-ui/icons/Close'; import { ManifestYaml } from './ManifestYaml'; diff --git a/plugins/kubernetes-react/src/components/KubernetesDrawer/KubernetesStructuredMetadataTableDrawer.tsx b/plugins/kubernetes-react/src/components/KubernetesDrawer/KubernetesStructuredMetadataTableDrawer.tsx index 7f6cc4f65e..b31d3f9aa7 100644 --- a/plugins/kubernetes-react/src/components/KubernetesDrawer/KubernetesStructuredMetadataTableDrawer.tsx +++ b/plugins/kubernetes-react/src/components/KubernetesDrawer/KubernetesStructuredMetadataTableDrawer.tsx @@ -15,18 +15,14 @@ */ import React, { ChangeEvent, useContext, useState } from 'react'; -import { - Button, - Typography, - makeStyles, - IconButton, - createStyles, - Theme, - Drawer, - Switch, - FormControlLabel, - Grid, -} from '@material-ui/core'; +import Button from '@material-ui/core/Button'; +import Typography from '@material-ui/core/Typography'; +import IconButton from '@material-ui/core/IconButton'; +import Drawer from '@material-ui/core/Drawer'; +import Switch from '@material-ui/core/Switch'; +import FormControlLabel from '@material-ui/core/FormControlLabel'; +import Grid from '@material-ui/core/Grid'; +import { makeStyles, createStyles, Theme } from '@material-ui/core/styles'; import Close from '@material-ui/icons/Close'; import OpenInNewIcon from '@material-ui/icons/OpenInNew'; import { V1ObjectMeta } from '@kubernetes/client-node'; diff --git a/plugins/kubernetes-react/src/components/KubernetesDrawer/ManifestYaml.tsx b/plugins/kubernetes-react/src/components/KubernetesDrawer/ManifestYaml.tsx index 246477b53b..5090badfcd 100644 --- a/plugins/kubernetes-react/src/components/KubernetesDrawer/ManifestYaml.tsx +++ b/plugins/kubernetes-react/src/components/KubernetesDrawer/ManifestYaml.tsx @@ -14,7 +14,8 @@ * limitations under the License. */ import { CodeSnippet } from '@backstage/core-components'; -import { FormControlLabel, Switch } from '@material-ui/core'; +import FormControlLabel from '@material-ui/core/FormControlLabel'; +import Switch from '@material-ui/core/Switch'; import jsyaml from 'js-yaml'; import React, { useState } from 'react'; diff --git a/plugins/kubernetes-react/src/components/PodExecTerminal/PodExecTerminal.tsx b/plugins/kubernetes-react/src/components/PodExecTerminal/PodExecTerminal.tsx index d8c9b0dc02..3510670a05 100644 --- a/plugins/kubernetes-react/src/components/PodExecTerminal/PodExecTerminal.tsx +++ b/plugins/kubernetes-react/src/components/PodExecTerminal/PodExecTerminal.tsx @@ -17,7 +17,7 @@ import 'xterm/css/xterm.css'; import { discoveryApiRef, useApi } from '@backstage/core-plugin-api'; import { ClusterAttributes } from '@backstage/plugin-kubernetes-common'; -import { createStyles, makeStyles, Theme } from '@material-ui/core'; +import { createStyles, makeStyles, Theme } from '@material-ui/core/styles'; import React, { useEffect, useMemo, useState } from 'react'; import { Terminal } from 'xterm'; import { FitAddon } from 'xterm-addon-fit'; diff --git a/plugins/kubernetes-react/src/components/Pods/ErrorList/ErrorList.tsx b/plugins/kubernetes-react/src/components/Pods/ErrorList/ErrorList.tsx index 3c964b46d7..6131c7aa16 100644 --- a/plugins/kubernetes-react/src/components/Pods/ErrorList/ErrorList.tsx +++ b/plugins/kubernetes-react/src/components/Pods/ErrorList/ErrorList.tsx @@ -15,17 +15,13 @@ */ import React from 'react'; -import { - List, - ListItem, - ListItemText, - Divider, - createStyles, - makeStyles, - Theme, - Paper, - Grid, -} from '@material-ui/core'; +import List from '@material-ui/core/List'; +import ListItem from '@material-ui/core/ListItem'; +import ListItemText from '@material-ui/core/ListItemText'; +import Divider from '@material-ui/core/Divider'; +import Paper from '@material-ui/core/Paper'; +import Grid from '@material-ui/core/Grid'; +import { createStyles, makeStyles, Theme } from '@material-ui/core/styles'; import { PodAndErrors } from '../types'; import { FixDialog } from '../FixDialog/FixDialog'; diff --git a/plugins/kubernetes-react/src/components/Pods/Events/Events.tsx b/plugins/kubernetes-react/src/components/Pods/Events/Events.tsx index 9f888d182c..6a43b2fe5b 100644 --- a/plugins/kubernetes-react/src/components/Pods/Events/Events.tsx +++ b/plugins/kubernetes-react/src/components/Pods/Events/Events.tsx @@ -15,24 +15,22 @@ */ import React from 'react'; -import { - Avatar, - Container, - Grid, - List, - ListItem, - ListItemAvatar, - ListItemText, - Tooltip, - Typography, -} from '@material-ui/core'; +import Avatar from '@material-ui/core/Avatar'; +import Container from '@material-ui/core/Container'; +import Grid from '@material-ui/core/Grid'; +import List from '@material-ui/core/List'; +import ListItem from '@material-ui/core/ListItem'; +import ListItemAvatar from '@material-ui/core/ListItemAvatar'; +import ListItemText from '@material-ui/core/ListItemText'; +import Tooltip from '@material-ui/core/Tooltip'; +import Typography from '@material-ui/core/Typography'; import InfoIcon from '@material-ui/icons/Info'; import WarningIcon from '@material-ui/icons/Warning'; import { DateTime } from 'luxon'; import { useEvents } from './useEvents'; -import { Skeleton } from '@material-ui/lab'; +import Skeleton from '@material-ui/lab/Skeleton'; import { DismissableBanner } from '@backstage/core-components'; import { Event } from 'kubernetes-models/v1'; diff --git a/plugins/kubernetes-react/src/components/Pods/FixDialog/FixDialog.tsx b/plugins/kubernetes-react/src/components/Pods/FixDialog/FixDialog.tsx index d0f3e74c14..fd7440870f 100644 --- a/plugins/kubernetes-react/src/components/Pods/FixDialog/FixDialog.tsx +++ b/plugins/kubernetes-react/src/components/Pods/FixDialog/FixDialog.tsx @@ -15,7 +15,8 @@ */ import React, { useState } from 'react'; -import { Button, Grid } from '@material-ui/core'; +import Button from '@material-ui/core/Button'; +import Grid from '@material-ui/core/Grid'; import Dialog from '@material-ui/core/Dialog'; import DialogActions from '@material-ui/core/DialogActions'; import DialogContent from '@material-ui/core/DialogContent'; diff --git a/plugins/kubernetes-react/src/components/Pods/PodDrawer/ContainerCard.tsx b/plugins/kubernetes-react/src/components/Pods/PodDrawer/ContainerCard.tsx index 746abbd668..cabda69b2c 100644 --- a/plugins/kubernetes-react/src/components/Pods/PodDrawer/ContainerCard.tsx +++ b/plugins/kubernetes-react/src/components/Pods/PodDrawer/ContainerCard.tsx @@ -15,14 +15,12 @@ */ import { StructuredMetadataTable } from '@backstage/core-components'; import { ClientContainerStatus } from '@backstage/plugin-kubernetes-common'; -import { - Card, - CardActions, - CardContent, - CardHeader, - Grid, - Typography, -} from '@material-ui/core'; +import Card from '@material-ui/core/Card'; +import CardActions from '@material-ui/core/CardActions'; +import CardContent from '@material-ui/core/CardContent'; +import CardHeader from '@material-ui/core/CardHeader'; +import Grid from '@material-ui/core/Grid'; +import Typography from '@material-ui/core/Typography'; import { IContainer, IContainerStatus } from 'kubernetes-models/v1'; import { DateTime } from 'luxon'; import React from 'react'; diff --git a/plugins/kubernetes-react/src/components/Pods/PodDrawer/PendingPodContent.tsx b/plugins/kubernetes-react/src/components/Pods/PodDrawer/PendingPodContent.tsx index fb0dbe9b9c..703930498a 100644 --- a/plugins/kubernetes-react/src/components/Pods/PodDrawer/PendingPodContent.tsx +++ b/plugins/kubernetes-react/src/components/Pods/PodDrawer/PendingPodContent.tsx @@ -14,7 +14,10 @@ * limitations under the License. */ import React from 'react'; -import { Grid, List, ListItem, Typography } from '@material-ui/core'; +import Grid from '@material-ui/core/Grid'; +import List from '@material-ui/core/List'; +import ListItem from '@material-ui/core/ListItem'; +import Typography from '@material-ui/core/Typography'; import { IPodCondition, Pod } from 'kubernetes-models/v1'; import { StatusError, diff --git a/plugins/kubernetes-react/src/components/Pods/PodDrawer/PodDrawer.tsx b/plugins/kubernetes-react/src/components/Pods/PodDrawer/PodDrawer.tsx index e8545a005b..7a7b17b7f6 100644 --- a/plugins/kubernetes-react/src/components/Pods/PodDrawer/PodDrawer.tsx +++ b/plugins/kubernetes-react/src/components/Pods/PodDrawer/PodDrawer.tsx @@ -17,13 +17,9 @@ import React from 'react'; import { ItemCardGrid } from '@backstage/core-components'; -import { - createStyles, - makeStyles, - Theme, - Grid, - Typography, -} from '@material-ui/core'; +import Grid from '@material-ui/core/Grid'; +import Typography from '@material-ui/core/Typography'; +import { createStyles, makeStyles, Theme } from '@material-ui/core/styles'; import { Pod } from 'kubernetes-models/v1'; diff --git a/plugins/kubernetes-react/src/components/Pods/PodLogs/PodLogs.tsx b/plugins/kubernetes-react/src/components/Pods/PodLogs/PodLogs.tsx index 5c08de047c..a66d5ec47e 100644 --- a/plugins/kubernetes-react/src/components/Pods/PodLogs/PodLogs.tsx +++ b/plugins/kubernetes-react/src/components/Pods/PodLogs/PodLogs.tsx @@ -20,8 +20,8 @@ import { EmptyState, LogViewer, } from '@backstage/core-components'; -import { Paper } from '@material-ui/core'; -import { Skeleton } from '@material-ui/lab'; +import Paper from '@material-ui/core/Paper'; +import Skeleton from '@material-ui/lab/Skeleton'; import { ContainerScope } from './types'; import { usePodLogs } from './usePodLogs'; diff --git a/plugins/kubernetes-react/src/components/Pods/PodsTable.tsx b/plugins/kubernetes-react/src/components/Pods/PodsTable.tsx index d9a7657367..51acef848d 100644 --- a/plugins/kubernetes-react/src/components/Pods/PodsTable.tsx +++ b/plugins/kubernetes-react/src/components/Pods/PodsTable.tsx @@ -29,7 +29,7 @@ import { useMatchingErrors } from '../../hooks/useMatchingErrors'; import { Pod } from 'kubernetes-models/v1/Pod'; import { V1Pod } from '@kubernetes/client-node'; import { usePodMetrics } from '../../hooks/usePodMetrics'; -import { Typography } from '@material-ui/core'; +import Typography from '@material-ui/core/Typography'; /** * diff --git a/plugins/kubernetes-react/src/components/ResourceUtilization/ResourceUtilization.tsx b/plugins/kubernetes-react/src/components/ResourceUtilization/ResourceUtilization.tsx index 15f906e469..c794ae3381 100644 --- a/plugins/kubernetes-react/src/components/ResourceUtilization/ResourceUtilization.tsx +++ b/plugins/kubernetes-react/src/components/ResourceUtilization/ResourceUtilization.tsx @@ -13,7 +13,8 @@ * See the License for the specific language governing permissions and * 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 React from 'react'; import { GaugePropsGetColor, LinearGauge } from '@backstage/core-components'; diff --git a/plugins/kubernetes-react/src/components/ServicesAccordions/ServiceDrawer.tsx b/plugins/kubernetes-react/src/components/ServicesAccordions/ServiceDrawer.tsx index 9588cd00ed..c5392a3e3c 100644 --- a/plugins/kubernetes-react/src/components/ServicesAccordions/ServiceDrawer.tsx +++ b/plugins/kubernetes-react/src/components/ServicesAccordions/ServiceDrawer.tsx @@ -17,7 +17,8 @@ import React from 'react'; import { V1Service } from '@kubernetes/client-node'; import { KubernetesStructuredMetadataTableDrawer } from '../KubernetesDrawer'; -import { Typography, Grid } from '@material-ui/core'; +import Typography from '@material-ui/core/Typography'; +import Grid from '@material-ui/core/Grid'; export const ServiceDrawer = ({ service, diff --git a/plugins/kubernetes-react/src/components/ServicesAccordions/ServicesAccordions.tsx b/plugins/kubernetes-react/src/components/ServicesAccordions/ServicesAccordions.tsx index 50d6ec6f3e..71832fd35c 100644 --- a/plugins/kubernetes-react/src/components/ServicesAccordions/ServicesAccordions.tsx +++ b/plugins/kubernetes-react/src/components/ServicesAccordions/ServicesAccordions.tsx @@ -15,13 +15,11 @@ */ import React, { useContext } from 'react'; -import { - Accordion, - AccordionDetails, - AccordionSummary, - Grid, - Typography, -} from '@material-ui/core'; +import Accordion from '@material-ui/core/Accordion'; +import AccordionDetails from '@material-ui/core/AccordionDetails'; +import AccordionSummary from '@material-ui/core/AccordionSummary'; +import Grid from '@material-ui/core/Grid'; +import Typography from '@material-ui/core/Typography'; import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; import { V1Service } from '@kubernetes/client-node'; import { ServiceDrawer } from './ServiceDrawer'; diff --git a/plugins/kubernetes-react/src/components/StatefulSetsAccordions/StatefulSetDrawer.tsx b/plugins/kubernetes-react/src/components/StatefulSetsAccordions/StatefulSetDrawer.tsx index e07a5f426c..6f776bc1d6 100644 --- a/plugins/kubernetes-react/src/components/StatefulSetsAccordions/StatefulSetDrawer.tsx +++ b/plugins/kubernetes-react/src/components/StatefulSetsAccordions/StatefulSetDrawer.tsx @@ -18,7 +18,9 @@ import React from 'react'; import { V1StatefulSet } from '@kubernetes/client-node'; import { KubernetesStructuredMetadataTableDrawer } from '../KubernetesDrawer'; import { renderCondition } from '../../utils/pod'; -import { Typography, Grid, Chip } from '@material-ui/core'; +import Typography from '@material-ui/core/Typography'; +import Grid from '@material-ui/core/Grid'; +import Chip from '@material-ui/core/Chip'; export const StatefulSetDrawer = ({ statefulset, diff --git a/plugins/kubernetes-react/src/components/StatefulSetsAccordions/StatefulSetsAccordions.tsx b/plugins/kubernetes-react/src/components/StatefulSetsAccordions/StatefulSetsAccordions.tsx index 37bb76c84e..00f08c3c98 100644 --- a/plugins/kubernetes-react/src/components/StatefulSetsAccordions/StatefulSetsAccordions.tsx +++ b/plugins/kubernetes-react/src/components/StatefulSetsAccordions/StatefulSetsAccordions.tsx @@ -15,13 +15,11 @@ */ import React, { useContext } from 'react'; -import { - Accordion, - AccordionDetails, - AccordionSummary, - Grid, - Typography, -} from '@material-ui/core'; +import Accordion from '@material-ui/core/Accordion'; +import AccordionDetails from '@material-ui/core/AccordionDetails'; +import AccordionSummary from '@material-ui/core/AccordionSummary'; +import Grid from '@material-ui/core/Grid'; +import Typography from '@material-ui/core/Typography'; import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; import { V1Pod, diff --git a/plugins/kubernetes-react/src/utils/pod.tsx b/plugins/kubernetes-react/src/utils/pod.tsx index 1123f11427..498d5c9802 100644 --- a/plugins/kubernetes-react/src/utils/pod.tsx +++ b/plugins/kubernetes-react/src/utils/pod.tsx @@ -20,7 +20,7 @@ import { V1DeploymentCondition, } from '@kubernetes/client-node'; import React, { Fragment, ReactNode } from 'react'; -import { Chip } from '@material-ui/core'; +import Chip from '@material-ui/core/Chip'; import { StatusAborted, StatusError,