Skip to content

Commit

Permalink
Merge branch 'master' of github.com:elastic/kibana into deprecations/…
Browse files Browse the repository at this point in the history
…docs
  • Loading branch information
Bamieh committed Jun 28, 2021
2 parents 3126dd3 + 43a897e commit e5a25ba
Show file tree
Hide file tree
Showing 150 changed files with 2,352 additions and 1,424 deletions.
3 changes: 3 additions & 0 deletions docs/api/task-manager/health.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,20 @@

Retrieve the health status of the {kib} Task Manager.

[float]
[[task-manager-api-health-request]]
==== Request

`GET <kibana host>:<port>/api/task_manager/_health`

[float]
[[task-manager-api-health-codes]]
==== Response code

`200`::
Indicates a successful call.

[float]
[[task-manager-api-health-example]]
==== Example

Expand Down
1 change: 1 addition & 0 deletions docs/developer/getting-started/monorepo-packages.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ yarn kbn watch-bazel
- @kbn/securitysolution-utils
- @kbn/server-http-tools
- @kbn/server-route-repository
- @kbn/spec-to-console
- @kbn/std
- @kbn/storybook
- @kbn/telemetry-utils
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

```typescript
readonly links: {
readonly settings: string;
readonly canvas: {
readonly guide: string;
};
Expand Down

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions docs/user/dashboard/tsvb.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,15 @@ For other types of month over month calculations, use <<timelion, *Timelion*>> o

Calculating the duration between the start and end of an event is unsupported in *TSVB* because *TSVB* requires correlation between different time periods.
*TSVB* requires that the duration is pre-calculated.

[float]
===== How do I group on multiple fields?

To group with multiple fields, create runtime fields in the index pattern you are visualizing.

. Create a runtime field. Refer to <<managing-index-patterns, *Manage index patterns data fields*>> for more information.
+
[role="screenshot"]
image::images/tsvb_group_by_multiple_fields.png[Group by multiple fields]

. Create a new TSVB visualization and group by this field.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,7 @@
"@kbn/plugin-generator": "link:bazel-bin/packages/kbn-plugin-generator",
"@kbn/plugin-helpers": "link:bazel-bin/packages/kbn-plugin-helpers",
"@kbn/pm": "link:packages/kbn-pm",
"@kbn/spec-to-console": "link:bazel-bin/packages/kbn-spec-to-console",
"@kbn/storybook": "link:bazel-bin/packages/kbn-storybook",
"@kbn/telemetry-tools": "link:bazel-bin/packages/kbn-telemetry-tools",
"@kbn/test": "link:packages/kbn-test",
Expand Down
1 change: 1 addition & 0 deletions packages/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ filegroup(
"//packages/kbn-securitysolution-hook-utils:build",
"//packages/kbn-server-http-tools:build",
"//packages/kbn-server-route-repository:build",
"//packages/kbn-spec-to-console:build",
"//packages/kbn-std:build",
"//packages/kbn-storybook:build",
"//packages/kbn-telemetry-tools:build",
Expand Down
55 changes: 55 additions & 0 deletions packages/kbn-spec-to-console/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")

PKG_BASE_NAME = "kbn-spec-to-console"
PKG_REQUIRE_NAME = "@kbn/spec-to-console"

SOURCE_FILES = glob(
[
"bin/**/*",
"lib/**/*",
"index.js"
],
exclude = [
"**/*.test.*",
"**/__fixtures__/**",
],
)

SRCS = SOURCE_FILES

filegroup(
name = "srcs",
srcs = SRCS,
)

NPM_MODULE_EXTRA_FILES = [
"package.json",
"README.md",
]

DEPS = []

js_library(
name = PKG_BASE_NAME,
srcs = NPM_MODULE_EXTRA_FILES + [
":srcs",
],
deps = DEPS,
package_name = PKG_REQUIRE_NAME,
visibility = ["//visibility:public"],
)

pkg_npm(
name = "npm_module",
deps = [
":%s" % PKG_BASE_NAME,
]
)

filegroup(
name = "build",
srcs = [
":npm_module",
],
visibility = ["//visibility:public"],
)
4 changes: 2 additions & 2 deletions packages/kbn-spec-to-console/lib/convert.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

const convert = require('./convert');

const clusterHealthSpec = require('../test/fixtures/cluster_health_spec');
const clusterHealthAutocomplete = require('../test/fixtures/cluster_health_autocomplete');
const clusterHealthSpec = require('./__fixtures__/cluster_health_spec');
const clusterHealthAutocomplete = require('./__fixtures__/cluster_health_autocomplete');

test('convert', () => {
expect(convert(clusterHealthSpec)).toEqual(clusterHealthAutocomplete);
Expand Down
5 changes: 3 additions & 2 deletions packages/kbn-spec-to-console/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "spec-to-console",
"version": "0.0.0",
"name": "@kbn/spec-to-console",
"version": "1.0.0",
"description": "ES REST spec -> Console autocomplete",
"main": "index.js",
"directories": {
"lib": "lib"
},
"private": true,
"scripts": {
"format": "../../node_modules/.bin/prettier **/*.js --write"
},
Expand Down
Binary file added rfcs/images/0019_lifecycle_preboot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
261 changes: 261 additions & 0 deletions rfcs/text/0019_lifecycle_preboot.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion scripts/spec_to_console.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
* Side Public License, v 1.
*/

require('../packages/kbn-spec-to-console/bin/spec_to_console');
require('@kbn/spec-to-console/bin/spec_to_console');
14 changes: 11 additions & 3 deletions src/core/public/core_app/core_app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,13 @@ import type { CoreContext } from '../core_system';
import type { NotificationsSetup, NotificationsStart } from '../notifications';
import type { IUiSettingsClient } from '../ui_settings';
import type { InjectedMetadataSetup } from '../injected_metadata';
import { renderApp as renderErrorApp, setupUrlOverflowDetection } from './errors';
import {
renderApp as renderErrorApp,
setupPublicBaseUrlConfigWarning,
setupUrlOverflowDetection,
} from './errors';
import { renderApp as renderStatusApp } from './status';
import { DocLinksStart } from '../doc_links';

interface SetupDeps {
application: InternalApplicationSetup;
Expand All @@ -30,6 +35,7 @@ interface SetupDeps {

interface StartDeps {
application: InternalApplicationStart;
docLinks: DocLinksStart;
http: HttpStart;
notifications: NotificationsStart;
uiSettings: IUiSettingsClient;
Expand All @@ -40,7 +46,7 @@ export class CoreApp {

constructor(private readonly coreContext: CoreContext) {}

public setup({ http, application, injectedMetadata, notifications }: SetupDeps) {
public setup({ application, http, injectedMetadata, notifications }: SetupDeps) {
application.register(this.coreContext.coreId, {
id: 'error',
title: 'App Error',
Expand Down Expand Up @@ -68,7 +74,7 @@ export class CoreApp {
});
}

public start({ application, http, notifications, uiSettings }: StartDeps) {
public start({ application, docLinks, http, notifications, uiSettings }: StartDeps) {
if (!application.history) {
return;
}
Expand All @@ -79,6 +85,8 @@ export class CoreApp {
toasts: notifications.toasts,
uiSettings,
});

setupPublicBaseUrlConfigWarning({ docLinks, http, notifications });
}

public stop() {
Expand Down
1 change: 1 addition & 0 deletions src/core/public/core_app/errors/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@

export { renderApp } from './error_application';
export { setupUrlOverflowDetection, URL_MAX_LENGTH } from './url_overflow';
export { setupPublicBaseUrlConfigWarning } from './public_base_url';
114 changes: 114 additions & 0 deletions src/core/public/core_app/errors/public_base_url.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

import { docLinksServiceMock } from '../../doc_links/doc_links_service.mock';
import { httpServiceMock } from '../../http/http_service.mock';
import { notificationServiceMock } from '../../notifications/notifications_service.mock';

import { setupPublicBaseUrlConfigWarning } from './public_base_url';

describe('publicBaseUrl warning', () => {
const docLinks = docLinksServiceMock.createStartContract();
const notifications = notificationServiceMock.createStartContract();

beforeEach(() => {
jest.resetAllMocks();
});

it('does not show any toast on localhost', () => {
const http = httpServiceMock.createStartContract();

setupPublicBaseUrlConfigWarning({
docLinks,
notifications,
http,
location: {
hostname: 'localhost',
} as Location,
});

expect(notifications.toasts.addWarning).not.toHaveBeenCalled();
});

it('does not show any toast on 127.0.0.1', () => {
const http = httpServiceMock.createStartContract();

setupPublicBaseUrlConfigWarning({
docLinks,
notifications,
http,
location: {
hostname: '127.0.0.1',
} as Location,
});

expect(notifications.toasts.addWarning).not.toHaveBeenCalled();
});

it('does not show toast if configured correctly', () => {
const http = httpServiceMock.createStartContract({ publicBaseUrl: 'http://myhost.com' });

setupPublicBaseUrlConfigWarning({
docLinks,
notifications,
http,
location: {
hostname: 'myhost.com',
toString() {
return 'http://myhost.com/';
},
} as Location,
});

expect(notifications.toasts.addWarning).not.toHaveBeenCalled();
});

describe('config missing toast', () => {
it('adds toast if publicBaseUrl is missing', () => {
const http = httpServiceMock.createStartContract({ publicBaseUrl: undefined });

setupPublicBaseUrlConfigWarning({
docLinks,
notifications,
http,
location: {
hostname: 'myhost.com',
toString() {
return 'http://myhost.com/';
},
} as Location,
});

expect(notifications.toasts.addWarning).toHaveBeenCalledWith({
title: 'Configuration missing',
text: expect.any(Function),
});
});

it('does not add toast if storage key set', () => {
const http = httpServiceMock.createStartContract({ publicBaseUrl: undefined });

setupPublicBaseUrlConfigWarning({
docLinks,
notifications,
http,
location: {
hostname: 'myhost.com',
toString() {
return 'http://myhost.com/';
},
} as Location,
storage: {
getItem: (id: string) => 'true',
} as Storage,
});

expect(notifications.toasts.addWarning).not.toHaveBeenCalled();
});
});
});
Loading

0 comments on commit e5a25ba

Please sign in to comment.