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
Closes EMB-1063 docs url (#66460)
Sébastieneb3d8eb251d3
diff --git a/frontend/src/metabase/embedding/embedding-hub/components/DocsLink.tsx b/frontend/src/metabase/embedding/embedding-hub/components/DocsLink.tsxindex 08f099acef8..783a3dbb839 100644--- a/frontend/src/metabase/embedding/embedding-hub/components/DocsLink.tsx+++ b/frontend/src/metabase/embedding/embedding-hub/components/DocsLink.tsx@@ -7,13 +7,20 @@ import type { UtmProps } from "metabase/selectors/settings";interface DocsLinkProps {docsPath: string;+ anchor?: string;utm: Required<Pick<UtmProps, "utm_campaign" | "utm_content">>;children: ReactNode;}-export const DocsLink = ({ docsPath, utm, children }: DocsLinkProps) => {+export const DocsLink = ({+ docsPath,+ anchor,+ utm,+ children,+}: DocsLinkProps) => {// eslint-disable-next-line no-unconditional-metabase-links-render -- we are in admin so we must always show the link.const { url } = useDocsUrl(docsPath, {+ anchor,utm: {utm_source: "product",utm_campaign: utm.utm_campaign,diff --git a/frontend/src/metabase/embedding/embedding-hub/components/EmbeddingHub.tsx b/frontend/src/metabase/embedding/embedding-hub/components/EmbeddingHub.tsxindex 25f687dcb55..16e1676b197 100644--- a/frontend/src/metabase/embedding/embedding-hub/components/EmbeddingHub.tsx+++ b/frontend/src/metabase/embedding/embedding-hub/components/EmbeddingHub.tsx@@ -49,9 +49,10 @@ export const EmbeddingHub = () => {type: "click" as const,onClick,}))- .with({ docsPath: P.string }, ({ docsPath }) => ({+ .with({ docsPath: P.string }, ({ docsPath, anchor }) => ({type: "docs" as const,docsPath,+ anchor,utm: { utm_campaign: "embedding_hub", utm_content: stepId },})).with({ modal: P.nonNullable }, ({ modal }) => ({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 f08fd43244f..8d89d6b7bb9 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@@ -120,4 +120,32 @@ 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",+ );+ });});diff --git a/frontend/src/metabase/embedding/embedding-hub/components/StepperWithCards/StepperWithCards.tsx b/frontend/src/metabase/embedding/embedding-hub/components/StepperWithCards/StepperWithCards.tsxindex ef52a00287a..6c01574dacc 100644--- a/frontend/src/metabase/embedding/embedding-hub/components/StepperWithCards/StepperWithCards.tsx+++ b/frontend/src/metabase/embedding/embedding-hub/components/StepperWithCards/StepperWithCards.tsx@@ -42,7 +42,7 @@ type DocsUtm = Required<Pick<UtmProps, "utm_campaign" | "utm_content">>;export type StepperCardClickAction =| { type: "link"; to: string }- | { type: "docs"; docsPath: string; utm: DocsUtm }+ | { type: "docs"; docsPath: string; anchor?: string; utm: DocsUtm }| { type: "click"; onClick: () => void };export const StepperWithCards = ({ steps }: { steps: StepperStep[] }) => {@@ -209,8 +209,8 @@ const CardAction = ({children: ReactNode;}) =>match(card.clickAction)- .with({ type: "docs" }, ({ docsPath, utm }) => (- <DocsLink docsPath={docsPath} utm={utm}>+ .with({ type: "docs" }, ({ docsPath, anchor, utm }) => (+ <DocsLink docsPath={docsPath} anchor={anchor} utm={utm}>{children}</DocsLink>))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 aade80c0de2..b18485dd90c 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@@ -102,14 +102,15 @@ export const useGetEmbeddingHubSteps = (): EmbeddingHubStep[] => {{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#set-up-sso",+ docsPath: "embedding/embedded-analytics-js",+ anchor: "set-up-sso",variant: "outline",stepId: "secure-embeds",},{title: t`Configure data permissions`,- docsPath:- "permissions/embedding#one-database-for-all-customers-commingled-setups",+ 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",diff --git a/frontend/src/metabase/embedding/embedding-hub/types/embedding-checklist.ts b/frontend/src/metabase/embedding/embedding-hub/types/embedding-checklist.tsindex 59996f08f88..1bc614399a8 100644--- a/frontend/src/metabase/embedding/embedding-hub/types/embedding-checklist.ts+++ b/frontend/src/metabase/embedding/embedding-hub/types/embedding-checklist.ts@@ -51,6 +51,9 @@ interface EmbeddingHubAction {/** Path of the documentation page, e.g. `embedding/embedded-analytics-js` */docsPath?: string;+ /** Anchor on the documentation page, e.g. `set-up-sso` */+ anchor?: string;+/** CTA button variant. */variant?: "outline" | "subtle" | "filled";diff --git a/frontend/src/metabase/setup/components/LicenseTokenStep/LicenseTokenForm.tsx b/frontend/src/metabase/setup/components/LicenseTokenStep/LicenseTokenForm.tsxindex 7c64b7dffde..408c7e6bb88 100644--- a/frontend/src/metabase/setup/components/LicenseTokenStep/LicenseTokenForm.tsx+++ b/frontend/src/metabase/setup/components/LicenseTokenStep/LicenseTokenForm.tsx@@ -88,7 +88,7 @@ export const LicenseTokenForm = ({</HoverCard></Box>}- rightSectionWidth="1rem"+ rightSectionWidth="2rem"/><FormErrorMessage /></Box>