Skip to content

Commit

Permalink
Merge branch 'master' into fix/Watcher-error-prevents-navigation-#20305
Browse files Browse the repository at this point in the history
# Conflicts:
#	x-pack/plugins/watcher/common/constants/action_states.js
#	x-pack/plugins/watcher/common/constants/watch_states.js
#	x-pack/plugins/watcher/server/models/action/email_action.js
#	x-pack/plugins/watcher/server/models/watch/base_watch.js
  • Loading branch information
sebelga committed Oct 22, 2018
2 parents 8cbf7f2 + 7739410 commit 8b65314
Show file tree
Hide file tree
Showing 299 changed files with 18,497 additions and 2,993 deletions.
4 changes: 3 additions & 1 deletion .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
"inputControl":"src/core_plugins/input_control_vis",
"kbn": "src/core_plugins/kibana",
"kbnVislibVisTypes": "src/core_plugins/kbn_vislib_vis_types",
"kbn.management.objects": "src/core_plugins/kibana/public/management",
"markdownVis": "src/core_plugins/markdown_vis",
"metricVis": "src/core_plugins/metric_vis",
"statusPage": "src/core_plugins/status_page",
"tagCloud": "src/core_plugins/tagcloud",
"xpack.idxMgmt": "x-pack/plugins/index_management"
"xpack.idxMgmt": "x-pack/plugins/index_management",
"xpack.watcher": "x-pack/plugins/watcher"
},
"exclude": [
"src/ui/ui_render/bootstrap/app_bootstrap.js",
Expand Down
4 changes: 4 additions & 0 deletions docs/reporting/reporting-troubleshooting.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ those characters is installed.
You might see "There was an error generating your report" or one of the following errors when you download your report. See below for
an explanation of why the failure occurred and what you can do to fix it.

[float]
=== Data Table Visualization does not show all data in PDF reports
There is currently a known limitation with the Data Table visualization that only the first page of data rows, which are the only data visible on the screen, are shown in PDF reports.

[float]
==== `You must install fontconfig and freetype for Reporting to work'`
Reporting using PhantomJS, the default browser, relies on system packages. Install the appropriate fontconfig and freetype
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"**/@types/node": "8.10.21"
},
"dependencies": {
"@elastic/eui": "4.4.1",
"@elastic/eui": "4.5.1",
"@elastic/filesaver": "1.1.2",
"@elastic/numeral": "2.3.2",
"@elastic/ui-ace": "0.2.3",
Expand Down Expand Up @@ -113,6 +113,7 @@
"extract-text-webpack-plugin": "3.0.1",
"file-loader": "1.1.4",
"font-awesome": "4.4.0",
"getos": "^3.1.0",
"glob": "^7.1.2",
"glob-all": "^3.1.0",
"good-squeeze": "2.1.0",
Expand Down
239 changes: 239 additions & 0 deletions src/core/public/chrome/chrome_service.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,239 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import * as Rx from 'rxjs';
import { toArray } from 'rxjs/operators';

const store = new Map();
(window as any).localStorage = {
setItem: (key: string, value: string) => store.set(String(key), String(value)),
getItem: (key: string) => store.get(String(key)),
removeItem: (key: string) => store.delete(String(key)),
};

import { ChromeService } from './chrome_service';

beforeEach(() => {
store.clear();
});

describe('start', () => {
describe('brand', () => {
it('updates/emits the brand as it changes', async () => {
const service = new ChromeService();
const start = service.start();
const promise = start
.getBrand$()
.pipe(toArray())
.toPromise();

start.setBrand({
logo: 'big logo',
smallLogo: 'not so big logo',
});
start.setBrand({
logo: 'big logo without small logo',
});
service.stop();

await expect(promise).resolves.toMatchInlineSnapshot(`
Array [
Object {},
Object {
"logo": "big logo",
"smallLogo": "not so big logo",
},
Object {
"logo": "big logo without small logo",
"smallLogo": undefined,
},
]
`);
});
});

describe('visibility', () => {
it('updates/emits the visibility', async () => {
const service = new ChromeService();
const start = service.start();
const promise = start
.getIsVisible$()
.pipe(toArray())
.toPromise();

start.setIsVisible(true);
start.setIsVisible(false);
start.setIsVisible(true);
service.stop();

await expect(promise).resolves.toMatchInlineSnapshot(`
Array [
true,
true,
false,
true,
]
`);
});

it('always emits false if embed query string is in hash when started', async () => {
window.history.pushState(undefined, '', '#/home?a=b&embed=true');

const service = new ChromeService();
const start = service.start();
const promise = start
.getIsVisible$()
.pipe(toArray())
.toPromise();

start.setIsVisible(true);
start.setIsVisible(false);
start.setIsVisible(true);
service.stop();

await expect(promise).resolves.toMatchInlineSnapshot(`
Array [
false,
false,
false,
false,
]
`);
});
});

describe('is collapsed', () => {
it('updates/emits isCollapsed', async () => {
const service = new ChromeService();
const start = service.start();
const promise = start
.getIsCollapsed$()
.pipe(toArray())
.toPromise();

start.setIsCollapsed(true);
start.setIsCollapsed(false);
start.setIsCollapsed(true);
service.stop();

await expect(promise).resolves.toMatchInlineSnapshot(`
Array [
false,
true,
false,
true,
]
`);
});

it('only stores true in localStorage', async () => {
const service = new ChromeService();
const start = service.start();

start.setIsCollapsed(true);
expect(store.size).toBe(1);

start.setIsCollapsed(false);
expect(store.size).toBe(0);
});
});

describe('application classes', () => {
it('updates/emits the application classes', async () => {
const service = new ChromeService();
const start = service.start();
const promise = start
.getApplicationClasses$()
.pipe(toArray())
.toPromise();

start.addApplicationClass('foo');
start.addApplicationClass('foo');
start.addApplicationClass('bar');
start.addApplicationClass('bar');
start.addApplicationClass('baz');
start.removeApplicationClass('bar');
start.removeApplicationClass('foo');
service.stop();

await expect(promise).resolves.toMatchInlineSnapshot(`
Array [
Array [],
Array [
"foo",
],
Array [
"foo",
],
Array [
"foo",
"bar",
],
Array [
"foo",
"bar",
],
Array [
"foo",
"bar",
"baz",
],
Array [
"foo",
"baz",
],
Array [
"baz",
],
]
`);
});
});
});

describe('stop', () => {
it('completes applicationClass$, isCollapsed$, isVisible$, and brand$ observables', async () => {
const service = new ChromeService();
const start = service.start();
const promise = Rx.combineLatest(
start.getBrand$(),
start.getApplicationClasses$(),
start.getIsCollapsed$(),
start.getIsVisible$()
).toPromise();

service.stop();
await promise;
});

it('completes immediately if service already stopped', async () => {
const service = new ChromeService();
const start = service.start();
service.stop();

await expect(
Rx.combineLatest(
start.getBrand$(),
start.getApplicationClasses$(),
start.getIsCollapsed$(),
start.getIsVisible$()
).toPromise()
).resolves.toBe(undefined);
});
});
Loading

0 comments on commit 8b65314

Please sign in to comment.