diff --git a/enterprise/frontend/src/metabase-enterprise/model_persistence/index.ts b/enterprise/frontend/src/metabase-enterprise/model_persistence/index.ts index 2367656fcf0ee2e5bf42aa24f8e5e63c5ae1a2d7..5dcdad007a08f2ccb9577ac63eac8d2413143470 100644 --- a/enterprise/frontend/src/metabase-enterprise/model_persistence/index.ts +++ b/enterprise/frontend/src/metabase-enterprise/model_persistence/index.ts @@ -2,11 +2,9 @@ import { PLUGIN_MODEL_PERSISTENCE } from "metabase/plugins"; import { hasPremiumFeature } from "metabase-enterprise/settings"; import ModelCacheControl from "./components/ModelCacheControl"; -import ModelCacheManagementSection from "./components/ModelCacheManagementSection"; if (hasPremiumFeature("advanced_config")) { PLUGIN_MODEL_PERSISTENCE.isModelLevelPersistenceEnabled = () => true; PLUGIN_MODEL_PERSISTENCE.ModelCacheControl = ModelCacheControl; - PLUGIN_MODEL_PERSISTENCE.ModelCacheManagementSection = ModelCacheManagementSection; } diff --git a/frontend/src/metabase/plugins/index.ts b/frontend/src/metabase/plugins/index.ts index 2c6a1c851761b39d98ec8c9b019171371c676171..a62bda512129e5189f1d530968a7d93f9cb975f7 100644 --- a/frontend/src/metabase/plugins/index.ts +++ b/frontend/src/metabase/plugins/index.ts @@ -188,5 +188,4 @@ export const PLUGIN_GROUP_MANAGERS: PluginGroupManagersType = { export const PLUGIN_MODEL_PERSISTENCE = { isModelLevelPersistenceEnabled: () => false, ModelCacheControl: PluginPlaceholder as any, - ModelCacheManagementSection: PluginPlaceholder as any, }; diff --git a/enterprise/frontend/src/metabase-enterprise/model_persistence/components/ModelCacheManagementSection/ModelCacheManagementSection.styled.tsx b/frontend/src/metabase/query_builder/components/view/sidebars/ModelCacheManagementSection/ModelCacheManagementSection.styled.tsx similarity index 100% rename from enterprise/frontend/src/metabase-enterprise/model_persistence/components/ModelCacheManagementSection/ModelCacheManagementSection.styled.tsx rename to frontend/src/metabase/query_builder/components/view/sidebars/ModelCacheManagementSection/ModelCacheManagementSection.styled.tsx diff --git a/enterprise/frontend/src/metabase-enterprise/model_persistence/components/ModelCacheManagementSection/ModelCacheManagementSection.tsx b/frontend/src/metabase/query_builder/components/view/sidebars/ModelCacheManagementSection/ModelCacheManagementSection.tsx similarity index 96% rename from enterprise/frontend/src/metabase-enterprise/model_persistence/components/ModelCacheManagementSection/ModelCacheManagementSection.tsx rename to frontend/src/metabase/query_builder/components/view/sidebars/ModelCacheManagementSection/ModelCacheManagementSection.tsx index 242ce5445d2484a7db059fc948f64f6a16285cf9..f8447e29841c91f61d98265761d0d199737256b4 100644 --- a/enterprise/frontend/src/metabase-enterprise/model_persistence/components/ModelCacheManagementSection/ModelCacheManagementSection.tsx +++ b/frontend/src/metabase/query_builder/components/view/sidebars/ModelCacheManagementSection/ModelCacheManagementSection.tsx @@ -29,14 +29,11 @@ type LoaderRenderProps = { }; function getStatusMessage(job: ModelCacheRefreshStatus) { - if (job.state === "off") { - return t`Caching is turned off`; - } if (job.state === "error") { return t`Failed to update model cache`; } if (job.state === "creating") { - return t`Queued`; + return t`Waiting to create the first model cache`; } if (job.state === "refreshing") { return t`Refreshing model cache`; diff --git a/enterprise/frontend/src/metabase-enterprise/model_persistence/components/ModelCacheManagementSection/ModelCacheManagementSection.unit.spec.tsx b/frontend/src/metabase/query_builder/components/view/sidebars/ModelCacheManagementSection/ModelCacheManagementSection.unit.spec.tsx similarity index 97% rename from enterprise/frontend/src/metabase-enterprise/model_persistence/components/ModelCacheManagementSection/ModelCacheManagementSection.unit.spec.tsx rename to frontend/src/metabase/query_builder/components/view/sidebars/ModelCacheManagementSection/ModelCacheManagementSection.unit.spec.tsx index 65835613ecae39ba399f9d957041fc0199932305..c390d5ba740c179a35339495f7f97b45f25b60dd 100644 --- a/enterprise/frontend/src/metabase-enterprise/model_persistence/components/ModelCacheManagementSection/ModelCacheManagementSection.unit.spec.tsx +++ b/frontend/src/metabase/query_builder/components/view/sidebars/ModelCacheManagementSection/ModelCacheManagementSection.unit.spec.tsx @@ -90,7 +90,9 @@ describe("ModelCacheManagementSection", () => { it("displays 'creating' state correctly", async () => { await setup({ state: "creating" }); - expect(screen.getByText("Queued")).toBeInTheDocument(); + expect( + screen.getByText("Waiting to create the first model cache"), + ).toBeInTheDocument(); expect(screen.queryByLabelText("refresh icon")).not.toBeInTheDocument(); }); diff --git a/enterprise/frontend/src/metabase-enterprise/model_persistence/components/ModelCacheManagementSection/index.ts b/frontend/src/metabase/query_builder/components/view/sidebars/ModelCacheManagementSection/index.ts similarity index 100% rename from enterprise/frontend/src/metabase-enterprise/model_persistence/components/ModelCacheManagementSection/index.ts rename to frontend/src/metabase/query_builder/components/view/sidebars/ModelCacheManagementSection/index.ts diff --git a/frontend/src/metabase/query_builder/components/view/sidebars/QuestionInfoSidebar.tsx b/frontend/src/metabase/query_builder/components/view/sidebars/QuestionInfoSidebar.tsx index 1d7de32c74df9cf19987e7430ed1513e4fc88e79..fb511938f6df02775bd45e8c185d71aea09f9437 100644 --- a/frontend/src/metabase/query_builder/components/view/sidebars/QuestionInfoSidebar.tsx +++ b/frontend/src/metabase/query_builder/components/view/sidebars/QuestionInfoSidebar.tsx @@ -1,11 +1,7 @@ import React from "react"; import { t } from "ttag"; -import { - PLUGIN_MODERATION, - PLUGIN_MODEL_PERSISTENCE, - PLUGIN_CACHING, -} from "metabase/plugins"; +import { PLUGIN_MODERATION, PLUGIN_CACHING } from "metabase/plugins"; import MetabaseSettings from "metabase/lib/settings"; @@ -15,6 +11,8 @@ import Question from "metabase-lib/lib/Question"; import { Card } from "metabase-types/types/Card"; import EditableText from "metabase/core/components/EditableText"; + +import ModelCacheManagementSection from "./ModelCacheManagementSection"; import { Root, ContentSection } from "./QuestionInfoSidebar.styled"; interface QuestionInfoSidebarProps { @@ -60,9 +58,7 @@ export const QuestionInfoSidebar = ({ {isPersisted && ( <ContentSection extraPadding> - <PLUGIN_MODEL_PERSISTENCE.ModelCacheManagementSection - model={question} - /> + <ModelCacheManagementSection model={question} /> </ContentSection> )}