mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-23 01:27:42 +01:00
Check for permission before linking to Query page from Query Modal
This commit is contained in:
parent
c032009144
commit
4b3efe1378
@ -7,9 +7,11 @@ import PlayerListCard from "../cards/common/PlayerListCard";
|
||||
import {getViewTitle} from "../../views/query/QueryResultView";
|
||||
import {ChartLoader} from "../navigation/Loader";
|
||||
import {Link} from "react-router-dom";
|
||||
import {useAuth} from "../../hooks/authenticationHook";
|
||||
|
||||
const QueryPlayerListModal = ({open, toggle, queryData, title}) => {
|
||||
const {t} = useTranslation();
|
||||
const {hasPermission} = useAuth();
|
||||
return (
|
||||
<Modal id="queryModal" aria-labelledby="queryModalLabel" show={open} onHide={toggle} size="xl">
|
||||
<Modal.Header>
|
||||
@ -23,7 +25,7 @@ const QueryPlayerListModal = ({open, toggle, queryData, title}) => {
|
||||
<PlayerListCard justList data={queryData?.data?.players || {players: [], extensionDescriptors: []}}
|
||||
orderBy={2}/>}
|
||||
<Modal.Footer>
|
||||
{Boolean(queryData?.data?.players.players.length) && <Link className="btn bg-theme"
|
||||
{hasPermission('access.query') && Boolean(queryData?.data?.players.players.length) && <Link className="btn bg-theme"
|
||||
to={"/query/result?timestamp=" + queryData?.timestamp}>
|
||||
{t('html.query.label.showFullQuery')} <Fa icon={faArrowRight}/>
|
||||
</Link>}
|
||||
|
Loading…
Reference in New Issue
Block a user