Skip to content

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

Set showDashboardQuestions to false by default on SDK CollectionBrowser (#78038)

Sébastienccd7e611846b
diff --git a/frontend/src/embedding-sdk-bundle/components/public/CollectionBrowser/CollectionBrowser.tsx b/frontend/src/embedding-sdk-bundle/components/public/CollectionBrowser/CollectionBrowser.tsx
index 6d0f7730658..0382089be5c 100644
--- a/frontend/src/embedding-sdk-bundle/components/public/CollectionBrowser/CollectionBrowser.tsx
+++ b/frontend/src/embedding-sdk-bundle/components/public/CollectionBrowser/CollectionBrowser.tsx
@@ -82,7 +82,7 @@ export type CollectionBrowserProps = {
visibleEntityTypes?: UserFacingEntityName[];
/**
- * Whether to show questions that belong to a dashboard alongside collection saved questions. Set to false to hide them and keep the list focused on collection content, matching the core Metabase app. Defaults to true.
+ * Whether to show questions that belong to a dashboard alongside collection saved questions. Set to true to show them. Defaults to false, keeping the list focused on collection content.
*/
showDashboardQuestions?: boolean;
@@ -107,7 +107,7 @@ export const CollectionBrowserInner = ({
onClick,
pageSize = COLLECTION_PAGE_SIZE,
visibleEntityTypes = [...USER_FACING_ENTITY_NAMES],
- showDashboardQuestions = true,
+ showDashboardQuestions = false,
EmptyContentComponent = null,
visibleColumns = COLLECTION_BROWSER_LIST_COLUMNS,
className,
diff --git a/frontend/src/embedding-sdk-bundle/components/public/CollectionBrowser/CollectionBrowser.unit.spec.tsx b/frontend/src/embedding-sdk-bundle/components/public/CollectionBrowser/CollectionBrowser.unit.spec.tsx
index b1fb1280862..dd2dea12354 100644
--- a/frontend/src/embedding-sdk-bundle/components/public/CollectionBrowser/CollectionBrowser.unit.spec.tsx
+++ b/frontend/src/embedding-sdk-bundle/components/public/CollectionBrowser/CollectionBrowser.unit.spec.tsx
@@ -155,16 +155,16 @@ describe("CollectionBrowser", () => {
expect(columnTexts).toContain("Description");
});
- it("should show dashboard questions by default", async () => {
+ it("should hide dashboard questions by default", async () => {
await setup();
- expect(getLastItemsRequestParam("show_dashboard_questions")).toBe("true");
+ expect(getLastItemsRequestParam("show_dashboard_questions")).toBe("false");
});
- it("should hide dashboard questions when showDashboardQuestions is false", async () => {
- await setup({ props: { showDashboardQuestions: false } });
+ it("should show dashboard questions when showDashboardQuestions is true", async () => {
+ await setup({ props: { showDashboardQuestions: true } });
- expect(getLastItemsRequestParam("show_dashboard_questions")).toBe("false");
+ expect(getLastItemsRequestParam("show_dashboard_questions")).toBe("true");
});
it("should resolve collectionId=tenant to user's tenant collection", async () => {
diff --git a/frontend/src/metabase/embedding/embedding-iframe-sdk/types/embed.ts b/frontend/src/metabase/embedding/embedding-iframe-sdk/types/embed.ts
index 83e75084b15..887aa077cb1 100644
--- a/frontend/src/metabase/embedding/embedding-iframe-sdk/types/embed.ts
+++ b/frontend/src/metabase/embedding/embedding-iframe-sdk/types/embed.ts
@@ -188,7 +188,7 @@ export interface BrowserEmbedOptions {
/** Which entities to show on the collection browser */
collectionEntityTypes?: CollectionBrowserEntityTypes[];
- /** Whether to show questions that belong to a dashboard in the collection browser. Defaults to true. */
+ /** Whether to show questions that belong to a dashboard in the collection browser. Defaults to false. */
collectionShowDashboardQuestions?: boolean;
/** Which entities to show on the question's data picker */