diff --git a/workspaces/bulk-import/packages/app/src/components/search/SearchPage.tsx b/workspaces/bulk-import/packages/app/src/components/search/SearchPage.tsx index 51b48a66d..d02d5c4d9 100644 --- a/workspaces/bulk-import/packages/app/src/components/search/SearchPage.tsx +++ b/workspaces/bulk-import/packages/app/src/components/search/SearchPage.tsx @@ -42,13 +42,6 @@ import { makeStyles } from '@mui/styles'; import React from 'react'; const useStyles = makeStyles((theme: Theme) => ({ - bar: { - padding: theme.spacing(1, 0), - }, - filters: { - padding: theme.spacing(2), - marginTop: theme.spacing(2), - }, filter: { '& + &': { marginTop: theme.spacing(2.5), @@ -67,7 +60,11 @@ const SearchPage = () => { - + @@ -88,7 +85,12 @@ const SearchPage = () => { }, ]} /> - + {types.includes('techdocs') && ( ({ +const useStyles = makeStyles(() => ({ body: { marginBottom: '50px', padding: '24px', }, - approvalTool: { - display: 'flex', - flexDirection: 'row', - justifyContent: 'left', - alignItems: 'center', - paddingTop: '24px', - paddingBottom: '24px', - paddingLeft: '16px', - backgroundColor: theme.palette.background.paper, - borderBottomStyle: 'groove', - border: theme.palette.divider, - }, - + // We would need this once the ServiceNow approval tool is incorporated in the plugin + // approvalTool: { + // display: 'flex', + // flexDirection: 'row', + // justifyContent: 'left', + // alignItems: 'center', + // paddingTop: '24px', + // paddingBottom: '24px', + // paddingLeft: '16px', + // backgroundColor: theme.palette.background.paper, + // borderBottomStyle: 'groove', + // border: theme.palette.divider, + // }, approvalToolTooltip: { paddingTop: '4px', paddingRight: '24px', diff --git a/workspaces/bulk-import/plugins/bulk-import/src/components/AddRepositories/AddRepositoriesDrawer.tsx b/workspaces/bulk-import/plugins/bulk-import/src/components/AddRepositories/AddRepositoriesDrawer.tsx index 69ae821d8..e0191047e 100644 --- a/workspaces/bulk-import/plugins/bulk-import/src/components/AddRepositories/AddRepositoriesDrawer.tsx +++ b/workspaces/bulk-import/plugins/bulk-import/src/components/AddRepositories/AddRepositoriesDrawer.tsx @@ -12,21 +12,21 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */ import React, { useState } from 'react'; + */ +import React, { useState } from 'react'; import { Link } from '@backstage/core-components'; -import { - Button, - Card, - Container, - Drawer, - IconButton, - makeStyles, - Typography, -} from '@material-ui/core'; import CloseIcon from '@mui/icons-material/Close'; import OpenInNewIcon from '@mui/icons-material/OpenInNew'; +import Box from '@mui/material/Box'; +import Button from '@mui/material/Button'; +import Card from '@mui/material/Card'; +import Container from '@mui/material/Container'; +import Drawer from '@mui/material/Drawer'; +import IconButton from '@mui/material/IconButton'; +import Typography from '@mui/material/Typography'; +import { makeStyles } from '@mui/styles'; import { useFormikContext } from 'formik'; import { @@ -38,18 +38,7 @@ import { urlHelper } from '../../utils/repository-utils'; import { AddRepositoriesTableToolbar } from './AddRepositoriesTableToolbar'; import { RepositoriesTable } from './RepositoriesTable'; -const useStyles = makeStyles(theme => ({ - createButton: { - marginRight: theme.spacing(1), - }, - sidePanelfooter: { - display: 'flex', - flexDirection: 'row', - justifyContent: 'right', - marginTop: theme.spacing(2), - position: 'fixed', - bottom: '20px', - }, +const useStyles = makeStyles({ drawerPaper: { ['@media (max-width: 960px)']: { '& > div[class*="MuiDrawer-paper-"]': { @@ -63,7 +52,7 @@ const useStyles = makeStyles(theme => ({ display: 'flex', flexDirection: 'column', }, -})); +}); export const AddRepositoriesDrawer = ({ open, @@ -129,7 +118,7 @@ export const AddRepositoriesDrawer = ({
- +
@@ -147,13 +136,24 @@ export const AddRepositoriesDrawer = ({ drawerOrganization={orgData?.orgName} /> -
+ -
+ ); diff --git a/workspaces/bulk-import/plugins/bulk-import/src/components/AddRepositories/AddRepositoriesForm.test.tsx b/workspaces/bulk-import/plugins/bulk-import/src/components/AddRepositories/AddRepositoriesForm.test.tsx index 92dcec7f9..8ca20e89b 100644 --- a/workspaces/bulk-import/plugins/bulk-import/src/components/AddRepositories/AddRepositoriesForm.test.tsx +++ b/workspaces/bulk-import/plugins/bulk-import/src/components/AddRepositories/AddRepositoriesForm.test.tsx @@ -12,7 +12,8 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */ import React from 'react'; + */ +import React from 'react'; import { BrowserRouter as Router } from 'react-router-dom'; import { configApiRef, identityApiRef } from '@backstage/core-plugin-api'; @@ -51,8 +52,8 @@ jest.mock('@janus-idp/shared-react', () => ({ useDrawer: jest.fn(), })); -jest.mock('@material-ui/core', () => ({ - ...jest.requireActual('@material-ui/core'), +jest.mock('@mui/material', () => ({ + ...jest.requireActual('@mui/material'), makeStyles: () => () => { return { body: 'body', diff --git a/workspaces/bulk-import/plugins/bulk-import/src/components/AddRepositories/AddRepositoriesFormFooter.tsx b/workspaces/bulk-import/plugins/bulk-import/src/components/AddRepositories/AddRepositoriesFormFooter.tsx index d48ab045b..62634c292 100644 --- a/workspaces/bulk-import/plugins/bulk-import/src/components/AddRepositories/AddRepositoriesFormFooter.tsx +++ b/workspaces/bulk-import/plugins/bulk-import/src/components/AddRepositories/AddRepositoriesFormFooter.tsx @@ -16,9 +16,11 @@ import { Link } from '@backstage/core-components'; -import { Button, makeStyles } from '@material-ui/core'; +import Box from '@mui/material/Box'; +import Button from '@mui/material/Button'; import CircularProgress from '@mui/material/CircularProgress'; import Tooltip from '@mui/material/Tooltip'; +import { makeStyles } from '@mui/styles'; import { useFormikContext } from 'formik'; import { @@ -27,10 +29,7 @@ import { ApprovalTool, } from '../../types'; -const useStyles = makeStyles(theme => ({ - createButton: { - marginRight: theme.spacing(1), - }, +const useStyles = makeStyles({ illustration: { flexDirection: 'row', display: 'flex', @@ -40,25 +39,7 @@ const useStyles = makeStyles(theme => ({ tooltip: { maxWidth: 'none', }, - footer: { - display: 'flex', - flexDirection: 'row', - justifyContent: 'left', - position: 'fixed', - bottom: 0, - paddingTop: '24px', - paddingBottom: '24px', - paddingLeft: '24px', - backgroundColor: - theme.palette.type === 'light' - ? '#fff' - : theme.palette.navigation.background, - width: '100%', - borderTopStyle: 'groove', - border: theme.palette.divider, - zIndex: 1, - }, -})); +}); const sPad = (repositories: AddedRepositories) => Object.keys(repositories || []).length > 1 ? 's' : ''; @@ -85,7 +66,7 @@ export const AddRepositoriesFormFooter = () => { variant="contained" color="primary" onClick={handleSubmit as any} - className={styles.createButton} + sx={{ mr: 1 }} disabled={disableCreate || isSubmitting} startIcon={ isSubmitting && @@ -96,7 +77,27 @@ export const AddRepositoriesFormFooter = () => { ); return ( -
+ + theme.palette.mode === 'light' + ? '#fff' + : theme.palette.navigation.background, + width: '100%', + borderTopStyle: 'groove', + borderColor: 'divider', + zIndex: 1, + }} + data-testid="add-repository-footer" + > {toolTipTitle ? ( {submitButton} @@ -107,6 +108,6 @@ export const AddRepositoriesFormFooter = () => { -
+ ); }; diff --git a/workspaces/bulk-import/plugins/bulk-import/src/components/AddRepositories/AddRepositoriesPage.tsx b/workspaces/bulk-import/plugins/bulk-import/src/components/AddRepositories/AddRepositoriesPage.tsx index 27bd6676a..dc8fb2227 100644 --- a/workspaces/bulk-import/plugins/bulk-import/src/components/AddRepositories/AddRepositoriesPage.tsx +++ b/workspaces/bulk-import/plugins/bulk-import/src/components/AddRepositories/AddRepositoriesPage.tsx @@ -12,21 +12,21 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */ import React from 'react'; + */ +import React from 'react'; import { Content, Header, Page, Progress } from '@backstage/core-components'; import { usePermission } from '@backstage/plugin-permission-react'; -import { - Accordion, - AccordionDetails, - AccordionSummary, - makeStyles, - useTheme, -} from '@material-ui/core'; -import { Alert, AlertTitle } from '@material-ui/lab'; import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; +import Accordion from '@mui/material/Accordion'; +import AccordionDetails from '@mui/material/AccordionDetails'; +import AccordionSummary from '@mui/material/AccordionSummary'; +import Alert from '@mui/material/Alert'; +import AlertTitle from '@mui/material/AlertTitle'; +import { useTheme } from '@mui/material/styles'; import Typography from '@mui/material/Typography'; +import { makeStyles } from '@mui/styles'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { bulkImportPermission } from '@red-hat-developer-hub/backstage-plugin-bulk-import-common'; @@ -77,7 +77,7 @@ export const AddRepositoriesPage = () => { {/* { /> */} { /> { /> { /> diff --git a/workspaces/bulk-import/plugins/bulk-import/src/components/AddRepositories/RepositoriesTable.tsx b/workspaces/bulk-import/plugins/bulk-import/src/components/AddRepositories/RepositoriesTable.tsx index ccf3c6fd6..bbbc251b4 100644 --- a/workspaces/bulk-import/plugins/bulk-import/src/components/AddRepositories/RepositoriesTable.tsx +++ b/workspaces/bulk-import/plugins/bulk-import/src/components/AddRepositories/RepositoriesTable.tsx @@ -12,10 +12,14 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */ import * as React from 'react'; + */ +import * as React from 'react'; -import { Table, TableContainer, TablePagination } from '@material-ui/core'; -import { Alert, AlertTitle } from '@material-ui/lab'; +import Alert from '@mui/material/Alert'; +import AlertTitle from '@mui/material/AlertTitle'; +import Table from '@mui/material/Table'; +import TableContainer from '@mui/material/TableContainer'; +import TablePagination from '@mui/material/TablePagination'; import { useFormikContext } from 'formik'; import { useRepositories } from '../../hooks'; diff --git a/workspaces/bulk-import/plugins/bulk-import/src/components/AddRepositories/RepositoriesTableBody.tsx b/workspaces/bulk-import/plugins/bulk-import/src/components/AddRepositories/RepositoriesTableBody.tsx index 4723298eb..1d7d6ef3b 100644 --- a/workspaces/bulk-import/plugins/bulk-import/src/components/AddRepositories/RepositoriesTableBody.tsx +++ b/workspaces/bulk-import/plugins/bulk-import/src/components/AddRepositories/RepositoriesTableBody.tsx @@ -14,22 +14,17 @@ * limitations under the License. */ import * as React from 'react'; -import { makeStyles, TableBody, TableCell, TableRow } from '@material-ui/core'; +import Box from '@mui/material/Box'; import CircularProgress from '@mui/material/CircularProgress'; +import TableBody from '@mui/material/TableBody'; +import TableCell from '@mui/material/TableCell'; +import TableRow from '@mui/material/TableRow'; import { AddedRepositories, AddRepositoryData } from '../../types'; import { OrganizationTableRow } from './OrganizationTableRow'; import { RepositoriesColumnHeader } from './RepositoriesColumnHeader'; import { RepositoryTableRow } from './RepositoryTableRow'; -const useStyles = makeStyles(theme => ({ - empty: { - padding: theme.spacing(2), - display: 'flex', - justifyContent: 'center', - }, -})); - export const RepositoriesTableBody = ({ loading, ariaLabel, @@ -51,8 +46,6 @@ export const RepositoriesTableBody = ({ isDrawer?: boolean; showOrganizations?: boolean; }) => { - const classes = useStyles(); - const isSelected = (id: string) => { return !!selectedRepos[id]; }; @@ -62,9 +55,16 @@ export const RepositoriesTableBody = ({ -
+ -
+ @@ -106,9 +106,16 @@ export const RepositoriesTableBody = ({ -
+ No records found -
+ diff --git a/workspaces/bulk-import/plugins/bulk-import/src/components/AddRepositories/RepositoryTableRow.tsx b/workspaces/bulk-import/plugins/bulk-import/src/components/AddRepositories/RepositoryTableRow.tsx index 84cf8ff27..7a8a464c1 100644 --- a/workspaces/bulk-import/plugins/bulk-import/src/components/AddRepositories/RepositoryTableRow.tsx +++ b/workspaces/bulk-import/plugins/bulk-import/src/components/AddRepositories/RepositoryTableRow.tsx @@ -18,8 +18,11 @@ import { useAsync } from 'react-use'; import { Link } from '@backstage/core-components'; import { useApi } from '@backstage/core-plugin-api'; -import { Checkbox, makeStyles, TableCell, TableRow } from '@material-ui/core'; import OpenInNewIcon from '@mui/icons-material/OpenInNew'; +import Checkbox from '@mui/material/Checkbox'; +import TableCell from '@mui/material/TableCell'; +import TableRow from '@mui/material/TableRow'; +import { makeStyles } from '@mui/styles'; import { bulkImportApiRef } from '../../api/BulkImportBackendClient'; import { AddRepositoryData, RepositoryStatus } from '../../types'; diff --git a/workspaces/bulk-import/plugins/bulk-import/src/components/BulkImportPage.test.tsx b/workspaces/bulk-import/plugins/bulk-import/src/components/BulkImportPage.test.tsx index 779ac1623..4c9f9d068 100644 --- a/workspaces/bulk-import/plugins/bulk-import/src/components/BulkImportPage.test.tsx +++ b/workspaces/bulk-import/plugins/bulk-import/src/components/BulkImportPage.test.tsx @@ -12,7 +12,8 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */ import React from 'react'; + */ +import React from 'react'; import { RequirePermission, diff --git a/workspaces/bulk-import/plugins/bulk-import/src/components/BulkImportPage.tsx b/workspaces/bulk-import/plugins/bulk-import/src/components/BulkImportPage.tsx index ed6ad3a2b..b5a612c5c 100644 --- a/workspaces/bulk-import/plugins/bulk-import/src/components/BulkImportPage.tsx +++ b/workspaces/bulk-import/plugins/bulk-import/src/components/BulkImportPage.tsx @@ -12,7 +12,8 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */ import React from 'react'; + */ +import React from 'react'; import { Content, Header, Page, Progress } from '@backstage/core-components'; import { usePermission } from '@backstage/plugin-permission-react'; @@ -21,7 +22,8 @@ import { DeleteDialogContextProvider, DrawerContextProvider, } from '@janus-idp/shared-react'; -import { Alert, AlertTitle } from '@material-ui/lab'; +import Alert from '@mui/material/Alert'; +import AlertTitle from '@mui/material/AlertTitle'; import FormControl from '@mui/material/FormControl'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { Formik } from 'formik'; diff --git a/workspaces/bulk-import/plugins/bulk-import/src/components/PreviewFile/KeyValueTextField.tsx b/workspaces/bulk-import/plugins/bulk-import/src/components/PreviewFile/KeyValueTextField.tsx index 535e992ea..3708fb375 100644 --- a/workspaces/bulk-import/plugins/bulk-import/src/components/PreviewFile/KeyValueTextField.tsx +++ b/workspaces/bulk-import/plugins/bulk-import/src/components/PreviewFile/KeyValueTextField.tsx @@ -15,7 +15,8 @@ */ import React from 'react'; -import { FormHelperText, TextField } from '@material-ui/core'; +import FormHelperText from '@mui/material/FormHelperText'; +import TextField from '@mui/material/TextField'; interface KeyValueTextFieldProps { label: string; diff --git a/workspaces/bulk-import/plugins/bulk-import/src/components/PreviewFile/PreviewFile.test.tsx b/workspaces/bulk-import/plugins/bulk-import/src/components/PreviewFile/PreviewFile.test.tsx index f8f5385ef..ea7564dc6 100644 --- a/workspaces/bulk-import/plugins/bulk-import/src/components/PreviewFile/PreviewFile.test.tsx +++ b/workspaces/bulk-import/plugins/bulk-import/src/components/PreviewFile/PreviewFile.test.tsx @@ -40,8 +40,8 @@ jest.mock('@janus-idp/shared-react', () => ({ useDrawer: jest.fn(), })); -jest.mock('@material-ui/core', () => ({ - ...jest.requireActual('@material-ui/core'), +jest.mock('@mui/material', () => ({ + ...jest.requireActual('@mui/material'), makeStyles: () => () => { return { paper: 'paper', diff --git a/workspaces/bulk-import/plugins/bulk-import/src/components/PreviewFile/PreviewFileSidebar.tsx b/workspaces/bulk-import/plugins/bulk-import/src/components/PreviewFile/PreviewFileSidebar.tsx index 28b58e9f4..bb58fd0f8 100644 --- a/workspaces/bulk-import/plugins/bulk-import/src/components/PreviewFile/PreviewFileSidebar.tsx +++ b/workspaces/bulk-import/plugins/bulk-import/src/components/PreviewFile/PreviewFileSidebar.tsx @@ -12,7 +12,8 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */ import * as React from 'react'; + */ +import * as React from 'react'; import { configApiRef, @@ -20,7 +21,8 @@ import { useApi, } from '@backstage/core-plugin-api'; -import { Drawer, makeStyles } from '@material-ui/core'; +import Drawer from '@mui/material/Drawer'; +import { makeStyles } from '@mui/styles'; import { useFormikContext } from 'formik'; import { bulkImportApiRef } from '../../api/BulkImportBackendClient'; @@ -39,15 +41,12 @@ import { } from '../../utils/repository-utils'; import { PreviewFileSidebarDrawerContent } from './PreviewFileSidebarDrawerContent'; -const useDrawerStyles = makeStyles(theme => ({ +const useDrawerStyles = makeStyles({ paper: { width: '40%', gap: '3%', }, - body: { - padding: theme.spacing(2.5), - }, -})); +}); export const PreviewFileSidebar = ({ open, diff --git a/workspaces/bulk-import/plugins/bulk-import/src/components/PreviewFile/PreviewFileSidebarDrawerContent.tsx b/workspaces/bulk-import/plugins/bulk-import/src/components/PreviewFile/PreviewFileSidebarDrawerContent.tsx index 98bf70f03..a2d66829c 100644 --- a/workspaces/bulk-import/plugins/bulk-import/src/components/PreviewFile/PreviewFileSidebarDrawerContent.tsx +++ b/workspaces/bulk-import/plugins/bulk-import/src/components/PreviewFile/PreviewFileSidebarDrawerContent.tsx @@ -12,17 +12,18 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */ import * as React from 'react'; + */ +import * as React from 'react'; import { Link } from '@backstage/core-components'; -import { Button, makeStyles } from '@material-ui/core'; -import { Skeleton } from '@material-ui/lab'; import CloseIcon from '@mui/icons-material/Close'; import OpenInNewIcon from '@mui/icons-material/OpenInNew'; import Box from '@mui/material/Box'; +import Button from '@mui/material/Button'; import CircularProgress from '@mui/material/CircularProgress'; import IconButton from '@mui/material/IconButton'; +import Skeleton from '@mui/material/Skeleton'; import Stack from '@mui/material/Stack'; import Typography from '@mui/material/Typography'; @@ -35,52 +36,6 @@ import { urlHelper } from '../../utils/repository-utils'; import { PreviewPullRequest } from './PreviewPullRequest'; import { PreviewPullRequests } from './PreviewPullRequests'; -const useDrawerStyles = makeStyles(theme => ({ - paper: { - width: '40%', - gap: '3%', - }, - body: { - padding: theme.spacing(2.5), - }, -})); - -const useDrawerContentStyles = makeStyles(theme => ({ - createButton: { - marginRight: theme.spacing(1), - }, - header: { - display: 'flex', - flexDirection: 'row', - justifyContent: 'space-between', - alignItems: 'baseline', - padding: theme.spacing(2.5), - }, - body: { - padding: theme.spacing(2.5), - paddingTop: theme.spacing(1), - paddingBottom: theme.spacing(1), - marginBottom: '100px', - flexGrow: 1, - }, - footer: { - flexDirection: 'row', - gap: '14px', - paddingTop: theme.spacing(2.5), - display: 'flex', - justifyContent: 'left', - position: 'fixed', - bottom: 0, - paddingLeft: '24px', - paddingBottom: '24px', - backgroundColor: theme.palette.type === 'light' ? '#fff' : '#1b1d21', - width: '100%', - borderTopStyle: 'groove', - border: theme.palette.divider, - zIndex: 1, - }, -})); - export const PreviewFileSidebarDrawerContent = ({ repositoryType, onCancel, @@ -102,32 +57,39 @@ export const PreviewFileSidebarDrawerContent = ({ setPullRequest: (pullRequest: PullRequestPreviewData) => void; }) => { const [formErrors, setFormErrors] = React.useState(); - const classes = useDrawerStyles(); - const contentClasses = useDrawerContentStyles(); if (isLoading) { return ( - + - + - - + + ); } return ( <> - +
{repositoryType === RepositorySelection.Repository ? ( <> @@ -159,12 +121,21 @@ export const PreviewFileSidebarDrawerContent = ({ title="Close the drawer" onClick={onCancel} color="inherit" + size="large" > - + {repositoryType === RepositorySelection.Repository && ( -
+ + theme.palette.mode === 'light' ? '#fff' : '#1b1d21', + width: '100%', + borderTopStyle: 'groove', + borderColor: 'divider', // using theme.palette.divider for border + zIndex: 1, + }} + > -
+
); }; diff --git a/workspaces/bulk-import/plugins/bulk-import/src/components/PreviewFile/PreviewPullRequest.tsx b/workspaces/bulk-import/plugins/bulk-import/src/components/PreviewFile/PreviewPullRequest.tsx index ae00a45a7..b5f0b90e9 100644 --- a/workspaces/bulk-import/plugins/bulk-import/src/components/PreviewFile/PreviewPullRequest.tsx +++ b/workspaces/bulk-import/plugins/bulk-import/src/components/PreviewFile/PreviewPullRequest.tsx @@ -12,12 +12,14 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */ import * as React from 'react'; + */ +import * as React from 'react'; import { Link } from '@backstage/core-components'; -import { Alert, AlertTitle } from '@material-ui/lab'; import OpenInNewIcon from '@mui/icons-material/OpenInNew'; +import Alert from '@mui/material/Alert'; +import AlertTitle from '@mui/material/AlertTitle'; import Box from '@mui/material/Box'; import { useFormikContext } from 'formik'; diff --git a/workspaces/bulk-import/plugins/bulk-import/src/components/PreviewFile/PreviewPullRequestForm.test.tsx b/workspaces/bulk-import/plugins/bulk-import/src/components/PreviewFile/PreviewPullRequestForm.test.tsx index 774995d7d..80596f6ee 100644 --- a/workspaces/bulk-import/plugins/bulk-import/src/components/PreviewFile/PreviewPullRequestForm.test.tsx +++ b/workspaces/bulk-import/plugins/bulk-import/src/components/PreviewFile/PreviewPullRequestForm.test.tsx @@ -29,8 +29,8 @@ import { ApprovalTool, ImportJobStatus } from '../../types'; import { getPRTemplate } from '../../utils/repository-utils'; import { PreviewPullRequestForm } from './PreviewPullRequestForm'; -jest.mock('@material-ui/core', () => ({ - ...jest.requireActual('@material-ui/core'), +jest.mock('@mui/material', () => ({ + ...jest.requireActual('@mui/material'), makeStyles: () => () => { return { previewCard: 'previewcard', diff --git a/workspaces/bulk-import/plugins/bulk-import/src/components/PreviewFile/PreviewPullRequestForm.tsx b/workspaces/bulk-import/plugins/bulk-import/src/components/PreviewFile/PreviewPullRequestForm.tsx index 3bdb698d1..829b530d5 100644 --- a/workspaces/bulk-import/plugins/bulk-import/src/components/PreviewFile/PreviewPullRequestForm.tsx +++ b/workspaces/bulk-import/plugins/bulk-import/src/components/PreviewFile/PreviewPullRequestForm.tsx @@ -27,13 +27,15 @@ import { humanizeEntityRef, } from '@backstage/plugin-catalog-react'; -import { Checkbox, FormHelperText, makeStyles } from '@material-ui/core'; -import TextField from '@material-ui/core/TextField'; import Autocomplete from '@mui/material/Autocomplete'; import Box from '@mui/material/Box'; +import Checkbox from '@mui/material/Checkbox'; import CircularProgress from '@mui/material/CircularProgress'; import FormControlLabel from '@mui/material/FormControlLabel'; +import FormHelperText from '@mui/material/FormHelperText'; +import TextField from '@mui/material/TextField'; import Typography from '@mui/material/Typography'; +import { makeStyles } from '@mui/styles'; import { FormikErrors, useFormik, useFormikContext } from 'formik'; import { @@ -48,14 +50,15 @@ import { } from '../../utils/repository-utils'; import KeyValueTextField from './KeyValueTextField'; -const useDrawerContentStyles = makeStyles(theme => ({ +// THEME_NOT_RESOLVED +const useDrawerContentStyles = makeStyles({ previewCard: { - marginTop: theme.spacing(1), + // marginTop: theme?.spacing(1), }, previewCardContent: { paddingTop: 0, }, -})); +}); export const PreviewPullRequestForm = ({ repoId, @@ -268,7 +271,7 @@ export const PreviewPullRequestForm = ({ placeholder="Add Backstage catalog entity descriptor files" variant="outlined" margin="normal" - fullWidth + sx={{ width: '99%' }} name="prTitle" value={formik.values?.prTitle} onChange={handleChange} @@ -282,7 +285,7 @@ export const PreviewPullRequestForm = ({ placeholder="A describing text with Markdown support" margin="normal" variant="outlined" - fullWidth + sx={{ width: '99%' }} onChange={handleChange} name="prDescription" value={formik.values?.prDescription} @@ -306,7 +309,7 @@ export const PreviewPullRequestForm = ({ value={formik.values?.componentName} error={!!formik.errors?.componentName} helperText={formik.errors?.componentName} - fullWidth + sx={{ width: '99%' }} required />
diff --git a/workspaces/bulk-import/plugins/bulk-import/src/components/PreviewFile/PreviewPullRequests.test.tsx b/workspaces/bulk-import/plugins/bulk-import/src/components/PreviewFile/PreviewPullRequests.test.tsx index cb44d6d4e..2671a2aff 100644 --- a/workspaces/bulk-import/plugins/bulk-import/src/components/PreviewFile/PreviewPullRequests.test.tsx +++ b/workspaces/bulk-import/plugins/bulk-import/src/components/PreviewFile/PreviewPullRequests.test.tsx @@ -33,8 +33,8 @@ jest.mock('react', () => ({ useState: jest.fn(), })); -jest.mock('@material-ui/core', () => ({ - ...jest.requireActual('@material-ui/core'), +jest.mock('@mui/material', () => ({ + ...jest.requireActual('@mui/material'), makeStyles: () => () => { return { previewCard: 'previewcard', diff --git a/workspaces/bulk-import/plugins/bulk-import/src/components/PreviewFile/PreviewPullRequests.tsx b/workspaces/bulk-import/plugins/bulk-import/src/components/PreviewFile/PreviewPullRequests.tsx index 2ee176ffe..06503610a 100644 --- a/workspaces/bulk-import/plugins/bulk-import/src/components/PreviewFile/PreviewPullRequests.tsx +++ b/workspaces/bulk-import/plugins/bulk-import/src/components/PreviewFile/PreviewPullRequests.tsx @@ -12,12 +12,14 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */ import * as React from 'react'; + */ +import * as React from 'react'; -import { Tab, Tabs } from '@material-ui/core'; import ErrorOutline from '@mui/icons-material/ErrorOutline'; import InfoOutlined from '@mui/icons-material/InfoOutlined'; import Box from '@mui/material/Box'; +import Tab from '@mui/material/Tab'; +import Tabs from '@mui/material/Tabs'; import { useFormikContext } from 'formik'; import { diff --git a/workspaces/bulk-import/plugins/bulk-import/src/components/Repositories/AddedRepositoriesTableBody.tsx b/workspaces/bulk-import/plugins/bulk-import/src/components/Repositories/AddedRepositoriesTableBody.tsx index a923a40a4..571c4b0b4 100644 --- a/workspaces/bulk-import/plugins/bulk-import/src/components/Repositories/AddedRepositoriesTableBody.tsx +++ b/workspaces/bulk-import/plugins/bulk-import/src/components/Repositories/AddedRepositoriesTableBody.tsx @@ -14,22 +14,17 @@ * limitations under the License. */ import * as React from 'react'; -import { makeStyles, TableBody, TableCell, TableRow } from '@material-ui/core'; -import { Alert } from '@material-ui/lab'; +import Alert from '@mui/material/Alert'; +import Box from '@mui/material/Box'; import CircularProgress from '@mui/material/CircularProgress'; +import TableBody from '@mui/material/TableBody'; +import TableCell from '@mui/material/TableCell'; +import TableRow from '@mui/material/TableRow'; import { AddRepositoryData } from '../../types'; import { AddedRepositoryTableRow } from './AddedRepositoryTableRow'; import { RepositoriesListColumns } from './RepositoriesListColumns'; -const useStyles = makeStyles(theme => ({ - empty: { - padding: theme.spacing(2), - display: 'flex', - justifyContent: 'center', - }, -})); - export const AddedRepositoriesTableBody = ({ loading, rows, @@ -41,16 +36,21 @@ export const AddedRepositoriesTableBody = ({ emptyRows: number; rows: AddRepositoryData[]; }) => { - const classes = useStyles(); - if (loading) { return ( -
+ -
+ @@ -92,9 +92,16 @@ export const AddedRepositoriesTableBody = ({ -
+ No records found -
+ diff --git a/workspaces/bulk-import/plugins/bulk-import/src/components/Repositories/AddedRepositoryTableRow.tsx b/workspaces/bulk-import/plugins/bulk-import/src/components/Repositories/AddedRepositoryTableRow.tsx index ef2a6c8f0..5bc6017e1 100644 --- a/workspaces/bulk-import/plugins/bulk-import/src/components/Repositories/AddedRepositoryTableRow.tsx +++ b/workspaces/bulk-import/plugins/bulk-import/src/components/Repositories/AddedRepositoryTableRow.tsx @@ -12,12 +12,15 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */ import * as React from 'react'; + */ +import * as React from 'react'; import { Link } from '@backstage/core-components'; -import { makeStyles, TableCell, TableRow } from '@material-ui/core'; import OpenInNewIcon from '@mui/icons-material/OpenInNew'; +import TableCell from '@mui/material/TableCell'; +import TableRow from '@mui/material/TableRow'; +import { makeStyles } from '@mui/styles'; import { useFormikContext } from 'formik'; import { AddRepositoriesFormValues, AddRepositoryData } from '../../types'; diff --git a/workspaces/bulk-import/plugins/bulk-import/src/components/Repositories/CatalogInfoAction.test.tsx b/workspaces/bulk-import/plugins/bulk-import/src/components/Repositories/CatalogInfoAction.test.tsx index 280982ec0..b929d52f1 100644 --- a/workspaces/bulk-import/plugins/bulk-import/src/components/Repositories/CatalogInfoAction.test.tsx +++ b/workspaces/bulk-import/plugins/bulk-import/src/components/Repositories/CatalogInfoAction.test.tsx @@ -12,7 +12,8 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */ import React, { useState } from 'react'; + */ +import React, { useState } from 'react'; import { BrowserRouter } from 'react-router-dom'; import { useAsync } from 'react-use'; diff --git a/workspaces/bulk-import/plugins/bulk-import/src/components/Repositories/CatalogInfoAction.tsx b/workspaces/bulk-import/plugins/bulk-import/src/components/Repositories/CatalogInfoAction.tsx index 17e0cb2ca..aa1e24feb 100644 --- a/workspaces/bulk-import/plugins/bulk-import/src/components/Repositories/CatalogInfoAction.tsx +++ b/workspaces/bulk-import/plugins/bulk-import/src/components/Repositories/CatalogInfoAction.tsx @@ -12,7 +12,8 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */ import React from 'react'; + */ +import React from 'react'; import { useLocation, useNavigate } from 'react-router-dom'; import { useAsync } from 'react-use'; @@ -20,9 +21,10 @@ import { useApi } from '@backstage/core-plugin-api'; import { usePermission } from '@backstage/plugin-permission-react'; import { useDrawer } from '@janus-idp/shared-react'; -import { IconButton, Tooltip } from '@material-ui/core'; -import EditIcon from '@material-ui/icons/Edit'; +import EditIcon from '@mui/icons-material/Edit'; import OpenInNewIcon from '@mui/icons-material/OpenInNew'; +import IconButton from '@mui/material/IconButton'; +import Tooltip from '@mui/material/Tooltip'; import { useFormikContext } from 'formik'; import { bulkImportPermission } from '@red-hat-developer-hub/backstage-plugin-bulk-import-common'; @@ -123,6 +125,7 @@ const CatalogInfoAction = ({ data }: { data: AddRepositoryData }) => { aria-label="Update" data-testid="update" onClick={() => handleOpenDrawer(value as ImportJobStatus)} + size="large" > @@ -139,6 +142,7 @@ const CatalogInfoAction = ({ data }: { data: AddRepositoryData }) => { href={canView} color="inherit" aria-label="View" + size="large" > diff --git a/workspaces/bulk-import/plugins/bulk-import/src/components/Repositories/DeleteRepository.tsx b/workspaces/bulk-import/plugins/bulk-import/src/components/Repositories/DeleteRepository.tsx index 9c11be3f5..fa13eb877 100644 --- a/workspaces/bulk-import/plugins/bulk-import/src/components/Repositories/DeleteRepository.tsx +++ b/workspaces/bulk-import/plugins/bulk-import/src/components/Repositories/DeleteRepository.tsx @@ -36,6 +36,7 @@ const DeleteRepository = ({ data }: { data: AddRepositoryData }) => { color="inherit" onClick={() => openDialog(data)} aria-label="Delete" + size="large" > diff --git a/workspaces/bulk-import/plugins/bulk-import/src/components/Repositories/DeleteRepositoryDialog.tsx b/workspaces/bulk-import/plugins/bulk-import/src/components/Repositories/DeleteRepositoryDialog.tsx index 108c65869..3c579ec6e 100644 --- a/workspaces/bulk-import/plugins/bulk-import/src/components/Repositories/DeleteRepositoryDialog.tsx +++ b/workspaces/bulk-import/plugins/bulk-import/src/components/Repositories/DeleteRepositoryDialog.tsx @@ -16,7 +16,6 @@ import { useApi } from '@backstage/core-plugin-api'; -import { createStyles, makeStyles, Theme } from '@material-ui/core'; import CloseIcon from '@mui/icons-material/Close'; import WarningIcon from '@mui/icons-material/Warning'; import Alert from '@mui/material/Alert'; @@ -29,47 +28,27 @@ import DialogContent from '@mui/material/DialogContent'; import DialogTitle from '@mui/material/DialogTitle'; import IconButton from '@mui/material/IconButton'; import Typography from '@mui/material/Typography'; +import { makeStyles } from '@mui/styles'; +import createStyles from '@mui/styles/createStyles'; import { useMutation } from '@tanstack/react-query'; import { bulkImportApiRef } from '../../api/BulkImportBackendClient'; import { AddRepositoryData } from '../../types'; -const useStyles = makeStyles((theme: Theme) => +const useStyles = makeStyles(() => createStyles({ dialogContainer: { height: '70%', }, - - titleContainer: { - display: 'flex', - alignItems: 'center', - gap: theme.spacing(1), - }, dialogTitle: { padding: '16px 20px', }, - closeButton: { - position: 'absolute', - right: theme.spacing(1), - top: theme.spacing(1), - color: theme.palette.grey[700], - }, warningIcon: { alignContent: 'center', marginTop: '7px', marginBottom: '-5px', color: '#F0AB00', }, - button: { - textTransform: 'none', - }, - deleteButton: { - backgroundColor: '#C9190B', - color: theme.palette.getContrastText(theme.palette.error.main), - '&:hover': { - backgroundColor: theme.palette.error.dark, - }, - }, }), ); @@ -113,7 +92,13 @@ const DeleteRepositoryDialog = ({ title="Delete Repository" className={classes.dialogTitle} > - + {' '} Remove {repository.repoName} repository? @@ -121,9 +106,15 @@ const DeleteRepositoryDialog = ({ @@ -148,7 +139,6 @@ const DeleteRepositoryDialog = ({