From 75582508790c2c10be01dd36eb43999ba3edefde Mon Sep 17 00:00:00 2001 From: Ali BARIN Date: Mon, 27 Jan 2025 10:18:56 +0000 Subject: [PATCH] feat(AdminApplication): hide oauth tab for unsupported apps --- .../web/src/pages/AdminApplication/index.jsx | 79 +++++++++++-------- 1 file changed, 47 insertions(+), 32 deletions(-) diff --git a/packages/web/src/pages/AdminApplication/index.jsx b/packages/web/src/pages/AdminApplication/index.jsx index a7e24de3..256bfc99 100644 --- a/packages/web/src/pages/AdminApplication/index.jsx +++ b/packages/web/src/pages/AdminApplication/index.jsx @@ -31,18 +31,22 @@ export default function AdminApplication() { const matchSmallScreens = useMediaQuery(theme.breakpoints.down('md')); const formatMessage = useFormatMessage(); const navigate = useNavigate(); + const connectionsPathMatch = useMatch({ path: URLS.ADMIN_APP_CONNECTIONS_PATTERN, end: false, }); + const settingsPathMatch = useMatch({ path: URLS.ADMIN_APP_SETTINGS_PATTERN, end: false, }); + const oauthClientsPathMatch = useMatch({ path: URLS.ADMIN_APP_AUTH_CLIENTS_PATTERN, end: false, }); + const { appKey } = useParams(); const { data, loading } = useApp(appKey); @@ -86,13 +90,16 @@ export default function AdminApplication() { value={URLS.ADMIN_APP_SETTINGS_PATTERN} component={Link} /> - + + {app.supportsOauthClients && ( + + )} @@ -101,10 +108,14 @@ export default function AdminApplication() { path={`/settings/*`} element={} /> - } - /> + + {app.supportsOauthClients && ( + } + /> + )} + - - - } - /> - - } - /> - + + {app.supportsOauthClients && ( + + + } + /> + + + } + /> + + )} ); }