Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grouped Kibana nav #53545

Merged
merged 42 commits into from
Jan 21, 2020
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
c187078
rendering something semi-functional
Dec 19, 2019
c8bbcee
improving nested nav support
Dec 20, 2019
fe54ec9
Merge remote-tracking branch 'upstream/master' into kibana-grouped-nav
Dec 20, 2019
8a82938
adding categories for more apps
Dec 20, 2019
897e11b
Merge remote-tracking branch 'upstream/master' into kibana-grouped-nav
Jan 7, 2020
05e5b5d
aligning on category enum
Jan 10, 2020
0eb1a91
Merge remote-tracking branch 'upstream/master' into kibana-grouped-nav
Jan 10, 2020
f425dbc
added advanced settings
Jan 10, 2020
3234902
add license check
Jan 10, 2020
5f04ed5
forcing tests to run with individual nav items
Jan 10, 2020
b5f53a3
cleaning up nits and typings
Jan 12, 2020
ea85827
regenerating core documentation
Jan 12, 2020
629d486
Merge remote-tracking branch 'upstream/master' into kibana-grouped-nav
Jan 12, 2020
c15de44
add category to timelion
Jan 12, 2020
6ad9d3e
test fixes
Jan 13, 2020
f34f763
regenerating core documentation
Jan 13, 2020
321e2f7
Merge remote-tracking branch 'upstream/master' into kibana-grouped-nav
Jan 13, 2020
23a51b6
working around EUI nav bug
Jan 13, 2020
3efdaf5
fix recently visited links
Jan 13, 2020
29585ec
PR feedback and test fixes
Jan 13, 2020
bed3650
undoing stack management rename in favor of group rename
Jan 13, 2020
356c5b0
fixing ML nav placement
Jan 13, 2020
7ebb397
pr revisions and test fixes
Jan 14, 2020
a21c249
Merge remote-tracking branch 'upstream/master' into kibana-grouped-nav
Jan 14, 2020
f666437
updating types and api docs
Jan 14, 2020
efbb04e
fixing tests
Jan 14, 2020
7f3576d
fixing more tests
Jan 14, 2020
cb3b947
fixing more tests
Jan 14, 2020
8b26d41
Merge remote-tracking branch 'upstream/master' into kibana-grouped-nav
Jan 14, 2020
b35266d
fixing the last, I hope, test
Jan 14, 2020
e18acbb
fixing the last test, I hope
Jan 14, 2020
c951a97
improving advanced setting
Jan 14, 2020
e542a03
PR feedback and first attempt at renaming management -> stack management
Jan 14, 2020
f8564f8
Merge remote-tracking branch 'upstream/master' into kibana-grouped-nav
Jan 14, 2020
3d80243
fixing tests
Jan 15, 2020
6bc77cf
Merge remote-tracking branch 'upstream/master' into kibana-grouped-nav
Jan 15, 2020
06a2663
refactoring header component to prep for writing tests
Jan 16, 2020
7cd30ee
i18n fix
Jan 16, 2020
3110e0a
adding tests to header component
Jan 17, 2020
181d384
Merge remote-tracking branch 'upstream/master' into kibana-grouped-nav
Jan 18, 2020
fe9f10d
fixing type error
Jan 18, 2020
9a16416
Merge branch 'master' into kibana-grouped-nav
elasticmachine Jan 21, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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-public](./kibana-plugin-public.md) &gt; [AppBase](./kibana-plugin-public.appbase.md) &gt; [category](./kibana-plugin-public.appbase.category.md)

## AppBase.category property

The category the app lives in

<b>Signature:</b>

