Skip to content

Commit cdbf4ff

Browse files
legregojportnerelasticmachine
authored
[7.x] Grouped features for space management (#74151) (#77925)
* Grouped features for space management * Apply suggestions from code review Co-authored-by: Joe Portner <5295965+jportner@users.noreply.github.com> * Address PR Feedback * docs changes * updating types/docs * update APM feature name * Reintroduce extraAction following EUI update * change ordering of infra features, and render callout for management category Co-authored-by: Joe Portner <5295965+jportner@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Joe Portner <5295965+jportner@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
1 parent 91d0a3b commit cdbf4ff

File tree

70 files changed

+965
-313
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+965
-313
lines changed

docs/developer/architecture/security/feature-registration.asciidoc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ Registering a feature consists of the following fields. For more information, co
3838
|`"Sample Feature"`
3939
|A human readable name for your feature.
4040

41+
|`category` (required)
42+
|{kib-repo}blob/{branch}/src/core/types/app_category.ts[`AppCategory`]
43+
|`DEFAULT_APP_CATEGORIES.kibana`
44+
|The `AppCategory` which best represents your feature. Used to organize the display
45+
of features within the management screens.
46+
4147
|`app` (required)
4248
|`string[]`
4349
|`["sample_app", "kibana"]`
@@ -96,6 +102,7 @@ public setup(core, { features }) {
96102
name: 'Canvas',
97103
icon: 'canvasApp',
98104
navLinkId: 'canvas',
105+
category: DEFAULT_APP_CATEGORIES.kibana,
99106
app: ['canvas', 'kibana'],
100107
catalogue: ['canvas'],
101108
privileges: {
@@ -155,6 +162,7 @@ public setup(core, { features }) {
155162
}),
156163
icon: 'devToolsApp',
157164
navLinkId: 'dev_tools',
165+
category: DEFAULT_APP_CATEGORIES.management,
158166
app: ['kibana'],
159167
catalogue: ['console', 'searchprofiler', 'grokdebugger'],
160168
privileges: {
@@ -217,6 +225,7 @@ public setup(core, { features }) {
217225
order: 100,
218226
icon: 'discoverApp',
219227
navLinkId: 'discover',
228+
category: DEFAULT_APP_CATEGORIES.kibana,
220229
app: ['kibana'],
221230
catalogue: ['discover'],
222231
privileges: {
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [AppCategory](./kibana-plugin-core-server.appcategory.md) &gt; [ariaLabel](./kibana-plugin-core-server.appcategory.arialabel.md)
4+
5+
## AppCategory.ariaLabel property
6+
7+
If the visual label isn't appropriate for screen readers, can override it here
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
ariaLabel?: string;
13+
```
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [AppCategory](./kibana-plugin-core-server.appcategory.md) &gt; [euiIconType](./kibana-plugin-core-server.appcategory.euiicontype.md)
4+
5+
## AppCategory.euiIconType property
6+
7+
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
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
euiIconType?: string;
13+
```
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [AppCategory](./kibana-plugin-core-server.appcategory.md) &gt; [id](./kibana-plugin-core-server.appcategory.id.md)
4+
5+
## AppCategory.id property
6+
7+
Unique identifier for the categories
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
id: string;
13+
```
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [AppCategory](./kibana-plugin-core-server.appcategory.md) &gt; [label](./kibana-plugin-core-server.appcategory.label.md)
4+
5+
## AppCategory.label property
6+
7+
Label used for category name. Also used as aria-label if one isn't set.
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
label: string;
13+
```
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [AppCategory](./kibana-plugin-core-server.appcategory.md)
4+
5+
## AppCategory interface
6+
7+
A category definition for nav links to know where to sort them in the left hand nav
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
export interface AppCategory
13+
```
14+
15+
## Properties
16+
17+
| Property | Type | Description |
18+
| --- | --- | --- |
19+
| [ariaLabel](./kibana-plugin-core-server.appcategory.arialabel.md) | <code>string</code> | If the visual label isn't appropriate for screen readers, can override it here |
20+
| [euiIconType](./kibana-plugin-core-server.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 |
21+
| [id](./kibana-plugin-core-server.appcategory.id.md) | <code>string</code> | Unique identifier for the categories |
22+
| [label](./kibana-plugin-core-server.appcategory.label.md) | <code>string</code> | Label used for category name. Also used as aria-label if one isn't set. |
23+
| [order](./kibana-plugin-core-server.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) |
24+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [AppCategory](./kibana-plugin-core-server.appcategory.md) &gt; [order](./kibana-plugin-core-server.appcategory.order.md)
4+
5+
## AppCategory.order property
6+
7+
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)
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
order?: number;
13+
```

docs/development/core/server/kibana-plugin-core-server.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
5050

5151
| Interface | Description |
5252
| --- | --- |
53+
| [AppCategory](./kibana-plugin-core-server.appcategory.md) | A category definition for nav links to know where to sort them in the left hand nav |
5354
| [AssistanceAPIResponse](./kibana-plugin-core-server.assistanceapiresponse.md) | |
5455
| [AssistantAPIClientParams](./kibana-plugin-core-server.assistantapiclientparams.md) | |
5556
| [AuditableEvent](./kibana-plugin-core-server.auditableevent.md) | Event to audit. |

examples/alerting_example/server/plugin.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import { Plugin, CoreSetup } from 'kibana/server';
2121
import { i18n } from '@kbn/i18n';
22+
import { DEFAULT_APP_CATEGORIES } from '../../../src/core/server';
2223
import { PluginSetupContract as AlertingSetup } from '../../../x-pack/plugins/alerts/server';
2324
import { PluginSetupContract as FeaturesPluginSetup } from '../../../x-pack/plugins/features/server';
2425

@@ -47,6 +48,7 @@ export class AlertingExamplePlugin implements Plugin<void, void, AlertingExample
4748
management: {
4849
insightsAndAlerting: ['triggersActions'],
4950
},
51+
category: DEFAULT_APP_CATEGORIES.management,
5052
alerting: [alwaysFiringAlert.id, peopleInSpaceAlert.id, INDEX_THRESHOLD_ID],
5153
privileges: {
5254
all: {

src/core/public/chrome/ui/header/__snapshots__/collapsible_nav.test.tsx.snap

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)