Skip to content

Commit

Permalink
Merge branch 'main' into kbn-107678-fail-start-on-unknown-so-types
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine committed Nov 12, 2021
2 parents 55f00b5 + 7fea493 commit 112e95a
Show file tree
Hide file tree
Showing 872 changed files with 8,752 additions and 5,656 deletions.
12 changes: 12 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,18 @@
# Observability Shared
/x-pack/plugins/observability/ @elastic/observability-ui

# Unified Observability
/x-pack/plugins/observability/public/pages/overview @elastic/unified-observability
/x-pack/plugins/observability/public/pages/home @elastic/unified-observability
/x-pack/plugins/observability/public/pages/landing @elastic/unified-observability
/x-pack/plugins/observability/public/context @elastic/unified-observability

# Actionable Observability
/x-pack/plugins/observability/common/rules @elastic/actionable-observability
/x-pack/plugins/observability/public/rules @elastic/actionable-observability
/x-pack/plugins/observability/public/pages/alerts @elastic/actionable-observability
/x-pack/plugins/observability/public/pages/cases @elastic/actionable-observability

# Infra Monitoring
/x-pack/plugins/infra/ @elastic/infra-monitoring-ui
/x-pack/test/functional/apps/infra @elastic/infra-monitoring-ui
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,5 @@ core.application.register({
],
mount: () => { ... }
})

```

Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,5 @@ core.application.register({

// '[basePath]/app/my_app' will be matched
// '[basePath]/app/my_app/some/path' will not be matched

```

