Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into kbn-45291-applica…
Browse files Browse the repository at this point in the history
…tion-filter
  • Loading branch information
pgayvallet committed Jan 10, 2020
2 parents f488946 + c0d6b93 commit 815617b
Show file tree
Hide file tree
Showing 74 changed files with 2,512 additions and 956 deletions.
6 changes: 0 additions & 6 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,6 @@ module.exports = {
'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: {
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
Loading

0 comments on commit 815617b

Please sign in to comment.