Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Screenshotting] PoC print media #128470

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,9 +1,75 @@
.printViewport {
&__vis {
height: 600px; // These values might need to be passed in as dimensions for the report. I.e., print should use layout dimensions.
width: 975px;
@import './shared_poc_print'; // Bring in the shared print styling

// Some vertical space between vis, but center horizontally
margin: 10px auto;
/*
Dashboard styling

It is up to dashboard to decide how the visualizations should look on an A4 page. The assumption
is that we want to preserve current behaviour of 2 visualizations per page.
*/
$visualisationsPerPage: 2;
$visPadding: 4mm;

/*
We set the same visual padding on the browser and print versions of the UI so that
we don't hit a race condition where padding is being updated while the print image
is being formed. This can result in parts of the vis being cut out.
*/
@mixin visualizationPadding {
padding-left: $visPadding;
padding-right: $visPadding;

&:nth-child(#{$visualisationsPerPage}n - #{$visualisationsPerPage - 1}) {
padding-top: $visPadding;
}

&:nth-child(#{$visualisationsPerPage}n) {
page-break-after: always;
padding-top: $visPadding;
padding-bottom: $visPadding;
}
}

@include globalSharedRules();

@media screen, projection {
.printViewport {
&__vis {
@include visualizationPadding();

& .embPanel__header button {
display: none;
}

margin: $euiSizeL auto;
height: calc(#{$a4PageContentHeight} / #{$visualisationsPerPage});
width: $a4PageContentWidth;
padding: $visPadding;
}
}
}

@media print {

.printViewport {
&__vis {
@include visualizationPadding();

height: calc(#{$a4PageContentHeight} / #{$visualisationsPerPage});
width: $a4PageContentWidth;

& .euiPanel {
box-shadow: none !important;
}

& .embPanel__header button {
display: none;
}

page-break-inside: avoid;

& * {
overflow: hidden !important;
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@

/*
Global print styling

This styling should be usable by an plugin/app that wants to provide print
functionality. The styling should be extremely unopinionated.

Observations:

1. It is possible to request a print before all ES searches have populated
visualizations, this results in a borked print preview with half-rendered
visualisations. The user will have to close the print dialog and re-open
it. Not sure how to "fix" this UX.

2. We currently do not control the user-agent's header and footer content
(including the style of fonts)

3. I could not see a way to get page numbering other than using the
browser-provided footers :'(

4. Page box model is quite different from what we have in browsers - page
margins define where the "no-mans-land" exists for actual content. Moving
content into this space by, for example setting negative margins resulted
in slightly unpredictable behaviour because the browser wants to either
move this content to another page or it just looks broken/split across two
pages

5. page-break-* is your friend!
*/
$a4PageHeight: 297mm;
$a4PageWidth: 210mm;
$a4PageMargin: 0;
$a4PagePadding: 0;
$a4PageHeaderHeight: 5mm;
$a4PageFooterHeight: 10mm;
$a4PageMarginBottom: 9mm;

$a4PageContentHeight: $a4PageHeight - $a4PageFooterHeight - $a4PageHeaderHeight - $a4PageMarginBottom;
$a4PageContentWidth: $a4PageWidth;

// Currently we cannot control or style the content the browser places in
// margins, this might change in the future:
// See https://drafts.csswg.org/css-page-3/#margin-boxes
@page {
size: A4;
orientation: portrait;
padding: 0;
margin: 0;
margin-bottom: $a4PageMarginBottom;
}

@media screen, projection {
.printFooter, .printHeader {
display: none;
}
}

@media print {

html {
background-color: #FFF;
}

// When printing it is good practice to show the full url
a[href]:after {
content: ' [' attr(href) ']';
}

figure {
break-inside: avoid;
}

* {
-webkit-print-color-adjust: exact !important; /* Chrome, Safari, Edge */
color-adjust: exact !important; /*Firefox*/
}

.printHeader {
display: table-header-group;
position: fixed;
top: 0;
left: 50%;
padding-top: 2mm;
transform: translateX(-50%);
}

.printFooter {
display: table-footer-group;
position: fixed;
bottom: 0;
margin: 0 2mm 2mm 5mm;
> img {
height: 8mm;
}
}

// There is a known limitation that Chrome does not increment the counter of fixed elements even though
// they appear for each page. So we leave this out for now.
// See https://bugs.chromium.org/p/chromium/issues/detail?id=774830
// .printFooter::after {
// position: fixed;
// bottom: 2mm;
// left: 50%;
// transform: translateX(-50%);
// content: 'Page ' counter(x);
// }
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import {
} from '../../../../../controls/public';
import { withSuspense } from '../../../services/presentation_util';

import { SharedPocPrintUi } from './shared_poc_print_ui';

export interface DashboardViewportProps {
container: DashboardContainer;
controlGroup?: ControlGroupContainer;
Expand Down Expand Up @@ -147,6 +149,7 @@ export class DashboardViewport extends React.Component<DashboardViewportProps, S
)}
{this.state.controlGroupReady && <DashboardGrid container={container} />}
</div>
<SharedPocPrintUi title={this.state.title} />
</>
);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

import type { FunctionComponent } from 'react';
import React from 'react';

import { imgData } from './shared_poc_print_ui_logo';

interface Props {
title: string;
logo?: string;
}

export const SharedPocPrintUi: FunctionComponent<Props> = ({ title, logo = imgData }) => {
return (
<>
{/* NOTE: This UI is purely for test purposes, but it is easy to see how we could move this to some external place that shares this functionality. */}
<header className="printHeader">{title}</header>
<footer className="printFooter">
<img
alt="a cool logo for branding"
// We could make this image src dynamic to support injecting branding per Kibana deployment
src={logo}
/>
{/*
Currently pageNumber is not being used, but the idea was to try and use JS to count the pages and populate
the repeated element, could not get this working
*/}
<div className="pageNumber" />
</footer>
</>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

export const imgData = `data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAkEAAADGCAMAAADi8KTWAAAA9lBMVEUAAAB9f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cTlbZAxCQF26yY2357QesY+DwKOP3Qj81Ks07py/Lgq5BM3d4+Bnfnf9HrwRGxscGeuAIBSBlLY5XSF45tffOTV1bMjIJsNXvEWmKSHf0bs2tgoNPQ8oyDxAXS4tvVj8xl3rwwMOOQD1b69ftl8RbpdKQKF/fKZ9LJ2w7KNKvXEuupiGDd/nC8bvF3m7UINGw38Z+3m6iQowVZHwBjEiz/H81iI2NjwIdQLoudXqihJ8VG32ci20naX4Lfgb/ksLxbuLLt3AAAAAElFTkSuQmCC`;
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,7 @@ export const useDashboardAppState = ({
savedDashboard,
});

// Backwards compatible way of detecting that we are taking a screenshot
const legacyPrintLayoutDetected =
const printLayoutDetected =
screenshotModeService?.isScreenshotMode() &&
screenshotModeService.getScreenshotContext('layout') === 'print';

Expand All @@ -194,8 +193,7 @@ export const useDashboardAppState = ({
...initialDashboardStateFromUrl,
...forwardedAppState,

// if we are in legacy print mode, dashboard needs to be in print viewMode
...(legacyPrintLayoutDetected ? { viewMode: ViewMode.PRINT } : {}),
...(printLayoutDetected ? { viewMode: ViewMode.PRINT } : {}),

// if there is an incoming embeddable, dashboard always needs to be in edit mode to receive it.
...(incomingEmbeddable ? { viewMode: ViewMode.EDIT } : {}),
Expand Down
3 changes: 2 additions & 1 deletion x-pack/plugins/maps/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"savedObjects",
"share",
"presentationUtil",
"sharedUX"
"sharedUX",
"screenshotMode"
],
"optionalPlugins": [
"cloud",
Expand Down
Loading