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
Change Embed JS Wizard Upsells (#66756)
Timofey Kachalovfb721f66e86f
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 1437cac22a7..7eada077be7 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@@ -137,7 +137,7 @@ describe("scenarios > embedding > sdk iframe embed setup > guest-embed", () => {getEmbedSidebar().within(() => {cy.findByLabelText("Guest").should("be.visible").should("be.checked");- cy.findByTestId("upsell-gem").should("not.exist");+ cy.findByTestId("upsell-card").should("not.exist");cy.findByText("Chart").click();cy.findByText("Next").click();@@ -186,7 +186,7 @@ describe("scenarios > embedding > sdk iframe embed setup > guest-embed", () => {cy.findAllByTestId("parameter-widget").find("input").type("Foo Bar Baz");getEmbedSidebar().within(() => {- cy.findByTestId("upsell-gem").should("not.exist");+ cy.findByTestId("upsell-card").should("not.exist");});H.publishChanges("card");diff --git a/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/guest-embed-oss.cy.spec.ts b/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/guest-embed-oss.cy.spec.tsindex 0d7d5a50ad3..aa630c62596 100644--- a/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/guest-embed-oss.cy.spec.ts+++ b/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/guest-embed-oss.cy.spec.ts@@ -129,22 +129,13 @@ describe(getEmbedSidebar().within(() => {cy.findByLabelText("Guest").should("be.visible").should("be.checked");- ["Metabase account (SSO)"].forEach((text) => {- cy.findAllByTestId("tooltip-warning")- .filter(`:contains("${text}")`)- .within(() => {- cy.findByTestId("upsell-gem").should("be.visible");- });- });+ ["Metabase account (SSO)", "Exploration", "Browser"].forEach(+ (label) => {+ cy.findByLabelText(label).should("be.disabled");+ },+ );- ["Exploration", "Browser"].forEach((label) => {- cy.findByLabelText(label).should("be.disabled");- cy.get("label")- .contains(label)- .within(() => {- cy.findByTestId("upsell-gem").should("be.visible");- });- });+ cy.findByTestId("upsell-card").should("be.visible");cy.findByText("Chart").click();cy.findByText("Next").click();@@ -192,14 +183,12 @@ describe("Allow people to drill through on data points","Allow downloads","Allow people to save new questions",- ].forEach((text) => {- cy.findAllByTestId("tooltip-warning")- .filter(`:contains("${text}")`)- .within(() => {- cy.findByTestId("upsell-gem").should("be.visible");- });+ ].forEach((label) => {+ cy.findByLabelText(label).should("be.disabled");});+ cy.findByTestId("upsell-card").should("exist");+H.setEmbeddingParameter("Text", "Locked");cy.findAllByTestId("parameter-widget").find("input")@@ -215,8 +204,6 @@ describe(getEmbedSidebar().within(() => {cy.findByTestId("appearance-section").within(() => {- cy.findByTestId("upsell-gem").should("be.visible");-cy.findByText("Dark").click();});});diff --git a/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/select-embed-options.cy.spec.ts b/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/select-embed-options.cy.spec.tsindex ece9782ba28..a9cfb38de13 100644--- a/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/select-embed-options.cy.spec.ts+++ b/e2e/test/scenarios/embedding/sdk-iframe-embedding-setup/select-embed-options.cy.spec.ts@@ -35,9 +35,7 @@ describe("OSS", { tags: "@OSS" }, () => {resourceName: DASHBOARD_NAME,});- assertUpsellForOption("Allow people to drill through on data points");- assertUpsellForOption("Allow downloads");- assertUpsellForOption("Allow subscriptions");+ getEmbedSidebar().findByTestId("upsell-card").should("be.visible");});});});@@ -58,34 +56,17 @@ describe("EE without license", () => {mockEmbedJsToDevServer();});- it("should show upsell for Allow subscriptions option", () => {+ it("should show upsell banner", () => {navigateToEmbedOptionsStep({experience: "dashboard",resourceName: DASHBOARD_NAME,});- assertUpsellForOption("Allow people to drill through on data points");- assertUpsellForOption("Allow downloads");- assertUpsellForOption("Allow subscriptions");+ getEmbedSidebar().findByTestId("upsell-card").should("be.visible");});});});-function assertUpsellForOption(label: string) {- getEmbedSidebar()- .findByLabelText(label)- .closest("[data-testid=tooltip-warning]")- .icon("gem")- .realHover();-- H.hovercard().should("contain.text", "Get more powerful embedding");- H.hovercard().should(- "contain.text",- "Upgrade to get access to embeds with single sign-on, drill through, advanced theming, the SDK for React, and more.",- );- H.hovercard().should("contain.text", "Upgrade to Metabase Pro");-}-describe(suiteTitle, () => {beforeEach(() => {H.restore();diff --git a/frontend/src/metabase/common/components/UpsellCard/UpsellCard.tsx b/frontend/src/metabase/common/components/UpsellCard/UpsellCard.tsxindex 35c922f6c9f..e4a37da359c 100644--- a/frontend/src/metabase/common/components/UpsellCard/UpsellCard.tsx+++ b/frontend/src/metabase/common/components/UpsellCard/UpsellCard.tsx@@ -23,6 +23,10 @@ type CardWidthProps =| {maxWidth?: number;fullWidth?: never;+ }+ | {+ maxWidth?: "initial";+ fullWidth?: boolean;};type CardLinkProps =@@ -82,11 +86,14 @@ export const _UpsellCard: React.FC<UpsellCardProps> = ({[S.Large]: large,});+ const normalizedMaxWidth =+ maxWidth === "initial" ? undefined : `${maxWidth ?? 200}px`;+return (<Boxdata-testid="upsell-card"w={fullWidth ? "100%" : "auto"}- maw={`${maxWidth ?? 200}px`}+ maw={normalizedMaxWidth}{...props}className={className}>diff --git a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/analytics.ts b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/analytics.tsindex b377f582b6f..dbf33ef7942 100644--- a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/analytics.ts+++ b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/analytics.ts@@ -24,7 +24,6 @@ import {export const UTM_LOCATION = "embedded_analytics_js_wizard";export const UPSELL_CAMPAIGN_EXPERIENCE = "embedding_experience";-export const UPSELL_CAMPAIGN_AUTH = "embedding_auth";export const UPSELL_CAMPAIGN_BEHAVIOR = "embedding_behavior";export const SETUP_SSO_CAMPAIGN = "embedding_get_code";diff --git a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/Appearance/SimpleThemeSwitcherSection.tsx b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/Appearance/SimpleThemeSwitcherSection.tsxindex b03726222d8..04eb942d44a 100644--- a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/Appearance/SimpleThemeSwitcherSection.tsx+++ b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/Appearance/SimpleThemeSwitcherSection.tsx@@ -1,4 +1,3 @@-import type { ReactNode } from "react";import { t } from "ttag";import type { MetabaseThemePreset } from "metabase/embedding-sdk/theme";@@ -8,17 +7,15 @@ import { BaseAppearanceSection } from "./BaseAppearanceSection";type Props = {preset: MetabaseThemePreset | undefined;- upsellIcon: ReactNode;onPresetChange: (themePreset: MetabaseThemePreset) => void;};export const SimpleThemeSwitcherSection = ({preset,- upsellIcon,onPresetChange,}: Props) => {return (- <BaseAppearanceSection icons={upsellIcon}>+ <BaseAppearanceSection><Radio.Groupvalue={preset}onChange={(value) => onPresetChange(value as MetabaseThemePreset)}diff --git a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/Authentication/AuthenticationSection.tsx b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/Authentication/AuthenticationSection.tsxindex 3ae5edfd6fb..2ddae30a3e8 100644--- a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/Authentication/AuthenticationSection.tsx+++ b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/Authentication/AuthenticationSection.tsx@@ -1,9 +1,7 @@import type { ReactNode } from "react";import { t } from "ttag";-import { UPSELL_CAMPAIGN_AUTH } from "metabase/embedding/embedding-iframe-sdk-setup/analytics";-import { TooltipWarning } from "metabase/embedding/embedding-iframe-sdk-setup/components/warnings/TooltipWarning";-import { WithSimpleEmbeddingFeatureUpsellTooltip } from "metabase/embedding/embedding-iframe-sdk-setup/components/warnings/WithSimpleEmbeddingFeatureUpsellTooltip";+import { TooltipWarning } from "metabase/embedding/embedding-iframe-sdk-setup/components/Common/TooltipWarning";import { useSdkIframeEmbedSetupContext } from "metabase/embedding/embedding-iframe-sdk-setup/context";import {DEFAULT_EXPERIENCE,@@ -61,21 +59,14 @@ export const AuthenticationSection = () => {)}</WithGuestEmbedsDisabledWarning>- <WithSimpleEmbeddingFeatureUpsellTooltip- enableTooltip={!isSimpleEmbedFeatureAvailable}- campaign={UPSELL_CAMPAIGN_AUTH}- >- {({ disabled }) => (- <Radio- value="sso"- label={- // eslint-disable-next-line no-literal-metabase-strings -- Public Facing string- t`Metabase account (SSO)`- }- disabled={disabled}- />- )}- </WithSimpleEmbeddingFeatureUpsellTooltip>+ <Radio+ value="sso"+ label={+ // eslint-disable-next-line no-literal-metabase-strings -- Public Facing string+ t`Metabase account (SSO)`+ }+ disabled={!isSimpleEmbedFeatureAvailable}+ /></Stack></Radio.Group></Stack>diff --git a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/Common/EmbeddingUpsell.tsx b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/Common/EmbeddingUpsell.tsxnew file mode 100644index 00000000000..5659a661770--- /dev/null+++ b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/Common/EmbeddingUpsell.tsx@@ -0,0 +1,38 @@+import { t } from "ttag";++import { UpsellCard } from "metabase/common/components/UpsellCard";+import { UTM_LOCATION } from "metabase/embedding/embedding-iframe-sdk-setup/analytics";+import { useSdkIframeEmbedSetupContext } from "metabase/embedding/embedding-iframe-sdk-setup/context";+import { useSelector } from "metabase/lib/redux";+import { getUpgradeUrl } from "metabase/selectors/settings";++type Props = {+ campaign: string;+};++export const EmbeddingUpsell = ({ campaign }: Props) => {+ const { isSimpleEmbedFeatureAvailable } = useSdkIframeEmbedSetupContext();++ const upgradeUrl = useSelector((state) =>+ getUpgradeUrl(state, { utm_content: "embedding-page" }),+ );++ if (isSimpleEmbedFeatureAvailable) {+ return null;+ }++ return (+ <UpsellCard+ title={t`Get more powerful embedding`}+ buttonLink={upgradeUrl}+ campaign={campaign}+ location={UTM_LOCATION}+ /* eslint-disable-next-line no-literal-metabase-strings -- Button text */+ buttonText={t`Upgrade to Metabase Pro`}+ fullWidth+ maxWidth="initial"+ >+ {t`Upgrade to get access to embeds with single sign-on, drill through, advanced theming, the Modular Embedding SDK, and more.`}+ </UpsellCard>+ );+};diff --git a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/warnings/TooltipWarning.tsx b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/Common/TooltipWarning.tsxsimilarity index 100%rename from frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/warnings/TooltipWarning.tsxrename to frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/Common/TooltipWarning.tsxdiff --git a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/Common/WithNotAvailableForGuestEmbedsWarning.tsx b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/Common/WithNotAvailableForGuestEmbedsWarning.tsxdeleted file mode 100644index 32483b1c514..00000000000--- a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/Common/WithNotAvailableForGuestEmbedsWarning.tsx+++ /dev/null@@ -1,48 +0,0 @@-import type { ReactNode } from "react";-import { t } from "ttag";--import {- TooltipWarning,- type TooltipWarningMode,-} from "metabase/embedding/embedding-iframe-sdk-setup/components/warnings/TooltipWarning";-import { useSdkIframeEmbedSetupContext } from "metabase/embedding/embedding-iframe-sdk-setup/context";--import { WithNotAvailableWithoutSimpleEmbeddingFeatureWarning } from "./WithNotAvailableWithoutSimpleEmbeddingFeatureWarning";--export const WithNotAvailableForGuestEmbedsWarning = ({- mode,- children,- campaign,-}: {- mode?: TooltipWarningMode;- children: (data: { disabled: boolean; hoverCard: ReactNode }) => ReactNode;- campaign: string;-}) => {- const { settings } = useSdkIframeEmbedSetupContext();-- return (- <WithNotAvailableWithoutSimpleEmbeddingFeatureWarning- mode={mode}- campaign={campaign}- >- {({ disabled: disabledForOss, hoverCard: disabledForOssHoverCard }) => (- <TooltipWarning- enableTooltip={!disabledForOss}- tooltip={t`Not available if Guest Mode is selected`}- disabled={!!settings.isGuest}- >- {({- disabled: disabledForGuestEmbeds,- hoverCard: disabledForGuestEmbedsHoverCard,- }) =>- children({- disabled: disabledForOss || disabledForGuestEmbeds,- hoverCard:- disabledForOssHoverCard || disabledForGuestEmbedsHoverCard,- })- }- </TooltipWarning>- )}- </WithNotAvailableWithoutSimpleEmbeddingFeatureWarning>- );-};diff --git a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/Common/WithNotAvailableForOssOrGuestEmbedsGuard.tsx b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/Common/WithNotAvailableForOssOrGuestEmbedsGuard.tsxnew file mode 100644index 00000000000..86cfb39bef1--- /dev/null+++ b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/Common/WithNotAvailableForOssOrGuestEmbedsGuard.tsx@@ -0,0 +1,29 @@+import type { ReactNode } from "react";+import { t } from "ttag";++import { TooltipWarning } from "metabase/embedding/embedding-iframe-sdk-setup/components/Common/TooltipWarning";+import { useSdkIframeEmbedSetupContext } from "metabase/embedding/embedding-iframe-sdk-setup/context";++export const WithNotAvailableForOssOrGuestEmbedsGuard = ({+ children,+}: {+ children: (data: { disabled: boolean; hoverCard: ReactNode }) => ReactNode;+}) => {+ const { isSimpleEmbedFeatureAvailable, settings } =+ useSdkIframeEmbedSetupContext();++ return (+ <TooltipWarning+ enableTooltip={isSimpleEmbedFeatureAvailable}+ tooltip={t`Not available if Guest Mode is selected`}+ disabled={!!settings.isGuest}+ >+ {({ disabled: disabledForGuestEmbeds, hoverCard }) =>+ children({+ disabled: !isSimpleEmbedFeatureAvailable || disabledForGuestEmbeds,+ hoverCard,+ })+ }+ </TooltipWarning>+ );+};diff --git a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/Common/WithNotAvailableWithoutSimpleEmbeddingFeatureWarning.tsx b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/Common/WithNotAvailableWithoutSimpleEmbeddingFeatureWarning.tsxdeleted file mode 100644index f900a47bf42..00000000000--- a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/Common/WithNotAvailableWithoutSimpleEmbeddingFeatureWarning.tsx+++ /dev/null@@ -1,28 +0,0 @@-import type { ReactNode } from "react";--import { useSdkIframeEmbedSetupContext } from "metabase/embedding/embedding-iframe-sdk-setup/context";--import type { TooltipWarningMode } from "../warnings/TooltipWarning";-import { WithSimpleEmbeddingFeatureUpsellTooltip } from "../warnings/WithSimpleEmbeddingFeatureUpsellTooltip";--export const WithNotAvailableWithoutSimpleEmbeddingFeatureWarning = ({- mode,- children,- campaign,-}: {- mode?: TooltipWarningMode;- children: (data: { disabled: boolean; hoverCard: ReactNode }) => ReactNode;- campaign: string;-}) => {- const { isSimpleEmbedFeatureAvailable } = useSdkIframeEmbedSetupContext();-- return (- <WithSimpleEmbeddingFeatureUpsellTooltip- mode={mode}- enableTooltip={!isSimpleEmbedFeatureAvailable}- campaign={campaign}- >- {({ disabled, hoverCard }) => children({ disabled, hoverCard })}- </WithSimpleEmbeddingFeatureUpsellTooltip>- );-};diff --git a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/SelectEmbedExperienceStep.tsx b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/SelectEmbedExperienceStep.tsxindex 6bf74cf0e8f..30f7572c7b3 100644--- a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/SelectEmbedExperienceStep.tsx+++ b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/SelectEmbedExperienceStep.tsx@@ -1,16 +1,17 @@import { t } from "ttag";-import { UPSELL_CAMPAIGN_EXPERIENCE } from "metabase/embedding/embedding-iframe-sdk-setup/analytics";-import { AuthenticationSection } from "metabase/embedding/embedding-iframe-sdk-setup/components/Authentication/AuthenticationSection";-import { WithSimpleEmbeddingFeatureUpsellTooltip } from "metabase/embedding/embedding-iframe-sdk-setup/components/warnings/WithSimpleEmbeddingFeatureUpsellTooltip";-import { useHandleExperienceChange } from "metabase/embedding/embedding-iframe-sdk-setup/hooks/use-handle-experience-change";import { PLUGIN_METABOT } from "metabase/plugins";import { Card, Flex, Radio, Stack, Text } from "metabase/ui";+import { UPSELL_CAMPAIGN_EXPERIENCE } from "../analytics";import { getEmbedExperiences } from "../constants";import { useSdkIframeEmbedSetupContext } from "../context";+import { useHandleExperienceChange } from "../hooks/use-handle-experience-change";import type { SdkIframeEmbedSetupExperience } from "../types";+import { AuthenticationSection } from "./Authentication/AuthenticationSection";+import { EmbeddingUpsell } from "./Common/EmbeddingUpsell";+export const SelectEmbedExperienceStep = () => {const { isSimpleEmbedFeatureAvailable, experience, settings } =useSdkIframeEmbedSetupContext();@@ -21,7 +22,6 @@ export const SelectEmbedExperienceStep = () => {const handleEmbedExperienceChange = useHandleExperienceChange();const experiences = getEmbedExperiences({- isSimpleEmbedFeatureAvailable,isMetabotAvailable,});@@ -44,33 +44,26 @@ export const SelectEmbedExperienceStep = () => {><Stack gap="md">{experiences.map((experience) => (- <WithSimpleEmbeddingFeatureUpsellTooltip+ <Radiokey={experience.value}- mode="custom"- enableTooltip={experience.showUpsell === true}- campaign={UPSELL_CAMPAIGN_EXPERIENCE}- >- {({ disabled, hoverCard }) => (- <Radio- value={experience.value}- label={- <Flex gap="xs" align="center">- {experience.title}- {hoverCard}- </Flex>- }- description={experience.description}- disabled={- disabled ||- (isGuestEmbed && !experience.supportsGuestEmbed)- }- />- )}- </WithSimpleEmbeddingFeatureUpsellTooltip>+ value={experience.value}+ label={+ <Flex gap="xs" align="center">+ {experience.title}+ </Flex>+ }+ description={experience.description}+ disabled={+ (!experience.supportsOss && !isSimpleEmbedFeatureAvailable) ||+ (!experience.supportsGuestEmbed && isGuestEmbed)+ }+ />))}</Stack></Radio.Group></Card>++ <EmbeddingUpsell campaign={UPSELL_CAMPAIGN_EXPERIENCE} /></>);};diff --git a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/SelectEmbedOptionsStep.tsx b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/SelectEmbedOptionsStep.tsxindex ebb1cb7196a..35995c6ce25 100644--- a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/SelectEmbedOptionsStep.tsx+++ b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/SelectEmbedOptionsStep.tsx@@ -4,8 +4,6 @@ import { P, match } from "ts-pattern";import { c, t } from "ttag";import { useHasEmailSetup } from "metabase/common/hooks";-import { UPSELL_CAMPAIGN_BEHAVIOR } from "metabase/embedding/embedding-iframe-sdk-setup/analytics";-import { WithNotAvailableWithoutSimpleEmbeddingFeatureWarning } from "metabase/embedding/embedding-iframe-sdk-setup/components/Common/WithNotAvailableWithoutSimpleEmbeddingFeatureWarning";import type {MetabaseColors,MetabaseThemePreset,@@ -21,12 +19,14 @@ import {Text,} from "metabase/ui";+import { UPSELL_CAMPAIGN_BEHAVIOR } from "../analytics";import { useSdkIframeEmbedSetupContext } from "../context";import { ColorCustomizationSection } from "./Appearance/ColorCustomizationSection";import { SimpleThemeSwitcherSection } from "./Appearance/SimpleThemeSwitcherSection";import { AuthenticationSection } from "./Authentication/AuthenticationSection";-import { WithNotAvailableForGuestEmbedsWarning } from "./Common/WithNotAvailableForGuestEmbedsWarning";+import { EmbeddingUpsell } from "./Common/EmbeddingUpsell";+import { WithNotAvailableForOssOrGuestEmbedsGuard } from "./Common/WithNotAvailableForOssOrGuestEmbedsGuard";import { LegacyStaticEmbeddingAlert } from "./LegacyStaticEmbeddingAlert";import { MetabotLayoutSetting } from "./MetabotLayoutSetting";import { ParameterSettings } from "./ParameterSettings";@@ -38,11 +38,13 @@ export const SelectEmbedOptionsStep = () => (<ParametersSection /><AppearanceSection /><LegacyStaticEmbeddingAlert />+ <EmbeddingUpsell campaign={UPSELL_CAMPAIGN_BEHAVIOR} /></Stack>);const BehaviorSection = () => {- const { settings, updateSettings } = useSdkIframeEmbedSetupContext();+ const { isSimpleEmbedFeatureAvailable, settings, updateSettings } =+ useSdkIframeEmbedSetupContext();const hasEmailSetup = useHasEmailSetup();const behaviorSection = useMemo(() => {@@ -64,9 +66,7 @@ const BehaviorSection = () => {{ componentName: "metabase-question", questionId: P.nonNullable },(settings) => (<Stack gap="md">- <WithNotAvailableForGuestEmbedsWarning- campaign={UPSELL_CAMPAIGN_BEHAVIOR}- >+ <WithNotAvailableForOssOrGuestEmbedsGuard>{({ disabled }) => (<Checkboxlabel={t`Allow people to drill through on data points`}@@ -75,26 +75,18 @@ const BehaviorSection = () => {onChange={(e) => updateSettings({ drills: e.target.checked })}/>)}- </WithNotAvailableForGuestEmbedsWarning>+ </WithNotAvailableForOssOrGuestEmbedsGuard>- <WithNotAvailableWithoutSimpleEmbeddingFeatureWarning- campaign={UPSELL_CAMPAIGN_BEHAVIOR}- >- {({ disabled }) => (- <Checkbox- label={t`Allow downloads`}- disabled={disabled}- checked={settings.withDownloads}- onChange={(e) =>- updateSettings({ withDownloads: e.target.checked })- }- />- )}- </WithNotAvailableWithoutSimpleEmbeddingFeatureWarning>+ <Checkbox+ label={t`Allow downloads`}+ disabled={!isSimpleEmbedFeatureAvailable}+ checked={settings.withDownloads}+ onChange={(e) =>+ updateSettings({ withDownloads: e.target.checked })+ }+ />- <WithNotAvailableForGuestEmbedsWarning- campaign={UPSELL_CAMPAIGN_BEHAVIOR}- >+ <WithNotAvailableForOssOrGuestEmbedsGuard>{({ disabled }) => (<Checkboxlabel={t`Allow people to save new questions`}@@ -105,7 +97,7 @@ const BehaviorSection = () => {}/>)}- </WithNotAvailableForGuestEmbedsWarning>+ </WithNotAvailableForOssOrGuestEmbedsGuard></Stack>),)@@ -113,9 +105,7 @@ const BehaviorSection = () => {{ componentName: "metabase-dashboard", dashboardId: P.nonNullable },(settings) => (<Stack gap="md">- <WithNotAvailableForGuestEmbedsWarning- campaign={UPSELL_CAMPAIGN_BEHAVIOR}- >+ <WithNotAvailableForOssOrGuestEmbedsGuard>{({ disabled }) => (<Checkboxlabel={t`Allow people to drill through on data points`}@@ -124,26 +114,18 @@ const BehaviorSection = () => {onChange={(e) => updateSettings({ drills: e.target.checked })}/>)}- </WithNotAvailableForGuestEmbedsWarning>+ </WithNotAvailableForOssOrGuestEmbedsGuard>- <WithNotAvailableWithoutSimpleEmbeddingFeatureWarning- campaign={UPSELL_CAMPAIGN_BEHAVIOR}- >- {({ disabled }) => (- <Checkbox- label={t`Allow downloads`}- disabled={disabled}- checked={settings.withDownloads}- onChange={(e) =>- updateSettings({ withDownloads: e.target.checked })- }- />- )}- </WithNotAvailableWithoutSimpleEmbeddingFeatureWarning>+ <Checkbox+ label={t`Allow downloads`}+ disabled={!isSimpleEmbedFeatureAvailable}+ checked={settings.withDownloads}+ onChange={(e) =>+ updateSettings({ withDownloads: e.target.checked })+ }+ />- <WithNotAvailableForGuestEmbedsWarning- campaign={UPSELL_CAMPAIGN_BEHAVIOR}- >+ <WithNotAvailableForOssOrGuestEmbedsGuard>{({ disabled: disabledInGuestEmbedding }) => {return (<Flex align="center" gap="xs">@@ -187,7 +169,7 @@ const BehaviorSection = () => {</Flex>);}}- </WithNotAvailableForGuestEmbedsWarning>+ </WithNotAvailableForOssOrGuestEmbedsGuard></Stack>),)@@ -203,7 +185,7 @@ const BehaviorSection = () => {),).otherwise(() => null);- }, [hasEmailSetup, settings, updateSettings]);+ }, [hasEmailSetup, isSimpleEmbedFeatureAvailable, settings, updateSettings]);if (behaviorSection === null) {return null;@@ -245,7 +227,8 @@ const ParametersSection = () => {};const AppearanceSection = () => {- const { settings, updateSettings } = useSdkIframeEmbedSetupContext();+ const { isSimpleEmbedFeatureAvailable, settings, updateSettings } =+ useSdkIframeEmbedSetupContext();const { theme } = settings;@@ -289,28 +272,18 @@ const AppearanceSection = () => {return (<Card p="md">- <WithNotAvailableWithoutSimpleEmbeddingFeatureWarning- mode="custom"- campaign={UPSELL_CAMPAIGN_BEHAVIOR}- >- {({ disabled, hoverCard }) => (- <>- {disabled ? (- <SimpleThemeSwitcherSection- preset={theme?.preset}- upsellIcon={hoverCard}- onPresetChange={updateThemePreset}- />- ) : (- <ColorCustomizationSection- theme={theme}- onColorChange={updateColors}- onColorReset={() => updateSettings({ theme: undefined })}- />- )}- </>- )}- </WithNotAvailableWithoutSimpleEmbeddingFeatureWarning>+ {isSimpleEmbedFeatureAvailable ? (+ <ColorCustomizationSection+ theme={theme}+ onColorChange={updateColors}+ onColorReset={() => updateSettings({ theme: undefined })}+ />+ ) : (+ <SimpleThemeSwitcherSection+ preset={theme?.preset}+ onPresetChange={updateThemePreset}+ />+ )}{appearanceSection && <Divider mt="lg" mb="md" />}{appearanceSection}diff --git a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/warnings/WithSimpleEmbeddingFeatureUpsellTooltip.tsx b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/warnings/WithSimpleEmbeddingFeatureUpsellTooltip.tsxdeleted file mode 100644index cd4b49350e7..00000000000--- a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/components/warnings/WithSimpleEmbeddingFeatureUpsellTooltip.tsx+++ /dev/null@@ -1,57 +0,0 @@-import type { ReactNode } from "react";-import { t } from "ttag";--import { UpsellGem } from "metabase/admin/upsells/components";-import { UpsellCard } from "metabase/common/components/UpsellCard";-import { UTM_LOCATION } from "metabase/embedding/embedding-iframe-sdk-setup/analytics";-import { useSdkIframeEmbedSetupContext } from "metabase/embedding/embedding-iframe-sdk-setup/context";-import { useSelector } from "metabase/lib/redux";-import { getUpgradeUrl } from "metabase/selectors/settings";--import { TooltipWarning, type TooltipWarningMode } from "./TooltipWarning";--const UPSELL_CARD_WIDTH = 252;--export const WithSimpleEmbeddingFeatureUpsellTooltip = ({- mode,- children,- enableTooltip,- campaign,-}: {- mode?: TooltipWarningMode;- children: (data: { disabled: boolean; hoverCard: ReactNode }) => ReactNode;- enableTooltip: boolean;- campaign: string;-}) => {- const { settings } = useSdkIframeEmbedSetupContext();-- const disabled = !!settings.isGuest;-- const upgradeUrl = useSelector((state) =>- getUpgradeUrl(state, { utm_content: "embedding-page" }),- );-- return (- <TooltipWarning- mode={mode}- enableTooltip={enableTooltip}- icon={<UpsellGem />}- hovercard={- <UpsellCard- title={t`Get more powerful embedding`}- buttonLink={upgradeUrl}- campaign={campaign}- location={UTM_LOCATION}- /* eslint-disable-next-line no-literal-metabase-strings -- Button text */- buttonText={t`Upgrade to Metabase Pro`}- maxWidth={UPSELL_CARD_WIDTH}- >- {t`Upgrade to get access to embeds with single sign-on, drill through, advanced theming, the SDK for React, and more.`}- </UpsellCard>- }- disabled={disabled}- >- {children}- </TooltipWarning>- );-};diff --git a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/constants.ts b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/constants.tsindex e8a46f94b5e..9d3ebd8b028 100644--- a/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/constants.ts+++ b/frontend/src/metabase/embedding/embedding-iframe-sdk-setup/constants.ts@@ -13,10 +13,8 @@ import type {export const EMBED_RESOURCE_LIST_MAX_RECENTS = 6;export const getEmbedExperiences = ({- isSimpleEmbedFeatureAvailable,isMetabotAvailable,}: {- isSimpleEmbedFeatureAvailable: boolean;isMetabotAvailable: boolean;}) =>[@@ -24,26 +22,28 @@ export const getEmbedExperiences = ({value: "dashboard",title: t`Dashboard`,description: t`Embed an entire dashboard with multiple charts and filters`,+ supportsOss: true,supportsGuestEmbed: true,},{value: "chart",title: t`Chart`,description: t`Embed a single chart`,+ supportsOss: true,supportsGuestEmbed: true,},{value: "exploration",title: t`Exploration`,description: t`Embed an interactive data exploration experience`,- showUpsell: !isSimpleEmbedFeatureAvailable,+ supportsOss: false,supportsGuestEmbed: false,},{value: "browser",title: t`Browser`,description: t`Embed a browser to manage dashboards and charts`,- showUpsell: !isSimpleEmbedFeatureAvailable,+ supportsOss: false,supportsGuestEmbed: false,},...(isMetabotAvailable@@ -52,7 +52,7 @@ export const getEmbedExperiences = ({value: "metabot" as const,title: t`Metabot`,description: t`Embed a Metabot chat interface`,- showUpsell: !isSimpleEmbedFeatureAvailable,+ supportsOss: false,supportsGuestEmbed: false,},]@@ -61,7 +61,7 @@ export const getEmbedExperiences = ({title: string;description: string;value: SdkIframeEmbedSetupExperience;- showUpsell?: boolean;+ supportsOss: boolean;supportsGuestEmbed: boolean;}[];