From 271b699867e663fe18ee4eebe2f27b19c18c8af0 Mon Sep 17 00:00:00 2001 From: Joel Griffith Date: Mon, 25 Feb 2019 11:53:22 -0800 Subject: [PATCH 1/3] Fixes data points on maps not showing up in reports --- .../reporting/export_types/common/layouts/print.css | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/reporting/export_types/common/layouts/print.css b/x-pack/plugins/reporting/export_types/common/layouts/print.css index 02abc3b361b95..a02a5e7993660 100644 --- a/x-pack/plugins/reporting/export_types/common/layouts/print.css +++ b/x-pack/plugins/reporting/export_types/common/layouts/print.css @@ -8,6 +8,9 @@ /** * global */ + html { + background: white !important; +} /* elements can hide themselves when shared */ .hide-for-sharing { @@ -121,8 +124,11 @@ visualize-app .visEditor__canvas { * to handle this fine, but firefox moves the visualizations around. */ dashboard-app .react-grid-item { - height: 0 !important; /* 1. */ - width: 0 !important; /* 1. */ transform: none !important; /* 2. */ -webkit-transform: none !important; /* 2. */ } + +dashboard-app .react-grid-item .dshPanel { + border: none !important; + box-shadow: none !important; +} From e3f8e96b50724ad040f415bb38db86d1edf7cda4 Mon Sep 17 00:00:00 2001 From: Joel Griffith Date: Mon, 25 Feb 2019 13:56:08 -0800 Subject: [PATCH 2/3] Better method for rendering maps with coordinates --- .../reporting/export_types/common/layouts/print.css | 10 ++-------- .../reporting/export_types/common/lib/screenshots.js | 10 +++++----- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/x-pack/plugins/reporting/export_types/common/layouts/print.css b/x-pack/plugins/reporting/export_types/common/layouts/print.css index a02a5e7993660..02abc3b361b95 100644 --- a/x-pack/plugins/reporting/export_types/common/layouts/print.css +++ b/x-pack/plugins/reporting/export_types/common/layouts/print.css @@ -8,9 +8,6 @@ /** * global */ - html { - background: white !important; -} /* elements can hide themselves when shared */ .hide-for-sharing { @@ -124,11 +121,8 @@ visualize-app .visEditor__canvas { * to handle this fine, but firefox moves the visualizations around. */ dashboard-app .react-grid-item { + height: 0 !important; /* 1. */ + width: 0 !important; /* 1. */ transform: none !important; /* 2. */ -webkit-transform: none !important; /* 2. */ } - -dashboard-app .react-grid-item .dshPanel { - border: none !important; - box-shadow: none !important; -} diff --git a/x-pack/plugins/reporting/export_types/common/lib/screenshots.js b/x-pack/plugins/reporting/export_types/common/lib/screenshots.js index 9cf2b05400d3f..96d1ff4325877 100644 --- a/x-pack/plugins/reporting/export_types/common/lib/screenshots.js +++ b/x-pack/plugins/reporting/export_types/common/lib/screenshots.js @@ -266,11 +266,6 @@ export function screenshotsObservableFactory(server) { browser => openUrl(browser, url, conditionalHeaders), browser => browser ), - tap(() => logger.debug('injecting custom css')), - mergeMap( - browser => injectCustomCss(browser, layout), - browser => browser - ), tap(() => logger.debug('waiting for elements or items count attribute; or not found to interrupt')), mergeMap( browser => Rx.race( @@ -294,6 +289,11 @@ export function screenshotsObservableFactory(server) { ({ browser, itemsCount }) => waitForElementsToBeInDOM(browser, itemsCount, layout), ({ browser, itemsCount }) => ({ browser, itemsCount }) ), + tap(() => logger.debug('injecting custom css')), + mergeMap( + ({ browser }) => injectCustomCss(browser, layout), + ({ browser }) => ({ browser }) + ), tap(() => logger.debug('positioning elements')), mergeMap( ({ browser }) => positionElements(browser, layout), From e29f83be0e38536ed7b44601fd23d93fd770c2a0 Mon Sep 17 00:00:00 2001 From: Joel Griffith Date: Tue, 26 Feb 2019 08:42:00 -0800 Subject: [PATCH 3/3] Quick note on the movement of CSS injection (helps rendering of leaflet maps) --- x-pack/plugins/reporting/export_types/common/lib/screenshots.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/x-pack/plugins/reporting/export_types/common/lib/screenshots.js b/x-pack/plugins/reporting/export_types/common/lib/screenshots.js index 96d1ff4325877..1bf3345c3827b 100644 --- a/x-pack/plugins/reporting/export_types/common/lib/screenshots.js +++ b/x-pack/plugins/reporting/export_types/common/lib/screenshots.js @@ -289,6 +289,8 @@ export function screenshotsObservableFactory(server) { ({ browser, itemsCount }) => waitForElementsToBeInDOM(browser, itemsCount, layout), ({ browser, itemsCount }) => ({ browser, itemsCount }) ), + // Waiting till _after_ elements have rendered before injecting our CSS + // allows for them to be displayed properly in many cases tap(() => logger.debug('injecting custom css')), mergeMap( ({ browser }) => injectCustomCss(browser, layout),