From bd402fa63f26c602f0027c7f8f479fff3a739061 Mon Sep 17 00:00:00 2001 From: Aaysha <109507451+aayshasura@users.noreply.github.com> Date: Mon, 15 Jan 2024 20:26:27 +0530 Subject: [PATCH] SchemaRegistry bugfix cherrypick(v2.35) PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10622 GitOrigin-RevId: 5f1b15b52342d176fb697a9ce2b4e2650ffc6c49 --- .../Services/ApiExplorer/TopNav.tsx | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/frontend/libs/console/legacy-ce/src/lib/components/Services/ApiExplorer/TopNav.tsx b/frontend/libs/console/legacy-ce/src/lib/components/Services/ApiExplorer/TopNav.tsx index fc29444b798..71f1841ce58 100644 --- a/frontend/libs/console/legacy-ce/src/lib/components/Services/ApiExplorer/TopNav.tsx +++ b/frontend/libs/console/legacy-ce/src/lib/components/Services/ApiExplorer/TopNav.tsx @@ -7,7 +7,7 @@ import { IconTooltip } from '../../../new-components/Tooltip'; import { FaExclamationCircle, FaRegMap } from 'react-icons/fa'; import { sendTelemetryEvent } from '../../../telemetry'; import { useGetSchemaRegistryNotificationColor } from '../../../features/SchemaRegistry/hooks/useGetSchemaRegistryNotificationColor'; -import { getLSItem, LS_KEYS, setLSItem } from '../../../utils'; +import { getLSItem, isCloudConsole, LS_KEYS, setLSItem } from '../../../utils'; import { BreakingChangesColor, BreakingChangesTooltipMessage, @@ -39,12 +39,6 @@ const TopNav: React.FC = ({ location }) => { dataTestVal: 'rest-explorer-link', title: 'REST', }, - { - key: 'schema-registry', - link: '/api/schema-registry', - dataTestVal: 'schema-registry-link', - title: 'Schema Registry', - }, ], [ { @@ -63,6 +57,18 @@ const TopNav: React.FC = ({ location }) => { dataTestVal: 'security-explorer-link', title: 'Security', }); + + if ( + isCloudConsole(globals) && + (globals.userRole === 'admin' || globals.userRole === 'owner') + ) { + sectionsData[0].push({ + key: 'schema-registry', + link: '/api/schema-registry', + dataTestVal: 'schema-registry-link', + title: 'Schema Registry', + }); + } } const isActive = (link: string) => {