console: show cache button in EE console

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5840
GitOrigin-RevId: 3ba01eaa04ae66ee62b60403643e71bb720f961a
This commit is contained in:
Rikin Kachhia 2022-09-14 19:05:13 +05:30 committed by hasura-bot
parent cbddcce26b
commit 255310f9ed
2 changed files with 4 additions and 2 deletions

View File

@ -33,7 +33,7 @@ import {
} from '../../Actions/Add/reducer';
import { getGraphQLEndpoint } from '../utils';
import snippets from './snippets';
import globals from '../../../../Globals';
import { canAccessCacheButton } from '@/utils/permissions';
import 'graphiql/graphiql.css';
import 'graphiql-code-exporter/CodeExporter.css';
@ -240,7 +240,7 @@ class GraphiQLWrapper extends Component {
label: 'Cache',
title: 'Cache the response of this query',
onClick: _toggleCacheDirective,
hide: globals.consoleType !== 'cloud',
hide: !canAccessCacheButton(),
},
{
label: 'Code Exporter',

View File

@ -4,3 +4,5 @@ import { isProConsole } from './proConsole';
export const canAccessReadReplica = () => isProConsole(window.__env);
export const canAccessSecuritySettings = () => isProConsole(window.__env);
export const canAccessCacheButton = () => isProConsole(window.__env);