Skip to content

Commit

Permalink
Merge branch 'master' into flyout-overflow-button
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Aug 15, 2021
2 parents ddc2565 + 2e68ce1 commit e26cbf8
Show file tree
Hide file tree
Showing 740 changed files with 18,592 additions and 7,995 deletions.
6 changes: 3 additions & 3 deletions WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# Fetch Node.js rules
http_archive(
name = "build_bazel_rules_nodejs",
sha256 = "8f5f192ba02319254aaf2cdcca00ec12eaafeb979a80a1e946773c520ae0a2c9",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/3.7.0/rules_nodejs-3.7.0.tar.gz"],
sha256 = "e79c08a488cc5ac40981987d862c7320cee8741122a2649e9b08e850b6f20442",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/3.8.0/rules_nodejs-3.8.0.tar.gz"],
)

# Now that we have the rules let's import from them to complete the work
load("@build_bazel_rules_nodejs//:index.bzl", "check_rules_nodejs_version", "node_repositories", "yarn_install")

# Assure we have at least a given rules_nodejs version
check_rules_nodejs_version(minimum_version_string = "3.7.0")
check_rules_nodejs_version(minimum_version_string = "3.8.0")

# Setup the Node.js toolchain for the architectures we want to support
#
Expand Down
Binary file added dev_docs/assets/data_view_diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions dev_docs/key_concepts/data_views.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
id: kibDataViewsKeyConcepts
slug: /kibana-dev-docs/data-view-intro
title: Data Views
summary: Data views are the central method of defining queryable data sets in Kibana
date: 2021-08-11
tags: ['kibana','dev', 'contributor', 'api docs']
---

*Note: Kibana index patterns are currently being renamed to data views. There will be some naming inconsistencies until the transition is complete.*

Data views (formerly Kibana index patterns or KIPs) are the central method of describing sets of indices for queries. Usage is strongly recommended
as a number of high level <DocLink id="kibBuildingBlocks" text="building blocks"/> rely on them. Further, they provide a consistent view of data across
a variety Kibana apps.

Data views are defined by a wildcard string (an index pattern) which matches indices, data streams, and index aliases, optionally specify a
timestamp field for time series data, and are stored as a <DocLink id="kibDevDocsSavedObjectsIntro"
text="saved object"/>. They have a field list which comprises all the fields in matching indices plus fields defined specifically
on the data view via runtime fields. Schema-on-read functionality is provided by data view defined runtime fields.

![image](../assets/data_view_diagram.png)



The data view API is made available via the data plugin (`data.indexPatterns`, soon to be renamed) and most commonly used with <DocLink id="kibDevTutorialDataSearchAndSessions" section="high-level-search" text="SearchSource" />
(`data.search.search.SearchSource`) to perform queries. SearchSource will apply existing filters and queries from the search bar UI.

