Revert the Getting Started page (#12154)

* Revert "When on an embedded page, bypass Getting Started gate check (#12040)"

This reverts commit 05293f1c8d.

* Revert "Making tweaks. (#12003)"

This reverts commit aa3fa06f61.

* Revert "Functional tests for the Getting Started page (#11850)"

This reverts commit 099178a7ca.

* Revert "Prevent flicker on Getting Started page (#11826)"

This reverts commit c4b3ade27d.

* Revert "Getting Started page (#11805)"

This reverts commit 32eff371f2.

* Remove check for Getting Started page from navigateToApp
This commit is contained in:
Shaunak Kashyap 2017-06-05 14:18:30 -07:00 committed by GitHub
parent bd40b9d9e8
commit 27745f72a3
37 changed files with 67 additions and 951 deletions

View file

@ -1,8 +0,0 @@
export default function (kibana) {
return new kibana.Plugin({
uiExports: {
managementSections: ['plugins/getting_started']
}
});
}

View file

@ -1,4 +0,0 @@
{
"name": "getting_started",
"version": "kibana"
}

View file

@ -1,176 +0,0 @@
<div
class="kuiViewContent gettingStartedContent"
data-test-subj="gettingStartedContainer"
>
<div class="kuiViewContentItem kuiVerticalRhythm gettingStartedWelcome">
<h1 class="kuiTitle gettingStartedTitle">
Welcome to Kibana
</h1>
</div>
<div class="kuiViewContentItem kuiVerticalRhythm gettingStartedLogo">
<img
ng-src="{{ gettingStarted.imageUrls.kibanaLogo }}"
alt="Kibana logo"
/>
</div>
<div class="kuiViewContentItem kuiVerticalRhythm">
<injected-items items="gettingStarted.topMessages"></injected-items>
</div>
<div class="kuiViewContentItem kuiVerticalRhythm">
<div class="kuiCardGroup kuiCardGroup">
<div class="kuiCard kuiCardGroup__card gettingStartedCard">
<div class="kuiCard__description">
<div class="kuiCard__descriptionTitle">
<h2 class="kuiSubTitle">
First, add your data
</h2>
</div>
<div class="kuiCard__descriptionText gettingStartedCard__descriptionText">
<div class="gettingStartedLogoRow">
<img
class="gettingStartedLogoRow__logo"
ng-src="{{ gettingStarted.imageUrls.beatsLogo }}"
alt="Beats logo"
/>
<img
class="gettingStartedLogoRow__logo"
ng-src="{{ gettingStarted.imageUrls.logstashLogo }}"
alt="Logstash logo"
/>
</div>
</div>
</div>
<div class="kuiCard__footer">
<p class="kuiText">
Pull in data from the
<a
ng-href="{{ gettingStarted.documentationLinks.elasticsearch.docs }}"
class="kuiLink"
target="_blank"
>Elasticsearch API</a>,
<a
ng-href="{{ gettingStarted.documentationLinks.beats.docs }}"
class="kuiLink"
target="_blank"
>Beats</a>, or
<a
ng-href="{{ gettingStarted.documentationLinks.logstash.docs }}"
class="kuiLink"
target="_blank"
>Logstash</a>.
Not sure how to do that?
<a
ng-href="{{ gettingStarted.documentationLinks.gettingStarted }}"
class="kuiLink"
target="_blank"
>Read this introduction.</a>
</p>
</div>
</div>
<div class="kuiCard kuiCardGroup__card gettingStartedCard">
<div class="kuiCard__description">
<div class="kuiCard__descriptionTitle">
<h2 class="kuiSubTitle">
Visualize and explore
</h2>
</div>
<div class="kuiCard__descriptionText gettingStartedCard__descriptionText">
<div class="gettingStartedLogoRow">
<img
class="gettingStartedLogoRow__logo"
ng-src="{{ gettingStarted.imageUrls.dashboardIcon }}"
alt="Dashboard icon"
/>
</div>
</div>
</div>
<div class="kuiCard__footer">
<p class="kuiText">Once you've added data, you'll need to
<a
href="#/management/kibana/index"
class="kuiLink"
kbn-getting-started-opt-out
>configure an index pattern</a>
for your data before using our Discover and Visualize applications.</p>
</div>
</div>
<div
class="kuiCard kuiCardGroup__card gettingStartedCard"
ng-show="gettingStarted.hasManageAndMonitorMessages()"
>
<div class="kuiCard__description">
<div class="kuiCard__descriptionTitle">
<h2 class="kuiSubTitle">
Manage and monitor
</h2>
</div>
<div class="kuiCard__descriptionText gettingStartedCard__descriptionText">
<div class="gettingStartedLogoRow">
<img
class="gettingStartedLogoRow__logo"
ng-src="{{ gettingStarted.imageUrls.shieldIcon }}"
alt="Shield icon"
/>
</div>
</div>
</div>
<div class="kuiCard__footer">
<injected-items items="gettingStarted.manageAndMonitorMessages"></injected-items>
</div>
</div>
</div>
</div>
<div
ng-if="!gettingStarted.hasOptedOut()"
class="kuiViewContentItem kuiVerticalRhythm"
>
<div class="kuiFieldGroup">
<div class="kuiFieldGroupSection">
<a
class="kuiButton kuiButton--primary"
kbn-href="#/management"
kbn-getting-started-opt-out
data-test-subj="lnkGettingStartedOptOut"
>
<span class="kuiButton__inner">
<span>Got it, take me to Kibana</span>
</span>
</a>
</div>
</div>
</div>
<div class="kuiViewContentItem kuiVerticalRhythm">
<p class="kuiText">
Just want to see what Kibana is capable of doing?
<a
ng-href="{{ gettingStarted.documentationLinks.demoSite }}"
class="kuiLink"
target="_blank"
>View the demo site</a>.
</p>
</div>
<div class="kuiViewContentItem kuiVerticalRhythm">
<p class="kuiText">
<a
ng-href="{{ gettingStarted.documentationLinks.kibana.docs }}"
class="kuiLink"
target="_blank"
>Kibana documentation</a>
is always available to help.
</p>
</div>
</div>

View file

@ -1,58 +0,0 @@
import { uiModules } from 'ui/modules';
import 'ui/getting_started/opt_out_directive';
import { GettingStartedRegistryProvider } from 'ui/getting_started/registry';
import { GETTING_STARTED_REGISTRY_TYPES } from 'ui/getting_started/constants';
import { hasOptedOutOfGettingStarted } from 'ui/getting_started/opt_out_helpers';
import { documentationLinks } from 'ui/documentation_links';
import kibanaLogo from 'ui/images/logo-kibana-small.svg';
import beatsLogo from 'ui/images/logo-beats-small.svg';
import logstashLogo from 'ui/images/logo-logstash-small.svg';
import dashboardIcon from 'ui/images/icon-dashboard.svg';
import shieldIcon from 'ui/images/icon-shield.svg';
import template from './getting_started.html';
import './getting_started.less';
import '../injected_items';
const app = uiModules.get('kibana');
app.directive('gettingStarted', function ($injector) {
const Private = $injector.get('Private');
const registry = Private(GettingStartedRegistryProvider);
return {
restrict: 'E',
template: template,
scope: {
},
bindToController: true,
controllerAs: 'gettingStarted',
controller: class GettingStartedController {
constructor() {
const registeredTopMessages = registry.byType[GETTING_STARTED_REGISTRY_TYPES.TOP_MESSAGE] || [];
this.topMessages = registeredTopMessages.map(item => item.template);
const registeredManageAndMonitorMessages = registry.byType[GETTING_STARTED_REGISTRY_TYPES.MANAGE_AND_MONITOR_MESSAGE] || [];
this.manageAndMonitorMessages = registeredManageAndMonitorMessages.map(item => item.template);
this.imageUrls = {
kibanaLogo,
beatsLogo,
logstashLogo,
dashboardIcon,
shieldIcon
};
this.documentationLinks = documentationLinks;
}
hasManageAndMonitorMessages = () => {
return this.manageAndMonitorMessages.length > 0;
}
hasOptedOut = hasOptedOutOfGettingStarted;
}
};
});

View file

@ -1,59 +0,0 @@
.gettingStartedContent {
display: flex;
flex-direction: column;
align-items: center;
padding-top: 0;
}
.gettingStartedWelcome {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 200px;
width: 100%;
background-color: #f7f7f7;
}
.gettingStartedTitle {
transform: translateY(10px);
}
.gettingStartedLogo {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
border: 1px solid #D7DBDD;
width: 100px;
height: 100px;
border-radius: 100%;
background-color: #ffffff;
transform: translateY(-60px);
}
.gettingStartedLogoRow {
display: flex;
flex-direction: row;
justify-content: center;
}
.gettingStartedLogoRow__logo {
height: 80px;
& + & {
margin-left: 40px;
}
}
.gettingStartedCard__descriptionText {
margin-top: 32px;
margin-bottom: 32px;
}
.gettingStartedCard {
width: 340px;
}

View file

@ -1 +0,0 @@
import './getting_started';

View file

@ -1 +0,0 @@
import './injected_items';

View file

@ -1,38 +0,0 @@
import { isArray } from 'lodash';
import { uiModules } from 'ui/modules';
import angular from 'angular';
import template from './injected_items.html';
import './injected_items.less';
function makeAngularParseableExpression(item) {
return `<div class="injectedItems__item">${item}&nbsp;</div>`;
}
const app = uiModules.get('kibana');
app.directive('injectedItems', function ($injector) {
const $compile = $injector.get('$compile');
return {
restrict: 'E',
replace: true,
template: template,
scope: {
items: '='
},
link: ($scope, $el) => {
const items = $scope.items;
if (isArray(items) && items.length > 0) {
items.forEach(item => {
// Compile itemHtml with current $scope and append it into the container DOM element.
// We do this because we want to dynamically inject content (strings) into the DOM. This content
// may contain Angular directives so it must first be $compiled with the current $scope.
const itemHtml = $compile(makeAngularParseableExpression(item))($scope);
angular.element($el).append(itemHtml);
});
}
}
};
});

View file

@ -1,3 +0,0 @@
.injectedItems__item {
display: inline;
}

View file

@ -1 +0,0 @@
<getting-started></getting-started>

View file

@ -1,14 +0,0 @@
import routes from 'ui/routes';
import template from './getting_started_route.html';
import './components/getting_started';
import { GETTING_STARTED_ROUTE } from './lib/constants';
routes
.when(GETTING_STARTED_ROUTE, {
template: template,
controllerAs: 'gettingStartedRoute',
controller: class GettingStartedRouteController {
constructor() {
}
}
});

View file

@ -1,3 +0,0 @@
import './lib/add_setup_work';
import './lib/register_management_section';
import './getting_started_route';

View file

@ -1,189 +0,0 @@
import expect from 'expect.js';
import sinon from 'sinon';
import { set } from 'lodash';
import uiChrome from 'ui/chrome';
import { Notifier } from 'ui/notify/notifier';
import { WAIT_FOR_URL_CHANGE_TOKEN } from 'ui/routes';
import { gettingStartedGateCheck } from '../add_setup_work';
import {
GETTING_STARTED_ROUTE,
CREATE_INDEX_PATTERN_ROUTE
} from '../constants';
import {
hasOptedOutOfGettingStarted,
undoOptOutOfGettingStarted
} from 'ui/getting_started/opt_out_helpers';
describe('Getting Started page', () => {
describe('add_setup_work', () => {
describe('gettingStartedGateCheck', () => {
let getIds;
let kbnUrl;
let config;
let $route;
beforeEach(() => {
kbnUrl = {
change: sinon.spy()
};
$route = {};
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 = {
get: sinon.stub(),
set: sinon.spy()
};
getIds = sinon.stub()
.returns(Promise.resolve([ 'logstash-*', 'cars' ]));
});
it('sets the chrome to visible', async () => {
await gettingStartedGateCheck(getIds, kbnUrl, config, $route);
expect(uiChrome.getVisible()).to.be(true);
});
it('opts the user out of the Getting Started page', async () => {
await gettingStartedGateCheck(getIds, kbnUrl, config, $route);
expect(hasOptedOutOfGettingStarted()).to.be(true);
});
describe('if the current route does not require a default index pattern', () => {
beforeEach(() => {
$route.current.$$route.requireDefaultIndex = false;
});
it('returns without performing any default index pattern checks', async () => {
await gettingStartedGateCheck(getIds, kbnUrl, config, $route);
expect(config.get.called).to.be(false);
expect(config.set.called).to.be(false);
});
});
describe('if the current route requires a default index pattern', () => {
beforeEach(() => {
set($route, 'current.$$route.requireDefaultIndex', true);
});
describe('if a default index pattern exists', () => {
beforeEach(() => {
config.get
.withArgs('defaultIndex')
.returns('an-index-pattern');
});
it('returns without setting a default index pattern', async () => {
await gettingStartedGateCheck(getIds, kbnUrl, config, $route);
expect(config.set.called).to.be(false);
});
});
describe('if a default index pattern does not exist', () => {
beforeEach(() => {
config.get
.withArgs('defaultIndex')
.returns(undefined);
});
it('sets the first index pattern as the default index pattern', async () => {
await gettingStartedGateCheck(getIds, kbnUrl, config, $route);
expect(config.set.calledWith('defaultIndex', 'logstash-*')).to.be(true);
});
});
});
});
describe('if no index patterns exist', () => {
beforeEach(() => {
getIds = sinon.stub()
.returns(Promise.resolve([]));
});
describe('if user has opted out of the Getting Started page', () => {
it('sets the chrome to visible', async () => {
await gettingStartedGateCheck(getIds, kbnUrl, config, $route);
expect(uiChrome.getVisible()).to.be(true);
});
describe('if the current route does not require a default index pattern', () => {
beforeEach(() => {
$route.current.$$route.requireDefaultIndex = false;
});
it('returns without redirecting the user', async () => {
await gettingStartedGateCheck(getIds, kbnUrl, config, $route);
expect(kbnUrl.change.called).to.be(false);
});
});
describe('if the current route requires a default index pattern', () => {
beforeEach(() => {
$route.current.$$route.requireDefaultIndex = true;
});
afterEach(() => {
// Clear out any notifications
Notifier.prototype._notifs.length = 0;
});
it('redirects the user to the Create Index Pattern page', async () => {
try {
await gettingStartedGateCheck(getIds, kbnUrl, config, $route);
} catch (e) {
expect(e).to.be(WAIT_FOR_URL_CHANGE_TOKEN);
}
expect(kbnUrl.change.calledWith(CREATE_INDEX_PATTERN_ROUTE)).to.be(true);
});
});
});
describe('if the user has not opted out of the Getting Started page', () => {
beforeEach(() => {
undoOptOutOfGettingStarted();
getIds = sinon.stub()
.returns(Promise.resolve([]));
});
describe('if the user is not already on Getting Started page', () => {
beforeEach(() => {
$route.current.$$route.originalPath = 'discover';
});
it('redirects the user to the Getting Started page', async () => {
try {
await gettingStartedGateCheck(getIds, kbnUrl, config, $route);
} catch (e) {
expect(e).to.be(WAIT_FOR_URL_CHANGE_TOKEN);
}
expect(kbnUrl.change.calledWith(GETTING_STARTED_ROUTE)).to.be(true);
});
});
describe('if the user is already on Getting Started page', () => {
beforeEach(() => {
$route.current.$$route.originalPath = GETTING_STARTED_ROUTE;
});
it('redirects the user to the Getting Started page', async () => {
await gettingStartedGateCheck(getIds, kbnUrl, config, $route);
expect(kbnUrl.change.called).to.be(false);
});
});
});
});
});
});
});