```typescript
category?: AppCategory;
```
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export interface AppBase
| Property | Type | Description |
| --- | --- | --- |
| [capabilities](./kibana-plugin-public.appbase.capabilities.md) | <code>Partial&lt;Capabilities&gt;</code> | Custom capabilities defined by the app. |
| [category](./kibana-plugin-public.appbase.category.md) | <code>AppCategory</code> | The category the app lives in |
| [chromeless](./kibana-plugin-public.appbase.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. |
| [euiIconType](./kibana-plugin-public.appbase.euiicontype.md) | <code>string</code> | A EUI iconType that will be used for the app's icon. This icon takes precendence over the <code>icon</code> property. |
| [icon](./kibana-plugin-public.appbase.icon.md) | <code>string</code> | A URL to an image file used as an icon. Used as a fallback if <code>euiIconType</code> is not provided. |
Expand Down
22 changes: 22 additions & 0 deletions docs/development/core/public/kibana-plugin-public.appcategory.md
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; [AppCategory](./kibana-plugin-public.appcategory.md)

## AppCategory enum


<b>Signature:</b>

```typescript
export declare enum AppCategory
```

## Enumeration Members

| Member | Value | Description |
| --- | --- | --- |
| analyze | <code>0</code> | |
| management | <code>3</code> | |
| observability | <code>1</code> | |
| security | <code>2</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-public](./kibana-plugin-public.md) &gt; [ChromeNavLink](./kibana-plugin-public.chromenavlink.md) &gt; [category](./kibana-plugin-public.chromenavlink.category.md)

## ChromeNavLink.category property

The category the app lives in

<b>Signature:</b>

```typescript
readonly category?: AppCategory;
```
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export interface ChromeNavLink
| --- | --- | --- |
| [active](./kibana-plugin-public.chromenavlink.active.md) | <code>boolean</code> | Indicates whether or not this app is currently on the screen. |
| [baseUrl](./kibana-plugin-public.chromenavlink.baseurl.md) | <code>string</code> | The base route used to open the root of an application. |
| [category](./kibana-plugin-public.chromenavlink.category.md) | <code>AppCategory</code> | The category the app lives in |
| [disabled](./kibana-plugin-public.chromenavlink.disabled.md) | <code>boolean</code> | Disables a link from being clickable. |
| [euiIconType](./kibana-plugin-public.chromenavlink.euiicontype.md) | <code>string</code> | A EUI iconType that will be used for the app's icon. This icon takes precendence over the <code>icon</code> property. |
| [hidden](./kibana-plugin-public.chromenavlink.hidden.md) | <code>boolean</code> | Hides a link from the navigation. |
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-public](./kibana-plugin-public.md) &gt; [LegacyNavLink](./kibana-plugin-public.legacynavlink.md) &gt; [category](./kibana-plugin-public.legacynavlink.category.md)

## LegacyNavLink.category property

<b>Signature:</b>

```typescript
category?: AppCategory;
```
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export interface LegacyNavLink

| Property | Type | Description |
| --- | --- | --- |
| [category](./kibana-plugin-public.legacynavlink.category.md) | <code>AppCategory</code> | |
| [euiIconType](./kibana-plugin-public.legacynavlink.euiicontype.md) | <code>string</code> | |
| [icon](./kibana-plugin-public.legacynavlink.icon.md) | <code>string</code> | |
| [id](./kibana-plugin-public.legacynavlink.id.md) | <code>string</code> | |
Expand Down
303 changes: 152 additions & 151 deletions docs/development/core/public/kibana-plugin-public.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ returns `basePath` value, specific for an incoming request.
<b>Signature:</b>