31 changes: 16 additions & 15 deletions docs/development/core/public/kibana-plugin-core-public.app.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,25 @@
```typescript
export interface App<HistoryLocationState = unknown> extends AppNavOptions
```
<b>Extends:</b> AppNavOptions
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [appRoute](./kibana-plugin-core-public.app.approute.md) | <code>string</code> | Override the application's routing path from <code>/app/${id}</code>. Must be unique across registered applications. Should not include the base path from HTTP. |
| [capabilities](./kibana-plugin-core-public.app.capabilities.md) | <code>Partial&lt;Capabilities&gt;</code> | Custom capabilities defined by the app. |
| [category](./kibana-plugin-core-public.app.category.md) | <code>AppCategory</code> | The category definition of the product See [AppCategory](./kibana-plugin-core-public.appcategory.md) See DEFAULT\_APP\_CATEGORIES for more reference |
| [chromeless](./kibana-plugin-core-public.app.chromeless.md) | <code>boolean</code> | Hide the UI chrome when the application is mounted. Defaults to <code>false</code>. Takes precedence over chrome service visibility settings. |
| [deepLinks](./kibana-plugin-core-public.app.deeplinks.md) | <code>AppDeepLink[]</code> | Input type for registering secondary in-app locations for an application.<!-- -->Deep links must include at least one of <code>path</code> or <code>deepLinks</code>. A deep link that does not have a <code>path</code> represents a topological level in the application's hierarchy, but does not have a destination URL that is user-accessible. |
| [defaultPath](./kibana-plugin-core-public.app.defaultpath.md) | <code>string</code> | Allow to define the default path a user should be directed to when navigating to the app. When defined, this value will be used as a default for the <code>path</code> option when calling [navigateToApp](./kibana-plugin-core-public.applicationstart.navigatetoapp.md)<!-- -->\`<!-- -->, and will also be appended to the [application navLink](./kibana-plugin-core-public.chromenavlink.md) in the navigation bar. |
| [exactRoute](./kibana-plugin-core-public.app.exactroute.md) | <code>boolean</code> | If set to true, the application's route will only be checked against an exact match. Defaults to <code>false</code>. |
| [id](./kibana-plugin-core-public.app.id.md) | <code>string</code> | The unique identifier of the application |
| [keywords](./kibana-plugin-core-public.app.keywords.md) | <code>string[]</code> | Optional keywords to match with in deep links search. Omit if this part of the hierarchy does not have a page URL. |
| [mount](./kibana-plugin-core-public.app.mount.md) | <code>AppMount&lt;HistoryLocationState&gt;</code> | A mount function called when the user navigates to this app's route. |
| [navLinkStatus](./kibana-plugin-core-public.app.navlinkstatus.md) | <code>AppNavLinkStatus</code> | The initial status of the application's navLink. Defaulting to <code>visible</code> if <code>status</code> is <code>accessible</code> and <code>hidden</code> if status is <code>inaccessible</code> See [AppNavLinkStatus](./kibana-plugin-core-public.appnavlinkstatus.md) |
| [searchable](./kibana-plugin-core-public.app.searchable.md) | <code>boolean</code> | The initial flag to determine if the application is searchable in the global search. Defaulting to <code>true</code> if <code>navLinkStatus</code> is <code>visible</code> or omitted. |
| [status](./kibana-plugin-core-public.app.status.md) | <code>AppStatus</code> | The initial status of the application. Defaulting to <code>accessible</code> |
| [title](./kibana-plugin-core-public.app.title.md) | <code>string</code> | The title of the application. |
| [updater$](./kibana-plugin-core-public.app.updater_.md) | <code>Observable&lt;AppUpdater&gt;</code> | An [AppUpdater](./kibana-plugin-core-public.appupdater.md) observable that can be used to update the application [AppUpdatableFields](./kibana-plugin-core-public.appupdatablefields.md) at runtime. |
| [appRoute?](./kibana-plugin-core-public.app.approute.md) | string | <i>(Optional)</i> Override the application's routing path from <code>/app/${id}</code>. Must be unique across registered applications. Should not include the base path from HTTP. |
| [capabilities?](./kibana-plugin-core-public.app.capabilities.md) | Partial&lt;Capabilities&gt; | <i>(Optional)</i> Custom capabilities defined by the app. |
| [category?](./kibana-plugin-core-public.app.category.md) | AppCategory | <i>(Optional)</i> The category definition of the product See [AppCategory](./kibana-plugin-core-public.appcategory.md) See DEFAULT\_APP\_CATEGORIES for more reference |
| [chromeless?](./kibana-plugin-core-public.app.chromeless.md) | boolean | <i>(Optional)</i> Hide the UI chrome when the application is mounted. Defaults to <code>false</code>. Takes precedence over chrome service visibility settings. |
| [deepLinks?](./kibana-plugin-core-public.app.deeplinks.md) | AppDeepLink\[\] | <i>(Optional)</i> Input type for registering secondary in-app locations for an application.<!-- -->Deep links must include at least one of <code>path</code> or <code>deepLinks</code>. A deep link that does not have a <code>path</code> represents a topological level in the application's hierarchy, but does not have a destination URL that is user-accessible. |
| [defaultPath?](./kibana-plugin-core-public.app.defaultpath.md) | string | <i>(Optional)</i> Allow to define the default path a user should be directed to when navigating to the app. When defined, this value will be used as a default for the <code>path</code> option when calling [navigateToApp](./kibana-plugin-core-public.applicationstart.navigatetoapp.md)<!-- -->\`<!-- -->, and will also be appended to the [application navLink](./kibana-plugin-core-public.chromenavlink.md) in the navigation bar. |
| [exactRoute?](./kibana-plugin-core-public.app.exactroute.md) | boolean | <i>(Optional)</i> If set to true, the application's route will only be checked against an exact match. Defaults to <code>false</code>. |
| [id](./kibana-plugin-core-public.app.id.md) | string | The unique identifier of the application |
| [keywords?](./kibana-plugin-core-public.app.keywords.md) | string\[\] | <i>(Optional)</i> Optional keywords to match with in deep links search. Omit if this part of the hierarchy does not have a page URL. |
| [mount](./kibana-plugin-core-public.app.mount.md) | AppMount&lt;HistoryLocationState&gt; | A mount function called when the user navigates to this app's route. |
| [navLinkStatus?](./kibana-plugin-core-public.app.navlinkstatus.md) | AppNavLinkStatus | <i>(Optional)</i> The initial status of the application's navLink. Defaulting to <code>visible</code> if <code>status</code> is <code>accessible</code> and <code>hidden</code> if status is <code>inaccessible</code> See [AppNavLinkStatus](./kibana-plugin-core-public.appnavlinkstatus.md) |
| [searchable?](./kibana-plugin-core-public.app.searchable.md) | boolean | <i>(Optional)</i> The initial flag to determine if the application is searchable in the global search. Defaulting to <code>true</code> if <code>navLinkStatus</code> is <code>visible</code> or omitted. |
| [status?](./kibana-plugin-core-public.app.status.md) | AppStatus | <i>(Optional)</i> The initial status of the application. Defaulting to <code>accessible</code> |
| [title](./kibana-plugin-core-public.app.title.md) | string | The title of the application. |
| [updater$?](./kibana-plugin-core-public.app.updater_.md) | Observable&lt;AppUpdater&gt; | <i>(Optional)</i> An [AppUpdater](./kibana-plugin-core-public.appupdater.md) observable that can be used to update the application [AppUpdatableFields](./kibana-plugin-core-public.appupdatablefields.md) at runtime. |
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,5 @@ export class MyPlugin implements Plugin {
navLinkStatus: AppNavLinkStatus.disabled,
})
}

```
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ export interface AppCategory

