Skip to content
Snippets Groups Projects
Unverified Commit 8272ac47 authored by Anton Kulyk's avatar Anton Kulyk Committed by GitHub
Browse files

Fix public dashboards are cut when printing (#46829)

* Fix public dashboards are cut when printing

* Add comment
parent 0f306ca5
No related branches found
No related tags found
No related merge requests found
......@@ -13,6 +13,7 @@ import {
export const Root = styled.div<{
hasScroll: boolean;
hasVisibleOverflowWhenPriting?: boolean;
isBordered?: boolean;
}>`
display: flex;
......@@ -36,6 +37,16 @@ export const Root = styled.div<{
border-radius: 8px;
box-shadow: 0 2px 2px var(--mb-color-shadow);
`}
${props =>
// Prevents https://github.com/metabase/metabase/issues/40660
// when printing an embedded dashboard
props.hasVisibleOverflowWhenPriting &&
css`
@media print {
overflow: visible;
}
`}
`;
export const ContentContainer = styled.div`
......
......@@ -12,6 +12,7 @@ import {
} from "metabase/dashboard/components/Dashboard/Dashboard.styled";
import { ExportAsPdfButton } from "metabase/dashboard/components/DashboardHeader/buttons/ExportAsPdfButton";
import { DASHBOARD_PDF_EXPORT_ROOT_ID } from "metabase/dashboard/constants";
import { getDashboardType } from "metabase/dashboard/utils";
import { initializeIframeResizer, isSmallScreen } from "metabase/lib/dom";
import { useSelector } from "metabase/lib/redux";
import { FilterApplyButton } from "metabase/parameters/components/FilterApplyButton";
......@@ -105,6 +106,10 @@ export const EmbedFrame = ({
state => !getSetting(state, "hide-embed-branding?"),
);
const isPublicDashboard = Boolean(
dashboard && getDashboardType(dashboard.id) === "public",
);
const ParametersListComponent = getParametersListComponent({
isEmbeddingSdk,
isDashboard: !!dashboard,
......@@ -140,6 +145,7 @@ export const EmbedFrame = ({
<Root
hasScroll={hasFrameScroll}
isBordered={bordered}
hasVisibleOverflowWhenPriting={isPublicDashboard}
className={cx(EmbedFrameS.EmbedFrame, className, {
[EmbedFrameS.NoBackground]: !background,
})}
......
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