From 4b90bcbc70774cb1a6284169180a94c15d07a063 Mon Sep 17 00:00:00 2001 From: Peter Pisljar Date: Tue, 30 Jan 2018 10:12:41 +0100 Subject: [PATCH] visualize editor should not show if embed is set to true in url (#16310) (#16362) --- .../kibana/public/visualize/editor/editor.html | 2 +- test/functional/apps/visualize/_area_chart.js | 10 ++++++++++ test/functional/page_objects/visualize_page.js | 4 ++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/core_plugins/kibana/public/visualize/editor/editor.html b/src/core_plugins/kibana/public/visualize/editor/editor.html index 78bbdc38a2f63..dbb5435c86418 100644 --- a/src/core_plugins/kibana/public/visualize/editor/editor.html +++ b/src/core_plugins/kibana/public/visualize/editor/editor.html @@ -64,7 +64,7 @@ saved-obj="savedVis" ui-state="uiState" app-state="state" - editor-mode="true" + editor-mode="chrome.getVisible()" show-spy-panel="chrome.getVisible()" > diff --git a/test/functional/apps/visualize/_area_chart.js b/test/functional/apps/visualize/_area_chart.js index ec648ad37fb87..ffeb648af02d5 100644 --- a/test/functional/apps/visualize/_area_chart.js +++ b/test/functional/apps/visualize/_area_chart.js @@ -2,6 +2,7 @@ import expect from 'expect.js'; export default function ({ getService, getPageObjects }) { const log = getService('log'); + const remote = getService('remote'); const retry = getService('retry'); const PageObjects = getPageObjects(['common', 'visualize', 'header', 'settings']); @@ -181,6 +182,15 @@ export default function ({ getService, getPageObjects }) { expect(data.trim().split('\n')).to.eql(expectedTableData); }); }); + + it('should hide side editor if embed is set to true in url', async () => { + const url = await remote.getCurrentUrl(); + const embedUrl = url.split('/visualize/').pop().replace('?_g=', '?embed=true&_g='); + await PageObjects.common.navigateToUrl('visualize', embedUrl); + await PageObjects.header.waitUntilLoadingHasFinished(); + const sideEditorExists = await PageObjects.visualize.getSideEditorExists(); + expect(sideEditorExists).to.be(false); + }); }); }); } diff --git a/test/functional/page_objects/visualize_page.js b/test/functional/page_objects/visualize_page.js index 0beb78a55e70e..0b1ceff030b80 100644 --- a/test/functional/page_objects/visualize_page.js +++ b/test/functional/page_objects/visualize_page.js @@ -261,6 +261,10 @@ export function VisualizePageProvider({ getService, getPageObjects }) { return await testSubjects.exists('spyToggleButton'); } + async getSideEditorExists() { + return await find.existsByCssSelector('.collapsible-sidebar'); + } + async openSpyPanel() { log.debug('openSpyPanel'); const isOpen = await testSubjects.exists('spyContentContainer');