The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:
TypeScript analyticsbibusiness-intelligencebusinessintelligenceclojuredashboarddatadata-analysisdata-visualizationdatabasemetabasemysqlpostgrespostgresqlreportingslacksql-editorvisualization
Integration branch for Embedding settings reorganization (#80336)
Mahatthana (Kelvin) Nomsawadib9d217cbb4a6
diff --git a/.clj-kondo/config/modules/config.edn b/.clj-kondo/config/modules/config.ednindex 2f93f9a3b65..f6152d616e3 100644--- a/.clj-kondo/config/modules/config.edn+++ b/.clj-kondo/config/modules/config.edn@@ -929,6 +929,28 @@:model-imports #{:model/Card :model/Dashboard}:model-exports #{:model/EmbeddingTheme}}+ embedding-hub+ {:team "Embedding"+ :api #{metabase.embedding-hub.api}+ :uses #{api+ appearance+ audit-app+ embedding+ metabot+ permissions+ premium-features+ util.config}+ :model-imports #{:model/Card+ :model/Collection+ :model/ConnectionImpersonation+ :model/Dashboard+ :model/Database+ :model/DatabaseRouter+ :model/EmbeddingTheme+ :model/Sandbox+ :model/Table+ :model/Tenant}}+embedding.rest{:team "Embedding":ns-prefix "metabase.embedding-rest"@@ -2028,7 +2050,6 @@:uses #{apiapi.eid-translationcollections- embeddingeventsliblib.be@@ -3645,13 +3666,8 @@enterprise/embedding{:team "Embedding":ns-prefix "metabase-enterprise.embedding-hub"- :api #{metabase-enterprise.embedding-hub.api}- :uses #{api- appearance- audit-app- embedding- lib.schema- permissions+ :api #{}+ :uses #{lib.schemapremium-featuresutilenterprise/sso}diff --git a/.clj-kondo/ratchets.edn b/.clj-kondo/ratchets.ednindex 733d515802c..e6de6a370ab 100644--- a/.clj-kondo/ratchets.edn+++ b/.clj-kondo/ratchets.edn@@ -14,7 +14,7 @@:consistent-alias 2:def-fn 1:deprecated-namespace 95- :deprecated-var 86+ :deprecated-var 96:discouraged-java-method 4:discouraged-namespace 71:discouraged-var 130diff --git a/docs/installation-and-operation/serialization.md b/docs/installation-and-operation/serialization.mdindex 68426d88a86..61992dad98b 100644--- a/docs/installation-and-operation/serialization.md+++ b/docs/installation-and-operation/serialization.md@@ -145,6 +145,7 @@ show-homepage-datashow-homepage-pin-messageshow-homepage-xraysshow-metabot+show-modular-embed-termsshow-sdk-embed-termsshow-simple-embed-termsshow-static-embed-termsdiff --git a/e2e/snapshot-creators/default.cy.snap.js b/e2e/snapshot-creators/default.cy.snap.jsindex df0acc2fe7a..9169ed0731c 100644--- a/e2e/snapshot-creators/default.cy.snap.js+++ b/e2e/snapshot-creators/default.cy.snap.js@@ -109,8 +109,7 @@ describe("snapshots", () => {updateSetting("enable-public-sharing", true);// interactive is not enabled in the snapshots as it requires a premium feature// updateSetting("enable-embedding-interactive", true);- updateSetting("enable-embedding-sdk", true);- updateSetting("enable-embedding-static", true).then(() => {+ updateSetting("enable-embedding-modular", true).then(() => {updateSetting("embedding-secret-key", METABASE_SECRET_KEY);});// dismiss the license token missing banner, not necessary to render it in every testdiff --git a/e2e/support/helpers/e2e-embedding-iframe-sdk-helpers.ts b/e2e/support/helpers/e2e-embedding-iframe-sdk-helpers.tsindex 62ac04da4cb..a625134861b 100644--- a/e2e/support/helpers/e2e-embedding-iframe-sdk-helpers.ts+++ b/e2e/support/helpers/e2e-embedding-iframe-sdk-helpers.ts@@ -216,7 +216,7 @@ export function prepareSdkIframeEmbedTest({activateToken(withToken);}- cy.request("PUT", "/api/setting/enable-embedding-simple", {+ cy.request("PUT", "/api/setting/enable-embedding-modular", {value: true,});@@ -256,10 +256,7 @@ export function prepareGuestEmbedSdkIframeEmbedTest({onPrepare?.();- cy.request("PUT", "/api/setting/enable-embedding-simple", {- value: true,- });- cy.request("PUT", "/api/setting/enable-embedding-static", {+ cy.request("PUT", "/api/setting/enable-embedding-modular", {value: true,});diff --git a/e2e/support/helpers/e2e-embedding-iframe-sdk-setup-helpers.ts b/e2e/support/helpers/e2e-embedding-iframe-sdk-setup-helpers.tsindex b273c847914..a8a2f1cbf65 100644--- a/e2e/support/helpers/e2e-embedding-iframe-sdk-setup-helpers.ts+++ b/e2e/support/helpers/e2e-embedding-iframe-sdk-setup-helpers.ts@@ -4,8 +4,10 @@ export const embedModalContent = () =>export const embedModalEnableEmbeddingCard = () =>cy.findByTestId("enable-embedding-card");-const ACCEPT_TERMS_BUTTON_NAME =- /(Agree and (continue|enable)|Enable and continue)/;+// The card renders a single button, disabled once the terms are accepted, so+// an enabled one is the accept button and nothing else.+const ACCEPT_TERMS_BUTTON =+ '[data-testid="enable-embedding-card"] button:not([disabled])';export const embedModalEnableEmbedding = () => {// Wait for the modal before reading the DOM below. That read is a snapshot@@ -15,25 +17,21 @@ export const embedModalEnableEmbedding = () => {embedModalContent().should("exist");cy.get("body").then(($body) => {- // No card mounted — terms were accepted in the test setup, the section- // bails early via `showSection` (see EnableModularEmbeddingSection /- // EnableGuestEmbedsSection) and never renders.- if ($body.find('[data-testid="enable-embedding-card"]').length === 0) {+ // Nothing left to accept. Either no card mounted — terms were accepted in+ // the test setup and the section bails early via `showSection` (see+ // EnableModularEmbeddingSection / EnableGuestEmbedsSection) — or a section+ // that mounted on stale settings settled on its disabled "Enabled" label.+ if ($body.find(ACCEPT_TERMS_BUTTON).length === 0) {return;}- // Match the actionable label, not the disabled "Enabled" one — the latter- // also shows transiently on the stale section after an auth-mode switch.- cy.findByRole("button", { name: ACCEPT_TERMS_BUTTON_NAME }).click();+ cy.get(ACCEPT_TERMS_BUTTON).click();// Once the acceptance registers, the section freezes and relabels its- // button to a disabled "Enabled", so the actionable label going away is- // the signal. Asserting it here makes a lost click fail on the spot- // instead of on a misleading iframe timeout downstream (EMB-2292).- cy.findByRole("button", {- name: ACCEPT_TERMS_BUTTON_NAME,- timeout: 10_000,- }).should("not.exist");+ // button to a disabled "Enabled", so the enabled button going away is the+ // signal. Asserting it here makes a lost click fail on the spot instead of+ // on a misleading iframe timeout downstream (EMB-2292).+ cy.get(ACCEPT_TERMS_BUTTON, { timeout: 10_000 }).should("not.exist");});};diff --git a/e2e/support/helpers/embedding-sdk-testing/embedding-sdk-helpers.ts b/e2e/support/helpers/embedding-sdk-testing/embedding-sdk-helpers.tsindex 63db2110465..02a0bc1c5a4 100644--- a/e2e/support/helpers/embedding-sdk-testing/embedding-sdk-helpers.ts+++ b/e2e/support/helpers/embedding-sdk-testing/embedding-sdk-helpers.ts@@ -78,7 +78,7 @@ export function signInAsAdminAndEnableEmbeddingSdk() {activateToken("bleeding-edge");enableJwtAuth();cy.request("PUT", "/api/setting", {- "enable-embedding-sdk": true,+ "enable-embedding-modular": true,// Needed so CORS headers (e.g. Access-Control-Expose-Headers) are sent in responses,// and we can assert them in tests.diff --git a/e2e/test/scenarios/admin-2/sso/jwt.cy.spec.js b/e2e/test/scenarios/admin-2/sso/jwt.cy.spec.jsindex 598fc5976f2..41e721be237 100644--- a/e2e/test/scenarios/admin-2/sso/jwt.cy.spec.js+++ b/e2e/test/scenarios/admin-2/sso/jwt.cy.spec.js@@ -19,7 +19,7 @@ describe("scenarios > admin > settings > SSO > JWT", () => {);cy.button("Set up key").click();H.modal().within(() => {- cy.button("Done").click();+ cy.button("Create").click();});cy.button("Save and enable").click();cy.wait("@updateSettings");@@ -81,10 +81,14 @@ describe("scenarios > admin > settings > SSO > JWT", () => {cy.button("Regenerate key").click();H.modal().within(() => {- cy.findByText("Set up secret key").should("exist");+ cy.findByText("Delete key and generate a new one?").should("exist");cy.findByText(- "This will cause existing tokens to stop working until the identity provider is updated with the new key.",+ "This will cause existing tokens to stop working until the identity provider is updated with a new key.",).should("exist");+ cy.button("Delete key").click();+ });+ H.modal().within(() => {+ cy.findByText("Store your new key").should("exist");cy.button("Done").click();});cy.button("Save changes").click();diff --git a/e2e/test/scenarios/admin/i18n/content-translation/helpers/e2e-content-translation-helpers.ts b/e2e/test/scenarios/admin/i18n/content-translation/helpers/e2e-content-translation-helpers.tsindex 294a048a2f7..d227486d95e 100644--- a/e2e/test/scenarios/admin/i18n/content-translation/helpers/e2e-content-translation-helpers.ts+++ b/e2e/test/scenarios/admin/i18n/content-translation/helpers/e2e-content-translation-helpers.ts@@ -9,10 +9,8 @@ export const uploadTranslationDictionary = (rows: DictionaryArray) => {cy.intercept("POST", "/api/ee/content-translation/upload-dictionary").as("uploadDictionary",);- cy.intercept("GET", "/api/setting").as("getSettings");cy.signInAsAdmin();- cy.visit("/admin/embedding");- cy.wait("@getSettings");+ cy.visit("/embedding/localization");cy.findByTestId("content-localization-setting").findByText(/Upload edited translation dictionary/,diff --git a/e2e/test/scenarios/admin/i18n/content-translation/upload-and-download.cy.spec.ts b/e2e/test/scenarios/admin/i18n/content-translation/upload-and-download.cy.spec.tsindex 1803cfa864e..2e215f8cdf4 100644--- a/e2e/test/scenarios/admin/i18n/content-translation/upload-and-download.cy.spec.ts+++ b/e2e/test/scenarios/admin/i18n/content-translation/upload-and-download.cy.spec.ts@@ -29,7 +29,7 @@ describe("scenarios > admin > embedding > guest embeds> content translation", ()});it("admin settings configuration form is not present", () => {- cy.visit("/admin/embedding/guest");+ cy.visit("/embedding/localization");cy.findByTestId("content-translation-configuration").should("not.exist");});});@@ -56,7 +56,7 @@ describe("scenarios > admin > embedding > guest embeds> content translation", ()describe("The translation download button", () => {it("downloads the stored translations", () => {uploadTranslationDictionaryViaAPI(germanFieldNames);- cy.visit("/admin/embedding");+ cy.visit("/embedding/localization");cy.findByTestId("content-translation-configuration").button(/Get translation dictionary template/i).click();@@ -184,7 +184,7 @@ describe("scenarios > admin > embedding > guest embeds> content translation", ()});it("rejects, in the frontend, a CSV upload that is too big", () => {- cy.visit("/admin/embedding");+ cy.visit("/embedding/localization");cy.get("#content-translation-dictionary-upload-input").selectFile({contents: Cypress.Buffer.from(@@ -210,7 +210,7 @@ describe("scenarios > admin > embedding > guest embeds> content translation", ()});it("rejects invalid CSV", () => {- cy.visit("/admin/embedding");+ cy.visit("/embedding/localization");const validCSV = getCSVWithHeaderRow(germanFieldNames);const invalidCSV = validCSV + '\nde,Price,"Preis"X';diff --git a/e2e/test/scenarios/admin/remote-sync.cy.spec.ts b/e2e/test/scenarios/admin/remote-sync.cy.spec.tsindex 15f2c3d1083..995e8c450cb 100644--- a/e2e/test/scenarios/admin/remote-sync.cy.spec.ts+++ b/e2e/test/scenarios/admin/remote-sync.cy.spec.ts@@ -776,7 +776,7 @@ describe("Remote Sync", () => {H.copySyncedCollectionFixture();H.commitToRepo();// Enable static embedding instance-wide so the Embed option is offered.- H.updateSetting("enable-embedding-static", true);+ H.updateSetting("enable-embedding-modular", true);H.configureGitAndPullChanges("read-only");cy.visit("/");diff --git a/e2e/test/scenarios/embedding/embedding-admin-redirects.cy.spec.ts b/e2e/test/scenarios/embedding/embedding-admin-redirects.cy.spec.tsnew file mode 100644index 00000000000..203dcd5f88d--- /dev/null+++ b/e2e/test/scenarios/embedding/embedding-admin-redirects.cy.spec.ts@@ -0,0 +1,23 @@+const { H } = cy;++describe("scenarios > embedding > admin route redirects (EMB-1526)", () => {+ beforeEach(() => {+ H.restore();+ cy.signInAsAdmin();+ H.activateToken("pro-self-hosted");+ });++ // admin/routes.unit.spec.tsx asserts the whole retired-path -> hub table off+ // the route tree. This covers the part reading the tree cannot: that a+ // redirect actually fires in a browser, and that it carries its params over.+ it("redirects retired admin embedding URLs to the hub", () => {+ cy.visit("/admin/embedding");+ cy.location("pathname").should("eq", "/embedding/security");++ cy.visit("/admin/embedding/themes/some-theme-id");+ cy.location("pathname").should(+ "eq",+ "/embedding/appearance/theme/some-theme-id",+ );+ });+});diff --git a/e2e/test/scenarios/embedding/embedding-admin-settings-oss.cy.spec.ts b/e2e/test/scenarios/embedding/embedding-admin-settings-oss.cy.spec.tsdeleted file mode 100644index bb6b6121340..00000000000--- a/e2e/test/scenarios/embedding/embedding-admin-settings-oss.cy.spec.ts+++ /dev/null@@ -1,66 +0,0 @@-const { H } = cy;--describe(- "scenarios > embedding > admin settings > oss",- { tags: "@OSS" },- () => {- beforeEach(() => {- H.restore();- cy.signInAsAdmin();-- H.updateSetting("show-sdk-embed-terms", false);- });-- it("shows all embedding types without the setup guide", () => {- cy.log("Navigate to Embedding admin section");- cy.visit("/admin/embedding");-- cy.log("Check that we're on the embedding settings page");- cy.url().should("include", "/admin/embedding");- cy.get("main").findByText("Embedding settings").should("be.visible");-- cy.log("Verify sidebar does not contain setup guide");- cy.findByTestId("admin-layout-sidebar")- .findByRole("link", { name: /Setup guide/ })- .should("not.exist");-- cy.log("Verify sidebar does not contain guest embeds link");- cy.findByTestId("admin-layout-sidebar")- .findByRole("link", { name: /Guest embeds/ })- .should("not.exist");-- cy.log("Verify sidebar contains security settings link");- cy.findByTestId("admin-layout-sidebar")- .findByRole("link", { name: /Security/ })- .should("exist");- });-- it("should show embedding upsell on oss", () => {- cy.visit("/admin/embedding/interactive");-- cy.findByTestId("admin-layout-content").within(() => {- cy.findByRole("heading", { name: "Embedding settings" }).should(- "be.visible",- );-- cy.log("upsell gem icon should be visible");- cy.icon("gem").should("be.visible");-- cy.findByRole("link", { name: "Upgrade" })- .should("have.attr", "href")- .and(- "eq",- "https://www.metabase.com/upgrade?utm_source=product&utm_medium=upsell&utm_content=embedding-page&source_plan=oss&utm_users=10&utm_campaign=embedding-methods",- );- });- });-- it("should show CORS setting on security page", () => {- cy.visit("/admin/embedding/security");-- cy.findByTestId("admin-layout-content").within(() => {- cy.findByText("Cross-Origin Resource Sharing (CORS)").should("exist");- });- });- },-);diff --git a/e2e/test/scenarios/embedding/embedding-admin-settings-starter.cy.spec.ts b/e2e/test/scenarios/embedding/embedding-admin-settings-starter.cy.spec.tsdeleted file mode 100644index 6e2d0caa4d7..00000000000--- a/e2e/test/scenarios/embedding/embedding-admin-settings-starter.cy.spec.ts+++ /dev/null@@ -1,57 +0,0 @@-const { H } = cy;--describe("scenarios > embedding > admin settings > starter", () => {- beforeEach(() => {- H.restore();- cy.signInAsAdmin();-- H.activateToken("starter");-- H.updateSetting("show-sdk-embed-terms", false);- });-- it("shows all embedding types without the setup guide", () => {- cy.log("Navigate to Embedding admin section");- cy.visit("/admin/embedding");-- cy.log("Check that we're on the embedding settings page");- cy.url().should("include", "/admin/embedding");- cy.get("main").findByText("Embedding settings").should("be.visible");-- cy.log("Verify sidebar does not contain setup guide");- cy.findByTestId("admin-layout-sidebar")- .findByRole("link", { name: /Setup guide/ })- .should("not.exist");-- cy.log("Verify sidebar does not contain guest embeds link");- cy.findByTestId("admin-layout-sidebar")- .findByRole("link", { name: /Guest embeds/ })- .should("not.exist");-- cy.log("Verify sidebar contains security settings link");- cy.findByTestId("admin-layout-sidebar")- .findByRole("link", { name: /Security/ })- .should("exist");- });-- it("should show embedding upsell on oss", () => {- cy.visit("/admin/embedding/interactive");-- cy.findByTestId("admin-layout-content").within(() => {- cy.findByRole("heading", { name: "Embedding settings" }).should(- "be.visible",- );-- cy.log("upsell gem icon should be visible");- cy.icon("gem").should("be.visible");- });- });-- it("should show CORS setting on security page", () => {- cy.visit("/admin/embedding/security");-- cy.findByTestId("admin-layout-content").within(() => {- cy.findByText("Cross-Origin Resource Sharing (CORS)").should("exist");- });- });-});diff --git a/e2e/test/scenarios/embedding/embedding-hub.cy.spec.ts b/e2e/test/scenarios/embedding/embedding-hub.cy.spec.tsnew file mode 100644index 00000000000..415a350c3f2--- /dev/null+++ b/e2e/test/scenarios/embedding/embedding-hub.cy.spec.ts@@ -0,0 +1,773 @@+import { SAMPLE_DB_TABLES } from "e2e/support/cypress_data";+import { enableJwtAuth } from "e2e/support/helpers/e2e-jwt-helpers";++import { createThemeViaApi } from "./embedding-theme-editor/helpers";++const { H } = cy;++const { STATIC_ORDERS_ID } = SAMPLE_DB_TABLES;++/**+ * The embedding hub at `/embedding` -- the tabbed section, not the older+ * onboarding checklist that `onboarding/embedding-homepage.cy.spec.ts` covers.+ * One describe per tab; each tab adds its own as it lands.+ *+ * Deliberately thin: card copy, the upsell banner and the AI card's done states+ * are unit-tested next to their components. What is here is what needs a real+ * browser or a real backend -- routing, the two step orderings, and completion+ * coming back from the checklist endpoint.+ *+ * Get started's blocks are both `@EE`, because the steps themselves are: tenants,+ * SSO and data segregation only exist on an enterprise build. The unlicensed case+ * is that same build with no token activated, which is what the locked states are+ * about.+ */++const CARD = "embedding-hub-checklist-card";++const PRO_STEP_ORDER = [+ "Connect a database",+ "Create a dashboard",+ "Get embed snippet",+ "Configure data permissions and tenants",+ "Set up SSO",+ "Embed in production with SSO",+ "Create a custom theme",+ "Configure AI",+];++// Without modular embedding every Fine-tune step is locked, so AI -- the one+// advanced step still reachable -- is promoted into the first section.+const UNLICENSED_STEP_ORDER = [+ "Connect a database",+ "Create a dashboard",+ "Get embed snippet",+ "Configure AI",+ "Configure data permissions and tenants",+ "Set up SSO",+ "Embed in production with SSO",+ "Create a custom theme",+];++// Every plan sees every tab; the gem marks the ones its token can't unlock.+// OSS and Starter lack all four gated features, so they expect the same.+const TAB_GEMS_WITHOUT_PAID_FEATURES = [+ { label: "Get started", hasGem: false },+ { label: "Security", hasGem: false },+ { label: "Authentication", hasGem: true },+ { label: "Permissions", hasGem: false },+ { label: "Tenancy", hasGem: true },+ { label: "Appearance", hasGem: true },+ { label: "Localization", hasGem: true },+];++function assertStepOrder(titles: string[]) {+ cy.findAllByTestId(CARD)+ .should("have.length", titles.length)+ .each(($card, index) => {+ cy.wrap($card).should("contain.text", titles[index]);+ });+}++function assertHubTabs(tabs: { label: string; hasGem: boolean }[]) {+ cy.findByRole("navigation", { name: "Embedding hub" }).within(() => {+ // Every tab is a link and nothing else in the nav is, so the count makes+ // the list exhaustive -- a tab the hub should not have fails here.+ cy.findAllByRole("link").should("have.length", tabs.length);++ for (const { label, hasGem } of tabs) {+ cy.findByRole("link", { name: label })+ .findByTestId("upsell-gem")+ .should(hasGem ? "exist" : "not.exist");+ }+ });+}++describe("scenarios > embedding > embedding hub > get started", () => {+ describe("pro", { tags: "@EE" }, () => {+ beforeEach(() => {+ H.restore();+ cy.signInAsAdmin();+ H.activateToken("pro-self-hosted");+ });++ it("redirects from the hub root and lists the licensed step order", () => {+ cy.visit("/embedding");++ cy.log("the hub root is the Get started tab");+ cy.location("pathname").should("eq", "/embedding/get-started");++ cy.findByRole("link", { name: "Get started" }).should(+ "have.attr",+ "aria-current",+ "page",+ );++ cy.findByTestId("embedding-hub-main").within(() => {+ cy.findByRole("heading", {+ name: "Get started with Metabase Embedding",+ }).should("be.visible");++ assertStepOrder(PRO_STEP_ORDER);+ });+ });++ it("returns to Get started from the permissions wizard", () => {+ cy.visit("/embedding/get-started");++ cy.findByTestId("embedding-hub-main")+ .findByRole("link", { name: "Configure data permissions and tenants" })+ .click();++ cy.location("pathname").should(+ "eq",+ "/embedding/get-started/permissions",+ );++ cy.log(+ "the wizard's back link is relative, so it lands on the host that mounted it rather than admin",+ );+ cy.findByRole("link", { name: /Back to the setup guide/ }).click();++ cy.location("pathname").should("eq", "/embedding/get-started");+ });++ it("finishes the permissions wizard and lands back on Get started", () => {+ cy.log("seed every step the wizard checks, so Summary is the one left");+ H.updateSetting("use-tenants", true);+ cy.request("POST", "/api/collection", {+ name: "Shared collection",+ namespace: "shared-tenant-collection",+ }).then(({ body: sharedCollection }) => {+ H.createDashboard({+ name: "Tenant dashboard",+ collection_id: sharedCollection.id,+ });+ });++ cy.request("POST", "/api/ee/tenant", {+ name: "Test Tenant",+ slug: "test-tenant",+ });++ cy.request("POST", "/api/permissions/group", { name: "Test Group" }).then(+ ({ body: group }) => {+ cy.sandboxTable({ table_id: STATIC_ORDERS_ID, group_id: group.id });+ },+ );++ cy.visit("/embedding/get-started/permissions");++ cy.log("the Summary step closes the wizard out");+ cy.findByRole("button", { name: "Done" }).click();++ cy.location("pathname").should("eq", "/embedding/get-started");+ cy.findByTestId("embedding-hub-main").should("be.visible");+ });++ it("finishes the SSO wizard and lands back on Get started", () => {+ cy.log("JWT configured is what unlocks the two steps after it");+ enableJwtAuth();++ cy.visit("/embedding/get-started/sso");++ cy.findByRole("button", { name: "Next" }).click();++ cy.log("confirming the manual login test is what closes the wizard out");+ // A link, not a button: it is a `Button component={Link}`, so the step's+ // own navigation is what returns to the hub.+ cy.findByRole("link", { name: "Log in works, I'm done" }).click();++ cy.location("pathname").should("eq", "/embedding/get-started");+ cy.findByTestId("embedding-hub-main").should("be.visible");+ });+ });++ describe("unlicensed", { tags: "@EE" }, () => {+ beforeEach(() => {+ H.restore();+ cy.signInAsAdmin();+ });++ it("promotes AI into the first section and locks the Fine-tune steps", () => {+ cy.visit("/embedding/get-started");++ cy.findByTestId("embedding-hub-main").within(() => {+ assertStepOrder(UNLICENSED_STEP_ORDER);++ cy.log(+ "the upsell banner is what stands in for the Fine-tune subtitle",+ );+ cy.findByText(+ "Upgrade to Metabase Pro to configure advanced options.",+ ).should("be.visible");++ cy.log("a feature-locked step is inert, with no link to follow");+ cy.findByRole("link", { name: "Set up SSO" }).should("not.exist");+ cy.findByText("Set up SSO")+ .closest(`[data-testid=${CARD}]`)+ .should("have.attr", "aria-disabled", "true");++ cy.log("AI is never locked -- the admin AI page needs no token");+ cy.findByRole("button", { name: "Configure AI" }).should("be.visible");+ });+ });++ it("marks the embed step complete once a guest embed is published", () => {+ cy.visit("/embedding/get-started");++ cy.findByTestId("embedding-hub-main").within(() => {+ cy.findByText("Get embed snippet")+ .closest(`[data-testid=${CARD}]`)+ .findByLabelText("Step 3 complete")+ .should("not.exist");+ });++ cy.log("publish a dashboard as a guest embed");+ H.createDashboard({ name: "Published dashboard" }).then(+ ({ body: dashboard }) => {+ cy.request("PUT", `/api/dashboard/${dashboard.id}`, {+ enable_embedding: true,+ });+ },+ );++ cy.log(+ "the checklist is served without a licence, so completion is real rather than all-false",+ );+ cy.visit("/embedding/get-started");++ cy.findByTestId("embedding-hub-main").within(() => {+ cy.findByText("Get embed snippet")+ .closest(`[data-testid=${CARD}]`)+ .findByLabelText("Step 3 complete")+ .should("exist");+ });+ });+ });+});++describe("scenarios > embedding > embedding hub > security", () => {+ describe("pro", () => {+ beforeEach(() => {+ H.restore();+ cy.signInAsAdmin();+ H.activateToken("pro-self-hosted");++ // The snapshot turns embedding on, but this test is about turning it on+ // from the hub, so start from off the way a fresh instance would be.+ H.updateSetting("enable-embedding-modular", false);+ });++ it("turns embedding on with one switch", () => {+ cy.intercept("GET", "/api/setting").as("getSettings");+ cy.intercept("GET", "/api/session/properties").as("getSessionProperties");++ cy.visit("/embedding/security");++ cy.log("The first enable goes through the terms modal");+ cy.findByTestId("embedding-hub-main")+ .findByText("Modular embedding and SDK for React")+ .should("be.visible");++ // The switch renders before either request lands, reading undefined as+ // off and as terms-already-seen, so a click before then writes the+ // settings directly instead of opening the modal.+ cy.wait(["@getSettings", "@getSessionProperties"]);+ cy.findAllByRole("switch").first().should("not.be.checked").click();+ cy.findByRole("button", { name: "Agree" }).click();++ cy.log("The merged setting is written");++ // A fresh visit rather than cy.reload(): reloading the app inside the+ // Cypress runner leaves the hub, landing on /unauthorized and then home.+ cy.visit("/embedding/security");+ cy.wait(["@getSettings", "@getSessionProperties"]);++ cy.findAllByRole("switch").first().should("be.checked");++ cy.request("GET", "/api/session/properties").then(({ body }) => {+ expect(body["enable-embedding-modular"]).to.be.true;+ });+ });++ it("lists published guest embeds even after guest embeds are switched off", () => {+ cy.log("Publish a dashboard as a guest embed");+ // Publishing is itself gated on guest embeds being on, so this has to+ // come before the dashboard is marked embeddable.+ H.updateSetting("enable-embedding-modular", true);+ H.createDashboard({ name: "Published dashboard" }).then(+ ({ body: dashboard }) => {+ cy.request("PUT", `/api/dashboard/${dashboard.id}`, {+ enable_embedding: true,+ });+ },+ );++ cy.visit("/embedding/security");++ assertPublishedDashboardIsListed();++ cy.log(+ "Turning guest embeds off is exactly when an admin needs to audit what is already out there",+ );+ H.updateSetting("enable-embedding-modular", false);+ cy.visit("/embedding/security");++ assertPublishedDashboardIsListed();+ });+ });++ describe("oss", { tags: "@OSS" }, () => {+ beforeEach(() => {+ H.restore();+ cy.signInAsAdmin();+ H.updateSetting("show-modular-embed-terms", false);+ });++ it("shows the Pro upsell banner and the CORS setting", () => {+ cy.visit("/embedding/security");++ cy.findByTestId("embedding-hub-main").within(() => {+ cy.findByText(+ "Upgrade to Metabase Pro to access the SDK for React and more advanced options.",+ ).should("be.visible");+ // OSS leaves PLUGIN_ADMIN_SETTINGS.useUpsellFlow without a trigger, so+ // UpsellCta renders the store link; paid builds get a button that+ // opens the in-app flow instead.+ cy.findByRole("link", { name: "Try Metabase Pro" }).should(+ "be.visible",+ );++ cy.findByText("Cross-Origin Resource Sharing (CORS)").should("exist");+ });+ });++ it("shows every hub tab, gemming the ones this plan lacks", () => {+ cy.visit("/embedding/security");++ assertHubTabs(TAB_GEMS_WITHOUT_PAID_FEATURES);+ });+ });++ describe("starter", () => {+ beforeEach(() => {+ H.restore();+ cy.signInAsAdmin();+ H.activateToken("starter");+ H.updateSetting("show-modular-embed-terms", false);+ });++ it("shows the Pro upsell banner and the CORS setting", () => {+ cy.visit("/embedding/security");++ cy.findByTestId("embedding-hub-main").within(() => {+ // Starter is below Pro too -- SDK access is still gated.+ cy.findByRole("button", { name: "Try Metabase Pro" }).should(+ "be.visible",+ );++ cy.findByText("Cross-Origin Resource Sharing (CORS)").should("exist");+ });+ });++ it("shows every hub tab, gemming the ones this plan lacks", () => {+ cy.visit("/embedding/security");++ assertHubTabs(TAB_GEMS_WITHOUT_PAID_FEATURES);+ });+ });+});++describe("scenarios > embedding > embedding hub > authentication", () => {+ describe("pro", { tags: "@EE" }, () => {+ beforeEach(() => {+ H.restore();+ cy.signInAsAdmin();+ H.activateToken("pro-self-hosted");+ });++ it("saves JWT settings from the hub's copy of the admin form", () => {+ cy.intercept("PUT", "/api/setting").as("updateSettings");++ cy.visit("/embedding/authentication");++ cy.log("the hub supplies the heading, so the form does not add its own");+ cy.findByRole("heading", { name: "Authentication" }).should("be.visible");+ cy.findByRole("heading", { name: "JWT" }).should("not.exist");++ cy.findByLabelText("JWT Identity Provider URI *")+ .type("https://jwt.example.com/auth")+ .blur();++ cy.log("the shared secret is generated through the key modal");+ cy.button("Set up key").click();+ H.modal().within(() => {+ cy.button("Create").click();+ });++ cy.button("Save and enable").click();+ cy.wait("@updateSettings");++ cy.log("the settings the form writes are the real ones");+ cy.request("GET", "/api/session/properties").then(({ body }) => {+ expect(body["jwt-enabled"]).to.equal(true);+ expect(body["jwt-identity-provider-uri"]).to.equal(+ "https://jwt.example.com/auth",+ );+ });++ cy.log("and they survive a reload of the tab");+ // cy.reload() does not work here: the app comes back without the hub+ // around it, so the page renders with no "Authentication" heading and the+ // form is never reached. Visiting the path again mounts the hub properly.+ cy.visit("/embedding/authentication");+ H.main()+ .findByLabelText("JWT Identity Provider URI *")+ .should("have.value", "https://jwt.example.com/auth");+ });++ it("sends the admin to Admin settings when only SAML is configured", () => {+ configureSaml();++ cy.visit("/embedding/authentication");++ H.main().within(() => {+ cy.findByText("SAML is configured").should("be.visible");+ cy.findByLabelText("JWT Identity Provider URI *").should("not.exist");+ });+ });+ });++ describe("unlicensed", { tags: "@EE" }, () => {+ beforeEach(() => {+ H.restore();+ cy.signInAsAdmin();+ });++ it("upsells instead of exposing the form", () => {+ cy.visit("/embedding/authentication");++ // Card copy is unit-tested next to the component; this is what needs a+ // real browser -- the upsell rendering in place of the real form.+ H.main().within(() => {+ cy.findByText("Secure your embeds with single sign-on").should(+ "be.visible",+ );++ cy.log("nothing configurable renders below the paywall");+ cy.findByLabelText("JWT Identity Provider URI *").should("not.exist");+ });+ });+ });+});++describe("scenarios > embedding > embedding hub > permissions", () => {+ describe("pro", { tags: "@EE" }, () => {+ beforeEach(() => {+ H.restore();+ cy.signInAsAdmin();+ H.activateToken("pro-self-hosted");+ });++ it("navigates every tab and level of the editor without leaving the hub", () => {+ cy.visit("/embedding/permissions");++ cy.log("The editor renders at the hub's path, not admin's");+ cy.location("pathname").should("match", /^\/embedding\/permissions/);++ walkThroughPermissionsEditor();+ assertStillInsideHub();+ });++ it("navigates every tab and level of the editor with tenants enabled", () => {+ // The tenant-only tabs (Shared collections, Tenant collections) only+ // show up once tenants are on, so this is the full tab set -- the+ // other test is the narrower one licensing alone shows.+ H.updateSetting("use-tenants", true);++ cy.visit("/embedding/permissions");++ cy.log("The editor renders at the hub's path, not admin's");+ cy.location("pathname").should("match", /^\/embedding\/permissions/);++ walkThroughPermissionsEditor();++ cy.log("Shared collections tab");+ cy.findByRole("tab", { name: "Shared collections" }).click();+ cy.findAllByRole("menuitem").first().click();+ cy.location("pathname").should("match", /^\/embedding\/permissions/);++ cy.log("Tenant collections tab");+ cy.findByRole("tab", { name: "Tenant collections" }).click();+ cy.findAllByRole("menuitem").first().click();++ assertStillInsideHub();+ });+ });+});++function walkThroughPermissionsEditor() {+ cy.log("Data tab, Groups view: lands here by default");+ cy.findAllByRole("menuitem").first().click();+ cy.findByTestId("permission-table").should("be.visible");++ cy.log("Drilling into a group's database entity stays in the hub");+ cy.findByTestId("permission-table").findByText("Sample Database").click();+ cy.location("pathname").should("match", /^\/embedding\/permissions/);++ cy.log("Data tab, Databases view");+ cy.findByRole("tab", { name: "Databases" }).click();+ cy.findAllByRole("menuitem").first().click();+ cy.findByTestId("permission-table").should("be.visible");++ cy.log("Collections tab");+ cy.findByRole("tab", { name: "Collections" }).click();+ cy.findAllByRole("menuitem").first().click();+ cy.findByTestId("permission-table").should("be.visible");++ cy.log("Application tab");+ cy.findByRole("tab", { name: "Application" }).click();+ cy.findByTestId("permission-table").should("be.visible");+}++function assertStillInsideHub() {+ cy.log("Still inside the embedding hub throughout");+ cy.location("pathname").should("match", /^\/embedding\/permissions/);+ cy.findByTestId("embedding-hub-nav").should("be.visible");+}++describe("scenarios > embedding > embedding hub > tenancy", () => {+ describe("pro", { tags: "@EE" }, () => {+ beforeEach(() => {+ H.restore();+ cy.signInAsAdmin();+ H.activateToken("pro-self-hosted");+ });++ it("offers the enable card while the multi-tenant strategy is off", () => {+ H.updateSetting("use-tenants", false);++ cy.visit("/embedding");++ cy.findByTestId("embedding-hub-nav")+ .findByRole("link", { name: "Tenancy" })+ .click();++ cy.url().should("include", "/embedding/tenancy");++ cy.findByTestId("embedding-hub-main").within(() => {+ cy.findByText("Enable multi-tenant user strategy").should("be.visible");+ cy.findByRole("tab", { name: "Tenants" }).should("not.exist");+ });+ });++ it("carries the tenant surfaces once the strategy is on", () => {+ H.updateSetting("use-tenants", false);++ cy.visit("/embedding/tenancy");++ cy.log("Enable multi-tenancy from the enable card, not the API");+ cy.findByTestId("embedding-hub-main")+ .findByRole("button", { name: "Enable multi-tenancy" })+ .click();++ cy.log("Enabling lands on the tenants listing, now empty");+ // The empty state's copy is interpolated with anchor links, so no+ // single node's text content matches the sentence exactly -- a regex+ // matches the substring instead.+ cy.findByTestId("embedding-hub-main")+ .findByText(/Create your first tenant to start adding/)+ .should("be.visible");++ cy.findByTestId("embedding-hub-main").within(() => {+ cy.findByRole("tab", { name: "Tenants" }).should("be.visible");+ cy.findByRole("tab", { name: "Tenant users" }).click();+ });++ cy.log("The listing's own links stay inside the hub");+ cy.url().should("include", "/embedding/tenancy/people");+ cy.url().should("not.include", "/admin/people");+ });+ });++ describe("oss", () => {+ beforeEach(() => {+ H.restore();+ cy.signInAsAdmin();+ });++ it("upsells rather than hiding the tab", () => {+ cy.visit("/embedding/tenancy");++ // Card copy is unit-tested next to the component; this just confirms+ // the upsell renders in place of the real tenants surfaces.+ cy.findByTestId("embedding-hub-main")+ .findByText("Use a multi-tenant user strategy")+ .should("be.visible");+ });+ });+});++describe("scenarios > embedding > embedding hub > appearance", () => {+ describe("pro", { tags: "@EE" }, () => {+ beforeEach(() => {+ H.restore();+ cy.signInAsAdmin();+ H.activateToken("pro-self-hosted");+ });++ it("carries the theme listing and the branding settings on one tab", () => {+ cy.visit("/embedding");++ cy.findByTestId("embedding-hub-nav")+ .findByRole("link", { name: "Appearance" })+ .click();++ cy.url().should("include", "/embedding/appearance");++ cy.findByTestId("embedding-hub-main").within(() => {+ cy.findByRole("heading", { name: "Appearance" }).should("be.visible");+ cy.findByRole("heading", { name: "Themes" }).should("be.visible");+ cy.findByRole("heading", { name: "Branding elements" }).should(+ "be.visible",+ );+ cy.findByText("Loading message").should("be.visible");+ cy.findByText("When calculations return no results").should(+ "be.visible",+ );+ cy.findByText("When no objects can be found").should("be.visible");+ });+ });++ it("opens the theme editor inside the hub", () => {+ cy.visit("/embedding/appearance");++ cy.findByTestId("embedding-hub-main")+ .findByRole("button", { name: /New theme/ })+ .click();++ cy.url().should("include", "/embedding/appearance/theme/new");+ cy.url().should("not.include", "/admin/embedding/themes");+ });++ it("opens an existing theme inside the hub", () => {+ createThemeViaApi("Existing theme");+ cy.visit("/embedding/appearance");++ cy.findByTestId("embedding-hub-main")+ .findByText("Existing theme")+ .click();++ // The listing is the admin one, mounted with the hub's basePath: card+ // clicks have to land here rather than on the admin route.+ cy.url().should("match", /\/embedding\/appearance\/theme\/\d+/);+ cy.url().should("not.include", "/admin/embedding/themes");+ });++ it("creates a theme from the hub and shows it in the listing", () => {+ cy.visit("/embedding/appearance");++ cy.findByTestId("embedding-hub-main")+ .findByRole("button", { name: /New theme/ })+ .click();++ cy.findByLabelText("Theme name").clear().type("Hub theme");+ cy.findByRole("button", { name: /Save theme/ }).click();++ H.undoToastList().contains("Theme saved").should("be.visible");++ cy.url().should("eq", Cypress.config().baseUrl + "/embedding/appearance");+ cy.findByTestId("embedding-hub-main")+ .findByText("Hub theme")+ .should("be.visible");+ });+ });++ describe("unlicensed", () => {+ beforeEach(() => {+ H.restore();+ cy.signInAsAdmin();+ });++ it("upsells rather than hiding the tab", () => {+ cy.visit("/embedding/appearance");++ cy.findByTestId("embedding-hub-main")+ .findByText("Create custom themes")+ .should("be.visible");+ });++ it("sends a theme editor deep link back to the upsell", () => {+ // A themeId, not the bare `theme` path -- that one redirects from the+ // route table whatever the plan, so it would pass without the guard.+ cy.visit("/embedding/appearance/theme/new");++ cy.url().should("eq", Cypress.config().baseUrl + "/embedding/appearance");+ cy.findByTestId("embedding-hub-main")+ .findByText("Create custom themes")+ .should("be.visible");+ });+ });+});++describe("scenarios > embedding > embedding hub > localization", () => {+ describe("pro", { tags: "@EE" }, () => {+ beforeEach(() => {+ H.restore();+ cy.signInAsAdmin();+ H.activateToken("pro-self-hosted");+ });++ it("mounts the dictionary configuration", () => {+ cy.visit("/embedding/localization");++ cy.findByTestId("embedding-hub-main")+ .findByTestId("content-translation-configuration")+ .findByText("Translate embedded dashboards and questions")+ .should("be.visible");+ });+ });++ describe("unlicensed", () => {+ beforeEach(() => {+ H.restore();+ cy.signInAsAdmin();+ });++ it("upsells rather than hiding the tab", () => {+ cy.visit("/embedding/localization");++ // Card copy is unit-tested next to the component; this just confirms+ // the upsell renders in place of the real dictionary configuration.+ cy.findByTestId("embedding-hub-main")+ .findByText("Translate your embedded content")+ .should("be.visible");+ });+ });+});++function configureSaml() {+ cy.readFile("test_resources/sso/auth0-public-idp.cert", "utf8").then(+ (certificate) => {+ cy.request("PUT", "/api/setting", {+ "saml-enabled": true,+ "saml-identity-provider-uri": "https://example.test",+ "saml-identity-provider-certificate": certificate,+ "saml-identity-provider-issuer": "https://example.test/issuer",+ });+ },+ );+}++function assertPublishedDashboardIsListed() {+ cy.findByTestId("embedding-hub-main").within(() => {+ // The hub clips its content and scrolls it internally, so this card sits+ // below the fold on a CI-sized viewport and Cypress reads it as hidden+ // until it is scrolled in.+ cy.findByText("Published guest embeds")+ .scrollIntoView()+ .should("be.visible");+ cy.findByText("Published dashboard").should("be.visible");+ });+}diff --git a/e2e/test/scenarios/embedding/embedding-smoketests.cy.spec.js b/e2e/test/scenarios/embedding/embedding-smoketests.cy.spec.jsindex 5fb173e904c..6368a4dca4f 100644--- a/e2e/test/scenarios/embedding/embedding-smoketests.cy.spec.js+++ b/e2e/test/scenarios/embedding/embedding-smoketests.cy.spec.js@@ -6,14 +6,14 @@ import {ORDERS_QUESTION_ID,} from "e2e/support/cypress_sample_instance_data";-const standalonePath = "/admin/embedding/guest";+const standalonePath = "/embedding/security";// These tests will run on both OSS and EE instances. Both without a token!describe("scenarios > embedding > smoke tests", { tags: "@OSS" }, () => {beforeEach(() => {H.restore();cy.signInAsAdmin();- H.updateSetting("show-sdk-embed-terms", false);+ H.updateSetting("show-modular-embed-terms", false);});it("should not offer to share or embed models (metabase#20815)", () => {@@ -39,14 +39,14 @@ describe("scenarios > embedding > smoke tests", { tags: "@OSS" }, () => {});it("should show the sdk upsell link in oss", () => {- cy.visit("/admin/embedding");+ cy.visit("/embedding/security");mainPage().within(() => {- cy.findByRole("link", { name: "Upgrade" })+ cy.findByRole("link", { name: "Try Metabase Pro" }).should("have.attr", "href").and("eq",- "https://www.metabase.com/upgrade?utm_source=product&utm_medium=upsell&utm_content=embedding-page&source_plan=oss&utm_users=10&utm_campaign=embedding-methods",+ "https://www.metabase.com/upgrade?utm_source=product&utm_medium=upsell&utm_campaign=embedding-hub&utm_content=embedding-hub-security&source_plan=oss&utm_users=10",);});});@@ -71,7 +71,7 @@ describe("scenarios > embedding > smoke tests", { tags: "@OSS" }, () => {};["question", "dashboard"].forEach((object) => {it(`should be able to publish/embed and then unpublish a ${object} without filters`, () => {- cy.request("PUT", "/api/setting/enable-embedding-static", {+ cy.request("PUT", "/api/setting/enable-embedding-modular", {value: true,});const embeddableObject = object === "question" ? "card" : "dashboard";@@ -181,9 +181,10 @@ describe("scenarios > embedding > smoke tests", { tags: "@OSS" }, () => {cy.visit(standalonePath);cy.wait("@currentlyEmbeddedObject");- mainPage()- .findAllByText(/No (questions|dashboards) have been embedded yet./)- .should("have.length", 2);+ // The hub's Security tab renders this section only when published+ // guest embeds exist, so unpublishing empties it rather than+ // leaving a section with no rows.+ mainPage().findByTestId("embedded-resources").should("not.exist");});});@@ -200,7 +201,7 @@ describe("scenarios > embedding > smoke tests", { tags: "@OSS" }, () => {enable_embedding: true,});- cy.request("PUT", "/api/setting/enable-embedding-static", {+ cy.request("PUT", "/api/setting/enable-embedding-modular", {value: true,});@@ -231,7 +232,7 @@ describe("scenarios > embedding > smoke tests", { tags: "@OSS" }, () => {});it("should regenerate embedding token and invalidate previous embed url", () => {- cy.request("PUT", "/api/setting/enable-embedding-static", {+ cy.request("PUT", "/api/setting/enable-embedding-modular", {value: true,});@@ -297,7 +298,7 @@ describe("scenarios > embedding > smoke tests", { tags: "@OSS" }, () => {});function resetEmbedding() {- H.updateSetting("enable-embedding-static", false);+ H.updateSetting("enable-embedding-modular", false);H.updateSetting("embedding-secret-key", null);}@@ -323,5 +324,5 @@ function visitAndEnableSharing(object, unpublishBeforeOpen = true) {}function mainPage() {- return cy.findByTestId("admin-layout-content");+ return cy.findByTestId("embedding-hub-main");}diff --git a/e2e/test/scenarios/embedding/embedding-theme-editor/theme-editor.cy.spec.ts b/e2e/test/scenarios/embedding/embedding-theme-editor/theme-editor.cy.spec.tsindex cf08af32689..7d465d70545 100644--- a/e2e/test/scenarios/embedding/embedding-theme-editor/theme-editor.cy.spec.ts+++ b/e2e/test/scenarios/embedding/embedding-theme-editor/theme-editor.cy.spec.ts@@ -38,7 +38,7 @@ function createThemeViaApi(name = "Test theme") {function visitThemeEditor(themeId: number) {cy.intercept("GET", `/api/embed-theme/${themeId}`).as("getTheme");- cy.visit(`/admin/embedding/themes/${themeId}`);+ cy.visit(`/embedding/appearance/theme/${themeId}`);cy.wait("@getTheme");}@@ -70,8 +70,8 @@ describe(cy.log("editor panel should show the theme name");cy.findByLabelText("Theme name").should("have.value", "My custom theme");- cy.log("sidebar should be hidden on theme editor page");- cy.findByTestId("admin-layout-sidebar").should("not.exist");+ cy.log("theme editor should render full width");+ cy.findByTestId("embedding-hub-content-cap").should("not.exist");cy.log("save button should be disabled when no changes");cy.findByRole("button", { name: /Save theme/ }).should("be.disabled");@@ -105,12 +105,12 @@ describe(cy.findByRole("button", { name: /Cancel/ }).click();cy.log("should navigate back to the themes listing");- cy.url().should("include", "/admin/embedding/themes");- cy.url().should("not.match", /\/themes\/\d+/);+ cy.url().should("include", "/embedding/appearance");+ cy.url().should("not.match", /\/theme\/\d+/);});it("shows not found for invalid theme id", () => {- cy.visit("/admin/embedding/themes/99999");+ cy.visit("/embedding/appearance/theme/99999");H.main().findByText("We're a little lost...").should("be.visible");});@@ -139,7 +139,7 @@ describe(});cy.log("should remain on the editor page after cancelling");- cy.url().should("match", /\/themes\/\d+/);+ cy.url().should("match", /\/theme\/\d+/);cy.log("confirm deletion");cy.findByRole("button", { name: /Delete theme/ }).click();@@ -150,8 +150,8 @@ describe(H.undoToast().findByText("Theme deleted successfully").should("exist");cy.log("should navigate back to the themes listing");- cy.url().should("include", "/admin/embedding/themes");- cy.url().should("not.match", /\/themes\/\d+/);+ cy.url().should("include", "/embedding/appearance");+ cy.url().should("not.match", /\/theme\/\d+/);H.main().within(() => {cy.findByText("Theme to delete").should("not.exist");@@ -181,13 +181,13 @@ describe(H.undoToast().findByText("Theme deleted successfully").should("exist");cy.log("should land on the themes listing — not 404 or leave-prompt");- cy.url().should("include", "/admin/embedding/themes");- cy.url().should("not.match", /\/themes\/\d+/);+ cy.url().should("include", "/embedding/appearance");+ cy.url().should("not.match", /\/theme\/\d+/);H.main().findByText("We're a little lost...").should("not.exist");});it("does not show the delete button when creating a new theme", () => {- cy.visit("/admin/embedding/themes/new");+ cy.visit("/embedding/appearance/theme/new");cy.findByLabelText("Theme name").should("be.visible");cy.findByRole("button", { name: /Delete theme/ }).should("not.exist");@@ -365,7 +365,7 @@ describe(describe("preview panel", () => {it("shows enable embedding prompt when embedding is not enabled", () => {- H.updateSetting("enable-embedding-simple", false);+ H.updateSetting("enable-embedding-modular", false);createThemeViaApi("Preview test").then((theme) => {visitThemeEditor(theme.id);@@ -384,8 +384,8 @@ describe(});it("shows theme preview when embedding is enabled", () => {- H.updateSetting("enable-embedding-simple", true);- H.updateSetting("show-simple-embed-terms", false);+ H.updateSetting("enable-embedding-modular", true);+ H.updateSetting("show-modular-embed-terms", false);createThemeViaApi("Preview test").then((theme) => {visitThemeEditor(theme.id);@@ -398,8 +398,8 @@ describe(describe("preview picker", () => {beforeEach(() => {- H.updateSetting("enable-embedding-simple", true);- H.updateSetting("show-simple-embed-terms", false);+ H.updateSetting("enable-embedding-modular", true);+ H.updateSetting("show-modular-embed-terms", false);});it("defaults to a dashboard and can switch to a question", () => {diff --git a/e2e/test/scenarios/embedding/embedding-theme-editor/theme-listing.cy.spec.ts b/e2e/test/scenarios/embedding/embedding-theme-editor/theme-listing.cy.spec.tsindex e9dbcb14a20..105293b3d6a 100644--- a/e2e/test/scenarios/embedding/embedding-theme-editor/theme-listing.cy.spec.ts+++ b/e2e/test/scenarios/embedding/embedding-theme-editor/theme-listing.cy.spec.ts@@ -20,7 +20,7 @@ describe(});it("lazily seeds Light and Dark on first visit, and preserves admin deletions across reloads", () => {- cy.visit("/admin/embedding/themes");+ cy.visit("/embedding/appearance");H.main().within(() => {cy.log(@@ -46,23 +46,23 @@ describe(cy.findByRole("button", { name: /New theme/ }).click();});- cy.url().should("match", /\/admin\/embedding\/themes\/new$/);+ cy.url().should("match", /\/embedding\/appearance\/theme\/new$/);});it("does not create a theme when cancelling from the draft editor", () => {cy.intercept("POST", "/api/embed-theme").as("createTheme");- cy.visit("/admin/embedding/themes");+ cy.visit("/embedding/appearance");H.main().findByRole("button", { name: /New theme/ }).click();- cy.url().should("match", /\/admin\/embedding\/themes\/new$/);+ cy.url().should("match", /\/embedding\/appearance\/theme\/new$/);cy.findByRole("button", { name: /Cancel/ }).click();cy.log("navigates back to the listing");- cy.url().should("match", /\/admin\/embedding\/themes$/);+ cy.url().should("match", /\/embedding\/appearance$/);cy.log("new theme card is still visible");H.main()@@ -75,14 +75,14 @@ describe(it("navigates to theme editor when clicking an existing theme card", () => {createThemeViaApi("My theme");- cy.visit("/admin/embedding/themes");+ cy.visit("/embedding/appearance");H.main().within(() => {cy.findByText("My theme").click();});cy.log("navigates to the theme editor page");- cy.url().should("match", /\/admin\/embedding\/themes\/\d+/);+ cy.url().should("match", /\/embedding\/appearance\/theme\/\d+/);});it("uses white-labeled colors as a base for creating themes", () => {@@ -98,7 +98,7 @@ describe(H.updateSetting("application-colors", whitelabelColors);cy.intercept("POST", "/api/embed-theme").as("createTheme");- cy.visit("/admin/embedding/themes");+ cy.visit("/embedding/appearance");H.main().findByRole("button", { name: /New theme/ })@@ -126,7 +126,7 @@ describe(it("can duplicate a theme", () => {createThemeViaApi("Untitled theme");- cy.visit("/admin/embedding/themes");+ cy.visit("/embedding/appearance");H.main().within(() => {cy.findByText("Untitled theme").should("be.visible");@@ -146,7 +146,7 @@ describe(it("can delete a theme with confirmation", () => {createThemeViaApi("Untitled theme");- cy.visit("/admin/embedding/themes");+ cy.visit("/embedding/appearance");H.main().findByText("Untitled theme").should("be.visible");diff --git a/e2e/test/scenarios/embedding/embedding-theme-editor/theme-upsell.cy.spec.ts b/e2e/test/scenarios/embedding/embedding-theme-editor/theme-upsell.cy.spec.tsindex bb22efdb53e..1c971ed7dfe 100644--- a/e2e/test/scenarios/embedding/embedding-theme-editor/theme-upsell.cy.spec.ts+++ b/e2e/test/scenarios/embedding/embedding-theme-editor/theme-upsell.cy.spec.ts@@ -8,14 +8,13 @@ describe("scenarios > embedding > themes > upsell", () => {});it("shows the upsell with Metabase Pro copy and an external upgrade link", () => {- cy.visit("/admin/embedding/themes");+ cy.visit("/embedding/appearance");cy.log("nav label has an upsell gem");- cy.findByTestId("admin-layout-sidebar")- .findByRole("link", { name: /Themes/ })- .within(() => {- cy.icon("gem").should("be.visible");- });+ cy.findByRole("navigation", { name: "Embedding hub" })+ .findByRole("link", { name: "Appearance" })+ .findByTestId("upsell-gem")+ .should("exist");H.main().within(() => {cy.log("upsell copy matches the Figma");@@ -55,14 +54,13 @@ describe("scenarios > embedding > themes > upsell", () => {body: { available: false, plan_alias: "pro-cloud" },});- cy.visit("/admin/embedding/themes");+ cy.visit("/embedding/appearance");cy.log("nav label has an upsell gem");- cy.findByTestId("admin-layout-sidebar")- .findByRole("link", { name: /Themes/ })- .within(() => {- cy.icon("gem").should("be.visible");- });+ cy.findByRole("navigation", { name: "Embedding hub" })+ .findByRole("link", { name: "Appearance" })+ .findByTestId("upsell-gem")+ .should("exist");H.main().within(() => {cy.findByText("Metabase Pro").should("be.visible");@@ -103,7 +101,7 @@ describe("scenarios > embedding > themes > upsell", () => {body: { available: false, plan_alias: "pro-cloud" },});- cy.visit("/admin/embedding/themes");+ cy.visit("/embedding/appearance");H.main().within(() => {cy.findByText("Metabase Pro").should("be.visible");@@ -115,7 +113,7 @@ describe("scenarios > embedding > themes > upsell", () => {cy.findByText(/Please ask a Metabase Store Admin/).should("not.exist");cy.log("no trial → no trial line");- cy.findByText(/14-day free trial/).should("not.exist");+ cy.findByText(/14 day trial/).should("not.exist");cy.log("CTA is rendered (hosted starter as store admin → opens the upgrade modal)",@@ -145,7 +143,7 @@ describe("scenarios > embedding > themes > upsell", () => {body: { available: true, plan_alias: "pro-cloud" },});- cy.visit("/admin/embedding/themes");+ cy.visit("/embedding/appearance");H.main().within(() => {cy.findByText("Metabase Pro").should("be.visible");@@ -155,7 +153,7 @@ describe("scenarios > embedding > themes > upsell", () => {cy.log("trial line is rendered");cy.findByText(- /Get a 14-day free trial of this and other pro features/,+ /Get a 14 day trial of this and other Pro features/,).should("be.visible");cy.log("button text switches to 'Try for free'");@@ -173,14 +171,13 @@ describe("scenarios > embedding > themes > upsell", () => {});it("does not show the upsell and renders the themes listing", () => {- cy.visit("/admin/embedding/themes");+ cy.visit("/embedding/appearance");cy.log("nav label has no upsell gem");- cy.findByTestId("admin-layout-sidebar")- .findByRole("link", { name: /Themes/ })- .within(() => {- cy.icon("gem").should("not.exist");- });+ cy.findByRole("navigation", { name: "Embedding hub" })+ .findByRole("link", { name: "Appearance" })+ .findByTestId("upsell-gem")+ .should("not.exist");H.main().within(() => {cy.log("upsell copy is absent");diff --git a/e2e/test/scenarios/embedding/modular-embedding-settings.cy.spec.ts b/e2e/test/scenarios/embedding/modular-embedding-settings.cy.spec.tsdeleted file mode 100644index 8f5b13bd55f..00000000000--- a/e2e/test/scenarios/embedding/modular-embedding-settings.cy.spec.ts+++ /dev/null@@ -1,32 +0,0 @@-const { H } = cy;--describe("scenarios > modular embedding settings", { tags: "@EE" }, () => {- beforeEach(() => {- H.restore();- cy.signInAsAdmin();- H.activateToken("pro-self-hosted");- });-- it("should link to user strategy when tenants are disabled", () => {- cy.visit("/admin/embedding/modular");-- H.main()- .findByText("Tenants")- .scrollIntoView()- .should("be.visible")- .closest("a")- .should("have.attr", "href", "/admin/people/user-strategy");- });-- it("should link to tenants page when tenants are enabled", () => {- H.updateSetting("use-tenants", true);- cy.visit("/admin/embedding/modular");-- H.main()- .findByText("Tenants")- .scrollIntoView()- .should("be.visible")- .closest("a")- .should("have.attr", "href", "/admin/people/tenants");- });-});diff --git a/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/common-ee.cy.spec.ts b/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/common-ee.cy.spec.tsindex 7934d1687a0..d1e28a749bb 100644--- a/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/common-ee.cy.spec.ts+++ b/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/common-ee.cy.spec.ts@@ -5,6 +5,7 @@ import {import { enableJwtAuth } from "e2e/support/helpers/e2e-jwt-helpers";import {+ clickNewEmbedButton,getEmbedSidebar,navigateToEntitySelectionStep,navigateToGetCodeStep,@@ -21,9 +22,8 @@ describe("scenarios > embedding > sdk iframe embed setup > common", () => {cy.signInAsAdmin();H.activateToken("pro-self-hosted");H.enableTracking();- H.updateSetting("enable-embedding-simple", true);- H.updateSetting("show-simple-embed-terms", false);- H.updateSetting("enable-embedding-static", true);+ H.updateSetting("enable-embedding-modular", true);+ H.updateSetting("show-modular-embed-terms", false);H.updateSetting("show-static-embed-terms", false);cy.intercept("GET", "/api/dashboard/**").as("dashboard");@@ -44,7 +44,9 @@ describe("scenarios > embedding > sdk iframe embed setup > common", () => {});H.modal().should("not.exist");- cy.findAllByTestId("sdk-setting-card").should("be.visible");+ cy.findByTestId("embedding-hub-main")+ .findByRole("heading", { name: "Security" })+ .should("be.visible");});it("should close wizard when clicking `Done` button on the last step", () => {@@ -63,7 +65,9 @@ describe("scenarios > embedding > sdk iframe embed setup > common", () => {});H.modal().should("not.exist");- cy.findAllByTestId("sdk-setting-card").should("be.visible");+ cy.findByTestId("embedding-hub-main")+ .findByRole("heading", { name: "Security" })+ .should("be.visible");});it("should close wizard when navigating back in browser history", () => {@@ -72,14 +76,12 @@ describe("scenarios > embedding > sdk iframe embed setup > common", () => {.contains("General").should("be.visible");- cy.visit("/admin/embedding");- cy.findAllByTestId("sdk-setting-card").should("be.visible");+ cy.visit("/embedding/security");+ cy.findByTestId("embedding-hub-main")+ .findByRole("heading", { name: "Security" })+ .should("be.visible");- cy.findAllByTestId("sdk-setting-card")- .first()- .within(() => {- cy.findByText("New embed").click();- });+ clickNewEmbedButton();cy.wait("@dashboard");@@ -96,8 +98,8 @@ describe("scenarios > embedding > sdk iframe embed setup > common", () => {});describe("auth type switch", () => {- it("allows to select the `guest` item even when static embedding setting is disabled", () => {- H.updateSetting("enable-embedding-static", false);+ it("allows to select the `guest` item even when modular embedding is disabled", () => {+ H.updateSetting("enable-embedding-modular", false);H.visitQuestion(ORDERS_COUNT_QUESTION_ID);@@ -106,8 +108,8 @@ describe("scenarios > embedding > sdk iframe embed setup > common", () => {cy.findByLabelText("Guest").should("be.enabled");});- it("allows to select the `Metabase Account` item even when simple embedding setting is disabled", () => {- H.updateSetting("enable-embedding-simple", false);+ it("allows to select the `Metabase Account` item even when modular embedding is disabled", () => {+ H.updateSetting("enable-embedding-modular", false);H.visitQuestion(ORDERS_COUNT_QUESTION_ID);@@ -127,22 +129,9 @@ describe("scenarios > embedding > sdk iframe embed setup > common", () => {.click();};- const openFromAdminEmbedding = () => {- cy.visit("/admin/embedding");- cy.findAllByTestId("sdk-setting-card")- .first()- .within(() => {- cy.findByText("New embed").click();- });- };-- const openFromAdminGuestEmbeds = () => {- cy.visit("/admin/embedding/guest");- cy.findAllByTestId("guest-embeds-setting-card")- .first()- .within(() => {- cy.findByText("New embed").click();- });+ const openFromEmbeddingHub = () => {+ cy.visit("/embedding/security");+ clickNewEmbedButton();};const openFromSharingMenu = () => {@@ -169,30 +158,22 @@ describe("scenarios > embedding > sdk iframe embed setup > common", () => {openFromCommandPalette();assertCheckedAuth("sso");- openFromAdminEmbedding();+ openFromEmbeddingHub();assertCheckedAuth("sso");openFromSharingMenu();assertCheckedAuth("sso");-- // The Guest embeds admin section is intentionally guest-only and- // forces guest mode regardless of SSO configuration.- openFromAdminGuestEmbeds();- assertCheckedAuth("guest");});it("defaults to Guest from all entry points when SSO is not configured", () => {openFromCommandPalette();assertCheckedAuth("guest");- openFromAdminEmbedding();+ openFromEmbeddingHub();assertCheckedAuth("guest");openFromSharingMenu();assertCheckedAuth("guest");-- openFromAdminGuestEmbeds();- assertCheckedAuth("guest");});});diff --git a/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/common-oss-and-starter.cy.spec.ts b/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/common-oss-and-starter.cy.spec.tsindex 6c2892e642d..b0d1dd9f2a2 100644--- a/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/common-oss-and-starter.cy.spec.ts+++ b/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/common-oss-and-starter.cy.spec.ts@@ -26,7 +26,7 @@ describe("scenarios > embedding > sdk iframe embed setup > common (oss and start});it("allows to select the `guest` item even when static embedding setting is disabled", () => {- H.updateSetting("enable-embedding-static", false);+ H.updateSetting("enable-embedding-modular", false);H.visitQuestion(ORDERS_COUNT_QUESTION_ID);@@ -36,7 +36,7 @@ describe("scenarios > embedding > sdk iframe embed setup > common (oss and start});it("does not allow to select the `Metabase Account`, when token feature is missing (oss)", () => {- H.updateSetting("enable-embedding-simple", false);+ H.updateSetting("enable-embedding-modular", false);H.visitQuestion(ORDERS_COUNT_QUESTION_ID);diff --git a/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/embed-flow-enable-embed-js-ee.cy.spec.ts b/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/embed-flow-enable-embed-js-ee.cy.spec.tsindex 2c48c641239..a232fcacb56 100644--- a/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/embed-flow-enable-embed-js-ee.cy.spec.ts+++ b/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/embed-flow-enable-embed-js-ee.cy.spec.ts@@ -4,32 +4,30 @@ import {openSharingMenu,} from "e2e/support/helpers";-import { getEmbedSidebar } from "./helpers";+import { clickNewEmbedButton, getEmbedSidebar } from "./helpers";const { H } = cy;const DATA_BY_EMBEDDING_TYPE = {guest: {- path: "/admin/embedding/guest",+ path: "/embedding/security",token: null,authMethodLabel: "Guest",- cardTestId: "guest-embeds-setting-card",cardText:- "To continue, enable guest embeds and agree to the usage conditions.",- embeddingSettingName: "enable-embedding-static",+ "To continue, enable embedding and agree to the usage conditions.",+ embeddingSettingName: "enable-embedding-modular",showTermsSettingName: "show-static-embed-terms",tooltipText:/You should, however, read the license text linked above as that is the actual license that you will be agreeing to by enabling this feature/,},modular: {- path: "/admin/embedding",+ path: "/embedding/security",token: "bleeding-edge",authMethodLabel: "Metabase account (SSO)",- cardTestId: "sdk-setting-card",cardText:"To continue, enable modular embedding and agree to the usage conditions.",- embeddingSettingName: "enable-embedding-simple",- showTermsSettingName: "show-simple-embed-terms",+ embeddingSettingName: "enable-embedding-modular",+ showTermsSettingName: "show-modular-embed-terms",tooltipText: /Sharing Metabase accounts is a security risk/,},} as const;@@ -50,7 +48,6 @@ describe("scenarios > embedding > sdk iframe embed setup > enable embed js (EE)"authMethodLabel,embeddingSettingName,showTermsSettingName,- cardTestId,cardText,tooltipText,} = value;@@ -67,11 +64,7 @@ describe("scenarios > embedding > sdk iframe embed setup > enable embed js (EE)"cy.visit(path);- cy.findAllByTestId(cardTestId)- .first()- .within(() => {- cy.findByText("New embed").click();- });+ clickNewEmbedButton();cy.findByLabelText(authMethodLabel).click();@@ -127,11 +120,7 @@ describe("scenarios > embedding > sdk iframe embed setup > enable embed js (EE)"cy.visit(path);- cy.findAllByTestId(cardTestId)- .first()- .within(() => {- cy.findByText("New embed").click();- });+ clickNewEmbedButton();cy.findByLabelText(authMethodLabel).click();@@ -156,11 +145,7 @@ describe("scenarios > embedding > sdk iframe embed setup > enable embed js (EE)"cy.visit(path);- cy.findAllByTestId(cardTestId)- .first()- .within(() => {- cy.findByText("New embed").click();- });+ clickNewEmbedButton();cy.findByLabelText(authMethodLabel).click();@@ -170,7 +155,7 @@ describe("scenarios > embedding > sdk iframe embed setup > enable embed js (EE)"});it("shows guest embed status bar when guest embedding is toggled from disabled to enabled state", () => {- H.updateSetting("enable-embedding-static", false);+ H.updateSetting("enable-embedding-modular", false);H.visitDashboard(ORDERS_DASHBOARD_ID);diff --git a/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/embed-flow-enable-embed-js-oss-and-starter.cy.spec.ts b/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/embed-flow-enable-embed-js-oss-and-starter.cy.spec.tsindex 1fc83facd8d..58c0a3a4ce7 100644--- a/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/embed-flow-enable-embed-js-oss-and-starter.cy.spec.ts+++ b/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/embed-flow-enable-embed-js-oss-and-starter.cy.spec.ts@@ -1,6 +1,6 @@import { embedModalEnableEmbeddingCard } from "e2e/support/helpers";-import { getEmbedSidebar } from "./helpers";+import { clickNewEmbedButton, getEmbedSidebar } from "./helpers";const { H } = cy;@@ -23,20 +23,16 @@ describe("scenarios > embedding > sdk iframe embed setup > enable embed js (ossdescribe("guest", () => {it("shows the Enable to Continue button and enables embedding on click", () => {- H.updateSetting("enable-embedding-static", false);+ H.updateSetting("enable-embedding-modular", false);H.updateSetting("show-static-embed-terms", true);- cy.visit("/admin/embedding");+ cy.visit("/embedding/security");- cy.findAllByTestId("guest-embeds-setting-card")- .first()- .within(() => {- cy.findByText("New embed").click();- });+ clickNewEmbedButton();embedModalEnableEmbeddingCard().should("contain.text",- "To continue, enable guest embeds and agree to the usage conditions.",+ "To continue, enable embedding and agree to the usage conditions.",);embedModalEnableEmbeddingCard().within(() => {@@ -99,16 +95,12 @@ describe("scenarios > embedding > sdk iframe embed setup > enable embed js (oss});it("shows the enable card with fair usage terms when embedding is already enabled", () => {- H.updateSetting("enable-embedding-static", true);+ H.updateSetting("enable-embedding-modular", true);H.updateSetting("show-static-embed-terms", true);- cy.visit("/admin/embedding");+ cy.visit("/embedding/security");- cy.findAllByTestId("guest-embeds-setting-card")- .first()- .within(() => {- cy.findByText("New embed").click();- });+ clickNewEmbedButton();embedModalEnableEmbeddingCard().should("contain.text", "Agree to the")@@ -124,7 +116,7 @@ describe("scenarios > embedding > sdk iframe embed setup > enable embed js (oss.should("have.attr", "target", "_blank");cy.findByText(- /To continue, enable guest embeds and agree to the/,+ "To continue, enable embedding and agree to the usage conditions.",).should("not.exist");});@@ -139,20 +131,16 @@ describe("scenarios > embedding > sdk iframe embed setup > enable embed js (oss});it("hides the enable card when embedding is already enabled", () => {- H.updateSetting("enable-embedding-static", true);+ H.updateSetting("enable-embedding-modular", true);H.updateSetting("show-static-embed-terms", false);- cy.visit("/admin/embedding");+ cy.visit("/embedding/security");- cy.findAllByTestId("guest-embeds-setting-card")- .first()- .within(() => {- cy.findByText("New embed").click();- });+ clickNewEmbedButton();getEmbedSidebar().contains(- "To continue, enable guest embeds and agree to the usage conditions.",+ "To continue, enable embedding and agree to the usage conditions.",).should("not.exist");});@@ -160,20 +148,16 @@ describe("scenarios > embedding > sdk iframe embed setup > enable embed js (ossdescribe("Metabase account (sso)", () => {it("does not show the Enable to Continue button and disables item", () => {- H.updateSetting("enable-embedding-simple", false);- H.updateSetting("show-simple-embed-terms", true);+ H.updateSetting("enable-embedding-modular", false);+ H.updateSetting("show-modular-embed-terms", true);- cy.visit("/admin/embedding");+ cy.visit("/embedding/security");- cy.findAllByTestId("guest-embeds-setting-card")- .first()- .within(() => {- cy.findByText("New embed").click();- });+ clickNewEmbedButton();embedModalEnableEmbeddingCard().within(() => {cy.findByText(- "To continue, enable guest embeds and agree to the usage conditions.",+ "To continue, enable embedding and agree to the usage conditions.",).should("not.exist");});diff --git a/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/embed-parameters-remapping.cy.spec.ts b/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/embed-parameters-remapping.cy.spec.tsindex 139b1015997..e297f0e3d74 100644--- a/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/embed-parameters-remapping.cy.spec.ts+++ b/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/embed-parameters-remapping.cy.spec.ts@@ -19,7 +19,7 @@ describe(suiteTitle, () => {cy.signInAsAdmin();H.activateToken("pro-self-hosted");H.enableTracking();- H.updateSetting("enable-embedding-static", true);+ H.updateSetting("enable-embedding-modular", true);H.updateSetting("embedding-secret-key", JWT_SHARED_SECRET);H.mockEmbedJsToDevServer();});diff --git a/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/embed-parameters.cy.spec.ts b/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/embed-parameters.cy.spec.tsindex 840c020a240..05724a9b77c 100644--- a/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/embed-parameters.cy.spec.ts+++ b/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/embed-parameters.cy.spec.ts@@ -26,9 +26,8 @@ describe(suiteTitle, () => {// guest mode while SSO is unconfigured, so an unaccepted guest CTA would// otherwise have to be clicked through first. That flow is covered by// embed-flow-enable-embed-js-*.- H.updateSetting("enable-embedding-simple", true);- H.updateSetting("show-simple-embed-terms", false);- H.updateSetting("enable-embedding-static", true);+ H.updateSetting("enable-embedding-modular", true);+ H.updateSetting("show-modular-embed-terms", false);H.updateSetting("show-static-embed-terms", false);H.mockEmbedJsToDevServer();});diff --git a/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/get-code.cy.spec.ts b/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/get-code.cy.spec.tsindex ec866b88a28..dd72ad04d68 100644--- a/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/get-code.cy.spec.ts+++ b/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/get-code.cy.spec.ts@@ -21,9 +21,8 @@ describe("scenarios > embedding > sdk iframe embed setup > get code step", () =>H.enableTracking();// Accept the embedding terms up front so the wizard never shows the// Agree CTA — its flow is covered by embed-flow-enable-embed-js-*.- H.updateSetting("enable-embedding-simple", true);- H.updateSetting("show-simple-embed-terms", false);- H.updateSetting("enable-embedding-static", true);+ H.updateSetting("enable-embedding-modular", true);+ H.updateSetting("show-modular-embed-terms", false);H.updateSetting("show-static-embed-terms", false);cy.intercept("GET", "/api/dashboard/**").as("dashboard");diff --git a/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/helpers/index.ts b/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/helpers/index.tsindex 1afbfb7171f..4e3371107d4 100644--- a/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/helpers/index.ts+++ b/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/helpers/index.ts@@ -24,18 +24,18 @@ export const getResourceSelectorButton = (options?: Partial<Cypress.Timeoutable>,) => cy.findByTestId("embed-browse-entity-button", options);+// "New embed" is a button in the embedding hub's nav.+export const clickNewEmbedButton = () =>+ cy.findByRole("button", { name: "New embed" }).click();+export const visitNewEmbedPage = ({ waitForResource } = { waitForResource: true },) => {cy.intercept("GET", "/api/dashboard/*").as("dashboard");- cy.visit("/admin/embedding");+ cy.visit("/embedding/security");- cy.findAllByTestId(/(sdk-setting-card|guest-embeds-setting-card)/)- .first()- .within(() => {- cy.findByText("New embed").click();- });+ clickNewEmbedButton();cy.get("body").then(() => {if (waitForResource) {diff --git a/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/select-embed-entity.cy.spec.ts b/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/select-embed-entity.cy.spec.tsindex 1a9e89c7058..b9675889620 100644--- a/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/select-embed-entity.cy.spec.ts+++ b/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/select-embed-entity.cy.spec.ts@@ -32,7 +32,7 @@ describe(suiteTitle, () => {cy.signInAsAdmin();H.activateToken("pro-self-hosted");H.enableTracking();- H.updateSetting("enable-embedding-simple", true);+ H.updateSetting("enable-embedding-modular", true);cy.intercept("GET", "/api/dashboard/**").as("dashboard");cy.intercept("POST", "/api/card/*/query").as("cardQuery");@@ -291,7 +291,7 @@ describe("recently created dashboards", () => {H.restore();cy.signInAsAdmin();H.activateToken("pro-self-hosted");- H.updateSetting("enable-embedding-simple", true);+ H.updateSetting("enable-embedding-modular", true);cy.intercept("GET", "/api/dashboard/**").as("dashboard");cy.intercept("GET", "/api/activity/recents?*").as("recentActivity");diff --git a/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/select-embed-experience.cy.spec.ts b/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/select-embed-experience.cy.spec.tsindex 3d905b16d93..f2b9626e5f9 100644--- a/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/select-embed-experience.cy.spec.ts+++ b/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/select-embed-experience.cy.spec.ts@@ -24,8 +24,7 @@ describe(suiteTitle, () => {H.activateToken("pro-self-hosted");H.enableTracking();- H.updateSetting("enable-embedding-simple", true);- H.updateSetting("enable-embedding-static", true);+ H.updateSetting("enable-embedding-modular", true);H.setupAnthropicLlmProvider();cy.intercept("GET", "/api/dashboard/*").as("dashboard");@@ -175,12 +174,13 @@ describe(suiteTitle, () => {cy.visit(`/question/${ORDERS_QUESTION_ID}`);H.openEmbedJsModal();- H.embedModalEnableEmbedding();cy.get("#iframe-embed-container").findByTestId("preview-loading-indicator", { timeout: 20_000 }).should("be.visible");+ H.embedModalEnableEmbedding();+cy.get("[data-iframe-loaded]", { timeout: 20_000 }).should("have.length",1,@@ -198,6 +198,13 @@ describe(suiteTitle, () => {visitNewEmbedPage();+ // The hub's "New embed" button sits in the nav and is clickable as soon as+ // the layout mounts, where the admin settings card it replaced only+ // appeared once that page had loaded its settings. That delay was giving+ // the throttled recents response a head start; without it the wizard is+ // still resolving when the assertions run.+ cy.wait("@getRecents");+H.getSimpleEmbedIframeContent().within(() => {cy.findByText("Person overview").should("not.exist");cy.findByText("Orders in a dashboard").should("be.visible");diff --git a/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/select-embed-options.cy.spec.ts b/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/select-embed-options.cy.spec.tsindex 48fc7812237..6214bd6005d 100644--- a/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/select-embed-options.cy.spec.ts+++ b/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/select-embed-options.cy.spec.ts@@ -33,7 +33,7 @@ describe("OSS", { tags: "@OSS" }, () => {H.resetSnowplow();cy.signInAsAdmin();H.enableTracking();- H.updateSetting("enable-embedding-simple", true);+ H.updateSetting("enable-embedding-modular", true);cy.intercept("GET", "/api/dashboard/**").as("dashboard");cy.intercept("POST", "/api/card/*/query").as("cardQuery");@@ -69,7 +69,7 @@ describe("EE without license", () => {cy.signInAsAdmin();H.activateToken("starter");H.enableTracking();- H.updateSetting("enable-embedding-simple", true);+ H.updateSetting("enable-embedding-modular", true);cy.intercept("GET", "/api/dashboard/**").as("dashboard");cy.intercept("POST", "/api/card/*/query").as("cardQuery");@@ -95,7 +95,7 @@ describe(suiteTitle, () => {cy.signInAsAdmin();H.activateToken("pro-self-hosted");H.enableTracking();- H.updateSetting("enable-embedding-simple", true);+ H.updateSetting("enable-embedding-modular", true);H.setupAnthropicLlmProvider();cy.intercept("GET", "/api/dashboard/**").as("dashboard");diff --git a/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/user-settings-persistence.cy.spec.ts b/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/user-settings-persistence.cy.spec.tsindex 8b1042f256b..1257e143a46 100644--- a/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/user-settings-persistence.cy.spec.ts+++ b/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/user-settings-persistence.cy.spec.ts@@ -1,4 +1,4 @@-import { navigateToEmbedOptionsStep } from "./helpers";+import { clickNewEmbedButton, navigateToEmbedOptionsStep } from "./helpers";const { H } = cy;@@ -33,20 +33,12 @@ const assertPreviewFinishesLoading = () => {cy.findByTestId("preview-loading-indicator").should("not.exist");};-const reopenNewEmbedModal = () => {- cy.findAllByTestId(/(sdk-setting-card|guest-embeds-setting-card)/)- .first()- .within(() => {- cy.findByText("New embed").click();- });-};-describe("scenarios > embedding > sdk iframe embed setup > user settings persistence", () => {beforeEach(() => {H.restore();cy.signInAsAdmin();H.activateToken("pro-self-hosted");- H.updateSetting("enable-embedding-simple", true);+ H.updateSetting("enable-embedding-modular", true);cy.intercept("PUT", "/api/setting/sdk-iframe-embed-setup-settings").as("persistSettings",@@ -119,7 +111,7 @@ describe("scenarios > embedding > sdk iframe embed setup > user settings persistcy.findByTestId("sdk-iframe-embed-setup-modal-content").should("not.exist");cy.log("reopen the New embed modal");- reopenNewEmbedModal();+ clickNewEmbedButton();cy.log("the preview must finish loading — the restored saved theme must not leave it stuck on the loader",diff --git a/e2e/test/scenarios/embedding/sdk-iframe-embedding/eajs-internal-navigation.cy.spec.ts b/e2e/test/scenarios/embedding/sdk-iframe-embedding/eajs-internal-navigation.cy.spec.tsindex 36fab324ce1..ca4ab4996c1 100644--- a/e2e/test/scenarios/embedding/sdk-iframe-embedding/eajs-internal-navigation.cy.spec.ts+++ b/e2e/test/scenarios/embedding/sdk-iframe-embedding/eajs-internal-navigation.cy.spec.ts@@ -256,10 +256,10 @@ describe("scenarios > embedding > sdk iframe embedding > internal-navigation", (it("should not support internal navigation on guest embeds", () => {// Enable guest embedding settings- cy.request("PUT", "/api/setting/enable-embedding-simple", {+ cy.request("PUT", "/api/setting/enable-embedding-modular", {value: true,});- cy.request("PUT", "/api/setting/enable-embedding-static", {+ cy.request("PUT", "/api/setting/enable-embedding-modular", {value: true,});updateSetting("embedding-secret-key", JWT_SHARED_SECRET);diff --git a/e2e/test/scenarios/embedding/embedding-hub/embedding-hub.cy.spec.ts b/e2e/test/scenarios/embedding/setup-guide/setup-guide.cy.spec.tssimilarity index 92%rename from e2e/test/scenarios/embedding/embedding-hub/embedding-hub.cy.spec.tsrename to e2e/test/scenarios/embedding/setup-guide/setup-guide.cy.spec.tsindex 76ffb00536e..f5d8226c768 100644--- a/e2e/test/scenarios/embedding/embedding-hub/embedding-hub.cy.spec.ts+++ b/e2e/test/scenarios/embedding/setup-guide/setup-guide.cy.spec.ts@@ -6,7 +6,7 @@ const { H } = cy;const { STATIC_ORDERS_ID } = SAMPLE_DB_TABLES;const NON_SAMPLE_DB_NAME = "QA Postgres12";-describe("scenarios - embedding hub", () => {+describe("scenarios - setup guide", () => {describe("checklist", () => {beforeEach(() => {H.restore("setup");@@ -14,24 +14,24 @@ describe("scenarios - embedding hub", () => {H.activateToken("pro-cloud");});- it("Contains setup guide in sidebar", () => {- cy.visit("/admin/embedding");+ it("Contains the setup guide in the hub nav", () => {+ cy.visit("/embedding/security");- cy.findByTestId("admin-layout-sidebar")- .findByText("Setup guide")+ cy.findByRole("navigation", { name: "Embedding hub" })+ .findByRole("link", { name: "Get started" }).should("exist").click();- cy.findByTestId("admin-layout-content")- .findByRole("heading", { name: "Embedding setup guide" })+ cy.findByTestId("embedding-hub-main")+ .findByRole("heading", { name: "Get started with Metabase Embedding" }).should("exist");});it('"Create a dashboard" card should save the x-ray and show a success toast without leaving the guide', () => {- cy.visit("/admin/embedding/setup-guide");+ cy.visit("/embedding/get-started");cy.log("Find and click on 'Create a dashboard' card");- cy.findByTestId("admin-layout-content")+ cy.findByTestId("embedding-hub-main").findByText("Create a dashboard").click();@@ -50,14 +50,14 @@ describe("scenarios - embedding hub", () => {H.undoToast().findByText("See it").should("be.visible");cy.log("Should remain on the setup guide");- cy.url().should("include", "/admin/embedding/setup-guide");+ cy.url().should("include", "/embedding/get-started");});it('"Connect a database" card should pass from param in navigation URL', () => {- cy.visit("/admin/embedding/setup-guide");+ cy.visit("/embedding/get-started");cy.log("Find and click on 'Connect a database' card");- cy.findByTestId("admin-layout-content")+ cy.findByTestId("embedding-hub-main").findByText("Connect a database").click();@@ -75,7 +75,7 @@ describe("scenarios - embedding hub", () => {});it("Uploading CSVs to sample database should mark the 'Add Data' step as done", () => {- cy.intercept("GET", "/api/ee/embedding-hub/checklist").as("getChecklist");+ cy.intercept("GET", "/api/embedding-hub/checklist").as("getChecklist");cy.log("Enable CSV uploads");cy.request("PUT", "/api/setting/uploads-settings", {@@ -86,16 +86,16 @@ describe("scenarios - embedding hub", () => {},});- cy.visit("/admin/embedding/setup-guide");+ cy.visit("/embedding/get-started");cy.log("'Connect a database' should not be marked as done");- cy.findByTestId("admin-layout-content")+ cy.findByTestId("embedding-hub-main").findByText("Connect a database")- .closest("button")- .findByText("Done")+ .closest('[data-testid="embedding-hub-checklist-card"]')+ .findByLabelText("Step 1 complete").should("not.exist");- cy.findByTestId("admin-layout-content")+ cy.findByTestId("embedding-hub-main").findByText("Connect a database").click();@@ -122,18 +122,18 @@ describe("scenarios - embedding hub", () => {cy.wait("@getChecklist");cy.log("'Connect a database' should be marked as done");- cy.findByTestId("admin-layout-content")+ cy.findByTestId("embedding-hub-main").findByText("Connect a database")- .closest("button")+ .closest('[data-testid="embedding-hub-checklist-card"]').scrollIntoView()- .findByText("Done")+ .findByLabelText("Step 1 complete").should("be.visible");});it('"Get embed snippet" card should take you to the embed flow', () => {- cy.visit("/admin/embedding/setup-guide");+ cy.visit("/embedding/get-started");- cy.findByTestId("admin-layout-content")+ cy.findByTestId("embedding-hub-main").findByText("Get embed snippet").click();@@ -148,17 +148,17 @@ describe("scenarios - embedding hub", () => {cy.log("Create a dashboard to embed");H.createDashboard({ name: "Test Dashboard" });- cy.visit("/admin/embedding/setup-guide");+ cy.visit("/embedding/get-started");cy.log("step should not be marked as done at first");- cy.findByTestId("admin-layout-content")+ cy.findByTestId("embedding-hub-main").findByText("Get embed snippet")- .closest("button")- .findByText("Done")+ .closest('[data-testid="embedding-hub-checklist-card"]')+ .findByLabelText("Step 3 complete").should("not.exist");cy.log("open embed wizard");- cy.findByTestId("admin-layout-content")+ cy.findByTestId("embedding-hub-main").findByText("Get embed snippet").click();@@ -189,10 +189,10 @@ describe("scenarios - embedding hub", () => {H.modal().first().findByLabelText("Close").click();cy.log("step should be marked as done");- cy.findByTestId("admin-layout-content")+ cy.findByTestId("embedding-hub-main").findByText("Get embed snippet")- .closest("button")- .findByText("Done", { timeout: 10_000 })+ .closest('[data-testid="embedding-hub-checklist-card"]')+ .findByLabelText("Step 3 complete", { timeout: 10_000 }).should("be.visible");});@@ -271,45 +271,14 @@ describe("scenarios - embedding hub", () => {.should("not.exist");});- it("should link to user strategy when tenants are disabled", () => {- H.restore("setup");- cy.signInAsAdmin();- H.activateToken("pro-self-hosted");-- cy.visit("/admin/embedding/setup-guide");-- H.main()- .findByText("Tenants")- .scrollIntoView()- .should("be.visible")- .closest("a")- .should("have.attr", "href", "/admin/people/user-strategy");- });-- it("should link to tenants page when tenants are enabled", () => {- H.restore("setup");- cy.signInAsAdmin();- H.activateToken("pro-self-hosted");+ it('"Configure data permissions and tenants" card should navigate to permissions onboarding page', () => {+ cy.visit("/embedding/get-started");- H.updateSetting("use-tenants", true);- cy.visit("/admin/embedding/setup-guide");-- H.main()- .findByText("Tenants")- .scrollIntoView()- .should("be.visible")- .closest("a")- .should("have.attr", "href", "/admin/people/tenants");- });-- it('"Configure data permissions and enable tenants" card should navigate to permissions onboarding page', () => {- cy.visit("/admin/embedding/setup-guide");-- cy.findByTestId("admin-layout-content")- .findByText("Configure data permissions and enable tenants")+ cy.findByTestId("embedding-hub-main")+ .findByText("Configure data permissions and tenants").click();- cy.url().should("include", "/admin/embedding/setup-guide/permissions");+ cy.url().should("include", "/embedding/get-started/permissions");H.main().findByText("Configure data permissions and enable tenants")@@ -322,7 +291,7 @@ describe("scenarios - embedding hub", () => {cy.signInAsAdmin();H.activateToken("pro-self-hosted");- cy.visit("/admin/embedding/setup-guide/permissions");+ cy.visit("/embedding/get-started/permissions");cy.log("all 5 steps are present and none are completed at first");H.main().within(() => {@@ -383,9 +352,9 @@ describe("scenarios - embedding hub", () => {H.activateToken("pro-self-hosted");cy.log("create an x-ray dashboard via the embedding setup guide");- cy.visit("/admin/embedding/setup-guide");+ cy.visit("/embedding/get-started");- cy.findByTestId("admin-layout-content")+ cy.findByTestId("embedding-hub-main").findByText("Create a dashboard").click();@@ -399,7 +368,7 @@ describe("scenarios - embedding hub", () => {cy.log("wait for x-ray dashboard to generate and save it");H.undoToast().should("contain", "Your dashboard was saved");- cy.visit("/admin/embedding/setup-guide/permissions");+ cy.visit("/embedding/get-started/permissions");cy.log("tenants should not be enabled");cy.request("GET", "/api/session/properties").then((response) => {@@ -504,7 +473,7 @@ describe("scenarios - embedding hub", () => {cy.log("enable tenants via setting without creating a shared collection");H.updateSetting("use-tenants", true);- cy.visit("/admin/embedding/setup-guide/permissions");+ cy.visit("/embedding/get-started/permissions");cy.log("no steps should be completed");H.main().within(() => {@@ -535,7 +504,7 @@ describe("scenarios - embedding hub", () => {namespace: "shared-tenant-collection",});- cy.visit("/admin/embedding/setup-guide/permissions");+ cy.visit("/embedding/get-started/permissions");cy.log("wait until step is marked as complete");H.main().icon("check").should("have.length", 1);@@ -556,7 +525,7 @@ describe("scenarios - embedding hub", () => {cy.signInAsAdmin();H.activateToken("pro-self-hosted");- cy.visit("/admin/embedding/setup-guide/permissions");+ cy.visit("/embedding/get-started/permissions");cy.log("click the enable tenants button");H.main()@@ -615,7 +584,7 @@ describe("scenarios - embedding hub", () => {});it("can create two tenants and show summary", () => {- cy.visit("/admin/embedding/setup-guide/permissions");+ cy.visit("/embedding/get-started/permissions");cy.log("step 1 should be marked as done before navigating");H.main()@@ -699,11 +668,11 @@ describe("scenarios - embedding hub", () => {});cy.log("Configure data permissions step should be done");- cy.findByTestId("admin-layout-content")- .findByText("Configure data permissions and enable tenants")- .closest("button")+ cy.findByTestId("embedding-hub-main")+ .findByText("Configure data permissions and tenants")+ .closest('[data-testid="embedding-hub-checklist-card"]').scrollIntoView()- .findByText("Done")+ .findByLabelText("Step 4 complete").should("be.visible");cy.log("verify tenant_attributes are saved correctly via API");@@ -745,7 +714,7 @@ describe("scenarios - embedding hub", () => {slug: "existing-tenant",});- cy.visit("/admin/embedding/setup-guide/permissions");+ cy.visit("/embedding/get-started/permissions");H.main().findByRole("listitem", { name: "Create tenants" })@@ -779,7 +748,7 @@ describe("scenarios - embedding hub", () => {});it("reloads with strategy pre-selected and 'Select data' step unlocked when RLS is configured", () => {- cy.visit("/admin/embedding/setup-guide/permissions");+ cy.visit("/embedding/get-started/permissions");cy.log("'Select data' step should not be locked when RLS is configured",@@ -805,7 +774,7 @@ describe("scenarios - embedding hub", () => {cy.signInAsAdmin();H.activateToken("pro-self-hosted");- cy.visit("/admin/embedding/setup-guide/permissions");+ cy.visit("/embedding/get-started/permissions");cy.log("enable tenants and create shared collection");H.main()@@ -868,7 +837,7 @@ describe("scenarios - embedding hub", () => {cy.signInAsAdmin();H.activateToken("pro-self-hosted");- cy.visit("/admin/embedding/setup-guide/permissions");+ cy.visit("/embedding/get-started/permissions");cy.log("enable tenants and create shared collection");H.main()@@ -955,7 +924,7 @@ describe("scenarios - embedding hub", () => {"updatePermissionsGraph",);- cy.visit("/admin/embedding/setup-guide/permissions");+ cy.visit("/embedding/get-started/permissions");cy.log("steps 3, 4, and 5 should be locked initially");H.main().within(() => {@@ -1178,7 +1147,7 @@ describe("scenarios - embedding hub", () => {},);- cy.visit("/admin/embedding/setup-guide/permissions");+ cy.visit("/embedding/get-started/permissions");cy.log("wait for checklist data to load before interacting with steps");H.main()@@ -1290,7 +1259,7 @@ describe("scenarios - embedding hub", () => {"updatePermissionsGraph",);- cy.visit("/admin/embedding/setup-guide/permissions");+ cy.visit("/embedding/get-started/permissions");cy.log("enable tenants and create shared collection");H.main()@@ -1392,26 +1361,22 @@ describe("scenarios - embedding hub", () => {);it("locks the production embed step when JWT is not enabled", () => {- cy.visit("/admin/embedding/setup-guide");+ cy.visit("/embedding/get-started");cy.log("jwt should be disabled by default");cy.request("GET", "/api/session/properties").then(({ body }) => {expect(body["jwt-enabled"]).to.equal(false);});- cy.findByTestId("admin-layout-content")+ cy.findByTestId("embedding-hub-main").findByText("Embed in production with SSO").scrollIntoView().should("be.visible")- .closest("button")- .icon("lock")- .should("be.visible");+ .closest('[data-testid="embedding-hub-checklist-card"]')+ .should("have.attr", "aria-disabled", "true")+ .realHover();- cy.findByTestId("admin-layout-content")- .findByText("Embed in production with SSO")- .closest("button")- .findByText("Complete the other steps to unlock")- .should("be.visible");+ cy.findByRole("tooltip").should("have.text", "Set up SSO to unlock");});});@@ -1438,7 +1403,7 @@ describe("scenarios - embedding hub", () => {H.addPostgresDatabase("QA Postgres12");cy.get<number>("@postgresID").then((postgresId) => {- cy.visit("/admin/embedding/setup-guide/permissions");+ cy.visit("/embedding/get-started/permissions");H.main().findByRole("radio", { name: /Connection impersonation/ })@@ -1503,7 +1468,7 @@ describe("scenarios - embedding hub", () => {});it("should show 'no compatible databases' message when only Sample Database exists", () => {- cy.visit("/admin/embedding/setup-guide/permissions");+ cy.visit("/embedding/get-started/permissions");cy.log("select connection impersonation strategy");H.main()@@ -1531,7 +1496,7 @@ describe("scenarios - embedding hub", () => {it("should show disabled database with tooltip when database does not support connection impersonation", function () {H.addPostgresDatabase("QA Postgres12");- cy.visit("/admin/embedding/setup-guide/permissions");+ cy.visit("/embedding/get-started/permissions");H.main().findByRole("radio", { name: /Connection impersonation/ })@@ -1585,7 +1550,7 @@ describe("scenarios - embedding hub", () => {});it("creates a tenant with database_role attribute when using connection impersonation", () => {- cy.visit("/admin/embedding/setup-guide/permissions");+ cy.visit("/embedding/get-started/permissions");cy.log("select connection impersonation strategy");H.main()@@ -1653,9 +1618,9 @@ describe("scenarios - embedding hub", () => {cy.intercept("PUT", "/api/permissions/graph").as("updatePermissionsGraph",);- cy.intercept("GET", "/api/ee/embedding-hub/checklist").as("getChecklist");+ cy.intercept("GET", "/api/embedding-hub/checklist").as("getChecklist");- cy.visit("/admin/embedding/setup-guide/permissions");+ cy.visit("/embedding/get-started/permissions");cy.log("wait for checklist to load and page to settle on the summary step",@@ -1745,7 +1710,7 @@ describe("scenarios - embedding hub", () => {});it("creates a tenant with database_slug attribute when using database routing", () => {- cy.visit("/admin/embedding/setup-guide/permissions");+ cy.visit("/embedding/get-started/permissions");cy.log("select database routing strategy");H.main()@@ -1803,7 +1768,7 @@ describe("scenarios - embedding hub", () => {});it("disables the Enable JWT button when IdP URI is empty", () => {- cy.visit("/admin/embedding/setup-guide/sso");+ cy.visit("/embedding/get-started/sso");cy.findByLabelText(/JWT Identity Provider URI/i).should("be.visible")@@ -1818,7 +1783,7 @@ describe("scenarios - embedding hub", () => {});it("can configure JWT auth and complete SSO setup", () => {- cy.visit("/admin/embedding/setup-guide/sso");+ cy.visit("/embedding/get-started/sso");cy.log("no steps should be completed initially");H.main().icon("check").should("not.exist");@@ -1876,25 +1841,24 @@ describe("scenarios - embedding hub", () => {});cy.log("should go back to setup guide");- cy.url().should("include", "/admin/embedding/setup-guide");+ cy.url().should("include", "/embedding/get-started");cy.url().should("not.include", "/sso");cy.log("'Configure SSO' card should be marked as done");- cy.findByTestId("admin-layout-content")- .findByText("Configure SSO")- .closest("button")+ cy.findByTestId("embedding-hub-main")+ .findByText("Set up SSO")+ .closest('[data-testid="embedding-hub-checklist-card"]').scrollIntoView()- .findByText("Done", { timeout: 10_000 })+ .findByLabelText("Step 5 complete", { timeout: 10_000 }).should("be.visible");cy.log("'Embed in production with SSO' should now be unlocked");- cy.findByTestId("admin-layout-content")+ cy.findByTestId("embedding-hub-main").findByText("Embed in production with SSO").scrollIntoView().should("be.visible")- .closest("button")- .icon("lock")- .should("not.exist");+ .closest('[data-testid="embedding-hub-checklist-card"]')+ .should("not.have.attr", "aria-disabled");});});@@ -1910,7 +1874,7 @@ describe("scenarios - embedding hub", () => {"jwt-shared-secret": "0".repeat(64),});- cy.visit("/admin/embedding/setup-guide/sso");+ cy.visit("/embedding/get-started/sso");cy.log("step 1 should be marked as done");H.main()diff --git a/e2e/test/scenarios/sharing/public-sharing-embed-button-behavior.cy.spec.js b/e2e/test/scenarios/sharing/public-sharing-embed-button-behavior.cy.spec.jsindex de97d771288..95bb6d97da7 100644--- a/e2e/test/scenarios/sharing/public-sharing-embed-button-behavior.cy.spec.js+++ b/e2e/test/scenarios/sharing/public-sharing-embed-button-behavior.cy.spec.js@@ -19,7 +19,7 @@ const { H } = cy;describe("when embedding is disabled", () => {beforeEach(() => {- H.updateSetting("enable-embedding-static", false);+ H.updateSetting("enable-embedding-modular", false);});describe("when user is admin", () => {@@ -68,7 +68,7 @@ const { H } = cy;describe("when public sharing is enabled", () => {beforeEach(() => {H.updateSetting("enable-public-sharing", true);- H.updateSetting("enable-embedding-static", true);+ H.updateSetting("enable-embedding-modular", true);});describe("when user is admin", () => {@@ -137,7 +137,7 @@ const { H } = cy;describe("when public sharing is disabled", () => {beforeEach(() => {H.updateSetting("enable-public-sharing", false);- H.updateSetting("enable-embedding-static", true);+ H.updateSetting("enable-embedding-modular", true);});describe("when user is admin", () => {@@ -184,8 +184,13 @@ describe("Embed JS modal display", () => {});describe("when the user has a paid instance", () => {- it("should open Embed JS modal with the `enable simple embedding` card", () => {+ it("should open Embed JS modal with the `enable modular embedding` card", () => {H.activateToken("pro-self-hosted");++ // Once embedding is on, the embed flow asks only for the usage conditions+ // and drops the "enable modular embedding" wording this asserts on. The+ // snapshot leaves it on, so turn the merged setting off first.+ H.updateSetting("enable-embedding-modular", false);H.visitDashboard("@dashboardId");H.openSharingMenu("Embed");@@ -209,7 +214,7 @@ describe("Embed JS modal display", () => {it("should open Embed JS modal with the `enable guest embedding` card", () => {H.activateToken("pro-self-hosted");- H.updateSetting("enable-embedding-static", false);+ H.updateSetting("enable-embedding-modular", false);H.visitDashboard("@dashboardId");H.openSharingMenu("Embed");diff --git a/e2e/test/scenarios/sharing/public-sharing-embed-flow.cy.spec.ts b/e2e/test/scenarios/sharing/public-sharing-embed-flow.cy.spec.tsindex 9b51d0ae6c9..01987fa4344 100644--- a/e2e/test/scenarios/sharing/public-sharing-embed-flow.cy.spec.ts+++ b/e2e/test/scenarios/sharing/public-sharing-embed-flow.cy.spec.ts@@ -23,7 +23,7 @@ describe(suiteTitle, () => {cy.signInAsAdmin();H.activateToken("pro-self-hosted");H.enableTracking();- H.updateSetting("enable-embedding-simple", true);+ H.updateSetting("enable-embedding-modular", true);});afterEach(() => {@@ -60,9 +60,9 @@ describe(suiteTitle, () => {it("lets Guest embedding proceed after accepting only the Guest terms, without requiring the SSO terms (EMB-1884)", () => {// Reproduce a fresh Pro instance where neither auth type's terms have// been accepted yet, so the option cards start dimmed.- H.updateSetting("show-simple-embed-terms", true);+ H.updateSetting("show-modular-embed-terms", true);H.updateSetting("show-static-embed-terms", true);- H.updateSetting("enable-embedding-static", false);+ H.updateSetting("enable-embedding-modular", false);H.visitDashboard(ORDERS_DASHBOARD_ID);H.openSharingMenu("Embed");diff --git a/enterprise/backend/src/metabase_enterprise/api_routes/routes.clj b/enterprise/backend/src/metabase_enterprise/api_routes/routes.cljindex ea552fcd983..bf102414cc5 100644--- a/enterprise/backend/src/metabase_enterprise/api_routes/routes.clj+++ b/enterprise/backend/src/metabase_enterprise/api_routes/routes.clj@@ -24,7 +24,6 @@[metabase-enterprise.database-routing.api][metabase-enterprise.dependencies.api][metabase-enterprise.email.api]- [metabase-enterprise.embedding-hub.api][metabase-enterprise.erd.api][metabase-enterprise.gsheets.api :as gsheets.api][metabase-enterprise.library.api]@@ -136,7 +135,6 @@"/erd" (premium-handler metabase-enterprise.erd.api/routes :schema-viewer)"/remote-sync" (premium-handler metabase-enterprise.remote-sync.api/routes :remote-sync)"/replacement" (premium-handler metabase-enterprise.replacement.api/routes :dependencies)- "/embedding-hub" (premium-handler metabase-enterprise.embedding-hub.api/routes :embedding)"/gsheets" (-> gsheets.api/routes ;; gsheets requires both features.(premium-handler :attached-dwh)(premium-handler :etl-connections))diff --git a/enterprise/backend/src/metabase_enterprise/embedding_hub/api.clj b/enterprise/backend/src/metabase_enterprise/embedding_hub/api.cljindex ec9411854f6..ee95b6fe61f 100644--- a/enterprise/backend/src/metabase_enterprise/embedding_hub/api.clj+++ b/enterprise/backend/src/metabase_enterprise/embedding_hub/api.clj@@ -1,126 +1,16 @@(ns metabase-enterprise.embedding-hub.api+ "Enterprise half of the setup guide checklist. The endpoint itself lives in [[metabase.embedding-hub.api]]; what stays+ here is the one check a community build cannot make, because the JWT and SAML settings ship only with enterprise+ code."(:require- [metabase-enterprise.embedding-hub.db :as embedding-hub.db][metabase-enterprise.sso.settings :as sso-settings]- [metabase.api.macros :as api.macros]- [metabase.api.routes.common :refer [+auth]]- [metabase.appearance.core :as appearance]- [metabase.audit-app.core :as audit]- [metabase.embedding.settings :as embedding.settings]- [metabase.permissions.core :as perms]- [metabase.premium-features.core :as premium-features]))+ [metabase.premium-features.core :as premium-features :refer [defenterprise]]))-(defn- has-user-added-database? []- (or (embedding-hub.db/user-database-exists?)- ;; check for CSV uploads to sample db- ;; as the sample db is excluded from the above query- (when-let [sample-db-id (embedding-hub.db/sample-database-id)]- (embedding-hub.db/upload-table-exists-in-database? sample-db-id))))--(defn- has-user-created-dashboard? []- (let [example-dashboard-id (appearance/example-dashboard-id)- audit-collection-ids (filter some? [(when-let [audit-coll (audit/default-audit-collection)] (:id audit-coll))- (when-let [custom-coll (audit/default-custom-reports-collection)] (:id custom-coll))])]- (embedding-hub.db/user-dashboard-exists? example-dashboard-id audit-collection-ids)))--(defn- has-configured-sandboxes? []- (and (premium-features/has-feature? :sandboxes)- (embedding-hub.db/sandbox-exists?)))--(defn- has-configured-sso? []+(defenterprise has-configured-sso?+ "Whether JWT or SAML is licensed, enabled and configured."+ ;; :none rather than a feature, because the token checks below already gate this -- an instance+ ;; can license SSO without modular embedding+ :feature :none+ [](or (and (premium-features/has-feature? :sso-jwt) (sso-settings/jwt-enabled-and-configured))(and (premium-features/has-feature? :sso-saml) (sso-settings/saml-enabled) (sso-settings/saml-configured))))--(defn- has-user-created-models? []- (embedding-hub.db/user-model-exists? (:id (audit/default-audit-collection))))--(defn- has-user-created-tenants? []- (embedding-hub.db/active-tenant-exists?))--(defn- has-shared-tenant-collections? []- (embedding-hub.db/shared-tenant-collection-exists?))--(defn- shared-collection-has-dashboards? []- (when-let [shared-coll-id (embedding-hub.db/shared-tenant-collection-id)]- (embedding-hub.db/unarchived-dashboard-exists-in-collection? shared-coll-id)))--(defn- has-configured-data-segregation-strategy? []- ;; Check if any of the 3 data segregation strategies are enabled:- ;; 1. Row and Column Level Security (Sandboxing)- ;; 2. Connection Impersonation- ;; 3. Database Routing- (or (has-configured-sandboxes?)- (embedding-hub.db/impersonation-exists?)- (embedding-hub.db/database-router-exists?)))--(defn- active-data-segregation-strategy []- (cond- (has-configured-sandboxes?) "row-column-level-security"- (embedding-hub.db/impersonation-exists?) "connection-impersonation"- (embedding-hub.db/database-router-exists?) "database-routing"- :else nil))--(defn- has-published-guest-embed? []- ;; Check if at least one card or dashboard has embedding enabled (is published as a guest embed)- (or (embedding-hub.db/embedded-card-exists?)- (embedding-hub.db/embedded-dashboard-exists?)))--(defn- embedding-hub-checklist []- (let [enable-tenants? (and (perms/use-tenants)- (has-shared-tenant-collections?))- create-tenants? (has-user-created-tenants?)- setup-data-segregation-strategy? (has-configured-data-segregation-strategy?)]- {"checklist"- {;; for the main embedding hub checklist- "add-data" (has-user-added-database?)- "create-dashboard" (has-user-created-dashboard?)- "create-models" (has-user-created-models?)- "configure-row-column-security" (has-configured-sandboxes?)- "create-test-embed" (or (has-published-guest-embed?)- (embedding.settings/embedding-hub-test-embed-snippet-created))- "embed-production" (embedding.settings/embedding-hub-production-embed-snippet-created)- "data-permissions-and-enable-tenants" (and enable-tenants?- create-tenants?- setup-data-segregation-strategy?)-- ;; for the "configure data permissions and enable tenants" sub-checklist page- "enable-tenants" enable-tenants?- "move-dashboard-to-shared" (boolean (shared-collection-has-dashboards?))- "create-tenants" create-tenants?- "setup-data-segregation-strategy" setup-data-segregation-strategy?-- ;; for the "configure SSO" sub-checklist page- "sso-configured" (has-configured-sso?)- "sso-auth-manual-tested" (embedding.settings/embedding-hub-sso-auth-manual-tested)}-- "data-isolation-strategy" (active-data-segregation-strategy)}))--(def ^:private EmbeddingHubChecklistResponse- "Schema for the embedding hub checklist response."- [:map {:closed true}- ["checklist"- [:map {:closed true}- ["add-data" :boolean]- ["create-dashboard" :boolean]- ["create-models" :boolean]- ["configure-row-column-security" :boolean]- ["create-test-embed" :boolean]- ["embed-production" :boolean]- ["sso-configured" :boolean]- ["data-permissions-and-enable-tenants" :boolean]- ["enable-tenants" :boolean]- ["move-dashboard-to-shared" :boolean]- ["create-tenants" :boolean]- ["setup-data-segregation-strategy" :boolean]- ["sso-auth-manual-tested" :boolean]]]- ["data-isolation-strategy"- [:maybe [:enum "row-column-level-security" "connection-impersonation" "database-routing"]]]])--(api.macros/defendpoint :get "/checklist" :- EmbeddingHubChecklistResponse- "Get the embedding hub checklist status, indicating which setup steps have been completed."- []- (embedding-hub-checklist))--(def ^{:arglists '([request respond raise])} routes- "`/api/ee/embedding-hub` routes."- (api.macros/ns-handler *ns* +auth))diff --git a/enterprise/backend/src/metabase_enterprise/internal_stats/core.clj b/enterprise/backend/src/metabase_enterprise/internal_stats/core.cljindex 6261c517c7f..22d3ba3cb5b 100644--- a/enterprise/backend/src/metabase_enterprise/internal_stats/core.clj+++ b/enterprise/backend/src/metabase_enterprise/internal_stats/core.clj@@ -7,7 +7,10 @@"Boolean values that report on the state of different embedding configurations.":feature :none[embedded-dashboard-count embedded-question-count]- {:enabled-embedding-static (boolean (and (setting/get-value-of-type :boolean :enable-embedding-static)+ ;; Modular embedding, the SDK and guest embeds are one setting since 0.65.0. `setting/get`, not+ ;; `get-value-of-type`: only the former runs the `:getter`, which is where the fallback to the settings it+ ;; replaces lives. The field names are kept so existing reports keep resolving.+ {:enabled-embedding-static (boolean (and (setting/get :enable-embedding-modular)(or (> embedded-question-count 0)(> embedded-dashboard-count 0)))):enabled-embedding-interactive (boolean (and (setting/get-value-of-type :boolean :enable-embedding-interactive)@@ -16,10 +19,10 @@(setting/get-value-of-type :boolean :saml-enabled)(setting/get-value-of-type :boolean :ldap-enabled)(setting/get-value-of-type :boolean :google-auth-enabled))))- :enabled-embedding-sdk (boolean (and (setting/get-value-of-type :boolean :enable-embedding-sdk)+ :enabled-embedding-sdk (boolean (and (setting/get :enable-embedding-modular)(or (setting/get-value-of-type :boolean :jwt-enabled)(setting/get-value-of-type :boolean :saml-enabled))))- :enabled-embedding-simple (boolean (and (setting/get-value-of-type :boolean :enable-embedding-simple)+ :enabled-embedding-simple (boolean (and (setting/get :enable-embedding-modular)(or (setting/get-value-of-type :boolean :jwt-enabled)(setting/get-value-of-type :boolean :saml-enabled)))):use-tenants (boolean (setting/get-value-of-type :boolean :use-tenants))})diff --git a/enterprise/backend/src/metabase_enterprise/sso/integrations/jwt.clj b/enterprise/backend/src/metabase_enterprise/sso/integrations/jwt.cljindex 134eb7755e4..db3f91653dc 100644--- a/enterprise/backend/src/metabase_enterprise/sso/integrations/jwt.clj+++ b/enterprise/backend/src/metabase_enterprise/sso/integrations/jwt.clj@@ -82,10 +82,10 @@redirect (get-in request [:params :redirect])](cond;; Embedding feature checks- (and is-react-sdk? (not (embed.settings/enable-embedding-sdk)))+ (and is-react-sdk? (not (embed.settings/enable-embedding-modular)))(throw-react-sdk-embedding-disabled)- (and is-embedded-analytics-js? (not (embed.settings/enable-embedding-simple)))+ (and is-embedded-analytics-js? (not (embed.settings/enable-embedding-modular)))(throw-simple-embedding-disabled)(and is-modular-embedding? jwt)diff --git a/enterprise/backend/test/metabase_enterprise/advanced_permissions/api/setting_test.clj b/enterprise/backend/test/metabase_enterprise/advanced_permissions/api/setting_test.cljindex dcf459b3ff3..11e5c5b90aa 100644--- a/enterprise/backend/test/metabase_enterprise/advanced_permissions/api/setting_test.clj+++ b/enterprise/backend/test/metabase_enterprise/advanced_permissions/api/setting_test.clj@@ -146,7 +146,7 @@(deftest dashboard-api-test(testing "/api/dashboard"(mt/with-temporary-setting-values [enable-public-sharing true- enable-embedding-static true]+ enable-embedding-modular true](mt/with-user-in-groups[group {:name "New Group"}user [group]]@@ -219,7 +219,7 @@(deftest card-api-test(testing "/api/card"(mt/with-temporary-setting-values [enable-public-sharing true- enable-embedding-static true]+ enable-embedding-modular true](mt/with-user-in-groups[group {:name "New Group"}user [group]]diff --git a/enterprise/backend/test/metabase_enterprise/content_translation/routes_test.clj b/enterprise/backend/test/metabase_enterprise/content_translation/routes_test.cljindex b6444033bf1..6d6f6cd776f 100644--- a/enterprise/backend/test/metabase_enterprise/content_translation/routes_test.clj+++ b/enterprise/backend/test/metabase_enterprise/content_translation/routes_test.clj@@ -139,7 +139,7 @@`(do-with-new-secret-key! (fn ~binding ~@body)))(defmacro with-static-embedding! ^{:style/indent 0} [& body]- `(mt/with-temporary-setting-values [~'enable-embedding-static true]+ `(mt/with-temporary-setting-values [~'enable-embedding-modular true]~@body))(defn- embedded-dictionary-url [token]diff --git a/enterprise/backend/test/metabase_enterprise/database_routing/embedding_test.clj b/enterprise/backend/test/metabase_enterprise/database_routing/embedding_test.cljindex 72ad9c5a749..5d613efb472 100644--- a/enterprise/backend/test/metabase_enterprise/database_routing/embedding_test.clj+++ b/enterprise/backend/test/metabase_enterprise/database_routing/embedding_test.clj@@ -27,7 +27,7 @@`(do-with-new-secret-key! (fn [] ~@body)))(defmacro with-embedding-enabled-and-new-secret-key! {:style/indent 0} [& body]- `(mt/with-temporary-setting-values [~'enable-embedding-static true+ `(mt/with-temporary-setting-values [~'enable-embedding-modular true~'enable-embedding-interactive true](with-new-secret-key!~@body)))diff --git a/enterprise/backend/test/metabase_enterprise/embedding_hub/api_test.clj b/enterprise/backend/test/metabase_enterprise/embedding_hub/api_test.cljindex f6295c97234..e74b7363aac 100644--- a/enterprise/backend/test/metabase_enterprise/embedding_hub/api_test.clj+++ b/enterprise/backend/test/metabase_enterprise/embedding_hub/api_test.clj@@ -3,59 +3,22 @@[clojure.test :refer :all][metabase.test :as mt]))-(deftest has-user-created-models-test- (testing "has-user-created-models? correctly handles multiple sample collections (metabase#64627)"- (mt/with-premium-features #{:embedding}- (mt/with-temp [:model/Collection sample-collection-1 {:name "Sample Collection 1" :is_sample true}- :model/Collection sample-collection-2 {:name "Sample Collection 2" :is_sample true}- :model/Card user-model {:name "User Model"- :type "model"- :archived false- :collection_id nil- :dataset_query {:database (mt/id)- :type :query- :query {:source-table (mt/id :venues)}}}- :model/Card _sample-model-1 {:name "Sample Model 1"- :type "model"- :archived false- :collection_id (:id sample-collection-1)- :dataset_query {:database (mt/id)- :type :query- :query {:source-table (mt/id :venues)}}}- :model/Card _sample-model-2 {:name "Sample Model 2"- :type "model"- :archived false- :collection_id (:id sample-collection-2)- :dataset_query {:database (mt/id)- :type :query- :query {:source-table (mt/id :venues)}}}]- (testing "returns true when there is a model not in any sample collection"- (let [response (mt/user-http-request :crowberto :get 200 "/ee/embedding-hub/checklist")]- (is (true? (get-in response [:checklist :create-models]))- "Should detect the user model with nil collection_id")))- (testing "returns false when all models are in sample collections"- ;; Temporarily archive the user model so only sample collection models remain active- (mt/with-temp-vals-in-db :model/Card (:id user-model) {:archived true}- (let [response (mt/user-http-request :crowberto :get 200 "/ee/embedding-hub/checklist")]- (is (false? (get-in response [:checklist :create-models]))- "Should exclude models in both sample collections"))))))))-(deftest has-user-created-tenants-test(testing "create-tenants returns true when there is an active tenant"(mt/with-premium-features #{:embedding}(mt/with-temp [:model/Tenant _ {:name "Test Tenant" :slug "test-tenant"}]- (let [response (mt/user-http-request :crowberto :get 200 "/ee/embedding-hub/checklist")]+ (let [response (mt/user-http-request :crowberto :get 200 "/embedding-hub/checklist")](is (true? (get-in response [:checklist :create-tenants])))))))(testing "create-tenants returns false when tenant is inactive"(mt/with-premium-features #{:embedding}(mt/with-temp [:model/Tenant _ {:name "Inactive Tenant":slug "inactive-tenant":is_active false}]- (let [response (mt/user-http-request :crowberto :get 200 "/ee/embedding-hub/checklist")]+ (let [response (mt/user-http-request :crowberto :get 200 "/embedding-hub/checklist")](is (false? (get-in response [:checklist :create-tenants])))))))(testing "create-tenants returns false when no tenants exist"(mt/with-premium-features #{:embedding}- (let [response (mt/user-http-request :crowberto :get 200 "/ee/embedding-hub/checklist")]+ (let [response (mt/user-http-request :crowberto :get 200 "/embedding-hub/checklist")](is (false? (get-in response [:checklist :create-tenants])))))))(deftest has-configured-data-segregation-strategy-test@@ -64,7 +27,7 @@(mt/with-temp [:model/PermissionsGroup {group-id :id} {}:model/Sandbox _ {:group_id group-id:table_id (mt/id :venues)}]- (let [response (mt/user-http-request :crowberto :get 200 "/ee/embedding-hub/checklist")]+ (let [response (mt/user-http-request :crowberto :get 200 "/embedding-hub/checklist")](is (true? (get-in response [:checklist :setup-data-segregation-strategy])))))))(testing "setup-data-segregation-strategy returns true when connection impersonation is configured"(mt/with-premium-features #{:embedding}@@ -72,17 +35,17 @@:model/ConnectionImpersonation _ {:db_id (mt/id):group_id group-id:attribute "test-attr"}]- (let [response (mt/user-http-request :crowberto :get 200 "/ee/embedding-hub/checklist")]+ (let [response (mt/user-http-request :crowberto :get 200 "/embedding-hub/checklist")](is (true? (get-in response [:checklist :setup-data-segregation-strategy])))))))(testing "setup-data-segregation-strategy returns true when database routing is configured"(mt/with-premium-features #{:embedding :database-routing}(mt/with-temp [:model/DatabaseRouter _ {:database_id (mt/id):user_attribute "test-attr"}]- (let [response (mt/user-http-request :crowberto :get 200 "/ee/embedding-hub/checklist")]+ (let [response (mt/user-http-request :crowberto :get 200 "/embedding-hub/checklist")](is (true? (get-in response [:checklist :setup-data-segregation-strategy])))))))(testing "setup-data-segregation-strategy returns false when none are configured"(mt/with-premium-features #{:embedding}- (let [response (mt/user-http-request :crowberto :get 200 "/ee/embedding-hub/checklist")]+ (let [response (mt/user-http-request :crowberto :get 200 "/embedding-hub/checklist")](is (false? (get-in response [:checklist :setup-data-segregation-strategy])))))))(deftest enable-tenants-requires-shared-collection-test@@ -91,12 +54,12 @@(mt/with-temporary-setting-values [use-tenants true](mt/with-temp [:model/Collection _ {:name "Shared collection":namespace "shared-tenant-collection"}]- (let [response (mt/user-http-request :crowberto :get 200 "/ee/embedding-hub/checklist")]+ (let [response (mt/user-http-request :crowberto :get 200 "/embedding-hub/checklist")](is (true? (get-in response [:checklist :enable-tenants]))))))))(testing "enable-tenants returns false when use-tenants is true but no shared tenant collections exist"(mt/with-premium-features #{:embedding :tenants}(mt/with-temporary-setting-values [use-tenants true]- (let [response (mt/user-http-request :crowberto :get 200 "/ee/embedding-hub/checklist")]+ (let [response (mt/user-http-request :crowberto :get 200 "/embedding-hub/checklist")](is (false? (get-in response [:checklist :enable-tenants]))))))))(deftest data-permissions-and-enable-tenants-test@@ -109,7 +72,7 @@:model/PermissionsGroup {group-id :id} {}:model/Sandbox _ {:group_id group-id:table_id (mt/id :venues)}]- (let [response (mt/user-http-request :crowberto :get 200 "/ee/embedding-hub/checklist")]+ (let [response (mt/user-http-request :crowberto :get 200 "/embedding-hub/checklist")](is (true? (get-in response [:checklist :data-permissions-and-enable-tenants]))))))))(testing "returns false when data segregation is not configured even if tenants are created"(mt/with-premium-features #{:embedding :tenants}@@ -117,7 +80,7 @@(mt/with-temp [:model/Collection _ {:name "Shared collection":namespace "shared-tenant-collection"}:model/Tenant _ {:name "Test Tenant" :slug "test-tenant"}]- (let [response (mt/user-http-request :crowberto :get 200 "/ee/embedding-hub/checklist")]+ (let [response (mt/user-http-request :crowberto :get 200 "/embedding-hub/checklist")](is (false? (get-in response [:checklist :data-permissions-and-enable-tenants]))))))))(testing "returns false when tenants are not created even if tenants and data segregation are configured"(mt/with-premium-features #{:embedding :sandboxes :tenants}@@ -127,14 +90,14 @@:model/PermissionsGroup {group-id :id} {}:model/Sandbox _ {:group_id group-id:table_id (mt/id :venues)}]- (let [response (mt/user-http-request :crowberto :get 200 "/ee/embedding-hub/checklist")]+ (let [response (mt/user-http-request :crowberto :get 200 "/embedding-hub/checklist")](is (false? (get-in response [:checklist :data-permissions-and-enable-tenants])))))))))(deftest move-dashboard-to-shared-checklist-test(mt/id) ;; force the app-db's own database row to exist so add-data resolves deterministically(mt/with-premium-features #{:embedding :tenants}(mt/with-temporary-setting-values [use-tenants true]- (let [ck (fn [k] (get-in (mt/user-http-request :crowberto :get 200 "/ee/embedding-hub/checklist") [:checklist k]))]+ (let [ck (fn [k] (get-in (mt/user-http-request :crowberto :get 200 "/embedding-hub/checklist") [:checklist k]))](is (false? (ck :move-dashboard-to-shared)))(mt/with-temp [:model/Collection {sc :id} {:namespace "shared-tenant-collection"}](is (false? (ck :move-dashboard-to-shared)))@@ -143,11 +106,8 @@(deftest setting-and-sso-checklist-test(mt/id) ;; force the app-db's own database row to exist so add-data resolves deterministically- (testing "402 without :embedding feature"- (mt/with-premium-features #{}- (mt/user-http-request :crowberto :get 402 "/ee/embedding-hub/checklist")))(mt/with-premium-features #{:embedding}- (let [ck (fn [k] (get-in (mt/user-http-request :crowberto :get 200 "/ee/embedding-hub/checklist") [:checklist k]))]+ (let [ck (fn [k] (get-in (mt/user-http-request :crowberto :get 200 "/embedding-hub/checklist") [:checklist k]))](testing "create-test-embed reflects a published guest embed"(mt/with-temp [:model/Card _ {:enable_embedding true}](is (true? (ck :create-test-embed)))))@@ -161,24 +121,24 @@(mt/with-temporary-setting-values [jwt-shared-secret "0123456789abcdef0123456789abcdef"jwt-identity-provider-uri "https://idp.example.com"jwt-enabled true]- (is (true? (get-in (mt/user-http-request :crowberto :get 200 "/ee/embedding-hub/checklist")+ (is (true? (get-in (mt/user-http-request :crowberto :get 200 "/embedding-hub/checklist")[:checklist :sso-configured])))))(mt/with-premium-features #{:embedding}(mt/with-temporary-setting-values [embedding-hub-sso-auth-manual-tested true]- (is (true? (get-in (mt/user-http-request :crowberto :get 200 "/ee/embedding-hub/checklist")+ (is (true? (get-in (mt/user-http-request :crowberto :get 200 "/embedding-hub/checklist")[:checklist :sso-auth-manual-tested]))))))(deftest data-isolation-strategy-test(testing "data-isolation-strategy is nil when no strategy is configured"(mt/with-premium-features #{:embedding}- (let [response (mt/user-http-request :crowberto :get 200 "/ee/embedding-hub/checklist")]+ (let [response (mt/user-http-request :crowberto :get 200 "/embedding-hub/checklist")](is (nil? (:data-isolation-strategy response))))))(testing "data-isolation-strategy is row-column-level-security when sandboxes are configured"(mt/with-premium-features #{:embedding :sandboxes}(mt/with-temp [:model/PermissionsGroup {group-id :id} {}:model/Sandbox _ {:group_id group-id:table_id (mt/id :venues)}]- (let [response (mt/user-http-request :crowberto :get 200 "/ee/embedding-hub/checklist")]+ (let [response (mt/user-http-request :crowberto :get 200 "/embedding-hub/checklist")](is (= "row-column-level-security" (:data-isolation-strategy response)))))))(testing "data-isolation-strategy is connection-impersonation when connection impersonation is configured"(mt/with-premium-features #{:embedding}@@ -186,11 +146,11 @@:model/ConnectionImpersonation _ {:db_id (mt/id):group_id group-id:attribute "test-attr"}]- (let [response (mt/user-http-request :crowberto :get 200 "/ee/embedding-hub/checklist")]+ (let [response (mt/user-http-request :crowberto :get 200 "/embedding-hub/checklist")](is (= "connection-impersonation" (:data-isolation-strategy response)))))))(testing "data-isolation-strategy is database-routing when database routing is configured"(mt/with-premium-features #{:embedding :database-routing}(mt/with-temp [:model/DatabaseRouter _ {:database_id (mt/id):user_attribute "test-attr"}]- (let [response (mt/user-http-request :crowberto :get 200 "/ee/embedding-hub/checklist")]+ (let [response (mt/user-http-request :crowberto :get 200 "/embedding-hub/checklist")](is (= "database-routing" (:data-isolation-strategy response))))))))diff --git a/enterprise/backend/test/metabase_enterprise/internal_stats/core_test.clj b/enterprise/backend/test/metabase_enterprise/internal_stats/core_test.cljindex 1aa126c6075..aff3f5a1a9a 100644--- a/enterprise/backend/test/metabase_enterprise/internal_stats/core_test.clj+++ b/enterprise/backend/test/metabase_enterprise/internal_stats/core_test.clj@@ -5,16 +5,16 @@[metabase.test :as mt]))(deftest enabled-embedding-static-test- (testing "true when enable embedding static is true and dashboard count is greater than 0"- (mt/with-temporary-setting-values [enable-embedding-static true]+ (testing "true when modular embedding is on and dashboard count is greater than 0"+ (mt/with-temporary-setting-values [enable-embedding-modular true](is (:enabled-embedding-static (sut/embedding-settings 1 0)))))- (testing "true when enable embedding static is true and question count is greater than 0"- (mt/with-temporary-setting-values [enable-embedding-static true]+ (testing "true when modular embedding is on and question count is greater than 0"+ (mt/with-temporary-setting-values [enable-embedding-modular true](is (:enabled-embedding-static (sut/embedding-settings 0 1)))))- (testing "false when enable embedding static is true and no cards are dashboards are enabled"+ (testing "false when modular embedding is on and no cards or dashboards are enabled"(is (not (:enabled-embedding-static (sut/embedding-settings 0 0)))))- (testing "false when enable embedding static is false"- (mt/with-temporary-setting-values [enable-embedding-static false]+ (testing "false when modular embedding is off"+ (mt/with-temporary-setting-values [enable-embedding-modular false](is (not (:enabled-embedding-static (sut/embedding-settings 1 1)))))))(def ^:private idp-cert (slurp "test_resources/sso/auth0-public-idp.cert"))@@ -63,16 +63,16 @@(is (:enabled-embedding-interactive (sut/embedding-settings 0 0)))))))))(deftest enabled-embedding-sdk- (testing "with sdk enabled and jwt enabled"- (mt/with-temporary-setting-values [enable-embedding-sdk true- jwt-shared-secret "asdfasdf"- jwt-enabled true]+ (testing "with modular embedding on and jwt enabled"+ (mt/with-temporary-setting-values [enable-embedding-modular true+ jwt-shared-secret "asdfasdf"+ jwt-enabled true](is (:enabled-embedding-sdk (sut/embedding-settings 0 0)))))- (testing "with sdk disabled and jwt enabled"- (mt/with-temporary-setting-values [enable-embedding-sdk false- jwt-enabled true]+ (testing "with modular embedding off and jwt enabled"+ (mt/with-temporary-setting-values [enable-embedding-modular false+ jwt-enabled true](is (not (:enabled-embedding-sdk (sut/embedding-settings 0 0))))))- (testing "with sdk enabled and jwt disabled"- (mt/with-temporary-setting-values [enable-embedding-sdk true- jwt-enabled false]+ (testing "with modular embedding on and jwt disabled"+ (mt/with-temporary-setting-values [enable-embedding-modular true+ jwt-enabled false](is (not (:enabled-embedding-sdk (sut/embedding-settings 0 0)))))))diff --git a/enterprise/backend/test/metabase_enterprise/sso/integrations/jwt_test.clj b/enterprise/backend/test/metabase_enterprise/sso/integrations/jwt_test.cljindex 0b7c1557384..3385a3e2834 100644--- a/enterprise/backend/test/metabase_enterprise/sso/integrations/jwt_test.clj+++ b/enterprise/backend/test/metabase_enterprise/sso/integrations/jwt_test.clj@@ -1053,7 +1053,7 @@(deftest jwt-token-sdk-idp-url-test(testing "should return IdP URL when embedding SDK header is present but no JWT token is provided"(with-jwt-default-setup!- (mt/with-temporary-setting-values [enable-embedding-sdk true]+ (mt/with-temporary-setting-values [enable-embedding-modular true](let [result (client/client-real-response:get 200 "/auth/sso"{:request-options {:headers {"x-metabase-client" "embedding-sdk-react"}}})]@@ -1064,7 +1064,7 @@(deftest jwt-token-sdk-session-token-test(testing "should return a session token when a JWT token and sdk headers are passed"(with-jwt-default-setup!- (mt/with-temporary-setting-values [enable-embedding-sdk true]+ (mt/with-temporary-setting-values [enable-embedding-modular true](let [jwt-iat-time (buddy-util/now)jwt-exp-time (+ (buddy-util/now) 3600)jwt-payload (jwt/sign@@ -1105,7 +1105,7 @@jwt-identity-provider-uri niljwt-shared-secret nilslack-connect-enabled false]- (mt/with-temporary-setting-values [enable-embedding-sdk true]+ (mt/with-temporary-setting-values [enable-embedding-modular true](let [jwt-iat-time (buddy-util/now)jwt-exp-time (+ (buddy-util/now) 3600)jwt-payload (jwt/sign@@ -1125,7 +1125,7 @@(deftest jwt-token-embedding-disabled-test(testing "should not return a session token when embedding is disabled"(with-jwt-default-setup!- (mt/with-temporary-setting-values [enable-embedding-sdk false]+ (mt/with-temporary-setting-values [enable-embedding-modular false](let [jwt-iat-time (buddy-util/now)jwt-exp-time (+ (buddy-util/now) 3600)jwt-payload (jwt/sign@@ -1145,7 +1145,7 @@(deftest jwt-token-no-hash-test(testing "should not return a session token when token=false"(with-jwt-default-setup!- (mt/with-temporary-setting-values [enable-embedding-sdk true]+ (mt/with-temporary-setting-values [enable-embedding-modular true](let [jwt-iat-time (buddy-util/now)jwt-exp-time (+ (buddy-util/now) 3600)jwt-payload (jwt/signdiff --git a/enterprise/frontend/src/embedding-sdk-ee/notifications/QuestionAlertsButton.unit.spec.tsx b/enterprise/frontend/src/embedding-sdk-ee/notifications/QuestionAlertsButton.unit.spec.tsxindex e6f997ee147..0c223403816 100644--- a/enterprise/frontend/src/embedding-sdk-ee/notifications/QuestionAlertsButton.unit.spec.tsx+++ b/enterprise/frontend/src/embedding-sdk-ee/notifications/QuestionAlertsButton.unit.spec.tsx@@ -55,7 +55,7 @@ function setup({ isGuestEmbed }: { isGuestEmbed: boolean }) {permissions: { can_access_subscription: true },}),settings: createMockSettingsState({- "enable-embedding-sdk": true,+ "enable-embedding-modular": true,"token-features": createMockTokenFeatures({embedding_sdk: true,advanced_permissions: false,diff --git a/enterprise/frontend/src/metabase-enterprise/advanced_permissions/reducer.ts b/enterprise/frontend/src/metabase-enterprise/advanced_permissions/reducer.tsindex 36cb558322b..849131984c8 100644--- a/enterprise/frontend/src/metabase-enterprise/advanced_permissions/reducer.ts+++ b/enterprise/frontend/src/metabase-enterprise/advanced_permissions/reducer.ts@@ -7,8 +7,8 @@ import {UPDATE_DATA_PERMISSION,} from "metabase/admin/permissions/permissions";import {- DATABASES_BASE_PATH,- GROUPS_BASE_PATH,+ getDatabasesBasePath,+ getGroupsBasePath,} from "metabase/admin/permissions/utils/urls";import { navigate } from "metabase/router";import {@@ -26,10 +26,10 @@ export const getImpersonatedPostAction = () =>view === "database"? navigate(- `${DATABASES_BASE_PATH}/${entityId.databaseId}/impersonated/group/${groupId}`,+ `${getDatabasesBasePath()}/${entityId.databaseId}/impersonated/group/${groupId}`,): navigate(- `${GROUPS_BASE_PATH}/${groupId}/impersonated/database/${entityId.databaseId}`,+ `${getGroupsBasePath()}/${groupId}/impersonated/database/${entityId.databaseId}`,);const UPDATE_IMPERSONATION =diff --git a/enterprise/frontend/src/metabase-enterprise/ai-controls/pages/MetabotCustomizationPage/MetabotCustomizationPage.tsx b/enterprise/frontend/src/metabase-enterprise/ai-controls/pages/MetabotCustomizationPage/MetabotCustomizationPage.tsxindex c8e81ad72d9..a1952aa7a5b 100644--- a/enterprise/frontend/src/metabase-enterprise/ai-controls/pages/MetabotCustomizationPage/MetabotCustomizationPage.tsx+++ b/enterprise/frontend/src/metabase-enterprise/ai-controls/pages/MetabotCustomizationPage/MetabotCustomizationPage.tsx@@ -1,11 +1,11 @@import { t } from "ttag";+import { useSelector } from "metabase/redux";+import { getApplicationName } from "metabase/selectors/whitelabel";import {SettingsPageWrapper,SettingsSection,-} from "metabase/admin/components/SettingsSection";-import { useSelector } from "metabase/redux";-import { getApplicationName } from "metabase/selectors/whitelabel";+} from "metabase/settings-components";import { TextInput } from "metabase/ui";import { useAdminSettingWithDebouncedInput } from "metabase-enterprise/ai-controls/hooks";diff --git a/enterprise/frontend/src/metabase-enterprise/ai-controls/pages/MetabotFeatureAccessPage/MetabotFeatureAccessPage.tsx b/enterprise/frontend/src/metabase-enterprise/ai-controls/pages/MetabotFeatureAccessPage/MetabotFeatureAccessPage.tsxindex 080ae6f6d7d..c99f5607321 100644--- a/enterprise/frontend/src/metabase-enterprise/ai-controls/pages/MetabotFeatureAccessPage/MetabotFeatureAccessPage.tsx+++ b/enterprise/frontend/src/metabase-enterprise/ai-controls/pages/MetabotFeatureAccessPage/MetabotFeatureAccessPage.tsx@@ -1,10 +1,10 @@import { useState } from "react";import { t } from "ttag";-import { SettingsPageWrapper } from "metabase/admin/components/SettingsSection";import { useListPermissionsGroupsQuery } from "metabase/api";import { LoadingAndErrorWrapper } from "metabase/common/components/LoadingAndErrorWrapper";import { useSetting } from "metabase/settings";+import { SettingsPageWrapper } from "metabase/settings-components";import { Group, Stack, Title } from "metabase/ui";import { AiFeatureAccessTable } from "./components/AiFeatureAccessTable";diff --git a/enterprise/frontend/src/metabase-enterprise/ai-controls/pages/MetabotSystemPromptsPage/MetabotSystemPromptsPage.tsx b/enterprise/frontend/src/metabase-enterprise/ai-controls/pages/MetabotSystemPromptsPage/MetabotSystemPromptsPage.tsxindex 3b9bc23077d..70c9fe59b31 100644--- a/enterprise/frontend/src/metabase-enterprise/ai-controls/pages/MetabotSystemPromptsPage/MetabotSystemPromptsPage.tsx+++ b/enterprise/frontend/src/metabase-enterprise/ai-controls/pages/MetabotSystemPromptsPage/MetabotSystemPromptsPage.tsx@@ -1,8 +1,8 @@import { t } from "ttag";-import { SettingsPageWrapper } from "metabase/admin/components/SettingsSection";import { useSelector } from "metabase/redux";import { getApplicationName } from "metabase/selectors/whitelabel";+import { SettingsPageWrapper } from "metabase/settings-components";import { Textarea } from "metabase/ui";import { useAdminSettingWithBlurInput } from "metabase-enterprise/ai-controls/hooks";diff --git a/enterprise/frontend/src/metabase-enterprise/ai-controls/pages/MetabotUsageLimitsPage/GeneralLimitsSettingsSection.tsx b/enterprise/frontend/src/metabase-enterprise/ai-controls/pages/MetabotUsageLimitsPage/GeneralLimitsSettingsSection.tsxindex fce18124bf8..28dff457044 100644--- a/enterprise/frontend/src/metabase-enterprise/ai-controls/pages/MetabotUsageLimitsPage/GeneralLimitsSettingsSection.tsx+++ b/enterprise/frontend/src/metabase-enterprise/ai-controls/pages/MetabotUsageLimitsPage/GeneralLimitsSettingsSection.tsx@@ -1,6 +1,6 @@import { t } from "ttag";-import { SettingsSection } from "metabase/admin/components/SettingsSection";+import { SettingsSection } from "metabase/settings-components";import {NumberInput,SegmentedControl,diff --git a/enterprise/frontend/src/metabase-enterprise/ai-controls/pages/MetabotUsageLimitsPage/GroupLimitsSettingsSection/GroupLimitsSettingsSection.tsx b/enterprise/frontend/src/metabase-enterprise/ai-controls/pages/MetabotUsageLimitsPage/GroupLimitsSettingsSection/GroupLimitsSettingsSection.tsxindex 14d2f83fb1e..17b6a8a38b1 100644--- a/enterprise/frontend/src/metabase-enterprise/ai-controls/pages/MetabotUsageLimitsPage/GroupLimitsSettingsSection/GroupLimitsSettingsSection.tsx+++ b/enterprise/frontend/src/metabase-enterprise/ai-controls/pages/MetabotUsageLimitsPage/GroupLimitsSettingsSection/GroupLimitsSettingsSection.tsx@@ -1,11 +1,11 @@import { useMemo, useState } from "react";import { t } from "ttag";-import { SettingsSection } from "metabase/admin/components/SettingsSection";import { useListPermissionsGroupsQuery } from "metabase/api";import { isDefaultGroup } from "metabase/common/utils/groups";import { PLUGIN_TENANTS } from "metabase/plugins";import { useSetting } from "metabase/settings";+import { SettingsSection } from "metabase/settings-components";import { Tabs } from "metabase/ui";import {useGetAIControlsGroupLimitsQuery,diff --git a/enterprise/frontend/src/metabase-enterprise/ai-controls/pages/MetabotUsageLimitsPage/MetabotUsageLimitsPage.tsx b/enterprise/frontend/src/metabase-enterprise/ai-controls/pages/MetabotUsageLimitsPage/MetabotUsageLimitsPage.tsxindex f728d406c6b..4596a45f466 100644--- a/enterprise/frontend/src/metabase-enterprise/ai-controls/pages/MetabotUsageLimitsPage/MetabotUsageLimitsPage.tsx+++ b/enterprise/frontend/src/metabase-enterprise/ai-controls/pages/MetabotUsageLimitsPage/MetabotUsageLimitsPage.tsx@@ -1,6 +1,6 @@import { t } from "ttag";-import { SettingsPageWrapper } from "metabase/admin/components/SettingsSection";+import { SettingsPageWrapper } from "metabase/settings-components";import { GeneralLimitsSettingsSection } from "./GeneralLimitsSettingsSection";import { GroupLimitsSettingsSection } from "./GroupLimitsSettingsSection";diff --git a/enterprise/frontend/src/metabase-enterprise/api/tenants.ts b/enterprise/frontend/src/metabase-enterprise/api/tenants.tsindex a4f07b6f6aa..369a8a52933 100644--- a/enterprise/frontend/src/metabase-enterprise/api/tenants.ts+++ b/enterprise/frontend/src/metabase-enterprise/api/tenants.ts@@ -18,7 +18,7 @@ export const tenantsApi = EnterpriseApi.injectEndpoints({invalidatesTags: (_, error) =>invalidateTags(error, [listTag("tenant"),- listTag("embedding-hub-checklist"),+ listTag("setup-guide-checklist"),]),}),getTenant: builder.query<Tenant, Tenant["id"]>({diff --git a/enterprise/frontend/src/metabase-enterprise/audit_app/index.tsx b/enterprise/frontend/src/metabase-enterprise/audit_app/index.tsxindex 2f9f459a02d..079497dfff5 100644--- a/enterprise/frontend/src/metabase-enterprise/audit_app/index.tsx+++ b/enterprise/frontend/src/metabase-enterprise/audit_app/index.tsx@@ -8,7 +8,7 @@ import {PLUGIN_AUDIT,} from "metabase/plugins";import { Menu } from "metabase/ui";-import { isInternalUser } from "metabase/urls";+import * as Urls from "metabase/urls";import { handleMetabotSlashCommand } from "metabase-enterprise/monitor/ai-auditing/metabot-analytics/slash-commands";import {getAiAuditingRoutes,@@ -27,11 +27,7 @@ import { isAuditDb } from "./utils";const getUserMenuItems = (user: User): React.ReactNode => [<Menu.Itemcomponent={ForwardRefLink}- to={- isInternalUser(user)- ? `/admin/people/${user.id}/unsubscribe`- : `/admin/people/tenants/people/${user.id}/unsubscribe`- }+ to={Urls.unsubscribeUser(user)}key="unsubscribe">{t`Unsubscribe from all subscriptions / alerts`}diff --git a/enterprise/frontend/src/metabase-enterprise/auth/components/AuthSettingsPage.tsx b/enterprise/frontend/src/metabase-enterprise/auth/components/AuthSettingsPage.tsxindex 031ee06660e..82d4fe60d25 100644--- a/enterprise/frontend/src/metabase-enterprise/auth/components/AuthSettingsPage.tsx+++ b/enterprise/frontend/src/metabase-enterprise/auth/components/AuthSettingsPage.tsx@@ -1,18 +1,18 @@import { t } from "ttag";-import {- SettingsPageWrapper,- SettingsSection,-} from "metabase/admin/components/SettingsSection";import { GoogleAuthCard } from "metabase/admin/settings/auth/containers/GoogleAuthCard";import { LdapAuthCard } from "metabase/admin/settings/auth/containers/LdapAuthCard";import { ManageApiKeys } from "metabase/admin/settings/components/ApiKeys/ManageApiKeys";-import { AdminSettingInput } from "metabase/admin/settings/components/widgets/AdminSettingInput";import { useHasTokenFeature } from "metabase/common/hooks";import {type AuthSettingsPageProps,PLUGIN_AUTH_PROVIDERS,} from "metabase/plugins";+import {+ AdminSettingInput,+ SettingsPageWrapper,+ SettingsSection,+} from "metabase/settings-components";import { AdminAuthCard } from "metabase-enterprise/multi_factor_auth/components/AdminAuthCard";import { JwtAuthCard } from "../containers/JwtAuthCard";diff --git a/enterprise/frontend/src/metabase-enterprise/auth/components/SessionTimeoutSetting/SessionTimeoutSetting.tsx b/enterprise/frontend/src/metabase-enterprise/auth/components/SessionTimeoutSetting/SessionTimeoutSetting.tsxindex b595db2e4ac..a8de70fd16b 100644--- a/enterprise/frontend/src/metabase-enterprise/auth/components/SessionTimeoutSetting/SessionTimeoutSetting.tsx+++ b/enterprise/frontend/src/metabase-enterprise/auth/components/SessionTimeoutSetting/SessionTimeoutSetting.tsx@@ -1,11 +1,13 @@import { useEffect, useState } from "react";import { t } from "ttag";-import { SettingHeader } from "metabase/admin/settings/components/SettingHeader";-import { BasicAdminSettingInput } from "metabase/admin/settings/components/widgets/AdminSettingInput";import { SetByEnvVar } from "metabase/common/components/SetByEnvVar";import { useHasTokenFeature } from "metabase/common/hooks";import { useAdminSetting } from "metabase/settings";+import {+ BasicAdminSettingInput,+ SettingHeader,+} from "metabase/settings-components";import { Flex, Select, Stack, Text, TextInput } from "metabase/ui";import type { TimeoutValue } from "metabase-types/api";diff --git a/enterprise/frontend/src/metabase-enterprise/auth/components/SettingsJWTForm/SettingsJWTForm.tsx b/enterprise/frontend/src/metabase-enterprise/auth/components/SettingsJWTForm/SettingsJWTForm.tsxindex 9063d67f959..492c6f48632 100644--- a/enterprise/frontend/src/metabase-enterprise/auth/components/SettingsJWTForm/SettingsJWTForm.tsx+++ b/enterprise/frontend/src/metabase-enterprise/auth/components/SettingsJWTForm/SettingsJWTForm.tsx@@ -1,14 +1,6 @@import { t } from "ttag";import _ from "underscore";-import {- CollapsibleSettingsSection,- SETTINGS_CARD_DESCRIPTION_PROPS,- SETTINGS_CARD_STACK_PROPS,- SETTINGS_CARD_TITLE_PROPS,- SettingsPageWrapper,- SettingsSection,-} from "metabase/admin/components/SettingsSection";import { getExtraFormFieldProps } from "metabase/admin/settings/utils";import { LeaveRouteConfirmModal } from "metabase/common/components/LeaveConfirmModal";import { LoadingAndErrorWrapper } from "metabase/common/components/LoadingAndErrorWrapper";@@ -21,12 +13,21 @@ import {FormSubmitButton,FormTextInput,} from "metabase/forms";+import type { SettingsJWTFormProps } from "metabase/plugins";import { useSelector } from "metabase/redux";import { getApplicationName } from "metabase/selectors/whitelabel";import {useAdminSetting,useGetAdminSettingsDetailsQuery,} from "metabase/settings";+import {+ CollapsibleSettingsSection,+ SETTINGS_CARD_DESCRIPTION_PROPS,+ SETTINGS_CARD_STACK_PROPS,+ SETTINGS_CARD_TITLE_PROPS,+ SettingsPageWrapper,+ SettingsSection,+} from "metabase/settings-components";import { Box, Flex, Stack } from "metabase/ui";import { UserProvisioningSection } from "metabase-enterprise/auth/components/UserProvisioningSection";import type {@@ -62,7 +63,9 @@ export type JWTFormValues = Pick<| "jwt-attribute-tenant">;-export const SettingsJWTForm = () => {+export const SettingsJWTForm = ({+ title = t`JWT`,+}: SettingsJWTFormProps = {}) => {const {data: settingDetails,isLoading: isLoadingDetails,@@ -140,7 +143,7 @@ export const SettingsJWTForm = () => {);return (- <SettingsPageWrapper title={t`JWT`}>+ <SettingsPageWrapper title={title}><FormProviderinitialValues={getFormValues(settingDetails)}onSubmit={saveSettings}diff --git a/enterprise/frontend/src/metabase-enterprise/auth/components/SettingsJWTForm/SettingsJWTForm.unit.spec.tsx b/enterprise/frontend/src/metabase-enterprise/auth/components/SettingsJWTForm/SettingsJWTForm.unit.spec.tsxindex 18d194efee9..cf70d7354e7 100644--- a/enterprise/frontend/src/metabase-enterprise/auth/components/SettingsJWTForm/SettingsJWTForm.unit.spec.tsx+++ b/enterprise/frontend/src/metabase-enterprise/auth/components/SettingsJWTForm/SettingsJWTForm.unit.spec.tsx@@ -21,6 +21,9 @@ import { createMockGroup, createMockSettings } from "metabase-types/api/mocks";import { SettingsJWTForm } from "./SettingsJWTForm";+const GENERATED_TOKEN =+ "590ab155f412d477b8ab9c8b0e7b2e3ab4d4523e83770a724a2088edbde7f19a";+const GROUPS = [createMockGroup(),createMockGroup({ id: 2, name: "Administrators", magic_group_type: "admin" }),@@ -191,7 +194,7 @@ const setup = async ({{ name: "update-setting", delay: provisioningSaveDelayMs },);}- setupGenerateRandomTokenEndpoint("1234abcd");+ setupGenerateRandomTokenEndpoint(GENERATED_TOKEN);fetchMock.get("path:/api/permissions/group", GROUPS);fetchMock.put(@@ -236,8 +239,7 @@ const findMappingRow = (name: string) =>describe("SettingsJWTForm", () => {const ATTRS = {"jwt-identity-provider-uri": "http://example.com",- "jwt-shared-secret":- "590ab155f412d477b8ab9c8b0e7b2e3ab4d4523e83770a724a2088edbde7f19a",+ "jwt-shared-secret": GENERATED_TOKEN,"jwt-attribute-email": "[email protected]","jwt-attribute-firstname": "John","jwt-attribute-lastname": "Doe",@@ -254,12 +256,12 @@ describe("SettingsJWTForm", () => {await userEvent.click(await screen.findByRole("button", { name: /Set up key/ }),);- await userEvent.clear(await screen.findByLabelText(/New secret key/));- await userEvent.type(- await screen.findByLabelText(/New secret key/),- ATTRS["jwt-shared-secret"],+ expect(await screen.findByLabelText("New secret key")).toHaveValue(+ GENERATED_TOKEN,+ );+ await userEvent.click(+ await screen.findByRole("button", { name: "Create" }),);- await userEvent.click(await screen.findByRole("button", { name: /Done/ }));};it("saves the server settings, turns automatic on and enables the other cards", async () => {diff --git a/enterprise/frontend/src/metabase-enterprise/auth/components/SettingsOIDCForm/SettingsOIDCForm.tsx b/enterprise/frontend/src/metabase-enterprise/auth/components/SettingsOIDCForm/SettingsOIDCForm.tsxindex 12408b2b674..18e3556aa54 100644--- a/enterprise/frontend/src/metabase-enterprise/auth/components/SettingsOIDCForm/SettingsOIDCForm.tsx+++ b/enterprise/frontend/src/metabase-enterprise/auth/components/SettingsOIDCForm/SettingsOIDCForm.tsx@@ -3,14 +3,6 @@ import { useCallback, useEffect, useMemo, useRef } from "react";import { t } from "ttag";import * as Yup from "yup";-import {- CollapsibleSettingsSection,- SETTINGS_CARD_DESCRIPTION_PROPS,- SETTINGS_CARD_STACK_PROPS,- SETTINGS_CARD_TITLE_PROPS,- SettingsPageWrapper,- SettingsSection,-} from "metabase/admin/components/SettingsSection";import { GroupMappingsWidgetView } from "metabase/admin/settings/components/widgets/GroupMappingsWidget/GroupMappingsWidgetView";import { SETTINGS_FIELD_DESCRIPTION_PROPS } from "metabase/admin/settings/utils";import {@@ -32,6 +24,14 @@ import {import { useSelector } from "metabase/redux";import { getApplicationName } from "metabase/selectors/whitelabel";import { useSetting } from "metabase/settings";+import {+ CollapsibleSettingsSection,+ SETTINGS_CARD_DESCRIPTION_PROPS,+ SETTINGS_CARD_STACK_PROPS,+ SETTINGS_CARD_TITLE_PROPS,+ SettingsPageWrapper,+ SettingsSection,+} from "metabase/settings-components";import { Button, Flex, Stack } from "metabase/ui";import {type CustomOidcConfig,diff --git a/enterprise/frontend/src/metabase-enterprise/auth/components/SettingsSAMLForm/SettingsSAMLForm.tsx b/enterprise/frontend/src/metabase-enterprise/auth/components/SettingsSAMLForm/SettingsSAMLForm.tsxindex f839dff048b..c84bbd71e5a 100644--- a/enterprise/frontend/src/metabase-enterprise/auth/components/SettingsSAMLForm/SettingsSAMLForm.tsx+++ b/enterprise/frontend/src/metabase-enterprise/auth/components/SettingsSAMLForm/SettingsSAMLForm.tsx@@ -3,14 +3,6 @@ import { jt, t } from "ttag";import _ from "underscore";import * as Yup from "yup";-import {- CollapsibleSettingsSection,- SETTINGS_CARD_DESCRIPTION_PROPS,- SETTINGS_CARD_STACK_PROPS,- SETTINGS_CARD_TITLE_PROPS,- SettingsPageWrapper,- SettingsSection,-} from "metabase/admin/components/SettingsSection";import { GroupMappingsWidget } from "metabase/admin/settings/components/widgets/GroupMappingsWidget";import {SETTINGS_FIELD_DESCRIPTION_PROPS,@@ -36,6 +28,14 @@ import {useGetSettingsQuery,useSetting,} from "metabase/settings";+import {+ CollapsibleSettingsSection,+ SETTINGS_CARD_DESCRIPTION_PROPS,+ SETTINGS_CARD_STACK_PROPS,+ SETTINGS_CARD_TITLE_PROPS,+ SettingsPageWrapper,+ SettingsSection,+} from "metabase/settings-components";import { Flex, Stack, Text, Title } from "metabase/ui";import { useUpdateSamlMutation } from "metabase-enterprise/api";import { UserProvisioningSection } from "metabase-enterprise/auth/components/UserProvisioningSection";diff --git a/enterprise/frontend/src/metabase-enterprise/auth/components/UserProvisioningSection/UserProvisioningSection.tsx b/enterprise/frontend/src/metabase-enterprise/auth/components/UserProvisioningSection/UserProvisioningSection.tsxindex b26c55a3de8..260a246a760 100644--- a/enterprise/frontend/src/metabase-enterprise/auth/components/UserProvisioningSection/UserProvisioningSection.tsx+++ b/enterprise/frontend/src/metabase-enterprise/auth/components/UserProvisioningSection/UserProvisioningSection.tsx@@ -3,14 +3,14 @@ import cx from "classnames";import { useEffect, useId, useState } from "react";import { t } from "ttag";+import { useSelector } from "metabase/redux";+import { getApplicationName } from "metabase/selectors/whitelabel";+import { useAdminSetting } from "metabase/settings";import {SETTINGS_CARD_DESCRIPTION_PROPS,SETTINGS_CARD_TITLE_PROPS,SettingsSection,-} from "metabase/admin/components/SettingsSection";-import { useSelector } from "metabase/redux";-import { getApplicationName } from "metabase/selectors/whitelabel";-import { useAdminSetting } from "metabase/settings";+} from "metabase/settings-components";import { Box, Flex, Switch, Text, Title } from "metabase/ui";import S from "./UserProvisioningSection.module.css";diff --git a/enterprise/frontend/src/metabase-enterprise/caching/components/DatabaseCachingEditor.tsx b/enterprise/frontend/src/metabase-enterprise/caching/components/DatabaseCachingEditor.tsxindex 72baa485523..df7f52dd374 100644--- a/enterprise/frontend/src/metabase-enterprise/caching/components/DatabaseCachingEditor.tsx+++ b/enterprise/frontend/src/metabase-enterprise/caching/components/DatabaseCachingEditor.tsx@@ -3,7 +3,6 @@ import { useCallback, useMemo, useState } from "react";import { t } from "ttag";import { findWhere } from "underscore";-import { SettingsPageWrapper } from "metabase/admin/components/SettingsSection";import { PerformancePageContent } from "metabase/admin/performance/components/PerformancePageContent";import { StrategyForm } from "metabase/admin/performance/components/StrategyForm";import {@@ -24,6 +23,7 @@ import { DelayedLoadingAndErrorWrapper } from "metabase/common/components/Loadinimport { useConfirmation } from "metabase/common/hooks/use-confirmation";import { useDispatch } from "metabase/redux";import { addUndo } from "metabase/redux/undo";+import { SettingsPageWrapper } from "metabase/settings-components";import { ActionIcon, Center, Flex, Icon, Text, Tooltip } from "metabase/ui";import type { Database } from "metabase-types/api";diff --git a/enterprise/frontend/src/metabase-enterprise/caching/components/StrategyEditorForQuestionsAndDashboards/StrategyEditorForQuestionsAndDashboards.tsx b/enterprise/frontend/src/metabase-enterprise/caching/components/StrategyEditorForQuestionsAndDashboards/StrategyEditorForQuestionsAndDashboards.tsxindex c2c8c2bdf32..0876c9a71f9 100644--- a/enterprise/frontend/src/metabase-enterprise/caching/components/StrategyEditorForQuestionsAndDashboards/StrategyEditorForQuestionsAndDashboards.tsx+++ b/enterprise/frontend/src/metabase-enterprise/caching/components/StrategyEditorForQuestionsAndDashboards/StrategyEditorForQuestionsAndDashboards.tsx@@ -3,7 +3,6 @@ import { useCallback, useEffect, useMemo, useState } from "react";import { t } from "ttag";import _ from "underscore";-import { SettingsPageWrapper } from "metabase/admin/components/SettingsSection";import { PerformancePageContent } from "metabase/admin/performance/components/PerformancePageContent";import { StrategyForm } from "metabase/admin/performance/components/StrategyForm";import {@@ -19,6 +18,7 @@ import { DelayedLoadingAndErrorWrapper } from "metabase/common/components/Loadinimport { PaginationControls } from "metabase/common/components/PaginationControls";import { usePagination } from "metabase/common/hooks/use-pagination";import { useGetIcon } from "metabase/hooks/use-icon";+import { SettingsPageWrapper } from "metabase/settings-components";import { Center, Flex, Text } from "metabase/ui";import type { CacheableModel } from "metabase-types/api";diff --git a/enterprise/frontend/src/metabase-enterprise/content_translation/components/ContentTranslationConfiguration/ContentTranslationConfiguration.tsx b/enterprise/frontend/src/metabase-enterprise/content_translation/components/ContentTranslationConfiguration/ContentTranslationConfiguration.tsxindex e7dcfb14178..35191aabdc7 100644--- a/enterprise/frontend/src/metabase-enterprise/content_translation/components/ContentTranslationConfiguration/ContentTranslationConfiguration.tsx+++ b/enterprise/frontend/src/metabase-enterprise/content_translation/components/ContentTranslationConfiguration/ContentTranslationConfiguration.tsx@@ -12,7 +12,6 @@ import {import { c, msgid, ngettext, t } from "ttag";import ErrorBoundary from "metabase/ErrorBoundary";-import { SettingsSection } from "metabase/admin/components/SettingsSection";import { ExternalLink } from "metabase/common/components/ExternalLink";import { Markdown } from "metabase/common/components/Markdown";import { UploadInput } from "metabase/common/components/upload";@@ -24,6 +23,7 @@ import {FormSubmitButton,useFormContext,} from "metabase/forms";+import { SettingsSection } from "metabase/settings-components";import {Button,Group,diff --git a/enterprise/frontend/src/metabase-enterprise/custom_viz/components/AddDevCustomVizForm.tsx b/enterprise/frontend/src/metabase-enterprise/custom_viz/components/AddDevCustomVizForm.tsxindex a5f146289f7..5bca660626b 100644--- a/enterprise/frontend/src/metabase-enterprise/custom_viz/components/AddDevCustomVizForm.tsx+++ b/enterprise/frontend/src/metabase-enterprise/custom_viz/components/AddDevCustomVizForm.tsx@@ -1,7 +1,6 @@import { useCallback } from "react";import { t } from "ttag";-import { SettingsSection } from "metabase/admin/components/SettingsSection";import {Form,FormErrorMessage,@@ -9,6 +8,7 @@ import {FormSubmitButton,FormTextInput,} from "metabase/forms";+import { SettingsSection } from "metabase/settings-components";import { Group, Stack } from "metabase/ui";import { useCreateDevCustomVizPluginMutation } from "metabase-enterprise/api";diff --git a/enterprise/frontend/src/metabase-enterprise/custom_viz/components/CustomVizDevPage.tsx b/enterprise/frontend/src/metabase-enterprise/custom_viz/components/CustomVizDevPage.tsxindex ace78980d2b..99d969dab74 100644--- a/enterprise/frontend/src/metabase-enterprise/custom_viz/components/CustomVizDevPage.tsx+++ b/enterprise/frontend/src/metabase-enterprise/custom_viz/components/CustomVizDevPage.tsx@@ -1,8 +1,8 @@import { useMemo } from "react";import { t } from "ttag";-import { SettingsPageWrapper } from "metabase/admin/components/SettingsSection";import { LoadingAndErrorWrapper } from "metabase/common/components/LoadingAndErrorWrapper";+import { SettingsPageWrapper } from "metabase/settings-components";import { useListAllCustomVizPluginsQuery } from "metabase-enterprise/api";import { AddDevCustomVizForm } from "./AddDevCustomVizForm";diff --git a/enterprise/frontend/src/metabase-enterprise/custom_viz/components/CustomVizPage.tsx b/enterprise/frontend/src/metabase-enterprise/custom_viz/components/CustomVizPage.tsxindex 45dd8a3cb01..a2c06ceb072 100644--- a/enterprise/frontend/src/metabase-enterprise/custom_viz/components/CustomVizPage.tsx+++ b/enterprise/frontend/src/metabase-enterprise/custom_viz/components/CustomVizPage.tsx@@ -2,10 +2,6 @@ import { useCallback, useEffect } from "react";import { jt, t } from "ttag";import * as Yup from "yup";-import {- SettingsPageWrapper,- SettingsSection,-} from "metabase/admin/components/SettingsSection";import { ExternalLink } from "metabase/common/components/ExternalLink";import { useDocsUrl } from "metabase/common/hooks";import {@@ -15,6 +11,10 @@ import {FormSubmitButton,} from "metabase/forms";import { useNavigate } from "metabase/router";+import {+ SettingsPageWrapper,+ SettingsSection,+} from "metabase/settings-components";import {Box,Button,diff --git a/enterprise/frontend/src/metabase-enterprise/custom_viz/components/EditDevCustomVizForm.tsx b/enterprise/frontend/src/metabase-enterprise/custom_viz/components/EditDevCustomVizForm.tsxindex f61c74b2c51..f4bfb051d4a 100644--- a/enterprise/frontend/src/metabase-enterprise/custom_viz/components/EditDevCustomVizForm.tsx+++ b/enterprise/frontend/src/metabase-enterprise/custom_viz/components/EditDevCustomVizForm.tsx@@ -2,7 +2,6 @@ import { useCallback, useMemo } from "react";import { match } from "ts-pattern";import { t } from "ttag";-import { SettingsSection } from "metabase/admin/components/SettingsSection";import {Form,FormErrorMessage,@@ -10,6 +9,7 @@ import {FormSubmitButton,FormTextInput,} from "metabase/forms";+import { SettingsSection } from "metabase/settings-components";import { Button, Group, Icon, Stack, Text } from "metabase/ui";import {useDeleteCustomVizPluginMutation,diff --git a/enterprise/frontend/src/metabase-enterprise/custom_viz/components/ManageCustomVizPage.tsx b/enterprise/frontend/src/metabase-enterprise/custom_viz/components/ManageCustomVizPage.tsxindex 027aa1ef8f6..a02732ecb01 100644--- a/enterprise/frontend/src/metabase-enterprise/custom_viz/components/ManageCustomVizPage.tsx+++ b/enterprise/frontend/src/metabase-enterprise/custom_viz/components/ManageCustomVizPage.tsx@@ -1,10 +1,10 @@import { useCallback, useMemo } from "react";import { t } from "ttag";-import { SettingsPageWrapper } from "metabase/admin/components/SettingsSection";import { Link } from "metabase/common/components/Link";import { useHasTokenFeature } from "metabase/common/hooks";import { useAdminSetting } from "metabase/settings";+import { SettingsPageWrapper } from "metabase/settings-components";import {ActionIcon,Box,diff --git a/enterprise/frontend/src/metabase-enterprise/data_apps/admin/ManageDataAppUsersPage.tsx b/enterprise/frontend/src/metabase-enterprise/data_apps/admin/ManageDataAppUsersPage.tsxindex 43b8ba53d5f..812187e687b 100644--- a/enterprise/frontend/src/metabase-enterprise/data_apps/admin/ManageDataAppUsersPage.tsx+++ b/enterprise/frontend/src/metabase-enterprise/data_apps/admin/ManageDataAppUsersPage.tsx@@ -3,7 +3,6 @@ import { useMemo, useState } from "react";import { t } from "ttag";import { AdminPaneLayout } from "metabase/admin/components/AdminPaneLayout";-import { SettingsPageWrapper } from "metabase/admin/components/SettingsSection";import {useCreateMembershipMutation,useDeleteMembershipMutation,@@ -14,6 +13,7 @@ import { LoadingAndErrorWrapper } from "metabase/common/components/LoadingAndErrimport { useToast } from "metabase/common/hooks";import { isApiKeyGroupMember } from "metabase/common/utils/groups";import { useParams } from "metabase/router";+import { SettingsPageWrapper } from "metabase/settings-components";import { Box, Button, Stack, Text } from "metabase/ui";import { useGetDataAppQuery } from "metabase-enterprise/api";import type { Group, Member } from "metabase-types/api";diff --git a/enterprise/frontend/src/metabase-enterprise/data_apps/admin/ManageDataAppsPage.tsx b/enterprise/frontend/src/metabase-enterprise/data_apps/admin/ManageDataAppsPage.tsxindex 708ad5c3ca8..08d9516255b 100644--- a/enterprise/frontend/src/metabase-enterprise/data_apps/admin/ManageDataAppsPage.tsx+++ b/enterprise/frontend/src/metabase-enterprise/data_apps/admin/ManageDataAppsPage.tsx@@ -3,7 +3,7 @@ import { t } from "ttag";import {SettingsPageWrapper,SettingsSection,-} from "metabase/admin/components/SettingsSection";+} from "metabase/settings-components";import { Badge, Box, Flex, Group, Loader, Stack, Title } from "metabase/ui";import {useGetDataAppRepoStatusQuery,diff --git a/enterprise/frontend/src/metabase-enterprise/embedding/components/InteractiveEmbeddingAuthorizedOriginsWidget/InteractiveEmbeddingAuthorizedOriginsWidget.tsx b/enterprise/frontend/src/metabase-enterprise/embedding/components/InteractiveEmbeddingAuthorizedOriginsWidget/InteractiveEmbeddingAuthorizedOriginsWidget.tsxindex 5e06cdbb3fd..fb0ea8de407 100644--- a/enterprise/frontend/src/metabase-enterprise/embedding/components/InteractiveEmbeddingAuthorizedOriginsWidget/InteractiveEmbeddingAuthorizedOriginsWidget.tsx+++ b/enterprise/frontend/src/metabase-enterprise/embedding/components/InteractiveEmbeddingAuthorizedOriginsWidget/InteractiveEmbeddingAuthorizedOriginsWidget.tsx@@ -1,9 +1,9 @@import cx from "classnames";import { jt, t } from "ttag";-import { AdminSettingInput } from "metabase/admin/settings/components/widgets/AdminSettingInput";import { ExternalLink } from "metabase/common/components/ExternalLink";import CS from "metabase/css/core/index.css";+import { AdminSettingInput } from "metabase/settings-components";const Description = () => {return jt`Enter the origins for the websites or web apps where you want to allow embedding, separated by a space. Here are the ${(@@ -20,7 +20,7 @@ const Description = () => {export const InteractiveEmbeddingAuthorizedOriginsWidget = () => (<AdminSettingInputname="embedding-app-origins-interactive"- title={t`Authorized origins`}+ title={t`Authorized origins for full-app embedding`}description={<Description />}placeholder="https://*.example.com"inputType="text"diff --git a/enterprise/frontend/src/metabase-enterprise/embedding/components/InteractiveEmbeddingSettingsCard.tsx b/enterprise/frontend/src/metabase-enterprise/embedding/components/InteractiveEmbeddingSettingsCard.tsxdeleted file mode 100644index 8cf5eea67d4..00000000000--- a/enterprise/frontend/src/metabase-enterprise/embedding/components/InteractiveEmbeddingSettingsCard.tsx+++ /dev/null@@ -1,38 +0,0 @@-import { t } from "ttag";--import { EmbeddingSettingsCard } from "metabase/admin/settings/components/EmbeddingSettings";-import { useDocsUrl } from "metabase/common/hooks";-import { useSetting } from "metabase/settings";-import { Stack } from "metabase/ui/components";-import { InteractiveEmbeddingAuthorizedOriginsWidget } from "metabase-enterprise/embedding/components/InteractiveEmbeddingAuthorizedOriginsWidget";--export function InteractiveEmbeddingSettingsCard() {- const isInteractiveEmbeddingEnabled = useSetting(- "enable-embedding-interactive",- );-- const fullAppEmbeddingDocumentationUrl = useDocsUrl(- "embedding/full-app-embedding",- );-- return (- <EmbeddingSettingsCard- title={t`Enable full app embedding`}- description={t`Embed the full Metabase application or individual pages into your app. Best for complex, BI-focused scenarios where you want to embed all of Metabase's capabilities into your app. If you are looking for stability of UX, flexibility or control, or don't have a complex use case that requires a full-blown BI solution, we recommend using Modular embedding instead.`}- settingKey="enable-embedding-interactive"- links={[- {- icon: "reference",- title: t`Documentation`,- href: fullAppEmbeddingDocumentationUrl.url,- },- ]}- >- {isInteractiveEmbeddingEnabled && (- <Stack gap="xxl" px="xxl" pb="xl">- <InteractiveEmbeddingAuthorizedOriginsWidget />- </Stack>- )}- </EmbeddingSettingsCard>- );-}diff --git a/enterprise/frontend/src/metabase-enterprise/embedding/components/InteractiveEmbeddingSettingsCard.unit.spec.tsx b/enterprise/frontend/src/metabase-enterprise/embedding/components/InteractiveEmbeddingSettingsCard.unit.spec.tsxdeleted file mode 100644index 65e29f12cfd..00000000000--- a/enterprise/frontend/src/metabase-enterprise/embedding/components/InteractiveEmbeddingSettingsCard.unit.spec.tsx+++ /dev/null@@ -1,85 +0,0 @@-import userEvent from "@testing-library/user-event";--import {- findRequests,- setupPropertiesEndpoints,- setupSettingsEndpoints,- setupUpdateSettingEndpoint,- setupUpdateSettingsEndpoint,- setupUserKeyValueEndpoints,-} from "__support__/server-mocks";-import { fireEvent, renderWithProviders, screen } from "__support__/ui";-import { createMockSettings } from "metabase-types/api/mocks";--import { InteractiveEmbeddingSettingsCard } from "./InteractiveEmbeddingSettingsCard";--const setup = async ({ enabled }: { enabled: boolean }) => {- const settings = createMockSettings({- "enable-embedding-interactive": enabled,- });-- setupPropertiesEndpoints(settings);- setupSettingsEndpoints([]);- setupUpdateSettingEndpoint();- setupUpdateSettingsEndpoint();- setupUserKeyValueEndpoints({- namespace: "user_acknowledgement",- key: "upsell-dev_instances",- value: true,- });-- renderWithProviders(<InteractiveEmbeddingSettingsCard />);-};--describe("InteractiveEmbeddingSettingsCard", () => {- it("should show interactive embedding toggle", async () => {- await setup({ enabled: true });-- expect(- await screen.findByText("Enable full app embedding"),- ).toBeInTheDocument();- });-- it("should show a link to the doc", async () => {- await setup({ enabled: true });-- const linkToDoc = await screen.findByRole("link", {- name: "Documentation",- });-- expect(linkToDoc).toBeVisible();- expect(linkToDoc).toHaveAttribute(- "href",- "https://www.metabase.com/docs/latest/embedding/full-app-embedding.html",- );- });-- it("should toggle interactive embedding on", async () => {- await setup({ enabled: false });- const toggle = await screen.findByLabelText(- "Enable full app embedding toggle",- );-- await userEvent.click(toggle);- const puts = await findRequests("PUT");- expect(puts).toHaveLength(1);- const [{ url, body }] = puts;- expect(url).toContain("/setting");- expect(body).toEqual({ "enable-embedding-interactive": true });- });-- it("should allow changing authorized origins", async () => {- await setup({ enabled: true });-- const input = await screen.findByPlaceholderText("https://*.example.com");- await userEvent.type(input, "https://*.foo.example.com");- fireEvent.blur(input);- await screen.findByDisplayValue("https://*.foo.example.com");-- const puts = await findRequests("PUT");- expect(puts).toHaveLength(1);- const [{ url, body }] = puts;- expect(url).toContain("/setting/embedding-app-origins-interactive");- expect(body).toEqual({ value: "https://*.foo.example.com" });- });-});diff --git a/enterprise/frontend/src/metabase-enterprise/embedding/index.ts b/enterprise/frontend/src/metabase-enterprise/embedding/index.tsindex 33732ebee9a..97737700fd8 100644--- a/enterprise/frontend/src/metabase-enterprise/embedding/index.ts+++ b/enterprise/frontend/src/metabase-enterprise/embedding/index.ts@@ -4,7 +4,7 @@ import { PLUGIN_ADMIN_SETTINGS, PLUGIN_EMBEDDING } from "metabase/plugins";import { isInteractiveEmbeddingEnabled } from "metabase-enterprise/embedding/selectors";import { hasPremiumFeature } from "metabase-enterprise/settings";-import { InteractiveEmbeddingSettingsCard } from "./components/InteractiveEmbeddingSettingsCard";+import { InteractiveEmbeddingAuthorizedOriginsWidget } from "./components/InteractiveEmbeddingAuthorizedOriginsWidget";/*** We can't gate this component behind a feature flag, because SDK users could@@ -21,7 +21,7 @@ export function initializePlugin() {PLUGIN_EMBEDDING.isEnabled = () => true;PLUGIN_EMBEDDING.isInteractiveEmbeddingEnabled =isInteractiveEmbeddingEnabled;- PLUGIN_ADMIN_SETTINGS.InteractiveEmbeddingSettingsCard =- InteractiveEmbeddingSettingsCard;+ PLUGIN_ADMIN_SETTINGS.InteractiveEmbeddingAuthorizedOriginsWidget =+ InteractiveEmbeddingAuthorizedOriginsWidget;}}diff --git a/enterprise/frontend/src/metabase-enterprise/license/components/BillingInfo/BillingInfo.tsx b/enterprise/frontend/src/metabase-enterprise/license/components/BillingInfo/BillingInfo.tsxindex d7096292904..62dca5dbec1 100644--- a/enterprise/frontend/src/metabase-enterprise/license/components/BillingInfo/BillingInfo.tsx+++ b/enterprise/frontend/src/metabase-enterprise/license/components/BillingInfo/BillingInfo.tsx@@ -1,8 +1,8 @@import { t } from "ttag";-import { SettingHeader } from "metabase/admin/settings/components/SettingHeader";import { ButtonLink } from "metabase/common/components/ExternalLink";import { useStoreUrl } from "metabase/common/hooks";+import { SettingHeader } from "metabase/settings-components";import { Alert, Anchor, Box, Icon } from "metabase/ui";import type { BillingInfo as IBillingInfo } from "metabase-types/api";diff --git a/enterprise/frontend/src/metabase-enterprise/license/components/BillingInfo/BillingInfoTable.tsx b/enterprise/frontend/src/metabase-enterprise/license/components/BillingInfo/BillingInfoTable.tsxindex 90d140ce110..38f4e548400 100644--- a/enterprise/frontend/src/metabase-enterprise/license/components/BillingInfo/BillingInfoTable.tsx+++ b/enterprise/frontend/src/metabase-enterprise/license/components/BillingInfo/BillingInfoTable.tsx@@ -2,10 +2,10 @@ import { forwardRef } from "react";import { t } from "ttag";import ErrorBoundary from "metabase/ErrorBoundary";-import { SettingHeader } from "metabase/admin/settings/components/SettingHeader";import { ExternalLink } from "metabase/common/components/ExternalLink";import { Link } from "metabase/common/components/Link";import { useSetting } from "metabase/settings";+import { SettingHeader } from "metabase/settings-components";import { Box, Card, Flex, Icon, Text } from "metabase/ui";import type { BillingInfo, BillingInfoLineItem } from "metabase-types/api";diff --git a/enterprise/frontend/src/metabase-enterprise/license/components/LicenseAndBillingSettings/LicenseAndBillingSettings.tsx b/enterprise/frontend/src/metabase-enterprise/license/components/LicenseAndBillingSettings/LicenseAndBillingSettings.tsxindex da3a84dfe6e..825ba22adc1 100644--- a/enterprise/frontend/src/metabase-enterprise/license/components/LicenseAndBillingSettings/LicenseAndBillingSettings.tsx+++ b/enterprise/frontend/src/metabase-enterprise/license/components/LicenseAndBillingSettings/LicenseAndBillingSettings.tsx@@ -1,12 +1,7 @@import { useCallback } from "react";import { jt, t } from "ttag";-import {- SettingsPageWrapper,- SettingsSection,-} from "metabase/admin/components/SettingsSection";import { LicenseInput } from "metabase/admin/settings/components/LicenseInput";-import { SettingHeader } from "metabase/admin/settings/components/SettingHeader";import { ExplorePlansIllustration } from "metabase/admin/settings/components/SettingsLicense/ExplorePlansIllustration";import { ExternalLink } from "metabase/common/components/ExternalLink";import { LoadingAndErrorWrapper } from "metabase/common/components/LoadingAndErrorWrapper";@@ -16,6 +11,11 @@ import { useSelector } from "metabase/redux";import type { State } from "metabase/redux/store";import { getUpgradeUrl } from "metabase/selectors/settings";import { useGetAdminSettingsDetailsQuery, useSetting } from "metabase/settings";+import {+ SettingHeader,+ SettingsPageWrapper,+ SettingsSection,+} from "metabase/settings-components";import { Box, Divider, Flex, Stack } from "metabase/ui";import { useGetBillingInfoQuery } from "metabase-enterprise/api";import { useLicense } from "metabase-enterprise/settings/hooks/use-license";diff --git a/enterprise/frontend/src/metabase-enterprise/moderation/components/MetabotVerifiedContentConfigurationPane.tsx b/enterprise/frontend/src/metabase-enterprise/moderation/components/MetabotVerifiedContentConfigurationPane.tsxindex fb352da5813..e549856a734 100644--- a/enterprise/frontend/src/metabase-enterprise/moderation/components/MetabotVerifiedContentConfigurationPane.tsx+++ b/enterprise/frontend/src/metabase-enterprise/moderation/components/MetabotVerifiedContentConfigurationPane.tsx@@ -1,8 +1,8 @@import { t } from "ttag";-import { SettingHeader } from "metabase/admin/settings/components/SettingHeader";import { useToast } from "metabase/common/hooks";import { useUpdateMetabotMutation } from "metabase/metabot";+import { SettingHeader } from "metabase/settings-components";import { Stack, Switch } from "metabase/ui";import type { MetabotInfo } from "metabase-types/api";diff --git a/enterprise/frontend/src/metabase-enterprise/multi_factor_auth/components/AdminAuthCard/AdminAuthCard.tsx b/enterprise/frontend/src/metabase-enterprise/multi_factor_auth/components/AdminAuthCard/AdminAuthCard.tsxindex e9dd66daccd..2ee5fcdb1af 100644--- a/enterprise/frontend/src/metabase-enterprise/multi_factor_auth/components/AdminAuthCard/AdminAuthCard.tsx+++ b/enterprise/frontend/src/metabase-enterprise/multi_factor_auth/components/AdminAuthCard/AdminAuthCard.tsx@@ -1,7 +1,6 @@import { useState } from "react";import { jt, msgid, ngettext, t } from "ttag";-import { SettingsSection } from "metabase/admin/components/SettingsSection";import { ConfirmModal } from "metabase/common/components/ConfirmModal";import { Link } from "metabase/common/components/Link";import { useHasTokenFeature } from "metabase/common/hooks";@@ -9,6 +8,7 @@ import { getUserIsAdmin } from "metabase/current-user";import { dayjs } from "metabase/dayjs";import { useSelector } from "metabase/redux";import { useAdminSetting } from "metabase/settings";+import { SettingsSection } from "metabase/settings-components";import {Alert,Anchor,diff --git a/enterprise/frontend/src/metabase-enterprise/multi_factor_auth/components/MfaUsersPage/MfaUsersPage.tsx b/enterprise/frontend/src/metabase-enterprise/multi_factor_auth/components/MfaUsersPage/MfaUsersPage.tsxindex aa23dbae31d..158e844e7f9 100644--- a/enterprise/frontend/src/metabase-enterprise/multi_factor_auth/components/MfaUsersPage/MfaUsersPage.tsx+++ b/enterprise/frontend/src/metabase-enterprise/multi_factor_auth/components/MfaUsersPage/MfaUsersPage.tsx@@ -1,12 +1,12 @@import { t } from "ttag";import NoResults from "assets/img/no_results.svg";-import { SettingsPageWrapper } from "metabase/admin/components/SettingsSection";import { SearchFilter } from "metabase/admin/people/components/SearchFilter";import { Breadcrumbs } from "metabase/common/components/Breadcrumbs";import { EmptyState } from "metabase/common/components/EmptyState";import { DelayedLoadingAndErrorWrapper } from "metabase/common/components/LoadingAndErrorWrapper/DelayedLoadingAndErrorWrapper";import { PaginationControls } from "metabase/common/components/PaginationControls";+import { SettingsPageWrapper } from "metabase/settings-components";import {Box,Card,diff --git a/enterprise/frontend/src/metabase-enterprise/remote_sync/components/RemoteSyncAdminSettings/RemoteSyncAdminSettings.tsx b/enterprise/frontend/src/metabase-enterprise/remote_sync/components/RemoteSyncAdminSettings/RemoteSyncAdminSettings.tsxindex 5089982a433..6a898d1641e 100644--- a/enterprise/frontend/src/metabase-enterprise/remote_sync/components/RemoteSyncAdminSettings/RemoteSyncAdminSettings.tsx+++ b/enterprise/frontend/src/metabase-enterprise/remote_sync/components/RemoteSyncAdminSettings/RemoteSyncAdminSettings.tsx@@ -1,6 +1,6 @@import { t } from "ttag";-import { SettingsPageWrapper } from "metabase/admin/components/SettingsSection";+import { SettingsPageWrapper } from "metabase/settings-components";import { RemoteSyncSettingsForm } from "./RemoteSyncSettingsForm";diff --git a/enterprise/frontend/src/metabase-enterprise/remote_sync/components/RemoteSyncAdminSettings/RemoteSyncSettingsSection.tsx b/enterprise/frontend/src/metabase-enterprise/remote_sync/components/RemoteSyncAdminSettings/RemoteSyncSettingsSection.tsxindex bdd45a47c44..be6fefef443 100644--- a/enterprise/frontend/src/metabase-enterprise/remote_sync/components/RemoteSyncAdminSettings/RemoteSyncSettingsSection.tsx+++ b/enterprise/frontend/src/metabase-enterprise/remote_sync/components/RemoteSyncAdminSettings/RemoteSyncSettingsSection.tsx@@ -1,6 +1,6 @@import { type ComponentProps, createContext, useContext } from "react";-import { SettingsSection } from "metabase/admin/components/SettingsSection";+import { SettingsSection } from "metabase/settings-components";import type { RemoteSyncSettingsVariant } from "../../types";diff --git a/enterprise/frontend/src/metabase-enterprise/sandboxes/containers/EditSandboxingModal.tsx b/enterprise/frontend/src/metabase-enterprise/sandboxes/containers/EditSandboxingModal.tsxindex 037e04ad689..193967768ed 100644--- a/enterprise/frontend/src/metabase-enterprise/sandboxes/containers/EditSandboxingModal.tsx+++ b/enterprise/frontend/src/metabase-enterprise/sandboxes/containers/EditSandboxingModal.tsx@@ -1,6 +1,6 @@import { t } from "ttag";-import { GROUPS_BASE_PATH } from "metabase/admin/permissions/utils/urls";+import { getGroupsBasePath } from "metabase/admin/permissions/utils/urls";import {skipToken,useGetGroupTableAccessPolicyQuery,@@ -77,7 +77,7 @@ const EditSandboxingModalContainer = ({entityId: { databaseId, schemaName: params.schemaName, tableId },// the modal is mounted under both permissions editor views; only// permission post-actions read the view- view: location.pathname.startsWith(GROUPS_BASE_PATH)+ view: location.pathname.startsWith(getGroupsBasePath())? "group": "database",}),diff --git a/enterprise/frontend/src/metabase-enterprise/semantic_search/SearchSettingsWidget.tsx b/enterprise/frontend/src/metabase-enterprise/semantic_search/SearchSettingsWidget.tsxindex d5c5cd149ff..e3cf5e0264d 100644--- a/enterprise/frontend/src/metabase-enterprise/semantic_search/SearchSettingsWidget.tsx+++ b/enterprise/frontend/src/metabase-enterprise/semantic_search/SearchSettingsWidget.tsx@@ -2,8 +2,6 @@ import { useEffect, useState } from "react";import { t } from "ttag";import _ from "underscore";-import { SettingHeader } from "metabase/admin/settings/components/SettingHeader";-import { BasicAdminSettingInput } from "metabase/admin/settings/components/widgets/AdminSettingInput";import { UpsellSemanticSearchPill } from "metabase/admin/upsells/UpsellSemanticSearch";import { getErrorMessage } from "metabase/api/utils";import type { SearchSettingsWidgetProps } from "metabase/plugins";@@ -14,6 +12,10 @@ import {isProPlan,useAdminSetting,} from "metabase/settings";+import {+ BasicAdminSettingInput,+ SettingHeader,+} from "metabase/settings-components";import { Box, Progress, Stack, Text, Tooltip } from "metabase/ui";import { useGetSemanticSearchStatusQuery } from "metabase-enterprise/api/search";diff --git a/enterprise/frontend/src/metabase-enterprise/support/components/SupportSettingsSection/SupportSettingsSection.tsx b/enterprise/frontend/src/metabase-enterprise/support/components/SupportSettingsSection/SupportSettingsSection.tsxindex 9f994c7a3b8..11a5187ceda 100644--- a/enterprise/frontend/src/metabase-enterprise/support/components/SupportSettingsSection/SupportSettingsSection.tsx+++ b/enterprise/frontend/src/metabase-enterprise/support/components/SupportSettingsSection/SupportSettingsSection.tsx@@ -1,9 +1,9 @@import { t } from "ttag";-import { SettingsSection } from "metabase/admin/components/SettingsSection";import { LoadingAndErrorWrapper } from "metabase/common/components/LoadingAndErrorWrapper";import { PaginationControls } from "metabase/common/components/PaginationControls";import { useNavigate } from "metabase/router";+import { SettingsSection } from "metabase/settings-components";import { Box, Button, Flex, LoadingOverlay, Text, Title } from "metabase/ui";import { adminHelpGrantAccess } from "metabase/urls";diff --git a/enterprise/frontend/src/metabase-enterprise/tenants/EditUserStrategyModal/EditUserStrategyModal.tsx b/enterprise/frontend/src/metabase-enterprise/tenants/EditUserStrategyModal/EditUserStrategyModal.tsxindex 4f34908f221..beb55712c03 100644--- a/enterprise/frontend/src/metabase-enterprise/tenants/EditUserStrategyModal/EditUserStrategyModal.tsx+++ b/enterprise/frontend/src/metabase-enterprise/tenants/EditUserStrategyModal/EditUserStrategyModal.tsx@@ -9,6 +9,7 @@ import { useDispatch } from "metabase/redux";import { useNavigate } from "metabase/router";import { useAdminSetting } from "metabase/settings";import { Button, Flex, Modal, Radio, Stack } from "metabase/ui";+import * as EnterpriseUrls from "metabase-enterprise/urls";interface EditUserStrategyModalProps {onClose: () => void;@@ -78,7 +79,7 @@ export const EditUserStrategyModal = ({dispatch(permissionApi.util.invalidateTags(["permissions-group",- "embedding-hub-checklist",+ "setup-guide-checklist",]),);@@ -90,7 +91,7 @@ export const EditUserStrategyModal = ({// This ensures `createTenantsRouteGuard` sees the updated setting.await refetch();- navigate("/admin/people/tenants");+ navigate(EnterpriseUrls.tenants());}};diff --git a/enterprise/frontend/src/metabase-enterprise/tenants/components/CreateTenantsOnboardingStep/CreateTenantsOnboardingStep.tsx b/enterprise/frontend/src/metabase-enterprise/tenants/components/CreateTenantsOnboardingStep/CreateTenantsOnboardingStep.tsxindex 9772f69bb20..5aadd9d43b8 100644--- a/enterprise/frontend/src/metabase-enterprise/tenants/components/CreateTenantsOnboardingStep/CreateTenantsOnboardingStep.tsx+++ b/enterprise/frontend/src/metabase-enterprise/tenants/components/CreateTenantsOnboardingStep/CreateTenantsOnboardingStep.tsx@@ -4,7 +4,7 @@ import { t } from "ttag";import { getErrorMessage } from "metabase/api/utils";import { useToast } from "metabase/common/hooks";-import { createEmptyTenantDraft } from "metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/utils";+import { createEmptyTenantDraft } from "metabase/embedding/setup-guide/components/SetupPermissionsAndTenantsPage/utils";import type { CreatedTenantData } from "metabase/plugins/oss/tenants";import {Button,diff --git a/enterprise/frontend/src/metabase-enterprise/tenants/components/TenantCollectionPermissionsPage/TenantCollectionPermissionsPage.tsx b/enterprise/frontend/src/metabase-enterprise/tenants/components/TenantCollectionPermissionsPage/TenantCollectionPermissionsPage.tsxindex d5907ff1592..23294ed7b66 100644--- a/enterprise/frontend/src/metabase-enterprise/tenants/components/TenantCollectionPermissionsPage/TenantCollectionPermissionsPage.tsx+++ b/enterprise/frontend/src/metabase-enterprise/tenants/components/TenantCollectionPermissionsPage/TenantCollectionPermissionsPage.tsx@@ -17,6 +17,7 @@ import {import type { PermissionEditorEntity } from "metabase/admin/permissions/types";import { assertNumericId } from "metabase/admin/permissions/types";import { useListCollectionsTreeQuery } from "metabase/api";+import { getPermissionsBasePath } from "metabase/common/components/PermissionsBasePath/base-path";import { useDispatch, useSelector } from "metabase/redux";import { useNavigate, useParams } from "metabase/router";import type { CollectionId } from "metabase-types/api";@@ -54,7 +55,7 @@ export function TenantCollectionPermissionsPage() {}, [dispatch]);const navigateToItem = ({ id }: { id: CollectionId }) =>- navigate(`/admin/permissions/tenant-collections/${id}`);+ navigate(`${getPermissionsBasePath()}/tenant-collections/${id}`);const handlePermissionChange = useCallback((diff --git a/enterprise/frontend/src/metabase-enterprise/tenants/components/TenantSpecificCollectionPermissionsPage/TenantSpecificCollectionPermissionsPage.tsx b/enterprise/frontend/src/metabase-enterprise/tenants/components/TenantSpecificCollectionPermissionsPage/TenantSpecificCollectionPermissionsPage.tsxindex 1b0d197cc26..6edeb66d621 100644--- a/enterprise/frontend/src/metabase-enterprise/tenants/components/TenantSpecificCollectionPermissionsPage/TenantSpecificCollectionPermissionsPage.tsx+++ b/enterprise/frontend/src/metabase-enterprise/tenants/components/TenantSpecificCollectionPermissionsPage/TenantSpecificCollectionPermissionsPage.tsx@@ -18,6 +18,7 @@ import {import type { PermissionEditorEntity } from "metabase/admin/permissions/types";import { assertNumericId } from "metabase/admin/permissions/types";import { useListCollectionsTreeQuery } from "metabase/api";+import { getPermissionsBasePath } from "metabase/common/components/PermissionsBasePath/base-path";import { useDispatch, useSelector } from "metabase/redux";import { useNavigate, useParams } from "metabase/router";import type { Collection, CollectionId } from "metabase-types/api";@@ -63,7 +64,7 @@ function TenantSpecificCollectionPermissionsPageView() {const navigateToItem = useCallback(({ id }: { id: CollectionId }) => {- navigate(`/admin/permissions/tenant-specific-collections/${id}`);+ navigate(`${getPermissionsBasePath()}/tenant-specific-collections/${id}`);},[navigate],);diff --git a/enterprise/frontend/src/metabase-enterprise/tenants/components/TenantsListingEmptyState.tsx b/enterprise/frontend/src/metabase-enterprise/tenants/components/TenantsListingEmptyState.tsxindex f29c8dbf9fb..3fc34305658 100644--- a/enterprise/frontend/src/metabase-enterprise/tenants/components/TenantsListingEmptyState.tsx+++ b/enterprise/frontend/src/metabase-enterprise/tenants/components/TenantsListingEmptyState.tsx@@ -2,6 +2,7 @@ import { c, t } from "ttag";import { Link } from "metabase/common/components/Link";import { Anchor, Box, Button, Flex, Text } from "metabase/ui";+import * as EnterpriseUrls from "metabase-enterprise/urls";export const TenantsListingEmptyState = ({onCreateTenant,@@ -16,13 +17,13 @@ export const TenantsListingEmptyState = ({).jt`Create your first tenant to start adding ${(<Anchorcomponent={Link}- to="/admin/people/tenants/people"+ to={EnterpriseUrls.tenantPeople()}key="external-users-link">{t`external users`}</Anchor>- )} to it, and organize these users into ${<Anchor component={Link} to="/admin/people/tenants/groups" key="tenant-groups-link">{t`groups`}</Anchor>} to assign ${(+ )} to it, and organize these users into ${<Anchor component={Link} to={EnterpriseUrls.tenantGroups()} key="tenant-groups-link">{t`groups`}</Anchor>} to assign ${(<Anchorcomponent={Link}- to="/admin/permissions"+ to={EnterpriseUrls.tenantsPermissions()}key="permissions-link">{t`permissions`}</Anchor>)}. Then, create dashboards, charts and models for your tenants in shared collections.`}diff --git a/enterprise/frontend/src/metabase-enterprise/tenants/components/TenantsSummaryOnboardingStep/TenantsSummaryOnboardingStep.tsx b/enterprise/frontend/src/metabase-enterprise/tenants/components/TenantsSummaryOnboardingStep/TenantsSummaryOnboardingStep.tsxindex e793a55be9d..7d694deba3b 100644--- a/enterprise/frontend/src/metabase-enterprise/tenants/components/TenantsSummaryOnboardingStep/TenantsSummaryOnboardingStep.tsx+++ b/enterprise/frontend/src/metabase-enterprise/tenants/components/TenantsSummaryOnboardingStep/TenantsSummaryOnboardingStep.tsx@@ -3,10 +3,12 @@ import { useMemo } from "react";import { jt, msgid, ngettext, t } from "ttag";import { RelatedSettingCard } from "metabase/admin/components/RelatedSettingsSection";+import { useSetupGuideReturnPath } from "metabase/embedding/setup-guide/hooks";import type { CreatedTenantData } from "metabase/plugins/oss/tenants";import { useNavigate } from "metabase/router";import { Button, Flex, SimpleGrid, Stack, Text, Title } from "metabase/ui";import { conjunct } from "metabase/utils/formatting/strings";+import * as EnterpriseUrls from "metabase-enterprise/urls";import type { DataSegregationStrategy } from "metabase-types/api";import { useListTenantsQuery } from "../../../api/tenants";@@ -38,13 +40,14 @@ export const TenantsSummaryOnboardingStep = ({rlsColumnName?: string | null;}) => {const navigate = useNavigate();+ const returnPath = useSetupGuideReturnPath();const { data: tenantsData } = useListTenantsQuery({ status: "active" },{ skip: tenants.length > 0 },);- const onDone = () => navigate("/admin/embedding/setup-guide");+ const onDone = () => navigate(returnPath);const tenantsToShow = useMemo(() => {// If we have tenants from the flow, use them@@ -122,13 +125,13 @@ const RelatedSettingsSection = () => (<RelatedSettingCardname={t`Tenants`}icon="globe"- to="/admin/people/tenants"+ to={EnterpriseUrls.tenants()}/><RelatedSettingCardname={t`People`}icon="person"- to="/admin/people/tenants/people"+ to={EnterpriseUrls.tenantPeople()}/><RelatedSettingCard@@ -140,7 +143,7 @@ const RelatedSettingsSection = () => (<RelatedSettingCardname={t`Permissions`}icon="group"- to="/admin/permissions"+ to={EnterpriseUrls.tenantsPermissions()}/></SimpleGrid>);diff --git a/enterprise/frontend/src/metabase-enterprise/tenants/containers/TenantsListingApp.tsx b/enterprise/frontend/src/metabase-enterprise/tenants/containers/TenantsListingApp.tsxindex 48d4079e0a7..b1c95e4ea67 100644--- a/enterprise/frontend/src/metabase-enterprise/tenants/containers/TenantsListingApp.tsx+++ b/enterprise/frontend/src/metabase-enterprise/tenants/containers/TenantsListingApp.tsx@@ -1,15 +1,16 @@import { useEffect, useMemo, useState } from "react";import { t } from "ttag";-import { SettingsSection } from "metabase/admin/components/SettingsSection";import {ACTIVE_STATUS,type ActiveStatus,} from "metabase/admin/people/constants";import { LoadingAndErrorWrapper } from "metabase/common/components/LoadingAndErrorWrapper";+import { isEmbeddingHubTenancy } from "metabase/common/tenants";import { getUserIsAdmin } from "metabase/current-user";import { useSelector } from "metabase/redux";import { Outlet } from "metabase/router";+import { SettingsSection } from "metabase/settings-components";import { Box, Group, Tabs, Title } from "metabase/ui";import { useListTenantsQuery } from "metabase-enterprise/api";@@ -52,14 +53,23 @@ export const TenantsListingApp = () => {const hasNoTenants = data?.data?.length === 0;+ const isEmbeddingHub = isEmbeddingHubTenancy();+return (- // Make the layout narrow when there are no tenants- <Box maw={hasNoTenants ? "700px" : undefined} mx="auto">- <Group justify="space-between" w="100%" mb="xl">- <Title order={1}>{t`Tenants`}</Title>+ // Narrower when there are no tenants. 50rem matches the embedding hub's+ // content column, which mounts this same listing.+ <Box maw={hasNoTenants ? "50rem" : undefined} mx="auto">+ <Group+ justify={isEmbeddingHub ? "flex-end" : "space-between"}+ w="100%"+ mb="xl"+ >+ {!isEmbeddingHub && <Title order={1}>{t`Tenants`}</Title>}<Group gap="sm">- <TenantsDocsButton />+ {/* The embedding hub's Tenancy page links to the same docs above the+ listing, so this would be the second link to one destination. */}+ {!isEmbeddingHub && <TenantsDocsButton />}<EditUserStrategySettingsButton page="tenants" /></Group></Group>diff --git a/enterprise/frontend/src/metabase-enterprise/tenants/index.tsx b/enterprise/frontend/src/metabase-enterprise/tenants/index.tsxindex e05f842f331..ae9e3e16069 100644--- a/enterprise/frontend/src/metabase-enterprise/tenants/index.tsx+++ b/enterprise/frontend/src/metabase-enterprise/tenants/index.tsx@@ -194,7 +194,7 @@ export function initializePlugin() {},)}<Route path=":userId">- <Route index element={redirect("/admin/people/tenants/people")} />+ <Route index element={redirect("..")} />{modalRoute("edit",(props) => (diff --git a/enterprise/frontend/src/metabase-enterprise/transforms-python/pages/PythonRunnerSettingsPage/PythonRunnerSettingsPage.tsx b/enterprise/frontend/src/metabase-enterprise/transforms-python/pages/PythonRunnerSettingsPage/PythonRunnerSettingsPage.tsxindex e083e53d669..c7e5b826532 100644--- a/enterprise/frontend/src/metabase-enterprise/transforms-python/pages/PythonRunnerSettingsPage/PythonRunnerSettingsPage.tsx+++ b/enterprise/frontend/src/metabase-enterprise/transforms-python/pages/PythonRunnerSettingsPage/PythonRunnerSettingsPage.tsx@@ -1,11 +1,11 @@import { t } from "ttag";+import { useSetting } from "metabase/settings";import {+ AdminSettingInput,SettingsPageWrapper,SettingsSection,-} from "metabase/admin/components/SettingsSection";-import { AdminSettingInput } from "metabase/admin/settings/components/widgets/AdminSettingInput";-import { useSetting } from "metabase/settings";+} from "metabase/settings-components";export function PythonRunnerSettingsPage() {const isHosted = useSetting("is-hosted?");diff --git a/enterprise/frontend/src/metabase-enterprise/upload_management/UploadManagementTable.tsx b/enterprise/frontend/src/metabase-enterprise/upload_management/UploadManagementTable.tsxindex 2c16f615494..5ff9fad8e50 100644--- a/enterprise/frontend/src/metabase-enterprise/upload_management/UploadManagementTable.tsx+++ b/enterprise/frontend/src/metabase-enterprise/upload_management/UploadManagementTable.tsx@@ -1,7 +1,6 @@import { useCallback, useMemo, useState } from "react";import { msgid, ngettext, t } from "ttag";-import { SettingHeader } from "metabase/admin/settings/components/SettingHeader";import {BulkActionBar,BulkActionButton,@@ -10,6 +9,7 @@ import { Link } from "metabase/common/components/Link";import { DelayedLoadingAndErrorWrapper } from "metabase/common/components/LoadingAndErrorWrapper/DelayedLoadingAndErrorWrapper";import { ClientSortableTable } from "metabase/common/components/Table";import { useToast } from "metabase/common/hooks";+import { SettingHeader } from "metabase/settings-components";import {Box,Button,diff --git a/enterprise/frontend/src/metabase-enterprise/urls.ts b/enterprise/frontend/src/metabase-enterprise/urls.tsindex 37e76959bee..e0e3a116127 100644--- a/enterprise/frontend/src/metabase-enterprise/urls.ts+++ b/enterprise/frontend/src/metabase-enterprise/urls.ts@@ -1,3 +1,5 @@+import { getPermissionsBasePath } from "metabase/common/components/PermissionsBasePath/base-path";+import { getTenantsBasePath } from "metabase/common/tenants";import type { DatabaseId, Tenant } from "metabase-types/api";export * as Urls from "metabase/urls";@@ -25,21 +27,39 @@ export function removeDestinationDatabase(}export function newTenant() {- return `/admin/people/tenants/new`;+ return `${getTenantsBasePath()}/new`;}export function editTenant(tenantId: Tenant["id"]) {- return `/admin/people/tenants/${tenantId}/edit`;+ return `${getTenantsBasePath()}/${tenantId}/edit`;}export function deactivateTenant(tenantId: Tenant["id"]) {- return `/admin/people/tenants/${tenantId}/deactivate`;+ return `${getTenantsBasePath()}/${tenantId}/deactivate`;}export function reactivateTenant(tenantId: Tenant["id"]) {- return `/admin/people/tenants/${tenantId}/reactivate`;+ return `${getTenantsBasePath()}/${tenantId}/reactivate`;}export function editUserStrategy(page: "people" | "tenants") {- return `/admin/people${page === "tenants" ? "/tenants" : ""}/user-strategy`;+ return page === "tenants"+ ? `${getTenantsBasePath()}/user-strategy`+ : `/admin/people/user-strategy`;+}++export function tenants() {+ return getTenantsBasePath();+}++export function tenantPeople() {+ return `${getTenantsBasePath()}/people`;+}++export function tenantGroups() {+ return `${getTenantsBasePath()}/groups`;+}++export function tenantsPermissions() {+ return getPermissionsBasePath();}diff --git a/enterprise/frontend/src/metabase-enterprise/user_provisioning/components/UserProvisioning.tsx b/enterprise/frontend/src/metabase-enterprise/user_provisioning/components/UserProvisioning.tsxindex f0e4a040955..60062c219a9 100644--- a/enterprise/frontend/src/metabase-enterprise/user_provisioning/components/UserProvisioning.tsx+++ b/enterprise/frontend/src/metabase-enterprise/user_provisioning/components/UserProvisioning.tsx@@ -2,14 +2,6 @@ import { useDisclosure } from "@mantine/hooks";import { P, isMatching } from "ts-pattern";import { t } from "ttag";-import {- SettingsPageWrapper,- SettingsSection,-} from "metabase/admin/components/SettingsSection";-import {- AdminSettingInput,- BasicAdminSettingInput,-} from "metabase/admin/settings/components/widgets/AdminSettingInput";import { NotFound } from "metabase/common/components/ErrorPages";import { LoadingAndErrorWrapper } from "metabase/common/components/LoadingAndErrorWrapper";import { SetByEnvVar } from "metabase/common/components/SetByEnvVar";@@ -20,6 +12,12 @@ import {useSetting,useUpdateSettingMutation,} from "metabase/settings";+import {+ AdminSettingInput,+ BasicAdminSettingInput,+ SettingsPageWrapper,+ SettingsSection,+} from "metabase/settings-components";import {Alert,Box,diff --git a/enterprise/frontend/src/metabase-enterprise/whitelabel/components/ColorSettings/ColorSettings.tsx b/enterprise/frontend/src/metabase-enterprise/whitelabel/components/ColorSettings/ColorSettings.tsxindex 9bb933af892..f878bbc52f1 100644--- a/enterprise/frontend/src/metabase-enterprise/whitelabel/components/ColorSettings/ColorSettings.tsx+++ b/enterprise/frontend/src/metabase-enterprise/whitelabel/components/ColorSettings/ColorSettings.tsx@@ -1,7 +1,7 @@import { useCallback, useMemo, useState } from "react";import { t } from "ttag";-import { SettingHeader } from "metabase/admin/settings/components/SettingHeader";+import { SettingHeader } from "metabase/settings-components";import { Box, Stack, Tabs } from "metabase/ui";import type { ColorSettings as ColorSettingsType } from "metabase-types/api";diff --git a/enterprise/frontend/src/metabase-enterprise/whitelabel/components/EmbeddedAppearanceSettings.tsx b/enterprise/frontend/src/metabase-enterprise/whitelabel/components/EmbeddedAppearanceSettings.tsxnew file mode 100644index 00000000000..6d30df7bfe5--- /dev/null+++ b/enterprise/frontend/src/metabase-enterprise/whitelabel/components/EmbeddedAppearanceSettings.tsx@@ -0,0 +1,44 @@+import { c, t } from "ttag";++import {+ AdminSettingInput,+ SettingsSection,+} from "metabase/settings-components";++import { getLoadingMessageOptions } from "../lib/loading-message";++import { IllustrationWidget } from "./IllustrationWidget";++/**+ * The whitelabel settings that show up *inside* an embed: the loading message+ * and the two empty-state illustrations. Excludes logo, favicon, the login+ * and landing illustrations, `show-metabase-links`, and instance colours,+ * fonts and application name -- the theme editor on the same tab covers those.+ *+ * Registered through a plugin slot rather than imported: everything here is+ * EE-only, and `frontend/src/metabase/**` may not import `metabase-enterprise*`.+ */+export function EmbeddedAppearanceSettings() {+ return (+ <SettingsSection>+ <AdminSettingInput+ name="loading-message"+ title={c(+ "Label for a setting that selects the message shown to users while Metabase is loading",+ ).t`Loading message`}+ inputType="select"+ options={getLoadingMessageOptions()}+ />++ <IllustrationWidget+ name="no-data-illustration"+ title={t`When calculations return no results`}+ />++ <IllustrationWidget+ name="no-object-illustration"+ title={t`When no objects can be found`}+ />+ </SettingsSection>+ );+}diff --git a/enterprise/frontend/src/metabase-enterprise/whitelabel/components/FontWidget/FontWidget.tsx b/enterprise/frontend/src/metabase-enterprise/whitelabel/components/FontWidget/FontWidget.tsxindex 88919db3073..ad9004f667f 100644--- a/enterprise/frontend/src/metabase-enterprise/whitelabel/components/FontWidget/FontWidget.tsx+++ b/enterprise/frontend/src/metabase-enterprise/whitelabel/components/FontWidget/FontWidget.tsx@@ -1,9 +1,11 @@import { t } from "ttag";-import { SettingHeader } from "metabase/admin/settings/components/SettingHeader";-import { BasicAdminSettingInput } from "metabase/admin/settings/components/widgets/AdminSettingInput";import { SetByEnvVar } from "metabase/common/components/SetByEnvVar";import { useAdminSetting } from "metabase/settings";+import {+ BasicAdminSettingInput,+ SettingHeader,+} from "metabase/settings-components";import { Box } from "metabase/ui";import { FontFilesWidget } from "./FontFilesWidget";diff --git a/enterprise/frontend/src/metabase-enterprise/whitelabel/components/HelpLinkSettings/HelpLinkSettings.tsx b/enterprise/frontend/src/metabase-enterprise/whitelabel/components/HelpLinkSettings/HelpLinkSettings.tsxindex ecbf57c4864..7e203cd3ec3 100644--- a/enterprise/frontend/src/metabase-enterprise/whitelabel/components/HelpLinkSettings/HelpLinkSettings.tsx+++ b/enterprise/frontend/src/metabase-enterprise/whitelabel/components/HelpLinkSettings/HelpLinkSettings.tsx@@ -2,12 +2,14 @@ import { useEffect, useState } from "react";import { usePrevious } from "react-use";import { jt, t } from "ttag";-import { SettingHeader } from "metabase/admin/settings/components/SettingHeader";-import { BasicAdminSettingInput } from "metabase/admin/settings/components/widgets/AdminSettingInput";import { getErrorMessage } from "metabase/api/utils";import { ExternalLink } from "metabase/common/components/ExternalLink";import { SetByEnvVar } from "metabase/common/components/SetByEnvVar";import { useAdminSetting } from "metabase/settings";+import {+ BasicAdminSettingInput,+ SettingHeader,+} from "metabase/settings-components";import { Stack, TextInput } from "metabase/ui";import type { HelpLinkSetting } from "metabase-types/api";diff --git a/enterprise/frontend/src/metabase-enterprise/whitelabel/components/IllustrationWidget/IllustrationWidget.tsx b/enterprise/frontend/src/metabase-enterprise/whitelabel/components/IllustrationWidget/IllustrationWidget.tsxindex 01676be664d..c8b1a3cb703 100644--- a/enterprise/frontend/src/metabase-enterprise/whitelabel/components/IllustrationWidget/IllustrationWidget.tsx+++ b/enterprise/frontend/src/metabase-enterprise/whitelabel/components/IllustrationWidget/IllustrationWidget.tsx@@ -3,12 +3,14 @@ import type React from "react";import { useEffect, useRef, useState } from "react";import { t } from "ttag";-import { SettingHeader } from "metabase/admin/settings/components/SettingHeader";-import { BasicAdminSettingInput } from "metabase/admin/settings/components/widgets/AdminSettingInput";import { LighthouseIllustrationThumbnail } from "metabase/common/components/LighthouseIllustration";import { SetByEnvVar } from "metabase/common/components/SetByEnvVar";import CS from "metabase/css/core/index.css";import { useAdminSetting } from "metabase/settings";+import {+ BasicAdminSettingInput,+ SettingHeader,+} from "metabase/settings-components";import { Box, Button, Flex, Icon, Paper, Text } from "metabase/ui";import type {EnterpriseSettingKey,diff --git a/enterprise/frontend/src/metabase-enterprise/whitelabel/components/IllustrationWidget/ImageUploadWidget.tsx b/enterprise/frontend/src/metabase-enterprise/whitelabel/components/IllustrationWidget/ImageUploadWidget.tsxindex 5432f601bcd..8d0429ff416 100644--- a/enterprise/frontend/src/metabase-enterprise/whitelabel/components/IllustrationWidget/ImageUploadWidget.tsx+++ b/enterprise/frontend/src/metabase-enterprise/whitelabel/components/IllustrationWidget/ImageUploadWidget.tsx@@ -3,10 +3,10 @@ import type React from "react";import { useRef, useState } from "react";import { t } from "ttag";-import { SettingHeader } from "metabase/admin/settings/components/SettingHeader";import { SetByEnvVar } from "metabase/common/components/SetByEnvVar";import CS from "metabase/css/core/index.css";import { useAdminSetting } from "metabase/settings";+import { SettingHeader } from "metabase/settings-components";import { Box, Button, Flex, Icon, Paper, Text } from "metabase/ui";import type { EnterpriseSettingKey } from "metabase-types/api";diff --git a/enterprise/frontend/src/metabase-enterprise/whitelabel/components/MetabotToggleWidget/MetabotToggleWidget.tsx b/enterprise/frontend/src/metabase-enterprise/whitelabel/components/MetabotToggleWidget/MetabotToggleWidget.tsxindex c77c06d548c..223f01da404 100644--- a/enterprise/frontend/src/metabase-enterprise/whitelabel/components/MetabotToggleWidget/MetabotToggleWidget.tsx+++ b/enterprise/frontend/src/metabase-enterprise/whitelabel/components/MetabotToggleWidget/MetabotToggleWidget.tsx@@ -1,7 +1,7 @@import { t } from "ttag";-import { SettingHeader } from "metabase/admin/settings/components/SettingHeader";import { useAdminSetting } from "metabase/settings";+import { SettingHeader } from "metabase/settings-components";import { Box } from "metabase/ui";import { ImageToggle } from "../ImageToggle";diff --git a/enterprise/frontend/src/metabase-enterprise/whitelabel/components/WhiteLabelBrandingSettingsPage.tsx b/enterprise/frontend/src/metabase-enterprise/whitelabel/components/WhiteLabelBrandingSettingsPage.tsxindex e24dd980c28..ca5027d722c 100644--- a/enterprise/frontend/src/metabase-enterprise/whitelabel/components/WhiteLabelBrandingSettingsPage.tsx+++ b/enterprise/frontend/src/metabase-enterprise/whitelabel/components/WhiteLabelBrandingSettingsPage.tsx@@ -1,11 +1,11 @@import { c, t } from "ttag";import {+ AdminSettingInput,+ SettingHeader,SettingsPageWrapper,SettingsSection,-} from "metabase/admin/components/SettingsSection";-import { SettingHeader } from "metabase/admin/settings/components/SettingHeader";-import { AdminSettingInput } from "metabase/admin/settings/components/widgets/AdminSettingInput";+} from "metabase/settings-components";import { Box } from "metabase/ui";import { getLoadingMessageOptions } from "../lib/loading-message";diff --git a/enterprise/frontend/src/metabase-enterprise/whitelabel/components/WhiteLabelConcealSettingsPage.tsx b/enterprise/frontend/src/metabase-enterprise/whitelabel/components/WhiteLabelConcealSettingsPage.tsxindex 8b079fb90d8..8121494ee6e 100644--- a/enterprise/frontend/src/metabase-enterprise/whitelabel/components/WhiteLabelConcealSettingsPage.tsx+++ b/enterprise/frontend/src/metabase-enterprise/whitelabel/components/WhiteLabelConcealSettingsPage.tsx@@ -1,10 +1,10 @@import { t } from "ttag";import {+ AdminSettingInput,SettingsPageWrapper,SettingsSection,-} from "metabase/admin/components/SettingsSection";-import { AdminSettingInput } from "metabase/admin/settings/components/widgets/AdminSettingInput";+} from "metabase/settings-components";import { Text } from "metabase/ui";import { HelpLinkSettings } from "./HelpLinkSettings";diff --git a/enterprise/frontend/src/metabase-enterprise/whitelabel/index.ts b/enterprise/frontend/src/metabase-enterprise/whitelabel/index.tsindex 2d63d083d17..c6de310c2d8 100644--- a/enterprise/frontend/src/metabase-enterprise/whitelabel/index.ts+++ b/enterprise/frontend/src/metabase-enterprise/whitelabel/index.ts@@ -22,6 +22,7 @@ import {} from "metabase-enterprise/settings/selectors";import type { SettingKey } from "metabase-types/api";+import { EmbeddedAppearanceSettings } from "./components/EmbeddedAppearanceSettings";import { LandingPageUrlField } from "./components/LandingPageUrlField";import { LogoIcon } from "./components/LogoIcon";import {@@ -47,6 +48,7 @@ export function initializePlugin() {LazyWhiteLabelBrandingSettingsPage;PLUGIN_WHITELABEL.WhiteLabelConcealSettingsPage =LazyWhiteLabelConcealSettingsPage;+ PLUGIN_WHITELABEL.EmbeddedAppearanceSettings = EmbeddedAppearanceSettings;PLUGIN_APP_INIT_FUNCTIONS.push(() => {updateColors();diff --git a/enterprise/frontend/src/metabase-enterprise/writable_connection/pages/WritableConnectionInfoPage/WritableConnectionInfoPage.tsx b/enterprise/frontend/src/metabase-enterprise/writable_connection/pages/WritableConnectionInfoPage/WritableConnectionInfoPage.tsxindex b9e8c36d965..50fe6941188 100644--- a/enterprise/frontend/src/metabase-enterprise/writable_connection/pages/WritableConnectionInfoPage/WritableConnectionInfoPage.tsx+++ b/enterprise/frontend/src/metabase-enterprise/writable_connection/pages/WritableConnectionInfoPage/WritableConnectionInfoPage.tsx@@ -1,7 +1,6 @@import { useMemo, useState } from "react";import { t } from "ttag";-import { SettingsSection } from "metabase/admin/components/SettingsSection";import {skipToken,useGetDatabaseQuery,@@ -12,6 +11,7 @@ import { DelayedLoadingAndErrorWrapper } from "metabase/common/components/Loadinimport { DatabaseForm } from "metabase/databases/components/DatabaseForm";import type { DatabaseFormConfig } from "metabase/databases/types";import { useNavigate, useParams } from "metabase/router";+import { SettingsSection } from "metabase/settings-components";import { Box, Flex, ScrollArea, Title } from "metabase/ui";import * as Urls from "metabase/urls";import type { Database, DatabaseData } from "metabase-types/api";diff --git a/eslint.config.mjs b/eslint.config.mjsindex d0d5bc7554f..4f5406b619c 100644--- a/eslint.config.mjs+++ b/eslint.config.mjs@@ -404,6 +404,9 @@ const configs = [files: ["**/*.unit.spec.*","frontend/src/metabase/admin/**/*",+ "frontend/src/metabase/embedding-hub/**/*",+ "frontend/src/metabase/embedding/settings/**/*",+ "frontend/src/metabase/embedding/themes/**/*","frontend/src/metabase/monitor/tools/**/*","frontend/src/metabase/setup/**/*","enterprise/frontend/src/metabase-enterprise/whitelabel/**/*",diff --git a/frontend/lint/module-boundaries.mjs b/frontend/lint/module-boundaries.mjsindex 92315edd83c..b94d9541ff2 100644--- a/frontend/lint/module-boundaries.mjs+++ b/frontend/lint/module-boundaries.mjs@@ -148,6 +148,16 @@ const elements = [name: "mcp-app",pattern: "frontend/src/metabase/embedding/mcp/**",}),+ // App tier because ResourcePreview imports the EAJS runtime+ // (embedding-iframe-sdk), and PreviewPanel then EmbeddingThemeEditorApp import+ // it in turn -- shared cannot import app. The runtime has real module-load+ // side effects, so this stays app tier rather than becoming shared. Must+ // precede shared/embedding below: first match wins.+ createElement({+ type: "app",+ name: "theme-editor",+ pattern: "frontend/src/metabase/embedding/themes/components/ThemeEditor/**",+ }),...["frontend/src/metabase/app-embed-mcp.tsx","frontend/src/metabase/app-embed-mcp-public-path.ts",@@ -242,6 +252,15 @@ const elements = [createElement({ type: "shared", name: "segments", enforcePublicApi: true }),createElement({ type: "shared", name: "selectors" }),createElement({ type: "shared", name: "settings", enforcePublicApi: true }),+ // Settings-page rendering primitives, needed by admin, enterprise and+ // embedding alike. Not in shared/settings: that module is data only -- api,+ // selectors and hooks behind a private-by-default barrel -- and reading a+ // setting value should not drag React components in with it.+ createElement({+ type: "shared",+ name: "settings-components",+ enforcePublicApi: true,+ }),createElement({ type: "feature", name: "setup" }),createElement({ type: "shared", name: "static-viz" }),createElement({ type: "shared", name: "status" }),@@ -258,27 +277,28 @@ const elements = [createElement({ type: "shared", name: "visualizer" }),// feature- // The theme editor previews the live embed through the app-tier EAJS- // runtime, so the whole editor is an app-tier module. It still lives under- // the admin folder; the pattern must come before feature/admin (first match- // wins).- // TODO(embedding-modules): move the folder out of admin so module == folder.- createElement({- type: "app",- name: "theme-editor",- pattern: "frontend/src/metabase/admin/embedding/components/ThemeEditor/**",- }),- // Route composition for the admin app. Must precede feature/admin.- ...[- "frontend/src/metabase/admin/routes.tsx",- "frontend/src/metabase/admin/routes.unit.spec.tsx",- ].map((pattern) =>- createElement({ type: "app", name: "admin-routes", pattern, mode: "full" }),- ),createElement({ type: "feature", name: "admin" }),createElement({ type: "feature", name: "dashboard" }),createElement({ type: "feature", name: "data-studio" }),createElement({ type: "shared", name: "documents" }),+ // The hub's route table and the page that mounts the app-tier theme editor.+ // Must precede feature/embedding-hub: routes.tsx imports admin's permissions+ // routes (feature) and EmbeddingHubThemeEditorPage imports+ // EmbeddingThemeEditorApp (app), neither of which a feature module may import.+ ...[+ "frontend/src/metabase/embedding-hub/routes.tsx",+ "frontend/src/metabase/embedding-hub/routes.unit.spec.tsx",+ "frontend/src/metabase/embedding-hub/pages/EmbeddingHubThemeEditorPage.tsx",+ "frontend/src/metabase/embedding-hub/pages/EmbeddingHubThemeEditorPage.unit.spec.tsx",+ ].map((pattern) =>+ createElement({+ type: "app",+ name: "embedding-hub-routes",+ pattern,+ mode: "full",+ }),+ ),+ createElement({ type: "feature", name: "embedding-hub" }),// EE plugin-bootstrap files that only wire app-tier SDK modules into plugin// slots, so they're app tier, not feature/enterprise. Tagged by which embedding// product they belong to. Must precede the feature/enterprise element belowdiff --git a/frontend/src/embedding-sdk-bundle/components/private/SdkUsageProblem/SdkUsageProblemDisplay-simple-embedding.unit.spec.tsx b/frontend/src/embedding-sdk-bundle/components/private/SdkUsageProblem/SdkUsageProblemDisplay-simple-embedding.unit.spec.tsxindex d6cd2211c6c..ed496859d0e 100644--- a/frontend/src/embedding-sdk-bundle/components/private/SdkUsageProblem/SdkUsageProblemDisplay-simple-embedding.unit.spec.tsx+++ b/frontend/src/embedding-sdk-bundle/components/private/SdkUsageProblem/SdkUsageProblemDisplay-simple-embedding.unit.spec.tsx@@ -31,7 +31,7 @@ jest.mock("metabase/embedding-sdk/config", () => ({EMBEDDING_SDK_CONFIG: {isEmbeddingSdk: true,metabaseClientRequestHeader: "embedding-simple",- enableEmbeddingSettingKey: "enable-embedding-simple",+ enableEmbeddingSettingKey: "enable-embedding-modular",tokenFeatureKey: "embedding_simple",},EMBEDDING_SDK_IFRAME_EMBEDDING_CONFIG: {@@ -52,7 +52,7 @@ const setup = (options: Options) => {const settingValues = createMockSettings({"token-features": tokenFeatures,- "enable-embedding-simple": options.isSimpleEmbeddingEnabled ?? true,+ "enable-embedding-modular": options.isSimpleEmbeddingEnabled ?? true,});const MINUTE = 60;diff --git a/frontend/src/embedding-sdk-bundle/components/private/SdkUsageProblem/SdkUsageProblemDisplay.unit.spec.tsx b/frontend/src/embedding-sdk-bundle/components/private/SdkUsageProblem/SdkUsageProblemDisplay.unit.spec.tsxindex 0a8da163ec4..b4f717589ec 100644--- a/frontend/src/embedding-sdk-bundle/components/private/SdkUsageProblem/SdkUsageProblemDisplay.unit.spec.tsx+++ b/frontend/src/embedding-sdk-bundle/components/private/SdkUsageProblem/SdkUsageProblemDisplay.unit.spec.tsx@@ -46,7 +46,7 @@ const setup = ({ hasExpirationClaim = true, ...options }: Options) => {const settingValues = createMockSettings({"token-features": tokenFeatures,- "enable-embedding-sdk": options.isEmbeddingSdkEnabled ?? true,+ "enable-embedding-modular": options.isEmbeddingSdkEnabled ?? true,});const MINUTE = 60;@@ -200,7 +200,7 @@ describe("SdkUsageProblemDisplay", () => {const card = screen.getByTestId(PROBLEM_CARD_TEST_ID);// API keys are always allowed on localhost regardless of the- // `enable-embedding-sdk` setting, so the eval-only warning still shows —+ // `enable-embedding-modular` setting, so the eval-only warning still shows —// not the "not enabled" error.expect(within(card).getByText("This embed is powered by the Metabase SDK."),diff --git a/frontend/src/embedding-sdk-bundle/components/public/CollectionBrowser/CollectionBrowser.unit.spec.tsx b/frontend/src/embedding-sdk-bundle/components/public/CollectionBrowser/CollectionBrowser.unit.spec.tsxindex 75c9b80ae79..5e59a2ea852 100644--- a/frontend/src/embedding-sdk-bundle/components/public/CollectionBrowser/CollectionBrowser.unit.spec.tsx+++ b/frontend/src/embedding-sdk-bundle/components/public/CollectionBrowser/CollectionBrowser.unit.spec.tsx@@ -665,7 +665,7 @@ async function setupAll({...(currentUser ? { currentUser } : {}),...(tokenFeatures ? { tokenFeatures } : {}),settingValues: createMockSettings({- "enable-embedding-sdk": true,+ "enable-embedding-modular": true,"use-tenants": useTenants,}),});diff --git a/frontend/src/embedding-sdk-bundle/test/__support__/ui.tsx b/frontend/src/embedding-sdk-bundle/test/__support__/ui.tsxindex 7b5c1beee3d..f665f7706aa 100644--- a/frontend/src/embedding-sdk-bundle/test/__support__/ui.tsx+++ b/frontend/src/embedding-sdk-bundle/test/__support__/ui.tsx@@ -52,7 +52,7 @@ export function renderWithSDKProviders(// Without this, SDK components will not render due to missing token features and settings.if (!storeInitialState.settings && seededSettings) {seededSettings.values["token-features"].embedding_sdk = true;- seededSettings.values["enable-embedding-sdk"] = true;+ seededSettings.values["enable-embedding-modular"] = true;}if (seededSettings?.values) {diff --git a/frontend/src/embedding-sdk-bundle/test/server-mocks/sdk-init.ts b/frontend/src/embedding-sdk-bundle/test/server-mocks/sdk-init.tsindex ba9299cfb7c..b6693995850 100644--- a/frontend/src/embedding-sdk-bundle/test/server-mocks/sdk-init.ts+++ b/frontend/src/embedding-sdk-bundle/test/server-mocks/sdk-init.ts@@ -24,7 +24,7 @@ import {export const setupSdkState = ({currentUser = createMockUser(),- settingValues = createMockSettings({ "enable-embedding-sdk": true }),+ settingValues = createMockSettings({ "enable-embedding-modular": true }),tokenFeatures = createMockTokenFeatures({ embedding_sdk: true }),settingDefinitions = [],sdkState = createMockSdkState({diff --git a/frontend/src/metabase-types/api/mocks/metabot.ts b/frontend/src/metabase-types/api/mocks/metabot.tsindex 73bf9428e5d..80981c2918b 100644--- a/frontend/src/metabase-types/api/mocks/metabot.ts+++ b/frontend/src/metabase-types/api/mocks/metabot.ts@@ -123,9 +123,7 @@ export const MCP_APPS_BOOTSTRAP_SETTING_KEYS = ["embedding-app-origins-sdk","enable-embedding","enable-embedding-interactive",- "enable-embedding-sdk",- "enable-embedding-simple",- "enable-embedding-static",+ "enable-embedding-modular","enable-nested-queries","enable-password-login","enable-pivoted-exports",diff --git a/frontend/src/metabase-types/api/mocks/settings.ts b/frontend/src/metabase-types/api/mocks/settings.tsindex 9bcf0773082..678485ad8e1 100644--- a/frontend/src/metabase-types/api/mocks/settings.ts+++ b/frontend/src/metabase-types/api/mocks/settings.ts@@ -258,9 +258,7 @@ export const createMockSettings = ("embedding-app-origins-interactive": "","enable-embedding": false,"non-table-chart-generated": true,- "enable-embedding-static": false,- "enable-embedding-sdk": false,- "enable-embedding-simple": false,+ "enable-embedding-modular": false,"enable-embedding-interactive": false,"enable-nested-queries": true,"enable-pivoted-exports": true,@@ -287,8 +285,7 @@ export const createMockSettings = ("hide-embed-branding?": true,"instance-creation": dayjs().toISOString(),"show-static-embed-terms": true,- "show-sdk-embed-terms": true,- "show-simple-embed-terms": true,+ "show-modular-embed-terms": true,"google-auth-auto-create-accounts-domain": null,"google-auth-client-id": null,"google-auth-configured": false,diff --git a/frontend/src/metabase-types/api/settings.ts b/frontend/src/metabase-types/api/settings.tsindex 1fbf56bce7b..528b38bb0f2 100644--- a/frontend/src/metabase-types/api/settings.ts+++ b/frontend/src/metabase-types/api/settings.ts@@ -454,9 +454,7 @@ interface InstanceSettings {"email-smtp-username": string | null;"email-smtp-password": string | null;"enable-embedding": boolean;- "enable-embedding-static": boolean;- "enable-embedding-sdk": boolean;- "enable-embedding-simple": boolean;+ "enable-embedding-modular": boolean;"enable-embedding-interactive": boolean;"enable-nested-queries": boolean;"enable-public-sharing": boolean;@@ -509,8 +507,7 @@ interface AdminSettings {"version-info"?: VersionInfo | null;"last-acknowledged-version": string | null;"show-static-embed-terms": boolean | null;- "show-sdk-embed-terms": boolean | null;- "show-simple-embed-terms": boolean | null;+ "show-modular-embed-terms": boolean | null;"system-timezone"?: string;"embedding-homepage": EmbeddingHomepageStatus;"setup-license-active-at-setup": boolean;diff --git a/frontend/src/metabase-types/api/user.ts b/frontend/src/metabase-types/api/user.tsindex 638f582449c..f59c8e60c24 100644--- a/frontend/src/metabase-types/api/user.ts+++ b/frontend/src/metabase-types/api/user.ts@@ -208,6 +208,11 @@ export type UserKeyValue =key: "isNavbarOpened";value: boolean;}+ | {+ namespace: "embedding_hub";+ key: "isNavbarOpened";+ value: boolean;+ }| {namespace: "dependency_diagnostics";key: string;diff --git a/frontend/src/metabase/AppComponent.tsx b/frontend/src/metabase/AppComponent.tsxindex d44a3cd0f4e..7e9d47c6bd9 100644--- a/frontend/src/metabase/AppComponent.tsx+++ b/frontend/src/metabase/AppComponent.tsx@@ -7,6 +7,7 @@ import {getIsAppBarVisible,getIsDataApp,getIsDataStudioApp,+ getIsEmbeddingHubApp,getIsMonitorApp,getIsNavBarEnabled,} from "metabase/app/selectors";@@ -75,6 +76,9 @@ export function App() {const isMonitorApp = useSelector((state) =>getIsMonitorApp(state, routerProps),);+ const isEmbeddingHubApp = useSelector((state) =>+ getIsEmbeddingHubApp(state, routerProps),+ );const isDataApp = useSelector((state) => getIsDataApp(state, routerProps));const isAppBarVisible = useSelector((state) =>getIsAppBarVisible(state, routerProps),@@ -123,7 +127,11 @@ export function App() {<NewModals /><Metabothide={- isAdminApp || isDataStudioApp || isMonitorApp || isDataApp+ isAdminApp ||+ isDataStudioApp ||+ isMonitorApp ||+ isEmbeddingHubApp ||+ isDataApp}/></AppContentContainer>diff --git a/frontend/src/metabase/admin/ai/AIModelSettingsSection.tsx b/frontend/src/metabase/admin/ai/AIModelSettingsSection.tsxindex a79d8180296..df27583ae4b 100644--- a/frontend/src/metabase/admin/ai/AIModelSettingsSection.tsx+++ b/frontend/src/metabase/admin/ai/AIModelSettingsSection.tsx@@ -1,9 +1,11 @@import { t } from "ttag";-import { SettingsSection } from "metabase/admin/components/SettingsSection";-import { AdminSettingInput } from "metabase/admin/settings/components/widgets/AdminSettingInput";import { LlmModelPicker } from "metabase/metabot";import { useSetting } from "metabase/settings";+import {+ AdminSettingInput,+ SettingsSection,+} from "metabase/settings-components";import { Stack } from "metabase/ui";export function AIModelSettingsSection({ id }: { id?: string }) {diff --git a/frontend/src/metabase/admin/ai/AIProviderSettingsSection.tsx b/frontend/src/metabase/admin/ai/AIProviderSettingsSection.tsxindex c0efb7253f9..bba1d7dd1e1 100644--- a/frontend/src/metabase/admin/ai/AIProviderSettingsSection.tsx+++ b/frontend/src/metabase/admin/ai/AIProviderSettingsSection.tsx@@ -1,8 +1,8 @@import { t } from "ttag";-import { SettingsSection } from "metabase/admin/components/SettingsSection";import { useListLlmProvidersQuery } from "metabase/api";import { AIProviderList } from "metabase/metabot";+import { SettingsSection } from "metabase/settings-components";export function AIProviderSettingsSection({ id }: { id?: string }) {const { data: connections = [] } = useListLlmProvidersQuery();diff --git a/frontend/src/metabase/admin/ai/AISettingsPage.tsx b/frontend/src/metabase/admin/ai/AISettingsPage.tsxindex 09345618614..ae76c5b20b4 100644--- a/frontend/src/metabase/admin/ai/AISettingsPage.tsx+++ b/frontend/src/metabase/admin/ai/AISettingsPage.tsx@@ -1,10 +1,6 @@import type { ReactNode } from "react";import { jt, t } from "ttag";-import {- SettingsPageWrapper,- SettingsSection,-} from "metabase/admin/components/SettingsSection";import { ExternalLink } from "metabase/common/components/ExternalLink";import { Link } from "metabase/common/components/Link";import { LoadingAndErrorWrapper } from "metabase/common/components/LoadingAndErrorWrapper";@@ -18,6 +14,10 @@ import {} from "metabase/plugins";import { queryToSearch, useSearchParams } from "metabase/router";import { useAdminSetting, useSetting } from "metabase/settings";+import {+ SettingsPageWrapper,+ SettingsSection,+} from "metabase/settings-components";import { Divider, Flex, Stack, Switch, Tabs } from "metabase/ui";import { AIModelSettingsSection } from "./AIModelSettingsSection";diff --git a/frontend/src/metabase/admin/ai/MCPServerUrlSection.tsx b/frontend/src/metabase/admin/ai/MCPServerUrlSection.tsxindex 29e2a52ae23..22c88d75ea1 100644--- a/frontend/src/metabase/admin/ai/MCPServerUrlSection.tsx+++ b/frontend/src/metabase/admin/ai/MCPServerUrlSection.tsx@@ -1,7 +1,7 @@import { t } from "ttag";-import { SettingHeader } from "metabase/admin/settings/components/SettingHeader";import { CopyTextInput } from "metabase/common/components/CopyTextInput";+import { SettingHeader } from "metabase/settings-components";import { Box } from "metabase/ui";import S from "./MCPServerUrlSection.module.css";diff --git a/frontend/src/metabase/admin/ai/McpAppsSettings.tsx b/frontend/src/metabase/admin/ai/McpAppsSettings.tsxindex 06e8d0cafc0..0614d9bfdba 100644--- a/frontend/src/metabase/admin/ai/McpAppsSettings.tsx+++ b/frontend/src/metabase/admin/ai/McpAppsSettings.tsx@@ -1,12 +1,14 @@import { type ReactNode, useCallback, useState } from "react";import { jt, t } from "ttag";-import { SettingsSection } from "metabase/admin/components/SettingsSection";-import { SettingHeader } from "metabase/admin/settings/components/SettingHeader";-import { AdminSettingInput } from "metabase/admin/settings/components/widgets/AdminSettingInput";import { ExternalLink } from "metabase/common/components/ExternalLink";import { useDocsUrl } from "metabase/common/hooks";import { useAdminSetting } from "metabase/settings";+import {+ AdminSettingInput,+ SettingHeader,+ SettingsSection,+} from "metabase/settings-components";import { Box, Flex, Stack, Switch, Text } from "metabase/ui";import { CursorInstallLink } from "./CursorInstallLink";diff --git a/frontend/src/metabase/admin/ai/MetabotAdminSuggestedPrompts.tsx b/frontend/src/metabase/admin/ai/MetabotAdminSuggestedPrompts.tsxindex f4a1d23a49e..fda98417c60 100644--- a/frontend/src/metabase/admin/ai/MetabotAdminSuggestedPrompts.tsx+++ b/frontend/src/metabase/admin/ai/MetabotAdminSuggestedPrompts.tsx@@ -3,7 +3,6 @@ import { useMemo } from "react";import { match } from "ts-pattern";import { t } from "ttag";-import { SettingHeader } from "metabase/admin/settings/components/SettingHeader";import { ForwardRefLink } from "metabase/common/components/Link";import { PaginationControls } from "metabase/common/components/PaginationControls";import { Table } from "metabase/common/components/Table";@@ -15,6 +14,7 @@ import {useRegenerateSuggestedMetabotPromptsMutation,} from "metabase/metabot";import { FIXED_METABOT_IDS } from "metabase/metabot/constants";+import { SettingHeader } from "metabase/settings-components";import {ActionIcon,Box,diff --git a/frontend/src/metabase/admin/ai/MetabotSettingsPanel.tsx b/frontend/src/metabase/admin/ai/MetabotSettingsPanel.tsxindex 118d1162446..9049f64fefc 100644--- a/frontend/src/metabase/admin/ai/MetabotSettingsPanel.tsx+++ b/frontend/src/metabase/admin/ai/MetabotSettingsPanel.tsx@@ -3,7 +3,6 @@ import type { ReactNode } from "react";import { match } from "ts-pattern";import { c, t } from "ttag";-import { SettingHeader } from "metabase/admin/settings/components/SettingHeader";import { skipToken, useGetCollectionQuery } from "metabase/api";import { canonicalCollectionId } from "metabase/common/collections/utils";import { LoadingAndErrorWrapper } from "metabase/common/components/LoadingAndErrorWrapper";@@ -14,6 +13,7 @@ import { useUpdateMetabotMutation } from "metabase/metabot";import { FIXED_METABOT_ENTITY_IDS } from "metabase/metabot/constants";import { PLUGIN_MODERATION } from "metabase/plugins";import { useAdminSetting } from "metabase/settings";+import { SettingHeader } from "metabase/settings-components";import {Box,Button,diff --git a/frontend/src/metabase/admin/ai/MetabotSlackSetup.tsx b/frontend/src/metabase/admin/ai/MetabotSlackSetup.tsxindex ec08f423aa7..02209fd933b 100644--- a/frontend/src/metabase/admin/ai/MetabotSlackSetup.tsx+++ b/frontend/src/metabase/admin/ai/MetabotSlackSetup.tsx@@ -4,8 +4,6 @@ import { P, match } from "ts-pattern";import { c, t } from "ttag";import * as Yup from "yup";-import { SettingsSection } from "metabase/admin/components/SettingsSection";-import { BasicAdminSettingInput } from "metabase/admin/settings/components/widgets/AdminSettingInput";import { ConfirmModal } from "metabase/common/components/ConfirmModal";import { ExternalLink } from "metabase/common/components/ExternalLink";import { useDocsUrl } from "metabase/common/hooks";@@ -22,6 +20,10 @@ import {useAdminSettings,useSetting,} from "metabase/settings";+import {+ BasicAdminSettingInput,+ SettingsSection,+} from "metabase/settings-components";import { Accordion, Button, Flex, Stack, Text } from "metabase/ui";import * as Errors from "metabase/utils/errors";import type { SlackAppInfo } from "metabase-types/api/slack";diff --git a/frontend/src/metabase/admin/ai/OAuthAuthorizationsPage.tsx b/frontend/src/metabase/admin/ai/OAuthAuthorizationsPage.tsxindex 14e04547a1f..7cf8abbd6a1 100644--- a/frontend/src/metabase/admin/ai/OAuthAuthorizationsPage.tsx+++ b/frontend/src/metabase/admin/ai/OAuthAuthorizationsPage.tsx@@ -2,7 +2,6 @@ import { useMemo } from "react";import { t } from "ttag";import NoResults from "assets/img/no_results.svg";-import { SettingsPageWrapper } from "metabase/admin/components/SettingsSection";import { DateTime } from "metabase/common/components/DateTime";import { EmptyState } from "metabase/common/components/EmptyState";import { DelayedLoadingAndErrorWrapper } from "metabase/common/components/LoadingAndErrorWrapper/DelayedLoadingAndErrorWrapper";@@ -15,6 +14,7 @@ import {} from "metabase/common/hooks/use-url-state";import CS from "metabase/css/core/index.css";import { useLocation } from "metabase/router";+import { SettingsPageWrapper } from "metabase/settings-components";import {Badge,type BadgeColor,diff --git a/frontend/src/metabase/admin/app/reducers.ts b/frontend/src/metabase/admin/app/reducers.tsindex 49cf1461a82..abc0d700e76 100644--- a/frontend/src/metabase/admin/app/reducers.ts+++ b/frontend/src/metabase/admin/app/reducers.ts@@ -19,11 +19,6 @@ export const getAdminPaths: () => AdminPath[] = () => {path: "/admin/databases",key: "databases",},- {- getName: () => t`Embedding`,- path: "/admin/embedding",- key: "embedding",- },{getName: () => t`AI`,path: "/admin/metabot",diff --git a/frontend/src/metabase/admin/components/RelatedSettingsSection/RelatedSettingsSection.tsx b/frontend/src/metabase/admin/components/RelatedSettingsSection/RelatedSettingsSection.tsxindex 26846d6f025..ad845e9a29c 100644--- a/frontend/src/metabase/admin/components/RelatedSettingsSection/RelatedSettingsSection.tsx+++ b/frontend/src/metabase/admin/components/RelatedSettingsSection/RelatedSettingsSection.tsx@@ -1,36 +1,8 @@-import { t } from "ttag";-import { Link } from "metabase/common/components/Link";-import { Card, Group, Icon, SimpleGrid, Stack, Text } from "metabase/ui";+import { Card, Group, Icon, Text } from "metabase/ui";import type { IconName } from "metabase-types/api";import S from "./RelatedSettingsSection.module.css";-import type { RelatedSettingItem } from "./constants";--export function RelatedSettingsSection({- items,-}: {- items?: RelatedSettingItem[];-}) {- return (- <Stack gap="lg">- <Text size="lg" fw="bold" lh="xs">- {t`Related settings`}- </Text>-- <SimpleGrid cols={{ xs: 1, md: 3 }} spacing="lg">- {items?.map((item) => (- <RelatedSettingCard- key={item.to}- icon={item.icon}- name={item.name}- to={item.to}- />- ))}- </SimpleGrid>- </Stack>- );-}export const RelatedSettingCard = ({icon,diff --git a/frontend/src/metabase/admin/components/RelatedSettingsSection/constants.ts b/frontend/src/metabase/admin/components/RelatedSettingsSection/constants.tsdeleted file mode 100644index 1c177ec2d50..00000000000--- a/frontend/src/metabase/admin/components/RelatedSettingsSection/constants.ts+++ /dev/null@@ -1,101 +0,0 @@-import { t } from "ttag";--import { PLUGIN_TENANTS } from "metabase/plugins";-import type { IconName } from "metabase-types/api";-export interface RelatedSettingItem {- icon: IconName;- name: string;- to: string;-}--export const getModularEmbeddingRelatedSettingItems = ({- isUsingTenants,- hasSimpleEmbedding,-}: {- isUsingTenants?: boolean;- hasSimpleEmbedding?: boolean;-}): RelatedSettingItem[] => {- const isTenantsFeatureAvailable = PLUGIN_TENANTS.isEnabled;-- const items: RelatedSettingItem[] = [- ...(hasSimpleEmbedding- ? [- {- icon: "shield_outline" as const,- name: t`Security`,- to: "/admin/embedding/security",- },- ]- : []),- {- icon: "lock",- name: t`Authentication`,- to: "/admin/settings/authentication",- },- {- icon: "database",- name: t`Databases`,- to: "/admin/databases",- },- {- icon: "person",- name: t`People`,- to: "/admin/people",- },- {- icon: "group",- name: t`Permissions`,- to: "/admin/permissions",- },- ...(hasSimpleEmbedding- ? [- {- icon: "palette" as const,- name: t`Appearance`,- to: "/admin/settings/appearance",- },- ]- : []),- ...(isTenantsFeatureAvailable- ? [- {- icon: "globe" as const,- name: t`Tenants`,- to: isUsingTenants- ? "/admin/people/tenants"- : "/admin/people/user-strategy",- },- ]- : []),- ];-- return items;-};--export const getGuestEmbedsRelatedSettingItems = (): RelatedSettingItem[] => [- {- icon: "shield_outline",- name: t`Security`,- to: "/admin/embedding/security",- },- {- icon: "database",- name: t`Databases`,- to: "/admin/databases",- },- {- icon: "person",- name: t`People`,- to: "/admin/people",- },- {- icon: "group",- name: t`Permissions`,- to: "/admin/permissions",- },- {- icon: "palette",- name: t`Appearance`,- to: "/admin/settings/appearance",- },-];diff --git a/frontend/src/metabase/admin/components/RelatedSettingsSection/index.ts b/frontend/src/metabase/admin/components/RelatedSettingsSection/index.tsindex 1ab4bbac33f..57b1c637486 100644--- a/frontend/src/metabase/admin/components/RelatedSettingsSection/index.ts+++ b/frontend/src/metabase/admin/components/RelatedSettingsSection/index.ts@@ -1,9 +1 @@-export {- RelatedSettingsSection,- RelatedSettingCard,-} from "./RelatedSettingsSection";--export {- getModularEmbeddingRelatedSettingItems,- getGuestEmbedsRelatedSettingItems,-} from "./constants";+export { RelatedSettingCard } from "./RelatedSettingsSection";diff --git a/frontend/src/metabase/admin/databases/containers/DatabaseEditApp.tsx b/frontend/src/metabase/admin/databases/containers/DatabaseEditApp.tsxindex 7454b9b0296..d9389849707 100644--- a/frontend/src/metabase/admin/databases/containers/DatabaseEditApp.tsx+++ b/frontend/src/metabase/admin/databases/containers/DatabaseEditApp.tsx@@ -25,6 +25,7 @@ import { connect, useSelector } from "metabase/redux";import { Outlet, useParams } from "metabase/router";import { useSetting } from "metabase/settings";import { Box, Divider, Flex } from "metabase/ui";+import { isSameOrSiteUrlOrigin } from "metabase/utils/dom";import type { DatabaseId, Database as DatabaseType } from "metabase-types/api";import { DatabaseConnectionInfoSection } from "../components/DatabaseConnectionInfoSection";@@ -54,9 +55,20 @@ function DatabaseEditAppInner({const isModelPersistenceEnabled = useSetting("persisted-models-enabled");const databaseId = parseInt(params.databaseId ?? "", 10);- const fromEmbeddingSetupGuide = new URLSearchParams(- window.location.search,- ).has(RETURN_TO_SETUP_GUIDE_PARAM);+ // The param carries where the guide was opened from. Older links carry the+ // literal "true", which falls back to the default guide path.+ const returnToSetupGuide = new URLSearchParams(window.location.search).get(+ RETURN_TO_SETUP_GUIDE_PARAM,+ );+ const fromEmbeddingSetupGuide = returnToSetupGuide != null;+ // Checked the way `useSetupGuideReturnPath` checks the same param: the value+ // comes from the URL and is navigated to.+ const setupGuideOrigin =+ returnToSetupGuide &&+ returnToSetupGuide !== "true" &&+ isSameOrSiteUrlOrigin(returnToSetupGuide)+ ? returnToSetupGuide+ : undefined;const [showReturnModal, setShowReturnModal] = useState(false);const [pollingInterval, setPollingInterval] = useState<number>();@@ -156,6 +168,7 @@ function DatabaseEditAppInner({onClose={() => setShowReturnModal(false)}title={t`Database connected!`}message={t`Your database has been added and synced. Return to the setup guide to continue.`}+ returnTo={setupGuideOrigin}/>)}</>diff --git a/frontend/src/metabase/admin/databases/containers/DatabasePage.tsx b/frontend/src/metabase/admin/databases/containers/DatabasePage.tsxindex acf1d813011..9536a761fbf 100644--- a/frontend/src/metabase/admin/databases/containers/DatabasePage.tsx+++ b/frontend/src/metabase/admin/databases/containers/DatabasePage.tsx@@ -2,9 +2,9 @@ import { useDisclosure } from "@mantine/hooks";import { useEffect, useState } from "react";import { t } from "ttag";-import { SettingsSection } from "metabase/admin/components/SettingsSection";import { useParams } from "metabase/router";import { useSetting } from "metabase/settings";+import { SettingsSection } from "metabase/settings-components";import {Box,Button,diff --git a/frontend/src/metabase/admin/databases/hooks/use-database-connection.ts b/frontend/src/metabase/admin/databases/hooks/use-database-connection.tsindex aceb7962747..eadeb456440 100644--- a/frontend/src/metabase/admin/databases/hooks/use-database-connection.ts+++ b/frontend/src/metabase/admin/databases/hooks/use-database-connection.ts@@ -20,7 +20,7 @@ export const useDatabaseConnection = ({const queryParams = new URLSearchParams(location.search);const preselectedEngine =queryParams.get("engine") ?? getDefaultEngineKey(engines || {});- const fromEmbeddingSetupGuide = queryParams.has(RETURN_TO_SETUP_GUIDE_PARAM);+ const returnToSetupGuide = queryParams.get(RETURN_TO_SETUP_GUIDE_PARAM);const addingNewDatabase = databaseId === undefined;const databaseReq = useGetDatabaseQuery(@@ -42,9 +42,12 @@ export const useDatabaseConnection = ({const handleOnSubmit = (savedDB: { id: DatabaseId }) => {if (addingNewDatabase) {- const param = fromEmbeddingSetupGuide- ? `?${RETURN_TO_SETUP_GUIDE_PARAM}=true`- : "";+ // Carried through so the post-sync modal returns to whichever host+ // opened the guide, not always the default one.+ const param =+ returnToSetupGuide != null+ ? `?${RETURN_TO_SETUP_GUIDE_PARAM}=${encodeURIComponent(returnToSetupGuide)}`+ : "";navigate(`/admin/databases/${savedDB.id}${param}`);} else {handleCancel();diff --git a/frontend/src/metabase/admin/embedding/components/EmbeddingNav.tsx b/frontend/src/metabase/admin/embedding/components/EmbeddingNav.tsxdeleted file mode 100644index 645d06203a2..00000000000--- a/frontend/src/metabase/admin/embedding/components/EmbeddingNav.tsx+++ /dev/null@@ -1,78 +0,0 @@-import { t } from "ttag";--import {- AdminNavItem,- type AdminNavItemProps,- AdminNavWrapper,-} from "metabase/admin/components/AdminNav";-import { UpsellGem } from "metabase/common/components/upsells/components/UpsellGem";-import { useHasTokenFeature } from "metabase/common/hooks";-import { useLocation } from "metabase/router";-import { Divider, Flex, Stack } from "metabase/ui";--export function EmbeddingNav() {- const hasSimpleEmbedding = useHasTokenFeature("embedding_simple");-- return (- <AdminNavWrapper>- <Stack gap="xxs">- {hasSimpleEmbedding && (- <>- <EmbeddingNavItem- path="/admin/embedding/setup-guide"- label={t`Setup guide`}- icon="list"- />-- <Divider mb="sm" />- </>- )}-- <EmbeddingNavItem- path="/admin/embedding"- label={- <Flex gap="sm" align="center">- <span>{t`Settings`}</span>- </Flex>- }- icon="gear"- />-- {/* EE with non-starter plan has embedding settings on different pages */}- {hasSimpleEmbedding && (- <EmbeddingNavItem- path="/admin/embedding/guest"- label={t`Guest embeds`}- icon="ghost"- />- )}-- <EmbeddingNavItem- path="/admin/embedding/security"- label={t`Security`}- icon="shield_outline"- />-- <EmbeddingNavItem- path="/admin/embedding/themes"- label={- <Flex gap="sm" align="center">- <span>{t`Themes`}</span>- {!hasSimpleEmbedding && <UpsellGem />}- </Flex>- }- icon="palette"- />- </Stack>- </AdminNavWrapper>- );-}--const EmbeddingNavItem = (props: AdminNavItemProps) => {- const location = useLocation();- const subpath = location.pathname;-- const isActive = props.path === subpath;-- return <AdminNavItem {...props} active={isActive} />;-};diff --git a/frontend/src/metabase/admin/embedding/components/EmbeddingNav.unit.spec.tsx b/frontend/src/metabase/admin/embedding/components/EmbeddingNav.unit.spec.tsxdeleted file mode 100644index ce150fc42e9..00000000000--- a/frontend/src/metabase/admin/embedding/components/EmbeddingNav.unit.spec.tsx+++ /dev/null@@ -1,50 +0,0 @@-import { createMockSettingsState } from "__support__/state";-import { renderWithProviders, screen, within } from "__support__/ui";-import { Route } from "metabase/router";-import {- createMockSettings,- createMockTokenFeatures,- createMockUser,-} from "metabase-types/api/mocks";--import { EmbeddingNav } from "./EmbeddingNav";--const setup = ({- hasSimpleEmbedding = false,-}: {- hasSimpleEmbedding?: boolean;-} = {}) => {- const initialRoute = "/admin/embedding/themes";- const settings = createMockSettings({- "token-features": createMockTokenFeatures({- embedding_simple: hasSimpleEmbedding,- }),- });-- renderWithProviders(<Route path="*" element={<EmbeddingNav />} />, {- withRouter: true,- initialRoute,- storeInitialState: {- currentUser: createMockUser({ is_superuser: true }),- settings: createMockSettingsState(settings),- },- });-};--describe("EmbeddingNav", () => {- it("shows an upsell gem next to the Themes label for OSS/starter users", () => {- setup({ hasSimpleEmbedding: false });-- const themesLink = screen.getByRole("link", { name: /Themes/ });- expect(within(themesLink).getByTestId("upsell-gem")).toBeInTheDocument();- });-- it("does not show an upsell gem next to the Themes label for Pro users", () => {- setup({ hasSimpleEmbedding: true });-- const themesLink = screen.getByRole("link", { name: /Themes/ });- expect(- within(themesLink).queryByTestId("upsell-gem"),- ).not.toBeInTheDocument();- });-});diff --git a/frontend/src/metabase/admin/embedding/components/ThemeEditor/ColorRow.tsx b/frontend/src/metabase/admin/embedding/components/ThemeEditor/ColorRow.tsxdeleted file mode 100644index 4690a509d55..00000000000--- a/frontend/src/metabase/admin/embedding/components/ThemeEditor/ColorRow.tsx+++ /dev/null@@ -1,17 +0,0 @@-import { ColorPicker } from "metabase/common/components/ColorPicker";-import { Flex, Text } from "metabase/ui";--interface ColorRowProps {- label: string;- value: string;- onChange: (color?: string) => void;-}--export function ColorRow({ label, value, onChange }: ColorRowProps) {- return (- <Flex align="center" justify="space-between">- <Text fz="sm">{label}</Text>- <ColorPicker value={value} onChange={onChange} />- </Flex>- );-}diff --git a/frontend/src/metabase/admin/embedding/components/ThemeListing/EmbeddingThemeListingApp.unit.spec.tsx b/frontend/src/metabase/admin/embedding/components/ThemeListing/EmbeddingThemeListingApp.unit.spec.tsxdeleted file mode 100644index ff9a39c3cb3..00000000000--- a/frontend/src/metabase/admin/embedding/components/ThemeListing/EmbeddingThemeListingApp.unit.spec.tsx+++ /dev/null@@ -1,69 +0,0 @@-import fetchMock from "fetch-mock";--import { createMockSettingsState } from "__support__/state";-import { renderWithProviders, screen } from "__support__/ui";-import {- createMockSettings,- createMockTokenFeatures,- createMockUser,-} from "metabase-types/api/mocks";--import { EmbeddingThemeListingApp } from "./EmbeddingThemeListingApp";--const setup = ({- hasSimpleEmbedding = false,-}: {- hasSimpleEmbedding?: boolean;-} = {}) => {- fetchMock.get("path:/api/embed-theme", []);-- const settings = createMockSettings({- "token-features": createMockTokenFeatures({- embedding_simple: hasSimpleEmbedding,- }),- });-- renderWithProviders(<EmbeddingThemeListingApp />, {- storeInitialState: {- currentUser: createMockUser({ is_superuser: true }),- settings: createMockSettingsState(settings),- },- });-};--describe("EmbeddingThemeListingApp", () => {- it("renders the themes upsell for OSS/starter users", async () => {- setup({ hasSimpleEmbedding: false });-- expect(await screen.findByText("Create custom themes")).toBeInTheDocument();- expect(- screen.queryByRole("heading", { name: "Themes" }),- ).not.toBeInTheDocument();- expect(- screen.queryByRole("button", { name: /New theme/ }),- ).not.toBeInTheDocument();- });-- it("renders the themes listing for Pro users", async () => {- setup({ hasSimpleEmbedding: true });-- expect(- await screen.findByRole("heading", { name: "Themes" }),- ).toBeInTheDocument();- expect(- screen.getByRole("button", { name: /New theme/ }),- ).toBeInTheDocument();- expect(screen.queryByText("Create custom themes")).not.toBeInTheDocument();- });-- it("does not request themes from the API when showing the upsell", async () => {- setup({ hasSimpleEmbedding: false });-- await screen.findByText("Create custom themes");-- // Give RTK Query a chance to fire the request if it were going to.- expect(fetchMock.callHistory.calls("path:/api/embed-theme")).toHaveLength(- 0,- );- });-});diff --git a/frontend/src/metabase/admin/embedding/containers/AdminEmbeddingApp.tsx b/frontend/src/metabase/admin/embedding/containers/AdminEmbeddingApp.tsxdeleted file mode 100644index de14019a219..00000000000--- a/frontend/src/metabase/admin/embedding/containers/AdminEmbeddingApp.tsx+++ /dev/null@@ -1,41 +0,0 @@-import { AdminSettingsLayout } from "metabase/admin/components/AdminLayout/AdminSettingsLayout";-import { Outlet, useLocation } from "metabase/router";--import { EmbeddingNav } from "../components/EmbeddingNav";-import { useEnsureDefaultEmbeddingThemes } from "../hooks";--const SIDEBAR_HIDDEN_PATHS = new Set([- "/admin/embedding/setup-guide/permissions",- "/admin/embedding/setup-guide/sso",-]);--// routes in this array won't render the embedding sidebar-const SIDEBAR_HIDDEN_PATH_PREFIXES = ["/admin/embedding/themes/"];--// routes in this array will take the full width _of the main content area_-const FULL_CONTENT_WIDTH_PATH_PREFIXES = ["/admin/embedding/themes/"];--export const AdminEmbeddingApp = () => {- const location = useLocation();-- useEnsureDefaultEmbeddingThemes();-- const shouldHideSidebar =- SIDEBAR_HIDDEN_PATHS.has(location.pathname) ||- SIDEBAR_HIDDEN_PATH_PREFIXES.some((prefix) =>- location.pathname.startsWith(prefix),- );-- const isFullWidth = FULL_CONTENT_WIDTH_PATH_PREFIXES.some((prefix) =>- location.pathname.startsWith(prefix),- );-- return (- <AdminSettingsLayout- sidebar={shouldHideSidebar ? undefined : <EmbeddingNav />}- fullWidth={isFullWidth}- >- <Outlet />- </AdminSettingsLayout>- );-};diff --git a/frontend/src/metabase/admin/embedding/containers/AdminEmbeddingApp.unit.spec.tsx b/frontend/src/metabase/admin/embedding/containers/AdminEmbeddingApp.unit.spec.tsxdeleted file mode 100644index b3ae177e363..00000000000--- a/frontend/src/metabase/admin/embedding/containers/AdminEmbeddingApp.unit.spec.tsx+++ /dev/null@@ -1,51 +0,0 @@-import { renderWithProviders, screen } from "__support__/ui";-import { Route } from "metabase/router";--import { AdminEmbeddingApp } from "./AdminEmbeddingApp";--describe("AdminEmbeddingApp", () => {- it("shows the sidebar on the setup guide root", () => {- renderWithProviders(<Route path="*" element={<AdminEmbeddingApp />} />, {- initialRoute: "/admin/embedding/setup-guide",- withRouter: true,- });-- expect(screen.getByTestId("admin-layout-sidebar")).toBeInTheDocument();- });-- it.each([- "/admin/embedding/setup-guide/permissions",- "/admin/embedding/setup-guide/sso",- ])("hides the sidebar for %s", (pathname) => {- renderWithProviders(<Route path="*" element={<AdminEmbeddingApp />} />, {- initialRoute: pathname,- withRouter: true,- });-- expect(- screen.queryByTestId("admin-layout-sidebar"),- ).not.toBeInTheDocument();- expect(screen.getByTestId("admin-layout-content")).toBeInTheDocument();- });-- it("hides the sidebar for theme editor paths", () => {- renderWithProviders(<Route path="*" element={<AdminEmbeddingApp />} />, {- initialRoute: "/admin/embedding/themes/42",- withRouter: true,- });-- expect(- screen.queryByTestId("admin-layout-sidebar"),- ).not.toBeInTheDocument();- expect(screen.getByTestId("admin-layout-content")).toBeInTheDocument();- });-- it("shows the sidebar on the themes listing page", () => {- renderWithProviders(<Route path="*" element={<AdminEmbeddingApp />} />, {- initialRoute: "/admin/embedding/themes",- withRouter: true,- });-- expect(screen.getByTestId("admin-layout-sidebar")).toBeInTheDocument();- });-});diff --git a/frontend/src/metabase/admin/embedding/embedding-hub/EmbeddingHubAdminSettingsPage.tsx b/frontend/src/metabase/admin/embedding/embedding-hub/EmbeddingHubAdminSettingsPage.tsxdeleted file mode 100644index f0aa661cb2e..00000000000--- a/frontend/src/metabase/admin/embedding/embedding-hub/EmbeddingHubAdminSettingsPage.tsx+++ /dev/null@@ -1,36 +0,0 @@-import { t } from "ttag";--import {- RelatedSettingsSection,- getModularEmbeddingRelatedSettingItems,-} from "metabase/admin/components/RelatedSettingsSection";-import { useHasTokenFeature } from "metabase/common/hooks";-import { EmbeddingHub } from "metabase/embedding/embedding-hub";-import { useSetting } from "metabase/settings";-import { Stack, Text, Title } from "metabase/ui";--export const EmbeddingHubAdminSettingsPage = () => {- const isUsingTenants = useSetting("use-tenants");- const hasSimpleEmbedding = useHasTokenFeature("embedding_simple");-- return (- <Stack mx="auto" py="xxl" gap="xxl" maw={800}>- <Stack gap="xxs">- <Title order={1} c="text-primary">{t`Embedding setup guide`}</Title>-- <Text c="text-secondary">{t`Follow the guide to get started with modular embedding`}</Text>- </Stack>-- <EmbeddingHub />-- <Stack ml="2.7rem">- <RelatedSettingsSection- items={getModularEmbeddingRelatedSettingItems({- isUsingTenants,- hasSimpleEmbedding,- })}- />- </Stack>- </Stack>- );-};diff --git a/frontend/src/metabase/admin/embedding/embedding-hub/index.ts b/frontend/src/metabase/admin/embedding/embedding-hub/index.tsdeleted file mode 100644index 4144bafd687..00000000000--- a/frontend/src/metabase/admin/embedding/embedding-hub/index.ts+++ /dev/null@@ -1 +0,0 @@-export { EmbeddingHubAdminSettingsPage } from "./EmbeddingHubAdminSettingsPage";diff --git a/frontend/src/metabase/admin/help/Help.tsx b/frontend/src/metabase/admin/help/Help.tsxindex 576f8a7ea7f..1a90d8b3e07 100644--- a/frontend/src/metabase/admin/help/Help.tsx+++ b/frontend/src/metabase/admin/help/Help.tsx@@ -4,10 +4,6 @@ import { t } from "ttag";import _ from "underscore";import { AdminSettingsLayout } from "metabase/admin/components/AdminLayout/AdminSettingsLayout";-import {- SettingsPageWrapper,- SettingsSection,-} from "metabase/admin/components/SettingsSection";import { UpsellBetterSupport } from "metabase/admin/upsells";import { useGetBugReportDetailsQuery } from "metabase/api/bug-report";import { CopyButton } from "metabase/common/components/CopyButton";@@ -18,6 +14,10 @@ import { useSelector } from "metabase/redux";import { Outlet } from "metabase/router";import { getIsPaidPlan } from "metabase/selectors/settings";import { useSetting } from "metabase/settings";+import {+ SettingsPageWrapper,+ SettingsSection,+} from "metabase/settings-components";import { Box, Code, Group } from "metabase/ui";import { getBasename } from "metabase/utils/basename";diff --git a/frontend/src/metabase/admin/people/components/GroupDetail.tsx b/frontend/src/metabase/admin/people/components/GroupDetail.tsxindex 0929d816c4c..7d8e0f60ad2 100644--- a/frontend/src/metabase/admin/people/components/GroupDetail.tsx+++ b/frontend/src/metabase/admin/people/components/GroupDetail.tsx@@ -2,7 +2,6 @@ import { useState } from "react";import { msgid, ngettext, t } from "ttag";import { AdminPaneLayout } from "metabase/admin/components/AdminPaneLayout";-import { SettingsSection } from "metabase/admin/components/SettingsSection";import {useCreateMembershipMutation,useDeleteMembershipMutation,@@ -19,6 +18,7 @@ import {} from "metabase/common/utils/groups";import { PLUGIN_GROUP_MANAGERS, PLUGIN_TENANTS } from "metabase/plugins";import { useDispatch } from "metabase/redux";+import { SettingsSection } from "metabase/settings-components";import { Box, Button, Text } from "metabase/ui";import type { Group, Member, Membership, User } from "metabase-types/api";diff --git a/frontend/src/metabase/admin/people/components/GroupsListing.tsx b/frontend/src/metabase/admin/people/components/GroupsListing.tsxindex 83199f971ca..3c9abf58eb9 100644--- a/frontend/src/metabase/admin/people/components/GroupsListing.tsx+++ b/frontend/src/metabase/admin/people/components/GroupsListing.tsx@@ -10,6 +10,7 @@ import { ConfirmModal } from "metabase/common/components/ConfirmModal";import { Link } from "metabase/common/components/Link";import { LoadingAndErrorWrapper } from "metabase/common/components/LoadingAndErrorWrapper";import { UserAvatar } from "metabase/common/components/UserAvatar";+import { getTenantsBasePath } from "metabase/common/tenants";import {getGroupNameLocalized,isAdminGroup,@@ -218,7 +219,7 @@ function EditingGroupRow({function GroupNameCell({ group }: { group: GroupInfo }) {const name = getGroupNameLocalized(group);const membersLink = PLUGIN_TENANTS.isTenantGroup(group)- ? `/admin/people/tenants/groups/${group.id}`+ ? `${getTenantsBasePath()}/groups/${group.id}`: `/admin/people/groups/${group.id}`;return (diff --git a/frontend/src/metabase/admin/people/containers/AdminPeopleApp/AdminPeopleApp.unit.spec.tsx b/frontend/src/metabase/admin/people/containers/AdminPeopleApp/AdminPeopleApp.unit.spec.tsxindex 8eb8f02660b..fd65865313f 100644--- a/frontend/src/metabase/admin/people/containers/AdminPeopleApp/AdminPeopleApp.unit.spec.tsx+++ b/frontend/src/metabase/admin/people/containers/AdminPeopleApp/AdminPeopleApp.unit.spec.tsx@@ -154,7 +154,7 @@ describe("AdminPeopleApp", () => {await setupTenantRoute("/admin/people/tenants");expect(- await screen.findByText("Manage customer-facing analytics at scale"),+ await screen.findByText("Use a multi-tenant user strategy"),).toBeInTheDocument();});});diff --git a/frontend/src/metabase/admin/people/containers/GroupDetailApp.tsx b/frontend/src/metabase/admin/people/containers/GroupDetailApp.tsxindex dafdc1572f7..6661f6867c5 100644--- a/frontend/src/metabase/admin/people/containers/GroupDetailApp.tsx+++ b/frontend/src/metabase/admin/people/containers/GroupDetailApp.tsx@@ -1,6 +1,5 @@import { t } from "ttag";-import { SettingsPageWrapper } from "metabase/admin/components/SettingsSection";import {useGetPermissionsGroupQuery,useListUserMembershipsQuery,@@ -9,6 +8,7 @@ import { LoadingAndErrorWrapper } from "metabase/common/components/LoadingAndErrimport { getUser } from "metabase/current-user";import { useSelector } from "metabase/redux";import { useParams } from "metabase/router";+import { SettingsPageWrapper } from "metabase/settings-components";import { GroupDetail } from "../components/GroupDetail";diff --git a/frontend/src/metabase/admin/people/containers/GroupsListingApp.tsx b/frontend/src/metabase/admin/people/containers/GroupsListingApp.tsxindex 5275ce59ec0..653ccc19344 100644--- a/frontend/src/metabase/admin/people/containers/GroupsListingApp.tsx+++ b/frontend/src/metabase/admin/people/containers/GroupsListingApp.tsx@@ -2,10 +2,6 @@ import { useMemo } from "react";import { t } from "ttag";import _ from "underscore";-import {- SettingsPageWrapper,- SettingsSection,-} from "metabase/admin/components/SettingsSection";import {useCreatePermissionsGroupMutation,useDeletePermissionsGroupMutation,@@ -13,10 +9,15 @@ import {useUpdatePermissionsGroupMutation,} from "metabase/api";import { LoadingAndErrorWrapper } from "metabase/common/components/LoadingAndErrorWrapper";+import { isEmbeddingHubTenancy } from "metabase/common/tenants";import { getUserIsAdmin } from "metabase/current-user";import { PLUGIN_GROUP_MANAGERS, PLUGIN_TENANTS } from "metabase/plugins";import { useDispatch, useSelector } from "metabase/redux";import { useSetting } from "metabase/settings";+import {+ SettingsPageWrapper,+ SettingsSection,+} from "metabase/settings-components";import type { Group } from "metabase-types/api";import { GroupsListing } from "../components/GroupsListing";@@ -75,8 +76,10 @@ export const GroupsListingApp = ({return external ? t`Tenant groups` : t`Internal groups`;}, [external, isUsingTenants]);+ const isEmbeddingHub = isEmbeddingHubTenancy();+return (- <SettingsPageWrapper title={pageTitle}>+ <SettingsPageWrapper title={isEmbeddingHub ? undefined : pageTitle}><SettingsSection><LoadingAndErrorWrapper error={error} loading={isLoading}><GroupsListingdiff --git a/frontend/src/metabase/admin/people/containers/PeopleListingApp/PeopleListingApp.tsx b/frontend/src/metabase/admin/people/containers/PeopleListingApp/PeopleListingApp.tsxindex 3f768dfe1c8..b03c1572853 100644--- a/frontend/src/metabase/admin/people/containers/PeopleListingApp/PeopleListingApp.tsx+++ b/frontend/src/metabase/admin/people/containers/PeopleListingApp/PeopleListingApp.tsx@@ -1,15 +1,16 @@import { useEffect, useMemo } from "react";import { t } from "ttag";-import { SettingsSection } from "metabase/admin/components/SettingsSection";import { useListPermissionsGroupsQuery, useListUsersQuery } from "metabase/api";import { Link } from "metabase/common/components/Link";import { LoadingAndErrorWrapper } from "metabase/common/components/LoadingAndErrorWrapper";+import { isEmbeddingHubTenancy } from "metabase/common/tenants";import { getUser, getUserIsAdmin } from "metabase/current-user";import { PLUGIN_TENANTS } from "metabase/plugins";import { useSelector } from "metabase/redux";import { Outlet } from "metabase/router";import { useSetting } from "metabase/settings";+import { SettingsSection } from "metabase/settings-components";import { Box, Button, Flex, Group, Tabs, Title } from "metabase/ui";import * as Urls from "metabase/urls";@@ -98,15 +99,19 @@ export function PeopleListingApp({return external ? t`Tenant users` : t`Internal users`;}, [external, isUsingTenants]);+ const isEmbeddingHub = isEmbeddingHubTenancy();+return (<div>- <Group justify="space-between" w="100%" mb="xl">- <Title order={1}>{pageTitle}</Title>-- {!external && (- <PLUGIN_TENANTS.EditUserStrategySettingsButton page="people" />- )}- </Group>+ {(!isEmbeddingHub || !external) && (+ <Group justify="space-between" w="100%" mb="xl">+ {!isEmbeddingHub && <Title order={1}>{pageTitle}</Title>}++ {!external && (+ <PLUGIN_TENANTS.EditUserStrategySettingsButton page="people" />+ )}+ </Group>+ )}{isAdmin && hasDeactivatedUsers && (<Tabsdiff --git a/frontend/src/metabase/admin/people/containers/UserSuccessModal.tsx b/frontend/src/metabase/admin/people/containers/UserSuccessModal.tsxindex 033912385db..5c36164c0be 100644--- a/frontend/src/metabase/admin/people/containers/UserSuccessModal.tsx+++ b/frontend/src/metabase/admin/people/containers/UserSuccessModal.tsx@@ -7,6 +7,7 @@ import { ConfirmModal } from "metabase/common/components/ConfirmModal";import { Link } from "metabase/common/components/Link";import { LoadingAndErrorWrapper } from "metabase/common/components/LoadingAndErrorWrapper";import { PasswordReveal } from "metabase/common/components/PasswordReveal";+import { getTenantsBasePath } from "metabase/common/tenants";import CS from "metabase/css/core/index.css";import { PLUGIN_TENANTS } from "metabase/plugins";import { useDispatch, useSelector } from "metabase/redux";@@ -14,6 +15,7 @@ import { useNavigate } from "metabase/router";import { isSsoEnabled } from "metabase/selectors/settings";import { getSetting } from "metabase/settings";import { Box } from "metabase/ui";+import * as Urls from "metabase/urls";import type { User } from "metabase-types/api";import { clearTemporaryPassword } from "../people";@@ -40,7 +42,9 @@ export function UserSuccessModal({ params }: UserSuccessModalProps) {const navigate = useNavigate();const handleClose = () => {- navigate(isExternalUser ? "/admin/people/tenants/people" : "/admin/people");+ navigate(+ isExternalUser ? `${getTenantsBasePath()}/people` : "/admin/people",+ );};useEffect(() => {@@ -51,7 +55,7 @@ export function UserSuccessModal({ params }: UserSuccessModalProps) {useEffect(() => {if (isExternalUser && !temporaryPassword) {- navigate("/admin/people/tenants/people", { replace: true });+ navigate(`${getTenantsBasePath()}/people`, { replace: true });}}, [isExternalUser, temporaryPassword, navigate]);@@ -97,7 +101,7 @@ const EmailSuccess = ({)} with instructions to log in. If this user is unable to authenticate then you can ${(<Linkkey="link"- to={`/admin/people/${user.id}/reset`}+ to={Urls.resetPassword(user)}className={CS.link}>{t`reset their password.`}</Link>)}`}</div>diff --git a/frontend/src/metabase/admin/performance/components/ModelPersistenceConfiguration.tsx b/frontend/src/metabase/admin/performance/components/ModelPersistenceConfiguration.tsxindex 8fe443c82ae..5cfd8231452 100644--- a/frontend/src/metabase/admin/performance/components/ModelPersistenceConfiguration.tsx+++ b/frontend/src/metabase/admin/performance/components/ModelPersistenceConfiguration.tsx@@ -2,10 +2,6 @@ import type { ChangeEvent } from "react";import { useEffect, useState } from "react";import { c, msgid, ngettext, t } from "ttag";-import {- SettingsPageWrapper,- SettingsSection,-} from "metabase/admin/components/SettingsSection";import { ModelCachingScheduleWidget } from "metabase/admin/settings/components/widgets/ModelCachingScheduleWidget/ModelCachingScheduleWidget";import {useDisablePersistMutation,@@ -21,6 +17,10 @@ import {getShowMetabaseLinks,} from "metabase/selectors/whitelabel";import { useSetting } from "metabase/settings";+import {+ SettingsPageWrapper,+ SettingsSection,+} from "metabase/settings-components";import { Switch, Text } from "metabase/ui";import ModelPersistenceConfigurationS from "./ModelPersistenceConfiguration.module.css";diff --git a/frontend/src/metabase/admin/performance/components/StrategyEditorForDatabases.tsx b/frontend/src/metabase/admin/performance/components/StrategyEditorForDatabases.tsxindex 5e2772ac6b8..f404361ab03 100644--- a/frontend/src/metabase/admin/performance/components/StrategyEditorForDatabases.tsx+++ b/frontend/src/metabase/admin/performance/components/StrategyEditorForDatabases.tsx@@ -2,10 +2,10 @@ import { useEffect, useState } from "react";import { t } from "ttag";import { findWhere } from "underscore";-import { SettingsPageWrapper } from "metabase/admin/components/SettingsSection";import { UpsellCacheConfig } from "metabase/admin/upsells";import { DelayedLoadingAndErrorWrapper } from "metabase/common/components/LoadingAndErrorWrapper/DelayedLoadingAndErrorWrapper";import { PLUGIN_CACHING } from "metabase/plugins";+import { SettingsPageWrapper } from "metabase/settings-components";import { Box, Flex } from "metabase/ui";import { rootId } from "../constants/simple";diff --git a/frontend/src/metabase/admin/permissions/components/FilterableTree/AdminTreeNode.module.css b/frontend/src/metabase/admin/permissions/components/FilterableTree/AdminTreeNode.module.cssnew file mode 100644index 00000000000..800423ff9ef--- /dev/null+++ b/frontend/src/metabase/admin/permissions/components/FilterableTree/AdminTreeNode.module.css@@ -0,0 +1,42 @@+/*+ * `:not([data-css-specificity-hack])` rather than a bare class: this needs+ * to beat `TreeNodeRoot`'s own emotion-generated color/background rules+ * (tree/TreeNode.styled.tsx), which are also single-class specificity, so+ * source order alone can't be trusted to pick a winner. See+ * ArchiveButton.module.css / MetricExpressionPill.module.css for the same+ * trick elsewhere.+ */++.adminSelected:not([data-css-specificity-hack="🦑"]) {+ color: var(--mb-color-core-white);+ background-color: var(--mb-color-navbar-admin);+}++.adminSelected:not([data-css-specificity-hack="🦑"]):hover {+ background-color: var(--mb-color-navbar-admin);+}++.adminUnselected:not([data-css-specificity-hack="🦑"]) {+ color: var(--mb-color-text-secondary);+}++.adminUnselected:not([data-css-specificity-hack="🦑"]):hover {+ background-color: var(--mb-color-navbar-admin-secondary);+}++.hubSelected:not([data-css-specificity-hack="🦑"]) {+ color: var(--mb-color-core-white);+ background-color: var(--mb-color-brand);+}++.hubSelected:not([data-css-specificity-hack="🦑"]):hover {+ background-color: var(--mb-color-brand-hover);+}++.hubUnselected:not([data-css-specificity-hack="🦑"]) {+ color: var(--mb-color-text-secondary);+}++.hubUnselected:not([data-css-specificity-hack="🦑"]):hover {+ background-color: var(--mb-color-background_surface-brand-subtle);+}diff --git a/frontend/src/metabase/admin/permissions/components/FilterableTree/AdminTreeNode.tsx b/frontend/src/metabase/admin/permissions/components/FilterableTree/AdminTreeNode.tsxnew file mode 100644index 00000000000..ed0708b1b86--- /dev/null+++ b/frontend/src/metabase/admin/permissions/components/FilterableTree/AdminTreeNode.tsx@@ -0,0 +1,29 @@+import { forwardRef } from "react";++import { isEmbeddingHubPermissions } from "metabase/admin/permissions/utils/is-embedding-hub";+import { Tree } from "metabase/common/components/tree";+import type { TreeNodeProps } from "metabase/common/components/tree/types";++import styles from "./AdminTreeNode.module.css";++/**+ * Switches between admin's purple and the hub's blue. See `is-embedding-hub.ts`.+ */+export const AdminTreeNode = forwardRef<HTMLLIElement, TreeNodeProps>(+ function AdminTreeNode(props, ref) {+ const className = getTreeNodeClassName(+ isEmbeddingHubPermissions(),+ props.isSelected,+ );++ return <Tree.Node {...props} ref={ref} className={className} />;+ },+);++function getTreeNodeClassName(isEmbeddingHub: boolean, isSelected: boolean) {+ if (isEmbeddingHub) {+ return isSelected ? styles.hubSelected : styles.hubUnselected;+ }++ return isSelected ? styles.adminSelected : styles.adminUnselected;+}diff --git a/frontend/src/metabase/admin/permissions/components/FilterableTree/FilterableTree.styled.tsx b/frontend/src/metabase/admin/permissions/components/FilterableTree/FilterableTree.styled.tsxindex 26c51bc4fd2..8c897965af8 100644--- a/frontend/src/metabase/admin/permissions/components/FilterableTree/FilterableTree.styled.tsx+++ b/frontend/src/metabase/admin/permissions/components/FilterableTree/FilterableTree.styled.tsx@@ -1,9 +1,6 @@// eslint-disable-next-line no-restricted-importsimport styled from "@emotion/styled";-import { Tree } from "metabase/common/components/tree";-import { color } from "metabase/ui/utils/colors";-export const FilterableTreeRoot = styled.div`display: flex;flex-direction: column;@@ -27,19 +24,3 @@ export const ItemGroupsDivider = styled.hr`export const EmptyStateContainer = styled.div`margin-top: 6.25rem;`;--export const AdminTreeNode = styled(Tree.Node)`- color: ${(props) =>- // TODO: We should really come up with a better solution for this, but since admin-navbar is currently not determined by- // user whitelabelling, this is somewhat safe (and consistent with what is in the admin header nav)- props.isSelected ? "var(--mantine-color-white)" : color("text-secondary")};- background-color: ${(props) =>- props.isSelected ? color("navbar-admin") : "unset"};-- &:hover {- background-color: ${(props) =>- props.isSelected- ? color("navbar-admin")- : color("navbar-admin-secondary")};- }-`;diff --git a/frontend/src/metabase/admin/permissions/components/FilterableTree/FilterableTree.tsx b/frontend/src/metabase/admin/permissions/components/FilterableTree/FilterableTree.tsxindex cda345badf9..09f757776eb 100644--- a/frontend/src/metabase/admin/permissions/components/FilterableTree/FilterableTree.tsx+++ b/frontend/src/metabase/admin/permissions/components/FilterableTree/FilterableTree.tsx@@ -9,8 +9,8 @@ import { Icon, Input, TextInput, type TextInputProps } from "metabase/ui";import { SEARCH_DEBOUNCE_DURATION } from "metabase/utils/constants";import type { IconName } from "metabase-types/api";+import { AdminTreeNode } from "./AdminTreeNode";import {- AdminTreeNode,EmptyStateContainer,FilterInputContainer,FilterableTreeContainer,diff --git a/frontend/src/metabase/admin/permissions/components/PermissionsPageLayout/PermissionsEditBar.module.css b/frontend/src/metabase/admin/permissions/components/PermissionsPageLayout/PermissionsEditBar.module.cssnew file mode 100644index 00000000000..ccfbb62f425--- /dev/null+++ b/frontend/src/metabase/admin/permissions/components/PermissionsPageLayout/PermissionsEditBar.module.css@@ -0,0 +1,14 @@+/*+ * Lines the banner up with the rest of the hub's permissions page: its icon+ * with the page title and tab labels (`TAB_LABEL_INSET` in+ * embedding-hub/pages/EmbeddingHubPermissionsPage.tsx), its buttons with the+ * app switcher (`CONTENT_PADDING_X` in nav/components/AreaLayout/AreaContent.tsx).+ *+ * `:not([data-css-specificity-hack])` rather than a bare class: this needs to+ * beat `FullWidthContainer`'s own padding, including the wider values it sets+ * in media queries, which are all single-class specificity.+ */+.hubEditBar:not([data-css-specificity-hack="🧭"]) {+ padding-left: 2.5rem;+ padding-right: 3.5rem;+}diff --git a/frontend/src/metabase/admin/permissions/components/PermissionsPageLayout/PermissionsEditBar.tsx b/frontend/src/metabase/admin/permissions/components/PermissionsPageLayout/PermissionsEditBar.tsxindex 2b0eac37863..0adc4af3f75 100644--- a/frontend/src/metabase/admin/permissions/components/PermissionsPageLayout/PermissionsEditBar.tsx+++ b/frontend/src/metabase/admin/permissions/components/PermissionsPageLayout/PermissionsEditBar.tsx@@ -2,12 +2,15 @@ import { useDisclosure } from "@mantine/hooks";import { t } from "ttag";import type { PermissionsGraphDiff } from "metabase/admin/permissions/types";+import { isEmbeddingHubPermissions } from "metabase/admin/permissions/utils/is-embedding-hub";import { ConfirmModal } from "metabase/common/components/ConfirmModal";import { EditBar } from "metabase/common/components/EditBar";import { Button } from "metabase/ui";import { PermissionsConfirm } from "../PermissionsConfirm";+import S from "./PermissionsEditBar.module.css";+interface PermissionsEditBarProps {diff?: PermissionsGraphDiff;isDirty: boolean;@@ -22,6 +25,7 @@ export function PermissionsEditBar({onSave,}: PermissionsEditBarProps) {const [modelOpened, { open: openModal, close: closeModal }] = useDisclosure();+ const isEmbeddingHub = isEmbeddingHubPermissions();const saveButton = (<Buttonkey="save"@@ -41,7 +45,8 @@ export function PermissionsEditBar({return (<><EditBar- admin+ admin={!isEmbeddingHub}+ className={isEmbeddingHub ? S.hubEditBar : undefined}title={t`You've made changes to permissions.`}buttons={[cancelButton, saveButton]}/>diff --git a/frontend/src/metabase/admin/permissions/components/PermissionsPageLayout/PermissionsPageLayout.module.css b/frontend/src/metabase/admin/permissions/components/PermissionsPageLayout/PermissionsPageLayout.module.cssnew file mode 100644index 00000000000..284cc495ef8--- /dev/null+++ b/frontend/src/metabase/admin/permissions/components/PermissionsPageLayout/PermissionsPageLayout.module.css@@ -0,0 +1,13 @@+/*+ * Right-aligns the toolbar with the hub's app switcher, which sits+ * `CONTENT_PADDING_X` (nav/components/AreaLayout/AreaContent.tsx) from the+ * edge; 0.75rem of that is the button's own padding.+ *+ * `:not([data-css-specificity-hack])` rather than a bare class: this needs to+ * beat `ToolbarButtonsContainer`'s own emotion-generated padding+ * (PermissionsPageLayout.styled.tsx), which is also single-class specificity,+ * so source order alone can't be trusted to pick a winner.+ */+.hubToolbarButtons:not([data-css-specificity-hack="📐"]) {+ padding-right: 2.75rem;+}diff --git a/frontend/src/metabase/admin/permissions/components/PermissionsPageLayout/PermissionsPageLayout.tsx b/frontend/src/metabase/admin/permissions/components/PermissionsPageLayout/PermissionsPageLayout.tsxindex 912de353504..1430c0880cc 100644--- a/frontend/src/metabase/admin/permissions/components/PermissionsPageLayout/PermissionsPageLayout.tsx+++ b/frontend/src/metabase/admin/permissions/components/PermissionsPageLayout/PermissionsPageLayout.tsx@@ -13,8 +13,10 @@ import {} from "metabase/admin/permissions/components/PermissionsPageLayout/PermissionsPageLayout.styled";import { getIsHelpReferenceOpen } from "metabase/admin/permissions/selectors/help-reference";import type { PermissionsGraphDiff } from "metabase/admin/permissions/types";+import { isEmbeddingHubPermissions } from "metabase/admin/permissions/utils/is-embedding-hub";import { ConfirmModal } from "metabase/common/components/ConfirmModal";import { LeaveRouteConfirmModal } from "metabase/common/components/LeaveConfirmModal";+import { getPermissionsBasePath } from "metabase/common/components/PermissionsBasePath/base-path";import { useDispatch, useSelector } from "metabase/redux";import { useNavigate } from "metabase/router";import { useUserSetting } from "metabase/settings";@@ -35,6 +37,7 @@ import { LegacyPermissionsModal } from "../LegacyPermissionsModal/LegacyPermissiimport { ToolbarButton } from "../ToolbarButton";import { PermissionsEditBar } from "./PermissionsEditBar";+import S from "./PermissionsPageLayout.module.css";import { PermissionsTabs } from "./PermissionsTabs";export type PermissionsPageTab =@@ -96,7 +99,7 @@ export function PermissionsPageLayout({const navigate = useNavigate();const navigateToTab = (tab: PermissionsPageTab) =>- navigate(`/admin/permissions/${tab}`);+ navigate(`${getPermissionsBasePath()}/${tab}`);const clearSaveError = () => {dispatch(clearPermissionsSaveError());@@ -138,7 +141,11 @@ export function PermissionsPageLayout({<TabsContainer><PermissionsTabs tab={tab} onChangeTab={navigateToTab} />- <ToolbarButtonsContainer>+ <ToolbarButtonsContainer+ className={+ isEmbeddingHubPermissions() ? S.hubToolbarButtons : undefined+ }+ >{helpContent && !isHelpReferenceOpen && (<ToolbarButtontext={t`Permissions help`}diff --git a/frontend/src/metabase/admin/permissions/components/PermissionsTable/PermissionsTable.tsx b/frontend/src/metabase/admin/permissions/components/PermissionsTable/PermissionsTable.tsxindex 8fb588352ea..227eab7debc 100644--- a/frontend/src/metabase/admin/permissions/components/PermissionsTable/PermissionsTable.tsx+++ b/frontend/src/metabase/admin/permissions/components/PermissionsTable/PermissionsTable.tsx@@ -2,6 +2,7 @@ import { useVirtualizer } from "@tanstack/react-virtual";import cx from "classnames";import { memo, useCallback, useRef, useState } from "react";+import { isEmbeddingHubPermissions } from "metabase/admin/permissions/utils/is-embedding-hub";import { ConfirmModal } from "metabase/common/components/ConfirmModal";import CS from "metabase/css/core/index.css";import { Ellipsified, Flex, Text, Tooltip } from "metabase/ui";@@ -217,6 +218,7 @@ const EntityRow = memo(function EntityRow({onSelect,onAction,}: EntityRowProps) {+ const isEmbeddingHub = isEmbeddingHubPermissions();const entityName = (<span className={cx(CS.flex, CS.alignCenter)}><Ellipsified>{entity.name}</Ellipsified>@@ -231,7 +233,14 @@ const EntityRow = memo(function EntityRow({<PermissionsTableRow aria-label={`${entity.name} permissions`}><PermissionsTableCell>{entity.canSelect ? (- <EntityNameLink onClick={() => onSelect?.(entity)}>+ <EntityNameLink+ onClick={() => onSelect?.(entity)}+ // The hub overrides the link's default admin purple with its own+ // blue, both colors the design system already owns.+ style={+ isEmbeddingHub ? { color: "var(--mb-color-brand)" } : undefined+ }+ >{entityName}</EntityNameLink>) : (diff --git a/frontend/src/metabase/admin/permissions/pages/CollectionPermissionsPage/CollectionPermissionsPage.tsx b/frontend/src/metabase/admin/permissions/pages/CollectionPermissionsPage/CollectionPermissionsPage.tsxindex cdfe7a00e64..433d1207044 100644--- a/frontend/src/metabase/admin/permissions/pages/CollectionPermissionsPage/CollectionPermissionsPage.tsx+++ b/frontend/src/metabase/admin/permissions/pages/CollectionPermissionsPage/CollectionPermissionsPage.tsx@@ -3,6 +3,7 @@ import { t } from "ttag";import { CollectionPermissionsHelp } from "metabase/admin/permissions/components/CollectionPermissionsHelp";import { useListCollectionsTreeQuery } from "metabase/api";+import { getPermissionsBasePath } from "metabase/common/components/PermissionsBasePath/base-path";import { useDispatch, useSelector } from "metabase/redux";import { useNavigate, useParams } from "metabase/router";import type { CollectionId } from "metabase-types/api";@@ -59,7 +60,7 @@ export function CollectionPermissionsPage() {}, [dispatch]);const navigateToItem = ({ id }: { id: CollectionId }) =>- navigate(`/admin/permissions/collections/${id}`);+ navigate(`${getPermissionsBasePath()}/collections/${id}`);const handlePermissionChange = useCallback((diff --git a/frontend/src/metabase/admin/permissions/pages/DatabasePermissionsPage/DatabasesPermissionsPage.tsx b/frontend/src/metabase/admin/permissions/pages/DatabasePermissionsPage/DatabasesPermissionsPage.tsxindex 75f7189ed19..e4117db429b 100644--- a/frontend/src/metabase/admin/permissions/pages/DatabasePermissionsPage/DatabasesPermissionsPage.tsx+++ b/frontend/src/metabase/admin/permissions/pages/DatabasePermissionsPage/DatabasesPermissionsPage.tsx@@ -3,6 +3,7 @@ import { useAsync } from "react-use";import { t } from "ttag";import { PermissionsEditorLegacyNoSelfServiceWarning } from "metabase/admin/permissions/components/PermissionsEditor/PermissionsEditorLegacyWarning";+import { getPermissionsBasePath } from "metabase/common/components/PermissionsBasePath/base-path";import type { ITreeNodeItem } from "metabase/common/components/tree/types";import { PLUGIN_ADVANCED_PERMISSIONS } from "metabase/plugins";import { useDispatch, useSelector } from "metabase/redux";@@ -37,8 +38,8 @@ import type {} from "../../types";import { assertNumericId, parseDataRouteParams } from "../../types";import {- DATABASES_BASE_PATH,getDatabaseFocusPermissionsUrl,+ getDatabasesBasePath,} from "../../utils/urls";export function DatabasesPermissionsPage() {@@ -73,7 +74,7 @@ export function DatabasesPermissionsPage() {(item as DataTreeNodeItem).entityId,),);- const navigateToDatabaseList = () => navigate(DATABASES_BASE_PATH);+ const navigateToDatabaseList = () => navigate(getDatabasesBasePath());const showSplitPermsMessage = useSelector((state) =>getSetting(state, "show-updated-permission-banner"),@@ -87,7 +88,7 @@ export function DatabasesPermissionsPage() {const handleEntityChange = useCallback((entityType: string) => {- navigate(`/admin/permissions/data/${entityType}`);+ navigate(`${getPermissionsBasePath()}/data/${entityType}`);},[navigate],);diff --git a/frontend/src/metabase/admin/permissions/pages/GroupDataPermissionsPage/GroupsPermissionsPage.tsx b/frontend/src/metabase/admin/permissions/pages/GroupDataPermissionsPage/GroupsPermissionsPage.tsxindex 44430a4497f..b4f17bcf4a5 100644--- a/frontend/src/metabase/admin/permissions/pages/GroupDataPermissionsPage/GroupsPermissionsPage.tsx+++ b/frontend/src/metabase/admin/permissions/pages/GroupDataPermissionsPage/GroupsPermissionsPage.tsx@@ -3,6 +3,7 @@ import { useAsync } from "react-use";import { t } from "ttag";import { PermissionsEditorLegacyNoSelfServiceWarning } from "metabase/admin/permissions/components/PermissionsEditor/PermissionsEditorLegacyWarning";+import { getPermissionsBasePath } from "metabase/common/components/PermissionsBasePath/base-path";import type { ITreeNodeItem } from "metabase/common/components/tree/types";import { PLUGIN_ADVANCED_PERMISSIONS } from "metabase/plugins";import { useDispatch, useSelector } from "metabase/redux";@@ -36,8 +37,8 @@ import type {} from "../../types";import { parseGroupRouteParams } from "../../types";import {- GROUPS_BASE_PATH,getGroupFocusPermissionsUrl,+ getGroupsBasePath,} from "../../utils/urls";export function GroupsPermissionsPage() {@@ -61,7 +62,7 @@ export function GroupsPermissionsPage() {const groupRouteParams = parseGroupRouteParams(params);const navigateToItem = (item: ITreeNodeItem) =>- navigate(`${GROUPS_BASE_PATH}/${item.id}`);+ navigate(`${getGroupsBasePath()}/${item.id}`);const { loading: isLoading } = useAsync(async () => {if (groupRouteParams.groupId) {@@ -78,7 +79,7 @@ export function GroupsPermissionsPage() {const handleEntityChange = useCallback((entityType: string) => {- navigate(`/admin/permissions/data/${entityType}/`);+ navigate(`${getPermissionsBasePath()}/data/${entityType}/`);},[navigate],);diff --git a/frontend/src/metabase/admin/permissions/utils/is-embedding-hub.ts b/frontend/src/metabase/admin/permissions/utils/is-embedding-hub.tsnew file mode 100644index 00000000000..e1f4104779b--- /dev/null+++ b/frontend/src/metabase/admin/permissions/utils/is-embedding-hub.ts@@ -0,0 +1,7 @@+import { getPermissionsBasePath } from "metabase/common/components/PermissionsBasePath/base-path";+import * as Urls from "metabase/urls";++/** Used to pick admin's vs. the hub's color scheme, based on where the permissions editor is mounted. */+export function isEmbeddingHubPermissions() {+ return getPermissionsBasePath() === Urls.embeddingHubPermissions();+}diff --git a/frontend/src/metabase/admin/permissions/utils/urls.ts b/frontend/src/metabase/admin/permissions/utils/urls.tsindex 85331d29163..45d07d56f9a 100644--- a/frontend/src/metabase/admin/permissions/utils/urls.ts+++ b/frontend/src/metabase/admin/permissions/utils/urls.ts@@ -1,3 +1,4 @@+import { getPermissionsBasePath } from "metabase/common/components/PermissionsBasePath/base-path";import type { GroupId, PermissionEntityId } from "metabase-types/api";import {@@ -6,37 +7,38 @@ import {isTableEntityId,} from "./data-entity-id";-export const DATABASES_BASE_PATH = `/admin/permissions/data/database`;-export const GROUPS_BASE_PATH = `/admin/permissions/data/group`;+export const getDatabasesBasePath = () =>+ `${getPermissionsBasePath()}/data/database`;+export const getGroupsBasePath = () => `${getPermissionsBasePath()}/data/group`;export const getDatabaseFocusPermissionsUrl = (entityId?: PermissionEntityId,) => {if (entityId == null) {- return DATABASES_BASE_PATH;+ return getDatabasesBasePath();}if (isTableEntityId(entityId)) {return entityId.schemaName != null && entityId.schemaName !== ""- ? `${DATABASES_BASE_PATH}/${+ ? `${getDatabasesBasePath()}/${entityId.databaseId}/schema/${encodeURIComponent(entityId.schemaName)}/table/${entityId.tableId}`- : `${DATABASES_BASE_PATH}/${entityId.databaseId}/table/${entityId.tableId}`;+ : `${getDatabasesBasePath()}/${entityId.databaseId}/table/${entityId.tableId}`;}if (isSchemaEntityId(entityId)) {- return `${DATABASES_BASE_PATH}/${+ return `${getDatabasesBasePath()}/${entityId.databaseId}/schema/${encodeURIComponent(entityId.schemaName)}`;}if (isDatabaseEntityId(entityId)) {- return `${DATABASES_BASE_PATH}/${entityId.databaseId}`;+ return `${getDatabasesBasePath()}/${entityId.databaseId}`;}- return DATABASES_BASE_PATH;+ return getDatabasesBasePath();};export const getGroupFocusPermissionsUrl = (@@ -44,22 +46,22 @@ export const getGroupFocusPermissionsUrl = (entityId?: PermissionEntityId,) => {if (groupId == null) {- return GROUPS_BASE_PATH;+ return getGroupsBasePath();}if (entityId == null) {- return `${GROUPS_BASE_PATH}/${groupId}`;+ return `${getGroupsBasePath()}/${groupId}`;}if (isSchemaEntityId(entityId)) {- return `${GROUPS_BASE_PATH}/${groupId}/database/${+ return `${getGroupsBasePath()}/${groupId}/database/${entityId.databaseId}/schema/${encodeURIComponent(entityId.schemaName)}`;}if (isDatabaseEntityId(entityId)) {- return `${GROUPS_BASE_PATH}/${groupId}/database/${entityId.databaseId}`;+ return `${getGroupsBasePath()}/${groupId}/database/${entityId.databaseId}`;}- return GROUPS_BASE_PATH;+ return getGroupsBasePath();};diff --git a/frontend/src/metabase/admin/routes.tsx b/frontend/src/metabase/admin/routes.tsxindex 0b9154ea147..091f4359461 100644--- a/frontend/src/metabase/admin/routes.tsx+++ b/frontend/src/metabase/admin/routes.tsx@@ -21,7 +21,6 @@ import {} from "metabase/plugins";import type { State } from "metabase/redux/store";import { Route, type RouteComponent, redirect } from "metabase/router";-import { getTokenFeature } from "metabase/settings";import type { MetabotAdminLayout } from "./ai/MetabotAdminLayout";import { getSettingsRoutes } from "./settingsRoutes";@@ -108,63 +107,6 @@ const upsellTenants = () =>}),);-const embeddingApp = () =>- import(- /* webpackChunkName: "admin" */ "metabase/admin/embedding/containers/AdminEmbeddingApp"- ).then(({ AdminEmbeddingApp }) => ({ Component: AdminEmbeddingApp }));--const embeddingSettings = () =>- import(- /* webpackChunkName: "admin" */ "metabase/admin/settings/components/EmbeddingSettings"- ).then(({ EmbeddingSettings }) => ({ Component: EmbeddingSettings }));--const embeddingSecuritySettings = () =>- import(- /* webpackChunkName: "admin" */ "metabase/admin/settings/components/EmbeddingSettings"- ).then(({ EmbeddingSecuritySettings }) => ({- Component: EmbeddingSecuritySettings,- }));--const guestEmbedsSettings = () =>- import(- /* webpackChunkName: "admin" */ "metabase/admin/settings/components/EmbeddingSettings"- ).then(({ GuestEmbedsSettings }) => ({ Component: GuestEmbedsSettings }));--const embeddingHub = () =>- import(- /* webpackChunkName: "admin" */ "metabase/admin/embedding/embedding-hub"- ).then(({ EmbeddingHubAdminSettingsPage }) => ({- Component: EmbeddingHubAdminSettingsPage,- }));--const setupPermissions = () =>- import(- /* webpackChunkName: "admin" */ "metabase/embedding/embedding-hub"- ).then(({ SetupPermissionsAndTenantsPage }) => ({- Component: SetupPermissionsAndTenantsPage,- }));--const setupSso = () =>- import(- /* webpackChunkName: "admin" */ "metabase/embedding/embedding-hub"- ).then(({ SetupSsoPage }) => ({- Component: SetupSsoPage,- }));--const themeListing = () =>- import(- /* webpackChunkName: "admin" */ "metabase/admin/embedding/components/ThemeListing"- ).then(({ EmbeddingThemeListingApp }) => ({- Component: EmbeddingThemeListingApp,- }));--const themeEditor = () =>- import(- /* webpackChunkName: "admin" */ "metabase/admin/embedding/components/ThemeEditor"- ).then(({ EmbeddingThemeEditorApp }) => ({- Component: EmbeddingThemeEditorApp,- }));-const performanceApp = () =>import(/* webpackChunkName: "admin" */ "metabase/admin/performance/components/PerformanceApp"@@ -226,9 +168,6 @@ export const getRoutes = (CanAccessSettings: RouteComponent,IsAdmin: RouteComponent,) => {- const state = store.getState();- const hasSimpleEmbedding = getTokenFeature(state, "embedding_simple");-return (<Route path="/admin" element={<CanAccessSettings />}><Route lazy={adminApp}>@@ -338,65 +277,66 @@ export const getRoutes = (</Route></Route>- {/* EMBEDDING */}+ {/* EMBEDDING — the admin embedding section moved to the embedding+ hub at /embedding (EMB-1526). Every old path redirects to its hub+ equivalent so no bookmarked/linked URL breaks. */}<Route- path="embedding"- element={createElement(createAdminRouteGuard("embedding"))}- >- <Route lazy={embeddingApp}>- <Route index lazy={embeddingSettings} />-- <Route path="setup-guide">- <Route index lazy={embeddingHub} />-- <Route path="permissions" lazy={setupPermissions} />-- <Route path="sso" lazy={setupSso} />- </Route>-- {/* EE with non-starter plan has embedding settings on different pages */}- {hasSimpleEmbedding && (- <Route path="guest" lazy={guestEmbedsSettings} />- )}-- <Route path="security" lazy={embeddingSecuritySettings} />- <Route path="themes" lazy={themeListing} />- <Route path="themes/:themeId" lazy={themeEditor} />- </Route>- </Route>-- {/* OSS/Starter has all embedding settings on the same page */}- {!hasSimpleEmbedding && (- <Route- path="/admin/embedding/guest"- element={redirect("/admin/embedding")}- />- )}+ path="/admin/embedding"+ element={redirect("/embedding/security")}+ />+ <Route+ path="/admin/embedding/setup-guide"+ element={redirect("/embedding/get-started")}+ />+ <Route+ path="/admin/embedding/setup-guide/permissions"+ element={redirect("/embedding/get-started/permissions")}+ />+ <Route+ path="/admin/embedding/setup-guide/sso"+ element={redirect("/embedding/get-started/sso")}+ />+ <Route+ path="/admin/embedding/guest"+ element={redirect("/embedding/security")}+ />+ <Route+ path="/admin/embedding/security"+ element={redirect("/embedding/security")}+ />+ <Route+ path="/admin/embedding/themes"+ element={redirect("/embedding/appearance")}+ />+ <Route+ path="/admin/embedding/themes/:themeId"+ element={redirect("/embedding/appearance/theme/:themeId")}+ />{/* Backwards compatibility for embedding settings */}<Routepath="/admin/embedding/modular"- element={redirect("/admin/embedding")}+ element={redirect("/embedding/security")}/><Routepath="/admin/embedding/interactive"- element={redirect("/admin/embedding")}+ element={redirect("/embedding/security")}/><Routepath="/admin/settings/embedding-in-other-applications"- element={redirect("/admin/embedding")}+ element={redirect("/embedding/security")}/><Routepath="/admin/settings/embedding-in-other-applications/full-app"- element={redirect("/admin/embedding")}+ element={redirect("/embedding/security")}/><Routepath="/admin/settings/embedding-in-other-applications/standalone"- element={redirect("/admin/embedding/guest")}+ element={redirect("/embedding/security")}/><Routepath="/admin/settings/embedding-in-other-applications/sdk"- element={redirect("/admin/embedding")}+ element={redirect("/embedding/security")}/>{/* SETTINGS */}diff --git a/frontend/src/metabase/admin/routes.unit.spec.tsx b/frontend/src/metabase/admin/routes.unit.spec.tsxindex 5ffc4501a96..0611884863f 100644--- a/frontend/src/metabase/admin/routes.unit.spec.tsx+++ b/frontend/src/metabase/admin/routes.unit.spec.tsx@@ -1,4 +1,4 @@-import type { ReactNode } from "react";+import { type ReactNode, isValidElement } from "react";import { getStore, mainReducers } from "__support__/entities-store";import { createMockSettingsState } from "__support__/state";@@ -29,6 +29,42 @@ function lazyLoaders(tree: ReactNode) {return loaders;}+/**+ * Every path-carrying route whose element navigates elsewhere, as written path+ * -> target. Read off the route table rather than by navigating, so one test+ * covers the section instead of a spec per redirected page. Index redirects+ * have no path of their own and are not collected.+ */+function navigationTargets(tree: ReactNode) {+ const targets: Record<string, string> = {};++ const collect = (routes: RouteObject[]) => {+ for (const route of routes) {+ const element = route.element;++ if (route.path && isValidElement<{ to?: string }>(element)) {+ const { to } = element.props;++ if (typeof to === "string") {+ targets[route.path] = to;+ }+ }++ collect(route.children ?? []);+ }+ };++ collect(toRouteObjects(tree));+ return targets;+}++function isRetiredEmbeddingPath(path: string) {+ return (+ path.startsWith("/admin/embedding") ||+ path.startsWith("/admin/settings/embedding-in-other-applications")+ );+}+const Guard = () => null;// A real store: `getRoutes` reads a setting off it to decide whether the custom@@ -52,6 +88,42 @@ describe("admin routes", () => {}});+ it("redirects every retired embedding path to its hub equivalent", () => {+ const targets = navigationTargets(getRoutes(createStore(), Guard, Guard));++ expect(targets).toMatchObject({+ "/admin/embedding": "/embedding/security",+ "/admin/embedding/setup-guide": "/embedding/get-started",+ "/admin/embedding/setup-guide/permissions":+ "/embedding/get-started/permissions",+ "/admin/embedding/setup-guide/sso": "/embedding/get-started/sso",+ "/admin/embedding/guest": "/embedding/security",+ "/admin/embedding/security": "/embedding/security",+ "/admin/embedding/themes": "/embedding/appearance",+ "/admin/embedding/themes/:themeId":+ "/embedding/appearance/theme/:themeId",+ "/admin/embedding/modular": "/embedding/security",+ "/admin/embedding/interactive": "/embedding/security",+ "/admin/settings/embedding-in-other-applications": "/embedding/security",+ "/admin/settings/embedding-in-other-applications/full-app":+ "/embedding/security",+ "/admin/settings/embedding-in-other-applications/standalone":+ "/embedding/security",+ "/admin/settings/embedding-in-other-applications/sdk":+ "/embedding/security",+ });+ });++ it("sends every retired embedding path straight to the hub, never to another redirect", () => {+ const targets = navigationTargets(getRoutes(createStore(), Guard, Guard));++ const chained = Object.entries(targets).filter(+ ([path, to]) => isRetiredEmbeddingPath(path) && targets[to] !== undefined,+ );++ expect(chained).toEqual([]);+ });+it("resolves every page in the settings tree", async () => {const loaders = lazyLoaders(getSettingsRoutes(createStore(), Guard));diff --git a/frontend/src/metabase/admin/settings/auth/components/AuthCard/AuthCard.tsx b/frontend/src/metabase/admin/settings/auth/components/AuthCard/AuthCard.tsxindex de22c91df0e..48e235eadd7 100644--- a/frontend/src/metabase/admin/settings/auth/components/AuthCard/AuthCard.tsx+++ b/frontend/src/metabase/admin/settings/auth/components/AuthCard/AuthCard.tsx@@ -2,10 +2,10 @@ import type { ReactNode } from "react";import { useCallback, useState } from "react";import { c, t } from "ttag";-import { SettingsSection } from "metabase/admin/components/SettingsSection";import { useGetEnvVarDocsUrl } from "metabase/admin/settings/utils";import { ConfirmModal } from "metabase/common/components/ConfirmModal";import { Link } from "metabase/common/components/Link";+import { SettingsSection } from "metabase/settings-components";import { ActionIcon, Anchor, Button, Icon, Menu, Text } from "metabase/ui";import type { SettingDefinition } from "metabase-types/api";diff --git a/frontend/src/metabase/admin/settings/auth/components/GoogleAuthForm/GoogleAuthForm.tsx b/frontend/src/metabase/admin/settings/auth/components/GoogleAuthForm/GoogleAuthForm.tsxindex 21a60bc2fb9..f90b6fc5ce9 100644--- a/frontend/src/metabase/admin/settings/auth/components/GoogleAuthForm/GoogleAuthForm.tsx+++ b/frontend/src/metabase/admin/settings/auth/components/GoogleAuthForm/GoogleAuthForm.tsx@@ -1,10 +1,6 @@import { useMemo } from "react";import { jt, t } from "ttag";-import {- SettingsPageWrapper,- SettingsSection,-} from "metabase/admin/components/SettingsSection";import { ExternalLink } from "metabase/common/components/ExternalLink";import { useDocsUrl, useHasTokenFeature } from "metabase/common/hooks";import {@@ -19,6 +15,10 @@ import {useGetSettingsQuery,useSetting,} from "metabase/settings";+import {+ SettingsPageWrapper,+ SettingsSection,+} from "metabase/settings-components";import { Flex, Stack, Text, Title } from "metabase/ui";import type { SettingDefinition, Settings } from "metabase-types/api";diff --git a/frontend/src/metabase/admin/settings/components/ApiKeys/ManageApiKeys.tsx b/frontend/src/metabase/admin/settings/components/ApiKeys/ManageApiKeys.tsxindex 1327b20b481..4f3cf926bab 100644--- a/frontend/src/metabase/admin/settings/components/ApiKeys/ManageApiKeys.tsx+++ b/frontend/src/metabase/admin/settings/components/ApiKeys/ManageApiKeys.tsx@@ -3,8 +3,8 @@ import { useCallback, useMemo, useState } from "react";import { t } from "ttag";import ApiKeysEmptyIllustration from "assets/img/api-keys-empty.svg?component";-import { SettingsPageWrapper } from "metabase/admin/components/SettingsSection";import { DelayedLoadingAndErrorWrapper } from "metabase/common/components/LoadingAndErrorWrapper/DelayedLoadingAndErrorWrapper";+import { SettingsPageWrapper } from "metabase/settings-components";import {ActionIcon,Box,diff --git a/frontend/src/metabase/admin/settings/components/Email/BaseSMTPConnectionForm.tsx b/frontend/src/metabase/admin/settings/components/Email/BaseSMTPConnectionForm.tsxindex cc99c8e4fc7..7754cd4de04 100644--- a/frontend/src/metabase/admin/settings/components/Email/BaseSMTPConnectionForm.tsx+++ b/frontend/src/metabase/admin/settings/components/Email/BaseSMTPConnectionForm.tsx@@ -17,12 +17,11 @@ import {useGetAdminSettingsDetailsQuery,useGetSettingsQuery,} from "metabase/settings";+import { SetByEnvVarWrapper } from "metabase/settings-components";import { Box, Button, Chip, Flex, Modal, Stack } from "metabase/ui";import * as Errors from "metabase/utils/errors";import type { SettingDefinitionMap, SettingKey } from "metabase-types/api";-import { SetByEnvVarWrapper } from "../widgets/AdminSettingInput";-type GetFullFormKey = (shortFormKey: "port" | "host" | "username" | "security" | "password",) => SettingKey;diff --git a/frontend/src/metabase/admin/settings/components/Email/SelfHostedSMTPConnectionCard.tsx b/frontend/src/metabase/admin/settings/components/Email/SelfHostedSMTPConnectionCard.tsxindex 2a1ccdc790c..f6a7833b80f 100644--- a/frontend/src/metabase/admin/settings/components/Email/SelfHostedSMTPConnectionCard.tsx+++ b/frontend/src/metabase/admin/settings/components/Email/SelfHostedSMTPConnectionCard.tsx@@ -1,8 +1,8 @@import { useDisclosure } from "@mantine/hooks";import { t } from "ttag";-import { SettingsSection } from "metabase/admin/components/SettingsSection";import { useSetting } from "metabase/settings";+import { SettingsSection } from "metabase/settings-components";import { Button, Flex, Paper, Title } from "metabase/ui";import { SelfHostedSMTPConnectionForm } from "./SelfHostedSMTPConnectionForm";diff --git a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingLegaleseModal/EmbeddingLegaleseModal.tsx b/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingLegaleseModal/EmbeddingLegaleseModal.tsxdeleted file mode 100644index dd16eb6a002..00000000000--- a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingLegaleseModal/EmbeddingLegaleseModal.tsx+++ /dev/null@@ -1,86 +0,0 @@-import { useState } from "react";-import { match } from "ts-pattern";-import { t } from "ttag";--import { useUpdateSettingsMutation } from "metabase/settings";-import { Button, Group, List, Modal, type ModalProps, Text } from "metabase/ui";--type SettingKey = "enable-embedding-sdk" | "enable-embedding-simple";--export const EmbeddingLegaleseModal = ({- setting,- opened,- onClose,-}: ModalProps & { setting: SettingKey }) => {- const [loading, setLoading] = useState(false);- const [updateSettings] = useUpdateSettingsMutation();-- const onAccept = async () => {- setLoading(true);-- await updateSettings({- [setting]: true,-- // hide the legalese modal and popups.- [getShowEmbedTermsSetting(setting)]: false,- });-- setLoading(false);- onClose();- };-- return (- <Modal- title={t`First, some legalese`}- onClose={onClose}- opened={opened}- size={670}- padding="xxl"- withCloseButton={false}- closeOnClickOutside={false}- >- <Text mt="xxs">{getTitle(setting)}</Text>- <List mt="xxs">- <List.Item mr="lg">- <Text>{t`Sharing Metabase accounts is a security risk. Even if you filter data on the client side, each user could use their token to view any data visible to that shared user account.`}</Text>- </List.Item>- <List.Item mr="lg">- <Text>{t`That, and we consider shared accounts to be unfair usage. Fair usage involves giving each end-user of the embedded analytics their own Metabase account.`}</Text>- </List.Item>- </List>- <Group justify="right" mt="xl">- <Button- onClick={onClose}- variant="outline"- disabled={loading}- >{t`Decline and go back`}</Button>- <Button- onClick={onAccept}- variant="filled"- data-is-loading={loading}- loading={loading}- >{t`Agree and continue`}</Button>- </Group>- </Modal>- );-};--const getTitle = (key: SettingKey) =>- match(key)- .with(- "enable-embedding-sdk",- () =>- t`When using the Embedded analytics SDK for React, each end user should have their own Metabase account.`,- )- .with(- "enable-embedding-simple",- () =>- t`When using modular embedding, each end user must have their own Metabase account.`,- )- .exhaustive();--const getShowEmbedTermsSetting = (key: SettingKey) =>- match(key)- .with("enable-embedding-sdk", () => "show-sdk-embed-terms")- .with("enable-embedding-simple", () => "show-simple-embed-terms")- .exhaustive();diff --git a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingLegaleseModal/EmbeddingLegaleseModal.unit.spec.tsx b/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingLegaleseModal/EmbeddingLegaleseModal.unit.spec.tsxdeleted file mode 100644index f4e046f6c30..00000000000--- a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingLegaleseModal/EmbeddingLegaleseModal.unit.spec.tsx+++ /dev/null@@ -1,75 +0,0 @@-import userEvent from "@testing-library/user-event";--import {- findRequests,- setupPropertiesEndpoints,- setupSettingsEndpoints,- setupUpdateSettingsEndpoint,-} from "__support__/server-mocks";-import { renderWithProviders, screen, waitFor } from "__support__/ui";-import { createMockSettings } from "metabase-types/api/mocks";--import { EmbeddingLegaleseModal } from "./EmbeddingLegaleseModal";--type SettingKey = "enable-embedding-sdk" | "enable-embedding-simple";--const setup = (setting: SettingKey = "enable-embedding-sdk") => {- const onClose = jest.fn();-- setupPropertiesEndpoints(createMockSettings());- setupSettingsEndpoints([]);- setupUpdateSettingsEndpoint();-- renderWithProviders(- <EmbeddingLegaleseModal setting={setting} opened onClose={onClose} />,- );-- return { onClose };-};--describe("EmbeddingSdkLegaleseModal", () => {- it.each([- {- setting: "enable-embedding-sdk" as const,- expectedSettingUpdate: {- "show-sdk-embed-terms": false,- "enable-embedding-sdk": true,- },- },- {- setting: "enable-embedding-simple" as const,- expectedSettingUpdate: {- "show-simple-embed-terms": false,- "enable-embedding-simple": true,- },- },- ])(- "should update the settings and close the modal when the user clicks Accept for $setting",- async ({ setting, expectedSettingUpdate }) => {- const { onClose } = setup(setting);-- await userEvent.click(- screen.getByRole("button", { name: "Agree and continue" }),- { delay: null },- );-- const puts = await findRequests("PUT");- expect(puts).toHaveLength(1);- const [{ body }] = puts;-- expect(body).toEqual(expectedSettingUpdate);-- await waitFor(() => {- expect(onClose).toHaveBeenCalled();- });- },- );-- it("should not update settings when the user clicks Decline", async () => {- const { onClose } = setup();- await userEvent.click(screen.getByText("Decline and go back"));- expect(onClose).toHaveBeenCalled();- const puts = await findRequests("PUT");- expect(puts).toHaveLength(0);- });-});diff --git a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSdkSettings/EmbeddingSdkSettings.tsx b/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSdkSettings/EmbeddingSdkSettings.tsxdeleted file mode 100644index 34cad5c1407..00000000000--- a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSdkSettings/EmbeddingSdkSettings.tsx+++ /dev/null@@ -1,93 +0,0 @@-import cx from "classnames";-import { match } from "ts-pattern";-import { c, t } from "ttag";--import { UpsellSdkLink } from "metabase/admin/upsells/UpsellSdkLink";-import { ExternalLink } from "metabase/common/components/ExternalLink";-import { useDocsUrl, useUrlWithUtm } from "metabase/common/hooks";-import CS from "metabase/css/core/index.css";-import { PLUGIN_EMBEDDING_SDK, PLUGIN_IS_EE_BUILD } from "metabase/plugins";--import { EmbeddingSettingsCard } from "../EmbeddingSettingsCard";--const utmTags = {- utm_source: "product",- utm_medium: "docs",- utm_campaign: "embedding-sdk",- utm_content: "embedding-sdk-admin",-};--export const EmbeddingSdkSettings = () => {- const isEE = PLUGIN_IS_EE_BUILD.isEEBuild();- const isReactSdkFeatureAvailable = PLUGIN_EMBEDDING_SDK.isEnabled();-- const implementJwtUrl = useDocsUrl("embedding/sdk/authentication", {- utm: utmTags,- });-- const sdkQuickStartUrl = useUrlWithUtm(- "https://metaba.se/sdk-quick-start",- utmTags,- );-- const sdkDocumentationUrl = useUrlWithUtm(- "https://metaba.se/sdk-docs",- utmTags,- );-- const ImplementJwtLink = (- <ExternalLink- key="implement-jwt"- href={implementJwtUrl.url}- className={cx(CS.link, CS.textBold)}- >- {t`implement JWT or SAML SSO`}- </ExternalLink>- );-- const apiKeyBannerText = match({- needsToUpgrade: !isReactSdkFeatureAvailable,- needsToImplementJwt: isReactSdkFeatureAvailable,- })- .with(- { needsToUpgrade: true },- () =>- c(- "{0} is the link to upsell the SDK. {1} is the link to implement JWT or SAML authentication.",- )- .jt`You can test Embedded analytics SDK on localhost quickly by using API keys. To use the SDK on other sites, ${<UpsellSdkLink key="upsell-sdk-link" />} and ${ImplementJwtLink}.`,- )- .with(- { needsToImplementJwt: true },- () =>- c("{0} is the link to implement JWT or SAML authentication.")- .jt`You can test Embedded analytics SDK on localhost quickly by using API keys. To use the SDK on other sites, ${ImplementJwtLink}.`,- )- .otherwise(() => null);-- if (!isEE) {- return null;- }-- return (- <EmbeddingSettingsCard- title={t`Enable modular embedding SDK`}- description={t`Embed the full power of Metabase into your application to build a custom analytics experience and programmatically manage dashboards and data.`}- settingKey="enable-embedding-sdk"- links={[- {- icon: "bolt",- title: t`Quick start`,- href: sdkQuickStartUrl,- },- {- icon: "reference",- title: t`Documentation`,- href: sdkDocumentationUrl,- },- ]}- alertInfoText={apiKeyBannerText}- testId="sdk-setting-card"- />- );-};diff --git a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSecuritySettings/CorsInputWidget.tsx b/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSecuritySettings/CorsInputWidget.tsxdeleted file mode 100644index 8b2987471e9..00000000000--- a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSecuritySettings/CorsInputWidget.tsx+++ /dev/null@@ -1,49 +0,0 @@-import { jt, t } from "ttag";--import { AdminSettingInput } from "metabase/admin/settings/components/widgets/AdminSettingInput";-import { useSetting } from "metabase/settings";-import { Box, Group, HoverCard, Icon, Text } from "metabase/ui";--export const CorsInputWidget = () => {- const isLocalhostCorsDisabled = useSetting("disable-cors-on-localhost");-- const corsHintText = isLocalhostCorsDisabled- ? t`Separate values with a space. Localhost is not allowed. Changes will take effect within one minute.`- : t`Separate values with a space. Localhost is automatically included. Changes will take effect within one minute.`;-- return (- <AdminSettingInput- title={t`Cross-Origin Resource Sharing (CORS)`}- description={- <Group align="center" gap="sm">- <Text c="text-secondary" fz="md">- {jt`Add the website domains where you want to allow embedding. ${(- <HoverCard key="embedding-cors-hint" position="bottom">- <HoverCard.Target>- <Icon- name="info"- c="text-secondary"- cursor="pointer"- ml="sm"- style={{ verticalAlign: "middle" }}- />- </HoverCard.Target>-- <HoverCard.Dropdown>- <Box p="lg" w={270}>- <Text lh="lg" c="text-secondary">- {corsHintText}- </Text>- </Box>- </HoverCard.Dropdown>- </HoverCard>- )}`}- </Text>- </Group>- }- name="embedding-app-origins-sdk"- placeholder="https://*.example.com"- inputType="text"- />- );-};diff --git a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSecuritySettings/EmbeddingSecuritySettings.tsx b/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSecuritySettings/EmbeddingSecuritySettings.tsxdeleted file mode 100644index 5c9d278e95f..00000000000--- a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSecuritySettings/EmbeddingSecuritySettings.tsx+++ /dev/null@@ -1,23 +0,0 @@-import { t } from "ttag";--import {- SettingsPageWrapper,- SettingsSection,-} from "metabase/admin/components/SettingsSection";--import { CorsInputWidget } from "./CorsInputWidget";-import { SameSiteSelectWidget } from "./SameSiteSelectWidget";--export function EmbeddingSecuritySettings() {- return (- <SettingsPageWrapper title={t`Security`}>- <SettingsSection>- <CorsInputWidget />- </SettingsSection>-- <SettingsSection>- <SameSiteSelectWidget />- </SettingsSection>- </SettingsPageWrapper>- );-}diff --git a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSecuritySettings/index.ts b/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSecuritySettings/index.tsdeleted file mode 100644index 0187c2bc70b..00000000000--- a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSecuritySettings/index.ts+++ /dev/null@@ -1,3 +0,0 @@-export { EmbeddingSecuritySettings } from "./EmbeddingSecuritySettings";-export { CorsInputWidget } from "./CorsInputWidget";-export { SameSiteSelectWidget } from "./SameSiteSelectWidget";diff --git a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSecuritySettings/tests/common.unit.spec.tsx b/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSecuritySettings/tests/common.unit.spec.tsxdeleted file mode 100644index 47f5f135973..00000000000--- a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSecuritySettings/tests/common.unit.spec.tsx+++ /dev/null@@ -1,59 +0,0 @@-import userEvent from "@testing-library/user-event";--import { findRequests } from "__support__/server-mocks";-import { renderWithProviders, screen } from "__support__/ui";--import { setup as baseSetup } from "../../tests/setup";-import { EmbeddingSecuritySettings } from "../EmbeddingSecuritySettings";--const setup = async () => {- await baseSetup({- renderCallback: ({ state }) =>- renderWithProviders(<EmbeddingSecuritySettings />, {- storeInitialState: state,- }),- });-- expect(await screen.findByText("Security")).toBeInTheDocument();-};--describe("EmbeddingSecuritySettings => common", () => {- it("should allow users to update CORS settings", async () => {- await setup();-- expect(- await screen.findByText("Cross-Origin Resource Sharing (CORS)"),- ).toBeInTheDocument();-- const input = await screen.findByPlaceholderText("https://*.example.com");- await userEvent.type(input, "https://my-app.example.com");- await userEvent.tab();-- const puts = await findRequests("PUT");- expect(puts).toHaveLength(1);-- const [{ url, body }] = puts;- expect(url).toContain("/setting/embedding-app-origins-sdk");- expect(body).toEqual({ value: "https://my-app.example.com" });- });-- it("should allow changing samesite cookie setting", async () => {- await setup();-- expect(- await screen.findByText("SameSite cookie setting"),- ).toBeInTheDocument();-- const button = await screen.findByText("Lax (default)");- await userEvent.click(button);- const newOption = await screen.findByText("Strict (not recommended)");- await userEvent.click(newOption);-- const puts = await findRequests("PUT");- expect(puts).toHaveLength(1);-- const [{ url, body }] = puts;- expect(url).toContain("/setting/session-cookie-samesite");- expect(body).toEqual({ value: "strict" });- });-});diff --git a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSettings.module.css b/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSettings.module.cssdeleted file mode 100644index 2504acad2d3..00000000000--- a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSettings.module.css+++ /dev/null@@ -1,9 +0,0 @@-.SectionCard {- border-radius: 8px;- border: 1px solid var(--mb-color-border-neutral);- background: var(--mb-color-background_page-primary);-}--.CardLinksSection {- border-top: 1px solid var(--mb-color-border-neutral);-}diff --git a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSettings/EmbeddingSettings.tsx b/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSettings/EmbeddingSettings.tsxdeleted file mode 100644index 5bc76b6f114..00000000000--- a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSettings/EmbeddingSettings.tsx+++ /dev/null@@ -1,131 +0,0 @@-import type { PropsWithChildren } from "react";-import { t } from "ttag";--import {- RelatedSettingsSection,- getModularEmbeddingRelatedSettingItems,-} from "metabase/admin/components/RelatedSettingsSection";-import { SettingsPageWrapper } from "metabase/admin/components/SettingsSection";-import { NewEmbedButton } from "metabase/admin/settings/components/EmbeddingSettings/NewEmbedButton/NewEmbedButton";-import { UpsellDevInstances } from "metabase/admin/upsells";-import { ExternalLink } from "metabase/common/components/ExternalLink";-import { useDocsUrl, useHasTokenFeature } from "metabase/common/hooks";-import { PLUGIN_CONTENT_TRANSLATION } from "metabase/content-translation/plugins";-import {- PLUGIN_ADMIN_SETTINGS,- PLUGIN_EMBEDDING_SDK,- PLUGIN_IS_EE_BUILD,-} from "metabase/plugins";-import { useSetting } from "metabase/settings";-import { Box, Group, Icon, Stack, Text } from "metabase/ui";--import { EmbeddingSdkSettings } from "../EmbeddingSdkSettings/EmbeddingSdkSettings";-import S from "../EmbeddingSettings.module.css";-import { EmbeddingSettingsCard } from "../EmbeddingSettingsCard";-import { SharedCombinedEmbeddingSettings } from "../SharedCombinedEmbeddingSettings";--function EmbeddingSettingsPageWrapper({ children }: PropsWithChildren) {- const isEE = PLUGIN_IS_EE_BUILD.isEEBuild();- const isUsingTenants = useSetting("use-tenants");- const hasSimpleEmbedding = useHasTokenFeature("embedding_simple");-- return (- <SettingsPageWrapper title={t`Embedding settings`}>- {children}-- <RelatedSettingsSection- items={getModularEmbeddingRelatedSettingItems({- isUsingTenants,- hasSimpleEmbedding,- })}- />-- {isEE && <UpsellDevInstances location="embedding-page" />}- </SettingsPageWrapper>- );-}--function EmbeddingSettingsEE() {- const isReactSdkFeatureAvailable = PLUGIN_EMBEDDING_SDK.isEnabled();-- const isHosted = useSetting("is-hosted?");-- // The quickstart is part of the documentation page, unlike the SDK, so we only need a single docs link.- const embedJsDocumentationUrl = useDocsUrl("embedding/embedded-analytics-js");-- return (- <>- <Text size="lg" fw="bold" lh="xs">- {t`Embedding methods`}- </Text>-- <EmbeddingSettingsCard- title={t`Enable modular embedding`}- description={t`The simplest way to embed Metabase. Embed dashboards, questions, the query builder, natural language querying with AI, and more in your app with components. Built on the SDK with per-component controls and theming.`}- settingKey="enable-embedding-simple"- links={[- {- icon: "reference",- title: t`Documentation`,- href: embedJsDocumentationUrl?.url,- },- ]}- actionButton={<NewEmbedButton />}- testId="sdk-setting-card"- />-- <EmbeddingSdkSettings />-- {PLUGIN_ADMIN_SETTINGS.InteractiveEmbeddingSettingsCard && (- <PLUGIN_ADMIN_SETTINGS.InteractiveEmbeddingSettingsCard />- )}-- <Text size="lg" fw="bold" lh="xs">- {t`Settings`}- </Text>-- <PLUGIN_CONTENT_TRANSLATION.ContentTranslationConfiguration />-- {isReactSdkFeatureAvailable && isHosted && (- <Box py="xl" px="xxl" className={S.SectionCard}>- <Stack gap="xxs">- <Text- htmlFor="version-pinning"- component="label"- c="text-primary"- fw="bold"- fz="lg"- >- {t`Version pinning`}- </Text>-- <Text c="text-secondary" lh="lg" mb="sm">- {t`Metabase Cloud instances are automatically upgraded to new releases. SDK packages are strictly compatible with specific version of Metabase. You can request to pin your Metabase to a major version and upgrade your Metabase and SDK dependency in a coordinated fashion.`}- </Text>-- <ExternalLink href="mailto:[email protected]">- <Group gap="sm" fw="bold" w="fit-content">- <Icon name="mail" size={14} aria-hidden />- <span>{t`Request version pinning`}</span>- </Group>- </ExternalLink>- </Stack>- </Box>- )}- </>- );-}--function EmbeddingSettingsOSS() {- return <SharedCombinedEmbeddingSettings showContentTranslationSettings />;-}--export const EmbeddingSettings = () => {- const hasSimpleEmbedding = useHasTokenFeature("embedding_simple");-- return (- <EmbeddingSettingsPageWrapper>- {hasSimpleEmbedding ? <EmbeddingSettingsEE /> : <EmbeddingSettingsOSS />}- </EmbeddingSettingsPageWrapper>- );-};diff --git a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSettings/index.ts b/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSettings/index.tsdeleted file mode 100644index 68d9dd94d91..00000000000--- a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSettings/index.ts+++ /dev/null@@ -1 +0,0 @@-export * from "./EmbeddingSettings";diff --git a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSettings/tests/common.unit.spec.tsx b/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSettings/tests/common.unit.spec.tsxdeleted file mode 100644index b19f953d382..00000000000--- a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSettings/tests/common.unit.spec.tsx+++ /dev/null@@ -1,66 +0,0 @@-import { screen } from "__support__/ui";--import { setup } from "./setup";--describe("EmbeddingSdkSettings (OSS)", () => {- describe("SDK card", () => {- it("should not show SDK card in OSS", async () => {- await setup({- isEmbeddingSdkEnabled: false,- showSdkEmbedTerms: false,- });- expect(- screen.queryByText(/Enable modular embedding SDK/i),- ).not.toBeInTheDocument();- });- });-- it("should not show version pinning section", async () => {- await setup({- isEmbeddingSdkEnabled: true,- showSdkEmbedTerms: false,- });- expect(screen.queryByText("Version pinning")).not.toBeInTheDocument();- expect(- screen.queryByText(- "Metabase Cloud instances are automatically upgraded to new releases. SDK packages are strictly compatible with specific version of Metabase. You can request to pin your Metabase to a major version and upgrade your Metabase and SDK dependency in a coordinated fashion.",- ),- ).not.toBeInTheDocument();- expect(- screen.queryByRole("link", { name: "Request version pinning" }),- ).not.toBeInTheDocument();- });-- it("should show cards with related settings", async () => {- await setup({- isEmbeddingSdkEnabled: false,- showSdkEmbedTerms: false,- });-- const relatedSettingCards = await screen.findAllByTestId(- "related-setting-card",- );- expect(relatedSettingCards).toHaveLength(4);-- expect(await screen.findByText("Authentication")).toBeInTheDocument();- expect(await screen.findByText("Databases")).toBeInTheDocument();- expect(await screen.findByText("People")).toBeInTheDocument();- expect(await screen.findByText("Permissions")).toBeInTheDocument();- });-- it("does not show the modular embedding toggle when token features are missing", () => {- setup({- tokenFeatures: { embedding_simple: false },- });-- expect(- screen.queryByText("Enable modular embedding"),- ).not.toBeInTheDocument();- });-- it("shows the Guest Embeds toggle when token features are missing", () => {- setup({ tokenFeatures: { embedding_simple: false } });-- expect(screen.getByText("Enable guest embeds")).toBeInTheDocument();- });-});diff --git a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSettings/tests/enterprise.unit.spec.tsx b/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSettings/tests/enterprise.unit.spec.tsxdeleted file mode 100644index 80529f50463..00000000000--- a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSettings/tests/enterprise.unit.spec.tsx+++ /dev/null@@ -1,67 +0,0 @@-import { screen, within } from "__support__/ui";--import { type SetupOpts, setup as baseSetup } from "./setup";--const setup = (opts: SetupOpts = {}) =>- baseSetup({- tokenFeatures: {- embedding_sdk: opts.isEmbeddingSdkEnabled,- embedding_simple: opts.isEmbeddingSimpleEnabled,- },- ...opts,- });--describe("EmbeddingSdkSettings (EE)", () => {- it("should not tell users to switch binaries when they have a EE build", async () => {- await setup({- isEmbeddingSdkEnabled: false,- isEmbeddingSimpleEnabled: true,- showSdkEmbedTerms: false,- isHosted: true,- enterprisePlugins: [- "embedding-sdk",- "embedding_iframe_sdk",- "embedding_iframe_sdk_setup",- ],- });- expect(- screen.getByText(- /You can test Embedded analytics SDK on localhost quickly by using API keys/i,- ),- ).toBeInTheDocument();-- const alertInfo = within(screen.getByTestId("sdk-settings-alert-info"));- expect(- alertInfo.queryByText("switch Metabase binaries"),- ).not.toBeInTheDocument();- expect(alertInfo.getByText("upgrade to Metabase Pro")).toBeInTheDocument();- expect(- alertInfo.getByText("implement JWT or SAML SSO"),- ).toBeInTheDocument();- });-- it("should show Tenants in related settings when tenants feature is available", async () => {- await setup({- tokenFeatures: { tenants: true },- enterprisePlugins: [- "embedding-sdk",- "embedding_iframe_sdk",- "embedding_iframe_sdk_setup",- "tenants",- ],- });-- expect(screen.getByText("Tenants")).toBeInTheDocument();- });-- it("should not show Security and Appearance in related settings without token", async () => {- await setup({- isEmbeddingSdkEnabled: false,- isEmbeddingSimpleEnabled: false,- showSdkEmbedTerms: false,- });-- expect(screen.queryByText("Security")).not.toBeInTheDocument();- expect(screen.queryByText("Appearance")).not.toBeInTheDocument();- });-});diff --git a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSettings/tests/premium.unit.spec.tsx b/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSettings/tests/premium.unit.spec.tsxdeleted file mode 100644index 0804fa01c14..00000000000--- a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSettings/tests/premium.unit.spec.tsx+++ /dev/null@@ -1,90 +0,0 @@-import { screen, within } from "__support__/ui";--import { type SetupOpts, setup as baseSetup } from "./setup";--const setup = (opts: SetupOpts = {}) =>- baseSetup({- tokenFeatures: {- embedding_simple: opts.isEmbeddingSimpleEnabled,- embedding_sdk: opts.isEmbeddingSdkEnabled,- },- ...opts,- });--describe("EmbeddingSdkSettings (EE with Embedding SDK token)", () => {- it("should not tell users to upgrade or switch binaries", async () => {- await setup({- isEmbeddingSdkEnabled: true,- isEmbeddingSimpleEnabled: true,- showSdkEmbedTerms: false,- enterprisePlugins: [- "embedding-sdk",- "embedding_iframe_sdk",- "embedding_iframe_sdk_setup",- ],- });- expect(- screen.getByText(- /You can test Embedded analytics SDK on localhost quickly by using API keys/i,- ),- ).toBeInTheDocument();-- const alertInfo = within(screen.getByTestId("sdk-settings-alert-info"));- // should only be shown on non-EE instances- expect(- alertInfo.queryByText("switch Metabase binaries"),- ).not.toBeInTheDocument();- expect(- alertInfo.queryByText("upgrade to Metabase Pro"),- ).not.toBeInTheDocument();- expect(- alertInfo.getByText("implement JWT or SAML SSO"),- ).toBeInTheDocument();- });-- describe("Version pinning", () => {- it("should offer users version pinning when they have a cloud instance", async () => {- await setup({- isEmbeddingSdkEnabled: true,- isEmbeddingSimpleEnabled: true,- showSdkEmbedTerms: false,- isHosted: true,- enterprisePlugins: [- "embedding-sdk",- "embedding_iframe_sdk",- "embedding_iframe_sdk_setup",- ],- });-- expect(screen.getByText("Version pinning")).toBeInTheDocument();- expect(- screen.getByText(- /Metabase Cloud instances are automatically upgraded to new releases/i,- ),- ).toBeInTheDocument();- expect(- screen.getByRole("link", { name: "Request version pinning" }),- ).toBeInTheDocument();- });-- it("should not offer users version pinning on self hosted instances", () => {- setup({ isHosted: false });-- expect(screen.queryByText("Version pinning")).not.toBeInTheDocument();- expect(- screen.queryByRole("link", { name: "Request version pinning" }),- ).not.toBeInTheDocument();- });- });-- it("should show Security and Appearance in related settings", async () => {- await setup({- isEmbeddingSdkEnabled: true,- isEmbeddingSimpleEnabled: true,- showSdkEmbedTerms: false,- });-- expect(screen.getByText("Security")).toBeInTheDocument();- expect(screen.getByText("Appearance")).toBeInTheDocument();- });-});diff --git a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSettings/tests/setup.tsx b/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSettings/tests/setup.tsxdeleted file mode 100644index e6e61bba143..00000000000--- a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSettings/tests/setup.tsx+++ /dev/null@@ -1,20 +0,0 @@-import { renderWithProviders, screen } from "__support__/ui";--import {- type SetupOpts as BaseSetupOpts,- setup as baseSetup,-} from "../../tests/setup";-import { EmbeddingSettings } from "../EmbeddingSettings";--export type SetupOpts = Omit<BaseSetupOpts, "renderCallback">;--export async function setup(setupOptions: SetupOpts = {}) {- baseSetup({- enterprisePlugins: [], // ensures PLUGIN_IS_EE_BUILD.isEEBuild is set to true- ...setupOptions,- renderCallback: ({ state }) =>- renderWithProviders(<EmbeddingSettings />, { storeInitialState: state }),- });-- await screen.findByText("Embedding settings");-}diff --git a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSettings/tests/simple-embedding.unit.spec.tsx b/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSettings/tests/simple-embedding.unit.spec.tsxdeleted file mode 100644index 48aac66b62a..00000000000--- a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSettings/tests/simple-embedding.unit.spec.tsx+++ /dev/null@@ -1,104 +0,0 @@-import userEvent from "@testing-library/user-event";--import { findRequests } from "__support__/server-mocks";-import { screen } from "__support__/ui";--import { type SetupOpts, setup as baseSetup } from "./setup";--const setup = (opts: SetupOpts = {}) =>- baseSetup({- tokenFeatures: {- embedding_sdk: true,- embedding_simple: true,- },- enterprisePlugins: ["embedding"],- ...opts,- });--describe("EmbeddingSdkSettings (EE with Simple Embedding feature)", () => {- it("should show both SDK and Simple Embedding toggles", async () => {- await setup({- isEmbeddingSdkEnabled: false,- isEmbeddingSimpleEnabled: false,- showSdkEmbedTerms: false,- });-- const toggles = screen.getAllByRole("switch");- expect(toggles).toHaveLength(2);-- expect(- screen.getByRole("switch", {- name: "Enable modular embedding SDK toggle",- }),- ).toBeInTheDocument();-- expect(- screen.getByRole("switch", {- name: "Enable modular embedding toggle",- }),- ).toBeInTheDocument();- });-- it("should show legalese modal when Simple Embedding toggle is enabled", async () => {- await setup({- isEmbeddingSdkEnabled: false,- isEmbeddingSimpleEnabled: false,- showSdkEmbedTerms: false,- });-- expect(screen.queryByRole("dialog")).not.toBeInTheDocument();-- // Enable Embedded Analytics JS- const toggle = await screen.findByRole("switch", {- name: "Enable modular embedding toggle",- });-- await userEvent.click(toggle);-- // Should show the legalese modal- expect(screen.getByRole("dialog")).toBeInTheDocument();- expect(screen.getByText("First, some legalese")).toBeInTheDocument();- expect(screen.getByText("Decline and go back")).toBeInTheDocument();- expect(screen.getByText("Agree and continue")).toBeInTheDocument();- });-- it("should update simple embedding settings when user accepts terms", async () => {- await setup({- isEmbeddingSdkEnabled: false,- isEmbeddingSimpleEnabled: false,- showSdkEmbedTerms: false,- });-- const toggle = await screen.findByRole("switch", {- name: "Enable modular embedding toggle",- });-- await userEvent.click(toggle);- await userEvent.click(screen.getByText("Agree and continue"));- expect(screen.queryByRole("dialog")).not.toBeInTheDocument();-- const puts = await findRequests("PUT");- expect(puts).toHaveLength(1);-- const [{ body }] = puts;- expect(body).toEqual({- "enable-embedding-simple": true,- "show-simple-embed-terms": false,- });- });-- it("should show embed button and docs when simple embedding is available", async () => {- await setup({- isEmbeddingSdkEnabled: false,- isEmbeddingSimpleEnabled: true,- showSdkEmbedTerms: false,- });-- const card = screen- .getAllByTestId("sdk-setting-card")- .find((card) => card.textContent?.includes("Enable modular embedding"));-- expect(card).toHaveTextContent("New embed");- expect(card).toHaveTextContent("Documentation");- });-});diff --git a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSettingsCard.tsx b/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSettingsCard.tsxdeleted file mode 100644index 1f30f02b61a..00000000000--- a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSettingsCard.tsx+++ /dev/null@@ -1,98 +0,0 @@-import type { PropsWithChildren } from "react";--import { ExternalLink } from "metabase/common/components/ExternalLink";-import { Alert, Flex, Group, Icon, Stack, Text } from "metabase/ui";-import type { IconName } from "metabase-types/api";--import S from "./EmbeddingSettings.module.css";-import { type EmbeddingSettingKey, EmbeddingToggle } from "./EmbeddingToggle";--type LinkItem = { icon: IconName; title: string; href: string };--export function EmbeddingSettingsCard({- children,- title,- description,- settingKey,- dependentSettingKeys,- isFeatureEnabled = true,- links,- rightSideContent,- alertInfoText,- actionButton,- testId,-}: PropsWithChildren<{- title: string;- description: string;- settingKey: EmbeddingSettingKey;- dependentSettingKeys?: EmbeddingSettingKey[];- isFeatureEnabled?: boolean;- links?: LinkItem[];- rightSideContent?: React.ReactNode;- alertInfoText?: React.ReactNode;- actionButton?: React.ReactNode;- testId?: string;-}>) {- const hasLinksContent = links && links.length > 0;-- return (- <Flex direction="column" className={S.SectionCard} data-testid={testId}>- <Stack gap="xxs" px="xxl" py="xl">- <Text fw={600} c="text-primary" fz="h4">- {title}- </Text>-- <Text c="text-secondary" lh="lg" mb="lg" maw="38rem">- {description}- </Text>-- <Group justify="space-between" align="center">- <EmbeddingToggle- settingKey={settingKey}- dependentSettingKeys={dependentSettingKeys}- labelPosition="right"- disabled={!isFeatureEnabled}- aria-label={`${title} toggle`}- />- {rightSideContent}- </Group>-- {alertInfoText && (- <Alert- size="compact"- variant="light"- data-testid="sdk-settings-alert-info"- mt="lg"- icon={<Icon name="info" />}- >- {alertInfoText}- </Alert>- )}- </Stack>-- {children}-- {(hasLinksContent || actionButton) && (- <Group- px="xxl"- className={S.CardLinksSection}- h="3.5rem"- justify="space-between"- >- <Group gap="xxl">- {links?.map((link, index) => (- <ExternalLink key={index} href={link.href}>- <Group gap="sm" fw="bold">- <Icon name={link.icon} size={14} aria-hidden />- <span>{link.title}</span>- </Group>- </ExternalLink>- ))}- </Group>-- {actionButton}- </Group>- )}- </Flex>- );-}diff --git a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/GuestEmbedsSettings/GuestEmbedsSettings.tsx b/frontend/src/metabase/admin/settings/components/EmbeddingSettings/GuestEmbedsSettings/GuestEmbedsSettings.tsxdeleted file mode 100644index 7e187ffaae9..00000000000--- a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/GuestEmbedsSettings/GuestEmbedsSettings.tsx+++ /dev/null@@ -1,18 +0,0 @@-import { t } from "ttag";--import {- RelatedSettingsSection,- getGuestEmbedsRelatedSettingItems,-} from "metabase/admin/components/RelatedSettingsSection";-import { SettingsPageWrapper } from "metabase/admin/components/SettingsSection";-import { SharedCombinedEmbeddingSettings } from "metabase/admin/settings/components/EmbeddingSettings/SharedCombinedEmbeddingSettings";--export function GuestEmbedsSettings() {- return (- <SettingsPageWrapper title={t`Guest embeds`}>- <SharedCombinedEmbeddingSettings />-- <RelatedSettingsSection items={getGuestEmbedsRelatedSettingItems()} />- </SettingsPageWrapper>- );-}diff --git a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/GuestEmbedsSettings/GuestEmbedsSettings.unit.spec.tsx b/frontend/src/metabase/admin/settings/components/EmbeddingSettings/GuestEmbedsSettings/GuestEmbedsSettings.unit.spec.tsxdeleted file mode 100644index 8760e711cfa..00000000000--- a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/GuestEmbedsSettings/GuestEmbedsSettings.unit.spec.tsx+++ /dev/null@@ -1,58 +0,0 @@-import {- setupEmbeddableEntitiesEndpoints,- setupGenerateRandomTokenEndpoint,- setupPropertiesEndpoints,- setupSettingsEndpoints,- setupUpdateSettingEndpoint,- setupUpsellEndpoints,- setupUserKeyValueEndpoints,-} from "__support__/server-mocks";-import { renderWithProviders, screen } from "__support__/ui";-import {- createMockCard,- createMockDashboard,- createMockSettings,-} from "metabase-types/api/mocks";--import { GuestEmbedsSettings } from "./GuestEmbedsSettings";--const setup = async ({ enabled }: { enabled: boolean }) => {- const settings = createMockSettings({ "enable-embedding-static": enabled });-- setupPropertiesEndpoints(settings);- setupSettingsEndpoints([]);- setupUpdateSettingEndpoint();- setupUpsellEndpoints();- setupEmbeddableEntitiesEndpoints({- dashboards: [createMockDashboard({ name: "My cool dashboard" })],- cards: [createMockCard({ name: "My cool card" })],- });- setupGenerateRandomTokenEndpoint("fake-token");- setupUserKeyValueEndpoints({- namespace: "user_acknowledgement",- key: "upsell-embedded-analytics-js",- value: true,- });-- renderWithProviders(<GuestEmbedsSettings />);-- expect(await screen.findAllByText("Guest embeds")).toHaveLength(1); // Title- expect(await screen.findAllByText("Enable guest embeds")).toHaveLength(1); // Card-};--describe("GuestEmbedsSettings", () => {- it("should show cards with related settings", async () => {- await setup({ enabled: true });-- const relatedSettingCards = await screen.findAllByTestId(- "related-setting-card",- );- expect(relatedSettingCards).toHaveLength(5);-- expect(await screen.findByText("Security")).toBeInTheDocument();- expect(await screen.findByText("Databases")).toBeInTheDocument();- expect(await screen.findByText("People")).toBeInTheDocument();- expect(await screen.findByText("Permissions")).toBeInTheDocument();- expect(await screen.findByText("Appearance")).toBeInTheDocument();- });-});diff --git a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/NewEmbedButton/NewEmbedButton.tsx b/frontend/src/metabase/admin/settings/components/EmbeddingSettings/NewEmbedButton/NewEmbedButton.tsxdeleted file mode 100644index 77192b87fbc..00000000000--- a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/NewEmbedButton/NewEmbedButton.tsx+++ /dev/null@@ -1,37 +0,0 @@-import { t } from "ttag";--import { useDispatch } from "metabase/redux";-import { setOpenModalWithProps } from "metabase/redux/ui";-import { Button } from "metabase/ui";--interface NewEmbedButtonProps {- /**- * Force initial authentication mode to `guest`- */- forceIsGuest?: boolean;-}--export const NewEmbedButton = ({ forceIsGuest }: NewEmbedButtonProps) => {- const dispatch = useDispatch();-- return (- <Button- variant="brand"- size="sm"- onClick={() => {- dispatch(- setOpenModalWithProps({- id: "embed",- props: {- initialState: {- isGuest: forceIsGuest,- },- },- }),- );- }}- >- {t`New embed`}- </Button>- );-};diff --git a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/SharedCombinedEmbeddingSettings/SharedCombinedEmbeddingSettings.tsx b/frontend/src/metabase/admin/settings/components/EmbeddingSettings/SharedCombinedEmbeddingSettings/SharedCombinedEmbeddingSettings.tsxdeleted file mode 100644index a1e75069299..00000000000--- a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/SharedCombinedEmbeddingSettings/SharedCombinedEmbeddingSettings.tsx+++ /dev/null@@ -1,92 +0,0 @@-import { t } from "ttag";--import { SettingsSection } from "metabase/admin/components/SettingsSection";-import { EmbeddingSettingsCard } from "metabase/admin/settings/components/EmbeddingSettings";-import { NewEmbedButton } from "metabase/admin/settings/components/EmbeddingSettings/NewEmbedButton/NewEmbedButton";-import { UpsellBanner } from "metabase/common/components/upsells/components";-import { PLUGIN_CONTENT_TRANSLATION } from "metabase/content-translation/plugins";-import {- PLUGIN_ADMIN_SETTINGS,- PLUGIN_EMBEDDING_IFRAME_SDK_SETUP,-} from "metabase/plugins";-import { useSelector } from "metabase/redux";-import { getUpgradeUrl } from "metabase/selectors/settings";-import { useSetting } from "metabase/settings";-import { Box, Text } from "metabase/ui";--import { SettingTitle } from "../../SettingHeader";-import { EmbeddedResources } from "../../widgets/PublicLinksListing/EmbeddedResources";-import { EmbeddingSecretKeyWidget } from "../EmbeddingSecretKeyWidget";--type Props = {- showEmbeddingSdkSettings?: boolean;- showContentTranslationSettings?: boolean;-};--export function SharedCombinedEmbeddingSettings({- showContentTranslationSettings,-}: Props) {- const isSimpleEmbedFeatureAvailable =- PLUGIN_EMBEDDING_IFRAME_SDK_SETUP.isEnabled();- const isGuestEmbedsEnabled = useSetting("enable-embedding-static");-- const upgradeUrl = useSelector((state) =>- getUpgradeUrl(state, { utm_content: "embedding-settings" }),- );-- const { triggerUpsellFlow } = PLUGIN_ADMIN_SETTINGS.useUpsellFlow({- campaign: "enterprise",- location: "embedding-settings",- });-- return (- <>- <EmbeddingSettingsCard- title={t`Enable guest embeds`}- description={t`A secure way to embed charts and dashboards, without single sign-on, when you don’t want to offer ad-hoc querying or chart drill-through.`}- settingKey="enable-embedding-static"- actionButton={<NewEmbedButton forceIsGuest />}- sdk-setting-card- testId="guest-embeds-setting-card"- />-- {!isSimpleEmbedFeatureAvailable && (- <UpsellBanner- title={t`Upgrade to Metabase Pro for more powerful embedding methods`}- campaign="embedding-methods"- location="embedding-page"- buttonText={t`Upgrade`}- buttonLink={upgradeUrl}- onClick={triggerUpsellFlow}- dismissible- >- <Text c="text-secondary" lh="md">- {t`Embed charts, dashboards with drill-throughs, or even the query builder into your own application using customizable components. Secure your embeds with single sign-on.`}- </Text>- </UpsellBanner>- )}-- <SettingsSection>- <EmbeddingSecretKeyWidget />- </SettingsSection>-- {isGuestEmbedsEnabled && (- <SettingsSection>- <Box data-testid="embedded-resources">- <SettingTitle- id="static-embeds"- fz="lg"- mb="lg"- >{t`Published embeds`}</SettingTitle>-- <EmbeddedResources />- </Box>- </SettingsSection>- )}-- {showContentTranslationSettings && (- <PLUGIN_CONTENT_TRANSLATION.ContentTranslationConfiguration />- )}- </>- );-}diff --git a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/SharedCombinedEmbeddingSettings/SharedCombinedEmbeddingSettings.unit.spec.tsx b/frontend/src/metabase/admin/settings/components/EmbeddingSettings/SharedCombinedEmbeddingSettings/SharedCombinedEmbeddingSettings.unit.spec.tsxdeleted file mode 100644index 58988ab67d0..00000000000--- a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/SharedCombinedEmbeddingSettings/SharedCombinedEmbeddingSettings.unit.spec.tsx+++ /dev/null@@ -1,98 +0,0 @@-import userEvent from "@testing-library/user-event";--import {- findRequests,- setupEmbeddableEntitiesEndpoints,- setupGenerateRandomTokenEndpoint,- setupPropertiesEndpoints,- setupSettingsEndpoints,- setupUpdateSettingEndpoint,- setupUpdateSettingsEndpoint,- setupUpsellEndpoints,- setupUserKeyValueEndpoints,-} from "__support__/server-mocks";-import { renderWithProviders, screen } from "__support__/ui";-import {- createMockCard,- createMockDashboard,- createMockSettings,-} from "metabase-types/api/mocks";--import { SharedCombinedEmbeddingSettings } from "./SharedCombinedEmbeddingSettings";--const setup = async ({ enabled }: { enabled: boolean }) => {- const settings = createMockSettings({ "enable-embedding-static": enabled });-- setupPropertiesEndpoints(settings);- setupSettingsEndpoints([]);- setupUpdateSettingEndpoint();- setupUpdateSettingsEndpoint();- setupUpsellEndpoints();- setupEmbeddableEntitiesEndpoints({- dashboards: [createMockDashboard({ name: "My cool dashboard" })],- cards: [createMockCard({ name: "My cool card" })],- });- setupGenerateRandomTokenEndpoint("fake-token");- setupUserKeyValueEndpoints({- namespace: "user_acknowledgement",- key: "upsell-embedded-analytics-js",- value: true,- });-- renderWithProviders(<SharedCombinedEmbeddingSettings />);-};--describe("SharedCombinedEmbeddingSettings", () => {- it("should toggle static embedding on", async () => {- await setup({ enabled: false });-- await screen.findByText("Enable guest embeds");-- const toggle = screen.getByRole("switch", {- name: /Enable guest embeds toggle/i,- });-- await userEvent.click(toggle);-- const puts = await findRequests("PUT");- expect(puts).toHaveLength(1);- const [{ url, body }] = puts;- expect(url).toContain("/setting");- expect(body).toEqual({- "enable-embedding-static": true,- });- });-- it("should show embeddable dashboards and cards when embedding is enabled", async () => {- await setup({ enabled: true });-- expect(await screen.findByText("My cool dashboard")).toBeInTheDocument();- expect(await screen.findByText("My cool card")).toBeInTheDocument();- });-- it("should hide embeddable dashboards and cards when embedding is disabled", async () => {- await setup({ enabled: false });- expect(await screen.findByText("Enable guest embeds")).toBeInTheDocument();- expect(screen.queryByText("Manage embeds")).not.toBeInTheDocument();- });-- it("should show the embedding secret key input", async () => {- await setup({ enabled: true });-- expect(await screen.findByText("Embedding secret key")).toBeInTheDocument();- });-- it("should generate a new embedding secret key", async () => {- await setup({ enabled: true });-- expect(await screen.findByText("Embedding secret key")).toBeInTheDocument();- const generateButton = screen.getByRole("button", { name: "Generate key" });- await userEvent.click(generateButton);-- const puts = await findRequests("PUT");- expect(puts).toHaveLength(1);- const [{ url, body }] = puts;- expect(url).toContain("/setting/embedding-secret-key");- expect(body).toEqual({ value: "fake-token" }); // we got this from the mock api- });-});diff --git a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/SharedCombinedEmbeddingSettings/index.ts b/frontend/src/metabase/admin/settings/components/EmbeddingSettings/SharedCombinedEmbeddingSettings/index.tsdeleted file mode 100644index e886cd67484..00000000000--- a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/SharedCombinedEmbeddingSettings/index.ts+++ /dev/null@@ -1 +0,0 @@-export * from "./SharedCombinedEmbeddingSettings";diff --git a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/index.ts b/frontend/src/metabase/admin/settings/components/EmbeddingSettings/index.tsdeleted file mode 100644index 4fd00073c52..00000000000--- a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/index.ts+++ /dev/null@@ -1,5 +0,0 @@-export { GuestEmbedsSettings } from "metabase/admin/settings/components/EmbeddingSettings/GuestEmbedsSettings/GuestEmbedsSettings";-export { EmbeddingSettings } from "metabase/admin/settings/components/EmbeddingSettings/EmbeddingSettings/EmbeddingSettings";-export { EmbeddingSecuritySettings } from "./EmbeddingSecuritySettings";-export { EmbeddingSettingsCard } from "./EmbeddingSettingsCard";-export { EmbeddingToggle } from "./EmbeddingToggle";diff --git a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/tests/setup.tsx b/frontend/src/metabase/admin/settings/components/EmbeddingSettings/tests/setup.tsxdeleted file mode 100644index 9836ce4d3de..00000000000--- a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/tests/setup.tsx+++ /dev/null@@ -1,95 +0,0 @@-import { setupEnterpriseOnlyPlugin } from "__support__/enterprise";-import {- findRequests,- setupPropertiesEndpoints,- setupSettingsEndpoints,- setupTokenStatusEndpoint,- setupUpdateSettingEndpoint,- setupUpdateSettingsEndpoint,- setupUpsellEndpoints,- setupUserKeyValueEndpoints,-} from "__support__/server-mocks";-import { mockSettings } from "__support__/settings";-import { createMockState } from "__support__/state";-import { waitFor } from "__support__/ui";-import { PLUGIN_IS_EE_BUILD } from "metabase/plugins";-import type { State } from "metabase/redux/store";-import type { Settings, TokenFeatures } from "metabase-types/api";-import {- createMockSettings,- createMockTokenFeatures,-} from "metabase-types/api/mocks";--export interface SetupOpts {- renderCallback: (data: { state: Partial<State> }) => void;- showSdkEmbedTerms?: Settings["show-sdk-embed-terms"];- isEmbeddingSdkEnabled?: Settings["enable-embedding-sdk"];- isEmbeddingSimpleEnabled?: Settings["enable-embedding-simple"];- isHosted?: Settings["is-hosted?"];- tokenFeatures?: Partial<TokenFeatures>;- enterprisePlugins?: Parameters<typeof setupEnterpriseOnlyPlugin>[0][];-}--export async function setup({- renderCallback,- showSdkEmbedTerms = true,- isEmbeddingSdkEnabled = false,- isEmbeddingSimpleEnabled = false,- isHosted = false,- tokenFeatures = {},- enterprisePlugins,-}: SetupOpts) {- const settings = createMockSettings({- "show-sdk-embed-terms": showSdkEmbedTerms,- "enable-embedding-sdk": isEmbeddingSdkEnabled,- "enable-embedding-simple": isEmbeddingSimpleEnabled,- "is-hosted?": isHosted,- "token-features": createMockTokenFeatures(tokenFeatures),- });-- const state = createMockState({- settings: mockSettings(settings),- });-- if (enterprisePlugins?.length) {- PLUGIN_IS_EE_BUILD.isEEBuild = () => true;-- enterprisePlugins.forEach((plugin) => {- setupEnterpriseOnlyPlugin(plugin);- });-- setupTokenStatusEndpoint({ valid: true });- }-- setupPropertiesEndpoints(settings);- setupSettingsEndpoints([]);- setupUpdateSettingEndpoint();- setupUpdateSettingsEndpoint();- setupUpsellEndpoints();- setupUserKeyValueEndpoints({- namespace: "user_acknowledgement",- key: "upsell-dev_instances",- value: true,- });- setupUserKeyValueEndpoints({- namespace: "user_acknowledgement",- key: "upsell-embedded-analytics-js",- value: true,- });-- renderCallback({ state });-- await waitFor(async () => {- const gets = await findRequests("GET");- expect(gets).toEqual(- expect.arrayContaining([- expect.objectContaining({- url: expect.stringContaining("/api/setting"),- }),- expect.objectContaining({- url: expect.stringContaining("/api/session/properties"),- }),- ]),- );- });-}diff --git a/frontend/src/metabase/admin/settings/components/SettingsLdapForm.tsx b/frontend/src/metabase/admin/settings/components/SettingsLdapForm.tsxindex e0f6de4d6c9..a754745c356 100644--- a/frontend/src/metabase/admin/settings/components/SettingsLdapForm.tsx+++ b/frontend/src/metabase/admin/settings/components/SettingsLdapForm.tsx@@ -4,12 +4,6 @@ import _ from "underscore";import type { TestConfig } from "yup";import * as Yup from "yup";-import {- SETTINGS_CARD_STACK_PROPS,- SETTINGS_CARD_TITLE_PROPS,- SettingsPageWrapper,- SettingsSection,-} from "metabase/admin/components/SettingsSection";import { GroupMappingsWidget } from "metabase/admin/settings/components/widgets/GroupMappingsWidget";import { getExtraFormFieldProps } from "metabase/admin/settings/utils";import { LoadingAndErrorWrapper } from "metabase/common/components/LoadingAndErrorWrapper";@@ -26,6 +20,12 @@ import {useGetAdminSettingsDetailsQuery,useGetSettingsQuery,} from "metabase/settings";+import {+ SETTINGS_CARD_STACK_PROPS,+ SETTINGS_CARD_TITLE_PROPS,+ SettingsPageWrapper,+ SettingsSection,+} from "metabase/settings-components";import { Box, Flex, Group, Radio, Stack } from "metabase/ui";import type { EnterpriseSettings, Settings } from "metabase-types/api";diff --git a/frontend/src/metabase/admin/settings/components/SettingsLicense/SettingsLicense.tsx b/frontend/src/metabase/admin/settings/components/SettingsLicense/SettingsLicense.tsxindex 8454720909c..3ba23111a68 100644--- a/frontend/src/metabase/admin/settings/components/SettingsLicense/SettingsLicense.tsx+++ b/frontend/src/metabase/admin/settings/components/SettingsLicense/SettingsLicense.tsx@@ -1,14 +1,12 @@import { t } from "ttag";-import { SettingsSection } from "metabase/admin/components/SettingsSection";import { ExternalLink } from "metabase/common/components/ExternalLink";import { useSelector } from "metabase/redux";import type { State } from "metabase/redux/store";import { getUpgradeUrl } from "metabase/selectors/settings";+import { SettingHeader, SettingsSection } from "metabase/settings-components";import { Box, Button, Divider, Flex, Text } from "metabase/ui";-import { SettingHeader } from "../SettingHeader";-import { ExplorePlansIllustration } from "./ExplorePlansIllustration";export const SettingsLicense = () => {diff --git a/frontend/src/metabase/admin/settings/components/SettingsPages/AuthenticationSettingsPage.tsx b/frontend/src/metabase/admin/settings/components/SettingsPages/AuthenticationSettingsPage.tsxindex 45519a7dbe5..278a86b3679 100644--- a/frontend/src/metabase/admin/settings/components/SettingsPages/AuthenticationSettingsPage.tsx+++ b/frontend/src/metabase/admin/settings/components/SettingsPages/AuthenticationSettingsPage.tsx@@ -1,6 +1,5 @@import { t } from "ttag";-import { SettingsPageWrapper } from "metabase/admin/components/SettingsSection";import { UpsellSSO } from "metabase/admin/upsells";import {type AuthSettingsPageTab,@@ -8,6 +7,7 @@ import {PLUGIN_MULTI_FACTOR_AUTH,} from "metabase/plugins";import { hasAnySsoFeature, useGetSettingsQuery } from "metabase/settings";+import { SettingsPageWrapper } from "metabase/settings-components";import { Box, Flex, Stack } from "metabase/ui";import { ApiKeysAuthCard } from "../../auth/components/ApiKeysAuthCard";diff --git a/frontend/src/metabase/admin/settings/components/SettingsPages/CloudSettingsPage.tsx b/frontend/src/metabase/admin/settings/components/SettingsPages/CloudSettingsPage.tsxindex d991665edf2..ea917e727c3 100644--- a/frontend/src/metabase/admin/settings/components/SettingsPages/CloudSettingsPage.tsx+++ b/frontend/src/metabase/admin/settings/components/SettingsPages/CloudSettingsPage.tsx@@ -1,15 +1,15 @@import { t } from "ttag";+import { ButtonLink } from "metabase/common/components/ExternalLink";+import { useHasTokenFeature, useStoreUrl } from "metabase/common/hooks";import {+ SettingHeader,SettingsPageWrapper,SettingsSection,-} from "metabase/admin/components/SettingsSection";-import { ButtonLink } from "metabase/common/components/ExternalLink";-import { useHasTokenFeature, useStoreUrl } from "metabase/common/hooks";+} from "metabase/settings-components";import { Box, Icon } from "metabase/ui";import { CloudPanel } from "../CloudPanel";-import { SettingHeader } from "../SettingHeader";export function CloudSettingsPage() {const isHosted = useHasTokenFeature("hosting");diff --git a/frontend/src/metabase/admin/settings/components/SettingsPages/CustomVisualizationsSettingsPage.tsx b/frontend/src/metabase/admin/settings/components/SettingsPages/CustomVisualizationsSettingsPage.tsxindex 768c2f50c95..4f50316eea3 100644--- a/frontend/src/metabase/admin/settings/components/SettingsPages/CustomVisualizationsSettingsPage.tsx+++ b/frontend/src/metabase/admin/settings/components/SettingsPages/CustomVisualizationsSettingsPage.tsx@@ -1,12 +1,12 @@import { jt, t } from "ttag";-import { SettingsPageWrapper } from "metabase/admin/components/SettingsSection";import { UpsellCustomViz } from "metabase/admin/upsells";import { Link } from "metabase/common/components/Link";import { useHasTokenFeature, useMetadataToasts } from "metabase/common/hooks";import { PLUGIN_CUSTOM_VIZ } from "metabase/plugins";import { useParams } from "metabase/router";import { useAdminSetting } from "metabase/settings";+import { SettingsPageWrapper } from "metabase/settings-components";import {Alert,Button,diff --git a/frontend/src/metabase/admin/settings/components/SettingsPages/DataAppsSettingsPage.tsx b/frontend/src/metabase/admin/settings/components/SettingsPages/DataAppsSettingsPage.tsxindex 9c9f769ae9b..9f940b12c89 100644--- a/frontend/src/metabase/admin/settings/components/SettingsPages/DataAppsSettingsPage.tsx+++ b/frontend/src/metabase/admin/settings/components/SettingsPages/DataAppsSettingsPage.tsx@@ -2,7 +2,7 @@// the upsell branch below.// import { t } from "ttag";//-// import { SettingsPageWrapper } from "metabase/admin/components/SettingsSection";+// import { SettingsPageWrapper } from "metabase/settings-components";// import { UpsellDataApps } from "metabase/admin/upsells";// import { useHasTokenFeature } from "metabase/common/hooks";import { PLUGIN_DATA_APPS } from "metabase/plugins";diff --git a/frontend/src/metabase/admin/settings/components/SettingsPages/DomainsSettingsPage.tsx b/frontend/src/metabase/admin/settings/components/SettingsPages/DomainsSettingsPage.tsxindex 02c68907ba5..b4768e078b0 100644--- a/frontend/src/metabase/admin/settings/components/SettingsPages/DomainsSettingsPage.tsx+++ b/frontend/src/metabase/admin/settings/components/SettingsPages/DomainsSettingsPage.tsx@@ -2,11 +2,6 @@ import type { FormikHelpers } from "formik";import { flushSync } from "react-dom";import { jt, t } from "ttag";-import {- SettingsPageWrapper,- SettingsSection,-} from "metabase/admin/components/SettingsSection";-import { isSettingSetFromEnvVar } from "metabase/admin/settings/settings";import { ExternalLink } from "metabase/common/components/ExternalLink";import { LeaveRouteConfirmModal } from "metabase/common/components/LeaveConfirmModal";import { Link } from "metabase/common/components/Link";@@ -22,12 +17,16 @@ import {FormTextarea,} from "metabase/forms";import { useAdminSetting, useAdminSettings } from "metabase/settings";+import {+ SettingHeader,+ SettingsPageWrapper,+ SettingsSection,+ isSettingSetFromEnvVar,+} from "metabase/settings-components";import { Box, Stack } from "metabase/ui";import * as Urls from "metabase/urls";import { reload } from "metabase/utils/dom";-import { SettingHeader } from "../SettingHeader";-import {type DomainsSettings,isDomainSettingsDirty,diff --git a/frontend/src/metabase/admin/settings/components/SettingsPages/EmailSettingsPage.tsx b/frontend/src/metabase/admin/settings/components/SettingsPages/EmailSettingsPage.tsxindex b776154f38c..c5d202f0779 100644--- a/frontend/src/metabase/admin/settings/components/SettingsPages/EmailSettingsPage.tsx+++ b/frontend/src/metabase/admin/settings/components/SettingsPages/EmailSettingsPage.tsx@@ -1,17 +1,17 @@import { t } from "ttag";-import {- SettingsPageWrapper,- SettingsSection,-} from "metabase/admin/components/SettingsSection";import { UpsellHostingBanner } from "metabase/admin/upsells";import { LoadingAndErrorWrapper } from "metabase/common/components/LoadingAndErrorWrapper";import { useHasTokenFeature } from "metabase/common/hooks";import { useGetSettingsQuery } from "metabase/settings";+import {+ AdminSettingInput,+ SettingsPageWrapper,+ SettingsSection,+} from "metabase/settings-components";import { Center } from "metabase/ui";import { SMTPConnectionCard } from "../Email/SMTPConnectionCard";-import { AdminSettingInput } from "../widgets/AdminSettingInput";import { EmailFromAddressWidget } from "../widgets/EmailFromAddressWidget";import { EmailReplyToWidget } from "../widgets/EmailReplyToWidget";import { SendTestEmailWidget } from "../widgets/SendTestEmailWidget";diff --git a/frontend/src/metabase/admin/settings/components/SettingsPages/GeneralSettingsPage.tsx b/frontend/src/metabase/admin/settings/components/SettingsPages/GeneralSettingsPage.tsxindex 71d94622d17..3e680abc9f9 100644--- a/frontend/src/metabase/admin/settings/components/SettingsPages/GeneralSettingsPage.tsx+++ b/frontend/src/metabase/admin/settings/components/SettingsPages/GeneralSettingsPage.tsx@@ -1,16 +1,19 @@import { t } from "ttag";-import {- SettingsPageWrapper,- SettingsSection,-} from "metabase/admin/components/SettingsSection";import { CollectUserDataInput } from "metabase/admin/settings/components/widgets/UsageTracking/CollectUserDataInput";import { UpsellDevInstances } from "metabase/admin/upsells";+import { ExternalLink } from "metabase/common/components/ExternalLink";import { useHasTokenFeature } from "metabase/common/hooks";-import { PLUGIN_SEMANTIC_SEARCH } from "metabase/plugins";+import { PLUGIN_EMBEDDING_SDK, PLUGIN_SEMANTIC_SEARCH } from "metabase/plugins";+import { useSetting } from "metabase/settings";+import {+ AdminSettingInput,+ SettingsPageWrapper,+ SettingsSection,+} from "metabase/settings-components";+import { Group, Icon, Text } from "metabase/ui";import { DevInstanceBanner } from "../GeneralSettings/DevInstanceBanner";-import { AdminSettingInput } from "../widgets/AdminSettingInput";import { HomepageSetting } from "../widgets/HomepageSetting";import { HttpsOnlyWidget } from "../widgets/HttpsOnlyWidget";import { SiteUrlWidget } from "../widgets/SiteUrlWidget";@@ -20,6 +23,8 @@ export function GeneralSettingsPage() {const hasHostingFeature = useHasTokenFeature("hosting");const hasAuditAppFeature = useHasTokenFeature("audit_app");const enableAnonymousTracking = !hasHostingFeature;+ const isReactSdkFeatureAvailable = PLUGIN_EMBEDDING_SDK.isEnabled();+ const isHosted = useSetting("is-hosted?");return (<SettingsPageWrapper title={t`General`}>@@ -79,6 +84,21 @@ export function GeneralSettingsPage() {</SettingsSection>)}+ {isReactSdkFeatureAvailable && isHosted && (+ <SettingsSection title={t`Version pinning`}>+ <Text c="text-secondary" lh="lg" mb="sm">+ {t`Metabase Cloud instances are automatically upgraded to new releases. SDK packages are strictly compatible with specific version of Metabase. You can request to pin your Metabase to a major version and upgrade your Metabase and SDK dependency in a coordinated fashion.`}+ </Text>++ <ExternalLink href="mailto:[email protected]">+ <Group gap="sm" fw="bold" w="fit-content">+ <Icon name="mail" size={14} aria-hidden />+ <span>{t`Request version pinning`}</span>+ </Group>+ </ExternalLink>+ </SettingsSection>+ )}+<UpsellDevInstances location="settings-general" /></SettingsPageWrapper>);diff --git a/frontend/src/metabase/admin/settings/components/SettingsPages/GeneralSettingsPage.unit.spec.tsx b/frontend/src/metabase/admin/settings/components/SettingsPages/GeneralSettingsPage.unit.spec.tsxindex 8e813cf0e19..3f251f12d5c 100644--- a/frontend/src/metabase/admin/settings/components/SettingsPages/GeneralSettingsPage.unit.spec.tsx+++ b/frontend/src/metabase/admin/settings/components/SettingsPages/GeneralSettingsPage.unit.spec.tsx@@ -11,6 +11,7 @@ import {} from "__support__/server-mocks";import { renderWithProviders, screen, waitFor } from "__support__/ui";import { UndoListing } from "metabase/common/components/UndoListing";+import { PLUGIN_EMBEDDING_SDK } from "metabase/plugins";import { Route } from "metabase/router";import type { SettingKey } from "metabase-types/api";import {@@ -37,18 +38,35 @@ const generalSettings = {"search-engine": "appdb",} as const;+const originalIsEmbeddingSdkEnabled = PLUGIN_EMBEDDING_SDK.isEnabled;++afterEach(() => {+ PLUGIN_EMBEDDING_SDK.isEnabled = originalIsEmbeddingSdkEnabled;+});+const setup = async ({isCloudPlan,hasAuditApp,+ isHosted,+ hasEmbeddingSdk,}: {isCloudPlan?: boolean;hasAuditApp?: boolean;+ isHosted?: boolean;+ hasEmbeddingSdk?: boolean;} = {}) => {+ // Direct control, bypassing hasPremiumFeature/MetabaseSettings singleton+ // timing -- deterministic regardless of what earlier tests in this worker+ // left behind.+ PLUGIN_EMBEDDING_SDK.isEnabled = () => hasEmbeddingSdk ?? false;+const settings = createMockSettings({...generalSettings,+ "is-hosted?": isHosted ?? false,"token-features": createMockTokenFeatures({hosting: isCloudPlan ?? false,audit_app: hasAuditApp ?? true,+ embedding_sdk: hasEmbeddingSdk ?? false,}),});@@ -237,4 +255,38 @@ describe("GeneralSettingsPage", () => {expect(screen.getByText("Usage tracking")).toBeInTheDocument();});});++ describe("Version pinning", () => {+ it("should offer users version pinning when they have a cloud instance with the SDK", async () => {+ await setup({ isHosted: true, hasEmbeddingSdk: true });++ expect(screen.getByText("Version pinning")).toBeInTheDocument();+ expect(+ screen.getByText(+ /Metabase Cloud instances are automatically upgraded to new releases/i,+ ),+ ).toBeInTheDocument();+ expect(+ screen.getByRole("link", { name: "Request version pinning" }),+ ).toBeInTheDocument();+ });++ it("should not offer version pinning on self-hosted instances", async () => {+ await setup({ isHosted: false, hasEmbeddingSdk: true });++ expect(screen.queryByText("Version pinning")).not.toBeInTheDocument();+ expect(+ screen.queryByRole("link", { name: "Request version pinning" }),+ ).not.toBeInTheDocument();+ });++ it("should not offer version pinning without the SDK feature", async () => {+ await setup({ isHosted: true, hasEmbeddingSdk: false });++ expect(screen.queryByText("Version pinning")).not.toBeInTheDocument();+ expect(+ screen.queryByRole("link", { name: "Request version pinning" }),+ ).not.toBeInTheDocument();+ });+ });});diff --git a/frontend/src/metabase/admin/settings/components/SettingsPages/LocalizationSettingsPage.tsx b/frontend/src/metabase/admin/settings/components/SettingsPages/LocalizationSettingsPage.tsxindex 59b9c7cd8d4..9ff407d8605 100644--- a/frontend/src/metabase/admin/settings/components/SettingsPages/LocalizationSettingsPage.tsx+++ b/frontend/src/metabase/admin/settings/components/SettingsPages/LocalizationSettingsPage.tsx@@ -1,17 +1,17 @@import { t } from "ttag";import _ from "underscore";-import {- SettingsPageWrapper,- SettingsSection,-} from "metabase/admin/components/SettingsSection";import { CommunityLocalizationNotice } from "metabase/common/components/CommunityLocalizationNotice";import { useSelector } from "metabase/redux";import { getApplicationName } from "metabase/selectors/whitelabel";import { useSetting } from "metabase/settings";+import {+ AdminSettingInput,+ SettingsPageWrapper,+ SettingsSection,+} from "metabase/settings-components";import { Stack } from "metabase/ui";-import { AdminSettingInput } from "../widgets/AdminSettingInput";import { FormattingWidget } from "../widgets/FormattingWidget";export function LocalizationSettingsPage() {diff --git a/frontend/src/metabase/admin/settings/components/SettingsPages/MapsSettingsPage.tsx b/frontend/src/metabase/admin/settings/components/SettingsPages/MapsSettingsPage.tsxindex 4b2aff88e22..69f8b1d0b7a 100644--- a/frontend/src/metabase/admin/settings/components/SettingsPages/MapsSettingsPage.tsx+++ b/frontend/src/metabase/admin/settings/components/SettingsPages/MapsSettingsPage.tsx@@ -1,13 +1,13 @@import { jt, t } from "ttag";+import { ExternalLink } from "metabase/common/components/ExternalLink";+import { useDocsUrl } from "metabase/common/hooks";import {+ AdminSettingInput,SettingsPageWrapper,SettingsSection,-} from "metabase/admin/components/SettingsSection";-import { ExternalLink } from "metabase/common/components/ExternalLink";-import { useDocsUrl } from "metabase/common/hooks";+} from "metabase/settings-components";-import { AdminSettingInput } from "../widgets/AdminSettingInput";import { CustomGeoJSONWidget } from "../widgets/CustomGeoJSONWidget";export function MapsSettingsPage() {diff --git a/frontend/src/metabase/admin/settings/components/SettingsPages/PublicSharingSettingsPage.tsx b/frontend/src/metabase/admin/settings/components/SettingsPages/PublicSharingSettingsPage.tsxindex e68a40d9cee..34e98c25dc8 100644--- a/frontend/src/metabase/admin/settings/components/SettingsPages/PublicSharingSettingsPage.tsx+++ b/frontend/src/metabase/admin/settings/components/SettingsPages/PublicSharingSettingsPage.tsx@@ -1,12 +1,12 @@import { t } from "ttag";+import { useSetting } from "metabase/settings";import {+ AdminSettingInput,SettingsPageWrapper,SettingsSection,-} from "metabase/admin/components/SettingsSection";-import { useSetting } from "metabase/settings";+} from "metabase/settings-components";-import { AdminSettingInput } from "../widgets/AdminSettingInput";import {PublicLinksActionListing,PublicLinksDashboardListing,diff --git a/frontend/src/metabase/admin/settings/components/SettingsPages/SlackSettingsPage.tsx b/frontend/src/metabase/admin/settings/components/SettingsPages/SlackSettingsPage.tsxindex 259fedce880..35543c279ba 100644--- a/frontend/src/metabase/admin/settings/components/SettingsPages/SlackSettingsPage.tsx+++ b/frontend/src/metabase/admin/settings/components/SettingsPages/SlackSettingsPage.tsx@@ -1,7 +1,7 @@import { t } from "ttag";import { MetabotSlackSetup } from "metabase/admin/ai/MetabotSlackSetup";-import { SettingsPageWrapper } from "metabase/admin/components/SettingsSection";+import { SettingsPageWrapper } from "metabase/settings-components";import { Icon } from "metabase/ui";import { SlackSetup } from "../../slack/SlackSetup";diff --git a/frontend/src/metabase/admin/settings/components/SettingsPages/UpdatesSettingsPage.tsx b/frontend/src/metabase/admin/settings/components/SettingsPages/UpdatesSettingsPage.tsxindex 6dd8c5218ed..2c2271123f9 100644--- a/frontend/src/metabase/admin/settings/components/SettingsPages/UpdatesSettingsPage.tsx+++ b/frontend/src/metabase/admin/settings/components/SettingsPages/UpdatesSettingsPage.tsx@@ -1,16 +1,16 @@import cx from "classnames";import { t } from "ttag";-import {- SettingsPageWrapper,- SettingsSection,-} from "metabase/admin/components/SettingsSection";import { UpsellHostingBanner } from "metabase/admin/upsells";import { NotFound } from "metabase/common/components/ErrorPages";import CS from "metabase/css/core/index.css";import { useSetting } from "metabase/settings";+import {+ AdminSettingInput,+ SettingsPageWrapper,+ SettingsSection,+} from "metabase/settings-components";-import { AdminSettingInput } from "../widgets/AdminSettingInput";import { VersionUpdateNotice } from "../widgets/VersionUpdateNotice";import { NewVersionInfo } from "../widgets/VersionUpdateNotice/VersionUpdateNotice";diff --git a/frontend/src/metabase/admin/settings/components/SettingsPages/UploadSettingsPage.tsx b/frontend/src/metabase/admin/settings/components/SettingsPages/UploadSettingsPage.tsxindex 22fe067b1aa..bd902406bc2 100644--- a/frontend/src/metabase/admin/settings/components/SettingsPages/UploadSettingsPage.tsx+++ b/frontend/src/metabase/admin/settings/components/SettingsPages/UploadSettingsPage.tsx@@ -1,11 +1,11 @@import { t } from "ttag";+import { UpsellUploads } from "metabase/admin/upsells";+import { PLUGIN_UPLOAD_MANAGEMENT } from "metabase/plugins";import {SettingsPageWrapper,SettingsSection,-} from "metabase/admin/components/SettingsSection";-import { UpsellUploads } from "metabase/admin/upsells";-import { PLUGIN_UPLOAD_MANAGEMENT } from "metabase/plugins";+} from "metabase/settings-components";import { Box, Flex } from "metabase/ui";import { UploadSettingsForm } from "../UploadSettings/UploadSettingsForm";diff --git a/frontend/src/metabase/admin/settings/components/SettingsPages/WebhooksSettingsPage.tsx b/frontend/src/metabase/admin/settings/components/SettingsPages/WebhooksSettingsPage.tsxindex 06f4510c6cd..af74b76bb1b 100644--- a/frontend/src/metabase/admin/settings/components/SettingsPages/WebhooksSettingsPage.tsx+++ b/frontend/src/metabase/admin/settings/components/SettingsPages/WebhooksSettingsPage.tsx@@ -1,11 +1,11 @@import { useState } from "react";import { c, t } from "ttag";+import { useListChannelsQuery } from "metabase/api/channel";import {SettingsPageWrapper,SettingsSection,-} from "metabase/admin/components/SettingsSection";-import { useListChannelsQuery } from "metabase/api/channel";+} from "metabase/settings-components";import {Button,Flex,diff --git a/frontend/src/metabase/admin/settings/components/UploadSettings/UploadSettingsForm.tsx b/frontend/src/metabase/admin/settings/components/UploadSettings/UploadSettingsForm.tsxindex 21a669ec612..855d508bd81 100644--- a/frontend/src/metabase/admin/settings/components/UploadSettings/UploadSettingsForm.tsx+++ b/frontend/src/metabase/admin/settings/components/UploadSettings/UploadSettingsForm.tsx@@ -17,6 +17,7 @@ import { LoadingAndErrorWrapper } from "metabase/common/components/LoadingAndErrimport { useToast } from "metabase/common/hooks";import CS from "metabase/css/core/index.css";import { useAdminSetting, useSetting } from "metabase/settings";+import { SettingHeader } from "metabase/settings-components";import {Alert,Box,@@ -36,8 +37,6 @@ import type {UploadsSettings,} from "metabase-types/api";-import { SettingHeader } from "../SettingHeader";-import { dbHasSchema, getDatabaseOptions, getSchemaOptions } from "./utils";const FEEDBACK_TIMEOUT = 5000;diff --git a/frontend/src/metabase/admin/settings/components/widgets/CustomGeoJSONWidget.tsx b/frontend/src/metabase/admin/settings/components/widgets/CustomGeoJSONWidget.tsxindex 969391b4db7..8202814bcd9 100644--- a/frontend/src/metabase/admin/settings/components/widgets/CustomGeoJSONWidget.tsx+++ b/frontend/src/metabase/admin/settings/components/widgets/CustomGeoJSONWidget.tsx@@ -16,6 +16,7 @@ import { LoadingAndErrorWrapper } from "metabase/common/components/LoadingAndErrimport AdminS from "metabase/css/admin.module.css";import CS from "metabase/css/core/index.css";import { useAdminSetting } from "metabase/settings";+import { SettingHeader } from "metabase/settings-components";import {Box,Button,@@ -34,8 +35,6 @@ import type {GeoJSONData,} from "metabase-types/api";-import { SettingHeader } from "../SettingHeader";-export const CustomGeoJSONWidget = () => {const [map, setMap] = useState<CustomGeoJSONMap | undefined>();const [originalMap, setOriginalMap] = useState<diff --git a/frontend/src/metabase/admin/settings/components/widgets/EmailFromAddressWidget.tsx b/frontend/src/metabase/admin/settings/components/widgets/EmailFromAddressWidget.tsxindex 7a63c931665..d872f43bc8a 100644--- a/frontend/src/metabase/admin/settings/components/widgets/EmailFromAddressWidget.tsx+++ b/frontend/src/metabase/admin/settings/components/widgets/EmailFromAddressWidget.tsx@@ -3,12 +3,9 @@ import { t } from "ttag";import { UpsellEmailWhitelabelPill } from "metabase/admin/upsells";import { useHasTokenFeature } from "metabase/common/hooks";import { useAdminSetting, useSetting } from "metabase/settings";+import { AdminSettingInput, SettingHeader } from "metabase/settings-components";import { Box, Icon, TextInput } from "metabase/ui";-import { SettingHeader } from "../SettingHeader";--import { AdminSettingInput } from "./AdminSettingInput";-export function EmailFromAddressWidget() {const { value: fromAddressValue } = useAdminSetting("email-from-address");const isHosted = useSetting("is-hosted?");diff --git a/frontend/src/metabase/admin/settings/components/widgets/EmailReplyToWidget.tsx b/frontend/src/metabase/admin/settings/components/widgets/EmailReplyToWidget.tsxindex 24fbb7f8481..947d52237c1 100644--- a/frontend/src/metabase/admin/settings/components/widgets/EmailReplyToWidget.tsx+++ b/frontend/src/metabase/admin/settings/components/widgets/EmailReplyToWidget.tsx@@ -3,12 +3,12 @@ import _ from "underscore";import { SetByEnvVar } from "metabase/common/components/SetByEnvVar";import { useAdminSetting } from "metabase/settings";+import {+ BasicAdminSettingInput,+ SettingHeader,+} from "metabase/settings-components";import { Stack } from "metabase/ui";-import { SettingHeader } from "../SettingHeader";--import { BasicAdminSettingInput } from "./AdminSettingInput";-// The backend accepts a string array for multiple reply-to emails,// but currently the frontend only lets the user enter a single email.//diff --git a/frontend/src/metabase/admin/settings/components/widgets/FormattingWidget.tsx b/frontend/src/metabase/admin/settings/components/widgets/FormattingWidget.tsxindex 7c82c166d16..57b28c8f039 100644--- a/frontend/src/metabase/admin/settings/components/widgets/FormattingWidget.tsx+++ b/frontend/src/metabase/admin/settings/components/widgets/FormattingWidget.tsx@@ -2,9 +2,9 @@ import { useEffect, useMemo, useState } from "react";import { t } from "ttag";import _ from "underscore";-import { SettingsSection } from "metabase/admin/components/SettingsSection";import { SetByEnvVar } from "metabase/common/components/SetByEnvVar";import { useAdminSetting } from "metabase/settings";+import { SettingsSection } from "metabase/settings-components";import { Box, Radio, Select, Stack, Switch, Text } from "metabase/ui";import {getCurrencyOptions,diff --git a/frontend/src/metabase/admin/settings/components/widgets/HomepageSetting.tsx b/frontend/src/metabase/admin/settings/components/widgets/HomepageSetting.tsxindex a10249b8d2b..3f8bb5971ae 100644--- a/frontend/src/metabase/admin/settings/components/widgets/HomepageSetting.tsx+++ b/frontend/src/metabase/admin/settings/components/widgets/HomepageSetting.tsx@@ -5,11 +5,10 @@ import { trackCustomHomepageDashboardEnabled } from "metabase/common/analytics";import { DashboardSelector } from "metabase/common/components/DashboardSelector";import { PLUGIN_HOMEPAGE_SETTING } from "metabase/plugins";import { useAdminSetting } from "metabase/settings";+import { SettingHeader } from "metabase/settings-components";import { Box, Radio, Stack, Text } from "metabase/ui";import type { DashboardId } from "metabase-types/api";-import { SettingHeader } from "../SettingHeader";-type Mode = "default" | "dashboard" | "url";export function getHomepageMode(diff --git a/frontend/src/metabase/admin/settings/components/widgets/HttpsOnlyWidget.tsx b/frontend/src/metabase/admin/settings/components/widgets/HttpsOnlyWidget.tsxindex 8b2949d023d..4f05df49670 100644--- a/frontend/src/metabase/admin/settings/components/widgets/HttpsOnlyWidget.tsx+++ b/frontend/src/metabase/admin/settings/components/widgets/HttpsOnlyWidget.tsx@@ -3,10 +3,9 @@ import { t } from "ttag";import { useHasTokenFeature } from "metabase/common/hooks";import { useAdminSetting } from "metabase/settings";+import { AdminSettingInput } from "metabase/settings-components";import { fetchWithTimeout } from "metabase/utils/fetchWithTimeout";-import { AdminSettingInput } from "./AdminSettingInput";-enum Status {VERIFIED = "verified",CHECKING = "checking",diff --git a/frontend/src/metabase/admin/settings/components/widgets/PublicLinksListing/PublicDocumentResources.tsx b/frontend/src/metabase/admin/settings/components/widgets/PublicLinksListing/PublicDocumentResources.tsxindex eb69e3a4da6..f236d78630b 100644--- a/frontend/src/metabase/admin/settings/components/widgets/PublicLinksListing/PublicDocumentResources.tsx+++ b/frontend/src/metabase/admin/settings/components/widgets/PublicLinksListing/PublicDocumentResources.tsx@@ -1,10 +1,10 @@import { t } from "ttag";-import { PublicLinksListing } from "metabase/admin/settings/components/widgets/PublicLinksListing/index";import {useDeleteDocumentPublicLinkMutation,useListPublicDocumentsQuery,} from "metabase/api";+import { PublicLinksListing } from "metabase/common/components/PublicLinksListing/PublicLinksListing";import * as Urls from "metabase/urls";import type { Document } from "metabase-types/api";diff --git a/frontend/src/metabase/admin/settings/components/widgets/PublicLinksListing/PublicResources.tsx b/frontend/src/metabase/admin/settings/components/widgets/PublicLinksListing/PublicResources.tsxindex 0c43e59b814..37ecacc85ef 100644--- a/frontend/src/metabase/admin/settings/components/widgets/PublicLinksListing/PublicResources.tsx+++ b/frontend/src/metabase/admin/settings/components/widgets/PublicLinksListing/PublicResources.tsx@@ -8,6 +8,7 @@ import {useListPublicCardsQuery,useListPublicDashboardsQuery,} from "metabase/api";+import { PublicLinksListing } from "metabase/common/components/PublicLinksListing/PublicLinksListing";import { useSetting } from "metabase/settings";import * as Urls from "metabase/urls";import type {@@ -16,8 +17,6 @@ import type {GetPublicDashboard,} from "metabase-types/api";-import { PublicLinksListing } from "./PublicLinksListing";-export const PublicLinksDashboardListing = () => {const query = useListPublicDashboardsQuery();const [revoke] = useDeleteDashboardPublicLinkMutation();diff --git a/frontend/src/metabase/admin/settings/components/widgets/PublicLinksListing/index.ts b/frontend/src/metabase/admin/settings/components/widgets/PublicLinksListing/index.tsindex ce6b5be8f54..470bd8c5dec 100644--- a/frontend/src/metabase/admin/settings/components/widgets/PublicLinksListing/index.ts+++ b/frontend/src/metabase/admin/settings/components/widgets/PublicLinksListing/index.ts@@ -1,4 +1,2 @@-export * from "./PublicLinksListing";-export * from "./EmbeddedResources";export * from "./PublicResources";export * from "./PublicDocumentResources";diff --git a/frontend/src/metabase/admin/settings/components/widgets/SiteUrlWidget.tsx b/frontend/src/metabase/admin/settings/components/widgets/SiteUrlWidget.tsxindex 893db2ba31c..1ca6525e5fd 100644--- a/frontend/src/metabase/admin/settings/components/widgets/SiteUrlWidget.tsx+++ b/frontend/src/metabase/admin/settings/components/widgets/SiteUrlWidget.tsx@@ -4,13 +4,13 @@ import { t } from "ttag";import { InputWithSelectPrefix } from "metabase/common/components/InputWithSelectPrefix";import { useHasTokenFeature } from "metabase/common/hooks";import { useAdminSetting } from "metabase/settings";+import {+ SetByEnvVarWrapper,+ SettingHeader,+} from "metabase/settings-components";import { Box, Text } from "metabase/ui";import type { GenericErrorResponse } from "metabase/utils/errors";-import { SettingHeader } from "../SettingHeader";--import { SetByEnvVarWrapper } from "./AdminSettingInput";-export function SiteUrlWidget() {const { value, updateSetting, description, isLoading, settingDetails } =useAdminSetting("site-url");diff --git a/frontend/src/metabase/admin/settings/components/widgets/UsageTracking/BaseUsageTrackingSettingToggle.tsx b/frontend/src/metabase/admin/settings/components/widgets/UsageTracking/BaseUsageTrackingSettingToggle.tsxindex b6358ab7775..565a61c0fb0 100644--- a/frontend/src/metabase/admin/settings/components/widgets/UsageTracking/BaseUsageTrackingSettingToggle.tsx+++ b/frontend/src/metabase/admin/settings/components/widgets/UsageTracking/BaseUsageTrackingSettingToggle.tsx@@ -1,12 +1,13 @@-import { isSettingSetFromEnvVar } from "metabase/admin/settings/settings";import { SetByEnvVar } from "metabase/common/components/SetByEnvVar";import { useAdminSetting } from "metabase/settings";+import {+ BasicAdminSettingInput,+ SettingHeader,+ isSettingSetFromEnvVar,+} from "metabase/settings-components";import { Stack } from "metabase/ui";import type { Settings } from "metabase-types/api";-import { SettingHeader } from "../../SettingHeader";-import { BasicAdminSettingInput } from "../AdminSettingInput";-interface BaseUsageTrackingSettingToggleProps {settingName: keyof Settings;title: string;diff --git a/frontend/src/metabase/admin/settings/slack/SlackBugReportChannelInput.tsx b/frontend/src/metabase/admin/settings/slack/SlackBugReportChannelInput.tsxindex cb90d14d23d..a035f1d5d1a 100644--- a/frontend/src/metabase/admin/settings/slack/SlackBugReportChannelInput.tsx+++ b/frontend/src/metabase/admin/settings/slack/SlackBugReportChannelInput.tsx@@ -3,10 +3,10 @@ import { t } from "ttag";import { useToast } from "metabase/common/hooks";import { useSetting } from "metabase/settings";+import { SettingHeader } from "metabase/settings-components";import { Box, Text, TextInput } from "metabase/ui";import { useUpdateSlackSettingsMutation } from "../api/slack";-import { SettingHeader } from "../components/SettingHeader";const getSlackError = (err: unknown): string =>// Unjustified type cast. FIXMEdiff --git a/frontend/src/metabase/admin/settings/slack/SlackSetup.tsx b/frontend/src/metabase/admin/settings/slack/SlackSetup.tsxindex d2a4d124cfb..5e653ade11f 100644--- a/frontend/src/metabase/admin/settings/slack/SlackSetup.tsx+++ b/frontend/src/metabase/admin/settings/slack/SlackSetup.tsx@@ -2,7 +2,6 @@ import { useDisclosure } from "@mantine/hooks";import { useMemo } from "react";import { jt, t } from "ttag";-import { SettingsSection } from "metabase/admin/components/SettingsSection";import { ConfirmModal } from "metabase/common/components/ConfirmModal";import {ButtonLink,@@ -11,6 +10,7 @@ import {import { Markdown } from "metabase/common/components/Markdown";import { useDocsUrl } from "metabase/common/hooks";import { useSetting } from "metabase/settings";+import { SettingsSection } from "metabase/settings-components";import {Badge,Box,diff --git a/frontend/src/metabase/admin/upsells/UpsellEmbeddingTheme.tsx b/frontend/src/metabase/admin/upsells/UpsellEmbeddingTheme.tsxdeleted file mode 100644index 7a9dfd537e3..00000000000--- a/frontend/src/metabase/admin/upsells/UpsellEmbeddingTheme.tsx+++ /dev/null@@ -1,42 +0,0 @@-import { t } from "ttag";--import { DottedBackground } from "metabase/common/components/upsells/components/DottedBackground";-import { LineDecorator } from "metabase/common/components/upsells/components/LineDecorator";-import { useUpgradeAction } from "metabase/common/components/upsells/components/UpgradeModal";-import { UpsellCardContent } from "metabase/common/components/upsells/components/UpsellCardContent";-import { UPGRADE_URL } from "metabase/common/components/upsells/constants";-import { useHasTokenFeature } from "metabase/common/hooks";-import { Stack } from "metabase/ui";--export const UpsellEmbeddingTheme = ({ source }: { source: string }) => {- const hasSimpleEmbedding = useHasTokenFeature("embedding_simple");- const campaign = "embedding-themes";-- const { onClick: upgradeOnClick, url: upgradeUrl } = useUpgradeAction({- url: UPGRADE_URL,- campaign,- location: source,- });-- if (hasSimpleEmbedding) {- return null;- }-- return (- <DottedBackground px="3.5rem" pb="2rem">- <Stack align="center" p={40}>- <LineDecorator>- <UpsellCardContent- campaign={campaign}- location={source}- title={t`Create custom themes`}- description={t`Fine-tune the appearance of your embedded content with colors and fonts.`}- upgradeOnClick={upgradeOnClick}- upgradeUrl={upgradeUrl}- image="app/assets/img/upsell-themes.png"- />- </LineDecorator>- </Stack>- </DottedBackground>- );-};diff --git a/frontend/src/metabase/admin/upsells/UpsellSdkLink.tsx b/frontend/src/metabase/admin/upsells/UpsellSdkLink.tsxdeleted file mode 100644index bfc4830b77a..00000000000--- a/frontend/src/metabase/admin/upsells/UpsellSdkLink.tsx+++ /dev/null@@ -1,50 +0,0 @@-import cx from "classnames";-import { t } from "ttag";--import { ExternalLink } from "metabase/common/components/ExternalLink";-import CS from "metabase/css/core/index.css";-import linkStyles from "metabase/css/core/link.module.css";-import { PLUGIN_ADMIN_SETTINGS } from "metabase/plugins";-import { useSelector } from "metabase/redux";-import { getUpgradeUrl } from "metabase/selectors/settings";-import { UnstyledButton } from "metabase/ui";--export function UpsellSdkLink() {- const campaign = "embedding-sdk";- const location = "embedding-sdk-admin";- const upgradeUrl = useSelector((state) =>- getUpgradeUrl(state, {- utm_campaign: campaign,- utm_content: location,- }),- );- const { triggerUpsellFlow } = PLUGIN_ADMIN_SETTINGS.useUpsellFlow({- campaign,- location,- });-- if (triggerUpsellFlow) {- return (- <UnstyledButton- onClick={triggerUpsellFlow}- c="core-brand"- className={linkStyles.link}- key="upgrade-button"- fw="bold"- fz="inherit"- >- {t`upgrade to Metabase Pro`}- </UnstyledButton>- );- }-- return (- <ExternalLink- key="upgrade-url"- href={upgradeUrl}- className={cx(CS.textBold, linkStyles.link)}- >- {t`upgrade to Metabase Pro`}- </ExternalLink>- );-}diff --git a/frontend/src/metabase/admin/upsells/UpsellTenants.tsx b/frontend/src/metabase/admin/upsells/UpsellTenants.tsxindex 0061f0912c1..17a2c279d8b 100644--- a/frontend/src/metabase/admin/upsells/UpsellTenants.tsx+++ b/frontend/src/metabase/admin/upsells/UpsellTenants.tsx@@ -8,10 +8,15 @@ import { UPGRADE_URL } from "metabase/common/components/upsells/constants";import { useHasTokenFeature } from "metabase/common/hooks";import { Stack } from "metabase/ui";-export const UpsellTenants = () => {+export const UpsellTenants = ({+ align = "center",+ source: location = "people-tenants",+}: {+ align?: "center" | "flex-start";+ source?: string;+}) => {const hasTenants = useHasTokenFeature("tenants");const campaign = "tenants";- const location = "people-tenants";const { onClick: upgradeOnClick, url: upgradeUrl } = useUpgradeAction({url: UPGRADE_URL,campaign,@@ -23,17 +28,19 @@ export const UpsellTenants = () => {}return (- <DottedBackground px="3.5rem" pb="2rem">- <Stack align="center" p={40}>+ <DottedBackground px={align === "flex-start" ? 0 : "3.5rem"} py="2rem">+ {/* Left-aligned in the embedding hub, where the card lines up with+ the page heading. Admin People keeps the original centered layout. */}+ <Stack align={align}><LineDecorator><UpsellCardContentcampaign={campaign}location={location}- title={t`Manage customer-facing analytics at scale`}- description={t`Group your customers into tenants, reuse the same dashboards and permissions, and keep each tenant's data isolated.`}+ title={t`Use a multi-tenant user strategy`}+ description={t`Securely share data with external users and allow them to create content. Reuse the same dashboards and permissions across all tenants, instead of recreating them for each customer.`}upgradeOnClick={upgradeOnClick}upgradeUrl={upgradeUrl}- image="app/assets/img/upsell-tenants.png"+ image="app/assets/img/upsell-embedding-tenants.svg"/></LineDecorator></Stack>diff --git a/frontend/src/metabase/admin/upsells/index.ts b/frontend/src/metabase/admin/upsells/index.tsindex ad699e4efbc..2afca3acef0 100644--- a/frontend/src/metabase/admin/upsells/index.ts+++ b/frontend/src/metabase/admin/upsells/index.ts@@ -4,7 +4,6 @@ export * from "./UpsellCloud";export * from "./UpsellCustomViz";export * from "./UpsellDataApps";export * from "./UpsellEmailWhitelabel";-export * from "./UpsellEmbeddingTheme";export * from "./UpsellHosting";export * from "./UpsellPermissions";export * from "./UpsellRemoteSync";diff --git a/frontend/src/metabase/api/card.ts b/frontend/src/metabase/api/card.tsindex 75ffebd1e41..7644deebd0d 100644--- a/frontend/src/metabase/api/card.ts+++ b/frontend/src/metabase/api/card.ts@@ -185,7 +185,7 @@ export const cardApi = Api.injectEndpoints({listTag("card"),listTag("schema"),listTag("table"),- listTag("embedding-hub-checklist"),+ listTag("setup-guide-checklist"),]),}),updateCard: builder.mutation<Card, UpdateCardRequest>({@@ -343,7 +343,7 @@ export const cardApi = Api.injectEndpoints({}),updateCardEnableEmbedding: updateCardPropertiesMutation<"enable_embedding" | "embedding_type"- >([listTag("embedding-hub-checklist")]),+ >([listTag("setup-guide-checklist")]),updateCardEmbeddingParams: updateCardPropertiesMutation<"embedding_params" | "embedding_type">(),diff --git a/frontend/src/metabase/api/collection.ts b/frontend/src/metabase/api/collection.tsindex 786353434b2..dba7db66b0c 100644--- a/frontend/src/metabase/api/collection.ts+++ b/frontend/src/metabase/api/collection.ts@@ -147,9 +147,9 @@ export const collectionApi = Api.injectEndpoints({idTag("collection", collection.parent_id ?? "root"),];- // Creating a shared tenant collection affects the embedding hub checklist+ // Creating a shared tenant collection affects the setup guide checklistif (request.namespace === "shared-tenant-collection") {- tags.push(listTag("embedding-hub-checklist"));+ tags.push(listTag("setup-guide-checklist"));}return invalidateTags(error, tags);diff --git a/frontend/src/metabase/api/dashboard.ts b/frontend/src/metabase/api/dashboard.tsindex cea63334c62..494c6b29060 100644--- a/frontend/src/metabase/api/dashboard.ts+++ b/frontend/src/metabase/api/dashboard.ts@@ -262,7 +262,7 @@ export const dashboardApi = Api.injectEndpoints({}),updateDashboardEnableEmbedding: updateDashboardPropertiesMutation<"enable_embedding" | "embedding_type"- >([listTag("embedding-hub-checklist")]),+ >([listTag("setup-guide-checklist")]),updateDashboardEmbeddingParams: updateDashboardPropertiesMutation<"embedding_params" | "embedding_type">(),diff --git a/frontend/src/metabase/api/database.ts b/frontend/src/metabase/api/database.tsindex c3a26028134..c091ab18dd4 100644--- a/frontend/src/metabase/api/database.ts+++ b/frontend/src/metabase/api/database.ts@@ -179,7 +179,7 @@ export const databaseApi = Api.injectEndpoints({invalidatesTags: (_, error) =>invalidateTags(error, [listTag("database"),- listTag("embedding-hub-checklist"),+ listTag("setup-guide-checklist"),]),}),updateDatabase: builder.mutation<Database, UpdateDatabaseRequest>({diff --git a/frontend/src/metabase/api/tags/constants.ts b/frontend/src/metabase/api/tags/constants.tsindex 525c9296525..c4bb708c40a 100644--- a/frontend/src/metabase/api/tags/constants.ts+++ b/frontend/src/metabase/api/tags/constants.ts@@ -24,7 +24,7 @@ export const TAG_TYPES = ["external-transform","public-document","comment",- "embedding-hub-checklist",+ "setup-guide-checklist","exploration","field","field-values",diff --git a/frontend/src/metabase/app-embed-sdk.tsx b/frontend/src/metabase/app-embed-sdk.tsxindex c66ebaa5e69..330997db140 100644--- a/frontend/src/metabase/app-embed-sdk.tsx+++ b/frontend/src/metabase/app-embed-sdk.tsx@@ -17,7 +17,7 @@ import {EMBEDDING_SDK_IFRAME_EMBEDDING_CONFIG.isSimpleEmbedding = true;EMBEDDING_SDK_CONFIG.isEmbeddingSdk = true;EMBEDDING_SDK_CONFIG.metabaseClientRequestHeader = "embedding-simple";-EMBEDDING_SDK_CONFIG.enableEmbeddingSettingKey = "enable-embedding-simple";+EMBEDDING_SDK_CONFIG.enableEmbeddingSettingKey = "enable-embedding-modular";EMBEDDING_SDK_CONFIG.tokenFeatureKey = "embedding_simple";// load the embedding_iframe_sdk EE plugindiff --git a/frontend/src/metabase/app/selectors.ts b/frontend/src/metabase/app/selectors.tsindex f2ae6ac97c6..4b0be2a565e 100644--- a/frontend/src/metabase/app/selectors.ts+++ b/frontend/src/metabase/app/selectors.ts@@ -37,6 +37,12 @@ export const getIsMonitorApp = createSelector([getRouterPath], (path) => {return path.startsWith("/monitor");});+const EMBEDDING_HUB_PATH_PREFIX = "/embedding";++export const getIsEmbeddingHubApp = createSelector([getRouterPath], (path) => {+ return path.startsWith(EMBEDDING_HUB_PATH_PREFIX);+});+export const getIsDataApp = createSelector([getRouterPath], (path) => {return path.startsWith(`${Urls.DATA_APP_ROOT_URL}/`);});@@ -76,6 +82,7 @@ const PATHS_WITHOUT_NAVBAR = [/^\/auth/,/^\/data-studio/,/^\/monitor/,+ new RegExp(`^${EMBEDDING_HUB_PATH_PREFIX}`),// Data apps run full-page with their own custom chrome (a hover-down panel),// so neither the left navbar nor the top app bar should be shown.new RegExp(`^${Urls.DATA_APP_ROOT_URL}/`),@@ -206,6 +213,7 @@ export const getIsAppBarVisible = createSelector(getIsAdminApp,getIsDataStudioApp,getIsMonitorApp,+ getIsEmbeddingHubApp,getIsEditingDashboard,selectIsWithinIframe,getIsEmbeddedAppBarVisible,@@ -217,6 +225,7 @@ export const getIsAppBarVisible = createSelector(isAdminApp,isDataStudioApp,isMonitorApp,+ isEmbeddingHubApp,isEditingDashboard,isEmbedded,isEmbeddedAppBarVisible,@@ -229,6 +238,7 @@ export const getIsAppBarVisible = createSelector(isAdminApp ||isDataStudioApp ||isMonitorApp ||+ isEmbeddingHubApp ||isEditingDashboard ||isFullscreen) {diff --git a/frontend/src/metabase/common/components/EditBar/EditBar.module.css b/frontend/src/metabase/common/components/EditBar/EditBar.module.cssnew file mode 100644index 00000000000..8773604d8c6--- /dev/null+++ b/frontend/src/metabase/common/components/EditBar/EditBar.module.css@@ -0,0 +1,65 @@+.root {+ display: flex;+ align-items: center;+ justify-content: space-between;+ position: relative;+ padding-top: 0.5rem;+ padding-bottom: 0.5rem;+ background-color: color-mix(+ in srgb,+ var(--mb-color-accent7) 85%,+ transparent+ );+}++.root.brand {+ background-color: color-mix(+ in srgb,+ var(--mb-color-core-brand) 85%,+ transparent+ );+}++.editIcon {+ color: var(--mb-color-text-primary-inverse);+}++.title {+ color: var(--mb-color-text-primary-inverse);+ font-weight: 700;+}++/* restyles metabase/ui buttons for the colored bar: filled = primary, subtle = secondary */+.buttonsContainer {+ display: flex;+}++.buttonsContainer :global(button[data-variant]) {+ color: var(--mb-color-text-primary-inverse);+ background-color: color-mix(+ in srgb,+ var(--mb-color-background_page-primary) 10%,+ transparent+ );+ border: none;+ font-size: 1em;+ margin-left: 0.75em;+}++.buttonsContainer :global(button[data-variant="filled"]) {+ color: var(--mb-color-accent7);+ background-color: var(--mb-color-background_page-primary);+}++.buttonsContainer.brand :global(button[data-variant="filled"]) {+ color: var(--mb-color-core-brand);+}++.buttonsContainer :global(button[data-variant]):hover {+ color: var(--mb-color-text-primary-inverse);+ background-color: var(--mb-color-accent7);+}++.buttonsContainer.brand :global(button[data-variant]):hover {+ background-color: var(--mb-color-core-brand);+}diff --git a/frontend/src/metabase/common/components/EditBar/EditBar.styled.tsx b/frontend/src/metabase/common/components/EditBar/EditBar.styled.tsxdeleted file mode 100644index 381adeb837c..00000000000--- a/frontend/src/metabase/common/components/EditBar/EditBar.styled.tsx+++ /dev/null@@ -1,56 +0,0 @@-import isPropValid from "@emotion/is-prop-valid";-// eslint-disable-next-line no-restricted-imports-import styled from "@emotion/styled";--import { FullWidthContainer } from "metabase/styled-components/layout/FullWidthContainer";-import { Icon } from "metabase/ui";-import { alpha } from "metabase/ui/colors";-import { color } from "metabase/ui/utils/colors";--export const Root = styled(FullWidthContainer, {- shouldForwardProp: isPropValid,-})<{ admin: boolean }>`- display: flex;- align-items: center;- justify-content: space-between;- position: relative;- padding-top: 0.5rem;- padding-bottom: 0.5rem;- background-color: ${(props) =>- alpha(props.admin ? "accent7" : "core-brand", 0.85)};-`;--export const EditIcon = styled(Icon)`- color: var(--mb-color-text-primary-inverse);-`;--export const Title = styled.span`- color: var(--mb-color-text-primary-inverse);- font-weight: 700;-`;--/* restyles metabase/ui buttons for the colored bar: filled = primary, subtle = secondary */-export const ButtonsContainer = styled("div", {- shouldForwardProp: isPropValid,-})<{ admin: boolean }>`- display: flex;-- button[data-variant] {- color: var(--mb-color-text-primary-inverse);- background-color: ${() => alpha("background_page-primary", 0.1)};- border: none;- font-size: 1em;- margin-left: 0.75em;- }-- button[data-variant="filled"] {- color: ${(props) => color(props.admin ? "text-primary" : "core-brand")};- background-color: var(--mb-color-background_page-primary);- }-- button[data-variant]:hover {- color: var(--mb-color-text-primary-inverse);- background-color: ${(props) =>- color(props.admin ? "accent7" : "core-brand")};- }-`;diff --git a/frontend/src/metabase/common/components/EditBar/EditBar.tsx b/frontend/src/metabase/common/components/EditBar/EditBar.tsxindex 790e4197244..8f6c36ba697 100644--- a/frontend/src/metabase/common/components/EditBar/EditBar.tsx+++ b/frontend/src/metabase/common/components/EditBar/EditBar.tsx@@ -1,8 +1,10 @@+import cx from "classnames";import type { ReactNode } from "react";-import { Group } from "metabase/ui";+import { FullWidthContainer } from "metabase/styled-components/layout/FullWidthContainer";+import { Group, Icon } from "metabase/ui";-import { ButtonsContainer, EditIcon, Root, Title } from "./EditBar.styled";+import styles from "./EditBar.module.css";type Props = {title: string;@@ -21,18 +23,21 @@ export function EditBar({className,"data-testid": dataTestId,}: Props) {+ const isBrand = !admin;+return (- <Root- className={className}- admin={admin}+ <FullWidthContainer+ className={cx(styles.root, { [styles.brand]: isBrand }, className)}data-testid={dataTestId ?? "edit-bar"}><Group gap="sm" align="center" wrap="nowrap">- <EditIcon name="pencil" size={12} />- <Title>{title}</Title>+ <Icon name="pencil" size={12} className={styles.editIcon} />+ <span className={styles.title}>{title}</span></Group>{center && <div>{center}</div>}- <ButtonsContainer admin={admin}>{buttons}</ButtonsContainer>- </Root>+ <div className={cx(styles.buttonsContainer, { [styles.brand]: isBrand })}>+ {buttons}+ </div>+ </FullWidthContainer>);}diff --git a/frontend/src/metabase/common/components/Link/BaseLink.tsx b/frontend/src/metabase/common/components/Link/BaseLink.tsxindex a77a5ff0784..e7f99d88813 100644--- a/frontend/src/metabase/common/components/Link/BaseLink.tsx+++ b/frontend/src/metabase/common/components/Link/BaseLink.tsx@@ -49,14 +49,24 @@ function hrefFor(target: To): string {* but react-router resolves it against the current route instead, which would* nest it. Anchor it so the target does not depend on where the link renders.*- * Left alone: a leading `?` or `#`, which keeps the current path by design, and- * anything carrying a scheme (`https:`, `mailto:`) or a protocol-relative `//`,- * which is not a route at all.+ * Three forms are left alone:+ *+ * 1. A leading `?` or `#`, which keeps the current path by design.+ * 2. Anything carrying a scheme (`https:`, `mailto:`) or a protocol-relative+ * `//`, which is not a route at all.+ * 3. An explicit `.` or `..`, which is route-relative on purpose. `..` means+ * "up one level", so a page mounted under more than one route uses it to+ * link back to whichever parent it currently sits under. Anchoring it would+ * give `/..`, which react-router resolves to `/` — the link would go to the+ * home page instead.*/function toRootRelative(pathname: string): string {const isAlreadyAnchored = pathname === "" || /^[/?#]/.test(pathname);const hasScheme = /^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(pathname);- return isAlreadyAnchored || hasScheme ? pathname : `/${pathname}`;+ const isExplicitlyRelative = /^\.{1,2}(\/|$)/.test(pathname);+ return isAlreadyAnchored || hasScheme || isExplicitlyRelative+ ? pathname+ : `/${pathname}`;}function anchorTarget(to: To): To {diff --git a/frontend/src/metabase/common/components/Link/Link.unit.spec.tsx b/frontend/src/metabase/common/components/Link/Link.unit.spec.tsxindex 9ec8b5e9b5e..3a8d821434c 100644--- a/frontend/src/metabase/common/components/Link/Link.unit.spec.tsx+++ b/frontend/src/metabase/common/components/Link/Link.unit.spec.tsx@@ -41,9 +41,25 @@ function Home() {);}+function RelativeLinkPage() {+ const { pathname } = useLocation();+ return (+ <div>+ <span data-testid="relative-link-location">{pathname}</span>+ {/* An explicit `..` asks for route-relative resolution on purpose. */}+ <Link to="..">up</Link>+ </div>+ );+}+const tree = (<Route path="/" element={<Home />}><Route path="other" element={<span data-testid="other">other</span>} />+ {/* Nested two levels deep on purpose: at depth 1 the parent is the root,+ so "/.." and ".." both land on "/" and the test would pass either way. */}+ <Route path="section" element={<Outlet />}>+ <Route path="child" element={<RelativeLinkPage />} />+ </Route></Route>);@@ -163,4 +179,19 @@ describe("Link", () => {expect(screen.getByTestId("other")).toBeInTheDocument();expect(screen.getByTestId("location")).toHaveTextContent("/other");});++ it("resolves an explicit `..` against the current route, not the root", async () => {+ renderWithProviders(tree, {+ withRouter: true,+ initialRoute: "/section/child",+ });++ await screen.findByTestId("relative-link-location");++ // Anchoring would turn ".." into "/..", which resolves to "/" — a silent+ // navigation to the app root instead of one level up.+ await userEvent.click(screen.getByRole("link", { name: "up" }));++ expect(screen.getByTestId("location")).toHaveTextContent("/section");+ });});diff --git a/frontend/src/metabase/common/components/PermissionsBasePath/base-path.ts b/frontend/src/metabase/common/components/PermissionsBasePath/base-path.tsnew file mode 100644index 00000000000..782ea076319--- /dev/null+++ b/frontend/src/metabase/common/components/PermissionsBasePath/base-path.ts@@ -0,0 +1,54 @@+import { useEffect, useId } from "react";++/**+ * Where the permissions editor is currently mounted.+ *+ * Unlike the tenant URLs, this cannot be a React context: the permission URL+ * builders are called from redux selectors and thunks+ * (`selectors/data-permissions/breadcrumbs.ts`, `permissions.ts`,+ * `advanced_permissions/reducer.ts`), which have no component to read a context+ * from. Only one permissions editor renders at a time, so a module-level value+ * set by whichever host mounted it is sufficient and keeps every call site's+ * signature unchanged.+ */++export const ADMIN_PERMISSIONS_BASE_PATH = "/admin/permissions";++let basePath = ADMIN_PERMISSIONS_BASE_PATH;+let ownerId: string | null = null;++export function setPermissionsBasePath(+ nextBasePath: string,+ nextOwnerId: string,+) {+ basePath = nextBasePath;+ ownerId = nextOwnerId;+}++/**+ * Only the current owner may reset. React renders the incoming tree before+ * cleaning up the outgoing one, so a host unmounting during a tab switch runs+ * this after its replacement has already claimed the path — and both hosts+ * claim the same string, so comparing values cannot tell them apart.+ */+export function resetPermissionsBasePath(callerId: string) {+ if (ownerId !== callerId) {+ return;+ }++ basePath = ADMIN_PERMISSIONS_BASE_PATH;+ ownerId = null;+}++export function getPermissionsBasePath() {+ return basePath;+}++/** Claims the permissions base path for as long as the caller is mounted. */+export function usePermissionsBasePath(nextBasePath: string) {+ const ownerId = useId();++ setPermissionsBasePath(nextBasePath, ownerId);++ useEffect(() => () => resetPermissionsBasePath(ownerId), [ownerId]);+}diff --git a/frontend/src/metabase/common/components/PermissionsBasePath/base-path.unit.spec.tsx b/frontend/src/metabase/common/components/PermissionsBasePath/base-path.unit.spec.tsxnew file mode 100644index 00000000000..361cb4e7e76--- /dev/null+++ b/frontend/src/metabase/common/components/PermissionsBasePath/base-path.unit.spec.tsx@@ -0,0 +1,55 @@+import { renderWithProviders, screen } from "__support__/ui";++import {+ ADMIN_PERMISSIONS_BASE_PATH,+ getPermissionsBasePath,+ usePermissionsBasePath,+} from "./base-path";++const HUB_BASE_PATH = "/admin/embedding/permissions";++// Two hosts claiming the same path, the way the Tenancy and Permissions tabs+// both do.+function TenancyHost() {+ usePermissionsBasePath(HUB_BASE_PATH);++ return <div>tenancy</div>;+}++function PermissionsHost() {+ usePermissionsBasePath(HUB_BASE_PATH);++ return <div>permissions</div>;+}++function Tab({ name }: { name: "tenancy" | "permissions" }) {+ return name === "tenancy" ? <TenancyHost /> : <PermissionsHost />;+}++describe("usePermissionsBasePath", () => {+ it("claims the base path while mounted", () => {+ renderWithProviders(<Tab name="permissions" />);++ expect(getPermissionsBasePath()).toBe(HUB_BASE_PATH);+ });++ it("releases the base path on unmount", () => {+ const { unmount } = renderWithProviders(<Tab name="permissions" />);++ unmount();++ expect(getPermissionsBasePath()).toBe(ADMIN_PERMISSIONS_BASE_PATH);+ });++ it("keeps the path when one host replaces another claiming the same path", () => {+ // React renders the incoming host before cleaning up the outgoing one, so+ // the outgoing cleanup runs after the incoming claim. Both hosts claim the+ // same string, so only the owning token can tell them apart.+ const { rerender } = renderWithProviders(<Tab name="tenancy" />);++ rerender(<Tab name="permissions" />);++ expect(screen.getByText("permissions")).toBeInTheDocument();+ expect(getPermissionsBasePath()).toBe(HUB_BASE_PATH);+ });+});diff --git a/frontend/src/metabase/admin/settings/components/widgets/PublicLinksListing/PublicLinksListing.tsx b/frontend/src/metabase/common/components/PublicLinksListing/PublicLinksListing.tsxsimilarity index 100%rename from frontend/src/metabase/admin/settings/components/widgets/PublicLinksListing/PublicLinksListing.tsxrename to frontend/src/metabase/common/components/PublicLinksListing/PublicLinksListing.tsxdiff --git a/frontend/src/metabase/admin/settings/components/widgets/PublicLinksListing/PublicLinksListing.unit.spec.tsx b/frontend/src/metabase/common/components/PublicLinksListing/PublicLinksListing.unit.spec.tsxsimilarity index 100%rename from frontend/src/metabase/admin/settings/components/widgets/PublicLinksListing/PublicLinksListing.unit.spec.tsxrename to frontend/src/metabase/common/components/PublicLinksListing/PublicLinksListing.unit.spec.tsxdiff --git a/frontend/src/metabase/common/components/upsells/components/UpsellBanner.tsx b/frontend/src/metabase/common/components/upsells/components/UpsellBanner.tsxindex 3669dc83fff..8c98dfcbc79 100644--- a/frontend/src/metabase/common/components/upsells/components/UpsellBanner.tsx+++ b/frontend/src/metabase/common/components/upsells/components/UpsellBanner.tsx@@ -41,7 +41,7 @@ type UpsellBannerPropsBase = {campaign: string;location: string;large?: boolean;- children: React.ReactNode;+ children?: React.ReactNode;style?: React.CSSProperties;onClick?: () => void;};@@ -77,27 +77,32 @@ export const UpsellBannerInner: React.FC<UpsellBannerProps> = ({? props: { dismissible: false, onDismiss: () => {} };const gemSize = large ? 24 : undefined;+ // Without body text there is only the single title line, so top-aligning the+ // row would leave the gem and the button sitting above it.+ const hasBody = Boolean(children);// Use onClick if provided, otherwise use upgrade actionconst handleClick = onClick ?? upgradeOnClick;return (<Box- className={cx(S.UpsellBannerComponent, large && S.Large)}+ className={cx(S.UpsellBannerComponent, large && hasBody && S.Large)}data-testid="upsell-banner"bg="background_page-primary"{...domProps}>- <Flex align="flex-start" gap="sm" wrap="nowrap">- <UpsellGem size={gemSize} mt="1px" />+ <Flex align={hasBody ? "flex-start" : "center"} gap="sm" wrap="nowrap">+ <UpsellGem size={gemSize} mt={hasBody ? "1px" : undefined} /><Stack gap="xxs"><Title lh={1.25} order={3} size="md">{title}</Title>- <Text lh="1rem" size="sm" c="text-secondary">- {children}- </Text>+ {children && (+ <Text lh="1rem" size="sm" c="text-secondary">+ {children}+ </Text>+ )}</Stack></Flex>diff --git a/frontend/src/metabase/common/components/upsells/components/UpsellCardContent.tsx b/frontend/src/metabase/common/components/upsells/components/UpsellCardContent.tsxindex 5ebadb750d5..4ae824d4ae5 100644--- a/frontend/src/metabase/common/components/upsells/components/UpsellCardContent.tsx+++ b/frontend/src/metabase/common/components/upsells/components/UpsellCardContent.tsx@@ -181,7 +181,7 @@ const UpsellCardLeftColumnContent = ({</Text>)}{isTrialAvailable && (- <Text>{t`Get a 14-day free trial of this and other pro features`}</Text>+ <Text>{t`Get a 14 day trial of this and other Pro features.`}</Text>)}</Stack>{!shouldShowContactAdmin && (diff --git a/frontend/src/metabase/common/data-studio/selectors.ts b/frontend/src/metabase/common/data-studio/selectors.tsindex e185e1f5df0..c7ea4ab6b38 100644--- a/frontend/src/metabase/common/data-studio/selectors.ts+++ b/frontend/src/metabase/common/data-studio/selectors.ts@@ -3,7 +3,6 @@ import { PLUGIN_REMOTE_SYNC } from "metabase/plugins";import type { State } from "metabase/redux/store";import { isWithinIframe } from "metabase/utils/iframe";-// Must be in sync with CanAccessDataStudio in frontend/src/metabase/data-studio/route-guards.tsxexport function canAccessDataStudio(state: State) {if (isWithinIframe()) {return false;diff --git a/frontend/src/metabase/common/embedding-hub/selectors.ts b/frontend/src/metabase/common/embedding-hub/selectors.tsnew file mode 100644index 00000000000..eefe686a214--- /dev/null+++ b/frontend/src/metabase/common/embedding-hub/selectors.ts@@ -0,0 +1,10 @@+import { getUserIsAdmin } from "metabase/current-user";+import type { State } from "metabase/redux/store";+import { isWithinIframe } from "metabase/utils/iframe";++export function canAccessEmbeddingHub(state: State) {+ if (isWithinIframe()) {+ return false;+ }+ return getUserIsAdmin(state);+}diff --git a/frontend/src/metabase/common/embedding-hub/selectors.unit.spec.ts b/frontend/src/metabase/common/embedding-hub/selectors.unit.spec.tsnew file mode 100644index 00000000000..28c832ef16c--- /dev/null+++ b/frontend/src/metabase/common/embedding-hub/selectors.unit.spec.ts@@ -0,0 +1,42 @@+import { createMockState } from "__support__/state";+import { createMockUser } from "metabase-types/api/mocks";++import { canAccessEmbeddingHub } from "./selectors";++jest.mock("metabase/utils/iframe", () => ({+ isWithinIframe: jest.fn(() => false),+}));++const { isWithinIframe } = jest.requireMock("metabase/utils/iframe");++describe("canAccessEmbeddingHub", () => {+ beforeEach(() => {+ jest.clearAllMocks();+ isWithinIframe.mockReturnValue(false);+ });++ it("returns false when in embedding iframe", () => {+ isWithinIframe.mockReturnValue(true);+ const state = createMockState({+ currentUser: createMockUser({ is_superuser: true }),+ });++ expect(canAccessEmbeddingHub(state)).toBe(false);+ });++ it("returns true when user is admin", () => {+ const state = createMockState({+ currentUser: createMockUser({ is_superuser: true }),+ });++ expect(canAccessEmbeddingHub(state)).toBe(true);+ });++ it("returns false when user is not an admin", () => {+ const state = createMockState({+ currentUser: createMockUser({ is_superuser: false }),+ });++ expect(canAccessEmbeddingHub(state)).toBe(false);+ });+});diff --git a/frontend/src/metabase/common/tenants/base-path.ts b/frontend/src/metabase/common/tenants/base-path.tsnew file mode 100644index 00000000000..7bba906ca58--- /dev/null+++ b/frontend/src/metabase/common/tenants/base-path.ts@@ -0,0 +1,21 @@+/**+ * Where the tenant route fragment is currently mounted. The embedding hub+ * mounts the same fragment under its Tenancy tab, so whichever host renders it+ * declares its base path here.+ */++const ADMIN_TENANTS_BASE_PATH = "/admin/people/tenants";++let basePath = ADMIN_TENANTS_BASE_PATH;++export function setTenantsBasePath(nextBasePath: string) {+ basePath = nextBasePath;+}++export function getTenantsBasePath() {+ return basePath;+}++export function resetTenantsBasePath() {+ basePath = ADMIN_TENANTS_BASE_PATH;+}diff --git a/frontend/src/metabase/common/tenants/index.ts b/frontend/src/metabase/common/tenants/index.tsnew file mode 100644index 00000000000..6557b55f5a8--- /dev/null+++ b/frontend/src/metabase/common/tenants/index.ts@@ -0,0 +1,2 @@+export * from "./base-path";+export * from "./is-embedding-hub";diff --git a/frontend/src/metabase/common/tenants/is-embedding-hub.ts b/frontend/src/metabase/common/tenants/is-embedding-hub.tsnew file mode 100644index 00000000000..6c315ecc750--- /dev/null+++ b/frontend/src/metabase/common/tenants/is-embedding-hub.ts@@ -0,0 +1,12 @@+import * as Urls from "metabase/urls";++import { getTenantsBasePath } from "./base-path";++/**+ * Used to drop the headings the hub's Tenancy tab already supplies, based on where the+ * tenant routes are mounted. The permissions editor has the same check against its own+ * base path in admin/permissions/utils/is-embedding-hub.ts.+ */+export function isEmbeddingHubTenancy() {+ return getTenantsBasePath() === Urls.embeddingHubTenancy();+}diff --git a/frontend/src/metabase/dashboard/components/DashboardHeader/DashboardHeaderButtonRow/DashboardSharingMenu/tests/setup.tsx b/frontend/src/metabase/dashboard/components/DashboardHeader/DashboardHeaderButtonRow/DashboardSharingMenu/tests/setup.tsxindex d88f53c1def..7a07cda8029 100644--- a/frontend/src/metabase/dashboard/components/DashboardHeader/DashboardHeaderButtonRow/DashboardSharingMenu/tests/setup.tsx+++ b/frontend/src/metabase/dashboard/components/DashboardHeader/DashboardHeaderButtonRow/DashboardSharingMenu/tests/setup.tsx@@ -64,7 +64,7 @@ const setupState = ({const settingValues = createMockSettings({"token-features": tokenFeatures,"enable-public-sharing": isPublicSharingEnabled,- "enable-embedding-static": isEmbeddingEnabled,+ "enable-embedding-modular": isEmbeddingEnabled,"email-configured?": isEmailSetup,"slack-token-valid?": isSlackSetup,});diff --git a/frontend/src/metabase/data-studio/route-guards.tsx b/frontend/src/metabase/data-studio/route-guards.tsxindex 21dd56876ca..fd247013bdf 100644--- a/frontend/src/metabase/data-studio/route-guards.tsx+++ b/frontend/src/metabase/data-studio/route-guards.tsx@@ -1,7 +1,6 @@import { canAccessDataStudio } from "metabase/common/data-studio/selectors";import { canAccessDataModel } from "metabase/current-user";import {- AvailableInEmbedding,MetabaseIsSetup,UserIsAuthenticated,createRedirectGuard,@@ -18,14 +17,11 @@ const UserCanAccessDataModel = createRedirectGuard("/unauthorized",);-// Must be in sync with canAccessDataStudio in frontend/src/metabase/data-studio/selectors.tsexport const CanAccessDataStudio = () => (<MetabaseIsSetup><UserIsAuthenticated><UserCanAccessDataStudio>- <AvailableInEmbedding>- <Outlet />- </AvailableInEmbedding>+ <Outlet /></UserCanAccessDataStudio></UserIsAuthenticated></MetabaseIsSetup>diff --git a/frontend/src/metabase/embedding-hub/components/EmbeddingHubLayout/EmbeddingHubContent.tsx b/frontend/src/metabase/embedding-hub/components/EmbeddingHubLayout/EmbeddingHubContent.tsxnew file mode 100644index 00000000000..c690acae2b5--- /dev/null+++ b/frontend/src/metabase/embedding-hub/components/EmbeddingHubLayout/EmbeddingHubContent.tsx@@ -0,0 +1,56 @@+import type { ReactNode } from "react";++import { AppSwitcher } from "metabase/nav/components/AppSwitcher";+import {+ AreaContent,+ CONTENT_PADDING_X,+} from "metabase/nav/components/AreaLayout";+import { Box } from "metabase/ui";++const CONTENT_MAX_WIDTH = "50rem";++type EmbeddingHubContentProps = {+ children?: ReactNode;+ /** The permissions editor is full-width, per the design -- every other hub page caps at 800px. */+ fullWidth?: boolean;+};++export function EmbeddingHubContent({+ children,+ fullWidth = false,+}: EmbeddingHubContentProps) {+ return (+ <Box+ data-testid="embedding-hub-main"+ h="100%"+ bg="background_page-secondary"+ pos="relative"+ style={{ overflow: "hidden" }}+ >+ <Box+ pos="absolute"+ top="1.5rem"+ right={CONTENT_PADDING_X}+ bg="background_page-secondary"+ bdrs="50%"+ style={{ zIndex: 10 }}+ >+ <AppSwitcher />+ </Box>+ <AreaContent fullWidth={fullWidth}>+ {fullWidth ? (+ children+ ) : (+ <Box+ maw={CONTENT_MAX_WIDTH}+ mx="auto"+ w="100%"+ data-testid="embedding-hub-content-cap"+ >+ {children}+ </Box>+ )}+ </AreaContent>+ </Box>+ );+}diff --git a/frontend/src/metabase/embedding-hub/components/EmbeddingHubLayout/EmbeddingHubLayout.tsx b/frontend/src/metabase/embedding-hub/components/EmbeddingHubLayout/EmbeddingHubLayout.tsxnew file mode 100644index 00000000000..7756f0c10e0--- /dev/null+++ b/frontend/src/metabase/embedding-hub/components/EmbeddingHubLayout/EmbeddingHubLayout.tsx@@ -0,0 +1,180 @@+import { t } from "ttag";++import { useHasTokenFeature } from "metabase/common/hooks";+import { useUserKeyValue } from "metabase/current-user";+import { useEnsureDefaultEmbeddingThemes } from "metabase/embedding/themes/hooks";+import {+ AreaLayout,+ AreaNavButton,+ AreaTab,+} from "metabase/nav/components/AreaLayout";+import { useDispatch } from "metabase/redux";+import { setOpenModalWithProps } from "metabase/redux/ui";+import { Outlet, useLocation } from "metabase/router";+import { FixedSizeIcon, Flex, Stack } from "metabase/ui";+import * as Urls from "metabase/urls";+import type { IconName } from "metabase-types/api";++import { EmbeddingHubContent } from "./EmbeddingHubContent";++type EmbeddingHubTab = {+ label: string;+ icon: IconName;+ to: string;+ isGated?: boolean;+ /** The design caps most hub pages at 800px; only a few need the whole+ * area. See `EmbeddingHubContent`. A gated tab is also full width: its+ * upsell page owns the whole tab, header included, same as Permissions. */+ fullWidth?: boolean;+};++export function EmbeddingHubLayout() {+ const {+ value: navbarOpenedValue,+ setValue: setIsNavbarOpened,+ isLoading: isLoadingNavbarKey,+ } = useUserKeyValue({+ namespace: "embedding_hub",+ key: "isNavbarOpened",+ });+ const isNavbarOpened = navbarOpenedValue !== false;++ const { pathname } = useLocation();+ const hasSsoJwt = useHasTokenFeature("sso_jwt");+ const hasSimpleEmbedding = useHasTokenFeature("embedding_simple");+ const hasTenants = useHasTokenFeature("tenants");+ const hasContentTranslation = useHasTokenFeature("content_translation");++ useEnsureDefaultEmbeddingThemes();++ // Order comes from the design.+ const tabs: EmbeddingHubTab[] = [+ { label: t`Get started`, icon: "list", to: Urls.embeddingHubGetStarted() },+ {+ label: t`Security`,+ icon: "shield_outline",+ to: Urls.embeddingHubSecurity(),+ },+ {+ label: t`Authentication`,+ icon: "lock",+ to: Urls.embeddingHubAuthentication(),+ isGated: !hasSsoJwt,+ },+ {+ label: t`Permissions`,+ icon: "eye",+ to: Urls.embeddingHubPermissions(),+ fullWidth: true,+ },+ {+ label: t`Tenancy`,+ icon: "group",+ to: Urls.embeddingHubTenancy(),+ isGated: !hasTenants,+ },+ {+ label: t`Appearance`,+ icon: "palette",+ to: Urls.embeddingHubAppearance(),+ isGated: !hasSimpleEmbedding,+ },+ {+ label: t`Localization`,+ icon: "globe",+ to: Urls.embeddingHubLocalization(),+ isGated: !hasContentTranslation,+ },+ ];++ const currentTab = tabs.find((tab) => isTabSelected(tab, pathname));+ // The theme editor takes over the window -- no nav, no app switcher -- so its+ // side-by-side editor and preview panels get the whole screen.+ const isThemeEditor = pathname.startsWith(+ `${Urls.embeddingHubAppearance()}/theme/`,+ );++ if (isThemeEditor) {+ return <Outlet />;+ }++ const upperNav = (+ <Stack component="nav" gap="0.75rem" aria-label={t`Embedding hub`}>+ {tabs.map((tab) => (+ <AreaTab+ key={tab.to}+ label={tab.label}+ icon={tab.icon}+ to={tab.to}+ isSelected={isTabSelected(tab, pathname)}+ isGated={tab.isGated}+ showLabel={isNavbarOpened}+ />+ ))}+ </Stack>+ );++ return (+ <AreaLayout+ logo={+ <Flex+ bdrs="50%"+ bg="background_surface-brand-subtle"+ w="2rem"+ h="2rem"+ align="center"+ justify="center"+ >+ <FixedSizeIcon name="embed" size={14} c="brand" />+ </Flex>+ }+ title={t`Embedding hub`}+ testId="embedding-hub-nav"+ isLoading={isLoadingNavbarKey}+ isNavbarOpened={isNavbarOpened}+ onNavbarToggle={setIsNavbarOpened}+ upperNav={upperNav}+ lowerNav={<NewEmbedNavButton showLabel={isNavbarOpened} />}+ >+ <EmbeddingHubContent+ fullWidth={+ (currentTab?.fullWidth ?? false) || (currentTab?.isGated ?? false)+ }+ >+ <Outlet />+ </EmbeddingHubContent>+ </AreaLayout>+ );+}++function isTabSelected(tab: EmbeddingHubTab, pathname: string) {+ return isUnder(pathname, tab.to);+}++// Matches a whole path segment, never a string prefix, so a tab claims its own+// sub-routes without claiming a sibling whose path merely starts the same way.+export function isUnder(pathname: string, base: string) {+ return pathname === base || pathname.startsWith(`${base}/`);+}++/**+ * Pinned to the bottom of the nav, per the design. It dispatches into the same+ * `id: "embed"` modal the admin button uses, which is why the embedding hub's routes+ * mount inside AppComponent -- NewModals lives there.+ */+function NewEmbedNavButton({ showLabel }: { showLabel: boolean }) {+ const dispatch = useDispatch();++ return (+ <AreaNavButton+ label={t`New embed`}+ icon="add"+ showLabel={showLabel}+ onClick={() =>+ dispatch(+ setOpenModalWithProps({ id: "embed", props: { initialState: {} } }),+ )+ }+ />+ );+}diff --git a/frontend/src/metabase/embedding-hub/components/EmbeddingHubLayout/EmbeddingHubLayout.unit.spec.tsx b/frontend/src/metabase/embedding-hub/components/EmbeddingHubLayout/EmbeddingHubLayout.unit.spec.tsxnew file mode 100644index 00000000000..ff7c3ace0a9--- /dev/null+++ b/frontend/src/metabase/embedding-hub/components/EmbeddingHubLayout/EmbeddingHubLayout.unit.spec.tsx@@ -0,0 +1,170 @@+import {+ setupPropertiesEndpoints,+ setupSettingsEndpoints,+ setupUserKeyValueEndpoints,+} from "__support__/server-mocks";+import { mockSettings } from "__support__/settings";+import { createMockState } from "__support__/state";+import { renderWithProviders, screen, within } from "__support__/ui";+import { Route } from "metabase/router";+import {+ createMockSettings,+ createMockTokenFeatures,+ createMockUser,+} from "metabase-types/api/mocks";++import { EmbeddingHubLayout } from "./EmbeddingHubLayout";++jest.mock("metabase/embedding/themes/hooks", () => ({+ useEnsureDefaultEmbeddingThemes: jest.fn(),+}));++jest.mock("metabase/nav/components/AppSwitcher", () => ({+ AppSwitcher: () => null,+}));++const TAB_LABELS = [+ "Get started",+ "Security",+ "Authentication",+ "Permissions",+ "Tenancy",+ "Appearance",+ "Localization",+];++type SetupOptions = {+ initialRoute?: string;+ isNavbarOpened?: boolean;+};++function setup({+ initialRoute = "/embedding/get-started",+ isNavbarOpened = true,+}: SetupOptions = {}) {+ const tokenFeatures = createMockTokenFeatures();++ setupSettingsEndpoints([]);+ setupPropertiesEndpoints(+ createMockSettings({ "token-features": tokenFeatures }),+ );+ setupUserKeyValueEndpoints({+ namespace: "embedding_hub",+ key: "isNavbarOpened",+ value: isNavbarOpened,+ });++ return renderWithProviders(+ <Route path="/embedding" element={<EmbeddingHubLayout />}>+ <Route path="get-started">+ <Route index element={<div>{"Get started body"}</div>} />+ <Route+ path="permissions"+ element={<div>{"Permissions wizard body"}</div>}+ />+ </Route>+ <Route path="security" element={<div>{"Security body"}</div>} />+ </Route>,+ {+ withRouter: true,+ initialRoute,+ storeInitialState: createMockState({+ currentUser: createMockUser({ is_superuser: true }),+ settings: mockSettings({ "token-features": tokenFeatures }),+ }),+ },+ );+}++function findNav() {+ return screen.findByRole("navigation", { name: "Embedding hub" });+}++describe("EmbeddingHubLayout", () => {+ it("renders every tab, in design order, each linking to its own path", async () => {+ setup();++ const nav = await findNav();+ const links = within(nav).getAllByRole("link");++ expect(links.map((link) => link.getAttribute("aria-label"))).toEqual(+ TAB_LABELS,+ );+ expect(+ await within(nav).findByRole("link", { name: "Get started" }),+ ).toHaveAttribute("href", "/embedding/get-started");+ });++ it("shows a gem on the paid tabs, none on Permissions", async () => {+ setup();++ const nav = await findNav();++ for (const label of [+ "Authentication",+ "Tenancy",+ "Appearance",+ "Localization",+ ]) {+ expect(+ within(+ await within(nav).findByRole("link", { name: label }),+ ).getByTestId("upsell-gem"),+ ).toBeInTheDocument();+ }++ expect(+ within(+ await within(nav).findByRole("link", { name: "Permissions" }),+ ).queryByTestId("upsell-gem"),+ ).not.toBeInTheDocument();+ });++ it("keeps Get started current on the setup wizard sub-pages", async () => {+ setup({ initialRoute: "/embedding/get-started/permissions" });++ const nav = await findNav();++ // The wizard belongs to Get started, so the nav must not go blank there.+ expect(+ await within(nav).findByRole("link", { name: "Get started" }),+ ).toHaveAttribute("aria-current", "page");+ });++ it("does not light up Permissions on the permissions wizard", async () => {+ setup({ initialRoute: "/embedding/get-started/permissions" });++ const nav = await findNav();++ // The wizard belongs to Get started, so Permissions must not claim it.+ expect(+ await within(nav).findByRole("link", { name: "Permissions" }),+ ).not.toHaveAttribute("aria-current");+ });++ it("keeps the width cap on the permissions wizard", async () => {+ setup({ initialRoute: "/embedding/get-started/permissions" });++ await screen.findByText("Permissions wizard body");++ expect(screen.getByTestId("embedding-hub-content-cap")).toBeInTheDocument();+ });++ describe("New embed button", () => {+ it("shows its label while the navbar is open", async () => {+ setup({ isNavbarOpened: true });++ expect(+ await screen.findByRole("button", { name: "New embed" }),+ ).toHaveTextContent("New embed");+ });++ it("collapses to the icon alone once the navbar is closed", async () => {+ setup({ isNavbarOpened: false });++ const button = await screen.findByRole("button", { name: "New embed" });++ expect(button).toHaveTextContent("");+ });+ });+});diff --git a/frontend/src/metabase/embedding-hub/components/EmbeddingHubLayout/index.ts b/frontend/src/metabase/embedding-hub/components/EmbeddingHubLayout/index.tsnew file mode 100644index 00000000000..dd9ab6afc80--- /dev/null+++ b/frontend/src/metabase/embedding-hub/components/EmbeddingHubLayout/index.ts@@ -0,0 +1 @@+export * from "./EmbeddingHubLayout";diff --git a/frontend/src/metabase/embedding-hub/components/EmbeddingHubPermissionsBasePath.tsx b/frontend/src/metabase/embedding-hub/components/EmbeddingHubPermissionsBasePath.tsxnew file mode 100644index 00000000000..a3ecf118eff--- /dev/null+++ b/frontend/src/metabase/embedding-hub/components/EmbeddingHubPermissionsBasePath.tsx@@ -0,0 +1,29 @@+import { usePermissionsBasePath } from "metabase/common/components/PermissionsBasePath/base-path";+import { Outlet } from "metabase/router";+import * as Urls from "metabase/urls";++/**+ * Declares the embedding hub as the permissions editor's host, so the URL+ * builders in `utils/urls` — which redux selectors and thunks also call — build+ * links back into the hub rather than always into admin. Admin needs no+ * equivalent wrapper: its base path is already `getPermissionsBasePath`'s+ * resting default. `is-embedding-hub.ts`'s color switch reads this same base+ * path, so setting it here is the only thing this component needs to do.+ *+ * The assignment happens during render rather than in an effect: children+ * render before any effect runs, and their first render already builds URLs.+ *+ * Unmounting resets it, which covers leaving the editor for somewhere that is+ * not admin permissions — `ConversationHeader` links a group to the+ * permissions editor from Monitor, and would otherwise send the user into the+ * hub.+ *+ * The Tenancy tab claims the same path for its own tenant-scoped permissions+ * routes, so `usePermissionsBasePath` tracks which host claimed last and only+ * lets that one reset.+ */+export function EmbeddingHubPermissionsBasePath() {+ usePermissionsBasePath(Urls.embeddingHubPermissions());++ return <Outlet />;+}diff --git a/frontend/src/metabase/embedding-hub/components/EmbeddingHubUpsellBanner.tsx b/frontend/src/metabase/embedding-hub/components/EmbeddingHubUpsellBanner.tsxnew file mode 100644index 00000000000..d04f2e63d46--- /dev/null+++ b/frontend/src/metabase/embedding-hub/components/EmbeddingHubUpsellBanner.tsx@@ -0,0 +1,41 @@+import { t } from "ttag";++import { UpsellBanner } from "metabase/common/components/upsells/components";+import { PLUGIN_ADMIN_SETTINGS } from "metabase/plugins";+import { useSelector } from "metabase/redux";+import { getUpgradeUrl } from "metabase/selectors/settings";++type Props = {+ title: string;+ campaign: string;+ location: string;+};++// Render this only when the upsell is actually shown: useUpsellFlow sets+// window.name in a useEffect, which renames the Cypress AUT frame and breaks+// cy.press on any page that mounts it (same reason as EmbeddingUpsell.tsx).+export function EmbeddingHubUpsellBanner({ title, campaign, location }: Props) {+ const upgradeUrl = useSelector((state) =>+ getUpgradeUrl(state, {+ utm_campaign: campaign,+ utm_content: location,+ }),+ );++ const { triggerUpsellFlow } = PLUGIN_ADMIN_SETTINGS.useUpsellFlow({+ campaign,+ location,+ });++ return (+ <UpsellBanner+ title={title}+ campaign={campaign}+ location={location}+ buttonText={t`Try Metabase Pro`}+ buttonLink={upgradeUrl}+ onClick={triggerUpsellFlow}+ large+ />+ );+}diff --git a/frontend/src/metabase/embedding-hub/pages/EmbeddingHubAppearancePage.tsx b/frontend/src/metabase/embedding-hub/pages/EmbeddingHubAppearancePage.tsxnew file mode 100644index 00000000000..b12dcb53ab2--- /dev/null+++ b/frontend/src/metabase/embedding-hub/pages/EmbeddingHubAppearancePage.tsx@@ -0,0 +1,63 @@+import { t } from "ttag";++import { Link } from "metabase/common/components/Link";+import { useHasTokenFeature } from "metabase/common/hooks";+import { EmbeddingThemeListingApp } from "metabase/embedding/themes/components/ThemeListing";+import { AppearanceUpsellPage } from "metabase/embedding-hub/upsells";+import { PLUGIN_WHITELABEL } from "metabase/plugins";+import { useSetting } from "metabase/settings";+import { SettingsPageWrapper } from "metabase/settings-components";+import { Card, Icon, Stack, Text, Title } from "metabase/ui";+import * as Urls from "metabase/urls";++/**+ * Combines the embedding theme editor and the branding settings into one tab.+ * Both are gated on `hasSimpleEmbedding`, even though the branding settings+ * alone gate on `whitelabel`, since the two features ship together.+ */+export function EmbeddingHubAppearancePage() {+ const hasSimpleEmbedding = useHasTokenFeature("embedding_simple");+ const isFullAppEmbeddingEnabled = useSetting("enable-embedding-interactive");++ if (!hasSimpleEmbedding) {+ return <AppearanceUpsellPage />;+ }++ return (+ <SettingsPageWrapper title={t`Appearance`}>+ <Stack gap="lg">+ <Title order={4}>{t`Themes`}</Title>++ <EmbeddingThemeListingApp+ basePath={`${Urls.embeddingHubAppearance()}/theme`}+ />+ </Stack>++ <Stack gap="lg">+ <Title order={4}>{t`Branding elements`}</Title>++ <PLUGIN_WHITELABEL.EmbeddedAppearanceSettings />+ </Stack>++ {/* Per the design's annotation: only when full-app embedding is on. */}+ {isFullAppEmbeddingEnabled && <FullAppAppearanceBanner />}+ </SettingsPageWrapper>+ );+}++function FullAppAppearanceBanner() {+ return (+ <Card p="lg" bg="background-brand">+ {/* One flowing sentence, not a Group of rigid parts -- the link needs+ to wrap inline with the text on narrow screens rather than being+ pushed onto its own line. */}+ <Text c="text-secondary">+ {t`Colors and branding for full-app embedding are based on the appearance settings defined in the`}{" "}+ <Link to="/admin/settings/whitelabel">+ <Text component="span" c="brand" fw="bold">{t`Admin`}</Text>{" "}+ <Icon name="external" size={12} c="brand" />+ </Link>+ </Text>+ </Card>+ );+}diff --git a/frontend/src/metabase/embedding-hub/pages/EmbeddingHubAppearancePage.unit.spec.tsx b/frontend/src/metabase/embedding-hub/pages/EmbeddingHubAppearancePage.unit.spec.tsxnew file mode 100644index 00000000000..dbe3166be2c--- /dev/null+++ b/frontend/src/metabase/embedding-hub/pages/EmbeddingHubAppearancePage.unit.spec.tsx@@ -0,0 +1,120 @@+import fetchMock from "fetch-mock";++import { setupEnterprisePlugins } from "__support__/enterprise";+import {+ setupPropertiesEndpoints,+ setupSettingsEndpoints,+ setupUpdateSettingEndpoint,+} from "__support__/server-mocks";+import { mockSettings } from "__support__/settings";+import { createMockState } from "__support__/state";+import { renderWithProviders, screen } from "__support__/ui";+import { Route } from "metabase/router";+import {+ createMockSettings,+ createMockTokenFeatures,+ createMockUser,+} from "metabase-types/api/mocks";++import { EmbeddingHubAppearancePage } from "./EmbeddingHubAppearancePage";++interface SetupOpts {+ hasSimpleEmbedding?: boolean;+ isFullAppEmbeddingEnabled?: boolean;+}++function setup({+ hasSimpleEmbedding = false,+ isFullAppEmbeddingEnabled = false,+}: SetupOpts = {}) {+ fetchMock.get("path:/api/embed-theme", []);++ const settings = createMockSettings({+ "token-features": createMockTokenFeatures({+ embedding_simple: hasSimpleEmbedding,+ // The two halves of the tab gate on different features but arrive+ // together in practice, so the licensed case licenses both.+ whitelabel: hasSimpleEmbedding,+ }),+ "enable-embedding-interactive": isFullAppEmbeddingEnabled,+ });++ setupPropertiesEndpoints(settings);+ setupSettingsEndpoints([]);+ setupUpdateSettingEndpoint();++ // Settings before plugins: PLUGIN_WHITELABEL.EmbeddedAppearanceSettings is+ // registered only when `hasPremiumFeature("whitelabel")` is true.+ const storeSettings = mockSettings(settings);+ setupEnterprisePlugins();++ renderWithProviders(+ <Route path="/" element={<EmbeddingHubAppearancePage />} />,+ {+ withRouter: true,+ initialRoute: "/",+ storeInitialState: createMockState({+ settings: storeSettings,+ currentUser: createMockUser({ is_superuser: true }),+ }),+ },+ );+}++describe("EmbeddingHubAppearancePage", () => {+ it("upsells and shows neither section below the paywall", async () => {+ setup({ hasSimpleEmbedding: false });++ expect(await screen.findByText("Create custom themes")).toBeInTheDocument();++ expect(+ screen.queryByRole("heading", { name: "Themes" }),+ ).not.toBeInTheDocument();+ expect(+ screen.queryByRole("heading", { name: "Branding elements" }),+ ).not.toBeInTheDocument();++ // Carried over from EmbeddingThemeListingApp.unit.spec.tsx, which+ // asserted this while the listing still gated itself. The page is where+ // the fetch is avoided now: it never mounts the listing.+ expect(fetchMock.callHistory.calls("path:/api/embed-theme")).toHaveLength(+ 0,+ );+ });++ it("shows both the theme listing and the branding settings when licensed", async () => {+ setup({ hasSimpleEmbedding: true });++ expect(+ await screen.findByRole("button", { name: /New theme/ }),+ ).toBeInTheDocument();+ expect(screen.getByRole("heading", { name: "Themes" })).toBeInTheDocument();++ // The EE slot's own content, not just its heading -- an unregistered slot+ // would leave the heading and render nothing under it.+ expect(+ screen.getByRole("heading", { name: "Branding elements" }),+ ).toBeInTheDocument();+ expect(await screen.findByText("Loading message")).toBeInTheDocument();++ expect(screen.queryByText("Create custom themes")).not.toBeInTheDocument();+ });++ it("hides the full-app banner when full-app embedding is off", async () => {+ setup({ hasSimpleEmbedding: true, isFullAppEmbeddingEnabled: false });++ await screen.findByRole("button", { name: /New theme/ });++ expect(screen.queryByText(/full-app embedding/)).not.toBeInTheDocument();+ });++ it("points the full-app banner at admin when full-app embedding is on", async () => {+ setup({ hasSimpleEmbedding: true, isFullAppEmbeddingEnabled: true });++ expect(await screen.findByText(/full-app embedding/)).toBeInTheDocument();+ expect(screen.getByRole("link", { name: /Admin/ })).toHaveAttribute(+ "href",+ "/admin/settings/whitelabel",+ );+ });+});diff --git a/frontend/src/metabase/embedding-hub/pages/EmbeddingHubAuthenticationPage.tsx b/frontend/src/metabase/embedding-hub/pages/EmbeddingHubAuthenticationPage.tsxnew file mode 100644index 00000000000..ce7004add4e--- /dev/null+++ b/frontend/src/metabase/embedding-hub/pages/EmbeddingHubAuthenticationPage.tsx@@ -0,0 +1,133 @@+import type { ComponentType } from "react";+import { Suspense, lazy } from "react";+import { t } from "ttag";++import { Link } from "metabase/common/components/Link";+import { LoadingAndErrorWrapper } from "metabase/common/components/LoadingAndErrorWrapper";+import { useHasTokenFeature } from "metabase/common/hooks";+import type { SettingsJWTFormProps } from "metabase/plugins";+import { PLUGIN_AUTH_PROVIDERS } from "metabase/plugins";+import { useGetAdminSettingsDetailsQuery, useSetting } from "metabase/settings";+import { SettingsPageWrapper } from "metabase/settings-components";+import { Card, Group, Icon, Stack, Text, Title } from "metabase/ui";++import { AuthenticationUpsellPage } from "../upsells";++const ADMIN_AUTHENTICATION_URL = "/admin/settings/authentication";++// Loaded through the same route slot settingsRoutes.tsx uses, so the hub+// shares the auth-jwt chunk instead of pulling the form back out of it.+const SettingsJWTForm = lazy(() =>+ PLUGIN_AUTH_PROVIDERS.settingsJWTForm().then(({ Component }) => ({+ // PluginRoute's Component is untyped -- the loaded module always accepts+ // SettingsJWTFormProps, since it's SettingsJWTForm itself.+ default: Component as ComponentType<SettingsJWTFormProps>,+ })),+);++/**+ * A JWT-only view of the authentication settings. The admin authentication+ * page does not change -- this is a second view onto the same settings.+ *+ * Only JWT and SAML count as configured SSO here, because embedding supports+ * only those two.+ */+export function EmbeddingHubAuthenticationPage() {+ const hasSsoJwt = useHasTokenFeature("sso_jwt");++ // Same endpoint and args as the JWT form, so this is a second subscriber to+ // one cache entry, not a second request. Gating here keeps the page from+ // painting beside the form's spinner.+ const { isLoading } = useGetAdminSettingsDetailsQuery();++ // `jwt-configured` is optional in metabase-types/api/settings.ts, unlike its+ // SAML peer.+ const isJwtConfigured = useSetting("jwt-configured");+ const isSamlConfigured = useSetting("saml-configured");++ if (!hasSsoJwt) {+ return <AuthenticationUpsellPage />;+ }++ if (isLoading) {+ return <LoadingAndErrorWrapper loading />;+ }++ return (+ <SettingsPageWrapper title={t`Authentication`}>+ <AuthenticationSection+ isJwtConfigured={isJwtConfigured}+ isSamlConfigured={isSamlConfigured}+ />+ </SettingsPageWrapper>+ );+}++function AuthenticationSection({+ isJwtConfigured,+ isSamlConfigured,+}: {+ isJwtConfigured: boolean | undefined;+ isSamlConfigured: boolean;+}) {+ // No banner on the SAML card: its own Go to Admin points at the same page,+ // and two links to one place read as two different destinations.+ if (!isJwtConfigured && isSamlConfigured) {+ return <SamlConfiguredCard />;+ }++ return (+ <>+ <Suspense fallback={<LoadingAndErrorWrapper loading />}>+ <SettingsJWTForm title={null} />+ </Suspense>+ <OtherAuthMethodsBanner />+ </>+ );+}++/**+ * JWT wins whenever it is configured, so this is only ever the SAML-only+ * instance: SSO already works, and everything it needs lives in admin.+ */+function SamlConfiguredCard() {+ return (+ <Card p="xxl" withBorder>+ <Stack gap="lg">+ <Title order={2}>{t`SAML is configured`}</Title>++ <Text c="text-secondary">+ {t`You can review all authentication settings in the Admin.`}+ </Text>++ <Group justify="flex-end">+ <Link to={ADMIN_AUTHENTICATION_URL}>+ <Group gap={4} wrap="nowrap">+ <Text c="brand" fw="bold">{t`Go to Admin`}</Text>+ <Icon name="external" size={12} c="brand" />+ </Group>+ </Link>+ </Group>+ </Stack>+ </Card>+ );+}++function OtherAuthMethodsBanner() {+ return (+ <Card p="lg" withBorder bg="background-brand">+ <Group gap="xxs">+ <Text c="text-secondary">+ {t`View more authentication options, such as SAML, in the`}+ </Text>++ <Link to={ADMIN_AUTHENTICATION_URL}>+ <Group gap={4} wrap="nowrap">+ <Text c="brand" fw="bold">{t`Admin settings`}</Text>+ <Icon name="external" size={12} c="brand" />+ </Group>+ </Link>+ </Group>+ </Card>+ );+}diff --git a/frontend/src/metabase/embedding-hub/pages/EmbeddingHubAuthenticationPage.unit.spec.tsx b/frontend/src/metabase/embedding-hub/pages/EmbeddingHubAuthenticationPage.unit.spec.tsxnew file mode 100644index 00000000000..9fa796e747c--- /dev/null+++ b/frontend/src/metabase/embedding-hub/pages/EmbeddingHubAuthenticationPage.unit.spec.tsx@@ -0,0 +1,133 @@+import { setupEnterprisePlugins } from "__support__/enterprise";+import {+ setupGroupsEndpoint,+ setupPropertiesEndpoints,+ setupSettingsEndpoints,+ setupUpdateSettingEndpoint,+} from "__support__/server-mocks";+import { mockSettings } from "__support__/settings";+import { createMockState } from "__support__/state";+import { renderWithProviders, screen } from "__support__/ui";+import { Route } from "metabase/router";+import {+ createMockGroup,+ createMockSettings,+ createMockTokenFeatures,+ createMockUser,+} from "metabase-types/api/mocks";++import { EmbeddingHubAuthenticationPage } from "./EmbeddingHubAuthenticationPage";++interface SetupOpts {+ hasSsoJwt?: boolean;+ isJwtConfigured?: boolean;+ isSamlConfigured?: boolean;+}++function setup({+ hasSsoJwt = false,+ isJwtConfigured = false,+ isSamlConfigured = false,+}: SetupOpts = {}) {+ const settings = createMockSettings({+ "token-features": createMockTokenFeatures({ sso_jwt: hasSsoJwt }),+ "jwt-configured": isJwtConfigured,+ "saml-configured": isSamlConfigured,+ });++ setupPropertiesEndpoints(settings);+ setupSettingsEndpoints([]);+ setupUpdateSettingEndpoint();+ setupGroupsEndpoint([createMockGroup()]);++ // Settings before plugins: PLUGIN_AUTH_PROVIDERS.settingsJWTForm is only+ // registered when `hasPremiumFeature("sso_jwt")` is true, and that reads the+ // mocked settings.+ const storeSettings = mockSettings(settings);+ setupEnterprisePlugins();++ renderWithProviders(+ <Route path="/" element={<EmbeddingHubAuthenticationPage />} />,+ {+ withRouter: true,+ initialRoute: "/",+ storeInitialState: createMockState({+ settings: storeSettings,+ currentUser: createMockUser({ is_superuser: true }),+ }),+ },+ );+}++describe("EmbeddingHubAuthenticationPage", () => {+ it("upsells instead of showing the JWT form when SSO is not licensed", async () => {+ setup({ hasSsoJwt: false });++ expect(+ await screen.findByText("Secure your embeds with single sign-on"),+ ).toBeInTheDocument();++ // The claim that matters: nothing configurable renders below the paywall.+ expect(+ screen.queryByText("JWT Identity Provider URI"),+ ).not.toBeInTheDocument();+ });++ it("mounts the admin JWT form when JWT is configured", async () => {+ setup({ hasSsoJwt: true, isJwtConfigured: true });++ expect(+ await screen.findByText("JWT Identity Provider URI"),+ ).toBeInTheDocument();+ expect(+ screen.queryByText("Secure your embeds with single sign-on"),+ ).not.toBeInTheDocument();+ });++ it("shows the JWT form when nothing is configured yet", async () => {+ // The stepped setup flow lives in the setup guide, not here.+ setup({ hasSsoJwt: true });++ expect(+ await screen.findByText("JWT Identity Provider URI"),+ ).toBeInTheDocument();+ });++ it("sends the admin to admin settings when only SAML is configured", async () => {+ setup({ hasSsoJwt: true, isSamlConfigured: true });++ expect(await screen.findByText("SAML is configured")).toBeInTheDocument();++ expect(screen.getByRole("link", { name: /Go to Admin/ })).toHaveAttribute(+ "href",+ "/admin/settings/authentication",+ );+ expect(+ screen.queryByText("JWT Identity Provider URI"),+ ).not.toBeInTheDocument();++ // The card's own link goes to the same page the banner would.+ expect(+ screen.queryByRole("link", { name: /Admin settings/ }),+ ).not.toBeInTheDocument();+ });++ it("prefers the JWT form when JWT and SAML are both configured", async () => {+ setup({ hasSsoJwt: true, isJwtConfigured: true, isSamlConfigured: true });++ expect(+ await screen.findByText("JWT Identity Provider URI"),+ ).toBeInTheDocument();+ expect(screen.queryByText("SAML is configured")).not.toBeInTheDocument();+ });++ it("points at admin for the other auth methods", async () => {+ setup({ hasSsoJwt: true, isJwtConfigured: true });++ await screen.findByText("JWT Identity Provider URI");++ expect(+ screen.getByRole("link", { name: /Admin settings/ }),+ ).toHaveAttribute("href", "/admin/settings/authentication");+ });+});diff --git a/frontend/src/metabase/embedding-hub/pages/EmbeddingHubLocalizationPage.tsx b/frontend/src/metabase/embedding-hub/pages/EmbeddingHubLocalizationPage.tsxnew file mode 100644index 00000000000..ed15fc4aabc--- /dev/null+++ b/frontend/src/metabase/embedding-hub/pages/EmbeddingHubLocalizationPage.tsx@@ -0,0 +1,27 @@+import { t } from "ttag";++import { useHasTokenFeature } from "metabase/common/hooks";+import { PLUGIN_CONTENT_TRANSLATION } from "metabase/content-translation/plugins";+import { LocalizationUpsellPage } from "metabase/embedding-hub/upsells";+import { SettingsPageWrapper } from "metabase/settings-components";++/**+ * Content translation only. Other tabs link out to admin for anything+ * outside their own scope. This one reuses the exact settings component+ * the admin embedding section renders instead, because content translation+ * has no standalone admin page to link to. That admin usage goes away+ * separately, when EMB-1526 drops the admin embedding route.+ */+export function EmbeddingHubLocalizationPage() {+ const hasContentTranslation = useHasTokenFeature("content_translation");++ if (!hasContentTranslation) {+ return <LocalizationUpsellPage />;+ }++ return (+ <SettingsPageWrapper title={t`Localization`}>+ <PLUGIN_CONTENT_TRANSLATION.ContentTranslationConfiguration />+ </SettingsPageWrapper>+ );+}diff --git a/frontend/src/metabase/embedding-hub/pages/EmbeddingHubLocalizationPage.unit.spec.tsx b/frontend/src/metabase/embedding-hub/pages/EmbeddingHubLocalizationPage.unit.spec.tsxnew file mode 100644index 00000000000..5bd914a5755--- /dev/null+++ b/frontend/src/metabase/embedding-hub/pages/EmbeddingHubLocalizationPage.unit.spec.tsx@@ -0,0 +1,87 @@+import { setupEnterprisePlugins } from "__support__/enterprise";+import {+ setupPropertiesEndpoints,+ setupSettingsEndpoints,+} from "__support__/server-mocks";+import { mockSettings } from "__support__/settings";+import { createMockState } from "__support__/state";+import { renderWithProviders, screen } from "__support__/ui";+import { Route } from "metabase/router";+import {+ createMockSettings,+ createMockTokenFeatures,+ createMockUser,+} from "metabase-types/api/mocks";++import { EmbeddingHubLocalizationPage } from "./EmbeddingHubLocalizationPage";++interface SetupOpts {+ hasContentTranslation?: boolean;+}++function setup({ hasContentTranslation = false }: SetupOpts = {}) {+ const settings = createMockSettings({+ "token-features": createMockTokenFeatures({+ content_translation: hasContentTranslation,+ }),+ });++ setupPropertiesEndpoints(settings);+ setupSettingsEndpoints([]);++ // Settings before plugins: ContentTranslationConfiguration is registered+ // only when `hasPremiumFeature("content_translation")` is true.+ const storeSettings = mockSettings(settings);+ setupEnterprisePlugins();++ renderWithProviders(+ <Route path="/" element={<EmbeddingHubLocalizationPage />} />,+ {+ withRouter: true,+ initialRoute: "/",+ storeInitialState: createMockState({+ settings: storeSettings,+ currentUser: createMockUser({ is_superuser: true }),+ }),+ },+ );+}++describe("EmbeddingHubLocalizationPage", () => {+ it("upsells when content translation is not licensed", async () => {+ setup({ hasContentTranslation: false });++ expect(+ await screen.findByText("Translate your embedded content"),+ ).toBeInTheDocument();+ expect(+ await screen.findByText(+ "Upload a translation dictionary to translate content such as item titles, headings, filter labels, and data in your embedded components.",+ ),+ ).toBeInTheDocument();++ expect(+ screen.queryByText("Translate embedded dashboards and questions"),+ ).not.toBeInTheDocument();+ });++ it("mounts the dictionary configuration when licensed", async () => {+ setup({ hasContentTranslation: true });++ expect(+ await screen.findByText("Translate embedded dashboards and questions"),+ ).toBeInTheDocument();++ expect(+ screen.queryByText("Translate your embedded content"),+ ).not.toBeInTheDocument();+ });++ it("keeps the tab's own title on both editions", async () => {+ setup({ hasContentTranslation: false });++ expect(+ await screen.findByRole("heading", { name: "Localization" }),+ ).toBeInTheDocument();+ });+});diff --git a/frontend/src/metabase/embedding-hub/pages/EmbeddingHubPermissionsPage.tsx b/frontend/src/metabase/embedding-hub/pages/EmbeddingHubPermissionsPage.tsxnew file mode 100644index 00000000000..6804bd20ed5--- /dev/null+++ b/frontend/src/metabase/embedding-hub/pages/EmbeddingHubPermissionsPage.tsx@@ -0,0 +1,31 @@+import { t } from "ttag";++import { EmbeddingHubPermissionsBasePath } from "metabase/embedding-hub/components/EmbeddingHubPermissionsBasePath";+import { Box, Stack, Title } from "metabase/ui";++const TAB_LABEL_INSET = "2.5rem";++/**+ * The admin permissions editor, mounted a second time under the hub. Admin+ * permissions does not change.+ *+ * The tab set is whatever the admin editor already has — five when tenants are+ * on — rather than a narrowed copy, so there is no forked component to keep in+ * sync.+ */+export function EmbeddingHubPermissionsPage() {+ return (+ // White, like admin, not the hub's tinted background.+ <Stack gap="lg" h="100%" pt="1.5rem" bg="background_page-primary">+ {/* Full-width page, so it places its own padding here. */}+ <Box pl={TAB_LABEL_INSET}>+ <Title order={1} c="text-primary">{t`Permissions`}</Title>+ </Box>++ {/* The editor scrolls internally, so it needs a shrinkable flex child. */}+ <Box style={{ flex: 1, minHeight: 0 }}>+ <EmbeddingHubPermissionsBasePath />+ </Box>+ </Stack>+ );+}diff --git a/frontend/src/metabase/embedding-hub/pages/EmbeddingHubSecurityPage.tsx b/frontend/src/metabase/embedding-hub/pages/EmbeddingHubSecurityPage.tsxnew file mode 100644index 00000000000..53ac73ec9f9--- /dev/null+++ b/frontend/src/metabase/embedding-hub/pages/EmbeddingHubSecurityPage.tsx@@ -0,0 +1,101 @@+import { t } from "ttag";++import {+ useListEmbeddableCardsQuery,+ useListEmbeddableDashboardsQuery,+} from "metabase/api";+import { useHasTokenFeature } from "metabase/common/hooks";+import { EmbeddedResources } from "metabase/embedding/settings/EmbeddedResources";+import { EmbeddingMethodsCard } from "metabase/embedding/settings/EmbeddingMethodsCard";+import { EmbeddingSecretKeyWidget } from "metabase/embedding/settings/EmbeddingSecretKeyWidget";+import { CorsInputWidget } from "metabase/embedding/settings/EmbeddingSecuritySettings/CorsInputWidget";+import { SameSiteSelectWidget } from "metabase/embedding/settings/EmbeddingSecuritySettings/SameSiteSelectWidget";+import { EmbeddingHubUpsellBanner } from "metabase/embedding-hub/components/EmbeddingHubUpsellBanner";+import { PLUGIN_ADMIN_SETTINGS } from "metabase/plugins";+import { useSetting } from "metabase/settings";+import {+ SettingTitle,+ SettingsPageWrapper,+ SettingsSection,+} from "metabase/settings-components";+import { Box } from "metabase/ui";++const UPSELL_CAMPAIGN = "embedding-hub";+const UPSELL_LOCATION = "embedding-hub-security";++/**+ * Card order comes from the design: embedding methods, CORS, SameSite, secret+ * key, then the two conditional cards.+ *+ * The hub has no Guest embeds tab, so this page carries what admin settings'+ * Guest embeds page holds today: the Enable guest embeds toggle, the secret+ * key and the published embeds list.+ */+export function EmbeddingHubSecurityPage() {+ const hasSimpleEmbedding = useHasTokenFeature("embedding_simple");++ const isFullAppEmbeddingEnabled = useSetting("enable-embedding-interactive");++ // Keyed on whether anything is actually published, not on the toggle: an+ // admin who has just turned guest embeds off still needs to see what is+ // already out there, and that is exactly when they most need to.+ const { data: embeddedDashboards } = useListEmbeddableDashboardsQuery();+ const { data: embeddedCards } = useListEmbeddableCardsQuery();+ const hasPublishedGuestEmbeds =+ (embeddedDashboards?.length ?? 0) > 0 || (embeddedCards?.length ?? 0) > 0;++ return (+ <SettingsPageWrapper title={t`Security`}>+ <EmbeddingMethodsCard />++ {!hasSimpleEmbedding && (+ <EmbeddingHubUpsellBanner+ title={t`Upgrade to Metabase Pro to access the SDK for React and more advanced options.`}+ campaign={UPSELL_CAMPAIGN}+ location={UPSELL_LOCATION}+ />+ )}++ <SettingsSection>+ <CorsInputWidget />+ </SettingsSection>++ {/* SameSite governs the metabase.SESSION cookie, and guest embeds never+ set one (src/metabase/request/cookies.clj:71-81). Guest is the only+ method below the paywall, so the setting is inert there -- showing it+ invites an admin to change a value that cannot affect their embeds. */}+ {hasSimpleEmbedding && (+ <SettingsSection>+ <SameSiteSelectWidget />+ </SettingsSection>+ )}++ <SettingsSection>+ <EmbeddingSecretKeyWidget />+ </SettingsSection>++ {/* Per the design's annotation: only when published guest embeds exist. */}+ {hasPublishedGuestEmbeds && (+ <SettingsSection>+ <Box data-testid="embedded-resources">+ <SettingTitle+ id="static-embeds"+ fz="lg"+ mb="lg"+ >{t`Published guest embeds`}</SettingTitle>++ <EmbeddedResources />+ </Box>+ </SettingsSection>+ )}++ {/* Per the design's annotation: only when full-app embedding is on. */}+ {isFullAppEmbeddingEnabled &&+ PLUGIN_ADMIN_SETTINGS.InteractiveEmbeddingAuthorizedOriginsWidget && (+ <SettingsSection>+ <PLUGIN_ADMIN_SETTINGS.InteractiveEmbeddingAuthorizedOriginsWidget />+ </SettingsSection>+ )}+ </SettingsPageWrapper>+ );+}diff --git a/frontend/src/metabase/embedding-hub/pages/EmbeddingHubSecurityPage.unit.spec.tsx b/frontend/src/metabase/embedding-hub/pages/EmbeddingHubSecurityPage.unit.spec.tsxnew file mode 100644index 00000000000..17c7c6a9216--- /dev/null+++ b/frontend/src/metabase/embedding-hub/pages/EmbeddingHubSecurityPage.unit.spec.tsx@@ -0,0 +1,146 @@+import { setupEnterpriseOnlyPlugin } from "__support__/enterprise";+import {+ setupEmbeddableEntitiesEndpoints,+ setupPropertiesEndpoints,+ setupSettingsEndpoints,+ setupUpdateSettingEndpoint,+ setupUpsellEndpoints,+} from "__support__/server-mocks";+import { mockSettings } from "__support__/settings";+import { createMockState } from "__support__/state";+import { renderWithProviders, screen, waitFor } from "__support__/ui";+import type { Card, Dashboard, Settings } from "metabase-types/api";+import {+ createMockDashboard,+ createMockSettings,+ createMockTokenFeatures,+} from "metabase-types/api/mocks";++import { EmbeddingHubSecurityPage } from "./EmbeddingHubSecurityPage";++interface SetupOpts {+ isGuestEmbedsEnabled?: Settings["enable-embedding-modular"];+ isFullAppEmbeddingEnabled?: Settings["enable-embedding-interactive"];+ hasSimpleEmbedding?: boolean;+ dashboards?: Dashboard[];+ cards?: Card[];+}++function setup({+ isGuestEmbedsEnabled = false,+ isFullAppEmbeddingEnabled = false,+ hasSimpleEmbedding = false,+ dashboards = [],+ cards = [],+}: SetupOpts) {+ const settings = createMockSettings({+ "enable-embedding-modular": isGuestEmbedsEnabled,+ "enable-embedding-interactive": isFullAppEmbeddingEnabled,+ "token-features": createMockTokenFeatures({+ embedding_simple: hasSimpleEmbedding,+ embedding: isFullAppEmbeddingEnabled,+ }),+ });++ const state = createMockState({ settings: mockSettings(settings) });++ // The plugin reads the token features at init, so the store has to be+ // populated before it registers the authorized-origins widget.+ if (isFullAppEmbeddingEnabled) {+ setupEnterpriseOnlyPlugin("embedding");+ }++ setupPropertiesEndpoints(settings);+ setupSettingsEndpoints([]);+ setupUpdateSettingEndpoint();+ setupUpsellEndpoints();+ setupEmbeddableEntitiesEndpoints({ dashboards, cards });++ renderWithProviders(<EmbeddingHubSecurityPage />, {+ storeInitialState: state,+ });+}++describe("EmbeddingHubSecurityPage", () => {+ describe("published guest embeds", () => {+ it("lists published guest embeds even when guest embeds are turned off", async () => {+ setup({+ isGuestEmbedsEnabled: false,+ dashboards: [createMockDashboard({ name: "Published dashboard" })],+ });++ expect(+ await screen.findByText("Published guest embeds"),+ ).toBeInTheDocument();+ expect(+ await screen.findByText("Published dashboard"),+ ).toBeInTheDocument();+ });++ it("hides the card when nothing is published, even with guest embeds on", async () => {+ setup({ isGuestEmbedsEnabled: true });++ await screen.findByText("Secret key for guest embeds");++ await waitFor(() => {+ expect(+ screen.queryByText("Published guest embeds"),+ ).not.toBeInTheDocument();+ });+ });+ });++ describe("CORS", () => {+ it("shows CORS on an instance whose only embedding method is guest", async () => {+ setup({ hasSimpleEmbedding: false });++ expect(+ await screen.findByText("Cross-Origin Resource Sharing (CORS)"),+ ).toBeInTheDocument();+ });+ });++ describe("SameSite cookie setting", () => {+ it("is hidden on an instance whose only embedding method is guest", async () => {+ setup({ hasSimpleEmbedding: false });++ await screen.findByText("Secret key for guest embeds");++ await waitFor(() => {+ expect(+ screen.queryByText("SameSite cookie setting"),+ ).not.toBeInTheDocument();+ });+ });++ it("is shown once modular embedding is available", async () => {+ setup({ hasSimpleEmbedding: true });++ expect(+ await screen.findByText("SameSite cookie setting"),+ ).toBeInTheDocument();+ });+ });++ describe("full-app authorized origins", () => {+ it("is hidden when full-app embedding is off", async () => {+ setup({ hasSimpleEmbedding: true, isFullAppEmbeddingEnabled: false });++ await screen.findByText("Secret key for guest embeds");++ await waitFor(() => {+ expect(+ screen.queryByText("Authorized origins for full-app embedding"),+ ).not.toBeInTheDocument();+ });+ });++ it("is shown when full-app embedding is on", async () => {+ setup({ hasSimpleEmbedding: true, isFullAppEmbeddingEnabled: true });++ expect(+ await screen.findByText("Authorized origins for full-app embedding"),+ ).toBeInTheDocument();+ });+ });+});diff --git a/frontend/src/metabase/embedding-hub/pages/EmbeddingHubTenancyPage.tsx b/frontend/src/metabase/embedding-hub/pages/EmbeddingHubTenancyPage.tsxnew file mode 100644index 00000000000..885c69a038f--- /dev/null+++ b/frontend/src/metabase/embedding-hub/pages/EmbeddingHubTenancyPage.tsx@@ -0,0 +1,180 @@+import { useEffect } from "react";+import { t } from "ttag";++import { ExternalLink } from "metabase/common/components/ExternalLink";+import { usePermissionsBasePath } from "metabase/common/components/PermissionsBasePath/base-path";+import { useDocsUrl, useHasTokenFeature } from "metabase/common/hooks";+import {+ resetTenantsBasePath,+ setTenantsBasePath,+} from "metabase/common/tenants";+import { isUnder } from "metabase/embedding-hub/components/EmbeddingHubLayout";+import { TenancyUpsellPage } from "metabase/embedding-hub/upsells";+import { Outlet, useLocation, useNavigate } from "metabase/router";+import { useAdminSetting, useSetting } from "metabase/settings";+import { SettingsPageWrapper } from "metabase/settings-components";+import {+ Box,+ Button,+ Card,+ Center,+ Flex,+ Group,+ Icon,+ Image,+ Stack,+ Tabs,+ Text,+ Title,+} from "metabase/ui";+import * as Urls from "metabase/urls";++const UTM_CAMPAIGN = "embedding-hub";+const UTM_CONTENT = "embedding-hub-tenancy-page";+const TENANTS_ILLUSTRATION = "app/assets/img/upsell-embedding-tenants.svg";++/**+ * A second view of admin People's tenant surfaces, not a move — admin keeps its+ * copy, including the tab bar, which comes from PeopleNav outside the route+ * fragment. Branches on license and the setting itself rather than reusing+ * `createTenantsRouteGuard`: that guard redirects the licensed-but-disabled+ * state to `/admin/people`, but here the tab that leads to it is always+ * clickable, so that state renders in place instead.+ */+export function EmbeddingHubTenancyPage() {+ const hasTenants = useHasTokenFeature("tenants");+ const isUsingTenants = useSetting("use-tenants");++ // Declares the hub as both the tenant and the permissions editor's URL+ // builders' host, the same way EmbeddingHubPermissionsBasePath does when the+ // Permissions tab itself is mounted.+ usePermissionsBasePath(Urls.embeddingHubPermissions());+ setTenantsBasePath(Urls.embeddingHubTenancy());+ useEffect(() => resetTenantsBasePath, []);++ if (!hasTenants) {+ return <TenancyUpsellPage />;+ }++ return (+ <SettingsPageWrapper title={t`Tenancy`}>+ {!isUsingTenants && <EnableTenancyCard />}++ {isUsingTenants && (+ <>+ <TenancyTabs />++ {/* The listing centres itself with `mx="auto"`, which as a flex+ item collapses it to its content width. */}+ <Box w="100%">+ <Outlet />+ </Box>+ </>+ )}+ </SettingsPageWrapper>+ );+}++function TenancyTabs() {+ const { pathname } = useLocation();+ const navigate = useNavigate();+ const tenancyBasePath = Urls.embeddingHubTenancy();++ const tabs = [+ { label: t`Tenants`, to: tenancyBasePath },+ { label: t`Tenant groups`, to: `${tenancyBasePath}/groups` },+ { label: t`Tenant users`, to: `${tenancyBasePath}/people` },+ ];++ // The listing also renders at /:tenantId, so anything that is not groups or+ // users belongs to the Tenants tab.+ const activeTab =+ tabs.find((tab) => tab.to !== tenancyBasePath && isUnder(pathname, tab.to))+ ?.to ?? tenancyBasePath;++ return (+ <Group justify="space-between" align="center">+ <Tabs+ variant="pills"+ value={activeTab}+ onChange={(value) => value && navigate(value)}+ >+ <Tabs.List>+ {tabs.map((tab) => (+ <Tabs.Tab key={tab.to} value={tab.to}>+ {tab.label}+ </Tabs.Tab>+ ))}+ </Tabs.List>+ </Tabs>++ <TenantsDocsLink label={t`Documentation`} />+ </Group>+ );+}++function EnableTenancyCard() {+ const { updateSetting } = useAdminSetting("use-tenants");++ return (+ <Card p="xxl" withBorder>+ <Flex gap="xxl" align="center" justify="space-between" wrap="nowrap">+ <Stack gap="lg" maw="30rem">+ <Title order={4}>{t`Enable multi-tenant user strategy`}</Title>++ <Text c="text-secondary" lh="lg">+ {t`A tenant is a set of attributes assigned to a user to isolate them from other tenants. For example, in a SaaS app with embedded Metabase dashboards, you can assign each customer to a tenant. Tenants let you reuse the same dashboards and permissions across all tenants, instead of recreating them for each customer.`}+ </Text>++ <Group gap="xl">+ <Button+ variant="filled"+ onClick={() => updateSetting({ key: "use-tenants", value: true })}+ >+ {t`Enable multi-tenancy`}+ </Button>++ <TenantsDocsLink label={t`View docs`} />+ </Group>+ </Stack>++ {/* The same artwork the upsell shows, since this is the same subject+ one step further on. */}+ <Card+ p={6}+ radius={12}+ shadow="sm"+ withBorder+ maw="40%"+ visibleFrom="md"+ >+ <Center w="100%" p="xxl">+ <Image src={TENANTS_ILLUSTRATION} w="100%" h="auto" alt="" />+ </Center>+ </Card>+ </Flex>+ </Card>+ );+}++function TenantsDocsLink({ label }: { label: string }) {+ const { url } = useDocsUrl("embedding/tenants", {+ utm: {+ utm_source: "product",+ utm_medium: "docs",+ utm_campaign: UTM_CAMPAIGN,+ utm_content: UTM_CONTENT,+ },+ });++ return (+ <ExternalLink href={url}>+ <Group gap={4} wrap="nowrap">+ <Text c="brand" fw="bold">+ {label}+ </Text>+ <Icon name="external" size={12} c="brand" aria-hidden />+ </Group>+ </ExternalLink>+ );+}diff --git a/frontend/src/metabase/embedding-hub/pages/EmbeddingHubTenancyPage.unit.spec.tsx b/frontend/src/metabase/embedding-hub/pages/EmbeddingHubTenancyPage.unit.spec.tsxnew file mode 100644index 00000000000..0b3af27356d--- /dev/null+++ b/frontend/src/metabase/embedding-hub/pages/EmbeddingHubTenancyPage.unit.spec.tsx@@ -0,0 +1,151 @@+import userEvent from "@testing-library/user-event";++import { setupEnterprisePlugins } from "__support__/enterprise";+import {+ findRequests,+ setupPropertiesEndpoints,+ setupSettingsEndpoints,+ setupTenantEntpoints,+ setupUpdateSettingEndpoint,+} from "__support__/server-mocks";+import { mockSettings } from "__support__/settings";+import { createMockState } from "__support__/state";+import { renderWithProviders, screen, waitFor } from "__support__/ui";+import { Route } from "metabase/router";+import {+ createMockSettings,+ createMockTokenFeatures,+ createMockUser,+} from "metabase-types/api/mocks";++import { EmbeddingHubTenancyPage } from "./EmbeddingHubTenancyPage";++interface SetupOpts {+ hasTenants?: boolean;+ isUsingTenants?: boolean;+}++function setup({ hasTenants = false, isUsingTenants = false }: SetupOpts = {}) {+ const settings = createMockSettings({+ "token-features": createMockTokenFeatures({ tenants: hasTenants }),+ "use-tenants": isUsingTenants,+ });++ setupPropertiesEndpoints(settings);+ setupSettingsEndpoints([{ key: "use-tenants", value: isUsingTenants }]);+ setupUpdateSettingEndpoint();+ setupTenantEntpoints([]);++ // Settings before plugins: PLUGIN_TENANTS registers on `hasPremiumFeature`,+ // so registering first would leave EditUserStrategyModal unset.+ const storeSettings = mockSettings(settings);+ setupEnterprisePlugins();++ return renderWithProviders(+ <Route path="/embedding/tenancy" element={<EmbeddingHubTenancyPage />} />,+ {+ withRouter: true,+ initialRoute: "/embedding/tenancy",+ storeInitialState: createMockState({+ settings: storeSettings,+ currentUser: createMockUser({ is_superuser: true }),+ }),+ },+ );+}++describe("EmbeddingHubTenancyPage", () => {+ describe("not licensed", () => {+ it("upsells and offers nothing to turn on", async () => {+ setup({ hasTenants: false });++ expect(+ await screen.findByText("Use a multi-tenant user strategy"),+ ).toBeInTheDocument();+ expect(+ screen.getByText(/Securely share data with external users/),+ ).toBeInTheDocument();++ expect(+ screen.queryByRole("button", { name: "Enable multi-tenancy" }),+ ).not.toBeInTheDocument();+ expect(+ screen.queryByRole("tab", { name: "Tenants" }),+ ).not.toBeInTheDocument();+ });+ });++ describe("licensed but tenancy is off", () => {+ it("shows the enable card instead of the upsell or the listing", async () => {+ setup({ hasTenants: true, isUsingTenants: false });++ expect(+ await screen.findByText("Enable multi-tenant user strategy"),+ ).toBeInTheDocument();++ expect(+ screen.queryByText("Use a multi-tenant user strategy"),+ ).not.toBeInTheDocument();+ expect(+ screen.queryByRole("tab", { name: "Tenants" }),+ ).not.toBeInTheDocument();+ });++ it("turns tenancy on without asking for a strategy first", async () => {+ setup({ hasTenants: true, isUsingTenants: false });++ await userEvent.click(+ await screen.findByRole("button", { name: "Enable multi-tenancy" }),+ );++ await waitFor(async () => {+ expect(await findRequests("PUT")).toHaveLength(1);+ });++ const [{ url, body }] = await findRequests("PUT");++ expect(url).toContain("/api/setting/use-tenants");+ expect(body).toEqual({ value: true });++ expect(+ screen.queryByRole("heading", { name: "Pick a user strategy" }),+ ).not.toBeInTheDocument();+ });+ });++ describe("licensed and tenancy is on", () => {+ it("carries the tab bar that PeopleNav supplies in admin", async () => {+ setup({ hasTenants: true, isUsingTenants: true });++ expect(+ await screen.findByRole("tab", { name: "Tenants" }),+ ).toBeInTheDocument();+ expect(+ screen.getByRole("tab", { name: "Tenant groups" }),+ ).toBeInTheDocument();+ expect(+ screen.getByRole("tab", { name: "Tenant users" }),+ ).toBeInTheDocument();++ expect(+ screen.queryByText("Enable multi-tenant user strategy"),+ ).not.toBeInTheDocument();+ expect(+ screen.queryByText("Use a multi-tenant user strategy"),+ ).not.toBeInTheDocument();+ });++ it("tags its docs link with the hub's campaign", async () => {+ setup({ hasTenants: true, isUsingTenants: true });++ const docsLink = await screen.findByRole("link", {+ name: "Documentation",+ });++ expect(docsLink).toHaveAttribute(+ "href",+ expect.stringContaining("utm_campaign=embedding-hub"),+ );+ });+ });+});diff --git a/frontend/src/metabase/embedding-hub/pages/EmbeddingHubThemeEditorPage.tsx b/frontend/src/metabase/embedding-hub/pages/EmbeddingHubThemeEditorPage.tsxnew file mode 100644index 00000000000..2e3f686ce64--- /dev/null+++ b/frontend/src/metabase/embedding-hub/pages/EmbeddingHubThemeEditorPage.tsx@@ -0,0 +1,32 @@+import { useHasTokenFeature } from "metabase/common/hooks";+import { EmbeddingThemeEditorApp } from "metabase/embedding/themes/components/ThemeEditor";+import { Navigate, useSearchParams } from "metabase/router";+import * as Urls from "metabase/urls";++/**+ * The editor is its own route rather than a child of the Appearance page, so it+ * repeats that page's `embedding_simple` gate -- without it a deep link opens+ * the editor on a plan that cannot use it. Sending them to Appearance shows the+ * upsell that page already owns.+ */+export function EmbeddingHubThemeEditorPage() {+ const hasSimpleEmbedding = useHasTokenFeature("embedding_simple");+ const [searchParams] = useSearchParams();++ if (!hasSimpleEmbedding) {+ return <Navigate to={Urls.embeddingHubAppearance()} replace />;+ }++ // Only the setup guide is honored, so a crafted `return` cannot redirect elsewhere.+ const returnPath =+ searchParams.get("return") === "get-started"+ ? Urls.embeddingHubGetStarted()+ : undefined;++ return (+ <EmbeddingThemeEditorApp+ basePath={Urls.embeddingHubAppearance()}+ returnPath={returnPath}+ />+ );+}diff --git a/frontend/src/metabase/embedding-hub/pages/EmbeddingHubThemeEditorPage.unit.spec.tsx b/frontend/src/metabase/embedding-hub/pages/EmbeddingHubThemeEditorPage.unit.spec.tsxnew file mode 100644index 00000000000..17113db582b--- /dev/null+++ b/frontend/src/metabase/embedding-hub/pages/EmbeddingHubThemeEditorPage.unit.spec.tsx@@ -0,0 +1,82 @@+import fetchMock from "fetch-mock";++import {+ setupPropertiesEndpoints,+ setupRecentViewsEndpoints,+ setupSettingsEndpoints,+} from "__support__/server-mocks";+import { mockSettings } from "__support__/settings";+import { createMockState } from "__support__/state";+import { renderWithProviders, screen } from "__support__/ui";+import { Route } from "metabase/router";+import {+ createMockSettings,+ createMockTokenFeatures,+ createMockUser,+} from "metabase-types/api/mocks";++import { EmbeddingHubThemeEditorPage } from "./EmbeddingHubThemeEditorPage";++interface SetupOpts {+ hasSimpleEmbedding?: boolean;+ route?: string;+}++function setup({+ hasSimpleEmbedding = true,+ route = "/embedding/appearance/theme/new",+}: SetupOpts = {}) {+ fetchMock.get("path:/api/embed-theme", []);+ setupRecentViewsEndpoints([]);+ // With no recents, the preview panel falls back to searching for a dashboard.+ fetchMock.get("path:/api/search", { data: [], total: 0 });++ const settings = createMockSettings({+ "token-features": createMockTokenFeatures({+ embedding_simple: hasSimpleEmbedding,+ }),+ });++ setupPropertiesEndpoints(settings);+ setupSettingsEndpoints([]);++ renderWithProviders(+ <>+ <Route+ path="/embedding/appearance/theme/:themeId"+ element={<EmbeddingHubThemeEditorPage />}+ />+ <Route path="/embedding/appearance" element={<div>Appearance</div>} />+ <Route path="/embedding/get-started" element={<div>Get started</div>} />+ </>,+ {+ withRouter: true,+ initialRoute: route,+ storeInitialState: createMockState({+ settings: mockSettings(settings),+ currentUser: createMockUser({ is_superuser: true }),+ }),+ },+ );+}++describe("EmbeddingHubThemeEditorPage", () => {+ it("redirects to Appearance without embedding_simple", async () => {+ setup({ hasSimpleEmbedding: false });++ expect(await screen.findByText("Appearance")).toBeInTheDocument();+ });++ it("renders the editor when licensed", async () => {+ setup();++ expect(await screen.findByText("Edit theme")).toBeInTheDocument();+ });++ it("ignores a return value it does not recognize", async () => {+ setup({ route: "/embedding/appearance/theme/new?return=somewhere-else" });++ expect(await screen.findByText("Edit theme")).toBeInTheDocument();+ expect(screen.queryByText("Get started")).not.toBeInTheDocument();+ });+});diff --git a/frontend/src/metabase/embedding-hub/pages/GetStarted/ChecklistCard.tsx b/frontend/src/metabase/embedding-hub/pages/GetStarted/ChecklistCard.tsxnew file mode 100644index 00000000000..1a7e76d225f--- /dev/null+++ b/frontend/src/metabase/embedding-hub/pages/GetStarted/ChecklistCard.tsx@@ -0,0 +1,175 @@+import { t } from "ttag";++import { ForwardRefLink } from "metabase/common/components/Link";+import {+ Card,+ FixedSizeIcon,+ Flex,+ Group,+ Icon,+ Stack,+ Text,+ Tooltip,+} from "metabase/ui";+import type { IconName } from "metabase-types/api";++import S from "./GetStarted.module.css";++export type ChecklistCardProps = {+ /** Position in the checklist, shown in the badge. */+ step: number;+ icon: IconName;+ title: string;+ description: string;+ isDone?: boolean;+ /** Either disabled on OSS, or waiting on another step to be completed. */+ isLocked?: boolean;+ /** Why it is locked, shown on hover. */+ lockedReason?: string;+ to?: string;+ onClick?: () => void;+};++export function ChecklistCard({+ step,+ icon,+ title,+ description,+ isDone = false,+ isLocked = false,+ lockedReason,+ to,+ onClick,+}: ChecklistCardProps) {+ const textColor = isLocked ? "text-tertiary" : "text-primary";+ const isInteractive = !isLocked && (to != null || onClick != null);++ const content = (+ <Stack gap="sm" h="100%" justify="space-between">+ <Group gap="sm" align="flex-start" wrap="nowrap">+ <FixedSizeIcon+ name={icon}+ size={16}+ c={isLocked ? "text-tertiary" : "brand"}+ mt="0.15rem"+ />++ <Stack gap="sm">+ <Text fw="bold" fz="lg" lh="md" c={textColor}>+ {title}+ </Text>++ <Text+ fz="md"+ lh="lg"+ c={isLocked ? "text-tertiary" : "text-secondary"}+ >+ {description}+ </Text>+ </Stack>+ </Group>++ <Flex justify="flex-end">+ <StepBadge+ step={step}+ isDone={isDone && !isLocked}+ isLocked={isLocked}+ />+ </Flex>+ </Stack>+ );++ let card;++ if (isInteractive && to != null) {+ card = (+ <Card+ p="lg"+ withBorder+ className={S.interactiveCard}+ component={ForwardRefLink}+ to={to}+ aria-label={title}+ data-testid="embedding-hub-checklist-card"+ >+ {content}+ </Card>+ );+ } else if (isInteractive) {+ card = (+ // A plain "button" string, not `component={UnstyledButton}`: Card's+ // polymorphic typing (unlike Flex's, which is what AreaTab uses) does+ // not resolve UnstyledButton's own props through the `component` prop,+ // so `onClick` is rejected at the type level. The global button reset+ // (`reset.module.css`) already strips native button chrome, so this+ // renders identically to UnstyledButton would have.+ <Card+ component="button"+ type="button"+ p="lg"+ withBorder+ // The global button reset does not cover text-align, so without this a+ // native button centres the card's text.+ ta="left"+ className={S.interactiveCard}+ onClick={onClick}+ aria-label={title}+ data-testid="embedding-hub-checklist-card"+ >+ {content}+ </Card>+ );+ } else {+ // Locked, or given neither `to` nor `onClick`: a plain div, with no click target.+ card = (+ <Card+ p="lg"+ withBorder+ data-testid="embedding-hub-checklist-card"+ aria-disabled={isLocked || undefined}+ >+ {content}+ </Card>+ );+ }++ if (isLocked && lockedReason) {+ return (+ <Tooltip label={lockedReason} position="top" withArrow>+ {card}+ </Tooltip>+ );+ }++ return card;+}++function StepBadge({+ step,+ isDone,+ isLocked,+}: {+ step: number;+ isDone: boolean;+ isLocked: boolean;+}) {+ if (isDone) {+ return (+ <Flex+ className={S.badge}+ bg="background-success"+ aria-label={t`Step ${step} complete`}+ >+ <Icon name="check" size={14} c="success" />+ </Flex>+ );+ }++ return (+ <Flex className={S.badge}>+ <Text fw="bold" fz="md" c={isLocked ? "text-tertiary" : "brand"}>+ {step}+ </Text>+ </Flex>+ );+}diff --git a/frontend/src/metabase/embedding-hub/pages/GetStarted/ChecklistCard.unit.spec.tsx b/frontend/src/metabase/embedding-hub/pages/GetStarted/ChecklistCard.unit.spec.tsxnew file mode 100644index 00000000000..fcf8a9abcde--- /dev/null+++ b/frontend/src/metabase/embedding-hub/pages/GetStarted/ChecklistCard.unit.spec.tsx@@ -0,0 +1,27 @@+import userEvent from "@testing-library/user-event";++import { renderWithProviders, screen } from "__support__/ui";++import { ChecklistCard } from "./ChecklistCard";++describe("ChecklistCard", () => {+ it("does not fire its action while locked", async () => {+ const onClick = jest.fn();++ renderWithProviders(+ <ChecklistCard+ step={6}+ icon="embed"+ title="Embed in production with SSO"+ description="Embed a dashboard."+ isLocked+ lockedReason="Set up SSO to unlock"+ onClick={onClick}+ />,+ );++ await userEvent.click(screen.getByText("Embed in production with SSO"));++ expect(onClick).not.toHaveBeenCalled();+ });+});diff --git a/frontend/src/metabase/embedding-hub/pages/GetStarted/EmbeddingHubGetStartedPage.tsx b/frontend/src/metabase/embedding-hub/pages/GetStarted/EmbeddingHubGetStartedPage.tsxnew file mode 100644index 00000000000..645b14c7e5a--- /dev/null+++ b/frontend/src/metabase/embedding-hub/pages/GetStarted/EmbeddingHubGetStartedPage.tsx@@ -0,0 +1,431 @@+import cx from "classnames";+import { useCallback, useMemo, useState } from "react";+import { match } from "ts-pattern";+import { t } from "ttag";++import { ExternalLink } from "metabase/common/components/ExternalLink";+import { useDocsUrl, useHasTokenFeature } from "metabase/common/hooks";+import {+ useCompletedSetupGuideSteps,+ useSetupGuideModals,+} from "metabase/embedding/setup-guide";+import type {+ SetupGuideModalToTrigger,+ SetupGuideStepId,+} from "metabase/embedding/setup-guide/types/setup-guide";+import { EmbeddingHubUpsellBanner } from "metabase/embedding-hub/components/EmbeddingHubUpsellBanner";+import { AIProviderConfigurationModal } from "metabase/metabot/components/AIProviderConfigurationModal";+import type { SdkIframeEmbedSetupModalInitialState } from "metabase/plugins";+import { useDispatch, useSelector } from "metabase/redux";+import { setOpenModalWithProps } from "metabase/redux/ui";+import { getUrlWithUtm } from "metabase/selectors/settings";+import {+ Box,+ Card,+ FixedSizeIcon,+ Group,+ Stack,+ Text,+ Title,+} from "metabase/ui";+import * as Urls from "metabase/urls";+import type { IconName } from "metabase-types/api";++import { ChecklistCard } from "./ChecklistCard";+import S from "./GetStarted.module.css";++const MARKETING_DEMO_URL = "https://www.metabase.com/embedding-demo";++const SETUP_GUIDE_URLS = {+ permissions: `${Urls.embeddingHubGetStarted()}/permissions`,+ sso: `${Urls.embeddingHubGetStarted()}/sso`,+};++/**+ * The hub shares only completion state with the home-page checklist, keyed by+ * `SetupGuideStepId`. Copy and actions are its own, because the two have+ * different designs: the home page is a linear stepper, the hub is grouped+ * cards with their own wording and entry points.+ */+type HubStep = {+ id: SetupGuideStepId;+ icon: IconName;+ title: string;+ description: string;+ to?: string;+ onClick?: () => void;+};++type HubCard =+ | { type: "step"; step: HubStep }+ | { type: "theme" }+ | { type: "ai" };++const UTM_CAMPAIGN = "embedding-hub";+const UTM_CONTENT = "embedding-hub-get-started-page";++export function EmbeddingHubGetStartedPage() {+ const dispatch = useDispatch();+ const { data: completedSteps } = useCompletedSetupGuideSteps();+ const { setOpenedModal, modals } = useSetupGuideModals({+ returnTo: Urls.embeddingHubGetStarted(),+ });++ const openEmbedModal = useCallback(+ (initialState: SdkIframeEmbedSetupModalInitialState) => {+ dispatch(setOpenModalWithProps({ id: "embed", props: { initialState } }));+ },+ [dispatch],+ );++ // The hub is the only place that renders the setup guide on OSS, so each step+ // needs its own feature check rather than one stand-in for "Pro".+ const hasSimpleEmbedding = useHasTokenFeature("embedding_simple");+ const hasSsoJwt = useHasTokenFeature("sso_jwt");+ const hasTenants = useHasTokenFeature("tenants");++ // A locked step carries a reason only when the prerequisite is actionable.+ // Feature-locked steps leave it out: naming a prerequisite would imply the+ // step is reachable, and the upsell banner already says what it takes.+ const lockedSteps: Partial<+ Record<SetupGuideStepId, { isLocked: boolean; reason?: string }>+ > = useMemo(() => {+ const isSsoConfigured = completedSteps["sso-configured"];++ return {+ "data-permissions-and-enable-tenants": { isLocked: !hasTenants },+ "sso-configured": { isLocked: !hasSsoJwt },+ "embed-production": match({ hasSsoJwt, isSsoConfigured })+ .with({ hasSsoJwt: false }, () => ({ isLocked: true }))+ .with({ isSsoConfigured: false }, () => ({+ isLocked: true,+ reason: t`Set up SSO to unlock`,+ }))+ .otherwise(() => ({ isLocked: false })),+ };+ }, [completedSteps, hasSsoJwt, hasTenants]);++ const baseEmbedSteps = useMemo(+ () =>+ getBaseEmbedSteps({ setOpenedModal, openEmbedModal, hasSimpleEmbedding }),+ [setOpenedModal, openEmbedModal, hasSimpleEmbedding],+ );+ const fineTuneSteps = useMemo(+ () => getFineTuneSteps({ openEmbedModal }),+ [openEmbedModal],+ );++ function renderCard(card: HubCard, position: number) {+ switch (card.type) {+ case "step": {+ const { step } = card;+ const locked = lockedSteps[step.id];++ return (+ <ChecklistCard+ key={step.id}+ step={position}+ icon={step.icon}+ title={step.title}+ description={step.description}+ isDone={completedSteps[step.id]}+ isLocked={locked?.isLocked ?? false}+ lockedReason={locked?.reason}+ to={step.to}+ onClick={step.onClick}+ />+ );+ }+ case "theme":+ return (+ <ThemeCard+ key="custom-theme"+ step={position}+ isLocked={!hasSimpleEmbedding}+ isDone={completedSteps["create-custom-theme"]}+ />+ );+ case "ai":+ return (+ <AiCard+ key="configure-ai"+ step={position}+ isConfigured={completedSteps["configure-ai"]}+ />+ );+ }+ }++ // Without modular embedding every Fine-tune step is locked, and AI is the one+ // advanced step still reachable -- so the design promotes it into the first+ // section.+ const firstSection: HubCard[] = [+ ...baseEmbedSteps.map((step): HubCard => ({ type: "step", step })),+ ...(hasSimpleEmbedding ? [] : [{ type: "ai" as const }]),+ ];+ const fineTuneSection: HubCard[] = [+ ...fineTuneSteps.map((step): HubCard => ({ type: "step", step })),+ { type: "theme" },+ ...(hasSimpleEmbedding ? [{ type: "ai" as const }] : []),+ ];++ return (+ <Stack gap="2.5rem">+ <Title order={1} c="text-primary">+ {t`Get started with Metabase Embedding`}+ </Title>++ <Stack gap="lg">+ <Box>+ <Title order={3} c="text-primary">{t`Create your first embed`}</Title>+ <Text c="text-secondary" mt={4}>+ {hasSimpleEmbedding+ ? t`If all you want is a simple embedded dashboard, these steps are all you need.`+ : t`Start with the basics of Metabase embedding.`}+ </Text>+ </Box>++ <Box+ className={cx(S.cardGrid, !hasSimpleEmbedding && S.cardGridTwoColumn)}+ >+ {firstSection.map((card, index) => renderCard(card, index + 1))}+ </Box>+ </Stack>++ <Stack gap="lg">+ <Box>+ <Title order={3} c="text-primary">{t`Fine-tune your embed`}</Title>++ {hasSimpleEmbedding ? (+ <Text c="text-secondary" mt={4}>+ {t`If you have a more sophisticated setup in mind, with many users and tenants, then keep going.`}+ </Text>+ ) : (+ <Box mt="lg">+ <EmbeddingHubUpsellBanner+ title={t`Upgrade to Metabase Pro to configure advanced options.`}+ campaign={UTM_CAMPAIGN}+ location={UTM_CONTENT}+ />+ </Box>+ )}+ </Box>++ <Box+ className={cx(S.cardGrid, !hasSimpleEmbedding && S.cardGridTwoColumn)}+ >+ {fineTuneSection.map((card, index) =>+ renderCard(card, firstSection.length + index + 1),+ )}+ </Box>+ </Stack>++ <UsefulLinksSection />++ {modals}+ </Stack>+ );+}++type StepHandlers = {+ setOpenedModal: (modal: SetupGuideModalToTrigger) => void;+ openEmbedModal: (initialState: SdkIframeEmbedSetupModalInitialState) => void;+};++function getBaseEmbedSteps({+ setOpenedModal,+ openEmbedModal,+ hasSimpleEmbedding,+}: StepHandlers & { hasSimpleEmbedding: boolean }): HubStep[] {+ return [+ {+ id: "add-data",+ icon: "database",+ title: t`Connect a database`,+ description: t`Connect your own database or upload a CSV and start working with your real data.`,+ onClick: () => setOpenedModal({ type: "add-data", initialTab: "db" }),+ },+ {+ id: "create-dashboard",+ icon: "dashboard",+ title: t`Create a dashboard`,+ description: t`Automatically generate a dashboard from your data using x-rays.`,+ onClick: () => setOpenedModal({ type: "xray-dashboard" }),+ },+ {+ id: "create-test-embed",+ icon: "embed",+ title: t`Get embed snippet`,+ description: hasSimpleEmbedding+ ? t`Embed a dashboard, question, the query builder or the collection browser. Configure the experience and customize the appearance.`+ : t`Embed a dashboard or question. Configure the experience and customize the appearance.`,+ onClick: () => openEmbedModal({}),+ },+ ];+}++function getFineTuneSteps({+ openEmbedModal,+}: Pick<StepHandlers, "openEmbedModal">): HubStep[] {+ return [+ {+ id: "data-permissions-and-enable-tenants",+ icon: "group",+ title: t`Configure data permissions and tenants`,+ description: t`Share data with external users and allow them to create content.`,+ to: SETUP_GUIDE_URLS.permissions,+ },+ {+ id: "sso-configured",+ icon: "lock",+ title: t`Set up SSO`,+ description: t`Configure JWT authentication to ensure only authorized users can access your embeds.`,+ to: SETUP_GUIDE_URLS.sso,+ },+ {+ id: "embed-production",+ icon: "embed",+ title: t`Embed in production with SSO`,+ description: t`Embed a dashboard, question, the query builder or the collection browser. Configure the experience and customize the appearance.`,+ onClick: () =>+ openEmbedModal({ isGuest: false, useExistingUserSession: false }),+ },+ ];+}++/**+ * Steps 7 and 8 are specific to the embedding hub: they are not in the shared+ * checklist, which also drives `SetupGuideHomePage` -- the stepper Metabase+ * puts on the home page for admins while the `embedding-homepage` setting is+ * visible. That page keeps the shared steps only, so these two live here.+ */+function ThemeCard({+ step,+ isLocked,+ isDone,+}: {+ step: number;+ isLocked: boolean;+ isDone: boolean;+}) {+ return (+ <ChecklistCard+ step={step}+ isLocked={isLocked}+ isDone={isDone}+ icon="palette"+ title={t`Create a custom theme`}+ description={t`Fine-tune the appearance of your embedded content with colors and fonts.`}+ // Straight into a new theme, tagged so the editor returns here on save+ // rather than to the Appearance listing the user never passed through.+ to={`${Urls.embeddingHubAppearance()}/theme/new?return=get-started`}+ />+ );+}++// AI is available on both OSS and Pro, so this is the only card that moves+// between sections depending on the plan.+function AiCard({+ step,+ isConfigured,+}: {+ step: number;+ isConfigured: boolean;+}) {+ const [isModalOpen, setIsModalOpen] = useState(false);++ return (+ <>+ <ChecklistCard+ step={step}+ icon="metabot"+ title={t`Configure AI`}+ description={t`Connect to an LLM provider to embed AI chat interfaces and let your users ask natural language queries.`}+ isDone={isConfigured}+ // Configured, the card links out to the admin AI page rather than+ // reopening the modal. That is a product decision, not a constraint --+ // the modal still works, offering a switch-provider flow.+ to={isConfigured ? Urls.adminAiSettings() : undefined}+ onClick={isConfigured ? undefined : () => setIsModalOpen(true)}+ />++ <AIProviderConfigurationModal+ opened={isModalOpen}+ onClose={() => setIsModalOpen(false)}+ />+ </>+ );+}++function UsefulLinksSection() {+ const docsUtm = {+ utm_source: "product",+ utm_medium: "docs",+ utm_campaign: UTM_CAMPAIGN,+ utm_content: UTM_CONTENT,+ };++ const { url: introductionUrl } = useDocsUrl("embedding/introduction", {+ utm: docsUtm,+ });+ const { url: documentationUrl } = useDocsUrl("embedding/start", {+ utm: docsUtm,+ });++ const demoUrl = useSelector((state) =>+ getUrlWithUtm(state, {+ url: MARKETING_DEMO_URL,+ utm_source: "product",+ utm_medium: "demo",+ utm_campaign: UTM_CAMPAIGN,+ utm_content: UTM_CONTENT,+ }),+ );++ return (+ <Stack gap="lg">+ <Title order={3} c="text-primary">{t`Useful links`}</Title>++ <Box className={S.cardGrid}>+ <UsefulLink+ icon="embed"+ label={t`Embedding methods`}+ href={introductionUrl}+ />+ <UsefulLink icon="embed_static" label={t`Demo`} href={demoUrl} />+ <UsefulLink+ icon="reference"+ label={t`Documentation`}+ href={documentationUrl}+ />+ </Box>+ </Stack>+ );+}++function UsefulLink({+ icon,+ label,+ href,+}: {+ icon: IconName;+ label: string;+ href: string;+}) {+ return (+ <Card+ component={ExternalLink}+ href={href}+ p="lg"+ withBorder+ className={S.interactiveCard}+ >+ <Group gap="sm" wrap="nowrap">+ <FixedSizeIcon name={icon} size={16} c="brand" />+ <Text fz="md" c="text-primary">+ {label}+ </Text>+ </Group>+ </Card>+ );+}diff --git a/frontend/src/metabase/embedding-hub/pages/GetStarted/EmbeddingHubGetStartedPage.unit.spec.tsx b/frontend/src/metabase/embedding-hub/pages/GetStarted/EmbeddingHubGetStartedPage.unit.spec.tsxnew file mode 100644index 00000000000..8d1f27df773--- /dev/null+++ b/frontend/src/metabase/embedding-hub/pages/GetStarted/EmbeddingHubGetStartedPage.unit.spec.tsx@@ -0,0 +1,369 @@+import userEvent from "@testing-library/user-event";+import fetchMock from "fetch-mock";++import { setupEnterprisePlugins } from "__support__/enterprise";+import {+ setupDatabaseListEndpoint,+ setupLlmProviderTypesEndpoint,+ setupLlmProvidersEndpoint,+ setupPropertiesEndpoints,+ setupRecentViewsAndSelectionsEndpoints,+ setupSearchEndpoints,+ setupSettingsEndpoints,+ setupTokenStatusEndpoint,+} from "__support__/server-mocks";+import { mockSettings } from "__support__/settings";+import { createMockState } from "__support__/state";+import { renderWithProviders, screen, within } from "__support__/ui";+import type { SetupGuideChecklist } from "metabase/embedding/setup-guide/api/setup-guide";+import { Route } from "metabase/router";+import {+ createMockSettings,+ createMockTokenFeatures,+ createMockUser,+} from "metabase-types/api/mocks";++import { EmbeddingHubGetStartedPage } from "./EmbeddingHubGetStartedPage";++const THEME_CARD = "Create a custom theme";+const AI_CARD = "Configure AI";+const TENANTS_CARD = "Configure data permissions and tenants";+const SSO_CARD = "Set up SSO";+const PRODUCTION_CARD = "Embed in production with SSO";++interface SetupOpts {+ hasSimpleEmbedding?: boolean;+ hasSsoJwt?: boolean;+ hasTenants?: boolean;+ checklist?: Partial<SetupGuideChecklist>;+ isLlmConfigured?: boolean;+ isEmbeddedMetabotEnabled?: boolean;+}++function setup({+ hasSimpleEmbedding = false,+ hasSsoJwt = false,+ hasTenants = false,+ checklist = {},+ isLlmConfigured = false,+ isEmbeddedMetabotEnabled = true,+}: SetupOpts = {}) {+ const settings = createMockSettings({+ "token-features": createMockTokenFeatures({+ embedding_simple: hasSimpleEmbedding,+ sso_jwt: hasSsoJwt,+ tenants: hasTenants,+ }),+ "llm-metabot-configured?": isLlmConfigured,+ "embedded-metabot-enabled?": isEmbeddedMetabotEnabled,+ });++ fetchMock.get("path:/api/embedding-hub/checklist", {+ checklist,+ "data-isolation-strategy": null,+ });++ setupPropertiesEndpoints(settings);+ setupSettingsEndpoints([]);+ setupSearchEndpoints([]);+ setupDatabaseListEndpoint([]);+ setupRecentViewsAndSelectionsEndpoints([], ["selections"]);+ setupTokenStatusEndpoint({ valid: true });++ // The AI card opens AIProviderConfigurationModal, which loads both.+ setupLlmProvidersEndpoint([]);+ setupLlmProviderTypesEndpoint([]);++ // Settings before plugins: the shared checklist drops the tenants step when+ // PLUGIN_TENANTS.isEnabled is false, and that registration reads the mock.+ const storeSettings = mockSettings(settings);+ setupEnterprisePlugins();++ return renderWithProviders(+ <Route+ path="/embedding/get-started"+ element={<EmbeddingHubGetStartedPage />}+ />,+ {+ withRouter: true,+ initialRoute: "/embedding/get-started",+ storeInitialState: createMockState({+ settings: storeSettings,+ currentUser: createMockUser({ is_superuser: true }),+ }),+ },+ );+}++/**+ * The card whose own subtree carries the given title.+ *+ * An unlocked card is a real control -- an anchor or a button -- with the+ * title as its accessible name, so it is found by role. A locked card is+ * deliberately inert: no link, no button, no role at all, since it is not+ * meant to be reachable. There is nothing to query by role there, so it+ * falls back to the container testid, scoped by the title text within it.+ */+function queryCard(title: string) {+ const control =+ screen.queryByRole("link", { name: title }) ??+ screen.queryByRole("button", { name: title });++ if (control) {+ return control;+ }++ return (+ screen+ .queryAllByTestId("embedding-hub-checklist-card")+ .find((card) => within(card).queryByText(title) != null) ?? null+ );+}++function getCard(title: string) {+ const card = queryCard(title);++ if (!card) {+ throw new Error(`No checklist card found for "${title}"`);+ }++ return card;+}++function isLocked(title: string) {+ return getCard(title).getAttribute("aria-disabled") === "true";+}++describe("EmbeddingHubGetStartedPage", () => {+ describe("per-feature locking", () => {+ it("locks every Fine-tune step when the instance licenses nothing", async () => {+ setup();++ expect(await screen.findByText(SSO_CARD)).toBeInTheDocument();++ // AI is excluded on purpose: it needs no paid feature, so it never locks.+ [TENANTS_CARD, SSO_CARD, PRODUCTION_CARD, THEME_CARD].forEach((title) => {+ expect(isLocked(title)).toBe(true);+ });+ });++ it("keys each step off its own feature, not one blanket check", async () => {+ // Licensing a single feature is how the per-step gating is shown, not a+ // shape to expect: Pro carries everything bar the cloud-only features.+ setup({ hasSsoJwt: true });++ expect(await screen.findByText(SSO_CARD)).toBeInTheDocument();++ expect(isLocked(SSO_CARD)).toBe(false);+ expect(isLocked(TENANTS_CARD)).toBe(true);+ expect(isLocked(THEME_CARD)).toBe(true);+ });++ it("unlocks the tenants step on its own feature", async () => {+ setup({ hasTenants: true });++ expect(await screen.findByText(TENANTS_CARD)).toBeInTheDocument();+ expect(isLocked(TENANTS_CARD)).toBe(false);+ expect(isLocked(SSO_CARD)).toBe(true);+ });++ it("unlocks the theme step on embedding_simple", async () => {+ setup({ hasSimpleEmbedding: true });++ expect(await screen.findByText(THEME_CARD)).toBeInTheDocument();+ expect(isLocked(THEME_CARD)).toBe(false);+ expect(isLocked(SSO_CARD)).toBe(true);+ });++ it("opens a new theme and tags it to return here", async () => {+ setup({ hasSimpleEmbedding: true });++ const card = await screen.findByRole("link", { name: THEME_CARD });++ expect(card).toHaveAttribute(+ "href",+ expect.stringContaining("/theme/new?return=get-started"),+ );+ });+ });++ describe("the production-embed prerequisite", () => {+ it("names the prerequisite once SSO is licensed but not configured", async () => {+ setup({ hasSsoJwt: true, checklist: { "sso-configured": false } });++ expect(await screen.findByText(PRODUCTION_CARD)).toBeInTheDocument();+ expect(isLocked(PRODUCTION_CARD)).toBe(true);++ // The reason is a tooltip, so it is in the DOM only once hovered.+ await userEvent.hover(getCard(PRODUCTION_CARD));++ expect(+ await screen.findByText("Set up SSO to unlock"),+ ).toBeInTheDocument();+ });++ it("names no prerequisite when SSO is not licensed at all", async () => {+ // Without the feature the step is locked anyway, so a prerequisite would+ // name something that unlocks nothing.+ setup({ hasSsoJwt: false });++ expect(await screen.findByText(PRODUCTION_CARD)).toBeInTheDocument();+ expect(isLocked(PRODUCTION_CARD)).toBe(true);++ await userEvent.hover(getCard(PRODUCTION_CARD));++ expect(+ screen.queryByText("Set up SSO to unlock"),+ ).not.toBeInTheDocument();+ });++ it("unlocks once SSO is both licensed and configured", async () => {+ setup({+ hasSsoJwt: true,+ checklist: {+ "sso-configured": true,+ "sso-auth-manual-tested": true,+ },+ });++ await screen.findByText(SSO_CARD);++ expect(screen.getByText(PRODUCTION_CARD)).toBeInTheDocument();+ expect(isLocked(PRODUCTION_CARD)).toBe(false);+ expect(+ screen.queryByText("Set up SSO to unlock"),+ ).not.toBeInTheDocument();+ });+ });++ describe("the AI card's done state", () => {+ // Which settings make it done is the backend's business -- it reports+ // `configure-ai`, and the card just renders what the checklist says.+ it("is not done while the checklist says it is not", async () => {+ setup({ checklist: { "configure-ai": false } });++ expect(await screen.findByText(AI_CARD)).toBeInTheDocument();+ expect(+ within(getCard(AI_CARD)).queryByLabelText(/complete/),+ ).not.toBeInTheDocument();+ });++ it("is done when the checklist says so, and links out to admin", async () => {+ setup({ checklist: { "configure-ai": true } });++ // Before the checklist loads, the card is still the unconfigured+ // (button) variant -- querying by text alone would resolve against+ // that transient render and hold a stale node once it is swapped for+ // the link. Querying by the link role waits for the swap itself.+ const card = await screen.findByRole("link", { name: AI_CARD });++ expect(within(card).getByLabelText(/complete/)).toBeInTheDocument();++ // Configured, the card links out rather than reopening the modal.+ expect(card).toHaveAttribute("href", expect.stringContaining("/admin"));+ });++ it("opens the provider modal while unconfigured", async () => {+ setup({ checklist: { "configure-ai": false } });++ await userEvent.click(await screen.findByText(AI_CARD));++ expect(+ await screen.findByRole("dialog", {+ name: "Connect to an AI provider",+ }),+ ).toBeInTheDocument();+ });+ });++ describe("the first-embed blurb", () => {+ it("promises a simple embedded dashboard on pro, where the fine-tune steps exist", async () => {+ setup({ hasSimpleEmbedding: true });++ expect(+ await screen.findByText(+ "If all you want is a simple embedded dashboard, these steps are all you need.",+ ),+ ).toBeInTheDocument();+ });++ it("promises only the basics on OSS, where AI is not part of a simple embed", async () => {+ setup({ hasSimpleEmbedding: false });++ expect(+ await screen.findByText("Start with the basics of Metabase embedding."),+ ).toBeInTheDocument();+ });+ });++ describe("the paywall banner", () => {+ it("replaces the Fine-tune subtitle rather than stacking with it", async () => {+ setup({ hasSimpleEmbedding: false });++ expect(+ await screen.findByText(+ "Upgrade to Metabase Pro to configure advanced options.",+ ),+ ).toBeInTheDocument();++ expect(+ screen.queryByText(+ "If you have a more sophisticated setup in mind, with many users and tenants, then keep going.",+ ),+ ).not.toBeInTheDocument();+ });++ it("shows the subtitle and no banner above the paywall", async () => {+ setup({ hasSimpleEmbedding: true });++ expect(+ await screen.findByText(+ "If you have a more sophisticated setup in mind, with many users and tenants, then keep going.",+ ),+ ).toBeInTheDocument();++ expect(+ screen.queryByText(+ "Upgrade to Metabase Pro to configure advanced options.",+ ),+ ).not.toBeInTheDocument();+ });+ });++ describe("useful links", () => {+ it("tags all three with the embedding hub's campaign and page", async () => {+ setup();++ const links = ["Embedding methods", "Demo", "Documentation"];++ for (const label of links) {+ const link = await screen.findByRole("link", {+ name: new RegExp(label),+ });+ const { searchParams } = new URL(link.getAttribute("href") ?? "");++ expect(searchParams.get("utm_campaign")).toBe("embedding-hub");+ expect(searchParams.get("utm_content")).toBe(+ "embedding-hub-get-started-page",+ );+ }+ });+ });++ describe("the first-embed steps", () => {+ it("renders all three unlocked on every edition", async () => {+ setup();++ const titles = [+ "Connect a database",+ "Create a dashboard",+ "Get embed snippet",+ ];++ for (const title of titles) {+ expect(await screen.findByText(title)).toBeInTheDocument();+ expect(isLocked(title)).toBe(false);+ }+ });+ });+});diff --git a/frontend/src/metabase/embedding-hub/pages/GetStarted/GetStarted.module.css b/frontend/src/metabase/embedding-hub/pages/GetStarted/GetStarted.module.cssnew file mode 100644index 00000000000..5beb7988970--- /dev/null+++ b/frontend/src/metabase/embedding-hub/pages/GetStarted/GetStarted.module.css@@ -0,0 +1,39 @@+/* The numbered circle in the bottom-right of a checklist card. */+.badge {+ width: 2.625rem;+ height: 2.625rem;+ border-radius: 50%;+ align-items: center;+ justify-content: center;+ border: 1px solid var(--mb-color-border);+}++.interactiveCard {+ cursor: pointer;+ text-decoration: none;+ transition: border-color 0.2s ease;+}++.interactiveCard:hover {+ border-color: var(--mb-color-brand);+}++/*+ * Flows instead of holding a fixed column count, so cards stop shrinking below+ * a usable width when the window narrows. `auto-fill` rather than `auto-fit`:+ * auto-fit collapses the empty tracks, which would stretch the last row's two+ * cards to full width instead of leaving them column-sized as the design shows.+ */+.cardGrid {+ display: grid;+ grid-template-columns: repeat(auto-fill, minmax(15.625rem, 1fr));+ gap: var(--mantine-spacing-lg);+}++/*+ * Without modular embedding the checklist is shorter and its cards carry more+ * weight, so the design fixes two columns rather than letting them flow.+ */+.cardGridTwoColumn {+ grid-template-columns: repeat(2, 1fr);+}diff --git a/frontend/src/metabase/embedding-hub/pages/GetStarted/index.ts b/frontend/src/metabase/embedding-hub/pages/GetStarted/index.tsnew file mode 100644index 00000000000..aaa82907222--- /dev/null+++ b/frontend/src/metabase/embedding-hub/pages/GetStarted/index.ts@@ -0,0 +1 @@+export { EmbeddingHubGetStartedPage } from "./EmbeddingHubGetStartedPage";diff --git a/frontend/src/metabase/embedding-hub/pages/index.ts b/frontend/src/metabase/embedding-hub/pages/index.tsnew file mode 100644index 00000000000..44b3242b2ac--- /dev/null+++ b/frontend/src/metabase/embedding-hub/pages/index.ts@@ -0,0 +1,10 @@+export * from "./EmbeddingHubAppearancePage";+export * from "./EmbeddingHubAuthenticationPage";+export * from "./EmbeddingHubLocalizationPage";+export * from "./EmbeddingHubPermissionsPage";+export * from "./EmbeddingHubSecurityPage";+export * from "./EmbeddingHubTenancyPage";+// EmbeddingHubThemeEditorPage is deliberately absent: it is app-tier, and this+// barrel is feature-tier, so re-exporting it would let feature code reach app+// code past the boundary lint. routes.tsx imports that file directly.+export * from "./GetStarted";diff --git a/frontend/src/metabase/embedding-hub/route-guards.tsx b/frontend/src/metabase/embedding-hub/route-guards.tsxnew file mode 100644index 00000000000..077110c3a89--- /dev/null+++ b/frontend/src/metabase/embedding-hub/route-guards.tsx@@ -0,0 +1,22 @@+import { canAccessEmbeddingHub } from "metabase/common/embedding-hub/selectors";+import {+ MetabaseIsSetup,+ UserIsAuthenticated,+ createRedirectGuard,+} from "metabase/route-guards";+import { Outlet } from "metabase/router";++const UserCanAccessEmbeddingHub = createRedirectGuard(+ (state) => canAccessEmbeddingHub(state),+ "/unauthorized",+);++export const CanAccessEmbeddingHub = () => (+ <MetabaseIsSetup>+ <UserIsAuthenticated>+ <UserCanAccessEmbeddingHub>+ <Outlet />+ </UserCanAccessEmbeddingHub>+ </UserIsAuthenticated>+ </MetabaseIsSetup>+);diff --git a/frontend/src/metabase/embedding-hub/routes.tsx b/frontend/src/metabase/embedding-hub/routes.tsxnew file mode 100644index 00000000000..b082b920fcb--- /dev/null+++ b/frontend/src/metabase/embedding-hub/routes.tsx@@ -0,0 +1,121 @@+import { getRoutes as getAdminPermissionsRoutes } from "metabase/admin/permissions/routes";+import { PLUGIN_TENANTS } from "metabase/plugins";+import { Navigate, Route } from "metabase/router";+import * as Urls from "metabase/urls";++import { CanAccessEmbeddingHub } from "./route-guards";++/**+ * The hub pages, in their own chunk. The access guard stays eager: it has to+ * decide before there is anything to show.+ */+const embeddingHubLayout = () =>+ import("./components/EmbeddingHubLayout").then(({ EmbeddingHubLayout }) => ({+ Component: EmbeddingHubLayout,+ }));++const embeddingHubGetStartedPage = () =>+ import("./pages").then(({ EmbeddingHubGetStartedPage }) => ({+ Component: EmbeddingHubGetStartedPage,+ }));++const embeddingHubSecurityPage = () =>+ import("./pages").then(({ EmbeddingHubSecurityPage }) => ({+ Component: EmbeddingHubSecurityPage,+ }));++const embeddingHubAuthenticationPage = () =>+ import("./pages").then(({ EmbeddingHubAuthenticationPage }) => ({+ Component: EmbeddingHubAuthenticationPage,+ }));++const embeddingHubPermissionsPage = () =>+ import("./pages").then(({ EmbeddingHubPermissionsPage }) => ({+ Component: EmbeddingHubPermissionsPage,+ }));++const embeddingHubTenancyPage = () =>+ import("./pages").then(({ EmbeddingHubTenancyPage }) => ({+ Component: EmbeddingHubTenancyPage,+ }));++const embeddingHubAppearancePage = () =>+ import("./pages").then(({ EmbeddingHubAppearancePage }) => ({+ Component: EmbeddingHubAppearancePage,+ }));++const embeddingHubThemeEditorPage = () =>+ import("./pages/EmbeddingHubThemeEditorPage").then(+ ({ EmbeddingHubThemeEditorPage }) => ({+ Component: EmbeddingHubThemeEditorPage,+ }),+ );++const embeddingHubLocalizationPage = () =>+ import("./pages").then(({ EmbeddingHubLocalizationPage }) => ({+ Component: EmbeddingHubLocalizationPage,+ }));++const setupPermissionsAndTenantsPage = () =>+ import("metabase/embedding/setup-guide").then(+ ({ SetupPermissionsAndTenantsPage }) => ({+ Component: SetupPermissionsAndTenantsPage,+ }),+ );++const setupSsoPage = () =>+ import("metabase/embedding/setup-guide").then(({ SetupSsoPage }) => ({+ Component: SetupSsoPage,+ }));++/**+ * Every tab owns a path segment, and `/embedding` redirects to the first one,+ * so no tab's path is a prefix of another's.+ *+ * The two setup wizards nest under Get started because they belong to it: that+ * keeps its tab selected while they are open, without listing their paths+ * anywhere.+ */+export function getEmbeddingHubRoutes() {+ return (+ <Route element={<CanAccessEmbeddingHub />}>+ <Route path={Urls.EMBEDDING_HUB_ROOT_PATH} lazy={embeddingHubLayout}>+ <Route+ index+ element={<Navigate to={Urls.embeddingHubGetStarted()} replace />}+ />++ <Route path="get-started">+ <Route index lazy={embeddingHubGetStartedPage} />+ <Route path="permissions" lazy={setupPermissionsAndTenantsPage} />+ <Route path="sso" lazy={setupSsoPage} />+ </Route>++ <Route path="security" lazy={embeddingHubSecurityPage} />++ <Route path="authentication" lazy={embeddingHubAuthenticationPage} />++ <Route path="permissions" lazy={embeddingHubPermissionsPage}>+ {getAdminPermissionsRoutes()}+ </Route>++ {/* Null on OSS, and on EE assigned during plugin init. With no child+ routes the page still renders its own upsell. */}+ <Route path="tenancy" lazy={embeddingHubTenancyPage}>+ {PLUGIN_TENANTS.tenantsRoutes}+ </Route>+ <Route path="appearance">+ <Route index lazy={embeddingHubAppearancePage} />+ <Route path="theme">+ <Route+ index+ element={<Navigate to={Urls.embeddingHubAppearance()} replace />}+ />+ <Route path=":themeId" lazy={embeddingHubThemeEditorPage} />+ </Route>+ </Route>+ <Route path="localization" lazy={embeddingHubLocalizationPage} />+ </Route>+ </Route>+ );+}diff --git a/frontend/src/metabase/embedding-hub/routes.unit.spec.tsx b/frontend/src/metabase/embedding-hub/routes.unit.spec.tsxnew file mode 100644index 00000000000..ccce6d4b2c9--- /dev/null+++ b/frontend/src/metabase/embedding-hub/routes.unit.spec.tsx@@ -0,0 +1,64 @@+import { lazyLoaders } from "__support__/lazy-routes";+import { type RouteObject, toRouteObjects } from "metabase/router";++import { getEmbeddingHubRoutes } from "./routes";++/**+ * Reading the tree as data keeps the paths honest without rendering the pages,+ * the layout or the guard. No e2e test visits `sso`.+ *+ * Each page is named in an `import()` rather than imported, so resolving every+ * loader is what catches a typo that would otherwise first show as a blank page.+ */+describe("embedding hub routes", () => {+ it("routes every page it owns", () => {+ const paths = leafPaths(toRouteObjects(getEmbeddingHubRoutes()));++ expect(paths).toEqual([+ "embedding",+ "embedding/get-started",+ "embedding/get-started/permissions",+ "embedding/get-started/sso",+ "embedding/security",+ "embedding/authentication",+ "embedding/permissions",+ // Contributed by getAdminPermissionsRoutes(), not declared here.+ "embedding/permissions/data",+ "embedding/permissions/data/database",+ "embedding/permissions/data/database/:databaseId",+ "embedding/permissions/data/database/:databaseId/table/:tableId",+ "embedding/permissions/data/database/:databaseId/schema/:schemaName",+ "embedding/permissions/data/database/:databaseId/schema/:schemaName/table/:tableId",+ "embedding/permissions/data/group",+ "embedding/permissions/data/group/:groupId",+ "embedding/permissions/data/group/:groupId/database/:databaseId",+ "embedding/permissions/data/group/:groupId/database/:databaseId/schema/:schemaName",+ "embedding/permissions/collections/:collectionId",+ "embedding/tenancy",+ "embedding/appearance",+ "embedding/appearance/theme",+ "embedding/appearance/theme/:themeId",+ "embedding/localization",+ ]);+ });++ it("resolves every page", async () => {+ const loaders = lazyLoaders(getEmbeddingHubRoutes());++ // 22: includes the appearance/theme route, which is lazy too.+ expect(loaders).toHaveLength(22);++ for (const load of loaders) {+ expect((await load()).Component).toBeDefined();+ }+ });+});++function leafPaths(routes: RouteObject[], prefix = ""): string[] {+ return routes.flatMap((route) => {+ const path = [prefix, route.path].filter(Boolean).join("/");+ const children = route.children ?? [];++ return children.length > 0 ? leafPaths(children, path) : [path];+ });+}diff --git a/frontend/src/metabase/embedding-hub/upsells/AppearanceUpsellPage.tsx b/frontend/src/metabase/embedding-hub/upsells/AppearanceUpsellPage.tsxnew file mode 100644index 00000000000..9029921da18--- /dev/null+++ b/frontend/src/metabase/embedding-hub/upsells/AppearanceUpsellPage.tsx@@ -0,0 +1,24 @@+import { t } from "ttag";++import { useHasTokenFeature } from "metabase/common/hooks";++import { BaseUpsellPage } from "./BaseUpsellPage";++export function AppearanceUpsellPage() {+ const hasSimpleEmbedding = useHasTokenFeature("embedding_simple");++ if (hasSimpleEmbedding) {+ return null;+ }++ return (+ <BaseUpsellPage+ campaign="embedding-themes"+ location="embedding-hub-appearance"+ header={t`Appearance`}+ title={t`Create custom themes`}+ description={t`Fine-tune the appearance of your embedded content with colors and fonts.`}+ image="app/assets/img/upsell-themes.png"+ />+ );+}diff --git a/frontend/src/metabase/embedding-hub/upsells/AuthenticationUpsellPage.tsx b/frontend/src/metabase/embedding-hub/upsells/AuthenticationUpsellPage.tsxnew file mode 100644index 00000000000..3b3dff5b193--- /dev/null+++ b/frontend/src/metabase/embedding-hub/upsells/AuthenticationUpsellPage.tsx@@ -0,0 +1,24 @@+import { t } from "ttag";++import { useHasTokenFeature } from "metabase/common/hooks";++import { BaseUpsellPage } from "./BaseUpsellPage";++export function AuthenticationUpsellPage() {+ const hasSsoJwt = useHasTokenFeature("sso_jwt");++ if (hasSsoJwt) {+ return null;+ }++ return (+ <BaseUpsellPage+ campaign="embedding-sso"+ location="embedding-hub-authentication"+ header={t`Authentication`}+ title={t`Secure your embeds with single sign-on`}+ description={t`Connect Metabase to your identity provider using JSON Web Tokens (JWT) to authenticate people to ensure only authorized users can access your embeds.`}+ image="app/assets/img/upsell-embedding-sso.svg"+ />+ );+}diff --git a/frontend/src/metabase/embedding-hub/upsells/BaseUpsellPage.module.css b/frontend/src/metabase/embedding-hub/upsells/BaseUpsellPage.module.cssnew file mode 100644index 00000000000..49b0b7fe28b--- /dev/null+++ b/frontend/src/metabase/embedding-hub/upsells/BaseUpsellPage.module.css@@ -0,0 +1,6 @@+@media screen and (max-height: 520px) {+ .UpsellPageContent {+ height: 100%;+ overflow-y: auto;+ }+}diff --git a/frontend/src/metabase/embedding-hub/upsells/BaseUpsellPage.tsx b/frontend/src/metabase/embedding-hub/upsells/BaseUpsellPage.tsxnew file mode 100644index 00000000000..3dc11f01afd--- /dev/null+++ b/frontend/src/metabase/embedding-hub/upsells/BaseUpsellPage.tsx@@ -0,0 +1,65 @@+import { DottedBackground } from "metabase/common/components/upsells/components/DottedBackground";+import { LineDecorator } from "metabase/common/components/upsells/components/LineDecorator";+import { useUpgradeAction } from "metabase/common/components/upsells/components/UpgradeModal";+import { UpsellCardContent } from "metabase/common/components/upsells/components/UpsellCardContent";+import { UPGRADE_URL } from "metabase/common/components/upsells/constants";+import { Box, Stack, Title } from "metabase/ui";++import S from "./BaseUpsellPage.module.css";++export type BaseUpsellPageProps = {+ campaign: string;+ location: string;+ header: string;+ title: string;+ description: string;+ bulletPoints?: string[];+ image?: string;+ variant?: "image-full-height" | "image-card";+};++// Same full-bleed shape as the data-studio and monitor upsell pages: the+// dotted field owns the whole tab, header included, instead of sitting+// inside the tab's normal 800px column below a separately-rendered title.+export function BaseUpsellPage({+ campaign,+ location,+ header,+ title,+ description,+ bulletPoints,+ image,+ variant,+}: BaseUpsellPageProps) {+ const { onClick: upgradeOnClick, url: upgradeUrl } = useUpgradeAction({+ url: UPGRADE_URL,+ campaign,+ location,+ });++ return (+ <DottedBackground px="3.5rem" pt="1.5rem" pb="2rem">+ {/* fit-content + mx="auto" so the title's box is exactly as wide as+ the card below it (Stack's default stretch), whatever that width+ is -- centering the pair without hardcoding the card's width. */}+ <Box w="fit-content" mx="auto">+ <Stack gap={160} p={40} className={S.UpsellPageContent}>+ <Title order={1}>{header}</Title>+ <LineDecorator>+ <UpsellCardContent+ campaign={campaign}+ location={location}+ title={title}+ description={description}+ bulletPoints={bulletPoints}+ image={image}+ upgradeOnClick={upgradeOnClick}+ upgradeUrl={upgradeUrl}+ variant={variant}+ />+ </LineDecorator>+ </Stack>+ </Box>+ </DottedBackground>+ );+}diff --git a/frontend/src/metabase/embedding-hub/upsells/LocalizationUpsellPage.tsx b/frontend/src/metabase/embedding-hub/upsells/LocalizationUpsellPage.tsxnew file mode 100644index 00000000000..865b4f5a4bc--- /dev/null+++ b/frontend/src/metabase/embedding-hub/upsells/LocalizationUpsellPage.tsx@@ -0,0 +1,24 @@+import { t } from "ttag";++import { useHasTokenFeature } from "metabase/common/hooks";++import { BaseUpsellPage } from "./BaseUpsellPage";++export function LocalizationUpsellPage() {+ const hasContentTranslation = useHasTokenFeature("content_translation");++ if (hasContentTranslation) {+ return null;+ }++ return (+ <BaseUpsellPage+ campaign="content-translation"+ location="embedding-hub-localization"+ header={t`Localization`}+ title={t`Translate your embedded content`}+ description={t`Upload a translation dictionary to translate content such as item titles, headings, filter labels, and data in your embedded components.`}+ image="app/assets/img/upsell-embedding-localization.svg"+ />+ );+}diff --git a/frontend/src/metabase/embedding-hub/upsells/TenancyUpsellPage.tsx b/frontend/src/metabase/embedding-hub/upsells/TenancyUpsellPage.tsxnew file mode 100644index 00000000000..b81144a6a5c--- /dev/null+++ b/frontend/src/metabase/embedding-hub/upsells/TenancyUpsellPage.tsx@@ -0,0 +1,24 @@+import { t } from "ttag";++import { useHasTokenFeature } from "metabase/common/hooks";++import { BaseUpsellPage } from "./BaseUpsellPage";++export function TenancyUpsellPage() {+ const hasTenants = useHasTokenFeature("tenants");++ if (hasTenants) {+ return null;+ }++ return (+ <BaseUpsellPage+ campaign="tenants"+ location="embedding-hub-tenancy"+ header={t`Tenancy`}+ title={t`Use a multi-tenant user strategy`}+ description={t`Securely share data with external users and allow them to create content. Reuse the same dashboards and permissions across all tenants, instead of recreating them for each customer.`}+ image="app/assets/img/upsell-embedding-tenants.svg"+ />+ );+}diff --git a/frontend/src/metabase/embedding-hub/upsells/index.ts b/frontend/src/metabase/embedding-hub/upsells/index.tsnew file mode 100644index 00000000000..f2a4e1e31c1--- /dev/null+++ b/frontend/src/metabase/embedding-hub/upsells/index.ts@@ -0,0 +1,5 @@+export * from "./AppearanceUpsellPage";+export * from "./AuthenticationUpsellPage";+export * from "./BaseUpsellPage";+export * from "./LocalizationUpsellPage";+export * from "./TenancyUpsellPage";diff --git a/frontend/src/metabase/embedding-sdk/config.ts b/frontend/src/metabase/embedding-sdk/config.tsindex 3aa6562f27e..ea46ac38b7b 100644--- a/frontend/src/metabase/embedding-sdk/config.ts+++ b/frontend/src/metabase/embedding-sdk/config.ts@@ -13,7 +13,7 @@ type InternalSdkConfig = {| "mcp-apps"| "data-app";metabaseClientRequestIdentifier: string | undefined;- enableEmbeddingSettingKey: "enable-embedding-sdk" | "enable-embedding-simple";+ enableEmbeddingSettingKey: "enable-embedding-modular";tokenFeatureKey: "embedding_sdk" | "embedding_simple";};@@ -55,7 +55,7 @@ export const EMBEDDING_SDK_CONFIG: InternalSdkConfig = {/*** Which setting indicates whether the embedding is enabled?*/- enableEmbeddingSettingKey: "enable-embedding-sdk" satisfies SettingKey,+ enableEmbeddingSettingKey: "enable-embedding-modular" satisfies SettingKey,/*** Which token feature indicates whether the embedding is available?diff --git a/frontend/src/metabase/embedding/components/ReturnToSetupGuideModal/ReturnToSetupGuideModal.tsx b/frontend/src/metabase/embedding/components/ReturnToSetupGuideModal/ReturnToSetupGuideModal.tsxindex 5f2b5909727..410400d3012 100644--- a/frontend/src/metabase/embedding/components/ReturnToSetupGuideModal/ReturnToSetupGuideModal.tsx+++ b/frontend/src/metabase/embedding/components/ReturnToSetupGuideModal/ReturnToSetupGuideModal.tsx@@ -3,16 +3,18 @@ import { t } from "ttag";import { useNavigate } from "metabase/router";import { Button, Group, Modal, Stack, Text } from "metabase/ui";-// Path to the admin embedding setup guide. Inlined here (rather than-// imported from admin/) so this modal can live at the shared tier and be-// invoked from dashboard/admin/etc. without a cross-feature dependency.-const EMBEDDING_SETUP_GUIDE_PATH = "/admin/embedding/setup-guide";+// Fallback for callers that did not say where they came from. Inlined here+// rather than imported so this modal can live at the shared tier and be invoked+// from anywhere without a cross-feature dependency.+const DEFAULT_SETUP_GUIDE_PATH = "/embedding/get-started";interface ReturnToSetupGuideModalProps {opened: boolean;onClose: () => void;title: string;message: string;+ /** Where to send the user back to. The guide has more than one host. */+ returnTo?: string;}/**@@ -24,6 +26,7 @@ export const ReturnToSetupGuideModal = ({onClose,title,message,+ returnTo = DEFAULT_SETUP_GUIDE_PATH,}: ReturnToSetupGuideModalProps) => {const navigate = useNavigate();@@ -35,10 +38,7 @@ export const ReturnToSetupGuideModal = ({<Button variant="subtle" onClick={onClose}>{t`Stay here`}</Button>- <Button- variant="filled"- onClick={() => navigate(EMBEDDING_SETUP_GUIDE_PATH)}- >+ <Button variant="filled" onClick={() => navigate(returnTo)}>{t`Return to the setup guide`}</Button></Group>diff --git a/frontend/src/metabase/embedding/embedding-hub/api/embedding-hub.ts b/frontend/src/metabase/embedding/embedding-hub/api/embedding-hub.tsdeleted file mode 100644index 6d5b0b2e643..00000000000--- a/frontend/src/metabase/embedding/embedding-hub/api/embedding-hub.ts+++ /dev/null@@ -1,40 +0,0 @@-import { Api } from "metabase/api";-import { listTag } from "metabase/api/tags";-import type { DataSegregationStrategy } from "metabase-types/api";--type CheckListApiStep =- | "create-dashboard"- | "add-data"- | "configure-row-column-security"- | "create-test-embed"- | "embed-production"- | "sso-configured"- | "enable-tenants"- | "move-dashboard-to-shared"- | "create-tenants"- | "setup-data-segregation-strategy"- | "data-permissions-and-enable-tenants"- | "sso-auth-manual-tested";-export type EmbeddingHubChecklist = Record<CheckListApiStep, boolean>;--export type EmbeddingHubChecklistResponse = {- checklist: EmbeddingHubChecklist;- "data-isolation-strategy": DataSegregationStrategy | null;-};--export const embeddingHubApi = Api.injectEndpoints({- endpoints: (builder) => ({- getEmbeddingHubChecklist: builder.query<- EmbeddingHubChecklistResponse,- void- >({- query: () => ({- method: "GET",- url: "/api/ee/embedding-hub/checklist",- }),- providesTags: [listTag("embedding-hub-checklist")],- }),- }),-});--export const { useGetEmbeddingHubChecklistQuery } = embeddingHubApi;diff --git a/frontend/src/metabase/embedding/embedding-hub/hooks/index.ts b/frontend/src/metabase/embedding/embedding-hub/hooks/index.tsdeleted file mode 100644index c68f442ae66..00000000000--- a/frontend/src/metabase/embedding/embedding-hub/hooks/index.ts+++ /dev/null@@ -1,3 +0,0 @@-export { useCompletedEmbeddingHubSteps } from "./use-completed-embedding-hub-steps";-export { useGetEmbeddingHubSteps } from "./use-get-embedding-hub-steps";-export { useHelpUrl } from "./use-help-url";diff --git a/frontend/src/metabase/embedding/embedding-hub/types/index.ts b/frontend/src/metabase/embedding/embedding-hub/types/index.tsdeleted file mode 100644index 03b4c37eca3..00000000000--- a/frontend/src/metabase/embedding/embedding-hub/types/index.ts+++ /dev/null@@ -1,6 +0,0 @@-export type {- EmbeddingHubStep,- EmbeddingHubStepId,- EmbeddingHubAction,- EmbeddingHubModalToTrigger,-} from "./embedding-checklist";diff --git a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/AuthenticationCard/AuthenticationCard.tsx b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/AuthenticationCard/AuthenticationCard.tsxindex 0d582fdba38..4184baa9251 100644--- a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/AuthenticationCard/AuthenticationCard.tsx+++ b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/AuthenticationCard/AuthenticationCard.tsx@@ -83,13 +83,29 @@ export const AuthenticationCard = () => {resourceType={resourceType}/>)}- {isGuestEmbedsEnabled !== undefined && (- <EnableGuestEmbedsSection- key={currentStep}- isEnabled={isGuestEmbedsEnabled}- termsAccepted={isGuestEmbedsTermsAccepted}- />- )}+ {isGuestEmbedsEnabled !== undefined &&+ // Guest enablement writes the same+ // `enable-embedding-modular` setting the SSO path does, so+ // on Pro the modular embedding terms are owed here too and+ // the section that states them is the one to show. Guest's+ // own terms come first whenever they are still unaccepted.+ (isSimpleEmbedFeatureAvailable &&+ isGuestEmbedsTermsAccepted ? (+ <EnableModularEmbeddingSection+ key={currentStep}+ isEnabled={isGuestEmbedsEnabled}+ termsAccepted={isSimpleEmbeddingTermsAccepted}+ />+ ) : (+ <EnableGuestEmbedsSection+ key={currentStep}+ isEnabled={isGuestEmbedsEnabled}+ termsAccepted={isGuestEmbedsTermsAccepted}+ isSimpleEmbedFeatureAvailable={+ isSimpleEmbedFeatureAvailable+ }+ />+ ))}</>)}</Stack>diff --git a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/AuthenticationCard/EnableGuestEmbedsSection.tsx b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/AuthenticationCard/EnableGuestEmbedsSection.tsxindex 61660ba00c4..830f54e45ad 100644--- a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/AuthenticationCard/EnableGuestEmbedsSection.tsx+++ b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/AuthenticationCard/EnableGuestEmbedsSection.tsx@@ -11,17 +11,21 @@ import { UsageConditionsInfoIcon } from "./UsageConditionsInfoIcon";interface Props {isEnabled: boolean;termsAccepted: boolean;+ isSimpleEmbedFeatureAvailable: boolean;}/**- * Rendered under the Guest radio when guest embeds (`enable-embedding-static`)- * aren't enabled yet or the AGPL usage conditions haven't been accepted. Lets- * the admin enable the feature and accept the terms in a single click from- * inside the wizard.+ * Rendered under the Guest radio when `enable-embedding-modular` isn't on yet+ * or the AGPL usage conditions haven't been accepted. Lets the admin do both+ * in one click from inside the wizard.+ *+ * `show-static-embed-terms` is force-false on Pro (settings.clj), so the+ * "agree to the usage conditions" wording never renders there.*/export const EnableGuestEmbedsSection = ({isEnabled,termsAccepted,+ isSimpleEmbedFeatureAvailable,}: Props) => {const [updateSettings] = useUpdateSettingsMutation();const [sendToast] = useToast();@@ -33,14 +37,20 @@ export const EnableGuestEmbedsSection = ({const [showSection] = useState(!isAccepted);const initialDataRef = useRef({ isEnabled, termsAccepted });+ // Wording follows the admin settings page's labels for the same toggle+ // (EmbeddingMethodsCard.tsx).+ const failedToEnableMessage = isSimpleEmbedFeatureAvailable+ ? t`Failed to enable modular embedding`+ : t`Failed to enable embedding`;+const handleEnable = async () => {try {await updateSettings({- "enable-embedding-static": true,+ "enable-embedding-modular": true,...(!termsAccepted && { "show-static-embed-terms": false }),});} catch (error) {- sendToast({ message: t`Failed to enable guest embeds` });+ sendToast({ message: failedToEnableMessage });}};@@ -61,7 +71,9 @@ export const EnableGuestEmbedsSection = ({const { title, buttonCaption } =match(initialDataRef.current).with({ isEnabled: false, termsAccepted: false }, () => ({- title: jt`To continue, enable guest embeds and agree to the ${usageConditionsLink}.`,+ // Never matches on Pro: `show-static-embed-terms` is force-false+ // there (settings.clj), so `termsAccepted` is always true.+ title: jt`To continue, enable embedding and agree to the ${usageConditionsLink}.`,buttonCaption: t`Agree and enable`,})).with({ isEnabled: true, termsAccepted: false }, () => ({@@ -69,7 +81,9 @@ export const EnableGuestEmbedsSection = ({buttonCaption: t`Agree and continue`,})).with({ isEnabled: false, termsAccepted: true }, () => ({- title: t`Enable guest embeds to get started.`,+ title: isSimpleEmbedFeatureAvailable+ ? t`Enable modular embedding to get started.`+ : t`Enable embedding to get started.`,buttonCaption: t`Enable and continue`,})).otherwise(() => null) ?? {};diff --git a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/AuthenticationCard/EnableModularEmbeddingSection.tsx b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/AuthenticationCard/EnableModularEmbeddingSection.tsxindex 6b96112e4f6..887a6286bcf 100644--- a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/AuthenticationCard/EnableModularEmbeddingSection.tsx+++ b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/AuthenticationCard/EnableModularEmbeddingSection.tsx@@ -15,7 +15,7 @@ interface Props {/*** Rendered under the SSO radio when modular embedding- * (`enable-embedding-simple`) isn't enabled yet or its terms haven't been+ * (`enable-embedding-modular`) isn't enabled yet or its terms haven't been* accepted. Lets the admin enable the feature and accept the terms in a* single click from inside the wizard.*/@@ -36,8 +36,8 @@ export const EnableModularEmbeddingSection = ({const handleEnable = async () => {try {await updateSettings({- "enable-embedding-simple": true,- ...(!termsAccepted && { "show-simple-embed-terms": false }),+ "enable-embedding-modular": true,+ ...(!termsAccepted && { "show-modular-embed-terms": false }),});} catch (error) {sendToast({ message: t`Failed to enable modular embedding` });diff --git a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/SdkIframeEmbedSetupModal.tsx b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/SdkIframeEmbedSetupModal.tsxindex dc43030503a..1a0b12bc173 100644--- a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/SdkIframeEmbedSetupModal.tsx+++ b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/SdkIframeEmbedSetupModal.tsx@@ -57,7 +57,7 @@ export const SdkIframeEmbedSetupContent = () => {);function handleEmbedDone() {- // Embedding Hub: track step completion+ // Setup guide: track step completion. The settings keep their embedding-hub names.// Test embed = guest or existing user session (for quick testing)// Production embed = full SSO setupconst isTestEmbed = settings.isGuest || settings.useExistingUserSession;diff --git a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/SdkIframeEmbedSetupProvider.tsx b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/SdkIframeEmbedSetupProvider.tsxindex c8165f22a3d..571a8226800 100644--- a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/SdkIframeEmbedSetupProvider.tsx+++ b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/SdkIframeEmbedSetupProvider.tsx@@ -43,10 +43,14 @@ export const SdkIframeEmbedSetupProvider = ({const isSimpleEmbedFeatureAvailable =PLUGIN_EMBEDDING_IFRAME_SDK_SETUP.isEnabled();- const isSimpleEmbeddingEnabled = useSetting("enable-embedding-simple");- const isSimpleEmbeddingTermsAccepted = !useSetting("show-simple-embed-terms");+ // One setting backs both since 0.65.0; only the terms they gate still differ.+ const isModularEmbeddingEnabled = useSetting("enable-embedding-modular");+ const isSimpleEmbeddingEnabled = isModularEmbeddingEnabled;+ const isGuestEmbedsEnabled = isModularEmbeddingEnabled;- const isGuestEmbedsEnabled = useSetting("enable-embedding-static");+ const isSimpleEmbeddingTermsAccepted = !useSetting(+ "show-modular-embed-terms",+ );const isGuestEmbedsTermsAccepted = !useSetting("show-static-embed-terms");const isSsoEnabledAndConfigured = useIsSsoEnabledAndConfigured();diff --git a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/steps/AppearanceStep/AppearanceStep.unit.spec.tsx b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/steps/AppearanceStep/AppearanceStep.unit.spec.tsxindex 898a95a177d..3ed2f770f18 100644--- a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/steps/AppearanceStep/AppearanceStep.unit.spec.tsx+++ b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/steps/AppearanceStep/AppearanceStep.unit.spec.tsx@@ -25,11 +25,11 @@ describe("AppearanceStep > option cards dim state when landing on this step dire});it("does not dim the option cards", async () => {- // showSimpleEmbedTerms is true in real OSS — the terms popup is+ // showModularEmbedTerms is true in real OSS — the terms popup is// never shown to OSS users, so the setting never flips to false.landOnAppearanceStep({- simpleEmbeddingEnabled: false,- showSimpleEmbedTerms: true,+ modularEmbeddingEnabled: false,+ showModularEmbedTerms: true,});await waitFor(() => {@@ -51,8 +51,8 @@ describe("AppearanceStep > option cards dim state when landing on this step direit("dims the option cards when the user has not accepted the simple-embedding terms", async () => {landOnAppearanceStep({- simpleEmbeddingEnabled: true,- showSimpleEmbedTerms: true,+ modularEmbeddingEnabled: true,+ showModularEmbedTerms: true,});await waitFor(() => {@@ -64,8 +64,8 @@ describe("AppearanceStep > option cards dim state when landing on this step direit("does not dim the option cards once the user has accepted the simple-embedding terms", async () => {landOnAppearanceStep({- simpleEmbeddingEnabled: true,- showSimpleEmbedTerms: false,+ modularEmbeddingEnabled: true,+ showModularEmbedTerms: false,});await waitFor(() => {@@ -82,9 +82,8 @@ describe("AppearanceStep > option cards dim state when landing on this step direresourceType: "dashboard",isGuest: true,},- simpleEmbeddingEnabled: true,- showSimpleEmbedTerms: true,- guestEmbeddingEnabled: false,+ modularEmbeddingEnabled: true,+ showModularEmbedTerms: true,showStaticEmbedTerms: true,});@@ -102,9 +101,8 @@ describe("AppearanceStep > option cards dim state when landing on this step direresourceType: "dashboard",isGuest: true,},- simpleEmbeddingEnabled: true,- showSimpleEmbedTerms: true,- guestEmbeddingEnabled: true,+ modularEmbeddingEnabled: true,+ showModularEmbedTerms: true,showStaticEmbedTerms: false,});diff --git a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/steps/GetCodeStep/GetCodeStep.tsx b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/steps/GetCodeStep/GetCodeStep.tsxindex 581ef8894bd..524e4e4d65b 100644--- a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/steps/GetCodeStep/GetCodeStep.tsx+++ b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/steps/GetCodeStep/GetCodeStep.tsx@@ -33,7 +33,7 @@ export const GetCodeStep = () => {const handleFrontendSnippetCopied = () => {trackSnippetCopied("frontend");- // Embedding Hub: track step completion+ // Setup guide: track step completion. The settings keep their embedding-hub names.// Test embed = guest or existing user session (for quick testing)// Production embed = full SSO setupconst isTestEmbed = settings.isGuest || settings.useExistingUserSession;diff --git a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/tests/SdkIframeEmbedSetup-embedding-hub.unit.spec.tsx b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/tests/SdkIframeEmbedSetup-setup-guide.unit.spec.tsxsimilarity index 92%rename from frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/tests/SdkIframeEmbedSetup-embedding-hub.unit.spec.tsxrename to frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/tests/SdkIframeEmbedSetup-setup-guide.unit.spec.tsxindex 0835edcdaa8..b9f6b96d91d 100644--- a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/tests/SdkIframeEmbedSetup-embedding-hub.unit.spec.tsx+++ b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/tests/SdkIframeEmbedSetup-setup-guide.unit.spec.tsx@@ -5,7 +5,7 @@ import { PLUGIN_EMBEDDING_IFRAME_SDK_SETUP } from "metabase/plugins";import { setup, waitForUpdateSetting } from "./test-setup";-describe("Embed flow > embedding hub step completion tracking", () => {+describe("Embed flow > setup guide step completion tracking", () => {beforeEach(() => {PLUGIN_EMBEDDING_IFRAME_SDK_SETUP.isEnabled = jest.fn(() => true);});@@ -28,8 +28,8 @@ describe("Embed flow > embedding hub step completion tracking", () => {async ({ useExistingUserSession, trigger }) => {setup({jwtReady: !useExistingUserSession,- simpleEmbeddingEnabled: true,- showSimpleEmbedTerms: false,+ modularEmbeddingEnabled: true,+ showModularEmbedTerms: false,initialState: {useExistingUserSession,},diff --git a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/tests/SdkIframeEmbedSetup.unit.spec.tsx b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/tests/SdkIframeEmbedSetup.unit.spec.tsxindex e12ca4e6fea..dd94886a34d 100644--- a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/tests/SdkIframeEmbedSetup.unit.spec.tsx+++ b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/tests/SdkIframeEmbedSetup.unit.spec.tsx@@ -34,6 +34,56 @@ describe("Embed flow > initial setup", () => {});});+describe("Embed flow > enabling embedding from the Guest option", () => {+ const guestSetup = (+ options: Parameters<typeof setup>[0] & { hasLicense: boolean },+ ) => {+ PLUGIN_EMBEDDING_IFRAME_SDK_SETUP.isEnabled = () => options.hasLicense;++ setup({ ...options, initialState: { isGuest: true } });+ };++ afterEach(() => {+ PLUGIN_EMBEDDING_IFRAME_SDK_SETUP.isEnabled = () => false;+ });++ it("states the modular embedding terms on EE with a license", () => {+ guestSetup({+ hasLicense: true,+ modularEmbeddingEnabled: false,+ showModularEmbedTerms: true,+ });++ expect(screen.getByTestId("enable-embedding-card")).toHaveTextContent(+ "To continue, enable modular embedding and agree to the usage conditions.",+ );+ });++ it("only asks to enable on EE with a license once the terms are accepted", () => {+ guestSetup({+ hasLicense: true,+ modularEmbeddingEnabled: false,+ showModularEmbedTerms: false,+ });++ expect(screen.getByTestId("enable-embedding-card")).toHaveTextContent(+ "Enable modular embedding to get started.",+ );+ });++ it("states the guest embedding terms on EE without a license", () => {+ guestSetup({+ hasLicense: false,+ modularEmbeddingEnabled: false,+ showStaticEmbedTerms: true,+ });++ expect(screen.getByTestId("enable-embedding-card")).toHaveTextContent(+ "To continue, enable embedding and agree to the usage conditions.",+ );+ });+});+describe("Embed flow > misconfigured Site URL (EMB-1747)", () => {beforeEach(() => {PLUGIN_EMBEDDING_IFRAME_SDK_SETUP.isEnabled = jest.fn(() => true);@@ -45,7 +95,7 @@ describe("Embed flow > misconfigured Site URL (EMB-1747)", () => {it("renders a Site URL mismatch error in the preview area when the configured Site URL origin doesn't match the current host", async () => {setup({- simpleEmbeddingEnabled: true,+ modularEmbeddingEnabled: true,siteUrl: "http://different-host.example:9999",initialState: {resourceType: "dashboard",@@ -70,7 +120,7 @@ describe("Embed flow > misconfigured Site URL (EMB-1747)", () => {it("does not render the Site URL mismatch error when origins match", async () => {setup({- simpleEmbeddingEnabled: true,+ modularEmbeddingEnabled: true,siteUrl: window.location.origin,initialState: {resourceType: "dashboard",@@ -117,7 +167,7 @@ describe("Embed flow > custom visualizations", () => {);setup({- simpleEmbeddingEnabled: true,+ modularEmbeddingEnabled: true,initialState: {resourceType: "question",resourceId: mockCard.id,@@ -140,7 +190,7 @@ describe("Embed flow > custom visualizations", () => {);});- it("automatically allows the custom visualizations used by a dashboard opened from the embedding hub", async () => {+ it("automatically allows the custom visualizations used by a dashboard opened from the setup guide", async () => {const dashboard = createMockDashboard({enable_embedding: true,dashcards: [@@ -155,7 +205,7 @@ describe("Embed flow > custom visualizations", () => {],});- setup({ simpleEmbeddingEnabled: true, dashboard });+ setup({ modularEmbeddingEnabled: true, dashboard });await waitFor(() => {expect(window.metabaseConfig?.allowedCustomVisualizations).toEqual([@@ -179,7 +229,7 @@ describe("Embed flow > Get Code Snippet", () => {jest.mocked(navigator.clipboard.writeText).mockClear();setup({- simpleEmbeddingEnabled: true,+ modularEmbeddingEnabled: true,jwtReady: true,initialState: { useExistingUserSession: false },});@@ -205,7 +255,7 @@ describe("Embed flow > Get Code Snippet", () => {const trackSimpleEvent = jest.spyOn(Analytics, "trackSimpleEvent");setup({- simpleEmbeddingEnabled: true,+ modularEmbeddingEnabled: true,jwtReady: true,initialState: { useExistingUserSession: true },});@@ -235,7 +285,7 @@ describe("Embed flow > forward and backward navigation", () => {});it("navigates forward through the embed flow", async () => {- setup({ simpleEmbeddingEnabled: true });+ setup({ modularEmbeddingEnabled: true });expect(screen.getByText("Authentication")).toBeInTheDocument();@@ -269,7 +319,7 @@ describe("Embed flow > forward and backward navigation", () => {});it("navigates backward to the previous step", async () => {- setup({ simpleEmbeddingEnabled: true });+ setup({ modularEmbeddingEnabled: true });// First step (experience + resource) > select embed optionsawait userEvent.click(screen.getByRole("button", { name: "Next" }));@@ -288,7 +338,7 @@ describe("Embed flow > forward and backward navigation", () => {});it("hides the resource picker for exploration on the first step", async () => {- setup({ simpleEmbeddingEnabled: true });+ setup({ modularEmbeddingEnabled: true });await userEvent.click(screen.getByRole("radio", { name: /Exploration/ }));@@ -304,7 +354,7 @@ describe("Embed flow > forward and backward navigation", () => {});it("hides the authentication and resource cards when Exploration is selected", async () => {- setup({ simpleEmbeddingEnabled: true });+ setup({ modularEmbeddingEnabled: true });expect(screen.getByText("Authentication")).toBeInTheDocument();expect(screen.getByText("Select a dashboard to embed")).toBeInTheDocument();@@ -321,7 +371,7 @@ describe("Embed flow > forward and backward navigation", () => {});it("hides the authentication card but keeps the resource card (as a collection picker) when Browser is selected", async () => {- setup({ simpleEmbeddingEnabled: true });+ setup({ modularEmbeddingEnabled: true });expect(screen.getByText("Authentication")).toBeInTheDocument();expect(screen.getByText("Select a dashboard to embed")).toBeInTheDocument();@@ -338,7 +388,7 @@ describe("Embed flow > forward and backward navigation", () => {});it("renders the SSO radio above the Guest radio in the authentication card", () => {- setup({ simpleEmbeddingEnabled: true });+ setup({ modularEmbeddingEnabled: true });const radios = screen.getAllByRole("radio");const ssoIndex = radios.findIndex((r) => r.getAttribute("value") === "sso");@@ -353,7 +403,7 @@ describe("Embed flow > forward and backward navigation", () => {it("selects Guest when initialState.isGuest is true, even with SSO configured", () => {setup({- simpleEmbeddingEnabled: true,+ modularEmbeddingEnabled: true,jwtReady: true,initialState: { isGuest: true, useExistingUserSession: true },});@@ -367,7 +417,7 @@ describe("Embed flow > forward and backward navigation", () => {/This embed will only work for local testing\. To get production ready code, configure/;it("shows a warning on the authentication card when SSO is selected but not configured", () => {- setup({ simpleEmbeddingEnabled: true, jwtReady: false });+ setup({ modularEmbeddingEnabled: true, jwtReady: false });expect(screen.getByDisplayValue("sso")).toBeChecked();expect(screen.getByText("Authentication")).toBeInTheDocument();@@ -375,7 +425,7 @@ describe("Embed flow > forward and backward navigation", () => {});it("hides the warning when Guest is selected", async () => {- setup({ simpleEmbeddingEnabled: true, jwtReady: false });+ setup({ modularEmbeddingEnabled: true, jwtReady: false });await userEvent.click(screen.getByRole("radio", { name: "Guest" }));@@ -383,7 +433,7 @@ describe("Embed flow > forward and backward navigation", () => {});it("hides the warning when SSO is configured", () => {- setup({ simpleEmbeddingEnabled: true, jwtReady: true });+ setup({ modularEmbeddingEnabled: true, jwtReady: true });expect(screen.queryByText(warningText)).not.toBeInTheDocument();});@@ -391,7 +441,7 @@ describe("Embed flow > forward and backward navigation", () => {it.each(["Exploration", "Browser"])("shows a warning on the experience card when %s is selected and SSO is not configured",async (experienceLabel) => {- setup({ simpleEmbeddingEnabled: true, jwtReady: false });+ setup({ modularEmbeddingEnabled: true, jwtReady: false });await userEvent.click(screen.getByRole("radio", { name: new RegExp(experienceLabel) }),@@ -404,7 +454,7 @@ describe("Embed flow > forward and backward navigation", () => {);it("hides the experience card warning when Exploration is selected and SSO is configured", async () => {- setup({ simpleEmbeddingEnabled: true, jwtReady: true });+ setup({ modularEmbeddingEnabled: true, jwtReady: true });await userEvent.click(screen.getByRole("radio", { name: /Exploration/ }));@@ -413,7 +463,7 @@ describe("Embed flow > forward and backward navigation", () => {});it("disables next and back buttons when simple embedding is disabled", () => {- setup({ simpleEmbeddingEnabled: false });+ setup({ modularEmbeddingEnabled: false });expect(screen.getByRole("button", { name: "Next" })).toBeDisabled();expect(@@ -434,7 +484,7 @@ describe("Embed flow > forward and backward navigation", () => {);setup({- simpleEmbeddingEnabled: true,+ modularEmbeddingEnabled: true,initialState: {resourceType: "question",resourceId: 456,@@ -465,7 +515,7 @@ describe("Embed flow > Pro feature upsell indicators", () => {);setup({- simpleEmbeddingEnabled: false,+ modularEmbeddingEnabled: false,initialState: {resourceType: "question",resourceId: 456,@@ -506,7 +556,7 @@ describe("Embed flow > Pro feature upsell indicators", () => {);setup({- simpleEmbeddingEnabled: true,+ modularEmbeddingEnabled: true,hasEmailSetup: true,initialState: {resourceType: "question",@@ -538,7 +588,7 @@ describe("Embed flow > Pro feature upsell indicators", () => {it("disables Pro checkboxes for OSS users (dashboard)", () => {setup({- simpleEmbeddingEnabled: false,+ modularEmbeddingEnabled: false,initialState: {resourceType: "dashboard",resourceId: 1,@@ -562,7 +612,7 @@ describe("Embed flow > Pro feature upsell indicators", () => {PLUGIN_EMBEDDING_IFRAME_SDK_SETUP.isEnabled = jest.fn(() => true);setup({- simpleEmbeddingEnabled: true,+ modularEmbeddingEnabled: true,hasEmailSetup: true,});@@ -598,7 +648,7 @@ describe("Embed flow > Metabot", () => {it("toggles the save option for Metabot", async () => {setup({- simpleEmbeddingEnabled: true,+ modularEmbeddingEnabled: true,metabotEnabled: true,});diff --git a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/tests/test-setup.tsx b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/tests/test-setup.tsxindex 9b4c97f2ec3..2e1c5562fd6 100644--- a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/tests/test-setup.tsx+++ b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/tests/test-setup.tsx@@ -31,9 +31,8 @@ import { SdkIframeEmbedSetupModal } from "../SdkIframeEmbedSetupModal";export const setup = (options?: {enterprisePlugins?: Parameters<typeof setupEnterpriseOnlyPlugin>[0][];- simpleEmbeddingEnabled?: boolean;- showSimpleEmbedTerms?: boolean;- guestEmbeddingEnabled?: boolean;+ modularEmbeddingEnabled?: boolean;+ showModularEmbedTerms?: boolean;showStaticEmbedTerms?: boolean;jwtReady?: boolean;initialState?: SdkIframeEmbedSetupModalInitialState;@@ -58,14 +57,13 @@ export const setup = (options?: {}const tokenFeatures = createMockTokenFeatures({- embedding_simple: options?.simpleEmbeddingEnabled ?? false,+ embedding_simple: options?.modularEmbeddingEnabled ?? false,});const settingValues = createMockSettings({"token-features": tokenFeatures,- "show-simple-embed-terms": options?.showSimpleEmbedTerms ?? false,- "enable-embedding-simple": options?.simpleEmbeddingEnabled ?? false,+ "show-modular-embed-terms": options?.showModularEmbedTerms ?? false,"show-static-embed-terms": options?.showStaticEmbedTerms ?? false,- "enable-embedding-static": options?.guestEmbeddingEnabled ?? false,+ "enable-embedding-modular": options?.modularEmbeddingEnabled ?? false,"jwt-enabled": options?.jwtReady ?? false,"jwt-configured": options?.jwtReady ?? false,"jwt-enabled-and-configured": options?.jwtReady ?? false,diff --git a/frontend/src/metabase/embedding/mcp/McpQuestionView.unit.spec.tsx b/frontend/src/metabase/embedding/mcp/McpQuestionView.unit.spec.tsxindex 2108f170fc7..b1ff8bd497c 100644--- a/frontend/src/metabase/embedding/mcp/McpQuestionView.unit.spec.tsx+++ b/frontend/src/metabase/embedding/mcp/McpQuestionView.unit.spec.tsx@@ -87,7 +87,7 @@ const QUERY_RESULT = createMockDataset({*/const BOOTSTRAP = createMockMcpAppsBootstrapResponse({settings: createMockMcpAppsBootstrapSettings({- "enable-embedding-sdk": true,+ "enable-embedding-modular": true,"token-features": createMockTokenFeatures({ embedding_sdk: true }),}),});diff --git a/frontend/src/metabase/admin/settings/components/widgets/PublicLinksListing/EmbeddedResources.tsx b/frontend/src/metabase/embedding/settings/EmbeddedResources.tsxsimilarity index 90%rename from frontend/src/metabase/admin/settings/components/widgets/PublicLinksListing/EmbeddedResources.tsxrename to frontend/src/metabase/embedding/settings/EmbeddedResources.tsxindex 1870efc62c4..6a89f272949 100644--- a/frontend/src/metabase/admin/settings/components/widgets/PublicLinksListing/EmbeddedResources.tsx+++ b/frontend/src/metabase/embedding/settings/EmbeddedResources.tsx@@ -4,6 +4,8 @@ import {useListEmbeddableCardsQuery,useListEmbeddableDashboardsQuery,} from "metabase/api";+import { PublicLinksListing } from "metabase/common/components/PublicLinksListing/PublicLinksListing";+import { SettingHeader } from "metabase/settings-components";import { Stack } from "metabase/ui";import * as Urls from "metabase/urls";import type {@@ -11,10 +13,6 @@ import type {GetEmbeddableDashboard,} from "metabase-types/api";-import { SettingHeader } from "../../SettingHeader";--import { PublicLinksListing } from "./PublicLinksListing";-// refetch if revisiting this page and the cache is over a minute oldconst refetchSettings = { refetchOnMountOrArgChange: 60 };diff --git a/frontend/src/metabase/embedding/settings/EmbeddingLegaleseModal/EmbeddingLegaleseModal.tsx b/frontend/src/metabase/embedding/settings/EmbeddingLegaleseModal/EmbeddingLegaleseModal.tsxnew file mode 100644index 00000000000..8897c3b3dc6--- /dev/null+++ b/frontend/src/metabase/embedding/settings/EmbeddingLegaleseModal/EmbeddingLegaleseModal.tsx@@ -0,0 +1,50 @@+import { useState } from "react";+import { t } from "ttag";++import { useUpdateSettingsMutation } from "metabase/settings";+import { Button, Group, Modal, type ModalProps, Text } from "metabase/ui";++export const EmbeddingLegaleseModal = ({ opened, onClose }: ModalProps) => {+ const [loading, setLoading] = useState(false);+ const [updateSettings] = useUpdateSettingsMutation();++ const onAccept = async () => {+ setLoading(true);++ await updateSettings({+ "enable-embedding-modular": true,+ "show-modular-embed-terms": false,+ });++ setLoading(false);+ onClose();+ };++ return (+ <Modal+ title={t`Each end user needs their own Metabase account`}+ onClose={onClose}+ opened={opened}+ size={670}+ padding="xxl"+ withCloseButton={false}+ closeOnClickOutside={false}+ >+ <Text mt="xxs">{t`When you embed Metabase, each person who uses your app needs their own Metabase account. That's because sharing a single account between users is a security risk. Filtering data on the client side doesn't solve it, since anyone with that account's token can reach anything the account can see. Additionally, we consider shared accounts to be unfair usage.`}</Text>+ <Group justify="right" mt="xl">+ <Button+ onClick={onClose}+ variant="subtle"+ radius="xs"+ disabled={loading}+ >{t`Cancel`}</Button>+ <Button+ onClick={onAccept}+ variant="filled"+ data-is-loading={loading}+ loading={loading}+ >{t`Agree`}</Button>+ </Group>+ </Modal>+ );+};diff --git a/frontend/src/metabase/embedding/settings/EmbeddingLegaleseModal/EmbeddingLegaleseModal.unit.spec.tsx b/frontend/src/metabase/embedding/settings/EmbeddingLegaleseModal/EmbeddingLegaleseModal.unit.spec.tsxnew file mode 100644index 00000000000..15cd074080c--- /dev/null+++ b/frontend/src/metabase/embedding/settings/EmbeddingLegaleseModal/EmbeddingLegaleseModal.unit.spec.tsx@@ -0,0 +1,55 @@+import userEvent from "@testing-library/user-event";++import {+ findRequests,+ setupPropertiesEndpoints,+ setupSettingsEndpoints,+ setupUpdateSettingsEndpoint,+} from "__support__/server-mocks";+import { renderWithProviders, screen, waitFor } from "__support__/ui";+import { createMockSettings } from "metabase-types/api/mocks";++import { EmbeddingLegaleseModal } from "./EmbeddingLegaleseModal";++const setup = () => {+ const onClose = jest.fn();++ setupPropertiesEndpoints(createMockSettings());+ setupSettingsEndpoints([]);+ setupUpdateSettingsEndpoint();++ renderWithProviders(<EmbeddingLegaleseModal opened onClose={onClose} />);++ return { onClose };+};++describe("EmbeddingLegaleseModal", () => {+ it("should enable modular embedding, dismiss the terms and close the modal when the user clicks Accept", async () => {+ const { onClose } = setup();++ await userEvent.click(screen.getByRole("button", { name: "Agree" }), {+ delay: null,+ });++ const puts = await findRequests("PUT");+ expect(puts).toHaveLength(1);+ const [{ body }] = puts;++ expect(body).toEqual({+ "enable-embedding-modular": true,+ "show-modular-embed-terms": false,+ });++ await waitFor(() => {+ expect(onClose).toHaveBeenCalled();+ });+ });++ it("should not update settings when the user clicks Decline", async () => {+ const { onClose } = setup();+ await userEvent.click(screen.getByText("Cancel"));+ expect(onClose).toHaveBeenCalled();+ const puts = await findRequests("PUT");+ expect(puts).toHaveLength(0);+ });+});diff --git a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingLegaleseModal/index.ts b/frontend/src/metabase/embedding/settings/EmbeddingLegaleseModal/index.tssimilarity index 100%rename from frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingLegaleseModal/index.tsrename to frontend/src/metabase/embedding/settings/EmbeddingLegaleseModal/index.tsdiff --git a/frontend/src/metabase/embedding/settings/EmbeddingMethodsCard/EmbeddingMethodsCard.tsx b/frontend/src/metabase/embedding/settings/EmbeddingMethodsCard/EmbeddingMethodsCard.tsxnew file mode 100644index 00000000000..b057f5de285--- /dev/null+++ b/frontend/src/metabase/embedding/settings/EmbeddingMethodsCard/EmbeddingMethodsCard.tsx@@ -0,0 +1,94 @@+import type { ReactNode } from "react";+import { t } from "ttag";++import { useHasTokenFeature } from "metabase/common/hooks";+import {+ type EmbeddingSettingKey,+ EmbeddingToggle,+} from "metabase/embedding/settings/EmbeddingToggle";+import { SettingsSection } from "metabase/settings-components";+import { Box, Flex, Text } from "metabase/ui";+import { isNotNull } from "metabase/utils/types";++type EmbeddingMethod = {+ title: string;+ description: ReactNode;+ settingKey: EmbeddingSettingKey;+};++/**+ * The embedding methods, as one card of rows rather than a card per method.+ *+ * Modular embedding, the SDK and guest embeds share one switch, agreed for the+ * embedding settings reorganization and carried by EMB-2257: individual+ * toggles add complexity without adding security, since whoever can embed also+ * controls the toggles, and guest is a property of modular embedding rather+ * than a method beside it. Full-app keeps its own.+ *+ * `enable-embedding-modular` is the one setting behind that switch. Until an+ * admin sets it, it reads as the OR of the three deprecated settings it+ * replaces, so an upgrade cannot switch a live embed off.+ *+ * Guest embeds is the only free method, so OSS keeps a guest-only row.+ */+export function EmbeddingMethodsCard() {+ const hasSimpleEmbedding = useHasTokenFeature("embedding_simple");+ const hasFullAppEmbedding = useHasTokenFeature("embedding");++ const modularEmbedding: EmbeddingMethod = {+ title: t`Modular embedding and SDK for React`,+ description: t`Embed the full power of Metabase into your application with modular embedding and the React SDK to build custom analytics experiences and programmatically manage dashboards and data.`,+ settingKey: "enable-embedding-modular",+ };++ const guestEmbeds: EmbeddingMethod = {+ title: t`Enable embedding`,+ description: t`Embed Metabase dashboards and questions into your application with modular embedding.`,+ settingKey: "enable-embedding-modular",+ };++ const fullAppEmbedding: EmbeddingMethod = {+ title: t`Full-app embedding`,+ description: t`A way to embed the entire Metabase app in an iframe. This involves hard trade-off and is generally not recommended unless you know exactly what you are doing.`,+ settingKey: "enable-embedding-interactive",+ };++ const proMethods = [+ hasSimpleEmbedding ? modularEmbedding : null,+ hasFullAppEmbedding ? fullAppEmbedding : null,+ ].filter(isNotNull);++ const methods = proMethods.length > 0 ? proMethods : [guestEmbeds];++ return (+ <SettingsSection+ title={methods.length > 1 ? t`Availability of embedding methods` : null}+ titleProps={{ order: 4 }}+ >+ {methods.map((method) => (+ <EmbeddingMethodRow key={method.settingKey} {...method} />+ ))}+ </SettingsSection>+ );+}++function EmbeddingMethodRow({+ title,+ description,+ settingKey,+}: EmbeddingMethod) {+ return (+ <Flex gap="xxl" justify="space-between" align="flex-start">+ <Box maw="38rem">+ <Text fw="bold" c="text-primary" mb="xxs">+ {title}+ </Text>+ <Text c="text-secondary" lh="lg">+ {description}+ </Text>+ </Box>++ <EmbeddingToggle settingKey={settingKey} aria-label={`${title} toggle`} />+ </Flex>+ );+}diff --git a/frontend/src/metabase/embedding/settings/EmbeddingMethodsCard/EmbeddingMethodsCard.unit.spec.tsx b/frontend/src/metabase/embedding/settings/EmbeddingMethodsCard/EmbeddingMethodsCard.unit.spec.tsxnew file mode 100644index 00000000000..c707bc09dfb--- /dev/null+++ b/frontend/src/metabase/embedding/settings/EmbeddingMethodsCard/EmbeddingMethodsCard.unit.spec.tsx@@ -0,0 +1,174 @@+import userEvent from "@testing-library/user-event";++import {+ findRequests,+ setupPropertiesEndpoints,+ setupSettingsEndpoints,+ setupUpdateSettingsEndpoint,+} from "__support__/server-mocks";+import { mockSettings } from "__support__/settings";+import { createMockState } from "__support__/state";+import { renderWithProviders, screen, waitFor } from "__support__/ui";+import type { Settings } from "metabase-types/api";+import {+ createMockSettingDefinition,+ createMockSettings,+ createMockTokenFeatures,+} from "metabase-types/api/mocks";++import { EmbeddingMethodsCard } from "./EmbeddingMethodsCard";++const MERGED_LABEL = "Modular embedding and SDK for React";+const OSS_LABEL = "Enable embedding";++type SetupOpts = {+ hasSimpleEmbedding?: boolean;+ hasFullAppEmbedding?: boolean;+ envSettingKeys?: (keyof Settings)[];+ showEmbedTerms?: boolean;+} & Partial<+ Pick<Settings, "enable-embedding-modular" | "enable-embedding-interactive">+>;++async function setup({+ hasSimpleEmbedding = true,+ hasFullAppEmbedding = hasSimpleEmbedding,+ envSettingKeys = [],+ showEmbedTerms = false,+ ...values+}: SetupOpts = {}) {+ const settingValues = createMockSettings({+ "enable-embedding-modular": false,+ "enable-embedding-interactive": false,+ "show-modular-embed-terms": showEmbedTerms,+ "token-features": createMockTokenFeatures({+ embedding_simple: hasSimpleEmbedding,+ embedding: hasFullAppEmbedding,+ }),+ ...values,+ });++ const definitions = (+ ["enable-embedding-modular", "enable-embedding-interactive"] as const+ ).map((key) =>+ createMockSettingDefinition({+ key,+ value: settingValues[key],+ is_env_setting: envSettingKeys.includes(key),+ }),+ );++ setupSettingsEndpoints(definitions);+ setupPropertiesEndpoints(settingValues);+ setupUpdateSettingsEndpoint();++ renderWithProviders(<EmbeddingMethodsCard />, {+ storeInitialState: createMockState({+ settings: mockSettings(settingValues),+ }),+ });++ await waitFor(async () => {+ expect(await findRequests("GET")).not.toHaveLength(0);+ });+}++describe("EmbeddingMethodsCard", () => {+ it("presents modular embedding, the SDK and guest embeds as one method", async () => {+ await setup();++ expect(await screen.findByText(MERGED_LABEL)).toBeInTheDocument();+ expect(screen.getByText("Full-app embedding")).toBeInTheDocument();++ expect(screen.queryByText("Modular embedding SDK")).not.toBeInTheDocument();+ expect(screen.queryByText(OSS_LABEL)).not.toBeInTheDocument();+ });++ it("shows only guest embeds on OSS, where the paid methods cannot run", async () => {+ await setup({ hasSimpleEmbedding: false });++ expect(await screen.findByText(OSS_LABEL)).toBeInTheDocument();+ expect(screen.queryByText(MERGED_LABEL)).not.toBeInTheDocument();+ expect(screen.queryByText("Full-app embedding")).not.toBeInTheDocument();+ });++ it("shows only full-app embedding when that is the only feature on the token", async () => {+ await setup({ hasSimpleEmbedding: false, hasFullAppEmbedding: true });++ expect(await screen.findByText("Full-app embedding")).toBeInTheDocument();+ expect(screen.queryByText(MERGED_LABEL)).not.toBeInTheDocument();+ expect(screen.queryByText(OSS_LABEL)).not.toBeInTheDocument();+ });++ describe("the merged switch", () => {+ it("reads on when enable-embedding-modular is on", async () => {+ await setup({ "enable-embedding-modular": true });++ // The merged row comes first, full-app second.+ const [mergedSwitch] = await screen.findAllByRole("switch");+ expect(mergedSwitch).toBeChecked();+ });++ it("reads off when enable-embedding-modular is off", async () => {+ await setup();++ const [mergedSwitch] = await screen.findAllByRole("switch");+ expect(mergedSwitch).not.toBeChecked();+ });++ it("writes the one setting the three methods now share", async () => {+ await setup();++ const [mergedSwitch] = await screen.findAllByRole("switch");+ await userEvent.click(mergedSwitch);++ await waitFor(async () => {+ expect(await findRequests("PUT")).toHaveLength(1);+ });++ const [{ body }] = await findRequests("PUT");+ expect(body).toEqual({ "enable-embedding-modular": true });+ });++ it("asks the admin to accept the terms before turning embedding on", async () => {+ await setup({ showEmbedTerms: true });++ const [mergedSwitch] = await screen.findAllByRole("switch");+ await userEvent.click(mergedSwitch);++ expect(+ await screen.findByText(+ "Each end user needs their own Metabase account",+ ),+ ).toBeInTheDocument();+ expect(await findRequests("PUT")).toHaveLength(0);+ });++ // The terms are about paid methods and about shared accounts as unfair use+ // of a paid seat, so guest embeds below the paywall never trigger them.+ it("does not ask an OSS admin to accept the terms", async () => {+ await setup({ hasSimpleEmbedding: false, showEmbedTerms: true });++ const [guestSwitch] = await screen.findAllByRole("switch");+ await userEvent.click(guestSwitch);++ await waitFor(async () => {+ expect(await findRequests("PUT")).toHaveLength(1);+ });++ const [{ body }] = await findRequests("PUT");+ expect(body).toEqual({ "enable-embedding-modular": true });+ expect(+ screen.queryByText("Each end user needs their own Metabase account"),+ ).not.toBeInTheDocument();+ });++ it("locks the row when the setting is pinned to an env var", async () => {+ await setup({ envSettingKeys: ["enable-embedding-modular"] });++ expect(+ await screen.findByText("Set via environment variable"),+ ).toBeInTheDocument();+ });+ });+});diff --git a/frontend/src/metabase/embedding/settings/EmbeddingMethodsCard/index.ts b/frontend/src/metabase/embedding/settings/EmbeddingMethodsCard/index.tsnew file mode 100644index 00000000000..9cf9d93221b--- /dev/null+++ b/frontend/src/metabase/embedding/settings/EmbeddingMethodsCard/index.ts@@ -0,0 +1 @@+export { EmbeddingMethodsCard } from "./EmbeddingMethodsCard";diff --git a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSecretKeyWidget.tsx b/frontend/src/metabase/embedding/settings/EmbeddingSecretKeyWidget.tsxsimilarity index 84%rename from frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSecretKeyWidget.tsxrename to frontend/src/metabase/embedding/settings/EmbeddingSecretKeyWidget.tsxindex 6e435dd8dc8..45c93d388af 100644--- a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSecretKeyWidget.tsx+++ b/frontend/src/metabase/embedding/settings/EmbeddingSecretKeyWidget.tsx@@ -1,15 +1,16 @@import { useDisclosure } from "@mantine/hooks";import { t } from "ttag";-import { SetByEnvVarWrapper } from "metabase/admin/settings/components/widgets/AdminSettingInput";import { useLazyGenerateRandomTokenQuery } from "metabase/api/util";import { ConfirmModal } from "metabase/common/components/ConfirmModal";import { CopyButton } from "metabase/common/components/CopyButton";import { useAdminSetting } from "metabase/settings";+import {+ SetByEnvVarWrapper,+ SettingHeader,+} from "metabase/settings-components";import { Box, Button, Flex, TextInputBlurChange } from "metabase/ui";-import { SettingHeader } from "../SettingHeader";-export const EmbeddingSecretKeyWidget = () => {const [modalOpened, { open: openModal, close: closeModal }] =useDisclosure(false);@@ -17,6 +18,8 @@ export const EmbeddingSecretKeyWidget = () => {const { value, updateSetting, settingDetails } = useAdminSetting("embedding-secret-key",);+ // Avoid turning controlled input into uncontrolled because value could be `null`+ const embeddingSecretKey = value ?? "";const [generateRandomToken] = useLazyGenerateRandomTokenQuery();const handleChange = async (newToken: string) => {@@ -35,7 +38,7 @@ export const EmbeddingSecretKeyWidget = () => {<Box data-testid="embedding-secret-key-setting"><SettingHeaderid="embedding-secret-key"- title={t`Embedding secret key`}+ title={t`Secret key for guest embeds`}titleProps={{ fz: "lg", mb: "xxs" }}description={t`Standalone Embed Secret Key used to sign JSON Web Tokens for requests to /api/embed endpoints. This lets you create a secure environment limited to specific users or organizations.`}/>@@ -45,12 +48,14 @@ export const EmbeddingSecretKeyWidget = () => {><Flex gap="lg" w="100%"><TextInputBlurChange- value={value}+ value={embeddingSecretKey}onBlurChange={(e) => handleChange(e.target.value)}- rightSection={value && <CopyButton value={value} />}+ rightSection={+ embeddingSecretKey && <CopyButton value={embeddingSecretKey} />+ }w="100%"/>- {value ? (+ {embeddingSecretKey ? (<><Buttonvariant="outline"diff --git a/frontend/src/metabase/embedding/settings/EmbeddingSecuritySettings/CorsInputWidget.tsx b/frontend/src/metabase/embedding/settings/EmbeddingSecuritySettings/CorsInputWidget.tsxnew file mode 100644index 00000000000..2dac4dd878f--- /dev/null+++ b/frontend/src/metabase/embedding/settings/EmbeddingSecuritySettings/CorsInputWidget.tsx@@ -0,0 +1,59 @@+import { jt, t } from "ttag";++import { useHasTokenFeature } from "metabase/common/hooks";+import { useSetting } from "metabase/settings";+import { AdminSettingInput } from "metabase/settings-components";+import { Box, Group, HoverCard, Icon, Text } from "metabase/ui";++export const CorsInputWidget = () => {+ const isLocalhostCorsDisabled = useSetting("disable-cors-on-localhost");+ const hasSimpleEmbedding = useHasTokenFeature("embedding_simple");++ const corsHintText = isLocalhostCorsDisabled+ ? t`Separate values with a space. Localhost is not allowed. Changes will take effect within one minute.`+ : t`Separate values with a space. Localhost is automatically included. Changes will take effect within one minute.`;++ const hint = (+ <HoverCard key="embedding-cors-hint" position="bottom">+ <HoverCard.Target>+ <Icon+ name="info"+ c="text-secondary"+ cursor="pointer"+ ml="sm"+ style={{ verticalAlign: "middle" }}+ />+ </HoverCard.Target>++ <HoverCard.Dropdown>+ <Box p="lg" w={270}>+ <Text lh="lg" c="text-secondary">+ {corsHintText}+ </Text>+ </Box>+ </HoverCard.Dropdown>+ </HoverCard>+ );++ // The paid design names the methods this covers and the API-key caveat;+ // below the paywall the SDK is not available, so the plain line applies.+ const corsDescription = hasSimpleEmbedding+ ? jt`Add the website domains where you want to allow Modular embedding and SDK. SDK using API keys can only run on localhost. ${hint}`+ : jt`Add the website domains where you want to allow embedding. ${hint}`;++ return (+ <AdminSettingInput+ title={t`Cross-Origin Resource Sharing (CORS)`}+ description={+ <Group align="center" gap="sm">+ <Text c="text-secondary" fz="md">+ {corsDescription}+ </Text>+ </Group>+ }+ name="embedding-app-origins-sdk"+ placeholder="https://*.example.com"+ inputType="text"+ />+ );+};diff --git a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSecuritySettings/EmbeddingAppSameSiteCookieDescription.module.css b/frontend/src/metabase/embedding/settings/EmbeddingSecuritySettings/EmbeddingAppSameSiteCookieDescription.module.csssimilarity index 100%rename from frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSecuritySettings/EmbeddingAppSameSiteCookieDescription.module.cssrename to frontend/src/metabase/embedding/settings/EmbeddingSecuritySettings/EmbeddingAppSameSiteCookieDescription.module.cssdiff --git a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSecuritySettings/EmbeddingAppSameSiteCookieDescription.tsx b/frontend/src/metabase/embedding/settings/EmbeddingSecuritySettings/EmbeddingAppSameSiteCookieDescription.tsxsimilarity index 80%rename from frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSecuritySettings/EmbeddingAppSameSiteCookieDescription.tsxrename to frontend/src/metabase/embedding/settings/EmbeddingSecuritySettings/EmbeddingAppSameSiteCookieDescription.tsxindex cae81f9bbb5..0d93190b307 100644--- a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSecuritySettings/EmbeddingAppSameSiteCookieDescription.tsx+++ b/frontend/src/metabase/embedding/settings/EmbeddingSecuritySettings/EmbeddingAppSameSiteCookieDescription.tsx@@ -1,4 +1,4 @@-import { jt, t } from "ttag";+import { c, jt, t } from "ttag";import { ExternalLink } from "metabase/common/components/ExternalLink";import { useSelector } from "metabase/redux";@@ -28,7 +28,12 @@ export const EmbeddingAppSameSiteCookieDescription = () => {return (<Stack gap="sm">{shouldDisplayNote && <AuthorizedOriginsNote />}- <Text>{jt`Determines whether to allow cookies for cross-site requests. ${(+ <Text c="text-secondary">{t`Determines whether or not cookies are allowed to be sent on cross-site requests. You'll likely need to change this to None if your embedding application is hosted under a different domain than Metabase. Otherwise, leave it set to Lax, as it's more secure.`}</Text>++ <Text c="text-secondary">{c(+ "{0} is a 'Learn more' link to the embedding documentation",+ )+ .jt`If you set this to None, you'll have to use HTTPS, or browsers will reject the request. ${(<ExternalLink key="learn-more" href={docsUrl}>{t`Learn more`}</ExternalLink>diff --git a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSecuritySettings/SameSiteSelectWidget.tsx b/frontend/src/metabase/embedding/settings/EmbeddingSecuritySettings/SameSiteSelectWidget.tsxsimilarity index 94%rename from frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSecuritySettings/SameSiteSelectWidget.tsxrename to frontend/src/metabase/embedding/settings/EmbeddingSecuritySettings/SameSiteSelectWidget.tsxindex 1a3dd09e63e..606d406467c 100644--- a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingSecuritySettings/SameSiteSelectWidget.tsx+++ b/frontend/src/metabase/embedding/settings/EmbeddingSecuritySettings/SameSiteSelectWidget.tsx@@ -1,9 +1,11 @@import { useMemo, useState } from "react";import { t } from "ttag";-import { SettingHeader } from "metabase/admin/settings/components/SettingHeader";-import { SetByEnvVarWrapper } from "metabase/admin/settings/components/widgets/AdminSettingInput";import { useAdminSetting } from "metabase/settings";+import {+ SetByEnvVarWrapper,+ SettingHeader,+} from "metabase/settings-components";import { Box, Button, Group, Icon, Menu, Stack, Text } from "metabase/ui";import type { SessionCookieSameSite } from "metabase-types/api";diff --git a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingToggle/EmbeddingToggle.tsx b/frontend/src/metabase/embedding/settings/EmbeddingToggle/EmbeddingToggle.tsxsimilarity index 74%rename from frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingToggle/EmbeddingToggle.tsxrename to frontend/src/metabase/embedding/settings/EmbeddingToggle/EmbeddingToggle.tsxindex af55c146592..a0a96e018d7 100644--- a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingToggle/EmbeddingToggle.tsx+++ b/frontend/src/metabase/embedding/settings/EmbeddingToggle/EmbeddingToggle.tsx@@ -2,6 +2,7 @@ import { useDisclosure } from "@mantine/hooks";import type { ChangeEvent } from "react";import { t } from "ttag";+import { useHasTokenFeature } from "metabase/common/hooks";import {useAdminSetting,useAdminSettings,@@ -12,10 +13,8 @@ import { Switch, type SwitchProps, Text } from "metabase/ui";import { EmbeddingLegaleseModal } from "../EmbeddingLegaleseModal";export type EmbeddingSettingKey =- | "enable-embedding-static"- | "enable-embedding-sdk"| "enable-embedding-interactive"- | "enable-embedding-simple";+ | "enable-embedding-modular";export type EmbeddingToggleProps = {settingKey: EmbeddingSettingKey;@@ -32,8 +31,8 @@ export function EmbeddingToggle({const { values: dependentSettingsValues, updateSettings } =useAdminSettings(dependentSettingKeys);- const showSdkEmbedTerms = useSetting("show-sdk-embed-terms");- const showSimpleEmbedTerms = useSetting("show-simple-embed-terms");+ const showModularEmbedTerms = useSetting("show-modular-embed-terms");+ const hasSimpleEmbedding = useHasTokenFeature("embedding_simple");const [isLegaleseModalOpen,@@ -47,16 +46,14 @@ export function EmbeddingToggle({const isEnabled =Boolean(value) && Object.values(dependentSettingsValues).every(Boolean);- const isEmbeddingToggle =- settingKey === "enable-embedding-sdk" ||- settingKey === "enable-embedding-simple";+ // Previously this covered modular embedding and the modular embedding SDK, not+ // guest embeds. The merged toggle also covers guest embeds, so gate on the token+ // feature to exclude them and match the previous behaviour.+ const shouldShowModularEmbedTerms =+ settingKey === "enable-embedding-modular" && hasSimpleEmbedding;const handleChange = (checked: boolean) => {- const shouldShowEmbedTerms =- (settingKey === "enable-embedding-sdk" && showSdkEmbedTerms) ||- (settingKey === "enable-embedding-simple" && showSimpleEmbedTerms);-- if (shouldShowEmbedTerms && isEmbeddingToggle && checked) {+ if (showModularEmbedTerms && shouldShowModularEmbedTerms && checked) {openLegaleseModal();return;}@@ -83,9 +80,8 @@ export function EmbeddingToggle({}}/>- {isEmbeddingToggle && (+ {shouldShowModularEmbedTerms && (<EmbeddingLegaleseModal- setting={settingKey}opened={isLegaleseModalOpen}onClose={closeLegaleseModal}/>diff --git a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingToggle/EmbeddingToggle.unit.spec.tsx b/frontend/src/metabase/embedding/settings/EmbeddingToggle/EmbeddingToggle.unit.spec.tsxsimilarity index 95%rename from frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingToggle/EmbeddingToggle.unit.spec.tsxrename to frontend/src/metabase/embedding/settings/EmbeddingToggle/EmbeddingToggle.unit.spec.tsxindex f4b8151df28..cc290aab2e9 100644--- a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingToggle/EmbeddingToggle.unit.spec.tsx+++ b/frontend/src/metabase/embedding/settings/EmbeddingToggle/EmbeddingToggle.unit.spec.tsx@@ -21,7 +21,7 @@ type SetupProps = Partial<Omit<SettingDefinition<EmbeddingToggleProps["settingKey"]>, "key">;const setup = async ({- settingKey = "enable-embedding-static",+ settingKey = "enable-embedding-modular",label = undefined,disabled = undefined,is_env_setting = false,@@ -91,7 +91,7 @@ describe("EmbeddingToggle", () => {const puts = await findRequests("PUT");expect(puts).toHaveLength(1);const [{ body }] = puts;- expect(body).toEqual({ "enable-embedding-static": true });+ expect(body).toEqual({ "enable-embedding-modular": true });});it("should send a PUT request with value=false when setting is on", async () => {@@ -103,7 +103,7 @@ describe("EmbeddingToggle", () => {const puts = await findRequests("PUT");expect(puts).toHaveLength(1);const [{ body }] = puts;- expect(body).toEqual({ "enable-embedding-static": false });+ expect(body).toEqual({ "enable-embedding-modular": false });});});diff --git a/frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingToggle/index.ts b/frontend/src/metabase/embedding/settings/EmbeddingToggle/index.tssimilarity index 100%rename from frontend/src/metabase/admin/settings/components/EmbeddingSettings/EmbeddingToggle/index.tsrename to frontend/src/metabase/embedding/settings/EmbeddingToggle/index.tsdiff --git a/frontend/src/metabase/embedding/setup-guide/api/setup-guide.ts b/frontend/src/metabase/embedding/setup-guide/api/setup-guide.tsnew file mode 100644index 00000000000..89dc5489cf8--- /dev/null+++ b/frontend/src/metabase/embedding/setup-guide/api/setup-guide.ts@@ -0,0 +1,42 @@+import { Api } from "metabase/api";+import { listTag } from "metabase/api/tags";+import type { DataSegregationStrategy } from "metabase-types/api";++type CheckListApiStep =+ | "create-dashboard"+ | "add-data"+ | "configure-row-column-security"+ | "create-test-embed"+ | "embed-production"+ | "sso-configured"+ | "enable-tenants"+ | "move-dashboard-to-shared"+ | "create-tenants"+ | "setup-data-segregation-strategy"+ | "data-permissions-and-enable-tenants"+ | "sso-auth-manual-tested"+ // Embedding hub-only steps. The response is a superset of any one host's step list --+ // the home-page stepper maps its own steps and never looks these up.+ | "create-custom-theme"+ | "configure-ai";+export type SetupGuideChecklist = Record<CheckListApiStep, boolean>;++export type SetupGuideChecklistResponse = {+ checklist: SetupGuideChecklist;+ "data-isolation-strategy": DataSegregationStrategy | null;+};++export const setupGuideApi = Api.injectEndpoints({+ endpoints: (builder) => ({+ getSetupGuideChecklist: builder.query<SetupGuideChecklistResponse, void>({+ query: () => ({+ method: "GET",+ // The path keeps the old name: renaming it would break the endpoint.+ url: "/api/embedding-hub/checklist",+ }),+ providesTags: [listTag("setup-guide-checklist")],+ }),+ }),+});++export const { useGetSetupGuideChecklistQuery } = setupGuideApi;diff --git a/frontend/src/metabase/embedding/embedding-hub/components/DocsLink.tsx b/frontend/src/metabase/embedding/setup-guide/components/DocsLink.tsxsimilarity index 100%rename from frontend/src/metabase/embedding/embedding-hub/components/DocsLink.tsxrename to frontend/src/metabase/embedding/setup-guide/components/DocsLink.tsxdiff --git a/frontend/src/metabase/embedding/embedding-hub/components/OnboardingStepper/OnboardingStepper.module.css b/frontend/src/metabase/embedding/setup-guide/components/OnboardingStepper/OnboardingStepper.module.csssimilarity index 100%rename from frontend/src/metabase/embedding/embedding-hub/components/OnboardingStepper/OnboardingStepper.module.cssrename to frontend/src/metabase/embedding/setup-guide/components/OnboardingStepper/OnboardingStepper.module.cssdiff --git a/frontend/src/metabase/embedding/embedding-hub/components/OnboardingStepper/OnboardingStepper.stories.tsx b/frontend/src/metabase/embedding/setup-guide/components/OnboardingStepper/OnboardingStepper.stories.tsxsimilarity index 100%rename from frontend/src/metabase/embedding/embedding-hub/components/OnboardingStepper/OnboardingStepper.stories.tsxrename to frontend/src/metabase/embedding/setup-guide/components/OnboardingStepper/OnboardingStepper.stories.tsxdiff --git a/frontend/src/metabase/embedding/embedding-hub/components/OnboardingStepper/OnboardingStepper.tsx b/frontend/src/metabase/embedding/setup-guide/components/OnboardingStepper/OnboardingStepper.tsxsimilarity index 100%rename from frontend/src/metabase/embedding/embedding-hub/components/OnboardingStepper/OnboardingStepper.tsxrename to frontend/src/metabase/embedding/setup-guide/components/OnboardingStepper/OnboardingStepper.tsxdiff --git a/frontend/src/metabase/embedding/embedding-hub/components/OnboardingStepper/OnboardingStepper.unit.spec.tsx b/frontend/src/metabase/embedding/setup-guide/components/OnboardingStepper/OnboardingStepper.unit.spec.tsxsimilarity index 100%rename from frontend/src/metabase/embedding/embedding-hub/components/OnboardingStepper/OnboardingStepper.unit.spec.tsxrename to frontend/src/metabase/embedding/setup-guide/components/OnboardingStepper/OnboardingStepper.unit.spec.tsxdiff --git a/frontend/src/metabase/embedding/embedding-hub/components/OnboardingStepper/OnboardingStepperContext.tsx b/frontend/src/metabase/embedding/setup-guide/components/OnboardingStepper/OnboardingStepperContext.tsxsimilarity index 100%rename from frontend/src/metabase/embedding/embedding-hub/components/OnboardingStepper/OnboardingStepperContext.tsxrename to frontend/src/metabase/embedding/setup-guide/components/OnboardingStepper/OnboardingStepperContext.tsxdiff --git a/frontend/src/metabase/embedding/embedding-hub/components/OnboardingStepper/OnboardingStepperStep.tsx b/frontend/src/metabase/embedding/setup-guide/components/OnboardingStepper/OnboardingStepperStep.tsxsimilarity index 100%rename from frontend/src/metabase/embedding/embedding-hub/components/OnboardingStepper/OnboardingStepperStep.tsxrename to frontend/src/metabase/embedding/setup-guide/components/OnboardingStepper/OnboardingStepperStep.tsxdiff --git a/frontend/src/metabase/embedding/embedding-hub/components/OnboardingStepper/hooks/use-auto-advance-step.ts b/frontend/src/metabase/embedding/setup-guide/components/OnboardingStepper/hooks/use-auto-advance-step.tssimilarity index 100%rename from frontend/src/metabase/embedding/embedding-hub/components/OnboardingStepper/hooks/use-auto-advance-step.tsrename to frontend/src/metabase/embedding/setup-guide/components/OnboardingStepper/hooks/use-auto-advance-step.tsdiff --git a/frontend/src/metabase/embedding/embedding-hub/components/OnboardingStepper/hooks/use-scroll-step-into-view.ts b/frontend/src/metabase/embedding/setup-guide/components/OnboardingStepper/hooks/use-scroll-step-into-view.tssimilarity index 100%rename from frontend/src/metabase/embedding/embedding-hub/components/OnboardingStepper/hooks/use-scroll-step-into-view.tsrename to frontend/src/metabase/embedding/setup-guide/components/OnboardingStepper/hooks/use-scroll-step-into-view.tsdiff --git a/frontend/src/metabase/embedding/embedding-hub/components/OnboardingStepper/index.ts b/frontend/src/metabase/embedding/setup-guide/components/OnboardingStepper/index.tssimilarity index 100%rename from frontend/src/metabase/embedding/embedding-hub/components/OnboardingStepper/index.tsrename to frontend/src/metabase/embedding/setup-guide/components/OnboardingStepper/index.tsdiff --git a/frontend/src/metabase/embedding/embedding-hub/components/OnboardingStepper/types.ts b/frontend/src/metabase/embedding/setup-guide/components/OnboardingStepper/types.tssimilarity index 100%rename from frontend/src/metabase/embedding/embedding-hub/components/OnboardingStepper/types.tsrename to frontend/src/metabase/embedding/setup-guide/components/OnboardingStepper/types.tsdiff --git a/frontend/src/metabase/embedding/embedding-hub/components/OnboardingStepper/utils/get-next-step-to-activate.ts b/frontend/src/metabase/embedding/setup-guide/components/OnboardingStepper/utils/get-next-step-to-activate.tssimilarity index 100%rename from frontend/src/metabase/embedding/embedding-hub/components/OnboardingStepper/utils/get-next-step-to-activate.tsrename to frontend/src/metabase/embedding/setup-guide/components/OnboardingStepper/utils/get-next-step-to-activate.tsdiff --git a/frontend/src/metabase/embedding/embedding-hub/components/EmbeddingHub.tsx b/frontend/src/metabase/embedding/setup-guide/components/SetupGuide.tsxsimilarity index 58%rename from frontend/src/metabase/embedding/embedding-hub/components/EmbeddingHub.tsxrename to frontend/src/metabase/embedding/setup-guide/components/SetupGuide.tsxindex 49489b1e877..c218df10750 100644--- a/frontend/src/metabase/embedding/embedding-hub/components/EmbeddingHub.tsx+++ b/frontend/src/metabase/embedding/setup-guide/components/SetupGuide.tsx@@ -1,37 +1,31 @@-import { useMemo, useState } from "react";+import { useMemo } from "react";import { P, match } from "ts-pattern";import { t } from "ttag";-import { CreateDashboardModal } from "metabase/common/CreateDashboard/CreateDashboardModal";-import { AddDataModal } from "metabase/nav/containers/MainNavbar/MainNavbarContainer/AddDataModal";-import { PLUGIN_TENANTS } from "metabase/plugins";+import { RETURN_TO_SETUP_GUIDE_PARAM } from "metabase/embedding/constants";import {- useCompletedEmbeddingHubSteps,- useGetEmbeddingHubSteps,+ useCompletedSetupGuideSteps,+ useGetSetupGuideSteps,+ useSetupGuideModals,} from "../hooks";-import type {- EmbeddingHubModalToTrigger,- EmbeddingHubStepId,-} from "../types/embedding-checklist";+import type { SetupGuideStepId } from "../types/setup-guide";-import { EmbeddingHubXrayPickerModal } from "./EmbeddingHubXrayPickerModal";import {type StepperCardClickAction,type StepperStep,StepperWithCards,} from "./StepperWithCards/StepperWithCards";-export const EmbeddingHub = () => {- const embeddingSteps = useGetEmbeddingHubSteps();- const { data: completedSteps } = useCompletedEmbeddingHubSteps();+export const SetupGuide = ({ returnTo }: { returnTo?: string } = {}) => {+ const embeddingSteps = useGetSetupGuideSteps();+ const { data: completedSteps } = useCompletedSetupGuideSteps();- const [openedModal, setOpenedModal] =- useState<EmbeddingHubModalToTrigger | null>(null);+ // Flows that leave the guide -- connecting a database, for one -- come back+ // here, and the guide has more than one host.+ const { setOpenedModal, modals } = useSetupGuideModals({ returnTo });- const closeModal = () => setOpenedModal(null);-- const lockedSteps: Partial<Record<EmbeddingHubStepId, boolean>> = useMemo(+ const lockedSteps: Partial<Record<SetupGuideStepId, boolean>> = useMemo(() => ({"embed-production": !completedSteps?.["sso-configured"],}),@@ -68,7 +62,10 @@ export const EmbeddingHub = () => {const stepId = action.stepId ?? step.id;const clickAction: StepperCardClickAction | undefined = match(action)- .with({ to: P.string }, ({ to }) => ({ type: "link" as const, to }))+ .with({ to: P.string }, ({ to }) => ({+ type: "link" as const,+ to: returnTo ? withReturnTo(to, returnTo) : to,+ })).with({ onClick: P.nonNullable }, ({ onClick }) => ({type: "click" as const,onClick,@@ -77,7 +74,7 @@ export const EmbeddingHub = () => {type: "docs" as const,docsPath,anchor,- utm: { utm_campaign: "embedding_hub", utm_content: stepId },+ utm: { utm_campaign: "setup-guide", utm_content: stepId },})).with({ modal: P.nonNullable }, ({ modal }) => ({type: "click" as const,@@ -99,30 +96,21 @@ export const EmbeddingHub = () => {};}),}));- }, [embeddingSteps, completedSteps, lockedSteps]);+ }, [embeddingSteps, completedSteps, lockedSteps, setOpenedModal, returnTo]);return (<><StepperWithCards steps={stepperSteps} />- <AddDataModal- opened={openedModal?.type === "add-data"}- onClose={closeModal}- initialTab={- openedModal?.type === "add-data" ? openedModal?.initialTab : undefined- }- fromEmbeddingSetupGuide- />- <CreateDashboardModal- opened={openedModal?.type === "new-dashboard"}- onClose={closeModal}- />- <EmbeddingHubXrayPickerModal- opened={openedModal?.type === "xray-dashboard"}- onClose={closeModal}- />- {openedModal?.type === "user-strategy" && (- <PLUGIN_TENANTS.EditUserStrategyModal onClose={closeModal} />- )}+ {modals}</>);};++/** Keeps the caller's own query string intact -- a step's `to` may carry one. */+function withReturnTo(to: string, returnTo: string) {+ const [path, search] = to.split("?");+ const params = new URLSearchParams(search);+ params.set(RETURN_TO_SETUP_GUIDE_PARAM, returnTo);++ return `${path}?${params}`;+}diff --git a/frontend/src/metabase/embedding/embedding-hub/components/EmbeddingHub.unit.spec.tsx b/frontend/src/metabase/embedding/setup-guide/components/SetupGuide.unit.spec.tsxsimilarity index 96%rename from frontend/src/metabase/embedding/embedding-hub/components/EmbeddingHub.unit.spec.tsxrename to frontend/src/metabase/embedding/setup-guide/components/SetupGuide.unit.spec.tsxindex 649c8603e64..3c2c160f63a 100644--- a/frontend/src/metabase/embedding/embedding-hub/components/EmbeddingHub.unit.spec.tsx+++ b/frontend/src/metabase/embedding/setup-guide/components/SetupGuide.unit.spec.tsx@@ -25,7 +25,7 @@ import {createMockUser,} from "metabase-types/api/mocks";-import { EmbeddingHub } from "./EmbeddingHub";+import { SetupGuide } from "./SetupGuide";const setup = ({ isAdmin = true, checklist = {} } = {}) => {mockGetBoundingClientRect();@@ -73,18 +73,18 @@ const setup = ({ isAdmin = true, checklist = {} } = {}) => {query: { include_only_uploadable: true },response: { data: [], total: 0 },});- fetchMock.get("path:/api/ee/embedding-hub/checklist", {+ fetchMock.get("path:/api/embedding-hub/checklist", {checklist,"data-isolation-strategy": null,});- return renderWithProviders(<EmbeddingHub />, {+ return renderWithProviders(<SetupGuide />, {storeInitialState: state,withUndos: true,});};-describe("EmbeddingHub", () => {+describe("SetupGuide", () => {it("opens AddDataModal when 'Connect a database' is clicked", async () => {setup();diff --git a/frontend/src/metabase/embedding/embedding-hub/components/EmbeddingHubXrayPickerModal.tsx b/frontend/src/metabase/embedding/setup-guide/components/SetupGuideXrayPickerModal.tsxsimilarity index 92%rename from frontend/src/metabase/embedding/embedding-hub/components/EmbeddingHubXrayPickerModal.tsxrename to frontend/src/metabase/embedding/setup-guide/components/SetupGuideXrayPickerModal.tsxindex 3ec5f888879..596db56f70c 100644--- a/frontend/src/metabase/embedding/embedding-hub/components/EmbeddingHubXrayPickerModal.tsx+++ b/frontend/src/metabase/embedding/setup-guide/components/SetupGuideXrayPickerModal.tsx@@ -12,15 +12,15 @@ import { useDispatch } from "metabase/redux";import * as Urls from "metabase/urls";import type { TableId } from "metabase-types/api";-interface EmbeddingHubXrayPickerModalProps {+interface SetupGuideXrayPickerModalProps {opened: boolean;onClose: () => void;}-export const EmbeddingHubXrayPickerModal = ({+export const SetupGuideXrayPickerModal = ({opened,onClose,-}: EmbeddingHubXrayPickerModalProps) => {+}: SetupGuideXrayPickerModalProps) => {const dispatch = useDispatch();const [sendToast] = useToast();const [fetchXrayDashboard] = useLazyGetXrayDashboardQuery();@@ -46,7 +46,7 @@ export const EmbeddingHubXrayPickerModal = ({dispatch(Api.util.invalidateTags([...invalidateTags(null, ["collection"]),- listTag("embedding-hub-checklist"),+ listTag("setup-guide-checklist"),]),);diff --git a/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/ConnectionImpersonationStepContent.tsx b/frontend/src/metabase/embedding/setup-guide/components/SetupPermissionsAndTenantsPage/ConnectionImpersonationStepContent.tsxsimilarity index 100%rename from frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/ConnectionImpersonationStepContent.tsxrename to frontend/src/metabase/embedding/setup-guide/components/SetupPermissionsAndTenantsPage/ConnectionImpersonationStepContent.tsxdiff --git a/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/DataSegregationStrategyPicker.tsx b/frontend/src/metabase/embedding/setup-guide/components/SetupPermissionsAndTenantsPage/DataSegregationStrategyPicker.tsxsimilarity index 100%rename from frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/DataSegregationStrategyPicker.tsxrename to frontend/src/metabase/embedding/setup-guide/components/SetupPermissionsAndTenantsPage/DataSegregationStrategyPicker.tsxdiff --git a/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/DatabaseRoutingStepContent.tsx b/frontend/src/metabase/embedding/setup-guide/components/SetupPermissionsAndTenantsPage/DatabaseRoutingStepContent.tsxsimilarity index 100%rename from frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/DatabaseRoutingStepContent.tsxrename to frontend/src/metabase/embedding/setup-guide/components/SetupPermissionsAndTenantsPage/DatabaseRoutingStepContent.tsxdiff --git a/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/EnableTenantsStepContent.tsx b/frontend/src/metabase/embedding/setup-guide/components/SetupPermissionsAndTenantsPage/EnableTenantsStepContent.tsxsimilarity index 100%rename from frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/EnableTenantsStepContent.tsxrename to frontend/src/metabase/embedding/setup-guide/components/SetupPermissionsAndTenantsPage/EnableTenantsStepContent.tsxdiff --git a/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/MoveDashboardStepContent.tsx b/frontend/src/metabase/embedding/setup-guide/components/SetupPermissionsAndTenantsPage/MoveDashboardStepContent.tsxsimilarity index 100%rename from frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/MoveDashboardStepContent.tsxrename to frontend/src/metabase/embedding/setup-guide/components/SetupPermissionsAndTenantsPage/MoveDashboardStepContent.tsxdiff --git a/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/MoveDashboardStepContent.unit.spec.tsx b/frontend/src/metabase/embedding/setup-guide/components/SetupPermissionsAndTenantsPage/MoveDashboardStepContent.unit.spec.tsxsimilarity index 100%rename from frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/MoveDashboardStepContent.unit.spec.tsxrename to frontend/src/metabase/embedding/setup-guide/components/SetupPermissionsAndTenantsPage/MoveDashboardStepContent.unit.spec.tsxdiff --git a/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/RlsDataSelector/RlsDataSelector.module.css b/frontend/src/metabase/embedding/setup-guide/components/SetupPermissionsAndTenantsPage/RlsDataSelector/RlsDataSelector.module.csssimilarity index 100%rename from frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/RlsDataSelector/RlsDataSelector.module.cssrename to frontend/src/metabase/embedding/setup-guide/components/SetupPermissionsAndTenantsPage/RlsDataSelector/RlsDataSelector.module.cssdiff --git a/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/RlsDataSelector/RlsDataSelector.tsx b/frontend/src/metabase/embedding/setup-guide/components/SetupPermissionsAndTenantsPage/RlsDataSelector/RlsDataSelector.tsxsimilarity index 100%rename from frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/RlsDataSelector/RlsDataSelector.tsxrename to frontend/src/metabase/embedding/setup-guide/components/SetupPermissionsAndTenantsPage/RlsDataSelector/RlsDataSelector.tsxdiff --git a/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/RlsDataSelector/TableColumnCard.tsx b/frontend/src/metabase/embedding/setup-guide/components/SetupPermissionsAndTenantsPage/RlsDataSelector/TableColumnCard.tsxsimilarity index 100%rename from frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/RlsDataSelector/TableColumnCard.tsxrename to frontend/src/metabase/embedding/setup-guide/components/SetupPermissionsAndTenantsPage/RlsDataSelector/TableColumnCard.tsxdiff --git a/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/RlsDataSelector/index.ts b/frontend/src/metabase/embedding/setup-guide/components/SetupPermissionsAndTenantsPage/RlsDataSelector/index.tssimilarity index 100%rename from frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/RlsDataSelector/index.tsrename to frontend/src/metabase/embedding/setup-guide/components/SetupPermissionsAndTenantsPage/RlsDataSelector/index.tsdiff --git a/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/SetupPermissionsAndTenantsPage.module.css b/frontend/src/metabase/embedding/setup-guide/components/SetupPermissionsAndTenantsPage/SetupPermissionsAndTenantsPage.module.csssimilarity index 100%rename from frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/SetupPermissionsAndTenantsPage.module.cssrename to frontend/src/metabase/embedding/setup-guide/components/SetupPermissionsAndTenantsPage/SetupPermissionsAndTenantsPage.module.cssdiff --git a/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/SetupPermissionsAndTenantsPage.tsx b/frontend/src/metabase/embedding/setup-guide/components/SetupPermissionsAndTenantsPage/SetupPermissionsAndTenantsPage.tsxsimilarity index 95%rename from frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/SetupPermissionsAndTenantsPage.tsxrename to frontend/src/metabase/embedding/setup-guide/components/SetupPermissionsAndTenantsPage/SetupPermissionsAndTenantsPage.tsxindex d71beb6132f..348e07b45db 100644--- a/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/SetupPermissionsAndTenantsPage.tsx+++ b/frontend/src/metabase/embedding/setup-guide/components/SetupPermissionsAndTenantsPage/SetupPermissionsAndTenantsPage.tsx@@ -3,8 +3,8 @@ import { match } from "ts-pattern";import { t } from "ttag";import { Link } from "metabase/common/components/Link";-import { OnboardingStepper } from "metabase/embedding/embedding-hub/components/OnboardingStepper";-import type { OnboardingStepperHandle } from "metabase/embedding/embedding-hub/components/OnboardingStepper/types";+import { OnboardingStepper } from "metabase/embedding/setup-guide/components/OnboardingStepper";+import type { OnboardingStepperHandle } from "metabase/embedding/setup-guide/components/OnboardingStepper/types";import {type CreatedTenantData,PLUGIN_TENANTS,@@ -12,7 +12,8 @@ import {import { Group, Icon, Stack, Text, Title } from "metabase/ui";import type { DataSegregationStrategy } from "metabase-types/api";-import { useGetEmbeddingHubChecklistQuery } from "../../api/embedding-hub";+import { useGetSetupGuideChecklistQuery } from "../../api/setup-guide";+import { useSetupGuideReturnPath } from "../../hooks";import { ConnectionImpersonationStepContent } from "./ConnectionImpersonationStepContent";import { DataSegregationStrategyPicker } from "./DataSegregationStrategyPicker";@@ -30,12 +31,12 @@ import {import S from "./SetupPermissionsAndTenantsPage.module.css";import { useLastXrayDashboard } from "./hooks/use-xray-dashboards";import { createEmptyTenantDraft } from "./utils";-const SETUP_GUIDE_PATH = "/admin/embedding/setup-guide";export const SetupPermissionsAndTenantsPage = () => {+ const returnPath = useSetupGuideReturnPath();const stepperRef = useRef<OnboardingStepperHandle>(null);- const { data: checklistResponse } = useGetEmbeddingHubChecklistQuery();+ const { data: checklistResponse } = useGetSetupGuideChecklistQuery();const checklist = checklistResponse?.checklist;// The "Which data segregation strategy does your database use?"@@ -134,7 +135,7 @@ export const SetupPermissionsAndTenantsPage = () => {return (<Stack mx="auto" gap="sm" maw={680}>- <Link to={SETUP_GUIDE_PATH} className={S.backLink}>+ <Link to={returnPath} className={S.backLink}><Group gap="xxs"><Icon name="chevronleft" size={12} /><Text size="sm" c="text-secondary">{t`Back to the setup guide`}</Text>diff --git a/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/hooks/use-update-all-tenant-users-group-permissions.ts b/frontend/src/metabase/embedding/setup-guide/components/SetupPermissionsAndTenantsPage/hooks/use-update-all-tenant-users-group-permissions.tssimilarity index 99%rename from frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/hooks/use-update-all-tenant-users-group-permissions.tsrename to frontend/src/metabase/embedding/setup-guide/components/SetupPermissionsAndTenantsPage/hooks/use-update-all-tenant-users-group-permissions.tsindex 2cddabfb5fa..e31b430be70 100644--- a/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/hooks/use-update-all-tenant-users-group-permissions.ts+++ b/frontend/src/metabase/embedding/setup-guide/components/SetupPermissionsAndTenantsPage/hooks/use-update-all-tenant-users-group-permissions.ts@@ -143,7 +143,7 @@ export function useUpdateAllTenantUsersGroupPermissions(): UseUpdateAllTenantUse// so subsequent updates can find the newly created sandbox IDsdispatch(Api.util.invalidateTags([- listTag("embedding-hub-checklist"),+ listTag("setup-guide-checklist"),listTag("group-table-access-policy"),]),);diff --git a/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/hooks/use-upsert-group-table-access-policies.ts b/frontend/src/metabase/embedding/setup-guide/components/SetupPermissionsAndTenantsPage/hooks/use-upsert-group-table-access-policies.tssimilarity index 100%rename from frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/hooks/use-upsert-group-table-access-policies.tsrename to frontend/src/metabase/embedding/setup-guide/components/SetupPermissionsAndTenantsPage/hooks/use-upsert-group-table-access-policies.tsdiff --git a/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/hooks/use-xray-dashboards.ts b/frontend/src/metabase/embedding/setup-guide/components/SetupPermissionsAndTenantsPage/hooks/use-xray-dashboards.tssimilarity index 96%rename from frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/hooks/use-xray-dashboards.tsrename to frontend/src/metabase/embedding/setup-guide/components/SetupPermissionsAndTenantsPage/hooks/use-xray-dashboards.tsindex f490b647cfa..eeca062d52c 100644--- a/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/hooks/use-xray-dashboards.ts+++ b/frontend/src/metabase/embedding/setup-guide/components/SetupPermissionsAndTenantsPage/hooks/use-xray-dashboards.ts@@ -78,7 +78,7 @@ export const useMoveXrayDashboardToSharedCollection = () => {collection_id: targetCollectionId,}).unwrap();- dispatch(Api.util.invalidateTags([listTag("embedding-hub-checklist")]));+ dispatch(Api.util.invalidateTags([listTag("setup-guide-checklist")]));},[updateDashboard, dispatch],);@@ -121,7 +121,7 @@ export const useCreateSampleDashboardInSharedCollection = () => {dashcards: [dashcard as DashboardCard],}).unwrap();- dispatch(Api.util.invalidateTags([listTag("embedding-hub-checklist")]));+ dispatch(Api.util.invalidateTags([listTag("setup-guide-checklist")]));} finally {setIsCreating(false);}diff --git a/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/index.ts b/frontend/src/metabase/embedding/setup-guide/components/SetupPermissionsAndTenantsPage/index.tssimilarity index 100%rename from frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/index.tsrename to frontend/src/metabase/embedding/setup-guide/components/SetupPermissionsAndTenantsPage/index.tsdiff --git a/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/utils.ts b/frontend/src/metabase/embedding/setup-guide/components/SetupPermissionsAndTenantsPage/utils.tssimilarity index 100%rename from frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/utils.tsrename to frontend/src/metabase/embedding/setup-guide/components/SetupPermissionsAndTenantsPage/utils.tsdiff --git a/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/utils/permission-utils.ts b/frontend/src/metabase/embedding/setup-guide/components/SetupPermissionsAndTenantsPage/utils/permission-utils.tssimilarity index 100%rename from frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/utils/permission-utils.tsrename to frontend/src/metabase/embedding/setup-guide/components/SetupPermissionsAndTenantsPage/utils/permission-utils.tsdiff --git a/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/utils/permission-utils.unit.spec.ts b/frontend/src/metabase/embedding/setup-guide/components/SetupPermissionsAndTenantsPage/utils/permission-utils.unit.spec.tssimilarity index 100%rename from frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/utils/permission-utils.unit.spec.tsrename to frontend/src/metabase/embedding/setup-guide/components/SetupPermissionsAndTenantsPage/utils/permission-utils.unit.spec.tsdiff --git a/frontend/src/metabase/embedding/embedding-hub/components/SetupSsoPage/AddEndpointStep.tsx b/frontend/src/metabase/embedding/setup-guide/components/SetupSsoPage/AddEndpointStep.tsxsimilarity index 100%rename from frontend/src/metabase/embedding/embedding-hub/components/SetupSsoPage/AddEndpointStep.tsxrename to frontend/src/metabase/embedding/setup-guide/components/SetupSsoPage/AddEndpointStep.tsxdiff --git a/frontend/src/metabase/embedding/embedding-hub/components/SetupSsoPage/SetupJwtStep.tsx b/frontend/src/metabase/embedding/setup-guide/components/SetupSsoPage/SetupJwtStep.tsxsimilarity index 100%rename from frontend/src/metabase/embedding/embedding-hub/components/SetupSsoPage/SetupJwtStep.tsxrename to frontend/src/metabase/embedding/setup-guide/components/SetupSsoPage/SetupJwtStep.tsxdiff --git a/frontend/src/metabase/embedding/embedding-hub/components/SetupSsoPage/SetupSsoPage.module.css b/frontend/src/metabase/embedding/setup-guide/components/SetupSsoPage/SetupSsoPage.module.csssimilarity index 100%rename from frontend/src/metabase/embedding/embedding-hub/components/SetupSsoPage/SetupSsoPage.module.cssrename to frontend/src/metabase/embedding/setup-guide/components/SetupSsoPage/SetupSsoPage.module.cssdiff --git a/frontend/src/metabase/embedding/embedding-hub/components/SetupSsoPage/SetupSsoPage.tsx b/frontend/src/metabase/embedding/setup-guide/components/SetupSsoPage/SetupSsoPage.tsxsimilarity index 86%rename from frontend/src/metabase/embedding/embedding-hub/components/SetupSsoPage/SetupSsoPage.tsxrename to frontend/src/metabase/embedding/setup-guide/components/SetupSsoPage/SetupSsoPage.tsxindex c658fdf83ca..d4f5a031255 100644--- a/frontend/src/metabase/embedding/embedding-hub/components/SetupSsoPage/SetupSsoPage.tsx+++ b/frontend/src/metabase/embedding/setup-guide/components/SetupSsoPage/SetupSsoPage.tsx@@ -2,23 +2,23 @@ import { useMemo, useRef, useState } from "react";import { t } from "ttag";import { Link } from "metabase/common/components/Link";-import { OnboardingStepper } from "metabase/embedding/embedding-hub/components/OnboardingStepper";-import type { OnboardingStepperHandle } from "metabase/embedding/embedding-hub/components/OnboardingStepper/types";+import { OnboardingStepper } from "metabase/embedding/setup-guide/components/OnboardingStepper";+import type { OnboardingStepperHandle } from "metabase/embedding/setup-guide/components/OnboardingStepper/types";import { Group, Icon, Stack, Text, Title } from "metabase/ui";-import { useGetEmbeddingHubChecklistQuery } from "../../api/embedding-hub";+import { useGetSetupGuideChecklistQuery } from "../../api/setup-guide";+import { useSetupGuideReturnPath } from "../../hooks";import { AddEndpointStep } from "./AddEndpointStep";import { SetupJwtStep } from "./SetupJwtStep";import S from "./SetupSsoPage.module.css";import { TestJwtStep } from "./TestJwtStep";-const SETUP_GUIDE_PATH = "/admin/embedding/setup-guide";-export const SetupSsoPage = () => {+ const returnPath = useSetupGuideReturnPath();const stepperRef = useRef<OnboardingStepperHandle>(null);- const { data: checklistResponse } = useGetEmbeddingHubChecklistQuery();+ const { data: checklistResponse } = useGetSetupGuideChecklistQuery();const checklist = checklistResponse?.checklist;// Prefer in-session success state; fall back to backend detection on reload.@@ -54,7 +54,7 @@ export const SetupSsoPage = () => {return (<Stack mx="auto" gap="sm" maw={680}>- <Link to={SETUP_GUIDE_PATH} className={S.backLink}>+ <Link to={returnPath} className={S.backLink}><Group gap="xxs"><Icon name="chevronleft" size={12} /><Text size="sm" c="text-secondary">{t`Back to the setup guide`}</Text>diff --git a/frontend/src/metabase/embedding/embedding-hub/components/SetupSsoPage/SetupSsoPage.unit.spec.tsx b/frontend/src/metabase/embedding/setup-guide/components/SetupSsoPage/SetupSsoPage.unit.spec.tsxsimilarity index 90%rename from frontend/src/metabase/embedding/embedding-hub/components/SetupSsoPage/SetupSsoPage.unit.spec.tsxrename to frontend/src/metabase/embedding/setup-guide/components/SetupSsoPage/SetupSsoPage.unit.spec.tsxindex 6709e488d90..85f938e4cb6 100644--- a/frontend/src/metabase/embedding/embedding-hub/components/SetupSsoPage/SetupSsoPage.unit.spec.tsx+++ b/frontend/src/metabase/embedding/setup-guide/components/SetupSsoPage/SetupSsoPage.unit.spec.tsx@@ -11,13 +11,15 @@ import { renderWithProviders, screen } from "__support__/ui";import { Route } from "metabase/router";import { createMockSettings } from "metabase-types/api/mocks";-import type { EmbeddingHubChecklist } from "../../api/embedding-hub";+import type { SetupGuideChecklist } from "../../api/setup-guide";import { SetupSsoPage } from "./SetupSsoPage";-const defaultChecklist: EmbeddingHubChecklist = {+const defaultChecklist: SetupGuideChecklist = {"add-data": false,+ "configure-ai": false,"configure-row-column-security": false,+ "create-custom-theme": false,"create-dashboard": false,"create-tenants": false,"create-test-embed": false,@@ -33,14 +35,14 @@ const defaultChecklist: EmbeddingHubChecklist = {const setup = ({checklist = {},}: {- checklist?: Partial<EmbeddingHubChecklist>;+ checklist?: Partial<SetupGuideChecklist>;} = {}) => {const settings = createMockSettings();setupPropertiesEndpoints(settings);setupUpdateSettingsEndpoint();- fetchMock.get("path:/api/ee/embedding-hub/checklist", {+ fetchMock.get("path:/api/embedding-hub/checklist", {checklist: { ...defaultChecklist, ...checklist },"data-isolation-strategy": null,});@@ -49,16 +51,13 @@ const setup = ({});return renderWithProviders(- <Route- path="/admin/embedding/setup-guide/sso"- element={<SetupSsoPage />}- />,+ <Route path="/embedding/get-started/sso" element={<SetupSsoPage />} />,{storeInitialState: createMockState({settings: createMockSettingsState(settings),}),withRouter: true,- initialRoute: "/admin/embedding/setup-guide/sso",+ initialRoute: "/embedding/get-started/sso",},);};diff --git a/frontend/src/metabase/embedding/embedding-hub/components/SetupSsoPage/TestJwtStep.tsx b/frontend/src/metabase/embedding/setup-guide/components/SetupSsoPage/TestJwtStep.tsxsimilarity index 87%rename from frontend/src/metabase/embedding/embedding-hub/components/SetupSsoPage/TestJwtStep.tsxrename to frontend/src/metabase/embedding/setup-guide/components/SetupSsoPage/TestJwtStep.tsxindex 4910717ff9a..034594b2f04 100644--- a/frontend/src/metabase/embedding/embedding-hub/components/SetupSsoPage/TestJwtStep.tsx+++ b/frontend/src/metabase/embedding/setup-guide/components/SetupSsoPage/TestJwtStep.tsx@@ -5,13 +5,15 @@ import { t } from "ttag";import { Link } from "metabase/common/components/Link";import { useToast } from "metabase/common/hooks";-import { useHelpUrl } from "metabase/embedding/embedding-hub/hooks";+import {+ useHelpUrl,+ useSetupGuideReturnPath,+} from "metabase/embedding/setup-guide/hooks";import { useUpdateSettingsMutation } from "metabase/settings";import { Button, Group, Stack, Text, Title } from "metabase/ui";-const SETUP_GUIDE_PATH = "/admin/embedding/setup-guide";-export const TestJwtStep = () => {+ const returnPath = useSetupGuideReturnPath();const [sendToast] = useToast();const [updateSettings] = useUpdateSettingsMutation();@@ -50,7 +52,7 @@ export const TestJwtStep = () => {<Buttoncomponent={Link}- to={SETUP_GUIDE_PATH}+ to={returnPath}variant="filled"onClick={onDone}>@@ -63,6 +65,7 @@ export const TestJwtStep = () => {const SsoTroubleshootingView = ({ onDone }: { onDone: () => void }) => {const helpUrl = useHelpUrl();+ const returnPath = useSetupGuideReturnPath();return (<Stack gap="xl">@@ -77,7 +80,7 @@ const SsoTroubleshootingView = ({ onDone }: { onDone: () => void }) => {<Text fw={700} mb="xxs">{t`404 error after SSO sign-in`}</Text><Text size="md" c="text-secondary" lh="lg">- {t`If after clicking on "Sign in with SSO", the browser returns a 404 error, make sure the value of the JWT SSO URI in admin settings / auth / JWT is pointing to your endpoint and your endpoint is up and running and available.`}+ {t`If after clicking on "Sign in with SSO", the browser returns a 404 error, make sure the value of the JWT SSO URI in the embedding hub's Authentication tab is pointing to your endpoint and your endpoint is up and running and available.`}</Text></div>@@ -107,7 +110,7 @@ const SsoTroubleshootingView = ({ onDone }: { onDone: () => void }) => {>{t`User provisioning disabled for JWT SSO`}</Text><Text size="md" c="text-secondary" lh="lg">- {t`If after being redirected from your app to Metabase, you see an error message "Sorry, but you'll need a $SITENAME account to view this page, contact your administrator. User provisioning is turned off for JWT SSO in admin settings/authentication. Either turn this feature on to have users be provisioned if they don't exist yet, or ensure users exist before signing them in via JWT SSO.`}+ {t`If after being redirected from your app to Metabase, you see an error message "Sorry, but you'll need a $SITENAME account to view this page, contact your administrator. User provisioning is turned off for JWT SSO in the embedding hub's Authentication tab. Either turn this feature on to have users be provisioned if they don't exist yet, or ensure users exist before signing them in via JWT SSO.`}</Text></div></Stack>@@ -119,7 +122,7 @@ const SsoTroubleshootingView = ({ onDone }: { onDone: () => void }) => {<Buttoncomponent={Link}- to={SETUP_GUIDE_PATH}+ to={returnPath}variant="filled"onClick={onDone}>diff --git a/frontend/src/metabase/embedding/embedding-hub/components/SetupSsoPage/index.ts b/frontend/src/metabase/embedding/setup-guide/components/SetupSsoPage/index.tssimilarity index 100%rename from frontend/src/metabase/embedding/embedding-hub/components/SetupSsoPage/index.tsrename to frontend/src/metabase/embedding/setup-guide/components/SetupSsoPage/index.tsdiff --git a/frontend/src/metabase/embedding/embedding-hub/components/StepperWithCards/StepperWithCards.module.css b/frontend/src/metabase/embedding/setup-guide/components/StepperWithCards/StepperWithCards.module.csssimilarity index 100%rename from frontend/src/metabase/embedding/embedding-hub/components/StepperWithCards/StepperWithCards.module.cssrename to frontend/src/metabase/embedding/setup-guide/components/StepperWithCards/StepperWithCards.module.cssdiff --git a/frontend/src/metabase/embedding/embedding-hub/components/StepperWithCards/StepperWithCards.tsx b/frontend/src/metabase/embedding/setup-guide/components/StepperWithCards/StepperWithCards.tsxsimilarity index 100%rename from frontend/src/metabase/embedding/embedding-hub/components/StepperWithCards/StepperWithCards.tsxrename to frontend/src/metabase/embedding/setup-guide/components/StepperWithCards/StepperWithCards.tsxdiff --git a/frontend/src/metabase/embedding/embedding-hub/components/StepperWithCards/StepperWithCards.unit.spec.tsx b/frontend/src/metabase/embedding/setup-guide/components/StepperWithCards/StepperWithCards.unit.spec.tsxsimilarity index 100%rename from frontend/src/metabase/embedding/embedding-hub/components/StepperWithCards/StepperWithCards.unit.spec.tsxrename to frontend/src/metabase/embedding/setup-guide/components/StepperWithCards/StepperWithCards.unit.spec.tsxdiff --git a/frontend/src/metabase/embedding/embedding-hub/components/index.ts b/frontend/src/metabase/embedding/setup-guide/components/index.tssimilarity index 73%rename from frontend/src/metabase/embedding/embedding-hub/components/index.tsrename to frontend/src/metabase/embedding/setup-guide/components/index.tsindex b912384cc2e..64dc7c54d6b 100644--- a/frontend/src/metabase/embedding/embedding-hub/components/index.ts+++ b/frontend/src/metabase/embedding/setup-guide/components/index.ts@@ -1,3 +1,3 @@-export { EmbeddingHub } from "./EmbeddingHub";+export { SetupGuide } from "./SetupGuide";export { SetupPermissionsAndTenantsPage } from "./SetupPermissionsAndTenantsPage";export { SetupSsoPage } from "./SetupSsoPage";diff --git a/frontend/src/metabase/embedding/setup-guide/hooks/index.ts b/frontend/src/metabase/embedding/setup-guide/hooks/index.tsnew file mode 100644index 00000000000..b4d1b8cea60--- /dev/null+++ b/frontend/src/metabase/embedding/setup-guide/hooks/index.ts@@ -0,0 +1,5 @@+export { useCompletedSetupGuideSteps } from "./use-completed-setup-guide-steps";+export { useGetSetupGuideSteps } from "./use-get-setup-guide-steps";+export { useSetupGuideModals } from "./use-setup-guide-modals";+export { useSetupGuideReturnPath } from "./use-setup-guide-return-path";+export { useHelpUrl } from "./use-help-url";diff --git a/frontend/src/metabase/embedding/embedding-hub/hooks/use-completed-embedding-hub-steps.ts b/frontend/src/metabase/embedding/setup-guide/hooks/use-completed-setup-guide-steps.tssimilarity index 63%rename from frontend/src/metabase/embedding/embedding-hub/hooks/use-completed-embedding-hub-steps.tsrename to frontend/src/metabase/embedding/setup-guide/hooks/use-completed-setup-guide-steps.tsindex fe3791be179..8963736ba79 100644--- a/frontend/src/metabase/embedding/embedding-hub/hooks/use-completed-embedding-hub-steps.ts+++ b/frontend/src/metabase/embedding/setup-guide/hooks/use-completed-setup-guide-steps.ts@@ -1,19 +1,21 @@import { useMemo } from "react";-import { useGetEmbeddingHubChecklistQuery } from "../api/embedding-hub";-import type { EmbeddingHubStepId } from "../types";+import { useGetSetupGuideChecklistQuery } from "../api/setup-guide";+import type { SetupGuideStepId } from "../types";/**- * Embedding Hub completion steps should be derived by the instance state at the time, or tracked manually in instance settings for some of them.+ * Setup guide completion steps should be derived by the instance state at the time, or tracked manually in instance settings for some of them.*/-export const useCompletedEmbeddingHubSteps = (): {- data: Record<EmbeddingHubStepId, boolean>;+export const useCompletedSetupGuideSteps = (): {+ data: Record<SetupGuideStepId, boolean>;isLoading: boolean;} => {- const { data: checklistResponse, isLoading } =- useGetEmbeddingHubChecklistQuery(undefined, {+ const { data: checklistResponse, isLoading } = useGetSetupGuideChecklistQuery(+ undefined,+ {refetchOnMountOrArgChange: true,- });+ },+ );const data = useMemo(() => {const checklist = checklistResponse?.checklist;@@ -29,6 +31,10 @@ export const useCompletedEmbeddingHubSteps = (): {"embed-production": false,"data-permissions-and-enable-tenants": false,+ // embedding hub-only steps+ "create-custom-theme": false,+ "configure-ai": false,+// "configure data permissions and enable tenants" sub-checklist"create-tenants": false,"enable-tenants": false,@@ -39,7 +45,7 @@ export const useCompletedEmbeddingHubSteps = (): {};}- // For the main embedding hub, the SSO step is only complete if both+ // For the main setup guide, the SSO step is only complete if both// SSO is configured AND the user has manually acknowledged it worksreturn {...checklist,diff --git a/frontend/src/metabase/embedding/embedding-hub/hooks/use-get-embedding-hub-steps.ts b/frontend/src/metabase/embedding/setup-guide/hooks/use-get-setup-guide-steps.tssimilarity index 85%rename from frontend/src/metabase/embedding/embedding-hub/hooks/use-get-embedding-hub-steps.tsrename to frontend/src/metabase/embedding/setup-guide/hooks/use-get-setup-guide-steps.tsindex fe5bacb51f3..87a7fd6e8bb 100644--- a/frontend/src/metabase/embedding/embedding-hub/hooks/use-get-embedding-hub-steps.ts+++ b/frontend/src/metabase/embedding/setup-guide/hooks/use-get-setup-guide-steps.ts@@ -8,9 +8,14 @@ import {import { useDispatch } from "metabase/redux";import { setOpenModalWithProps } from "metabase/redux/ui";-import type { EmbeddingHubStep } from "../types";+import type { SetupGuideStep } from "../types";-export const useGetEmbeddingHubSteps = (): EmbeddingHubStep[] => {+const SETUP_GUIDE_URLS = {+ permissions: "/embedding/get-started/permissions",+ sso: "/embedding/get-started/sso",+};++export const useGetSetupGuideSteps = (): SetupGuideStep[] => {const dispatch = useDispatch();const openEmbedModal = useCallback(@@ -28,7 +33,7 @@ export const useGetEmbeddingHubSteps = (): EmbeddingHubStep[] => {return useMemo(() => {const isTenantsFeatureAvailable = PLUGIN_TENANTS.isEnabled;- const TEST_EMBED: EmbeddingHubStep = {+ const TEST_EMBED: SetupGuideStep = {id: "create-test-embed",title: t`Create embed`,actions: [@@ -43,7 +48,7 @@ export const useGetEmbeddingHubSteps = (): EmbeddingHubStep[] => {],};- const ADD_DATA: EmbeddingHubStep = {+ const ADD_DATA: SetupGuideStep = {id: "add-data",title: t`Add your data`,actions: [@@ -56,7 +61,7 @@ export const useGetEmbeddingHubSteps = (): EmbeddingHubStep[] => {],};- const CREATE_DASHBOARD: EmbeddingHubStep = {+ const CREATE_DASHBOARD: SetupGuideStep = {id: "create-dashboard",title: t`Prepare data`,actions: [@@ -69,35 +74,35 @@ export const useGetEmbeddingHubSteps = (): EmbeddingHubStep[] => {],};- const DATA_PERMISSIONS_AND_ENABLE_TENANTS: EmbeddingHubStep = {+ const DATA_PERMISSIONS_AND_ENABLE_TENANTS: SetupGuideStep = {id: "data-permissions-and-enable-tenants",title: t`Pick a strategy for users and permissions`,actions: [{title: t`Configure data permissions and enable tenants`,description: t`Set granular permissions for multi-tenancy to control data access. Share dashboards, questions, and models with external users and allow them to create content, while restricting access to internal or other tenants' data.`,- to: "/admin/embedding/setup-guide/permissions",+ to: SETUP_GUIDE_URLS.permissions,variant: "outline",stepId: "data-permissions-and-enable-tenants",},],};- const SSO_CONFIGURED: EmbeddingHubStep = {+ const SSO_CONFIGURED: SetupGuideStep = {id: "sso-configured",title: t`Set up authentication`,actions: [{title: t`Configure SSO`,description: t`Configure JWT authentication to ensure only authorized users can access your embeds.`,- to: "/admin/embedding/setup-guide/sso",+ to: SETUP_GUIDE_URLS.sso,variant: "outline",stepId: "sso-configured",},],};- const EMBED_PRODUCTION: EmbeddingHubStep = {+ const EMBED_PRODUCTION: SetupGuideStep = {id: "embed-production",title: t`Deployment`,actions: [diff --git a/frontend/src/metabase/embedding/embedding-hub/hooks/use-help-url.ts b/frontend/src/metabase/embedding/setup-guide/hooks/use-help-url.tssimilarity index 100%rename from frontend/src/metabase/embedding/embedding-hub/hooks/use-help-url.tsrename to frontend/src/metabase/embedding/setup-guide/hooks/use-help-url.tsdiff --git a/frontend/src/metabase/embedding/setup-guide/hooks/use-setup-guide-modals.tsx b/frontend/src/metabase/embedding/setup-guide/hooks/use-setup-guide-modals.tsxnew file mode 100644index 00000000000..f738e272320--- /dev/null+++ b/frontend/src/metabase/embedding/setup-guide/hooks/use-setup-guide-modals.tsx@@ -0,0 +1,55 @@+import { useState } from "react";++import { CreateDashboardModal } from "metabase/common/CreateDashboard/CreateDashboardModal";+import { AddDataModal } from "metabase/nav/containers/MainNavbar/MainNavbarContainer/AddDataModal";+import { PLUGIN_TENANTS } from "metabase/plugins";++import { SetupGuideXrayPickerModal } from "../components/SetupGuideXrayPickerModal";+import type { SetupGuideModalToTrigger } from "../types/setup-guide";++// Fallback for callers that do not say where they are.+const DEFAULT_SETUP_GUIDE_PATH = "/embedding/get-started";++/**+ * The checklist's modals and the state that opens them, so the stepper on the+ * home page and the card grid in the embedding hub drive the same set rather+ * than keeping two copies in sync.+ *+ * @param returnTo path of the guide that is rendering these modals. Flows that+ * leave the guide -- connecting a database, for one -- carry it so they can+ * return to the host the user actually started from.+ */+export function useSetupGuideModals({+ returnTo = DEFAULT_SETUP_GUIDE_PATH,+}: { returnTo?: string } = {}) {+ const [openedModal, setOpenedModal] =+ useState<SetupGuideModalToTrigger | null>(null);++ const closeModal = () => setOpenedModal(null);++ const modals = (+ <>+ <AddDataModal+ opened={openedModal?.type === "add-data"}+ onClose={closeModal}+ initialTab={+ openedModal?.type === "add-data" ? openedModal.initialTab : undefined+ }+ returnToSetupGuide={returnTo}+ />+ <CreateDashboardModal+ opened={openedModal?.type === "new-dashboard"}+ onClose={closeModal}+ />+ <SetupGuideXrayPickerModal+ opened={openedModal?.type === "xray-dashboard"}+ onClose={closeModal}+ />+ {openedModal?.type === "user-strategy" && (+ <PLUGIN_TENANTS.EditUserStrategyModal onClose={closeModal} />+ )}+ </>+ );++ return { setOpenedModal, modals };+}diff --git a/frontend/src/metabase/embedding/setup-guide/hooks/use-setup-guide-return-path.ts b/frontend/src/metabase/embedding/setup-guide/hooks/use-setup-guide-return-path.tsnew file mode 100644index 00000000000..c0809e5f75b--- /dev/null+++ b/frontend/src/metabase/embedding/setup-guide/hooks/use-setup-guide-return-path.ts@@ -0,0 +1,23 @@+import { RETURN_TO_SETUP_GUIDE_PARAM } from "metabase/embedding/constants";+import { useSearchParams } from "metabase/router";+import { isSameOrSiteUrlOrigin } from "metabase/utils/dom";++const DEFAULT_SETUP_GUIDE_PATH = "/embedding/get-started";++/**+ * Where a setup wizard's back link should return to. The guide has more than+ * one host, so it names the one it is rendered in; the hub is the fallback.+ *+ * The value comes from the URL, so it is checked the way `getRedirectUrl` in+ * route-guards/redirect-target.ts checks the login `redirect` param: anything+ * off-origin would otherwise render as a working external link on an admin+ * page, and an empty value as a dead one.+ */+export function useSetupGuideReturnPath(): string {+ const [searchParams] = useSearchParams();+ const returnPath = searchParams.get(RETURN_TO_SETUP_GUIDE_PARAM);++ return returnPath && isSameOrSiteUrlOrigin(returnPath)+ ? returnPath+ : DEFAULT_SETUP_GUIDE_PATH;+}diff --git a/frontend/src/metabase/embedding/setup-guide/hooks/use-setup-guide-return-path.unit.spec.tsx b/frontend/src/metabase/embedding/setup-guide/hooks/use-setup-guide-return-path.unit.spec.tsxnew file mode 100644index 00000000000..9e84d8ff471--- /dev/null+++ b/frontend/src/metabase/embedding/setup-guide/hooks/use-setup-guide-return-path.unit.spec.tsx@@ -0,0 +1,55 @@+import { renderWithProviders, screen } from "__support__/ui";+import { Route } from "metabase/router";++import { useSetupGuideReturnPath } from "./use-setup-guide-return-path";++function TestComponent() {+ return <div data-testid="return-path">{useSetupGuideReturnPath()}</div>;+}++const setup = (search: string) => {+ renderWithProviders(+ <Route path="embedding/get-started/sso" element={<TestComponent />} />,+ { withRouter: true, initialRoute: `/embedding/get-started/sso${search}` },+ );+};++describe("useSetupGuideReturnPath", () => {+ it("returns the host named by the query parameter", () => {+ setup("?returnToEmbeddingSetupGuide=%2Fsetup-guide");++ expect(screen.getByTestId("return-path")).toHaveTextContent("/setup-guide");+ });++ it("falls back to the hub when the parameter is absent", () => {+ setup("");++ expect(screen.getByTestId("return-path")).toHaveTextContent(+ "/embedding/get-started",+ );+ });++ it("falls back to the hub when the parameter is empty", () => {+ setup("?returnToEmbeddingSetupGuide=");++ expect(screen.getByTestId("return-path")).toHaveTextContent(+ "/embedding/get-started",+ );+ });++ it("falls back to the hub for an off-origin url", () => {+ setup("?returnToEmbeddingSetupGuide=https%3A%2F%2Fevil.test");++ expect(screen.getByTestId("return-path")).toHaveTextContent(+ "/embedding/get-started",+ );+ });++ it("falls back to the hub for a protocol-relative url", () => {+ setup("?returnToEmbeddingSetupGuide=%2F%2Fevil.test");++ expect(screen.getByTestId("return-path")).toHaveTextContent(+ "/embedding/get-started",+ );+ });+});diff --git a/frontend/src/metabase/embedding/embedding-hub/index.ts b/frontend/src/metabase/embedding/setup-guide/index.tssimilarity index 100%rename from frontend/src/metabase/embedding/embedding-hub/index.tsrename to frontend/src/metabase/embedding/setup-guide/index.tsdiff --git a/frontend/src/metabase/embedding/setup-guide/types/index.ts b/frontend/src/metabase/embedding/setup-guide/types/index.tsnew file mode 100644index 00000000000..d8dc7643b7d--- /dev/null+++ b/frontend/src/metabase/embedding/setup-guide/types/index.ts@@ -0,0 +1,6 @@+export type {+ SetupGuideStep,+ SetupGuideStepId,+ SetupGuideAction,+ SetupGuideModalToTrigger,+} from "./setup-guide";diff --git a/frontend/src/metabase/embedding/embedding-hub/types/embedding-checklist.ts b/frontend/src/metabase/embedding/setup-guide/types/setup-guide.tssimilarity index 64%rename from frontend/src/metabase/embedding/embedding-hub/types/embedding-checklist.tsrename to frontend/src/metabase/embedding/setup-guide/types/setup-guide.tsindex 9b6521af21b..432b96240cc 100644--- a/frontend/src/metabase/embedding/embedding-hub/types/embedding-checklist.ts+++ b/frontend/src/metabase/embedding/setup-guide/types/setup-guide.ts@@ -1,29 +1,33 @@import type { AddDataTab } from "metabase/nav/containers/MainNavbar/MainNavbarContainer/AddDataModal/utils";-export type EmbeddingHubStepId =+export type SetupGuideStepId =| "create-test-embed"| "add-data"| "create-dashboard"| "configure-row-column-security"| "sso-configured"| "embed-production"- | "data-permissions-and-enable-tenants";--export interface EmbeddingHubStep {- id: EmbeddingHubStepId;+ | "data-permissions-and-enable-tenants"+ // Embedding hub-only steps. The home-page stepper never renders these; it maps its own+ // step list and simply never looks them up.+ | "create-custom-theme"+ | "configure-ai";++export interface SetupGuideStep {+ id: SetupGuideStepId;title: string;- actions: EmbeddingHubAction[];+ actions: SetupGuideAction[];}-export type EmbeddingHubModalToTrigger =+export type SetupGuideModalToTrigger =| { type: "add-data"; initialTab: AddDataTab }| { type: "new-dashboard" }| { type: "xray-dashboard" }| { type: "user-strategy" };-export interface EmbeddingHubAction {- stepId?: EmbeddingHubStepId;+export interface SetupGuideAction {+ stepId?: SetupGuideStepId;title: string;description: string;@@ -46,7 +50,7 @@ export interface EmbeddingHubAction {variant?: "outline" | "subtle" | "filled";/** Which modal to trigger? */- modal?: EmbeddingHubModalToTrigger;+ modal?: SetupGuideModalToTrigger;optional?: boolean;}diff --git a/frontend/src/metabase/admin/embedding/components/ThemeEditor/ColorSwatchCard.tsx b/frontend/src/metabase/embedding/themes/components/ThemeEditor/ColorSwatchCard.tsxsimilarity index 100%rename from frontend/src/metabase/admin/embedding/components/ThemeEditor/ColorSwatchCard.tsxrename to frontend/src/metabase/embedding/themes/components/ThemeEditor/ColorSwatchCard.tsxdiff --git a/frontend/src/metabase/admin/embedding/components/ThemeEditor/EditorPanel.tsx b/frontend/src/metabase/embedding/themes/components/ThemeEditor/EditorPanel.tsxsimilarity index 98%rename from frontend/src/metabase/admin/embedding/components/ThemeEditor/EditorPanel.tsxrename to frontend/src/metabase/embedding/themes/components/ThemeEditor/EditorPanel.tsxindex 22c895bda38..5f5d49c0922 100644--- a/frontend/src/metabase/admin/embedding/components/ThemeEditor/EditorPanel.tsx+++ b/frontend/src/metabase/embedding/themes/components/ThemeEditor/EditorPanel.tsx@@ -1,7 +1,7 @@import { useMemo, useState } from "react";import { t } from "ttag";-import type { EmbeddingThemeEditorResult } from "metabase/admin/embedding/hooks/use-embedding-theme-editor";+import type { EmbeddingThemeEditorResult } from "metabase/embedding/themes/hooks/use-embedding-theme-editor";import {Box,Button,diff --git a/frontend/src/metabase/admin/embedding/components/ThemeEditor/EmbeddingThemeEditorApp.tsx b/frontend/src/metabase/embedding/themes/components/ThemeEditor/EmbeddingThemeEditorApp.tsxsimilarity index 81%rename from frontend/src/metabase/admin/embedding/components/ThemeEditor/EmbeddingThemeEditorApp.tsxrename to frontend/src/metabase/embedding/themes/components/ThemeEditor/EmbeddingThemeEditorApp.tsxindex 175738febe8..4c7762a7b00 100644--- a/frontend/src/metabase/admin/embedding/components/ThemeEditor/EmbeddingThemeEditorApp.tsx+++ b/frontend/src/metabase/embedding/themes/components/ThemeEditor/EmbeddingThemeEditorApp.tsx@@ -1,17 +1,27 @@import { useRef } from "react";-import { useDeleteThemeFlow } from "metabase/admin/embedding/hooks";-import { useEmbeddingThemeEditor } from "metabase/admin/embedding/hooks/use-embedding-theme-editor";import { NotFound } from "metabase/common/components/ErrorPages";import { LeaveRouteConfirmModal } from "metabase/common/components/LeaveConfirmModal/LeaveRouteConfirmModal";import { useBeforeUnload } from "metabase/common/hooks/use-before-unload";+import { useDeleteThemeFlow } from "metabase/embedding/themes/hooks";+import { useEmbeddingThemeEditor } from "metabase/embedding/themes/hooks/use-embedding-theme-editor";import { useNavigate, useParams } from "metabase/router";import { Flex, Loader, Stack } from "metabase/ui";import { EditorPanel } from "./EditorPanel";import { PreviewPanel } from "./PreviewPanel";-export function EmbeddingThemeEditorApp() {+type EmbeddingThemeEditorAppProps = {+ /** Where the theme listing lives, so the editor knows where to return to. */+ basePath: string;+ /** Overrides `basePath` on save or delete, to return to the page that linked here. */+ returnPath?: string;+};++export function EmbeddingThemeEditorApp({+ basePath,+ returnPath,+}: EmbeddingThemeEditorAppProps) {const { themeId: themeIdParam } = useParams<{ themeId: string }>();const themeId =themeIdParam === "new" ? "new" : parseInt(themeIdParam ?? "", 10);@@ -22,7 +32,7 @@ export function EmbeddingThemeEditorApp() {const isSavingRef = useRef(false);const goToThemeList = () => {- navigate("/admin/embedding/themes");+ navigate(returnPath ?? basePath);};const {diff --git a/frontend/src/metabase/admin/embedding/components/ThemeEditor/EnableEmbeddingPrompt.tsx b/frontend/src/metabase/embedding/themes/components/ThemeEditor/EnableEmbeddingPrompt.tsxsimilarity index 93%rename from frontend/src/metabase/admin/embedding/components/ThemeEditor/EnableEmbeddingPrompt.tsxrename to frontend/src/metabase/embedding/themes/components/ThemeEditor/EnableEmbeddingPrompt.tsxindex dab17cbdeee..98f503003aa 100644--- a/frontend/src/metabase/admin/embedding/components/ThemeEditor/EnableEmbeddingPrompt.tsx+++ b/frontend/src/metabase/embedding/themes/components/ThemeEditor/EnableEmbeddingPrompt.tsx@@ -16,8 +16,8 @@ export function EnableEmbeddingPrompt({const handleEnable = async () => {await updateSettings({- "enable-embedding-simple": true,- ...(!isTermsAccepted && { "show-simple-embed-terms": false }),+ "enable-embedding-modular": true,+ ...(!isTermsAccepted && { "show-modular-embed-terms": false }),});};diff --git a/frontend/src/metabase/admin/embedding/components/ThemeEditor/EnableEmbeddingPrompt.unit.spec.tsx b/frontend/src/metabase/embedding/themes/components/ThemeEditor/EnableEmbeddingPrompt.unit.spec.tsxsimilarity index 100%rename from frontend/src/metabase/admin/embedding/components/ThemeEditor/EnableEmbeddingPrompt.unit.spec.tsxrename to frontend/src/metabase/embedding/themes/components/ThemeEditor/EnableEmbeddingPrompt.unit.spec.tsxdiff --git a/frontend/src/metabase/admin/embedding/components/ThemeEditor/PreviewPanel.module.css b/frontend/src/metabase/embedding/themes/components/ThemeEditor/PreviewPanel.module.csssimilarity index 100%rename from frontend/src/metabase/admin/embedding/components/ThemeEditor/PreviewPanel.module.cssrename to frontend/src/metabase/embedding/themes/components/ThemeEditor/PreviewPanel.module.cssdiff --git a/frontend/src/metabase/admin/embedding/components/ThemeEditor/PreviewPanel.tsx b/frontend/src/metabase/embedding/themes/components/ThemeEditor/PreviewPanel.tsxsimilarity index 96%rename from frontend/src/metabase/admin/embedding/components/ThemeEditor/PreviewPanel.tsxrename to frontend/src/metabase/embedding/themes/components/ThemeEditor/PreviewPanel.tsxindex ccea217301c..9199df66678 100644--- a/frontend/src/metabase/admin/embedding/components/ThemeEditor/PreviewPanel.tsx+++ b/frontend/src/metabase/embedding/themes/components/ThemeEditor/PreviewPanel.tsx@@ -12,8 +12,8 @@ import type { PreviewResource } from "./types";import { useDefaultPreviewResource } from "./use-default-preview-resource";export function PreviewPanel({ settings }: { settings: MetabaseTheme }) {- const isSimpleEmbeddingEnabled = useSetting("enable-embedding-simple");- const isTermsAccepted = !useSetting("show-simple-embed-terms");+ const isSimpleEmbeddingEnabled = useSetting("enable-embedding-modular");+ const isTermsAccepted = !useSetting("show-modular-embed-terms");const isEmbeddingReady = isSimpleEmbeddingEnabled && isTermsAccepted;diff --git a/frontend/src/metabase/admin/embedding/components/ThemeEditor/PreviewPanel.unit.spec.tsx b/frontend/src/metabase/embedding/themes/components/ThemeEditor/PreviewPanel.unit.spec.tsxsimilarity index 96%rename from frontend/src/metabase/admin/embedding/components/ThemeEditor/PreviewPanel.unit.spec.tsxrename to frontend/src/metabase/embedding/themes/components/ThemeEditor/PreviewPanel.unit.spec.tsxindex 7ef1ff7d244..a582e37cf59 100644--- a/frontend/src/metabase/admin/embedding/components/ThemeEditor/PreviewPanel.unit.spec.tsx+++ b/frontend/src/metabase/embedding/themes/components/ThemeEditor/PreviewPanel.unit.spec.tsx@@ -32,8 +32,8 @@ const setup = ({const storeInitialState = createMockState({settings: mockSettings({- "enable-embedding-simple": true,- "show-simple-embed-terms": false,+ "enable-embedding-modular": true,+ "show-modular-embed-terms": false,}),});diff --git a/frontend/src/metabase/admin/embedding/components/ThemeEditor/PreviewResourcePicker.tsx b/frontend/src/metabase/embedding/themes/components/ThemeEditor/PreviewResourcePicker.tsxsimilarity index 100%rename from frontend/src/metabase/admin/embedding/components/ThemeEditor/PreviewResourcePicker.tsxrename to frontend/src/metabase/embedding/themes/components/ThemeEditor/PreviewResourcePicker.tsxdiff --git a/frontend/src/metabase/admin/embedding/components/ThemeEditor/ResourcePreview.tsx b/frontend/src/metabase/embedding/themes/components/ThemeEditor/ResourcePreview.tsxsimilarity index 100%rename from frontend/src/metabase/admin/embedding/components/ThemeEditor/ResourcePreview.tsxrename to frontend/src/metabase/embedding/themes/components/ThemeEditor/ResourcePreview.tsxdiff --git a/frontend/src/metabase/admin/embedding/components/ThemeEditor/constants.ts b/frontend/src/metabase/embedding/themes/components/ThemeEditor/constants.tssimilarity index 100%rename from frontend/src/metabase/admin/embedding/components/ThemeEditor/constants.tsrename to frontend/src/metabase/embedding/themes/components/ThemeEditor/constants.tsdiff --git a/frontend/src/metabase/admin/embedding/components/ThemeEditor/get-theme-code-snippet.ts b/frontend/src/metabase/embedding/themes/components/ThemeEditor/get-theme-code-snippet.tssimilarity index 100%rename from frontend/src/metabase/admin/embedding/components/ThemeEditor/get-theme-code-snippet.tsrename to frontend/src/metabase/embedding/themes/components/ThemeEditor/get-theme-code-snippet.tsdiff --git a/frontend/src/metabase/admin/embedding/components/ThemeEditor/get-theme-code-snippet.unit.spec.ts b/frontend/src/metabase/embedding/themes/components/ThemeEditor/get-theme-code-snippet.unit.spec.tssimilarity index 100%rename from frontend/src/metabase/admin/embedding/components/ThemeEditor/get-theme-code-snippet.unit.spec.tsrename to frontend/src/metabase/embedding/themes/components/ThemeEditor/get-theme-code-snippet.unit.spec.tsdiff --git a/frontend/src/metabase/admin/embedding/components/ThemeEditor/index.ts b/frontend/src/metabase/embedding/themes/components/ThemeEditor/index.tssimilarity index 100%rename from frontend/src/metabase/admin/embedding/components/ThemeEditor/index.tsrename to frontend/src/metabase/embedding/themes/components/ThemeEditor/index.tsdiff --git a/frontend/src/metabase/admin/embedding/components/ThemeEditor/types.ts b/frontend/src/metabase/embedding/themes/components/ThemeEditor/types.tssimilarity index 100%rename from frontend/src/metabase/admin/embedding/components/ThemeEditor/types.tsrename to frontend/src/metabase/embedding/themes/components/ThemeEditor/types.tsdiff --git a/frontend/src/metabase/admin/embedding/components/ThemeEditor/use-default-preview-resource.ts b/frontend/src/metabase/embedding/themes/components/ThemeEditor/use-default-preview-resource.tssimilarity index 100%rename from frontend/src/metabase/admin/embedding/components/ThemeEditor/use-default-preview-resource.tsrename to frontend/src/metabase/embedding/themes/components/ThemeEditor/use-default-preview-resource.tsdiff --git a/frontend/src/metabase/admin/embedding/components/ThemeEditor/use-default-preview-resource.unit.spec.tsx b/frontend/src/metabase/embedding/themes/components/ThemeEditor/use-default-preview-resource.unit.spec.tsxsimilarity index 100%rename from frontend/src/metabase/admin/embedding/components/ThemeEditor/use-default-preview-resource.unit.spec.tsxrename to frontend/src/metabase/embedding/themes/components/ThemeEditor/use-default-preview-resource.unit.spec.tsxdiff --git a/frontend/src/metabase/admin/embedding/components/ThemeListing/DeleteThemeModal.tsx b/frontend/src/metabase/embedding/themes/components/ThemeListing/DeleteThemeModal.tsxsimilarity index 100%rename from frontend/src/metabase/admin/embedding/components/ThemeListing/DeleteThemeModal.tsxrename to frontend/src/metabase/embedding/themes/components/ThemeListing/DeleteThemeModal.tsxdiff --git a/frontend/src/metabase/admin/embedding/components/ThemeListing/EmbeddingThemeCard.tsx b/frontend/src/metabase/embedding/themes/components/ThemeListing/EmbeddingThemeCard.tsxsimilarity index 100%rename from frontend/src/metabase/admin/embedding/components/ThemeListing/EmbeddingThemeCard.tsxrename to frontend/src/metabase/embedding/themes/components/ThemeListing/EmbeddingThemeCard.tsxdiff --git a/frontend/src/metabase/admin/embedding/components/ThemeListing/EmbeddingThemeCardPreview.tsx b/frontend/src/metabase/embedding/themes/components/ThemeListing/EmbeddingThemeCardPreview.tsxsimilarity index 100%rename from frontend/src/metabase/admin/embedding/components/ThemeListing/EmbeddingThemeCardPreview.tsxrename to frontend/src/metabase/embedding/themes/components/ThemeListing/EmbeddingThemeCardPreview.tsxdiff --git a/frontend/src/metabase/admin/embedding/components/ThemeListing/EmbeddingThemeCardPreview.unit.spec.tsx b/frontend/src/metabase/embedding/themes/components/ThemeListing/EmbeddingThemeCardPreview.unit.spec.tsxsimilarity index 100%rename from frontend/src/metabase/admin/embedding/components/ThemeListing/EmbeddingThemeCardPreview.unit.spec.tsxrename to frontend/src/metabase/embedding/themes/components/ThemeListing/EmbeddingThemeCardPreview.unit.spec.tsxdiff --git a/frontend/src/metabase/admin/embedding/components/ThemeListing/EmbeddingThemeListingApp.tsx b/frontend/src/metabase/embedding/themes/components/ThemeListing/EmbeddingThemeListingApp.tsxsimilarity index 62%rename from frontend/src/metabase/admin/embedding/components/ThemeListing/EmbeddingThemeListingApp.tsxrename to frontend/src/metabase/embedding/themes/components/ThemeListing/EmbeddingThemeListingApp.tsxindex 65ff69f5754..104924b619f 100644--- a/frontend/src/metabase/admin/embedding/components/ThemeListing/EmbeddingThemeListingApp.tsx+++ b/frontend/src/metabase/embedding/themes/components/ThemeListing/EmbeddingThemeListingApp.tsx@@ -1,29 +1,30 @@import { t } from "ttag";-import { useDeleteThemeFlow } from "metabase/admin/embedding/hooks";-import { UpsellEmbeddingTheme } from "metabase/admin/upsells";import {useCopyEmbeddingThemeMutation,useListEmbeddingThemesQuery,} from "metabase/api/embedding-theme";-import { useHasTokenFeature, useToast } from "metabase/common/hooks";+import { useToast } from "metabase/common/hooks";+import { useDeleteThemeFlow } from "metabase/embedding/themes/hooks";import { useNavigate } from "metabase/router";-import { Loader, SimpleGrid, Stack, Text, Title } from "metabase/ui";+import { Loader, SimpleGrid, Stack } from "metabase/ui";import { EmbeddingThemeCard } from "./EmbeddingThemeCard";import { NewThemeCard } from "./NewThemeCard";-export function EmbeddingThemeListingApp() {- const hasSimpleEmbedding = useHasTokenFeature("embedding_simple");+type EmbeddingThemeListingAppProps = {+ /** Where the theme editor lives, so the listing knows where to link to. */+ basePath: string;+};- if (!hasSimpleEmbedding) {- return <UpsellEmbeddingTheme source="embedding-themes" />;- }-- return <EmbeddingThemeListingAppInner />;-}--function EmbeddingThemeListingAppInner() {+/**+ * The caller is responsible for gating this on the `embedding_simple` token+ * feature -- the embedding hub's Appearance page does, showing its own+ * upsell instead of mounting this component at all when the feature is off.+ */+export function EmbeddingThemeListingApp({+ basePath,+}: EmbeddingThemeListingAppProps) {const navigate = useNavigate();const { data: themes, isLoading } = useListEmbeddingThemesQuery();const [duplicateTheme] = useCopyEmbeddingThemeMutation();@@ -31,7 +32,7 @@ function EmbeddingThemeListingAppInner() {const { requestDelete, modal: deleteModal } = useDeleteThemeFlow();const handleCreateTheme = () => {- navigate(`/admin/embedding/themes/new`);+ navigate(`${basePath}/new`);};const handleDuplicateTheme = async (themeId: number) => {@@ -52,21 +53,17 @@ function EmbeddingThemeListingAppInner() {);}+ // No `mx="auto"`: as a flex child, auto side margins override+ // `align-items: stretch` and shrink the grid to its content, which squashes+ // the fixed-height cards into columns.return (- <Stack mx="auto" gap="xxl" maw={1200}>- <Stack gap="xxs">- <Title order={1}>{t`Themes`}</Title>- <Text c="text-secondary">- {t`Create and edit themes to reuse across multiple embeds.`}- </Text>- </Stack>-+ <Stack gap="xxl" w="100%"><SimpleGrid cols={{ base: 1, sm: 2, md: 3 }} spacing="lg">{themes?.map((theme) => (<EmbeddingThemeCardkey={theme.id}theme={theme}- onEdit={() => navigate(`/admin/embedding/themes/${theme.id}`)}+ onEdit={() => navigate(`${basePath}/${theme.id}`)}onDuplicate={() => handleDuplicateTheme(theme.id)}onDelete={() => requestDelete(theme.id)}/>diff --git a/frontend/src/metabase/embedding/themes/components/ThemeListing/EmbeddingThemeListingApp.unit.spec.tsx b/frontend/src/metabase/embedding/themes/components/ThemeListing/EmbeddingThemeListingApp.unit.spec.tsxnew file mode 100644index 00000000000..3e075ce1b8d--- /dev/null+++ b/frontend/src/metabase/embedding/themes/components/ThemeListing/EmbeddingThemeListingApp.unit.spec.tsx@@ -0,0 +1,45 @@+import fetchMock from "fetch-mock";++import { renderWithProviders, screen } from "__support__/ui";+import { createMockUser } from "metabase-types/api/mocks";++import { EmbeddingThemeListingApp } from "./EmbeddingThemeListingApp";++const setup = () => {+ fetchMock.get("path:/api/embed-theme", []);++ renderWithProviders(+ <EmbeddingThemeListingApp basePath="/embedding/appearance/theme" />,+ {+ storeInitialState: {+ currentUser: createMockUser({ is_superuser: true }),+ },+ },+ );+};++/**+ * The two upsell tests this file used to carry are gone: the component no+ * longer checks `embedding_simple` -- its caller gates it and shows the+ * upsell instead. theme-upsell.cy.spec.ts covers that end to end, per edition.+ */+describe("EmbeddingThemeListingApp", () => {+ it("renders the themes listing", async () => {+ setup();++ expect(+ await screen.findByRole("button", { name: /New theme/ }),+ ).toBeInTheDocument();+ });++ it("leaves the heading to the host page", async () => {+ setup();++ expect(+ await screen.findByRole("button", { name: /New theme/ }),+ ).toBeInTheDocument();+ expect(+ screen.queryByRole("heading", { name: "Themes" }),+ ).not.toBeInTheDocument();+ });+});diff --git a/frontend/src/metabase/admin/embedding/components/ThemeListing/NewThemeCard.module.css b/frontend/src/metabase/embedding/themes/components/ThemeListing/NewThemeCard.module.csssimilarity index 100%rename from frontend/src/metabase/admin/embedding/components/ThemeListing/NewThemeCard.module.cssrename to frontend/src/metabase/embedding/themes/components/ThemeListing/NewThemeCard.module.cssdiff --git a/frontend/src/metabase/admin/embedding/components/ThemeListing/NewThemeCard.tsx b/frontend/src/metabase/embedding/themes/components/ThemeListing/NewThemeCard.tsxsimilarity index 100%rename from frontend/src/metabase/admin/embedding/components/ThemeListing/NewThemeCard.tsxrename to frontend/src/metabase/embedding/themes/components/ThemeListing/NewThemeCard.tsxdiff --git a/frontend/src/metabase/admin/embedding/components/ThemeListing/index.ts b/frontend/src/metabase/embedding/themes/components/ThemeListing/index.tssimilarity index 100%rename from frontend/src/metabase/admin/embedding/components/ThemeListing/index.tsrename to frontend/src/metabase/embedding/themes/components/ThemeListing/index.tsdiff --git a/frontend/src/metabase/admin/embedding/hooks/index.ts b/frontend/src/metabase/embedding/themes/hooks/index.tssimilarity index 100%rename from frontend/src/metabase/admin/embedding/hooks/index.tsrename to frontend/src/metabase/embedding/themes/hooks/index.tsdiff --git a/frontend/src/metabase/admin/embedding/hooks/use-default-embedding-theme-settings.ts b/frontend/src/metabase/embedding/themes/hooks/use-default-embedding-theme-settings.tssimilarity index 100%rename from frontend/src/metabase/admin/embedding/hooks/use-default-embedding-theme-settings.tsrename to frontend/src/metabase/embedding/themes/hooks/use-default-embedding-theme-settings.tsdiff --git a/frontend/src/metabase/admin/embedding/hooks/use-default-embedding-theme-settings.unit.spec.tsx b/frontend/src/metabase/embedding/themes/hooks/use-default-embedding-theme-settings.unit.spec.tsxsimilarity index 100%rename from frontend/src/metabase/admin/embedding/hooks/use-default-embedding-theme-settings.unit.spec.tsxrename to frontend/src/metabase/embedding/themes/hooks/use-default-embedding-theme-settings.unit.spec.tsxdiff --git a/frontend/src/metabase/admin/embedding/hooks/use-default-embedding-themes.ts b/frontend/src/metabase/embedding/themes/hooks/use-default-embedding-themes.tssimilarity index 100%rename from frontend/src/metabase/admin/embedding/hooks/use-default-embedding-themes.tsrename to frontend/src/metabase/embedding/themes/hooks/use-default-embedding-themes.tsdiff --git a/frontend/src/metabase/admin/embedding/hooks/use-delete-theme-flow.tsx b/frontend/src/metabase/embedding/themes/hooks/use-delete-theme-flow.tsxsimilarity index 100%rename from frontend/src/metabase/admin/embedding/hooks/use-delete-theme-flow.tsxrename to frontend/src/metabase/embedding/themes/hooks/use-delete-theme-flow.tsxdiff --git a/frontend/src/metabase/admin/embedding/hooks/use-embedding-theme-editor.ts b/frontend/src/metabase/embedding/themes/hooks/use-embedding-theme-editor.tssimilarity index 98%rename from frontend/src/metabase/admin/embedding/hooks/use-embedding-theme-editor.tsrename to frontend/src/metabase/embedding/themes/hooks/use-embedding-theme-editor.tsindex 1914504acf7..b07deadf32b 100644--- a/frontend/src/metabase/admin/embedding/hooks/use-embedding-theme-editor.ts+++ b/frontend/src/metabase/embedding/themes/hooks/use-embedding-theme-editor.ts@@ -2,7 +2,6 @@ import { useCallback, useEffect, useMemo, useState } from "react";import { t } from "ttag";import { isEqual } from "underscore";-import { useDefaultEmbeddingThemeSettings } from "metabase/admin/embedding/hooks/use-default-embedding-theme-settings";import { skipToken } from "metabase/api";import {useCreateEmbeddingThemeMutation,@@ -10,6 +9,7 @@ import {useUpdateEmbeddingThemeMutation,} from "metabase/api/embedding-theme";import { useToast } from "metabase/common/hooks";+import { useDefaultEmbeddingThemeSettings } from "metabase/embedding/themes/hooks/use-default-embedding-theme-settings";import type {ChartColor,MetabaseColor,diff --git a/frontend/src/metabase/admin/embedding/hooks/use-embedding-theme-editor.unit.spec.tsx b/frontend/src/metabase/embedding/themes/hooks/use-embedding-theme-editor.unit.spec.tsxsimilarity index 100%rename from frontend/src/metabase/admin/embedding/hooks/use-embedding-theme-editor.unit.spec.tsxrename to frontend/src/metabase/embedding/themes/hooks/use-embedding-theme-editor.unit.spec.tsxdiff --git a/frontend/src/metabase/admin/embedding/hooks/use-ensure-default-embedding-themes.ts b/frontend/src/metabase/embedding/themes/hooks/use-ensure-default-embedding-themes.tssimilarity index 91%rename from frontend/src/metabase/admin/embedding/hooks/use-ensure-default-embedding-themes.tsrename to frontend/src/metabase/embedding/themes/hooks/use-ensure-default-embedding-themes.tsindex 39dfbe20ab1..d03bfe37f18 100644--- a/frontend/src/metabase/admin/embedding/hooks/use-ensure-default-embedding-themes.ts+++ b/frontend/src/metabase/embedding/themes/hooks/use-ensure-default-embedding-themes.ts@@ -6,8 +6,8 @@ import { useSetting } from "metabase/settings";import { useDefaultEmbeddingThemes } from "./use-default-embedding-themes";/**- * Lazily seeds the default `Light` and `Dark` embedding themes on first visit of the themes- * listing page. Guarded by the `default-embedding-themes-seeded` setting so that subsequent+ * Lazily seeds the default `Light` and `Dark` embedding themes on first visit to the embedding+ * hub. Guarded by the `default-embedding-themes-seeded` setting so that subsequent* visits — including those after an admin has deleted the seeded themes — are no-ops.** Safe to call unconditionally: the hook fires at most one POST per mount, and the backenddiff --git a/frontend/src/metabase/admin/embedding/hooks/use-ensure-default-embedding-themes.unit.spec.tsx b/frontend/src/metabase/embedding/themes/hooks/use-ensure-default-embedding-themes.unit.spec.tsxsimilarity index 100%rename from frontend/src/metabase/admin/embedding/hooks/use-ensure-default-embedding-themes.unit.spec.tsxrename to frontend/src/metabase/embedding/themes/hooks/use-ensure-default-embedding-themes.unit.spec.tsxdiff --git a/frontend/src/metabase/admin/embedding/utils/derive-sdk-theme-settings.ts b/frontend/src/metabase/embedding/themes/utils/derive-sdk-theme-settings.tssimilarity index 96%rename from frontend/src/metabase/admin/embedding/utils/derive-sdk-theme-settings.tsrename to frontend/src/metabase/embedding/themes/utils/derive-sdk-theme-settings.tsindex 9783d388159..4ea8aa06924 100644--- a/frontend/src/metabase/admin/embedding/utils/derive-sdk-theme-settings.ts+++ b/frontend/src/metabase/embedding/themes/utils/derive-sdk-theme-settings.ts@@ -27,7 +27,7 @@ const SDK_COLORS_TO_PERSIST = ["charts",] as const satisfies MetabaseColor[];-export const WHITELABEL_CHART_COLOR_NAMES = Array.from(+const WHITELABEL_CHART_COLOR_NAMES = Array.from({ length: ACCENT_COUNT },// Unjustified type cast. FIXME(_, i) => `accent${i}` as ColorName,diff --git a/frontend/src/metabase/admin/embedding/utils/derive-sdk-theme-settings.unit.spec.ts b/frontend/src/metabase/embedding/themes/utils/derive-sdk-theme-settings.unit.spec.tssimilarity index 100%rename from frontend/src/metabase/admin/embedding/utils/derive-sdk-theme-settings.unit.spec.tsrename to frontend/src/metabase/embedding/themes/utils/derive-sdk-theme-settings.unit.spec.tsdiff --git a/frontend/src/metabase/forms/components/FormSecretKey/FormSecretKey.module.css b/frontend/src/metabase/forms/components/FormSecretKey/FormSecretKey.module.cssindex 72ea914c894..262b26da417 100644--- a/frontend/src/metabase/forms/components/FormSecretKey/FormSecretKey.module.css+++ b/frontend/src/metabase/forms/components/FormSecretKey/FormSecretKey.module.css@@ -32,3 +32,10 @@top: 0;width: auto;}++/* Overrides Mantine's default input styles, hence the raised specificity. */+.secretKeyInput:not([data-css-specificity-hack="🔑"]) {+ border-radius: var(--mantine-radius-sm);+ background-color: var(--mb-color-background_page-secondary);+ font-family: var(--mantine-font-family-monospace);+}diff --git a/frontend/src/metabase/forms/components/FormSecretKey/FormSecretKey.tsx b/frontend/src/metabase/forms/components/FormSecretKey/FormSecretKey.tsxindex 1ea30832218..f7eda764686 100644--- a/frontend/src/metabase/forms/components/FormSecretKey/FormSecretKey.tsx+++ b/frontend/src/metabase/forms/components/FormSecretKey/FormSecretKey.tsx@@ -1,7 +1,6 @@-import { useDisclosure } from "@mantine/hooks";import cx from "classnames";import { useField } from "formik";-import { type Ref, forwardRef } from "react";+import { type Ref, forwardRef, useState } from "react";import { t } from "ttag";import {@@ -13,7 +12,8 @@ import {} from "metabase/ui";import S from "./FormSecretKey.module.css";-import { SetupKeyModal } from "./SetupKeyModal";+import { RegenerateKeyConfirmModal } from "./RegenerateKeyConfirmModal";+import { SecretKeyModal } from "./SetupKeyModal";export interface FormSecretKeyProps extends Omit<TextInputProps,@@ -23,24 +23,37 @@ export interface FormSecretKeyProps extends Omit<nullable?: boolean;}+type OpenModal = "create-key" | "confirm-regenerate" | "store-new-key" | null;+export const FormSecretKey = forwardRef(function FormSecretKey({ name, nullable, onChange, onBlur, readOnly, ...props }: FormSecretKeyProps,ref: Ref<HTMLInputElement>,) {- const [showModal, { open: openModal, close: closeModal }] = useDisclosure();+ const [openModal, setOpenModal] = useState<OpenModal>(null);const [{ value }, { error }, { setValue }] = useField(name);+ const closeModal = () => setOpenModal(null);++ const confirmSecretKey = (secretKey: string) => {+ setValue(secretKey);+ closeModal();+ };++ const hasSecretKey = Boolean(value);+const generateSecretButtonProps = readOnly? null: {rightSection: (<ButtonclassName={S.generateButton}- miw={value ? undefined : "10rem"}- onClick={openModal}- variant="filled"+ miw={hasSecretKey ? undefined : "10rem"}+ onClick={() =>+ setOpenModal(hasSecretKey ? "confirm-regenerate" : "create-key")+ }+ variant={hasSecretKey ? "default" : "filled"}>- {value ? t`Regenerate key` : t`Set up key`}+ {hasSecretKey ? t`Regenerate key` : t`Set up key`}</Button>),rightSectionProps: { className: S.rightSection },@@ -58,21 +71,37 @@ export const FormSecretKey = forwardRef(function FormSecretKey(classNames={{wrapper: S.inputWrapper,input: cx(S.input, {- [S.unset]: !value, // Just show the 'Set up key' button when no key is set yet+ [S.unset]: !hasSecretKey, // Just show the 'Set up key' button when no key is set yet}),}}{...generateSecretButtonProps}/>{!!error && <Text c="feedback-negative">{error}</Text>}</Stack>- {showModal && (- <SetupKeyModal- onConfirm={(newValue) => {- setValue(newValue);- closeModal();- }}++ {openModal === "create-key" && (+ <SecretKeyModal+ title={t`Create a secret key`}+ confirmLabel={t`Create`}+ withCancelButton+ onConfirm={confirmSecretKey}+ onClose={closeModal}+ />+ )}++ {openModal === "confirm-regenerate" && (+ <RegenerateKeyConfirmModal+ onConfirm={() => setOpenModal("store-new-key")}+ onClose={closeModal}+ />+ )}++ {openModal === "store-new-key" && (+ <SecretKeyModal+ title={t`Store your new key`}+ confirmLabel={t`Done`}+ onConfirm={confirmSecretKey}onClose={closeModal}- currentValue={value}/>)}</>diff --git a/frontend/src/metabase/forms/components/FormSecretKey/FormSecretKey.unit.spec.tsx b/frontend/src/metabase/forms/components/FormSecretKey/FormSecretKey.unit.spec.tsxindex 452d82a0e16..b6591b5ea76 100644--- a/frontend/src/metabase/forms/components/FormSecretKey/FormSecretKey.unit.spec.tsx+++ b/frontend/src/metabase/forms/components/FormSecretKey/FormSecretKey.unit.spec.tsx@@ -17,6 +17,7 @@ interface SetupOpts {}const GENERATED_TOKEN = "newly-generated-token-xyz";+const REGENERATED_TOKEN = "second-generated-token-def";const EXISTING_VALUE = "my-super-secret-token-abc123";// obfuscateValue shows "**********" + last 2 charsconst OBFUSCATED_EXISTING = "**********23";@@ -44,11 +45,19 @@ const setup = ({<FormSubmitButton /></Form></FormProvider>,+ // The failure path asserts on the error toast, which only renders here.+ { withUndos: true },);return { onSubmit };};+const regenerateKey = async () => {+ await userEvent.click(screen.getByRole("button", { name: "Regenerate key" }));+ await userEvent.click(screen.getByRole("button", { name: "Delete key" }));+ await screen.findByRole("dialog", { name: "Store your new key" });+};+describe("FormSecretKey", () => {afterEach(() => {fetchMock.hardReset();@@ -66,17 +75,7 @@ describe("FormSecretKey", () => {).not.toBeInTheDocument();});- it("opens the setup modal when 'Set up key' is clicked", async () => {- setup({ initialValues: { secret: undefined } });-- await userEvent.click(screen.getByRole("button", { name: "Set up key" }));-- expect(- await screen.findByRole("dialog", { name: "Set up secret key" }),- ).toBeInTheDocument();- });-- it("auto-generates a token when the modal opens", async () => {+ it("generates a key and shows it read-only when 'Set up key' is clicked", async () => {setup({ initialValues: { secret: undefined } });expect(fetchMock.callHistory.calls("generate-random-token")).toHaveLength(@@ -85,46 +84,60 @@ describe("FormSecretKey", () => {await userEvent.click(screen.getByRole("button", { name: "Set up key" }));+ const modal = await screen.findByRole("dialog", {+ name: "Create a secret key",+ });expect(fetchMock.callHistory.calls("generate-random-token")).toHaveLength(1,);- // The modal's text input should contain the generated token- await waitFor(() => {- const modalInput = within(screen.getByRole("dialog")).getByRole(- "textbox",- { name: "New secret key" },- );- expect(modalInput).toHaveValue(GENERATED_TOKEN);+ const keyInput = within(modal).getByRole("textbox", {+ name: "New secret key",});+ await waitFor(() => expect(keyInput).toHaveValue(GENERATED_TOKEN));+ expect(keyInput).toHaveAttribute("readonly");});- it("closes the modal and updates the form value after clicking 'Done'", async () => {+ it("copies the generated key to the clipboard", async () => {setup({ initialValues: { secret: undefined } });await userEvent.click(screen.getByRole("button", { name: "Set up key" }));- await screen.findByRole("dialog", { name: "Set up secret key" });+ const modal = await screen.findByRole("dialog", {+ name: "Create a secret key",+ });- await waitFor(() => {- expect(screen.getByRole("button", { name: "Done" })).toBeEnabled();+ const copyButton = await within(modal).findByRole("button", {+ name: "Copy",});+ expect(copyButton).toHaveTextContent("");- await userEvent.click(screen.getByRole("button", { name: "Done" }));+ await userEvent.click(copyButton);++ expect(navigator.clipboard.writeText).toHaveBeenCalledWith(+ GENERATED_TOKEN,+ );+ });++ it("updates the form value after clicking 'Create'", async () => {+ setup({ initialValues: { secret: undefined } });++ await userEvent.click(screen.getByRole("button", { name: "Set up key" }));+ await screen.findByRole("dialog", { name: "Create a secret key" });await waitFor(() => {- expect(- screen.queryByRole("dialog", { name: "Set up secret key" }),- ).not.toBeInTheDocument();+ expect(screen.getByRole("button", { name: "Create" })).toBeEnabled();});+ await userEvent.click(screen.getByRole("button", { name: "Create" }));- // The input shows the obfuscated generated valueawait waitFor(() => {- expect(screen.getByLabelText("Signing Key")).toHaveValue(- OBFUSCATED_GENERATED,- );+ expect(+ screen.queryByRole("dialog", { name: "Create a secret key" }),+ ).not.toBeInTheDocument();});- // Button switches to "Regenerate key"+ expect(screen.getByLabelText("Signing Key")).toHaveValue(+ OBFUSCATED_GENERATED,+ );expect(screen.getByRole("button", { name: "Regenerate key" }),).toBeInTheDocument();@@ -133,24 +146,81 @@ describe("FormSecretKey", () => {).not.toBeInTheDocument();});- it("closes the modal without updating the value after clicking 'Cancel'", async () => {+ it("does not show the previously generated key when reopened", async () => {setup({ initialValues: { secret: undefined } });await userEvent.click(screen.getByRole("button", { name: "Set up key" }));- await screen.findByRole("dialog", { name: "Set up secret key" });+ await screen.findByRole("dialog", { name: "Create a secret key" });+ await waitFor(() =>+ expect(+ screen.getByRole("textbox", { name: "New secret key" }),+ ).toHaveValue(GENERATED_TOKEN),+ );+ await userEvent.click(screen.getByRole("button", { name: "Cancel" }));++ fetchMock.modifyRoute("generate-random-token", {+ response: { token: REGENERATED_TOKEN },+ });+ await userEvent.click(screen.getByRole("button", { name: "Set up key" }));++ const keyInput = await screen.findByRole("textbox", {+ name: "New secret key",+ });+ expect(keyInput).not.toHaveValue(GENERATED_TOKEN);+ await waitFor(() => expect(keyInput).toHaveValue(REGENERATED_TOKEN));+ });++ it("closes the modal when generating the secret key fails", async () => {+ setup({ initialValues: { secret: undefined } });++ fetchMock.modifyRoute("generate-random-token", { response: 500 });+ await userEvent.click(screen.getByRole("button", { name: "Set up key" }));++ expect(+ await screen.findByText("Error generating secret key."),+ ).toBeInTheDocument();+ await waitFor(() => {+ expect(+ screen.queryByRole("dialog", { name: "Create a secret key" }),+ ).not.toBeInTheDocument();+ });+ });++ it("does not update the value after clicking 'Cancel'", async () => {+ setup({ initialValues: { secret: undefined } });++ await userEvent.click(screen.getByRole("button", { name: "Set up key" }));+ await screen.findByRole("dialog", { name: "Create a secret key" });await userEvent.click(screen.getByRole("button", { name: "Cancel" }));await waitFor(() => {expect(- screen.queryByRole("dialog", { name: "Set up secret key" }),+ screen.queryByRole("dialog", { name: "Create a secret key" }),).not.toBeInTheDocument();});- // Still shows "Set up key" — value was not changedexpect(screen.getByRole("button", { name: "Set up key" }),).toBeInTheDocument();});++ it("cannot be dismissed with Escape", async () => {+ setup({ initialValues: { secret: undefined } });++ await userEvent.click(screen.getByRole("button", { name: "Set up key" }));+ const modal = await screen.findByRole("dialog", {+ name: "Create a secret key",+ });+ expect(+ within(modal).queryByRole("button", { name: "Close" }),+ ).not.toBeInTheDocument();++ await userEvent.keyboard("{Escape}");++ expect(+ screen.getByRole("dialog", { name: "Create a secret key" }),+ ).toBeInTheDocument();+ });});describe("when there is an existing value", () => {@@ -173,7 +243,7 @@ describe("FormSecretKey", () => {).not.toBeInTheDocument();});- it("opens the setup modal when 'Regenerate key' is clicked", async () => {+ it("asks for confirmation before generating a new key", async () => {setup({ initialValues: { secret: EXISTING_VALUE } });await userEvent.click(@@ -183,49 +253,133 @@ describe("FormSecretKey", () => {);expect(- await screen.findByRole("dialog", { name: "Set up secret key" }),+ await screen.findByRole("dialog", {+ name: "Delete key and generate a new one?",+ }),+ ).toBeInTheDocument();+ expect(+ screen.getByText(/This will cause existing tokens to stop working/),).toBeInTheDocument();+ expect(fetchMock.callHistory.calls("generate-random-token")).toHaveLength(+ 0,+ );});- it("shows a warning about existing tokens being invalidated when regenerating", async () => {+ it("cannot dismiss the regenerate confirmation with Escape", async () => {setup({ initialValues: { secret: EXISTING_VALUE } });await userEvent.click(screen.getByRole("button", { name: "Regenerate key" }),);+ const modal = await screen.findByRole("dialog", {+ name: "Delete key and generate a new one?",+ });+ expect(+ within(modal).queryByRole("button", { name: "Close" }),+ ).not.toBeInTheDocument();++ await userEvent.keyboard("{Escape}");expect(- await screen.findByText(- /This will cause existing tokens to stop working/,- ),+ screen.getByRole("dialog", {+ name: "Delete key and generate a new one?",+ }),).toBeInTheDocument();});- });- describe("when readOnly is true (env var controlled)", () => {- it("does not show 'Regenerate key' or 'Set up key' buttons", () => {- setup({ initialValues: { secret: EXISTING_VALUE }, readOnly: true });- expect(- within(screen.getByTestId("inputWrapper")).queryByRole("button"),- ).not.toBeInTheDocument();+ it("keeps the current key when the confirmation is dismissed", async () => {+ setup({ initialValues: { secret: EXISTING_VALUE } });++ await userEvent.click(+ screen.getByRole("button", { name: "Regenerate key" }),+ );+ await userEvent.click(+ screen.getByRole("button", { name: "No, don't delete" }),+ );++ await waitFor(() => {+ expect(+ screen.queryByRole("dialog", {+ name: "Delete key and generate a new one?",+ }),+ ).not.toBeInTheDocument();+ });+ expect(screen.getByLabelText("Signing Key")).toHaveValue(+ OBFUSCATED_EXISTING,+ );});- });- describe("token length validation", () => {- it("disables 'Done' button when the token is too short", async () => {+ it("replaces the key after confirming and clicking 'Done'", async () => {+ setup({ initialValues: { secret: EXISTING_VALUE } });++ await regenerateKey();++ await waitFor(() => {+ expect(screen.getByRole("button", { name: "Done" })).toBeEnabled();+ });+ await userEvent.click(screen.getByRole("button", { name: "Done" }));++ await waitFor(() => {+ expect(screen.getByLabelText("Signing Key")).toHaveValue(+ OBFUSCATED_GENERATED,+ );+ });+ });++ it("shows a freshly generated key, not the one from an earlier modal", async () => {setup({ initialValues: { secret: undefined } });await userEvent.click(screen.getByRole("button", { name: "Set up key" }));- const input = screen.getByRole("textbox", { name: "New secret key" });+ await waitFor(() =>+ expect(+ screen.getByRole("textbox", { name: "New secret key" }),+ ).toHaveValue(GENERATED_TOKEN),+ );+ await userEvent.click(screen.getByRole("button", { name: "Create" }));++ fetchMock.modifyRoute("generate-random-token", {+ response: { token: REGENERATED_TOKEN },+ });+ await regenerateKey();++ const keyInput = screen.getByRole("textbox", { name: "New secret key" });+ expect(keyInput).not.toHaveValue(GENERATED_TOKEN);+ await waitFor(() => expect(keyInput).toHaveValue(REGENERATED_TOKEN));+ });++ it("does not offer to cancel out of storing the new key", async () => {+ setup({ initialValues: { secret: EXISTING_VALUE } });++ await regenerateKey();++ expect(+ screen.queryByRole("button", { name: "Cancel" }),+ ).not.toBeInTheDocument();+ });- await userEvent.clear(input);- await userEvent.type(input, "1234");- // Token is too short, so 'Done' button should be disabled- expect(screen.getByRole("button", { name: "Done" })).toBeDisabled();+ it("cannot dismiss the store step with Escape", async () => {+ setup({ initialValues: { secret: EXISTING_VALUE } });++ await regenerateKey();+ const modal = screen.getByRole("dialog", { name: "Store your new key" });+ expect(+ within(modal).queryByRole("button", { name: "Close" }),+ ).not.toBeInTheDocument();++ await userEvent.keyboard("{Escape}");++ expect(+ screen.getByRole("dialog", { name: "Store your new key" }),+ ).toBeInTheDocument();+ });+ });- await userEvent.clear(input);- await userEvent.type(input, "12345678");- expect(screen.getByRole("button", { name: "Done" })).toBeEnabled();+ describe("when readOnly is true (env var controlled)", () => {+ it("does not show 'Regenerate key' or 'Set up key' buttons", () => {+ setup({ initialValues: { secret: EXISTING_VALUE }, readOnly: true });+ expect(+ within(screen.getByTestId("inputWrapper")).queryByRole("button"),+ ).not.toBeInTheDocument();});});});diff --git a/frontend/src/metabase/forms/components/FormSecretKey/RegenerateKeyConfirmModal.tsx b/frontend/src/metabase/forms/components/FormSecretKey/RegenerateKeyConfirmModal.tsxnew file mode 100644index 00000000000..8e49a82a1de--- /dev/null+++ b/frontend/src/metabase/forms/components/FormSecretKey/RegenerateKeyConfirmModal.tsx@@ -0,0 +1,26 @@+import { t } from "ttag";++import { ConfirmModal } from "metabase/common/components/ConfirmModal";++type RegenerateKeyConfirmModalProps = {+ onConfirm: () => void;+ onClose: () => void;+};++export const RegenerateKeyConfirmModal = ({+ onConfirm,+ onClose,+}: RegenerateKeyConfirmModalProps) => (+ <ConfirmModal+ opened+ withCloseButton={false}+ closeOnClickOutside={false}+ closeOnEscape={false}+ title={t`Delete key and generate a new one?`}+ message={t`This will cause existing tokens to stop working until the identity provider is updated with a new key.`}+ confirmButtonText={t`Delete key`}+ closeButtonText={t`No, don't delete`}+ onConfirm={onConfirm}+ onClose={onClose}+ />+);diff --git a/frontend/src/metabase/forms/components/FormSecretKey/SetupKeyModal.tsx b/frontend/src/metabase/forms/components/FormSecretKey/SetupKeyModal.tsxindex 5dc41760e36..61be9411f37 100644--- a/frontend/src/metabase/forms/components/FormSecretKey/SetupKeyModal.tsx+++ b/frontend/src/metabase/forms/components/FormSecretKey/SetupKeyModal.tsx@@ -1,114 +1,101 @@+// TODO (Kelvin 2026-08-27) rename this file to SecretKeyModal.tsx to match+// the component name; kept as SetupKeyModal.tsx for now to keep the diff+// reviewable.import { useCallback, useState } from "react";import { useMount } from "react-use";import { t } from "ttag";import { useLazyGenerateRandomTokenQuery } from "metabase/api/util";+import { getCopyTextFieldProps } from "metabase/common/components/CopyTextField/copy-text-field-props";import { useMetadataToasts } from "metabase/common/hooks";import {- ActionIcon,- Alert,Button,- Flex,Group,- Icon,Loader,Modal,Stack,Text,TextInput,- Tooltip,} from "metabase/ui";-type SetupKeyDialogProps = {- currentValue?: string;- onClose: () => void;+import S from "./FormSecretKey.module.css";++type SecretKeyModalProps = {+ title: string;+ confirmLabel: string;+ withCancelButton?: boolean;onConfirm: (secretKey: string) => void;+ onClose: () => void;};-const MIN_SECRET_LENGTH = 8;+export const SecretKeyModal = ({+ title,+ confirmLabel,+ withCancelButton = false,+ onConfirm,+ onClose,+}: SecretKeyModalProps) => {+ const { sendErrorToast } = useMetadataToasts();+ const [generateRandomToken] = useLazyGenerateRandomTokenQuery();-export const SetupKeyModal = (props: SetupKeyDialogProps) => {- const { currentValue, onClose, onConfirm } = props;- const [secretValue, setSecretKey] = useState<string>("");- const { sendErrorToast, sendSuccessToast } = useMetadataToasts();- const [generateRandomToken, { isFetching: isGenerating }] =- useLazyGenerateRandomTokenQuery();+ // Held locally rather than read from the query cache: the cached token is+ // the one generated last time the modal was open, and showing it would let+ // the user copy a key that is about to be replaced.+ const [secretKey, setSecretKey] = useState("");const generateToken = useCallback(async () => {try {- const result = await generateRandomToken().unwrap();- setSecretKey(result.token);+ const { token } = await generateRandomToken().unwrap();+ setSecretKey(token);} catch {sendErrorToast(t`Error generating secret key.`);+ // Nothing to protect from an accidental dismissal, and the modal offers+ // no other way out.+ onClose();}- }, [generateRandomToken, sendErrorToast]);+ }, [generateRandomToken, sendErrorToast, onClose]);useMount(() => {void generateToken();});+ const copyFieldProps = getCopyTextFieldProps({ value: secretKey });+return (- <Modal onClose={onClose} opened title={t`Set up secret key`}>- <Stack>- <Flex align="end" gap="1rem">- <TextInput- onChange={(event) => setSecretKey(event.target.value || "")}- value={secretValue}- disabled={isGenerating}- rightSection={- isGenerating ? (- <Loader size="xs" />- ) : (- <Tooltip label={t`Copy to clipboard`}>- <ActionIcon- aria-label={t`Copy to clipboard`}- onClick={async () => {- try {- await navigator.clipboard.writeText(secretValue);- sendSuccessToast(t`Secret key copied to clipboard`);- } catch {- sendErrorToast(- t`Error copying secret key to clipboard.`,- );- }- }}- >- <Icon name="copy" />- </ActionIcon>- </Tooltip>- )- }- flex="1 0 auto"- aria-label={t`New secret key`}- />- <Button flex="0 0 auto" variant="filled" onClick={generateToken}>- {t`Regenerate key`}- </Button>- </Flex>- <Stack gap="sm">- <Alert size="compact" color="warning">- {t`Make sure you copy this key now and save it in a safe place.`}- <Text fw="bold" component="strong" display="block">- {t`You won't be able to see it again.`}- </Text>- </Alert>- {!!currentValue && (- <Alert size="compact" color="warning" mt="lg">- <Text component="strong" fw="bold">- {t`This will cause existing tokens to stop working until the identity provider is updated with the new key.`}- </Text>- </Alert>- )}- </Stack>+ <Modal+ opened+ onClose={onClose}+ title={title}+ // No escape hatches: the key is unrecoverable once this closes. A hung+ // request keeps the modal up until fetch gives up and the catch closes it.+ withCloseButton={false}+ closeOnClickOutside={false}+ closeOnEscape={false}+ >+ <Stack gap="xl" mt="lg">+ <Text>+ {t`Store this key somewhere safe. For security reasons, we can't show it to you again.`}+ </Text>++ <TextInput+ aria-label={t`New secret key`}+ value={secretKey}+ classNames={{ input: S.secretKeyInput }}+ {...copyFieldProps}+ rightSection={+ !secretKey ? <Loader size="xs" /> : copyFieldProps.rightSection+ }+ />- <Group justify="flex-end" gap="sm" mt="sm">- <Button onClick={onClose} variant="subtle">{t`Cancel`}</Button>+ <Group justify="flex-end" gap="sm">+ {withCancelButton && <Button onClick={onClose}>{t`Cancel`}</Button>}<Button- disabled={secretValue.length < MIN_SECRET_LENGTH}- onClick={() => onConfirm(secretValue)}+ data-autofocus+ disabled={!secretKey}+ onClick={() => onConfirm(secretKey)}variant="filled">- {t`Done`}+ {confirmLabel}</Button></Group></Stack>diff --git a/frontend/src/metabase/home/components/EmbedHomepage/EmbedJsContent.tsx b/frontend/src/metabase/home/components/EmbedHomepage/EmbedJsContent.tsxindex 4d4a1489bb5..87ae1d1356e 100644--- a/frontend/src/metabase/home/components/EmbedHomepage/EmbedJsContent.tsx+++ b/frontend/src/metabase/home/components/EmbedHomepage/EmbedJsContent.tsx@@ -22,11 +22,7 @@ export const EmbedJsContent = ({}: EmbedJsContentProps) => {const cta = match({ variant, hasEmbeddingFeature }).with({ variant: "ee", hasEmbeddingFeature: true }, () => (- <Button- component={Link}- to={"/admin/embedding/setup-guide"}- variant="outline"- >+ <Button component={Link} to={"/embedding/get-started"} variant="outline">{t`Go to setup guide`}</Button>))diff --git a/frontend/src/metabase/home/components/EmbeddingHubHomePage/index.ts b/frontend/src/metabase/home/components/EmbeddingHubHomePage/index.tsdeleted file mode 100644index a628f65ff83..00000000000--- a/frontend/src/metabase/home/components/EmbeddingHubHomePage/index.ts+++ /dev/null@@ -1 +0,0 @@-export { EmbeddingHubHomePage } from "./EmbeddingHubHomePage";diff --git a/frontend/src/metabase/home/components/HomeLayout/HomeLayout.tsx b/frontend/src/metabase/home/components/HomeLayout/HomeLayout.tsxindex c3447abf5c8..bc0bf636105 100644--- a/frontend/src/metabase/home/components/HomeLayout/HomeLayout.tsx+++ b/frontend/src/metabase/home/components/HomeLayout/HomeLayout.tsx@@ -11,8 +11,8 @@ import { useSetting } from "metabase/settings";import { Box, Button, Icon, Tooltip } from "metabase/ui";import { CustomHomePageModal } from "../CustomHomePageModal";-import { EmbeddingHubHomePage } from "../EmbeddingHubHomePage";import { HomeGreeting } from "../HomeGreeting";+import { SetupGuideHomePage } from "../SetupGuideHomePage";interface HomeLayoutProps {children?: ReactNode;@@ -32,7 +32,7 @@ export const HomeLayout = ({ children }: HomeLayoutProps): ReactNode => {user?.is_superuser &&isSimpleEmbeddingAvailable) {- return <EmbeddingHubHomePage />;+ return <SetupGuideHomePage />;}return (diff --git a/frontend/src/metabase/home/components/EmbeddingHubHomePage/EmbeddingHubHomePage.tsx b/frontend/src/metabase/home/components/SetupGuideHomePage/SetupGuideHomePage.tsxsimilarity index 88%rename from frontend/src/metabase/home/components/EmbeddingHubHomePage/EmbeddingHubHomePage.tsxrename to frontend/src/metabase/home/components/SetupGuideHomePage/SetupGuideHomePage.tsxindex bddd9c37614..955e76838eb 100644--- a/frontend/src/metabase/home/components/EmbeddingHubHomePage/EmbeddingHubHomePage.tsx+++ b/frontend/src/metabase/home/components/SetupGuideHomePage/SetupGuideHomePage.tsx@@ -2,7 +2,7 @@ import { useDisclosure } from "@mantine/hooks";import type { ReactNode } from "react";import { t } from "ttag";-import { EmbeddingHub } from "metabase/embedding/embedding-hub";+import { SetupGuide } from "metabase/embedding/setup-guide";import { useDispatch } from "metabase/redux";import { ActionIcon, Group, Icon, Menu, Stack, Text } from "metabase/ui";@@ -11,9 +11,9 @@ import { dismissEmbeddingHomepage } from "../EmbedHomepage/actions";import { MetabotGreeting } from "../HomeGreeting";/**- * Embedding Hub shown in the embedding home page for admins in EE instances.+ * Setup guide shown in the embedding home page for admins in EE instances.*/-export const EmbeddingHubHomePage = (): ReactNode => {+export const SetupGuideHomePage = (): ReactNode => {const [isCustomHomePageModalOpened,{ open: openCustomHomePageModal, close: closeCustomHomePageModal },@@ -58,7 +58,7 @@ export const EmbeddingHubHomePage = (): ReactNode => {</Menu></Group>- <EmbeddingHub />+ <SetupGuide returnTo="/" /><CustomHomePageModalisOpen={isCustomHomePageModalOpened}diff --git a/frontend/src/metabase/home/components/SetupGuideHomePage/index.ts b/frontend/src/metabase/home/components/SetupGuideHomePage/index.tsnew file mode 100644index 00000000000..a2fc24390d9--- /dev/null+++ b/frontend/src/metabase/home/components/SetupGuideHomePage/index.ts@@ -0,0 +1 @@+export { SetupGuideHomePage } from "./SetupGuideHomePage";diff --git a/frontend/src/metabase/nav/components/AppSwitcher/AppSwitcher.tsx b/frontend/src/metabase/nav/components/AppSwitcher/AppSwitcher.tsxindex d5dc2fa2477..2f929b03475 100644--- a/frontend/src/metabase/nav/components/AppSwitcher/AppSwitcher.tsx+++ b/frontend/src/metabase/nav/components/AppSwitcher/AppSwitcher.tsx@@ -7,6 +7,7 @@ import { ExternalLink } from "metabase/common/components/ExternalLink";import { ForwardRefLink } from "metabase/common/components/Link";import { trackDataStudioOpened } from "metabase/common/data-studio/analytics";import { canAccessDataStudio as canAccessDataStudioSelector } from "metabase/common/data-studio/selectors";+import { canAccessEmbeddingHub as canAccessEmbeddingHubSelector } from "metabase/common/embedding-hub/selectors";import { useHelpLink } from "metabase/common/hooks";import { trackMonitorOpened } from "metabase/common/monitor/analytics";import { canAccessMonitor as canAccessMonitorSelector } from "metabase/common/monitor/selectors";@@ -61,6 +62,7 @@ export const AppSwitcher = ({ className }: { className?: string }) => {const canAccessOnboardingPage = useSelector(getCanAccessOnboardingPage);const canAccessDataStudio = useSelector(canAccessDataStudioSelector);const canAccessMonitor = useSelector(canAccessMonitorSelector);+ const canAccessEmbeddingHub = useSelector(canAccessEmbeddingHubSelector);const isNewInstance = useSelector(getIsNewInstance);const helpLink = useHelpLink();@@ -77,7 +79,12 @@ export const AppSwitcher = ({ className }: { className?: string }) => {const appsSection = useMemo(() => {const showAdminSettingsItem = adminItems?.length > 0;- if (!canAccessDataStudio && !canAccessMonitor && !showAdminSettingsItem) {+ if (+ !canAccessDataStudio &&+ !canAccessMonitor &&+ !canAccessEmbeddingHub &&+ !showAdminSettingsItem+ ) {return null;}@@ -97,6 +104,21 @@ export const AppSwitcher = ({ className }: { className?: string }) => {</Menu.Item>,];+ if (showAdminSettingsItem) {+ items.push(+ <Menu.Item+ key="admin-app-link"+ component={ForwardRefLink}+ to={"/admin"}+ leftSection={+ <Icon+ name="io"+ {...(currentApp === "admin" ? CURRENT_APP_ICON_OVERRIDES : null)}+ />+ }+ >{t`Admin`}</Menu.Item>,+ );+ }if (canAccessDataStudio) {items.push(<Menu.Item@@ -139,19 +161,23 @@ export const AppSwitcher = ({ className }: { className?: string }) => {</Menu.Item>,);}- if (showAdminSettingsItem) {+ if (canAccessEmbeddingHub) {items.push(<Menu.Item- key="admin-app-link"+ key="embedding-hub-link"component={ForwardRefLink}- to={"/admin"}+ to={Urls.embeddingHub()}leftSection={<Icon- name="io"- {...(currentApp === "admin" ? CURRENT_APP_ICON_OVERRIDES : null)}+ name="embed"+ {...(currentApp === "embedding-hub"+ ? CURRENT_APP_ICON_OVERRIDES+ : null)}/>}- >{t`Admin`}</Menu.Item>,+ >+ {t`Embedding hub`}+ </Menu.Item>,);}@@ -161,7 +187,13 @@ export const AppSwitcher = ({ className }: { className?: string }) => {<Box px="lg">{items}</Box></>);- }, [canAccessDataStudio, canAccessMonitor, adminItems, currentApp]);+ }, [+ canAccessDataStudio,+ canAccessMonitor,+ canAccessEmbeddingHub,+ adminItems,+ currentApp,+ ]);// If the instance is not new, we remove the link from the sidebar automatically and show it here instead!const showOnboardingLink = !isNewInstance && canAccessOnboardingPage;diff --git a/frontend/src/metabase/nav/components/AppSwitcher/AppSwitcher.unit.spec.tsx b/frontend/src/metabase/nav/components/AppSwitcher/AppSwitcher.unit.spec.tsxindex 7d2a2be95c7..a7aba5becb2 100644--- a/frontend/src/metabase/nav/components/AppSwitcher/AppSwitcher.unit.spec.tsx+++ b/frontend/src/metabase/nav/components/AppSwitcher/AppSwitcher.unit.spec.tsx@@ -40,7 +40,7 @@ const REGULAR_ITEMS = [const ADMIN_ITEMS = [...REGULAR_ITEMS, "Main app", "Admin"];const HOSTED_ITEMS = [...ADMIN_ITEMS];-const WITH_AREAS = [...ADMIN_ITEMS, "Data studio", "Monitor"];+const WITH_AREAS = [...ADMIN_ITEMS, "Data studio", "Monitor", "Embedding hub"];const adminNavItem = {getName: () => `People`,@@ -86,6 +86,7 @@ async function setup({<Route path="/admin" element={<AppSwitcher />} /><Route path="/data-studio" element={<AppSwitcher />} /><Route path="/monitor" element={<AppSwitcher />} />+ <Route path="/embedding" element={<AppSwitcher />} /></>,{withRouter: true,@@ -175,6 +176,10 @@ describe("ProfileLink", () => {await openProfileLink();await assertActiveApp("monitor");+ await userEvent.click(await getEmbeddingHubMenuItem());+ await openProfileLink();+ await assertActiveApp("embedding-hub");+await userEvent.click(await getMainAppMenuItem());await openProfileLink();await assertActiveApp("main");@@ -209,6 +214,32 @@ describe("ProfileLink", () => {});});+ it("should not show the embedding hub to non-admins", async () => {+ await setup({ isAdmin: false });++ expect(screen.queryByText("Embedding hub")).not.toBeInTheDocument();+ });++ it("should render the app entries in the designed order", async () => {+ await setup({ isAdmin: true });++ const appOrder = [+ "Main app",+ "Admin",+ "Data studio",+ "Monitor",+ "Embedding hub",+ ];+ const menuItems = await screen.findAllByRole("menuitem");+ const appMenuItems = menuItems.filter((menuItem) =>+ appOrder.includes(menuItem.textContent ?? ""),+ );++ expect(appMenuItems.map((menuItem) => menuItem.textContent)).toEqual(+ appOrder,+ );+ });+it("tracks opening Monitor from the app switcher", async () => {trackMonitorOpened.mockClear();await setup({ isAdmin: true });@@ -351,6 +382,11 @@ const assertActiveApp = async (current: CurrentApp) => {name: current === "monitor" ? /check_filled/i : /pulse/i,}),).toBeInTheDocument();+ expect(+ await within(await getEmbeddingHubMenuItem()).findByRole("img", {+ name: current === "embedding-hub" ? /check_filled/i : /embed/i,+ }),+ ).toBeInTheDocument();};const getMainAppMenuItem = () =>@@ -361,3 +397,5 @@ const getDataStudioMenuItem = () =>screen.findByRole("menuitem", { name: /data studio/i });const getMonitorMenuItem = () =>screen.findByRole("menuitem", { name: /monitor/i });+const getEmbeddingHubMenuItem = () =>+ screen.findByRole("menuitem", { name: /embedding hub/i });diff --git a/frontend/src/metabase/nav/components/AppSwitcher/useGetCurrentApp.tsx b/frontend/src/metabase/nav/components/AppSwitcher/useGetCurrentApp.tsxindex 632f41f46c9..423094e49af 100644--- a/frontend/src/metabase/nav/components/AppSwitcher/useGetCurrentApp.tsx+++ b/frontend/src/metabase/nav/components/AppSwitcher/useGetCurrentApp.tsx@@ -1,8 +1,14 @@import { match } from "ts-pattern";import { useLocation } from "metabase/router";+import * as Urls from "metabase/urls";-export type CurrentApp = "main" | "admin" | "data-studio" | "monitor";+export type CurrentApp =+ | "main"+ | "admin"+ | "data-studio"+ | "monitor"+ | "embedding-hub";export const useGetCurrentApp = (): CurrentApp => {const location = useLocation();@@ -19,5 +25,9 @@ export const useGetCurrentApp = (): CurrentApp => {(path) => path.startsWith("/monitor"),() => "monitor",)+ .when(+ (path) => path.startsWith(Urls.embeddingHub()),+ () => "embedding-hub",+ ).otherwise(() => "main");};diff --git a/frontend/src/metabase/nav/components/AreaLayout/AreaContent.tsx b/frontend/src/metabase/nav/components/AreaLayout/AreaContent.tsxindex ea00a476cec..d53b5fb5466 100644--- a/frontend/src/metabase/nav/components/AreaLayout/AreaContent.tsx+++ b/frontend/src/metabase/nav/components/AreaLayout/AreaContent.tsx@@ -7,16 +7,21 @@ export const CONTENT_PADDING_X = "3.5rem";type AreaContentProps = {children?: ReactNode;+ /** Drops the content padding so a page can use the whole area, for editors+ * that put a panel and a live preview side by side. Mirrors `fullWidth` on+ * `AdminSettingsLayout`. */+ fullWidth?: boolean;};export const AreaContent = memo(function AreaContent({children,+ fullWidth = false,}: AreaContentProps) {return (<Boxh="100%"- px={CONTENT_PADDING_X}- py="1.5rem"+ px={fullWidth ? 0 : CONTENT_PADDING_X}+ py={fullWidth ? 0 : "1.5rem"}style={{ overflowY: "auto" }}><ErrorBoundary>{children}</ErrorBoundary>diff --git a/frontend/src/metabase/nav/components/AreaLayout/AreaLayout.tsx b/frontend/src/metabase/nav/components/AreaLayout/AreaLayout.tsxindex 399c24685ce..54593942ce4 100644--- a/frontend/src/metabase/nav/components/AreaLayout/AreaLayout.tsx+++ b/frontend/src/metabase/nav/components/AreaLayout/AreaLayout.tsx@@ -9,6 +9,7 @@ import { AreaNavbarHeader } from "./AreaNavbarHeader";type AreaLayoutProps = {logo: ReactNode;+ title?: ReactNode;testId: string;isLoading: boolean;isNavbarOpened: boolean;@@ -24,6 +25,7 @@ type AreaLayoutProps = {*/export function AreaLayout({logo,+ title,testId,isLoading,isNavbarOpened,@@ -62,6 +64,7 @@ export function AreaLayout({<Stack gap="lg" flex={1} mih={0} className={S.upperGroup}><AreaNavbarHeaderlogo={logo}+ title={title}headerControls={headerControls}isNavbarOpened={isNavbarOpened}onNavbarToggle={onNavbarToggle}diff --git a/frontend/src/metabase/nav/components/AreaLayout/AreaNavButton.tsx b/frontend/src/metabase/nav/components/AreaLayout/AreaNavButton.tsxnew file mode 100644index 00000000000..df6bacb76d3--- /dev/null+++ b/frontend/src/metabase/nav/components/AreaLayout/AreaNavButton.tsx@@ -0,0 +1,46 @@+import { Button, FixedSizeIcon, Tooltip } from "metabase/ui";+import type { IconName } from "metabase-types/api";++import { TOOLTIP_OPEN_DELAY } from "./constants";++type AreaNavButtonProps = {+ label: string;+ icon: IconName;+ showLabel: boolean;+ onClick: () => void;+};++/**+ * An action in the nav, sitting alongside the [[AreaTab]]s but not one of them:+ * it goes nowhere, so it is a button and never reads as the current page.+ */+export function AreaNavButton({+ label,+ icon,+ showLabel,+ onClick,+}: AreaNavButtonProps) {+ return (+ <Tooltip+ label={label}+ position="right"+ openDelay={TOOLTIP_OPEN_DELAY}+ disabled={showLabel}+ >+ <Button+ variant="filled"+ size="md"+ fullWidth+ // Collapsed, this button sets the nav rail's width, so it takes the+ // [[AreaTab]]s' 32px box rather than a button's taller, wider one.+ h={showLabel ? undefined : "xxl"}+ p={showLabel ? undefined : "sm"}+ leftSection={<FixedSizeIcon name={icon} display="block" />}+ onClick={onClick}+ aria-label={label}+ >+ {showLabel && label}+ </Button>+ </Tooltip>+ );+}diff --git a/frontend/src/metabase/nav/components/AreaLayout/AreaNavbarHeader.tsx b/frontend/src/metabase/nav/components/AreaLayout/AreaNavbarHeader.tsxindex 04f034957c0..f1640b28bfb 100644--- a/frontend/src/metabase/nav/components/AreaLayout/AreaNavbarHeader.tsx+++ b/frontend/src/metabase/nav/components/AreaLayout/AreaNavbarHeader.tsx@@ -1,13 +1,14 @@import cx from "classnames";import type { ReactNode } from "react";-import { Box, Flex, Group } from "metabase/ui";+import { Box, Flex, Group, Text } from "metabase/ui";import S from "./AreaLayout.module.css";import { ToggleActionIcon } from "./ToggleActionIcon";type AreaNavbarHeaderProps = {logo: ReactNode;+ title?: ReactNode;headerControls?: ReactNode;isNavbarOpened: boolean;onNavbarToggle: (isOpened: boolean) => void;@@ -15,6 +16,7 @@ type AreaNavbarHeaderProps = {export function AreaNavbarHeader({logo,+ title,headerControls,isNavbarOpened,onNavbarToggle,@@ -38,6 +40,11 @@ export function AreaNavbarHeader({/>)}</Box>+ {isNavbarOpened && title && (+ <Text fw="bold" c="text-primary">+ {title}+ </Text>+ )}{isNavbarOpened && headerControls}</Group>{isNavbarOpened && (diff --git a/frontend/src/metabase/nav/components/AreaLayout/AreaNavbarHeader.unit.spec.tsx b/frontend/src/metabase/nav/components/AreaLayout/AreaNavbarHeader.unit.spec.tsxindex f55ba7a67b8..addd38dd8f9 100644--- a/frontend/src/metabase/nav/components/AreaLayout/AreaNavbarHeader.unit.spec.tsx+++ b/frontend/src/metabase/nav/components/AreaLayout/AreaNavbarHeader.unit.spec.tsx@@ -6,14 +6,16 @@ import { AreaNavbarHeader } from "./AreaNavbarHeader";interface SetupOpts {isNavbarOpened?: boolean;+ title?: string;}-const setup = ({ isNavbarOpened = true }: SetupOpts = {}) => {+const setup = ({ isNavbarOpened = true, title }: SetupOpts = {}) => {const onNavbarToggle = jest.fn();renderWithProviders(<AreaNavbarHeaderlogo={<div>{"Logo"}</div>}+ title={title}headerControls={<div>{"Header controls"}</div>}isNavbarOpened={isNavbarOpened}onNavbarToggle={onNavbarToggle}@@ -30,6 +32,18 @@ describe("AreaNavbarHeader", () => {expect(screen.getByText("Logo")).toBeInTheDocument();});+ it("renders the title when the navbar is open", () => {+ setup({ isNavbarOpened: true, title: "Embedding hub" });++ expect(screen.getByText("Embedding hub")).toBeInTheDocument();+ });++ it("hides the title when the navbar is closed, leaving room for the logo alone", () => {+ setup({ isNavbarOpened: false, title: "Embedding hub" });++ expect(screen.queryByText("Embedding hub")).not.toBeInTheDocument();+ });+it("renders header controls when the navbar is open", () => {setup({ isNavbarOpened: true });diff --git a/frontend/src/metabase/nav/components/AreaLayout/index.ts b/frontend/src/metabase/nav/components/AreaLayout/index.tsindex d228860447f..3a3aabda242 100644--- a/frontend/src/metabase/nav/components/AreaLayout/index.ts+++ b/frontend/src/metabase/nav/components/AreaLayout/index.ts@@ -1,4 +1,5 @@export * from "./AreaContent";export * from "./AreaLayout";+export * from "./AreaNavButton";export * from "./AreaTab";export * from "./AreaTabGroup";diff --git a/frontend/src/metabase/nav/containers/MainNavbar/MainNavbarContainer/AddDataModal/AddDataModal.tsx b/frontend/src/metabase/nav/containers/MainNavbar/MainNavbarContainer/AddDataModal/AddDataModal.tsxindex 1fc60186a48..c4c4e3c6ec7 100644--- a/frontend/src/metabase/nav/containers/MainNavbar/MainNavbarContainer/AddDataModal/AddDataModal.tsx+++ b/frontend/src/metabase/nav/containers/MainNavbar/MainNavbarContainer/AddDataModal/AddDataModal.tsx@@ -24,7 +24,8 @@ interface AddDataModalProps {onClose: () => void;initialTab?: AddDataTab;- fromEmbeddingSetupGuide?: boolean;+ /** Path of the setup guide that opened this, so the flow can return there. */+ returnToSetupGuide?: string;}interface Tabs {@@ -54,7 +55,7 @@ const AddDataModalContent = ({opened,onClose,initialTab,- fromEmbeddingSetupGuide,+ returnToSetupGuide,}: AddDataModalProps) => {const { areUploadsEnabled, canManageUploads, isAdmin, hasAttachedDwh } =useAddDataState();@@ -157,7 +158,7 @@ const AddDataModalContent = ({<Tabs.Panel value="db" className={S.panel}><DatabasesPanelcanSeeContent={isAdmin}- fromEmbeddingSetupGuide={fromEmbeddingSetupGuide}+ returnToSetupGuide={returnToSetupGuide}/></Tabs.Panel><Tabs.Panel value="csv" className={S.panel}>diff --git a/frontend/src/metabase/nav/containers/MainNavbar/MainNavbarContainer/AddDataModal/Panels/DatabasesPanel.tsx b/frontend/src/metabase/nav/containers/MainNavbar/MainNavbarContainer/AddDataModal/Panels/DatabasesPanel.tsxindex 3a056c3a07a..5a1a256e71b 100644--- a/frontend/src/metabase/nav/containers/MainNavbar/MainNavbarContainer/AddDataModal/Panels/DatabasesPanel.tsx+++ b/frontend/src/metabase/nav/containers/MainNavbar/MainNavbarContainer/AddDataModal/Panels/DatabasesPanel.tsx@@ -8,18 +8,19 @@ import { DatabasePanelEmptyState } from "./AddDataModalEmptyStates";export const DatabasesPanel = ({canSeeContent,- fromEmbeddingSetupGuide,+ returnToSetupGuide,}: {canSeeContent: boolean;- fromEmbeddingSetupGuide?: boolean;+ /** Path of the setup guide that opened this, so the flow can return there. */+ returnToSetupGuide?: string;}) => {const navigate = useNavigate();const handleDatabaseSelect = (key: string) => {trackDatabaseSelect(key);const params = new URLSearchParams({ engine: key });- if (fromEmbeddingSetupGuide) {- params.set(RETURN_TO_SETUP_GUIDE_PARAM, "true");+ if (returnToSetupGuide) {+ params.set(RETURN_TO_SETUP_GUIDE_PARAM, returnToSetupGuide);}navigate(`/admin/databases/create?${params.toString()}`);};diff --git a/frontend/src/metabase/plugins/index.ts b/frontend/src/metabase/plugins/index.tsindex 9db9dd018cd..d56b6c6df85 100644--- a/frontend/src/metabase/plugins/index.ts+++ b/frontend/src/metabase/plugins/index.ts@@ -10,6 +10,7 @@ export {PLUGIN_ADMIN_USER_FORM_FIELDS,type AuthSettingsPageProps,type AuthSettingsPageTab,+ type SettingsJWTFormProps,} from "./oss/auth";export {PLUGIN_CACHING,diff --git a/frontend/src/metabase/plugins/oss/auth.ts b/frontend/src/metabase/plugins/oss/auth.tsindex 5e03bd491b8..70cc172d6d3 100644--- a/frontend/src/metabase/plugins/oss/auth.ts+++ b/frontend/src/metabase/plugins/oss/auth.ts@@ -1,4 +1,4 @@-import type { ComponentType } from "react";+import type { ComponentType, ReactNode } from "react";import {PluginPlaceholder,@@ -18,6 +18,11 @@ export type AuthSettingsPageProps = {tab?: AuthSettingsPageTab;};+export type SettingsJWTFormProps = {+ /** `null` renders the form with no heading -- the embedding hub supplies its own. */+ title?: ReactNode;+};+const getDefaultPluginAuthProviders = () => ({isEnabled: () => false,AuthSettingsPage: PluginPlaceholder<AuthSettingsPageProps>,diff --git a/frontend/src/metabase/plugins/oss/settings.ts b/frontend/src/metabase/plugins/oss/settings.tsindex efacd722eef..806a7933cf4 100644--- a/frontend/src/metabase/plugins/oss/settings.ts+++ b/frontend/src/metabase/plugins/oss/settings.ts@@ -5,7 +5,9 @@ import { PluginPlaceholder } from "metabase/plugins/components/PluginPlaceholderimport { definePluginSlot } from "../slot";const getDefaultPluginAdminSettings = () => ({- InteractiveEmbeddingSettingsCard: null,+ // The origins list is its own card on the hub's Security tab, below the+ // methods card, so it is registered separately from the settings card.+ InteractiveEmbeddingAuthorizedOriginsWidget: null,LicenseAndBillingSettings: PluginPlaceholder,useUpsellFlow: (_props: {campaign: string;@@ -18,7 +20,7 @@ const getDefaultPluginAdminSettings = () => ({});export const PLUGIN_ADMIN_SETTINGS: {- InteractiveEmbeddingSettingsCard: ComponentType | null;+ InteractiveEmbeddingAuthorizedOriginsWidget: ComponentType | null;LicenseAndBillingSettings: ComponentType;useUpsellFlow: (props: { campaign: string; location: string }) => {triggerUpsellFlow: (() => void) | undefined;diff --git a/frontend/src/metabase/plugins/oss/whitelabel.ts b/frontend/src/metabase/plugins/oss/whitelabel.tsindex 8fe3171be0b..582a5a4c0cb 100644--- a/frontend/src/metabase/plugins/oss/whitelabel.ts+++ b/frontend/src/metabase/plugins/oss/whitelabel.ts@@ -5,6 +5,9 @@ import { definePluginSlot } from "../slot";const getDefaultPluginWhitelabel = () => ({WhiteLabelBrandingSettingsPage: PluginPlaceholder,WhiteLabelConcealSettingsPage: PluginPlaceholder,+ // The subset of the whitelabel appearance settings that show up inside an+ // embed, for the embedding hub's Appearance tab.+ EmbeddedAppearanceSettings: PluginPlaceholder,});export const PLUGIN_WHITELABEL = definePluginSlot(getDefaultPluginWhitelabel);diff --git a/frontend/src/metabase/query_builder/components/view/ViewHeader/components/ViewTitleHeaderRightSide/QuestionSharingMenu/tests/setup.tsx b/frontend/src/metabase/query_builder/components/view/ViewHeader/components/ViewTitleHeaderRightSide/QuestionSharingMenu/tests/setup.tsxindex ae30b89a800..66354407a1a 100644--- a/frontend/src/metabase/query_builder/components/view/ViewHeader/components/ViewTitleHeaderRightSide/QuestionSharingMenu/tests/setup.tsx+++ b/frontend/src/metabase/query_builder/components/view/ViewHeader/components/ViewTitleHeaderRightSide/QuestionSharingMenu/tests/setup.tsx@@ -69,7 +69,7 @@ const setupState = ({const settingValues = createMockSettings({"token-features": tokenFeatures,"enable-public-sharing": isPublicSharingEnabled,- "enable-embedding-static": isEmbeddingEnabled,+ "enable-embedding-modular": isEmbeddingEnabled,"email-configured?": isEmailSetup,"slack-token-valid?": isSlackSetup,});diff --git a/frontend/src/metabase/redux/store/admin.ts b/frontend/src/metabase/redux/store/admin.tsindex 00adc37736a..fae690a489a 100644--- a/frontend/src/metabase/redux/store/admin.ts+++ b/frontend/src/metabase/redux/store/admin.ts@@ -9,7 +9,6 @@ import type {export type AdminPathKey =| "data-model"| "settings"- | "embedding"| "metabot"| "people"| "databases"diff --git a/frontend/src/metabase/routes.tsx b/frontend/src/metabase/routes.tsxindex 719752de4e8..46970e86e5f 100644--- a/frontend/src/metabase/routes.tsx+++ b/frontend/src/metabase/routes.tsx@@ -20,6 +20,7 @@ import { MoveQuestionsIntoDashboardsModal } from "metabase/common/components/Movimport { NotFoundFallbackPage } from "metabase/common/components/NotFoundFallbackPage";import { UnsubscribePage } from "metabase/common/components/Unsubscribe";import { getDataStudioRoutes } from "metabase/data-studio/routes";+import { getEmbeddingHubRoutes } from "metabase/embedding-hub/routes";import { getMetabotRoutes } from "metabase/metabot/routes";import { getMetricRoutes } from "metabase/metrics/routes";import NewModelOptions from "metabase/models/containers/NewModelOptions";@@ -539,6 +540,9 @@ export const getRoutes = (store: AppStore): RouteObject[] => [// MONITOR...toRouteObjects(getMonitorRoutes()),++ // EMBEDDING HUB+ ...toRouteObjects(getEmbeddingHubRoutes()),],},],diff --git a/frontend/src/metabase/admin/settings/components/widgets/AdminSettingInput.tsx b/frontend/src/metabase/settings-components/AdminSettingInput.tsxsimilarity index 96%rename from frontend/src/metabase/admin/settings/components/widgets/AdminSettingInput.tsxrename to frontend/src/metabase/settings-components/AdminSettingInput.tsxindex f1ef50d6ba4..a0f8351390d 100644--- a/frontend/src/metabase/admin/settings/components/widgets/AdminSettingInput.tsx+++ b/frontend/src/metabase/settings-components/AdminSettingInput.tsx@@ -1,7 +1,6 @@import { useEffect, useState } from "react";import { t } from "ttag";-import { isSettingSetFromEnvVar } from "metabase/admin/settings/settings";import { SetByEnvVar } from "metabase/common/components/SetByEnvVar";import { useAdminSetting } from "metabase/settings";import {@@ -22,7 +21,8 @@ import type {SettingKey,} from "metabase-types/api";-import { SettingHeader } from "../SettingHeader";+import { SettingHeader } from "./SettingHeader";+import { isSettingSetFromEnvVar } from "./is-setting-set-from-env-var";type SelectInputType = "select";type RadioInputType = "radio";@@ -68,8 +68,8 @@ export type AdminSettingInputProps<S extends EnterpriseSettingKey> = {/*** A simple admin settings component for basic needs, if you need something special,- * create a special component (in the widgets/ folder) instead of building one-off- * features into this component+ * create a special component (in admin/settings/components/widgets/) instead of+ * building one-off features into this component*/export function AdminSettingInput<SettingName extends EnterpriseSettingKey>({title,diff --git a/frontend/src/metabase/admin/settings/components/widgets/AdminSettingInput.unit.spec.tsx b/frontend/src/metabase/settings-components/AdminSettingInput.unit.spec.tsxsimilarity index 100%rename from frontend/src/metabase/admin/settings/components/widgets/AdminSettingInput.unit.spec.tsxrename to frontend/src/metabase/settings-components/AdminSettingInput.unit.spec.tsxdiff --git a/frontend/src/metabase/admin/settings/components/SettingHeader/SettingHeader.tsx b/frontend/src/metabase/settings-components/SettingHeader/SettingHeader.tsxsimilarity index 100%rename from frontend/src/metabase/admin/settings/components/SettingHeader/SettingHeader.tsxrename to frontend/src/metabase/settings-components/SettingHeader/SettingHeader.tsxdiff --git a/frontend/src/metabase/admin/settings/components/SettingHeader/index.ts b/frontend/src/metabase/settings-components/SettingHeader/index.tssimilarity index 100%rename from frontend/src/metabase/admin/settings/components/SettingHeader/index.tsrename to frontend/src/metabase/settings-components/SettingHeader/index.tsdiff --git a/frontend/src/metabase/admin/components/SettingsSection/SettingsSection.module.css b/frontend/src/metabase/settings-components/SettingsSection/SettingsSection.module.csssimilarity index 100%rename from frontend/src/metabase/admin/components/SettingsSection/SettingsSection.module.cssrename to frontend/src/metabase/settings-components/SettingsSection/SettingsSection.module.cssdiff --git a/frontend/src/metabase/admin/components/SettingsSection/SettingsSection.tsx b/frontend/src/metabase/settings-components/SettingsSection/SettingsSection.tsxsimilarity index 100%rename from frontend/src/metabase/admin/components/SettingsSection/SettingsSection.tsxrename to frontend/src/metabase/settings-components/SettingsSection/SettingsSection.tsxdiff --git a/frontend/src/metabase/admin/components/SettingsSection/SettingsSection.unit.spec.tsx b/frontend/src/metabase/settings-components/SettingsSection/SettingsSection.unit.spec.tsxsimilarity index 100%rename from frontend/src/metabase/admin/components/SettingsSection/SettingsSection.unit.spec.tsxrename to frontend/src/metabase/settings-components/SettingsSection/SettingsSection.unit.spec.tsxdiff --git a/frontend/src/metabase/admin/components/SettingsSection/index.ts b/frontend/src/metabase/settings-components/SettingsSection/index.tssimilarity index 100%rename from frontend/src/metabase/admin/components/SettingsSection/index.tsrename to frontend/src/metabase/settings-components/SettingsSection/index.tsdiff --git a/frontend/src/metabase/settings-components/index.ts b/frontend/src/metabase/settings-components/index.tsnew file mode 100644index 00000000000..745a0cc787d--- /dev/null+++ b/frontend/src/metabase/settings-components/index.ts@@ -0,0 +1,16 @@+export {+ AdminSettingInput,+ BasicAdminSettingInput,+ SetByEnvVarWrapper,+ type AdminSettingInputProps,+} from "./AdminSettingInput";+export { isSettingSetFromEnvVar } from "./is-setting-set-from-env-var";+export { SettingHeader, SettingTitle } from "./SettingHeader";+export {+ CollapsibleSettingsSection,+ SETTINGS_CARD_DESCRIPTION_PROPS,+ SETTINGS_CARD_STACK_PROPS,+ SETTINGS_CARD_TITLE_PROPS,+ SettingsPageWrapper,+ SettingsSection,+} from "./SettingsSection";diff --git a/frontend/src/metabase/admin/settings/settings.ts b/frontend/src/metabase/settings-components/is-setting-set-from-env-var.tssimilarity index 100%rename from frontend/src/metabase/admin/settings/settings.tsrename to frontend/src/metabase/settings-components/is-setting-set-from-env-var.tsdiff --git a/frontend/src/metabase/settings/api.ts b/frontend/src/metabase/settings/api.tsindex fbf647d0309..ffc73d66acc 100644--- a/frontend/src/metabase/settings/api.ts+++ b/frontend/src/metabase/settings/api.ts@@ -90,6 +90,7 @@ export const settingsApi = Api.injectEndpoints({invalidatesTags: (_, error, { key }) => {return invalidateTags(error, [tag("session-properties"),+ listTag("setup-guide-checklist"),...(key === "uploads-settings" ? [listTag("database")] : []),...(key === "mfa-enforcement" ? [tag("mfa-status")] : []),@@ -107,7 +108,7 @@ export const settingsApi = Api.injectEndpoints({invalidatesTags: (_, error, settings) =>invalidateTags(error, [tag("session-properties"),- listTag("embedding-hub-checklist"),+ listTag("setup-guide-checklist"),// Saving a custom homepage also changes the current user server-side...("custom-homepage" in settings ||"custom-homepage-dashboard" in settingsdiff --git a/frontend/src/metabase/settings/use-admin-setting.unit.spec.tsx b/frontend/src/metabase/settings/use-admin-setting.unit.spec.tsxindex 8fd90e7088a..15fbb2807ab 100644--- a/frontend/src/metabase/settings/use-admin-setting.unit.spec.tsx+++ b/frontend/src/metabase/settings/use-admin-setting.unit.spec.tsx@@ -8,6 +8,7 @@ import {setupUpdateSettingsEndpoint,} from "__support__/server-mocks";import { renderWithProviders, screen, waitFor } from "__support__/ui";+import { useGetSetupGuideChecklistQuery } from "metabase/embedding/setup-guide/api/setup-guide";import {createMockSettingDefinition,createMockSettings,@@ -40,6 +41,27 @@ const TestComponent = () => {);};+// The setup guide checklist is derived from settings server-side, so a single+// setting write has to invalidate it -- otherwise the card stays stale until reload.+const TestChecklistComponent = () => {+ const { isLoading } = useGetSetupGuideChecklistQuery();+ const { updateSetting } = useAdminSetting("site-name");++ if (isLoading) {+ return <div>Loading...</div>;+ }++ return (+ <button+ onClick={() =>+ updateSetting({ key: "site-name", value: "New Site Name" })+ }+ >+ change site name+ </button>+ );+};+const TestMultipleSettingsComponent = () => {const { values, details, updateSettings, isLoading } = useAdminSettings(["site-name",@@ -144,6 +166,30 @@ describe("useAdminSetting", () => {});});+describe("setup guide checklist invalidation", () => {+ const CHECKLIST_URL = "path:/api/embedding-hub/checklist";++ const setupChecklist = async () => {+ fetchMock.get(CHECKLIST_URL, { checklist: {} });+ setupPropertiesEndpoints(createMockSettings({ "site-name": "Metabased" }));+ setupSettingsEndpoints([createMockSettingDefinition({ key: "site-name" })]);+ setupUpdateSettingEndpoint();+ renderWithProviders(<TestChecklistComponent />);+ };++ it("refetches the checklist after a single setting is written", async () => {+ await setupChecklist();+ const updateButton = await screen.findByText("change site name");+ expect(fetchMock.callHistory.calls(CHECKLIST_URL)).toHaveLength(1);++ await userEvent.click(updateButton);++ await waitFor(() => {+ expect(fetchMock.callHistory.calls(CHECKLIST_URL)).toHaveLength(2);+ });+ });+});+describe("useAdminSettings", () => {it("should have loading state", async () => {await setupMultipleSettings();diff --git a/frontend/src/metabase/urls/admin.ts b/frontend/src/metabase/urls/admin.tsindex 91f16a03e88..ce602cd58d8 100644--- a/frontend/src/metabase/urls/admin.ts+++ b/frontend/src/metabase/urls/admin.ts@@ -1,3 +1,4 @@+import { getTenantsBasePath } from "metabase/common/tenants";import type {BaseUser,CustomVizPluginId,@@ -14,38 +15,45 @@ export const isInternalUser = (user: Pick<BaseUser, "tenant_id">) =>export function newUser() {return `/admin/people/new`;}+export function newTenantUser() {- return "/admin/people/tenants/people/new";+ return `${getTenantsBasePath()}/people/new`;}export function editUser(user: Pick<BaseUser, "id" | "tenant_id">) {return isInternalUser(user)? `/admin/people/${user.id}/edit`- : `/admin/people/tenants/people/${user.id}/edit`;+ : `${getTenantsBasePath()}/people/${user.id}/edit`;}export function resetPassword(user: BaseUser) {return isInternalUser(user)? `/admin/people/${user.id}/reset`- : `/admin/people/tenants/people/${user.id}/reset`;+ : `${getTenantsBasePath()}/people/${user.id}/reset`;}export function newUserSuccess(user: BaseUser) {return isInternalUser(user)? `/admin/people/${user.id}/success`- : `/admin/people/tenants/people/${user.id}/success`;+ : `${getTenantsBasePath()}/people/${user.id}/success`;}export function deactivateUser(user: BaseUser) {return isInternalUser(user)? `/admin/people/${user.id}/deactivate`- : `/admin/people/tenants/people/${user.id}/deactivate`;+ : `${getTenantsBasePath()}/people/${user.id}/deactivate`;}export function reactivateUser(user: BaseUser) {return isInternalUser(user)? `/admin/people/${user.id}/reactivate`- : `/admin/people/tenants/people/${user.id}/reactivate`;+ : `${getTenantsBasePath()}/people/${user.id}/reactivate`;+}++export function unsubscribeUser(user: Pick<BaseUser, "id" | "tenant_id">) {+ return isInternalUser(user)+ ? `/admin/people/${user.id}/unsubscribe`+ : `${getTenantsBasePath()}/people/${user.id}/unsubscribe`;}// TODO: move to EE urlsdiff --git a/frontend/src/metabase/urls/embedding-hub.ts b/frontend/src/metabase/urls/embedding-hub.tsnew file mode 100644index 00000000000..4b1058f4429--- /dev/null+++ b/frontend/src/metabase/urls/embedding-hub.ts@@ -0,0 +1,35 @@+export const EMBEDDING_HUB_ROOT_PATH = "embedding";++const ROOT_URL = `/${EMBEDDING_HUB_ROOT_PATH}`;++export function embeddingHub() {+ return ROOT_URL;+}++export function embeddingHubGetStarted() {+ return `${ROOT_URL}/get-started`;+}++export function embeddingHubSecurity() {+ return `${ROOT_URL}/security`;+}++export function embeddingHubAuthentication() {+ return `${ROOT_URL}/authentication`;+}++export function embeddingHubPermissions() {+ return `${ROOT_URL}/permissions`;+}++export function embeddingHubTenancy() {+ return `${ROOT_URL}/tenancy`;+}++export function embeddingHubAppearance() {+ return `${ROOT_URL}/appearance`;+}++export function embeddingHubLocalization() {+ return `${ROOT_URL}/localization`;+}diff --git a/frontend/src/metabase/urls/index.ts b/frontend/src/metabase/urls/index.tsindex 989a2d345a5..77b2fb3f28b 100644--- a/frontend/src/metabase/urls/index.ts+++ b/frontend/src/metabase/urls/index.ts@@ -10,6 +10,7 @@ export * from "./data-apps";export * from "./data-studio";export * from "./dependencies";export * from "./documents";+export * from "./embedding-hub";export * from "./explorations";export * from "./indexed-entities";export * from "./metabase-protocol";diff --git a/resources/frontend_client/app/assets/img/upsell-embedding-localization.svg b/resources/frontend_client/app/assets/img/upsell-embedding-localization.svgnew file mode 100644index 00000000000..cffa4bbd85a--- /dev/null+++ b/resources/frontend_client/app/assets/img/upsell-embedding-localization.svg@@ -0,0 +1,94 @@+<svg width="349" height="317" viewBox="0 0 349 317" fill="none" xmlns="http://www.w3.org/2000/svg">+<g clip-path="url(#clip0_19175_47383)">+<rect width="349" height="317" rx="6" fill="#0572D1" fill-opacity="0.03"/>+<g filter="url(#filter0_d_19175_47383)">+<rect x="51" y="12" width="248" height="157" rx="7.56415" fill="white"/>+<rect x="51" y="12" width="248" height="157" rx="7.56415" fill="#EEF6FD" fill-opacity="0.8"/>+<rect x="51.5" y="12.5" width="247" height="156" rx="7.06415" stroke="black" stroke-opacity="0.12"/>+<line x1="283.905" y1="51.9727" x2="73.9999" y2="51.4999" stroke="black" stroke-opacity="0.12"/>+<line x1="283.905" y1="102.973" x2="73.9999" y2="102.5" stroke="black" stroke-opacity="0.12"/>+<line x1="283.905" y1="152.473" x2="73.9999" y2="152" stroke="black" stroke-opacity="0.12"/>+<path d="M63.3472 35.4551V26.9791H65.4402L66.8052 30.7491C66.8919 30.9917 66.9742 31.2474 67.0522 31.5161C67.1302 31.7847 67.2125 32.0491 67.2992 32.3091H67.3512C67.4379 32.0491 67.5159 31.7847 67.5852 31.5161C67.6632 31.2474 67.7455 30.9917 67.8322 30.7491L69.1712 26.9791H71.2512V35.4551H69.5092V32.3481C69.5092 32.0707 69.5222 31.7631 69.5482 31.4251C69.5829 31.0784 69.6175 30.7317 69.6522 30.3851C69.6955 30.0384 69.7302 29.7307 69.7562 29.4621H69.7042L69.0152 31.4771L67.8062 34.7141H66.7532L65.5442 31.4771L64.8682 29.4621H64.8162C64.8509 29.7307 64.8855 30.0384 64.9202 30.3851C64.9549 30.7317 64.9852 31.0784 65.0112 31.4251C65.0459 31.7631 65.0632 32.0707 65.0632 32.3481V35.4551H63.3472ZM75.9795 35.6111C75.3642 35.6111 74.8095 35.4767 74.3155 35.2081C73.8215 34.9394 73.4315 34.5537 73.1455 34.0511C72.8595 33.5484 72.7165 32.9417 72.7165 32.2311C72.7165 31.5291 72.8595 30.9267 73.1455 30.4241C73.4402 29.9214 73.8215 29.5357 74.2895 29.2671C74.7575 28.9897 75.2472 28.8511 75.7585 28.8511C76.3739 28.8511 76.8809 28.9897 77.2795 29.2671C77.6869 29.5357 77.9902 29.9041 78.1895 30.3721C78.3975 30.8314 78.5015 31.3557 78.5015 31.9451C78.5015 32.1097 78.4929 32.2744 78.4755 32.4391C78.4582 32.5951 78.4409 32.7121 78.4235 32.7901H74.5625C74.6492 33.2581 74.8442 33.6047 75.1475 33.8301C75.4509 34.0467 75.8149 34.1551 76.2395 34.1551C76.6989 34.1551 77.1625 34.0121 77.6305 33.7261L78.2675 34.8831C77.9382 35.1084 77.5699 35.2861 77.1625 35.4161C76.7552 35.5461 76.3609 35.6111 75.9795 35.6111ZM74.5495 31.5291H76.8765C76.8765 31.1737 76.7899 30.8834 76.6165 30.6581C76.4519 30.4241 76.1789 30.3071 75.7975 30.3071C75.5029 30.3071 75.2385 30.4111 75.0045 30.6191C74.7705 30.8184 74.6189 31.1217 74.5495 31.5291ZM79.8221 35.4551V29.0071H81.7331V35.4551H79.8221ZM80.7711 28.0581C80.4504 28.0581 80.1904 27.9671 79.9911 27.7851C79.7917 27.6031 79.6921 27.3604 79.6921 27.0571C79.6921 26.7537 79.7917 26.5111 79.9911 26.3291C80.1904 26.1471 80.4504 26.0561 80.7711 26.0561C81.0917 26.0561 81.3517 26.1471 81.5511 26.3291C81.7504 26.5111 81.8501 26.7537 81.8501 27.0571C81.8501 27.3604 81.7504 27.6031 81.5511 27.7851C81.3517 27.9671 81.0917 28.0581 80.7711 28.0581ZM85.3128 35.6111C84.8882 35.6111 84.4505 35.5287 83.9998 35.3641C83.5578 35.1994 83.1722 34.9827 82.8428 34.7141L83.7008 33.5181C83.9955 33.7347 84.2772 33.9037 84.5458 34.0251C84.8232 34.1377 85.0962 34.1941 85.3648 34.1941C85.6508 34.1941 85.8588 34.1464 85.9888 34.0511C86.1188 33.9471 86.1838 33.8127 86.1838 33.6481C86.1838 33.5007 86.1188 33.3794 85.9888 33.2841C85.8675 33.1887 85.7072 33.1021 85.5078 33.0241C85.3085 32.9374 85.0962 32.8507 84.8708 32.7641C84.6108 32.6601 84.3508 32.5301 84.0908 32.3741C83.8395 32.2181 83.6272 32.0187 83.4538 31.7761C83.2805 31.5247 83.1938 31.2214 83.1938 30.8661C83.1938 30.2681 83.4192 29.7827 83.8698 29.4101C84.3292 29.0374 84.9272 28.8511 85.6638 28.8511C86.1578 28.8511 86.5912 28.9377 86.9638 29.1111C87.3452 29.2757 87.6702 29.4621 87.9388 29.6701L87.0808 30.8141C86.8555 30.6407 86.6302 30.5064 86.4048 30.4111C86.1795 30.3157 85.9542 30.2681 85.7288 30.2681C85.2348 30.2681 84.9878 30.4371 84.9878 30.7751C84.9878 30.9831 85.1092 31.1434 85.3518 31.2561C85.6032 31.3601 85.8935 31.4727 86.2228 31.5941C86.5002 31.6894 86.7688 31.8151 87.0288 31.9711C87.2975 32.1184 87.5185 32.3177 87.6918 32.5691C87.8738 32.8117 87.9648 33.1324 87.9648 33.5311C87.9648 34.1117 87.7395 34.6057 87.2888 35.0131C86.8382 35.4117 86.1795 35.6111 85.3128 35.6111ZM91.4076 35.6111C90.6103 35.6111 90.0383 35.3814 89.6916 34.9221C89.3536 34.4627 89.1846 33.8604 89.1846 33.1151V30.5021H88.3006V29.0851L89.2886 29.0071L89.5096 27.2911H91.0956V29.0071H92.6426V30.5021H91.0956V33.0891C91.0956 33.4531 91.1693 33.7174 91.3166 33.8821C91.4726 34.0381 91.6763 34.1161 91.9276 34.1161C92.0316 34.1161 92.1356 34.1031 92.2396 34.0771C92.3523 34.0511 92.4519 34.0207 92.5386 33.9861L92.8376 35.3771C92.6729 35.4291 92.4693 35.4811 92.2266 35.5331C91.9926 35.5851 91.7196 35.6111 91.4076 35.6111ZM95.3832 35.4551L93.2122 29.0071H95.1362L95.9682 32.0491C96.0548 32.3697 96.1372 32.6991 96.2152 33.0371C96.3018 33.3664 96.3885 33.7001 96.4752 34.0381H96.5272C96.6052 33.7001 96.6832 33.3664 96.7612 33.0371C96.8478 32.6991 96.9345 32.3697 97.0212 32.0491L97.8662 29.0071H99.6992L97.5932 35.4551H95.3832ZM103.49 35.6111C102.875 35.6111 102.32 35.4767 101.826 35.2081C101.332 34.9394 100.942 34.5537 100.656 34.0511C100.37 33.5484 100.227 32.9417 100.227 32.2311C100.227 31.5291 100.37 30.9267 100.656 30.4241C100.951 29.9214 101.332 29.5357 101.8 29.2671C102.268 28.9897 102.758 28.8511 103.269 28.8511C103.885 28.8511 104.392 28.9897 104.79 29.2671C105.198 29.5357 105.501 29.9041 105.7 30.3721C105.908 30.8314 106.012 31.3557 106.012 31.9451C106.012 32.1097 106.004 32.2744 105.986 32.4391C105.969 32.5951 105.952 32.7121 105.934 32.7901H102.073C102.16 33.2581 102.355 33.6047 102.658 33.8301C102.962 34.0467 103.326 34.1551 103.75 34.1551C104.21 34.1551 104.673 34.0121 105.141 33.7261L105.778 34.8831C105.449 35.1084 105.081 35.2861 104.673 35.4161C104.266 35.5461 103.872 35.6111 103.49 35.6111ZM102.06 31.5291H104.387C104.387 31.1737 104.301 30.8834 104.127 30.6581C103.963 30.4241 103.69 30.3071 103.308 30.3071C103.014 30.3071 102.749 30.4111 102.515 30.6191C102.281 30.8184 102.13 31.1217 102.06 31.5291ZM107.333 35.4551V29.0071H108.893L109.023 30.1381H109.075C109.309 29.7047 109.59 29.3841 109.92 29.1761C110.249 28.9594 110.578 28.8511 110.908 28.8511C111.09 28.8511 111.241 28.8641 111.363 28.8901C111.484 28.9074 111.588 28.9377 111.675 28.9811L111.363 30.6321C111.25 30.5974 111.137 30.5714 111.025 30.5541C110.921 30.5367 110.799 30.5281 110.661 30.5281C110.418 30.5281 110.162 30.6191 109.894 30.8011C109.634 30.9744 109.417 31.2777 109.244 31.7111V35.4551H107.333ZM112.512 35.4551V26.3421H114.371V31.5681H114.423L116.464 29.0071H118.544L116.282 31.6591L118.713 35.4551H116.646L115.19 32.9461L114.371 33.8691V35.4551H112.512ZM121.133 35.6111C120.543 35.6111 120.075 35.4247 119.729 35.0521C119.382 34.6707 119.209 34.2071 119.209 33.6611C119.209 32.9851 119.495 32.4564 120.067 32.0751C120.639 31.6937 121.562 31.4381 122.836 31.3081C122.818 31.0221 122.732 30.7967 122.576 30.6321C122.428 30.4587 122.177 30.3721 121.822 30.3721C121.553 30.3721 121.28 30.4241 121.003 30.5281C120.725 30.6321 120.431 30.7751 120.119 30.9571L119.43 29.6961C119.837 29.4447 120.27 29.2411 120.73 29.0851C121.198 28.9291 121.683 28.8511 122.186 28.8511C123.009 28.8511 123.642 29.0894 124.084 29.5661C124.526 30.0427 124.747 30.7751 124.747 31.7631V35.4551H123.187L123.057 34.7921H123.005C122.736 35.0347 122.446 35.2341 122.134 35.3901C121.83 35.5374 121.497 35.6111 121.133 35.6111ZM121.783 34.1291C121.999 34.1291 122.186 34.0814 122.342 33.9861C122.506 33.8821 122.671 33.7477 122.836 33.5831V32.4521C122.16 32.5387 121.692 32.6774 121.432 32.8681C121.172 33.0501 121.042 33.2667 121.042 33.5181C121.042 33.7261 121.107 33.8821 121.237 33.9861C121.375 34.0814 121.557 34.1291 121.783 34.1291ZM128.3 35.6111C127.598 35.6111 127.087 35.3814 126.766 34.9221C126.454 34.4541 126.298 33.8171 126.298 33.0111V29.0071H128.209V32.7641C128.209 33.2234 128.274 33.5441 128.404 33.7261C128.534 33.8994 128.738 33.9861 129.015 33.9861C129.258 33.9861 129.461 33.9297 129.626 33.8171C129.791 33.7044 129.968 33.5224 130.159 33.2711V29.0071H132.07V35.4551H130.51L130.367 34.5581H130.328C130.059 34.8787 129.765 35.1344 129.444 35.3251C129.123 35.5157 128.742 35.6111 128.3 35.6111ZM134.077 35.4551V30.5021H133.219V29.0851L134.077 29.0201V28.6691C134.077 28.2097 134.155 27.7937 134.311 27.4211C134.467 27.0484 134.718 26.7494 135.065 26.5241C135.411 26.2987 135.875 26.1861 136.456 26.1861C136.724 26.1861 136.971 26.2121 137.197 26.2641C137.422 26.3161 137.604 26.3681 137.743 26.4201L137.392 27.8241C137.279 27.7807 137.166 27.7504 137.054 27.7331C136.941 27.7071 136.833 27.6941 136.729 27.6941C136.495 27.6941 136.313 27.7677 136.183 27.9151C136.053 28.0537 135.988 28.2877 135.988 28.6171V29.0071H138.081L138.302 27.2911H139.888V29.0071H141.435V30.5021H139.888V33.0891C139.888 33.4531 139.961 33.7174 140.109 33.8821C140.265 34.0381 140.468 34.1161 140.72 34.1161C140.824 34.1161 140.928 34.1031 141.032 34.0771C141.144 34.0511 141.244 34.0207 141.331 33.9861L141.63 35.3771C141.465 35.4291 141.261 35.4811 141.019 35.5331C140.785 35.5851 140.512 35.6111 140.2 35.6111C139.402 35.6111 138.83 35.3814 138.484 34.9221C138.146 34.4627 137.977 33.8604 137.977 33.1151V30.5021H135.988V35.4551H134.077ZM145.359 35.6111C144.744 35.6111 144.189 35.4767 143.695 35.2081C143.201 34.9394 142.811 34.5537 142.525 34.0511C142.239 33.5484 142.096 32.9417 142.096 32.2311C142.096 31.5291 142.239 30.9267 142.525 30.4241C142.82 29.9214 143.201 29.5357 143.669 29.2671C144.137 28.9897 144.627 28.8511 145.138 28.8511C145.754 28.8511 146.261 28.9897 146.659 29.2671C147.067 29.5357 147.37 29.9041 147.569 30.3721C147.777 30.8314 147.881 31.3557 147.881 31.9451C147.881 32.1097 147.873 32.2744 147.855 32.4391C147.838 32.5951 147.821 32.7121 147.803 32.7901H143.942C144.029 33.2581 144.224 33.6047 144.527 33.8301C144.831 34.0467 145.195 34.1551 145.619 34.1551C146.079 34.1551 146.542 34.0121 147.01 33.7261L147.647 34.8831C147.318 35.1084 146.95 35.2861 146.542 35.4161C146.135 35.5461 145.741 35.6111 145.359 35.6111ZM143.929 31.5291H146.256C146.256 31.1737 146.17 30.8834 145.996 30.6581C145.832 30.4241 145.559 30.3071 145.177 30.3071C144.883 30.3071 144.618 30.4111 144.384 30.6191C144.15 30.8184 143.999 31.1217 143.929 31.5291ZM151.96 35.4551V26.9791H154.872C155.496 26.9791 156.06 27.0657 156.562 27.2391C157.074 27.4037 157.481 27.6854 157.784 28.0841C158.088 28.4827 158.239 29.0244 158.239 29.7091C158.239 30.3677 158.088 30.9094 157.784 31.3341C157.481 31.7587 157.078 32.0751 156.575 32.2831C156.073 32.4824 155.522 32.5821 154.924 32.5821H153.871V35.4551H151.96ZM153.871 31.0611H154.807C155.847 31.0611 156.367 30.6104 156.367 29.7091C156.367 29.2671 156.229 28.9551 155.951 28.7731C155.674 28.5911 155.275 28.5001 154.755 28.5001H153.871V31.0611ZM159.549 35.4551V29.0071H161.109L161.239 30.1381H161.291C161.525 29.7047 161.806 29.3841 162.136 29.1761C162.465 28.9594 162.794 28.8511 163.124 28.8511C163.306 28.8511 163.457 28.8641 163.579 28.8901C163.7 28.9074 163.804 28.9377 163.891 28.9811L163.579 30.6321C163.466 30.5974 163.353 30.5714 163.241 30.5541C163.137 30.5367 163.015 30.5281 162.877 30.5281C162.634 30.5281 162.378 30.6191 162.11 30.8011C161.85 30.9744 161.633 31.2777 161.46 31.7111V35.4551H159.549ZM167.37 35.6111C166.824 35.6111 166.309 35.4811 165.823 35.2211C165.347 34.9524 164.961 34.5667 164.666 34.0641C164.372 33.5527 164.224 32.9417 164.224 32.2311C164.224 31.5117 164.372 30.9007 164.666 30.3981C164.961 29.8954 165.347 29.5141 165.823 29.2541C166.309 28.9854 166.824 28.8511 167.37 28.8511C167.916 28.8511 168.428 28.9854 168.904 29.2541C169.381 29.5141 169.767 29.8954 170.061 30.3981C170.356 30.9007 170.503 31.5117 170.503 32.2311C170.503 32.9417 170.356 33.5527 170.061 34.0641C169.767 34.5667 169.381 34.9524 168.904 35.2211C168.428 35.4811 167.916 35.6111 167.37 35.6111ZM167.37 34.0641C167.76 34.0641 168.055 33.8994 168.254 33.5701C168.454 33.2321 168.553 32.7857 168.553 32.2311C168.553 31.6677 168.454 31.2214 168.254 30.8921C168.055 30.5627 167.76 30.3981 167.37 30.3981C166.972 30.3981 166.673 30.5627 166.473 30.8921C166.283 31.2214 166.187 31.6677 166.187 32.2311C166.187 32.7857 166.283 33.2321 166.473 33.5701C166.673 33.8994 166.972 34.0641 167.37 34.0641ZM174.113 35.6111C173.316 35.6111 172.675 35.3121 172.189 34.7141C171.713 34.1074 171.474 33.2797 171.474 32.2311C171.474 31.5291 171.6 30.9267 171.851 30.4241C172.111 29.9127 172.445 29.5227 172.852 29.2541C173.268 28.9854 173.702 28.8511 174.152 28.8511C174.508 28.8511 174.807 28.9117 175.049 29.0331C175.292 29.1544 175.522 29.3191 175.738 29.5271L175.66 28.5391V26.3421H177.571V35.4551H176.011L175.881 34.8181H175.829C175.604 35.0434 175.34 35.2341 175.036 35.3901C174.733 35.5374 174.425 35.6111 174.113 35.6111ZM174.607 34.0511C174.815 34.0511 175.002 34.0077 175.166 33.9211C175.34 33.8344 175.504 33.6827 175.66 33.4661V30.8271C175.496 30.6711 175.318 30.5627 175.127 30.5021C174.945 30.4414 174.768 30.4111 174.594 30.4111C174.291 30.4111 174.022 30.5584 173.788 30.8531C173.554 31.1391 173.437 31.5897 173.437 32.2051C173.437 32.8377 173.537 33.3057 173.736 33.6091C173.944 33.9037 174.235 34.0511 174.607 34.0511ZM181.201 35.6111C180.499 35.6111 179.988 35.3814 179.667 34.9221C179.355 34.4541 179.199 33.8171 179.199 33.0111V29.0071H181.11V32.7641C181.11 33.2234 181.175 33.5441 181.305 33.7261C181.435 33.8994 181.639 33.9861 181.916 33.9861C182.159 33.9861 182.363 33.9297 182.527 33.8171C182.692 33.7044 182.87 33.5224 183.06 33.2711V29.0071H184.971V35.4551H183.411L183.268 34.5581H183.229C182.961 34.8787 182.666 35.1344 182.345 35.3251C182.025 35.5157 181.643 35.6111 181.201 35.6111ZM186.653 35.4551V26.3421H188.512V31.5681H188.564L190.605 29.0071H192.685L190.423 31.6591L192.854 35.4551H190.787L189.331 32.9461L188.512 33.8691V35.4551H186.653ZM195.801 35.6111C195.004 35.6111 194.432 35.3814 194.085 34.9221C193.747 34.4627 193.578 33.8604 193.578 33.1151V30.5021H192.694V29.0851L193.682 29.0071L193.903 27.2911H195.489V29.0071H197.036V30.5021H195.489V33.0891C195.489 33.4531 195.563 33.7174 195.71 33.8821C195.866 34.0381 196.07 34.1161 196.321 34.1161C196.425 34.1161 196.529 34.1031 196.633 34.0771C196.746 34.0511 196.845 34.0207 196.932 33.9861L197.231 35.3771C197.066 35.4291 196.863 35.4811 196.62 35.5331C196.386 35.5851 196.113 35.6111 195.801 35.6111ZM200.952 35.6111C200.337 35.6111 199.782 35.4767 199.288 35.2081C198.794 34.9394 198.404 34.5537 198.118 34.0511C197.832 33.5484 197.689 32.9417 197.689 32.2311C197.689 31.5291 197.832 30.9267 198.118 30.4241C198.413 29.9214 198.794 29.5357 199.262 29.2671C199.73 28.9897 200.22 28.8511 200.731 28.8511C201.347 28.8511 201.854 28.9897 202.252 29.2671C202.66 29.5357 202.963 29.9041 203.162 30.3721C203.37 30.8314 203.474 31.3557 203.474 31.9451C203.474 32.1097 203.466 32.2744 203.448 32.4391C203.431 32.5951 203.414 32.7121 203.396 32.7901H199.535C199.622 33.2581 199.817 33.6047 200.12 33.8301C200.424 34.0467 200.788 34.1551 201.212 34.1551C201.672 34.1551 202.135 34.0121 202.603 33.7261L203.24 34.8831C202.911 35.1084 202.543 35.2861 202.135 35.4161C201.728 35.5461 201.334 35.6111 200.952 35.6111ZM199.522 31.5291H201.849C201.849 31.1737 201.763 30.8834 201.589 30.6581C201.425 30.4241 201.152 30.3071 200.77 30.3071C200.476 30.3071 200.211 30.4111 199.977 30.6191C199.743 30.8184 199.592 31.1217 199.522 31.5291Z" fill="#4C5773"/>+<path opacity="0.75" d="M62.7867 52.1539H64.2995V50.7545C64.2995 50.6234 64.3045 50.467 64.3146 50.2855C64.3247 50.104 64.3323 49.9502 64.3373 49.8241H64.3071C64.2466 49.9401 64.1835 50.0535 64.118 50.1645C64.0524 50.2754 63.9843 50.3889 63.9137 50.5049L62.7867 52.1539ZM64.2995 53.9844V52.6531H62.1286V52.2446L64.1936 49.1584H64.8895V52.1539H65.5476V52.6531H64.8895V53.9844H64.2995ZM67.7947 54.0751C67.3106 54.0751 66.9298 53.8583 66.6525 53.4246C66.3802 52.9859 66.244 52.3631 66.244 51.5563C66.244 50.7444 66.3802 50.1267 66.6525 49.7031C66.9298 49.2795 67.3106 49.0677 67.7947 49.0677C68.2737 49.0677 68.6494 49.2795 68.9217 49.7031C69.1991 50.1267 69.3378 50.7444 69.3378 51.5563C69.3378 52.3631 69.1991 52.9859 68.9217 53.4246C68.6494 53.8583 68.2737 54.0751 67.7947 54.0751ZM67.7947 53.5759C68.0771 53.5759 68.304 53.4171 68.4754 53.0994C68.6469 52.7766 68.7326 52.2623 68.7326 51.5563C68.7326 50.8503 68.6469 50.3435 68.4754 50.0359C68.304 49.7232 68.0771 49.5669 67.7947 49.5669C67.5123 49.5669 67.2828 49.7232 67.1063 50.0359C66.9349 50.3435 66.8492 50.8503 66.8492 51.5563C66.8492 52.2623 66.9349 52.7766 67.1063 53.0994C67.2828 53.4171 67.5123 53.5759 67.7947 53.5759Z" fill="black" fill-opacity="0.7"/>+<path opacity="0.75" d="M62.3026 104V103.629C62.7867 103.145 63.1977 102.722 63.5355 102.359C63.8734 101.99 64.1306 101.66 64.3071 101.368C64.4836 101.07 64.5718 100.793 64.5718 100.536C64.5718 100.258 64.4962 100.031 64.3449 99.8548C64.1936 99.6784 63.9642 99.5901 63.6565 99.5901C63.4548 99.5901 63.2683 99.6481 63.0968 99.7641C62.9253 99.875 62.769 100.011 62.6278 100.173L62.2723 99.817C62.474 99.5951 62.6883 99.4186 62.9153 99.2875C63.1472 99.1514 63.4195 99.0833 63.7322 99.0833C64.181 99.0833 64.534 99.2144 64.7912 99.4766C65.0484 99.7338 65.1769 100.077 65.1769 100.505C65.1769 100.808 65.0912 101.116 64.9198 101.428C64.7533 101.736 64.5214 102.061 64.2239 102.404C63.9314 102.742 63.5935 103.11 63.2103 103.508C63.3414 103.498 63.4775 103.488 63.6187 103.478C63.7599 103.468 63.8936 103.463 64.0196 103.463H65.419V104H62.3026ZM67.7947 104.091C67.3106 104.091 66.9298 103.874 66.6525 103.44C66.3802 103.002 66.244 102.379 66.244 101.572C66.244 100.76 66.3802 100.142 66.6525 99.7187C66.9298 99.2951 67.3106 99.0833 67.7947 99.0833C68.2737 99.0833 68.6494 99.2951 68.9217 99.7187C69.1991 100.142 69.3378 100.76 69.3378 101.572C69.3378 102.379 69.1991 103.002 68.9217 103.44C68.6494 103.874 68.2737 104.091 67.7947 104.091ZM67.7947 103.592C68.0771 103.592 68.304 103.433 68.4754 103.115C68.6469 102.792 68.7326 102.278 68.7326 101.572C68.7326 100.866 68.6469 100.359 68.4754 100.052C68.304 99.7389 68.0771 99.5825 67.7947 99.5825C67.5123 99.5825 67.2828 99.7389 67.1063 100.052C66.9349 100.359 66.8492 100.866 66.8492 101.572C66.8492 102.278 66.9349 102.792 67.1063 103.115C67.2828 103.433 67.5123 103.592 67.7947 103.592Z" fill="black" fill-opacity="0.7"/>+<path opacity="0.75" d="M68.8835 154.091C68.3994 154.091 68.0186 153.874 67.7413 153.44C67.469 153.002 67.3328 152.379 67.3328 151.572C67.3328 150.76 67.469 150.142 67.7413 149.719C68.0186 149.295 68.3994 149.083 68.8835 149.083C69.3625 149.083 69.7382 149.295 70.0105 149.719C70.2879 150.142 70.4266 150.76 70.4266 151.572C70.4266 152.379 70.2879 153.002 70.0105 153.44C69.7382 153.874 69.3625 154.091 68.8835 154.091ZM68.8835 153.592C69.1659 153.592 69.3928 153.433 69.5642 153.115C69.7357 152.792 69.8214 152.278 69.8214 151.572C69.8214 150.866 69.7357 150.359 69.5642 150.052C69.3928 149.739 69.1659 149.583 68.8835 149.583C68.6011 149.583 68.3716 149.739 68.1951 150.052C68.0237 150.359 67.938 150.866 67.938 151.572C67.938 152.278 68.0237 152.792 68.1951 153.115C68.3716 153.433 68.6011 153.592 68.8835 153.592Z" fill="black" fill-opacity="0.7"/>+<rect x="74" y="152" width="100" height="23" transform="rotate(-90 74 152)" fill="#205B83"/>+<rect x="230" y="152" width="70" height="22" transform="rotate(-90 230 152)" fill="#92CF75"/>+<rect x="106" y="152" width="100" height="22" transform="rotate(-90 106 152)" fill="#2D76A8"/>+<rect x="261" y="152" width="70" height="23" transform="rotate(-90 261 152)" fill="#BFE46D"/>+<rect x="137" y="152" width="90" height="22" transform="rotate(-90 137 152)" fill="#2C968A"/>+<rect x="168" y="152" width="80" height="23" transform="rotate(-90 168 152)" fill="#205B83"/>+<rect x="198" y="152" width="80" height="24" transform="rotate(-90 198 152)" fill="#6DB87D"/>+</g>+<g filter="url(#filter1_d_19175_47383)">+<rect x="35" y="102" width="279" height="176.625" rx="8.50967" fill="white"/>+<rect x="35" y="102" width="279" height="176.625" rx="8.50967" fill="#EEF6FD" fill-opacity="0.4"/>+<rect x="35.5625" y="102.562" width="277.875" height="175.5" rx="7.94717" stroke="black" stroke-opacity="0.12" stroke-width="1.125"/>+<line x1="297.018" y1="146.969" x2="60.8748" y2="146.437" stroke="black" stroke-opacity="0.12" stroke-width="1.125"/>+<line x1="297.018" y1="204.344" x2="60.8748" y2="203.812" stroke="black" stroke-opacity="0.12" stroke-width="1.125"/>+<line x1="297.018" y1="260.032" x2="60.8748" y2="259.5" stroke="black" stroke-opacity="0.12" stroke-width="1.125"/>+<path d="M48.8907 129.012V119.476H52.1667C52.8687 119.476 53.5024 119.574 54.0679 119.769C54.6432 119.954 55.1014 120.271 55.4427 120.719C55.7839 121.168 55.9545 121.777 55.9545 122.547C55.9545 123.288 55.7839 123.898 55.4427 124.376C55.1014 124.853 54.648 125.209 54.0825 125.443C53.517 125.667 52.8979 125.78 52.2252 125.78H51.0405V129.012H48.8907ZM51.0405 124.068H52.0935C53.2635 124.068 53.8485 123.561 53.8485 122.547C53.8485 122.05 53.6925 121.699 53.3805 121.494C53.0685 121.29 52.62 121.187 52.035 121.187H51.0405V124.068ZM57.4273 129.012V121.758H59.1823L59.3286 123.03H59.3871C59.6503 122.543 59.9672 122.182 60.3377 121.948C60.7082 121.704 61.0787 121.582 61.4492 121.582C61.6539 121.582 61.8246 121.597 61.9611 121.626C62.0976 121.646 62.2146 121.68 62.3121 121.728L61.9611 123.586C61.8343 123.547 61.7076 123.518 61.5808 123.498C61.4638 123.479 61.3273 123.469 61.1713 123.469C60.8983 123.469 60.6107 123.571 60.3084 123.776C60.0159 123.971 59.7722 124.312 59.5772 124.8V129.012H57.4273ZM66.2268 129.187C65.6125 129.187 65.0324 129.041 64.4864 128.748C63.9501 128.446 63.5163 128.012 63.1848 127.447C62.8533 126.872 62.6875 126.184 62.6875 125.385C62.6875 124.575 62.8533 123.888 63.1848 123.323C63.5163 122.757 63.9501 122.328 64.4864 122.036C65.0324 121.733 65.6125 121.582 66.2268 121.582C66.841 121.582 67.4163 121.733 67.9525 122.036C68.4888 122.328 68.9226 122.757 69.2541 123.323C69.5856 123.888 69.7514 124.575 69.7514 125.385C69.7514 126.184 69.5856 126.872 69.2541 127.447C68.9226 128.012 68.4888 128.446 67.9525 128.748C67.4163 129.041 66.841 129.187 66.2268 129.187ZM66.2268 127.447C66.6655 127.447 66.997 127.262 67.2213 126.891C67.4455 126.511 67.5576 126.009 67.5576 125.385C67.5576 124.751 67.4455 124.249 67.2213 123.878C66.997 123.508 66.6655 123.323 66.2268 123.323C65.7783 123.323 65.4419 123.508 65.2176 123.878C65.0031 124.249 64.8959 124.751 64.8959 125.385C64.8959 126.009 65.0031 126.511 65.2176 126.891C65.4419 127.262 65.7783 127.447 66.2268 127.447ZM73.8126 129.187C72.9156 129.187 72.1941 128.851 71.6481 128.178C71.1118 127.496 70.8437 126.564 70.8437 125.385C70.8437 124.595 70.9851 123.917 71.2678 123.352C71.5603 122.777 71.9357 122.338 72.3939 122.036C72.8619 121.733 73.3494 121.582 73.8564 121.582C74.2562 121.582 74.5926 121.65 74.8656 121.787C75.1386 121.923 75.3969 122.109 75.6407 122.343L75.5529 121.231V118.76H77.7028V129.012H75.9478L75.8016 128.295H75.7431C75.4896 128.549 75.1922 128.763 74.8509 128.939C74.5097 129.104 74.1636 129.187 73.8126 129.187ZM74.3683 127.432C74.6023 127.432 74.8119 127.383 74.9972 127.286C75.1922 127.188 75.3774 127.018 75.5529 126.774V123.805C75.3677 123.63 75.1678 123.508 74.9533 123.44C74.7486 123.371 74.5487 123.337 74.3537 123.337C74.0124 123.337 73.7102 123.503 73.4469 123.834C73.1837 124.156 73.0521 124.663 73.0521 125.355C73.0521 126.067 73.1642 126.594 73.3884 126.935C73.6224 127.266 73.9491 127.432 74.3683 127.432ZM81.7867 129.187C80.997 129.187 80.4217 128.929 80.061 128.412C79.71 127.886 79.5345 127.169 79.5345 126.262V121.758H81.6844V125.984C81.6844 126.501 81.7575 126.862 81.9037 127.067C82.05 127.262 82.2791 127.359 82.5911 127.359C82.8641 127.359 83.0932 127.296 83.2785 127.169C83.4637 127.042 83.6636 126.837 83.8781 126.555V121.758H86.028V129.012H84.273L84.1121 128.003H84.0682C83.766 128.363 83.4345 128.651 83.0737 128.865C82.713 129.08 82.284 129.187 81.7867 129.187ZM91.0789 129.187C90.4061 129.187 89.7967 129.041 89.2507 128.748C88.7145 128.446 88.2855 128.012 87.9637 127.447C87.6517 126.872 87.4957 126.184 87.4957 125.385C87.4957 124.575 87.6712 123.888 88.0222 123.323C88.3732 122.757 88.8364 122.328 89.4116 122.036C89.9869 121.733 90.606 121.582 91.269 121.582C91.7175 121.582 92.1124 121.655 92.4536 121.802C92.8046 121.948 93.1166 122.133 93.3896 122.357L92.3805 123.747C92.0392 123.464 91.7126 123.323 91.4006 123.323C90.8839 123.323 90.4695 123.508 90.1575 123.878C89.8552 124.249 89.7041 124.751 89.7041 125.385C89.7041 126.009 89.8552 126.511 90.1575 126.891C90.4695 127.262 90.8595 127.447 91.3275 127.447C91.5615 127.447 91.7906 127.398 92.0149 127.301C92.2391 127.193 92.4439 127.067 92.6291 126.92L93.4774 128.324C93.1166 128.636 92.7266 128.861 92.3074 128.997C91.8881 129.124 91.4786 129.187 91.0789 129.187ZM97.3973 129.187C96.5003 129.187 95.8568 128.929 95.4668 128.412C95.0866 127.895 94.8964 127.218 94.8964 126.379V123.44H93.9019V121.845L95.0134 121.758L95.2621 119.827H97.0463V121.758H98.7867V123.44H97.0463V126.35C97.0463 126.759 97.1292 127.057 97.2949 127.242C97.4704 127.418 97.6996 127.505 97.9823 127.505C98.0993 127.505 98.2163 127.491 98.3333 127.461C98.4601 127.432 98.5722 127.398 98.6697 127.359L99.0061 128.924C98.8208 128.982 98.5917 129.041 98.3187 129.099C98.0554 129.158 97.7483 129.187 97.3973 129.187ZM103.061 129.187C102.446 129.187 101.866 129.041 101.32 128.748C100.784 128.446 100.35 128.012 100.019 127.447C99.6871 126.872 99.5214 126.184 99.5214 125.385C99.5214 124.575 99.6871 123.888 100.019 123.323C100.35 122.757 100.784 122.328 101.32 122.036C101.866 121.733 102.446 121.582 103.061 121.582C103.675 121.582 104.25 121.733 104.786 122.036C105.323 122.328 105.757 122.757 106.088 123.323C106.42 123.888 106.585 124.575 106.585 125.385C106.585 126.184 106.42 126.872 106.088 127.447C105.757 128.012 105.323 128.446 104.786 128.748C104.25 129.041 103.675 129.187 103.061 129.187ZM103.061 127.447C103.499 127.447 103.831 127.262 104.055 126.891C104.279 126.511 104.392 126.009 104.392 125.385C104.392 124.751 104.279 124.249 104.055 123.878C103.831 123.508 103.499 123.323 103.061 123.323C102.612 123.323 102.276 123.508 102.052 123.878C101.837 124.249 101.73 124.751 101.73 125.385C101.73 126.009 101.837 126.511 102.052 126.891C102.276 127.262 102.612 127.447 103.061 127.447ZM110.122 129.187C109.644 129.187 109.152 129.095 108.645 128.909C108.147 128.724 107.713 128.48 107.343 128.178L108.308 126.833C108.64 127.076 108.957 127.266 109.259 127.403C109.571 127.53 109.878 127.593 110.18 127.593C110.502 127.593 110.736 127.539 110.882 127.432C111.028 127.315 111.102 127.164 111.102 126.979C111.102 126.813 111.028 126.677 110.882 126.569C110.746 126.462 110.565 126.365 110.341 126.277C110.117 126.179 109.878 126.082 109.624 125.984C109.332 125.867 109.039 125.721 108.747 125.546C108.464 125.37 108.225 125.146 108.03 124.873C107.835 124.59 107.738 124.249 107.738 123.849C107.738 123.176 107.991 122.63 108.498 122.211C109.015 121.792 109.688 121.582 110.517 121.582C111.072 121.582 111.56 121.68 111.979 121.875C112.408 122.06 112.774 122.27 113.076 122.504L112.111 123.791C111.857 123.596 111.604 123.444 111.35 123.337C111.097 123.23 110.843 123.176 110.59 123.176C110.034 123.176 109.756 123.366 109.756 123.747C109.756 123.981 109.893 124.161 110.166 124.288C110.448 124.405 110.775 124.532 111.145 124.668C111.457 124.775 111.76 124.917 112.052 125.092C112.354 125.258 112.603 125.482 112.798 125.765C113.003 126.038 113.105 126.399 113.105 126.847C113.105 127.5 112.852 128.056 112.345 128.514C111.838 128.963 111.097 129.187 110.122 129.187ZM117.398 129.012V121.758H119.153L119.3 122.694H119.358C119.66 122.391 119.982 122.133 120.323 121.919C120.665 121.694 121.074 121.582 121.552 121.582C122.069 121.582 122.483 121.689 122.795 121.904C123.117 122.109 123.37 122.406 123.556 122.796C123.877 122.465 124.219 122.182 124.579 121.948C124.94 121.704 125.359 121.582 125.837 121.582C126.617 121.582 127.187 121.845 127.548 122.372C127.919 122.889 128.104 123.6 128.104 124.507V129.012H125.954V124.785C125.954 124.259 125.881 123.898 125.735 123.703C125.598 123.508 125.374 123.41 125.062 123.41C124.701 123.41 124.287 123.644 123.819 124.112V129.012H121.669V124.785C121.669 124.259 121.596 123.898 121.45 123.703C121.313 123.508 121.089 123.41 120.777 123.41C120.416 123.41 120.007 123.644 119.548 124.112V129.012H117.398ZM131.766 129.187C131.103 129.187 130.577 128.978 130.187 128.558C129.797 128.129 129.602 127.608 129.602 126.993C129.602 126.233 129.924 125.638 130.567 125.209C131.211 124.78 132.249 124.493 133.682 124.346C133.663 124.025 133.565 123.771 133.39 123.586C133.224 123.391 132.941 123.293 132.541 123.293C132.239 123.293 131.932 123.352 131.62 123.469C131.308 123.586 130.977 123.747 130.626 123.951L129.85 122.533C130.309 122.25 130.796 122.021 131.313 121.845C131.839 121.67 132.385 121.582 132.951 121.582C133.877 121.582 134.589 121.85 135.086 122.387C135.583 122.923 135.832 123.747 135.832 124.858V129.012H134.077L133.931 128.266H133.872C133.57 128.539 133.243 128.763 132.892 128.939C132.551 129.104 132.176 129.187 131.766 129.187ZM132.498 127.52C132.741 127.52 132.951 127.466 133.126 127.359C133.312 127.242 133.497 127.091 133.682 126.906V125.633C132.922 125.731 132.395 125.887 132.103 126.101C131.81 126.306 131.664 126.55 131.664 126.833C131.664 127.067 131.737 127.242 131.883 127.359C132.039 127.466 132.244 127.52 132.498 127.52ZM133.17 120.646L132.117 119.593L134.37 116.931L135.817 118.35L133.17 120.646ZM139.786 129.187C139.308 129.187 138.816 129.095 138.309 128.909C137.811 128.724 137.378 128.48 137.007 128.178L137.972 126.833C138.304 127.076 138.621 127.266 138.923 127.403C139.235 127.53 139.542 127.593 139.844 127.593C140.166 127.593 140.4 127.539 140.546 127.432C140.693 127.315 140.766 127.164 140.766 126.979C140.766 126.813 140.693 126.677 140.546 126.569C140.41 126.462 140.229 126.365 140.005 126.277C139.781 126.179 139.542 126.082 139.289 125.984C138.996 125.867 138.704 125.721 138.411 125.546C138.128 125.37 137.889 125.146 137.694 124.873C137.499 124.59 137.402 124.249 137.402 123.849C137.402 123.176 137.655 122.63 138.162 122.211C138.679 121.792 139.352 121.582 140.181 121.582C140.736 121.582 141.224 121.68 141.643 121.875C142.072 122.06 142.438 122.27 142.74 122.504L141.775 123.791C141.521 123.596 141.268 123.444 141.014 123.337C140.761 123.23 140.507 123.176 140.254 123.176C139.698 123.176 139.42 123.366 139.42 123.747C139.42 123.981 139.557 124.161 139.83 124.288C140.112 124.405 140.439 124.532 140.81 124.668C141.122 124.775 141.424 124.917 141.716 125.092C142.019 125.258 142.267 125.482 142.462 125.765C142.667 126.038 142.769 126.399 142.769 126.847C142.769 127.5 142.516 128.056 142.009 128.514C141.502 128.963 140.761 129.187 139.786 129.187ZM148.73 129.012L146.287 121.758H148.452L149.388 125.18C149.485 125.541 149.578 125.911 149.666 126.291C149.763 126.662 149.861 127.037 149.958 127.418H150.017C150.105 127.037 150.192 126.662 150.28 126.291C150.378 125.911 150.475 125.541 150.573 125.18L151.523 121.758H153.585L151.216 129.012H148.73ZM157.85 129.187C157.158 129.187 156.534 129.036 155.978 128.734C155.423 128.432 154.984 127.998 154.662 127.432C154.34 126.867 154.179 126.184 154.179 125.385C154.179 124.595 154.34 123.917 154.662 123.352C154.994 122.786 155.423 122.352 155.949 122.05C156.476 121.738 157.026 121.582 157.602 121.582C158.294 121.582 158.864 121.738 159.313 122.05C159.771 122.352 160.112 122.767 160.337 123.293C160.571 123.81 160.688 124.4 160.688 125.063C160.688 125.248 160.678 125.433 160.658 125.619C160.639 125.794 160.619 125.926 160.6 126.014H156.256C156.354 126.54 156.573 126.93 156.914 127.184C157.256 127.427 157.665 127.549 158.143 127.549C158.66 127.549 159.181 127.388 159.708 127.067L160.424 128.368C160.054 128.622 159.639 128.822 159.181 128.968C158.723 129.114 158.279 129.187 157.85 129.187ZM156.242 124.595H158.859C158.859 124.195 158.762 123.869 158.567 123.615C158.382 123.352 158.075 123.22 157.646 123.22C157.314 123.22 157.017 123.337 156.753 123.571C156.49 123.795 156.32 124.137 156.242 124.595ZM162.173 129.012V121.758H163.928L164.074 122.679H164.133C164.445 122.387 164.786 122.133 165.157 121.919C165.537 121.694 165.971 121.582 166.458 121.582C167.248 121.582 167.818 121.845 168.169 122.372C168.53 122.889 168.711 123.6 168.711 124.507V129.012H166.561V124.785C166.561 124.259 166.488 123.898 166.341 123.703C166.205 123.508 165.981 123.41 165.669 123.41C165.396 123.41 165.162 123.474 164.967 123.6C164.772 123.717 164.557 123.888 164.323 124.112V129.012H162.173ZM173.131 129.187C172.234 129.187 171.513 128.851 170.967 128.178C170.43 127.496 170.162 126.564 170.162 125.385C170.162 124.595 170.304 123.917 170.586 123.352C170.879 122.777 171.254 122.338 171.713 122.036C172.181 121.733 172.668 121.582 173.175 121.582C173.575 121.582 173.911 121.65 174.184 121.787C174.457 121.923 174.716 122.109 174.959 122.343L174.872 121.231V118.76H177.021V129.012H175.266L175.12 128.295H175.062C174.808 128.549 174.511 128.763 174.17 128.939C173.828 129.104 173.482 129.187 173.131 129.187ZM173.687 127.432C173.921 127.432 174.131 127.383 174.316 127.286C174.511 127.188 174.696 127.018 174.872 126.774V123.805C174.686 123.63 174.486 123.508 174.272 123.44C174.067 123.371 173.867 123.337 173.672 123.337C173.331 123.337 173.029 123.503 172.766 123.834C172.502 124.156 172.371 124.663 172.371 125.355C172.371 126.067 172.483 126.594 172.707 126.935C172.941 127.266 173.268 127.432 173.687 127.432ZM178.926 129.012V121.758H181.076V129.012H178.926ZM179.994 120.69C179.633 120.69 179.341 120.588 179.116 120.383C178.892 120.178 178.78 119.905 178.78 119.564C178.78 119.223 178.892 118.95 179.116 118.745C179.341 118.54 179.633 118.438 179.994 118.438C180.355 118.438 180.647 118.54 180.871 118.745C181.096 118.95 181.208 119.223 181.208 119.564C181.208 119.905 181.096 120.178 180.871 120.383C180.647 120.588 180.355 120.69 179.994 120.69ZM185.557 129.187C184.66 129.187 183.938 128.851 183.392 128.178C182.856 127.496 182.588 126.564 182.588 125.385C182.588 124.595 182.729 123.917 183.012 123.352C183.304 122.777 183.68 122.338 184.138 122.036C184.606 121.733 185.094 121.582 185.601 121.582C186 121.582 186.337 121.65 186.61 121.787C186.883 121.923 187.141 122.109 187.385 122.343L187.297 121.231V118.76H189.447V129.012H187.692L187.546 128.295H187.487C187.234 128.549 186.936 128.763 186.595 128.939C186.254 129.104 185.908 129.187 185.557 129.187ZM186.112 127.432C186.346 127.432 186.556 127.383 186.741 127.286C186.936 127.188 187.122 127.018 187.297 126.774V123.805C187.112 123.63 186.912 123.508 186.697 123.44C186.493 123.371 186.293 123.337 186.098 123.337C185.757 123.337 185.454 123.503 185.191 123.834C184.928 124.156 184.796 124.663 184.796 125.355C184.796 126.067 184.908 126.594 185.133 126.935C185.367 127.266 185.693 127.432 186.112 127.432ZM194.467 129.187C193.853 129.187 193.273 129.041 192.727 128.748C192.19 128.446 191.756 128.012 191.425 127.447C191.093 126.872 190.928 126.184 190.928 125.385C190.928 124.575 191.093 123.888 191.425 123.323C191.756 122.757 192.19 122.328 192.727 122.036C193.273 121.733 193.853 121.582 194.467 121.582C195.081 121.582 195.656 121.733 196.193 122.036C196.729 122.328 197.163 122.757 197.494 123.323C197.826 123.888 197.992 124.575 197.992 125.385C197.992 126.184 197.826 126.872 197.494 127.447C197.163 128.012 196.729 128.446 196.193 128.748C195.656 129.041 195.081 129.187 194.467 129.187ZM194.467 127.447C194.906 127.447 195.237 127.262 195.461 126.891C195.686 126.511 195.798 126.009 195.798 125.385C195.798 124.751 195.686 124.249 195.461 123.878C195.237 123.508 194.906 123.323 194.467 123.323C194.018 123.323 193.682 123.508 193.458 123.878C193.243 124.249 193.136 124.751 193.136 125.385C193.136 126.009 193.243 126.511 193.458 126.891C193.682 127.262 194.018 127.447 194.467 127.447ZM201.528 129.187C201.05 129.187 200.558 129.095 200.051 128.909C199.554 128.724 199.12 128.48 198.749 128.178L199.714 126.833C200.046 127.076 200.363 127.266 200.665 127.403C200.977 127.53 201.284 127.593 201.586 127.593C201.908 127.593 202.142 127.539 202.288 127.432C202.435 127.315 202.508 127.164 202.508 126.979C202.508 126.813 202.435 126.677 202.288 126.569C202.152 126.462 201.972 126.365 201.747 126.277C201.523 126.179 201.284 126.082 201.031 125.984C200.738 125.867 200.446 125.721 200.153 125.546C199.87 125.37 199.632 125.146 199.437 124.873C199.242 124.59 199.144 124.249 199.144 123.849C199.144 123.176 199.398 122.63 199.905 122.211C200.421 121.792 201.094 121.582 201.923 121.582C202.479 121.582 202.966 121.68 203.385 121.875C203.814 122.06 204.18 122.27 204.482 122.504L203.517 123.791C203.263 123.596 203.01 123.444 202.756 123.337C202.503 123.23 202.249 123.176 201.996 123.176C201.44 123.176 201.162 123.366 201.162 123.747C201.162 123.981 201.299 124.161 201.572 124.288C201.855 124.405 202.181 124.532 202.552 124.668C202.864 124.775 203.166 124.917 203.458 125.092C203.761 125.258 204.009 125.482 204.204 125.765C204.409 126.038 204.511 126.399 204.511 126.847C204.511 127.5 204.258 128.056 203.751 128.514C203.244 128.963 202.503 129.187 201.528 129.187Z" fill="#4C5773"/>+<path opacity="0.75" d="M48.26 147.298H49.9619V145.723C49.9619 145.576 49.9676 145.4 49.979 145.196C49.9903 144.991 49.9988 144.818 50.0045 144.677H49.9704C49.9024 144.807 49.8315 144.935 49.7577 145.06C49.684 145.184 49.6074 145.312 49.5279 145.442L48.26 147.298ZM49.9619 149.357V147.859H47.5197V147.4L49.8428 143.928H50.6257V147.298H51.366V147.859H50.6257V149.357H49.9619ZM53.894 149.459C53.3494 149.459 52.9211 149.215 52.609 148.727C52.3027 148.234 52.1495 147.533 52.1495 146.625C52.1495 145.712 52.3027 145.017 52.609 144.54C52.9211 144.064 53.3494 143.826 53.894 143.826C54.4329 143.826 54.8556 144.064 55.1619 144.54C55.474 145.017 55.63 145.712 55.63 146.625C55.63 147.533 55.474 148.234 55.1619 148.727C54.8556 149.215 54.4329 149.459 53.894 149.459ZM53.894 148.897C54.2117 148.897 54.467 148.719 54.6599 148.361C54.8528 147.998 54.9492 147.42 54.9492 146.625C54.9492 145.831 54.8528 145.261 54.6599 144.915C54.467 144.563 54.2117 144.387 53.894 144.387C53.5763 144.387 53.3182 144.563 53.1196 144.915C52.9267 145.261 52.8303 145.831 52.8303 146.625C52.8303 147.42 52.9267 147.998 53.1196 148.361C53.3182 148.719 53.5763 148.897 53.894 148.897Z" fill="black" fill-opacity="0.7"/>+<path opacity="0.75" d="M47.7154 205.625V205.208C48.26 204.663 48.7224 204.187 49.1025 203.778C49.4826 203.364 49.7719 202.993 49.9704 202.664C50.169 202.329 50.2683 202.017 50.2683 201.728C50.2683 201.416 50.1832 201.16 50.013 200.962C49.8428 200.763 49.5847 200.664 49.2386 200.664C49.0117 200.664 48.8018 200.729 48.6089 200.86C48.416 200.984 48.2401 201.138 48.0813 201.319L47.6813 200.919C47.9083 200.67 48.1494 200.471 48.4047 200.323C48.6656 200.17 48.972 200.094 49.3237 200.094C49.8286 200.094 50.2257 200.241 50.5151 200.536C50.8044 200.826 50.9491 201.211 50.9491 201.694C50.9491 202.034 50.8526 202.38 50.6597 202.732C50.4725 203.078 50.2116 203.444 49.8768 203.829C49.5478 204.21 49.1677 204.624 48.7365 205.072C48.884 205.061 49.0372 205.049 49.1961 205.038C49.3549 205.026 49.5053 205.021 49.6471 205.021H51.2214V205.625H47.7154ZM53.894 205.727C53.3494 205.727 52.9211 205.483 52.609 204.995C52.3027 204.502 52.1495 203.801 52.1495 202.893C52.1495 201.98 52.3027 201.285 52.609 200.809C52.9211 200.332 53.3494 200.094 53.894 200.094C54.4329 200.094 54.8556 200.332 55.1619 200.809C55.474 201.285 55.63 201.98 55.63 202.893C55.63 203.801 55.474 204.502 55.1619 204.995C54.8556 205.483 54.4329 205.727 53.894 205.727ZM53.894 205.165C54.2117 205.165 54.467 204.987 54.6599 204.629C54.8528 204.266 54.9492 203.688 54.9492 202.893C54.9492 202.099 54.8528 201.529 54.6599 201.183C54.467 200.831 54.2117 200.655 53.894 200.655C53.5763 200.655 53.3182 200.831 53.1196 201.183C52.9267 201.529 52.8303 202.099 52.8303 202.893C52.8303 203.688 52.9267 204.266 53.1196 204.629C53.3182 204.987 53.5763 205.165 53.894 205.165Z" fill="black" fill-opacity="0.7"/>+<path opacity="0.75" d="M55.1189 261.977C54.5743 261.977 54.146 261.733 53.8339 261.245C53.5276 260.752 53.3744 260.051 53.3744 259.143C53.3744 258.23 53.5276 257.535 53.8339 257.059C54.146 256.582 54.5743 256.344 55.1189 256.344C55.6579 256.344 56.0805 256.582 56.3868 257.059C56.6989 257.535 56.8549 258.23 56.8549 259.143C56.8549 260.051 56.6989 260.752 56.3868 261.245C56.0805 261.733 55.6579 261.977 55.1189 261.977ZM55.1189 261.415C55.4366 261.415 55.6919 261.237 55.8848 260.879C56.0777 260.516 56.1741 259.938 56.1741 259.143C56.1741 258.349 56.0777 257.779 55.8848 257.433C55.6919 257.081 55.4366 256.905 55.1189 256.905C54.8012 256.905 54.5431 257.081 54.3445 257.433C54.1516 257.779 54.0552 258.349 54.0552 259.143C54.0552 259.938 54.1516 260.516 54.3445 260.879C54.5431 261.237 54.8012 261.415 55.1189 261.415Z" fill="black" fill-opacity="0.7"/>+<rect x="60.875" y="259.5" width="112.5" height="25.875" transform="rotate(-90 60.875 259.5)" fill="#205B83"/>+<rect x="236.375" y="259.5" width="78.75" height="24.75" transform="rotate(-90 236.375 259.5)" fill="#92CF75"/>+<rect x="96.875" y="259.5" width="112.5" height="24.75" transform="rotate(-90 96.875 259.5)" fill="#2D76A8"/>+<rect x="271.25" y="259.5" width="78.75" height="25.875" transform="rotate(-90 271.25 259.5)" fill="#BFE46D"/>+<rect x="131.75" y="259.5" width="101.25" height="24.75" transform="rotate(-90 131.75 259.5)" fill="#2C968A"/>+<rect x="166.625" y="259.5" width="90" height="25.875" transform="rotate(-90 166.625 259.5)" fill="#205B83"/>+<rect x="200.375" y="259.5" width="90" height="27" transform="rotate(-90 200.375 259.5)" fill="#6DB87D"/>+</g>+<g filter="url(#filter2_d_19175_47383)">+<rect x="20" y="204" width="309" height="195.617" rx="9.42468" fill="white"/>+<rect x="20.623" y="204.623" width="307.754" height="194.371" rx="8.8017" stroke="black" stroke-opacity="0.12" stroke-width="1.24597"/>+<line x1="310.192" y1="253.805" x2="48.6572" y2="253.216" stroke="black" stroke-opacity="0.12" stroke-width="1.24597"/>+<line x1="310.192" y1="317.349" x2="48.6572" y2="316.76" stroke="black" stroke-opacity="0.12" stroke-width="1.24597"/>+<path d="M35.0764 221.046H49.4113V222.828H35.0764V221.046ZM36.6314 223.881H47.9373V225.566H36.6314V223.881ZM35.287 226.375H49.2007V229.858H47.2408V228.125H37.1659V229.858H35.287V226.375ZM41.1505 219.783H43.1752V224.82H41.1505V219.783ZM43.0942 228.627H45.0379V232.45C45.0379 232.698 45.0757 232.86 45.1513 232.935C45.2377 233 45.4267 233.033 45.7182 233.033C45.783 233.033 45.8856 233.033 46.026 233.033C46.1772 233.033 46.3391 233.033 46.5119 233.033C46.6955 233.033 46.8629 233.033 47.014 233.033C47.1652 233.033 47.2786 233.033 47.3542 233.033C47.5378 233.033 47.6727 232.989 47.7591 232.903C47.8563 232.806 47.9211 232.622 47.9535 232.352C47.9967 232.072 48.0291 231.656 48.0507 231.105C48.1803 231.202 48.3476 231.299 48.5528 231.397C48.7688 231.494 48.9847 231.58 49.2007 231.656C49.4275 231.721 49.6272 231.78 49.8 231.834C49.7352 232.611 49.6219 233.211 49.4599 233.632C49.2979 234.064 49.0657 234.361 48.7634 234.523C48.461 234.696 48.0507 234.782 47.5324 234.782C47.4352 234.782 47.2894 234.782 47.095 234.782C46.9115 234.782 46.7063 234.782 46.4795 234.782C46.2636 234.782 46.0584 234.782 45.864 234.782C45.6804 234.782 45.5401 234.782 45.4429 234.782C44.8166 234.782 44.3306 234.712 43.9851 234.571C43.6503 234.431 43.4182 234.188 43.2886 233.843C43.159 233.508 43.0942 233.049 43.0942 232.466V228.627ZM39.0934 228.627H41.1019C41.0479 229.437 40.9399 230.176 40.778 230.846C40.616 231.515 40.346 232.115 39.9681 232.644C39.6009 233.173 39.0718 233.632 38.3807 234.021C37.7004 234.42 36.8042 234.755 35.6919 235.025C35.6379 234.852 35.5516 234.663 35.4328 234.458C35.314 234.253 35.179 234.048 35.0278 233.843C34.8875 233.648 34.7525 233.481 34.6229 233.34C35.5947 233.157 36.3668 232.925 36.9391 232.644C37.5115 232.363 37.9434 232.028 38.235 231.64C38.5265 231.251 38.7263 230.808 38.8343 230.311C38.953 229.815 39.0394 229.253 39.0934 228.627ZM66.1272 232.676C65.7492 233.022 65.3119 233.308 64.8152 233.535C64.3185 233.762 63.7407 233.875 63.082 233.875C62.4773 233.875 61.986 233.664 61.6081 233.243C61.2409 232.822 61.0573 232.217 61.0573 231.429C61.0573 230.997 61.0843 230.533 61.1383 230.036C61.2031 229.529 61.2733 229.021 61.3489 228.514C61.4245 228.006 61.4893 227.525 61.5433 227.072C61.6081 226.608 61.6405 226.192 61.6405 225.825C61.6405 225.425 61.5433 225.128 61.3489 224.934C61.1545 224.729 60.8846 224.626 60.539 224.626C60.1611 224.626 59.7399 224.761 59.2756 225.031C58.8113 225.29 58.3361 225.625 57.8502 226.035C57.3643 226.446 56.9 226.883 56.4572 227.347C56.0253 227.812 55.6474 228.254 55.3234 228.675L55.3072 226.181C55.5016 225.965 55.7553 225.711 56.0685 225.42C56.3924 225.128 56.7542 224.826 57.1537 224.513C57.5641 224.2 57.9906 223.908 58.4333 223.638C58.8869 223.357 59.3404 223.131 59.7939 222.958C60.2583 222.785 60.7064 222.699 61.1383 222.699C61.7214 222.699 62.1966 222.807 62.5637 223.023C62.9417 223.228 63.2224 223.514 63.406 223.881C63.5896 224.237 63.6814 224.642 63.6814 225.096C63.6814 225.517 63.6544 225.976 63.6004 226.473C63.5464 226.959 63.4816 227.455 63.406 227.963C63.3304 228.47 63.2656 228.972 63.2116 229.469C63.1684 229.966 63.1468 230.419 63.1468 230.83C63.1468 231.046 63.2008 231.224 63.3088 231.364C63.4168 231.494 63.568 231.559 63.7623 231.559C64.0647 231.559 64.3994 231.461 64.7666 231.267C65.1337 231.062 65.5009 230.77 65.868 230.392L66.1272 232.676ZM54.9347 224.95C54.7619 224.972 54.5405 224.999 54.2706 225.031C54.0006 225.063 53.709 225.101 53.3959 225.144C53.0935 225.188 52.7858 225.231 52.4726 225.274C52.1595 225.317 51.8679 225.355 51.598 225.387L51.3874 223.314C51.625 223.325 51.8463 223.33 52.0515 223.33C52.2675 223.319 52.5158 223.309 52.7966 223.298C53.0557 223.276 53.3635 223.249 53.7198 223.217C54.087 223.174 54.4541 223.125 54.8213 223.071C55.1992 223.017 55.5502 222.958 55.8741 222.893C56.1981 222.828 56.4518 222.763 56.6354 222.699L57.2833 223.525C57.1861 223.654 57.0727 223.816 56.9432 224.011C56.8244 224.205 56.7002 224.405 56.5706 224.61C56.441 224.804 56.3276 224.977 56.2305 225.128L55.2748 228.173C55.102 228.422 54.8861 228.735 54.6269 229.113C54.3785 229.491 54.114 229.89 53.8332 230.311C53.5525 230.733 53.2771 231.138 53.0071 231.526C52.7372 231.915 52.4942 232.255 52.2783 232.547L50.9986 230.781C51.2038 230.522 51.436 230.225 51.6951 229.89C51.9651 229.545 52.2459 229.183 52.5374 228.805C52.829 228.416 53.1151 228.033 53.3959 227.655C53.6766 227.266 53.9358 226.905 54.1734 226.57C54.4217 226.224 54.6269 225.927 54.7889 225.679L54.8213 225.258L54.9347 224.95ZM54.7403 221.84C54.7403 221.603 54.7403 221.365 54.7403 221.127C54.7403 220.879 54.7187 220.631 54.6755 220.382L57.0403 220.463C56.9756 220.712 56.9054 221.073 56.8298 221.549C56.765 222.013 56.6948 222.547 56.6192 223.152C56.5544 223.757 56.4896 224.394 56.4248 225.063C56.3708 225.722 56.3222 226.381 56.2791 227.04C56.2467 227.698 56.2305 228.314 56.2305 228.886C56.2305 229.329 56.2305 229.777 56.2305 230.23C56.2413 230.684 56.2521 231.148 56.2629 231.623C56.2737 232.099 56.2953 232.59 56.3276 233.097C56.3384 233.238 56.3546 233.432 56.3762 233.681C56.3978 233.94 56.4194 234.161 56.441 234.345H54.2058C54.2274 234.15 54.2382 233.934 54.2382 233.697C54.249 233.459 54.2544 233.276 54.2544 233.146C54.2652 232.617 54.276 232.126 54.2868 231.672C54.2976 231.218 54.303 230.738 54.303 230.23C54.3137 229.723 54.3299 229.134 54.3515 228.465C54.3623 228.217 54.3785 227.903 54.4001 227.525C54.4217 227.137 54.4433 226.716 54.4649 226.262C54.4973 225.798 54.5297 225.328 54.5621 224.853C54.5945 224.378 54.6215 223.935 54.6431 223.525C54.6755 223.104 54.6971 222.747 54.7079 222.456C54.7295 222.153 54.7403 221.948 54.7403 221.84ZM69.3343 224.788H73.1569V226.392H69.3343V224.788ZM69.3343 227.315H73.1893V228.837H69.3343V227.315ZM74.5499 225.873H80.7212V227.623H74.5499V225.873ZM69.2857 229.826H73.1569V231.364H69.2857V229.826ZM72.2499 224.788H74.0964V233C74.0964 233.421 74.0478 233.762 73.9506 234.021C73.8642 234.28 73.6861 234.485 73.4161 234.636C73.1569 234.777 72.8384 234.863 72.4604 234.895C72.0933 234.939 71.6614 234.96 71.1646 234.96C71.1322 234.701 71.0674 234.404 70.9703 234.069C70.8731 233.735 70.7651 233.443 70.6463 233.195C70.9271 233.205 71.197 233.216 71.4562 233.227C71.7261 233.227 71.9097 233.227 72.0069 233.227C72.1689 233.216 72.2499 233.13 72.2499 232.968V224.788ZM79.9113 225.873H81.7902C81.7902 225.873 81.7848 225.927 81.774 226.035C81.774 226.132 81.774 226.24 81.774 226.359C81.774 226.478 81.774 226.581 81.774 226.667C81.7309 227.909 81.6877 228.967 81.6445 229.842C81.6121 230.716 81.5635 231.445 81.4987 232.028C81.4447 232.601 81.3799 233.054 81.3043 233.389C81.2287 233.724 81.1315 233.972 81.0128 234.134C80.84 234.361 80.6618 234.523 80.4782 234.62C80.3055 234.717 80.0949 234.787 79.8465 234.831C79.6306 234.874 79.3606 234.895 79.0367 234.895C78.7127 234.906 78.3618 234.906 77.9838 234.895C77.973 234.615 77.919 234.301 77.8218 233.956C77.7355 233.61 77.6221 233.313 77.4817 233.065C77.7732 233.087 78.0378 233.103 78.2754 233.114C78.5237 233.114 78.7181 233.114 78.8585 233.114C78.9773 233.114 79.0745 233.103 79.15 233.081C79.2256 233.049 79.3012 232.984 79.3768 232.887C79.474 232.757 79.555 232.466 79.6198 232.012C79.6846 231.559 79.7386 230.868 79.7817 229.939C79.8357 229.01 79.8789 227.774 79.9113 226.23V225.873ZM68.5082 224.788H70.3386V228.352C70.3386 228.859 70.317 229.41 70.2738 230.004C70.2306 230.598 70.155 231.197 70.047 231.802C69.939 232.396 69.777 232.968 69.5611 233.519C69.3451 234.08 69.0643 234.588 68.7188 235.041C68.6108 234.933 68.4596 234.809 68.2653 234.669C68.0817 234.539 67.8873 234.409 67.6822 234.28C67.477 234.161 67.2988 234.069 67.1476 234.004C67.5688 233.454 67.8765 232.854 68.0709 232.207C68.2653 231.548 68.384 230.884 68.4272 230.214C68.4812 229.534 68.5082 228.908 68.5082 228.335V224.788ZM69.3505 221.16H74.4041V222.78H69.3505V221.16ZM75.8457 221.16H82.0008V222.78H75.8457V221.16ZM69.4315 219.637L71.278 220.123C71.0728 220.706 70.8191 221.284 70.5167 221.856C70.2144 222.429 69.8904 222.963 69.5449 223.46C69.1993 223.957 68.8538 224.394 68.5082 224.772C68.3894 224.664 68.2329 224.545 68.0385 224.416C67.8441 224.286 67.639 224.156 67.423 224.027C67.2178 223.897 67.0342 223.795 66.8723 223.719C67.4122 223.233 67.9035 222.623 68.3463 221.889C68.7998 221.154 69.1615 220.404 69.4315 219.637ZM75.9591 219.637L77.8542 220.123C77.5303 220.998 77.1091 221.84 76.5908 222.65C76.0725 223.46 75.5326 224.129 74.9711 224.658C74.8523 224.55 74.6903 224.426 74.4851 224.286C74.2908 224.146 74.0856 224.011 73.8696 223.881C73.6645 223.741 73.4863 223.633 73.3351 223.557C73.8966 223.093 74.4095 222.515 74.8739 221.824C75.3382 221.122 75.7 220.393 75.9591 219.637ZM69.9984 222.391L71.5858 221.824C71.8233 222.159 72.0609 222.537 72.2985 222.958C72.536 223.368 72.7034 223.724 72.8006 224.027L71.116 224.675C71.0297 224.372 70.8731 224.005 70.6463 223.573C70.4303 223.141 70.2144 222.747 69.9984 222.391ZM77.0444 222.504L78.6479 221.921C78.9287 222.245 79.204 222.612 79.474 223.023C79.7547 223.422 79.9599 223.778 80.0895 224.092L78.3888 224.739C78.2808 224.437 78.0972 224.075 77.838 223.654C77.5789 223.222 77.3143 222.839 77.0444 222.504ZM76.3479 224.335H78.1458V227.38C78.1458 228.006 78.108 228.648 78.0324 229.307C77.9676 229.955 77.8326 230.608 77.6275 231.267C77.4223 231.926 77.1253 232.568 76.7366 233.195C76.3587 233.821 75.8565 234.415 75.2302 234.976C75.0682 234.782 74.8577 234.571 74.5985 234.345C74.3394 234.118 74.0964 233.929 73.8696 233.778C74.4203 233.27 74.8577 232.741 75.1816 232.19C75.5164 231.64 75.7647 231.089 75.9267 230.538C76.0995 229.977 76.2129 229.426 76.2669 228.886C76.3209 228.346 76.3479 227.839 76.3479 227.363V224.335ZM83.7178 220.982H97.9554V222.747H83.7178V220.982ZM89.7595 219.751H91.7518V222.034H89.7595V219.751ZM84.2523 224.011H96.7244V225.695H86.0988V234.944H84.2523V224.011ZM95.7202 224.011H97.5829V232.871C97.5829 233.335 97.5235 233.708 97.4047 233.988C97.2967 234.269 97.0862 234.49 96.773 234.652C96.4491 234.793 96.0549 234.879 95.5906 234.912C95.1263 234.955 94.5755 234.976 93.9384 234.976C93.906 234.804 93.8574 234.604 93.7927 234.377C93.7279 234.15 93.6523 233.923 93.5659 233.697C93.4795 233.481 93.3877 233.292 93.2905 233.13C93.7225 233.141 94.1382 233.151 94.5377 233.162C94.9481 233.162 95.2234 233.162 95.3638 233.162C95.4934 233.162 95.5852 233.141 95.6392 233.097C95.6932 233.043 95.7202 232.957 95.7202 232.838V224.011ZM88.3341 225.485H90.051C90.0186 226.122 89.9106 226.678 89.7271 227.153C89.5435 227.628 89.2249 228.022 88.7714 228.335C88.3179 228.648 87.6592 228.908 86.7953 229.113C86.7305 228.897 86.6063 228.654 86.4228 228.384C86.25 228.114 86.0826 227.903 85.9206 227.752C86.5901 227.633 87.0923 227.482 87.427 227.299C87.7618 227.104 87.9885 226.861 88.1073 226.57C88.2369 226.278 88.3125 225.916 88.3341 225.485ZM91.3468 225.468H93.0152V226.716C93.0152 226.888 93.0368 226.996 93.08 227.04C93.1232 227.072 93.2149 227.088 93.3553 227.088C93.3877 227.088 93.4417 227.088 93.5173 227.088C93.5929 227.088 93.6739 227.088 93.7603 227.088C93.8466 227.088 93.9276 227.088 94.0032 227.088C94.0896 227.088 94.149 227.088 94.1814 227.088C94.2786 227.088 94.3488 227.072 94.392 227.04C94.446 226.996 94.4838 226.91 94.5053 226.78C94.5377 226.651 94.5593 226.456 94.5701 226.197C94.7213 226.305 94.9373 226.413 95.218 226.521C95.5096 226.618 95.7634 226.694 95.9793 226.748C95.9037 227.439 95.7472 227.903 95.5096 228.141C95.272 228.379 94.9049 228.497 94.4082 228.497C94.3326 228.497 94.2354 228.497 94.1166 228.497C93.9978 228.497 93.8682 228.497 93.7279 228.497C93.5983 228.497 93.4741 228.497 93.3553 228.497C93.2473 228.497 93.1609 228.497 93.0962 228.497C92.621 228.497 92.2539 228.443 91.9947 228.335C91.7464 228.217 91.5736 228.033 91.4764 227.785C91.39 227.525 91.3468 227.175 91.3468 226.732V225.468ZM87.6862 229.097H89.4193V234.215H87.6862V229.097ZM88.7552 229.097H94.0842V233.34H88.7552V231.899H92.3349V230.538H88.7552V229.097ZM86.6171 222.715L88.5446 222.391C88.6958 222.639 88.8416 222.925 88.982 223.249C89.1224 223.562 89.2249 223.838 89.2897 224.075L87.265 224.48C87.2218 224.243 87.1354 223.957 87.0059 223.622C86.8871 223.287 86.7575 222.985 86.6171 222.715ZM92.9504 222.375L95.1047 222.699C94.9103 223.044 94.7267 223.368 94.5539 223.67C94.392 223.962 94.2354 224.21 94.0842 224.416L92.1567 224.092C92.2971 223.843 92.4429 223.557 92.594 223.233C92.7452 222.909 92.864 222.623 92.9504 222.375ZM104.175 222.261V224.432H109.877V222.261H104.175ZM102.296 220.399H111.853V226.278H102.296V220.399ZM100.061 227.639H106.265V234.879H104.321V229.502H101.908V234.976H100.061V227.639ZM107.625 227.639H114.04V234.895H112.096V229.502H109.488V234.976H107.625V227.639ZM100.871 232.288H105.131V234.15H100.871V232.288ZM108.516 232.288H113.052V234.15H108.516V232.288Z" fill="#4C5773"/>+<path opacity="0.75" d="M34.6859 254.308H36.5708V252.565C36.5708 252.401 36.5771 252.206 36.5896 251.98C36.6022 251.754 36.6116 251.562 36.6179 251.405H36.5802C36.5048 251.55 36.4263 251.691 36.3446 251.829C36.2629 251.968 36.1781 252.109 36.0901 252.254L34.6859 254.308ZM36.5708 256.589V254.93H33.8659V254.421L36.4388 250.576H37.3059V254.308H38.1259V254.93H37.3059V256.589H36.5708ZM40.9257 256.702C40.3225 256.702 39.8481 256.432 39.5025 255.891C39.1632 255.345 38.9936 254.569 38.9936 253.564C38.9936 252.552 39.1632 251.782 39.5025 251.254C39.8481 250.727 40.3225 250.463 40.9257 250.463C41.5226 250.463 41.9906 250.727 42.3299 251.254C42.6755 251.782 42.8483 252.552 42.8483 253.564C42.8483 254.569 42.6755 255.345 42.3299 255.891C41.9906 256.432 41.5226 256.702 40.9257 256.702ZM40.9257 256.08C41.2775 256.08 41.5603 255.882 41.7739 255.486C41.9875 255.084 42.0943 254.443 42.0943 253.564C42.0943 252.684 41.9875 252.052 41.7739 251.669C41.5603 251.28 41.2775 251.085 40.9257 251.085C40.5738 251.085 40.2879 251.28 40.068 251.669C39.8544 252.052 39.7476 252.684 39.7476 253.564C39.7476 254.443 39.8544 255.084 40.068 255.486C40.2879 255.882 40.5738 256.08 40.9257 256.08Z" fill="black" fill-opacity="0.7"/>+<path opacity="0.75" d="M34.0827 318.907V318.445C34.6859 317.842 35.1979 317.314 35.6189 316.862C36.0399 316.403 36.3603 315.992 36.5802 315.627C36.8001 315.257 36.9101 314.911 36.9101 314.591C36.9101 314.245 36.8158 313.962 36.6273 313.742C36.4388 313.523 36.153 313.413 35.7697 313.413C35.5184 313.413 35.2859 313.485 35.0723 313.629C34.8586 313.768 34.6639 313.937 34.4879 314.138L34.045 313.695C34.2963 313.419 34.5633 313.199 34.8461 313.036C35.1351 312.866 35.4744 312.781 35.8639 312.781C36.4231 312.781 36.863 312.945 37.1834 313.271C37.5038 313.592 37.6641 314.019 37.6641 314.553C37.6641 314.93 37.5572 315.313 37.3436 315.703C37.1363 316.086 36.8473 316.491 36.4765 316.919C36.1121 317.34 35.6912 317.798 35.2136 318.295C35.377 318.282 35.5466 318.269 35.7226 318.257C35.8985 318.244 36.065 318.238 36.2221 318.238H37.9656V318.907H34.0827ZM40.9257 319.02C40.3225 319.02 39.8481 318.75 39.5025 318.21C39.1632 317.663 38.9936 316.887 38.9936 315.882C38.9936 314.87 39.1632 314.101 39.5025 313.573C39.8481 313.045 40.3225 312.781 40.9257 312.781C41.5226 312.781 41.9906 313.045 42.3299 313.573C42.6755 314.101 42.8483 314.87 42.8483 315.882C42.8483 316.887 42.6755 317.663 42.3299 318.21C41.9906 318.75 41.5226 319.02 40.9257 319.02ZM40.9257 318.398C41.2775 318.398 41.5603 318.2 41.7739 317.805C41.9875 317.402 42.0943 316.762 42.0943 315.882C42.0943 315.002 41.9875 314.371 41.7739 313.988C41.5603 313.598 41.2775 313.403 40.9257 313.403C40.5738 313.403 40.2879 313.598 40.068 313.988C39.8544 314.371 39.7476 315.002 39.7476 315.882C39.7476 316.762 39.8544 317.402 40.068 317.805C40.2879 318.2 40.5738 318.398 40.9257 318.398Z" fill="black" fill-opacity="0.7"/>+<rect x="48.6572" y="378.436" width="124.597" height="28.6573" transform="rotate(-90 48.6572 378.436)" fill="#205B83"/>+<rect x="243.028" y="378.436" width="87.2177" height="27.4113" transform="rotate(-90 243.028 378.436)" fill="#92CF75"/>+<rect x="88.5282" y="378.436" width="124.597" height="27.4113" transform="rotate(-90 88.5282 378.436)" fill="#2D76A8"/>+<rect x="281.653" y="378.436" width="87.2177" height="28.6573" transform="rotate(-90 281.653 378.436)" fill="#BFE46D"/>+<rect x="127.153" y="378.436" width="112.137" height="27.4113" transform="rotate(-90 127.153 378.436)" fill="#2C968A"/>+<rect x="165.778" y="378.436" width="99.6774" height="28.6573" transform="rotate(-90 165.778 378.436)" fill="#205B83"/>+<rect x="203.157" y="378.436" width="99.6774" height="29.9032" transform="rotate(-90 203.157 378.436)" fill="#6DB87D"/>+</g>+</g>+<defs>+<filter id="filter0_d_19175_47383" x="46.2724" y="10.109" width="257.455" height="166.455" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">+<feFlood flood-opacity="0" result="BackgroundImageFix"/>+<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>+<feOffset dy="2.83656"/>+<feGaussianBlur stdDeviation="2.3638"/>+<feComposite in2="hardAlpha" operator="out"/>+<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.08 0"/>+<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_19175_47383"/>+<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_19175_47383" result="shape"/>+</filter>+<filter id="filter1_d_19175_47383" x="23.68" y="93.8711" width="301.64" height="199.265" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">+<feFlood flood-opacity="0" result="BackgroundImageFix"/>+<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>+<feOffset dy="3.19112"/>+<feGaussianBlur stdDeviation="5.66"/>+<feComposite in2="hardAlpha" operator="out"/>+<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.18 0"/>+<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_19175_47383"/>+<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_19175_47383" result="shape"/>+</filter>+<filter id="filter2_d_19175_47383" x="4.11" y="191.644" width="340.78" height="227.397" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">+<feFlood flood-opacity="0" result="BackgroundImageFix"/>+<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>+<feOffset dy="3.53426"/>+<feGaussianBlur stdDeviation="7.945"/>+<feComposite in2="hardAlpha" operator="out"/>+<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.18 0"/>+<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_19175_47383"/>+<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_19175_47383" result="shape"/>+</filter>+<clipPath id="clip0_19175_47383">+<rect width="349" height="317" rx="6" fill="white"/>+</clipPath>+</defs>+</svg>diff --git a/resources/frontend_client/app/assets/img/upsell-embedding-sso.svg b/resources/frontend_client/app/assets/img/upsell-embedding-sso.svgnew file mode 100644index 00000000000..1c34a66940f--- /dev/null+++ b/resources/frontend_client/app/assets/img/upsell-embedding-sso.svg@@ -0,0 +1,53 @@+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 282 256" width="282" height="256" fill="none">+ <rect width="282" height="256" rx="10" fill="#0572D1" fill-opacity="0.03"/>+ <svg x="0.00" y="17.40" width="282.00" height="221.20" viewBox="0 0 269 211" fill="none" xmlns="http://www.w3.org/2000/svg">+<path d="M71 112.5C68.6 112.5 66.3333 111.833 65.5 111.5C68.6667 109.833 75 103.8 75 93C75 82.2 68.6667 76.1667 65.5 74.5C66.5 74.1667 69.1 73.5 71.5 73.5C74.5 73.5 86.5 76.5 86.5 93C86.5 109.5 74 112.5 71 112.5Z" fill="#0572D2" fill-opacity="0.07"/>+<path d="M211.5 195.5H203.5V16C203.5 10.4 200.167 9.33333 198.5 9.5C199.667 9.33333 202.8 9 206 9C210 9 211.5 11.5 211.5 14V195.5Z" fill="#0572D2" fill-opacity="0.07"/>+<path d="M143.5 131L149 102.5C146.2 101.3 145.167 99.6667 145 99H153.5C156.5 99 159 96 159 92.5C159 89 156.5 86 153.5 86H142.5C144.1 79.6 151.5 77.6667 155 77.5C161 77.5 167.5 82.5 167.5 90.5C167.5 96.9 162.833 101.167 160.5 102.5L165.5 131H143.5Z" fill="#0572D2" fill-opacity="0.21"/>+<path d="M100.113 155.887C92.6312 148.405 87.0478 139.743 83.3631 130.5" stroke="#509EE3"/>+<path d="M118 35.8441C111.57 39.2712 105.532 43.6943 100.113 49.1134C94.632 54.5945 90.1698 60.7088 86.7266 67.2207" stroke="#0572D2" stroke-opacity="0.21"/>+<path d="M153.5 27C171.375 27 189.251 33.3088 203.5 45.9261" stroke="#509EE3"/>+<path d="M218.166 63.4967C234.564 90.6363 232.348 125.871 211.517 150.822" stroke="#0572D2" stroke-opacity="0.21"/>+<path d="M203.639 46.0298C209.416 51.1509 214.282 57.0581 218.158 63.4984" stroke="#0572D2" stroke-opacity="0.21"/>+<path d="M199.35 162.496C185.86 172.833 169.679 178 153.5 178" stroke="#509EE3"/>+<path d="M153.5 160C125.682 160 102.478 140.246 97.1504 114" stroke="#0572D2" stroke-opacity="0.21"/>+<path d="M112.838 61.8452C123.244 51.4375 137.62 45 153.5 45" stroke="#509EE3"/>+<path d="M168.376 46.9577C182.593 50.7655 195.356 59.9973 203.296 73.7499" stroke="#0572D2" stroke-opacity="0.21"/>+<path d="M106.455 149.5C98.6392 141.677 92.7625 131.916 89.6074 121" stroke="#509EE3"/>+<path d="M200.5 55.4548C188.468 43.4339 171.852 36 153.5 36C127.17 36 104.413 51.3029 93.6396 73.5" stroke="#509EE3"/>+<path d="M211.557 70.5C216.624 79.8865 219.5 90.63 219.5 102.045C219.5 113.503 216.602 124.284 211.5 133.695" stroke="#509EE3"/>+<path d="M211.559 133.698C209.307 137.85 206.637 141.707 203.617 145.225" stroke="#509EE3"/>+<path d="M200.5 149.545C188.468 161.566 171.852 169 153.5 169C137.571 169 122.951 163.399 111.5 154.061" stroke="#0572D2" stroke-opacity="0.21"/>+<path d="M62 126L44 93.5L62 60.5H83L101.5 93.5L82.5 126H62Z" stroke="#509EE3"/>+<path d="M71 73.5C79.4621 73.5 86.5 82.1206 86.5 93C86.5 103.879 79.4621 112.5 71 112.5C62.5379 112.5 55.5 103.879 55.5 93C55.5 82.1206 62.5379 73.5 71 73.5Z" stroke="#509EE3"/>+<path d="M65.5 111.28C71.0974 108.166 75 101.152 75 92.9994C75 84.8466 71.0974 77.8332 65.5 74.7188" stroke="#509EE3"/>+<path d="M62.5 126H49L31 93.5L49 60.5H62" stroke="#509EE3"/>+<line x1="111.5" y1="100" x2="111.5" y2="196" stroke="#509EE3"/>+<line x1="111" y1="195.5" x2="212" y2="195.5" stroke="#509EE3"/>+<path d="M211.5 195.5V14.203C211.5 11.3635 209.138 9.094 206.301 9.20692L115.801 12.8089C113.119 12.9157 111 15.1209 111 17.805V85.5" stroke="#509EE3"/>+<path d="M203.5 195.5V14.6695C203.5 11.8427 201.159 9.57805 198.333 9.67222L173.5 10.5" stroke="#509EE3"/>+<path d="M97.5 86H153C156.314 86 159 88.9101 159 92.5C159 96.0899 156.314 99 153 99H98.5" stroke="#509EE3"/>+<path d="M154.5 77C161.956 77 168 83.0442 168 90.5C168 95.6641 165.1 100.15 160.84 102.42L166 131.5H143L148.586 102.638C146.808 101.77 145.25 100.521 144.015 99H145.337C146.381 100.125 147.629 101.058 149.024 101.739L149.713 102.075L149.567 102.828L144.212 130.5H164.808L159.855 102.595L159.729 101.879L160.369 101.537C164.316 99.4334 167 95.28 167 90.5C167 83.5964 161.404 78 154.5 78C149.183 78 144.646 81.3207 142.839 86H141.77C143.623 80.7569 148.622 77 154.5 77Z" fill="#509EE3"/>+<path d="M154.5 72C164.717 72 173 80.2827 173 90.5C173 96.8793 169.771 102.504 164.858 105.83L171 135H138L144.692 106.188C141.891 104.432 139.595 101.948 138.066 99H139.201C140.642 101.587 142.719 103.771 145.224 105.34L145.828 105.719L145.666 106.414L139.259 134H169.768L163.88 106.036L163.741 105.379L164.298 105.002C168.947 101.854 172 96.5335 172 90.5C172 80.835 164.165 73 154.5 73C146.391 73 139.571 78.5158 137.585 86H136.552C138.562 77.9576 145.835 72 154.5 72Z" fill="#509EE3"/>+<line x1="211" y1="102.5" x2="229" y2="102.5" stroke="#509EE3"/>+<line x1="193.887" y1="62.1152" x2="200.887" y2="55.1152" stroke="#509EE3"/>+<line x1="113.113" y1="62.1114" x2="100.113" y2="49.1114" stroke="#509EE3"/>+<line x1="153.5" y1="45" x2="153.5" y2="27" stroke="#509EE3"/>+<line x1="113.113" y1="142.887" x2="100.113" y2="155.887" stroke="#509EE3"/>+<line x1="153.5" y1="160" x2="153.5" y2="178" stroke="#509EE3"/>+<line x1="182.25" y1="152.297" x2="191.25" y2="167.885" stroke="#509EE3"/>+<line x1="31" y1="93.5" x2="44" y2="93.5" stroke="#509EE3"/>+<circle cx="153.5" cy="159.5" r="2" fill="#F8FBFE" stroke="#509EE3"/>+<circle cx="153.5" cy="177.5" r="2" fill="#F8FBFE" stroke="#509EE3"/>+<circle cx="191.5" cy="168.5" r="2" fill="#F8FBFE" stroke="#509EE3"/>+<circle cx="229.5" cy="102.5" r="2" fill="#F8FBFE" stroke="#509EE3"/>+<circle cx="194.5" cy="61.5" r="2" fill="#F8FBFE" stroke="#509EE3"/>+<circle cx="153.5" cy="45.5" r="2" fill="#F8FBFE" stroke="#509EE3"/>+<circle cx="99.5" cy="48.5" r="2" fill="#F8FBFE" stroke="#509EE3"/>+<circle cx="112.5" cy="61.5" r="2" fill="#F8FBFE" stroke="#509EE3"/>+<circle cx="112.5" cy="143.5" r="2" fill="#F8FBFE" stroke="#509EE3"/>+<circle cx="99.5" cy="155.5" r="2" fill="#F8FBFE" stroke="#509EE3"/>+<circle cx="153.5" cy="27.5" r="2" fill="#F8FBFE" stroke="#509EE3"/>+<path d="M153.5 54C180.286 54 202 75.7142 202 102.5C202 129.286 180.286 151 153.5 151C126.714 151 105 129.286 105 102.5C105 101.323 105.043 100.156 105.125 99H153C156.5 99 159 96 159 92.5C159 89 156 86 153 86H107.881C114.632 67.3374 132.508 54 153.5 54Z" fill="#0572D2" fill-opacity="0.07"/>+</svg>+</svg>diff --git a/resources/frontend_client/app/assets/img/upsell-embedding-tenants.svg b/resources/frontend_client/app/assets/img/upsell-embedding-tenants.svgnew file mode 100644index 00000000000..10dff39ed9c--- /dev/null+++ b/resources/frontend_client/app/assets/img/upsell-embedding-tenants.svg@@ -0,0 +1,98 @@+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 282 256" width="282" height="256" fill="none">+ <rect width="282" height="256" rx="10" fill="#0572D1" fill-opacity="0.03"/>+ <svg x="21.15" y="53.85" width="239.70" height="148.30" viewBox="0 0 291 180" fill="none" xmlns="http://www.w3.org/2000/svg">+<rect x="9.97895" y="0.302679" width="27.5335" height="27.5335" rx="6.96161" fill="#EEF6FC"/>+<rect x="9.97895" y="0.302679" width="27.5335" height="27.5335" rx="6.96161" stroke="#509EE3" stroke-width="0.605357"/>+<path d="M27.556 9.37981C27.556 11.4843 25.85 13.1903 23.7455 13.1903C21.6411 13.1903 19.9351 11.4843 19.9351 9.37981C19.9351 7.27534 21.6411 5.56934 23.7455 5.56934C25.85 5.56934 27.556 7.27534 27.556 9.37981Z" fill="#E4ECFB" stroke="#509EE3" stroke-width="0.605357" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M17.7042 22.5699H29.7863C31.1251 22.5699 32.1565 21.4187 31.5312 20.2348C30.6115 18.4934 28.5148 16.4146 23.7452 16.4146C18.9757 16.4146 16.879 18.4934 15.9593 20.2348C15.334 21.4187 16.3653 22.5699 17.7042 22.5699Z" fill="#E4ECFB" stroke="#509EE3" stroke-width="0.605357" stroke-linecap="round" stroke-linejoin="round"/>+<rect x="249.989" y="0.302679" width="27.5335" height="27.5335" rx="6.96161" fill="#EEF6FC"/>+<rect x="249.989" y="0.302679" width="27.5335" height="27.5335" rx="6.96161" stroke="#509EE3" stroke-width="0.605357"/>+<path d="M255.255 7.9074C255.255 6.61235 256.305 5.5625 257.6 5.5625H269.911C271.206 5.5625 272.255 6.61235 272.255 7.9074V20.2181C272.255 21.5132 271.206 22.5631 269.911 22.5631H257.6C256.305 22.5631 255.255 21.5132 255.255 20.2181V7.9074Z" fill="#E4ECFB" stroke="#509EE3" stroke-width="0.908036" stroke-linecap="round" stroke-linejoin="round"/>+<g clip-path="url(#clip0_18783_123855)">+<path d="M263.494 16.4414C263.494 16.0031 263.58 15.569 263.748 15.1641C263.916 14.7591 264.162 14.391 264.472 14.0811C264.782 13.771 265.151 13.5242 265.556 13.3564C265.961 13.1888 266.395 13.1025 266.833 13.1025C266.931 13.1026 267.025 13.1424 267.095 13.2119C267.164 13.2814 267.204 13.3753 267.204 13.4736V16.4414C267.204 16.6462 267.038 16.8124 266.833 16.8125L263.865 16.8125C263.66 16.8125 263.494 16.6463 263.494 16.4414ZM266.462 16.0703V13.8711C266.248 13.9019 266.039 13.9591 265.839 14.042C265.524 14.1725 265.238 14.3644 264.997 14.6055C264.756 14.8466 264.564 15.1332 264.434 15.4482C264.351 15.6482 264.293 15.8571 264.263 16.0703L266.462 16.0703Z" fill="#509EE3"/>+<path d="M263.494 16.4414C263.494 16.0031 263.58 15.569 263.748 15.1641C263.916 14.7591 264.162 14.391 264.472 14.0811C264.782 13.771 265.151 13.5242 265.556 13.3564C265.961 13.1888 266.395 13.1025 266.833 13.1025C266.931 13.1026 267.025 13.1424 267.095 13.2119C267.164 13.2814 267.204 13.3753 267.204 13.4736V16.4414C267.204 16.6462 267.038 16.8124 266.833 16.8125L263.865 16.8125C263.66 16.8125 263.494 16.6463 263.494 16.4414ZM266.462 16.0703V13.8711C266.248 13.9019 266.039 13.9591 265.839 14.042C265.524 14.1725 265.238 14.3644 264.997 14.6055C264.756 14.8466 264.564 15.1332 264.434 15.4482C264.351 15.6482 264.293 15.8571 264.263 16.0703L266.462 16.0703Z" stroke="#509EE3"/>+<path d="M264.038 18.125C263.936 17.9473 263.998 17.721 264.175 17.6191C264.353 17.5173 264.58 17.5791 264.682 17.7568C264.826 18.0083 265.012 18.2347 265.233 18.4248C265.59 18.7318 266.024 18.9329 266.487 19.0068C266.95 19.0807 267.425 19.0245 267.858 18.8438C268.291 18.663 268.667 18.3643 268.943 17.9814C269.219 17.5986 269.385 17.1461 269.422 16.6738C269.459 16.2016 269.365 15.7284 269.152 15.3066C268.938 14.8848 268.613 14.5311 268.213 14.2842C268.039 14.1766 267.985 13.9477 268.092 13.7734C268.2 13.5992 268.429 13.545 268.603 13.6523C269.12 13.9714 269.539 14.4283 269.814 14.9717C270.089 15.5149 270.209 16.1239 270.162 16.7314C270.114 17.3391 269.9 17.9225 269.544 18.416C269.189 18.9093 268.704 19.2946 268.144 19.5283C267.584 19.7621 266.97 19.8348 266.371 19.7393C265.772 19.6437 265.21 19.3836 264.75 18.9873C264.464 18.7418 264.223 18.4493 264.038 18.125Z" fill="#509EE3"/>+<path d="M264.038 18.125C263.936 17.9473 263.998 17.721 264.175 17.6191C264.353 17.5173 264.58 17.5791 264.682 17.7568C264.826 18.0083 265.012 18.2347 265.233 18.4248C265.59 18.7318 266.024 18.9329 266.487 19.0068C266.95 19.0807 267.425 19.0245 267.858 18.8438C268.291 18.663 268.667 18.3643 268.943 17.9814C269.219 17.5986 269.385 17.1461 269.422 16.6738C269.459 16.2016 269.365 15.7284 269.152 15.3066C268.938 14.8848 268.613 14.5311 268.213 14.2842C268.039 14.1766 267.985 13.9477 268.092 13.7734C268.2 13.5992 268.429 13.545 268.603 13.6523C269.12 13.9714 269.539 14.4283 269.814 14.9717C270.089 15.5149 270.209 16.1239 270.162 16.7314C270.114 17.3391 269.9 17.9225 269.544 18.416C269.189 18.9093 268.704 19.2946 268.144 19.5283C267.584 19.7621 266.97 19.8348 266.371 19.7393C265.772 19.6437 265.21 19.3836 264.75 18.9873C264.464 18.7418 264.223 18.4493 264.038 18.125Z" stroke="#509EE3"/>+</g>+<path d="M261.117 9.76562L261.117 22.5695" stroke="#509EE3" stroke-width="0.908036" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M255.548 9.67188H271.962" stroke="#509EE3" stroke-width="0.908036" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M249.947 14.0708L241.247 14.0708C235.898 14.0708 231.562 18.4072 231.562 23.7565L231.562 64.619C231.562 69.9683 227.225 74.3047 221.876 74.3047L66.0833 74.3047C60.7389 74.3047 56.4045 69.9759 56.3976 64.6315L56.3445 23.7431C56.3376 18.3987 52.0032 14.0699 46.6588 14.0699L37.5864 14.0699" stroke="#509EE3" stroke-width="0.605357"/>+<path d="M5.30351 36.3365H3.44547V41.4141H2.2785V36.3365H0.445286V35.3889H5.30351V36.3365ZM10.5209 38.7739H8.0463V40.4747H10.9389V41.4141H6.87933V35.3889H10.9265V36.3365H8.0463V37.8552H10.5209V38.7739ZM16.7232 41.4141H15.5646L13.8886 37.5283V41.4141H12.7175V35.3889H13.8886L15.5521 39.2581L15.5563 35.3889H16.7232V41.4141ZM21.651 40.1561H19.8426L19.4867 41.4141H18.2618L20.2357 35.3889H21.291L23.2276 41.4141H22.0027L21.651 40.1561ZM20.1281 39.167H21.3779L20.7613 36.949L20.1281 39.167ZM28.5982 41.4141H27.4395L25.7635 37.5283V41.4141H24.5924V35.3889H25.7635L27.4271 39.2581L27.4312 35.3889H28.5982V41.4141ZM34.9908 36.3365H33.1328V41.4141H31.9658V36.3365H30.1326V35.3889H34.9908V36.3365ZM45.4009 40.1561H43.5925L43.2366 41.4141H42.0117L43.9856 35.3889H45.0408L46.9775 41.4141H45.7526L45.4009 40.1561ZM43.878 39.167H45.1277L44.5111 36.949L43.878 39.167Z" fill="#509EE3"/>+<path d="M238.266 41.4141V35.3889H239.826C240.105 35.3889 240.365 35.4234 240.608 35.4923C240.851 35.5585 241.072 35.6537 241.27 35.7779C241.444 35.8799 241.599 36.0055 241.734 36.1544C241.872 36.3006 241.992 36.4607 242.094 36.6345C242.212 36.8469 242.303 37.0814 242.367 37.338C242.433 37.5945 242.466 37.8676 242.466 38.1573V38.6539C242.466 38.9325 242.436 39.196 242.375 39.4443C242.314 39.6926 242.229 39.9202 242.119 40.1271C242.014 40.3119 241.891 40.483 241.75 40.6402C241.61 40.7947 241.455 40.9244 241.287 41.0292C241.091 41.1534 240.874 41.2485 240.637 41.3147C240.403 41.381 240.152 41.4141 239.884 41.4141H238.266ZM239.437 36.3324V40.4788H239.884C240.027 40.4788 240.161 40.4609 240.285 40.425C240.409 40.3892 240.523 40.3368 240.625 40.2678C240.729 40.1961 240.823 40.105 240.906 39.9947C240.992 39.8816 241.065 39.7505 241.125 39.6015C241.175 39.4719 241.212 39.3284 241.237 39.1712C241.265 39.0112 241.278 38.8387 241.278 38.6539V38.149C241.278 37.9752 241.265 37.8111 241.237 37.6566C241.212 37.4993 241.175 37.3559 241.125 37.2262C241.065 37.0717 240.985 36.9338 240.885 36.8124C240.789 36.691 240.676 36.5917 240.546 36.5145C240.447 36.4565 240.336 36.4124 240.215 36.382C240.096 36.3489 239.967 36.3324 239.826 36.3324H239.437ZM247.191 40.1561H245.383L245.027 41.4141H243.802L245.776 35.3889H246.831L248.768 41.4141H247.543L247.191 40.1561ZM245.668 39.167H246.918L246.301 36.949L245.668 39.167ZM254.594 36.3365H252.735V41.4141H251.568V36.3365H249.735V35.3889H254.594V36.3365ZM259.066 40.1561H257.258L256.902 41.4141H255.677L257.651 35.3889H258.706L260.643 41.4141H259.418L259.066 40.1561ZM257.543 39.167H258.793L258.176 36.949L257.543 39.167ZM265.169 39.8416C265.169 39.734 265.15 39.6333 265.111 39.5395C265.075 39.4457 265.013 39.3574 264.925 39.2746C264.834 39.1946 264.715 39.1215 264.569 39.0553C264.426 38.9863 264.246 38.9229 264.031 38.8649C263.697 38.7739 263.403 38.6635 263.15 38.5339C262.899 38.4042 262.693 38.2621 262.533 38.1077C262.373 37.9532 262.252 37.7821 262.169 37.5945C262.089 37.4069 262.049 37.2028 262.049 36.9821C262.049 36.7283 262.103 36.4979 262.21 36.291C262.318 36.0841 262.467 35.9075 262.657 35.7613C262.848 35.6151 263.072 35.5034 263.332 35.4261C263.591 35.3461 263.872 35.3061 264.176 35.3061C264.49 35.3061 264.777 35.3516 265.037 35.4427C265.299 35.5337 265.524 35.6606 265.711 35.8234C265.899 35.9889 266.045 36.1848 266.15 36.411C266.255 36.6372 266.307 36.8855 266.307 37.1559H265.173C265.168 37.0207 265.143 36.8965 265.099 36.7834C265.057 36.6703 264.995 36.5724 264.912 36.4896C264.827 36.4096 264.721 36.3475 264.594 36.3034C264.47 36.2565 264.323 36.2331 264.155 36.2331C264.001 36.2331 263.863 36.2524 263.741 36.291C263.623 36.3269 263.522 36.3779 263.439 36.4441C263.357 36.5131 263.293 36.5945 263.249 36.6883C263.208 36.7793 263.187 36.8786 263.187 36.9862C263.187 37.0993 263.214 37.2014 263.27 37.2924C263.328 37.3835 263.41 37.4649 263.518 37.5366C263.626 37.6111 263.755 37.6787 263.907 37.7394C264.061 37.8 264.235 37.8566 264.428 37.909C264.635 37.967 264.832 38.0373 265.02 38.1201C265.208 38.2028 265.38 38.298 265.537 38.4056C265.775 38.5822 265.964 38.7877 266.104 39.0222C266.245 39.2567 266.315 39.5271 266.315 39.8333C266.315 40.0981 266.262 40.334 266.154 40.5409C266.049 40.7451 265.903 40.9175 265.715 41.0582C265.528 41.2016 265.304 41.3106 265.045 41.3851C264.786 41.4568 264.503 41.4927 264.197 41.4927C263.896 41.4927 263.598 41.4485 263.303 41.3603C263.01 41.2692 262.755 41.1368 262.537 40.963C262.33 40.792 262.166 40.5906 262.045 40.3588C261.926 40.1271 261.867 39.8553 261.867 39.5436H263.009C263.014 39.7257 263.046 39.8816 263.104 40.0112C263.162 40.1409 263.243 40.2471 263.348 40.3299C263.45 40.4126 263.573 40.4733 263.717 40.5119C263.863 40.5506 264.023 40.5699 264.197 40.5699C264.351 40.5699 264.488 40.5519 264.606 40.5161C264.728 40.4802 264.83 40.4306 264.912 40.3671C264.995 40.3036 265.059 40.2278 265.103 40.1395C265.147 40.0485 265.169 39.9491 265.169 39.8416ZM271.686 38.7739H269.211V40.4747H272.104V41.4141H268.044V35.3889H272.091V36.3365H269.211V37.8552H271.686V38.7739ZM278.343 36.3365H276.485V41.4141H275.318V36.3365H273.485V35.3889H278.343V36.3365ZM288.753 40.1561H286.945L286.589 41.4141H285.364L287.338 35.3889H288.393L290.33 41.4141H289.105L288.753 40.1561ZM287.231 39.167H288.48L287.864 36.949L287.231 39.167Z" fill="#509EE3"/>+<g opacity="0.5">+<rect x="9.97895" y="68.8886" width="27.5335" height="27.5335" rx="6.96161" fill="#F1F2F4"/>+<rect x="9.97895" y="68.8886" width="27.5335" height="27.5335" rx="6.96161" stroke="#8D93A5" stroke-width="0.605357"/>+<path d="M27.556 77.9657C27.556 80.0702 25.85 81.7762 23.7455 81.7762C21.6411 81.7762 19.9351 80.0702 19.9351 77.9657C19.9351 75.8613 21.6411 74.1553 23.7455 74.1553C25.85 74.1553 27.556 75.8613 27.556 77.9657Z" fill="#8D93A5" fill-opacity="0.3" stroke="#5A6072" stroke-width="0.605357" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M17.7042 91.1559H29.7863C31.1251 91.1559 32.1565 90.0047 31.5312 88.8208C30.6115 87.0793 28.5148 85.0005 23.7452 85.0005C18.9757 85.0005 16.879 87.0793 15.9593 88.8208C15.334 90.0047 16.3653 91.1559 17.7042 91.1559Z" fill="#8D93A5" fill-opacity="0.3" stroke="#5A6072" stroke-width="0.605357" stroke-linecap="round" stroke-linejoin="round"/>+</g>+<g opacity="0.5">+<rect x="249.989" y="68.8886" width="27.5335" height="27.5335" rx="6.96161" fill="#F1F2F4"/>+<rect x="249.989" y="68.8886" width="27.5335" height="27.5335" rx="6.96161" stroke="#8D93A5" stroke-width="0.605357"/>+<path d="M255.255 76.5012C255.255 75.2061 256.305 74.1562 257.6 74.1562H269.911C271.206 74.1562 272.255 75.2061 272.255 76.5012V88.8119C272.255 90.107 271.206 91.1568 269.911 91.1568H257.6C256.305 91.1568 255.255 90.107 255.255 88.8119V76.5012Z" fill="#C6C9D2" fill-opacity="0.3" stroke="#5A6072" stroke-width="0.908036" stroke-linecap="round" stroke-linejoin="round"/>+<g clip-path="url(#clip1_18783_123855)">+<path fill-rule="evenodd" clip-rule="evenodd" d="M267.204 85.0353C267.204 84.8304 267.038 84.6643 266.833 84.6643L263.865 84.6643C263.767 84.6643 263.673 84.7034 263.603 84.773C263.533 84.8425 263.494 84.9369 263.494 85.0353C263.494 85.4737 263.581 85.9079 263.749 86.313C263.916 86.718 264.162 87.0861 264.472 87.3961C264.782 87.7062 265.15 87.9521 265.555 88.1199C265.961 88.2877 266.395 88.374 266.833 88.374C267.038 88.374 267.204 88.2079 267.204 88.0031L267.204 85.0353ZM264.263 85.4063L266.462 85.4063L266.462 87.6054C266.249 87.5746 266.039 87.5173 265.839 87.4344C265.524 87.3039 265.238 87.1126 264.997 86.8715C264.756 86.6304 264.565 86.3441 264.434 86.029C264.351 85.8289 264.294 85.6197 264.263 85.4063Z" fill="#5A6072" fill-opacity="0.5"/>+<path d="M268.148 87.1865C267.97 87.2884 267.909 87.5151 268.011 87.6928C268.113 87.8706 268.339 87.9321 268.517 87.8302C268.841 87.6443 269.133 87.4042 269.378 87.1188C269.775 86.658 270.035 86.097 270.131 85.4978C270.227 84.8986 270.153 84.2849 269.92 83.7246C269.686 83.1643 269.301 82.6795 268.807 82.3235C268.314 81.9674 267.731 81.7541 267.123 81.7066C266.516 81.6591 265.907 81.7794 265.363 82.0542C264.82 82.3291 264.363 82.748 264.044 83.2649C263.937 83.4393 263.991 83.6678 264.165 83.7754C264.34 83.883 264.568 83.8289 264.676 83.6546C264.923 83.2545 265.276 82.9296 265.698 82.7163C266.12 82.5029 266.593 82.4094 267.066 82.4463C267.538 82.4832 267.99 82.649 268.373 82.9252C268.756 83.2013 269.054 83.5769 269.235 84.0103C269.416 84.4435 269.472 84.9179 269.398 85.3809C269.325 85.844 269.123 86.278 268.816 86.6349C268.626 86.856 268.4 87.0423 268.148 87.1865Z" fill="#5A6072" fill-opacity="0.5"/>+</g>+<path d="M261.117 78.3516L261.117 91.1554" stroke="#5A6072" stroke-width="0.908036" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M255.548 78.2656H271.962" stroke="#5A6072" stroke-width="0.908036" stroke-linecap="round" stroke-linejoin="round"/>+</g>+<path d="M37.8145 82.6562L249.946 82.6563" stroke="#C6C9D2" stroke-width="0.605357" stroke-linejoin="round" stroke-dasharray="3.63 3.63"/>+<path d="M38.0361 151.244H46.7347C52.084 151.244 56.4204 146.907 56.4204 141.558L56.4204 100.842C56.4204 95.4927 60.7569 91.1562 66.1061 91.1562H221.891C227.235 91.1562 231.57 95.485 231.577 100.829L231.63 141.571C231.637 146.916 235.971 151.244 241.315 151.244H249.947" stroke="#C6C9D2" stroke-width="0.605357" stroke-dasharray="3.63 3.63"/>+<path d="M5.14385 104.93H3.2858V110.008H2.11883V104.93H0.285618V103.983H5.14385V104.93ZM10.3613 107.368H7.88663V109.068H10.7792V110.008H6.71967V103.983H10.7668V104.93H7.88663V106.449H10.3613V107.368ZM16.5636 110.008H15.4049L13.7289 106.122V110.008H12.5578V103.983H13.7289L15.3925 107.852L15.3966 103.983H16.5636V110.008ZM21.4913 108.75H19.6829L19.3271 110.008H18.1022L20.0761 103.983H21.1313L23.068 110.008H21.8431L21.4913 108.75ZM19.9685 107.761H21.2182L20.6016 105.543L19.9685 107.761ZM28.4385 110.008H27.2798L25.6039 106.122V110.008H24.4327V103.983H25.6039L27.2674 107.852L27.2715 103.983H28.4385V110.008ZM34.8312 104.93H32.9731V110.008H31.8062V104.93H29.9729V103.983H34.8312V104.93ZM42.27 110.008V103.983H44.2935C44.6218 103.983 44.9198 104.016 45.1874 104.082C45.4578 104.148 45.6881 104.249 45.8785 104.384C46.0688 104.519 46.215 104.69 46.3171 104.897C46.4219 105.104 46.4744 105.348 46.4744 105.63C46.4716 105.812 46.4385 105.984 46.375 106.147C46.3144 106.307 46.2233 106.448 46.1019 106.569C46.0357 106.635 45.9599 106.696 45.8743 106.751C45.7916 106.806 45.6991 106.853 45.5971 106.892V106.896C45.7957 106.951 45.953 107.021 46.0688 107.107C46.1875 107.192 46.2868 107.292 46.3668 107.405C46.4495 107.526 46.5102 107.659 46.5489 107.802C46.5902 107.943 46.6109 108.089 46.6109 108.241C46.6109 108.53 46.5613 108.786 46.462 109.006C46.3626 109.227 46.2206 109.412 46.0357 109.561C45.8509 109.71 45.626 109.822 45.3612 109.896C45.0964 109.971 44.7984 110.008 44.4673 110.008H42.27ZM43.4369 107.351V109.068H44.4715C44.6232 109.068 44.7584 109.049 44.877 109.011C44.9984 108.972 45.0991 108.919 45.1791 108.853C45.2674 108.779 45.3336 108.689 45.3777 108.584C45.4246 108.479 45.4481 108.362 45.4481 108.233C45.4481 108.097 45.4302 107.976 45.3943 107.868C45.3612 107.761 45.3074 107.67 45.2329 107.595C45.1584 107.518 45.0619 107.459 44.9432 107.417C44.8246 107.376 44.6839 107.354 44.5211 107.351H43.4369ZM43.4369 106.511H44.3018C44.4784 106.508 44.6343 106.488 44.7694 106.449C44.9046 106.408 45.0136 106.347 45.0964 106.267C45.1653 106.203 45.2177 106.126 45.2536 106.035C45.2922 105.944 45.3115 105.841 45.3115 105.725C45.3115 105.603 45.295 105.497 45.2619 105.406C45.2315 105.315 45.1846 105.239 45.1212 105.179C45.0384 105.093 44.9267 105.031 44.786 104.992C44.648 104.954 44.4853 104.933 44.2977 104.93H43.4369V106.511Z" fill="#8D93A5"/>+<path d="M238.266 110.008V103.983H239.826C240.105 103.983 240.365 104.017 240.608 104.086C240.851 104.152 241.072 104.247 241.27 104.372C241.444 104.474 241.599 104.599 241.734 104.748C241.872 104.894 241.992 105.054 242.094 105.228C242.212 105.441 242.303 105.675 242.367 105.932C242.433 106.188 242.466 106.461 242.466 106.751V107.248C242.466 107.526 242.436 107.79 242.375 108.038C242.314 108.286 242.229 108.514 242.119 108.721C242.014 108.906 241.891 109.077 241.75 109.234C241.61 109.388 241.455 109.518 241.287 109.623C241.091 109.747 240.874 109.842 240.637 109.908C240.403 109.975 240.152 110.008 239.884 110.008H238.266ZM239.437 104.926V109.073H239.884C240.027 109.073 240.161 109.055 240.285 109.019C240.409 108.983 240.523 108.931 240.625 108.862C240.729 108.79 240.823 108.699 240.906 108.588C240.992 108.475 241.065 108.344 241.125 108.195C241.175 108.066 241.212 107.922 241.237 107.765C241.265 107.605 241.278 107.432 241.278 107.248V106.743C241.278 106.569 241.265 106.405 241.237 106.25C241.212 106.093 241.175 105.95 241.125 105.82C241.065 105.665 240.985 105.528 240.885 105.406C240.789 105.285 240.676 105.185 240.546 105.108C240.447 105.05 240.336 105.006 240.215 104.976C240.096 104.943 239.967 104.926 239.826 104.926H239.437ZM247.191 108.75H245.383L245.027 110.008H243.802L245.776 103.983H246.831L248.768 110.008H247.543L247.191 108.75ZM245.668 107.761H246.918L246.301 105.543L245.668 107.761ZM254.594 104.93H252.735V110.008H251.568V104.93H249.735V103.983H254.594V104.93ZM259.066 108.75H257.258L256.902 110.008H255.677L257.651 103.983H258.706L260.643 110.008H259.418L259.066 108.75ZM257.543 107.761H258.793L258.176 105.543L257.543 107.761ZM265.169 108.435C265.169 108.328 265.15 108.227 265.111 108.133C265.075 108.039 265.013 107.951 264.925 107.868C264.834 107.788 264.715 107.715 264.569 107.649C264.426 107.58 264.246 107.517 264.031 107.459C263.697 107.368 263.403 107.257 263.15 107.128C262.899 106.998 262.693 106.856 262.533 106.701C262.373 106.547 262.252 106.376 262.169 106.188C262.089 106.001 262.049 105.797 262.049 105.576C262.049 105.322 262.103 105.092 262.21 104.885C262.318 104.678 262.467 104.501 262.657 104.355C262.848 104.209 263.072 104.097 263.332 104.02C263.591 103.94 263.872 103.9 264.176 103.9C264.49 103.9 264.777 103.945 265.037 104.036C265.299 104.127 265.524 104.254 265.711 104.417C265.899 104.583 266.045 104.779 266.15 105.005C266.255 105.231 266.307 105.479 266.307 105.75H265.173C265.168 105.614 265.143 105.49 265.099 105.377C265.057 105.264 264.995 105.166 264.912 105.083C264.827 105.003 264.721 104.941 264.594 104.897C264.47 104.85 264.323 104.827 264.155 104.827C264.001 104.827 263.863 104.846 263.741 104.885C263.623 104.921 263.522 104.972 263.439 105.038C263.357 105.107 263.293 105.188 263.249 105.282C263.208 105.373 263.187 105.472 263.187 105.58C263.187 105.693 263.214 105.795 263.27 105.886C263.328 105.977 263.41 106.059 263.518 106.13C263.626 106.205 263.755 106.272 263.907 106.333C264.061 106.394 264.235 106.45 264.428 106.503C264.635 106.561 264.832 106.631 265.02 106.714C265.208 106.797 265.38 106.892 265.537 106.999C265.775 107.176 265.964 107.381 266.104 107.616C266.245 107.85 266.315 108.121 266.315 108.427C266.315 108.692 266.262 108.928 266.154 109.135C266.049 109.339 265.903 109.511 265.715 109.652C265.528 109.795 265.304 109.904 265.045 109.979C264.786 110.051 264.503 110.086 264.197 110.086C263.896 110.086 263.598 110.042 263.303 109.954C263.01 109.863 262.755 109.731 262.537 109.557C262.33 109.386 262.166 109.184 262.045 108.953C261.926 108.721 261.867 108.449 261.867 108.137H263.009C263.014 108.319 263.046 108.475 263.104 108.605C263.162 108.735 263.243 108.841 263.348 108.924C263.45 109.006 263.573 109.067 263.717 109.106C263.863 109.144 264.023 109.164 264.197 109.164C264.351 109.164 264.488 109.146 264.606 109.11C264.728 109.074 264.83 109.024 264.912 108.961C264.995 108.897 265.059 108.822 265.103 108.733C265.147 108.642 265.169 108.543 265.169 108.435ZM271.686 107.368H269.211V109.068H272.104V110.008H268.044V103.983H272.091V104.93H269.211V106.449H271.686V107.368ZM278.343 104.93H276.485V110.008H275.318V104.93H273.485V103.983H278.343V104.93ZM285.782 110.008V103.983H287.806C288.134 103.983 288.432 104.016 288.7 104.082C288.97 104.148 289.2 104.249 289.391 104.384C289.581 104.519 289.727 104.69 289.829 104.897C289.934 105.104 289.987 105.348 289.987 105.63C289.984 105.812 289.951 105.984 289.887 106.147C289.827 106.307 289.736 106.448 289.614 106.569C289.548 106.635 289.472 106.696 289.387 106.751C289.304 106.806 289.211 106.853 289.109 106.892V106.896C289.308 106.951 289.465 107.021 289.581 107.107C289.7 107.192 289.799 107.292 289.879 107.405C289.962 107.526 290.022 107.659 290.061 107.802C290.102 107.943 290.123 108.089 290.123 108.241C290.123 108.53 290.073 108.786 289.974 109.006C289.875 109.227 289.733 109.412 289.548 109.561C289.363 109.71 289.138 109.822 288.873 109.896C288.609 109.971 288.311 110.008 287.98 110.008H285.782ZM286.949 107.351V109.068H287.984C288.135 109.068 288.271 109.049 288.389 109.011C288.511 108.972 288.611 108.919 288.691 108.853C288.78 108.779 288.846 108.689 288.89 108.584C288.937 108.479 288.96 108.362 288.96 108.233C288.96 108.097 288.942 107.976 288.906 107.868C288.873 107.761 288.82 107.67 288.745 107.595C288.671 107.518 288.574 107.459 288.455 107.417C288.337 107.376 288.196 107.354 288.033 107.351H286.949ZM286.949 106.511H287.814C287.991 106.508 288.146 106.488 288.282 106.449C288.417 106.408 288.526 106.347 288.609 106.267C288.678 106.203 288.73 106.126 288.766 106.035C288.804 105.944 288.824 105.841 288.824 105.725C288.824 105.603 288.807 105.497 288.774 105.406C288.744 105.315 288.697 105.239 288.633 105.179C288.551 105.093 288.439 105.031 288.298 104.992C288.16 104.954 287.997 104.933 287.81 104.93H286.949V106.511Z" fill="#8D93A5"/>+<path d="M126.031 110.008V103.983H127.591C127.87 103.983 128.13 104.017 128.373 104.086C128.616 104.152 128.837 104.247 129.035 104.372C129.209 104.474 129.364 104.599 129.499 104.748C129.637 104.894 129.757 105.054 129.859 105.228C129.977 105.441 130.069 105.675 130.132 105.932C130.198 106.188 130.231 106.461 130.231 106.751V107.248C130.231 107.526 130.201 107.79 130.14 108.038C130.08 108.286 129.994 108.514 129.884 108.721C129.779 108.906 129.656 109.077 129.515 109.234C129.375 109.388 129.22 109.518 129.052 109.623C128.856 109.747 128.639 109.842 128.402 109.908C128.168 109.975 127.917 110.008 127.649 110.008H126.031ZM127.202 104.926V109.073H127.649C127.793 109.073 127.926 109.055 128.05 109.019C128.175 108.983 128.288 108.931 128.39 108.862C128.495 108.79 128.588 108.699 128.671 108.588C128.757 108.475 128.83 108.344 128.891 108.195C128.94 108.066 128.977 107.922 129.002 107.765C129.03 107.605 129.044 107.432 129.044 107.248V106.743C129.044 106.569 129.03 106.405 129.002 106.25C128.977 106.093 128.94 105.95 128.891 105.82C128.83 105.665 128.75 105.528 128.65 105.406C128.554 105.285 128.441 105.185 128.311 105.108C128.212 105.05 128.101 105.006 127.98 104.976C127.861 104.943 127.732 104.926 127.591 104.926H127.202ZM134.956 108.75H133.148L132.792 110.008H131.567L133.541 103.983H134.596L136.533 110.008H135.308L134.956 108.75ZM133.433 107.761H134.683L134.067 105.543L133.433 107.761ZM141.059 108.435C141.059 108.328 141.04 108.227 141.001 108.133C140.965 108.039 140.903 107.951 140.815 107.868C140.724 107.788 140.605 107.715 140.459 107.649C140.316 107.58 140.136 107.517 139.921 107.459C139.587 107.368 139.294 107.257 139.04 107.128C138.789 106.998 138.583 106.856 138.423 106.701C138.263 106.547 138.142 106.376 138.059 106.188C137.979 106.001 137.939 105.797 137.939 105.576C137.939 105.322 137.993 105.092 138.1 104.885C138.208 104.678 138.357 104.501 138.547 104.355C138.738 104.209 138.963 104.097 139.222 104.02C139.481 103.94 139.763 103.9 140.066 103.9C140.381 103.9 140.668 103.945 140.927 104.036C141.189 104.127 141.414 104.254 141.601 104.417C141.789 104.583 141.935 104.779 142.04 105.005C142.145 105.231 142.197 105.479 142.197 105.75H141.063C141.058 105.614 141.033 105.49 140.989 105.377C140.948 105.264 140.885 105.166 140.803 105.083C140.717 105.003 140.611 104.941 140.484 104.897C140.36 104.85 140.214 104.827 140.045 104.827C139.891 104.827 139.753 104.846 139.632 104.885C139.513 104.921 139.412 104.972 139.329 105.038C139.247 105.107 139.183 105.188 139.139 105.282C139.098 105.373 139.077 105.472 139.077 105.58C139.077 105.693 139.105 105.795 139.16 105.886C139.218 105.977 139.301 106.059 139.408 106.13C139.516 106.205 139.645 106.272 139.797 106.333C139.952 106.394 140.125 106.45 140.319 106.503C140.525 106.561 140.723 106.631 140.91 106.714C141.098 106.797 141.27 106.892 141.428 106.999C141.665 107.176 141.854 107.381 141.994 107.616C142.135 107.85 142.206 108.121 142.206 108.427C142.206 108.692 142.152 108.928 142.044 109.135C141.939 109.339 141.793 109.511 141.605 109.652C141.418 109.795 141.194 109.904 140.935 109.979C140.676 110.051 140.393 110.086 140.087 110.086C139.786 110.086 139.488 110.042 139.193 109.954C138.9 109.863 138.645 109.731 138.427 109.557C138.22 109.386 138.056 109.184 137.935 108.953C137.816 108.721 137.757 108.449 137.757 108.137H138.899C138.905 108.319 138.936 108.475 138.994 108.605C139.052 108.735 139.134 108.841 139.238 108.924C139.341 109.006 139.463 109.067 139.607 109.106C139.753 109.144 139.913 109.164 140.087 109.164C140.241 109.164 140.378 109.146 140.496 109.11C140.618 109.074 140.72 109.024 140.803 108.961C140.885 108.897 140.949 108.822 140.993 108.733C141.037 108.642 141.059 108.543 141.059 108.435ZM147.845 110.008H146.695V107.397H144.99V110.008H143.835V103.983H144.99V106.453H146.695V103.983H147.845V110.008ZM149.797 110.008V103.983H151.821C152.149 103.983 152.447 104.016 152.715 104.082C152.985 104.148 153.216 104.249 153.406 104.384C153.596 104.519 153.743 104.69 153.845 104.897C153.949 105.104 154.002 105.348 154.002 105.63C153.999 105.812 153.966 105.984 153.903 106.147C153.842 106.307 153.751 106.448 153.629 106.569C153.563 106.635 153.487 106.696 153.402 106.751C153.319 106.806 153.227 106.853 153.125 106.892V106.896C153.323 106.951 153.48 107.021 153.596 107.107C153.715 107.192 153.814 107.292 153.894 107.405C153.977 107.526 154.038 107.659 154.076 107.802C154.118 107.943 154.138 108.089 154.138 108.241C154.138 108.53 154.089 108.786 153.989 109.006C153.89 109.227 153.748 109.412 153.563 109.561C153.378 109.71 153.154 109.822 152.889 109.896C152.624 109.971 152.326 110.008 151.995 110.008H149.797ZM150.964 107.351V109.068H151.999C152.151 109.068 152.286 109.049 152.404 109.011C152.526 108.972 152.627 108.919 152.707 108.853C152.795 108.779 152.861 108.689 152.905 108.584C152.952 108.479 152.976 108.362 152.976 108.233C152.976 108.097 152.958 107.976 152.922 107.868C152.889 107.761 152.835 107.67 152.76 107.595C152.686 107.518 152.589 107.459 152.471 107.417C152.352 107.376 152.211 107.354 152.049 107.351H150.964ZM150.964 106.511H151.829C152.006 106.508 152.162 106.488 152.297 106.449C152.432 106.408 152.541 106.347 152.624 106.267C152.693 106.203 152.745 106.126 152.781 106.035C152.82 105.944 152.839 105.841 152.839 105.725C152.839 105.603 152.822 105.497 152.789 105.406C152.759 105.315 152.712 105.239 152.649 105.179C152.566 105.093 152.454 105.031 152.313 104.992C152.176 104.954 152.013 104.933 151.825 104.93H150.964V106.511ZM159.948 107.438C159.948 107.697 159.924 107.944 159.877 108.179C159.83 108.41 159.763 108.626 159.674 108.824C159.581 109.023 159.465 109.205 159.327 109.371C159.189 109.536 159.032 109.674 158.855 109.784C158.695 109.881 158.519 109.955 158.325 110.008C158.135 110.063 157.93 110.091 157.709 110.091C157.474 110.091 157.258 110.06 157.059 110C156.86 109.939 156.68 109.853 156.517 109.743C156.357 109.627 156.214 109.488 156.087 109.325C155.96 109.159 155.854 108.973 155.768 108.766C155.691 108.576 155.631 108.369 155.59 108.146C155.551 107.922 155.532 107.686 155.532 107.438V106.561C155.532 106.296 155.554 106.045 155.598 105.808C155.645 105.57 155.713 105.351 155.801 105.15C155.887 104.959 155.99 104.787 156.111 104.632C156.236 104.478 156.378 104.345 156.538 104.235C156.695 104.127 156.872 104.045 157.067 103.987C157.263 103.929 157.476 103.9 157.705 103.9C157.936 103.9 158.153 103.93 158.354 103.991C158.559 104.049 158.742 104.133 158.905 104.243C159.068 104.348 159.21 104.475 159.331 104.624C159.455 104.773 159.561 104.937 159.65 105.116C159.746 105.321 159.819 105.544 159.869 105.787C159.921 106.03 159.948 106.288 159.948 106.561V107.438ZM158.768 106.552C158.768 106.398 158.76 106.252 158.743 106.114C158.73 105.973 158.706 105.843 158.673 105.725C158.632 105.576 158.576 105.443 158.507 105.328C158.439 105.209 158.357 105.112 158.263 105.038C158.189 104.983 158.105 104.94 158.011 104.91C157.92 104.879 157.818 104.864 157.705 104.864C157.597 104.864 157.499 104.878 157.411 104.905C157.325 104.933 157.248 104.973 157.179 105.025C157.085 105.103 157.005 105.199 156.939 105.315C156.876 105.431 156.826 105.566 156.79 105.721C156.763 105.839 156.742 105.969 156.728 106.11C156.717 106.25 156.712 106.398 156.712 106.552V107.438C156.712 107.584 156.717 107.725 156.728 107.86C156.739 107.995 156.758 108.121 156.786 108.237C156.816 108.383 156.86 108.517 156.918 108.638C156.979 108.757 157.049 108.853 157.129 108.928C157.204 108.994 157.288 109.045 157.382 109.081C157.478 109.117 157.587 109.135 157.709 109.135C157.825 109.135 157.931 109.118 158.027 109.085C158.124 109.052 158.21 109.004 158.284 108.94C158.378 108.863 158.456 108.766 158.52 108.65C158.586 108.532 158.639 108.398 158.677 108.249C158.707 108.133 158.73 108.006 158.743 107.868C158.76 107.73 158.768 107.587 158.768 107.438V106.552ZM164.644 108.75H162.835L162.479 110.008H161.254L163.228 103.983H164.284L166.22 110.008H164.995L164.644 108.75ZM163.121 107.761H164.37L163.754 105.543L163.121 107.761ZM169.662 107.757H168.781V110.008H167.618V103.983H169.638C169.971 103.983 170.273 104.023 170.544 104.103C170.814 104.18 171.046 104.294 171.239 104.446C171.429 104.598 171.576 104.787 171.678 105.013C171.783 105.239 171.835 105.501 171.835 105.799C171.835 106.014 171.809 106.209 171.756 106.383C171.707 106.554 171.635 106.707 171.541 106.842C171.445 106.98 171.329 107.1 171.194 107.202C171.061 107.304 170.912 107.392 170.747 107.467L172.042 109.954V110.008H170.796L169.662 107.757ZM168.781 106.813H169.642C169.821 106.813 169.978 106.788 170.113 106.739C170.251 106.686 170.363 106.612 170.449 106.515C170.52 106.438 170.574 106.346 170.61 106.238C170.649 106.13 170.668 106.01 170.668 105.878C170.668 105.718 170.643 105.577 170.593 105.456C170.547 105.332 170.475 105.23 170.378 105.15C170.293 105.078 170.188 105.023 170.064 104.984C169.94 104.945 169.798 104.926 169.638 104.926H168.781V106.813ZM173.531 110.008V103.983H175.091C175.369 103.983 175.63 104.017 175.873 104.086C176.116 104.152 176.336 104.247 176.535 104.372C176.709 104.474 176.863 104.599 176.999 104.748C177.136 104.894 177.256 105.054 177.359 105.228C177.477 105.441 177.568 105.675 177.632 105.932C177.698 106.188 177.731 106.461 177.731 106.751V107.248C177.731 107.526 177.701 107.79 177.64 108.038C177.579 108.286 177.494 108.514 177.383 108.721C177.279 108.906 177.156 109.077 177.015 109.234C176.874 109.388 176.72 109.518 176.552 109.623C176.356 109.747 176.139 109.842 175.902 109.908C175.667 109.975 175.416 110.008 175.149 110.008H173.531ZM174.702 104.926V109.073H175.149C175.292 109.073 175.426 109.055 175.55 109.019C175.674 108.983 175.787 108.931 175.89 108.862C175.994 108.79 176.088 108.699 176.171 108.588C176.256 108.475 176.33 108.344 176.39 108.195C176.44 108.066 176.477 107.922 176.502 107.765C176.53 107.605 176.543 107.432 176.543 107.248V106.743C176.543 106.569 176.53 106.405 176.502 106.25C176.477 106.093 176.44 105.95 176.39 105.82C176.33 105.665 176.25 105.528 176.15 105.406C176.054 105.285 175.941 105.185 175.811 105.108C175.712 105.05 175.601 105.006 175.48 104.976C175.361 104.943 175.232 104.926 175.091 104.926H174.702Z" fill="#8D93A5"/>+<g opacity="0.5">+<rect x="9.97895" y="137.475" width="27.5335" height="27.5335" rx="6.96161" fill="#F1F2F4"/>+<rect x="9.97895" y="137.475" width="27.5335" height="27.5335" rx="6.96161" stroke="#8D93A5" stroke-width="0.605357"/>+<path d="M27.556 146.552C27.556 148.656 25.85 150.362 23.7455 150.362C21.6411 150.362 19.9351 148.656 19.9351 146.552C19.9351 144.447 21.6411 142.741 23.7455 142.741C25.85 142.741 27.556 144.447 27.556 146.552Z" fill="#8D93A5" fill-opacity="0.3" stroke="#5A6072" stroke-width="0.605357" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M17.7042 159.742H29.7863C31.1251 159.742 32.1565 158.591 31.5312 157.407C30.6115 155.665 28.5148 153.586 23.7452 153.586C18.9757 153.586 16.879 155.665 15.9593 157.407C15.334 158.591 16.3653 159.742 17.7042 159.742Z" fill="#8D93A5" fill-opacity="0.3" stroke="#5A6072" stroke-width="0.605357" stroke-linecap="round" stroke-linejoin="round"/>+</g>+<g opacity="0.5">+<rect x="249.989" y="137.475" width="27.5335" height="27.5335" rx="6.96161" fill="#F1F2F4"/>+<rect x="249.989" y="137.475" width="27.5335" height="27.5335" rx="6.96161" stroke="#8D93A5" stroke-width="0.605357"/>+<path d="M255.255 145.087C255.255 143.792 256.305 142.742 257.6 142.742H269.911C271.206 142.742 272.255 143.792 272.255 145.087V157.398C272.255 158.693 271.206 159.743 269.911 159.743H257.6C256.305 159.743 255.255 158.693 255.255 157.398V145.087Z" fill="#C6C9D2" fill-opacity="0.3" stroke="#5A6072" stroke-width="0.908036" stroke-linecap="round" stroke-linejoin="round"/>+<g clip-path="url(#clip2_18783_123855)">+<path fill-rule="evenodd" clip-rule="evenodd" d="M266.834 153.242C266.629 153.242 266.463 153.408 266.463 153.613V156.581C266.463 156.679 266.502 156.774 266.572 156.843C266.641 156.913 266.736 156.952 266.834 156.952C267.273 156.952 267.707 156.866 268.112 156.698C268.517 156.53 268.885 156.284 269.195 155.974C269.505 155.664 269.751 155.296 269.919 154.891C270.086 154.486 270.173 154.052 270.173 153.613C270.173 153.408 270.007 153.242 269.802 153.242L266.834 153.242ZM267.205 156.183V153.984L269.404 153.984C269.373 154.198 269.316 154.407 269.233 154.607C269.103 154.922 268.911 155.208 268.67 155.449C268.429 155.69 268.143 155.882 267.828 156.012C267.628 156.095 267.419 156.153 267.205 156.183Z" fill="#5A6072" fill-opacity="0.5"/>+<path d="M268.985 152.298C269.087 152.476 269.314 152.538 269.492 152.436C269.669 152.334 269.731 152.107 269.629 151.929C269.443 151.605 269.203 151.313 268.918 151.068C268.457 150.671 267.896 150.411 267.297 150.315C266.697 150.22 266.084 150.293 265.523 150.527C264.963 150.76 264.478 151.145 264.122 151.639C263.766 152.132 263.553 152.715 263.505 153.323C263.458 153.931 263.578 154.54 263.853 155.083C264.128 155.626 264.547 156.083 265.064 156.402C265.238 156.51 265.467 156.455 265.574 156.281C265.682 156.107 265.628 155.878 265.453 155.771C265.053 155.524 264.728 155.17 264.515 154.748C264.302 154.326 264.208 153.853 264.245 153.381C264.282 152.908 264.448 152.456 264.724 152.073C265 151.69 265.376 151.392 265.809 151.211C266.242 151.031 266.717 150.974 267.18 151.048C267.643 151.122 268.077 151.323 268.434 151.63C268.655 151.82 268.841 152.047 268.985 152.298Z" fill="#5A6072" fill-opacity="0.5"/>+</g>+<path d="M261.117 146.938L261.117 159.741" stroke="#5A6072" stroke-width="0.908036" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M255.548 146.852H271.962" stroke="#5A6072" stroke-width="0.908036" stroke-linecap="round" stroke-linejoin="round"/>+</g>+<path d="M5.14385 173.516H3.2858V178.594H2.11883V173.516H0.285618V172.569H5.14385V173.516ZM10.3613 175.954H7.88663V177.654H10.7792V178.594H6.71967V172.569H10.7668V173.516H7.88663V175.035H10.3613V175.954ZM16.5636 178.594H15.4049L13.7289 174.708V178.594H12.5578V172.569H13.7289L15.3925 176.438L15.3966 172.569H16.5636V178.594ZM21.4913 177.336H19.6829L19.3271 178.594H18.1022L20.0761 172.569H21.1313L23.068 178.594H21.8431L21.4913 177.336ZM19.9685 176.347H21.2182L20.6016 174.129L19.9685 176.347ZM28.4385 178.594H27.2798L25.6039 174.708V178.594H24.4327V172.569H25.6039L27.2674 176.438L27.2715 172.569H28.4385V178.594ZM34.8312 173.516H32.9731V178.594H31.8062V173.516H29.9729V172.569H34.8312V173.516ZM46.462 176.707C46.4426 177.01 46.3764 177.283 46.2633 177.526C46.153 177.769 46.004 177.976 45.8164 178.147C45.6288 178.318 45.4053 178.45 45.146 178.544C44.8867 178.635 44.5998 178.681 44.2853 178.681C44.037 178.681 43.8066 178.649 43.5942 178.585C43.3845 178.519 43.1955 178.425 43.0273 178.304C42.8728 178.191 42.7348 178.054 42.6134 177.894C42.4948 177.734 42.3941 177.558 42.3114 177.365C42.2313 177.172 42.1693 176.959 42.1251 176.727C42.0838 176.496 42.0631 176.25 42.0631 175.991V175.18C42.0631 174.937 42.0824 174.707 42.121 174.489C42.1596 174.268 42.2176 174.064 42.2948 173.876C42.3831 173.647 42.499 173.443 42.6424 173.264C42.7859 173.084 42.9486 172.933 43.1307 172.809C43.2935 172.704 43.4714 172.624 43.6645 172.569C43.8604 172.511 44.0701 172.482 44.2935 172.482C44.6246 172.482 44.9184 172.529 45.175 172.622C45.4343 172.716 45.655 172.85 45.8371 173.024C46.0192 173.198 46.1626 173.41 46.2675 173.661C46.3723 173.912 46.4385 174.195 46.4661 174.509H45.3074C45.2964 174.33 45.2688 174.173 45.2246 174.038C45.1833 173.902 45.1226 173.789 45.0426 173.698C44.9598 173.61 44.8563 173.544 44.7322 173.5C44.6108 173.453 44.4646 173.429 44.2935 173.429C44.2025 173.429 44.117 173.439 44.037 173.458C43.9597 173.478 43.888 173.507 43.8218 173.545C43.7087 173.611 43.6121 173.707 43.5321 173.831C43.4549 173.952 43.3928 174.094 43.3459 174.257C43.31 174.384 43.2838 174.525 43.2673 174.679C43.2507 174.831 43.2424 174.995 43.2424 175.171V175.991C43.2424 176.231 43.2549 176.446 43.2797 176.636C43.3073 176.824 43.3487 176.988 43.4038 177.129C43.4425 177.225 43.488 177.311 43.5404 177.385C43.5956 177.46 43.6576 177.522 43.7266 177.572C43.8011 177.627 43.8839 177.668 43.9749 177.696C44.0687 177.721 44.1722 177.733 44.2853 177.733C44.437 177.733 44.5736 177.714 44.6949 177.675C44.8163 177.636 44.9198 177.576 45.0053 177.493C45.0908 177.41 45.1584 177.304 45.2081 177.174C45.2577 177.045 45.2881 176.889 45.2991 176.707H46.462Z" fill="#8D93A5"/>+<path d="M238.266 178.594V172.569H239.826C240.105 172.569 240.365 172.603 240.608 172.672C240.851 172.738 241.072 172.833 241.27 172.958C241.444 173.06 241.599 173.185 241.734 173.334C241.872 173.48 241.992 173.64 242.094 173.814C242.212 174.027 242.303 174.261 242.367 174.518C242.433 174.774 242.466 175.047 242.466 175.337V175.834C242.466 176.112 242.436 176.376 242.375 176.624C242.314 176.872 242.229 177.1 242.119 177.307C242.014 177.492 241.891 177.663 241.75 177.82C241.61 177.974 241.455 178.104 241.287 178.209C241.091 178.333 240.874 178.428 240.637 178.494C240.403 178.561 240.152 178.594 239.884 178.594H238.266ZM239.437 173.512V177.659H239.884C240.027 177.659 240.161 177.641 240.285 177.605C240.409 177.569 240.523 177.516 240.625 177.447C240.729 177.376 240.823 177.285 240.906 177.174C240.992 177.061 241.065 176.93 241.125 176.781C241.175 176.652 241.212 176.508 241.237 176.351C241.265 176.191 241.278 176.018 241.278 175.834V175.329C241.278 175.155 241.265 174.991 241.237 174.836C241.212 174.679 241.175 174.536 241.125 174.406C241.065 174.251 240.985 174.113 240.885 173.992C240.789 173.871 240.676 173.771 240.546 173.694C240.447 173.636 240.336 173.592 240.215 173.562C240.096 173.529 239.967 173.512 239.826 173.512H239.437ZM247.191 177.336H245.383L245.027 178.594H243.802L245.776 172.569H246.831L248.768 178.594H247.543L247.191 177.336ZM245.668 176.347H246.918L246.301 174.129L245.668 176.347ZM254.594 173.516H252.735V178.594H251.568V173.516H249.735V172.569H254.594V173.516ZM259.066 177.336H257.258L256.902 178.594H255.677L257.651 172.569H258.706L260.643 178.594H259.418L259.066 177.336ZM257.543 176.347H258.793L258.176 174.129L257.543 176.347ZM265.169 177.021C265.169 176.914 265.15 176.813 265.111 176.719C265.075 176.625 265.013 176.537 264.925 176.454C264.834 176.374 264.715 176.301 264.569 176.235C264.426 176.166 264.246 176.103 264.031 176.045C263.697 175.954 263.403 175.843 263.15 175.714C262.899 175.584 262.693 175.442 262.533 175.287C262.373 175.133 262.252 174.962 262.169 174.774C262.089 174.587 262.049 174.382 262.049 174.162C262.049 173.908 262.103 173.678 262.21 173.471C262.318 173.264 262.467 173.087 262.657 172.941C262.848 172.795 263.072 172.683 263.332 172.606C263.591 172.526 263.872 172.486 264.176 172.486C264.49 172.486 264.777 172.531 265.037 172.622C265.299 172.713 265.524 172.84 265.711 173.003C265.899 173.169 266.045 173.364 266.15 173.591C266.255 173.817 266.307 174.065 266.307 174.336H265.173C265.168 174.2 265.143 174.076 265.099 173.963C265.057 173.85 264.995 173.752 264.912 173.669C264.827 173.589 264.721 173.527 264.594 173.483C264.47 173.436 264.323 173.413 264.155 173.413C264.001 173.413 263.863 173.432 263.741 173.471C263.623 173.507 263.522 173.558 263.439 173.624C263.357 173.693 263.293 173.774 263.249 173.868C263.208 173.959 263.187 174.058 263.187 174.166C263.187 174.279 263.214 174.381 263.27 174.472C263.328 174.563 263.41 174.645 263.518 174.716C263.626 174.791 263.755 174.858 263.907 174.919C264.061 174.98 264.235 175.036 264.428 175.089C264.635 175.147 264.832 175.217 265.02 175.3C265.208 175.383 265.38 175.478 265.537 175.585C265.775 175.762 265.964 175.967 266.104 176.202C266.245 176.436 266.315 176.707 266.315 177.013C266.315 177.278 266.262 177.514 266.154 177.721C266.049 177.925 265.903 178.097 265.715 178.238C265.528 178.381 265.304 178.49 265.045 178.565C264.786 178.637 264.503 178.672 264.197 178.672C263.896 178.672 263.598 178.628 263.303 178.54C263.01 178.449 262.755 178.316 262.537 178.143C262.33 177.972 262.166 177.77 262.045 177.539C261.926 177.307 261.867 177.035 261.867 176.723H263.009C263.014 176.905 263.046 177.061 263.104 177.191C263.162 177.321 263.243 177.427 263.348 177.51C263.45 177.592 263.573 177.653 263.717 177.692C263.863 177.73 264.023 177.75 264.197 177.75C264.351 177.75 264.488 177.732 264.606 177.696C264.728 177.66 264.83 177.61 264.912 177.547C264.995 177.483 265.059 177.407 265.103 177.319C265.147 177.228 265.169 177.129 265.169 177.021ZM271.686 175.954H269.211V177.654H272.104V178.594H268.044V172.569H272.091V173.516H269.211V175.035H271.686V175.954ZM278.343 173.516H276.485V178.594H275.318V173.516H273.485V172.569H278.343V173.516ZM289.974 176.707C289.955 177.01 289.889 177.283 289.776 177.526C289.665 177.769 289.516 177.976 289.329 178.147C289.141 178.318 288.918 178.45 288.658 178.544C288.399 178.635 288.112 178.681 287.797 178.681C287.549 178.681 287.319 178.649 287.106 178.585C286.897 178.519 286.708 178.425 286.539 178.304C286.385 178.191 286.247 178.054 286.126 177.894C286.007 177.734 285.906 177.558 285.824 177.365C285.744 177.172 285.681 176.959 285.637 176.727C285.596 176.496 285.575 176.25 285.575 175.991V175.18C285.575 174.937 285.595 174.707 285.633 174.489C285.672 174.268 285.73 174.064 285.807 173.876C285.895 173.647 286.011 173.443 286.155 173.264C286.298 173.084 286.461 172.933 286.643 172.809C286.806 172.704 286.984 172.624 287.177 172.569C287.373 172.511 287.582 172.482 287.806 172.482C288.137 172.482 288.431 172.529 288.687 172.622C288.946 172.716 289.167 172.85 289.349 173.024C289.531 173.198 289.675 173.41 289.78 173.661C289.884 173.912 289.951 174.195 289.978 174.509H288.82C288.809 174.33 288.781 174.173 288.737 174.038C288.695 173.902 288.635 173.789 288.555 173.698C288.472 173.61 288.369 173.544 288.244 173.5C288.123 173.453 287.977 173.429 287.806 173.429C287.715 173.429 287.629 173.439 287.549 173.458C287.472 173.478 287.4 173.507 287.334 173.545C287.221 173.611 287.124 173.707 287.044 173.831C286.967 173.952 286.905 174.094 286.858 174.257C286.822 174.384 286.796 174.525 286.779 174.679C286.763 174.831 286.755 174.995 286.755 175.171V175.991C286.755 176.231 286.767 176.446 286.792 176.636C286.819 176.824 286.861 176.988 286.916 177.129C286.955 177.225 287 177.311 287.053 177.385C287.108 177.46 287.17 177.522 287.239 177.572C287.313 177.627 287.396 177.668 287.487 177.696C287.581 177.721 287.684 177.733 287.797 177.733C287.949 177.733 288.086 177.714 288.207 177.675C288.329 177.636 288.432 177.576 288.518 177.493C288.603 177.41 288.671 177.304 288.72 177.174C288.77 177.045 288.8 176.889 288.811 176.707H289.974Z" fill="#8D93A5"/>+<g filter="url(#filter0_dd_18783_123855)">+<rect x="138.021" y="68.5" width="28.1388" height="28.1388" rx="7.26429" fill="white"/>+<rect x="138.021" y="68.5" width="28.1388" height="28.1388" rx="7.26429" stroke="#8D93A5" stroke-width="0.605357"/>+<path d="M143.825 76.2121C143.825 74.917 144.875 73.8672 146.17 73.8672H158.481C159.776 73.8672 160.826 74.917 160.826 76.2121V88.5228C160.826 89.8179 159.776 90.8677 158.481 90.8677H146.17C144.875 90.8677 143.825 89.8179 143.825 88.5228V76.2121Z" fill="#C6C9D2" fill-opacity="0.3" stroke="#5A6072" stroke-width="0.908036" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M149.688 78.0703L149.688 90.8742" stroke="#5A6072" stroke-width="0.908036" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M144.118 77.9688H160.532" stroke="#5A6072" stroke-width="0.908036" stroke-linecap="round" stroke-linejoin="round"/>+</g>+<defs>+<filter id="filter0_dd_18783_123855" x="125.612" y="68.1973" width="52.9584" height="52.9584" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">+<feFlood flood-opacity="0" result="BackgroundImageFix"/>+<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>+<feMorphology radius="2.42143" operator="erode" in="SourceAlpha" result="effect1_dropShadow_18783_123855"/>+<feOffset dy="4.84286"/>+<feGaussianBlur stdDeviation="2.42143"/>+<feColorMatrix type="matrix" values="0 0 0 0 0.0627451 0 0 0 0 0.0941176 0 0 0 0 0.156863 0 0 0 0.03 0"/>+<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_18783_123855"/>+<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>+<feMorphology radius="2.42143" operator="erode" in="SourceAlpha" result="effect2_dropShadow_18783_123855"/>+<feOffset dy="12.1071"/>+<feGaussianBlur stdDeviation="7.26429"/>+<feColorMatrix type="matrix" values="0 0 0 0 0.0627451 0 0 0 0 0.0941176 0 0 0 0 0.156863 0 0 0 0.08 0"/>+<feBlend mode="normal" in2="effect1_dropShadow_18783_123855" result="effect2_dropShadow_18783_123855"/>+<feBlend mode="normal" in="SourceGraphic" in2="effect2_dropShadow_18783_123855" result="shape"/>+</filter>+<clipPath id="clip0_18783_123855">+<rect width="7.91405" height="7.91405" fill="white" transform="translate(262.876 20.3984) rotate(-90)"/>+</clipPath>+<clipPath id="clip1_18783_123855">+<rect width="7.91405" height="7.91405" fill="white" transform="translate(270.79 88.9922) rotate(180)"/>+</clipPath>+<clipPath id="clip2_18783_123855">+<rect width="7.91405" height="7.91405" fill="white" transform="translate(270.791 149.656) rotate(90)"/>+</clipPath>+</defs>+</svg>+</svg>diff --git a/resources/frontend_client/app/assets/img/upsell-tenants.png b/resources/frontend_client/app/assets/img/upsell-tenants.pngdeleted file mode 100644index e5599aa4585..00000000000Binary files a/resources/frontend_client/app/assets/img/upsell-tenants.png and /dev/null differdiff --git a/resources/migrations/064/20260811_embedding_theme_is_default.yaml b/resources/migrations/064/20260811_embedding_theme_is_default.yamlnew file mode 100644index 00000000000..c51ef4eaba9--- /dev/null+++ b/resources/migrations/064/20260811_embedding_theme_is_default.yaml@@ -0,0 +1,16 @@+databaseChangeLog:+ - changeSet:+ id: v64.2026-08-11T09:00:00+ author: kelvin+ comment: Add embedding_theme.is_default to distinguish seeded themes from user-created ones+ changes:+ - addColumn:+ tableName: embedding_theme+ columns:+ - column:+ name: is_default+ type: ${boolean.type}+ defaultValueBoolean: false+ remarks: True for the Light/Dark themes Metabase seeds on first visit to the themes page. Nothing else can tell them apart - names are stored translated, and seeding is lazy so ids are not ordered. Existing rows are deliberately left false, so instances that already have themes count them as user-created.+ constraints:+ nullable: falsediff --git a/resources/user_key_value_types/embedding_hub.edn b/resources/user_key_value_types/embedding_hub.ednnew file mode 100644index 00000000000..349f7ef36a3--- /dev/null+++ b/resources/user_key_value_types/embedding_hub.edn@@ -0,0 +1,2 @@+[:map+ [:value :boolean]]diff --git a/src/metabase/analytics/stats.clj b/src/metabase/analytics/stats.cljindex bccc1de436f..30ed326851e 100644--- a/src/metabase/analytics/stats.clj+++ b/src/metabase/analytics/stats.clj@@ -131,10 +131,13 @@:instance_started (analytics.settings/instance-creation):has_sample_data (analytics.db/sample-database-exists?):enable_embedding (setting/get :enable-embedding)- :enable_embedding_sdk (setting/get :enable-embedding-sdk)- :enable_embedding_simple (setting/get :enable-embedding-simple)+ ;; Modular embedding, the SDK and guest embeds are one setting since 0.65.0. The three field names are kept so+ ;; existing reports keep resolving; they now all report that one flag.+ :enable_embedding_sdk (setting/get :enable-embedding-modular)+ :enable_embedding_simple (setting/get :enable-embedding-modular):enable_embedding_interactive (setting/get :enable-embedding-interactive)- :enable_embedding_static (setting/get :enable-embedding-static)+ :enable_embedding_static (setting/get :enable-embedding-modular)+ :enable_embedding_modular (setting/get :enable-embedding-modular):embedding_app_origin_set (boolean(setting/get :embedding-app-origin));; We no longer add "localhost:*" as a default origin as of Metabase 56, as it is always allowed,@@ -711,7 +714,7 @@{:name :static-embedding:available true:enabled (and- (setting/get :enable-embedding-static)+ (setting/get :enable-embedding-modular)(or(analytics.db/embedded-dashboard-exists?)(analytics.db/embedded-card-exists?)))}@@ -791,7 +794,7 @@:enabled (premium-features/enable-remote-sync?)}{:name :sdk-embedding:available true- :enabled (setting/get :enable-embedding-sdk)}+ :enabled (setting/get :enable-embedding-modular)}{:name :tenants:enabled (setting/get :use-tenants):available (premium-features/enable-tenants?)}diff --git a/src/metabase/api_routes/routes.clj b/src/metabase/api_routes/routes.cljindex c5e0aa1ab8c..637a9c67e82 100644--- a/src/metabase/api_routes/routes.clj+++ b/src/metabase/api_routes/routes.clj@@ -27,6 +27,7 @@[metabase.data-studio.api][metabase.documents.api][metabase.eid-translation.api]+ [metabase.embedding-hub.api][metabase.embedding-rest.api][metabase.frontend-errors.api][metabase.geojson.api]@@ -203,6 +204,7 @@"/embed" (+message-only-exceptions metabase.embedding-rest.api/embedding-routes)"/embed-mcp" (+auth metabase.mcp.callback-api/routes)"/embed-theme" (+auth metabase.embedding-rest.api/theme-routes)+ "/embedding-hub" metabase.embedding-hub.api/routes"/eval-trace" (metabase.ai-tracing.api/+eval-capture-enabled metabase.ai-tracing.api/routes);; Explorations are intentionally disabled on the v64 release branch. do not uncomment this;; "/exploration" (+auth metabase.explorations.api/routes)diff --git a/src/metabase/dashboards_rest/api.clj b/src/metabase/dashboards_rest/api.cljindex 582c8f68f07..758faeafb59 100644--- a/src/metabase/dashboards_rest/api.clj+++ b/src/metabase/dashboards_rest/api.clj@@ -648,7 +648,8 @@endpoints and a signed JWT."[](perms/check-has-application-permission :setting)- (embedding.validation/check-embedding-enabled)+ ;; Not gated on `enable-embedding-static`: an admin who turned guest embeds off still needs to see what is already+ ;; published. Publishing itself stays gated.(dashboards-rest.db/embeddable-dashboards));;; --------------------------------------------- Fetching/Updating/Etc. ---------------------------------------------diff --git a/src/metabase/embedding/models/theme.clj b/src/metabase/embedding/models/theme.cljindex 0ff5aecda12..ea753dc1eb7 100644--- a/src/metabase/embedding/models/theme.clj+++ b/src/metabase/embedding/models/theme.clj@@ -25,7 +25,8 @@(defmethod serdes/make-spec "EmbeddingTheme"[_model-name _opts]{:copy [:entity_id :name :settings]- :skip []+ ;; is_default means the theme is a default theme for this instance.+ :skip [:is_default]:transform {:created_at (serdes/date):updated_at (serdes/date)}})diff --git a/src/metabase/embedding/schema.clj b/src/metabase/embedding/schema.cljindex 48c94f796fb..4d167f4c4fa 100644--- a/src/metabase/embedding/schema.clj+++ b/src/metabase/embedding/schema.clj@@ -15,6 +15,7 @@[:entity_id :string][:name :string][:settings ::embedding-theme.settings]+ [:is_default :boolean][:created_at ms/TemporalInstant][:updated_at ms/TemporalInstant]])@@ -24,5 +25,6 @@[:entity_id {:optional true} [:maybe :string]][:name {:optional true} [:maybe :string]][:settings {:optional true} [:maybe ::embedding-theme.settings]]+ [:is_default {:optional true} [:maybe :boolean]][:created_at {:optional true} [:maybe ms/TemporalInstant]][:updated_at {:optional true} [:maybe ms/TemporalInstant]]])diff --git a/src/metabase/embedding/settings.clj b/src/metabase/embedding/settings.cljindex 0f6751c08ad..dca5bf71296 100644--- a/src/metabase/embedding/settings.clj+++ b/src/metabase/embedding/settings.clj@@ -9,6 +9,7 @@[metabase.settings.core :as setting :refer [defsetting]][metabase.util :as u][metabase.util.i18n :as i18n :refer [deferred-tru]]+ [metabase.util.json :as json][metabase.util.log :as log][metabase.util.malli :as mu][metabase.util.random :as u.random]))@@ -34,21 +35,63 @@false(setting/get-value-of-type :boolean :show-static-embed-terms))))-(defsetting show-sdk-embed-terms+(defsetting ^:deprecated show-sdk-embed-terms(deferred-tru "Check if admin should see the SDK licensing terms popup"):type :boolean:default true:can-read-from-env? false:doc false- :export? true)+ :export? true+ :deprecated "0.65.0")-(defsetting show-simple-embed-terms+(defsetting ^:deprecated show-simple-embed-terms(deferred-tru "Check if admin should see the simple embedding terms popup"):type :boolean:default true:can-read-from-env? false:doc false- :export? true)+ :export? true+ :deprecated "0.65.0")++(defn- any-legacy-embedding-terms-unaccepted?+ "Whether either of the terms settings [[show-modular-embed-terms]] replaces is still unaccepted. `true` on these+ settings means the popup is still owed, so an admin who accepted only one of the two has not seen everything the+ merged terms cover."+ []+ (boolean+ (some #(setting/get-value-of-type :boolean %)+ [:show-simple-embed-terms :show-sdk-embed-terms])))++(defn- show-modular-embed-terms?+ "The effective value of [[show-modular-embed-terms]].++ Until an admin accepts it, it stands for the two settings it replaces: either one still unaccepted means the popup+ is still owed. Reading the *source* rather than the value is what separates \"nobody answered this\" from \"an admin+ accepted it\" -- without that, accepting would bounce back from a legacy value."+ []+ (if (= :default (setting/get-raw-value-source :show-modular-embed-terms))+ (any-legacy-embedding-terms-unaccepted?)+ (setting/get-value-of-type :boolean :show-modular-embed-terms)))++(defsetting show-modular-embed-terms+ (deferred-tru "Check if admin should see the modular embedding and SDK licensing terms popup")+ :type :boolean+ :default true+ :can-read-from-env? false+ :doc false+ :export? true+ :getter show-modular-embed-terms?)++(defn- embedding-app-origin-set?+ "Whether any authorized-origin setting names a real origin."+ []+ (boolean+ (or (setting/get-value-of-type :string :embedding-app-origin)+ (setting/get-value-of-type :string :embedding-app-origins-interactive)+ (let [sdk-origins (setting/get-value-of-type :string :embedding-app-origins-sdk)]+ ;; Don't track "localhost:*" as a meaningful origin since it was+ ;; the old default and may still exist in migrated instances+ (and sdk-origins (not (str/blank? sdk-origins)) (not= "localhost:*" sdk-origins))))))(mu/defn- make-embedding-toggle-setter"Creates a boolean setter for various boolean embedding-enabled flavors, all tracked by snowplow."@@ -62,13 +105,7 @@(embedding-secret-key! (u.random/secure-hex 32)))(analytics/track-event! :snowplow/embed_share{:event (keyword (str event-name (if new-value "-enabled" "-disabled")))- :embedding-app-origin-set (boolean- (or (setting/get-value-of-type :string :embedding-app-origin)- (setting/get-value-of-type :string :embedding-app-origins-interactive)- (let [sdk-origins (setting/get-value-of-type :string :embedding-app-origins-sdk)]- ;; Don't track "localhost:*" as a meaningful origin since it was- ;; the old default and may still exist in migrated instances- (and sdk-origins (not (str/blank? sdk-origins)) (not= "localhost:*" sdk-origins)))))+ :embedding-app-origin-set (embedding-app-origin-set?):number-embedded-questions (embedding.db/count-embedded-cards):number-embedded-dashboards (embedding.db/count-embedded-dashboards)}))))))@@ -95,24 +132,79 @@:audit :getter:encryption :no)-(defsetting enable-embedding-sdk+(defsetting ^:deprecated enable-embedding-sdk(deferred-tru "Allow admins to embed Metabase via the SDK?"):type :boolean:default false:visibility :authenticated:export? false:audit :getter+ :deprecated "0.65.0":setter (make-embedding-toggle-setter :enable-embedding-sdk "sdk-embedding"))-(defsetting enable-embedding-simple+(defsetting ^:deprecated enable-embedding-simple(deferred-tru "Allow admins to embed Metabase via modular embedding?"):type :boolean:default false:visibility :authenticated:export? false:audit :getter+ :deprecated "0.65.0":setter (make-embedding-toggle-setter :enable-embedding-simple "simple-embedding"))+(defn- any-legacy-embedding-method-enabled?+ "Whether any of the settings [[enable-embedding-modular]] replaces is on, read through the normal resolution order so+ that a value set by env var counts."+ []+ (boolean+ (some #(setting/get-value-of-type :boolean %)+ [:enable-embedding-simple :enable-embedding-sdk :enable-embedding-static])))++(defn- modular-embedding-enabled?+ "The effective value of [[enable-embedding-modular]].++ Until an admin sets it, it stands for whatever the three settings it replaces already say: any of them on means+ embedding is on, so an upgrade cannot switch a live embed off. Reading the *source* rather than the value is what+ separates \"nobody set this\" from \"an admin turned it off\" -- without that, turning it off would bounce back on+ from a legacy value."+ []+ (if (= :default (setting/get-raw-value-source :enable-embedding-modular))+ (any-legacy-embedding-method-enabled?)+ (setting/get-value-of-type :boolean :enable-embedding-modular)))++(defsetting enable-embedding-modular+ (deferred-tru "Allow admins to embed Metabase via modular embedding, the SDK for React, and guest embeds?")+ :type :boolean+ :default false+ :visibility :authenticated+ :export? false+ :audit :getter+ :getter modular-embedding-enabled?+ ;; A hand-rolled version of [[make-embedding-toggle-setter]]: it compares the stored value and guards the+ ;; write on it, but the merged flag has to compare the effective value and write unconditionally, so an unset+ ;; setting flips off its legacy fallback rather than reading through it.+ :setter (fn [new-value]+ (u/prog1 new-value+ ;; Compared against the effective value, not the stored one: an unset setting reads as its `false`+ ;; default, so guarding the write on the stored value would make "turn it off" a no-op and leave the+ ;; legacy fallback answering for it.+ (let [old-value (modular-embedding-enabled?)]+ (setting/set-value-of-type! :boolean :enable-embedding-modular new-value)+ (when (not= new-value old-value)+ (when (and new-value (str/blank? (embedding-secret-key)))+ (embedding-secret-key! (u.random/secure-hex 32)))+ ;; `simple_event` rather than the `embed_share` the legacy toggles use: that schema's `event`+ ;; is a closed enum, so `modular_embedding_*` would need a new version cut for a tracker being+ ;; retired for Metaplow. The context the enum-typed event carried moves into `event_detail`,+ ;; the way the SDK bundle already sends it.+ (analytics/track-event!+ :snowplow/simple_event+ {:event (keyword (str "modular-embedding" (if new-value "-enabled" "-disabled")))+ :event-detail (json/encode+ {:embedding_app_origin_set (embedding-app-origin-set?)+ :number_embedded_questions (embedding.db/count-embedded-cards)+ :number_embedded_dashboards (embedding.db/count-embedded-dashboards)})}))))))+(defsetting enable-embedding-interactive(deferred-tru "Allow admins to embed Metabase via interactive embedding?"):type :boolean@@ -131,13 +223,14 @@:encryption :when-encryption-key-set:audit :getter)-(defsetting enable-embedding-static+(defsetting ^:deprecated enable-embedding-static(deferred-tru "Allow admins to embed Metabase via static embedding?"):type :boolean:default false:visibility :authenticated:export? false:audit :getter+ :deprecated "0.65.0":setter (make-embedding-toggle-setter :enable-embedding-static "static-embedding"))(mu/defn- ignore-localhost :- :string@@ -267,10 +360,8 @@(or;; the deprecated umbrella setting must still count as embedding-enabled while instances have it set#_{:clj-kondo/ignore [:deprecated-var]} (enable-embedding)- (enable-embedding-static)- (enable-embedding-interactive)- (enable-embedding-sdk)- (enable-embedding-simple)))+ (enable-embedding-modular)+ (enable-embedding-interactive)));; settings for the embedding homepage(defsetting embedding-homepage@@ -294,8 +385,10 @@:export? true:visibility :admin)+;; The next three settings track the setup guide checklist, not the embedding hub section.+;; The names stay: renaming persisted keys would cost a migration for three booleans and change nothing users see.(defsetting embedding-hub-test-embed-snippet-created- (deferred-tru "Indicates if a test embed snippet has been created for tracking in the embedding hub")+ (deferred-tru "Indicates if a test embed snippet has been created for tracking in the setup guide"):type :boolean:default false:export? true@@ -304,7 +397,7 @@:doc false)(defsetting embedding-hub-production-embed-snippet-created- (deferred-tru "Indicates if a production embed snippet has been created for tracking in the embedding hub")+ (deferred-tru "Indicates if a production embed snippet has been created for tracking in the setup guide"):type :boolean:default false:export? truediff --git a/src/metabase/embedding/validation.clj b/src/metabase/embedding/validation.cljindex 56c9fad00d4..380767daef1 100644--- a/src/metabase/embedding/validation.clj+++ b/src/metabase/embedding/validation.clj@@ -7,5 +7,5 @@(defn check-embedding-enabled"Is embedding of Cards or Objects (secured access via `/api/embed` endpoints with a signed JWT enabled?"[]- (api/check (embed.settings/enable-embedding-static)+ (api/check (embed.settings/enable-embedding-modular)[400 (tru "Embedding is not enabled.")]))diff --git a/src/metabase/embedding_hub/api.clj b/src/metabase/embedding_hub/api.cljnew file mode 100644index 00000000000..d1a15cd40fa--- /dev/null+++ b/src/metabase/embedding_hub/api.clj@@ -0,0 +1,158 @@+(ns metabase.embedding-hub.api+ "Checklist state for the setup guide. Named for the embedding hub because that is the API path+ (`/api/embedding-hub/checklist`); the UI it serves is the setup guide."+ (:require+ [metabase.api.common :as api]+ [metabase.api.macros :as api.macros]+ [metabase.api.routes.common :refer [+auth]]+ [metabase.appearance.core :as appearance]+ [metabase.audit-app.core :as audit]+ [metabase.config.core :as config]+ [metabase.embedding-hub.db :as embedding-hub.db]+ [metabase.embedding.settings :as embedding.settings]+ [metabase.metabot.settings :as metabot.settings]+ [metabase.permissions.core :as perms]+ [metabase.premium-features.core :as premium-features :refer [defenterprise]]))++(defn- has-user-added-database? []+ ;; `boolean`, because the trailing `when-let` yields nil on an instance with no sample database,+ ;; and the response schema requires a boolean.+ (boolean+ (or (embedding-hub.db/user-added-database?)+ ;; check for CSV uploads to sample db+ ;; as the sample db is excluded from the above query+ (when-let [sample-db-id (embedding-hub.db/sample-database-id)]+ (embedding-hub.db/uploaded-table? sample-db-id)))))++(defn- has-user-created-dashboard? []+ (let [example-dashboard-id (appearance/example-dashboard-id)+ audit-collection-ids (filter some? [(when-let [audit-coll (audit/default-audit-collection)] (:id audit-coll))+ (when-let [custom-coll (audit/default-custom-reports-collection)] (:id custom-coll))])]+ (embedding-hub.db/user-created-dashboard? example-dashboard-id audit-collection-ids)))++(defn- has-configured-sandboxes? []+ (and (premium-features/has-feature? :sandboxes)+ (embedding-hub.db/sandbox?)))++(defenterprise has-configured-sso?+ "Whether JWT or SAML is licensed, enabled and configured. The JWT and SAML settings are enterprise-only, so a+ community build has nothing to configure and always reports false."+ metabase-enterprise.embedding-hub.api+ []+ false)++(defn- has-user-created-models? []+ (embedding-hub.db/user-created-model? (:id (audit/default-audit-collection))))++(defn- has-user-created-tenants? []+ ;; config/ee-available? guards the enterprise-only models below: resolving one requires a+ ;; namespace a community build does not ship+ (and config/ee-available?+ (embedding-hub.db/active-tenant?)))++(defn- has-shared-tenant-collections? []+ (embedding-hub.db/shared-tenant-collection?))++(defn- shared-collection-has-dashboards? []+ (when-let [shared-coll-id (embedding-hub.db/shared-tenant-collection-id)]+ (embedding-hub.db/dashboard-in-collection? shared-coll-id)))++(defn- has-configured-data-segregation-strategy? []+ ;; Any data segregation strategy: row and column level security (sandboxing), connection+ ;; impersonation, or database routing.+ (or (has-configured-sandboxes?)+ (and config/ee-available? (embedding-hub.db/connection-impersonation?))+ (and config/ee-available? (embedding-hub.db/database-router?))))++(defn- active-data-segregation-strategy []+ (cond+ (has-configured-sandboxes?) "row-column-level-security"+ (and config/ee-available? (embedding-hub.db/connection-impersonation?)) "connection-impersonation"+ (and config/ee-available? (embedding-hub.db/database-router?)) "database-routing"+ :else nil))++(defn- has-published-guest-embed? []+ ;; Check if at least one card or dashboard has embedding enabled (is published as a guest embed)+ (or (embedding-hub.db/embedding-enabled-card?)+ (embedding-hub.db/embedding-enabled-dashboard?)))++(defn- has-created-custom-theme? []+ ;; `is_default` marks the Light/Dark themes Metabase seeds; anything else is+ ;; the admin's own. Themes seeded before the flag existed are unmarked, so they read as custom --+ ;; accepted rather than backfilled, since nothing can identify them retroactively.+ (embedding-hub.db/custom-embedding-theme?))++(defn- has-configured-ai? []+ ;; Both halves: credentials for the chosen provider, and embedded Metabot+ ;; actually switched on. `embedded-metabot-enabled?` defaults to true, so on+ ;; its own it would report a fresh instance as done.+ (boolean+ (and (metabot.settings/llm-metabot-configured?)+ (metabot.settings/embedded-metabot-enabled?))))++(defn- setup-guide-checklist []+ (let [enable-tenants? (and (perms/use-tenants)+ (has-shared-tenant-collections?))+ create-tenants? (has-user-created-tenants?)+ setup-data-segregation-strategy? (has-configured-data-segregation-strategy?)]+ {"checklist"+ {;; for the main setup guide checklist+ "add-data" (has-user-added-database?)+ "create-dashboard" (has-user-created-dashboard?)+ "create-models" (has-user-created-models?)+ "configure-row-column-security" (has-configured-sandboxes?)+ "create-test-embed" (or (has-published-guest-embed?)+ (embedding.settings/embedding-hub-test-embed-snippet-created))+ "embed-production" (embedding.settings/embedding-hub-production-embed-snippet-created)+ "create-custom-theme" (has-created-custom-theme?)+ "configure-ai" (has-configured-ai?)+ "data-permissions-and-enable-tenants" (and enable-tenants?+ create-tenants?+ setup-data-segregation-strategy?)++ ;; for the "configure data permissions and enable tenants" sub-checklist page+ "enable-tenants" enable-tenants?+ "move-dashboard-to-shared" (boolean (shared-collection-has-dashboards?))+ "create-tenants" create-tenants?+ "setup-data-segregation-strategy" setup-data-segregation-strategy?++ ;; for the "configure SSO" sub-checklist page+ "sso-configured" (has-configured-sso?)+ "sso-auth-manual-tested" (embedding.settings/embedding-hub-sso-auth-manual-tested)}++ "data-isolation-strategy" (active-data-segregation-strategy)}))++(def ^:private SetupGuideChecklistResponse+ "Schema for the setup guide checklist response."+ [:map {:closed true}+ ["checklist"+ [:map {:closed true}+ ["add-data" :boolean]+ ["create-dashboard" :boolean]+ ["create-models" :boolean]+ ["configure-row-column-security" :boolean]+ ["create-test-embed" :boolean]+ ["embed-production" :boolean]+ ["create-custom-theme" :boolean]+ ["configure-ai" :boolean]+ ["sso-configured" :boolean]+ ["data-permissions-and-enable-tenants" :boolean]+ ["enable-tenants" :boolean]+ ["move-dashboard-to-shared" :boolean]+ ["create-tenants" :boolean]+ ["setup-data-segregation-strategy" :boolean]+ ["sso-auth-manual-tested" :boolean]]]+ ["data-isolation-strategy"+ [:maybe [:enum "row-column-level-security" "connection-impersonation" "database-routing"]]]])++(api.macros/defendpoint :get "/checklist" :- SetupGuideChecklistResponse+ "Get the setup guide checklist status, indicating which setup steps have been completed."+ []+ ;; The checklist reports instance setup state, so it is admin-only. Stated here because no premium+ ;; gate stands in front of the route -- the guide has to work unlicensed.+ (api/check-superuser)+ (setup-guide-checklist))++(def ^{:arglists '([request respond raise])} routes+ "`/api/embedding-hub` routes."+ (api.macros/ns-handler *ns* +auth))diff --git a/src/metabase/embedding_hub/db.clj b/src/metabase/embedding_hub/db.cljnew file mode 100644index 00000000000..eea089e8b9c--- /dev/null+++ b/src/metabase/embedding_hub/db.clj@@ -0,0 +1,109 @@+(ns metabase.embedding-hub.db+ "Application database queries for the embedding hub module. Every function here is a direct Toucan 2 call with no+ additional logic, so the rest of the module never talks to `toucan2.core` itself."+ (:require+ [toucan2.core :as t2]))++(defn user-added-database?+ "Whether a database other than the sample and audit ones exists."+ []+ (t2/exists? :model/Database {:where [:and+ [:= :is_sample false]+ [:= :is_audit false]]}))++(defn sample-database-id+ "The id of the sample database, or nil."+ []+ (t2/select-one-pk :model/Database :is_sample true))++(defn uploaded-table?+ "Whether the database with `database-id` has an active uploaded table."+ [database-id]+ (t2/exists? :model/Table {:where [:and+ [:= :active true]+ [:= :is_upload true]+ [:= :db_id database-id]]}))++(defn user-created-dashboard?+ "Whether an unarchived dashboard exists outside `example-dashboard-id` and `audit-collection-ids`."+ [example-dashboard-id audit-collection-ids]+ (t2/exists? :model/Dashboard {:where (cond-> [:and+ [:= :archived false]]+ example-dashboard-id (conj [:not= :id example-dashboard-id])+ (seq audit-collection-ids) (conj [:or+ [:is :collection_id nil]+ [:not-in :collection_id audit-collection-ids]]))}))++(defn user-created-model?+ "Whether an unarchived model exists outside the audit collection with `audit-collection-id` and the sample+ collections."+ [audit-collection-id]+ (t2/exists? :model/Card {:where [:and+ [:= :type "model"]+ [:= :archived false]+ [:or+ [:and+ [:!= :collection_id audit-collection-id]+ [:not [:exists ^:allow-subquery+ {:select [1]+ :from [[(t2/table-name :model/Collection) :sample_coll]]+ :where [:and+ [:= :sample_coll.is_sample true]+ [:= :sample_coll.id :report_card.collection_id]]}]]]+ [:is :collection_id nil]]]}))++(defn sandbox?+ "Whether a Sandbox exists."+ []+ (t2/exists? :model/Sandbox))++(defn active-tenant?+ "Whether an active Tenant exists."+ []+ (t2/exists? :model/Tenant :is_active true))++(defn shared-tenant-collection?+ "Whether an unarchived shared tenant collection exists."+ []+ (t2/exists? :model/Collection {:where [:and+ [:= :namespace "shared-tenant-collection"]+ [:= :archived false]]}))++(defn shared-tenant-collection-id+ "The id of an unarchived shared tenant collection, or nil."+ []+ (t2/select-one-pk :model/Collection {:where [:and+ [:= :namespace "shared-tenant-collection"]+ [:= :archived false]]}))++(defn dashboard-in-collection?+ "Whether an unarchived dashboard lives in the collection with `collection-id`."+ [collection-id]+ (t2/exists? :model/Dashboard {:where [:and+ [:= :collection_id collection-id]+ [:= :archived false]]}))++(defn connection-impersonation?+ "Whether a ConnectionImpersonation exists."+ []+ (t2/exists? :model/ConnectionImpersonation))++(defn database-router?+ "Whether a DatabaseRouter exists."+ []+ (t2/exists? :model/DatabaseRouter))++(defn embedding-enabled-card?+ "Whether a Card is published as a guest embed."+ []+ (t2/exists? :model/Card :enable_embedding true))++(defn embedding-enabled-dashboard?+ "Whether a Dashboard is published as a guest embed."+ []+ (t2/exists? :model/Dashboard :enable_embedding true))++(defn custom-embedding-theme?+ "Whether an EmbeddingTheme that Metabase did not seed exists."+ []+ (t2/exists? :model/EmbeddingTheme :is_default false))diff --git a/src/metabase/embedding_rest/api/theme.clj b/src/metabase/embedding_rest/api/theme.cljindex e6778279e3c..38e1aa8e66a 100644--- a/src/metabase/embedding_rest/api/theme.clj+++ b/src/metabase/embedding_rest/api/theme.clj@@ -20,6 +20,7 @@[:entity_id ms/NonBlankString][:name ms/NonBlankString][:settings ms/OpaqueJSONObject]+ [:is_default :boolean][:created_at (ms/InstanceOfClass java.time.temporal.Temporal)][:updated_at (ms/InstanceOfClass java.time.temporal.Temporal)]])@@ -90,6 +91,9 @@(locking seed-defaults-lock(t2/with-transaction [_conn](when-not (embedding.settings/default-embedding-themes-seeded)- (embedding-rest.db/insert-embedding-themes! themes)+ ;; Marked here because nothing else can identify them afterwards: the+ ;; names are stored already translated, and seeding is lazy so the ids+ ;; are not ordered.+ (embedding-rest.db/insert-embedding-themes! (map #(assoc % :is_default true) themes))(embedding.settings/default-embedding-themes-seeded! true))))nil)diff --git a/src/metabase/embedding_rest/db.clj b/src/metabase/embedding_rest/db.cljindex 968c5313791..67931be6ee0 100644--- a/src/metabase/embedding_rest/db.clj+++ b/src/metabase/embedding_rest/db.clj@@ -45,10 +45,10 @@(t2/select-one :model/DashboardCard dashcard-id))(mu/defn embedding-themes- "The id, entity id, name, settings, and timestamps of every EmbeddingTheme, oldest first."+ "The id, entity id, name, settings, default flag, and timestamps of every EmbeddingTheme, oldest first."[](t2/select :model/EmbeddingTheme {:order-by [[:created_at :asc]]- :select [:id :entity_id :name :settings :created_at :updated_at]}))+ :select [:id :entity_id :name :settings :is_default :created_at :updated_at]}))(mu/defn embedding-theme-exists?"Whether an EmbeddingTheme with `id` exists."@@ -66,8 +66,9 @@(t2/insert-returning-instance! :model/EmbeddingTheme row))(mu/defn insert-embedding-themes!- "Insert the EmbeddingTheme `rows`."- [rows :- [:sequential (mut/select-keys ::embedding.schema/embedding-theme.update [:name :settings])]]+ "Insert the EmbeddingTheme `rows`. Only seeding - the Light/Dark themes written on the first visit+ to the embedding hub - sets `is_default`, so the single-row insert above leaves it out."+ [rows :- [:sequential (mut/select-keys ::embedding.schema/embedding-theme.update [:name :settings :is_default])]](t2/insert! :model/EmbeddingTheme rows))(mu/defn update-embedding-theme!diff --git a/src/metabase/queries_rest/api/card.clj b/src/metabase/queries_rest/api/card.cljindex 6d7fdbb5240..6cffc390257 100644--- a/src/metabase/queries_rest/api/card.clj+++ b/src/metabase/queries_rest/api/card.clj@@ -6,7 +6,6 @@[metabase.collections.models.collection :as collection][metabase.collections.models.collection.root :as collection.root][metabase.eid-translation.core :as eid-translation]- [metabase.embedding.validation :as embedding.validation][metabase.events.core :as events][metabase.lib-be.core :as lib-be][metabase.lib-be.schema :as lib-be.schema]@@ -135,7 +134,8 @@and a signed JWT."[](perms/check-has-application-permission :setting)- (embedding.validation/check-embedding-enabled)+ ;; Not gated on `enable-embedding-static`: an admin who turned guest embeds off still needs to see what is already+ ;; published. Publishing itself stays gated.(queries-rest.db/embeddable-cards));;; -------------------------------------------- Fetching a Card or Cards --------------------------------------------diff --git a/test/metabase/dashboards_rest/api_test.clj b/test/metabase/dashboards_rest/api_test.cljindex bf15d65143e..7edf23b2485 100644--- a/test/metabase/dashboards_rest/api_test.clj+++ b/test/metabase/dashboards_rest/api_test.clj@@ -2744,7 +2744,13 @@(deftest fetch-embeddable-dashboards-test(testing "GET /api/dashboard/embeddable"(testing "Test that we can fetch a list of embeddable-accessible dashboards"- (mt/with-temporary-setting-values [enable-embedding-static true]+ (mt/with-temporary-setting-values [enable-embedding-modular true]+ (mt/with-temp [:model/Dashboard _ {:enable_embedding true}]+ (is (= [{:name true, :id true}]+ (for [dash (mt/user-http-request :crowberto :get 200 "dashboard/embeddable")]+ (m/map-vals boolean (select-keys dash [:name :id]))))))))+ (testing "and that we can still see them once guest embeds are turned off"+ (mt/with-temporary-setting-values [enable-embedding-modular false](mt/with-temp [:model/Dashboard _ {:enable_embedding true}](is (= [{:name true, :id true}](for [dash (mt/user-http-request :crowberto :get 200 "dashboard/embeddable")]@@ -5571,7 +5577,7 @@(deftest update-dashboard-embedding-type-to-nil-test(testing "PUT /api/dashboard/:id"(testing "Admin should be able to set embedding_type to nil to clear it"- (mt/with-temporary-setting-values [enable-embedding-static true]+ (mt/with-temporary-setting-values [enable-embedding-modular true](mt/with-temp [:model/Dashboard dashboard {:enable_embedding true:embedding_type "static-legacy"}](with-dashboards-in-writeable-collection! [dashboard]@@ -6278,7 +6284,7 @@(deftest update-embedding-type-to-guest-embed-and-static-legacy-test(testing "PUT /api/dashboard/:id sets/echoes/persists embedding_type for guest-embed and static-legacy"- (mt/with-temporary-setting-values [enable-embedding-static true]+ (mt/with-temporary-setting-values [enable-embedding-modular true](mt/with-temp [:model/Dashboard dashboard {}](doseq [embedding-type ["guest-embed" "static-legacy"]](let [resp (mt/user-http-request :crowberto :put 200 (str "dashboard/" (u/the-id dashboard))diff --git a/test/metabase/embedding/settings_test.clj b/test/metabase/embedding/settings_test.cljindex 3975e636d9d..ae906383a49 100644--- a/test/metabase/embedding/settings_test.clj+++ b/test/metabase/embedding/settings_test.clj@@ -4,7 +4,9 @@[clojure.test :refer :all][metabase.analytics.snowplow-test :as snowplow-test][metabase.embedding.settings :as embed.settings]+ [metabase.settings.core :as setting][metabase.test :as mt]+ [metabase.util.json :as json][toucan2.core :as t2]))(deftest show-static-embed-terms-test@@ -55,6 +57,31 @@:user-id (str (mt/user->id :crowberto))}](filter embedding-event? (snowplow-test/pop-event-data-and-user-id!))))))))))))+(deftest enable-embedding-modular-test+ (testing "Toggling modular embedding sends a simple_event whose event_detail decodes to the context map"+ (mt/with-test-user :crowberto+ (mt/with-premium-features #{:embedding}+ (mt/with-temporary-setting-values [embedding-app-origins-interactive "https://example.com"+ enable-embedding-modular false]+ (let [expected-detail {"embedding_app_origin_set" true+ "number_embedded_questions" (t2/count :model/Card :enable_embedding true)+ "number_embedded_dashboards" (t2/count :model/Dashboard :enable_embedding true)}+ ;; `event_detail` arrives as a JSON string, unlike the typed columns `embed_share` used, so decode+ ;; it before comparing -- that round trip is the thing worth asserting.+ pop-events! #(for [event (filter embedding-event? (snowplow-test/pop-event-data-and-user-id!))]+ (update event :data update "event_detail" json/decode))]+ (snowplow-test/with-fake-snowplow-collector+ (embed.settings/enable-embedding-modular! true)+ (is (= [{:data {"event" "modular_embedding_enabled"+ "event_detail" expected-detail}+ :user-id (str (mt/user->id :crowberto))}]+ (pop-events!)))+ (mt/with-temporary-setting-values [enable-embedding-modular false]+ (is (= [{:data {"event" "modular_embedding_disabled"+ "event_detail" expected-detail}+ :user-id (str (mt/user->id :crowberto))}]+ (pop-events!)))))))))))+(deftest enabling-embedding-generates-secret-key-test(testing "Enabling embedding auto-generates embedding-secret-key when blank, and preserves an existing key"(mt/with-test-user :crowberto@@ -62,7 +89,8 @@(snowplow-test/with-fake-snowplow-collector(mt/with-temporary-setting-values [enable-embedding-simple false enable-embedding-static false embedding-secret-key nil](embed.settings/enable-embedding-simple! true)- (is (true? (embed.settings/enable-embedding-simple)))+ ;; asserts the deprecated setting the setter under test writes+ (is (true? #_{:clj-kondo/ignore [:deprecated-var]} (embed.settings/enable-embedding-simple)))(is (not (str/blank? (embed.settings/embedding-secret-key))))(let [generated-key (embed.settings/embedding-secret-key)](embed.settings/enable-embedding-static! true)@@ -90,7 +118,8 @@(let [origin-value (str "localhost:* " other-ip " "(str/join " " (map #(str "localhost:" %) (range 1000 2000))))](embed.settings/embedding-app-origins-sdk! origin-value)- (is (not (and (embed.settings/enable-embedding-sdk)+ ;; reads the deprecated sdk setting on purpose; that is what this test asserts+ (is (not (and #_{:clj-kondo/ignore [:deprecated-var]} (embed.settings/enable-embedding-sdk)(embed.settings/embedding-app-origins-sdk))))))))(defn- depricated-setting-throws [f env & [reason]]@@ -140,25 +169,33 @@;; reads the deprecated enable-embedding setting on purpose; the sync under test bridges from it(let [unsyncd-settings {:enable-embedding #_{:clj-kondo/ignore [:deprecated-var]} (embed.settings/enable-embedding):enable-embedding-interactive (embed.settings/enable-embedding-interactive)- :enable-embedding-sdk (embed.settings/enable-embedding-sdk)- :enable-embedding-static (embed.settings/enable-embedding-static)}]+ ;; reads the deprecated sdk setting on purpose; the sync under test bridges from it+ :enable-embedding-sdk #_{:clj-kondo/ignore [:deprecated-var]} (embed.settings/enable-embedding-sdk)+ ;; reads the deprecated static setting on purpose; the sync under test bridges from it+ :enable-embedding-static #_{:clj-kondo/ignore [:deprecated-var]} (embed.settings/enable-embedding-static)}];; called for side effects:(#'embed.settings/sync-enable-settings! env)(cond(= expected-behavior :no-op)(do (is (= [:no-op (:enable-embedding-interactive unsyncd-settings)] [:no-op (embed.settings/enable-embedding-interactive)]))- (is (= [:no-op (:enable-embedding-sdk unsyncd-settings)] [:no-op (embed.settings/enable-embedding-sdk)]))- (is (= [:no-op (:enable-embedding-static unsyncd-settings)] [:no-op (embed.settings/enable-embedding-static)])))+ ;; compares against the deprecated sdk setting the sync bridges from+ (is (= [:no-op (:enable-embedding-sdk unsyncd-settings)] [:no-op #_{:clj-kondo/ignore [:deprecated-var]} (embed.settings/enable-embedding-sdk)]))+ ;; compares against the deprecated static setting the sync bridges from+ (is (= [:no-op (:enable-embedding-static unsyncd-settings)] [:no-op #_{:clj-kondo/ignore [:deprecated-var]} (embed.settings/enable-embedding-static)])))(= expected-behavior :sets-all-true)(do (is (= [expected-behavior true] [:sets-all-true (embed.settings/enable-embedding-interactive)]))- (is (= [expected-behavior true] [:sets-all-true (embed.settings/enable-embedding-sdk)]))- (is (= [expected-behavior true] [:sets-all-true (embed.settings/enable-embedding-static)])))+ ;; compares against the deprecated sdk setting the sync bridges from+ (is (= [expected-behavior true] [:sets-all-true #_{:clj-kondo/ignore [:deprecated-var]} (embed.settings/enable-embedding-sdk)]))+ ;; compares against the deprecated static setting the sync bridges from+ (is (= [expected-behavior true] [:sets-all-true #_{:clj-kondo/ignore [:deprecated-var]} (embed.settings/enable-embedding-static)])))(= expected-behavior :sets-all-false)(do (is (= [expected-behavior false] [:sets-all-false (embed.settings/enable-embedding-interactive)]))- (is (= [expected-behavior false] [:sets-all-false (embed.settings/enable-embedding-sdk)]))- (is (= [expected-behavior false] [:sets-all-false (embed.settings/enable-embedding-static)])))+ ;; compares against the deprecated sdk setting the sync bridges from+ (is (= [expected-behavior false] [:sets-all-false #_{:clj-kondo/ignore [:deprecated-var]} (embed.settings/enable-embedding-sdk)]))+ ;; compares against the deprecated static setting the sync bridges from+ (is (= [expected-behavior false] [:sets-all-false #_{:clj-kondo/ignore [:deprecated-var]} (embed.settings/enable-embedding-static)]))):else (throw (ex-info "Invalid expected-behavior in test-enabled-sync." {:expected-behavior expected-behavior})))))@@ -275,3 +312,53 @@(mt/with-temp-env-var-value! [mb-embedding-app-origins-interactive "ssh://metabase.com"](is (= "ssh://metabase.com"(embed.settings/embedding-app-origins-interactive)))))))))++(deftest enable-embedding-modular-falls-back-to-the-settings-it-replaces-test+ (testing "With nothing set, the merged setting stands for the three it replaces"+ (doseq [legacy-setting [:enable-embedding-simple :enable-embedding-sdk :enable-embedding-static]]+ (testing (str "on when only " legacy-setting " is on")+ (mt/with-temporary-setting-values [enable-embedding-simple false+ enable-embedding-sdk false+ enable-embedding-static false]+ (mt/with-temporary-setting-values [enable-embedding-modular nil]+ (setting/set-value-of-type! :boolean legacy-setting true)+ (is (true? (embed.settings/enable-embedding-modular))))))))+ (testing "off when all three are off"+ (mt/with-temporary-setting-values [enable-embedding-simple false+ enable-embedding-sdk false+ enable-embedding-static false+ enable-embedding-modular nil]+ (is (false? (embed.settings/enable-embedding-modular)))))+ (testing "an explicit value wins over the legacy fallback, so turning it off stays off"+ (mt/with-temporary-setting-values [enable-embedding-simple true+ enable-embedding-sdk true+ enable-embedding-static true+ enable-embedding-modular false]+ (is (false? (embed.settings/enable-embedding-modular)))))+ (testing "a legacy setting given by env var counts towards the fallback"+ (mt/with-temporary-setting-values [enable-embedding-simple false+ enable-embedding-sdk false+ enable-embedding-static false+ enable-embedding-modular nil]+ (mt/with-temp-env-var-value! [mb-enable-embedding-static "true"]+ (is (true? (embed.settings/enable-embedding-modular)))))))++(deftest show-modular-embed-terms-falls-back-to-the-settings-it-replaces-test+ (testing "With nothing set, the merged setting stands for the two it replaces"+ (doseq [legacy-setting [:show-simple-embed-terms :show-sdk-embed-terms]]+ (testing (str "shows the legalese when only " legacy-setting " is unaccepted (true)")+ (mt/with-temporary-setting-values [show-simple-embed-terms false+ show-sdk-embed-terms false+ show-modular-embed-terms nil]+ (setting/set-value-of-type! :boolean legacy-setting true)+ (is (true? (embed.settings/show-modular-embed-terms)))))))+ (testing "does not show the legalese when both have been accepted (false)"+ (mt/with-temporary-setting-values [show-simple-embed-terms false+ show-sdk-embed-terms false+ show-modular-embed-terms nil]+ (is (false? (embed.settings/show-modular-embed-terms)))))+ (testing "an explicit value wins over the legacy fallback, so accepting (false) keeps the legalese hidden"+ (mt/with-temporary-setting-values [show-simple-embed-terms true+ show-sdk-embed-terms true+ show-modular-embed-terms false]+ (is (false? (embed.settings/show-modular-embed-terms))))))diff --git a/test/metabase/embedding_hub/api_test.clj b/test/metabase/embedding_hub/api_test.cljnew file mode 100644index 00000000000..75e4f8a4632--- /dev/null+++ b/test/metabase/embedding_hub/api_test.clj@@ -0,0 +1,112 @@+(ns metabase.embedding-hub.api-test+ (:require+ [clojure.test :refer :all]+ [metabase.config.core :as config]+ [metabase.test :as mt]))++(def ^:private edition-features+ ;; A community build can never carry a token, and faking one here would make the checklist+ ;; query the enterprise models that build does not ship.+ (if config/ee-available? #{:embedding} #{}))++(deftest has-user-created-models-test+ (testing "has-user-created-models? correctly handles multiple sample collections (metabase#64627)"+ (mt/with-premium-features edition-features+ (mt/with-temp [:model/Collection sample-collection-1 {:name "Sample Collection 1" :is_sample true}+ :model/Collection sample-collection-2 {:name "Sample Collection 2" :is_sample true}+ :model/Card user-model {:name "User Model"+ :type "model"+ :archived false+ :collection_id nil+ :dataset_query {:database (mt/id)+ :type :query+ :query {:source-table (mt/id :venues)}}}+ :model/Card _sample-model-1 {:name "Sample Model 1"+ :type "model"+ :archived false+ :collection_id (:id sample-collection-1)+ :dataset_query {:database (mt/id)+ :type :query+ :query {:source-table (mt/id :venues)}}}+ :model/Card _sample-model-2 {:name "Sample Model 2"+ :type "model"+ :archived false+ :collection_id (:id sample-collection-2)+ :dataset_query {:database (mt/id)+ :type :query+ :query {:source-table (mt/id :venues)}}}]+ (testing "returns true when there is a model not in any sample collection"+ (let [response (mt/user-http-request :crowberto :get 200 "/embedding-hub/checklist")]+ (is (true? (get-in response [:checklist :create-models]))+ "Should detect the user model with nil collection_id")))+ (testing "returns false when all models are in sample collections"+ ;; Temporarily archive the user model so only sample collection models remain active+ (mt/with-temp-vals-in-db :model/Card (:id user-model) {:archived true}+ (let [response (mt/user-http-request :crowberto :get 200 "/embedding-hub/checklist")]+ (is (false? (get-in response [:checklist :create-models]))+ "Should exclude models in both sample collections"))))))))++(deftest checklist-access-test+ (mt/id) ;; force the app-db's own database row to exist so add-data resolves deterministically+ (testing "served without a licence -- unlicensed admins see the guide, and its upsell is aimed at them"+ (mt/with-premium-features #{}+ (mt/with-temp [:model/Card _ {:enable_embedding true}]+ (let [response (mt/user-http-request :crowberto :get 200 "/embedding-hub/checklist")]+ (testing "completion is real rather than all-false"+ (is (true? (get-in response [:checklist :create-test-embed]))))+ (testing "steps reading a paid feature report false rather than erroring"+ (is (false? (get-in response [:checklist :configure-row-column-security])))+ (is (false? (get-in response [:checklist :sso-configured]))))))))+ (testing "non-admins are rejected -- the response reports instance setup state"+ (doseq [features [#{} #{:embedding}]]+ (mt/with-premium-features features+ (mt/user-http-request :rasta :get 403 "/embedding-hub/checklist")))))++(deftest community-build-checklist-test+ (when-not config/ee-available?+ (mt/id) ;; force the app-db's own database row to exist so add-data resolves deterministically+ (testing "a community build answers rather than failing on models it does not ship"+ (let [response (mt/user-http-request :crowberto :get 200 "/embedding-hub/checklist")]+ (testing "every enterprise-backed step reports false"+ (doseq [step [:configure-row-column-security+ :sso-configured+ :create-tenants+ :setup-data-segregation-strategy+ :data-permissions-and-enable-tenants]]+ (is (false? (get-in response [:checklist step]))+ (str (name step) " should be false without enterprise code"))))+ (testing "no data isolation strategy is active"+ (is (nil? (:data-isolation-strategy response))))))))++(deftest create-custom-theme-checklist-test+ (mt/with-premium-features edition-features+ (let [ck (fn [] (get-in (mt/user-http-request :crowberto :get 200 "/embedding-hub/checklist")+ [:checklist :create-custom-theme]))]+ (testing "false when no themes exist"+ (is (false? (ck))))+ (testing "a seeded theme does not count as the admin's own"+ (mt/with-temp [:model/EmbeddingTheme _ {:name "Light" :settings {} :is_default true}]+ (is (false? (ck)))))+ (testing "a theme the admin created does"+ (mt/with-temp [:model/EmbeddingTheme _ {:name "Brand" :settings {} :is_default false}]+ (is (true? (ck))))))))++(deftest configure-ai-checklist-test+ (mt/with-premium-features edition-features+ (let [ck (fn [] (get-in (mt/user-http-request :crowberto :get 200 "/embedding-hub/checklist")+ [:checklist :configure-ai]))]+ (testing "false without provider credentials"+ (is (false? (ck))))+ ;; The default provider is anthropic, so its key is what makes+ ;; `llm-metabot-configured?` -- a computed setting -- report true.+ (testing "true once the provider is configured"+ (mt/with-temporary-setting-values [llm-anthropic-api-key "sk-ant-test"]+ (is (true? (ck)))))+ (testing "false when embedded Metabot is off, even with credentials"+ (mt/with-temporary-setting-values [llm-anthropic-api-key "sk-ant-test"+ embedded-metabot-enabled? false]+ (is (false? (ck)))))+ (testing "false when AI features are off entirely"+ (mt/with-temporary-setting-values [llm-anthropic-api-key "sk-ant-test"+ ai-features-enabled? false]+ (is (false? (ck))))))))diff --git a/test/metabase/embedding_rest/api/embed_test.clj b/test/metabase/embedding_rest/api/embed_test.cljindex 8583e891c9e..68fec1bdf12 100644--- a/test/metabase/embedding_rest/api/embed_test.clj+++ b/test/metabase/embedding_rest/api/embed_test.clj@@ -139,7 +139,7 @@~@body)))(defmacro with-embedding-enabled-and-new-secret-key! {:style/indent 0} [& body]- `(mt/with-temporary-setting-values [~'enable-embedding-static true+ `(mt/with-temporary-setting-values [~'enable-embedding-modular true~'enable-embedding-interactive true](with-new-secret-key!~@body)))@@ -1254,7 +1254,7 @@(client/client :get 200 (format "embed/card/%s/params/%s/values"(card-token card nil entity-id) param-key)))](binding [custom-values/*max-rows* 5]- (mt/with-temporary-setting-values [enable-embedding-static true]+ (mt/with-temporary-setting-values [enable-embedding-modular true](with-new-secret-key!(api.card-test/with-card-param-values-fixtures [{:keys [card field-filter-card param-keys]}](t2/update! :model/Card (:id field-filter-card)@@ -1409,29 +1409,28 @@(deftest card-param-values-native-card-without-parameters-test(testing "a native card described only by its template tags, with an empty locked value, still serves values"- (mt/with-temporary-setting-values [enable-embedding-static true]- (with-new-secret-key!- (mt/with-temp- [:model/Card card {:enable_embedding true- :embedding_params {:total "locked" :state "enabled"}- :dataset_query- {:database (mt/id)- :type :native- :native {:query "SELECT * FROM ORDERS WHERE {{total}} AND {{state}}"- :template-tags {"total" {:id "t1"- :name "total"- :display-name "Total"- :type :dimension- :widget-type :number/>=- :dimension [:field (mt/id :orders :total) nil]}- "state" {:id "s1"- :name "state"- :display-name "State"- :type :dimension- :widget-type :string/=- :dimension [:field (mt/id :people :state) nil]}}}}}]- (let [token (card-token card {:params {:total []}})]- (is (seq (:values (client/client :get 200 (format "embed/card/%s/params/s1/values" token)))))))))))+ (with-embedding-enabled-and-new-secret-key!+ (mt/with-temp+ [:model/Card card {:enable_embedding true+ :embedding_params {:total "locked" :state "enabled"}+ :dataset_query+ {:database (mt/id)+ :type :native+ :native {:query "SELECT * FROM ORDERS WHERE {{total}} AND {{state}}"+ :template-tags {"total" {:id "t1"+ :name "total"+ :display-name "Total"+ :type :dimension+ :widget-type :number/>=+ :dimension [:field (mt/id :orders :total) nil]}+ "state" {:id "s1"+ :name "state"+ :display-name "State"+ :type :dimension+ :widget-type :string/=+ :dimension [:field (mt/id :people :state) nil]}}}}}]+ (let [token (card-token card {:params {:total []}})]+ (is (seq (:values (client/client :get 200 (format "embed/card/%s/params/s1/values" token))))))))));;; ------------------------------------------------ Chain filtering -------------------------------------------------@@ -1628,7 +1627,7 @@(mt/dataset test-data(testing "GET /api/embed/pivot/card/:token/query"(testing "check that the endpoint doesn't work if embedding isn't enabled"- (mt/with-temporary-setting-values [enable-embedding-static false]+ (mt/with-temporary-setting-values [enable-embedding-modular false](with-new-secret-key!(with-temp-card [card (api.pivots/pivot-card)](is (= "Embedding is not enabled."@@ -1690,7 +1689,7 @@(deftest pivot-dashcard-embedding-disabled-test(mt/dataset test-data- (mt/with-temporary-setting-values [enable-embedding-static false]+ (mt/with-temporary-setting-values [enable-embedding-modular false](with-new-secret-key!(with-temp-dashcard [dashcard {:dash {:parameters []}:card (api.pivots/pivot-card)diff --git a/test/metabase/embedding_rest/api/preview_embed_test.clj b/test/metabase/embedding_rest/api/preview_embed_test.cljindex 071857a0880..b723e708a22 100644--- a/test/metabase/embedding_rest/api/preview_embed_test.clj+++ b/test/metabase/embedding_rest/api/preview_embed_test.clj@@ -36,7 +36,7 @@(is (= "You don't have permissions to do that."(mt/user-http-request :rasta :get 403 (card-url card)))))(testing "check that the endpoint doesn't work if embedding isn't enabled"- (mt/with-temporary-setting-values [enable-embedding-static false]+ (mt/with-temporary-setting-values [enable-embedding-modular false](is (= "Embedding is not enabled."(embed-test/with-temp-card [card](mt/user-http-request :crowberto :get 400 (card-url card)))))))@@ -86,7 +86,7 @@(is (= "You don't have permissions to do that."(mt/user-http-request :rasta :get 403 (card-query-url card)))))(testing "check that the endpoint doesn't work if embedding isn't enabled"- (mt/with-temporary-setting-values [enable-embedding-static false]+ (mt/with-temporary-setting-values [enable-embedding-modular false](is (= "Embedding is not enabled."(mt/user-http-request :crowberto :get 400 (card-query-url card))))))(testing "check that if embedding is enabled globally requests fail if they are signed with the wrong key"@@ -232,7 +232,7 @@(is (= "You don't have permissions to do that."(mt/user-http-request :rasta :get 403 (dashboard-url dash)))))(testing "check that the endpoint doesn't work if embedding isn't enabled"- (mt/with-temporary-setting-values [enable-embedding-static false]+ (mt/with-temporary-setting-values [enable-embedding-modular false](is (= "Embedding is not enabled."(mt/user-http-request :crowberto :get 400 (dashboard-url dash))))))(testing "check that if embedding is enabled globally requests fail if they are signed with the wrong key"@@ -276,7 +276,7 @@(mt/user-http-request :rasta :get 403 (dashcard-url dashcard)))))(testing "check that the endpoint doesn't work if embedding isn't enabled"(is (= "Embedding is not enabled."- (mt/with-temporary-setting-values [enable-embedding-static false]+ (mt/with-temporary-setting-values [enable-embedding-modular false](mt/user-http-request :crowberto :get 400 (dashcard-url dashcard))))))(testing "check that if embedding is enabled globally requests fail if they are signed with the wrong key"(is (= "Message seems corrupt or manipulated"@@ -468,7 +468,7 @@(mt/user-http-request :rasta :get 403 (pivot-dashcard-url dashcard)))))(testing "should fail if embedding is disabled"(is (= "Embedding is not enabled."- (mt/with-temporary-setting-values [enable-embedding-static false]+ (mt/with-temporary-setting-values [enable-embedding-modular false](embed-test/with-new-secret-key!(mt/user-http-request :crowberto :get 400 (pivot-dashcard-url dashcard)))))))(testing "should fail if embedding is enabled and the wrong key is used"@@ -532,7 +532,7 @@`(do-with-new-secret-key! (fn [] ~@body)))(defmacro with-embedding-enabled-and-new-secret-key! {:style/indent 0} [& body]- `(mt/with-temporary-setting-values [~'enable-embedding-static true]+ `(mt/with-temporary-setting-values [~'enable-embedding-modular true](with-new-secret-key!~@body)))@@ -546,7 +546,7 @@(deftest card-params-values-test(testing "GET /api/preview_embed/card/:token/params/:param-key/values"- ;; Card endpoint uses check-and-unsign which requires enable-embedding-static,+ ;; Card endpoint uses check-and-unsign which requires enable-embedding-modular,;; unlike dashboard endpoints which skip the check in preview mode(embed-test/with-embedding-enabled-and-new-secret-key!(mt/with-temp [:model/Card card {:dataset_query (mt/mbql-query venues)diff --git a/test/metabase/embedding_rest/api/theme_test.clj b/test/metabase/embedding_rest/api/theme_test.cljindex e98f81b5d4f..1a519922e94 100644--- a/test/metabase/embedding_rest/api/theme_test.clj+++ b/test/metabase/embedding_rest/api/theme_test.clj@@ -18,7 +18,7 @@response (mt/user-http-request :crowberto :post 200 "embed-theme"{:name theme-name:settings settings})]- (is (= #{:id :entity_id :name :settings :created_at :updated_at}+ (is (= #{:id :entity_id :name :settings :is_default :created_at :updated_at}(set (keys response))))(is (= theme-name (:name response)))(is (= settings (:settings response)))@@ -55,7 +55,7 @@(let [themes (mt/user-http-request :crowberto :get 200 "embed-theme")](is (= 2 (count themes))); settings is used for theme card previews- (is (= #{:id :entity_id :name :settings :created_at :updated_at}+ (is (= #{:id :entity_id :name :settings :is_default :created_at :updated_at}(set (keys (first themes)))))(testing "themes are ordered by oldest first"(is (= ["Theme 1" "Theme 2"]@@ -74,7 +74,7 @@:settings settings})theme-id (:id created)response (mt/user-http-request :crowberto :get 200 (format "embed-theme/%s" theme-id))]- (is (= #{:id :entity_id :name :settings :created_at :updated_at}+ (is (= #{:id :entity_id :name :settings :is_default :created_at :updated_at}(set (keys response))))(is (= "Test Theme" (:name response)))(is (= settings (:settings response))))))@@ -153,7 +153,7 @@:settings original-settings})theme-id (:id created)response (mt/user-http-request :crowberto :post 200 (format "embed-theme/%s/copy" theme-id))]- (is (= #{:id :entity_id :name :settings :created_at :updated_at}+ (is (= #{:id :entity_id :name :settings :is_default :created_at :updated_at}(set (keys response))))(is (= "Copy of My Theme" (:name response)))(is (= original-settings (:settings response)))diff --git a/test/metabase/queries_rest/api/card_test.clj b/test/metabase/queries_rest/api/card_test.cljindex d463336c365..ee2e0c8c0b3 100644--- a/test/metabase/queries_rest/api/card_test.clj+++ b/test/metabase/queries_rest/api/card_test.clj@@ -1091,7 +1091,7 @@(testing "Ignore values of `enable_embedding` while creating a Card (this must be done via `PUT /api/card/:id` instead)";; should be ignored regardless of the value of the `enable-embedding` Setting.(doseq [enable-embedding? [true false]]- (mt/with-temporary-setting-values [enable-embedding-static enable-embedding?]+ (mt/with-temporary-setting-values [enable-embedding-modular enable-embedding?](mt/with-model-cleanup [:model/Card](is (=? {:enable_embedding false}(mt/user-http-request :crowberto :post 200 "card" {:name "My Card"@@ -1105,7 +1105,7 @@(testing "Ignore values of `embedding_type` while creating a Card (this must be done via `PUT /api/card/:id` instead)";; should be ignored regardless of the value of the `embedding-type` Setting.(doseq [embedding-type [true false]]- (mt/with-temporary-setting-values [enable-embedding-static embedding-type]+ (mt/with-temporary-setting-values [enable-embedding-modular embedding-type](mt/with-model-cleanup [:model/Card](is (=? {:embedding_type nil}(mt/user-http-request :crowberto :post 200 "card" {:name "My Card"@@ -1944,11 +1944,11 @@(testing "PUT /api/card/:id"(mt/with-temp [:model/Card card](testing "If embedding is disabled, even an admin should not be allowed to update embedding params"- (mt/with-temporary-setting-values [enable-embedding-static false]+ (mt/with-temporary-setting-values [enable-embedding-modular false](is (= "Embedding is not enabled."(mt/user-http-request :crowberto :put 400 (str "card/" (u/the-id card)){:embedding_params {:abc "enabled"}})))))- (mt/with-temporary-setting-values [enable-embedding-static true]+ (mt/with-temporary-setting-values [enable-embedding-modular true](testing "Non-admin should not be allowed to update Card's embedding parms"(is (= "You don't have permissions to do that."(mt/user-http-request :rasta :put 403 (str "card/" (u/the-id card))@@ -1962,7 +1962,7 @@(deftest update-embedding-type-to-nil-test(testing "PUT /api/card/:id"(testing "Admin should be able to set embedding_type to nil to clear it"- (mt/with-temporary-setting-values [enable-embedding-static true]+ (mt/with-temporary-setting-values [enable-embedding-modular true](mt/with-temp [:model/Card card {:enable_embedding true:embedding_type "static-legacy"}](testing "Verify initial state has embedding_type set"@@ -3352,11 +3352,17 @@(deftest test-that-we-can-fetch-a-list-of-embeddable-cards(testing "GET /api/card/embeddable"- (mt/with-temporary-setting-values [enable-embedding-static true]+ (mt/with-temporary-setting-values [enable-embedding-modular true](mt/with-temp [:model/Card _ {:enable_embedding true}](is (= [{:name true, :id true}](for [card (mt/user-http-request :crowberto :get 200 "card/embeddable")]- (m/map-vals boolean (select-keys card [:name :id])))))))))+ (m/map-vals boolean (select-keys card [:name :id])))))))+ (testing "and that we can still see them once guest embeds are turned off"+ (mt/with-temporary-setting-values [enable-embedding-modular false]+ (mt/with-temp [:model/Card _ {:enable_embedding true}]+ (is (= [{:name true, :id true}]+ (for [card (mt/user-http-request :crowberto :get 200 "card/embeddable")]+ (m/map-vals boolean (select-keys card [:name :id]))))))))))(deftest ^:parallel pivot-card-test(mt/test-drivers (api.pivots/applicable-drivers)diff --git a/test/metabase/query_processor/streaming_test.clj b/test/metabase/query_processor/streaming_test.cljindex 8e1db3db0cf..d06d45392cc 100644--- a/test/metabase/query_processor/streaming_test.clj+++ b/test/metabase/query_processor/streaming_test.clj@@ -328,7 +328,7 @@card-defaults {:dataset_query query, :public_uuid public-uuid, :enable_embedding true}user (or user :rasta)](mt/with-temporary-setting-values [enable-public-sharing true- enable-embedding-static true]+ enable-embedding-modular true](embed-test/with-new-secret-key!;; allowing `with-temp` here since it's needed to create Dashboards#_{:clj-kondo/ignore [:discouraged-var]}diff --git a/test/metabase/server/middleware/security_test.clj b/test/metabase/server/middleware/security_test.cljindex 8fdfb66397c..941870ca757 100644--- a/test/metabase/server/middleware/security_test.clj+++ b/test/metabase/server/middleware/security_test.clj@@ -661,8 +661,7 @@(is (= "60" (get headers "Access-Control-Max-Age"))"Expected Access-Control-Max-Age header to be set to 60")))(testing "CORS should be enabled when origins are configured regardless of embedding flags"- (mt/with-temporary-setting-values [enable-embedding-simple false- enable-embedding-sdk false]+ (mt/with-temporary-setting-values [enable-embedding-modular false](let [headers (mw.security/access-control-headers "https://example.com""https://example.com")](is (= "https://example.com"@@ -675,8 +674,7 @@(deftest test-cors-enabled-when-origins-configured-without-embedding-features(testing "CORS headers should be sent when origins are configured even if embedding features are disabled"- (mt/with-temporary-setting-values [enable-embedding-sdk false- enable-embedding-simple false+ (mt/with-temporary-setting-values [enable-embedding-modular falseembedding-app-origins-sdk "https://example.com"](let [wrapped-handler (mw.security/add-security-headers(fn [_request respond _raise]diff --git a/test_resources/serialization_baseline/settings.yaml b/test_resources/serialization_baseline/settings.yamlindex be0e15b075f..cc11caf5a1e 100644--- a/test_resources/serialization_baseline/settings.yaml+++ b/test_resources/serialization_baseline/settings.yaml@@ -77,6 +77,7 @@ show-homepage-data: nullshow-homepage-pin-message: nullshow-homepage-xrays: nullshow-metabot: null+show-modular-embed-terms: nullshow-sdk-embed-terms: nullshow-simple-embed-terms: nullshow-static-embed-terms: null