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

Fix full screen toggle button when panel is expanded #13320

Merged
Merged
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
4 changes: 2 additions & 2 deletions src/core_plugins/kibana/public/dashboard/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
class="exitFullScreenMode"
ng-click="exitFullScreenMode()"
>
<span class="exitFullScreenModeLogo"></span>
<span class="exitFullScreenModeText">
<span class="exitFullScreenModeLogo" data-test-subj="exitFullScreenModeLogo"></span>
<span class="exitFullScreenModeText" data-test-subj="exitFullScreenModeText">
Exit full screen
<span class="kuiIcon fa fa-angle-left"></span>
</span>
Expand Down
1 change: 1 addition & 0 deletions src/core_plugins/kibana/public/dashboard/styles/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
padding: 0;
border: none;
background: none;
z-index: 5;
}


Expand Down
1 change: 0 additions & 1 deletion src/ui/public/styles/base.less
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ a {
.app-container {
> * {
position: relative;
z-index: 0;
}

.kibana-nav-options {
Expand Down
49 changes: 49 additions & 0 deletions test/functional/apps/dashboard/_dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,57 @@ export default function ({ getService, getPageObjects }) {
});
});

describe('full screen mode', () => {
it('option not available in edit mode', async () => {
const exists = await PageObjects.dashboard.fullScreenModeMenuItemExists();
expect(exists).to.be(false);
});

it('available in view mode', async () => {
await PageObjects.dashboard.saveDashboard('full screen test');
const exists = await PageObjects.dashboard.fullScreenModeMenuItemExists();
expect(exists).to.be(true);
});

it('hides the chrome', async () => {
let isChromeVisible = await PageObjects.common.isChromeVisible();
expect(isChromeVisible).to.be(true);

await PageObjects.dashboard.clickFullScreenMode();

await retry.try(async () => {
isChromeVisible = await PageObjects.common.isChromeVisible();
expect(isChromeVisible).to.be(false);
});
});

it('displays exit full screen logo button', async () => {
const exists = await PageObjects.dashboard.exitFullScreenLogoButtonExists();
expect(exists).to.be(true);
});

it('displays exit full screen logo button when panel is expanded', async () => {
await PageObjects.dashboard.toggleExpandPanel();

const exists = await PageObjects.dashboard.exitFullScreenTextButtonExists();
expect(exists).to.be(true);
});

it('exits when the text button is clicked on', async () => {
const logoButton = await PageObjects.dashboard.getExitFullScreenLogoButton();
await remote.moveMouseTo(logoButton);
await PageObjects.dashboard.clickExitFullScreenTextButton();

await retry.try(async () => {
const isChromeVisible = await PageObjects.common.isChromeVisible();
expect(isChromeVisible).to.be(true);
});
});
});

describe('add new visualization link', () => {
it('adds a new visualization', async () => {
await PageObjects.dashboard.clickEdit();
await PageObjects.dashboard.clickAddVisualization();
await PageObjects.dashboard.clickAddNewVisualizationLink();
await PageObjects.visualize.clickAreaChart();
Expand Down
33 changes: 33 additions & 0 deletions test/functional/page_objects/dashboard_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,39 @@ export function DashboardPageProvider({ getService, getPageObjects }) {
return logstash;
}

async clickFullScreenMode() {
log.debug(`clickFullScreenMode`);
await testSubjects.click('dashboardFullScreenMode');
}

async fullScreenModeMenuItemExists() {
return await testSubjects.exists('dashboardFullScreenMode');
}

async exitFullScreenTextButtonExists() {
return await testSubjects.exists('exitFullScreenModeText');
}

async getExitFullScreenTextButton() {
return await testSubjects.find('exitFullScreenModeText');
}

async exitFullScreenLogoButtonExists() {
return await testSubjects.exists('exitFullScreenModeLogo');
}

async getExitFullScreenLogoButton() {
return await testSubjects.find('exitFullScreenModeLogo');
}

async clickExitFullScreenLogoButton() {
await testSubjects.click('exitFullScreenModeLogo');
}

async clickExitFullScreenTextButton() {
await testSubjects.click('exitFullScreenModeText');
}

/**
* Returns true if already on the dashboard landing page (that page doesn't have a link to itself).
* @returns {Promise<boolean>}
Expand Down