From a9d607658dcb546ec13eedd13ee81bf2486c6718 Mon Sep 17 00:00:00 2001 From: Xiao Yijun Date: Tue, 29 Nov 2022 11:24:52 +0800 Subject: [PATCH] fix(console): correct tab nav link on the audit-logs details page (#2543) --- packages/console/src/pages/AuditLogDetails/index.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/console/src/pages/AuditLogDetails/index.tsx b/packages/console/src/pages/AuditLogDetails/index.tsx index cb90cec62..defeca76a 100644 --- a/packages/console/src/pages/AuditLogDetails/index.tsx +++ b/packages/console/src/pages/AuditLogDetails/index.tsx @@ -24,6 +24,9 @@ import * as styles from './index.module.scss'; const getAuditLogDetailsRelatedResourceLink = (pathname: string) => `/${pathname.slice(0, pathname.lastIndexOf('/'))}`; +const getDetailsTabNavLink = (logId: string, userId?: string) => + userId ? `/users/${userId}/logs/${logId}` : `/audit-logs/${logId}`; + const AuditLogDetails = () => { const { userId, logId } = useParams(); const { pathname } = useLocation(); @@ -42,6 +45,10 @@ const AuditLogDetails = () => { 'log_details.back_to_logs' ); + if (!logId) { + return null; + } + return (
} title={backLinkTitle} className={styles.backLink} /> @@ -96,7 +103,7 @@ const AuditLogDetails = () => {
- + {t('log_details.tab_details')}