Users can create data views via [Data view management](https://www.elastic.co/guide/en/kibana/current/index-patterns.html).
Additionally, they can be created through the data view API.

Data views also allow formatters and custom labels to be defined for fields.

86 changes: 86 additions & 0 deletions dev_docs/tutorials/data_views.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
---
id: kibDevTutorialDataViews
slug: /kibana-dev-docs/tutorials/data-views
title: Data views API
summary: Data views API
date: 2021-08-11
tags: ['kibana', 'onboarding', 'dev', 'architecture']
---

*Note: Kibana index patterns are currently being renamed to data views. There will be some naming inconsistencies until the transition is complete.*

### Data views API

- Get list of data views
- Get default data view and examine fields
- Get data view by id
- Find data view by title
- Create data view
- Create data view and save it
- Modify data view and save it
- Delete data view

#### Get list of data view titles and ids

```
const idsAndTitles = await data.indexPatterns.getIdsWithTitle();
idsAndTitles.forEach(({id, title}) => console.log(`Data view id: ${id} title: ${title}`));
```

#### Get default data view and examine fields

```
const defaultDataView = await data.indexPatterns.getDefault();
defaultDataView.fields.forEach(({name}) => { console.log(name); })
```

#### Get data view by id

```
const id = 'xxxxxx-xxx-xxxxxx';
const dataView = await data.indexPatterns.get(id);
```

#### Find data view by title

```
const title = 'kibana-*';
const [dataView] = await data.indexPatterns.find(title);
```

#### Create data view

```
const dataView = await data.indexPatterns.create({ title: 'kibana-*' });
```

#### Create data view and save it immediately

```
const dataView = await data.indexPatterns.createAndSave({ title: 'kibana-*' });
```

#### Create data view, modify, and save

```
const dataView = await data.indexPatterns.create({ title: 'kibana-*' });
dataView.setFieldCustomLabel('customer_name', 'Customer Name');
data.indexPatterns.createSavedObject(dataView);
```

#### Modify data view and save it

```
dataView.setFieldCustomLabel('customer_name', 'Customer Name');
await data.indexPatterns.updateSavedObject(dataView);
```

#### Delete index pattern

```
await data.indexPatterns.delete(dataViewId);
```

### Data view HTTP API

Rest-like HTTP CRUD+ API - [docs](https://www.elastic.co/guide/en/kibana/master/index-patterns-api.html)
2 changes: 2 additions & 0 deletions docs/apm/agent-configuration.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ For this reason, it is still essential to set custom default configurations loca
==== APM Server setup

This feature requires {apm-server-ref}/setup-kibana-endpoint.html[Kibana endpoint configuration] in APM Server.
In addition, if an APM agent is using {apm-server-ref}/configuration-anonymous.html[anonymous authentication] to communicate with the APM Server,
the agent's service name must be included in the `apm-server.auth.anonymous.allow_service` list.

APM Server acts as a proxy between the agents and Kibana.
Kibana communicates any changed settings to APM Server so that your agents only need to poll APM Server to determine which settings have changed.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [OverlayFlyoutOpenOptions](./kibana-plugin-core-public.overlayflyoutopenoptions.md) &gt; ["aria-label"](./kibana-plugin-core-public.overlayflyoutopenoptions._aria-label_.md)

## OverlayFlyoutOpenOptions."aria-label" property

<b>Signature:</b>

```typescript
'aria-label'?: string;
```
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ export interface OverlayFlyoutOpenOptions

| Property | Type | Description |
| --- | --- | --- |
| ["aria-label"](./kibana-plugin-core-public.overlayflyoutopenoptions._aria-label_.md) | <code>string</code> | |
| ["data-test-subj"](./kibana-plugin-core-public.overlayflyoutopenoptions._data-test-subj_.md) | <code>string</code> | |
| [className](./kibana-plugin-core-public.overlayflyoutopenoptions.classname.md) | <code>string</code> | |
| [closeButtonAriaLabel](./kibana-plugin-core-public.overlayflyoutopenoptions.closebuttonarialabel.md) | <code>string</code> | |
| [hideCloseButton](./kibana-plugin-core-public.overlayflyoutopenoptions.hideclosebutton.md) | <code>boolean</code> | |
| [maxWidth](./kibana-plugin-core-public.overlayflyoutopenoptions.maxwidth.md) | <code>boolean &#124; number &#124; string</code> | |
| [onClose](./kibana-plugin-core-public.overlayflyoutopenoptions.onclose.md) | <code>(flyout: OverlayRef) =&gt; void</code> | EuiFlyout onClose handler. If provided the consumer is responsible for calling flyout.close() to close the flyout; |
| [ownFocus](./kibana-plugin-core-public.overlayflyoutopenoptions.ownfocus.md) | <code>boolean</code> | |
| [size](./kibana-plugin-core-public.overlayflyoutopenoptions.size.md) | <code>EuiFlyoutSize</code> | |

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [OverlayFlyoutOpenOptions](./kibana-plugin-core-public.overlayflyoutopenoptions.md) &gt; [onClose](./kibana-plugin-core-public.overlayflyoutopenoptions.onclose.md)

## OverlayFlyoutOpenOptions.onClose property

EuiFlyout onClose handler. If provided the consumer is responsible for calling flyout.close() to close the flyout;

<b>Signature:</b>

```typescript
onClose?: (flyout: OverlayRef) => void;
```
Binary file added docs/maps/images/app_gis_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 12 additions & 11 deletions docs/maps/maps-getting-started.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ refer to <<xpack-security-authorization,Granting access to {kib}>>.
. Open the main menu, and then click *Dashboard*.
. Click **Create dashboard**.
. Set the time range to *Last 7 days*.
. Click **Create panel**.
. Click **Maps**.
. Click the **Create new Maps** icon image:maps/images/app_gis_icon.png[]

[float]
[[maps-add-choropleth-layer]]
Expand All @@ -62,14 +61,15 @@ and lighter shades will symbolize countries with less traffic.

. Add a Tooltip field:

** Select **ISO 3166-1 alpha-2 code** and **name**.
** Click **Add**.
** **ISO 3166-1 alpha-2 code** is added by default.
** Click **+ Add** to open field select.
** Select **name** and click *Add*.

. In **Layer style**, set:
. In **Layer style**:

** **Fill color: As number** to the grey color ramp
** **Border color** to white
** **Label** to symbol label
** Set **Fill color: As number** to the grey color ramp.
** Set **Border color** to white.
** Under **Label**, change **By value** to **Fixed**.

. Click **Save & close**.
+
Expand Down Expand Up @@ -135,9 +135,10 @@ grids with less bytes transferred.
** **Name** to `Total Requests and Bytes`
** **Visibility** to the range [0, 9]
** **Opacity** to 100%
. In **Metrics**, use:
** **Agregation** set to **Count**, and
** **Aggregation** set to **Sum** with **Field** set to **bytes**
. In **Metrics**:
** Set **Agregation** to **Count**.
** Click **Add metric**.
** Set **Aggregation** to **Sum** with **Field** set to **bytes**.
. In **Layer style**, change **Symbol size**:
** Set the field select to *sum bytes*.
** Set the min size to 7 and the max size to 25 px.
Expand Down
2 changes: 2 additions & 0 deletions docs/maps/vector-layer.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ To add a vector layer to your map, click *Add layer*, then select one of the fol
*Clusters and grids*:: Geospatial data grouped in grids with metrics for each gridded cell.
The index must contain at least one field mapped as {ref}/geo-point.html[geo_point] or {ref}/geo-shape.html[geo_shape].

*Create index*:: Draw shapes on the map and index in Elasticsearch.

*Documents*:: Points, lines, and polyons from Elasticsearch.
The index must contain at least one field mapped as {ref}/geo-point.html[geo_point] or {ref}/geo-shape.html[geo_shape].
+
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@
"re-resizable": "^6.1.1",
"re2": "^1.15.4",
"react": "^16.12.0",
"react-ace": "^5.9.0",
"react-ace": "^7.0.5",
"react-beautiful-dnd": "^13.0.0",
"react-color": "^2.13.8",
"react-dom": "^16.12.0",
Expand Down Expand Up @@ -446,7 +446,7 @@
"@babel/traverse": "^7.12.12",
"@babel/types": "^7.12.12",
"@bazel/ibazel": "^0.15.10",
"@bazel/typescript": "^3.7.0",
"@bazel/typescript": "^3.8.0",
"@cypress/snapshot": "^2.1.7",
"@cypress/webpack-preprocessor": "^5.6.0",
"@elastic/eslint-config-kibana": "link:bazel-bin/packages/elastic-eslint-config-kibana",
Expand Down
3 changes: 3 additions & 0 deletions packages/kbn-es-archiver/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["@kbn/babel-preset/node_preset"]
}
25 changes: 19 additions & 6 deletions packages/kbn-es-archiver/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")
load("//src/dev/bazel:index.bzl", "jsts_transpiler")

PKG_BASE_NAME = "kbn-es-archiver"
PKG_REQUIRE_NAME = "@kbn/es-archiver"
Expand Down Expand Up @@ -27,7 +28,7 @@ NPM_MODULE_EXTRA_FILES = [
"package.json",
]

SRC_DEPS = [
RUNTIME_DEPS = [
"//packages/kbn-dev-utils",
"//packages/kbn-test",
"//packages/kbn-utils",
Expand All @@ -43,6 +44,13 @@ SRC_DEPS = [
]

TYPES_DEPS = [
"//packages/kbn-dev-utils",
"//packages/kbn-test",
"//packages/kbn-utils",
"@npm//@elastic/elasticsearch",
"@npm//aggregate-error",
"@npm//globby",
"@npm//zlib",
"@npm//@types/bluebird",
"@npm//@types/chance",
"@npm//@types/jest",
Expand All @@ -52,7 +60,11 @@ TYPES_DEPS = [
"@npm//@types/sinon",
]

DEPS = SRC_DEPS + TYPES_DEPS
jsts_transpiler(
name = "target_node",
srcs = SRCS,
build_pkg_name = package_name(),
)

ts_config(
name = "tsconfig",
Expand All @@ -64,13 +76,14 @@ ts_config(
)

ts_project(
name = "tsc",
name = "tsc_types",
args = ['--pretty'],
srcs = SRCS,
deps = DEPS,
deps = TYPES_DEPS,
declaration = True,
declaration_map = True,
out_dir = "target",
emit_declaration_only = True,
out_dir = "target_types",
source_map = True,
root_dir = "src",
tsconfig = ":tsconfig",
Expand All @@ -79,7 +92,7 @@ ts_project(
js_library(
name = PKG_BASE_NAME,
srcs = NPM_MODULE_EXTRA_FILES,
deps = DEPS + [":tsc"],
deps = RUNTIME_DEPS + [":target_node", ":tsc_types"],
package_name = PKG_REQUIRE_NAME,
visibility = ["//visibility:public"],
)
Expand Down
4 changes: 2 additions & 2 deletions packages/kbn-es-archiver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"version": "1.0.0",
"license": "SSPL-1.0 OR Elastic License 2.0",
"private": "true",
"main": "target/index.js",
"types": "target/index.d.ts",
"main": "target_node/index.js",
"types": "target_types/index.d.ts",
"kibana": {
"devOnly": true
}
Expand Down
3 changes: 2 additions & 1 deletion packages/kbn-es-archiver/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"extends": "../../tsconfig.bazel.json",
"compilerOptions": {
"outDir": "./target/types",
"declaration": true,
"declarationMap": true,
"emitDeclarationOnly": true,
"outDir": "./target_types",
"sourceMap": true,
"sourceRoot": "../../../../packages/kbn-es-archiver/src",
"types": [
Expand Down
3 changes: 3 additions & 0 deletions packages/kbn-io-ts-utils/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["@kbn/babel-preset/node_preset"]
}
Loading

0 comments on commit e26cbf8

Please sign in to comment.