Skip to content
Snippets Groups Projects
Unverified Commit e322fc8e authored by Nemanja Glumac's avatar Nemanja Glumac Committed by GitHub
Browse files

Fix broken Audit overview page (#38125)

* Revert "Remove internal query check (#37587)"

This reverts commit 16aa9974.

* Add a comment

Explains why the guard against `internal` queries is needed here.
parent 6955751a
No related branches found
No related tags found
No related merge requests found
......@@ -17,6 +17,7 @@ import type {
} from "metabase-types/api";
import * as Lib from "metabase-lib";
import type Question from "metabase-lib/Question";
import InternalQuery from "metabase-lib/queries/InternalQuery";
import { CardMenuRoot } from "./DashCardMenu.styled";
interface OwnProps {
......@@ -151,10 +152,16 @@ DashCardMenu.shouldRender = ({
isPublic,
isEditing,
}: QueryDownloadWidgetOpts) => {
// Do not remove this check until we completely remove the old code related to Audit V1!
// MLv2 doesn't handle `internal` queries used for Audit V1.
const isInternalQuery =
question.legacyQuery({ useStructuredQuery: true }) instanceof InternalQuery;
if (isEmbed) {
return isEmbed;
}
return (
!isInternalQuery &&
!isPublic &&
!isEditing &&
!isXray &&
......
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