View file

@ -1,109 +0,0 @@
import { get } from 'lodash';
import uiRoutes, { WAIT_FOR_URL_CHANGE_TOKEN } from 'ui/routes';
import uiChrome from 'ui/chrome';
import { Notifier } from 'ui/notify/notifier';
import { IndexPatternsGetIdsProvider } from 'ui/index_patterns/_get_ids';
import KbnUrlProvider from 'ui/url';
import { hasOptedOutOfGettingStarted, optOutOfGettingStarted } from 'ui/getting_started/opt_out_helpers';
import {
GETTING_STARTED_ROUTE,
CREATE_INDEX_PATTERN_ROUTE
} from './constants';
function handleExistingIndexPatternsScenario(indexPatterns, currentRoute, config) {
// If index patterns exist, we're not going to show the user the Getting Started page.
// So we can show the chrome again at this point.
uiChrome.setVisible(true);
// The user need not see the Getting Started page, so opt them out of it
optOutOfGettingStarted();
// Some routes require a default index pattern to be present. If we're
// NOT on such a route, there's nothing more to do; send the user on their way
if (!currentRoute.requireDefaultIndex) {
return;
}
// Otherwise, check if we have a default index pattern
let defaultIndexPattern = config.get('defaultIndex');
// If we don't have an default index pattern, make the first index pattern the
// default one
if (!Boolean(defaultIndexPattern)) {
defaultIndexPattern = indexPatterns[0];
config.set('defaultIndex', defaultIndexPattern);
}
// At this point, we have a default index pattern and are all set!
return;
}
function handleGettingStartedOptedOutScenario(currentRoute, kbnUrl) {
// If the user has opted out of the Getting Started page, we're not going to show them that page.
// So we can show the chrome again at this point.
uiChrome.setVisible(true);
// Some routes require a default index pattern to be present. If we're
// NOT on such a route, there's nothing more to do; send the user on their way
if (!currentRoute.requireDefaultIndex) {
return;
}
// Otherwise, redirect the user to the index pattern creation page with
// a notification about creating an index pattern
const notify = new Notifier({
location: 'Index Patterns'
});
notify.error('Please create a new index pattern');
kbnUrl.change(CREATE_INDEX_PATTERN_ROUTE);
throw WAIT_FOR_URL_CHANGE_TOKEN;
}
function showGettingStartedPage(kbnUrl, isOnGettingStartedPage) {
// Redirect the user to the Getting Started page (unless they are on it already)
if (!isOnGettingStartedPage) {
kbnUrl.change(GETTING_STARTED_ROUTE);
throw WAIT_FOR_URL_CHANGE_TOKEN;
}
}
/*
* This function is exported for unit testing
*/
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 => {
const indexPatternsExist = Array.isArray(indexPatterns) && indexPatterns.length > 0;
if (indexPatternsExist) {
return handleExistingIndexPatternsScenario(indexPatterns, currentRoute, config);
}
if (hasOptedOutOfGettingStarted()) {
return handleGettingStartedOptedOutScenario(currentRoute, kbnUrl);
}
return showGettingStartedPage(kbnUrl, isOnGettingStartedPage);
});
}
// Start out with the chrome not being shown to prevent a flicker by
// hiding it later
uiChrome.setVisible(false);
uiRoutes.addSetupWork((Private, $injector) => {
const getIds = Private(IndexPatternsGetIdsProvider);
const kbnUrl = Private(KbnUrlProvider);
const config = $injector.get('config');
const $route = $injector.get('$route');
return gettingStartedGateCheck(getIds, kbnUrl, config, $route);
});

