Skip to content

Commit

Permalink
Merge branch 'master' of github.com:elastic/kibana into legrego/issue…
Browse files Browse the repository at this point in the history
…-87388
  • Loading branch information
legrego committed May 19, 2021
2 parents 0080018 + 8f1bf66 commit aff886e
Show file tree
Hide file tree
Showing 200 changed files with 5,087 additions and 2,660 deletions.
Binary file added dev_docs/assets/ml_csv_upload.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dev_docs/assets/sample_data.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions dev_docs/tutorials/sample_data.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
id: kibDevTutorialSampleData
slug: /kibana-dev-docs/tutorial/sample-data
title: Add sample data
summary: Learn how to add sample data to Kibana
date: 2021-04-26
tags: ['kibana', 'onboarding', 'dev', 'architecture', 'tutorials']
---

## Installation from the UI

1. Navigate to the home page.
2. Click **Add data**.
3. Click on the **Sample data** tab.
4. Select a dataset by clicking on the **Add data** button.

![Sample Data](../assets/sample_data.png)

## CSV Upload

1. Navigate to the **Machine Learning** application.
2. Click on the **Data Visualizer** tab.
3. Click on **Select file** in the **Import data** container.

![CSV Upload](../assets/ml_csv_upload.png)

## makelogs

The makelogs script generates sample web server logs. Make sure Elasticsearch is running before running the script.

```sh
node scripts/makelogs --auth <username>:<password>
```
4 changes: 2 additions & 2 deletions docs/user/dashboard/timelion.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Instead of using a visual editor to create charts, you define a graph by chaining functions together, using the *Timelion*-specific syntax.
The syntax enables some features that classical point series charts don't offer, such as pulling data from different indices or data sources into one graph.

deprecated::[7.0.0,"*Timelion* is still supported. The *Timelion app* is deprecated in 7.0, replaced by dashboard features. In 8.0 and later, the *Timelion app* is removed from {kib}. To prepare for the removal of *Timelion app*, you must migrate *Timelion app* worksheets to a dashboard. For information on how to migrate *Timelion app* worksheets, refer to the link:https://www.elastic.co/guide/en/kibana/7.10/release-notes-7.10.0.html#deprecation-v7.10.0[7.10.0 Release Notes]."]
deprecated::[7.0.0,"*Timelion* is still supported. The *Timelion app* is deprecated in 7.0, replaced by dashboard features. In the last 7.x minor version and later, the *Timelion app* is removed from {kib}. To prepare for the removal of *Timelion app*, you must migrate *Timelion app* worksheets to a dashboard. For information on how to migrate *Timelion app* worksheets, refer to the link:https://www.elastic.co/guide/en/kibana/7.10/release-notes-7.10.0.html#deprecation-v7.10.0[7.10.0 Release Notes]."]

[float]
==== Timelion expressions
Expand Down Expand Up @@ -554,4 +554,4 @@ Save and add the panel to the dashboard.

. Click *Save and return*.

