diff --git a/plugins/qeta-react/package.json b/plugins/qeta-react/package.json
index caaba283..3a9066b1 100644
--- a/plugins/qeta-react/package.json
+++ b/plugins/qeta-react/package.json
@@ -57,9 +57,10 @@
"@backstage/plugin-permission-react": "backstage:^",
"@backstage/plugin-signals-react": "backstage:^",
"@drodil/backstage-plugin-qeta-common": "workspace:^",
- "@material-ui/core": "^4.12.2",
- "@material-ui/icons": "^4.11.3",
- "@material-ui/lab": "4.0.0-alpha.61",
+ "@mui/icons-material": "^5.15.14",
+ "@mui/lab": "^5.0.0-alpha.169",
+ "@mui/material": "^5.16.7",
+ "@mui/styles": "^5.16.7",
"dataloader": "^2.2.2",
"dompurify": "^3.1.3",
"file-type": "16.5.4",
diff --git a/plugins/qeta-react/src/components/AIAnswerCard/AIAnswerCard.tsx b/plugins/qeta-react/src/components/AIAnswerCard/AIAnswerCard.tsx
index 240cda8d..a4a15468 100644
--- a/plugins/qeta-react/src/components/AIAnswerCard/AIAnswerCard.tsx
+++ b/plugins/qeta-react/src/components/AIAnswerCard/AIAnswerCard.tsx
@@ -5,33 +5,30 @@ import {
Post,
} from '@drodil/backstage-plugin-qeta-common';
import React, { useCallback } from 'react';
-import {
- Card,
- CardContent,
- CardHeader,
- Collapse,
- createStyles,
- IconButton,
- makeStyles,
- Theme,
- Tooltip,
- Typography,
-} from '@material-ui/core';
+import Card from '@mui/material/Card';
+import CardContent from '@mui/material/CardContent';
+import CardHeader from '@mui/material/CardHeader';
+import Collapse from '@mui/material/Collapse';
+import IconButton from '@mui/material/IconButton';
+import Tooltip from '@mui/material/Tooltip';
+import Typography from '@mui/material/Typography';
import { MarkdownRenderer } from '../MarkdownRenderer';
import { useAI, useTranslation } from '../../hooks';
-import FlareIcon from '@material-ui/icons/Flare';
+import FlareIcon from '@mui/icons-material/Flare';
import useDebounce from 'react-use/lib/useDebounce';
-import { Skeleton } from '@material-ui/lab';
+import Skeleton from '@mui/material/Skeleton';
import { RelativeTimeWithTooltip } from '../RelativeTimeWithTooltip';
-import RefreshIcon from '@material-ui/icons/Refresh';
+import RefreshIcon from '@mui/icons-material/Refresh';
import { configApiRef, useApi } from '@backstage/core-plugin-api';
-import KeyboardArrowDownIcon from '@material-ui/icons/KeyboardArrowDown';
-import KeyboardArrowUpIcon from '@material-ui/icons/KeyboardArrowUp';
+import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
+import KeyboardArrowUpIcon from '@mui/icons-material/KeyboardArrowUp';
+import makeStyles from '@mui/styles/makeStyles';
+import createStyles from '@mui/styles/createStyles';
export type QetaAIAnswerCardClassKey = 'card';
const useStyles = makeStyles(
- (theme: Theme) =>
+ theme =>
createStyles({
card: {
marginTop: theme.spacing(3),
@@ -167,6 +164,7 @@ export const AIAnswerCard = (props: AIAnswerCardProps) => {
setAnswer(undefined);
fetchAnswer({ regenerate: true });
}}
+ size="large"
>
@@ -184,6 +182,7 @@ export const AIAnswerCard = (props: AIAnswerCardProps) => {
);
}}
aria-expanded={expanded}
+ size="large"
>
{expanded ? : }
@@ -201,7 +200,7 @@ export const AIAnswerCard = (props: AIAnswerCardProps) => {
{answer === undefined && (
-
+
)}
{answer && (
diff --git a/plugins/qeta-react/src/components/AnswerForm/AnswerForm.tsx b/plugins/qeta-react/src/components/AnswerForm/AnswerForm.tsx
index 89ea5322..7708146b 100644
--- a/plugins/qeta-react/src/components/AnswerForm/AnswerForm.tsx
+++ b/plugins/qeta-react/src/components/AnswerForm/AnswerForm.tsx
@@ -1,5 +1,6 @@
import { WarningPanel } from '@backstage/core-components';
-import { Button, Typography } from '@material-ui/core';
+import Button from '@mui/material/Button';
+import Typography from '@mui/material/Typography';
import React, { useCallback, useEffect } from 'react';
import { configApiRef, useAnalytics, useApi } from '@backstage/core-plugin-api';
import {
diff --git a/plugins/qeta-react/src/components/AnswersContainer/AnswerList.tsx b/plugins/qeta-react/src/components/AnswersContainer/AnswerList.tsx
index 098fac0e..3aba5f0e 100644
--- a/plugins/qeta-react/src/components/AnswersContainer/AnswerList.tsx
+++ b/plugins/qeta-react/src/components/AnswersContainer/AnswerList.tsx
@@ -1,17 +1,16 @@
import { Progress, WarningPanel } from '@backstage/core-components';
-import {
- Box,
- Card,
- CardContent,
- Divider,
- Grid,
- Typography,
-} from '@material-ui/core';
+import Card from '@mui/material/Card';
+import CardContent from '@mui/material/CardContent';
+import Typography from '@mui/material/Typography';
+import Divider from '@mui/material/Divider';
+import Box from '@mui/material/Box';
+import Grid from '@mui/material/Grid';
import React, { useEffect, useRef, useState } from 'react';
import { AnswersResponse } from '@drodil/backstage-plugin-qeta-common';
import { AnswerListItem } from './AnswerListItem';
import { useTranslation } from '../../hooks';
import { QetaPagination } from '../QetaPagination/QetaPagination';
+import { SelectChangeEvent } from '@mui/material/Select';
export const AnswerList = (props: {
loading: boolean;
@@ -54,9 +53,7 @@ export const AnswerList = (props: {
onPageChange(value);
};
- const handlePageSizeChange = (
- event: React.ChangeEvent<{ value: unknown }>,
- ) => {
+ const handlePageSizeChange = (event: SelectChangeEvent) => {
if (listRef.current) {
listRef.current.scrollIntoView();
}
diff --git a/plugins/qeta-react/src/components/AnswersContainer/AnswerListItem.tsx b/plugins/qeta-react/src/components/AnswersContainer/AnswerListItem.tsx
index 7e8365b5..b4da2860 100644
--- a/plugins/qeta-react/src/components/AnswersContainer/AnswerListItem.tsx
+++ b/plugins/qeta-react/src/components/AnswersContainer/AnswerListItem.tsx
@@ -1,4 +1,6 @@
-import { Avatar, Grid, Typography } from '@material-ui/core';
+import Typography from '@mui/material/Typography';
+import Avatar from '@mui/material/Avatar';
+import Grid from '@mui/material/Grid';
import { Link } from '@backstage/core-components';
import React from 'react';
import DOMPurify from 'dompurify';
diff --git a/plugins/qeta-react/src/components/AnswersContainer/AnswersContainer.tsx b/plugins/qeta-react/src/components/AnswersContainer/AnswersContainer.tsx
index 23c1e589..9ab71120 100644
--- a/plugins/qeta-react/src/components/AnswersContainer/AnswersContainer.tsx
+++ b/plugins/qeta-react/src/components/AnswersContainer/AnswersContainer.tsx
@@ -1,14 +1,12 @@
-import {
- Box,
- Button,
- Collapse,
- Grid,
- TextField,
- Typography,
-} from '@material-ui/core';
+import Collapse from '@mui/material/Collapse';
+import Typography from '@mui/material/Typography';
+import Box from '@mui/material/Box';
+import Grid from '@mui/material/Grid';
+import Button from '@mui/material/Button';
+import TextField from '@mui/material/TextField';
import React, { useEffect } from 'react';
import useDebounce from 'react-use/lib/useDebounce';
-import FilterList from '@material-ui/icons/FilterList';
+import FilterList from '@mui/icons-material/FilterList';
import { useSearchParams } from 'react-router-dom';
import { EntityRefLink } from '@backstage/plugin-catalog-react';
import { useAnalytics } from '@backstage/core-plugin-api';
diff --git a/plugins/qeta-react/src/components/ArticleContent/ArticleButtons.tsx b/plugins/qeta-react/src/components/ArticleContent/ArticleButtons.tsx
index 730ef706..744ec959 100644
--- a/plugins/qeta-react/src/components/ArticleContent/ArticleButtons.tsx
+++ b/plugins/qeta-react/src/components/ArticleContent/ArticleButtons.tsx
@@ -1,21 +1,19 @@
import { PostResponse } from '@drodil/backstage-plugin-qeta-common';
import React from 'react';
-import ArrowUpward from '@material-ui/icons/ArrowUpward';
-import {
- Grid,
- IconButton,
- makeStyles,
- Tooltip,
- Typography,
-} from '@material-ui/core';
-import ArrowDownward from '@material-ui/icons/ArrowDownward';
+import ArrowUpward from '@mui/icons-material/ArrowUpward';
+import IconButton from '@mui/material/IconButton';
+import Tooltip from '@mui/material/Tooltip';
+import Typography from '@mui/material/Typography';
+import Grid from '@mui/material/Grid';
+import makeStyles from '@mui/styles/makeStyles';
+import ArrowDownward from '@mui/icons-material/ArrowDownward';
import { FavoriteButton } from '../Buttons/FavoriteButton';
import { LinkButton } from '../Buttons/LinkButton';
import { useRouteRef } from '@backstage/core-plugin-api';
import { editArticleRouteRef } from '../../routes';
-import DeleteIcon from '@material-ui/icons/Delete';
+import DeleteIcon from '@mui/icons-material/Delete';
import { DeleteModal } from '../DeleteModal';
-import EditIcon from '@material-ui/icons/Edit';
+import EditIcon from '@mui/icons-material/Edit';
import { useVoting } from '../../hooks/useVoting';
import { useStyles, useTranslation } from '../../hooks';
diff --git a/plugins/qeta-react/src/components/ArticleContent/ArticleContent.tsx b/plugins/qeta-react/src/components/ArticleContent/ArticleContent.tsx
index 14a8b440..5babe1af 100644
--- a/plugins/qeta-react/src/components/ArticleContent/ArticleContent.tsx
+++ b/plugins/qeta-react/src/components/ArticleContent/ArticleContent.tsx
@@ -2,7 +2,10 @@ import {
AnswerResponse,
PostResponse,
} from '@drodil/backstage-plugin-qeta-common';
-import { Avatar, Grid, makeStyles, Typography } from '@material-ui/core';
+import Typography from '@mui/material/Typography';
+import Avatar from '@mui/material/Avatar';
+import Grid from '@mui/material/Grid';
+import makeStyles from '@mui/styles/makeStyles';
import { MarkdownRenderer } from '../MarkdownRenderer';
import React from 'react';
import { RelativeTimeWithTooltip } from '../RelativeTimeWithTooltip';
diff --git a/plugins/qeta-react/src/components/AuthorBox/AuthorBox.tsx b/plugins/qeta-react/src/components/AuthorBox/AuthorBox.tsx
index c12de7b6..41c08a2c 100644
--- a/plugins/qeta-react/src/components/AuthorBox/AuthorBox.tsx
+++ b/plugins/qeta-react/src/components/AuthorBox/AuthorBox.tsx
@@ -1,4 +1,8 @@
-import { Avatar, Box, Grid, makeStyles, Typography } from '@material-ui/core';
+import Typography from '@mui/material/Typography';
+import Box from '@mui/material/Box';
+import Avatar from '@mui/material/Avatar';
+import Grid from '@mui/material/Grid';
+import makeStyles from '@mui/styles/makeStyles';
import React from 'react';
import {
AnswerResponse,
diff --git a/plugins/qeta-react/src/components/Buttons/AddToCollectionButton.tsx b/plugins/qeta-react/src/components/Buttons/AddToCollectionButton.tsx
index 02d1b247..1dee18f9 100644
--- a/plugins/qeta-react/src/components/Buttons/AddToCollectionButton.tsx
+++ b/plugins/qeta-react/src/components/Buttons/AddToCollectionButton.tsx
@@ -1,16 +1,14 @@
import { Collection, PostResponse } from '@drodil/backstage-plugin-qeta-common';
import React from 'react';
-import {
- Button,
- Dialog,
- DialogActions,
- DialogContent,
- DialogTitle,
- Grid,
-} from '@material-ui/core';
-import AddCircle from '@material-ui/icons/AddCircle';
-import RemoveCircle from '@material-ui/icons/RemoveCircle';
-import PlayListAddIcon from '@material-ui/icons/PlaylistAdd';
+import Grid from '@mui/material/Grid';
+import Button from '@mui/material/Button';
+import Dialog from '@mui/material/Dialog';
+import DialogActions from '@mui/material/DialogActions';
+import DialogContent from '@mui/material/DialogContent';
+import DialogTitle from '@mui/material/DialogTitle';
+import AddCircle from '@mui/icons-material/AddCircle';
+import RemoveCircle from '@mui/icons-material/RemoveCircle';
+import PlayListAddIcon from '@mui/icons-material/PlaylistAdd';
import { useApi } from '@backstage/core-plugin-api';
import { qetaApiRef } from '../../api';
import { useQetaApi, useStyles, useTranslation } from '../../hooks';
diff --git a/plugins/qeta-react/src/components/Buttons/AskQuestionButton.tsx b/plugins/qeta-react/src/components/Buttons/AskQuestionButton.tsx
index e43748bc..672e38be 100644
--- a/plugins/qeta-react/src/components/Buttons/AskQuestionButton.tsx
+++ b/plugins/qeta-react/src/components/Buttons/AskQuestionButton.tsx
@@ -1,4 +1,4 @@
-import HelpOutline from '@material-ui/icons/HelpOutline';
+import HelpOutline from '@mui/icons-material/HelpOutline';
import React from 'react';
import { RequirePermission } from '@backstage/plugin-permission-react';
import { qetaCreatePostPermission } from '@drodil/backstage-plugin-qeta-common';
diff --git a/plugins/qeta-react/src/components/Buttons/CollectionFollowButton.tsx b/plugins/qeta-react/src/components/Buttons/CollectionFollowButton.tsx
index a60b48cd..58aef083 100644
--- a/plugins/qeta-react/src/components/Buttons/CollectionFollowButton.tsx
+++ b/plugins/qeta-react/src/components/Buttons/CollectionFollowButton.tsx
@@ -1,7 +1,8 @@
import React from 'react';
-import { IconButton, Tooltip } from '@material-ui/core';
-import Visibility from '@material-ui/icons/Visibility';
-import VisibilityOff from '@material-ui/icons/VisibilityOff';
+import IconButton from '@mui/material/IconButton';
+import Tooltip from '@mui/material/Tooltip';
+import Visibility from '@mui/icons-material/Visibility';
+import VisibilityOff from '@mui/icons-material/VisibilityOff';
import { useStyles, useTranslation } from '../../hooks';
import { Collection } from '@drodil/backstage-plugin-qeta-common';
import { useCollectionsFollow } from '../../hooks/useCollectionsFollow';
diff --git a/plugins/qeta-react/src/components/Buttons/CreateCollectionButton.tsx b/plugins/qeta-react/src/components/Buttons/CreateCollectionButton.tsx
index e68580bb..073ba480 100644
--- a/plugins/qeta-react/src/components/Buttons/CreateCollectionButton.tsx
+++ b/plugins/qeta-react/src/components/Buttons/CreateCollectionButton.tsx
@@ -1,4 +1,4 @@
-import PlayListAddIcon from '@material-ui/icons/PlaylistAdd';
+import PlayListAddIcon from '@mui/icons-material/PlaylistAdd';
import React from 'react';
import { RequirePermission } from '@backstage/plugin-permission-react';
import { qetaCreatePostPermission } from '@drodil/backstage-plugin-qeta-common';
diff --git a/plugins/qeta-react/src/components/Buttons/EntityFollowButton.tsx b/plugins/qeta-react/src/components/Buttons/EntityFollowButton.tsx
index 2914727e..0dfd014d 100644
--- a/plugins/qeta-react/src/components/Buttons/EntityFollowButton.tsx
+++ b/plugins/qeta-react/src/components/Buttons/EntityFollowButton.tsx
@@ -1,7 +1,8 @@
import React from 'react';
-import { IconButton, Tooltip } from '@material-ui/core';
-import Visibility from '@material-ui/icons/Visibility';
-import VisibilityOff from '@material-ui/icons/VisibilityOff';
+import IconButton from '@mui/material/IconButton';
+import Tooltip from '@mui/material/Tooltip';
+import Visibility from '@mui/icons-material/Visibility';
+import VisibilityOff from '@mui/icons-material/VisibilityOff';
import { useEntityFollow, useStyles, useTranslation } from '../../hooks';
export const EntityFollowButton = (props: { entityRef: string }) => {
diff --git a/plugins/qeta-react/src/components/Buttons/FavoriteButton.tsx b/plugins/qeta-react/src/components/Buttons/FavoriteButton.tsx
index 5324b6cf..7818dbd0 100644
--- a/plugins/qeta-react/src/components/Buttons/FavoriteButton.tsx
+++ b/plugins/qeta-react/src/components/Buttons/FavoriteButton.tsx
@@ -1,9 +1,10 @@
import { PostResponse } from '@drodil/backstage-plugin-qeta-common';
-import { IconButton, Tooltip } from '@material-ui/core';
+import IconButton from '@mui/material/IconButton';
+import Tooltip from '@mui/material/Tooltip';
import React from 'react';
import { useApi } from '@backstage/core-plugin-api';
-import StarIcon from '@material-ui/icons/Star';
-import StarOutlineIcon from '@material-ui/icons/StarOutline';
+import StarIcon from '@mui/icons-material/Star';
+import StarOutlineIcon from '@mui/icons-material/StarOutline';
import { qetaApiRef } from '../../api';
import { useTranslation } from '../../hooks';
diff --git a/plugins/qeta-react/src/components/Buttons/LinkButton.tsx b/plugins/qeta-react/src/components/Buttons/LinkButton.tsx
index 5bd9e5f7..9a450e79 100644
--- a/plugins/qeta-react/src/components/Buttons/LinkButton.tsx
+++ b/plugins/qeta-react/src/components/Buttons/LinkButton.tsx
@@ -1,5 +1,6 @@
-import { IconButton, Tooltip } from '@material-ui/core';
-import Link from '@material-ui/icons/Link';
+import IconButton from '@mui/material/IconButton';
+import Tooltip from '@mui/material/Tooltip';
+import Link from '@mui/icons-material/Link';
import React from 'react';
import {
AnswerResponse,
diff --git a/plugins/qeta-react/src/components/Buttons/TagFollowButton.tsx b/plugins/qeta-react/src/components/Buttons/TagFollowButton.tsx
index bd6845bd..07d66360 100644
--- a/plugins/qeta-react/src/components/Buttons/TagFollowButton.tsx
+++ b/plugins/qeta-react/src/components/Buttons/TagFollowButton.tsx
@@ -1,7 +1,8 @@
import React from 'react';
-import { IconButton, Tooltip } from '@material-ui/core';
-import Visibility from '@material-ui/icons/Visibility';
-import VisibilityOff from '@material-ui/icons/VisibilityOff';
+import IconButton from '@mui/material/IconButton';
+import Tooltip from '@mui/material/Tooltip';
+import Visibility from '@mui/icons-material/Visibility';
+import VisibilityOff from '@mui/icons-material/VisibilityOff';
import { useStyles, useTagsFollow, useTranslation } from '../../hooks';
export const TagFollowButton = (props: { tag: string }) => {
diff --git a/plugins/qeta-react/src/components/Buttons/UserFollowButton.tsx b/plugins/qeta-react/src/components/Buttons/UserFollowButton.tsx
index 98188a14..84515d6b 100644
--- a/plugins/qeta-react/src/components/Buttons/UserFollowButton.tsx
+++ b/plugins/qeta-react/src/components/Buttons/UserFollowButton.tsx
@@ -1,7 +1,8 @@
import React from 'react';
-import { IconButton, Tooltip } from '@material-ui/core';
-import Visibility from '@material-ui/icons/Visibility';
-import VisibilityOff from '@material-ui/icons/VisibilityOff';
+import IconButton from '@mui/material/IconButton';
+import Tooltip from '@mui/material/Tooltip';
+import Visibility from '@mui/icons-material/Visibility';
+import VisibilityOff from '@mui/icons-material/VisibilityOff';
import { useStyles, useTranslation, useUserFollow } from '../../hooks';
export const UserFollowButton = (props: { userRef: string }) => {
diff --git a/plugins/qeta-react/src/components/Buttons/VoteButtons.tsx b/plugins/qeta-react/src/components/Buttons/VoteButtons.tsx
index d7ba0dd7..8718eec1 100644
--- a/plugins/qeta-react/src/components/Buttons/VoteButtons.tsx
+++ b/plugins/qeta-react/src/components/Buttons/VoteButtons.tsx
@@ -2,18 +2,15 @@ import {
AnswerResponse,
PostResponse,
} from '@drodil/backstage-plugin-qeta-common';
-import {
- Box,
- createStyles,
- IconButton,
- makeStyles,
- Theme,
- Tooltip,
- Typography,
-} from '@material-ui/core';
-import ArrowDownward from '@material-ui/icons/ArrowDownward';
-import ArrowUpward from '@material-ui/icons/ArrowUpward';
-import Check from '@material-ui/icons/Check';
+import IconButton from '@mui/material/IconButton';
+import Tooltip from '@mui/material/Tooltip';
+import Typography from '@mui/material/Typography';
+import Box from '@mui/material/Box';
+import createStyles from '@mui/styles/createStyles';
+import makeStyles from '@mui/styles/makeStyles';
+import ArrowDownward from '@mui/icons-material/ArrowDownward';
+import ArrowUpward from '@mui/icons-material/ArrowUpward';
+import Check from '@mui/icons-material/Check';
import React from 'react';
import { useVoting } from '../../hooks/useVoting';
@@ -23,7 +20,7 @@ export type QetaVoteButtonsClassKey =
| 'voteButtonContainer';
const useStyles = makeStyles(
- (theme: Theme) =>
+ theme =>
createStyles({
qetaCorrectAnswerSelected: {
color: theme.palette.success.main,
diff --git a/plugins/qeta-react/src/components/Buttons/WriteArticleButton.tsx b/plugins/qeta-react/src/components/Buttons/WriteArticleButton.tsx
index 97b66e66..60d20065 100644
--- a/plugins/qeta-react/src/components/Buttons/WriteArticleButton.tsx
+++ b/plugins/qeta-react/src/components/Buttons/WriteArticleButton.tsx
@@ -1,4 +1,4 @@
-import CreateIcon from '@material-ui/icons/Create';
+import CreateIcon from '@mui/icons-material/Create';
import React from 'react';
import { RequirePermission } from '@backstage/plugin-permission-react';
import { qetaCreatePostPermission } from '@drodil/backstage-plugin-qeta-common';
diff --git a/plugins/qeta-react/src/components/CollectionCard/CollectionCard.tsx b/plugins/qeta-react/src/components/CollectionCard/CollectionCard.tsx
index 219e0d63..e184f904 100644
--- a/plugins/qeta-react/src/components/CollectionCard/CollectionCard.tsx
+++ b/plugins/qeta-react/src/components/CollectionCard/CollectionCard.tsx
@@ -1,12 +1,15 @@
import { Collection } from '@drodil/backstage-plugin-qeta-common';
import { InfoCard } from '@backstage/core-components';
-import { Button, CardContent, CardMedia, Grid } from '@material-ui/core';
+import CardContent from '@mui/material/CardContent';
+import Grid from '@mui/material/Grid';
+import Button from '@mui/material/Button';
+import CardMedia from '@mui/material/CardMedia';
import { MarkdownRenderer } from '../MarkdownRenderer';
import React from 'react';
import { TagsAndEntities } from '../TagsAndEntities/TagsAndEntities';
-import DeleteIcon from '@material-ui/icons/Delete';
+import DeleteIcon from '@mui/icons-material/Delete';
import { DeleteModal } from '../DeleteModal';
-import EditIcon from '@material-ui/icons/Edit';
+import EditIcon from '@mui/icons-material/Edit';
import { useRouteRef } from '@backstage/core-plugin-api';
import { collectionEditRouteRef } from '../../routes';
import { useStyles, useTranslation } from '../../hooks';
diff --git a/plugins/qeta-react/src/components/CollectionForm/CollectionForm.tsx b/plugins/qeta-react/src/components/CollectionForm/CollectionForm.tsx
index ad16522a..e7b2cc79 100644
--- a/plugins/qeta-react/src/components/CollectionForm/CollectionForm.tsx
+++ b/plugins/qeta-react/src/components/CollectionForm/CollectionForm.tsx
@@ -4,16 +4,14 @@ import {
useApi,
useRouteRef,
} from '@backstage/core-plugin-api';
-import {
- Button,
- FormControl,
- FormHelperText,
- Grid,
- MenuItem,
- Select,
- TextField,
-} from '@material-ui/core';
-import { Alert } from '@material-ui/lab';
+import Grid from '@mui/material/Grid';
+import Button from '@mui/material/Button';
+import TextField from '@mui/material/TextField';
+import Alert from '@mui/material/Alert';
+import FormControl from '@mui/material/FormControl';
+import FormHelperText from '@mui/material/FormHelperText';
+import Select from '@mui/material/Select';
+import MenuItem from '@mui/material/MenuItem';
import React, { useCallback, useEffect } from 'react';
import { Controller, useForm } from 'react-hook-form';
import { useNavigate } from 'react-router-dom';
diff --git a/plugins/qeta-react/src/components/CollectionsGrid/CollectionsGrid.tsx b/plugins/qeta-react/src/components/CollectionsGrid/CollectionsGrid.tsx
index c80ad8fb..807e2fe1 100644
--- a/plugins/qeta-react/src/components/CollectionsGrid/CollectionsGrid.tsx
+++ b/plugins/qeta-react/src/components/CollectionsGrid/CollectionsGrid.tsx
@@ -1,19 +1,17 @@
import React, { useEffect } from 'react';
-import {
- Box,
- Button,
- Collapse,
- Grid,
- IconButton,
- TextField,
- Typography,
-} from '@material-ui/core';
+import Collapse from '@mui/material/Collapse';
+import IconButton from '@mui/material/IconButton';
+import Typography from '@mui/material/Typography';
+import Box from '@mui/material/Box';
+import Grid from '@mui/material/Grid';
+import Button from '@mui/material/Button';
+import TextField from '@mui/material/TextField';
import { CollectionsGridContent } from './CollectionsGridContent';
import { useQetaApi, useTranslation } from '../../hooks';
import useDebounce from 'react-use/lib/useDebounce';
import { QetaPagination } from '../QetaPagination/QetaPagination';
import { CollectionFilters, FilterPanel } from '../FilterPanel/FilterPanel';
-import FilterList from '@material-ui/icons/FilterList';
+import FilterList from '@mui/icons-material/FilterList';
import { getFiltersWithDateRange } from '../../utils';
export type CollectionsGridProps = {
@@ -111,7 +109,7 @@ export const CollectionsGrid = (props: CollectionsGridProps) => {
placeholder={t('collectionsPage.search.placeholder')}
size="small"
/>
-
+
diff --git a/plugins/qeta-react/src/components/CollectionsGrid/CollectionsGridContent.tsx b/plugins/qeta-react/src/components/CollectionsGrid/CollectionsGridContent.tsx
index ee0a6842..53ee77c8 100644
--- a/plugins/qeta-react/src/components/CollectionsGrid/CollectionsGridContent.tsx
+++ b/plugins/qeta-react/src/components/CollectionsGrid/CollectionsGridContent.tsx
@@ -1,7 +1,7 @@
import { CollectionsResponse } from '@drodil/backstage-plugin-qeta-common';
import React, { useEffect, useState } from 'react';
import { WarningPanel } from '@backstage/core-components';
-import { Grid } from '@material-ui/core';
+import Grid from '@mui/material/Grid';
import { CollectionsGridItem } from './CollectionsGridItem';
import { useTranslation } from '../../hooks';
import { LoadingGrid } from '../LoadingGrid/LoadingGrid';
diff --git a/plugins/qeta-react/src/components/CollectionsGrid/CollectionsGridItem.tsx b/plugins/qeta-react/src/components/CollectionsGrid/CollectionsGridItem.tsx
index fa9e7bea..99f17d07 100644
--- a/plugins/qeta-react/src/components/CollectionsGrid/CollectionsGridItem.tsx
+++ b/plugins/qeta-react/src/components/CollectionsGrid/CollectionsGridItem.tsx
@@ -6,16 +6,14 @@ import {
import React from 'react';
import { useRouteRef } from '@backstage/core-plugin-api';
import { collectionRouteRef } from '../../routes';
-import {
- Button,
- Card,
- CardActionArea,
- CardContent,
- CardMedia,
- Grid,
- Tooltip,
- Typography,
-} from '@material-ui/core';
+import Card from '@mui/material/Card';
+import CardContent from '@mui/material/CardContent';
+import CardActionArea from '@mui/material/CardActionArea';
+import Tooltip from '@mui/material/Tooltip';
+import Typography from '@mui/material/Typography';
+import Grid from '@mui/material/Grid';
+import Button from '@mui/material/Button';
+import CardMedia from '@mui/material/CardMedia';
import DOMPurify from 'dompurify';
import { useNavigate } from 'react-router-dom';
import { TagsAndEntities } from '../TagsAndEntities/TagsAndEntities';
diff --git a/plugins/qeta-react/src/components/CollectionsGrid/NoCollectionsCard.tsx b/plugins/qeta-react/src/components/CollectionsGrid/NoCollectionsCard.tsx
index c677096a..63413618 100644
--- a/plugins/qeta-react/src/components/CollectionsGrid/NoCollectionsCard.tsx
+++ b/plugins/qeta-react/src/components/CollectionsGrid/NoCollectionsCard.tsx
@@ -1,4 +1,7 @@
-import { Card, CardContent, Grid, Typography } from '@material-ui/core';
+import Card from '@mui/material/Card';
+import CardContent from '@mui/material/CardContent';
+import Typography from '@mui/material/Typography';
+import Grid from '@mui/material/Grid';
import React from 'react';
import { useTranslation } from '../../hooks';
diff --git a/plugins/qeta-react/src/components/CommentSection/CommentList.tsx b/plugins/qeta-react/src/components/CommentSection/CommentList.tsx
index d3fa3f98..f50472bf 100644
--- a/plugins/qeta-react/src/components/CommentSection/CommentList.tsx
+++ b/plugins/qeta-react/src/components/CommentSection/CommentList.tsx
@@ -2,7 +2,10 @@ import {
AnswerResponse,
PostResponse,
} from '@drodil/backstage-plugin-qeta-common';
-import { Box, Divider, makeStyles, Typography } from '@material-ui/core';
+import Typography from '@mui/material/Typography';
+import Divider from '@mui/material/Divider';
+import Box from '@mui/material/Box';
+import makeStyles from '@mui/styles/makeStyles';
import React from 'react';
import { Link } from '@backstage/core-components';
import { useApi } from '@backstage/core-plugin-api';
diff --git a/plugins/qeta-react/src/components/CommentSection/CommentSection.tsx b/plugins/qeta-react/src/components/CommentSection/CommentSection.tsx
index c991ca7d..1c2b8f3c 100644
--- a/plugins/qeta-react/src/components/CommentSection/CommentSection.tsx
+++ b/plugins/qeta-react/src/components/CommentSection/CommentSection.tsx
@@ -1,6 +1,8 @@
/* eslint-disable jsx-a11y/no-autofocus */
import React, { useEffect, useState } from 'react';
-import { Box, Button, Grid } from '@material-ui/core';
+import Box from '@mui/material/Box';
+import Grid from '@mui/material/Grid';
+import Button from '@mui/material/Button';
import {
AnswerResponse,
PostResponse,
@@ -14,7 +16,7 @@ import { confirmNavigationIfEdited } from '../../utils/utils';
import { RequirePermission } from '@backstage/plugin-permission-react';
import { MarkdownEditor } from '../MarkdownEditor/MarkdownEditor';
import { useTranslation } from '../../hooks';
-import AddCommentIcon from '@material-ui/icons/AddComment';
+import AddCommentIcon from '@mui/icons-material/AddComment';
export const CommentSection = (props: {
onCommentPost: (question: PostResponse, answer?: AnswerResponse) => void;
diff --git a/plugins/qeta-react/src/components/DeleteModal/DeleteModal.tsx b/plugins/qeta-react/src/components/DeleteModal/DeleteModal.tsx
index 385447a7..391a5a68 100644
--- a/plugins/qeta-react/src/components/DeleteModal/DeleteModal.tsx
+++ b/plugins/qeta-react/src/components/DeleteModal/DeleteModal.tsx
@@ -3,9 +3,13 @@ import {
CollectionResponse,
PostResponse,
} from '@drodil/backstage-plugin-qeta-common';
-import { Backdrop, Box, Button, Modal, Typography } from '@material-ui/core';
-import { Alert } from '@material-ui/lab';
-import Delete from '@material-ui/icons/Delete';
+import Typography from '@mui/material/Typography';
+import Box from '@mui/material/Box';
+import Button from '@mui/material/Button';
+import Alert from '@mui/material/Alert';
+import Delete from '@mui/icons-material/Delete';
+import Modal from '@mui/material/Modal';
+import Backdrop from '@mui/material/Backdrop';
import React from 'react';
import { useApi } from '@backstage/core-plugin-api';
import { useNavigate } from 'react-router-dom';
@@ -84,10 +88,7 @@ export const DeleteModal = (props: {
aria-labelledby="modal-modal-title"
aria-describedby="modal-modal-description"
closeAfterTransition
- BackdropComponent={Backdrop}
- BackdropProps={{
- timeout: 500,
- }}
+ slots={{ backdrop: Backdrop }}
>
{error && (
diff --git a/plugins/qeta-react/src/components/EntitiesGrid/EntitiesGrid.tsx b/plugins/qeta-react/src/components/EntitiesGrid/EntitiesGrid.tsx
index d1cace42..28629400 100644
--- a/plugins/qeta-react/src/components/EntitiesGrid/EntitiesGrid.tsx
+++ b/plugins/qeta-react/src/components/EntitiesGrid/EntitiesGrid.tsx
@@ -1,4 +1,6 @@
-import { Grid, IconButton, TextField } from '@material-ui/core';
+import IconButton from '@mui/material/IconButton';
+import Grid from '@mui/material/Grid';
+import TextField from '@mui/material/TextField';
import React, { useEffect } from 'react';
import { useQetaApi, useTranslation } from '../../hooks';
import useDebounce from 'react-use/lib/useDebounce';
@@ -71,7 +73,7 @@ export const EntitiesGrid = () => {
placeholder={t('entitiesPage.search.placeholder')}
size="small"
/>
-
+
void;
+ onChange: (value: string | string[]) => void;
}
type DateRangeValidation = {
@@ -27,16 +23,12 @@ export const DateRangeFilter = (props: DateRangeFilterProps) => {
value,
);
const { t } = useTranslation();
- const [fromDate, setFromDate] = useState('');
- const [toDate, setToDate] = useState('');
+ const localDate = formatDate(new Date());
+ const [fromDate, setFromDate] = useState(localDate);
+ const [toDate, setToDate] = useState(localDate);
const [validation, setValidation] = useState({
isValid: true,
});
- const isSmallScreen = useMediaQuery(theme =>
- theme.breakpoints.down('sm'),
- );
-
- const localDate = formatDate(new Date());
useEffect(() => {
setDateRangeOption(value || '');
@@ -47,55 +39,55 @@ export const DateRangeFilter = (props: DateRangeFilterProps) => {
}
}, [value]);
- useEffect(() => {
- if (dateRangeOption && dateRangeOption !== 'custom') {
- setFromDate('');
- setToDate('');
- onChange(
- 'dateRange',
- !dateRangeOption || dateRangeOption === 'select' ? '' : dateRangeOption,
- );
+ const handleCustom = (from?: string, to?: string) => {
+ const startDate = new Date(from ?? fromDate);
+ const endDate = new Date(to ?? toDate);
+ if (startDate <= endDate) {
+ setValidation({ isValid: true });
+ onChange(`${formatDate(startDate)}--${formatDate(endDate)}`);
+ } else {
+ setValidation({
+ isValid: false,
+ message: t('datePicker.invalidRange'),
+ });
}
- }, [dateRangeOption, onChange]);
-
- useEffect(() => {
- if (fromDate && toDate) {
- const startDate = new Date(fromDate);
- const endDate = new Date(toDate);
- if (startDate <= endDate) {
- setValidation({ isValid: true });
- onChange('dateRange', `${fromDate}--${toDate}`);
- } else {
- setValidation({
- isValid: false,
- message: t('datePicker.invalidRange'),
- });
- }
- }
- }, [t, fromDate, toDate, onChange]);
+ };
return (
-
- {
- setDateRangeOption(_e.target.value);
- }}
- variant="outlined"
- defaultValue="None"
- >
-
-
-
-
-
+
+ {validation.message && (
+
+
+ {validation.message}
+
+
+ )}
+
+ {
+ if (e.target.value !== 'custom') {
+ onChange(e.target.value === 'select' ? '' : e.target.value);
+ }
+ setDateRangeOption(e.target.value);
+ }}
+ variant="outlined"
+ defaultValue="select"
+ >
+
+
+
+
+
+
{dateRangeOption === 'custom' && (
-
-
+ <>
+
{
className={styles.dateFilter}
InputLabelProps={{ shrink: true }}
error={!validation.isValid}
- onChange={_e => setFromDate(_e.target.value)}
+ onChange={e => {
+ handleCustom(e.target.value);
+ }}
inputProps={{
max: toDate || localDate,
}}
/>
+
+
{
className={styles.dateFilter}
InputLabelProps={{ shrink: true }}
error={!validation.isValid}
- onChange={_e => setToDate(_e.target.value)}
+ onChange={e => {
+ handleCustom(undefined, e.target.value);
+ }}
inputProps={{
min: fromDate,
max: localDate,
}}
/>
-
- {validation.message && (
-
- {validation.message}
-
- )}
-
+
+ >
)}
-
+
);
};
diff --git a/plugins/qeta-react/src/components/FilterPanel/FilterPanel.tsx b/plugins/qeta-react/src/components/FilterPanel/FilterPanel.tsx
index 74fd398c..7f8d8802 100644
--- a/plugins/qeta-react/src/components/FilterPanel/FilterPanel.tsx
+++ b/plugins/qeta-react/src/components/FilterPanel/FilterPanel.tsx
@@ -1,18 +1,16 @@
import React from 'react';
-import {
- Box,
- Checkbox,
- Divider,
- FormControl,
- FormControlLabel,
- FormGroup,
- FormLabel,
- Grid,
- IconButton,
- Radio,
- RadioGroup,
- Tooltip,
-} from '@material-ui/core';
+import IconButton from '@mui/material/IconButton';
+import Tooltip from '@mui/material/Tooltip';
+import Divider from '@mui/material/Divider';
+import Box from '@mui/material/Box';
+import Grid from '@mui/material/Grid';
+import FormControl from '@mui/material/FormControl';
+import FormControlLabel from '@mui/material/FormControlLabel';
+import Radio from '@mui/material/Radio';
+import RadioGroup from '@mui/material/RadioGroup';
+import FormGroup from '@mui/material/FormGroup';
+import FormLabel from '@mui/material/FormLabel';
+import Checkbox from '@mui/material/Checkbox';
import { Entity, stringifyEntityRef } from '@backstage/catalog-model';
import { DateRangeFilter } from './DateRangeFilter';
import { PostType } from '@drodil/backstage-plugin-qeta-common';
@@ -24,8 +22,8 @@ import {
useStarredEntities,
} from '@backstage/plugin-catalog-react';
import { identityApiRef, useApi } from '@backstage/core-plugin-api';
-import FiberManualRecordIcon from '@material-ui/icons/FiberManualRecord';
-import AdjustIcon from '@material-ui/icons/Adjust';
+import FiberManualRecordIcon from '@mui/icons-material/FiberManualRecord';
+import AdjustIcon from '@mui/icons-material/Adjust';
const radioSelect = (value: string, label: string) => {
return (
@@ -335,7 +333,7 @@ export const FilterPanel = (props: FilterPanelProps) => {
onChange({ key: 'dateRange', value: e })}
+ onChange={val => onChange({ key: 'dateRange', value: val })}
/>
{showEntityFilter && (
@@ -377,6 +375,7 @@ export const FilterPanel = (props: FilterPanelProps) => {
onChange({ key: 'entitiesRelation', value: 'or' });
}
}}
+ size="large"
>
{filters.entitiesRelation === 'or' ? (
@@ -421,6 +420,7 @@ export const FilterPanel = (props: FilterPanelProps) => {
onChange({ key: 'tagsRelation', value: 'or' });
}
}}
+ size="large"
>
{filters.tagsRelation === 'or' ? (
diff --git a/plugins/qeta-react/src/components/FollowedLists/FollowedCollectionsList.tsx b/plugins/qeta-react/src/components/FollowedLists/FollowedCollectionsList.tsx
index bbc0f7eb..72ee9c2f 100644
--- a/plugins/qeta-react/src/components/FollowedLists/FollowedCollectionsList.tsx
+++ b/plugins/qeta-react/src/components/FollowedLists/FollowedCollectionsList.tsx
@@ -1,4 +1,8 @@
-import { Box, Divider, List, ListItem, ListSubheader } from '@material-ui/core';
+import Divider from '@mui/material/Divider';
+import Box from '@mui/material/Box';
+import ListItem from '@mui/material/ListItem';
+import List from '@mui/material/List';
+import ListSubheader from '@mui/material/ListSubheader';
import React from 'react';
import { useStyles, useTranslation } from '../../hooks';
import { useCollectionsFollow } from '../../hooks/useCollectionsFollow';
diff --git a/plugins/qeta-react/src/components/FollowedLists/FollowedEntitiesList.tsx b/plugins/qeta-react/src/components/FollowedLists/FollowedEntitiesList.tsx
index 92f1bfb3..a32ec056 100644
--- a/plugins/qeta-react/src/components/FollowedLists/FollowedEntitiesList.tsx
+++ b/plugins/qeta-react/src/components/FollowedLists/FollowedEntitiesList.tsx
@@ -1,4 +1,8 @@
-import { Box, Divider, List, ListItem, ListSubheader } from '@material-ui/core';
+import Divider from '@mui/material/Divider';
+import Box from '@mui/material/Box';
+import ListItem from '@mui/material/ListItem';
+import List from '@mui/material/List';
+import ListSubheader from '@mui/material/ListSubheader';
import React from 'react';
import { EntityChip } from '../TagsAndEntities/EntityChip';
import { useEntityFollow, useStyles, useTranslation } from '../../hooks';
diff --git a/plugins/qeta-react/src/components/FollowedLists/FollowedTagsList.tsx b/plugins/qeta-react/src/components/FollowedLists/FollowedTagsList.tsx
index 76d44214..ec1325d9 100644
--- a/plugins/qeta-react/src/components/FollowedLists/FollowedTagsList.tsx
+++ b/plugins/qeta-react/src/components/FollowedLists/FollowedTagsList.tsx
@@ -1,4 +1,8 @@
-import { Box, Divider, List, ListItem, ListSubheader } from '@material-ui/core';
+import Divider from '@mui/material/Divider';
+import Box from '@mui/material/Box';
+import ListItem from '@mui/material/ListItem';
+import List from '@mui/material/List';
+import ListSubheader from '@mui/material/ListSubheader';
import React from 'react';
import { TagChip } from '../TagsAndEntities/TagChip';
import { useStyles, useTagsFollow, useTranslation } from '../../hooks';
diff --git a/plugins/qeta-react/src/components/HeaderImageInput/HeaderImageInput.tsx b/plugins/qeta-react/src/components/HeaderImageInput/HeaderImageInput.tsx
index 763bfcf5..62297476 100644
--- a/plugins/qeta-react/src/components/HeaderImageInput/HeaderImageInput.tsx
+++ b/plugins/qeta-react/src/components/HeaderImageInput/HeaderImageInput.tsx
@@ -1,4 +1,7 @@
-import { Button, Grid, TextField, Typography } from '@material-ui/core';
+import Typography from '@mui/material/Typography';
+import Grid from '@mui/material/Grid';
+import Button from '@mui/material/Button';
+import TextField from '@mui/material/TextField';
import { imageUpload } from '../../utils/utils';
import React from 'react';
import { configApiRef, errorApiRef, useApi } from '@backstage/core-plugin-api';
diff --git a/plugins/qeta-react/src/components/HomePageCards/ImpactCard.tsx b/plugins/qeta-react/src/components/HomePageCards/ImpactCard.tsx
index b6eb5c83..4ece9451 100644
--- a/plugins/qeta-react/src/components/HomePageCards/ImpactCard.tsx
+++ b/plugins/qeta-react/src/components/HomePageCards/ImpactCard.tsx
@@ -1,5 +1,8 @@
import React from 'react';
-import { Box, Card, CardContent, Typography } from '@material-ui/core';
+import Card from '@mui/material/Card';
+import CardContent from '@mui/material/CardContent';
+import Typography from '@mui/material/Typography';
+import Box from '@mui/material/Box';
import numeral from 'numeral';
import { useQetaApi, useTranslation } from '../../hooks';
diff --git a/plugins/qeta-react/src/components/HomePageCards/PostsCard.tsx b/plugins/qeta-react/src/components/HomePageCards/PostsCard.tsx
index 78af810c..1a6d20c7 100644
--- a/plugins/qeta-react/src/components/HomePageCards/PostsCard.tsx
+++ b/plugins/qeta-react/src/components/HomePageCards/PostsCard.tsx
@@ -1,4 +1,7 @@
-import { Card, CardHeader, Divider, Grid } from '@material-ui/core';
+import Card from '@mui/material/Card';
+import CardHeader from '@mui/material/CardHeader';
+import Divider from '@mui/material/Divider';
+import Grid from '@mui/material/Grid';
import React from 'react';
import { PostsQuery, PostType } from '@drodil/backstage-plugin-qeta-common';
import { PostListItem } from '../PostsContainer';
diff --git a/plugins/qeta-react/src/components/LeftMenu/LeftMenu.tsx b/plugins/qeta-react/src/components/LeftMenu/LeftMenu.tsx
index ad32d193..bd0cfaa5 100644
--- a/plugins/qeta-react/src/components/LeftMenu/LeftMenu.tsx
+++ b/plugins/qeta-react/src/components/LeftMenu/LeftMenu.tsx
@@ -1,25 +1,23 @@
-import {
- Box,
- ListItem,
- ListItemIcon,
- makeStyles,
- MenuItem,
- MenuList,
- SvgIcon,
- Typography,
-} from '@material-ui/core';
-import AccountBox from '@material-ui/icons/AccountBox';
-import LoyaltyOutlined from '@material-ui/icons/LoyaltyOutlined';
-import StarIcon from '@material-ui/icons/Star';
+import Typography from '@mui/material/Typography';
+import Box from '@mui/material/Box';
+import MenuItem from '@mui/material/MenuItem';
+import ListItem from '@mui/material/ListItem';
+import SvgIcon from '@mui/material/SvgIcon';
+import MenuList from '@mui/material/MenuList';
+import ListItemIcon from '@mui/material/ListItemIcon';
+import makeStyles from '@mui/styles/makeStyles';
+import AccountBox from '@mui/icons-material/AccountBox';
+import LoyaltyOutlined from '@mui/icons-material/LoyaltyOutlined';
+import StarIcon from '@mui/icons-material/Star';
import React, { ReactNode } from 'react';
import { useApp, useRouteRef } from '@backstage/core-plugin-api';
-import HelpOutlined from '@material-ui/icons/HelpOutlined';
+import HelpOutlined from '@mui/icons-material/HelpOutlined';
import { useNavigate } from 'react-router-dom';
-import Home from '@material-ui/icons/Home';
+import Home from '@mui/icons-material/Home';
import { useLocation } from 'react-use';
-import CollectionsBookmarkIcon from '@material-ui/icons/CollectionsBookmark';
-import PlaylistPlay from '@material-ui/icons/PlaylistPlay';
-import SettingsIcon from '@material-ui/icons/Settings';
+import CollectionsBookmarkIcon from '@mui/icons-material/CollectionsBookmark';
+import PlaylistPlay from '@mui/icons-material/PlaylistPlay';
+import SettingsIcon from '@mui/icons-material/Settings';
import { GroupIcon } from '@backstage/core-components';
import {
articlesRouteRef,
@@ -51,6 +49,7 @@ export const useStyles = makeStyles(
leftMenu: {
top: '0',
width: '165px',
+ paddingTop: '2rem',
},
inPopup: {
marginRight: 0,
@@ -87,7 +86,9 @@ export const useStyles = makeStyles(
export const LeftMenu = (props: {
onKeyDown?: (event: React.KeyboardEvent) => void;
autoFocusItem?: boolean;
- onClick?: (event: React.MouseEvent) => void;
+ onClick?: (
+ event: MouseEvent | TouchEvent | React.MouseEvent,
+ ) => void;
inPopup?: boolean;
}) => {
const rootRoute = useRouteRef(qetaRouteRef);
diff --git a/plugins/qeta-react/src/components/LeftMenu/LeftMenuButton.tsx b/plugins/qeta-react/src/components/LeftMenu/LeftMenuButton.tsx
index 7b420fcf..ea9f3be4 100644
--- a/plugins/qeta-react/src/components/LeftMenu/LeftMenuButton.tsx
+++ b/plugins/qeta-react/src/components/LeftMenu/LeftMenuButton.tsx
@@ -1,13 +1,11 @@
-import {
- Button,
- ClickAwayListener,
- Grow,
- Paper,
- Popper,
-} from '@material-ui/core';
+import Button from '@mui/material/Button';
+import Popper from '@mui/material/Popper';
+import Paper from '@mui/material/Paper';
+import Grow from '@mui/material/Grow';
+import ClickAwayListener from '@mui/material/ClickAwayListener';
import React from 'react';
import { LeftMenu } from './LeftMenu';
-import MenuIcon from '@material-ui/icons/Menu';
+import MenuIcon from '@mui/icons-material/Menu';
export const LeftMenuButton = () => {
const [open, setOpen] = React.useState(false);
@@ -17,7 +15,9 @@ export const LeftMenuButton = () => {
setOpen(prevOpen => !prevOpen);
};
- const handleClose = (event: React.MouseEvent) => {
+ const handleClose = (
+ event: MouseEvent | TouchEvent | React.MouseEvent,
+ ) => {
if (
anchorRef.current &&
anchorRef.current.contains(event.target as HTMLElement)
diff --git a/plugins/qeta-react/src/components/LoadingGrid/LoadingGrid.tsx b/plugins/qeta-react/src/components/LoadingGrid/LoadingGrid.tsx
index b824cc5f..4070a8ff 100644
--- a/plugins/qeta-react/src/components/LoadingGrid/LoadingGrid.tsx
+++ b/plugins/qeta-react/src/components/LoadingGrid/LoadingGrid.tsx
@@ -1,4 +1,5 @@
-import { CircularProgress, Grid } from '@material-ui/core';
+import Grid from '@mui/material/Grid';
+import CircularProgress from '@mui/material/CircularProgress';
import React from 'react';
export const LoadingGrid = () => {
diff --git a/plugins/qeta-react/src/components/MarkdownEditor/MarkdownEditor.tsx b/plugins/qeta-react/src/components/MarkdownEditor/MarkdownEditor.tsx
index f55fcbe5..0e2f536a 100644
--- a/plugins/qeta-react/src/components/MarkdownEditor/MarkdownEditor.tsx
+++ b/plugins/qeta-react/src/components/MarkdownEditor/MarkdownEditor.tsx
@@ -10,7 +10,7 @@ import { errorApiRef, useApi } from '@backstage/core-plugin-api';
import { qetaApiRef } from '../../api';
import { MarkdownRenderer } from '../MarkdownRenderer';
import { imageUpload } from '../../utils/utils';
-import { makeStyles } from '@material-ui/core';
+import makeStyles from '@mui/styles/makeStyles';
import { catalogApiRef } from '@backstage/plugin-catalog-react';
import { stringifyEntityRef, UserEntity } from '@backstage/catalog-model';
diff --git a/plugins/qeta-react/src/components/MarkdownRenderer/MarkdownRenderer.tsx b/plugins/qeta-react/src/components/MarkdownRenderer/MarkdownRenderer.tsx
index 6f811b88..3b944fd3 100644
--- a/plugins/qeta-react/src/components/MarkdownRenderer/MarkdownRenderer.tsx
+++ b/plugins/qeta-react/src/components/MarkdownRenderer/MarkdownRenderer.tsx
@@ -5,7 +5,7 @@ import {
a11yDark,
a11yLight,
} from 'react-syntax-highlighter/dist/esm/styles/hljs';
-import { makeStyles } from '@material-ui/core';
+import makeStyles from '@mui/styles/makeStyles';
import { findUserMentions } from '@drodil/backstage-plugin-qeta-common';
import gfm from 'remark-gfm';
import { EntityRefLink } from '@backstage/plugin-catalog-react';
diff --git a/plugins/qeta-react/src/components/PostAnonymouslyCheckbox/PostAnonymouslyCheckbox.tsx b/plugins/qeta-react/src/components/PostAnonymouslyCheckbox/PostAnonymouslyCheckbox.tsx
index 7b7595c3..7ddf6cd5 100644
--- a/plugins/qeta-react/src/components/PostAnonymouslyCheckbox/PostAnonymouslyCheckbox.tsx
+++ b/plugins/qeta-react/src/components/PostAnonymouslyCheckbox/PostAnonymouslyCheckbox.tsx
@@ -1,5 +1,8 @@
import { Control, Controller } from 'react-hook-form';
-import { Box, Checkbox, FormControlLabel, Tooltip } from '@material-ui/core';
+import Tooltip from '@mui/material/Tooltip';
+import Box from '@mui/material/Box';
+import Checkbox from '@mui/material/Checkbox';
+import FormControlLabel from '@mui/material/FormControlLabel';
import React from 'react';
import { useTranslation } from '../../hooks';
diff --git a/plugins/qeta-react/src/components/PostForm/EntitiesInput.tsx b/plugins/qeta-react/src/components/PostForm/EntitiesInput.tsx
index 3bff7962..e7d54b8a 100644
--- a/plugins/qeta-react/src/components/PostForm/EntitiesInput.tsx
+++ b/plugins/qeta-react/src/components/PostForm/EntitiesInput.tsx
@@ -1,7 +1,8 @@
-import { Autocomplete } from '@material-ui/lab';
import { getEntityTitle } from '../../utils/utils';
import { Entity, stringifyEntityRef } from '@backstage/catalog-model';
-import { TextField, Tooltip } from '@material-ui/core';
+import Tooltip from '@mui/material/Tooltip';
+import TextField from '@mui/material/TextField';
+import Autocomplete from '@mui/material/Autocomplete';
import React, { useEffect, useMemo } from 'react';
import { configApiRef, useApi } from '@backstage/core-plugin-api';
import { catalogApiRef } from '@backstage/plugin-catalog-react';
@@ -113,7 +114,7 @@ export const EntitiesInput = (props: {
options={availableEntities}
getOptionLabel={getEntityTitle}
style={style}
- getOptionSelected={(o, v) =>
+ isOptionEqualToValue={(o, v) =>
stringifyEntityRef(o) === stringifyEntityRef(v)
}
onChange={(_e, newValue) => {
@@ -121,13 +122,13 @@ export const EntitiesInput = (props: {
onChange(newValue);
}
}}
- renderOption={option => {
+ renderOption={(optionProps, option) => {
return (
- <>
+
{getEntityTitle(option)}
- >
+
);
}}
renderInput={params => (
diff --git a/plugins/qeta-react/src/components/PostForm/PostForm.tsx b/plugins/qeta-react/src/components/PostForm/PostForm.tsx
index 307612ac..233f8468 100644
--- a/plugins/qeta-react/src/components/PostForm/PostForm.tsx
+++ b/plugins/qeta-react/src/components/PostForm/PostForm.tsx
@@ -4,8 +4,9 @@ import {
useApi,
useRouteRef,
} from '@backstage/core-plugin-api';
-import { Button, TextField } from '@material-ui/core';
-import { Alert } from '@material-ui/lab';
+import Button from '@mui/material/Button';
+import TextField from '@mui/material/TextField';
+import Alert from '@mui/material/Alert';
import React, { useCallback, useEffect } from 'react';
import { Controller, useForm } from 'react-hook-form';
import { useNavigate, useSearchParams } from 'react-router-dom';
diff --git a/plugins/qeta-react/src/components/PostForm/TagInput.tsx b/plugins/qeta-react/src/components/PostForm/TagInput.tsx
index 08c72d18..3c32ee10 100644
--- a/plugins/qeta-react/src/components/PostForm/TagInput.tsx
+++ b/plugins/qeta-react/src/components/PostForm/TagInput.tsx
@@ -1,5 +1,6 @@
-import { Autocomplete } from '@material-ui/lab';
-import { TextField, Tooltip } from '@material-ui/core';
+import Tooltip from '@mui/material/Tooltip';
+import TextField from '@mui/material/TextField';
+import Autocomplete from '@mui/material/Autocomplete';
import React, { useEffect, useMemo } from 'react';
import { qetaApiRef } from '../../api';
import { configApiRef, useApi } from '@backstage/core-plugin-api';
@@ -81,17 +82,17 @@ export const TagInput = (props: {
options={availableTags ?? []}
freeSolo={allowCreation}
style={style}
- renderOption={option => {
+ renderOption={(optionProps, option) => {
if (tagDescriptions[option]) {
return (
- <>
+
{option}
- >
+
);
}
- return option;
+ return {option};
}}
onChange={(_e, newValue) => {
const tags = filterTags(newValue);
diff --git a/plugins/qeta-react/src/components/PostHighlightList/PostHighlightList.tsx b/plugins/qeta-react/src/components/PostHighlightList/PostHighlightList.tsx
index 0b760971..a49f10d2 100644
--- a/plugins/qeta-react/src/components/PostHighlightList/PostHighlightList.tsx
+++ b/plugins/qeta-react/src/components/PostHighlightList/PostHighlightList.tsx
@@ -1,13 +1,11 @@
-import {
- Box,
- Divider,
- List,
- ListItem,
- ListItemText,
- ListSubheader,
-} from '@material-ui/core';
+import Divider from '@mui/material/Divider';
+import Box from '@mui/material/Box';
+import ListItem from '@mui/material/ListItem';
+import List from '@mui/material/List';
+import ListSubheader from '@mui/material/ListSubheader';
+import ListItemText from '@mui/material/ListItemText';
import React from 'react';
-import { Skeleton } from '@material-ui/lab';
+import Skeleton from '@mui/material/Skeleton';
import { useRouteRef } from '@backstage/core-plugin-api';
import { articleRouteRef, questionRouteRef } from '../../routes';
import { PostsQuery, PostType } from '@drodil/backstage-plugin-qeta-common';
@@ -53,9 +51,14 @@ export const PostHighlightList = (props: {
subheader={