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 onboarding improvements (#69456)
Phoomparin Manocd32f3b89c71
diff --git a/e2e/test/scenarios/embedding/embedding-hub/embedding-hub.cy.spec.ts b/e2e/test/scenarios/embedding/embedding-hub/embedding-hub.cy.spec.tsindex 4b96fc33bd0..7d167214c1c 100644--- a/e2e/test/scenarios/embedding/embedding-hub/embedding-hub.cy.spec.ts+++ b/e2e/test/scenarios/embedding/embedding-hub/embedding-hub.cy.spec.ts@@ -1,7 +1,10 @@-import { enableJwtAuth } from "e2e/support/helpers/e2e-jwt-helpers";+import { SAMPLE_DB_TABLES } from "e2e/support/cypress_data";+import { ALL_EXTERNAL_USERS_GROUP_ID } from "e2e/support/cypress_sample_instance_data";const { H } = cy;+const { STATIC_ORDERS_ID, STATIC_PEOPLE_ID } = SAMPLE_DB_TABLES;+describe("scenarios - embedding hub", () => {describe("checklist", () => {beforeEach(() => {@@ -113,39 +116,6 @@ describe("scenarios - embedding hub", () => {.should("be.visible");});- [- { dbId: 1, dbName: "sample db" },- { dbId: 2, dbName: "sqlite db" },- ].forEach(({ dbId, dbName }) => {- it(`"Create models" step should be marked in ${dbName} as done after creating a model`, () => {- if (dbId === 2) {- H.addSqliteDatabase(dbName);- }-- cy.log("Create a native query model via API");- H.createNativeQuestion(- {- name: "Test Model",- type: "model",- database: dbId,- native: { query: "SELECT 1 as t" },- },- { visitQuestion: true },- );-- cy.log("Navigate to embedding setup guide");- cy.visit("/admin/embedding/setup-guide");-- cy.log("'Create models' should now be marked as done");- cy.findByTestId("admin-layout-content")- .findByText("Create models")- .closest("button")- .scrollIntoView()- .findByText("Done", { timeout: 10_000 })- .should("be.visible");- });- });-it('"Get embed snippet" card should take you to the embed flow', () => {cy.visit("/admin/embedding/setup-guide");@@ -160,27 +130,50 @@ describe("scenarios - embedding hub", () => {});});- it("Embed in production step should be locked until JWT is enabled", () => {+ it('"Get embed snippet" step should be done when a guest embed is published', () => {+ cy.log("Create a dashboard to embed");+ H.createDashboard({ name: "Test Dashboard" });+cy.visit("/admin/embedding/setup-guide");+ cy.log("step should not be marked as done at first");cy.findByTestId("admin-layout-content")- .findByText("Embed in production with SSO")- .scrollIntoView()- .should("be.visible")+ .findByText("Get embed snippet").closest("button")- .icon("lock")- .should("be.visible");+ .findByText("Done")+ .should("not.exist");- enableJwtAuth();- cy.reload();+ cy.log("open embed wizard");+ cy.findByTestId("admin-layout-content")+ .findByText("Get embed snippet")+ .click();++ cy.log("choose dashboard experience");+ H.modal()+ .first()+ .within(() => {+ cy.findByText("Dashboard").click();+ cy.findByText("Next").click();+ });+ cy.log("pick a dashboard");+ H.modal().first().findByTestId("embed-browse-entity-button").click();+ H.entityPickerModal().findByText("Test Dashboard").click();+ H.modal().first().findByText("Next").click();++ cy.log("publish the embed");+ H.publishChanges("dashboard");++ cy.log("close the wizard");+ H.modal().first().findByText("Get code").click();+ H.modal().first().findByLabelText("Close").click();++ cy.log("step should be marked as done");cy.findByTestId("admin-layout-content")- .findByText("Embed in production with SSO")- .scrollIntoView()- .should("be.visible")+ .findByText("Get embed snippet").closest("button")- .icon("lock")- .should("not.exist");+ .findByText("Done", { timeout: 10_000 })+ .should("be.visible");});it("embedding checklist should show up on the embedding homepage", () => {@@ -195,7 +188,6 @@ describe("scenarios - embedding hub", () => {.should("be.visible");cy.get("main").within(() => {- cy.findByText("Create models").should("be.visible");cy.findByText("Create a dashboard").should("be.visible");cy.findByText("Connect a database").should("be.visible").click();});@@ -259,73 +251,1298 @@ describe("scenarios - embedding hub", () => {.should("not.exist");});- it('"Pick a user strategy" card should open the edit strategy modal', () => {+ it("should link to user strategy when tenants are disabled", () => {H.restore("setup");cy.signInAsAdmin();H.activateToken("bleeding-edge");- cy.request("PUT", "/api/setting/embedding-homepage", {- value: "visible",- });+ cy.visit("/admin/embedding/setup-guide");- cy.visit("/");+ 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("bleeding-edge");++ H.updateSetting("use-tenants", true);+ cy.visit("/admin/embedding/setup-guide");H.main()- .findByText("Pick a user strategy")+ .findByText("Tenants").scrollIntoView().should("be.visible")- .click();+ .closest("a")+ .should("have.attr", "href", "/admin/people/tenants");+ });- H.modal().within(() => {- cy.findByText("Pick a user strategy").should("be.visible");- cy.findByText("Multi tenant").click();- cy.button("Apply").click();- });+ it('"Configure data permissions and enable tenants" card should navigate to permissions onboarding page', () => {+ cy.visit("/admin/embedding/setup-guide");- cy.log("the internal prefix should show up on the page");- H.main().findByText("Internal users").should("be.visible");- H.main().findByText("Internal groups").should("be.visible");+ cy.findByTestId("admin-layout-content")+ .findByText("Configure data permissions and enable tenants")+ .click();- cy.visit("/");+ cy.url().should("include", "/admin/embedding/setup-guide/permissions");- cy.log("'Pick a user strategy' should now be marked as done");H.main()- .findByText("Pick a user strategy")- .closest("button")+ .findByText("Configure data permissions and enable tenants").scrollIntoView()- .findByText("Done", { timeout: 10_000 }).should("be.visible");});- it("should link to user strategy when tenants are disabled", () => {+ it("permissions setup page should mark steps as completed", () => {H.restore("setup");cy.signInAsAdmin();H.activateToken("bleeding-edge");- cy.visit("/admin/embedding/setup-guide");+ cy.visit("/admin/embedding/setup-guide/permissions");++ cy.log("all 5 steps are present and none are completed at first");+ H.main().within(() => {+ cy.findByText("Enable multi-tenant user strategy")+ .scrollIntoView()+ .should("be.visible");++ cy.findByText("Which data segregation strategy does your database use?")+ .scrollIntoView()+ .should("be.visible");++ cy.findByText("Select data to make available")+ .scrollIntoView()+ .should("be.visible");++ cy.findByText("Create tenants").scrollIntoView().should("be.visible");+ cy.findByText("Summary").scrollIntoView().should("be.visible");++ // No steps should be completed yet (no check icons)+ cy.icon("check").should("not.exist");+ });++ cy.log("enable tenants and create a shared collection");+ H.updateSetting("use-tenants", true);+ cy.request("POST", "/api/collection", {+ name: "Shared collection",+ namespace: "shared-tenant-collection",+ });++ cy.log("create a tenant");+ cy.request("POST", "/api/ee/tenant", {+ name: "Test Tenant",+ slug: "test-tenant",+ });+ cy.log("check steps 1 and 4 are completed");+ cy.reload();+ H.main().icon("check").should("have.length", 2);++ cy.log("setup row-level security");+ cy.request("POST", "/api/permissions/group", { name: "Test Group" }).then(+ ({ body: group }) => {+ cy.sandboxTable({+ table_id: STATIC_ORDERS_ID,+ group_id: group.id,+ });+ },+ );++ cy.log("check all 5 steps are completed");+ cy.reload();+ H.main().icon("check").should("have.length", 5);+ });++ it('"Enable tenants and create shared collection" button should enable tenants and create a shared collection', () => {+ H.restore("setup");+ cy.signInAsAdmin();+ H.activateToken("bleeding-edge");++ cy.visit("/admin/embedding/setup-guide/permissions");++ cy.log("tenants should not be enabled");+ cy.request("GET", "/api/session/properties").then((response) => {+ expect(response.body["use-tenants"]).to.equal(false);+ });++ cy.log("shared tenants collection should not exist");+ cy.request(+ "GET",+ "/api/collection/tree?namespace=shared-tenant-collection",+ ).then((response) => {+ expect(response.body).to.have.length(0);+ });++ cy.log("click the enable tenants button");H.main()- .findByText("Tenants")- .scrollIntoView()- .should("be.visible")- .closest("a")- .should("have.attr", "href", "/admin/people/user-strategy");+ .findByRole("button", {+ name: "Enable tenants and create shared collection",+ })+ .should("be.enabled")+ .click();++ cy.log("tenants should be enabled");+ cy.request("GET", "/api/session/properties").then((response) => {+ expect(response.body["use-tenants"]).to.equal(true);+ });++ cy.log("shared collection should be created");+ cy.request(+ "GET",+ "/api/collection/tree?namespace=shared-tenant-collection",+ ).then((response) => {+ expect(response.body).to.have.length(1);+ expect(response.body[0].name).to.equal("Shared collection");+ });++ cy.log("enable-tenants step should be marked as completed");+ H.main()+ .findByRole("listitem", {+ name: "Enable multi-tenant user strategy",++ // the embedding checklist query takes time on CI+ timeout: 10_000,+ })+ .should("have.attr", "data-completed", "true");});- it("should link to tenants page when tenants are enabled", () => {+ it("enable-tenants step should not be marked as completed when tenants are enabled but no shared collection exists", () => {H.restore("setup");cy.signInAsAdmin();H.activateToken("bleeding-edge");+ cy.log("enable tenants via setting without creating a shared collection");H.updateSetting("use-tenants", true);- cy.visit("/admin/embedding/setup-guide");+ cy.visit("/admin/embedding/setup-guide/permissions");++ cy.log("no steps should be completed");+ H.main().within(() => {+ cy.findByText("Enable multi-tenant user strategy")+ .scrollIntoView()+ .should("be.visible");++ cy.icon("check").should("not.exist");+ });++ cy.log("button should still be enabled");H.main()- .findByText("Tenants")- .scrollIntoView()- .should("be.visible")- .closest("a")- .should("have.attr", "href", "/admin/people/tenants");+ .findByRole("button", {+ name: "Enable tenants and create shared collection",+ })+ .should("be.enabled");+ });++ it('"Enable tenants and create shared collection" button should be disabled when already set up', () => {+ H.restore("setup");+ cy.signInAsAdmin();+ H.activateToken("bleeding-edge");++ cy.log("enable tenants and create a shared collection");+ H.updateSetting("use-tenants", true);+ cy.request("POST", "/api/collection", {+ name: "Shared collection",+ namespace: "shared-tenant-collection",+ });++ cy.visit("/admin/embedding/setup-guide/permissions");++ cy.log("wait until step is marked as complete");+ H.main().icon("check").should("have.length", 1);++ cy.log("un-collapse the pre-collapsed step");+ H.main().findByText("Enable multi-tenant user strategy").click();++ cy.log("button should be disabled as setup was already complete");+ H.main()+ .findByRole("button", {+ name: "Enable tenants and create shared collection",+ })+ .should("be.disabled");+ });++ it("selecting database routing strategy should show documentation link in step 3", () => {+ H.restore("setup");+ cy.signInAsAdmin();+ H.activateToken("bleeding-edge");++ cy.visit("/admin/embedding/setup-guide/permissions");++ cy.log("click the enable tenants button");+ H.main()+ .findByRole("button", {+ name: "Enable tenants and create shared collection",+ })+ .should("be.enabled")+ .click();++ cy.log("select database routing strategy");+ H.main()+ .findByRole("radio", { name: /Database routing/ })+ .click();++ cy.log("confirm the strategy selection");+ H.main().findByRole("button", { name: "Use database routing" }).click();++ cy.log("should show database routing content with docs link");+ H.main()+ .findByText("Manage data permissions with database routing")+ .should("be.visible");++ H.main()+ .findByRole("link", { name: /View the guide/i })+ .should("have.attr", "href")+ .and("include", "database-routing");+ });++ describe("create tenants step", () => {+ beforeEach(() => {+ H.restore("setup");+ cy.signInAsAdmin();+ H.activateToken("bleeding-edge");++ cy.log("enable tenants and create shared collection");+ H.updateSetting("use-tenants", true);+ cy.request("POST", "/api/collection", {+ name: "Shared collection",+ namespace: "shared-tenant-collection",+ });++ cy.log("setup row-level security to unlock the create tenants step");+ cy.request("POST", "/api/permissions/group", {+ name: "Test Group",+ }).then(({ body: group }) => {+ cy.sandboxTable({+ table_id: STATIC_ORDERS_ID,+ group_id: group.id,+ });+ });+ });++ it("can create two tenants and show summary", () => {+ cy.visit("/admin/embedding/setup-guide/permissions");++ cy.log("step 1 should be marked as done before navigating");+ H.main()+ .findByRole("listitem", {+ name: "Enable multi-tenant user strategy",+ timeout: 10_000,+ })+ .should("have.attr", "data-completed", "true");++ H.main().within(() => {+ cy.log("navigate to create tenants step");++ cy.findByRole("listitem", { name: "Create tenants" })+ .should("be.visible")+ .click();++ cy.log("fill out the tenant form");+ cy.findByPlaceholderText("Tenant name").clear().type("Acme Corp");+ cy.findByLabelText("organization_id").type("acme-123");+ cy.findByPlaceholderText("tenant-slug")+ .clear()+ .type("acme-corp-slug");++ cy.log("add another tenant");+ cy.findByRole("button", { name: /New tenant/ }).click();+ });++ cy.log("fill out the second tenant form");+ H.main().within(() => {+ cy.findAllByPlaceholderText("Tenant name")+ .should("have.length", 2)+ .last()+ .clear()+ .type("Beta Inc");++ cy.findAllByLabelText("organization_id")+ .should("have.length", 2)+ .last()+ .type("beta-456");++ cy.findAllByPlaceholderText("tenant-slug")+ .should("have.length", 2)+ .last()+ .clear()+ .type("beta-inc-slug");+ });++ cy.log("submit the tenant creation form");+ H.main().findByRole("button", { name: "Create tenants" }).click();++ cy.log("success toast should show");+ H.undoToast()+ .findByText("Tenants created successfully")+ .should("be.visible");++ H.main().within(() => {+ cy.log("step 4 should be marked as completed");+ cy.findByRole("listitem", {+ name: "Create tenants",+ timeout: 10_000,+ }).should("have.attr", "data-completed", "true");++ cy.findByText("You created the following tenants").should(+ "be.visible",+ );++ cy.log("step 5 should hide title when active");+ cy.findByText("Summary").should("not.exist");++ cy.log("summary step should show tenant #1");+ cy.findByText("Acme Corp").should("be.visible");+ cy.findByText("acme-corp-slug").should("be.visible");++ cy.log("summary step should show tenant #2");+ cy.findByText("Beta Inc").should("be.visible");+ cy.findByText("beta-inc-slug").should("be.visible");++ cy.log("navigation links should be shown in summary");+ cy.findByRole("link", { name: /Tenants/ }).should("be.visible");+ cy.findByRole("button", { name: "Done" }).click();+ });++ cy.log("Configure data permissions step should be done");+ cy.findByTestId("admin-layout-content")+ .findByText("Configure data permissions and enable tenants")+ .closest("button")+ .findByText("Done")+ .should("be.visible");++ cy.log("verify tenant_attributes are saved correctly via API");+ cy.request("GET", "/api/ee/tenant").should((response) => {+ const tenants = response.body.data;++ const acmeTenant = tenants.find(+ (tenant: { slug: string }) => tenant.slug === "acme-corp-slug",+ );++ const betaTenant = tenants.find(+ (tenant: { slug: string }) => tenant.slug === "beta-inc-slug",+ );++ expect(acmeTenant).to.exist;+ expect(acmeTenant.attributes).to.deep.equal({+ organization_id: "acme-123",+ });++ expect(betaTenant).to.exist;+ expect(betaTenant.attributes).to.deep.equal({+ organization_id: "beta-456",+ });+ });++ cy.visit("/admin/people/tenants");++ cy.log("tenants are shown in the tenants page");+ H.main().within(() => {+ cy.findByText("Acme Corp").should("be.visible");+ cy.findByText("Beta Inc").should("be.visible");+ });+ });++ it("shows error toast when creating a tenant with duplicate slug", () => {+ cy.log("create an existing tenant");+ cy.request("POST", "/api/ee/tenant", {+ name: "Existing Tenant",+ slug: "existing-tenant",+ });++ cy.visit("/admin/embedding/setup-guide/permissions");++ H.main()+ .findByRole("listitem", { name: "Create tenants" })+ .should("be.visible")+ .click();++ cy.log("fill out the tenant form with a colliding slug");+ H.main().within(() => {+ cy.findByPlaceholderText("Tenant name")+ .clear()+ .type("Another Tenant");++ cy.findByPlaceholderText("e.g. acme-corp").type("another-id");++ cy.findByPlaceholderText("tenant-slug")+ .clear()+ .type("existing-tenant");+ });++ H.main().findByRole("button", { name: "Create tenants" }).click();++ cy.log("error toast should be shown");+ H.undoToast()+ .findByText("This tenant name or slug is already taken.", {+ timeout: 10_000,+ })+ .should("be.visible");++ cy.log("we should still be on the create tenants step");+ H.main().findByPlaceholderText("Tenant name").should("be.visible");+ });++ it("reloads with strategy pre-selected and 'Select data' step unlocked when RLS is configured", () => {+ cy.visit("/admin/embedding/setup-guide/permissions");++ cy.log(+ "'Select data' step should not be locked when RLS is configured",+ );+ H.main()+ .findByRole("listitem", { name: "Select data to make available" })+ .icon("lock")+ .should("not.exist");++ cy.log("strategy picker should show RLS pre-selected");+ H.main()+ .findByText("Which data segregation strategy does your database use?")+ .scrollIntoView()+ .click();++ H.main()+ .findByRole("radio", { name: /Row and column level security/ })+ .should("have.attr", "aria-checked", "true");+ });++ it("shows autocomplete suggestions for organization_id based on selected field values", () => {+ H.restore("setup");+ cy.signInAsAdmin();+ H.activateToken("bleeding-edge");++ cy.visit("/admin/embedding/setup-guide/permissions");++ cy.log("enable tenants and create shared collection");+ H.main()+ .findByRole("button", {+ name: "Enable tenants and create shared collection",+ })+ .click();++ cy.log("wait for tenants to be enabled");+ H.main()+ .findByRole("listitem", {+ name: "Enable multi-tenant user strategy",+ timeout: 10_000,+ })+ .icon("check")+ .should("exist");++ cy.log("use row and column level security");+ H.main()+ .findByRole("radio", { name: /Row and column level security/ })+ .scrollIntoView()+ .click();++ H.main()+ .findByRole("button", { name: "Use row and column level security" })+ .scrollIntoView()+ .click();++ cy.log("pick orders table");+ H.main().findByText("Pick a table").click();+ H.miniPicker().findByText("Sample Database").click();+ H.miniPicker().findByText("Orders").click();++ H.main().findByPlaceholderText("Pick a column").click();+ H.popover().findByText("User ID").click();+ H.main().findByRole("button", { name: "Next" }).click();++ cy.log("autocomplete dropdown should show matching user id values");+ H.main().findByPlaceholderText("e.g. 1").type("1");++ H.popover().within(() => {+ cy.findAllByRole("option").should("have.length.at.least", 8);++ // The ID differs across run, so let's only do one assertion here.+ cy.findByRole("option", { name: "1" }).should("exist");+ });+ });});++ // Needs its own test case, as the RLS selected table and columns+ // are only populated when the user goes through the "Select data" step+ // in the UI. Without it, the data permissions description won't show.+ it("shows RLS data permissions description in summary", () => {+ H.restore("setup");+ cy.signInAsAdmin();+ H.activateToken("bleeding-edge");++ cy.visit("/admin/embedding/setup-guide/permissions");++ cy.log("enable tenants and create shared collection");+ H.main()+ .findByRole("button", {+ name: "Enable tenants and create shared collection",+ })+ .click();++ cy.log("wait for tenants to be enabled");+ H.main()+ .findByRole("listitem", {+ name: "Enable multi-tenant user strategy",+ timeout: 10_000,+ })+ .icon("check")+ .should("exist");++ cy.log("use row and column level security");+ H.main()+ .findByRole("radio", { name: /Row and column level security/ })+ .scrollIntoView()+ .click();++ H.main()+ .findByRole("button", { name: "Use row and column level security" })+ .scrollIntoView()+ .click();++ cy.log("pick Orders table and User ID column");+ H.main().findByText("Pick a table").click();+ H.miniPicker().findByText("Sample Database").click();+ H.miniPicker().findByText("Orders").click();++ H.main().findByPlaceholderText("Pick a column").click();+ H.popover().findByText("User ID").click();++ cy.intercept("PUT", "/api/permissions/graph").as(+ "updatePermissionsGraph",+ );+ H.main().findByRole("button", { name: "Next" }).click();+ cy.wait("@updatePermissionsGraph");++ cy.log("navigate to create tenants step");+ H.main().findByRole("listitem", { name: "Create tenants" }).click();++ cy.log("should show dynamic description with the selected column name");+ H.main()+ .contains("Enter a value that matches the User ID column.")+ .should("be.visible");++ cy.log("fill out the tenant form");+ H.main().within(() => {+ cy.findByPlaceholderText("Tenant name").clear().type("Acme Corp");+ cy.findByPlaceholderText("e.g. 1").type("42");+ cy.findByPlaceholderText("tenant-slug").clear().type("acme-corp");+ });++ H.main().findByRole("button", { name: "Create tenants" }).click();++ cy.log("success toast should show");+ H.undoToast()+ .findByText("Tenants created successfully")+ .should("be.visible");++ cy.log("data permissions description should show in summary");+ H.main()+ .contains(+ "All users in Acme Corp can view rows in the Orders table where User ID field equals 42.",+ )+ .should("be.visible");+ });++ it("should create sandboxes for multiple tables via row-level security setup", () => {+ H.restore("setup");+ cy.signInAsAdmin();+ H.activateToken("bleeding-edge");++ cy.intercept("PUT", "/api/permissions/graph").as(+ "updatePermissionsGraph",+ );++ cy.visit("/admin/embedding/setup-guide/permissions");++ cy.log("steps 3, 4, and 5 should be locked initially");+ H.main().within(() => {+ cy.findByRole("listitem", { name: "Select data to make available" })+ .icon("lock")+ .should("exist");++ cy.findByRole("listitem", { name: "Create tenants" })+ .icon("lock")+ .should("exist");++ cy.findByRole("listitem", { name: "Summary" })+ .icon("lock")+ .should("exist");+ });++ H.main()+ .findByRole("button", {+ name: "Enable tenants and create shared collection",+ })+ .click();++ cy.log("wait for tenants to be enabled");+ H.main()+ .findByRole("listitem", {+ name: "Enable multi-tenant user strategy",+ timeout: 10_000,+ })+ .icon("check")+ .should("exist");++ H.main()+ .findByRole("radio", { name: /Row and column level security/ })+ .scrollIntoView()+ .click();++ H.main()+ .findByRole("button", { name: "Use row and column level security" })+ .scrollIntoView()+ .click();++ cy.log("pick first table and column");+ H.main().findByText("Pick a table").click();++ H.miniPicker().findByText("Sample Database").click();+ H.miniPicker().findByText("Orders").click();++ H.main().findByPlaceholderText("Pick a column").click();+ H.popover().findByText("User ID").click();++ cy.log("pick second table and column");+ H.main().findByText("Add table").click();+ H.main().findAllByText("Pick a table").first().click();++ H.miniPicker().findByText("Sample Database").click();++ cy.log("orders should be hidden as it's already selected");+ H.miniPicker().findByText("Orders").should("not.exist");++ H.miniPicker().findByText("People").click();++ H.main()+ .findAllByPlaceholderText("Pick a column")+ .should("have.length", 2)+ .last()+ .click();++ H.popover().findByText("ID").click();++ cy.log("create sandbox");+ H.main().findByRole("button", { name: "Next" }).click();++ cy.log("wait for sandbox creation to complete");+ cy.wait("@updatePermissionsGraph");++ cy.log("no error toast should appear");+ H.undoToast().should("not.exist");++ // We verify permissions via API rather than UI because:+ // 1. The admin permissions UI is complex and would add significant test time+ // 2. This test focuses on the onboarding flow, not the permissions UI+ cy.log("access policies should be created");+ cy.request("GET", "/api/mt/gtap").should((response) => {+ const policies = response.body;+ expect(policies.length).to.be.at.least(2);++ const orderPolicy = policies.find(+ (policy: { table_id: number }) =>+ policy.table_id === STATIC_ORDERS_ID,+ );++ const peoplePolicy = policies.find(+ (policy: { table_id: number }) =>+ policy.table_id === STATIC_PEOPLE_ID,+ );++ expect(orderPolicy).to.exist;+ expect(peoplePolicy).to.exist;++ expect(orderPolicy.attribute_remappings).to.have.property(+ "organization_id",+ );++ expect(peoplePolicy.attribute_remappings).to.have.property(+ "organization_id",+ );+ });++ cy.log("permissions graph should have sandboxed view-data");+ cy.request(+ "GET",+ `/api/permissions/graph/group/${ALL_EXTERNAL_USERS_GROUP_ID}`,+ ).should((response) => {+ const graph = response.body;++ // [1] is for sample database, public schema.+ const permissions = graph.groups[ALL_EXTERNAL_USERS_GROUP_ID!][1];+ expect(permissions).to.exist;++ const viewData = permissions["view-data"];+ expect(viewData).to.exist;+ expect(viewData["PUBLIC"][STATIC_ORDERS_ID]).to.equal("sandboxed");+ expect(viewData["PUBLIC"][STATIC_PEOPLE_ID]).to.equal("sandboxed");++ expect(permissions["create-queries"]).to.equal("query-builder");+ });++ H.main()+ .findByRole("listitem", {+ name: "Select data to make available",+ timeout: 10_000,+ })+ .icon("check")+ .should("exist");+ });++ it("should update existing sandboxes when changing column selection", () => {+ H.restore("setup");+ cy.signInAsAdmin();+ H.activateToken("bleeding-edge");++ cy.intercept("PUT", "/api/permissions/graph").as(+ "updatePermissionsGraph",+ );++ // We use API setup here instead of clicking through the UI because:+ // 1. This test verifies the UPDATE flow (not CREATE), which requires a sandbox to already exist+ // 2. The sandbox can only be created after tenants are enabled (which creates the all-external-users group)+ // 3. Using API calls is cleaner for test data preparation than clicking through UI twice+ cy.log("enable tenants to create the all-external-users");+ H.updateSetting("use-tenants", true);++ cy.log("create shared collection");+ cy.request("POST", "/api/collection", {+ name: "Shared collection",+ parent_id: null,+ namespace: "shared-tenant-collection",+ });++ cy.log("create an existing sandbox for Orders table via API");+ cy.request("GET", "/api/permissions/group").then((response) => {+ const allExternalUsersGroup = response.body.find(+ (g: { magic_group_type: string }) =>+ g.magic_group_type === "all-external-users",+ );++ cy.request("POST", "/api/mt/gtap", {+ table_id: STATIC_ORDERS_ID,+ group_id: allExternalUsersGroup.id,+ card_id: null,+ attribute_remappings: {+ organization_id: ["dimension", ["field", 2, null]], // USER_ID field+ },+ });+ });++ cy.visit("/admin/embedding/setup-guide/permissions");++ cy.log("wait for create tenants step to be active and unlocked");+ H.main()+ .findByRole("listitem", { name: "Create tenants" })+ .should("have.attr", "data-active", "true");++ H.main()+ .findByText("Which data segregation strategy does your database use?")+ .scrollIntoView()+ .should("be.visible")+ .click();++ cy.log("select row and column level security strategy");+ H.main()+ .findByRole("radio", { name: /Row and column level security/ })+ .scrollIntoView()+ .click();++ H.main()+ .findByRole("button", { name: "Use row and column level security" })+ .scrollIntoView()+ .click();++ cy.log("Select the same Orders table");+ H.main().findByText("Pick a table").click();+ H.miniPicker().findByText("Sample Database").click();+ H.miniPicker().findByText("Orders").click();++ cy.log("select Product ID column instead of User ID");+ H.main().findByPlaceholderText("Pick a column").click();+ H.popover().findByText("Product ID").click();+ H.main().findByRole("button", { name: "Next" }).click();++ cy.log("wait for sandbox update to complete");+ cy.wait("@updatePermissionsGraph");++ cy.log("error toast should not appear");+ H.undoToast().should("not.exist");++ cy.log("sandbox should be updated and not created");+ cy.request("GET", "/api/mt/gtap").should((response) => {+ const policies = response.body;++ const orderPolicies = policies.filter(+ (policy: { table_id: number }) =>+ policy.table_id === STATIC_ORDERS_ID,+ );++ // should only have one sandbox for Orders table+ expect(orderPolicies.length).to.equal(1);++ const [orderPolicy] = orderPolicies;+ const tenantFieldRef = orderPolicy.attribute_remappings.organization_id;++ // attribute_remappings should reference field 3 (PRODUCT_ID),+ // not field 2 (USER_ID)+ expect(tenantFieldRef[1][1]).to.equal(3);+ });++ H.main()+ .findByRole("listitem", {+ name: "Select data to make available",+ timeout: 10_000,+ })+ .icon("check")+ .should("exist");+ });++ it("locks the production embed step when JWT is not enabled", () => {+ cy.visit("/admin/embedding/setup-guide");++ 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")+ .findByText("Embed in production with SSO")+ .scrollIntoView()+ .should("be.visible")+ .closest("button")+ .icon("lock")+ .should("be.visible");++ cy.findByTestId("admin-layout-content")+ .findByText("Embed in production with SSO")+ .closest("button")+ .findByText("Complete the other steps to unlock")+ .should("be.visible");+ });+ });++ describe("connection impersonation step", () => {+ beforeEach(() => {+ H.restore("setup");+ cy.signInAsAdmin();+ H.activateToken("bleeding-edge");++ H.updateSetting("use-tenants", true);++ cy.request("POST", "/api/collection", {+ name: "Shared collection",+ namespace: "shared-tenant-collection",+ });+ });++ it("should configure connection impersonation for selected databases", function () {+ H.addPostgresDatabase("QA Postgres12");++ cy.get<number>("@postgresID").then((postgresId) => {+ cy.visit("/admin/embedding/setup-guide/permissions");++ H.main()+ .findByRole("radio", { name: /Connection impersonation/ })+ .scrollIntoView()+ .click();++ H.main()+ .findByRole("button", { name: "Use connection impersonation" })+ .scrollIntoView()+ .click();++ cy.log("select database");+ H.main().findByPlaceholderText("Pick a database").click();+ H.popover().findByText("QA Postgres12").click();++ cy.log("database should be selected in the multi-select pill");+ H.main().findAllByLabelText("Remove").should("have.length", 1);+ H.main().findByText("QA Postgres12").should("be.visible");++ cy.log("setup connection impersonation for the database");+ H.main().findByRole("button", { name: "Next" }).click();++ cy.log("step should be marked as complete");+ H.main()+ .findByRole("listitem", {+ name: "Select data to make available",+ timeout: 10_000,+ })+ .icon("check")+ .should("exist");++ cy.log("connection impersonation policy should be created");+ cy.request("GET", "/api/ee/advanced-permissions/impersonation").should(+ (response) => {+ const policies = response.body;+ expect(policies.length).to.be.at.least(1);++ const postgresPolicy = policies.find(+ (policy: { db_id: number }) => policy.db_id === postgresId,+ );++ expect(postgresPolicy).to.exist;+ expect(postgresPolicy.attribute).to.equal("database_role");+ },+ );++ cy.log("permission graph should have impersonated view-data");+ cy.request(+ "GET",+ `/api/permissions/graph/group/${ALL_EXTERNAL_USERS_GROUP_ID}`,+ ).should((response) => {+ const graph = response.body;++ const permissions =+ graph.groups[ALL_EXTERNAL_USERS_GROUP_ID!][postgresId as number];++ expect(permissions).to.exist;+ expect(permissions["view-data"]).to.equal("impersonated");+ expect(permissions["create-queries"]).to.equal("query-builder");+ });+ });+ });++ it("should show 'no compatible databases' message when only Sample Database exists", () => {+ cy.visit("/admin/embedding/setup-guide/permissions");++ cy.log("select connection impersonation strategy");+ H.main()+ .findByRole("radio", { name: /Connection impersonation/ })+ .scrollIntoView()+ .click();++ H.main()+ .findByRole("button", { name: "Use connection impersonation" })+ .scrollIntoView()+ .click();++ H.main()+ .findByText(+ "None of your databases support connection impersonation. Pick a different data segregation strategy in the previous step, or connect a new database in the Database settings before proceeding. Metabase connects to more than 15 popular databases.",+ )+ .should("be.visible");++ cy.log("should show add database button");+ H.main()+ .findByRole("link", { name: "Add database" })+ .should("have.attr", "href", "/admin/databases/create");+ });++ 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");++ H.main()+ .findByRole("radio", { name: /Connection impersonation/ })+ .scrollIntoView()+ .click();++ H.main()+ .findByRole("button", { name: "Use connection impersonation" })+ .scrollIntoView()+ .click();++ cy.log("open the database picker dropdown");+ H.main().findByPlaceholderText("Pick a database").click();++ H.popover().findByText("Sample Database").should("be.visible");++ cy.log(+ "sample database should have the info icon (does not support connection impersonation)",+ );+ H.popover()+ .findByText("Sample Database")+ .parent()+ .icon("info")+ .should("exist");++ H.popover().findByText("QA Postgres12").should("be.visible");++ cy.log(+ "postgres should not have the info icon (supports connection impersonation)",+ );+ H.popover()+ .findByText("QA Postgres12")+ .parent()+ .icon("info")+ .should("not.exist");++ cy.log("clicking disabled database should not close dropdown");+ H.popover().findByText("Sample Database").click();+ H.popover().should("be.visible");++ cy.log("hover over the info icon to see tooltip");+ H.popover()+ .findByText("Sample Database")+ .parent()+ .icon("info")+ .trigger("mouseenter");++ H.tooltip()+ .findByText("This database doesn't support connection impersonation")+ .should("be.visible");+ });++ it("creates a tenant with database_role attribute when using connection impersonation", () => {+ cy.visit("/admin/embedding/setup-guide/permissions");++ cy.log("select connection impersonation strategy");+ H.main()+ .findByRole("radio", { name: /Connection impersonation/ })+ .scrollIntoView()+ .click();++ H.main()+ .findByRole("button", { name: "Use connection impersonation" })+ .scrollIntoView()+ .click();++ cy.log("navigate to create tenants step");+ H.main().findByRole("listitem", { name: "Create tenants" }).click();++ cy.log("fill out the tenant form");+ H.main().within(() => {+ cy.findByPlaceholderText("Tenant name").clear().type("Acme Corp");+ cy.findByPlaceholderText("tenant_role").type("acme_role");+ cy.findByPlaceholderText("tenant-slug").clear().type("acme-corp");+ });++ H.main().findByRole("button", { name: "Create tenants" }).click();++ cy.log("success toast should show");+ H.undoToast()+ .findByText("Tenants created successfully")+ .should("be.visible");++ cy.log("tenant should have database_role attribute");+ cy.request("GET", "/api/ee/tenant").should((response) => {+ const tenantBySlug = response.body.data.find(+ (tenant: { slug: string }) => tenant.slug === "acme-corp",+ );++ expect(tenantBySlug.attributes).to.deep.equal({+ database_role: "acme_role",+ });+ });++ cy.log("data permissions description should show in summary");+ H.main()+ .contains(+ "All users in Acme Corp will connect using the acme_role database role.",+ )+ .should("be.visible");+ });+ });++ describe("database routing create tenants step", () => {+ beforeEach(() => {+ H.restore("setup");+ cy.signInAsAdmin();+ H.activateToken("bleeding-edge");++ H.updateSetting("use-tenants", true);++ cy.request("POST", "/api/collection", {+ name: "Shared collection",+ namespace: "shared-tenant-collection",+ });+ });++ it("creates a tenant with database_slug attribute when using database routing", () => {+ cy.visit("/admin/embedding/setup-guide/permissions");++ cy.log("select database routing strategy");+ H.main()+ .findByRole("radio", { name: /Database routing/ })+ .scrollIntoView()+ .click();++ H.main()+ .findByRole("button", { name: "Use database routing" })+ .scrollIntoView()+ .click();++ cy.log("navigate to create tenants step");+ H.main().findByRole("listitem", { name: "Create tenants" }).click();++ cy.log("fill out the tenant form");+ H.main().within(() => {+ cy.findByPlaceholderText("Tenant name").clear().type("Acme Corp");+ cy.findByPlaceholderText("tenant-db-slug").type("acme-db");+ cy.findByPlaceholderText("tenant-slug").clear().type("acme-corp");+ });++ H.main().findByRole("button", { name: "Create tenants" }).click();++ cy.log("success toast should show");+ H.undoToast()+ .findByText("Tenants created successfully")+ .should("be.visible");++ cy.log("tenant should have database_slug attribute");+ cy.request("GET", "/api/ee/tenant").should((response) => {+ const tenantBySlug = response.body.data.find(+ (tenant: { slug: string }) => tenant.slug === "acme-corp",+ );++ expect(tenantBySlug.attributes).to.deep.equal({+ database_slug: "acme-db",+ });+ });++ cy.log("data permissions description should show in summary");+ H.main()+ .contains(+ "All users in Acme Corp will be routed to the acme-db database.",+ )+ .should("be.visible");+ });+ });++ describe("sso setup sub-checklist", () => {+ beforeEach(() => {+ H.restore("setup");+ cy.signInAsAdmin();+ H.activateToken("pro-cloud");+ });++ it("disables the Enable JWT button when IdP URI is empty", () => {+ cy.visit("/admin/embedding/setup-guide/sso");++ cy.findByLabelText(/JWT Identity Provider URI/i)+ .should("be.visible")+ .should("be.empty");++ H.main()+ .findByRole("button", {+ name: "Enable JWT authentication and continue",+ })+ .should("be.visible")+ .should("be.disabled");+ });++ it("can configure JWT auth and complete SSO setup", () => {+ cy.visit("/admin/embedding/setup-guide/sso");++ cy.log("no steps should be completed initially");+ H.main().icon("check").should("not.exist");++ cy.log("step 1: enable JWT");+ H.main().within(() => {+ cy.findByLabelText(/JWT Identity Provider URI/i)+ .should("be.visible")+ .type("https://jwt.example.com/auth");++ cy.findByRole("button", {+ name: "Enable JWT authentication and continue",+ }).click();+ });++ cy.log("JWT should be enabled");+ 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",+ );+ expect(body["jwt-shared-secret"]).to.be.a("string");+ expect(body["jwt-group-sync"]).to.equal(true);+ });++ cy.log("step 1 should be complete");+ H.main()+ .findByRole("listitem", { name: "Set up JWT authentication" })+ .should("have.attr", "data-completed", "true");++ cy.log("valid signing key should be shown");+ H.main().within(() => {+ cy.findByLabelText(/JWT Signing Key/i)+ .should("be.visible")+ .should("have.attr", "value")+ .and("have.length.at.least", 32);++ cy.findByRole("button", { name: "Next" }).click();+ });++ cy.log("step 2 should be complete");+ H.main()+ .findByRole("listitem", { name: "Add a new endpoint to your app" })+ .should("have.attr", "data-completed", "true");++ cy.log("step 3: confirm login works");+ H.main().within(() => {+ cy.findByText("Try logging in with SSO. Did it work?").should(+ "be.visible",+ );++ cy.findByRole("link", { name: "Log in works, I'm done" }).click();+ });++ cy.log("should go back to setup guide");+ cy.url().should("include", "/admin/embedding/setup-guide");+ 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")+ .scrollIntoView()+ .findByText("Done", { timeout: 10_000 })+ .should("be.visible");++ cy.log("'Embed in production with SSO' should now be unlocked");+ cy.findByTestId("admin-layout-content")+ .findByText("Embed in production with SSO")+ .scrollIntoView()+ .should("be.visible")+ .closest("button")+ .icon("lock")+ .should("not.exist");+ });+ });++ it("shows /help-premium troubleshooting link for pro-cloud plan in sso setup", () => {+ H.restore("setup");+ cy.signInAsAdmin();+ H.activateToken("pro-cloud");++ cy.log("enable JWT");+ cy.request("PUT", "/api/setting", {+ "jwt-enabled": true,+ "jwt-identity-provider-uri": "https://jwt.example.com/auth",+ "jwt-shared-secret": "0".repeat(64),+ });++ cy.visit("/admin/embedding/setup-guide/sso");++ cy.log("step 1 should be marked as done");+ H.main()+ .findByRole("listitem", {+ name: "Set up JWT authentication",+ timeout: 10_000,+ })+ .should("have.attr", "data-completed", "true");++ cy.log("navigate to step 3");+ H.main()+ .findByRole("listitem", {+ name: "Test that JWT authentication is working correctly",+ })+ .click();++ cy.log("click troubleshooting button");+ H.main().findByRole("button", { name: "No, I couldn't log in" }).click();++ cy.log("troubleshooting view should be shown");+ H.main().findByText("Troubleshooting").should("be.visible");++ cy.log("help link should point to /help-premium");+ H.main()+ .findByRole("link", { name: "Contact customer support" })+ .should("have.attr", "href")+ .and("include", "metabase.com/help-premium");});});diff --git a/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/guest-embed-ee.cy.spec.ts b/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/guest-embed-ee.cy.spec.tsindex e4562fcfcbb..61a1e965bfc 100644--- a/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/guest-embed-ee.cy.spec.ts+++ b/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/guest-embed-ee.cy.spec.ts@@ -404,7 +404,10 @@ describe("scenarios > embedding > sdk iframe embed setup > guest-embed", () => {cy.findByText("Get code").click();codeBlock().first().should("contain", "dashboard-id=");- codeBlock().first().should("contain", "hidden-parameters=");++ // hiddenParameters is reset to [] when switching from guest to SSO mode,+ // so hidden-parameters= should not appear in the code.+ codeBlock().first().should("not.contain", "hidden-parameters=");codeBlock().first().should("not.contain", "token=");codeBlock().first().should("not.contain", "locked-parameters=");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 fa004c2238b..5ccb3fde423 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@@ -1,3 +1,4 @@+import { SAMPLE_DATABASE } from "e2e/support/cypress_sample_database";import {ORDERS_BY_YEAR_QUESTION_ID,ORDERS_COUNT_QUESTION_ID,@@ -80,17 +81,22 @@ describe(suiteTitle, () => {cy.findByText("Next").click();cy.findByText("Select a dashboard to embed").should("be.visible");- cy.log("first dashboard should be selected by default");+ // see the "shows recently created dashboard at the top of the list (EMB-1179)"+ // test below for why we prioritize new dashboards+ cy.log(+ "recently created dashboard should be selected by default (EMB-1179)",+ );getRecentItemCards().should("have.length", 2).first()+ .should("contain", SECOND_DASHBOARD_NAME).should("have.attr", "data-selected", "true");cy.findByText(FIRST_DASHBOARD_NAME).should("be.visible");cy.findByText(SECOND_DASHBOARD_NAME).should("be.visible");- cy.log("second dashboard can be selected");- cy.findByText(SECOND_DASHBOARD_NAME).click();+ cy.log("a different dashboard can be selected");+ cy.findByText(FIRST_DASHBOARD_NAME).click();getRecentItemCards().eq(1).should("have.attr", "data-selected", "true");});@@ -98,7 +104,7 @@ describe(suiteTitle, () => {cy.log("selected dashboard should be shown in the preview");cy.wait("@dashboard");H.getSimpleEmbedIframeContent().within(() => {- cy.findByText(SECOND_DASHBOARD_NAME).should("be.visible");+ cy.findByText(FIRST_DASHBOARD_NAME).should("be.visible");});cy.log(@@ -275,6 +281,14 @@ describe(suiteTitle, () => {recents: [],}).as("emptyRecentItems");+ // The embed wizard calls the search API to find recently created+ // dashboards. Without this, the snapshot's admin-owned dashboards+ // would be returned and selected as the default.+ cy.log("simulate that there are no recently created dashboards");+ cy.intercept("GET", "/api/search?*", { data: [], total: 0 }).as(+ "emptySearch",+ );+visitNewEmbedPage();cy.wait("@emptyRecentItems");});@@ -349,3 +363,58 @@ const logRecent = (model: "dashboard" | "card", modelId: number | string) =>model: model,model_id: modelId,});++describe("recently created dashboards", () => {+ beforeEach(() => {+ H.restore();+ cy.signInAsAdmin();+ H.activateToken("bleeding-edge");+ H.updateSetting("enable-embedding-simple", true);++ cy.intercept("GET", "/api/dashboard/**").as("dashboard");+ cy.intercept("GET", "/api/activity/recents?*").as("recentActivity");+ cy.intercept("GET", "/api/search?*").as("searchQuery");++ mockEmbedJsToDevServer();+ });++ // When using x-rays to create your first dashboard in the onboarding+ // flow, user expects that to be the default for the wizard,+ // even if they have never visited that dashboard before.+ it("shows recently created dashboard at the top of the list (EMB-1179)", () => {+ const { ORDERS_ID } = SAMPLE_DATABASE;++ cy.log("simulate existing recent activity");+ logRecent("dashboard", ORDERS_DASHBOARD_ID);++ cy.log("create a dashboard via x-ray");+ cy.visit(`/auto/dashboard/table/${ORDERS_ID}`);+ H.main()+ .findByText("Total transactions", { timeout: 10_000 })+ .should("be.visible");++ cy.button("Save this").click();+ H.undoToast().should("contain", "Your dashboard was saved");++ visitNewEmbedPage();++ getEmbedSidebar().within(() => {+ cy.findByText("Next").click();+ cy.findByText("Select a dashboard to embed").should("be.visible");++ cy.log(+ "recently created dashboard should show up even though it was never viewed",+ );+ const XRAY_DASHBOARD_NAME = "A look at Orders";+ cy.findByText(XRAY_DASHBOARD_NAME, { timeout: 10_000 }).should(+ "be.visible",+ );++ cy.log("the x-ray dashboard should be selected by default");+ getRecentItemCards()+ .first()+ .should("contain", XRAY_DASHBOARD_NAME)+ .should("have.attr", "data-selected", "true");+ });+ });+});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 1a0b9e3d33b..1b3e5b3456b 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@@ -158,6 +158,14 @@ describe(suiteTitle, () => {cy.intercept("GET", "/api/activity/recents?*", { recents: [] }).as("emptyRecentItems",);++ // The embed wizard calls the search API to find recently created+ // dashboards. Without this, the snapshot's admin-owned dashboards+ // would be returned and selected as the default.+ cy.log("simulate that there are no recently created dashboards");+ cy.intercept("GET", "/api/search?*", { data: [], total: 0 }).as(+ "emptySearch",+ );});it("shows dashboard of id=1 when activity log is empty", () => {diff --git a/enterprise/backend/src/metabase_enterprise/embedding_hub/api.clj b/enterprise/backend/src/metabase_enterprise/embedding_hub/api.cljindex ce5ba948f4c..90d7121e6db 100644--- a/enterprise/backend/src/metabase_enterprise/embedding_hub/api.clj+++ b/enterprise/backend/src/metabase_enterprise/embedding_hub/api.clj@@ -53,21 +53,85 @@:where [:= :is_sample true]}]][:is :collection_id nil]]]}))+(defn- has-user-created-tenants? []+ (t2/exists? :model/Tenant :is_active true))++(defn- has-shared-tenant-collections? []+ (t2/exists? :model/Collection {:where [:and+ [:= :namespace "shared-tenant-collection"]+ [:= :archived false]]}))++(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?)+ (t2/exists? :model/ConnectionImpersonation)+ (t2/exists? :model/DatabaseRouter)))++(defn- active-data-segregation-strategy []+ (cond+ (has-configured-sandboxes?) "row-column-level-security"+ (t2/exists? :model/ConnectionImpersonation) "connection-impersonation"+ (t2/exists? :model/DatabaseRouter) "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 (t2/exists? :model/Card :enable_embedding true)+ (t2/exists? :model/Dashboard :enable_embedding true)))+(defn- 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" (embedding.settings/embedding-hub-test-embed-snippet-created)- "embed-production" (embedding.settings/embedding-hub-production-embed-snippet-created)- "secure-embeds" (has-configured-sso?)- "setup-tenants" (perms/use-tenants)})--;; TODO (Cam 2025-11-25) please add a response schema to this API endpoint, it makes it easier for our customers to-;; use our API + we will need it when we make auto-TypeScript-signature generation happen-;;-#_{:clj-kondo/ignore [:metabase/validate-defendpoint-has-response-schema]}-(api.macros/defendpoint :get "/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?+ "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]+ ["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))diff --git a/enterprise/backend/test/metabase_enterprise/embedding_hub/api_test.clj b/enterprise/backend/test/metabase_enterprise/embedding_hub/api_test.cljindex 331a4c22dd8..9f066ec59fa 100644--- a/enterprise/backend/test/metabase_enterprise/embedding_hub/api_test.clj+++ b/enterprise/backend/test/metabase_enterprise/embedding_hub/api_test.clj@@ -31,12 +31,140 @@: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? (:create-models response))+ (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? (:create-models response))+ (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")]+ (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")]+ (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")]+ (is (false? (get-in response [:checklist :create-tenants])))))))++(deftest has-configured-data-segregation-strategy-test+ (testing "setup-data-segregation-strategy returns true when row-level security is 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")]+ (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}+ (mt/with-temp [:model/PermissionsGroup {group-id :id} {}+ :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")]+ (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")]+ (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")]+ (is (false? (get-in response [:checklist :setup-data-segregation-strategy])))))))++(deftest enable-tenants-requires-shared-collection-test+ (testing "enable-tenants returns true when use-tenants is true AND shared tenant collections exist"+ (mt/with-premium-features #{:embedding :tenants}+ (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")]+ (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")]+ (is (false? (get-in response [:checklist :enable-tenants]))))))))++(deftest data-permissions-and-enable-tenants-test+ (testing "data-permissions-and-enable-tenants returns true when all three conditions are met"+ (mt/with-premium-features #{:embedding :sandboxes :tenants}+ (mt/with-temporary-setting-values [use-tenants true]+ (mt/with-temp [:model/Collection _ {:name "Shared collection"+ :namespace "shared-tenant-collection"}+ :model/Tenant _ {:name "Test Tenant" :slug "test-tenant"}+ :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")]+ (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}+ (mt/with-temporary-setting-values [use-tenants true]+ (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")]+ (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}+ (mt/with-temporary-setting-values [use-tenants true]+ (mt/with-temp [:model/Collection _ {:name "Shared collection"+ :namespace "shared-tenant-collection"}+ :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")]+ (is (false? (get-in response [:checklist :data-permissions-and-enable-tenants])))))))))++(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")]+ (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")]+ (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}+ (mt/with-temp [:model/PermissionsGroup {group-id :id} {}+ :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")]+ (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")]+ (is (= "database-routing" (:data-isolation-strategy response))))))))diff --git a/enterprise/frontend/src/metabase-enterprise/api/tenants.ts b/enterprise/frontend/src/metabase-enterprise/api/tenants.tsindex e5fb3d0e099..a4f07b6f6aa 100644--- a/enterprise/frontend/src/metabase-enterprise/api/tenants.ts+++ b/enterprise/frontend/src/metabase-enterprise/api/tenants.ts@@ -15,7 +15,11 @@ export const tenantsApi = EnterpriseApi.injectEndpoints({url: "/api/ee/tenant",body,}),- invalidatesTags: (_, error) => invalidateTags(error, [listTag("tenant")]),+ invalidatesTags: (_, error) =>+ invalidateTags(error, [+ listTag("tenant"),+ listTag("embedding-hub-checklist"),+ ]),}),getTenant: builder.query<Tenant, Tenant["id"]>({query: (id) => ({diff --git a/enterprise/frontend/src/metabase-enterprise/tenants/components/CreateTenantsOnboardingStep/CreateTenantsOnboardingStep.module.css b/enterprise/frontend/src/metabase-enterprise/tenants/components/CreateTenantsOnboardingStep/CreateTenantsOnboardingStep.module.cssnew file mode 100644index 00000000000..2e97b661160--- /dev/null+++ b/enterprise/frontend/src/metabase-enterprise/tenants/components/CreateTenantsOnboardingStep/CreateTenantsOnboardingStep.module.css@@ -0,0 +1,4 @@+.TenantNameInput {+ font-size: var(--mantine-font-size-lg);+ padding: 0 var(--mantine-spacing-md);+}diff --git a/enterprise/frontend/src/metabase-enterprise/tenants/components/CreateTenantsOnboardingStep/CreateTenantsOnboardingStep.tsx b/enterprise/frontend/src/metabase-enterprise/tenants/components/CreateTenantsOnboardingStep/CreateTenantsOnboardingStep.tsxnew file mode 100644index 00000000000..f7e3660bed2--- /dev/null+++ b/enterprise/frontend/src/metabase-enterprise/tenants/components/CreateTenantsOnboardingStep/CreateTenantsOnboardingStep.tsx@@ -0,0 +1,243 @@+import { useCallback, useState } from "react";+import { t } from "ttag";++import { getErrorMessage } from "metabase/api/utils";+import { useToast } from "metabase/common/hooks";+import type { DataSegregationStrategy } from "metabase/embedding/embedding-hub";+import { slugify } from "metabase/lib/formatting";+import type { CreatedTenantData } from "metabase/plugins/oss/tenants";+import {+ Button,+ Flex,+ Group,+ Icon,+ Paper,+ Stack,+ Text,+ TextInput,+} from "metabase/ui";+import type { FieldId } from "metabase-types/api";++import { useCreateTenantMutation } from "../../../api/tenants";++import S from "./CreateTenantsOnboardingStep.module.css";+import { TenantIdentifierInput } from "./TenantIdentifierInput";+import { getIsolationFieldConfig } from "./isolation-field-config";++export const CreateTenantsOnboardingStep = ({+ onTenantsCreated,+ selectedFieldIds,+ strategy,+ rlsColumnName,+}: {+ onTenantsCreated?: (tenants: CreatedTenantData[]) => void;+ selectedFieldIds?: FieldId[];+ strategy?: DataSegregationStrategy | null;+ rlsColumnName?: string | null;+}) => {+ const [sendToast] = useToast();++ const [createTenant, { isLoading }] = useCreateTenantMutation();++ const [tenants, setTenants] = useState<CreatedTenantData[]>([+ createEmptyTenant(1),+ ]);++ const addTenantCard = useCallback(() => {+ setTenants((prev) => [...prev, createEmptyTenant(prev.length + 1)]);+ }, []);++ const updateTenantCard = useCallback(+ (index: number, field: keyof CreatedTenantData, value: string) => {+ setTenants((prev) =>+ prev.map((tenant, i) => {+ if (i !== index) {+ return tenant;+ }++ const updated = { ...tenant, [field]: value };++ // re-generate slug when name changes+ if (field === "name") {+ updated.slug = slugify(value).replaceAll("_", "-");+ }++ return updated;+ }),+ );+ },+ [],+ );++ const removeTenantCard = useCallback((index: number) => {+ setTenants((prev) => prev.filter((_, i) => i !== index));+ }, []);++ const fieldConfig = getIsolationFieldConfig(strategy);++ const handleCreateTenants = useCallback(async () => {+ try {+ // Create all tenants sequentially+ for (const tenant of tenants) {+ const attributes =+ fieldConfig && tenant.dataIsolationFieldValue+ ? { [fieldConfig.attributeKey]: tenant.dataIsolationFieldValue }+ : {};++ await createTenant({+ name: tenant.name,+ slug: tenant.slug,+ attributes,+ }).unwrap();+ }++ sendToast({+ icon: "check",+ toastColor: "success",+ message: t`Tenants created successfully`,+ });++ // Pass the created tenants to the parent+ onTenantsCreated?.(tenants);+ } catch (error) {+ sendToast({+ icon: "warning",+ toastColor: "error",+ message: getErrorMessage(error, t`Failed to create tenants`),+ });+ }+ }, [tenants, fieldConfig, createTenant, sendToast, onTenantsCreated]);++ const isValid = tenants.every(+ (tenant) =>+ tenant.name.trim() &&+ tenant.slug.trim() &&+ tenant.dataIsolationFieldValue.trim(),+ );++ return (+ <Stack gap="md">+ <Stack gap="md">+ {tenants.map((tenant, index) => (+ <Paper key={index} withBorder p="md" radius="md">+ <Stack gap="md">+ <Group justify="space-between" align="flex-start">+ <TextInput+ value={tenant.name}+ onChange={(e) =>+ updateTenantCard(index, "name", e.target.value)+ }+ placeholder={t`Tenant name`}+ flex={1}+ fw="bold"+ classNames={{ input: S.TenantNameInput }}+ />+ {tenants.length > 1 && (+ <Button+ variant="subtle"+ color="text-secondary"+ p={0}+ onClick={() => removeTenantCard(index)}+ aria-label={t`Remove tenant`}+ >+ <Icon name="close" size={16} />+ </Button>+ )}+ </Group>++ <TenantFormField+ label={t`Tenant slug`}+ description={t`Can't be changed later. Used to reference tenants via API and SSO.`}+ value={tenant.slug}+ onChange={(value) => updateTenantCard(index, "slug", value)}+ placeholder="tenant-slug"+ />++ {strategy === "row-column-level-security" && (+ <TenantIdentifierInput+ value={tenant.dataIsolationFieldValue}+ onChange={(value) =>+ updateTenantCard(index, "dataIsolationFieldValue", value)+ }+ selectedFieldIds={selectedFieldIds}+ columnName={rlsColumnName}+ />+ )}++ {(strategy === "connection-impersonation" ||+ strategy === "database-routing") &&+ fieldConfig && (+ <TenantFormField+ label={fieldConfig.label}+ description={fieldConfig.description}+ value={tenant.dataIsolationFieldValue}+ onChange={(value) =>+ updateTenantCard(index, "dataIsolationFieldValue", value)+ }+ placeholder={fieldConfig.placeholder}+ />+ )}+ </Stack>+ </Paper>+ ))}+ </Stack>++ <Flex justify="space-between" align="center">+ <Button+ variant="subtle"+ leftSection={<Icon name="add" size={16} />}+ onClick={addTenantCard}+ p={0}+ fw="bold"+ >+ {t`New tenant`}+ </Button>++ <Button+ variant="filled"+ onClick={handleCreateTenants}+ loading={isLoading}+ disabled={!isValid}+ >+ {t`Create tenants`}+ </Button>+ </Flex>+ </Stack>+ );+};++const TenantFormField = ({+ label,+ description,+ value,+ onChange,+ placeholder,+}: {+ label: string;+ description: string;+ value: string;+ onChange: (value: string) => void;+ placeholder: string;+}) => (+ <Stack gap="xs">+ <Text fw="bold" size="sm">+ {label}+ </Text>++ <Text c="text-secondary" size="xs" mb="sm">+ {description}+ </Text>++ <TextInput+ value={value}+ onChange={(e) => onChange(e.target.value)}+ placeholder={placeholder}+ />+ </Stack>+);++const createEmptyTenant = (index: number): CreatedTenantData => ({+ name: `Tenant ${index}`,+ dataIsolationFieldValue: "",+ slug: `tenant-${index}`,+});diff --git a/enterprise/frontend/src/metabase-enterprise/tenants/components/CreateTenantsOnboardingStep/TenantIdentifierInput.tsx b/enterprise/frontend/src/metabase-enterprise/tenants/components/CreateTenantsOnboardingStep/TenantIdentifierInput.tsxnew file mode 100644index 00000000000..3d9d9ff385c--- /dev/null+++ b/enterprise/frontend/src/metabase-enterprise/tenants/components/CreateTenantsOnboardingStep/TenantIdentifierInput.tsx@@ -0,0 +1,57 @@+import { c, jt, t } from "ttag";++import { Autocomplete, Stack, Text } from "metabase/ui";+import type { FieldId } from "metabase-types/api";++import { useFieldDistinctValues } from "./hooks/use-field-distinct-values";+import { getIsolationFieldConfig } from "./isolation-field-config";++export const TenantIdentifierInput = ({+ value,+ onChange,+ selectedFieldIds,+ columnName,+}: {+ value: string;+ onChange: (value: string) => void;+ selectedFieldIds?: FieldId[];+ columnName?: string | null;+}) => {+ // Fetch value from first field only.+ // We expect all tables to share the same multi-tenancy column,+ // and they should share the same tenant_id values.+ const firstFieldId = selectedFieldIds?.[0];++ const { values: suggestions } = useFieldDistinctValues(firstFieldId);++ const config = getIsolationFieldConfig("row-column-level-security")!;++ const placeholder = suggestions[0]+ ? c("example tenant identifier value from the database")+ .t`e.g. ${suggestions[0]}`+ : c("example tenant identifier value").t`e.g. acme-corp`;++ const description = columnName+ ? jt`Enter a value that matches the ${(<strong key="col">{columnName}</strong>)} column.`+ : config.description;++ return (+ <Stack gap="xs">+ <Text fw="bold" size="sm">+ {config.label}+ </Text>++ <Text c="text-secondary" size="xs" mb="sm">+ {description}+ </Text>++ <Autocomplete+ value={value}+ onChange={onChange}+ data={suggestions}+ placeholder={placeholder}+ aria-label={t`organization_id`}+ />+ </Stack>+ );+};diff --git a/enterprise/frontend/src/metabase-enterprise/tenants/components/CreateTenantsOnboardingStep/hooks/use-field-distinct-values.ts b/enterprise/frontend/src/metabase-enterprise/tenants/components/CreateTenantsOnboardingStep/hooks/use-field-distinct-values.tsnew file mode 100644index 00000000000..254daee07b5--- /dev/null+++ b/enterprise/frontend/src/metabase-enterprise/tenants/components/CreateTenantsOnboardingStep/hooks/use-field-distinct-values.ts@@ -0,0 +1,70 @@+import { useMemo } from "react";++import {+ skipToken,+ useGetAdhocQueryQuery,+ useGetFieldQuery,+} from "metabase/api";+import type { FieldId, LocalFieldReference } from "metabase-types/api";++/** How many distinct values to fetch from the field. */+const DISTINCT_VALUES_LIMIT = 100;++/**+ * Fetch distinct values for a field by running an ad-hoc query.+ * This is used for autocompleting multi-tenancy column values.+ *+ * We intentionally use an ad-hoc query instead of `useGetFieldValuesQuery`.+ * The field values API only returns pre-scanned values.+ * During onboarding the cache is empty and we need fresh values.+ */+export function useFieldDistinctValues(fieldId: FieldId | undefined) {+ const { data: field, isLoading: isFieldLoading } = useGetFieldQuery(+ fieldId != null+ ? { id: fieldId, include_editable_data_model: true }+ : skipToken,+ );++ const tableId = field?.table_id;+ const databaseId = field?.table?.db_id;++ const query = useMemo(() => {+ if (fieldId == null || tableId == null || databaseId == null) {+ return null;+ }++ const breakout = [+ ["field", fieldId, null],+ ] as const satisfies LocalFieldReference[];++ return {+ database: databaseId,+ type: "query" as const,+ query: {+ "source-table": tableId,+ breakout,+ limit: DISTINCT_VALUES_LIMIT,+ },+ ignore_error: true,+ };+ }, [fieldId, tableId, databaseId]);++ const { data: adhocQueryDataset, isLoading: isAdHocQueryLoading } =+ useGetAdhocQueryQuery(query ?? skipToken);++ // Extract row values from query results+ const values = useMemo(() => {+ if (!adhocQueryDataset?.data?.rows) {+ return [];+ }++ return adhocQueryDataset.data.rows+ .map(([rowValue]) => (rowValue != null ? String(rowValue) : null))+ .filter((rowValue): rowValue is string => rowValue !== null);+ }, [adhocQueryDataset]);++ return {+ values,+ isLoading: isFieldLoading || isAdHocQueryLoading,+ };+}diff --git a/enterprise/frontend/src/metabase-enterprise/tenants/components/CreateTenantsOnboardingStep/hooks/use-field-distinct-values.unit.spec.tsx b/enterprise/frontend/src/metabase-enterprise/tenants/components/CreateTenantsOnboardingStep/hooks/use-field-distinct-values.unit.spec.tsxnew file mode 100644index 00000000000..3bb0c7069a9--- /dev/null+++ b/enterprise/frontend/src/metabase-enterprise/tenants/components/CreateTenantsOnboardingStep/hooks/use-field-distinct-values.unit.spec.tsx@@ -0,0 +1,98 @@+import { renderHook } from "@testing-library/react";++import {+ setupCardDataset,+ setupFieldEndpoints,+} from "__support__/server-mocks";+import { waitFor } from "__support__/ui";+import { MetabaseReduxProvider } from "metabase/lib/redux";+import { mainReducers as reducers } from "metabase/reducers-main";+import { getStore } from "metabase/store";+import type { FieldId, RowValue } from "metabase-types/api";+import { createMockField, createMockTable } from "metabase-types/api/mocks";+import { createMockState } from "metabase-types/store/mocks";++import { useFieldDistinctValues } from "./use-field-distinct-values";++interface SetupOpts {+ fieldId: FieldId | undefined;+ rows?: RowValue[][];+}++function setup({ fieldId, rows }: SetupOpts) {+ if (fieldId != null) {+ const field = createMockField({+ id: fieldId,+ table_id: 10,+ table: createMockTable({ id: 10, db_id: 100 }),+ });++ setupFieldEndpoints(field);++ if (rows) {+ setupCardDataset({ data: { rows } });+ }+ }++ const store = getStore(reducers, undefined, createMockState());++ function Wrapper({ children }: { children: React.ReactNode }) {+ return (+ <MetabaseReduxProvider store={store}>{children}</MetabaseReduxProvider>+ );+ }++ const { result } = renderHook(() => useFieldDistinctValues(fieldId), {+ wrapper: Wrapper,+ });++ return result;+}++describe("useFieldDistinctValues", () => {+ it("returns distinct values from ad-hoc query", async () => {+ const result = setup({+ fieldId: 1,+ rows: [["tenant_a"], ["tenant_b"], ["tenant_c"]],+ });++ await waitFor(() => {+ expect(result.current.isLoading).toBe(false);+ });++ expect(result.current.values).toEqual(["tenant_a", "tenant_b", "tenant_c"]);+ });++ it("returns empty values when fieldId is undefined", async () => {+ const result = setup({ fieldId: undefined });++ expect(result.current.values).toEqual([]);+ expect(result.current.isLoading).toBe(false);+ });++ it("filters out null values from results", async () => {+ const result = setup({+ fieldId: 1,+ rows: [["tenant_a"], [null], ["tenant_b"], [null]],+ });++ await waitFor(() => {+ expect(result.current.isLoading).toBe(false);+ });++ expect(result.current.values).toEqual(["tenant_a", "tenant_b"]);+ });++ it("converts numeric values to strings", async () => {+ const result = setup({+ fieldId: 1,+ rows: [[1], [2], [3]],+ });++ await waitFor(() => {+ expect(result.current.isLoading).toBe(false);+ });++ expect(result.current.values).toEqual(["1", "2", "3"]);+ });+});diff --git a/enterprise/frontend/src/metabase-enterprise/tenants/components/CreateTenantsOnboardingStep/index.ts b/enterprise/frontend/src/metabase-enterprise/tenants/components/CreateTenantsOnboardingStep/index.tsnew file mode 100644index 00000000000..5ec74da88a2--- /dev/null+++ b/enterprise/frontend/src/metabase-enterprise/tenants/components/CreateTenantsOnboardingStep/index.ts@@ -0,0 +1 @@+export { CreateTenantsOnboardingStep } from "./CreateTenantsOnboardingStep";diff --git a/enterprise/frontend/src/metabase-enterprise/tenants/components/CreateTenantsOnboardingStep/isolation-field-config.ts b/enterprise/frontend/src/metabase-enterprise/tenants/components/CreateTenantsOnboardingStep/isolation-field-config.tsnew file mode 100644index 00000000000..7b06539d541--- /dev/null+++ b/enterprise/frontend/src/metabase-enterprise/tenants/components/CreateTenantsOnboardingStep/isolation-field-config.ts@@ -0,0 +1,37 @@+import { match } from "ts-pattern";+import { t } from "ttag";++import type { DataSegregationStrategy } from "metabase/embedding/embedding-hub";++export type IsolationFieldConfig = {+ /** The attribute key sent to the API, e.g. organization_id */+ attributeKey: string;++ label: string;+ description: string;+ placeholder: string;+};++export const getIsolationFieldConfig = (+ strategy: DataSegregationStrategy | null | undefined,+): IsolationFieldConfig | null =>+ match(strategy)+ .with("row-column-level-security", () => ({+ attributeKey: "organization_id",+ label: "organization_id",+ description: t`Users will only see rows where this matches the value in the column you selected.`,+ placeholder: "1",+ }))+ .with("connection-impersonation", () => ({+ attributeKey: "database_role",+ label: "database_role",+ description: t`Users will access data based on the privileges granted to this role in the database.`,+ placeholder: "tenant_role",+ }))+ .with("database-routing", () => ({+ attributeKey: "database_slug",+ label: "database_slug",+ description: t`Match a slug for a destination DB as defined in the data source's DB routing settings.`,+ placeholder: "tenant-db-slug",+ }))+ .otherwise(() => null);diff --git a/enterprise/frontend/src/metabase-enterprise/tenants/components/TenantsSummaryOnboardingStep/TenantSummaryCard.tsx b/enterprise/frontend/src/metabase-enterprise/tenants/components/TenantsSummaryOnboardingStep/TenantSummaryCard.tsxnew file mode 100644index 00000000000..ae7b06040bb--- /dev/null+++ b/enterprise/frontend/src/metabase-enterprise/tenants/components/TenantsSummaryOnboardingStep/TenantSummaryCard.tsx@@ -0,0 +1,70 @@+import type { ReactNode } from "react";+import { t } from "ttag";++import { Grid, Paper, Stack, Text, Title } from "metabase/ui";++export const TenantSummaryCard = ({+ name,+ slug,+ isolationFieldLabel,+ isolationFieldValue,+ dataPermissionsDescription,+}: {+ name: string;+ slug: string;+ isolationFieldLabel: string | null;+ isolationFieldValue: string | null;+ dataPermissionsDescription: ReactNode;+}) => {+ return (+ <Paper withBorder p="lg" radius="md">+ <Stack gap="md">+ <Title order={4} c="text-primary">+ {name}+ </Title>++ <Grid>+ {isolationFieldLabel && (+ <Grid.Col span={4}>+ <Stack gap={4}>+ <Text size="xs" c="text-secondary">+ {isolationFieldLabel}+ </Text>++ <Text size="sm" fw="bold" c="text-primary">+ {isolationFieldValue ?? "-"}+ </Text>+ </Stack>+ </Grid.Col>+ )}++ <Grid.Col span={4}>+ <Stack gap={4}>+ <Text size="xs" c="text-secondary">+ {t`Tenant slug`}+ </Text>++ <Text size="sm" fw="bold" c="text-primary">+ {slug}+ </Text>+ </Stack>+ </Grid.Col>++ {dataPermissionsDescription && (+ <Grid.Col span={4}>+ <Stack gap={4}>+ <Text size="xs" c="text-secondary">+ {t`Data permissions`}+ </Text>++ <Text size="sm" c="text-primary">+ {dataPermissionsDescription}+ </Text>+ </Stack>+ </Grid.Col>+ )}+ </Grid>+ </Stack>+ </Paper>+ );+};diff --git a/enterprise/frontend/src/metabase-enterprise/tenants/components/TenantsSummaryOnboardingStep/TenantsSummaryOnboardingStep.tsx b/enterprise/frontend/src/metabase-enterprise/tenants/components/TenantsSummaryOnboardingStep/TenantsSummaryOnboardingStep.tsxnew file mode 100644index 00000000000..cd3157fc17e--- /dev/null+++ b/enterprise/frontend/src/metabase-enterprise/tenants/components/TenantsSummaryOnboardingStep/TenantsSummaryOnboardingStep.tsx@@ -0,0 +1,189 @@+import type { ReactNode } from "react";+import { useMemo } from "react";+import { push } from "react-router-redux";+import { jt, msgid, ngettext, t } from "ttag";++import { RelatedSettingCard } from "metabase/admin/components/RelatedSettingsSection";+import type { DataSegregationStrategy } from "metabase/embedding/embedding-hub";+import { conjunct } from "metabase/lib/formatting/strings";+import { useDispatch } from "metabase/lib/redux";+import type { CreatedTenantData } from "metabase/plugins/oss/tenants";+import { Button, Flex, SimpleGrid, Stack, Text, Title } from "metabase/ui";++import { useListTenantsQuery } from "../../../api/tenants";+import { getIsolationFieldConfig } from "../CreateTenantsOnboardingStep/isolation-field-config";++import { TenantSummaryCard } from "./TenantSummaryCard";++/**+ * If the user has reloaded the page, we fetch the+ * latest tenants to show as a fallback.+ */+const MAX_FETCHED_TENANTS_TO_SHOW = 3;++const ISOLATION_ATTRIBUTE_KEYS = [+ "organization_id",+ "database_role",+ "database_slug",+] as const;++export const TenantsSummaryOnboardingStep = ({+ tenants,+ strategy,+ rlsTableNames = [],+ rlsColumnName = null,+}: {+ tenants: CreatedTenantData[];+ strategy?: DataSegregationStrategy | null;+ rlsTableNames?: string[];+ rlsColumnName?: string | null;+}) => {+ const dispatch = useDispatch();++ const { data: tenantsData } = useListTenantsQuery(+ { status: "active" },+ { skip: tenants.length > 0 },+ );++ const onDone = () => dispatch(push("/admin/embedding/setup-guide"));++ const tenantsToShow = useMemo(() => {+ // If we have tenants from the flow, use them+ if (tenants.length > 0) {+ return tenants;+ }++ // Fallback to the last N tenants (most recently created are likely at the end)+ const lastTenants =+ tenantsData?.data?.slice(-MAX_FETCHED_TENANTS_TO_SHOW) ?? [];++ return lastTenants.map((tenant) => {+ // Detect which isolation attribute is set on the tenant+ const dataIsolationFieldKey = ISOLATION_ATTRIBUTE_KEYS.find(+ (key) => tenant.attributes?.[key] != null,+ );++ return {+ name: tenant.name,+ slug: tenant.slug,+ dataIsolationFieldValue:+ tenant.attributes?.[dataIsolationFieldKey ?? ""] ?? "",+ };+ });+ }, [tenants, tenantsData]);++ const fieldConfig = getIsolationFieldConfig(strategy);++ return (+ <Stack gap="lg">+ <Title order={3} c="text-primary">+ {t`You created the following tenants`}+ </Title>++ <Stack gap="md">+ {tenantsToShow.map((tenant) => (+ <TenantSummaryCard+ key={tenant.slug}+ name={tenant.name}+ isolationFieldLabel={+ tenant.dataIsolationFieldValue+ ? (fieldConfig?.label ?? null)+ : null+ }+ isolationFieldValue={tenant.dataIsolationFieldValue || null}+ slug={tenant.slug}+ dataPermissionsDescription={getDataPermissionsDescription({+ strategy,+ tenantName: tenant.name,+ tenantValue: tenant.dataIsolationFieldValue,+ tableNames: rlsTableNames,+ columnName: rlsColumnName,+ })}+ />+ ))}+ </Stack>++ <Text c="text-secondary" lh="lg">+ {t`If you need to change these settings, you can go back to the previous steps, or configure more details in the following pages.`}+ </Text>++ <RelatedSettingsSection />++ <Flex justify="flex-end">+ <Button variant="filled" onClick={onDone}>+ {t`Done`}+ </Button>+ </Flex>+ </Stack>+ );+};++const RelatedSettingsSection = () => (+ <SimpleGrid cols={2} spacing="md">+ <RelatedSettingCard+ name={t`Tenants`}+ icon="globe"+ to="/admin/people/tenants"+ />++ <RelatedSettingCard+ name={t`People`}+ icon="person"+ to="/admin/people/tenants/people"+ />++ <RelatedSettingCard+ name={t`Authentication`}+ icon="lock"+ to="/admin/settings/authentication"+ />++ <RelatedSettingCard+ name={t`Permissions`}+ icon="group"+ to="/admin/permissions"+ />+ </SimpleGrid>+);++export function getDataPermissionsDescription({+ strategy,+ tenantName,+ tenantValue,+ tableNames,+ columnName,+}: {+ strategy: DataSegregationStrategy | null | undefined;+ tenantName: string;+ tenantValue: string;+ tableNames: string[];+ columnName: string | null;+}): ReactNode {+ if (!tenantValue) {+ return null;+ }++ const boldName = <strong key="tenant">{tenantName}</strong>;+ const boldValue = <strong key="value">{tenantValue}</strong>;++ if (strategy === "row-column-level-security") {+ if (tableNames.length === 0 || !columnName) {+ return null;+ }++ const tableList = conjunct(tableNames, t`and`);+ const tableWord = ngettext(msgid`table`, `tables`, tableNames.length);++ return jt`All users in ${boldName} can view rows in the ${(<strong key="tables">{tableList}</strong>)} ${tableWord} where ${(<strong key="column">{columnName}</strong>)} field equals ${boldValue}.`;+ }++ if (strategy === "connection-impersonation") {+ return jt`All users in ${boldName} will connect using the ${boldValue} database role.`;+ }++ if (strategy === "database-routing") {+ return jt`All users in ${boldName} will be routed to the ${boldValue} database.`;+ }++ return null;+}diff --git a/enterprise/frontend/src/metabase-enterprise/tenants/components/TenantsSummaryOnboardingStep/TenantsSummaryOnboardingStep.unit.spec.ts b/enterprise/frontend/src/metabase-enterprise/tenants/components/TenantsSummaryOnboardingStep/TenantsSummaryOnboardingStep.unit.spec.tsnew file mode 100644index 00000000000..952915cf111--- /dev/null+++ b/enterprise/frontend/src/metabase-enterprise/tenants/components/TenantsSummaryOnboardingStep/TenantsSummaryOnboardingStep.unit.spec.ts@@ -0,0 +1,143 @@+import { type ReactNode, isValidElement } from "react";++import { getDataPermissionsDescription } from "./TenantsSummaryOnboardingStep";++type Input = Parameters<typeof getDataPermissionsDescription>[0];++const TENANT_NAME = "Acme Corp";+const TENANT_VALUE = "42";++const TEST_CASES: { name: string; input: Input; expected: string | null }[] = [+ {+ name: "RLS with one table",+ input: {+ strategy: "row-column-level-security",+ tenantName: TENANT_NAME,+ tenantValue: TENANT_VALUE,+ tableNames: ["Orders"],+ columnName: "company_id",+ },+ expected:+ "All users in Acme Corp can view rows in the Orders table where company_id field equals 42.",+ },+ {+ name: "RLS with two tables",+ input: {+ strategy: "row-column-level-security",+ tenantName: TENANT_NAME,+ tenantValue: TENANT_VALUE,+ tableNames: ["Orders", "Products"],+ columnName: "company_id",+ },+ expected:+ "All users in Acme Corp can view rows in the Orders and Products tables where company_id field equals 42.",+ },+ {+ name: "RLS with three tables (Oxford comma)",+ input: {+ strategy: "row-column-level-security",+ tenantName: TENANT_NAME,+ tenantValue: TENANT_VALUE,+ tableNames: ["Orders", "Products", "Reviews"],+ columnName: "company_id",+ },+ expected:+ "All users in Acme Corp can view rows in the Orders, Products, and Reviews tables where company_id field equals 42.",+ },+ {+ name: "RLS with empty tableNames → null",+ input: {+ strategy: "row-column-level-security",+ tenantName: TENANT_NAME,+ tenantValue: TENANT_VALUE,+ tableNames: [],+ columnName: "company_id",+ },+ expected: null,+ },+ {+ name: "RLS with null columnName → null",+ input: {+ strategy: "row-column-level-security",+ tenantName: TENANT_NAME,+ tenantValue: TENANT_VALUE,+ tableNames: ["Orders"],+ columnName: null,+ },+ expected: null,+ },+ {+ name: "connection-impersonation",+ input: {+ strategy: "connection-impersonation",+ tenantName: TENANT_NAME,+ tenantValue: "acme_role",+ tableNames: [],+ columnName: null,+ },+ expected:+ "All users in Acme Corp will connect using the acme_role database role.",+ },+ {+ name: "database-routing",+ input: {+ strategy: "database-routing",+ tenantName: TENANT_NAME,+ tenantValue: "acme-db",+ tableNames: [],+ columnName: null,+ },+ expected: "All users in Acme Corp will be routed to the acme-db database.",+ },+ {+ name: "empty tenantValue → null",+ input: {+ strategy: "connection-impersonation",+ tenantName: TENANT_NAME,+ tenantValue: "",+ tableNames: [],+ columnName: null,+ },+ expected: null,+ },+ {+ name: "unknown strategy → null",+ input: {+ strategy: null,+ tenantName: TENANT_NAME,+ tenantValue: TENANT_VALUE,+ tableNames: [],+ columnName: null,+ },+ expected: null,+ },+];++describe("getDataPermissionsDescription", () => {+ it.each(TEST_CASES)("$name", ({ input, expected }) => {+ expect(textFromReactNode(getDataPermissionsDescription(input))).toBe(+ expected,+ );+ });+});++/** Extracts plain text from a ReactNode, ignoring formatting elements. */+function textFromReactNode(node: ReactNode): string | null {+ if (node === null) {+ return null;+ }++ if (typeof node === "string" || typeof node === "number") {+ return String(node);+ }++ if (Array.isArray(node)) {+ return node.map((n) => textFromReactNode(n) ?? "").join("");+ }++ if (isValidElement(node)) {+ return textFromReactNode(node.props.children) ?? "";+ }++ return "";+}diff --git a/enterprise/frontend/src/metabase-enterprise/tenants/components/TenantsSummaryOnboardingStep/index.ts b/enterprise/frontend/src/metabase-enterprise/tenants/components/TenantsSummaryOnboardingStep/index.tsnew file mode 100644index 00000000000..8556803bd09--- /dev/null+++ b/enterprise/frontend/src/metabase-enterprise/tenants/components/TenantsSummaryOnboardingStep/index.ts@@ -0,0 +1 @@+export { TenantsSummaryOnboardingStep } from "./TenantsSummaryOnboardingStep";diff --git a/enterprise/frontend/src/metabase-enterprise/tenants/containers/NewTenantModal/NewTenantModal.tsx b/enterprise/frontend/src/metabase-enterprise/tenants/containers/NewTenantModal/NewTenantModal.tsxindex f71511024cd..fce33b2e1f7 100644--- a/enterprise/frontend/src/metabase-enterprise/tenants/containers/NewTenantModal/NewTenantModal.tsx+++ b/enterprise/frontend/src/metabase-enterprise/tenants/containers/NewTenantModal/NewTenantModal.tsx@@ -31,6 +31,7 @@ export const NewTenantModal = ({ onClose, location }: NewUserModalProps) => {...vals,name: vals.name ?? "",slug: vals.slug ?? "",+ attributes: vals.attributes ?? {},}).unwrap();dispatch(addUndo({ message: t`Tenant creation successful` }));onClose();diff --git a/enterprise/frontend/src/metabase-enterprise/tenants/index.tsx b/enterprise/frontend/src/metabase-enterprise/tenants/index.tsxindex 261d94538e1..450cacf2cf0 100644--- a/enterprise/frontend/src/metabase-enterprise/tenants/index.tsx+++ b/enterprise/frontend/src/metabase-enterprise/tenants/index.tsx@@ -33,6 +33,7 @@ import { hasPremiumFeature } from "metabase-enterprise/settings";import { EditUserStrategyModal } from "./EditUserStrategyModal";import { EditUserStrategySettingsButton } from "./EditUserStrategySettingsButton";import { CanAccessTenantSpecificRoute } from "./components/CanAccessTenantSpecificRoute";+import { CreateTenantsOnboardingStep } from "./components/CreateTenantsOnboardingStep";import { ExternalGroupDetailApp } from "./components/ExternalGroupDetailApp/ExternalGroupDetailApp";import { ExternalGroupsListingApp } from "./components/ExternalGroupsListingApp/ExternalGroupsListingApp";import { ExternalPeopleListingApp } from "./components/ExternalPeopleListingApp/ExternalPeopleListingApp";@@ -48,6 +49,7 @@ import { TenantSpecificCollectionPermissionsPage } from "./components/TenantSpecimport { TenantSpecificCollectionsItemList } from "./components/TenantSpecificCollectionsItemList";import { TenantUsersList } from "./components/TenantUsersList";import { TenantUsersPersonalCollectionList } from "./components/TenantUsersPersonalCollectionList";+import { TenantsSummaryOnboardingStep } from "./components/TenantsSummaryOnboardingStep";import { EditTenantModal } from "./containers/EditTenantModal";import { NewTenantModal } from "./containers/NewTenantModal";import { TenantActivationModal } from "./containers/TenantActivationModal";@@ -99,6 +101,8 @@ export function initializePlugin() {);PLUGIN_TENANTS.EditUserStrategyModal = EditUserStrategyModal;+ PLUGIN_TENANTS.CreateTenantsOnboardingStep = CreateTenantsOnboardingStep;+ PLUGIN_TENANTS.TenantsSummaryOnboardingStep = TenantsSummaryOnboardingStep;PLUGIN_TENANTS.userStrategyRoute = (<ModalRoute path="user-strategy" modal={EditUserStrategyModal} noWrap />diff --git a/frontend/src/metabase-types/api/mocks/settings.ts b/frontend/src/metabase-types/api/mocks/settings.tsindex b9acf024364..3b3c10c5c35 100644--- a/frontend/src/metabase-types/api/mocks/settings.ts+++ b/frontend/src/metabase-types/api/mocks/settings.ts@@ -401,6 +401,7 @@ export const createMockSettings = ("setup-license-active-at-setup": false,"embedding-hub-test-embed-snippet-created": false,"embedding-hub-production-embed-snippet-created": false,+ "embedding-hub-sso-auth-manual-tested": false,"notebook-native-preview-sidebar-width": null,"query-analysis-enabled": false,"check-for-updates": true,diff --git a/frontend/src/metabase-types/api/settings.ts b/frontend/src/metabase-types/api/settings.tsindex fa8d9d4593b..0cc2a991255 100644--- a/frontend/src/metabase-types/api/settings.ts+++ b/frontend/src/metabase-types/api/settings.ts@@ -500,6 +500,7 @@ interface AdminSettings {"setup-license-active-at-setup": boolean;"embedding-hub-test-embed-snippet-created": boolean;"embedding-hub-production-embed-snippet-created": boolean;+ "embedding-hub-sso-auth-manual-tested": boolean;"store-url": string;gsheets: Partial<GdrivePayload>;"license-token-missing-banner-dismissal-timestamp"?: Array<string>;@@ -749,6 +750,7 @@ export interface EnterpriseSettings extends Settings {"database-replication-connections"?: DatabaseReplicationConnections | null;"embedding-hub-test-embed-snippet-created": boolean;"embedding-hub-production-embed-snippet-created": boolean;+ "embedding-hub-sso-auth-manual-tested": boolean;"python-runner-url"?: string | null;"python-runner-api-token"?: string | null;"python-storage-s-3-endpoint"?: string | null;diff --git a/frontend/src/metabase-types/api/tenants.ts b/frontend/src/metabase-types/api/tenants.tsindex 6928ce2bc12..aa0ed3b6def 100644--- a/frontend/src/metabase-types/api/tenants.ts+++ b/frontend/src/metabase-types/api/tenants.ts@@ -10,7 +10,9 @@ export type Tenant = {tenant_collection_id: number | null;};-export type CreateTenantInput = Pick<Tenant, "name" | "slug">;+export type CreateTenantInput = Pick<Tenant, "name" | "slug"> & {+ attributes?: Tenant["attributes"];+};export type UpdateTenantInput = Pick<Tenant, "id"> &Partial<Pick<Tenant, "name" | "is_active">>;diff --git a/frontend/src/metabase/admin/components/RelatedSettingsSection/RelatedSettingsSection.tsx b/frontend/src/metabase/admin/components/RelatedSettingsSection/RelatedSettingsSection.tsxindex c10cadd0cf8..297b5a6f471 100644--- a/frontend/src/metabase/admin/components/RelatedSettingsSection/RelatedSettingsSection.tsx+++ b/frontend/src/metabase/admin/components/RelatedSettingsSection/RelatedSettingsSection.tsx@@ -39,7 +39,7 @@ export function RelatedSettingsSection({);}-const RelatedSettingCard = ({+export const RelatedSettingCard = ({icon,name,to,diff --git a/frontend/src/metabase/admin/components/RelatedSettingsSection/index.ts b/frontend/src/metabase/admin/components/RelatedSettingsSection/index.tsindex 6bc1f0926da..1ab4bbac33f 100644--- a/frontend/src/metabase/admin/components/RelatedSettingsSection/index.ts+++ b/frontend/src/metabase/admin/components/RelatedSettingsSection/index.ts@@ -1,4 +1,7 @@-export { RelatedSettingsSection } from "./RelatedSettingsSection";+export {+ RelatedSettingsSection,+ RelatedSettingCard,+} from "./RelatedSettingsSection";export {getModularEmbeddingRelatedSettingItems,diff --git a/frontend/src/metabase/admin/routes.tsx b/frontend/src/metabase/admin/routes.tsxindex 0e4022a3569..7de40372355 100644--- a/frontend/src/metabase/admin/routes.tsx+++ b/frontend/src/metabase/admin/routes.tsx@@ -40,7 +40,11 @@ import {ModelCachePage,ModelCacheRefreshJobModal,} from "metabase/admin/tools/components/ModelCacheRefreshJobs";-import { EmbeddingHubAdminSettingsPage } from "metabase/embedding/embedding-hub";+import {+ EmbeddingHubAdminSettingsPage,+ SetupPermissionsAndTenantsPage,+ SetupSsoPage,+} from "metabase/embedding/embedding-hub";import { ModalRoute } from "metabase/hoc/ModalRoute";import { getAdminRoutes as getMetabotAdminRoutes } from "metabase/metabot/components/MetabotAdmin/MetabotAdminPage";import { DataModelV1 } from "metabase/metadata/pages/DataModelV1";@@ -183,10 +187,16 @@ export const getRoutes = (<Route component={AdminEmbeddingApp}><IndexRoute component={EmbeddingSettings} />- <Route- path="setup-guide"- component={EmbeddingHubAdminSettingsPage}- />+ <Route path="setup-guide">+ <IndexRoute component={EmbeddingHubAdminSettingsPage} />++ <Route+ path="permissions"+ component={SetupPermissionsAndTenantsPage}+ />++ <Route path="sso" component={SetupSsoPage} />+ </Route>{/* EE with non-starter plan has embedding settings on different pages */}{hasSimpleEmbedding && (diff --git a/frontend/src/metabase/api/card.ts b/frontend/src/metabase/api/card.tsindex f8c8260c020..cf814642a42 100644--- a/frontend/src/metabase/api/card.ts+++ b/frontend/src/metabase/api/card.ts@@ -40,7 +40,9 @@ export const cardApi = Api.injectEndpoints({endpoints: (builder) => {const updateCardPropertiesMutation = <PropertyKey extends keyof UpdateCardRequest,- >() =>+ >(+ additionalTags: ReturnType<typeof listTag>[] = [],+ ) =>builder.mutation<Card, UpdateCardKeyRequest<PropertyKey>>({query: ({ id, ...body }) => ({method: "PUT",@@ -52,6 +54,7 @@ export const cardApi = Api.injectEndpoints({listTag("card"),idTag("card", id),idTag("table", `card__${id}`),+ ...additionalTags,]),});@@ -294,7 +297,7 @@ export const cardApi = Api.injectEndpoints({}),updateCardEnableEmbedding: updateCardPropertiesMutation<"enable_embedding" | "embedding_type"- >(),+ >([listTag("embedding-hub-checklist")]),updateCardEmbeddingParams: updateCardPropertiesMutation<"embedding_params" | "embedding_type">(),diff --git a/frontend/src/metabase/api/collection.ts b/frontend/src/metabase/api/collection.tsindex 9f4f9039ab9..9a42b8cb6c8 100644--- a/frontend/src/metabase/api/collection.ts+++ b/frontend/src/metabase/api/collection.ts@@ -87,13 +87,23 @@ export const collectionApi = Api.injectEndpoints({url: "/api/collection",body,}),- invalidatesTags: (collection, error) =>- collection- ? invalidateTags(error, [- listTag("collection"),- idTag("collection", collection.parent_id ?? "root"),- ])- : [],+ invalidatesTags: (collection, error, request) => {+ if (!collection) {+ return [];+ }++ const tags = [+ listTag("collection"),+ idTag("collection", collection.parent_id ?? "root"),+ ];++ // Creating a shared tenant collection affects the embedding hub checklist+ if (request.namespace === "shared-tenant-collection") {+ tags.push(listTag("embedding-hub-checklist"));+ }++ return invalidateTags(error, tags);+ },}),updateCollection: builder.mutation<Collection, UpdateCollectionRequest>({query: ({ id, ...body }) => ({diff --git a/frontend/src/metabase/api/dashboard.ts b/frontend/src/metabase/api/dashboard.tsindex 0f95a96f290..5700373b45b 100644--- a/frontend/src/metabase/api/dashboard.ts+++ b/frontend/src/metabase/api/dashboard.ts@@ -42,7 +42,9 @@ export const dashboardApi = Api.injectEndpoints({endpoints: (builder) => {const updateDashboardPropertiesMutation = <Key extends keyof UpdateDashboardRequest,- >() =>+ >(+ additionalTags: ReturnType<typeof listTag>[] = [],+ ) =>builder.mutation<Dashboard, UpdateDashboardPropertyRequest<Key>>({query: ({ id, ...body }) => ({method: "PUT",@@ -50,7 +52,11 @@ export const dashboardApi = Api.injectEndpoints({body,}),invalidatesTags: (_, error, { id }) =>- invalidateTags(error, [listTag("dashboard"), idTag("dashboard", id)]),+ invalidateTags(error, [+ listTag("dashboard"),+ idTag("dashboard", id),+ ...additionalTags,+ ]),});return {@@ -203,7 +209,7 @@ export const dashboardApi = Api.injectEndpoints({}),updateDashboardEnableEmbedding: updateDashboardPropertiesMutation<"enable_embedding" | "embedding_type"- >(),+ >([listTag("embedding-hub-checklist")]),updateDashboardEmbeddingParams: updateDashboardPropertiesMutation<"embedding_params" | "embedding_type">(),diff --git a/frontend/src/metabase/api/embedding-hub.ts b/frontend/src/metabase/api/embedding-hub.tsindex a8fdecc108b..c7294beb921 100644--- a/frontend/src/metabase/api/embedding-hub.ts+++ b/frontend/src/metabase/api/embedding-hub.ts@@ -1,21 +1,33 @@import { Api } from "metabase/api";+import type { DataSegregationStrategy } from "metabase/embedding/embedding-hub";import { listTag } from "./tags";type CheckListApiStep =| "create-dashboard"| "add-data"- | "create-models"| "configure-row-column-security"| "create-test-embed"| "embed-production"- | "secure-embeds"- | "setup-tenants";+ | "sso-configured"+ | "enable-tenants"+ | "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<EmbeddingHubChecklist, void>({+ getEmbeddingHubChecklist: builder.query<+ EmbeddingHubChecklistResponse,+ void+ >({query: () => ({method: "GET",url: "/api/ee/embedding-hub/checklist",diff --git a/frontend/src/metabase/api/group-table-access-policy.ts b/frontend/src/metabase/api/group-table-access-policy.tsnew file mode 100644index 00000000000..772b5f6eed8--- /dev/null+++ b/frontend/src/metabase/api/group-table-access-policy.ts@@ -0,0 +1,23 @@+import type { GroupTableAccessPolicy } from "metabase-types/api";++import { Api } from "./api";+import { listTag } from "./tags";++export const groupTableAccessPolicyApi = Api.injectEndpoints({+ endpoints: (builder) => ({+ listGroupTableAccessPolicies: builder.query<+ GroupTableAccessPolicy[],+ { group_id?: number; table_id?: number } | void+ >({+ query: (params) => ({+ method: "GET",+ url: "/api/mt/gtap",+ params,+ }),+ providesTags: () => [listTag("group-table-access-policy")],+ }),+ }),+});++export const { useListGroupTableAccessPoliciesQuery } =+ groupTableAccessPolicyApi;diff --git a/frontend/src/metabase/api/index.ts b/frontend/src/metabase/api/index.tsindex d2e6177e4b4..d6b9cb6b120 100644--- a/frontend/src/metabase/api/index.ts+++ b/frontend/src/metabase/api/index.ts@@ -31,6 +31,7 @@ export * from "./permission";export * from "./persist";export * from "./premium-features";export * from "./revision";+export * from "./group-table-access-policy";export * from "./search";export * from "./segment";export * from "./session";diff --git a/frontend/src/metabase/api/settings.ts b/frontend/src/metabase/api/settings.tsindex afe4d14a876..6feac98796f 100644--- a/frontend/src/metabase/api/settings.ts+++ b/frontend/src/metabase/api/settings.ts@@ -56,6 +56,9 @@ export const settingsApi = Api.injectEndpoints({tag("session-properties"),...(key === "uploads-settings" ? [listTag("database")] : []),...(key === "llm-anthropic-api-key" ? [listTag("llm-models")] : []),++ // Enabling tenants creates the "all-external-users" permission group+ ...(key === "use-tenants" ? [listTag("permissions-group")] : []),]);},}),diff --git a/frontend/src/metabase/api/tags/constants.ts b/frontend/src/metabase/api/tags/constants.tsindex 7664906e792..76557a17ba6 100644--- a/frontend/src/metabase/api/tags/constants.ts+++ b/frontend/src/metabase/api/tags/constants.ts@@ -35,6 +35,7 @@ export const TAG_TYPES = ["persisted-info","persisted-model","revision",+ "group-table-access-policy","schema","segment","session-properties",diff --git a/frontend/src/metabase/common/components/DatabaseMultiSelect/DatabaseMultiSelect.module.css b/frontend/src/metabase/common/components/DatabaseMultiSelect/DatabaseMultiSelect.module.cssnew file mode 100644index 00000000000..a7a673a0b1d--- /dev/null+++ b/frontend/src/metabase/common/components/DatabaseMultiSelect/DatabaseMultiSelect.module.css@@ -0,0 +1,35 @@+.pill {+ padding: 0.25rem 1rem;+}++.input:focus-within {+ border-color: var(--mb-color-brand);+}++.option {+ padding: 0.4rem 0.5rem;+}++.pillContent {+ color: var(--mb-color-text-primary);+}++.optionContent {+ flex: 1;+}++.optionIcon {+ color: var(--mb-color-text-primary);+ flex-shrink: 0;+}++.optionIconDisabled {+ color: var(--mb-color-text-tertiary);+ flex-shrink: 0;+}++.disabledInfoIcon {+ color: var(--mb-color-text-secondary);+ flex-shrink: 0;+ margin-left: auto;+}diff --git a/frontend/src/metabase/common/components/DatabaseMultiSelect/DatabaseMultiSelect.stories.tsx b/frontend/src/metabase/common/components/DatabaseMultiSelect/DatabaseMultiSelect.stories.tsxnew file mode 100644index 00000000000..a38b0512486--- /dev/null+++ b/frontend/src/metabase/common/components/DatabaseMultiSelect/DatabaseMultiSelect.stories.tsx@@ -0,0 +1,164 @@+import type { Store } from "@reduxjs/toolkit";+import type { StoryFn } from "@storybook/react";+import { HttpResponse, http } from "msw";+import { useState } from "react";+import _ from "underscore";++import { getStore } from "__support__/entities-store";+import { mockSettings } from "__support__/settings";+import { createMockEntitiesState } from "__support__/store";+import { Api } from "metabase/api";+import { MetabaseReduxProvider } from "metabase/lib/redux";+import { commonReducers } from "metabase/reducers-common";+import { Stack, Text } from "metabase/ui";+import type { Database, DatabaseId } from "metabase-types/api";+import { createMockDatabase } from "metabase-types/api/mocks";+import type { State } from "metabase-types/store";+import { createMockState } from "metabase-types/store/mocks";++import {+ DatabaseMultiSelect,+ type DatabaseMultiSelectProps,+} from "./DatabaseMultiSelect";++const mockDatabases: Database[] = [+ createMockDatabase({ id: 1, name: "Database 1" }),+ createMockDatabase({ id: 2, name: "Database 2" }),+ createMockDatabase({ id: 3, name: "Database 3" }),+];++const storeInitialState = createMockState({+ settings: mockSettings(),+ entities: createMockEntitiesState({}),+});++const publicReducerNames = Object.keys(commonReducers);+const initialState = _.pick(storeInitialState, ...publicReducerNames) as State;++const storeMiddleware = [Api.middleware];++const store = getStore(+ commonReducers,+ initialState,+ storeMiddleware,+) as unknown as Store<State>;++const ReduxDecorator = (Story: StoryFn) => {+ return (+ <MetabaseReduxProvider store={store}>+ <Story />+ </MetabaseReduxProvider>+ );+};++const DatabaseMultiSelectWrapper = (+ props: Omit<DatabaseMultiSelectProps, "value" | "onChange"> & {+ initialValue?: DatabaseId[];+ },+) => {+ const [value, setValue] = useState<DatabaseId[]>(props.initialValue ?? []);++ return (+ <Stack>+ <DatabaseMultiSelect {...props} value={value} onChange={setValue} />+ <Text size="sm" c="text-secondary">+ Selected IDs: {value.length > 0 ? value.join(", ") : "none"}+ </Text>+ </Stack>+ );+};++const msw = {+ handlers: [+ http.get("/api/database", () => HttpResponse.json({ data: mockDatabases })),+ ],+};++const mswEmpty = {+ handlers: [http.get("/api/database", () => HttpResponse.json({ data: [] }))],+};++export default {+ title: "Common/DatabaseMultiSelect",+ component: DatabaseMultiSelect,+ decorators: [ReduxDecorator],+ parameters: {+ msw,+ },+};++export const Default = {+ render: () => <DatabaseMultiSelectWrapper placeholder="Pick a database" />,+};++export const WithInitialSelection = {+ name: "With initial selection",+ render: () => (+ <DatabaseMultiSelectWrapper+ placeholder="Pick a database"+ initialValue={[1]}+ />+ ),+};++export const MultipleSelected = {+ name: "Multiple selected",+ render: () => (+ <DatabaseMultiSelectWrapper+ placeholder="Pick a database"+ initialValue={[1, 2]}+ />+ ),+};++export const Disabled = {+ render: () => (+ <DatabaseMultiSelectWrapper+ placeholder="Pick a database"+ initialValue={[1]}+ disabled+ />+ ),+};++export const WithLabel = {+ name: "With label",+ render: () => (+ <DatabaseMultiSelectWrapper+ placeholder="Pick a database"+ label="Select databases"+ />+ ),+};++export const WithDescription = {+ name: "With description",+ render: () => (+ <DatabaseMultiSelectWrapper+ placeholder="Pick a database"+ label="Select databases"+ description="Choose one or more databases to include"+ />+ ),+};++export const EmptyDatabases = {+ name: "Empty databases",+ parameters: {+ msw: mswEmpty,+ },+ render: () => (+ <DatabaseMultiSelectWrapper placeholder="No databases available" />+ ),+};++export const WithDisabledOptions = {+ name: "With disabled options",+ render: () => (+ <DatabaseMultiSelectWrapper+ placeholder="Pick a database"+ isOptionDisabled={(db) => db.id === 2}+ disabledOptionTooltip="Connection impersonation is not supported for this database"+ />+ ),+};diff --git a/frontend/src/metabase/common/components/DatabaseMultiSelect/DatabaseMultiSelect.tsx b/frontend/src/metabase/common/components/DatabaseMultiSelect/DatabaseMultiSelect.tsxnew file mode 100644index 00000000000..9ae3cb0fd28--- /dev/null+++ b/frontend/src/metabase/common/components/DatabaseMultiSelect/DatabaseMultiSelect.tsx@@ -0,0 +1,123 @@+import { useMemo } from "react";+import { t } from "ttag";++import { useListDatabasesQuery } from "metabase/api";+import {+ type ComboboxItem,+ Flex,+ Icon,+ MultiAutocomplete,+ Text,+ Tooltip,+} from "metabase/ui";+import type { Database, DatabaseId } from "metabase-types/api";++import S from "./DatabaseMultiSelect.module.css";++export interface DatabaseMultiSelectProps {+ value: DatabaseId[];+ onChange: (value: DatabaseId[]) => void;+ placeholder?: string;+ label?: string;+ description?: string;+ disabled?: boolean;+ "data-testid"?: string;++ /** Callback to determine if a database option should be disabled */+ isOptionDisabled?: (database: Database) => boolean;++ /** Tooltip text to show for disabled options */+ disabledOptionTooltip?: string;+}++export const DatabaseMultiSelect = ({+ value,+ onChange,+ placeholder = t`Pick a database`,+ label,+ description,+ disabled,+ "data-testid": dataTestId,+ isOptionDisabled,+ disabledOptionTooltip,+}: DatabaseMultiSelectProps) => {+ const { data: databasesResponse } = useListDatabasesQuery();++ const databases = useMemo(+ () => databasesResponse?.data ?? [],+ [databasesResponse?.data],+ );++ const databaseIds = useMemo(() => value.map(String), [value]);++ const options = useMemo(() => {+ return databases.map((db) => ({+ value: String(db.id),+ label: db.name,+ disabled: isOptionDisabled?.(db) ?? false,+ }));+ }, [databases, isOptionDisabled]);++ const handleChange = (databaseIds: string[]) =>+ onChange(databaseIds.map(Number));++ const renderValue = ({ value }: { value: string }) => {+ const database = databases.find((db) => db.id.toString() === value);++ if (!database) {+ return value;+ }++ return (+ <Flex align="center" gap="sm" className={S.pillContent}>+ <Icon name="database" size={16} />++ <Text fw="bold" size="md">+ {database.name}+ </Text>+ </Flex>+ );+ };++ const renderOption = ({ option }: { option: ComboboxItem }) => {+ const isDisabled = option.disabled;++ return (+ <Flex align="center" gap="sm" className={S.optionContent}>+ <Icon+ name="database"+ size={16}+ className={isDisabled ? S.optionIconDisabled : S.optionIcon}+ />++ <Text size="md" c={isDisabled ? "text-tertiary" : undefined}>+ {option.label}+ </Text>++ {isDisabled && disabledOptionTooltip && (+ <Tooltip label={disabledOptionTooltip} position="top">+ <Icon name="info" size={16} className={S.disabledInfoIcon} />+ </Tooltip>+ )}+ </Flex>+ );+ };++ return (+ <MultiAutocomplete+ value={databaseIds}+ data={options}+ placeholder={placeholder}+ label={label}+ description={description}+ nothingFoundMessage={t`No databases found`}+ classNames={{ pill: S.pill, input: S.input }}+ comboboxProps={{ disabled, classNames: { option: S.option } }}+ data-testid={dataTestId}+ rightSection={null}+ renderValue={renderValue}+ renderOption={renderOption}+ onChange={handleChange}+ />+ );+};diff --git a/frontend/src/metabase/common/components/DatabaseMultiSelect/DatabaseMultiSelect.unit.spec.tsx b/frontend/src/metabase/common/components/DatabaseMultiSelect/DatabaseMultiSelect.unit.spec.tsxnew file mode 100644index 00000000000..5072f032118--- /dev/null+++ b/frontend/src/metabase/common/components/DatabaseMultiSelect/DatabaseMultiSelect.unit.spec.tsx@@ -0,0 +1,136 @@+import userEvent from "@testing-library/user-event";+import { useState } from "react";++import { setupDatabasesEndpoints } from "__support__/server-mocks";+import { renderWithProviders, screen, waitFor } from "__support__/ui";+import type { Database } from "metabase-types/api";+import { createMockDatabase } from "metabase-types/api/mocks";++import { DatabaseMultiSelect } from "./DatabaseMultiSelect";++const mockDatabases: Database[] = [+ createMockDatabase({ id: 1, name: "Database 1" }),+ createMockDatabase({ id: 2, name: "Database 2" }),+ createMockDatabase({ id: 3, name: "Database 3" }),+];++const TestDatabaseMultiSelect = ({+ initialValue = [],+ isOptionDisabled,+ disabledOptionTooltip,+}: {+ initialValue?: number[];+ isOptionDisabled?: (database: Database) => boolean;+ disabledOptionTooltip?: string;+}) => {+ const [value, setValue] = useState(initialValue);++ return (+ <DatabaseMultiSelect+ value={value}+ onChange={setValue}+ placeholder="Pick a database"+ isOptionDisabled={isOptionDisabled}+ disabledOptionTooltip={disabledOptionTooltip}+ />+ );+};++interface SetupOpts {+ initialValue?: number[];+ databases?: Database[];+ isOptionDisabled?: (database: Database) => boolean;+ disabledOptionTooltip?: string;+}++function setup({+ initialValue = [],+ databases = mockDatabases,+ isOptionDisabled,+ disabledOptionTooltip,+}: SetupOpts = {}) {+ setupDatabasesEndpoints(databases);++ renderWithProviders(+ <TestDatabaseMultiSelect+ initialValue={initialValue}+ isOptionDisabled={isOptionDisabled}+ disabledOptionTooltip={disabledOptionTooltip}+ />,+ );+}++describe("DatabaseMultiSelect", () => {+ it("should show database options in the dropdown", async () => {+ setup();++ expect(+ await screen.findByPlaceholderText("Pick a database"),+ ).toBeInTheDocument();++ await userEvent.click(+ await screen.findByPlaceholderText("Pick a database"),+ );++ await waitFor(() => {+ expect(+ screen.getByRole("option", { name: /Database 1/ }),+ ).toBeInTheDocument();++ expect(+ screen.getByRole("option", { name: /Database 2/ }),+ ).toBeInTheDocument();++ expect(+ screen.getByRole("option", { name: /Database 3/ }),+ ).toBeInTheDocument();+ });+ });++ it("should allow selecting a database", async () => {+ setup();++ await userEvent.click(+ await screen.findByPlaceholderText("Pick a database"),+ );++ await waitFor(() => {+ expect(screen.getByText("Database 1")).toBeInTheDocument();+ });++ await userEvent.click(screen.getByText("Database 1"));++ // after selecting, the pill should appear in the input area+ await waitFor(() => {+ expect(screen.getByText("Database 1")).toBeInTheDocument();+ });+ });++ it("should show pre-selected databases as pills", async () => {+ setup({ initialValue: [1, 2] });++ // pills show database names (wait for data to load)+ expect(await screen.findByText("Database 1")).toBeInTheDocument();+ expect(screen.getByText("Database 2")).toBeInTheDocument();++ // each pill has a remove button+ expect(screen.getAllByLabelText("Remove")).toHaveLength(2);+ });++ it("should prevent selecting disabled options", async () => {+ setup({+ isOptionDisabled: (db) => db.id === 1,+ disabledOptionTooltip: "Not supported",+ });++ await userEvent.click(+ await screen.findByPlaceholderText("Pick a database"),+ );++ const option = await screen.findByRole("option", { name: /Database 1/ });+ await userEvent.click(option);++ // clicking a disabled option should not select it - no pills should appear+ expect(screen.queryByLabelText("Remove")).not.toBeInTheDocument();+ });+});diff --git a/frontend/src/metabase/common/components/DatabaseMultiSelect/index.ts b/frontend/src/metabase/common/components/DatabaseMultiSelect/index.tsnew file mode 100644index 00000000000..0258f8c8013--- /dev/null+++ b/frontend/src/metabase/common/components/DatabaseMultiSelect/index.ts@@ -0,0 +1 @@+export * from "./DatabaseMultiSelect";diff --git a/frontend/src/metabase/common/components/OnboardingStepper/OnboardingStepper.module.css b/frontend/src/metabase/common/components/OnboardingStepper/OnboardingStepper.module.cssindex 9b652a4c203..ad5ff2eb879 100644--- a/frontend/src/metabase/common/components/OnboardingStepper/OnboardingStepper.module.css+++ b/frontend/src/metabase/common/components/OnboardingStepper/OnboardingStepper.module.css@@ -50,11 +50,11 @@font-size: 1.0625rem;}-.StepRoot[data-active="true"] .StepHeader {+.StepRoot[data-active="true"] .StepHeaderWithTitle {margin-bottom: 1rem;}-.StepRoot[data-active="false"] .StepHeader {+.StepRoot[data-active="false"] .StepHeaderWithTitle {margin: 0;}@@ -108,7 +108,7 @@color: var(--mb-color-text-tertiary);}-/* Step content (only shown when active) */-.StepContent {+/* Step content with title (only shown when active) */+.StepContentWithTitle {margin-top: 1rem;}diff --git a/frontend/src/metabase/common/components/OnboardingStepper/OnboardingStepper.tsx b/frontend/src/metabase/common/components/OnboardingStepper/OnboardingStepper.tsxindex cc166cfc2b4..dd9a7e9e1a0 100644--- a/frontend/src/metabase/common/components/OnboardingStepper/OnboardingStepper.tsx+++ b/frontend/src/metabase/common/components/OnboardingStepper/OnboardingStepper.tsx@@ -1,11 +1,22 @@-import { Children, isValidElement, useEffect, useMemo, useState } from "react";+import {+ Children,+ forwardRef,+ isValidElement,+ useCallback,+ useImperativeHandle,+ useMemo,+ useState,+} from "react";import { StepperContext } from "./OnboardingStepperContext";import { OnboardingStepperStep } from "./OnboardingStepperStep";+import { useAutoAdvanceStep } from "./hooks/use-auto-advance-step";import { useScrollStepIntoView } from "./hooks/use-scroll-step-into-view";-import type { OnboardingStepperProps } from "./types";+import type { OnboardingStepperHandle, OnboardingStepperProps } from "./types";+import { getNextStepToActivate } from "./utils/get-next-step-to-activate";export type {+ OnboardingStepperHandle,OnboardingStepperProps,OnboardingStepperStepProps,} from "./types";@@ -18,12 +29,13 @@ export type {* Automatically advances to the next incomplete* step when a step is completed.*/-const OnboardingStepperRoot = ({- children,- completedSteps,- lockedSteps,- onChange,-}: OnboardingStepperProps) => {+const OnboardingStepperRoot = forwardRef<+ OnboardingStepperHandle,+ OnboardingStepperProps+>(function OnboardingStepper(+ { children, completedSteps, lockedSteps, onChange },+ ref,+) {// Extract step IDs and compute labels from childrenconst { stepIds, stepNumbers } = useMemo(() => {const ids: string[] = [];@@ -51,25 +63,62 @@ const OnboardingStepperRoot = ({return stepIds.find((id) => !completedSteps[id]) ?? null;}, [stepIds, completedSteps]);- const [activeStep, setActiveStepState] = useState<string | null>(+ const [activeStep, setActiveStepValue] = useState<string | null>(defaultActiveStep,);const { stepRefs, scrollStepIntoView } = useScrollStepIntoView(stepIds);- const setActiveStep = (stepId: string | null) => {- setActiveStepState(stepId);- scrollStepIntoView(stepId);- onChange?.(stepId);- };+ const currentStepIndex = activeStep ? stepIds.indexOf(activeStep) : -1;- // Move on to next incomplete step when completedSteps changes- useEffect(() => {- const nextIncomplete = stepIds.find((id) => !completedSteps[id]) ?? null;+ const setActiveStep = useCallback(+ (stepId: string | null) => {+ setActiveStepValue(stepId);+ scrollStepIntoView(stepId);+ onChange?.(stepId);+ },+ [onChange, scrollStepIntoView],+ );++ useAutoAdvanceStep({+ stepIds,+ completedSteps,+ lockedSteps,+ activeStep,+ setActiveStep,+ });++ const goToNextIncompleteStep = useCallback(() => {+ if (activeStep === null) {+ return;+ }++ const nextStepId = getNextStepToActivate({+ stepIds,+ completedSteps,+ lockedSteps,+ fromIndex: stepIds.indexOf(activeStep) + 1,+ });- setActiveStepState(nextIncomplete);- scrollStepIntoView(nextIncomplete);- }, [completedSteps, stepIds, scrollStepIntoView]);+ // When all steps are complete, falls back to the last step.+ // Skip navigation if we're already there.+ if (nextStepId && nextStepId !== activeStep) {+ setActiveStep(nextStepId);+ }+ }, [activeStep, stepIds, completedSteps, lockedSteps, setActiveStep]);++ const goToNextStep = useCallback(() => {+ const nextStep = stepIds[currentStepIndex + 1];++ if (nextStep) {+ setActiveStep(nextStep);+ }+ }, [stepIds, currentStepIndex, setActiveStep]);++ useImperativeHandle(ref, () => ({ goToNextIncompleteStep, goToNextStep }), [+ goToNextIncompleteStep,+ goToNextStep,+ ]);return (<StepperContext.Provider@@ -85,7 +134,7 @@ const OnboardingStepperRoot = ({{children}</StepperContext.Provider>);-};+});export const OnboardingStepper = Object.assign(OnboardingStepperRoot, {Step: OnboardingStepperStep,diff --git a/frontend/src/metabase/common/components/OnboardingStepper/OnboardingStepper.unit.spec.tsx b/frontend/src/metabase/common/components/OnboardingStepper/OnboardingStepper.unit.spec.tsxindex bc4604d9fdf..8071602bb72 100644--- a/frontend/src/metabase/common/components/OnboardingStepper/OnboardingStepper.unit.spec.tsx+++ b/frontend/src/metabase/common/components/OnboardingStepper/OnboardingStepper.unit.spec.tsx@@ -1,19 +1,24 @@import userEvent from "@testing-library/user-event";+import { createRef } from "react";-import { getIcon, render, screen } from "__support__/ui";+import { act, getIcon, render, screen } from "__support__/ui";import { OnboardingStepper } from "./OnboardingStepper";+import type { OnboardingStepperHandle } from "./types";const TestStepper = ({completedSteps = {},lockedSteps = {},onChange,+ stepperRef,}: {completedSteps?: Record<string, boolean>;lockedSteps?: Record<string, boolean>;onChange?: (value: string | null) => void;+ stepperRef?: React.Ref<OnboardingStepperHandle>;}) => (<OnboardingStepper+ ref={stepperRef}completedSteps={completedSteps}lockedSteps={lockedSteps}onChange={onChange}@@ -58,14 +63,14 @@ describe("OnboardingStepper", () => {expect(screen.queryByText("First step content")).not.toBeInTheDocument();});- it("does not open any step when all steps are completed", () => {+ it("opens the last step when all steps are completed", () => {setup({completedSteps: { "step-1": true, "step-2": true, "step-3": true },});expect(screen.queryByText("First step content")).not.toBeInTheDocument();expect(screen.queryByText("Second step content")).not.toBeInTheDocument();- expect(screen.queryByText("Third step content")).not.toBeInTheDocument();+ expect(screen.getByText("Third step content")).toBeInTheDocument();});it("switches to clicked step", async () => {@@ -112,6 +117,28 @@ describe("OnboardingStepper", () => {expect(screen.queryByText("First step content")).not.toBeInTheDocument();});+ it("does not collapse a manually opened step when all steps are already completed", async () => {+ const { rerender } = setup({+ completedSteps: { "step-1": true, "step-2": true, "step-3": true },+ });++ // all steps are already completed, last step is initially active+ expect(screen.getByText("Third step content")).toBeInTheDocument();++ // user manually opens step 2+ await userEvent.click(screen.getByText("Second step"));+ expect(screen.getByText("Second step content")).toBeInTheDocument();++ // completedSteps changes but all steps remain complete+ // (simulates a re-render with new object reference)+ rerender({+ completedSteps: { "step-1": true, "step-2": true, "step-3": true },+ });++ // step 2 should stay open, not collapse+ expect(screen.getByText("Second step content")).toBeInTheDocument();+ });+it("calls onChange when step changes", async () => {const onChange = jest.fn();setup({ onChange });@@ -138,4 +165,93 @@ describe("OnboardingStepper", () => {expect(screen.getByText("First step content")).toBeInTheDocument();expect(screen.queryByText("Second step content")).not.toBeInTheDocument();});++ it("does not jump back to previous incomplete steps when completing a later step", async () => {+ const { rerender } = setup();++ // navigate to step 2 without completing step 1+ await userEvent.click(screen.getByText("Second step"));+ expect(screen.getByText("Second step content")).toBeInTheDocument();++ // complete step 2 (step 1 is still incomplete)+ rerender({ completedSteps: { "step-2": true } });++ // should move forward to step 3, not back to step 1+ expect(screen.getByText("Third step content")).toBeInTheDocument();+ expect(screen.queryByText("First step content")).not.toBeInTheDocument();+ expect(screen.queryByText("Second step content")).not.toBeInTheDocument();+ });++ it("does not auto-advance to a locked step when current step is completed", () => {+ const { rerender } = setup({ lockedSteps: { "step-2": true } });++ // first step is active by default+ expect(screen.getByText("First step content")).toBeInTheDocument();++ // complete step 1, but step 2 is locked+ rerender({+ completedSteps: { "step-1": true },+ lockedSteps: { "step-2": true },+ });++ // should collapse step 1 but NOT open locked step 2+ // instead it should skip to step 3 (first incomplete unlocked step)+ expect(screen.queryByText("First step content")).not.toBeInTheDocument();+ expect(screen.queryByText("Second step content")).not.toBeInTheDocument();+ expect(screen.getByText("Third step content")).toBeInTheDocument();+ });++ // goToNextIncompleteStep is a ref method for manual navigation,+ // e.g. when a user clicks a "Next" button manually within a step.+ // It differs from auto-advance which triggers automatically when completedSteps changes.+ describe("goToNextIncompleteStep (manual navigation via refs)", () => {+ const setupWithRef = (props: Parameters<typeof TestStepper>[0] = {}) => {+ const ref = createRef<OnboardingStepperHandle>();+ render(<TestStepper {...props} stepperRef={ref} />);++ return { ref };+ };++ it("navigates to next step in sequence when called via ref", () => {+ const { ref } = setupWithRef();++ expect(screen.getByText("First step content")).toBeInTheDocument();++ // simulates clicking the "Next" button manually within a step.+ act(() => ref.current?.goToNextIncompleteStep());++ expect(screen.getByText("Second step content")).toBeInTheDocument();+ expect(screen.queryByText("First step content")).not.toBeInTheDocument();+ });++ it("skips completed steps to find next incomplete", async () => {+ const { ref } = setupWithRef({ completedSteps: { "step-2": true } });++ expect(screen.getByText("First step content")).toBeInTheDocument();++ // step 2 is complete, so should skip to step 3+ act(() => ref.current?.goToNextIncompleteStep());++ expect(screen.getByText("Third step content")).toBeInTheDocument();+ expect(screen.queryByText("Second step content")).not.toBeInTheDocument();+ });++ it("navigates to last step when all remaining steps are complete", async () => {+ const { ref } = setupWithRef({+ completedSteps: { "step-1": true, "step-2": true, "step-3": true },+ });++ // all steps complete, last step is initially active+ expect(screen.getByText("Third step content")).toBeInTheDocument();++ // manually open step 2+ await userEvent.click(screen.getByText("Second step"));+ expect(screen.getByText("Second step content")).toBeInTheDocument();++ // all steps complete, so navigate to last step (summary)+ act(() => ref.current?.goToNextIncompleteStep());++ expect(screen.getByText("Third step content")).toBeInTheDocument();+ });+ });});diff --git a/frontend/src/metabase/common/components/OnboardingStepper/OnboardingStepperStep.tsx b/frontend/src/metabase/common/components/OnboardingStepper/OnboardingStepperStep.tsxindex 74091356fde..426282c88d8 100644--- a/frontend/src/metabase/common/components/OnboardingStepper/OnboardingStepperStep.tsx+++ b/frontend/src/metabase/common/components/OnboardingStepper/OnboardingStepperStep.tsx@@ -1,3 +1,4 @@+import cx from "classnames";import { useContext } from "react";import { Box, Icon } from "metabase/ui";@@ -10,6 +11,7 @@ export function OnboardingStepperStep({stepId,title,children,+ hideTitleOnActive = false,"data-testid": testId,}: OnboardingStepperStepProps) {const {@@ -27,6 +29,8 @@ export function OnboardingStepperStep({const isLocked = lockedSteps[stepId] ?? false;const stepNumber = stepNumbers[stepId] ?? 0;+ const shouldShowTitle = !isActive || !hideTitleOnActive;+return (<Boxcomponent="section"@@ -36,6 +40,7 @@ export function OnboardingStepperStep({aria-label={title}aria-current={isActive ? "step" : undefined}data-active={isActive}+ data-completed={isCompleted}data-locked={isLocked}data-testid={testId}onClick={() => {@@ -54,17 +59,25 @@ export function OnboardingStepperStep({)}</div>- <div className={S.StepHeader}>- <div className={S.StepTitle} data-completed={isCompleted}>- {title}- </div>+ <div+ className={cx(S.StepHeader, shouldShowTitle && S.StepHeaderWithTitle)}+ >+ {shouldShowTitle && (+ <div className={S.StepTitle} data-completed={isCompleted}>+ {title}+ </div>+ )}- {isLocked && (+ {isLocked && !isActive && (<Icon name="lock" className={S.StepLockIcon} aria-label="Locked" />)}</div>- {isActive && <div className={S.StepContent}>{children}</div>}+ {isActive && (+ <div className={cx(shouldShowTitle && S.StepContentWithTitle)}>+ {children}+ </div>+ )}</Box>);}diff --git a/frontend/src/metabase/common/components/OnboardingStepper/hooks/use-auto-advance-step.ts b/frontend/src/metabase/common/components/OnboardingStepper/hooks/use-auto-advance-step.tsnew file mode 100644index 00000000000..f84e960925d--- /dev/null+++ b/frontend/src/metabase/common/components/OnboardingStepper/hooks/use-auto-advance-step.ts@@ -0,0 +1,63 @@+import { useEffect, useRef } from "react";++import { getNextStepToActivate } from "../utils/get-next-step-to-activate";++/**+ * Automatically advances to the next incomplete step when steps are completed.+ *+ * This hook only advances forward (never jumps back) and only triggers when+ * `completedSteps` changes. Manual step selection by the user does not trigger+ * auto-advance.+ *+ * We read `activeStep` via a ref to avoid including it in+ * effect dependencies, so effect only runs when steps are+ * completed, not when the user manually navigates between steps.+ */+export function useAutoAdvanceStep({+ stepIds,+ completedSteps,+ lockedSteps,+ activeStep,+ setActiveStep,+}: {+ stepIds: string[];+ completedSteps: Record<string, boolean>;+ lockedSteps?: Record<string, boolean>;+ activeStep: string | null;+ setActiveStep: (stepId: string | null) => void;+}): void {+ const activeStepRef = useRef(activeStep);+ const prevCompletedStepsRef = useRef(completedSteps);++ activeStepRef.current = activeStep;++ useEffect(() => {+ const currentStepId = activeStepRef.current;+ const currentStepIndex = currentStepId ? stepIds.indexOf(currentStepId) : 0;+ const prevCompletedSteps = prevCompletedStepsRef.current;++ // Check if the current step was already completed before this render.+ // If so, the user manually reopened a completed step - don't auto-advance.+ const wasCurrentStepAlreadyCompleted = currentStepId+ ? prevCompletedSteps[currentStepId]+ : false;++ // Update the ref for next render+ prevCompletedStepsRef.current = completedSteps;++ if (wasCurrentStepAlreadyCompleted) {+ return;+ }++ const nextStepId = getNextStepToActivate({+ stepIds,+ completedSteps,+ lockedSteps,+ fromIndex: currentStepIndex,+ });++ if (nextStepId !== currentStepId) {+ setActiveStep(nextStepId);+ }+ }, [stepIds, completedSteps, lockedSteps, setActiveStep]);+}diff --git a/frontend/src/metabase/common/components/OnboardingStepper/types.ts b/frontend/src/metabase/common/components/OnboardingStepper/types.tsindex e86bc821424..dbd6147b0e2 100644--- a/frontend/src/metabase/common/components/OnboardingStepper/types.ts+++ b/frontend/src/metabase/common/components/OnboardingStepper/types.ts@@ -22,6 +22,21 @@ export interface OnboardingStepperProps {onChange?: (value: string | null) => void;}+export interface OnboardingStepperHandle {+ /**+ * Navigate to the next incomplete step after the current position.+ * Falls back to next step in sequence if all remaining steps are complete.+ * Stays on current step if already at the last step.+ */+ goToNextIncompleteStep: () => void;++ /**+ * Navigate to the next step in sequence, regardless of completion status.+ * Useful when the user is reconfiguring a completed step.+ */+ goToNextStep: () => void;+}+export interface OnboardingStepperStepProps {/** Unique identifier for this step */stepId: string;@@ -29,6 +44,9 @@ export interface OnboardingStepperStepProps {/** Title displayed in the step header */title: string;+ /** Whether to hide the step title on step active */+ hideTitleOnActive?: boolean;+/** Content to show when the step is active */children: ReactNode;diff --git a/frontend/src/metabase/common/components/OnboardingStepper/utils/get-next-step-to-activate.ts b/frontend/src/metabase/common/components/OnboardingStepper/utils/get-next-step-to-activate.tsnew file mode 100644index 00000000000..3145217cbdb--- /dev/null+++ b/frontend/src/metabase/common/components/OnboardingStepper/utils/get-next-step-to-activate.ts@@ -0,0 +1,23 @@+/**+ * Finds the next incomplete and unlocked step starting from a given index.+ * Falls back to the last step when all remaining steps are complete,+ * ensuring summary/final steps can be reached.+ */+export const getNextStepToActivate = ({+ fromIndex = 0,++ stepIds,+ completedSteps,+ lockedSteps = {},+}: {+ fromIndex?: number;++ stepIds: string[];+ completedSteps: Record<string, boolean>;+ lockedSteps?: Record<string, boolean>;+}): string | null =>+ stepIds+ .slice(fromIndex)+ .find((id) => !completedSteps[id] && !lockedSteps?.[id]) ??+ stepIds[stepIds.length - 1] ??+ null;diff --git a/frontend/src/metabase/embedding/embedding-hub/components/EmbeddingHub.tsx b/frontend/src/metabase/embedding/embedding-hub/components/EmbeddingHub.tsxindex 4dbf9e2550c..ea386bc266b 100644--- a/frontend/src/metabase/embedding/embedding-hub/components/EmbeddingHub.tsx+++ b/frontend/src/metabase/embedding/embedding-hub/components/EmbeddingHub.tsx@@ -33,7 +33,7 @@ export const EmbeddingHub = () => {const lockedSteps: Partial<Record<EmbeddingHubStepId, boolean>> = useMemo(() => ({- "embed-production": !completedSteps?.["secure-embeds"],+ "embed-production": !completedSteps?.["sso-configured"],}),[completedSteps],);diff --git a/frontend/src/metabase/embedding/embedding-hub/components/EmbeddingHub.unit.spec.tsx b/frontend/src/metabase/embedding/embedding-hub/components/EmbeddingHub.unit.spec.tsxindex 37ebf8cdb78..c28583f2801 100644--- a/frontend/src/metabase/embedding/embedding-hub/components/EmbeddingHub.unit.spec.tsx+++ b/frontend/src/metabase/embedding/embedding-hub/components/EmbeddingHub.unit.spec.tsx@@ -82,7 +82,10 @@ const setup = ({ isAdmin = true, checklist = {} } = {}) => {query: { include_only_uploadable: true },response: { data: [], total: 0 },});- fetchMock.get("path:/api/ee/embedding-hub/checklist", checklist);+ fetchMock.get("path:/api/ee/embedding-hub/checklist", {+ checklist,+ "data-isolation-strategy": null,+ });return renderWithProviders(<EmbeddingHub />, { storeInitialState: state });};@@ -128,45 +131,16 @@ describe("EmbeddingHub", () => {expect(mockPush).toHaveBeenCalledWith("/auto/dashboard/table/10");});- it("has correct href link for Configure SSO card", async () => {- setup();-- const configureSsoLink = screen.getByRole("link", {- name: /configure sso/i,- });- expect(configureSsoLink).toBeInTheDocument();-- expect(configureSsoLink).toHaveAttribute(- "href",- "https://www.metabase.com/docs/latest/embedding/embedded-analytics-js.html?utm_source=product&utm_medium=docs&utm_campaign=embedding_hub&utm_content=secure-embeds&source_plan=oss#set-up-sso",- );- });-- it("has correct href link for Configure data permissions card", async () => {- setup();-- const configureDataPermissionsLink = screen.getByRole("link", {- name: /configure data permissions/i,- });- expect(configureDataPermissionsLink).toBeInTheDocument();-- expect(configureDataPermissionsLink).toHaveAttribute(- "href",- "https://www.metabase.com/docs/latest/permissions/embedding.html?utm_source=product&utm_medium=docs&utm_campaign=embedding_hub&utm_content=configure-row-column-security&source_plan=oss#one-database-for-all-customers-commingled-setups",- );- });-it("shows success banner when first 3 steps are completed", async () => {setup({checklist: {"add-data": true,"create-dashboard": true,"create-test-embed": true,- "create-models": false,"configure-row-column-security": false,"embed-production": false,- "secure-embeds": false,- "setup-tenants": false,+ "sso-configured": false,+ "data-permissions-and-enable-tenants": false,},});diff --git a/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/ConnectionImpersonationStepContent.tsx b/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/ConnectionImpersonationStepContent.tsxnew file mode 100644index 00000000000..75bb9a1f404--- /dev/null+++ b/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/ConnectionImpersonationStepContent.tsx@@ -0,0 +1,115 @@+/* eslint-disable metabase/no-literal-metabase-strings -- This string only shows for admins */++import { useCallback, useMemo, useState } from "react";+import { Link } from "react-router";+import { t } from "ttag";++import { useListDatabasesQuery } from "metabase/api";+import { getErrorMessage } from "metabase/api/utils";+import { DatabaseMultiSelect } from "metabase/common/components/DatabaseMultiSelect";+import { useToast } from "metabase/common/hooks";+import { Button, Flex, Stack, Text } from "metabase/ui";+import type { Database, DatabaseId } from "metabase-types/api";++import { useUpdateAllTenantUsersGroupPermissions } from "./hooks/use-update-all-tenant-users-group-permissions";++const supportsConnectionImpersonation = (db: Database) =>+ db.features?.includes("connection-impersonation") ?? false;++export const ConnectionImpersonationStepContent = ({+ onNext,+}: {+ onNext: () => void;+}) => {+ const [sendToast] = useToast();++ const [isUpdatingPermissions, setUpdatingPermissions] = useState(false);++ const { data: databasesResponse } = useListDatabasesQuery();+ const { updateDataAccess } = useUpdateAllTenantUsersGroupPermissions();++ const databases = useMemo(+ () => databasesResponse?.data ?? [],+ [databasesResponse],+ );++ const hasCompatibleDatabases = useMemo(+ () => databases.some(supportsConnectionImpersonation),+ [databases],+ );++ const [selectedDatabaseIds, setSelectedDatabaseIds] = useState<DatabaseId[]>(+ [],+ );++ const handleCreateImpersonations = useCallback(async () => {+ if (selectedDatabaseIds.length === 0) {+ return;+ }++ setUpdatingPermissions(true);++ try {+ await updateDataAccess({ impersonatedDatabaseIds: selectedDatabaseIds });++ onNext();+ } catch (error) {+ const message = getErrorMessage(+ error,+ t`Failed to configure connection impersonation`,+ );++ sendToast({ icon: "warning", toastColor: "error", message });+ } finally {+ setUpdatingPermissions(false);+ }+ }, [selectedDatabaseIds, updateDataAccess, onNext, sendToast]);++ const isNextDisabled = selectedDatabaseIds.length === 0;++ if (!hasCompatibleDatabases) {+ return (+ <Stack gap="md">+ <Text size="md" c="text-secondary" lh="lg">+ {t`None of your databases support connection impersonation. Pick a different data segregation strategy in the previous step, or connect a new database in the Database settings before proceeding. Metabase connects to more than 15 popular databases.`}+ </Text>++ <Flex justify="flex-end">+ <Button+ component={Link}+ to="/admin/databases/create"+ variant="filled"+ >+ {t`Add database`}+ </Button>+ </Flex>+ </Stack>+ );+ }++ return (+ <Stack gap="md">+ <Text size="md" c="text-secondary" lh="lg">+ {t`Select one or more databases to be made visible to all tenant users. Tenant users will be able to create queries on these databases with the query builder. The tenant attribute database_role will be used to manage permissions. You will specify this attribute for each tenant when you create tenants.`}+ </Text>++ <DatabaseMultiSelect+ value={selectedDatabaseIds}+ onChange={setSelectedDatabaseIds}+ isOptionDisabled={(db) => !supportsConnectionImpersonation(db)}+ disabledOptionTooltip={t`This database doesn't support connection impersonation`}+ />++ <Flex justify="flex-end">+ <Button+ variant="filled"+ disabled={isNextDisabled}+ loading={isUpdatingPermissions}+ onClick={handleCreateImpersonations}+ >+ {t`Next`}+ </Button>+ </Flex>+ </Stack>+ );+};diff --git a/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/DataSegregationStrategyPicker.module.css b/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/DataSegregationStrategyPicker.module.cssnew file mode 100644index 00000000000..9638c636c1c--- /dev/null+++ b/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/DataSegregationStrategyPicker.module.css@@ -0,0 +1,18 @@+.radioCard {+ cursor: pointer;+ border: 1px solid var(--mb-color-border);+}++.radioCard[data-checked] {+ border-color: var(--mb-color-brand);+ background: var(--mb-color-background-hover);+}++.radioCard[data-checked] .radioCardTitle {+ color: var(--mb-color-brand);+}++.cardIcon {+ flex-shrink: 0;+ color: var(--mb-color-brand);+}diff --git a/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/DataSegregationStrategyPicker.tsx b/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/DataSegregationStrategyPicker.tsxnew file mode 100644index 00000000000..a8f58314d08--- /dev/null+++ b/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/DataSegregationStrategyPicker.tsx@@ -0,0 +1,107 @@+/* eslint-disable metabase/no-literal-metabase-strings -- This string only shows for admins */++import { t } from "ttag";++import type { IconName } from "metabase/ui";+import { Button, Flex, Group, Icon, Radio, Stack, Text } from "metabase/ui";++import type { DataSegregationStrategy } from "../../types";++import S from "./DataSegregationStrategyPicker.module.css";++export type { DataSegregationStrategy };++interface DataSegregationStrategyPickerProps {+ value: DataSegregationStrategy | null;+ onChange: (value: DataSegregationStrategy) => void;+ onConfirm: () => void;+}++interface StrategyOption {+ id: DataSegregationStrategy;+ icon: IconName;+ title: string;+ description: string;+ confirmText: string;+}++const getOptions = (): StrategyOption[] => [+ {+ id: "row-column-level-security",+ icon: "layout_grid",+ title: t`Row and column level security`,+ description: t`All data is stored in the same database and Metabase will apply a filter to queries for a table column to match a specific value (ex: customerId = 2).`,+ confirmText: t`Use row and column level security`,+ },+ {+ id: "connection-impersonation",+ icon: "corner_up_right",+ title: t`Connection impersonation`,+ description: t`All data is stored in the same database, but Metabase will use a different database role to connect for each tenant. Roles are configured at the database level to only query relevant data.`,+ confirmText: t`Use connection impersonation`,+ },+ {+ id: "database-routing",+ icon: "database_routing",+ title: t`Database routing`,+ description: t`Each tenant has their own database with identical schema. Metabase will use a connection string from a tenant attribute to run queries against a different destination database.`,+ confirmText: t`Use database routing`,+ },+];++export const DataSegregationStrategyPicker = ({+ value,+ onChange,+ onConfirm,+}: DataSegregationStrategyPickerProps) => {+ const options = getOptions();+ const selectedOption =+ options.find((option) => option.id === value) ?? options[0];++ return (+ <Stack gap="md">+ <Radio.Group+ value={value}+ onChange={(nextValue) => onChange(nextValue as DataSegregationStrategy)}+ >+ <Stack gap="md">+ {options.map((strategy) => (+ <Radio.Card+ key={strategy.id}+ value={strategy.id}+ radius="md"+ p="md"+ className={S.radioCard}+ data-testid={`strategy-card-${strategy.id}`}+ >+ <Group wrap="nowrap" align="flex-start">+ <Icon+ name={strategy.icon}+ className={S.cardIcon}+ w={24}+ h={24}+ />++ <div>+ <Text fw="bold" size="md" className={S.radioCardTitle}>+ {strategy.title}+ </Text>++ <Text size="sm" c="text-secondary" lh="lg">+ {strategy.description}+ </Text>+ </div>+ </Group>+ </Radio.Card>+ ))}+ </Stack>+ </Radio.Group>++ <Flex justify="flex-end">+ <Button variant="filled" disabled={!value} onClick={onConfirm}>+ {selectedOption.confirmText}+ </Button>+ </Flex>+ </Stack>+ );+};diff --git a/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/DatabaseRoutingStepContent.tsx b/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/DatabaseRoutingStepContent.tsxnew file mode 100644index 00000000000..ae1afca412e--- /dev/null+++ b/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/DatabaseRoutingStepContent.tsx@@ -0,0 +1,45 @@+/* eslint-disable metabase/no-unconditional-metabase-links-render */++import { t } from "ttag";++import { ExternalLink } from "metabase/common/components/ExternalLink";+import { useDocsUrl } from "metabase/common/hooks";+import { Button, Group, Icon, Paper, Stack, Text, Title } from "metabase/ui";++export const DatabaseRoutingStepContent = () => {+ const { url: docsUrl } = useDocsUrl("permissions/database-routing", {+ utm: { utm_content: "embedding-hub" },+ });++ return (+ <Stack>+ <Text c="text-secondary" lh="xl" mt="xs">+ {t`Follow the steps in the documentation to manage data permissions with database routing.`}+ </Text>++ <Paper bg="background-brand" p="lg" radius="md" withBorder>+ <Stack gap="sm">+ <Title order={4} c="text-primary">+ {t`Manage data permissions with database routing`}+ </Title>++ <Text c="text-secondary" lh="xl">+ {t`Follow the guide in the docs to enable database routing at the data source level, add destination databases and configure the relevant tenant attributes.`}+ </Text>++ <Group justify="flex-end">+ <Button+ component={ExternalLink}+ href={docsUrl}+ variant="outline"+ rightSection={<Icon name="external" size={16} />}+ mt="sm"+ >+ {t`View the guide`}+ </Button>+ </Group>+ </Stack>+ </Paper>+ </Stack>+ );+};diff --git a/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/EnableTenantsStepContent.tsx b/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/EnableTenantsStepContent.tsxnew file mode 100644index 00000000000..f91acd8996d--- /dev/null+++ b/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/EnableTenantsStepContent.tsx@@ -0,0 +1,93 @@+/* eslint-disable metabase/no-literal-metabase-strings -- This string only shows for admins */++import { useCallback } from "react";+import { t } from "ttag";++import {+ useCreateCollectionMutation,+ useListCollectionsTreeQuery,+ useUpdateSettingMutation,+} from "metabase/api";+import { getErrorMessage } from "metabase/api/utils";+import { useToast } from "metabase/common/hooks";+import { Button, Group, Stack, Text } from "metabase/ui";++import S from "./SetupPermissionsAndTenantsPage.module.css";++interface EnableTenantsStepContentProps {+ isTenantsEnabled: boolean;+}++export const EnableTenantsStepContent = ({+ isTenantsEnabled,+}: EnableTenantsStepContentProps) => {+ const [sendToast] = useToast();++ const { data: sharedTenantCollections } = useListCollectionsTreeQuery({+ namespace: "shared-tenant-collection",+ });++ const [updateSetting, { isLoading: isUpdatingSetting }] =+ useUpdateSettingMutation();++ const [createCollection, { isLoading: isCreatingCollection }] =+ useCreateCollectionMutation();++ const hasSharedCollections =+ sharedTenantCollections && sharedTenantCollections.length > 0;++ const isEnablingTenants = isUpdatingSetting || isCreatingCollection;++ const enableTenantsAndCreateSharedCollection = useCallback(async () => {+ try {+ await updateSetting({ key: "use-tenants", value: true }).unwrap();++ // Only create a shared collection if none exist yet+ if (!hasSharedCollections) {+ await createCollection({+ name: t`Shared collection`,+ parent_id: null,+ namespace: "shared-tenant-collection",+ }).unwrap();+ }+ } catch (error) {+ sendToast({+ icon: "warning",+ toastColor: "error",+ message: getErrorMessage(+ error,+ t`Failed to enable tenants and create shared collection`,+ ),+ });+ }+ }, [updateSetting, hasSharedCollections, createCollection, sendToast]);++ return (+ <Stack gap="lg">+ <img+ src="app/assets/img/embedding-onboarding/multi-tenant-user-strategy.svg"+ alt=""+ className={S.illustration}+ />++ <Text size="md" 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.`}+ </Text>++ <Text size="md" c="text-secondary" lh="lg">+ {t`The main benefit of tenants is that you can reuse the same dashboards and permissions across all tenants, instead of recreating them for each customer, while ensuring each tenant only sees its own data. A shared collection will be created to hold dashboards and charts that are shared between all tenants.`}+ </Text>++ <Group justify="flex-end">+ <Button+ variant="filled"+ onClick={enableTenantsAndCreateSharedCollection}+ loading={isEnablingTenants}+ disabled={isTenantsEnabled && hasSharedCollections}+ >+ {t`Enable tenants and create shared collection`}+ </Button>+ </Group>+ </Stack>+ );+};diff --git a/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/RlsDataSelector/RlsDataSelector.module.css b/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/RlsDataSelector/RlsDataSelector.module.cssnew file mode 100644index 00000000000..90d368f7246--- /dev/null+++ b/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/RlsDataSelector/RlsDataSelector.module.css@@ -0,0 +1,39 @@+[data-can-remove="true"]:hover .RemoveButton {+ opacity: 1;+}++.RemoveButton {+ position: absolute;+ top: 0.5rem;+ right: 0.5rem;+ display: flex;+ align-items: center;+ justify-content: center;+ width: 1.5rem;+ height: 1.5rem;+ border-radius: var(--mantine-radius-xs);+ color: var(--mb-color-text-secondary);+ opacity: 0;+ transition:+ opacity 0.15s ease,+ background 0.15s ease;+}++.RemoveButton:hover {+ background: var(--mb-color-background-hover);+ color: var(--mb-color-text-primary);+}++.PickerTrigger {+ border: 1px solid var(--mb-color-border);+ transition: border-color 0.15s ease;+ cursor: pointer;+}++.PickerTrigger:hover {+ border-color: var(--mb-color-brand);+}++.AddTableButton {+ color: var(--mb-color-brand);+}diff --git a/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/RlsDataSelector/RlsDataSelector.tsx b/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/RlsDataSelector/RlsDataSelector.tsxnew file mode 100644index 00000000000..4441ac58c02--- /dev/null+++ b/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/RlsDataSelector/RlsDataSelector.tsx@@ -0,0 +1,146 @@+import { useCallback, useState } from "react";+import { t } from "ttag";++import { getErrorMessage } from "metabase/api/utils";+import { useToast } from "metabase/common/hooks";+import { Button, Flex, Icon, Stack, Text, UnstyledButton } from "metabase/ui";+import type { FieldId, TableId } from "metabase-types/api";++import { useUpsertGroupTableAccessPolicies } from "../hooks/use-upsert-group-table-access-policies";++import S from "./RlsDataSelector.module.css";+import { TableColumnCard } from "./TableColumnCard";++export interface TableColumnSelection {+ tableId: TableId | null;+ columnId: FieldId | null;+ /** Resolved by TableColumnCard once table metadata is loaded */+ tableName?: string | null;+ columnName?: string | null;+}++export interface RlsSelectionResult {+ fieldIds: FieldId[];+ tableNames: string[];+ columnName: string | null;+}++interface RlsDataSelectorProps {+ onSuccess: (result: RlsSelectionResult) => void;+}++export const RlsDataSelector = ({ onSuccess }: RlsDataSelectorProps) => {+ const [sendToast] = useToast();++ const [selections, setSelections] = useState<TableColumnSelection[]>([+ { tableId: null, columnId: null },+ ]);++ const { handleUpsertPolicies, isCreatingPolicy, isLoadingPolicies } =+ useUpsertGroupTableAccessPolicies({ tableColumnSelections: selections });++ const handleSubmit = useCallback(async () => {+ try {+ await handleUpsertPolicies();+ onSuccess({+ fieldIds: selections+ .map((s) => s.columnId)+ .filter((id): id is FieldId => id != null),++ tableNames: selections+ .map((s) => s.tableName)+ .filter((name): name is string => name != null),++ // We use the first selection's column name for the summary description.+ // In practice, all tables in an RLS setup share the same tenant+ // identifier column (e.g. tenant_id).+ columnName: selections[0]?.columnName ?? null,+ });+ } catch (error) {+ sendToast({+ icon: "warning",+ toastColor: "error",+ message: getErrorMessage(+ error,+ t`Failed to configure row-level security`,+ ),+ });+ }+ }, [handleUpsertPolicies, selections, onSuccess, sendToast]);++ const addTable = useCallback(() => {+ setSelections((prev) => [...prev, { tableId: null, columnId: null }]);+ }, []);++ const removeTable = useCallback((nextIndex: number) => {+ setSelections((prev) =>+ prev.filter((_, prevIndex) => prevIndex !== nextIndex),+ );+ }, []);++ const updateTable = useCallback(+ (index: number, selection: TableColumnSelection) => {+ setSelections((prev) => {+ const newSelections = [...prev];+ newSelections[index] = selection;++ return newSelections;+ });+ },+ [],+ );++ const canRemove = selections.length > 1;++ const isAllTableAndColumnChosen = selections.every(+ (selection) => selection.tableId !== null && selection.columnId !== null,+ );++ return (+ <Stack gap="md">+ <Text size="md" c="text-secondary" lh="lg">+ {t`Select one or more tables to be made visible to tenant users, and the column to filter by. Only rows where the value in the selected column matches the organization_id attribute will be visible to tenant users. You will create tenants and configure this attribute in the next step.`}+ </Text>++ <Text size="md" c="text-secondary" lh="lg">+ {t`Tenant users will be able to create queries on these tables with the query builder. All other tables will be blocked.`}+ </Text>++ <Stack gap="md">+ {selections.map((selection, index) => {+ // Get all selected table ids, except the current card's selection+ const selectedTableIds = selections+ .filter((_, filterIndex) => filterIndex !== index)+ .map((selection) => selection.tableId)+ .filter((tableId) => tableId !== null);++ return (+ <TableColumnCard+ key={index}+ selection={selection}+ onChange={(nextSelection) => updateTable(index, nextSelection)}+ onRemove={canRemove ? () => removeTable(index) : undefined}+ selectedTableIds={selectedTableIds}+ />+ );+ })}+ </Stack>++ <Flex justify="space-between" align="center">+ <UnstyledButton onClick={addTable} className={S.AddTableButton}>+ <Flex align="center" gap="xs">+ <Icon name="add" size={16} />+ <Text fw="bold" size="md" c="inherit">{t`Add table`}</Text>+ </Flex>+ </UnstyledButton>++ <Button+ variant="filled"+ disabled={!isAllTableAndColumnChosen || isLoadingPolicies}+ onClick={handleSubmit}+ loading={isCreatingPolicy}+ >{t`Next`}</Button>+ </Flex>+ </Stack>+ );+};diff --git a/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/RlsDataSelector/TableColumnCard.tsx b/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/RlsDataSelector/TableColumnCard.tsxnew file mode 100644index 00000000000..5d18533f3d8--- /dev/null+++ b/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/RlsDataSelector/TableColumnCard.tsx@@ -0,0 +1,208 @@+import { useDisclosure } from "@mantine/hooks";+import { useCallback } from "react";+import { t } from "ttag";++import { useGetTableQueryMetadataQuery } from "metabase/api";+import type { OmniPickerItem } from "metabase/common/components/Pickers";+import { DataPickerModal } from "metabase/common/components/Pickers/DataPicker";+import { MiniPicker } from "metabase/common/components/Pickers/MiniPicker";+import type {+ MiniPickerItem,+ MiniPickerPickableItem,+} from "metabase/common/components/Pickers/MiniPicker/types";+import {+ Box,+ Flex,+ Icon,+ Paper,+ Select,+ Stack,+ Text,+ UnstyledButton,+} from "metabase/ui";+import type { TableId } from "metabase-types/api";++import type { TableColumnSelection } from "./RlsDataSelector";+import S from "./RlsDataSelector.module.css";++interface TableColumnCardProps {+ selection: TableColumnSelection;+ onChange: (selection: TableColumnSelection) => void;+ onRemove?: () => void;++ /** Table IDs that are already selected in other cards and should be hidden */+ selectedTableIds?: TableId[];+}++export const TableColumnCard = ({+ selection,+ onChange,+ onRemove,+ selectedTableIds = [],+}: TableColumnCardProps) => {+ const [isPickerOpen, { close: closePicker, open: openPicker }] =+ useDisclosure(false);+ const [isBrowsing, { open: openBrowse, close: closeBrowse }] =+ useDisclosure(false);++ const { data: tableMetadata, isLoading: isLoadingTable } =+ useGetTableQueryMetadataQuery(+ { id: selection.tableId! },+ { skip: !selection.tableId },+ );++ const handleTableSelect = useCallback(+ (item: MiniPickerPickableItem) => {+ if (item.model === "table") {+ onChange({+ tableId: item.id,+ columnId: null,+ tableName: null,+ columnName: null,+ });+ closePicker();+ }+ },+ [onChange, closePicker],+ );++ const handleModalSelect = useCallback(+ (tableId: TableId) => {+ onChange({ tableId, columnId: null, tableName: null, columnName: null });+ closeBrowse();+ },+ [onChange, closeBrowse],+ );++ const handleBrowseAll = useCallback(() => {+ closePicker();+ openBrowse();+ }, [closePicker, openBrowse]);++ const handleColumnSelect = useCallback(+ (columnId: string | null) => {+ const field = tableMetadata?.fields?.find(+ (f) => String(f.id) === columnId,+ );+ onChange({+ ...selection,+ columnId: columnId ? Number(columnId) : null,+ tableName: tableMetadata?.display_name ?? null,+ columnName: field?.display_name ?? null,+ });+ },+ [selection, onChange, tableMetadata],+ );++ const columnOptions =+ tableMetadata?.fields?.map((field) => ({+ value: String(field.id),+ label: field.display_name,+ })) ?? [];++ const selectedTableName = tableMetadata?.display_name;++ const pickerValue = selection.tableId+ ? { model: "table" as const, id: selection.tableId }+ : undefined;++ // Hide tables that are already selected in other cards+ const shouldHidePickerItem = useCallback(+ (pickerItem: MiniPickerItem | OmniPickerItem) =>+ pickerItem.model === "table" && selectedTableIds.includes(pickerItem.id),+ [selectedTableIds],+ );++ return (+ <Paper withBorder radius="md" pos="relative" data-can-remove={!!onRemove}>+ {onRemove && (+ <UnstyledButton+ className={S.RemoveButton}+ onClick={onRemove}+ aria-label={t`Remove table`}+ >+ <Icon name="close" size={16} />+ </UnstyledButton>+ )}++ <Stack gap="lg" p="lg">+ <Box>+ <Text fw="bold" size="md" mb={4}>+ {t`Table`}+ </Text>+ <Text size="sm" c="text-secondary" mb="sm">+ {t`Will be visible to all tenant users`}+ </Text>++ <Flex+ component="button"+ type="button"+ className={S.PickerTrigger}+ onClick={openPicker}+ align="center"+ justify="space-between"+ w="100%"+ px="0.75rem"+ py="sm"+ bg="background-primary"+ bdrs="xs"+ >+ <Text+ c={selectedTableName ? "text-primary" : "text-tertiary"}+ size="md"+ >+ {selectedTableName ?? t`Pick a table`}+ </Text>++ <Icon name="chevrondown" size={16} />+ </Flex>++ <MiniPicker+ value={pickerValue}+ opened={isPickerOpen && !isBrowsing}+ onClose={closePicker}+ models={["table"]}+ onBrowseAll={handleBrowseAll}+ onChange={handleTableSelect}+ shouldShowLibrary={false}+ shouldHide={(item) => shouldHidePickerItem(item as MiniPickerItem)}+ />++ {isBrowsing && (+ <DataPickerModal+ title={t`Pick a table`}+ models={["table"]}+ onChange={handleModalSelect}+ onClose={closeBrowse}+ shouldDisableItem={shouldHidePickerItem}+ options={{+ hasLibrary: false,+ hasRootCollection: false,+ hasPersonalCollections: false,+ }}+ />+ )}+ </Box>++ <Box>+ <Text fw="bold" size="md" mb={4}>+ {t`Column to filter by`}+ </Text>++ <Text size="sm" c="text-secondary" mb="sm">+ {t`Tenant users will only see rows where this equals the organization_id attribute.`}+ </Text>++ <Select+ placeholder={t`Pick a column`}+ data={columnOptions}+ value={selection.columnId ? String(selection.columnId) : null}+ onChange={handleColumnSelect}+ disabled={!selection.tableId || isLoadingTable}+ comboboxProps={{ position: "bottom" }}+ />+ </Box>+ </Stack>+ </Paper>+ );+};diff --git a/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/RlsDataSelector/index.ts b/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/RlsDataSelector/index.tsnew file mode 100644index 00000000000..7218ce268f3--- /dev/null+++ b/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/RlsDataSelector/index.ts@@ -0,0 +1,5 @@+export {+ RlsDataSelector,+ type TableColumnSelection,+ type RlsSelectionResult,+} from "./RlsDataSelector";diff --git a/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/SetupPermissionsAndTenantsPage.module.css b/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/SetupPermissionsAndTenantsPage.module.cssnew file mode 100644index 00000000000..aca5a20a1a0--- /dev/null+++ b/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/SetupPermissionsAndTenantsPage.module.css@@ -0,0 +1,12 @@+.backLink {+ text-decoration: none;+}++.backLink:hover {+ text-decoration: underline;+}++.illustration {+ width: 100%;+ border-radius: 0.375rem;+}diff --git a/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/SetupPermissionsAndTenantsPage.tsx b/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/SetupPermissionsAndTenantsPage.tsxnew file mode 100644index 00000000000..74c3e9f77ab--- /dev/null+++ b/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/SetupPermissionsAndTenantsPage.tsx@@ -0,0 +1,204 @@+import { useMemo, useRef, useState } from "react";+import { Link } from "react-router";+import { match } from "ts-pattern";+import { t } from "ttag";++import { useGetEmbeddingHubChecklistQuery } from "metabase/api/embedding-hub";+import { OnboardingStepper } from "metabase/common/components/OnboardingStepper";+import type { OnboardingStepperHandle } from "metabase/common/components/OnboardingStepper/types";+import {+ type CreatedTenantData,+ PLUGIN_TENANTS,+} from "metabase/plugins/oss/tenants";+import { Group, Icon, Stack, Text, Title } from "metabase/ui";++import { ConnectionImpersonationStepContent } from "./ConnectionImpersonationStepContent";+import {+ type DataSegregationStrategy,+ DataSegregationStrategyPicker,+} from "./DataSegregationStrategyPicker";+import { DatabaseRoutingStepContent } from "./DatabaseRoutingStepContent";+import { EnableTenantsStepContent } from "./EnableTenantsStepContent";+import type { RlsSelectionResult } from "./RlsDataSelector";+import { RlsDataSelector } from "./RlsDataSelector";+import S from "./SetupPermissionsAndTenantsPage.module.css";++const SETUP_GUIDE_PATH = "/admin/embedding/setup-guide";++export const SetupPermissionsAndTenantsPage = () => {+ const stepperRef = useRef<OnboardingStepperHandle>(null);++ const { data: checklistResponse } = useGetEmbeddingHubChecklistQuery();+ const checklist = checklistResponse?.checklist;++ // The "Which data segregation strategy does your database use?"+ // is a purely UI step for choosing which strategy to use.+ const [selectedStrategy, setSelectedStrategy] =+ useState<DataSegregationStrategy | null>(null);++ const [isStrategyConfirmed, setIsStrategyConfirmed] = useState(false);++ // Track the tenants created in this onboarding flow+ const [createdTenants, setCreatedTenants] = useState<CreatedTenantData[]>([]);++ // Track RLS selection from the "Select data" step (in-session only)+ const [rlsSelection, setRlsSelection] = useState<RlsSelectionResult>({+ fieldIds: [],+ tableNames: [],+ columnName: null,+ });++ // Prefer in-session UI state; fall back to backend detection for reloads+ const activeStrategy =+ selectedStrategy ?? checklistResponse?.["data-isolation-strategy"] ?? null;++ const isTenantsEnabled = checklist?.["enable-tenants"] ?? false;++ const isDataSegregationSetupDone =+ checklist?.["setup-data-segregation-strategy"] ?? false;++ const isTenantsCreated = checklist?.["create-tenants"] ?? false;++ // When data segregation is finally configured, we permanently+ // mark this step as done. Otherwise rely on UI state.+ const isPickDataStrategyDone =+ isStrategyConfirmed || isDataSegregationSetupDone;++ const completedSteps = useMemo(() => {+ return {+ "enable-tenants": isTenantsEnabled,+ "data-segregation": isPickDataStrategyDone,+ "select-data": isDataSegregationSetupDone,+ "create-tenants": isTenantsCreated,++ summary:+ isTenantsEnabled && isDataSegregationSetupDone && isTenantsCreated,+ };+ }, [+ isTenantsEnabled,+ isPickDataStrategyDone,+ isDataSegregationSetupDone,+ isTenantsCreated,+ ]);++ const lockedSteps = useMemo(() => {+ return {+ // Unlock once we know the strategy — either from in-session confirmation+ // or from the backend on reload.+ "select-data": activeStrategy === null,+ "create-tenants": !isPickDataStrategyDone,+ summary: !(+ isTenantsEnabled &&+ isPickDataStrategyDone &&+ isDataSegregationSetupDone &&+ isTenantsCreated+ ),+ };+ }, [+ activeStrategy,+ isPickDataStrategyDone,+ isTenantsEnabled,+ isDataSegregationSetupDone,+ isTenantsCreated,+ ]);++ return (+ <Stack mx="auto" gap="sm" maw={680}>+ <Link to={SETUP_GUIDE_PATH} className={S.backLink}>+ <Group gap="xs">+ <Icon name="chevronleft" size={12} />+ <Text size="sm" c="text-secondary">{t`Back to the setup guide`}</Text>+ </Group>+ </Link>++ <Title order={1} c="text-primary" mb="xl">+ {t`Configure data permissions and enable tenants`}+ </Title>++ <OnboardingStepper+ ref={stepperRef}+ completedSteps={completedSteps}+ lockedSteps={lockedSteps}+ >+ <OnboardingStepper.Step+ stepId="enable-tenants"+ title={t`Enable multi-tenant user strategy`}+ >+ <EnableTenantsStepContent isTenantsEnabled={isTenantsEnabled} />+ </OnboardingStepper.Step>++ <OnboardingStepper.Step+ stepId="data-segregation"+ title={t`Which data segregation strategy does your database use?`}+ >+ <DataSegregationStrategyPicker+ value={activeStrategy}+ onChange={(value) => {+ setSelectedStrategy(value);+ setIsStrategyConfirmed(false);+ }}+ onConfirm={() => {+ setIsStrategyConfirmed(true);++ // User is re-configuring the data segregation,+ // so we need to _always_ go to the next step.+ stepperRef.current?.goToNextStep();+ }}+ />+ </OnboardingStepper.Step>++ <OnboardingStepper.Step+ stepId="select-data"+ title={t`Select data to make available`}+ // Database routing step links to documentation+ hideTitleOnActive={activeStrategy === "database-routing"}+ >+ {match(activeStrategy)+ .with("row-column-level-security", () => (+ <RlsDataSelector+ onSuccess={(result) => {+ setRlsSelection(result);++ // User might had already created tenants before,+ // so we allow jumping straight to the summary flow.+ stepperRef.current?.goToNextIncompleteStep();+ }}+ />+ ))+ .with("database-routing", () => <DatabaseRoutingStepContent />)+ .with("connection-impersonation", () => (+ <ConnectionImpersonationStepContent+ onNext={() => stepperRef.current?.goToNextIncompleteStep()}+ />+ ))+ .otherwise(() => null)}+ </OnboardingStepper.Step>++ <OnboardingStepper.Step+ stepId="create-tenants"+ title={t`Create tenants`}+ >+ <PLUGIN_TENANTS.CreateTenantsOnboardingStep+ onTenantsCreated={setCreatedTenants}+ selectedFieldIds={rlsSelection.fieldIds}+ strategy={activeStrategy}+ rlsColumnName={rlsSelection.columnName}+ />+ </OnboardingStepper.Step>++ <OnboardingStepper.Step+ stepId="summary"+ title={t`Summary`}+ hideTitleOnActive+ >+ <PLUGIN_TENANTS.TenantsSummaryOnboardingStep+ tenants={createdTenants}+ strategy={activeStrategy}+ rlsTableNames={rlsSelection.tableNames}+ rlsColumnName={rlsSelection.columnName}+ />+ </OnboardingStepper.Step>+ </OnboardingStepper>+ </Stack>+ );+};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/embedding-hub/components/SetupPermissionsAndTenantsPage/hooks/use-update-all-tenant-users-group-permissions.tsnew file mode 100644index 00000000000..8e943abb957--- /dev/null+++ b/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/hooks/use-update-all-tenant-users-group-permissions.ts@@ -0,0 +1,107 @@+import { useCallback, useMemo } from "react";++import { Api, useListPermissionsGroupsQuery } from "metabase/api";+import { listTag } from "metabase/api/tags";+import { useDispatch } from "metabase/lib/redux";+import { PLUGIN_TENANTS } from "metabase/plugins";+import { PermissionsApi } from "metabase/services";++import {+ type UpdateTenantDataAccessOptions,+ buildPermissionsGraph,+ buildSandboxPolicies,+} from "../utils/permission-utils";++interface UseUpdateAllTenantUsersGroupPermissionsResult {+ /**+ * Updates data access for the tenant users group in a single API call.+ * Supports both connection impersonation and row-level security (sandboxing).+ */+ updateDataAccess: (options: UpdateTenantDataAccessOptions) => Promise<void>;++ tenantUsersGroupId?: number;++ /** Whether the tenant users group data is still loading */+ isLoading: boolean;++ /** Whether the hook is ready to update permissions */+ isReady: boolean;+}++/**+ * Hook for updating data access for the "All tenant users" group:+ *+ * - Row-level security (table-level)+ * - Connection impersonation (database-level)+ */+export function useUpdateAllTenantUsersGroupPermissions(): UseUpdateAllTenantUsersGroupPermissionsResult {+ const dispatch = useDispatch();++ const { data: permissionGroups, isLoading } = useListPermissionsGroupsQuery(+ {},+ );++ const allTenantUsersGroupId = useMemo(+ () => permissionGroups?.find(PLUGIN_TENANTS.isExternalUsersGroup)?.id,+ [permissionGroups],+ );++ const updateDataAccess = useCallback(+ async (options: UpdateTenantDataAccessOptions) => {+ if (allTenantUsersGroupId === undefined) {+ return;+ }++ const { impersonatedDatabaseIds = [], sandboxedTables = [] } = options;++ // at least one impersonations or sandboxes are needed to setup+ if (+ impersonatedDatabaseIds.length === 0 &&+ sandboxedTables.length === 0+ ) {+ return;+ }++ // get the revision number of the graph+ const graph = await PermissionsApi.graphForGroup({+ groupId: allTenantUsersGroupId,+ });++ const groups = buildPermissionsGraph(allTenantUsersGroupId, options);+ const sandboxes = buildSandboxPolicies(+ allTenantUsersGroupId,+ sandboxedTables,+ );++ const impersonations = impersonatedDatabaseIds.map((databaseId) => ({+ db_id: databaseId,+ group_id: allTenantUsersGroupId,+ attribute: "database_role",+ }));++ await PermissionsApi.updateGraph({+ groups,+ revision: graph?.revision,+ ...(sandboxes.length > 0 && { sandboxes }),+ ...(impersonations.length > 0 && { impersonations }),+ });++ // invalidate the onboarding checklist and group table access policies+ // so subsequent updates can find the newly created sandbox IDs+ dispatch(+ Api.util.invalidateTags([+ listTag("embedding-hub-checklist"),+ listTag("group-table-access-policy"),+ ]),+ );+ },+ [allTenantUsersGroupId, dispatch],+ );++ return {+ updateDataAccess,+ tenantUsersGroupId: allTenantUsersGroupId,+ isLoading,+ isReady: allTenantUsersGroupId !== undefined,+ };+}diff --git a/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/hooks/use-upsert-group-table-access-policies.ts b/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/hooks/use-upsert-group-table-access-policies.tsnew file mode 100644index 00000000000..d63051990e7--- /dev/null+++ b/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/hooks/use-upsert-group-table-access-policies.ts@@ -0,0 +1,96 @@+import { useCallback, useState } from "react";+import { t } from "ttag";++import { tableApi, useListGroupTableAccessPoliciesQuery } from "metabase/api";+import { useDispatch } from "metabase/lib/redux";++import type { TableColumnSelection } from "../RlsDataSelector";++import { useUpdateAllTenantUsersGroupPermissions } from "./use-update-all-tenant-users-group-permissions";++interface UseUpsertGroupTableAccessPoliciesProps {+ tableColumnSelections: TableColumnSelection[];+}++/**+ * Creates group table access policies (sandboxes)+ * for the given table and column selections.+ */+export const useUpsertGroupTableAccessPolicies = ({+ tableColumnSelections,+}: UseUpsertGroupTableAccessPoliciesProps) => {+ const dispatch = useDispatch();++ const [isCreatingPolicy, setIsCreatingPolicy] = useState(false);++ const { updateDataAccess, tenantUsersGroupId, isReady } =+ useUpdateAllTenantUsersGroupPermissions();++ const { data: existingPolicies, isLoading: isLoadingPolicies } =+ useListGroupTableAccessPoliciesQuery(+ tenantUsersGroupId ? { group_id: tenantUsersGroupId } : undefined,+ { skip: !tenantUsersGroupId },+ );++ const handleUpsertPolicies = useCallback(async () => {+ if (!tenantUsersGroupId) {+ throw new Error(+ t`Could not find the tenant users group. Please enable tenants first.`,+ );+ }++ try {+ setIsCreatingPolicy(true);++ const nextPolicies = await Promise.all(+ tableColumnSelections.map(async (selection) => {+ if (selection.tableId === null || selection.columnId === null) {+ return null;+ }++ const { data: table } = await dispatch(+ tableApi.endpoints.getTable.initiate({ id: selection.tableId }),+ );++ if (!table) {+ return null;+ }++ const existingPolicy = existingPolicies?.find(+ (policy) => policy.table_id === selection.tableId,+ );++ return {+ tableId: table.id,+ databaseId: table.db_id,+ schemaName: table.schema ?? "",+ filterFieldId: selection.columnId,++ // If existing policy is found, this updates+ // the policy rather than creating a new one.+ ...(existingPolicy && { id: existingPolicy.id }),+ };+ }),+ );++ const sandboxedTables = nextPolicies.filter((entry) => entry != null);+ await updateDataAccess({ sandboxedTables });+ } finally {+ setIsCreatingPolicy(false);+ }+ }, [+ tenantUsersGroupId,+ tableColumnSelections,+ updateDataAccess,+ dispatch,+ existingPolicies,+ ]);++ return {+ handleUpsertPolicies,+ isCreatingPolicy,+ isLoadingPolicies,+ isReady,+ existingPolicies,+ };+};diff --git a/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/index.ts b/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/index.tsnew file mode 100644index 00000000000..88fd622abc2--- /dev/null+++ b/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/index.ts@@ -0,0 +1 @@+export { SetupPermissionsAndTenantsPage } from "./SetupPermissionsAndTenantsPage";diff --git a/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/utils/permission-utils.ts b/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/utils/permission-utils.tsnew file mode 100644index 00000000000..9087f006820--- /dev/null+++ b/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/utils/permission-utils.ts@@ -0,0 +1,104 @@+import type {+ DatabaseId,+ FieldId,+ GroupId,+ GroupTableAccessPolicy,+ TableId,+} from "metabase-types/api";++export interface UpdateTenantDataAccessOptions {+ /** Database IDs to enable connection impersonation for */+ impersonatedDatabaseIds?: DatabaseId[];++ /** Tables to enable sandboxing (row-level security) for */+ sandboxedTables?: SandboxedTableConfig[];+}++/** Input type for creating/updating sandbox policies via the API */+type SandboxPolicyInput = Partial<Pick<GroupTableAccessPolicy, "id">> &+ Omit<GroupTableAccessPolicy, "id" | "permission_id">;++type SandboxedTableConfig = {+ /**+ * Existing sandbox ID.+ * If provided, updates the existing sandbox.+ **/+ id?: number;++ tableId: TableId;+ databaseId: DatabaseId;+ schemaName: string;++ /** The field to use for tenant filtering */+ filterFieldId: FieldId;+};++type DatabasePermissionGraph = Record<+ string,+ string | Record<string, Record<TableId, string>>+>;++/**+ * Builds the permission graph structure for the API call.+ */+export function buildPermissionsGraph(+ groupId: GroupId,+ options: UpdateTenantDataAccessOptions,+): Record<GroupId, Record<DatabaseId, DatabasePermissionGraph>> {+ const { impersonatedDatabaseIds = [], sandboxedTables = [] } = options;++ const groupGraph: Record<DatabaseId, DatabasePermissionGraph> = {};++ // Add database-level impersonation permissions+ for (const databaseId of impersonatedDatabaseIds) {+ groupGraph[databaseId] = {+ "view-data": "impersonated",+ "create-queries": "query-builder",+ };+ }++ // Add table-level sandbox permissions+ for (const table of sandboxedTables) {+ const { databaseId, schemaName, tableId } = table;+ const schema = schemaName ?? "";++ if (!groupGraph[databaseId]) {+ groupGraph[databaseId] = { "create-queries": "query-builder" };+ }++ const dbPerms = groupGraph[databaseId];+ if (!dbPerms["view-data"] || typeof dbPerms["view-data"] === "string") {+ dbPerms["view-data"] = {};+ }++ const viewData = dbPerms["view-data"] as Record<+ string,+ Record<TableId, string>+ >;++ if (!viewData[schema]) {+ viewData[schema] = {};+ }++ viewData[schema][tableId as TableId] = "sandboxed";+ }++ return { [groupId]: groupGraph };+}++/**+ * Builds the sandbox policies array for the API call.+ */+export const buildSandboxPolicies = (+ groupId: GroupId,+ sandboxedTables: SandboxedTableConfig[] = [],+): SandboxPolicyInput[] =>+ sandboxedTables.map((table) => ({+ ...(table.id != null && { id: table.id }),+ table_id: Number(table.tableId),+ group_id: groupId,+ card_id: null,+ attribute_remappings: {+ organization_id: ["dimension", ["field", table.filterFieldId, null]],+ },+ }));diff --git a/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/utils/permission-utils.unit.spec.ts b/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/utils/permission-utils.unit.spec.tsnew file mode 100644index 00000000000..84aa0c940eb--- /dev/null+++ b/frontend/src/metabase/embedding/embedding-hub/components/SetupPermissionsAndTenantsPage/utils/permission-utils.unit.spec.ts@@ -0,0 +1,45 @@+import { buildPermissionsGraph } from "./permission-utils";++describe("buildPermissionsGraph", () => {+ const groupId = 10;++ it("sets view-data to 'impersonated' for database impersonation", () => {+ const result = buildPermissionsGraph(groupId, {+ impersonatedDatabaseIds: [1, 2],+ });++ expect(result).toEqual({+ [groupId]: {+ 1: { "view-data": "impersonated", "create-queries": "query-builder" },+ 2: { "view-data": "impersonated", "create-queries": "query-builder" },+ },+ });+ });++ it("sets view-data to 'sandboxed' for table sandboxing, grouped by schema", () => {+ const result = buildPermissionsGraph(groupId, {+ sandboxedTables: [+ { tableId: 100, databaseId: 1, schemaName: "public", filterFieldId: 5 },+ { tableId: 101, databaseId: 1, schemaName: "public", filterFieldId: 6 },+ {+ tableId: 200,+ databaseId: 1,+ schemaName: "private",+ filterFieldId: 7,+ },+ ],+ });++ expect(result).toEqual({+ [groupId]: {+ 1: {+ "view-data": {+ public: { 100: "sandboxed", 101: "sandboxed" },+ private: { 200: "sandboxed" },+ },+ "create-queries": "query-builder",+ },+ },+ });+ });+});diff --git a/frontend/src/metabase/embedding/embedding-hub/components/SetupSsoPage/AddEndpointStep.tsx b/frontend/src/metabase/embedding/embedding-hub/components/SetupSsoPage/AddEndpointStep.tsxnew file mode 100644index 00000000000..a50939a2835--- /dev/null+++ b/frontend/src/metabase/embedding/embedding-hub/components/SetupSsoPage/AddEndpointStep.tsx@@ -0,0 +1,51 @@+/* eslint-disable metabase/no-unconditional-metabase-links-render */++import { jt, t } from "ttag";++import { CopyButton } from "metabase/common/components/CopyButton";+import { useDocsUrl, useSetting } from "metabase/common/hooks";+import { Anchor, Button, Group, Stack, Text, TextInput } from "metabase/ui";++import S from "./SetupSsoPage.module.css";++export const AddEndpointStep = ({ onDone }: { onDone: () => void }) => {+ const jwtSharedSecret = useSetting("jwt-shared-secret");++ // TODO(EMB-1337): replace this with standalone JWT backend docs page.+ const { url: jwtDocsUrl } = useDocsUrl("embedding/authentication");++ const jwtDocsIframeUrl = `${jwtDocsUrl}?hide_nav=true&no_gdpr=true`;++ return (+ <Stack gap="lg">+ <TextInput+ label={t`JWT Signing Key`}+ description={t`This secret is used to sign JWT tokens. Replace YOUR_SECRET_HERE in the below snippet with this value.`}+ value={jwtSharedSecret ?? ""}+ readOnly+ rightSection={<CopyButton value={jwtSharedSecret ?? ""} />}+ rightSectionWidth={40}+ />++ <iframe+ src={jwtDocsIframeUrl}+ title={t`JWT Authentication Documentation`}+ className={S.docsIframe}+ />++ <Text size="sm" c="text-secondary">+ {jt`You can view more examples in the ${(+ <Anchor key="docs-link" href={jwtDocsUrl} target="_blank">+ {t`docs`}+ </Anchor>+ )}.`}+ </Text>++ <Group justify="flex-end">+ <Button variant="filled" onClick={onDone}>+ {t`Next`}+ </Button>+ </Group>+ </Stack>+ );+};diff --git a/frontend/src/metabase/embedding/embedding-hub/components/SetupSsoPage/SetupJwtStep.tsx b/frontend/src/metabase/embedding/embedding-hub/components/SetupSsoPage/SetupJwtStep.tsxnew file mode 100644index 00000000000..fb16b62e877--- /dev/null+++ b/frontend/src/metabase/embedding/embedding-hub/components/SetupSsoPage/SetupJwtStep.tsx@@ -0,0 +1,75 @@+/* eslint-disable metabase/no-literal-metabase-strings */+import { useCallback, useEffect, useState } from "react";+import { t } from "ttag";++import { useUpdateSettingsMutation } from "metabase/api";+import { useSetting, useToast } from "metabase/common/hooks";+import { UtilApi } from "metabase/services";+import { Button, Group, Stack, Text, TextInput } from "metabase/ui";++export const SetupJwtStep = ({ onSuccess }: { onSuccess: () => void }) => {+ const [sendToast] = useToast();+ const [updateSettings, { isLoading }] = useUpdateSettingsMutation();++ const existingJwtIdentityProviderUri = useSetting(+ "jwt-identity-provider-uri",+ );++ const [jwtIdentityProviderUri, setJwtIdentityProviderUri] = useState("");++ // Initialize with existing IdP URL if available+ useEffect(() => {+ if (existingJwtIdentityProviderUri) {+ setJwtIdentityProviderUri(existingJwtIdentityProviderUri);+ }+ }, [existingJwtIdentityProviderUri]);++ const handleEnableJwt = useCallback(async () => {+ try {+ const { token } = await UtilApi.random_token();++ await updateSettings({+ "jwt-identity-provider-uri": jwtIdentityProviderUri.trim(),+ "jwt-shared-secret": token,+ "jwt-enabled": true,+ "jwt-group-sync": true,+ }).unwrap();++ onSuccess();+ } catch (error) {+ sendToast({+ icon: "warning",+ toastColor: "error",+ message: t`Failed to enable JWT authentication`,+ });+ }+ }, [jwtIdentityProviderUri, updateSettings, sendToast, onSuccess]);++ return (+ <Stack gap="lg">+ <Text size="md" c="text-secondary" lh="lg">+ {t`To implement SSO you will need to add a new endpoint to your app. You can connect Metabase to your identity provider using JSON Web Tokens (JWT) to authenticate people. Enabling JWT authentication will also create a signing key and enable group sync.`}+ </Text>++ <TextInput+ label={t`JWT Identity Provider URI`}+ description={t`This is where Metabase will redirect login requests`}+ placeholder="http://localhost:9090/metabase/sso"+ value={jwtIdentityProviderUri}+ onChange={(e) => setJwtIdentityProviderUri(e.target.value)}+ required+ />++ <Group justify="flex-end">+ <Button+ variant="filled"+ onClick={handleEnableJwt}+ loading={isLoading}+ disabled={!jwtIdentityProviderUri.trim()}+ >+ {t`Enable JWT authentication and continue`}+ </Button>+ </Group>+ </Stack>+ );+};diff --git a/frontend/src/metabase/embedding/embedding-hub/components/SetupSsoPage/SetupSsoPage.module.css b/frontend/src/metabase/embedding/embedding-hub/components/SetupSsoPage/SetupSsoPage.module.cssnew file mode 100644index 00000000000..38a101cd387--- /dev/null+++ b/frontend/src/metabase/embedding/embedding-hub/components/SetupSsoPage/SetupSsoPage.module.css@@ -0,0 +1,14 @@+.backLink {+ text-decoration: none;+}++.backLink:hover {+ text-decoration: underline;+}++.docsIframe {+ width: 100%;+ height: 50rem;+ border: 1px solid var(--mb-color-border);+ border-radius: 0.5rem;+}diff --git a/frontend/src/metabase/embedding/embedding-hub/components/SetupSsoPage/SetupSsoPage.tsx b/frontend/src/metabase/embedding/embedding-hub/components/SetupSsoPage/SetupSsoPage.tsxnew file mode 100644index 00000000000..52d7f5b966e--- /dev/null+++ b/frontend/src/metabase/embedding/embedding-hub/components/SetupSsoPage/SetupSsoPage.tsx@@ -0,0 +1,84 @@+import { useMemo, useRef, useState } from "react";+import { Link } from "react-router";+import { t } from "ttag";++import { useGetEmbeddingHubChecklistQuery } from "metabase/api/embedding-hub";+import { OnboardingStepper } from "metabase/common/components/OnboardingStepper";+import type { OnboardingStepperHandle } from "metabase/common/components/OnboardingStepper/types";+import { Group, Icon, Stack, Text, Title } from "metabase/ui";++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 stepperRef = useRef<OnboardingStepperHandle>(null);++ const { data: checklistResponse } = useGetEmbeddingHubChecklistQuery();+ const checklist = checklistResponse?.checklist;++ // UI-only confirmation state for step 2+ const [isAddEndpointConfirmed, setIsAddEndpointConfirmed] = useState(false);++ const handleAddEndpointDone = () => {+ setIsAddEndpointConfirmed(true);+ stepperRef.current?.goToNextStep();+ };++ const completedSteps = useMemo(() => {+ const isSsoAuthManualTested =+ checklist?.["sso-auth-manual-tested"] ?? false;++ return {+ "setup-jwt": checklist?.["sso-configured"] ?? false,+ "add-endpoint": isAddEndpointConfirmed || isSsoAuthManualTested,+ "test-jwt": isSsoAuthManualTested,+ };+ }, [checklist, isAddEndpointConfirmed]);++ return (+ <Stack mx="auto" gap="sm" maw={680}>+ <Link to={SETUP_GUIDE_PATH} className={S.backLink}>+ <Group gap="xs">+ <Icon name="chevronleft" size={12} />+ <Text size="sm" c="text-secondary">{t`Back to the setup guide`}</Text>+ </Group>+ </Link>++ <Title order={1} c="text-primary" mb="xl">+ {t`Configure SSO`}+ </Title>++ <OnboardingStepper+ ref={stepperRef}+ completedSteps={completedSteps}+ lockedSteps={{}}+ >+ <OnboardingStepper.Step+ stepId="setup-jwt"+ title={t`Set up JWT authentication`}+ >+ <SetupJwtStep onSuccess={() => stepperRef.current?.goToNextStep()} />+ </OnboardingStepper.Step>++ <OnboardingStepper.Step+ stepId="add-endpoint"+ title={t`Add a new endpoint to your app`}+ >+ <AddEndpointStep onDone={handleAddEndpointDone} />+ </OnboardingStepper.Step>++ <OnboardingStepper.Step+ stepId="test-jwt"+ title={t`Test that JWT authentication is working correctly`}+ hideTitleOnActive+ >+ <TestJwtStep />+ </OnboardingStepper.Step>+ </OnboardingStepper>+ </Stack>+ );+};diff --git a/frontend/src/metabase/embedding/embedding-hub/components/SetupSsoPage/TestJwtStep.tsx b/frontend/src/metabase/embedding/embedding-hub/components/SetupSsoPage/TestJwtStep.tsxnew file mode 100644index 00000000000..7f8b8bb607b--- /dev/null+++ b/frontend/src/metabase/embedding/embedding-hub/components/SetupSsoPage/TestJwtStep.tsx@@ -0,0 +1,131 @@+/* eslint-disable metabase/no-literal-metabase-strings */++import { useState } from "react";+import { Link } from "react-router";+import { t } from "ttag";++import { useUpdateSettingsMutation } from "metabase/api";+import { useToast } from "metabase/common/hooks";+import { useHelpUrl } from "metabase/embedding/embedding-hub/hooks";+import { Button, Group, Stack, Text, Title } from "metabase/ui";++const SETUP_GUIDE_PATH = "/admin/embedding/setup-guide";++export const TestJwtStep = () => {+ const [sendToast] = useToast();+ const [updateSettings] = useUpdateSettingsMutation();++ const [showTroubleshooting, setShowTroubleshooting] = useState(false);++ const onDone = async () => {+ try {+ await updateSettings({+ "embedding-hub-sso-auth-manual-tested": true,+ }).unwrap();+ } catch (error) {+ sendToast({+ icon: "warning",+ toastColor: "error",+ message: t`Failed to save SSO test status`,+ });+ }+ };++ if (showTroubleshooting) {+ return <SsoTroubleshootingView onDone={onDone} />;+ }++ return (+ <Stack gap="lg">+ <Title order={3}>{t`Try logging in with SSO. Did it work?`}</Title>++ <Text size="md" c="text-secondary" lh="lg">+ {t`To check if JWT authentication was configured successfully, open Metabase in a different browser or in a private tab and try logging in to your account using single sign-on (SSO). Is login working correctly?`}+ </Text>++ <Group justify="flex-end">+ <Button variant="outline" onClick={() => setShowTroubleshooting(true)}>+ {t`No, I couldn't log in`}+ </Button>++ <Button+ component={Link}+ to={SETUP_GUIDE_PATH}+ variant="filled"+ onClick={onDone}+ >+ {t`Log in works, I'm done`}+ </Button>+ </Group>+ </Stack>+ );+};++const SsoTroubleshootingView = ({ onDone }: { onDone: () => void }) => {+ const helpUrl = useHelpUrl();++ return (+ <Stack gap="lg">+ <Title order={3}>{t`Troubleshooting`}</Title>++ <Text size="md" c="text-secondary" lh="lg">+ {t`Try the steps below before testing JWT authentication again. If nothing works, consider contacting support.`}+ </Text>++ <Stack gap="md">+ <div>+ <Text fw={700} mb="xs">{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.`}+ </Text>+ </div>++ <div>+ <Text+ fw={700}+ mb="xs"+ >{t`JWT decryption error: "Message seems corrupt"`}</Text>++ <Text size="md" c="text-secondary" lh="lg">+ {t`If after being redirected from your app to Metabase, you see "Message seems corrupt or manipulated" there was an issue decrypting signed JWT. Ensure METABASE_JWT_SHARED_SECRET has the right value.`}+ </Text>+ </div>++ <div>+ <Text fw={700} mb="xs">{t`Tenant ID mismatch error`}</Text>++ <Text size="md" c="text-secondary" lh="lg">+ {t`If after being redirected from your app to Metabase, you see an error message "Tenant ID mismatch with existing user", your application is trying to sign in a the user with the wrong tenant slug. Review @tenant claim in the JWT and ensure it matches the tenant this tenant user belongs to.`}+ </Text>+ </div>++ <div>+ <Text+ fw={700}+ mb="xs"+ >{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.`}+ </Text>+ </div>+ </Stack>++ <Group justify="flex-end">+ <Button component="a" href={helpUrl} target="_blank" variant="outline">+ {t`Contact customer support`}+ </Button>++ <Button+ component={Link}+ to={SETUP_GUIDE_PATH}+ variant="filled"+ onClick={onDone}+ >+ {t`Log in works, I'm done`}+ </Button>+ </Group>+ </Stack>+ );+};diff --git a/frontend/src/metabase/embedding/embedding-hub/components/SetupSsoPage/index.ts b/frontend/src/metabase/embedding/embedding-hub/components/SetupSsoPage/index.tsnew file mode 100644index 00000000000..060125baae0--- /dev/null+++ b/frontend/src/metabase/embedding/embedding-hub/components/SetupSsoPage/index.ts@@ -0,0 +1 @@+export { SetupSsoPage } from "./SetupSsoPage";diff --git a/frontend/src/metabase/embedding/embedding-hub/components/index.ts b/frontend/src/metabase/embedding/embedding-hub/components/index.tsindex 6f2da5e236b..86cd5648acc 100644--- a/frontend/src/metabase/embedding/embedding-hub/components/index.ts+++ b/frontend/src/metabase/embedding/embedding-hub/components/index.ts@@ -1,3 +1,5 @@export { EmbeddingHub } from "./EmbeddingHub";export { EmbeddingHubAdminSettingsPage } from "./EmbeddingHubAdminSettingsPage";export { EmbeddingHubHomePage } from "./EmbeddingHubHomePage";+export { SetupPermissionsAndTenantsPage } from "./SetupPermissionsAndTenantsPage";+export { SetupSsoPage } from "./SetupSsoPage";diff --git a/frontend/src/metabase/embedding/embedding-hub/hooks/index.ts b/frontend/src/metabase/embedding/embedding-hub/hooks/index.tsindex b467db7e0f2..c68f442ae66 100644--- a/frontend/src/metabase/embedding/embedding-hub/hooks/index.ts+++ b/frontend/src/metabase/embedding/embedding-hub/hooks/index.ts@@ -1,2 +1,3 @@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/hooks/use-completed-embedding-hub-steps.ts b/frontend/src/metabase/embedding/embedding-hub/hooks/use-completed-embedding-hub-steps.tsindex 3173afbaa63..99d5d879326 100644--- a/frontend/src/metabase/embedding/embedding-hub/hooks/use-completed-embedding-hub-steps.ts+++ b/frontend/src/metabase/embedding/embedding-hub/hooks/use-completed-embedding-hub-steps.ts@@ -11,27 +11,43 @@ export const useCompletedEmbeddingHubSteps = (): {data: Record<EmbeddingHubStepId, boolean>;isLoading: boolean;} => {- const { data: embeddingHubChecklist, isLoading } =+ const { data: checklistResponse, isLoading } =useGetEmbeddingHubChecklistQuery(undefined, {refetchOnMountOrArgChange: true,});const data = useMemo(() => {- if (isLoading || !embeddingHubChecklist) {+ const checklist = checklistResponse?.checklist;++ if (isLoading || !checklist) {return {+ // main checklist"create-test-embed": false,"add-data": false,"create-dashboard": false,"configure-row-column-security": false,- "secure-embeds": false,+ "sso-configured": false,"embed-production": false,- "create-models": false,- "setup-tenants": false,+ "data-permissions-and-enable-tenants": false,++ // "configure data permissions and enable tenants" sub-checklist+ "create-tenants": false,+ "enable-tenants": false,+ "setup-data-segregation-strategy": false,++ // "configure SSO" sub-checklist+ "sso-auth-manual-tested": false,};}- return embeddingHubChecklist;- }, [embeddingHubChecklist, isLoading]);+ // For the main embedding hub, the SSO step is only complete if both+ // SSO is configured AND the user has manually acknowledged it works+ return {+ ...checklist,+ "sso-configured":+ checklist["sso-configured"] && checklist["sso-auth-manual-tested"],+ };+ }, [checklistResponse, isLoading]);return { data, isLoading };};diff --git a/frontend/src/metabase/embedding/embedding-hub/hooks/use-get-embedding-hub-steps.ts b/frontend/src/metabase/embedding/embedding-hub/hooks/use-get-embedding-hub-steps.tsindex 900d18a7a89..4d649de7dd4 100644--- a/frontend/src/metabase/embedding/embedding-hub/hooks/use-get-embedding-hub-steps.ts+++ b/frontend/src/metabase/embedding/embedding-hub/hooks/use-get-embedding-hub-steps.ts@@ -8,7 +8,7 @@ import {} from "metabase/plugins";import { setOpenModalWithProps } from "metabase/redux/ui";-import type { EmbeddingHubAction, EmbeddingHubStep } from "../types";+import type { EmbeddingHubStep } from "../types";export const useGetEmbeddingHubSteps = (): EmbeddingHubStep[] => {const dispatch = useDispatch();@@ -71,56 +71,34 @@ export const useGetEmbeddingHubSteps = (): EmbeddingHubStep[] => {modal: { type: "xray-dashboard" },variant: "outline",},- {- title: t`Create models`,- description: t`Set up data models for your embedded analytics.`,- to: "/model/new",- optional: true,- stepId: "create-models",- },],};- const DATA_PERMISSION_CARD: EmbeddingHubAction = {- title: t`Configure data permissions`,- docsPath: "permissions/embedding",- anchor: "one-database-for-all-customers-commingled-setups",- description: t`Manage permissions to limit what data your users can access.`,- variant: "outline",- stepId: "configure-row-column-security",- optional: true,- };-- const SETUP_TENANTS: EmbeddingHubStep = {- id: "setup-tenants",+ const DATA_PERMISSIONS_AND_ENABLE_TENANTS: EmbeddingHubStep = {+ id: "data-permissions-and-enable-tenants",title: t`Pick a strategy for users and permissions`,actions: [{- title: t`Pick a user strategy`,- description: t`Decide between a multi-tenant or single-tenant user strategy.`,+ 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",variant: "outline",- modal: { type: "user-strategy" },+ stepId: "data-permissions-and-enable-tenants",},- DATA_PERMISSION_CARD,],};- const SECURE_EMBEDS: EmbeddingHubStep = {- id: "secure-embeds",+ const SSO_CONFIGURED: EmbeddingHubStep = {+ id: "sso-configured",title: t`Set up authentication`,actions: [{title: t`Configure SSO`,- description: t`Configure JWT or SAML authentication to ensure only authorized users can access your embeds.`,- docsPath: "embedding/embedded-analytics-js",- anchor: "set-up-sso",+ description: t`Configure JWT authentication to ensure only authorized users can access your embeds.`,+ to: "/admin/embedding/setup-guide/sso",variant: "outline",- stepId: "secure-embeds",+ stepId: "sso-configured",},-- // If tenants are not available, show data permission card on the authentication step.- // Otherwise, it is already shown on the tenants setup step.- ...(isTenantsFeatureAvailable ? [] : [DATA_PERMISSION_CARD]),],};@@ -148,8 +126,10 @@ export const useGetEmbeddingHubSteps = (): EmbeddingHubStep[] => {ADD_DATA,CREATE_DASHBOARD,TEST_EMBED,- ...(isTenantsFeatureAvailable ? [SETUP_TENANTS] : []),- SECURE_EMBEDS,+ ...(isTenantsFeatureAvailable+ ? [DATA_PERMISSIONS_AND_ENABLE_TENANTS]+ : []),+ SSO_CONFIGURED,EMBED_PRODUCTION,];}, [openEmbedModal]);diff --git a/frontend/src/metabase/embedding/embedding-hub/hooks/use-help-url.ts b/frontend/src/metabase/embedding/embedding-hub/hooks/use-help-url.tsnew file mode 100644index 00000000000..40e5d747b45--- /dev/null+++ b/frontend/src/metabase/embedding/embedding-hub/hooks/use-help-url.ts@@ -0,0 +1,12 @@+import { useSetting } from "metabase/common/hooks";+import { useSelector } from "metabase/lib/redux";+import { getIsPaidPlan } from "metabase/selectors/settings";++export const useHelpUrl = () => {+ const isPaidPlan = useSelector(getIsPaidPlan);+ const { tag } = useSetting("version");++ const path = isPaidPlan ? "help-premium" : "help";++ return `https://www.metabase.com/${path}?utm_source=in-product&utm_medium=menu&utm_campaign=help&instance_version=${tag}`;+};diff --git a/frontend/src/metabase/embedding/embedding-hub/types/embedding-checklist.ts b/frontend/src/metabase/embedding/embedding-hub/types/embedding-checklist.tsindex 4c88a02a270..c97f85ad7e0 100644--- a/frontend/src/metabase/embedding/embedding-hub/types/embedding-checklist.ts+++ b/frontend/src/metabase/embedding/embedding-hub/types/embedding-checklist.ts@@ -1,14 +1,18 @@import type { AddDataTab } from "metabase/nav/containers/MainNavbar/MainNavbarContainer/AddDataModal/utils";+export type DataSegregationStrategy =+ | "row-column-level-security"+ | "connection-impersonation"+ | "database-routing";+export type EmbeddingHubStepId =| "create-test-embed"| "add-data"| "create-dashboard"| "configure-row-column-security"- | "secure-embeds"+ | "sso-configured"| "embed-production"- | "create-models"- | "setup-tenants";+ | "data-permissions-and-enable-tenants";export interface EmbeddingHubStep {id: EmbeddingHubStepId;diff --git a/frontend/src/metabase/embedding/embedding-hub/types/index.ts b/frontend/src/metabase/embedding/embedding-hub/types/index.tsindex 03b4c37eca3..2ec6a454d35 100644--- a/frontend/src/metabase/embedding/embedding-hub/types/index.ts+++ b/frontend/src/metabase/embedding/embedding-hub/types/index.ts@@ -1,4 +1,5 @@export type {+ DataSegregationStrategy,EmbeddingHubStep,EmbeddingHubStepId,EmbeddingHubAction,diff --git a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/GetCodeStep.tsx b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/GetCodeStep.tsxindex 3a754dca46c..15fb4b22033 100644--- a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/GetCodeStep.tsx+++ b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/GetCodeStep.tsx@@ -37,7 +37,11 @@ export const GetCodeStep = () => {trackSnippetCopied("frontend");// Embedding Hub: track step completion- const settingKey: SettingKey = settings.useExistingUserSession+ // Test embed = guest or existing user session (for quick testing)+ // Production embed = full SSO setup+ const isTestEmbed = settings.isGuest || settings.useExistingUserSession;++ const settingKey: SettingKey = isTestEmbed? "embedding-hub-test-embed-snippet-created": "embedding-hub-production-embed-snippet-created";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 e478129f98c..870e3d865a5 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@@ -58,7 +58,11 @@ export const SdkIframeEmbedSetupContent = () => {function handleEmbedDone() {// Embedding Hub: track step completion- const settingKey: SettingKey = settings.useExistingUserSession+ // Test embed = guest or existing user session (for quick testing)+ // Production embed = full SSO setup+ const isTestEmbed = settings.isGuest || settings.useExistingUserSession;++ const settingKey: SettingKey = isTestEmbed? "embedding-hub-test-embed-snippet-created": "embedding-hub-production-embed-snippet-created";diff --git a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/hooks/use-recent-items.ts b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/hooks/use-recent-items.tsindex 8604d98663a..36aeaa10f74 100644--- a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/hooks/use-recent-items.ts+++ b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/hooks/use-recent-items.ts@@ -1,5 +1,6 @@import { useCallback, useMemo, useState } from "react";import { match } from "ts-pattern";+import _ from "underscore";import { useListRecentsQuery } from "metabase/api";import type { RecentItem } from "metabase-types/api";@@ -7,12 +8,19 @@ import type { RecentItem } from "metabase-types/api";import { EMBED_RESOURCE_LIST_MAX_RECENTS } from "../constants";import type { SdkIframeEmbedSetupRecentItem } from "../types";+import { useRecentlyCreatedDashboards } from "./use-recently-created-dashboards";+export const useRecentItems = () => {- const { data: apiRecentItems, isLoading } = useListRecentsQuery(+ const { data: recents, isLoading: isRecentsLoading } = useListRecentsQuery({ context: ["views", "selections"] },{ refetchOnMountOrArgChange: true },);+ const {+ recentlyCreatedDashboards,+ isLoading: isRecentlyCreatedDashboardsLoading,+ } = useRecentlyCreatedDashboards();+// Users can select dashboards from the dashboard picker.const [localRecentDashboards, setLocalRecentDashboards] = useState<SdkIframeEmbedSetupRecentItem[]@@ -29,28 +37,31 @@ export const useRecentItems = () => {>([]);const recentDashboards = useMemo(() => {+ // Recently created dashboards are prioritized first,+ // then local selections, then recent views from the activity log.+ const uniqueSuggestedDashboards = _.uniq(+ [...recentlyCreatedDashboards, ...localRecentDashboards],+ (recentItem) => recentItem.id,+ );+return getCombinedRecentItems("dashboard",- localRecentDashboards,- apiRecentItems ?? [],+ uniqueSuggestedDashboards,+ recents ?? [],);- }, [apiRecentItems, localRecentDashboards]);+ }, [recents, localRecentDashboards, recentlyCreatedDashboards]);const recentQuestions = useMemo(() => {- return getCombinedRecentItems(- "card",- localRecentQuestions,- apiRecentItems ?? [],- );- }, [apiRecentItems, localRecentQuestions]);+ return getCombinedRecentItems("card", localRecentQuestions, recents ?? []);+ }, [recents, localRecentQuestions]);const recentCollections = useMemo(() => {return getCombinedRecentItems("collection",localRecentCollections,- apiRecentItems ?? [],+ recents ?? [],);- }, [apiRecentItems, localRecentCollections]);+ }, [recents, localRecentCollections]);const addRecentItem = useCallback((@@ -79,7 +90,7 @@ export const useRecentItems = () => {recentQuestions,recentCollections,addRecentItem,- isRecentsLoading: isLoading,+ isRecentsLoading: isRecentsLoading || isRecentlyCreatedDashboardsLoading,};};diff --git a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/hooks/use-recently-created-dashboards.ts b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/hooks/use-recently-created-dashboards.tsnew file mode 100644index 00000000000..d6799572f67--- /dev/null+++ b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/hooks/use-recently-created-dashboards.ts@@ -0,0 +1,56 @@+import { useMemo } from "react";+import _ from "underscore";++import { useSearchQuery } from "metabase/api";+import { useSelector } from "metabase/lib/redux";+import { getUserId } from "metabase/selectors/user";+import type { SearchResult } from "metabase-types/api";++import type { SdkIframeEmbedSetupRecentItem } from "../types";++/**+ * Hook to fetch dashboards created by the current user.+ * Used for prioritize newly created dashboards in the embed wizard.+ */+export const useRecentlyCreatedDashboards = () => {+ const currentUserId = useSelector(getUserId);++ const { data: searchResults, isLoading } = useSearchQuery(+ {+ models: ["dashboard"],+ created_by: currentUserId ? [currentUserId] : undefined,+ limit: 5,++ // If the dashboard is created more than 1 hour ago,+ // it is likely stale and latest activity should take priority.+ created_at: "past1hours~",+ },+ { refetchOnMountOrArgChange: true },+ );++ const recentlyCreatedDashboards: SdkIframeEmbedSetupRecentItem[] =+ useMemo(() => {+ if (!searchResults?.data) {+ return [];+ }++ // The search API does not support sort_column, so we sort client-side.+ return searchResults.data+ .filter((result) => result.id !== undefined)+ .sort(sortSearchResultByCreationTime)+ .map((result) => _.pick(result, ["id", "name", "description"]));+ }, [searchResults?.data]);++ return {+ recentlyCreatedDashboards,+ isLoading,+ };+};++const sortSearchResultByCreationTime = (a: SearchResult, b: SearchResult) => {+ if (a.created_at === null || b.created_at === null) {+ return 0;+ }++ return new Date(b.created_at).getTime() - new Date(a.created_at).getTime();+};diff --git a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/utils/get-common-embed-settings.ts b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/utils/get-common-embed-settings.tsindex d65022f5538..c043cea7cc7 100644--- a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/utils/get-common-embed-settings.ts+++ b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/utils/get-common-embed-settings.ts@@ -55,7 +55,6 @@ const GET_DISABLE_GUEST_EMBED_SETTINGS: (data: {> = ({ experience, isSsoEnabledAndConfigured, useExistingUserSession }) => {const isQuestionOrDashboardEmbed =isQuestionOrDashboardExperience(experience);- const isQuestionEmbed = experience === "chart";return {...(isQuestionOrDashboardEmbed@@ -72,8 +71,12 @@ const GET_DISABLE_GUEST_EMBED_SETTINGS: (data: {useExistingUserSession:!isSsoEnabledAndConfigured || useExistingUserSession,}),- ...(isQuestionEmbed && {- // Currently, a chart should not have hidden parameters in non-guest embed mode+ ...(isQuestionOrDashboardEmbed && {+ // Reset hiddenParameters when switching from guest to SSO.+ // This is needed because when recentlyCreatedDashboards populates the+ // dashboardId or questionId, the embed wizard starts in guest mode and+ // sets all parameters as disabled in hiddenParameters. Without this reset,+ // the guest restrictions would carry over into SSO mode.hiddenParameters: [],}),};diff --git a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/utils/get-common-embed-settings.unit.spec.ts b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/utils/get-common-embed-settings.unit.spec.tsindex 8ce894ead51..5eb287a2fbf 100644--- a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/utils/get-common-embed-settings.unit.spec.ts+++ b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/utils/get-common-embed-settings.unit.spec.ts@@ -115,6 +115,7 @@ describe("getCommonEmbedSettings", () => {isSso: true,useExistingUserSession: true,drills: true,+ hiddenParameters: [],},},{@@ -126,6 +127,7 @@ describe("getCommonEmbedSettings", () => {isSso: true,useExistingUserSession: true,drills: true,+ hiddenParameters: [],},},{@@ -170,7 +172,11 @@ describe("getCommonEmbedSettings", () => {},);- it("should reset hiddenParameters for chart but not for dashboard in non-guest mode", () => {+ it("should reset hiddenParameters for chart and dashboard when switching to non-guest (SSO) mode", () => {+ // When recentlyCreatedDashboards/Questions populates a+ // dashboardId or questionId, the embed wizard starts in guest mode and+ // sets all parameters as disabled in hiddenParameters. This test ensures+ // those guest mode restrictions are removed when switching to SSO mode.const chartResult = getCommonEmbedSettings({experience: "chart",isGuestEmbedsEnabled: false,@@ -188,7 +194,7 @@ describe("getCommonEmbedSettings", () => {});expect(chartResult).toHaveProperty("hiddenParameters", []);- expect(dashboardResult).not.toHaveProperty("hiddenParameters");+ expect(dashboardResult).toHaveProperty("hiddenParameters", []);});it("should handle `false` for isGuest and `useExistingUserSession`", () => {@@ -205,6 +211,7 @@ describe("getCommonEmbedSettings", () => {isSso: true,useExistingUserSession: false,drills: true,+ hiddenParameters: [],});});@@ -235,6 +242,7 @@ describe("getCommonEmbedSettings", () => {isSso: true,useExistingUserSession: true,drills: true,+ hiddenParameters: [],},},{diff --git a/frontend/src/metabase/plugins/oss/tenants.ts b/frontend/src/metabase/plugins/oss/tenants.tsindex dbf43db3987..9ba2dc357f7 100644--- a/frontend/src/metabase/plugins/oss/tenants.ts+++ b/frontend/src/metabase/plugins/oss/tenants.ts@@ -4,6 +4,7 @@ import type {OmniPickerCollectionItem,OmniPickerItem,} from "metabase/common/components/Pickers";+import type { DataSegregationStrategy } from "metabase/embedding/embedding-hub";import type { CollectionTreeItem } from "metabase/entities/collections/utils";import type {Collection,@@ -16,6 +17,12 @@ import type {import { PluginPlaceholder } from "../components/PluginPlaceholder";+export type CreatedTenantData = {+ name: string;+ slug: string;+ dataIsolationFieldValue: string;+};+export type TenantCollectionPathItem = {id: CollectionId;namespace?: CollectionNamespace;@@ -30,6 +37,18 @@ const getDefaultPluginTenants = () => ({isEnabled: false,userStrategyRoute: null as React.ReactElement | null,tenantsRoutes: null as React.ReactElement | null,+ CreateTenantsOnboardingStep: PluginPlaceholder as React.ComponentType<{+ onTenantsCreated?: (tenants: CreatedTenantData[]) => void;+ selectedFieldIds?: number[];+ strategy?: DataSegregationStrategy | null;+ rlsColumnName?: string | null;+ }>,+ TenantsSummaryOnboardingStep: PluginPlaceholder as React.ComponentType<{+ tenants: CreatedTenantData[];+ strategy?: DataSegregationStrategy | null;+ rlsTableNames?: string[];+ rlsColumnName?: string | null;+ }>,EditUserStrategySettingsButton: PluginPlaceholder,FormTenantWidget: (_props: any) => null as React.ReactElement | null,TenantDisplayName: (_props: any) => null as React.ReactElement | null,@@ -92,6 +111,18 @@ export const PLUGIN_TENANTS: {sharedTenantCollections: Collection[] | undefined;};tenantsRoutes: React.ReactElement | null;+ CreateTenantsOnboardingStep: React.ComponentType<{+ onTenantsCreated?: (tenants: CreatedTenantData[]) => void;+ selectedFieldIds?: number[];+ strategy?: DataSegregationStrategy | null;+ rlsColumnName?: string | null;+ }>;+ TenantsSummaryOnboardingStep: React.ComponentType<{+ tenants: CreatedTenantData[];+ strategy?: DataSegregationStrategy | null;+ rlsTableNames?: string[];+ rlsColumnName?: string | null;+ }>;EditUserStrategySettingsButton: (props: {page: "people" | "tenants";}) => React.ReactElement | null;diff --git a/frontend/src/metabase/ui/components/icons/Icon/icons/corner_up_right.svg b/frontend/src/metabase/ui/components/icons/Icon/icons/corner_up_right.svgnew file mode 100644index 00000000000..41ab74fd763--- /dev/null+++ b/frontend/src/metabase/ui/components/icons/Icon/icons/corner_up_right.svg@@ -0,0 +1,3 @@+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">+ <path d="M14.293 3.29297C14.6834 2.9025 15.3155 2.90261 15.7061 3.29297L20.707 8.29199C20.7378 8.32278 20.7651 8.35608 20.791 8.38965C20.8048 8.40752 20.8185 8.42553 20.8311 8.44434C20.8762 8.51185 20.9115 8.58384 20.9385 8.6582C20.9774 8.76491 21 8.87984 21 9C21 9.11959 20.977 9.23357 20.9385 9.33984C20.9328 9.35553 20.9274 9.37128 20.9209 9.38672C20.9007 9.43473 20.8768 9.48057 20.8496 9.52441C20.8435 9.53423 20.8375 9.54406 20.8311 9.55371C20.7944 9.6086 20.7536 9.66054 20.707 9.70703L15.7061 14.707C15.3156 15.097 14.6834 15.0971 14.293 14.707C13.9025 14.3165 13.9026 13.6835 14.293 13.293L17.584 10H8C7.20444 10.0001 6.44146 10.3164 5.87891 10.8789C5.31635 11.4415 5.00006 12.2044 5 13V20C4.99987 20.5521 4.55209 20.9999 4 21C3.4478 21 3.00013 20.5522 3 20V13C3.00006 11.674 3.52624 10.4015 4.46387 9.46387C5.40149 8.52624 6.67401 8.00006 8 8H17.5859L14.293 4.70605C13.9026 4.31552 13.9025 3.68344 14.293 3.29297Z" fill="currentColor"/>+</svg>diff --git a/frontend/src/metabase/ui/components/icons/Icon/icons/database_routing.svg b/frontend/src/metabase/ui/components/icons/Icon/icons/database_routing.svgnew file mode 100644index 00000000000..3519c48d549--- /dev/null+++ b/frontend/src/metabase/ui/components/icons/Icon/icons/database_routing.svg@@ -0,0 +1,3 @@+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">+ <path d="M10 17L15 12M15 12L10 7M15 12H3M15 3H19C19.5304 3 20.0391 3.21071 20.4142 3.58579C20.7893 3.96086 21 4.46957 21 5V19C21 19.5304 20.7893 20.0391 20.4142 20.4142C20.0391 20.7893 19.5304 21 19 21H15" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>+</svg>diff --git a/frontend/src/metabase/ui/components/icons/Icon/icons/index.ts b/frontend/src/metabase/ui/components/icons/Icon/icons/index.tsindex 0cf62f99e55..837baf4e38a 100644--- a/frontend/src/metabase/ui/components/icons/Icon/icons/index.ts+++ b/frontend/src/metabase/ui/components/icons/Icon/icons/index.ts@@ -128,6 +128,8 @@ import contract_component from "./contract.svg?component";import contract_source from "./contract.svg?source";import copy_component from "./copy.svg?component";import copy_source from "./copy.svg?source";+import corner_up_right_component from "./corner_up_right.svg?component";+import corner_up_right_source from "./corner_up_right.svg?source";import currency_component from "./currency.svg?component";import currency_source from "./currency.svg?source";import curve_component from "./curve.svg?component";@@ -142,6 +144,8 @@ import data_studio_component from "./data_studio.svg?component";import data_studio_source from "./data_studio.svg?source";import database_component from "./database.svg?component";import database_source from "./database.svg?source";+import database_routing_component from "./database_routing.svg?component";+import database_routing_source from "./database_routing.svg?source";import dependencies_component from "./dependencies.svg?component";import dependencies_source from "./dependencies.svg?source";import document_component from "./document.svg?component";@@ -268,6 +272,8 @@ import key_component from "./key.svg?component";import key_source from "./key.svg?source";import label_component from "./label.svg?component";import label_source from "./label.svg?source";+import layout_grid_component from "./layout_grid.svg?component";+import layout_grid_source from "./layout_grid.svg?source";import ldap_component from "./ldap.svg?component";import ldap_source from "./ldap.svg?source";import learn_component from "./learn.svg?component";@@ -799,6 +805,10 @@ export const Icons: Record<IconName, { component: React.VFC; source: string }> =component: copy_component,source: copy_source,},+ corner_up_right: {+ component: corner_up_right_component,+ source: corner_up_right_source,+ },currency: {component: currency_component,source: currency_source,@@ -811,6 +821,10 @@ export const Icons: Record<IconName, { component: React.VFC; source: string }> =component: database_component,source: database_source,},+ database_routing: {+ component: database_routing_component,+ source: database_routing_source,+ },dependencies: {component: dependencies_component,source: dependencies_source,@@ -1071,6 +1085,10 @@ export const Icons: Record<IconName, { component: React.VFC; source: string }> =component: label_component,source: label_source,},+ layout_grid: {+ component: layout_grid_component,+ source: layout_grid_source,+ },ldap: {component: ldap_component,source: ldap_source,@@ -1740,8 +1758,10 @@ export type IconName =| "connections"| "contract"| "copy"+ | "corner_up_right"| "curved"| "database"+ | "database_routing"| "dependencies"| "data_studio"| "dash"@@ -1810,6 +1830,7 @@ export type IconName =| "index"| "key"| "label"+ | "layout_grid"| "ldap"| "learn"| "lightbulb"diff --git a/frontend/src/metabase/ui/components/icons/Icon/icons/layout_grid.svg b/frontend/src/metabase/ui/components/icons/Icon/icons/layout_grid.svgnew file mode 100644index 00000000000..b95efba16d9--- /dev/null+++ b/frontend/src/metabase/ui/components/icons/Icon/icons/layout_grid.svg@@ -0,0 +1,6 @@+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">+<path d="M9 3H4C3.44772 3 3 3.44772 3 4V9C3 9.55229 3.44772 10 4 10H9C9.55229 10 10 9.55229 10 9V4C10 3.44772 9.55229 3 9 3Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M20 3H15C14.4477 3 14 3.44772 14 4V9C14 9.55229 14.4477 10 15 10H20C20.5523 10 21 9.55229 21 9V4C21 3.44772 20.5523 3 20 3Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M20 14H15C14.4477 14 14 14.4477 14 15V20C14 20.5523 14.4477 21 15 21H20C20.5523 21 21 20.5523 21 20V15C21 14.4477 20.5523 14 20 14Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M9 14H4C3.44772 14 3 14.4477 3 15V20C3 20.5523 3.44772 21 4 21H9C9.55229 21 10 20.5523 10 20V15C10 14.4477 9.55229 14 9 14Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>+</svg>diff --git a/frontend/src/metabase/ui/components/inputs/MultiAutocomplete/MultiAutocomplete.tsx b/frontend/src/metabase/ui/components/inputs/MultiAutocomplete/MultiAutocomplete.tsxindex ec192ae9323..553cd3187b6 100644--- a/frontend/src/metabase/ui/components/inputs/MultiAutocomplete/MultiAutocomplete.tsx+++ b/frontend/src/metabase/ui/components/inputs/MultiAutocomplete/MultiAutocomplete.tsx@@ -14,6 +14,7 @@ import {getParsedComboboxData,isOptionsGroup,} from "@mantine/core";+import cx from "classnames";import type { ReactNode } from "react";import { useMemo } from "react";import { t } from "ttag";@@ -41,6 +42,10 @@ export type MultiAutocompleteProps = BoxProps &autoFocus?: boolean;rightSection?: ReactNode;nothingFoundMessage?: ReactNode;+ classNames?: {+ pill?: string;+ input?: string;+ };"aria-label"?: string;"data-testid"?: string;parseValue?: (rawValue: string) => string | null;@@ -69,6 +74,7 @@ export function MultiAutocomplete({autoFocus,rightSection,nothingFoundMessage,+ classNames,maxDropdownHeight,dropdownOpened,defaultDropdownOpened,@@ -175,11 +181,12 @@ export function MultiAutocomplete({<Combobox.DropdownTarget><PillsInput{...styleProps}+ classNames={{ input: classNames?.input }}label={label}description={description}error={error}required={required}- rightSection={rightSection ?? infoIcon}+ rightSection={rightSection === undefined ? infoIcon : rightSection}withAsterisk={withAsterisk}labelProps={labelProps}descriptionProps={descriptionProps}@@ -194,7 +201,7 @@ export function MultiAutocomplete({value !== null ? (<Pillkey={valueIndex}- className={S.pill}+ className={cx(S.pill, classNames?.pill)}removeButtonProps={{ "aria-label": t`Remove` }}withRemoveButtononClick={(event) => handlePillClick(event, valueIndex)}diff --git a/frontend/src/metabase/ui/components/overlays/Menu/index.ts b/frontend/src/metabase/ui/components/overlays/Menu/index.tsindex 44b648270e7..c80297eb92c 100644--- a/frontend/src/metabase/ui/components/overlays/Menu/index.ts+++ b/frontend/src/metabase/ui/components/overlays/Menu/index.ts@@ -1,3 +1,8 @@-export type { MenuProps, MenuItemProps } from "@mantine/core";+export type {+ MenuProps,+ MenuItemProps,+ MenuDropdownProps,+} from "@mantine/core";+export { Menu } from "./Menu";export { menuOverrides } from "./Menu.config";diff --git a/resources/frontend_client/app/assets/img/embedding-onboarding/multi-tenant-user-strategy.svg b/resources/frontend_client/app/assets/img/embedding-onboarding/multi-tenant-user-strategy.svgnew file mode 100644index 00000000000..b5c562131e4--- /dev/null+++ b/resources/frontend_client/app/assets/img/embedding-onboarding/multi-tenant-user-strategy.svg@@ -0,0 +1,82 @@+<svg width="560" height="346" viewBox="0 0 560 346" fill="none" xmlns="http://www.w3.org/2000/svg">+<rect width="560" height="346" rx="6" fill="#0572D2" fill-opacity="0.03"/>+<rect x="0.5" y="0.5" width="559" height="345" rx="5.5" stroke="#071722" stroke-opacity="0.14"/>+<rect x="58.4844" y="26.3359" width="45.4831" height="45.4831" rx="11.5" fill="#EEF6FC"/>+<rect x="58.4844" y="26.3359" width="45.4831" height="45.4831" rx="11.5" stroke="#509EE3"/>+<path d="M87.5208 41.3297C87.5208 44.8061 84.7026 47.6243 81.2262 47.6243C77.7498 47.6243 74.9316 44.8061 74.9316 41.3297C74.9316 37.8533 77.7498 35.0352 81.2262 35.0352C84.7026 35.0352 87.5208 37.8533 87.5208 41.3297Z" fill="#E4ECFB" stroke="#509EE3" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M71.2466 63.1174H91.2052C93.4169 63.1174 95.1205 61.2157 94.0877 59.26C92.5684 56.3833 89.1047 52.9492 81.2259 52.9492C73.347 52.9492 69.8834 56.3833 68.3641 59.26C67.3312 61.2157 69.0349 63.1174 71.2466 63.1174Z" fill="#E4ECFB" stroke="#509EE3" stroke-linecap="round" stroke-linejoin="round"/>+<rect x="454.961" y="26.3359" width="45.4831" height="45.4831" rx="11.5" fill="#EEF6FC"/>+<rect x="454.961" y="26.3359" width="45.4831" height="45.4831" rx="11.5" stroke="#509EE3"/>+<path d="M463.66 38.9087C463.66 36.7694 465.394 35.0352 467.534 35.0352H487.87C490.009 35.0352 491.744 36.7694 491.744 38.9087V59.2451C491.744 61.3844 490.009 63.1187 487.87 63.1187H467.534C465.394 63.1187 463.66 61.3844 463.66 59.2451V38.9087Z" fill="#E4ECFB" stroke="#509EE3" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M477.271 52.9961C477.272 52.272 477.414 51.5547 477.691 50.8857C477.969 50.2167 478.375 49.6088 478.887 49.0967C479.399 48.5846 480.007 48.1785 480.676 47.9014C481.345 47.6242 482.063 47.4814 482.787 47.4814C482.95 47.4815 483.105 47.5462 483.22 47.6611C483.335 47.7759 483.399 47.9313 483.399 48.0938L483.399 52.9961C483.399 53.3344 483.125 53.6092 482.787 53.6094L477.885 53.6094C477.546 53.6094 477.271 53.3345 477.271 52.9961ZM482.174 52.3838L482.174 48.751C481.821 48.8019 481.476 48.8964 481.146 49.0332C480.625 49.2488 480.152 49.5647 479.754 49.9629C479.356 50.3612 479.039 50.8342 478.823 51.3545C478.686 51.6851 478.592 52.0312 478.541 52.3838L482.174 52.3838Z" fill="#509EE3"/>+<path d="M477.271 52.9961C477.272 52.272 477.414 51.5547 477.691 50.8857C477.969 50.2167 478.375 49.6088 478.887 49.0967C479.399 48.5846 480.007 48.1785 480.676 47.9014C481.345 47.6242 482.063 47.4814 482.787 47.4814C482.95 47.4815 483.105 47.5462 483.22 47.6611C483.335 47.7759 483.399 47.9313 483.399 48.0938L483.399 52.9961C483.399 53.3344 483.125 53.6092 482.787 53.6094L477.885 53.6094C477.546 53.6094 477.271 53.3345 477.271 52.9961ZM482.174 52.3838L482.174 48.751C481.821 48.8019 481.476 48.8964 481.146 49.0332C480.625 49.2488 480.152 49.5647 479.754 49.9629C479.356 50.3612 479.039 50.8342 478.823 51.3545C478.686 51.6851 478.592 52.0312 478.541 52.3838L482.174 52.3838Z" stroke="#509EE3"/>+<path d="M478.169 55.7822C478.001 55.4886 478.103 55.1136 478.396 54.9453C478.69 54.7774 479.064 54.8787 479.232 55.1719C479.471 55.5875 479.778 55.9612 480.144 56.2754C480.733 56.7826 481.45 57.1162 482.215 57.2383C482.98 57.3603 483.764 57.2664 484.479 56.9678C485.195 56.6692 485.815 56.177 486.271 55.5449C486.728 54.9126 487.001 54.1647 487.063 53.3848C487.123 52.6048 486.97 51.8227 486.617 51.126C486.265 50.4293 485.728 49.8445 485.067 49.4365C484.779 49.2588 484.689 48.8808 484.867 48.5928C485.045 48.3048 485.423 48.2158 485.711 48.3936C486.565 48.9206 487.257 49.6748 487.711 50.5723C488.165 51.4697 488.363 52.4759 488.285 53.4795C488.207 54.4832 487.854 55.4465 487.266 56.2617C486.678 57.0769 485.877 57.7125 484.951 58.0986C484.026 58.4847 483.012 58.6061 482.022 58.4482C481.033 58.2904 480.106 57.8598 479.345 57.2051C478.873 56.7995 478.476 56.3178 478.169 55.7822Z" fill="#509EE3"/>+<path d="M478.169 55.7822C478.001 55.4886 478.103 55.1136 478.396 54.9453C478.69 54.7774 479.064 54.8787 479.232 55.1719C479.471 55.5875 479.778 55.9612 480.144 56.2754C480.733 56.7826 481.45 57.1162 482.215 57.2383C482.98 57.3603 483.764 57.2664 484.479 56.9678C485.195 56.6692 485.815 56.177 486.271 55.5449C486.728 54.9126 487.001 54.1647 487.063 53.3848C487.123 52.6048 486.97 51.8227 486.617 51.126C486.265 50.4293 485.728 49.8445 485.067 49.4365C484.779 49.2588 484.689 48.8808 484.867 48.5928C485.045 48.3048 485.423 48.2158 485.711 48.3936C486.565 48.9206 487.257 49.6748 487.711 50.5723C488.165 51.4697 488.363 52.4759 488.285 53.4795C488.207 54.4832 487.854 55.4465 487.266 56.2617C486.678 57.0769 485.877 57.7125 484.951 58.0986C484.026 58.4847 483.012 58.6061 482.022 58.4482C481.033 58.2904 480.106 57.8598 479.345 57.2051C478.873 56.7995 478.476 56.3178 478.169 55.7822Z" stroke="#509EE3"/>+<path d="M473.344 41.9688L473.344 63.1196" stroke="#509EE3" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M464.145 41.8164H491.26" stroke="#509EE3" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M454.892 49.0806L440.521 49.0806C431.684 49.0806 424.521 56.244 424.521 65.0806L424.521 132.582C424.521 141.419 417.357 148.582 408.521 148.582L151.164 148.582C142.336 148.582 135.176 141.431 135.164 132.603L135.077 65.0584C135.065 56.23 127.905 49.0792 119.077 49.0792L104.09 49.0792" stroke="#509EE3"/>+<path d="M50.9408 84.6475H47.8715V93.0352H45.9437V84.6475H42.9154V83.082H50.9408V84.6475ZM59.5596 88.6738H55.4717V91.4834H60.25V93.0352H53.5439V83.082H60.2295V84.6475H55.4717V87.1562H59.5596V88.6738ZM69.8053 93.0352H67.8912L65.1227 86.6162V93.0352H63.1881V83.082H65.1227L67.8707 89.4736L67.8775 83.082H69.8053V93.0352ZM77.9455 90.957H74.9582L74.3703 93.0352H72.3469L75.6076 83.082H77.3508L80.55 93.0352H78.5266L77.9455 90.957ZM75.4299 89.3232H77.4943L76.4758 85.6592L75.4299 89.3232ZM89.4217 93.0352H87.5076L84.7391 86.6162V93.0352H82.8045V83.082H84.7391L87.4871 89.4736L87.4939 83.082H89.4217V93.0352ZM99.9818 84.6475H96.9125V93.0352H94.9848V84.6475H91.9564V83.082H99.9818V84.6475ZM117.178 90.957H114.191L113.603 93.0352H111.58L114.84 83.082H116.584L119.783 93.0352H117.759L117.178 90.957ZM114.663 89.3232H116.727L115.709 85.6592L114.663 89.3232Z" fill="#509EE3"/>+<path d="M435.32 93.0352V83.082H437.897C438.357 83.082 438.788 83.139 439.189 83.2529C439.59 83.3623 439.955 83.5195 440.283 83.7246C440.57 83.8932 440.825 84.1006 441.048 84.3467C441.276 84.5882 441.475 84.8525 441.643 85.1396C441.839 85.4906 441.99 85.8779 442.094 86.3018C442.204 86.7256 442.258 87.1768 442.258 87.6553V88.4756C442.258 88.9359 442.208 89.3711 442.108 89.7812C442.008 90.1914 441.866 90.5674 441.684 90.9092C441.511 91.2145 441.308 91.4971 441.076 91.7568C440.843 92.012 440.588 92.2262 440.31 92.3994C439.987 92.6045 439.629 92.7617 439.237 92.8711C438.85 92.9805 438.435 93.0352 437.993 93.0352H435.32ZM437.254 84.6406V91.4902H437.993C438.23 91.4902 438.451 91.4606 438.656 91.4014C438.861 91.3421 439.048 91.2555 439.216 91.1416C439.39 91.0231 439.545 90.8727 439.681 90.6904C439.823 90.5036 439.943 90.2871 440.044 90.041C440.126 89.8268 440.187 89.5898 440.228 89.3301C440.274 89.0658 440.296 88.7809 440.296 88.4756V87.6416C440.296 87.3545 440.274 87.0833 440.228 86.8281C440.187 86.5684 440.126 86.3314 440.044 86.1172C439.943 85.862 439.811 85.6341 439.647 85.4336C439.488 85.2331 439.301 85.069 439.087 84.9414C438.922 84.8457 438.74 84.7728 438.54 84.7227C438.344 84.668 438.129 84.6406 437.897 84.6406H437.254ZM450.064 90.957H447.076L446.488 93.0352H444.465L447.726 83.082H449.469L452.668 93.0352H450.645L450.064 90.957ZM447.548 89.3232H449.613L448.594 85.6592L447.548 89.3232ZM462.292 84.6475H459.222V93.0352H457.295V84.6475H454.266V83.082H462.292V84.6475ZM469.68 90.957H466.693L466.105 93.0352H464.081L467.342 83.082H469.085L472.285 93.0352H470.261L469.68 90.957ZM467.164 89.3232H469.229L468.21 85.6592L467.164 89.3232ZM479.762 90.4375C479.762 90.2598 479.73 90.0934 479.666 89.9385C479.607 89.7835 479.504 89.6377 479.358 89.501C479.208 89.3688 479.012 89.248 478.771 89.1387C478.534 89.0247 478.237 88.9199 477.882 88.8242C477.33 88.6738 476.845 88.4915 476.426 88.2773C476.011 88.0632 475.672 87.8285 475.407 87.5732C475.143 87.318 474.942 87.0355 474.806 86.7256C474.674 86.4157 474.607 86.0785 474.607 85.7139C474.607 85.2946 474.696 84.9141 474.874 84.5723C475.052 84.2305 475.298 83.9388 475.612 83.6973C475.927 83.4557 476.298 83.2712 476.727 83.1436C477.155 83.0114 477.62 82.9453 478.121 82.9453C478.641 82.9453 479.115 83.0205 479.543 83.1709C479.976 83.3213 480.347 83.5309 480.657 83.7998C480.967 84.0732 481.209 84.3968 481.382 84.7705C481.555 85.1442 481.642 85.5544 481.642 86.001H479.769C479.759 85.7777 479.718 85.5726 479.646 85.3857C479.577 85.1989 479.475 85.0371 479.338 84.9004C479.197 84.7682 479.021 84.6657 478.812 84.5928C478.606 84.5153 478.365 84.4766 478.087 84.4766C477.832 84.4766 477.604 84.5085 477.403 84.5723C477.207 84.6315 477.041 84.7158 476.904 84.8252C476.768 84.9391 476.663 85.0736 476.59 85.2285C476.521 85.3789 476.487 85.543 476.487 85.7207C476.487 85.9076 476.533 86.0762 476.624 86.2266C476.72 86.377 476.856 86.5114 477.034 86.6299C477.212 86.7529 477.426 86.8646 477.677 86.9648C477.932 87.0651 478.219 87.1585 478.538 87.2451C478.88 87.3408 479.206 87.457 479.516 87.5938C479.826 87.7305 480.11 87.8877 480.37 88.0654C480.762 88.3571 481.074 88.6966 481.307 89.084C481.539 89.4714 481.655 89.918 481.655 90.4238C481.655 90.8613 481.566 91.251 481.389 91.5928C481.215 91.93 480.974 92.2148 480.664 92.4473C480.354 92.6842 479.985 92.8643 479.557 92.9873C479.128 93.1058 478.661 93.165 478.155 93.165C477.659 93.165 477.166 93.0921 476.679 92.9463C476.196 92.7959 475.774 92.5771 475.414 92.29C475.072 92.0075 474.801 91.6748 474.601 91.292C474.405 90.9092 474.307 90.4603 474.307 89.9453H476.193C476.202 90.2461 476.255 90.5036 476.351 90.7178C476.446 90.932 476.581 91.1074 476.754 91.2441C476.923 91.3809 477.125 91.4811 477.362 91.5449C477.604 91.6087 477.868 91.6406 478.155 91.6406C478.41 91.6406 478.636 91.611 478.832 91.5518C479.033 91.4925 479.201 91.4105 479.338 91.3057C479.475 91.2008 479.579 91.0755 479.652 90.9297C479.725 90.7793 479.762 90.6152 479.762 90.4375ZM490.527 88.6738H486.439V91.4834H491.217V93.0352H484.511V83.082H491.197V84.6475H486.439V87.1562H490.527V88.6738ZM501.525 84.6475H498.455V93.0352H496.528V84.6475H493.499V83.082H501.525V84.6475ZM518.721 90.957H515.734L515.146 93.0352H513.122L516.383 83.082H518.126L521.326 93.0352H519.302L518.721 90.957ZM516.205 89.3232H518.27L517.251 85.6592L516.205 89.3232Z" fill="#509EE3"/>+<g opacity="0.5">+<rect x="58.4844" y="139.641" width="45.4831" height="45.4831" rx="11.5" fill="#F1F2F4"/>+<rect x="58.4844" y="139.641" width="45.4831" height="45.4831" rx="11.5" stroke="#8D93A5"/>+<path d="M87.5208 154.634C87.5208 158.111 84.7026 160.929 81.2262 160.929C77.7498 160.929 74.9316 158.111 74.9316 154.634C74.9316 151.158 77.7498 148.34 81.2262 148.34C84.7026 148.34 87.5208 151.158 87.5208 154.634Z" fill="#8D93A5" fill-opacity="0.3" stroke="#5A6072" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M71.2466 176.422H91.2052C93.4169 176.422 95.1205 174.52 94.0877 172.565C92.5684 169.688 89.1047 166.254 81.2259 166.254C73.347 166.254 69.8834 169.688 68.3641 172.565C67.3312 174.52 69.0349 176.422 71.2466 176.422Z" fill="#8D93A5" fill-opacity="0.3" stroke="#5A6072" stroke-linecap="round" stroke-linejoin="round"/>+</g>+<g opacity="0.5">+<rect x="454.961" y="139.641" width="45.4831" height="45.4831" rx="11.5" fill="#F1F2F4"/>+<rect x="454.961" y="139.641" width="45.4831" height="45.4831" rx="11.5" stroke="#8D93A5"/>+<path d="M463.66 152.213C463.66 150.074 465.394 148.34 467.534 148.34H487.87C490.009 148.34 491.744 150.074 491.744 152.213V172.55C491.744 174.689 490.009 176.423 487.87 176.423H467.534C465.394 176.423 463.66 174.689 463.66 172.55V152.213Z" fill="#C6C9D2" fill-opacity="0.3" stroke="#5A6072" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>+<path fill-rule="evenodd" clip-rule="evenodd" d="M483.398 166.305C483.398 165.967 483.124 165.692 482.786 165.692L477.883 165.692C477.721 165.692 477.565 165.757 477.45 165.872C477.335 165.987 477.27 166.142 477.27 166.305C477.27 167.029 477.413 167.746 477.69 168.416C477.967 169.085 478.374 169.693 478.886 170.205C479.398 170.717 480.006 171.123 480.675 171.4C481.344 171.678 482.061 171.82 482.786 171.82C483.124 171.82 483.398 171.546 483.398 171.207L483.398 166.305ZM478.54 166.918L482.173 166.918L482.173 170.551C481.82 170.5 481.475 170.405 481.144 170.268C480.624 170.053 480.151 169.737 479.752 169.338C479.354 168.94 479.038 168.467 478.822 167.947C478.686 167.616 478.591 167.27 478.54 166.918Z" fill="#5A6072" fill-opacity="0.5"/>+<path d="M484.957 169.855C484.664 170.024 484.562 170.398 484.731 170.692C484.899 170.985 485.273 171.087 485.567 170.919C486.103 170.612 486.585 170.215 486.99 169.744C487.645 168.982 488.075 168.056 488.233 167.066C488.391 166.076 488.27 165.062 487.884 164.137C487.498 163.211 486.862 162.41 486.047 161.822C485.231 161.234 484.269 160.881 483.265 160.803C482.261 160.725 481.255 160.923 480.357 161.377C479.46 161.831 478.706 162.523 478.179 163.377C478.001 163.665 478.09 164.043 478.378 164.221C478.666 164.398 479.044 164.309 479.221 164.021C479.629 163.36 480.214 162.823 480.911 162.471C481.608 162.118 482.389 161.964 483.169 162.025C483.95 162.086 484.697 162.36 485.33 162.816C485.962 163.272 486.454 163.893 486.753 164.608C487.052 165.324 487.145 166.108 487.023 166.873C486.901 167.638 486.568 168.355 486.061 168.944C485.747 169.31 485.373 169.617 484.957 169.855Z" fill="#5A6072" fill-opacity="0.5"/>+<path d="M473.344 155.273L473.344 176.424" stroke="#5A6072" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M464.145 155.121H491.26" stroke="#5A6072" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>+</g>+<path d="M104.467 162.379L454.891 162.379" stroke="#C6C9D2" stroke-linejoin="round" stroke-dasharray="6 6"/>+<path d="M104.833 275.685H119.202C128.039 275.685 135.202 268.522 135.202 259.685L135.202 192.426C135.202 183.589 142.366 176.426 151.202 176.426H408.546C417.374 176.426 424.534 183.577 424.546 192.405L424.633 259.707C424.645 268.536 431.805 275.686 440.633 275.686H454.893" stroke="#C6C9D2" stroke-dasharray="6 6"/>+<path d="M50.6771 197.952H47.6078V206.34H45.6801V197.952H42.6518V196.387H50.6771V197.952ZM59.2959 201.979H55.208V204.788H59.9863V206.34H53.2803V196.387H59.9658V197.952H55.208V200.461H59.2959V201.979ZM69.5416 206.34H67.6275L64.859 199.921V206.34H62.9244V196.387H64.859L67.607 202.778L67.6139 196.387H69.5416V206.34ZM77.6818 204.262H74.6945L74.1066 206.34H72.0832L75.3439 196.387H77.0871L80.2863 206.34H78.2629L77.6818 204.262ZM75.1662 202.628H77.2307L76.2121 198.964L75.1662 202.628ZM89.158 206.34H87.2439L84.4754 199.921V206.34H82.5408V196.387H84.4754L87.2234 202.778L87.2303 196.387H89.158V206.34ZM99.7182 197.952H96.6488V206.34H94.7211V197.952H91.6928V196.387H99.7182V197.952ZM112.006 206.34V196.387H115.349C115.892 196.387 116.384 196.441 116.826 196.551C117.272 196.66 117.653 196.826 117.967 197.05C118.282 197.273 118.523 197.556 118.692 197.897C118.865 198.239 118.952 198.643 118.952 199.107C118.947 199.408 118.893 199.693 118.788 199.962C118.687 200.226 118.537 200.459 118.337 200.659C118.227 200.769 118.102 200.869 117.961 200.96C117.824 201.051 117.671 201.129 117.503 201.192V201.199C117.831 201.29 118.09 201.407 118.282 201.548C118.478 201.689 118.642 201.853 118.774 202.04C118.911 202.241 119.011 202.459 119.075 202.696C119.143 202.929 119.177 203.17 119.177 203.421C119.177 203.899 119.095 204.321 118.931 204.686C118.767 205.05 118.532 205.355 118.227 205.602C117.922 205.848 117.55 206.032 117.113 206.155C116.675 206.278 116.183 206.34 115.636 206.34H112.006ZM113.934 201.951V204.788H115.643C115.894 204.788 116.117 204.756 116.313 204.692C116.514 204.629 116.68 204.542 116.812 204.433C116.958 204.31 117.067 204.161 117.14 203.988C117.218 203.815 117.256 203.621 117.256 203.407C117.256 203.184 117.227 202.983 117.168 202.806C117.113 202.628 117.024 202.478 116.901 202.354C116.778 202.227 116.618 202.129 116.422 202.061C116.226 201.992 115.994 201.956 115.725 201.951H113.934ZM113.934 200.563H115.363C115.655 200.559 115.912 200.525 116.135 200.461C116.359 200.393 116.539 200.292 116.675 200.16C116.789 200.055 116.876 199.928 116.935 199.777C116.999 199.627 117.031 199.456 117.031 199.265C117.031 199.064 117.004 198.889 116.949 198.738C116.899 198.588 116.821 198.463 116.716 198.362C116.58 198.221 116.395 198.118 116.163 198.055C115.935 197.991 115.666 197.957 115.356 197.952H113.934V200.563Z" fill="#8D93A5"/>+<path d="M435.32 206.34V196.387H437.897C438.357 196.387 438.788 196.444 439.189 196.558C439.59 196.667 439.955 196.824 440.283 197.029C440.57 197.198 440.825 197.405 441.048 197.651C441.276 197.893 441.475 198.157 441.643 198.444C441.839 198.795 441.99 199.183 442.094 199.606C442.204 200.03 442.258 200.481 442.258 200.96V201.78C442.258 202.241 442.208 202.676 442.108 203.086C442.008 203.496 441.866 203.872 441.684 204.214C441.511 204.519 441.308 204.802 441.076 205.062C440.843 205.317 440.588 205.531 440.31 205.704C439.987 205.909 439.629 206.066 439.237 206.176C438.85 206.285 438.435 206.34 437.993 206.34H435.32ZM437.254 197.945V204.795H437.993C438.23 204.795 438.451 204.765 438.656 204.706C438.861 204.647 439.048 204.56 439.216 204.446C439.39 204.328 439.545 204.177 439.681 203.995C439.823 203.808 439.943 203.592 440.044 203.346C440.126 203.132 440.187 202.895 440.228 202.635C440.274 202.37 440.296 202.086 440.296 201.78V200.946C440.296 200.659 440.274 200.388 440.228 200.133C440.187 199.873 440.126 199.636 440.044 199.422C439.943 199.167 439.811 198.939 439.647 198.738C439.488 198.538 439.301 198.374 439.087 198.246C438.922 198.15 438.74 198.077 438.54 198.027C438.344 197.973 438.129 197.945 437.897 197.945H437.254ZM450.064 204.262H447.076L446.488 206.34H444.465L447.726 196.387H449.469L452.668 206.34H450.645L450.064 204.262ZM447.548 202.628H449.613L448.594 198.964L447.548 202.628ZM462.292 197.952H459.222V206.34H457.295V197.952H454.266V196.387H462.292V197.952ZM469.68 204.262H466.693L466.105 206.34H464.081L467.342 196.387H469.085L472.285 206.34H470.261L469.68 204.262ZM467.164 202.628H469.229L468.21 198.964L467.164 202.628ZM479.762 203.742C479.762 203.564 479.73 203.398 479.666 203.243C479.607 203.088 479.504 202.942 479.358 202.806C479.208 202.674 479.012 202.553 478.771 202.443C478.534 202.329 478.237 202.225 477.882 202.129C477.33 201.979 476.845 201.796 476.426 201.582C476.011 201.368 475.672 201.133 475.407 200.878C475.143 200.623 474.942 200.34 474.806 200.03C474.674 199.72 474.607 199.383 474.607 199.019C474.607 198.599 474.696 198.219 474.874 197.877C475.052 197.535 475.298 197.243 475.612 197.002C475.927 196.76 476.298 196.576 476.727 196.448C477.155 196.316 477.62 196.25 478.121 196.25C478.641 196.25 479.115 196.325 479.543 196.476C479.976 196.626 480.347 196.836 480.657 197.104C480.967 197.378 481.209 197.701 481.382 198.075C481.555 198.449 481.642 198.859 481.642 199.306H479.769C479.759 199.082 479.718 198.877 479.646 198.69C479.577 198.504 479.475 198.342 479.338 198.205C479.197 198.073 479.021 197.97 478.812 197.897C478.606 197.82 478.365 197.781 478.087 197.781C477.832 197.781 477.604 197.813 477.403 197.877C477.207 197.936 477.041 198.021 476.904 198.13C476.768 198.244 476.663 198.378 476.59 198.533C476.521 198.684 476.487 198.848 476.487 199.025C476.487 199.212 476.533 199.381 476.624 199.531C476.72 199.682 476.856 199.816 477.034 199.935C477.212 200.058 477.426 200.169 477.677 200.27C477.932 200.37 478.219 200.463 478.538 200.55C478.88 200.646 479.206 200.762 479.516 200.898C479.826 201.035 480.11 201.192 480.37 201.37C480.762 201.662 481.074 202.001 481.307 202.389C481.539 202.776 481.655 203.223 481.655 203.729C481.655 204.166 481.566 204.556 481.389 204.897C481.215 205.235 480.974 205.52 480.664 205.752C480.354 205.989 479.985 206.169 479.557 206.292C479.128 206.41 478.661 206.47 478.155 206.47C477.659 206.47 477.166 206.397 476.679 206.251C476.196 206.101 475.774 205.882 475.414 205.595C475.072 205.312 474.801 204.979 474.601 204.597C474.405 204.214 474.307 203.765 474.307 203.25H476.193C476.202 203.551 476.255 203.808 476.351 204.022C476.446 204.237 476.581 204.412 476.754 204.549C476.923 204.686 477.125 204.786 477.362 204.85C477.604 204.913 477.868 204.945 478.155 204.945C478.41 204.945 478.636 204.916 478.832 204.856C479.033 204.797 479.201 204.715 479.338 204.61C479.475 204.506 479.579 204.38 479.652 204.234C479.725 204.084 479.762 203.92 479.762 203.742ZM490.527 201.979H486.439V204.788H491.217V206.34H484.511V196.387H491.197V197.952H486.439V200.461H490.527V201.979ZM501.525 197.952H498.455V206.34H496.528V197.952H493.499V196.387H501.525V197.952ZM513.813 206.34V196.387H517.156C517.698 196.387 518.19 196.441 518.632 196.551C519.079 196.66 519.459 196.826 519.774 197.05C520.088 197.273 520.33 197.556 520.498 197.897C520.672 198.239 520.758 198.643 520.758 199.107C520.754 199.408 520.699 199.693 520.594 199.962C520.494 200.226 520.343 200.459 520.143 200.659C520.034 200.769 519.908 200.869 519.767 200.96C519.63 201.051 519.478 201.129 519.309 201.192V201.199C519.637 201.29 519.897 201.407 520.088 201.548C520.284 201.689 520.448 201.853 520.58 202.04C520.717 202.241 520.817 202.459 520.881 202.696C520.95 202.929 520.984 203.17 520.984 203.421C520.984 203.899 520.902 204.321 520.738 204.686C520.574 205.05 520.339 205.355 520.034 205.602C519.728 205.848 519.357 206.032 518.919 206.155C518.482 206.278 517.99 206.34 517.443 206.34H513.813ZM515.741 201.951V204.788H517.45C517.7 204.788 517.924 204.756 518.12 204.692C518.32 204.629 518.486 204.542 518.619 204.433C518.764 204.31 518.874 204.161 518.947 203.988C519.024 203.815 519.063 203.621 519.063 203.407C519.063 203.184 519.033 202.983 518.974 202.806C518.919 202.628 518.83 202.478 518.707 202.354C518.584 202.227 518.425 202.129 518.229 202.061C518.033 201.992 517.801 201.956 517.532 201.951H515.741ZM515.741 200.563H517.169C517.461 200.559 517.718 200.525 517.942 200.461C518.165 200.393 518.345 200.292 518.482 200.16C518.596 200.055 518.682 199.928 518.742 199.777C518.805 199.627 518.837 199.456 518.837 199.265C518.837 199.064 518.81 198.889 518.755 198.738C518.705 198.588 518.628 198.463 518.523 198.362C518.386 198.221 518.202 198.118 517.969 198.055C517.741 197.991 517.472 197.957 517.162 197.952H515.741V200.563Z" fill="#8D93A5"/>+<path d="M249.918 206.34V196.387H252.495C252.955 196.387 253.386 196.444 253.787 196.558C254.188 196.667 254.552 196.824 254.88 197.029C255.168 197.198 255.423 197.405 255.646 197.651C255.874 197.893 256.072 198.157 256.241 198.444C256.437 198.795 256.587 199.183 256.692 199.606C256.801 200.03 256.856 200.481 256.856 200.96V201.78C256.856 202.241 256.806 202.676 256.706 203.086C256.605 203.496 256.464 203.872 256.282 204.214C256.109 204.519 255.906 204.802 255.673 205.062C255.441 205.317 255.186 205.531 254.908 205.704C254.584 205.909 254.226 206.066 253.835 206.176C253.447 206.285 253.032 206.34 252.59 206.34H249.918ZM251.852 197.945V204.795H252.59C252.827 204.795 253.048 204.765 253.254 204.706C253.459 204.647 253.645 204.56 253.814 204.446C253.987 204.328 254.142 204.177 254.279 203.995C254.42 203.808 254.541 203.592 254.641 203.346C254.723 203.132 254.785 202.895 254.826 202.635C254.871 202.37 254.894 202.086 254.894 201.78V200.946C254.894 200.659 254.871 200.388 254.826 200.133C254.785 199.873 254.723 199.636 254.641 199.422C254.541 199.167 254.409 198.939 254.245 198.738C254.085 198.538 253.898 198.374 253.684 198.246C253.52 198.15 253.338 198.077 253.137 198.027C252.941 197.973 252.727 197.945 252.495 197.945H251.852ZM264.661 204.262H261.674L261.086 206.34H259.063L262.323 196.387H264.067L267.266 206.34H265.242L264.661 204.262ZM262.146 202.628H264.21L263.192 198.964L262.146 202.628ZM274.743 203.742C274.743 203.564 274.711 203.398 274.647 203.243C274.588 203.088 274.485 202.942 274.34 202.806C274.189 202.674 273.993 202.553 273.752 202.443C273.515 202.329 273.219 202.225 272.863 202.129C272.312 201.979 271.826 201.796 271.407 201.582C270.992 201.368 270.653 201.133 270.388 200.878C270.124 200.623 269.924 200.34 269.787 200.03C269.655 199.72 269.589 199.383 269.589 199.019C269.589 198.599 269.678 198.219 269.855 197.877C270.033 197.535 270.279 197.243 270.594 197.002C270.908 196.76 271.279 196.576 271.708 196.448C272.136 196.316 272.601 196.25 273.102 196.25C273.622 196.25 274.096 196.325 274.524 196.476C274.957 196.626 275.329 196.836 275.638 197.104C275.948 197.378 276.19 197.701 276.363 198.075C276.536 198.449 276.623 198.859 276.623 199.306H274.75C274.741 199.082 274.7 198.877 274.627 198.69C274.558 198.504 274.456 198.342 274.319 198.205C274.178 198.073 274.002 197.97 273.793 197.897C273.588 197.82 273.346 197.781 273.068 197.781C272.813 197.781 272.585 197.813 272.385 197.877C272.189 197.936 272.022 198.021 271.886 198.13C271.749 198.244 271.644 198.378 271.571 198.533C271.503 198.684 271.469 198.848 271.469 199.025C271.469 199.212 271.514 199.381 271.605 199.531C271.701 199.682 271.838 199.816 272.015 199.935C272.193 200.058 272.407 200.169 272.658 200.27C272.913 200.37 273.2 200.463 273.519 200.55C273.861 200.646 274.187 200.762 274.497 200.898C274.807 201.035 275.092 201.192 275.351 201.37C275.743 201.662 276.055 202.001 276.288 202.389C276.52 202.776 276.637 203.223 276.637 203.729C276.637 204.166 276.548 204.556 276.37 204.897C276.197 205.235 275.955 205.52 275.645 205.752C275.335 205.989 274.966 206.169 274.538 206.292C274.11 206.41 273.642 206.47 273.137 206.47C272.64 206.47 272.148 206.397 271.66 206.251C271.177 206.101 270.755 205.882 270.395 205.595C270.054 205.312 269.782 204.979 269.582 204.597C269.386 204.214 269.288 203.765 269.288 203.25H271.175C271.184 203.551 271.236 203.808 271.332 204.022C271.428 204.237 271.562 204.412 271.735 204.549C271.904 204.686 272.107 204.786 272.344 204.85C272.585 204.913 272.849 204.945 273.137 204.945C273.392 204.945 273.617 204.916 273.813 204.856C274.014 204.797 274.182 204.715 274.319 204.61C274.456 204.506 274.561 204.38 274.634 204.234C274.707 204.084 274.743 203.92 274.743 203.742ZM285.953 206.34H284.052V202.026H281.236V206.34H279.329V196.387H281.236V200.468H284.052V196.387H285.953V206.34ZM289.178 206.34V196.387H292.521C293.063 196.387 293.555 196.441 293.997 196.551C294.444 196.66 294.824 196.826 295.139 197.05C295.453 197.273 295.695 197.556 295.863 197.897C296.036 198.239 296.123 198.643 296.123 199.107C296.118 199.408 296.064 199.693 295.959 199.962C295.859 200.226 295.708 200.459 295.508 200.659C295.398 200.769 295.273 200.869 295.132 200.96C294.995 201.051 294.842 201.129 294.674 201.192V201.199C295.002 201.29 295.262 201.407 295.453 201.548C295.649 201.689 295.813 201.853 295.945 202.04C296.082 202.241 296.182 202.459 296.246 202.696C296.314 202.929 296.349 203.17 296.349 203.421C296.349 203.899 296.267 204.321 296.103 204.686C295.938 205.05 295.704 205.355 295.398 205.602C295.093 205.848 294.722 206.032 294.284 206.155C293.847 206.278 293.354 206.34 292.808 206.34H289.178ZM291.105 201.951V204.788H292.814C293.065 204.788 293.288 204.756 293.484 204.692C293.685 204.629 293.851 204.542 293.983 204.433C294.129 204.31 294.239 204.161 294.312 203.988C294.389 203.815 294.428 203.621 294.428 203.407C294.428 203.184 294.398 202.983 294.339 202.806C294.284 202.628 294.195 202.478 294.072 202.354C293.949 202.227 293.79 202.129 293.594 202.061C293.398 201.992 293.165 201.956 292.896 201.951H291.105ZM291.105 200.563H292.534C292.826 200.559 293.083 200.525 293.307 200.461C293.53 200.393 293.71 200.292 293.847 200.16C293.961 200.055 294.047 199.928 294.106 199.777C294.17 199.627 294.202 199.456 294.202 199.265C294.202 199.064 294.175 198.889 294.12 198.738C294.07 198.588 293.993 198.463 293.888 198.362C293.751 198.221 293.566 198.118 293.334 198.055C293.106 197.991 292.837 197.957 292.527 197.952H291.105V200.563ZM305.945 202.095C305.945 202.523 305.906 202.931 305.829 203.318C305.751 203.701 305.64 204.057 305.494 204.385C305.339 204.713 305.147 205.014 304.92 205.287C304.692 205.561 304.432 205.788 304.14 205.971C303.876 206.13 303.584 206.253 303.265 206.34C302.951 206.431 302.611 206.477 302.247 206.477C301.859 206.477 301.502 206.426 301.173 206.326C300.845 206.226 300.547 206.085 300.278 205.902C300.014 205.711 299.777 205.481 299.567 205.212C299.357 204.938 299.182 204.631 299.041 204.289C298.913 203.975 298.815 203.633 298.747 203.264C298.683 202.895 298.651 202.505 298.651 202.095V200.646C298.651 200.208 298.687 199.793 298.76 199.401C298.838 199.009 298.949 198.647 299.095 198.314C299.237 198 299.407 197.715 299.608 197.46C299.813 197.205 300.048 196.986 300.312 196.804C300.572 196.626 300.864 196.489 301.187 196.394C301.511 196.298 301.862 196.25 302.24 196.25C302.623 196.25 302.98 196.3 303.313 196.4C303.65 196.496 303.953 196.635 304.222 196.817C304.491 196.991 304.726 197.2 304.926 197.446C305.131 197.692 305.307 197.964 305.453 198.26C305.612 198.597 305.733 198.966 305.815 199.367C305.902 199.768 305.945 200.194 305.945 200.646V202.095ZM303.997 200.632C303.997 200.377 303.983 200.135 303.956 199.907C303.933 199.675 303.894 199.461 303.839 199.265C303.771 199.019 303.68 198.8 303.566 198.608C303.452 198.412 303.318 198.253 303.163 198.13C303.04 198.039 302.901 197.968 302.746 197.918C302.595 197.868 302.427 197.843 302.24 197.843C302.062 197.843 301.9 197.866 301.754 197.911C301.613 197.957 301.486 198.023 301.372 198.109C301.217 198.237 301.085 198.396 300.975 198.588C300.87 198.779 300.788 199.003 300.729 199.258C300.684 199.454 300.649 199.668 300.627 199.9C300.608 200.133 300.599 200.377 300.599 200.632V202.095C300.599 202.336 300.608 202.569 300.627 202.792C300.645 203.015 300.677 203.223 300.722 203.414C300.772 203.656 300.845 203.877 300.941 204.077C301.041 204.273 301.157 204.433 301.29 204.556C301.413 204.665 301.552 204.749 301.707 204.809C301.866 204.868 302.046 204.897 302.247 204.897C302.438 204.897 302.614 204.87 302.773 204.815C302.933 204.761 303.074 204.681 303.197 204.576C303.352 204.449 303.482 204.289 303.587 204.098C303.696 203.902 303.782 203.681 303.846 203.435C303.896 203.243 303.933 203.034 303.956 202.806C303.983 202.578 303.997 202.341 303.997 202.095V200.632ZM313.702 204.262H310.715L310.127 206.34H308.104L311.364 196.387H313.108L316.307 206.34H314.283L313.702 204.262ZM311.187 202.628H313.251L312.233 198.964L311.187 202.628ZM321.993 202.621H320.537V206.34H318.616V196.387H321.952C322.503 196.387 323.002 196.453 323.449 196.585C323.896 196.713 324.278 196.902 324.597 197.152C324.912 197.403 325.153 197.715 325.322 198.089C325.495 198.463 325.582 198.896 325.582 199.388C325.582 199.743 325.539 200.064 325.452 200.352C325.37 200.634 325.251 200.887 325.096 201.11C324.937 201.338 324.746 201.536 324.522 201.705C324.304 201.874 324.057 202.02 323.784 202.143L325.924 206.251V206.34H323.866L321.993 202.621ZM320.537 201.062H321.959C322.255 201.062 322.515 201.021 322.738 200.939C322.966 200.853 323.151 200.73 323.292 200.57C323.41 200.443 323.499 200.29 323.558 200.112C323.622 199.935 323.654 199.736 323.654 199.518C323.654 199.253 323.613 199.021 323.531 198.82C323.454 198.615 323.335 198.447 323.176 198.314C323.034 198.196 322.861 198.105 322.656 198.041C322.451 197.977 322.216 197.945 321.952 197.945H320.537V201.062ZM328.383 206.34V196.387H330.96C331.421 196.387 331.851 196.444 332.252 196.558C332.653 196.667 333.018 196.824 333.346 197.029C333.633 197.198 333.888 197.405 334.112 197.651C334.34 197.893 334.538 198.157 334.706 198.444C334.902 198.795 335.053 199.183 335.158 199.606C335.267 200.03 335.322 200.481 335.322 200.96V201.78C335.322 202.241 335.272 202.676 335.171 203.086C335.071 203.496 334.93 203.872 334.747 204.214C334.574 204.519 334.371 204.802 334.139 205.062C333.907 205.317 333.651 205.531 333.373 205.704C333.05 205.909 332.692 206.066 332.3 206.176C331.913 206.285 331.498 206.34 331.056 206.34H328.383ZM330.318 197.945V204.795H331.056C331.293 204.795 331.514 204.765 331.719 204.706C331.924 204.647 332.111 204.56 332.28 204.446C332.453 204.328 332.608 204.177 332.745 203.995C332.886 203.808 333.007 203.592 333.107 203.346C333.189 203.132 333.25 202.895 333.291 202.635C333.337 202.37 333.36 202.086 333.36 201.78V200.946C333.36 200.659 333.337 200.388 333.291 200.133C333.25 199.873 333.189 199.636 333.107 199.422C333.007 199.167 332.874 198.939 332.71 198.738C332.551 198.538 332.364 198.374 332.15 198.246C331.986 198.15 331.803 198.077 331.603 198.027C331.407 197.973 331.193 197.945 330.96 197.945H330.318Z" fill="#8D93A5"/>+<g opacity="0.5">+<rect x="58.4844" y="252.938" width="45.4831" height="45.4831" rx="11.5" fill="#F1F2F4"/>+<rect x="58.4844" y="252.938" width="45.4831" height="45.4831" rx="11.5" stroke="#8D93A5"/>+<path d="M87.5208 267.931C87.5208 271.408 84.7026 274.226 81.2262 274.226C77.7498 274.226 74.9316 271.408 74.9316 267.931C74.9316 264.455 77.7498 261.637 81.2262 261.637C84.7026 261.637 87.5208 264.455 87.5208 267.931Z" fill="#8D93A5" fill-opacity="0.3" stroke="#5A6072" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M71.2466 289.719H91.2052C93.4169 289.719 95.1205 287.817 94.0877 285.862C92.5684 282.985 89.1047 279.551 81.2259 279.551C73.347 279.551 69.8834 282.985 68.3641 285.862C67.3312 287.817 69.0349 289.719 71.2466 289.719Z" fill="#8D93A5" fill-opacity="0.3" stroke="#5A6072" stroke-linecap="round" stroke-linejoin="round"/>+</g>+<g opacity="0.5">+<rect x="454.961" y="252.938" width="45.4831" height="45.4831" rx="11.5" fill="#F1F2F4"/>+<rect x="454.961" y="252.938" width="45.4831" height="45.4831" rx="11.5" stroke="#8D93A5"/>+<path d="M463.66 265.51C463.66 263.371 465.394 261.637 467.534 261.637H487.87C490.009 261.637 491.744 263.371 491.744 265.51V285.847C491.744 287.986 490.009 289.72 487.87 289.72H467.534C465.394 289.72 463.66 287.986 463.66 285.847V265.51Z" fill="#C6C9D2" fill-opacity="0.3" stroke="#5A6072" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>+<path fill-rule="evenodd" clip-rule="evenodd" d="M482.787 278.992C482.449 278.992 482.175 279.267 482.175 279.605L482.175 284.508C482.175 284.67 482.239 284.826 482.354 284.941C482.469 285.056 482.625 285.12 482.787 285.12C483.512 285.12 484.229 284.978 484.898 284.701C485.567 284.423 486.175 284.017 486.687 283.505C487.199 282.993 487.606 282.385 487.883 281.716C488.16 281.046 488.303 280.329 488.303 279.605C488.303 279.267 488.028 278.992 487.69 278.992L482.787 278.992ZM483.4 283.851L483.4 280.218L487.033 280.218C486.982 280.57 486.888 280.916 486.751 281.247C486.535 281.767 486.219 282.24 485.821 282.638C485.422 283.037 484.949 283.353 484.429 283.568C484.098 283.705 483.753 283.8 483.4 283.851Z" fill="#5A6072" fill-opacity="0.5"/>+<path d="M486.342 277.429C486.51 277.723 486.885 277.824 487.178 277.656C487.472 277.488 487.573 277.113 487.405 276.82C487.098 276.284 486.701 275.802 486.23 275.397C485.469 274.742 484.542 274.311 483.552 274.153C482.562 273.995 481.548 274.116 480.623 274.502C479.697 274.889 478.896 275.525 478.308 276.34C477.72 277.155 477.368 278.118 477.289 279.122C477.211 280.126 477.41 281.132 477.864 282.029C478.318 282.927 479.01 283.681 479.864 284.208C480.152 284.386 480.529 284.297 480.707 284.009C480.885 283.721 480.795 283.343 480.507 283.165C479.846 282.757 479.31 282.173 478.957 281.476C478.605 280.779 478.45 279.997 478.511 279.217C478.572 278.437 478.846 277.69 479.302 277.057C479.759 276.425 480.379 275.932 481.095 275.634C481.811 275.335 482.594 275.242 483.359 275.364C484.124 275.486 484.841 275.818 485.431 276.326C485.796 276.64 486.103 277.014 486.342 277.429Z" fill="#5A6072" fill-opacity="0.5"/>+<path d="M473.344 268.57L473.344 289.721" stroke="#5A6072" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M464.145 268.418H491.26" stroke="#5A6072" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>+</g>+<path d="M50.6771 311.257H47.6078V319.645H45.6801V311.257H42.6518V309.691H50.6771V311.257ZM59.2959 315.283H55.208V318.093H59.9863V319.645H53.2803V309.691H59.9658V311.257H55.208V313.766H59.2959V315.283ZM69.5416 319.645H67.6275L64.859 313.226V319.645H62.9244V309.691H64.859L67.607 316.083L67.6139 309.691H69.5416V319.645ZM77.6818 317.566H74.6945L74.1066 319.645H72.0832L75.3439 309.691H77.0871L80.2863 319.645H78.2629L77.6818 317.566ZM75.1662 315.933H77.2307L76.2121 312.269L75.1662 315.933ZM89.158 319.645H87.2439L84.4754 313.226V319.645H82.5408V309.691H84.4754L87.2234 316.083L87.2303 309.691H89.158V319.645ZM99.7182 311.257H96.6488V319.645H94.7211V311.257H91.6928V309.691H99.7182V311.257ZM118.931 316.527C118.899 317.029 118.79 317.48 118.603 317.881C118.421 318.282 118.175 318.624 117.865 318.906C117.555 319.189 117.186 319.408 116.757 319.562C116.329 319.713 115.855 319.788 115.336 319.788C114.925 319.788 114.545 319.736 114.194 319.631C113.848 319.521 113.535 319.367 113.257 319.166C113.002 318.979 112.774 318.754 112.574 318.489C112.378 318.225 112.212 317.933 112.075 317.614C111.943 317.295 111.84 316.944 111.767 316.562C111.699 316.179 111.665 315.773 111.665 315.345V314.005C111.665 313.604 111.697 313.223 111.76 312.863C111.824 312.499 111.92 312.161 112.047 311.852C112.193 311.473 112.385 311.136 112.622 310.84C112.859 310.544 113.128 310.293 113.428 310.088C113.697 309.915 113.991 309.783 114.31 309.691C114.634 309.596 114.98 309.548 115.349 309.548C115.896 309.548 116.381 309.625 116.805 309.78C117.234 309.935 117.598 310.156 117.899 310.443C118.2 310.73 118.437 311.081 118.61 311.496C118.783 311.911 118.893 312.378 118.938 312.897H117.024C117.006 312.601 116.96 312.341 116.887 312.118C116.819 311.895 116.719 311.708 116.587 311.558C116.45 311.412 116.279 311.302 116.074 311.229C115.873 311.152 115.632 311.113 115.349 311.113C115.199 311.113 115.058 311.129 114.925 311.161C114.798 311.193 114.679 311.241 114.57 311.305C114.383 311.414 114.224 311.571 114.091 311.776C113.964 311.977 113.861 312.212 113.784 312.48C113.725 312.69 113.681 312.923 113.654 313.178C113.627 313.428 113.613 313.7 113.613 313.991V315.345C113.613 315.741 113.633 316.097 113.674 316.411C113.72 316.721 113.788 316.992 113.879 317.225C113.943 317.384 114.018 317.525 114.105 317.648C114.196 317.771 114.299 317.874 114.413 317.956C114.536 318.047 114.672 318.116 114.823 318.161C114.978 318.202 115.149 318.223 115.336 318.223C115.586 318.223 115.812 318.191 116.012 318.127C116.213 318.063 116.384 317.963 116.525 317.826C116.666 317.689 116.778 317.514 116.86 317.3C116.942 317.086 116.992 316.828 117.01 316.527H118.931Z" fill="#8D93A5"/>+<path d="M435.32 319.645V309.691H437.897C438.357 309.691 438.788 309.748 439.189 309.862C439.59 309.972 439.955 310.129 440.283 310.334C440.57 310.503 440.825 310.71 441.048 310.956C441.276 311.198 441.475 311.462 441.643 311.749C441.839 312.1 441.99 312.487 442.094 312.911C442.204 313.335 442.258 313.786 442.258 314.265V315.085C442.258 315.545 442.208 315.98 442.108 316.391C442.008 316.801 441.866 317.177 441.684 317.519C441.511 317.824 441.308 318.106 441.076 318.366C440.843 318.621 440.588 318.836 440.31 319.009C439.987 319.214 439.629 319.371 439.237 319.48C438.85 319.59 438.435 319.645 437.993 319.645H435.32ZM437.254 311.25V318.1H437.993C438.23 318.1 438.451 318.07 438.656 318.011C438.861 317.951 439.048 317.865 439.216 317.751C439.39 317.632 439.545 317.482 439.681 317.3C439.823 317.113 439.943 316.896 440.044 316.65C440.126 316.436 440.187 316.199 440.228 315.939C440.274 315.675 440.296 315.39 440.296 315.085V314.251C440.296 313.964 440.274 313.693 440.228 313.438C440.187 313.178 440.126 312.941 440.044 312.727C439.943 312.471 439.811 312.243 439.647 312.043C439.488 311.842 439.301 311.678 439.087 311.551C438.922 311.455 438.74 311.382 438.54 311.332C438.344 311.277 438.129 311.25 437.897 311.25H437.254ZM450.064 317.566H447.076L446.488 319.645H444.465L447.726 309.691H449.469L452.668 319.645H450.645L450.064 317.566ZM447.548 315.933H449.613L448.594 312.269L447.548 315.933ZM462.292 311.257H459.222V319.645H457.295V311.257H454.266V309.691H462.292V311.257ZM469.68 317.566H466.693L466.105 319.645H464.081L467.342 309.691H469.085L472.285 319.645H470.261L469.68 317.566ZM467.164 315.933H469.229L468.21 312.269L467.164 315.933ZM479.762 317.047C479.762 316.869 479.73 316.703 479.666 316.548C479.607 316.393 479.504 316.247 479.358 316.11C479.208 315.978 479.012 315.857 478.771 315.748C478.534 315.634 478.237 315.529 477.882 315.434C477.33 315.283 476.845 315.101 476.426 314.887C476.011 314.673 475.672 314.438 475.407 314.183C475.143 313.927 474.942 313.645 474.806 313.335C474.674 313.025 474.607 312.688 474.607 312.323C474.607 311.904 474.696 311.523 474.874 311.182C475.052 310.84 475.298 310.548 475.612 310.307C475.927 310.065 476.298 309.881 476.727 309.753C477.155 309.621 477.62 309.555 478.121 309.555C478.641 309.555 479.115 309.63 479.543 309.78C479.976 309.931 480.347 310.14 480.657 310.409C480.967 310.683 481.209 311.006 481.382 311.38C481.555 311.754 481.642 312.164 481.642 312.61H479.769C479.759 312.387 479.718 312.182 479.646 311.995C479.577 311.808 479.475 311.646 479.338 311.51C479.197 311.378 479.021 311.275 478.812 311.202C478.606 311.125 478.365 311.086 478.087 311.086C477.832 311.086 477.604 311.118 477.403 311.182C477.207 311.241 477.041 311.325 476.904 311.435C476.768 311.549 476.663 311.683 476.59 311.838C476.521 311.988 476.487 312.152 476.487 312.33C476.487 312.517 476.533 312.686 476.624 312.836C476.72 312.986 476.856 313.121 477.034 313.239C477.212 313.362 477.426 313.474 477.677 313.574C477.932 313.674 478.219 313.768 478.538 313.854C478.88 313.95 479.206 314.066 479.516 314.203C479.826 314.34 480.11 314.497 480.37 314.675C480.762 314.966 481.074 315.306 481.307 315.693C481.539 316.081 481.655 316.527 481.655 317.033C481.655 317.471 481.566 317.86 481.389 318.202C481.215 318.539 480.974 318.824 480.664 319.057C480.354 319.294 479.985 319.474 479.557 319.597C479.128 319.715 478.661 319.774 478.155 319.774C477.659 319.774 477.166 319.701 476.679 319.556C476.196 319.405 475.774 319.187 475.414 318.899C475.072 318.617 474.801 318.284 474.601 317.901C474.405 317.519 474.307 317.07 474.307 316.555H476.193C476.202 316.855 476.255 317.113 476.351 317.327C476.446 317.541 476.581 317.717 476.754 317.854C476.923 317.99 477.125 318.09 477.362 318.154C477.604 318.218 477.868 318.25 478.155 318.25C478.41 318.25 478.636 318.22 478.832 318.161C479.033 318.102 479.201 318.02 479.338 317.915C479.475 317.81 479.579 317.685 479.652 317.539C479.725 317.389 479.762 317.225 479.762 317.047ZM490.527 315.283H486.439V318.093H491.217V319.645H484.511V309.691H491.197V311.257H486.439V313.766H490.527V315.283ZM501.525 311.257H498.455V319.645H496.528V311.257H493.499V309.691H501.525V311.257ZM520.738 316.527C520.706 317.029 520.596 317.48 520.41 317.881C520.227 318.282 519.981 318.624 519.671 318.906C519.361 319.189 518.992 319.408 518.564 319.562C518.135 319.713 517.662 319.788 517.142 319.788C516.732 319.788 516.351 319.736 516 319.631C515.654 319.521 515.342 319.367 515.064 319.166C514.809 318.979 514.581 318.754 514.38 318.489C514.184 318.225 514.018 317.933 513.881 317.614C513.749 317.295 513.647 316.944 513.574 316.562C513.505 316.179 513.471 315.773 513.471 315.345V314.005C513.471 313.604 513.503 313.223 513.567 312.863C513.631 312.499 513.726 312.161 513.854 311.852C514 311.473 514.191 311.136 514.428 310.84C514.665 310.544 514.934 310.293 515.235 310.088C515.504 309.915 515.798 309.783 516.117 309.691C516.44 309.596 516.787 309.548 517.156 309.548C517.703 309.548 518.188 309.625 518.612 309.78C519.04 309.935 519.405 310.156 519.705 310.443C520.006 310.73 520.243 311.081 520.416 311.496C520.59 311.911 520.699 312.378 520.745 312.897H518.83C518.812 312.601 518.767 312.341 518.694 312.118C518.625 311.895 518.525 311.708 518.393 311.558C518.256 311.412 518.085 311.302 517.88 311.229C517.68 311.152 517.438 311.113 517.156 311.113C517.005 311.113 516.864 311.129 516.732 311.161C516.604 311.193 516.486 311.241 516.376 311.305C516.19 311.414 516.03 311.571 515.898 311.776C515.77 311.977 515.668 312.212 515.59 312.48C515.531 312.69 515.488 312.923 515.46 313.178C515.433 313.428 515.419 313.7 515.419 313.991V315.345C515.419 315.741 515.44 316.097 515.481 316.411C515.526 316.721 515.595 316.992 515.686 317.225C515.75 317.384 515.825 317.525 515.912 317.648C516.003 317.771 516.105 317.874 516.219 317.956C516.342 318.047 516.479 318.116 516.629 318.161C516.784 318.202 516.955 318.223 517.142 318.223C517.393 318.223 517.618 318.191 517.819 318.127C518.019 318.063 518.19 317.963 518.331 317.826C518.473 317.689 518.584 317.514 518.666 317.3C518.748 317.086 518.799 316.828 518.817 316.527H520.738Z" fill="#8D93A5"/>+<g filter="url(#filter0_dd_16800_34507)">+<rect x="270" y="139" width="46.4831" height="46.4831" rx="12" fill="white"/>+<rect x="270" y="139" width="46.4831" height="46.4831" rx="12" stroke="#8D93A5"/>+<path d="M279.588 151.733C279.588 149.594 281.322 147.859 283.461 147.859H303.798C305.937 147.859 307.671 149.594 307.671 151.733V172.069C307.671 174.209 305.937 175.943 303.798 175.943H283.461C281.322 175.943 279.588 174.209 279.588 172.069V151.733Z" fill="#C6C9D2" fill-opacity="0.3" stroke="#5A6072" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M289.271 154.793L289.271 175.944" stroke="#5A6072" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M280.072 154.641H307.187" stroke="#5A6072" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>+</g>+<defs>+<filter id="filter0_dd_16800_34507" x="249.5" y="138.5" width="87.4824" height="87.4844" 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="4" operator="erode" in="SourceAlpha" result="effect1_dropShadow_16800_34507"/>+<feOffset dy="8"/>+<feGaussianBlur stdDeviation="4"/>+<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_16800_34507"/>+<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="4" operator="erode" in="SourceAlpha" result="effect2_dropShadow_16800_34507"/>+<feOffset dy="20"/>+<feGaussianBlur stdDeviation="12"/>+<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_16800_34507" result="effect2_dropShadow_16800_34507"/>+<feBlend mode="normal" in="SourceGraphic" in2="effect2_dropShadow_16800_34507" result="shape"/>+</filter>+</defs>+</svg>diff --git a/resources/frontend_client/app/assets/img/embedding_hub_create_embed.png b/resources/frontend_client/app/assets/img/embedding_hub_create_embed.pngdeleted file mode 100644index 7bffb07b50e..00000000000Binary files a/resources/frontend_client/app/assets/img/embedding_hub_create_embed.png and /dev/null differdiff --git a/resources/frontend_client/app/assets/img/[email protected] b/resources/frontend_client/app/assets/img/[email protected]deleted file mode 100644index 476ff6991a3..00000000000Binary files a/resources/frontend_client/app/assets/img/[email protected] and /dev/null differdiff --git a/resources/frontend_client/app/assets/img/embedding_hub_row_column_security.png b/resources/frontend_client/app/assets/img/embedding_hub_row_column_security.pngdeleted file mode 100644index 805394a46dd..00000000000Binary files a/resources/frontend_client/app/assets/img/embedding_hub_row_column_security.png and /dev/null differdiff --git a/resources/frontend_client/app/assets/img/[email protected] b/resources/frontend_client/app/assets/img/[email protected]deleted file mode 100644index 2c62a39be8b..00000000000Binary files a/resources/frontend_client/app/assets/img/[email protected] and /dev/null differdiff --git a/resources/frontend_client/app/assets/img/embedding_hub_secure_embeds_diagram.png b/resources/frontend_client/app/assets/img/embedding_hub_secure_embeds_diagram.pngdeleted file mode 100644index 127e6a7a541..00000000000Binary files a/resources/frontend_client/app/assets/img/embedding_hub_secure_embeds_diagram.png and /dev/null differdiff --git a/resources/frontend_client/app/assets/img/[email protected] b/resources/frontend_client/app/assets/img/[email protected]deleted file mode 100644index 97a5d6ad330..00000000000Binary files a/resources/frontend_client/app/assets/img/[email protected] and /dev/null differdiff --git a/src/metabase/embedding/settings.clj b/src/metabase/embedding/settings.cljindex c599fc5037b..b15ac7f4551 100644--- a/src/metabase/embedding/settings.clj+++ b/src/metabase/embedding/settings.clj@@ -311,3 +311,12 @@:visibility :admin:can-read-from-env? false:doc false)++(defsetting embedding-hub-sso-auth-manual-tested+ (deferred-tru "Indicates if the user has manually confirmed that SSO authentication is working correctly")+ :type :boolean+ :default false+ :export? true+ :visibility :admin+ :can-read-from-env? false+ :doc false)diff --git a/test_resources/serialization_baseline/settings.yaml b/test_resources/serialization_baseline/settings.yamlindex 427752f1205..92d434cdb58 100644--- a/test_resources/serialization_baseline/settings.yaml+++ b/test_resources/serialization_baseline/settings.yaml@@ -20,6 +20,7 @@ disable-cors-on-localhost: nullemail-max-recipients-per-second: nullembedding-homepage: nullembedding-hub-production-embed-snippet-created: null+embedding-hub-sso-auth-manual-tested: nullembedding-hub-test-embed-snippet-created: nullenable-embedding: nullenable-nested-queries: null