For more information about *Timelion* conditions, refer to https://www.elastic.co/blog/timeseries-if-then-else-with-timelion[I have but one .condition()].
For more information about *Timelion* conditions, refer to https://www.elastic.co/blog/timeseries-if-then-else-with-timelion[I have but one .condition()].
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
"@elastic/safer-lodash-set": "link:bazel-bin/packages/elastic-safer-lodash-set/npm_module",
"@elastic/search-ui-app-search-connector": "^1.5.0",
"@elastic/ui-ace": "0.2.3",
"@hapi/accept": "^5.0.2",
"@hapi/boom": "^9.1.1",
"@hapi/cookie": "^11.0.2",
"@hapi/good-squeeze": "6.0.0",
Expand Down Expand Up @@ -171,7 +172,6 @@
"JSONStream": "1.3.5",
"abort-controller": "^3.0.0",
"abortcontroller-polyfill": "^1.4.0",
"accept": "3.0.2",
"ajv": "^6.12.4",
"angular": "^1.8.0",
"angular-aria": "^1.8.0",
Expand Down Expand Up @@ -303,7 +303,6 @@
"object-hash": "^1.3.1",
"object-path-immutable": "^3.1.1",
"opn": "^5.5.0",
"oppsy": "^2.0.0",
"p-limit": "^3.0.1",
"p-map": "^4.0.0",
"p-retry": "^4.2.0",
Expand Down Expand Up @@ -489,7 +488,6 @@
"@testing-library/react": "^11.2.6",
"@testing-library/react-hooks": "^5.1.1",
"@testing-library/user-event": "^13.1.1",
"@types/accept": "3.1.1",
"@types/angular": "^1.6.56",
"@types/angular-mocks": "^1.7.0",
"@types/archiver": "^5.1.0",
Expand Down
30 changes: 4 additions & 26 deletions packages/kbn-i18n/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ ts_project(
deps = DEPS,
allow_js = True,
declaration = True,
declaration_dir = "types",
declaration_dir = "target_types",
declaration_map = True,
incremental = True,
out_dir = "node",
out_dir = "target_node",
source_map = True,
root_dir = "src",
tsconfig = ":tsconfig",
Expand All @@ -102,38 +102,16 @@ ts_project(
allow_js = True,
declaration = False,
incremental = True,
out_dir = "web",
out_dir = "target_web",
source_map = True,
root_dir = "src",
tsconfig = ":tsconfig_browser",
)

filegroup(
name = "tsc_types",
srcs = [":tsc"],
output_group = "types",
)

filegroup(
name = "target_files",
srcs = [
":tsc",
":tsc_browser",
":tsc_types",
],
)

pkg_npm(
name = "target",
deps = [
":target_files",
],
)

js_library(
name = PKG_BASE_NAME,
srcs = NPM_MODULE_EXTRA_FILES,
deps = [":target"] + DEPS,
deps = [":tsc", ":tsc_browser"] + DEPS,
package_name = PKG_REQUIRE_NAME,
visibility = ["//visibility:public"],
)
Expand Down
6 changes: 3 additions & 3 deletions packages/kbn-i18n/angular/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"browser": "../target/web/angular",
"main": "../target/node/angular",
"types": "../target/types/angular/index.d.ts"
"browser": "../target_web/angular",
"main": "../target_node/angular",
"types": "../target_types/angular/index.d.ts"
}
6 changes: 3 additions & 3 deletions packages/kbn-i18n/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "@kbn/i18n",
"browser": "./target/web/browser.js",
"main": "./target/node/index.js",
"types": "./target/types/index.d.ts",
"browser": "./target_web/browser.js",
"main": "./target_node/index.js",
"types": "./target_types/index.d.ts",
"version": "1.0.0",
"license": "SSPL-1.0 OR Elastic License 2.0",
"private": true
Expand Down
6 changes: 3 additions & 3 deletions packages/kbn-i18n/react/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"browser": "../target/web/react",
"main": "../target/node/react",
"types": "../target/types/react/index.d.ts"
"browser": "../target_web/react",
"main": "../target_node/react",
"types": "../target_types/react/index.d.ts"
}
5 changes: 3 additions & 2 deletions packages/kbn-i18n/tsconfig.browser.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
"compilerOptions": {
"allowJs": true,
"incremental": true,
"outDir": "./target/web",
"outDir": "./target_web",
"declaration": false,
"isolatedModules": true,
"sourceMap": true,
"sourceRoot": "../../../../../packages/kbn-i18n/src"
"sourceRoot": "../../../../../packages/kbn-i18n/src",
"types": ["node"],
},
"include": [
"src/**/*.ts",
Expand Down
4 changes: 2 additions & 2 deletions packages/kbn-i18n/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"compilerOptions": {
"allowJs": true,
"incremental": true,
"declarationDir": "./target/types",
"outDir": "./target/node",
"declarationDir": "./target_types",
"outDir": "./target_node",
"declaration": true,
"declarationMap": true,
"sourceMap": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
*/

import { extname } from 'path';
import Accept from 'accept';
import Accept from '@hapi/accept';
import { open } from './fs';

declare module 'accept' {
declare module '@hapi/accept' {
// @types/accept does not include the `preferences` argument so we override the type to include it
export function encodings(encodingHeader?: string, preferences?: string[]): string[];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ async function removeLogFile() {
await asyncUnlink(logFilePath).catch(() => void 0);
}

describe('migration from 7.7.2-xpack with 100k objects', () => {
// FAILING on 7.13: https://github.com/elastic/kibana/issues/96895
describe.skip('migration from 7.7.2-xpack with 100k objects', () => {
let esServer: kbnTestServer.TestElasticsearchUtils;
let root: Root;
let coreStart: InternalCoreStart;
Expand Down
4 changes: 4 additions & 0 deletions src/plugins/dashboard/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ export {
} from './types';

export { migratePanelsTo730 } from './migrate_to_730_panels';

export const UI_SETTINGS = {
ENABLE_LABS_UI: 'labs:dashboard:enable_ui',
};
3 changes: 3 additions & 0 deletions src/plugins/dashboard/common/saved_dashboard_references.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ export function extractReferences(
}

const { panels, state } = dashboardAttributesToState(attributes);
if (!Array.isArray(panels)) {
return { attributes, references };
}

if (((panels as unknown) as Array<Record<string, string>>).some(isPre730Panel)) {
return pre730ExtractReferences({ attributes, references }, deps);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { CoreStart } from 'kibana/public';

import { coreMock, uiSettingsServiceMock } from '../../../../../core/public/mocks';
import { embeddablePluginMock } from 'src/plugins/embeddable/public/mocks';
import { getStubPluginServices } from '../../../../presentation_util/public';

import {
EmbeddableInput,
Expand Down Expand Up @@ -63,6 +64,7 @@ beforeEach(async () => {
uiActions: {} as any,
uiSettings: uiSettingsServiceMock.createStartContract(),
http: coreStart.http,
presentationUtil: getStubPluginServices(),
};

container = new DashboardContainer(getSampleDashboardInput(), containerOptions);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
CONTACT_CARD_EMBEDDABLE,
} from '../../services/embeddable_test_samples';
import { ErrorEmbeddable, IContainer, isErrorEmbeddable } from '../../services/embeddable';
import { getStubPluginServices } from '../../../../presentation_util/public';

const { setup, doStart } = embeddablePluginMock.createInstance();
setup.registerEmbeddableFactory(
Expand Down Expand Up @@ -53,6 +54,7 @@ beforeEach(async () => {
uiActions: {} as any,
uiSettings: uiSettingsServiceMock.createStartContract(),
http: coreStart.http,
presentationUtil: getStubPluginServices(),
};
const input = getSampleDashboardInput({
panels: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import { getSampleDashboardInput, getSampleDashboardPanel } from '../test_helper

import { embeddablePluginMock } from 'src/plugins/embeddable/public/mocks';
import { isErrorEmbeddable } from '../../services/embeddable';
import { getStubPluginServices } from '../../../../presentation_util/public';

import {
CONTACT_CARD_EMBEDDABLE,
ContactCardEmbeddableFactory,
Expand Down Expand Up @@ -45,6 +47,7 @@ beforeEach(async () => {
uiActions: {} as any,
uiSettings: uiSettingsServiceMock.createStartContract(),
http: coreMock.createStart().http,
presentationUtil: getStubPluginServices(),
};
const input = getSampleDashboardInput({
panels: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { embeddablePluginMock } from '../../../../embeddable/public/mocks';
import { DataPublicPluginStart } from '../../../../data/public/types';
import { dataPluginMock } from '../../../../data/public/mocks';
import { LINE_FEED_CHARACTER } from 'src/plugins/data/common/exports/export_csv';
import { getStubPluginServices } from '../../../../presentation_util/public';

describe('Export CSV action', () => {
const { setup, doStart } = embeddablePluginMock.createInstance();
Expand Down Expand Up @@ -59,6 +60,7 @@ describe('Export CSV action', () => {
uiActions: {} as any,
uiSettings: uiSettingsServiceMock.createStartContract(),
http: coreStart.http,
presentationUtil: getStubPluginServices(),
};
const input = getSampleDashboardInput({
panels: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
ContactCardEmbeddableOutput,
CONTACT_CARD_EMBEDDABLE,
} from '../../services/embeddable_test_samples';
import { getStubPluginServices } from '../../../../presentation_util/public';

const { setup, doStart } = embeddablePluginMock.createInstance();
setup.registerEmbeddableFactory(
Expand Down Expand Up @@ -60,6 +61,7 @@ beforeEach(async () => {
uiActions: {} as any,
uiSettings: uiSettingsServiceMock.createStartContract(),
http: coreStart.http,
presentationUtil: getStubPluginServices(),
};

container = new DashboardContainer(getSampleDashboardInput(), containerOptions);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
ContactCardEmbeddableOutput,
ContactCardEmbeddable,
} from '../../services/embeddable_test_samples';
import { getStubPluginServices } from '../../../../presentation_util/public';

describe('LibraryNotificationPopover', () => {
const { setup, doStart } = embeddablePluginMock.createInstance();
Expand Down Expand Up @@ -55,6 +56,7 @@ describe('LibraryNotificationPopover', () => {
uiActions: {} as any,
uiSettings: uiSettingsServiceMock.createStartContract(),
http: coreStart.http,
presentationUtil: getStubPluginServices(),
};

container = new DashboardContainer(getSampleDashboardInput(), containerOptions);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
ContactCardEmbeddableInput,
ContactCardEmbeddableOutput,
} from '../../services/embeddable_test_samples';
import { getStubPluginServices } from '../../../../presentation_util/public';

const { setup, doStart } = embeddablePluginMock.createInstance();
setup.registerEmbeddableFactory(
Expand All @@ -46,6 +47,7 @@ beforeEach(async () => {
uiActions: {} as any,
uiSettings: uiSettingsServiceMock.createStartContract(),
http: coreStart.http,
presentationUtil: getStubPluginServices(),
};
const input = getSampleDashboardInput({
panels: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
ContactCardEmbeddableOutput,
CONTACT_CARD_EMBEDDABLE,
} from '../../services/embeddable_test_samples';
import { getStubPluginServices } from '../../../../presentation_util/public';

const { setup, doStart } = embeddablePluginMock.createInstance();
setup.registerEmbeddableFactory(
Expand All @@ -55,6 +56,7 @@ beforeEach(async () => {
uiActions: {} as any,
uiSettings: uiSettingsServiceMock.createStartContract(),
http: coreStart.http,
presentationUtil: getStubPluginServices(),
};

container = new DashboardContainer(getSampleDashboardInput(), containerOptions);
Expand Down
Loading

0 comments on commit aff886e

Please sign in to comment.