Skip to content

Commit

Permalink
Merge branch 'master' into fix_ilm_navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine committed Nov 6, 2020
2 parents 0baccad + e378555 commit cc29641
Show file tree
Hide file tree
Showing 142 changed files with 2,955 additions and 759 deletions.
4 changes: 1 addition & 3 deletions docs/developer/plugin-list.asciidoc
Expand Up @@ -28,9 +28,7 @@ allowing users to configure their advanced settings, also known
as uiSettings within the code.
|{kib-repo}blob/{branch}/src/plugins/apm_oss[apmOss]
|WARNING: Missing README.
|{kib-repo}blob/{branch}/src/plugins/apm_oss/README.asciidoc[apmOss]
|{kib-repo}blob/{branch}/src/plugins/bfetch/README.md[bfetch]
|bfetch allows to batch HTTP requests and streams responses back.
Expand Down
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-embeddable-public](./kibana-plugin-plugins-embeddable-public.md) &gt; [Embeddable](./kibana-plugin-plugins-embeddable-public.embeddable.md) &gt; [fatalError](./kibana-plugin-plugins-embeddable-public.embeddable.fatalerror.md)

## Embeddable.fatalError property

<b>Signature:</b>

```typescript
fatalError?: Error;
```
Expand Up @@ -20,6 +20,7 @@ export declare abstract class Embeddable<TEmbeddableInput extends EmbeddableInpu
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [fatalError](./kibana-plugin-plugins-embeddable-public.embeddable.fatalerror.md) | | <code>Error</code> | |
| [id](./kibana-plugin-plugins-embeddable-public.embeddable.id.md) | | <code>string</code> | |
| [input](./kibana-plugin-plugins-embeddable-public.embeddable.input.md) | | <code>TEmbeddableInput</code> | |
| [isContainer](./kibana-plugin-plugins-embeddable-public.embeddable.iscontainer.md) | | <code>boolean</code> | |
Expand All @@ -43,6 +44,7 @@ export declare abstract class Embeddable<TEmbeddableInput extends EmbeddableInpu
| [getOutput$()](./kibana-plugin-plugins-embeddable-public.embeddable.getoutput_.md) | | |
| [getRoot()](./kibana-plugin-plugins-embeddable-public.embeddable.getroot.md) | | Returns the top most parent embeddable, or itself if this embeddable is not within a parent. |
| [getTitle()](./kibana-plugin-plugins-embeddable-public.embeddable.gettitle.md) | | |
| [onFatalError(e)](./kibana-plugin-plugins-embeddable-public.embeddable.onfatalerror.md) | | |
| [reload()](./kibana-plugin-plugins-embeddable-public.embeddable.reload.md) | | Reload will be called when there is a request to refresh the data or view, even if the input data did not change. |
| [render(el)](./kibana-plugin-plugins-embeddable-public.embeddable.render.md) | | |
| [supportedTriggers()](./kibana-plugin-plugins-embeddable-public.embeddable.supportedtriggers.md) | | |
Expand Down
@@ -0,0 +1,22 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-embeddable-public](./kibana-plugin-plugins-embeddable-public.md) &gt; [Embeddable](./kibana-plugin-plugins-embeddable-public.embeddable.md) &gt; [onFatalError](./kibana-plugin-plugins-embeddable-public.embeddable.onfatalerror.md)

## Embeddable.onFatalError() method

<b>Signature:</b>