| Property | Type | Description |
| --- | --- | --- |
| [ariaLabel](./kibana-plugin-core-public.appcategory.arialabel.md) | <code>string</code> | If the visual label isn't appropriate for screen readers, can override it here |
| [euiIconType](./kibana-plugin-core-public.appcategory.euiicontype.md) | <code>string</code> | Define an icon to be used for the category If the category is only 1 item, and no icon is defined, will default to the product icon Defaults to initials if no icon is defined |
| [id](./kibana-plugin-core-public.appcategory.id.md) | <code>string</code> | Unique identifier for the categories |
| [label](./kibana-plugin-core-public.appcategory.label.md) | <code>string</code> | Label used for category name. Also used as aria-label if one isn't set. |
| [order](./kibana-plugin-core-public.appcategory.order.md) | <code>number</code> | The order that categories will be sorted in Prefer large steps between categories to allow for further editing (Default categories are in steps of 1000) |
| [ariaLabel?](./kibana-plugin-core-public.appcategory.arialabel.md) | string | <i>(Optional)</i> If the visual label isn't appropriate for screen readers, can override it here |
| [euiIconType?](./kibana-plugin-core-public.appcategory.euiicontype.md) | string | <i>(Optional)</i> Define an icon to be used for the category If the category is only 1 item, and no icon is defined, will default to the product icon Defaults to initials if no icon is defined |
| [id](./kibana-plugin-core-public.appcategory.id.md) | string | Unique identifier for the categories |
| [label](./kibana-plugin-core-public.appcategory.label.md) | string | Label used for category name. Also used as aria-label if one isn't set. |
| [order?](./kibana-plugin-core-public.appcategory.order.md) | number | <i>(Optional)</i> The order that categories will be sorted in Prefer large steps between categories to allow for further editing (Default categories are in steps of 1000) |

Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ export interface AppLeaveConfirmAction

| Property | Type | Description |
| --- | --- | --- |
| [callback](./kibana-plugin-core-public.appleaveconfirmaction.callback.md) | <code>() =&gt; void</code> | |
| [text](./kibana-plugin-core-public.appleaveconfirmaction.text.md) | <code>string</code> | |
| [title](./kibana-plugin-core-public.appleaveconfirmaction.title.md) | <code>string</code> | |
| [type](./kibana-plugin-core-public.appleaveconfirmaction.type.md) | <code>AppLeaveActionType.confirm</code> | |
| [callback?](./kibana-plugin-core-public.appleaveconfirmaction.callback.md) | () =&gt; void | <i>(Optional)</i> |
| [text](./kibana-plugin-core-public.appleaveconfirmaction.text.md) | string | |
| [title?](./kibana-plugin-core-public.appleaveconfirmaction.title.md) | string | <i>(Optional)</i> |
| [type](./kibana-plugin-core-public.appleaveconfirmaction.type.md) | AppLeaveActionType.confirm | |

Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ export interface AppLeaveDefaultAction

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

Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ register<HistoryLocationState = unknown>(app: App<HistoryLocationState>): void;
| Parameter | Type | Description |
| --- | --- | --- |
| app | <code>App&lt;HistoryLocationState&gt;</code> | an [App](./kibana-plugin-core-public.app.md) |
| app | App&lt;HistoryLocationState&gt; | an [App](./kibana-plugin-core-public.app.md) |
<b>Returns:</b>
`void`
void
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ registerAppUpdater(appUpdater$: Observable<AppUpdater>): void;

| Parameter | Type | Description |
| --- | --- | --- |
| appUpdater$ | <code>Observable&lt;AppUpdater&gt;</code> | |
| appUpdater$ | Observable&lt;AppUpdater&gt; | |

<b>Returns:</b>

`void`
void

## Example

Expand All @@ -42,6 +42,5 @@ export class MyPlugin implements Plugin {
);
}
}

