Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

Move the SDK storybook instance URL out of the storybook config (#82544)

Romeo Van Snick3c3979838aa3
diff --git a/frontend/src/embedding-sdk-bundle/test/CommonSdkCorsStoryWrapper.tsx b/frontend/src/embedding-sdk-bundle/test/CommonSdkCorsStoryWrapper.tsx
index db86e796de1..65707c3e6ab 100644
--- a/frontend/src/embedding-sdk-bundle/test/CommonSdkCorsStoryWrapper.tsx
+++ b/frontend/src/embedding-sdk-bundle/test/CommonSdkCorsStoryWrapper.tsx
@@ -5,7 +5,7 @@ import "embedding-sdk-bundle";
import { ComponentProvider } from "embedding-sdk-bundle/components/public/ComponentProvider";
import type { MetabaseAuthConfig } from "embedding-sdk-bundle/types";
-import { STORYBOOK_METABASE_INSTANCE_URL } from "embedding-sdk-shared/.storybook/constants";
+import { STORYBOOK_METABASE_INSTANCE_URL } from "embedding-sdk-shared/test/storybook-constants";
const DEFAULT_AUTH_CONFIG: MetabaseAuthConfig = {
metabaseInstanceUrl: STORYBOOK_METABASE_INSTANCE_URL,
diff --git a/frontend/src/embedding-sdk-bundle/test/CommonSdkStoryWrapper.tsx b/frontend/src/embedding-sdk-bundle/test/CommonSdkStoryWrapper.tsx
index c8dd868b7a9..2cefa47b667 100644
--- a/frontend/src/embedding-sdk-bundle/test/CommonSdkStoryWrapper.tsx
+++ b/frontend/src/embedding-sdk-bundle/test/CommonSdkStoryWrapper.tsx
@@ -6,7 +6,7 @@ import { useMemo } from "react";
import "embedding-sdk-bundle";
import { ComponentProvider } from "embedding-sdk-bundle/components/public/ComponentProvider";
-import { STORYBOOK_METABASE_INSTANCE_URL } from "embedding-sdk-shared/.storybook/constants";
+import { STORYBOOK_METABASE_INSTANCE_URL } from "embedding-sdk-shared/test/storybook-constants";
import { storybookThemes } from "embedding-sdk-shared/test/storybook-themes";
import type { MetabaseAuthConfig } from "embedding-sdk-shared/types/auth-config";
import type { MetabaseTheme } from "metabase/embedding-sdk/theme";
diff --git a/frontend/src/embedding-sdk-shared/.storybook/constants.ts b/frontend/src/embedding-sdk-shared/.storybook/constants.ts
index 70fce9835d9..d5bb087f4f9 100644
--- a/frontend/src/embedding-sdk-shared/.storybook/constants.ts
+++ b/frontend/src/embedding-sdk-shared/.storybook/constants.ts
@@ -1,9 +1,3 @@
-/**
- * Metabase instance the SDK stories connect to.
- */
-export const STORYBOOK_METABASE_INSTANCE_URL =
- process.env.STORYBOOK_METABASE_INSTANCE_URL || "http://localhost:3000";
-
// Copied from the instance settings and re-ordered, may go out of sync with the real ones
// Locales in the format `xx_AA` were also changed to `xx-AA`
export const availableLocales = [
diff --git a/frontend/src/embedding-sdk-shared/test/storybook-constants.ts b/frontend/src/embedding-sdk-shared/test/storybook-constants.ts
new file mode 100644
index 00000000000..98601b48246
--- /dev/null
+++ b/frontend/src/embedding-sdk-shared/test/storybook-constants.ts
@@ -0,0 +1,5 @@
+/**
+ * Metabase instance the SDK stories connect to.
+ */
+export const STORYBOOK_METABASE_INSTANCE_URL =
+ process.env.STORYBOOK_METABASE_INSTANCE_URL || "http://localhost:3000";
diff --git a/frontend/src/metabase/embedding/embedding-iframe-sdk/embed.stories.tsx b/frontend/src/metabase/embedding/embedding-iframe-sdk/embed.stories.tsx
index 004f6c7426b..26f74b93ba0 100644
--- a/frontend/src/metabase/embedding/embedding-iframe-sdk/embed.stories.tsx
+++ b/frontend/src/metabase/embedding/embedding-iframe-sdk/embed.stories.tsx
@@ -5,7 +5,7 @@ import {
useControlledParametersPlaygroundState,
} from "embedding-sdk-bundle/test/ParametersPlayground";
import type { ParameterChangePayload } from "embedding-sdk-bundle/types/dashboard";
-import { STORYBOOK_METABASE_INSTANCE_URL } from "embedding-sdk-shared/.storybook/constants";
+import { STORYBOOK_METABASE_INSTANCE_URL } from "embedding-sdk-shared/test/storybook-constants";
import type { ParameterValues } from "metabase/embedding-sdk/types/dashboard";
import { SegmentedControl, Stack, Text } from "metabase/ui";