```typescript
protected onFatalError(e: Error): void;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| e | <code>Error</code> | |

<b>Returns:</b>

`void`

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

[Home](./index.md) &gt; [kibana-plugin-plugins-embeddable-public](./kibana-plugin-plugins-embeddable-public.md) &gt; [IEmbeddable](./kibana-plugin-plugins-embeddable-public.iembeddable.md) &gt; [fatalError](./kibana-plugin-plugins-embeddable-public.iembeddable.fatalerror.md)

## IEmbeddable.fatalError property

If this embeddable has encountered a fatal error, that error will be stored here

<b>Signature:</b>

```typescript
fatalError?: Error;
```
Expand Up @@ -15,6 +15,7 @@ export interface IEmbeddable<I extends EmbeddableInput = EmbeddableInput, O exte
| Property | Type | Description |
| --- | --- | --- |
| [enhancements](./kibana-plugin-plugins-embeddable-public.iembeddable.enhancements.md) | <code>object</code> | Extra abilities added to Embeddable by <code>*_enhanced</code> plugins. |
| [fatalError](./kibana-plugin-plugins-embeddable-public.iembeddable.fatalerror.md) | <code>Error</code> | If this embeddable has encountered a fatal error, that error will be stored here |
| [id](./kibana-plugin-plugins-embeddable-public.iembeddable.id.md) | <code>string</code> | A unique identifier for this embeddable. Mainly only used by containers to map their Panel States to a child embeddable instance. |
| [isContainer](./kibana-plugin-plugins-embeddable-public.iembeddable.iscontainer.md) | <code>boolean</code> | Is this embeddable an instance of a Container class, can it contain nested embeddables? |
| [parent](./kibana-plugin-plugins-embeddable-public.iembeddable.parent.md) | <code>IContainer</code> | If this embeddable is nested inside a container, this will contain a reference to its parent. |
Expand Down
Binary file not shown.
83 changes: 19 additions & 64 deletions docs/management/managing-fields.asciidoc
@@ -1,70 +1,29 @@
[[managing-fields]]
== Index patterns and fields
== Field management

The *Index patterns* UI helps you create and manage
the index patterns that retrieve your data from {es}.
Whenever possible,
{kib} uses the same field type for display as {es}. However, a few field types
{es} supports are not available in {kib}. Use field formatters to customize how your
fields are displayed in Kibana, regardless of how they are stored in {es}.

[role="screenshot"]
image::images/management-index-patterns.png[]

[float]
=== Required permissions

The `Index Pattern Management` {kib} privilege is required to access the *Index patterns* UI.

To add the privilege, open the menu, then click *Stack Management > Roles*.

[float]
=== Create an index pattern

An index pattern is the glue that connects {kib} to your {es} data. Create an
index pattern whenever you load your own data into {kib}. To get started,
click *Create index pattern*, and then follow the guided steps. Refer to
<<index-patterns, Creating an index pattern>> for the types of index patterns
that you can create.

[float]
=== Manage your index pattern

To view the fields and associated data types in an index pattern, click its name in
the *Index patterns* overview.

[role="screenshot"]
image::management/index-patterns/images/new-index-pattern.png["Index files and data types"]

Use the icons to perform the following actions:
Kibana provides these field formatters:

* [[set-default-pattern]]*Set the default index pattern.* {kib} uses a badge to make users
aware of which index pattern is the default. The first pattern
you create is automatically designated as the default pattern. The default
index pattern is loaded when you open *Discover*.
* <<field-formatters-string, Strings>>
* <<field-formatters-date, Dates>>
* <<field-formatters-geopoint, Geopoints>>
* <<field-formatters-numeric, Numbers>>

* *Refresh the index fields list.* You can refresh the index fields list to
pick up any newly-added fields. Doing so also resets the {kib} popularity counters
for the fields. The popularity counters are used in *Discover* to sort fields in lists.
To format a field:

* [[delete-pattern]]*Delete the index pattern.* This action removes the pattern from the list of
Saved Objects in {kib}. You will not be able to recover field formatters,
scripted fields, source filters, and field popularity data associated with the index pattern.
Deleting an index pattern does
not remove any indices or data documents from {es}.
. Open the main menu, and click *Stack Management > Index Patterns*.
. Click the index pattern that contains the field you want to format.
. Find the field you want to format and click the edit icon (image:management/index-patterns/images/edit_icon.png[]).
. Select a format and fill in the details.
+
WARNING: Deleting an index pattern breaks all visualizations, saved searches, and
other saved objects that reference the pattern.

[float]
=== Edit a field

To edit a field's properties, click the edit icon
image:management/index-patterns/images/edit_icon.png[] in the detail view.
You can set the field's format and popularity value.
[role="screenshot"]
image:management/index-patterns/images/edit-field-format.png["Edit field format"]

Kibana has field formatters for the following field types:

* <<field-formatters-string, Strings>>
* <<field-formatters-date, Dates>>
* <<field-formatters-geopoint, Geopoints>>
* <<field-formatters-numeric, Numbers>>

[[field-formatters-string]]
=== String field formatters
Expand Down Expand Up @@ -121,12 +80,8 @@ WARNING: Computing data on the fly with scripted fields can be very resource int
{kib} performance. Keep in mind that there's no built-in validation of a scripted field. If your scripts are
buggy, you'll get exceptions whenever you try to view the dynamically generated data.

When you define a scripted field in {kib}, you have a choice of scripting languages. In 5.0 and later, the default
options are {ref}/modules-scripting-expression.html[Lucene expressions] and {ref}/modules-scripting-painless.html[Painless].
While you can use other scripting languages if you enable dynamic scripting for them in {es}, this is not recommended
because they cannot be sufficiently {ref}/modules-scripting-security.html[sandboxed].

WARNING: In 5.0 and later, Groovy, JavaScript, and Python scripting are deprecated and unsupported.
When you define a scripted field in {kib}, you have a choice of the {ref}/modules-scripting-expression.html[Lucene expressions] or the
{ref}/modules-scripting-painless.html[Painless] scripting language.

You can reference any single value numeric field in your expressions, for example:

Expand Down
2 changes: 1 addition & 1 deletion src/dev/build/tasks/os_packages/docker_generator/run.ts
Expand Up @@ -40,7 +40,7 @@ export async function runDockerGenerator(
ubi: boolean = false
) {
// UBI var config
const baseOSImage = ubi ? 'docker.elastic.co/ubi8/ubi-minimal:latest' : 'centos:8';
const baseOSImage = ubi ? 'docker.elastic.co/ubi8/ubi-minimal:8.2' : 'centos:8';
const ubiVersionTag = 'ubi8';
const ubiImageFlavor = ubi ? `-${ubiVersionTag}` : '';

Expand Down
5 changes: 5 additions & 0 deletions src/plugins/apm_oss/README.asciidoc
@@ -0,0 +1,5 @@
# APM OSS plugin

OSS plugin for APM. Includes index configuration and tutorial resources.

See <<../../x-pack/plugins/apm/readme.md,the X-Pack APM plugin README>> for information about the main APM plugin.
Expand Up @@ -35,7 +35,7 @@ import { coreMock } from '../../../../../core/public/mocks';
import { CoreStart } from 'kibana/public';
import { AddToLibraryAction } from '.';
import { embeddablePluginMock } from 'src/plugins/embeddable/public/mocks';
import { ViewMode } from '../../../../embeddable/public';
import { ErrorEmbeddable, ViewMode } from '../../../../embeddable/public';

const { setup, doStart } = embeddablePluginMock.createInstance();
setup.registerEmbeddableFactory(
Expand Down Expand Up @@ -86,6 +86,16 @@ beforeEach(async () => {
}
});

test('Add to library is incompatible with Error Embeddables', async () => {
const action = new AddToLibraryAction({ toasts: coreStart.notifications.toasts });
const errorEmbeddable = new ErrorEmbeddable(
'Wow what an awful error',
{ id: ' 404' },
embeddable.getRoot() as IContainer
);
expect(await action.isCompatible({ embeddable: errorEmbeddable })).toBe(false);
});

test('Add to library is compatible when embeddable on dashboard has value type input', async () => {
const action = new AddToLibraryAction({ toasts: coreStart.notifications.toasts });
embeddable.updateInput(await embeddable.getInputAsValueType());
Expand Down
Expand Up @@ -26,6 +26,7 @@ import {
PanelNotFoundError,
EmbeddableInput,
isReferenceOrValueEmbeddable,
isErrorEmbeddable,
} from '../../../../embeddable/public';
import { NotificationsStart } from '../../../../../core/public';
import { DashboardPanelState, DASHBOARD_CONTAINER_TYPE, DashboardContainer } from '..';
Expand Down Expand Up @@ -61,7 +62,8 @@ export class AddToLibraryAction implements ActionByType<typeof ACTION_ADD_TO_LIB

public async isCompatible({ embeddable }: AddToLibraryActionContext) {
return Boolean(
embeddable.getInput()?.viewMode !== ViewMode.VIEW &&
!isErrorEmbeddable(embeddable) &&
embeddable.getInput()?.viewMode !== ViewMode.VIEW &&
embeddable.getRoot() &&
embeddable.getRoot().isContainer &&
embeddable.getRoot().type === DASHBOARD_CONTAINER_TYPE &&
Expand Down
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import { isErrorEmbeddable, IContainer } from '../../embeddable_plugin';
import { isErrorEmbeddable, IContainer, ErrorEmbeddable } from '../../embeddable_plugin';
import { DashboardContainer, DashboardPanelState } from '../embeddable';
import { getSampleDashboardInput, getSampleDashboardPanel } from '../test_helpers';
import {
Expand Down Expand Up @@ -86,6 +86,16 @@ beforeEach(async () => {
}
});

test('Clone is incompatible with Error Embeddables', async () => {
const action = new ClonePanelAction(coreStart);
const errorEmbeddable = new ErrorEmbeddable(
'Wow what an awful error',
{ id: ' 404' },
embeddable.getRoot() as IContainer
);
expect(await action.isCompatible({ embeddable: errorEmbeddable })).toBe(false);
});

test('Clone adds a new embeddable', async () => {
const dashboard = embeddable.getRoot() as IContainer;
const originalPanelCount = Object.keys(dashboard.getInput().panels).length;
Expand Down
Expand Up @@ -28,6 +28,7 @@ import {
PanelNotFoundError,
EmbeddableInput,
SavedObjectEmbeddableInput,
isErrorEmbeddable,
} from '../../../../embeddable/public';
import {
placePanelBeside,
Expand Down Expand Up @@ -66,7 +67,8 @@ export class ClonePanelAction implements ActionByType<typeof ACTION_CLONE_PANEL>

public async isCompatible({ embeddable }: ClonePanelActionContext) {
return Boolean(
embeddable.getInput()?.viewMode !== ViewMode.VIEW &&
!isErrorEmbeddable(embeddable) &&
embeddable.getInput()?.viewMode !== ViewMode.VIEW &&
embeddable.getRoot() &&
embeddable.getRoot().isContainer &&
embeddable.getRoot().type === DASHBOARD_CONTAINER_TYPE
Expand Down
Expand Up @@ -30,7 +30,7 @@ import { coreMock } from '../../../../../core/public/mocks';
import { CoreStart } from 'kibana/public';
import { LibraryNotificationAction, UnlinkFromLibraryAction } from '.';
import { embeddablePluginMock } from 'src/plugins/embeddable/public/mocks';
import { ViewMode } from '../../../../embeddable/public';
import { ErrorEmbeddable, IContainer, ViewMode } from '../../../../embeddable/public';

const { setup, doStart } = embeddablePluginMock.createInstance();
setup.registerEmbeddableFactory(
Expand Down Expand Up @@ -87,6 +87,16 @@ beforeEach(async () => {
embeddable.updateInput({ viewMode: ViewMode.EDIT });
});

test('Notification is incompatible with Error Embeddables', async () => {
const action = new LibraryNotificationAction(unlinkAction);
const errorEmbeddable = new ErrorEmbeddable(
'Wow what an awful error',
{ id: ' 404' },
embeddable.getRoot() as IContainer
);
expect(await action.isCompatible({ embeddable: errorEmbeddable })).toBe(false);
});

test('Notification is shown when embeddable on dashboard has reference type input', async () => {
const action = new LibraryNotificationAction(unlinkAction);
embeddable.updateInput(await embeddable.getInputAsRefType());
Expand Down
Expand Up @@ -19,7 +19,12 @@

import { i18n } from '@kbn/i18n';
import React from 'react';
import { IEmbeddable, ViewMode, isReferenceOrValueEmbeddable } from '../../embeddable_plugin';
import {
IEmbeddable,
ViewMode,
isReferenceOrValueEmbeddable,
isErrorEmbeddable,
} from '../../embeddable_plugin';
import { ActionByType, IncompatibleActionError } from '../../ui_actions_plugin';
import { reactToUiComponent } from '../../../../kibana_react/public';
import { UnlinkFromLibraryAction } from '.';
Expand Down Expand Up @@ -79,6 +84,7 @@ export class LibraryNotificationAction implements ActionByType<typeof ACTION_LIB

public isCompatible = async ({ embeddable }: LibraryNotificationActionContext) => {
return (
!isErrorEmbeddable(embeddable) &&
embeddable.getRoot().isContainer &&
embeddable.getInput()?.viewMode !== ViewMode.VIEW &&
isReferenceOrValueEmbeddable(embeddable) &&
Expand Down
Expand Up @@ -30,7 +30,11 @@ import { coreMock } from '../../../../../core/public/mocks';
import { CoreStart } from 'kibana/public';
import { UnlinkFromLibraryAction } from '.';
import { embeddablePluginMock } from 'src/plugins/embeddable/public/mocks';
import { ViewMode, SavedObjectEmbeddableInput } from '../../../../embeddable/public';
import {
ViewMode,
SavedObjectEmbeddableInput,
ErrorEmbeddable,
} from '../../../../embeddable/public';

const { setup, doStart } = embeddablePluginMock.createInstance();
setup.registerEmbeddableFactory(
Expand Down Expand Up @@ -80,6 +84,16 @@ beforeEach(async () => {
embeddable.updateInput({ viewMode: ViewMode.EDIT });
});

test('Unlink is incompatible with Error Embeddables', async () => {
const action = new UnlinkFromLibraryAction({ toasts: coreStart.notifications.toasts });
const errorEmbeddable = new ErrorEmbeddable(
'Wow what an awful error',
{ id: ' 404' },
embeddable.getRoot() as IContainer
);
expect(await action.isCompatible({ embeddable: errorEmbeddable })).toBe(false);
});

test('Unlink is compatible when embeddable on dashboard has reference type input', async () => {
const action = new UnlinkFromLibraryAction({ toasts: coreStart.notifications.toasts });
embeddable.updateInput(await embeddable.getInputAsRefType());
Expand Down
Expand Up @@ -26,6 +26,7 @@ import {
PanelNotFoundError,
EmbeddableInput,
isReferenceOrValueEmbeddable,
isErrorEmbeddable,
} from '../../../../embeddable/public';
import { NotificationsStart } from '../../../../../core/public';
import { DashboardPanelState, DASHBOARD_CONTAINER_TYPE, DashboardContainer } from '..';
Expand Down Expand Up @@ -61,7 +62,8 @@ export class UnlinkFromLibraryAction implements ActionByType<typeof ACTION_UNLIN

public async isCompatible({ embeddable }: UnlinkFromLibraryActionContext) {
return Boolean(
embeddable.getInput()?.viewMode !== ViewMode.VIEW &&
!isErrorEmbeddable(embeddable) &&
embeddable.getInput()?.viewMode !== ViewMode.VIEW &&
embeddable.getRoot() &&
embeddable.getRoot().isContainer &&
embeddable.getRoot().type === DASHBOARD_CONTAINER_TYPE &&
Expand Down

0 comments on commit cc29641

Please sign in to comment.