```

Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ getUrlForApp(appId: string, options?: {

| Parameter | Type | Description |
| --- | --- | --- |
| appId | <code>string</code> | |
| options | <code>{</code><br/><code> path?: string;</code><br/><code> absolute?: boolean;</code><br/><code> deepLinkId?: string;</code><br/><code> }</code> | |
| appId | string | |
| options | { path?: string; absolute?: boolean; deepLinkId?: string; } | |

<b>Returns:</b>

`string`
string

Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ export interface ApplicationStart

| Property | Type | Description |
| --- | --- | --- |
| [applications$](./kibana-plugin-core-public.applicationstart.applications_.md) | <code>Observable&lt;ReadonlyMap&lt;string, PublicAppInfo&gt;&gt;</code> | Observable emitting the list of currently registered apps and their associated status. |
| [capabilities](./kibana-plugin-core-public.applicationstart.capabilities.md) | <code>RecursiveReadonly&lt;Capabilities&gt;</code> | Gets the read-only capabilities. |
| [currentAppId$](./kibana-plugin-core-public.applicationstart.currentappid_.md) | <code>Observable&lt;string &#124; undefined&gt;</code> | An observable that emits the current application id and each subsequent id update. |
| [applications$](./kibana-plugin-core-public.applicationstart.applications_.md) | Observable&lt;ReadonlyMap&lt;string, PublicAppInfo&gt;&gt; | Observable emitting the list of currently registered apps and their associated status. |
| [capabilities](./kibana-plugin-core-public.applicationstart.capabilities.md) | RecursiveReadonly&lt;Capabilities&gt; | Gets the read-only capabilities. |
| [currentAppId$](./kibana-plugin-core-public.applicationstart.currentappid_.md) | Observable&lt;string \| undefined&gt; | An observable that emits the current application id and each subsequent id update. |

## Methods

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ navigateToApp(appId: string, options?: NavigateToAppOptions): Promise<void>;

| Parameter | Type | Description |
| --- | --- | --- |
| appId | <code>string</code> | |
| options | <code>NavigateToAppOptions</code> | navigation options |
| appId | string | |
| options | NavigateToAppOptions | navigation options |

<b>Returns:</b>

`Promise<void>`
Promise&lt;void&gt;

Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ navigateToUrl(url: string): Promise<void>;

| Parameter | Type | Description |
| --- | --- | --- |
| url | <code>string</code> | an absolute URL, an absolute path or a relative path, to navigate to. |
| url | string | an absolute URL, an absolute path or a relative path, to navigate to. |

<b>Returns:</b>

`Promise<void>`
Promise&lt;void&gt;

## Example

Expand All @@ -45,6 +45,5 @@ application.navigateToUrl('/app/discover/some-path') // does not include the cur
application.navigateToUrl('/base-path/s/my-space/app/unknown-app/some-path') // unknown application
application.navigateToUrl('../discover') // resolve to `/base-path/s/my-space/discover` which is not a path of a known app.
application.navigateToUrl('../../other-space/discover') // resolve to `/base-path/s/other-space/discover` which is not within the current basePath.

```

Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export class MyPlugin implements Plugin {
});
}
}

```

```ts
Expand All @@ -58,6 +57,5 @@ export renderApp = ({ appBasePath, element }: AppMountParameters) => {

return () => ReactDOM.unmountComponentAtNode(element);
}

```

Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export class MyPlugin implements Plugin {
});
}
}

```

```ts
Expand All @@ -52,6 +51,5 @@ export renderApp = ({ element, history }: AppMountParameters) => {

return () => ReactDOM.unmountComponentAtNode(element);
}

```

Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ export interface AppMountParameters<HistoryLocationState = unknown>

| Property | Type | Description |
| --- | --- | --- |
| [appBasePath](./kibana-plugin-core-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-core-public.appmountparameters.element.md) | <code>HTMLElement</code> | The container element to render the application into. |
| [history](./kibana-plugin-core-public.appmountparameters.history.md) | <code>ScopedHistory&lt;HistoryLocationState&gt;</code> | A scoped history instance for your application. Should be used to wire up your applications Router. |
| [onAppLeave](./kibana-plugin-core-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. |
| [setHeaderActionMenu](./kibana-plugin-core-public.appmountparameters.setheaderactionmenu.md) | <code>(menuMount: MountPoint &#124; undefined) =&gt; void</code> | A function that can be used to set the mount point used to populate the application action container in the chrome header.<!-- -->Calling the handler multiple time will erase the current content of the action menu with the mount from the latest call. Calling the handler with <code>undefined</code> will unmount the current mount point. Calling the handler after the application has been unmounted will have no effect. |
| [appBasePath](./kibana-plugin-core-public.appmountparameters.appbasepath.md) | string | The route path for configuring navigation to the application. This string should not include the base path from HTTP. |
| [element](./kibana-plugin-core-public.appmountparameters.element.md) | HTMLElement | The container element to render the application into. |
| [history](./kibana-plugin-core-public.appmountparameters.history.md) | ScopedHistory&lt;HistoryLocationState&gt; | A scoped history instance for your application. Should be used to wire up your applications Router. |
| [onAppLeave](./kibana-plugin-core-public.appmountparameters.onappleave.md) | (handler: AppLeaveHandler) =&gt; void | 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. |
| [setHeaderActionMenu](./kibana-plugin-core-public.appmountparameters.setheaderactionmenu.md) | (menuMount: MountPoint \| undefined) =&gt; void | A function that can be used to set the mount point used to populate the application action container in the chrome header.<!-- -->Calling the handler multiple time will erase the current content of the action menu with the mount from the latest call. Calling the handler with <code>undefined</code> will unmount the current mount point. Calling the handler after the application has been unmounted will have no effect. |

Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,5 @@ export renderApp = ({ element, history, onAppLeave }: AppMountParameters) => {
});
return renderApp({ element, history });
}

```

Loading

0 comments on commit 112e95a

Please sign in to comment.