```typescript
get: (request: KibanaRequest<unknown, unknown, unknown, any> | LegacyRequest) => string;
get: (request: LegacyRequest | KibanaRequest<unknown, unknown, unknown, any>) => string;
```
4 changes: 2 additions & 2 deletions docs/development/core/server/kibana-plugin-server.basepath.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ The constructor for this class is marked as internal. Third-party code should no

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [get](./kibana-plugin-server.basepath.get.md) | | <code>(request: KibanaRequest&lt;unknown, unknown, unknown, any&gt; &#124; LegacyRequest) =&gt; string</code> | returns <code>basePath</code> value, specific for an incoming request. |
| [get](./kibana-plugin-server.basepath.get.md) | | <code>(request: LegacyRequest &#124; KibanaRequest&lt;unknown, unknown, unknown, any&gt;) =&gt; string</code> | returns <code>basePath</code> value, specific for an incoming request. |
| [prepend](./kibana-plugin-server.basepath.prepend.md) | | <code>(path: string) =&gt; string</code> | Prepends <code>path</code> with the basePath. |
| [remove](./kibana-plugin-server.basepath.remove.md) | | <code>(path: string) =&gt; string</code> | Removes the prepended basePath from the <code>path</code>. |
| [serverBasePath](./kibana-plugin-server.basepath.serverbasepath.md) | | <code>string</code> | returns the server's basePath<!-- -->See [BasePath.get](./kibana-plugin-server.basepath.get.md) for getting the basePath value for a specific request |
| [set](./kibana-plugin-server.basepath.set.md) | | <code>(request: KibanaRequest&lt;unknown, unknown, unknown, any&gt; &#124; LegacyRequest, requestSpecificBasePath: string) =&gt; void</code> | sets <code>basePath</code> value, specific for an incoming request. |
| [set](./kibana-plugin-server.basepath.set.md) | | <code>(request: LegacyRequest &#124; KibanaRequest&lt;unknown, unknown, unknown, any&gt;, requestSpecificBasePath: string) =&gt; void</code> | sets <code>basePath</code> value, specific for an incoming request. |

Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ sets `basePath` value, specific for an incoming request.
<b>Signature:</b>

```typescript
set: (request: KibanaRequest<unknown, unknown, unknown, any> | LegacyRequest, requestSpecificBasePath: string) => void;
set: (request: LegacyRequest | KibanaRequest<unknown, unknown, unknown, any>, requestSpecificBasePath: string) => void;
```
6 changes: 6 additions & 0 deletions src/core/public/application/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { PluginOpaqueId } from '../plugins';
import { IUiSettingsClient } from '../ui_settings';
import { RecursiveReadonly } from '../../utils';
import { SavedObjectsStart } from '../saved_objects';
import { AppCategory } from '../';

/** @public */
export interface AppBase {
Expand All @@ -44,6 +45,11 @@ export interface AppBase {
*/
title: string;

/**
* The category the app lives in
*/
category?: AppCategory;
myasonik marked this conversation as resolved.
Show resolved Hide resolved

/**
* The initial status of the application.
* Defaulting to `accessible`
Expand Down
12 changes: 11 additions & 1 deletion src/core/public/chrome/chrome_service.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,15 @@ export class ChromeService {
);
}

const settings = injectedMetadata.getLegacyMetadata().uiSettings;

const navSetting =
settings?.user?.pageNavigation?.userValue || settings.defaults.pageNavigation.value;

const license = (injectedMetadata.getInjectedVars()?.xpackInitialInfo as {
license: { type: string };
})?.license?.type;
myasonik marked this conversation as resolved.
Show resolved Hide resolved

return {
navControls,
navLinks,
Expand All @@ -173,7 +182,6 @@ export class ChromeService {
getHeaderComponent: () => (
<React.Fragment>
<LoadingIndicator loadingCount$={http.getLoadingCount$()} />

<Header
application={application}
appTitle$={appTitle$.pipe(takeUntil(this.stop$))}
Expand All @@ -192,6 +200,8 @@ export class ChromeService {
recentlyAccessed$={recentlyAccessed.get$()}
navControlsLeft$={navControls.getLeft$()}
navControlsRight$={navControls.getRight$()}
navSetting={navSetting}
license={license}
/>
</React.Fragment>
),
Expand Down
6 changes: 6 additions & 0 deletions src/core/public/chrome/nav_links/nav_link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/

import { pick } from '../../../utils';
import { AppCategory } from '../../';

/**
* @public
Expand All @@ -33,6 +34,11 @@ export interface ChromeNavLink {
*/
readonly title: string;

/**
* The category the app lives in
*/
readonly category?: AppCategory;

/**
* The base route used to open the root of an application.
*/
Expand Down
Loading