From bf0f8bbb42c9c1149eb65448573133445aa921ef Mon Sep 17 00:00:00 2001 From: Larry Gregory Date: Tue, 20 Oct 2020 12:53:43 -0400 Subject: [PATCH] Cleanup feature registration (#80909) --- docs/api/features.asciidoc | 8 ----- .../security/feature-registration.asciidoc | 15 ---------- x-pack/plugins/actions/server/feature.ts | 2 -- x-pack/plugins/apm/server/feature.ts | 2 -- x-pack/plugins/canvas/server/plugin.ts | 2 -- .../enterprise_search/server/plugin.ts | 1 - .../plugins/features/common/kibana_feature.ts | 30 ++++--------------- .../feature_registry.test.ts.snap | 6 ---- .../features/server/feature_registry.test.ts | 18 +---------- .../plugins/features/server/feature_schema.ts | 12 ++++---- .../plugins/features/server/oss_features.ts | 13 -------- .../features/server/routes/index.test.ts | 2 +- .../plugins/features/server/routes/index.ts | 7 ++--- .../ui_capabilities_for_features.test.ts | 7 ----- x-pack/plugins/graph/server/plugin.ts | 4 +-- x-pack/plugins/infra/server/features.ts | 4 --- .../plugins/ingest_manager/server/plugin.ts | 2 -- x-pack/plugins/maps/server/plugin.ts | 2 -- x-pack/plugins/ml/server/plugin.ts | 4 +-- x-pack/plugins/monitoring/server/plugin.ts | 2 -- .../roles/__fixtures__/kibana_features.ts | 2 -- .../roles/edit_role/edit_role_page.test.tsx | 2 -- .../simple_privilege_section.test.tsx | 1 - .../disable_ui_capabilities.test.ts | 7 ----- .../authorization/disable_ui_capabilities.ts | 1 - .../privileges/privileges.test.ts | 24 --------------- .../security_solution/server/plugin.ts | 2 -- .../enabled_features.test.tsx.snap | 2 -- .../enabled_features.test.tsx | 3 -- .../edit_space/manage_space_page.test.tsx | 1 - .../spaces_grid/spaces_grid_pages.test.tsx | 1 - .../capabilities_switcher.test.ts | 3 -- x-pack/plugins/stack_alerts/server/feature.ts | 1 - x-pack/plugins/uptime/server/kibana.index.ts | 2 -- .../plugins/foo_plugin/server/index.ts | 2 -- 35 files changed, 19 insertions(+), 178 deletions(-) diff --git a/docs/api/features.asciidoc b/docs/api/features.asciidoc index 57a87ff6342f9..dad3ef75c8117 100644 --- a/docs/api/features.asciidoc +++ b/docs/api/features.asciidoc @@ -28,8 +28,6 @@ The API returns the following: { "id": "discover", "name": "Discover", - "icon": "discoverApp", - "navLinkId": "discover", "app": [ "kibana" ], @@ -73,8 +71,6 @@ The API returns the following: { "id": "visualize", "name": "Visualize", - "icon": "visualizeApp", - "navLinkId": "visualize", "app": [ "kibana" ], @@ -120,8 +116,6 @@ The API returns the following: { "id": "dashboard", "name": "Dashboard", - "icon": "dashboardApp", - "navLinkId": "dashboards", "app": [ "kibana" ], @@ -172,8 +166,6 @@ The API returns the following: { "id": "dev_tools", "name": "Dev Tools", - "icon": "devToolsApp", - "navLinkId": "dev_tools", "app": [ "kibana" ], diff --git a/docs/developer/architecture/security/feature-registration.asciidoc b/docs/developer/architecture/security/feature-registration.asciidoc index b27e457940d93..8c80c2e5f2ffb 100644 --- a/docs/developer/architecture/security/feature-registration.asciidoc +++ b/docs/developer/architecture/security/feature-registration.asciidoc @@ -59,15 +59,6 @@ of features within the management screens. |See <> |The set of subfeatures that enables finer access control than the `all` and `read` feature privileges. These options are only available in the Gold subscription level and higher. -|`icon` -|`string` -|"discoverApp" -|An https://elastic.github.io/eui/#/display/icons[EUI Icon] to use for this feature. - -|`navLinkId` -|`string` -|"sample_app" -|The ID of the navigation link associated with your feature. |=== ==== Privilege definition @@ -100,8 +91,6 @@ public setup(core, { features }) { features.registerKibanaFeature({ id: 'canvas', name: 'Canvas', - icon: 'canvasApp', - navLinkId: 'canvas', category: DEFAULT_APP_CATEGORIES.kibana, app: ['canvas', 'kibana'], catalogue: ['canvas'], @@ -160,8 +149,6 @@ public setup(core, { features }) { name: i18n.translate('xpack.features.devToolsFeatureName', { defaultMessage: 'Dev Tools', }), - icon: 'devToolsApp', - navLinkId: 'dev_tools', category: DEFAULT_APP_CATEGORIES.management, app: ['kibana'], catalogue: ['console', 'searchprofiler', 'grokdebugger'], @@ -223,8 +210,6 @@ public setup(core, { features }) { defaultMessage: 'Discover', }), order: 100, - icon: 'discoverApp', - navLinkId: 'discover', category: DEFAULT_APP_CATEGORIES.kibana, app: ['kibana'], catalogue: ['discover'], diff --git a/x-pack/plugins/actions/server/feature.ts b/x-pack/plugins/actions/server/feature.ts index 225f2761bad42..3ec824f955e72 100644 --- a/x-pack/plugins/actions/server/feature.ts +++ b/x-pack/plugins/actions/server/feature.ts @@ -13,8 +13,6 @@ export const ACTIONS_FEATURE = { name: i18n.translate('xpack.actions.featureRegistry.actionsFeatureName', { defaultMessage: 'Actions and Connectors', }), - icon: 'bell', - navLinkId: 'actions', category: DEFAULT_APP_CATEGORIES.management, app: [], management: { diff --git a/x-pack/plugins/apm/server/feature.ts b/x-pack/plugins/apm/server/feature.ts index d597b65040ce6..9eba18d44ad50 100644 --- a/x-pack/plugins/apm/server/feature.ts +++ b/x-pack/plugins/apm/server/feature.ts @@ -20,8 +20,6 @@ export const APM_FEATURE = { }), order: 900, category: DEFAULT_APP_CATEGORIES.observability, - icon: 'apmApp', - navLinkId: 'apm', app: ['apm', 'ux', 'kibana'], catalogue: ['apm'], management: { diff --git a/x-pack/plugins/canvas/server/plugin.ts b/x-pack/plugins/canvas/server/plugin.ts index ac5392c9d3dee..02499eae7eb67 100644 --- a/x-pack/plugins/canvas/server/plugin.ts +++ b/x-pack/plugins/canvas/server/plugin.ts @@ -43,8 +43,6 @@ export class CanvasPlugin implements Plugin { name: 'Canvas', order: 300, category: DEFAULT_APP_CATEGORIES.kibana, - icon: 'canvasApp', - navLinkId: 'canvas', app: ['canvas', 'kibana'], catalogue: ['canvas'], privileges: { diff --git a/x-pack/plugins/enterprise_search/server/plugin.ts b/x-pack/plugins/enterprise_search/server/plugin.ts index 43b0be8a5b438..4b1040de52f66 100644 --- a/x-pack/plugins/enterprise_search/server/plugin.ts +++ b/x-pack/plugins/enterprise_search/server/plugin.ts @@ -85,7 +85,6 @@ export class EnterpriseSearchPlugin implements Plugin { name: ENTERPRISE_SEARCH_PLUGIN.NAME, order: 0, category: DEFAULT_APP_CATEGORIES.enterpriseSearch, - icon: 'logoEnterpriseSearch', app: [ 'kibana', ENTERPRISE_SEARCH_PLUGIN.ID, diff --git a/x-pack/plugins/features/common/kibana_feature.ts b/x-pack/plugins/features/common/kibana_feature.ts index 32a7502956728..04b40843eb6d0 100644 --- a/x-pack/plugins/features/common/kibana_feature.ts +++ b/x-pack/plugins/features/common/kibana_feature.ts @@ -6,6 +6,7 @@ import { RecursiveReadonly } from '@kbn/utility-types'; import { AppCategory } from 'src/core/types'; +import { LicenseType } from '../../licensing/common/types'; import { FeatureKibanaPrivileges } from './feature_kibana_privileges'; import { SubFeatureConfig, SubFeature as KibanaSubFeature } from './sub_feature'; import { ReservedKibanaPrivilege } from './reserved_kibana_privilege'; @@ -52,25 +53,12 @@ export interface KibanaFeatureConfig { excludeFromBasePrivileges?: boolean; /** - * Optional array of supported licenses. + * Optional minimum supported license. * If omitted, all licenses are allowed. * This does not restrict access to your feature based on license. * Its only purpose is to inform the space and roles UIs on which features to display. */ - validLicenses?: ReadonlyArray< - 'basic' | 'standard' | 'gold' | 'platinum' | 'enterprise' | 'trial' - >; - - /** - * An optional EUI Icon to be used when displaying your feature. - */ - icon?: string; - - /** - * The optional Nav Link ID for feature. - * If specified, your link will be automatically hidden if needed based on the current space and user permissions. - */ - navLinkId?: string; + minimumLicense?: LicenseType; /** * An array of app ids that are enabled when this feature is enabled. @@ -170,10 +158,6 @@ export class KibanaFeature { return this.config.category; } - public get navLinkId() { - return this.config.navLinkId; - } - public get app() { return this.config.app; } @@ -186,12 +170,8 @@ export class KibanaFeature { return this.config.management; } - public get icon() { - return this.config.icon; - } - - public get validLicenses() { - return this.config.validLicenses; + public get minimumLicense() { + return this.config.minimumLicense; } public get privileges() { diff --git a/x-pack/plugins/features/server/__snapshots__/feature_registry.test.ts.snap b/x-pack/plugins/features/server/__snapshots__/feature_registry.test.ts.snap index fdeb53dd2fa12..3043de27534f1 100644 --- a/x-pack/plugins/features/server/__snapshots__/feature_registry.test.ts.snap +++ b/x-pack/plugins/features/server/__snapshots__/feature_registry.test.ts.snap @@ -12,12 +12,6 @@ exports[`FeatureRegistry Kibana Features prevents features from being registered exports[`FeatureRegistry Kibana Features prevents features from being registered with a management id of "contains_invalid()_chars" 1`] = `"child \\"management\\" fails because [child \\"kibana\\" fails because [\\"kibana\\" at position 0 fails because [\\"0\\" with value \\"contains_invalid()_chars\\" fails to match the required pattern: /^[a-zA-Z0-9:_-]+$/]]]"`; -exports[`FeatureRegistry Kibana Features prevents features from being registered with a navLinkId of "" 1`] = `"child \\"navLinkId\\" fails because [\\"navLinkId\\" is not allowed to be empty]"`; - -exports[`FeatureRegistry Kibana Features prevents features from being registered with a navLinkId of "contains space" 1`] = `"child \\"navLinkId\\" fails because [\\"navLinkId\\" with value \\"contains space\\" fails to match the required pattern: /^[a-zA-Z0-9:_-]+$/]"`; - -exports[`FeatureRegistry Kibana Features prevents features from being registered with a navLinkId of "contains_invalid()_chars" 1`] = `"child \\"navLinkId\\" fails because [\\"navLinkId\\" with value \\"contains_invalid()_chars\\" fails to match the required pattern: /^[a-zA-Z0-9:_-]+$/]"`; - exports[`FeatureRegistry Kibana Features prevents features from being registered with an ID of "catalogue" 1`] = `"child \\"id\\" fails because [\\"id\\" contains an invalid value]"`; exports[`FeatureRegistry Kibana Features prevents features from being registered with an ID of "doesn't match valid regex" 1`] = `"child \\"id\\" fails because [\\"id\\" with value \\"doesn't match valid regex\\" fails to match the required pattern: /^[a-zA-Z0-9_-]+$/]"`; diff --git a/x-pack/plugins/features/server/feature_registry.test.ts b/x-pack/plugins/features/server/feature_registry.test.ts index aaaeccbd15e72..fda72e4536939 100644 --- a/x-pack/plugins/features/server/feature_registry.test.ts +++ b/x-pack/plugins/features/server/feature_registry.test.ts @@ -33,11 +33,9 @@ describe('FeatureRegistry', () => { id: 'test-feature', name: 'Test Feature', excludeFromBasePrivileges: true, - icon: 'addDataApp', - navLinkId: 'someNavLink', app: ['app1'], category: { id: 'foo', label: 'foo' }, - validLicenses: ['standard', 'basic', 'gold', 'platinum'], + minimumLicense: 'platinum', catalogue: ['foo'], management: { foo: ['bar'], @@ -421,20 +419,6 @@ describe('FeatureRegistry', () => { }); ['contains space', 'contains_invalid()_chars', ''].forEach((prohibitedChars) => { - it(`prevents features from being registered with a navLinkId of "${prohibitedChars}"`, () => { - const featureRegistry = new FeatureRegistry(); - expect(() => - featureRegistry.registerKibanaFeature({ - id: 'foo', - name: 'some feature', - navLinkId: prohibitedChars, - app: [], - category: { id: 'foo', label: 'foo' }, - privileges: null, - }) - ).toThrowErrorMatchingSnapshot(); - }); - it(`prevents features from being registered with a management id of "${prohibitedChars}"`, () => { const featureRegistry = new FeatureRegistry(); expect(() => diff --git a/x-pack/plugins/features/server/feature_schema.ts b/x-pack/plugins/features/server/feature_schema.ts index c6ec2d52c6d1a..78ffcdb087360 100644 --- a/x-pack/plugins/features/server/feature_schema.ts +++ b/x-pack/plugins/features/server/feature_schema.ts @@ -91,12 +91,14 @@ const kibanaFeatureSchema = Joi.object({ category: appCategorySchema, order: Joi.number(), excludeFromBasePrivileges: Joi.boolean(), - validLicenses: Joi.array().items( - Joi.string().valid('basic', 'standard', 'gold', 'platinum', 'enterprise', 'trial') + minimumLicense: Joi.string().valid( + 'basic', + 'standard', + 'gold', + 'platinum', + 'enterprise', + 'trial' ), - icon: Joi.string(), - description: Joi.string(), - navLinkId: Joi.string().regex(uiCapabilitiesRegex), app: Joi.array().items(Joi.string()).required(), management: managementSchema, catalogue: catalogueSchema, diff --git a/x-pack/plugins/features/server/oss_features.ts b/x-pack/plugins/features/server/oss_features.ts index 4cec44d6fa19a..d420aea49c6e1 100644 --- a/x-pack/plugins/features/server/oss_features.ts +++ b/x-pack/plugins/features/server/oss_features.ts @@ -21,8 +21,6 @@ export const buildOSSFeatures = ({ savedObjectTypes, includeTimelion }: BuildOSS }), order: 100, category: DEFAULT_APP_CATEGORIES.kibana, - icon: 'discoverApp', - navLinkId: 'discover', app: ['discover', 'kibana'], catalogue: ['discover'], privileges: { @@ -82,8 +80,6 @@ export const buildOSSFeatures = ({ savedObjectTypes, includeTimelion }: BuildOSS }), order: 700, category: DEFAULT_APP_CATEGORIES.kibana, - icon: 'visualizeApp', - navLinkId: 'visualize', app: ['visualize', 'lens', 'kibana'], catalogue: ['visualize'], privileges: { @@ -143,8 +139,6 @@ export const buildOSSFeatures = ({ savedObjectTypes, includeTimelion }: BuildOSS }), order: 200, category: DEFAULT_APP_CATEGORIES.kibana, - icon: 'dashboardApp', - navLinkId: 'dashboards', app: ['dashboards', 'kibana'], catalogue: ['dashboard'], privileges: { @@ -222,8 +216,6 @@ export const buildOSSFeatures = ({ savedObjectTypes, includeTimelion }: BuildOSS }), order: 1300, category: DEFAULT_APP_CATEGORIES.management, - icon: 'devToolsApp', - navLinkId: 'dev_tools', app: ['dev_tools', 'kibana'], catalogue: ['console', 'searchprofiler', 'grokdebugger'], privileges: { @@ -260,7 +252,6 @@ export const buildOSSFeatures = ({ savedObjectTypes, includeTimelion }: BuildOSS }), order: 1500, category: DEFAULT_APP_CATEGORIES.management, - icon: 'advancedSettingsApp', app: ['kibana'], catalogue: ['advanced_settings'], management: { @@ -300,7 +291,6 @@ export const buildOSSFeatures = ({ savedObjectTypes, includeTimelion }: BuildOSS }), order: 1600, category: DEFAULT_APP_CATEGORIES.management, - icon: 'indexPatternApp', app: ['kibana'], catalogue: ['indexPatterns'], management: { @@ -340,7 +330,6 @@ export const buildOSSFeatures = ({ savedObjectTypes, includeTimelion }: BuildOSS }), order: 1700, category: DEFAULT_APP_CATEGORIES.management, - icon: 'savedObjectsApp', app: ['kibana'], catalogue: ['saved_objects'], management: { @@ -384,8 +373,6 @@ const timelionFeature: KibanaFeatureConfig = { name: 'Timelion', order: 350, category: DEFAULT_APP_CATEGORIES.kibana, - icon: 'timelionApp', - navLinkId: 'timelion', app: ['timelion', 'kibana'], catalogue: ['timelion'], privileges: { diff --git a/x-pack/plugins/features/server/routes/index.test.ts b/x-pack/plugins/features/server/routes/index.test.ts index 692a889203131..7080f18906146 100644 --- a/x-pack/plugins/features/server/routes/index.test.ts +++ b/x-pack/plugins/features/server/routes/index.test.ts @@ -55,7 +55,7 @@ describe('GET /api/features', () => { name: 'Licensed Feature', app: ['bar-app'], category: { id: 'foo', label: 'foo' }, - validLicenses: ['gold'], + minimumLicense: 'gold', privileges: null, }); diff --git a/x-pack/plugins/features/server/routes/index.ts b/x-pack/plugins/features/server/routes/index.ts index b5a4203d7a768..1b0cd20775352 100644 --- a/x-pack/plugins/features/server/routes/index.ts +++ b/x-pack/plugins/features/server/routes/index.ts @@ -33,10 +33,9 @@ export function defineRoutes({ router, featureRegistry }: RouteDefinitionParams) .filter( (feature) => request.query.ignoreValidLicenses || - !feature.validLicenses || - !feature.validLicenses.length || - (context.licensing!.license.type && - feature.validLicenses.includes(context.licensing!.license.type)) + !feature.minimumLicense || + (context.licensing!.license && + context.licensing!.license.hasAtLeast(feature.minimumLicense)) ) .sort( (f1, f2) => diff --git a/x-pack/plugins/features/server/ui_capabilities_for_features.test.ts b/x-pack/plugins/features/server/ui_capabilities_for_features.test.ts index f5ba17a632c92..ffb36840a5850 100644 --- a/x-pack/plugins/features/server/ui_capabilities_for_features.test.ts +++ b/x-pack/plugins/features/server/ui_capabilities_for_features.test.ts @@ -92,7 +92,6 @@ describe('populateUICapabilities', () => { new KibanaFeature({ id: 'newFeature', name: 'my new feature', - navLinkId: 'newFeatureNavLink', app: ['bar-app'], category: { id: 'foo', label: 'foo' }, privileges: { @@ -146,7 +145,6 @@ describe('populateUICapabilities', () => { new KibanaFeature({ id: 'newFeature', name: 'my new feature', - navLinkId: 'newFeatureNavLink', app: ['bar-app'], category: { id: 'foo', label: 'foo' }, catalogue: ['anotherFooEntry', 'anotherBarEntry'], @@ -216,7 +214,6 @@ describe('populateUICapabilities', () => { new KibanaFeature({ id: 'newFeature', name: 'my new feature', - navLinkId: 'newFeatureNavLink', app: ['bar-app'], category: { id: 'foo', label: 'foo' }, privileges: { @@ -247,7 +244,6 @@ describe('populateUICapabilities', () => { new KibanaFeature({ id: 'newFeature', name: 'my new feature', - navLinkId: 'newFeatureNavLink', app: ['bar-app'], category: { id: 'foo', label: 'foo' }, privileges: null, @@ -292,7 +288,6 @@ describe('populateUICapabilities', () => { new KibanaFeature({ id: 'newFeature', name: 'my new feature', - navLinkId: 'newFeatureNavLink', app: ['bar-app'], category: { id: 'foo', label: 'foo' }, privileges: { @@ -364,7 +359,6 @@ describe('populateUICapabilities', () => { new KibanaFeature({ id: 'newFeature', name: 'my new feature', - navLinkId: 'newFeatureNavLink', app: ['bar-app'], category: { id: 'foo', label: 'foo' }, privileges: { @@ -385,7 +379,6 @@ describe('populateUICapabilities', () => { new KibanaFeature({ id: 'yetAnotherNewFeature', name: 'yet another new feature', - navLinkId: 'yetAnotherNavLink', app: ['bar-app'], category: { id: 'foo', label: 'foo' }, privileges: { diff --git a/x-pack/plugins/graph/server/plugin.ts b/x-pack/plugins/graph/server/plugin.ts index 21c50bf82f4bc..85f25542b2efb 100644 --- a/x-pack/plugins/graph/server/plugin.ts +++ b/x-pack/plugins/graph/server/plugin.ts @@ -49,11 +49,9 @@ export class GraphPlugin implements Plugin { }), order: 600, category: DEFAULT_APP_CATEGORIES.kibana, - icon: 'graphApp', - navLinkId: 'graph', app: ['graph', 'kibana'], catalogue: ['graph'], - validLicenses: ['platinum', 'enterprise', 'trial'], + minimumLicense: 'platinum', privileges: { all: { app: ['graph', 'kibana'], diff --git a/x-pack/plugins/infra/server/features.ts b/x-pack/plugins/infra/server/features.ts index 3767144a1b798..d49755b6f68c1 100644 --- a/x-pack/plugins/infra/server/features.ts +++ b/x-pack/plugins/infra/server/features.ts @@ -17,8 +17,6 @@ export const METRICS_FEATURE = { }), order: 800, category: DEFAULT_APP_CATEGORIES.observability, - icon: 'metricsApp', - navLinkId: 'metrics', app: ['infra', 'metrics', 'kibana'], catalogue: ['infraops', 'metrics'], management: { @@ -68,8 +66,6 @@ export const LOGS_FEATURE = { }), order: 700, category: DEFAULT_APP_CATEGORIES.observability, - icon: 'logsApp', - navLinkId: 'logs', app: ['infra', 'logs', 'kibana'], catalogue: ['infralogging', 'logs'], alerting: [LOG_DOCUMENT_COUNT_ALERT_TYPE_ID], diff --git a/x-pack/plugins/ingest_manager/server/plugin.ts b/x-pack/plugins/ingest_manager/server/plugin.ts index e3757b46ed715..e5a06b7e38131 100644 --- a/x-pack/plugins/ingest_manager/server/plugin.ts +++ b/x-pack/plugins/ingest_manager/server/plugin.ts @@ -181,9 +181,7 @@ export class IngestManagerPlugin deps.features.registerKibanaFeature({ id: PLUGIN_ID, name: 'Ingest Manager', - icon: 'savedObjectsApp', category: DEFAULT_APP_CATEGORIES.management, - navLinkId: PLUGIN_ID, app: [PLUGIN_ID, 'kibana'], catalogue: ['ingestManager'], privileges: { diff --git a/x-pack/plugins/maps/server/plugin.ts b/x-pack/plugins/maps/server/plugin.ts index 46e39fcdac27a..00950e96047a0 100644 --- a/x-pack/plugins/maps/server/plugin.ts +++ b/x-pack/plugins/maps/server/plugin.ts @@ -171,8 +171,6 @@ export class MapsPlugin implements Plugin { }), order: 400, category: DEFAULT_APP_CATEGORIES.kibana, - icon: APP_ICON, - navLinkId: APP_ID, app: [APP_ID, 'kibana'], catalogue: [APP_ID], privileges: { diff --git a/x-pack/plugins/ml/server/plugin.ts b/x-pack/plugins/ml/server/plugin.ts index d0c837b7a1caf..1592973022dbd 100644 --- a/x-pack/plugins/ml/server/plugin.ts +++ b/x-pack/plugins/ml/server/plugin.ts @@ -17,7 +17,7 @@ import { } from 'kibana/server'; import { DEFAULT_APP_CATEGORIES } from '../../../../src/core/server'; import { PluginsSetup, RouteInitialization } from './types'; -import { PLUGIN_ID, PLUGIN_ICON } from '../common/constants/app'; +import { PLUGIN_ID } from '../common/constants/app'; import { MlCapabilities } from '../common/types/capabilities'; import { initMlTelemetry } from './lib/telemetry'; @@ -73,10 +73,8 @@ export class MlServerPlugin implements Plugin { const { excludeFromBaseAll, excludeFromBaseRead, privileges, category, ...rest } = config; return new KibanaFeature({ - icon: 'discoverApp', - navLinkId: 'discover', app: [], category: category ?? { id: 'foo', label: 'foo' }, catalogue: [], diff --git a/x-pack/plugins/security/public/management/roles/edit_role/edit_role_page.test.tsx b/x-pack/plugins/security/public/management/roles/edit_role/edit_role_page.test.tsx index 7dff2912e6aa3..e6daa15fe7e6e 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/edit_role_page.test.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/edit_role_page.test.tsx @@ -30,7 +30,6 @@ const buildFeatures = () => { new KibanaFeature({ id: 'feature1', name: 'Feature 1', - icon: 'addDataApp', app: ['feature1App'], category: { id: 'foo', label: 'foo' }, privileges: { @@ -55,7 +54,6 @@ const buildFeatures = () => { new KibanaFeature({ id: 'feature2', name: 'Feature 2', - icon: 'addDataApp', app: ['feature2App'], category: { id: 'foo', label: 'foo' }, privileges: { diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/simple_privilege_section/simple_privilege_section.test.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/simple_privilege_section/simple_privilege_section.test.tsx index 77b6da2a00487..6601c6ae1f8d5 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/simple_privilege_section/simple_privilege_section.test.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/simple_privilege_section/simple_privilege_section.test.tsx @@ -19,7 +19,6 @@ const buildProps = (customProps: any = {}) => { name: 'Feature 1', app: ['app'], category: { id: 'foo', label: 'foo' }, - icon: 'spacesApp', privileges: { all: { app: ['app'], diff --git a/x-pack/plugins/security/server/authorization/disable_ui_capabilities.test.ts b/x-pack/plugins/security/server/authorization/disable_ui_capabilities.test.ts index ea24560c8ddc9..ac97822a403af 100644 --- a/x-pack/plugins/security/server/authorization/disable_ui_capabilities.test.ts +++ b/x-pack/plugins/security/server/authorization/disable_ui_capabilities.test.ts @@ -81,7 +81,6 @@ describe('usingPrivileges', () => { name: 'Foo KibanaFeature', app: ['fooApp', 'foo'], category: { id: 'foo', label: 'foo' }, - navLinkId: 'foo', privileges: null, }), ], @@ -170,7 +169,6 @@ describe('usingPrivileges', () => { name: 'Foo KibanaFeature', app: ['foo'], category: { id: 'foo', label: 'foo' }, - navLinkId: 'foo', privileges: null, }), ], @@ -322,7 +320,6 @@ describe('usingPrivileges', () => { new KibanaFeature({ id: 'fooFeature', name: 'Foo KibanaFeature', - navLinkId: 'foo', app: [], category: { id: 'foo', label: 'foo' }, privileges: null, @@ -330,7 +327,6 @@ describe('usingPrivileges', () => { new KibanaFeature({ id: 'barFeature', name: 'Bar KibanaFeature', - navLinkId: 'bar', app: ['bar'], category: { id: 'foo', label: 'foo' }, privileges: null, @@ -471,7 +467,6 @@ describe('usingPrivileges', () => { new KibanaFeature({ id: 'fooFeature', name: 'Foo KibanaFeature', - navLinkId: 'foo', app: [], category: { id: 'foo', label: 'foo' }, privileges: null, @@ -479,7 +474,6 @@ describe('usingPrivileges', () => { new KibanaFeature({ id: 'barFeature', name: 'Bar KibanaFeature', - navLinkId: 'bar', app: [], category: { id: 'foo', label: 'foo' }, privileges: null, @@ -559,7 +553,6 @@ describe('all', () => { name: 'Foo KibanaFeature', app: ['foo'], category: { id: 'foo', label: 'foo' }, - navLinkId: 'foo', privileges: null, }), ], diff --git a/x-pack/plugins/security/server/authorization/disable_ui_capabilities.ts b/x-pack/plugins/security/server/authorization/disable_ui_capabilities.ts index 89cc9065655cd..ec975ca5f973f 100644 --- a/x-pack/plugins/security/server/authorization/disable_ui_capabilities.ts +++ b/x-pack/plugins/security/server/authorization/disable_ui_capabilities.ts @@ -28,7 +28,6 @@ export function disableUICapabilitiesFactory( ) { // nav links are sourced from the apps property. // The Kibana Platform associates nav links to the app which registers it, in a 1:1 relationship. - // This behavior is replacing the `navLinkId` property. const featureNavLinkIds = features .flatMap((feature) => feature.app) .filter((navLinkId) => navLinkId != null); diff --git a/x-pack/plugins/security/server/authorization/privileges/privileges.test.ts b/x-pack/plugins/security/server/authorization/privileges/privileges.test.ts index 2b1268b11a0ff..c7b015b001ccf 100644 --- a/x-pack/plugins/security/server/authorization/privileges/privileges.test.ts +++ b/x-pack/plugins/security/server/authorization/privileges/privileges.test.ts @@ -18,8 +18,6 @@ describe('features', () => { new KibanaFeature({ id: 'foo-feature', name: 'Foo KibanaFeature', - icon: 'arrowDown', - navLinkId: 'kibana:foo', app: ['app-1', 'app-2'], category: { id: 'foo', label: 'foo' }, catalogue: ['catalogue-1', 'catalogue-2'], @@ -65,7 +63,6 @@ describe('features', () => { new KibanaFeature({ id: 'foo', name: 'Foo KibanaFeature', - icon: 'arrowDown', app: [], category: { id: 'foo', label: 'foo' }, privileges: { @@ -169,7 +166,6 @@ describe('features', () => { new KibanaFeature({ id: 'foo', name: 'Foo KibanaFeature', - icon: 'arrowDown', app: [], category: { id: 'foo', label: 'foo' }, privileges: null, @@ -211,8 +207,6 @@ describe('features', () => { new KibanaFeature({ id: 'foo', name: 'Foo KibanaFeature', - icon: 'arrowDown', - navLinkId: 'kibana:foo', app: [], category: { id: 'foo', label: 'foo' }, catalogue: ['ignore-me-1', 'ignore-me-2'], @@ -336,8 +330,6 @@ describe('features', () => { new KibanaFeature({ id: 'foo', name: 'Foo KibanaFeature', - icon: 'arrowDown', - navLinkId: 'kibana:foo', app: [], category: { id: 'foo', label: 'foo' }, catalogue: ['ignore-me-1', 'ignore-me-2'], @@ -421,8 +413,6 @@ describe('features', () => { new KibanaFeature({ id: 'foo', name: 'Foo KibanaFeature', - icon: 'arrowDown', - navLinkId: 'kibana:foo', app: [], category: { id: 'foo', label: 'foo' }, catalogue: ['ignore-me-1', 'ignore-me-2'], @@ -480,8 +470,6 @@ describe('features', () => { id: 'foo', name: 'Foo KibanaFeature', excludeFromBasePrivileges: true, - icon: 'arrowDown', - navLinkId: 'kibana:foo', app: [], category: { id: 'foo', label: 'foo' }, catalogue: ['ignore-me-1', 'ignore-me-2'], @@ -546,8 +534,6 @@ describe('features', () => { new KibanaFeature({ id: 'foo', name: 'Foo KibanaFeature', - icon: 'arrowDown', - navLinkId: 'kibana:foo', app: [], category: { id: 'foo', label: 'foo' }, catalogue: ['ignore-me-1', 'ignore-me-2'], @@ -617,8 +603,6 @@ describe('reserved', () => { new KibanaFeature({ id: 'foo', name: 'Foo KibanaFeature', - icon: 'arrowDown', - navLinkId: 'kibana:foo', app: ['app-1', 'app-2'], category: { id: 'foo', label: 'foo' }, catalogue: ['catalogue-1', 'catalogue-2'], @@ -661,7 +645,6 @@ describe('reserved', () => { new KibanaFeature({ id: 'foo', name: 'Foo KibanaFeature', - icon: 'arrowDown', app: [], category: { id: 'foo', label: 'foo' }, privileges: null, @@ -728,7 +711,6 @@ describe('reserved', () => { new KibanaFeature({ id: 'foo', name: 'Foo KibanaFeature', - icon: 'arrowDown', app: [], category: { id: 'foo', label: 'foo' }, privileges: { @@ -770,7 +752,6 @@ describe('subFeatures', () => { new KibanaFeature({ id: 'foo', name: 'Foo KibanaFeature', - icon: 'arrowDown', app: [], category: { id: 'foo', label: 'foo' }, privileges: { @@ -899,7 +880,6 @@ describe('subFeatures', () => { new KibanaFeature({ id: 'foo', name: 'Foo KibanaFeature', - icon: 'arrowDown', app: [], category: { id: 'foo', label: 'foo' }, privileges: { @@ -1106,7 +1086,6 @@ describe('subFeatures', () => { new KibanaFeature({ id: 'foo', name: 'Foo KibanaFeature', - icon: 'arrowDown', app: [], category: { id: 'foo', label: 'foo' }, excludeFromBasePrivileges: true, @@ -1251,7 +1230,6 @@ describe('subFeatures', () => { new KibanaFeature({ id: 'foo', name: 'Foo KibanaFeature', - icon: 'arrowDown', app: [], category: { id: 'foo', label: 'foo' }, privileges: { @@ -1419,7 +1397,6 @@ describe('subFeatures', () => { new KibanaFeature({ id: 'foo', name: 'Foo KibanaFeature', - icon: 'arrowDown', app: [], category: { id: 'foo', label: 'foo' }, excludeFromBasePrivileges: true, @@ -1551,7 +1528,6 @@ describe('subFeatures', () => { new KibanaFeature({ id: 'foo', name: 'Foo KibanaFeature', - icon: 'arrowDown', app: [], category: { id: 'foo', label: 'foo' }, privileges: { diff --git a/x-pack/plugins/security_solution/server/plugin.ts b/x-pack/plugins/security_solution/server/plugin.ts index 5e827a790e9ad..f5e1c6936cbd6 100644 --- a/x-pack/plugins/security_solution/server/plugin.ts +++ b/x-pack/plugins/security_solution/server/plugin.ts @@ -190,9 +190,7 @@ export class Plugin implements IPlugin { { id: 'feature-3', name: 'Feature 3', - icon: 'spacesApp', app: [], category: DEFAULT_APP_CATEGORIES.management, privileges: null, diff --git a/x-pack/plugins/spaces/public/management/edit_space/manage_space_page.test.tsx b/x-pack/plugins/spaces/public/management/edit_space/manage_space_page.test.tsx index 66f5ea87551d3..270cf862ccbd9 100644 --- a/x-pack/plugins/spaces/public/management/edit_space/manage_space_page.test.tsx +++ b/x-pack/plugins/spaces/public/management/edit_space/manage_space_page.test.tsx @@ -37,7 +37,6 @@ featuresStart.getFeatures.mockResolvedValue([ new KibanaFeature({ id: 'feature-1', name: 'feature 1', - icon: 'spacesApp', app: [], category: DEFAULT_APP_CATEGORIES.kibana, privileges: null, diff --git a/x-pack/plugins/spaces/public/management/spaces_grid/spaces_grid_pages.test.tsx b/x-pack/plugins/spaces/public/management/spaces_grid/spaces_grid_pages.test.tsx index c1d19eb06c2e7..34942221e53ee 100644 --- a/x-pack/plugins/spaces/public/management/spaces_grid/spaces_grid_pages.test.tsx +++ b/x-pack/plugins/spaces/public/management/spaces_grid/spaces_grid_pages.test.tsx @@ -45,7 +45,6 @@ featuresStart.getFeatures.mockResolvedValue([ new KibanaFeature({ id: 'feature-1', name: 'feature 1', - icon: 'spacesApp', app: [], category: { id: 'foo', label: 'foo' }, privileges: null, diff --git a/x-pack/plugins/spaces/server/capabilities/capabilities_switcher.test.ts b/x-pack/plugins/spaces/server/capabilities/capabilities_switcher.test.ts index bf0b51b7e2503..0dd070e63ba31 100644 --- a/x-pack/plugins/spaces/server/capabilities/capabilities_switcher.test.ts +++ b/x-pack/plugins/spaces/server/capabilities/capabilities_switcher.test.ts @@ -22,7 +22,6 @@ const features = ([ { id: 'feature_2', name: 'Feature 2', - navLinkId: 'feature2', app: ['feature2'], catalogue: ['feature2Entry'], management: { @@ -42,7 +41,6 @@ const features = ([ { id: 'feature_3', name: 'Feature 3', - navLinkId: 'feature3', app: ['feature3_app'], catalogue: ['feature3Entry'], management: { @@ -63,7 +61,6 @@ const features = ([ // feature 4 intentionally delcares the same items as feature 3 id: 'feature_4', name: 'Feature 4', - navLinkId: 'feature3', app: ['feature3', 'feature3_app'], catalogue: ['feature3Entry'], management: { diff --git a/x-pack/plugins/stack_alerts/server/feature.ts b/x-pack/plugins/stack_alerts/server/feature.ts index 8e22f5a7437e4..4ac0bc43adcd7 100644 --- a/x-pack/plugins/stack_alerts/server/feature.ts +++ b/x-pack/plugins/stack_alerts/server/feature.ts @@ -15,7 +15,6 @@ export const BUILT_IN_ALERTS_FEATURE = { name: i18n.translate('xpack.stackAlerts.featureRegistry.actionsFeatureName', { defaultMessage: 'Stack Alerts', }), - icon: 'bell', app: [], category: DEFAULT_APP_CATEGORIES.management, management: { diff --git a/x-pack/plugins/uptime/server/kibana.index.ts b/x-pack/plugins/uptime/server/kibana.index.ts index 730bb2277227e..1100fbf5a828d 100644 --- a/x-pack/plugins/uptime/server/kibana.index.ts +++ b/x-pack/plugins/uptime/server/kibana.index.ts @@ -33,8 +33,6 @@ export const initServerWithKibana = (server: UptimeCoreSetup, plugins: UptimeCor name: PLUGIN.NAME, order: 1000, category: DEFAULT_APP_CATEGORIES.observability, - navLinkId: PLUGIN.ID, - icon: 'uptimeApp', app: ['uptime', 'kibana'], catalogue: ['uptime'], management: { diff --git a/x-pack/test/ui_capabilities/common/fixtures/plugins/foo_plugin/server/index.ts b/x-pack/test/ui_capabilities/common/fixtures/plugins/foo_plugin/server/index.ts index c5d188c4139bf..25bb6e7884578 100644 --- a/x-pack/test/ui_capabilities/common/fixtures/plugins/foo_plugin/server/index.ts +++ b/x-pack/test/ui_capabilities/common/fixtures/plugins/foo_plugin/server/index.ts @@ -17,9 +17,7 @@ class FooPlugin implements Plugin { plugins.features.registerKibanaFeature({ id: 'foo', name: 'Foo', - icon: 'upArrow', category: { id: 'foo', label: 'foo' }, - navLinkId: 'foo_plugin', app: ['foo_plugin', 'kibana'], catalogue: ['foo'], privileges: {