mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
fix(console): correct tab nav link on the audit-logs details page (#2543)
This commit is contained in:
parent
356a77e70c
commit
a9d607658d
1 changed files with 8 additions and 1 deletions
|
@ -24,6 +24,9 @@ import * as styles from './index.module.scss';
|
||||||
const getAuditLogDetailsRelatedResourceLink = (pathname: string) =>
|
const getAuditLogDetailsRelatedResourceLink = (pathname: string) =>
|
||||||
`/${pathname.slice(0, pathname.lastIndexOf('/'))}`;
|
`/${pathname.slice(0, pathname.lastIndexOf('/'))}`;
|
||||||
|
|
||||||
|
const getDetailsTabNavLink = (logId: string, userId?: string) =>
|
||||||
|
userId ? `/users/${userId}/logs/${logId}` : `/audit-logs/${logId}`;
|
||||||
|
|
||||||
const AuditLogDetails = () => {
|
const AuditLogDetails = () => {
|
||||||
const { userId, logId } = useParams();
|
const { userId, logId } = useParams();
|
||||||
const { pathname } = useLocation();
|
const { pathname } = useLocation();
|
||||||
|
@ -42,6 +45,10 @@ const AuditLogDetails = () => {
|
||||||
'log_details.back_to_logs'
|
'log_details.back_to_logs'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (!logId) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={detailsStyles.container}>
|
<div className={detailsStyles.container}>
|
||||||
<LinkButton to={backLink} icon={<Back />} title={backLinkTitle} className={styles.backLink} />
|
<LinkButton to={backLink} icon={<Back />} title={backLinkTitle} className={styles.backLink} />
|
||||||
|
@ -96,7 +103,7 @@ const AuditLogDetails = () => {
|
||||||
</div>
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
<TabNav>
|
<TabNav>
|
||||||
<TabNavItem href={`/audit-logs/${logId ?? ''}`}>
|
<TabNavItem href={getDetailsTabNavLink(logId, userId)}>
|
||||||
{t('log_details.tab_details')}
|
{t('log_details.tab_details')}
|
||||||
</TabNavItem>
|
</TabNavItem>
|
||||||
</TabNav>
|
</TabNav>
|
||||||
|
|
Loading…
Reference in a new issue