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

Remove visualization editor in visualization reports #50

Merged
merged 1 commit into from
May 14, 2021
Merged
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
Expand Up @@ -140,10 +140,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 @@ -152,8 +152,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