Skip to content

Commit

Permalink
Fix indexes breadcrum link, fixes #4326
Browse files Browse the repository at this point in the history
  • Loading branch information
ddelemeny committed Dec 26, 2023
1 parent 77b0e17 commit a2da0c7
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions quickwit/quickwit-ui/src/views/IndexView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

import { Box, styled, Typography, Link, Tab } from '@mui/material';
import { Box, styled, Typography, Tab } from '@mui/material';
import Link, { LinkProps } from '@mui/material/Link';
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { Client } from '../services/client';
import Loader from '../components/Loader';
import { useParams } from 'react-router-dom';
import { Link as RouterLink, useParams } from 'react-router-dom';
import { Index } from '../utils/models';
import { TabContext, TabList, TabPanel } from '@mui/lab';
import { IndexSummary } from '../components/IndexSummary';
Expand All @@ -39,6 +40,16 @@ padding-right: 0;
height: 100%;
`;

// NOTE : https://mui.com/material-ui/react-breadcrumbs/#integration-with-react-router
interface LinkRouterProps extends LinkProps {
to: string;
replace?: boolean;
}

function LinkRouter(props: LinkRouterProps) {
return <Link {...props} component={RouterLink} />;
}

function IndexView() {
const { indexId } = useParams();
const [loading, setLoading] = useState(false)
Expand Down Expand Up @@ -123,9 +134,9 @@ function IndexView() {
<ViewUnderAppBarBox>
<FullBoxContainer>
<QBreadcrumbs aria-label="breadcrumb">
<Link underline="hover" color="inherit" href="../indexes">
<LinkRouter underline="hover" color="inherit" to="/indexes">
<Typography color="text.primary">Indexes</Typography>
</Link>
</LinkRouter>
<Typography color="text.primary">{indexId}</Typography>
</QBreadcrumbs>
{ renderFetchIndexResult() }
Expand Down

0 comments on commit a2da0c7

Please sign in to comment.