Skip to content
Snippets Groups Projects
Unverified Commit 0c0ad437 authored by Aleksandr Lesnenko's avatar Aleksandr Lesnenko Committed by GitHub
Browse files

fix audit cards have actions menu (#31843)

parent db5ecb9c
No related branches found
No related tags found
No related merge requests found
import { restore, describeEE, visitQuestion } from "e2e/support/helpers";
import {
restore,
describeEE,
visitQuestion,
getDashboardCard,
} from "e2e/support/helpers";
import { USERS } from "e2e/support/cypress_data";
import { SAMPLE_DATABASE } from "e2e/support/cypress_sample_database";
......@@ -211,6 +216,11 @@ describeEE("audit > auditing", () => {
it("should load both tabs in Questions", () => {
// Overview tab
cy.visit("/admin/audit/questions/overview");
// There should not be any menu buttons on dashcards
getDashboardCard().realHover();
cy.findByTestId("dashcard-menu").should("not.exist");
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
cy.findByText("Slowest queries");
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
......
......@@ -32,6 +32,7 @@ import Question from "metabase-lib/Question";
import type Mode from "metabase-lib/Mode";
import type Metadata from "metabase-lib/metadata/Metadata";
import InternalQuery from "metabase-lib/queries/InternalQuery";
import { CardSlownessStatus, DashCardOnChangeCardAndRunHandler } from "./types";
import ClickBehaviorSidebarOverlay from "./ClickBehaviorSidebarOverlay";
import DashCardMenu from "./DashCardMenu";
......@@ -180,13 +181,14 @@ function DashCardVisualization({
const question = new Question(dashcard.card, metadata);
const mainSeries = series[0] as unknown as Dataset;
const isInternalQuery = question.query() instanceof InternalQuery;
const shouldShowDownloadWidget =
isEmbed ||
(!isPublic &&
!isEditing &&
DashCardMenu.shouldRender({ question, result: mainSeries }));
if (!shouldShowDownloadWidget) {
if (isInternalQuery || !shouldShowDownloadWidget) {
return null;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment