Skip to content
Snippets Groups Projects
Unverified Commit 56ed43e1 authored by Alexander Polyankin's avatar Alexander Polyankin Committed by GitHub
Browse files

Show caching controls only for questions (#23784)

parent d7ca8c9f
No related branches found
No related tags found
No related merge requests found
...@@ -27,9 +27,10 @@ export const QuestionInfoSidebar = ({ ...@@ -27,9 +27,10 @@ export const QuestionInfoSidebar = ({
const description = question.description(); const description = question.description();
const isDataset = question.isDataset(); const isDataset = question.isDataset();
const isPersisted = isDataset && question.isPersisted(); const isPersisted = isDataset && question.isPersisted();
const isCachingAvailable =
const showCaching = !isDataset &&
PLUGIN_CACHING.isEnabled() && MetabaseSettings.get("enable-query-caching"); PLUGIN_CACHING.isEnabled() &&
MetabaseSettings.get("enable-query-caching");
const handleSave = (description: string | null) => { const handleSave = (description: string | null) => {
if (question.description() !== description) { if (question.description() !== description) {
...@@ -63,7 +64,7 @@ export const QuestionInfoSidebar = ({ ...@@ -63,7 +64,7 @@ export const QuestionInfoSidebar = ({
</ContentSection> </ContentSection>
)} )}
{showCaching && ( {isCachingAvailable && (
<ContentSection extraPadding> <ContentSection extraPadding>
<PLUGIN_CACHING.QuestionCacheSection <PLUGIN_CACHING.QuestionCacheSection
question={question} question={question}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment