Skip to content

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

Rename "New exploration" to "New question" in <metabase-browser> (#72145)

Sébastien8b4f96092a26
diff --git a/e2e/test/scenarios/embedding/sdk-iframe-embedding/metabase-browser.cy.spec.ts b/e2e/test/scenarios/embedding/sdk-iframe-embedding/metabase-browser.cy.spec.ts
index f2f8029e520..ef5af9c4c87 100644
--- a/e2e/test/scenarios/embedding/sdk-iframe-embedding/metabase-browser.cy.spec.ts
+++ b/e2e/test/scenarios/embedding/sdk-iframe-embedding/metabase-browser.cy.spec.ts
@@ -47,12 +47,12 @@ describe("scenarios > embedding > sdk iframe embedding > metabase-browser", () =
cy.findByText("You don't have access to this collection").should(
"be.visible",
);
- cy.findByText("New exploration").should("not.exist");
+ cy.findByText("New question").should("not.exist");
});
});
});
- it("should not show New exploration button when user has no curate permissions on initial-collection", () => {
+ it("should not show New question button when user has no curate permissions on initial-collection", () => {
H.prepareSdkIframeEmbedTest({
withToken: "bleeding-edge",
signOut: false,
@@ -87,8 +87,8 @@ describe("scenarios > embedding > sdk iframe embedding > metabase-browser", () =
// User can see the collection contents (they have read access)
cy.findByText("Test Question").should("be.visible");
- // But New exploration button should be hidden since they can't save
- cy.findByText("New exploration").should("not.exist");
+ // But New question button should be hidden since they can't save
+ cy.findByText("New question").should("not.exist");
});
});
});
@@ -147,7 +147,7 @@ describe("scenarios > embedding > sdk iframe embedding > metabase-browser", () =
});
});
- it("should reset `Exploration` editor state when clicking 'new exploration' breadcrumb after selecting a filter", () => {
+ it("should reset `New question` editor state when clicking 'New question' breadcrumb after selecting a filter", () => {
H.prepareSdkIframeEmbedTest({
withToken: "bleeding-edge",
signOut: false,
@@ -161,7 +161,7 @@ describe("scenarios > embedding > sdk iframe embedding > metabase-browser", () =
`);
H.getSimpleEmbedIframeContent().within(() => {
- cy.findByText("New exploration").click();
+ cy.findByText("New question").click();
cy.findByText("Pick your starting data").should("be.visible");
@@ -175,7 +175,7 @@ describe("scenarios > embedding > sdk iframe embedding > metabase-browser", () =
cy.wait("@datasetMetadata");
cy.findByTestId("data-step-cell").should("have.text", "Orders");
- cy.findByTestId("sdk-breadcrumbs").findByText("New exploration").click();
+ cy.findByTestId("sdk-breadcrumbs").findByText("New question").click();
cy.findByText("Pick your starting data").should("be.visible");
cy.findByText("Orders").should("not.exist");
diff --git a/e2e/test/scenarios/embedding/sdk-iframe-embedding/view-and-curate-content.cy.spec.ts b/e2e/test/scenarios/embedding/sdk-iframe-embedding/view-and-curate-content.cy.spec.ts
index 798bff56050..8ba4c73389e 100644
--- a/e2e/test/scenarios/embedding/sdk-iframe-embedding/view-and-curate-content.cy.spec.ts
+++ b/e2e/test/scenarios/embedding/sdk-iframe-embedding/view-and-curate-content.cy.spec.ts
@@ -43,11 +43,11 @@ describe("scenarios > embedding > sdk iframe embedding > view and curate content
.should("be.visible");
});
- it("should show New Exploration button and open data picker when clicked", () => {
+ it("should show New Question button and open data picker when clicked", () => {
setupEmbed('<metabase-browser initial-collection="root" />');
H.getSimpleEmbedIframeContent()
- .findByText("New exploration")
+ .findByText("New question")
.should("be.visible")
.click();
@@ -84,7 +84,7 @@ describe("scenarios > embedding > sdk iframe embedding > view and curate content
.should("have.length", 5);
});
- it("should hide New Exploration button when with-new-question is false", () => {
+ it("should hide New Question button when with-new-question is false", () => {
setupEmbed(`
<metabase-browser
initial-collection="root"
@@ -93,7 +93,7 @@ describe("scenarios > embedding > sdk iframe embedding > view and curate content
`);
H.getSimpleEmbedIframeContent()
- .findByText("New exploration")
+ .findByText("New question")
.should("not.exist");
});
});
@@ -158,13 +158,13 @@ describe("scenarios > embedding > sdk iframe embedding > view and curate content
.should("be.visible");
});
- it("should show New Exploration button and open data picker when clicked", () => {
+ it("should show New Question button and open data picker when clicked", () => {
setupEmbed(
'<metabase-browser initial-collection="root" read-only="false" />',
);
H.getSimpleEmbedIframeContent()
- .findByText("New exploration")
+ .findByText("New question")
.should("be.visible")
.click();
@@ -179,7 +179,7 @@ describe("scenarios > embedding > sdk iframe embedding > view and curate content
'<metabase-browser initial-collection="root" read-only="false" />',
);
- H.getSimpleEmbedIframeContent().findByText("New exploration").click();
+ H.getSimpleEmbedIframeContent().findByText("New question").click();
cy.log("select data model");
H.getSimpleEmbedIframeContent().findByText("Orders").click();
@@ -280,7 +280,7 @@ describe("scenarios > embedding > sdk iframe embedding > view and curate content
.should("be.visible");
});
- it("should hide New Exploration button when with-new-question is false", () => {
+ it("should hide New Question button when with-new-question is false", () => {
setupEmbed(`
<metabase-browser
initial-collection="root"
@@ -290,7 +290,7 @@ describe("scenarios > embedding > sdk iframe embedding > view and curate content
`);
H.getSimpleEmbedIframeContent()
- .findByText("New exploration")
+ .findByText("New question")
.should("not.exist");
});
@@ -303,7 +303,7 @@ describe("scenarios > embedding > sdk iframe embedding > view and curate content
/>
`);
- H.getSimpleEmbedIframeContent().findByText("New exploration").click();
+ H.getSimpleEmbedIframeContent().findByText("New question").click();
cy.log("should show data picker with limited entity types");
H.getSimpleEmbedIframeContent()
diff --git a/frontend/src/embedding-sdk-bundle/components/private/SdkQuestionDefaultView/SdkQuestionDefaultView.tsx b/frontend/src/embedding-sdk-bundle/components/private/SdkQuestionDefaultView/SdkQuestionDefaultView.tsx
index 2314b085994..f89b9e2b52a 100644
--- a/frontend/src/embedding-sdk-bundle/components/private/SdkQuestionDefaultView/SdkQuestionDefaultView.tsx
+++ b/frontend/src/embedding-sdk-bundle/components/private/SdkQuestionDefaultView/SdkQuestionDefaultView.tsx
@@ -133,7 +133,7 @@ export const SdkQuestionDefaultView = ({
reportLocation({
type: "question",
id: originalId,
- name: "New exploration",
+ name: "New question",
onNavigate,
});
} else if (isExistingQuestion) {
diff --git a/frontend/src/metabase/embedding/embedding-iframe-sdk/components/MetabaseBrowser.tsx b/frontend/src/metabase/embedding/embedding-iframe-sdk/components/MetabaseBrowser.tsx
index efc16929451..e1066c1a167 100644
--- a/frontend/src/metabase/embedding/embedding-iframe-sdk/components/MetabaseBrowser.tsx
+++ b/frontend/src/metabase/embedding/embedding-iframe-sdk/components/MetabaseBrowser.tsx
@@ -31,7 +31,7 @@ type MetabaseBrowserView =
| { type: "collection"; id: SdkCollectionId }
| { type: "dashboard"; id: number | string }
| { type: "question" | "metric" | "model"; id: number | string }
- | { type: "exploration" }
+ | { type: "new-question" }
| { type: "create-dashboard" };
const BREADCRUMB_HEIGHT = "3.5rem";
@@ -81,7 +81,7 @@ export function MetabaseBrowser({ settings }: MetabaseBrowserProps) {
const viewContent = hasNavigatedAway
? null
: match(currentView)
- .with({ type: "exploration" }, () => (
+ .with({ type: "new-question" }, () => (
<Box px="xl" h="100%">
<InteractiveQuestion
questionId="new"
@@ -198,12 +198,12 @@ export function MetabaseBrowser({ settings }: MetabaseBrowserProps) {
))
.otherwise(() => null);
- const handleNewExploration = () => {
- setCurrentView({ type: "exploration" });
+ const handleNewQuestion = () => {
+ setCurrentView({ type: "new-question" });
};
- // Only show "New exploration" button if user has write access and it's enabled
- const showNewExplorationButton =
+ // Only show "New question" button if user has write access and it's enabled
+ const showNewQuestionButton =
(settings.withNewQuestion ?? true) && canWriteToInitialCollection;
// Only show "New dashboard" button if not read-only and user has write access
@@ -244,9 +244,9 @@ export function MetabaseBrowser({ settings }: MetabaseBrowserProps) {
{currentView.type === "collection" && (
<Group gap="sm">
- {showNewExplorationButton && (
- <Button justify="center" onClick={handleNewExploration}>
- {t`New exploration`}
+ {showNewQuestionButton && (
+ <Button justify="center" onClick={handleNewQuestion}>
+ {t`New question`}
</Button>
)}
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 d6dda6b356a..6953a35afda 100644
--- a/frontend/src/metabase/embedding/embedding-iframe-sdk/types/embed.ts
+++ b/frontend/src/metabase/embedding/embedding-iframe-sdk/types/embed.ts
@@ -174,7 +174,7 @@ export interface BrowserEmbedOptions {
/** Which entities to show on the question's data picker */
dataPickerEntityTypes?: EmbeddingEntityType[];
- /** Whether to show the "New exploration" button. Defaults to true. */
+ /** Whether to show the "New question" button. Defaults to true. */
withNewQuestion?: boolean;
/** Whether to show the "New dashboard" button. Defaults to true. Only applies when readOnly is false. */
diff --git a/frontend/src/metabase/embedding/embedding-iframe-sdk/types/modular-embedding.ts b/frontend/src/metabase/embedding/embedding-iframe-sdk/types/modular-embedding.ts
index eaebfbd4456..3d746dff1f8 100644
--- a/frontend/src/metabase/embedding/embedding-iframe-sdk/types/modular-embedding.ts
+++ b/frontend/src/metabase/embedding/embedding-iframe-sdk/types/modular-embedding.ts
@@ -262,7 +262,7 @@ export interface MetabaseBrowserAttributes {
"data-picker-entity-types"?: ("model" | "table")[];
/**
- * Whether to show the "New exploration" button.
+ * Whether to show the "New question" button.
*
* @defaultValue true
*/