Skip to content
This repository has been archived by the owner on Aug 9, 2022. It is now read-only.

Commit

Permalink
Remove visusalization editor in visualization reports (#366)
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Li <[email protected]>
  • Loading branch information
joshuali925 authored May 14, 2021
1 parent 368eb03 commit 327ee4e
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,10 @@ export const createVisualReport = async (
});

let buffer: Buffer;
// remove top nav bar
// remove unwanted elements
await page.evaluate(
/* istanbul ignore next */
() => {
(reportSource, REPORT_TYPE) => {
// remove buttons
document
.querySelectorAll("[class^='euiButton']")
Expand All @@ -141,8 +141,17 @@ export const createVisualReport = async (
document
.querySelectorAll("[class^='euiHeader']")
.forEach((e) => e.remove());
// remove visualization editor
if (reportSource === REPORT_TYPE.visualization) {
document
.querySelector('[data-test-subj="splitPanelResizer"]')
?.remove();
document.querySelector('.visEditor__collapsibleSidebar')?.remove();
}
document.body.style.paddingTop = '0px';
}
},
reportSource,
REPORT_TYPE
);
// force wait for any resize to load after the above DOM modification
await page.waitFor(1000);
Expand Down

0 comments on commit 327ee4e

Please sign in to comment.