View file

@ -1,2 +0,0 @@
export const GETTING_STARTED_ROUTE = '/management/kibana/getting_started';
export const CREATE_INDEX_PATTERN_ROUTE = '/management/kibana/index';

View file

@ -1,8 +0,0 @@
import { management } from 'ui/management';
import { GETTING_STARTED_ROUTE } from './constants';
management.getSection('kibana').register('getting_started', {
display: 'Getting Started',
order: 50,
url: `#${GETTING_STARTED_ROUTE}`
});

View file

@ -19,6 +19,10 @@ uiRoutes
redirectTo: '/management'
});
require('ui/index_patterns/route_setup/load_default')({
whenMissingRedirectTo: '/management/kibana/index'
});
uiModules
.get('apps/management')
.directive('kbnManagementApp', function (Private, $location, timefilter, buildNum, buildSha) {

View file

@ -4,18 +4,6 @@ const urlVersion = metadata.branch;
const baseUrl = 'https://www.elastic.co/';
export const documentationLinks = {
elasticsearch: {
docs: `${baseUrl}guide/en/elasticsearch/reference/current`
},
beats: {
docs: `${baseUrl}guide/en/beats/libbeat/current`
},
logstash: {
docs: `${baseUrl}guide/en/logstash/current`
},
kibana: {
docs: `${baseUrl}guide/en/kibana/current`
},
filebeat: {
installation: `${baseUrl}guide/en/beats/filebeat/${urlVersion}/filebeat-installation.html`,
configuration: `${baseUrl}guide/en/beats/filebeat/${urlVersion}/filebeat-configuration.html`,
@ -38,6 +26,4 @@ export const documentationLinks = {
date: {
dateMath: `${baseUrl}guide/en/elasticsearch/reference/${urlVersion}/common-options.html#date-math`
},
demoSite: 'http://demo.elastic.co',
gettingStarted: `${baseUrl}products/kibana/getting-started-link`
};

View file

@ -1,6 +0,0 @@
export const GETTING_STARTED_OPT_OUT_FLAG = 'kibana.isGettingStartedOptedOut';
export const GETTING_STARTED_REGISTRY_TYPES = {
TOP_MESSAGE: 'topMessage',
MANAGE_AND_MONITOR_MESSAGE: 'monitorAndManageMessage'
};

View file

@ -1,14 +0,0 @@
import { uiModules } from 'ui/modules';
import { optOutOfGettingStarted } from './opt_out_helpers';
const app = uiModules.get('kibana');
app.directive('kbnGettingStartedOptOut', () => {
return {
restrict: 'A',
link: (scope, element) => {
element.on('click', () => {
optOutOfGettingStarted();
});
}
};
});

View file

@ -1,16 +0,0 @@
import { GETTING_STARTED_OPT_OUT_FLAG } from './constants';
export function hasOptedOutOfGettingStarted() {
return Boolean(window.localStorage.getItem(GETTING_STARTED_OPT_OUT_FLAG));
}
export function optOutOfGettingStarted() {
window.localStorage.setItem(GETTING_STARTED_OPT_OUT_FLAG, true);
}
/**
* This function is intended for unit testing
*/
export function undoOptOutOfGettingStarted() {
window.localStorage.removeItem(GETTING_STARTED_OPT_OUT_FLAG);
}

View file

@ -1,18 +0,0 @@
import { uiRegistry } from 'ui/registry/_registry';
export const GettingStartedRegistryProvider = uiRegistry({
name: 'gettingStartedTopMessages',
group: [ 'type' ]
});
/**
* Usage:
*
* import { GettingStartedRegistryProvider } from 'ui/getting_started/registry';
* import { GETTING_STARTED_REGISTRY_TYPES } from 'ui/getting_started/constants';
*
* GettingStartedRegistryProvider.register(($injector, Private, someOtherService, ...) => ({
* type: GETTING_STARTED_REGISTRY_TYPES.TOP_MESSAGE,
* template: 'plain text | html markup | markup with directives'
* }));
*/

View file

@ -1,8 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="67" height="67" viewBox="0 0 67 67">
<g fill="none" fill-rule="evenodd" transform="translate(.219 .219)">
<rect width="66.563" height="17.75" fill="#00A9E5" rx="2"/>
<rect width="28.844" height="17.75" y="24.406" fill="#00BFB3" rx="2"/>
<rect width="28.844" height="17.75" y="48.813" fill="#00A9E5" rx="2"/>
<rect width="31.063" height="42.156" x="35.5" y="24.406" fill="#00BFB3" rx="2"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 468 B

View file

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="40px" height="50px" viewBox="0 0 40 50" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 43.2 (39069) - http://www.bohemiancoding.com/sketch -->
<title>icon-security-bb-edited</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="icon-security-bb-edited">
<path d="M0,25.9749 L0,26.2749 C0.8,36.6749 8.1,46.0759 19.3,49.8749 C19.7,49.9749 20.2,49.9749 20.6,49.8749 C32,46.0759 39.5,36.6749 40,26.2749 L40,25.9749 L0,25.9749 Z" id="Fill-1" fill="#00BFB3"></path>
<path d="M40,25.9749 L40,7.3749 C40,6.5749 39.4,5.7749 38.6,5.4749 L20.6,0.0749 C20.2,-0.0251 19.8,-0.0251 19.4,0.0749 L1.4,5.4749 C0.6,5.7749 0,6.4749 0,7.3749 L0,25.9749 L40,25.9749 Z" id="Fill-3" fill="#13A7DF"></path>
<polygon id="Fill-6" fill="#0078A0" points="0 25.975 40 25.975 40 19.975 0 19.975"></polygon>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -1,23 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 40 40" style="enable-background:new 0 0 40 40;" xml:space="preserve">
<style type="text/css">
.st0{fill:#07A5DE;}
.st1{fill:#3EBEB0;}
.st2{opacity:0.26;fill:#353535;enable-background:new ;}
.st3{fill:#353535;}
.st4{fill:none;}
</style>
<title>logo-menu</title>
<g id="ES_Hadoop_Gery">
<path class="st0" d="M5,0.5h14.2c6.3,0,11.4,5.1,11.4,11.4c0,0,0,0,0,0l0,0c0,6.3-5.1,11.4-11.4,11.4c0,0,0,0,0,0H5l0,0V0.5L5,0.5z
"/>
<path class="st1" d="M5,16.6h18.5C29.8,16.6,35,21.7,35,28c0,0,0,0,0,0.1l0,0c0,6.3-5.1,11.4-11.4,11.4c0,0,0,0-0.1,0H5l0,0V16.6
L5,16.6z"/>
<path class="st2" d="M32.2,20.6c-2.2-2.5-5.3-4-8.7-4H5v10.6h17.2C28.2,27.2,32.5,21,32.2,20.6z"/>
<path class="st3" d="M19.2,23.4c3.9,0,7.6-2,9.7-5.4c-0.3-0.1-0.5-0.3-0.8-0.4l-0.2-0.1c-0.3-0.1-0.6-0.2-0.8-0.3H27h-0.1
C26.6,17.1,26.3,17,26,17h-0.1h-0.2c-0.3,0-0.5-0.1-0.8-0.1h-0.2h-0.2c-0.3,0-0.6,0-0.9,0H5v6.8L19.2,23.4z"/>
</g>
<rect x="0" class="st4" width="40" height="40"/>
</svg>

Before

Width:  |  Height:  |  Size: 1.2 KiB

View file

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 40 40" style="enable-background:new 0 0 40 40;" xml:space="preserve">
<style type="text/css">
.st0{fill:#E9478B;}
.st1{fill:#3EBEB0;}
.st2{fill:#37A595;}
.st3{fill:#353535;}
.st4{fill:none;}
</style>
<title>logo-menu</title>
<g id="ES_Hadoop_Gery">
<path class="st0" d="M5.6,15.1c5,0,9.9,1.2,14.3,3.6L35,0.5H5v36.2l0,0V15.1L5.6,15.1z"/>
<path class="st1" d="M19.9,18.7L5,36.7v2.8h30C33.3,30.7,27.8,23,19.9,18.7z"/>
<path class="st2" d="M19.9,18.7L5,36.7v2.8h5.3l14.4-17.4c0,0-1-0.8-2.3-1.8C21.4,19.6,19.9,18.7,19.9,18.7z"/>
<path class="st3" d="M5.6,15.1H5v21.6l14.9-17.9C15.5,16.3,10.5,15.1,5.6,15.1z"/>
</g>
<rect x="0" class="st4" width="40" height="40"/>
</svg>

Before

Width:  |  Height:  |  Size: 950 B

View file

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 40 40" style="enable-background:new 0 0 40 40;" xml:space="preserve">
<style type="text/css">
.st0{fill:#F3BD19;}
.st1{fill:#231F20;}
.st2{fill:#3EBEB0;}
.st3{fill:#37A595;}
.st4{fill:none;}
</style>
<title>logo-menu</title>
<g id="ES_Hadoop_Gery">
<path class="st0" d="M2.7,0.5h5.5c7,0,12.6,5.7,12.6,12.6v8.2l0,0H2.7l0,0V0.5L2.7,0.5z"/>
<path class="st1" d="M2.7,21.4h18.1l0,0v18.1l0,0l0,0C10.8,39.5,2.7,31.4,2.7,21.4L2.7,21.4L2.7,21.4z"/>
<rect x="20.8" y="21.4" class="st2" width="16.5" height="18.1"/>
<rect x="20.8" y="21.4" class="st3" width="3.8" height="18.1"/>
</g>
<rect x="0" class="st4" width="40" height="40"/>
</svg>

Before

Width:  |  Height:  |  Size: 915 B

View file

@ -0,0 +1,58 @@
import _ from 'lodash';
import { Notifier } from 'ui/notify/notifier';
import { NoDefaultIndexPattern } from 'ui/errors';
import { IndexPatternsGetIdsProvider } from '../_get_ids';
import uiRoutes from 'ui/routes';
const notify = new Notifier({
location: 'Index Patterns'
});
module.exports = function (opts) {
opts = opts || {};
const whenMissingRedirectTo = opts.whenMissingRedirectTo || null;
let defaultRequiredToasts = null;
uiRoutes
.addSetupWork(function loadDefaultIndexPattern(Private, Promise, $route, config) {
const getIds = Private(IndexPatternsGetIdsProvider);
const route = _.get($route, 'current.$$route');
return getIds()
.then(function (patterns) {
let defaultId = config.get('defaultIndex');
let defined = !!defaultId;
const exists = _.contains(patterns, defaultId);
if (defined && !exists) {
config.remove('defaultIndex');
defaultId = defined = false;
}
if (!defined && route.requireDefaultIndex) {
// If there is only one index pattern, set it as default
if (patterns.length === 1) {
defaultId = patterns[0];
config.set('defaultIndex', defaultId);
} else {
throw new NoDefaultIndexPattern();
}
}
});
})
.afterWork(
// success
null,
// failure
function (err, kbnUrl) {
const hasDefault = !(err instanceof NoDefaultIndexPattern);
if (hasDefault || !whenMissingRedirectTo) throw err; // rethrow
kbnUrl.change(whenMissingRedirectTo);
if (!defaultRequiredToasts) defaultRequiredToasts = [];
else defaultRequiredToasts.push(notify.error(err));
}
);
};

View file

@ -230,8 +230,8 @@ Notifier.config = {
errorLifetime: 300000,
warningLifetime: 10000,
infoLifetime: 5000,
setInterval: window.setInterval.bind(window),
clearInterval: window.clearInterval.bind(window)
setInterval: window.setInterval,
clearInterval: window.clearInterval
};
Notifier.applyConfig = function (config) {

View file

@ -18,9 +18,9 @@ export default function ({ getService, getPageObjects }) {
const PageObjects = getPageObjects(['common', 'console']);
describe('console app', function describeIndexTests() {
before(async function () {
before(function () {
log.debug('navigateTo console');
await PageObjects.common.navigateToApp('console');
return PageObjects.common.navigateToApp('console');
});
it('should show the default request', function () {

View file

@ -1,78 +0,0 @@
import expect from 'expect.js';
export default ({ getService, getPageObjects }) => {
const kibanaServer = getService('kibanaServer');
const esArchiver = getService('esArchiver');
const remote = getService('remote');
const log = getService('log');
const PageObjects = getPageObjects(['common', 'gettingStarted']);
describe('Getting Started page', () => {
describe('when no index patterns exist', () => {
beforeEach(async () => {
// delete .kibana index and then wait for Kibana to re-create it
await esArchiver.unload('logstash_functional');
await esArchiver.load('empty_kibana');
});
describe('when user has not opted out of Getting Started page', () => {
beforeEach(async () => {
// First, we navigate to *somewhere* in Kibana so the browser loads up Kibana. This allows us...
await PageObjects.common.navigateToUrl('discover', '');
// ... to remove the Getting Started page opt-out flag from local storage for the Kibana domain
await remote.deleteLocalStorageItem('kibana.isGettingStartedOptedOut');
});
it('redirects to the Getting Started page', async () => {
await PageObjects.common.navigateToUrl('discover', '');
await PageObjects.common.waitUntilUrlIncludes('getting_started');
const isLoaded = await PageObjects.gettingStarted.doesContainerExist();
expect(isLoaded).to.be(true);
});
});
describe('when user has opted out of Getting Started page', () => {
beforeEach(async () => {
await PageObjects.gettingStarted.optOut();
});
it('does not redirect to the Getting Started page', async () => {
await PageObjects.common.navigateToUrl('discover', '');
const isLoaded = await PageObjects.gettingStarted.doesContainerExist();
expect(isLoaded).to.be(false);
});
});
});
describe('when index patterns exist', () => {
beforeEach(async () => {
log.debug('load kibana index with default index pattern');
await esArchiver.load('discover');
await kibanaServer.uiSettings.replace({
'dateFormat:tz':'UTC',
'defaultIndex':'logstash-*'
});
});
it('does not redirect to the Getting Started page', async () => {
await PageObjects.common.navigateToUrl('discover', '');
const isLoaded = await PageObjects.gettingStarted.doesContainerExist();
expect(isLoaded).to.be(false);
});
describe('when a user directly navigates to the Getting Started page', () => {
beforeEach(async () => {
await PageObjects.gettingStarted.navigateTo();
});
it('the kibana chrome (which contains the global nav) is visible', async () => {
const isChromeVisible = await PageObjects.common.isChromeVisible();
expect(isChromeVisible).to.be(true);
});
});
});
});
};

View file

@ -24,7 +24,6 @@ export default function ({ getService, loadTestFile }) {
loadTestFile(require.resolve('./_scripted_fields'));
loadTestFile(require.resolve('./_index_pattern_filter'));
loadTestFile(require.resolve('./_scripted_fields_filter'));
loadTestFile(require.resolve('./_getting_started'));
});
}

View file

@ -10,7 +10,6 @@ import {
SettingsPageProvider,
MonitoringPageProvider,
PointSeriesPageProvider,
GettingStartedPageProvider
} from './page_objects';
import {
@ -49,7 +48,6 @@ export default async function ({ readConfigFile }) {
settings: SettingsPageProvider,
monitoring: MonitoringPageProvider,
pointSeries: PointSeriesPageProvider,
gettingStarted: GettingStartedPageProvider,
},
services: {
es: commonConfig.get('services.es'),

View file

@ -2,7 +2,7 @@ import { delay } from 'bluebird';
import getUrl from '../../../src/test_utils/get_url';
export function CommonPageProvider({ getService, getPageObjects, getPageObject }) {
export function CommonPageProvider({ getService, getPageObjects }) {
const log = getService('log');
const config = getService('config');
const remote = getService('remote');
@ -87,11 +87,6 @@ export function CommonPageProvider({ getService, getPageObjects, getPageObject }
if (currentUrl.includes('app/kibana')) {
await testSubjects.find('kibanaChrome');
const gettingStartedPage = getPageObject('gettingStarted');
if (await gettingStartedPage.doesContainerExist()) {
await gettingStartedPage.optOut();
throw new Error('Retrying after receiving Getting Started page');
}
}
})
.then(async function () {

View file

@ -1,31 +0,0 @@
export function GettingStartedPageProvider({ getService, getPageObjects }) {
const log = getService('log');
const retry = getService('retry');
const testSubjects = getService('testSubjects');
const PageObjects = getPageObjects(['common']);
class GettingStartedPage {
async doesContainerExist() {
return await testSubjects.exists('gettingStartedContainer');
}
async optOut() {
log.debug('Clicking opt-out link');
await testSubjects.click('lnkGettingStartedOptOut');
await retry.try(async () => {
if (await this.doesContainerExist()) {
throw new Error('Still on getting started page');
}
});
}
async navigateTo() {
log.debug('Navigating directly to Getting Started page');
await PageObjects.common.navigateToUrl('settings', 'kibana/getting_started');
}
}
return new GettingStartedPage();
}

View file

@ -9,4 +9,3 @@ export { VisualizePageProvider } from './visualize_page';
export { SettingsPageProvider } from './settings_page';
export { MonitoringPageProvider } from './monitoring_page';
export { PointSeriesPageProvider } from './point_series_page';
export { GettingStartedPageProvider } from './getting_started_page';