Skip to content

Commit

Permalink
When on an embedded page, bypass Getting Started gate check (#12040)
Browse files Browse the repository at this point in the history
* When on an embedded page, bypass Getting Started gate check

* Add unit test for embedded page scenario
  • Loading branch information
ycombinator committed May 26, 2017
1 parent b994f60 commit 05293f1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ describe('Getting Started page', () => {
set($route, 'current.$$route', {});
});

describe('if the user is on an embedded page', () => {
beforeEach(() => {
set($route, 'current.params.embed', true);
});

it('should not show the UI chrome', () => {
expect(uiChrome.getVisible()).to.be(false);
});
});

describe('if index patterns exist', () => {
beforeEach(() => {
config = {
Expand Down
5 changes: 5 additions & 0 deletions src/core_plugins/getting_started/public/lib/add_setup_work.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ function showGettingStartedPage(kbnUrl, isOnGettingStartedPage) {
export function gettingStartedGateCheck(getIds, kbnUrl, config, $route) {
const currentRoute = get($route, 'current.$$route');
const isOnGettingStartedPage = get(currentRoute, 'originalPath') === GETTING_STARTED_ROUTE;
const isOnEmbeddedPage = Boolean(get($route, 'current.params.embed', false));

if (isOnEmbeddedPage) {
return Promise.resolve();
}

return getIds()
.then(indexPatterns => {
Expand Down

0 comments on commit 05293f1

Please sign in to comment.