Skip to content

Commit

Permalink
Merge branch 'master' into 43904_Add_Cleanup_Action_To_UI
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine committed Jan 11, 2020
2 parents 558ff5e + 51e51ca commit a8b21c7
Show file tree
Hide file tree
Showing 821 changed files with 25,603 additions and 7,528 deletions.
2 changes: 1 addition & 1 deletion .ci/Jenkinsfile_flaky
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def getWorkerMap(agentNumber, numberOfExecutions, worker, workerFailures, maxWor
def numberOfWorkers = Math.min(numberOfExecutions, maxWorkerProcesses)

for(def i = 1; i <= numberOfWorkers; i++) {
def workerExecutions = numberOfExecutions/numberOfWorkers + (i <= numberOfExecutions%numberOfWorkers ? 1 : 0)
def workerExecutions = floor(numberOfExecutions/numberOfWorkers + (i <= numberOfExecutions%numberOfWorkers ? 1 : 0))

workerMap["agent-${agentNumber}-worker-${i}"] = { workerNumber ->
for(def j = 0; j < workerExecutions; j++) {
Expand Down
30 changes: 2 additions & 28 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,31 +82,6 @@ module.exports = {
'react-hooks/exhaustive-deps': 'off',
},
},
{
files: ['src/legacy/core_plugins/kibana/**/*.{js,ts,tsx}'],
rules: {
'react-hooks/rules-of-hooks': 'off',
'react-hooks/exhaustive-deps': 'off',
},
},
{
files: ['src/legacy/core_plugins/tile_map/**/*.{js,ts,tsx}'],
rules: {
'react-hooks/exhaustive-deps': 'off',
},
},
{
files: ['src/legacy/core_plugins/vis_type_markdown/**/*.{js,ts,tsx}'],
rules: {
'react-hooks/exhaustive-deps': 'off',
},
},
{
files: ['src/legacy/core_plugins/vis_type_metric/**/*.{js,ts,tsx}'],
rules: {
'jsx-a11y/click-events-have-key-events': 'off',
},
},
{
files: ['src/legacy/core_plugins/vis_type_table/**/*.{js,ts,tsx}'],
rules: {
Expand Down Expand Up @@ -366,9 +341,8 @@ module.exports = {
'src/fixtures/**/*.js', // TODO: this directory needs to be more obviously "public" (or go away)
],
settings: {
// instructs import/no-extraneous-dependencies to treat modules
// in plugins/ or ui/ namespace as "core modules" so they don't
// trigger failures for not being listed in package.json
// instructs import/no-extraneous-dependencies to treat certain modules
// as core modules, even if they aren't listed in package.json
'import/core-modules': [
'plugins',
'legacy/ui',
Expand Down
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
/packages/kbn-es/ @elastic/kibana-operations
/packages/kbn-pm/ @elastic/kibana-operations
/packages/kbn-test/ @elastic/kibana-operations
/packages/kbn-ui-shared-deps/ @elastic/kibana-operations
/src/legacy/server/keystore/ @elastic/kibana-operations
/src/legacy/server/pid/ @elastic/kibana-operations
/src/legacy/server/sass/ @elastic/kibana-operations
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [AppLeaveAction](./kibana-plugin-public.appleaveaction.md)

## AppLeaveAction type

Possible actions to return from a [AppLeaveHandler](./kibana-plugin-public.appleavehandler.md)

See [AppLeaveConfirmAction](./kibana-plugin-public.appleaveconfirmaction.md) and [AppLeaveDefaultAction](./kibana-plugin-public.appleavedefaultaction.md)

<b>Signature:</b>

```typescript
export declare type AppLeaveAction = AppLeaveDefaultAction | AppLeaveConfirmAction;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [AppLeaveActionType](./kibana-plugin-public.appleaveactiontype.md)

## AppLeaveActionType enum

Possible type of actions on application leave.

<b>Signature:</b>

```typescript
export declare enum AppLeaveActionType
```

## Enumeration Members

| Member | Value | Description |
| --- | --- | --- |
| confirm | <code>&quot;confirm&quot;</code> | |
| default | <code>&quot;default&quot;</code> | |

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

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [AppLeaveConfirmAction](./kibana-plugin-public.appleaveconfirmaction.md)

## AppLeaveConfirmAction interface

Action to return from a [AppLeaveHandler](./kibana-plugin-public.appleavehandler.md) to show a confirmation message when trying to leave an application.

See

<b>Signature:</b>

```typescript
export interface AppLeaveConfirmAction
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [text](./kibana-plugin-public.appleaveconfirmaction.text.md) | <code>string</code> | |
| [title](./kibana-plugin-public.appleaveconfirmaction.title.md) | <code>string</code> | |
| [type](./kibana-plugin-public.appleaveconfirmaction.type.md) | <code>AppLeaveActionType.confirm</code> | |

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-public](./kibana-plugin-public.md) &gt; [AppLeaveConfirmAction](./kibana-plugin-public.appleaveconfirmaction.md) &gt; [text](./kibana-plugin-public.appleaveconfirmaction.text.md)

## AppLeaveConfirmAction.text property

<b>Signature:</b>

```typescript
text: string;
```
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-public](./kibana-plugin-public.md) &gt; [AppLeaveConfirmAction](./kibana-plugin-public.appleaveconfirmaction.md) &gt; [title](./kibana-plugin-public.appleaveconfirmaction.title.md)

## AppLeaveConfirmAction.title property

<b>Signature:</b>

```typescript
title?: string;
```
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-public](./kibana-plugin-public.md) &gt; [AppLeaveConfirmAction](./kibana-plugin-public.appleaveconfirmaction.md) &gt; [type](./kibana-plugin-public.appleaveconfirmaction.type.md)

## AppLeaveConfirmAction.type property

<b>Signature:</b>

```typescript
type: AppLeaveActionType.confirm;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [AppLeaveDefaultAction](./kibana-plugin-public.appleavedefaultaction.md)

## AppLeaveDefaultAction interface

Action to return from a [AppLeaveHandler](./kibana-plugin-public.appleavehandler.md) to execute the default behaviour when leaving the application.

See

<b>Signature:</b>

```typescript
export interface AppLeaveDefaultAction
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [type](./kibana-plugin-public.appleavedefaultaction.type.md) | <code>AppLeaveActionType.default</code> | |

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-public](./kibana-plugin-public.md) &gt; [AppLeaveDefaultAction](./kibana-plugin-public.appleavedefaultaction.md) &gt; [type](./kibana-plugin-public.appleavedefaultaction.type.md)

## AppLeaveDefaultAction.type property

<b>Signature:</b>

```typescript
type: AppLeaveActionType.default;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [AppLeaveHandler](./kibana-plugin-public.appleavehandler.md)

## AppLeaveHandler type

A handler that will be executed before leaving the application, either when going to another application or when closing the browser tab or manually changing the url. Should return `confirm` to to prompt a message to the user before leaving the page, or `default` to keep the default behavior (doing nothing).

See [AppMountParameters](./kibana-plugin-public.appmountparameters.md) for detailed usage examples.

<b>Signature:</b>

```typescript
export declare type AppLeaveHandler = (factory: AppLeaveActionFactory) => AppLeaveAction;
```
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ export interface ApplicationStart
| Method | Description |
| --- | --- |
| [getUrlForApp(appId, options)](./kibana-plugin-public.applicationstart.geturlforapp.md) | Returns a relative URL to a given app, including the global base path. |
| [navigateToApp(appId, options)](./kibana-plugin-public.applicationstart.navigatetoapp.md) | Navigiate to a given app |
| [navigateToApp(appId, options)](./kibana-plugin-public.applicationstart.navigatetoapp.md) | Navigate to a given app |
| [registerMountContext(contextName, provider)](./kibana-plugin-public.applicationstart.registermountcontext.md) | Register a context provider for application mounting. Will only be available to applications that depend on the plugin that registered this context. Deprecated, use [CoreSetup.getStartServices()](./kibana-plugin-public.coresetup.getstartservices.md)<!-- -->. |

Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

## ApplicationStart.navigateToApp() method

Navigiate to a given app
Navigate to a given app

<b>Signature:</b>

```typescript
navigateToApp(appId: string, options?: {
path?: string;
state?: any;
}): void;
}): Promise<void>;
```

## Parameters
Expand All @@ -24,5 +24,5 @@ navigateToApp(appId: string, options?: {

<b>Returns:</b>

`void`
`Promise<void>`

Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ export interface AppMountParameters
| --- | --- | --- |
| [appBasePath](./kibana-plugin-public.appmountparameters.appbasepath.md) | <code>string</code> | The route path for configuring navigation to the application. This string should not include the base path from HTTP. |
| [element](./kibana-plugin-public.appmountparameters.element.md) | <code>HTMLElement</code> | The container element to render the application into. |
| [onAppLeave](./kibana-plugin-public.appmountparameters.onappleave.md) | <code>(handler: AppLeaveHandler) =&gt; void</code> | A function that can be used to register a handler that will be called when the user is leaving the current application, allowing to prompt a confirmation message before actually changing the page.<!-- -->This will be called either when the user goes to another application, or when trying to close the tab or manually changing the url. |

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

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [AppMountParameters](./kibana-plugin-public.appmountparameters.md) &gt; [onAppLeave](./kibana-plugin-public.appmountparameters.onappleave.md)

## AppMountParameters.onAppLeave property

A function that can be used to register a handler that will be called when the user is leaving the current application, allowing to prompt a confirmation message before actually changing the page.

This will be called either when the user goes to another application, or when trying to close the tab or manually changing the url.

<b>Signature:</b>

```typescript
onAppLeave: (handler: AppLeaveHandler) => void;
```

## Example


```ts
// application.tsx
import React from 'react';
import ReactDOM from 'react-dom';
import { BrowserRouter, Route } from 'react-router-dom';

import { CoreStart, AppMountParams } from 'src/core/public';
import { MyPluginDepsStart } from './plugin';

export renderApp = ({ appBasePath, element, onAppLeave }: AppMountParams) => {
const { renderApp, hasUnsavedChanges } = await import('./application');
onAppLeave(actions => {
if(hasUnsavedChanges()) {
return actions.confirm('Some changes were not saved. Are you sure you want to leave?');
}
return actions.default();
});
return renderApp(params);
}

```

Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export interface ChromeNavLink
| [id](./kibana-plugin-public.chromenavlink.id.md) | <code>string</code> | A unique identifier for looking up links. |
| [linkToLastSubUrl](./kibana-plugin-public.chromenavlink.linktolastsuburl.md) | <code>boolean</code> | Whether or not the subUrl feature should be enabled. |
| [order](./kibana-plugin-public.chromenavlink.order.md) | <code>number</code> | An ordinal used to sort nav links relative to one another for display. |
| [subUrlBase](./kibana-plugin-public.chromenavlink.suburlbase.md) | <code>string</code> | A url base that legacy apps can set to match deep URLs to an applcation. |
| [subUrlBase](./kibana-plugin-public.chromenavlink.suburlbase.md) | <code>string</code> | A url base that legacy apps can set to match deep URLs to an application. |
| [title](./kibana-plugin-public.chromenavlink.title.md) | <code>string</code> | The title of the application. |
| [tooltip](./kibana-plugin-public.chromenavlink.tooltip.md) | <code>string</code> | A tooltip shown when hovering over an app link. |
| [url](./kibana-plugin-public.chromenavlink.url.md) | <code>string</code> | A url that legacy apps can set to deep link into their applications. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
>
>
A url base that legacy apps can set to match deep URLs to an applcation.
A url base that legacy apps can set to match deep URLs to an application.

<b>Signature:</b>

Expand Down
10 changes: 10 additions & 0 deletions docs/development/core/public/kibana-plugin-public.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,20 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [SimpleSavedObject](./kibana-plugin-public.simplesavedobject.md) | This class is a very simple wrapper for SavedObjects loaded from the server with the [SavedObjectsClient](./kibana-plugin-public.savedobjectsclient.md)<!-- -->.<!-- -->It provides basic functionality for creating/saving/deleting saved objects, but doesn't include any type-specific implementations. |
| [ToastsApi](./kibana-plugin-public.toastsapi.md) | Methods for adding and removing global toast messages. |

## Enumerations

| Enumeration | Description |
| --- | --- |
| [AppLeaveActionType](./kibana-plugin-public.appleaveactiontype.md) | Possible type of actions on application leave. |

## Interfaces

| Interface | Description |
| --- | --- |
| [App](./kibana-plugin-public.app.md) | Extension of [common app properties](./kibana-plugin-public.appbase.md) with the mount function. |
| [AppBase](./kibana-plugin-public.appbase.md) | |
| [AppLeaveConfirmAction](./kibana-plugin-public.appleaveconfirmaction.md) | Action to return from a [AppLeaveHandler](./kibana-plugin-public.appleavehandler.md) to show a confirmation message when trying to leave an application.<!-- -->See |
| [AppLeaveDefaultAction](./kibana-plugin-public.appleavedefaultaction.md) | Action to return from a [AppLeaveHandler](./kibana-plugin-public.appleavehandler.md) to execute the default behaviour when leaving the application.<!-- -->See |
| [ApplicationSetup](./kibana-plugin-public.applicationsetup.md) | |
| [ApplicationStart](./kibana-plugin-public.applicationstart.md) | |
| [AppMountContext](./kibana-plugin-public.appmountcontext.md) | The context object received when applications are mounted to the DOM. Deprecated, use [CoreSetup.getStartServices()](./kibana-plugin-public.coresetup.getstartservices.md)<!-- -->. |
Expand Down Expand Up @@ -105,6 +113,8 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->

| Type Alias | Description |
| --- | --- |
| [AppLeaveAction](./kibana-plugin-public.appleaveaction.md) | Possible actions to return from a [AppLeaveHandler](./kibana-plugin-public.appleavehandler.md)<!-- -->See [AppLeaveConfirmAction](./kibana-plugin-public.appleaveconfirmaction.md) and [AppLeaveDefaultAction](./kibana-plugin-public.appleavedefaultaction.md) |
| [AppLeaveHandler](./kibana-plugin-public.appleavehandler.md) | A handler that will be executed before leaving the application, either when going to another application or when closing the browser tab or manually changing the url. Should return <code>confirm</code> to to prompt a message to the user before leaving the page, or <code>default</code> to keep the default behavior (doing nothing).<!-- -->See [AppMountParameters](./kibana-plugin-public.appmountparameters.md) for detailed usage examples. |
| [AppMount](./kibana-plugin-public.appmount.md) | A mount function called when the user navigates to this app's route. |
| [AppMountDeprecated](./kibana-plugin-public.appmountdeprecated.md) | A mount function called when the user navigates to this app's route. |
| [AppUnmount](./kibana-plugin-public.appunmount.md) | A function called when an application should be unmounted from the page. This function should be synchronous. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export interface OverlayStart
| Property | Type | Description |
| --- | --- | --- |
| [banners](./kibana-plugin-public.overlaystart.banners.md) | <code>OverlayBannersStart</code> | [OverlayBannersStart](./kibana-plugin-public.overlaybannersstart.md) |
| [openConfirm](./kibana-plugin-public.overlaystart.openconfirm.md) | <code>OverlayModalStart['openConfirm']</code> | |
| [openFlyout](./kibana-plugin-public.overlaystart.openflyout.md) | <code>OverlayFlyoutStart['open']</code> | |
| [openModal](./kibana-plugin-public.overlaystart.openmodal.md) | <code>OverlayModalStart['open']</code> | |

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

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [OverlayStart](./kibana-plugin-public.overlaystart.md) &gt; [openConfirm](./kibana-plugin-public.overlaystart.openconfirm.md)

## OverlayStart.openConfirm property


<b>Signature:</b>

```typescript
openConfirm: OverlayModalStart['openConfirm'];
```
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## ICustomClusterClient type

Represents an Elasticsearch cluster API client created by a plugin.. It allows to call API on behalf of the internal Kibana user and the actual user that is derived from the request headers (via `asScoped(...)`<!-- -->).
Represents an Elasticsearch cluster API client created by a plugin. It allows to call API on behalf of the internal Kibana user and the actual user that is derived from the request headers (via `asScoped(...)`<!-- -->).

See [ClusterClient](./kibana-plugin-server.clusterclient.md)<!-- -->.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Set of helpers used to create `KibanaResponse` to form HTTP response on an incom

```typescript
kibanaResponseFactory: {
custom: <T extends string | Error | Record<string, any> | Buffer | Stream | {
custom: <T extends string | Error | Buffer | Stream | Record<string, any> | {
message: string | Error;
attributes?: Record<string, any> | undefined;
} | undefined>(options: CustomHttpResponseOptions<T>) => KibanaResponse<T>;
Expand All @@ -21,9 +21,9 @@ kibanaResponseFactory: {
conflict: (options?: ErrorHttpResponseOptions) => KibanaResponse<ResponseError>;
internalError: (options?: ErrorHttpResponseOptions) => KibanaResponse<ResponseError>;
customError: (options: CustomHttpResponseOptions<ResponseError>) => KibanaResponse<ResponseError>;
redirected: (options: RedirectResponseOptions) => KibanaResponse<string | Record<string, any> | Buffer | Stream>;
ok: (options?: HttpResponseOptions) => KibanaResponse<string | Record<string, any> | Buffer | Stream>;
accepted: (options?: HttpResponseOptions) => KibanaResponse<string | Record<string, any> | Buffer | Stream>;
redirected: (options: RedirectResponseOptions) => KibanaResponse<string | Buffer | Stream | Record<string, any>>;
ok: (options?: HttpResponseOptions) => KibanaResponse<string | Buffer | Stream | Record<string, any>>;
accepted: (options?: HttpResponseOptions) => KibanaResponse<string | Buffer | Stream | Record<string, any>>;
noContent: (options?: HttpResponseOptions) => KibanaResponse<undefined>;
}
```
Expand Down

0 comments on commit a8b21c7

Please sign in to comment.