mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[Security][Features] Adds subtext option to Kibana feature and sub-feature controls (#147709)
## Summary - [x] Allow plugins to configure a description subtext underneath kibana features - [x] Allow plugins to configure a description subtext underneath kibana subfeatures - [x] Adjusts subfeature form UI so privilege buttons have fullwidth, adjusts padding/margins - [x] Adds unit tests # Screen Shots <img width="752" alt="image" src="https://user-images.githubusercontent.com/56409205/211621510-83769516-4a04-4442-8d96-92f5b6708a45.png"> Privilege button group before  Privilege button group after <img width="666" alt="image" src="https://user-images.githubusercontent.com/56409205/211621622-36b7a388-f1f5-4cb4-810d-48adbf7f0155.png"> Example to test: 1. In `x-pack/plugins/security_solution/server/features.ts` before `privilegeGroups` on line 254, add `description: 'some subfeature description here'` and before `management` on line 551, add `description: 'some feature description here'`. 3. Stack Management > Roles > edit Kibana Privileges > Security > Security see descriptions show up underneath Security and underneath Endpoint List sub feature
This commit is contained in:
parent
83a1904491
commit
28ba652c3d
13 changed files with 257 additions and 31 deletions
|
@ -32,6 +32,11 @@ export interface KibanaFeatureConfig {
|
|||
*/
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* An optional description that will appear as subtext underneath the feature name
|
||||
*/
|
||||
description?: string;
|
||||
|
||||
/**
|
||||
* The category for this feature.
|
||||
* This will be used to organize the list of features for display within the
|
||||
|
@ -156,6 +161,10 @@ export class KibanaFeature {
|
|||
return this.config.name;
|
||||
}
|
||||
|
||||
public get description() {
|
||||
return this.config.description;
|
||||
}
|
||||
|
||||
public get order() {
|
||||
return this.config.order;
|
||||
}
|
||||
|
|
|
@ -29,6 +29,11 @@ export interface SubFeatureConfig {
|
|||
|
||||
/** Collection of privilege groups */
|
||||
privilegeGroups: readonly SubFeaturePrivilegeGroupConfig[];
|
||||
|
||||
/**
|
||||
* An optional description that will appear as subtext underneath the sub-feature name
|
||||
*/
|
||||
description?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -105,6 +110,10 @@ export class SubFeature {
|
|||
return this.config.requireAllSpaces ?? false;
|
||||
}
|
||||
|
||||
public get description() {
|
||||
return this.config.description || '';
|
||||
}
|
||||
|
||||
public toRaw() {
|
||||
return { ...this.config };
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue