Skip to content

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

Fix opening an info sidebar when native _variables_ sidebar was already opened (#67165)

Nemanja Glumac62a8a7b32e00
diff --git a/e2e/test/scenarios/native/native-reproductions.cy.spec.ts b/e2e/test/scenarios/native/native-reproductions.cy.spec.ts
index dea8d41826c..41eb8269e30 100644
--- a/e2e/test/scenarios/native/native-reproductions.cy.spec.ts
+++ b/e2e/test/scenarios/native/native-reproductions.cy.spec.ts
@@ -933,3 +933,44 @@ describe("issue 66745", () => {
});
});
});
+
+describe("issue 51717", () => {
+ beforeEach(() => {
+ H.restore();
+ cy.signInAsNormalUser();
+ });
+
+ it("should open question info sidebar when variables sidebar is already open (metabase#51717)", () => {
+ H.createNativeQuestion(
+ {
+ name: "42",
+ native: { query: "select 42" },
+ },
+ { visitQuestion: true },
+ );
+
+ cy.findByTestId("visibility-toggler")
+ .findByText(/open editor/i)
+ .click();
+
+ cy.log("Open variables sidebar");
+ cy.findByTestId("native-query-editor-action-buttons")
+ .should("be.visible")
+ .findByLabelText("Variables")
+ .click();
+ cy.findByTestId("sidebar-right")
+ .should("be.visible")
+ .and("contain", "Variables and parameters");
+
+ cy.log("Info sidebar is opened");
+ H.openQuestionInfoSidesheet();
+ cy.findByTestId("sidesheet")
+ .as("infoSidebar")
+ .should("be.visible")
+ .and("contain", "Info");
+
+ cy.log("Make sure info sidebar is interactive (on top of the stack)");
+ cy.get("@infoSidebar").findByRole("tab", { name: "History" }).click();
+ cy.get("@infoSidebar").should("contain", "You created this");
+ });
+});
diff --git a/frontend/src/metabase/query_builder/components/view/NativeVariablesButton/NativeVariablesButton.tsx b/frontend/src/metabase/query_builder/components/view/NativeVariablesButton/NativeVariablesButton.tsx
index dc9a9e3c8e1..079050b51b1 100644
--- a/frontend/src/metabase/query_builder/components/view/NativeVariablesButton/NativeVariablesButton.tsx
+++ b/frontend/src/metabase/query_builder/components/view/NativeVariablesButton/NativeVariablesButton.tsx
@@ -23,6 +23,7 @@ export const NativeVariablesButton = ({
<Tooltip label={t`Variables`}>
<Box
component="a"
+ aria-label={t`Variables`}
h={size}
className={cx(className, NativeVariablesButtonS.ButtonRoot, {
[NativeVariablesButtonS.isSelected]: isShowingTemplateTagsEditor,
diff --git a/frontend/src/metabase/query_builder/reducers.js b/frontend/src/metabase/query_builder/reducers.js
index 24c637ec328..2d9cc43fc49 100644
--- a/frontend/src/metabase/query_builder/reducers.js
+++ b/frontend/src/metabase/query_builder/reducers.js
@@ -270,6 +270,7 @@ export const uiControls = handleActions(
[onOpenQuestionInfo]: (state) =>
setUIControls(state, {
...UI_CONTROLS_SIDEBAR_DEFAULTS,
+ ...CLOSED_NATIVE_EDITOR_SIDEBARS,
isShowingQuestionInfoSidebar: true,
queryBuilderMode: "view",
}),