diff --git a/src/plugins/kibana_usage_collection/server/collectors/application_usage/schema.ts b/src/plugins/kibana_usage_collection/server/collectors/application_usage/schema.ts index 042bf8f034b21..4e267e0d15270 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/application_usage/schema.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/application_usage/schema.ts @@ -134,6 +134,7 @@ export const applicationUsageSchema = { apm: commonSchema, canvas: commonSchema, enterpriseSearch: commonSchema, + enterpriseSearchContent: commonSchema, appSearch: commonSchema, workplaceSearch: commonSchema, graph: commonSchema, diff --git a/src/plugins/telemetry/schema/oss_plugins.json b/src/plugins/telemetry/schema/oss_plugins.json index 8545f6b39d86d..76079970f26bc 100644 --- a/src/plugins/telemetry/schema/oss_plugins.json +++ b/src/plugins/telemetry/schema/oss_plugins.json @@ -2136,6 +2136,137 @@ } } }, + "enterpriseSearchContent": { + "properties": { + "appId": { + "type": "keyword", + "_meta": { + "description": "The application being tracked" + } + }, + "viewId": { + "type": "keyword", + "_meta": { + "description": "Always `main`" + } + }, + "clicks_total": { + "type": "long", + "_meta": { + "description": "General number of clicks in the application since we started counting them" + } + }, + "clicks_7_days": { + "type": "long", + "_meta": { + "description": "General number of clicks in the application over the last 7 days" + } + }, + "clicks_30_days": { + "type": "long", + "_meta": { + "description": "General number of clicks in the application over the last 30 days" + } + }, + "clicks_90_days": { + "type": "long", + "_meta": { + "description": "General number of clicks in the application over the last 90 days" + } + }, + "minutes_on_screen_total": { + "type": "float", + "_meta": { + "description": "Minutes the application is active and on-screen since we started counting them." + } + }, + "minutes_on_screen_7_days": { + "type": "float", + "_meta": { + "description": "Minutes the application is active and on-screen over the last 7 days" + } + }, + "minutes_on_screen_30_days": { + "type": "float", + "_meta": { + "description": "Minutes the application is active and on-screen over the last 30 days" + } + }, + "minutes_on_screen_90_days": { + "type": "float", + "_meta": { + "description": "Minutes the application is active and on-screen over the last 90 days" + } + }, + "views": { + "type": "array", + "items": { + "properties": { + "appId": { + "type": "keyword", + "_meta": { + "description": "The application being tracked" + } + }, + "viewId": { + "type": "keyword", + "_meta": { + "description": "The application view being tracked" + } + }, + "clicks_total": { + "type": "long", + "_meta": { + "description": "General number of clicks in the application sub view since we started counting them" + } + }, + "clicks_7_days": { + "type": "long", + "_meta": { + "description": "General number of clicks in the active application sub view over the last 7 days" + } + }, + "clicks_30_days": { + "type": "long", + "_meta": { + "description": "General number of clicks in the active application sub view over the last 30 days" + } + }, + "clicks_90_days": { + "type": "long", + "_meta": { + "description": "General number of clicks in the active application sub view over the last 90 days" + } + }, + "minutes_on_screen_total": { + "type": "float", + "_meta": { + "description": "Minutes the application sub view is active and on-screen since we started counting them." + } + }, + "minutes_on_screen_7_days": { + "type": "float", + "_meta": { + "description": "Minutes the application is active and on-screen active application sub view over the last 7 days" + } + }, + "minutes_on_screen_30_days": { + "type": "float", + "_meta": { + "description": "Minutes the application is active and on-screen active application sub view over the last 30 days" + } + }, + "minutes_on_screen_90_days": { + "type": "float", + "_meta": { + "description": "Minutes the application is active and on-screen active application sub view over the last 90 days" + } + } + } + } + } + } + }, "appSearch": { "properties": { "appId": { diff --git a/x-pack/plugins/enterprise_search/public/plugin.ts b/x-pack/plugins/enterprise_search/public/plugin.ts index 5b193d3e80964..5331a7ed81e11 100644 --- a/x-pack/plugins/enterprise_search/public/plugin.ts +++ b/x-pack/plugins/enterprise_search/public/plugin.ts @@ -26,6 +26,7 @@ import { SecurityPluginSetup, SecurityPluginStart } from '../../security/public' import { APP_SEARCH_PLUGIN, + ENTERPRISE_SEARCH_CONTENT_PLUGIN, ENTERPRISE_SEARCH_OVERVIEW_PLUGIN, WORKPLACE_SEARCH_PLUGIN, } from '../common/constants'; @@ -89,6 +90,29 @@ export class EnterpriseSearchPlugin implements Plugin { }, }); + core.application.register({ + id: ENTERPRISE_SEARCH_CONTENT_PLUGIN.ID, + title: ENTERPRISE_SEARCH_CONTENT_PLUGIN.NAV_TITLE, + euiIconType: ENTERPRISE_SEARCH_CONTENT_PLUGIN.LOGO, + appRoute: ENTERPRISE_SEARCH_CONTENT_PLUGIN.URL, + category: DEFAULT_APP_CATEGORIES.enterpriseSearch, + mount: async (params: AppMountParameters) => { + const kibanaDeps = await this.getKibanaDeps(core, params, cloud); + const { chrome, http } = kibanaDeps.core; + chrome.docTitle.change(ENTERPRISE_SEARCH_CONTENT_PLUGIN.NAME); + + await this.getInitialData(http); + const pluginData = this.getPluginData(); + + const { renderApp } = await import('./applications'); + const { EnterpriseSearchContent } = await import( + './applications/enterprise_search_content' + ); + + return renderApp(EnterpriseSearchContent, kibanaDeps, pluginData); + }, + }); + core.application.register({ id: APP_SEARCH_PLUGIN.ID, title: APP_SEARCH_PLUGIN.NAME, diff --git a/x-pack/plugins/enterprise_search/server/plugin.ts b/x-pack/plugins/enterprise_search/server/plugin.ts index 9d4f2382fd7cb..ef75cc680d2f6 100644 --- a/x-pack/plugins/enterprise_search/server/plugin.ts +++ b/x-pack/plugins/enterprise_search/server/plugin.ts @@ -24,6 +24,7 @@ import { SpacesPluginStart } from '../../spaces/server'; import { ENTERPRISE_SEARCH_OVERVIEW_PLUGIN, + ENTERPRISE_SEARCH_CONTENT_PLUGIN, APP_SEARCH_PLUGIN, WORKPLACE_SEARCH_PLUGIN, ENTERPRISE_SEARCH_RELEVANCE_LOGS_SOURCE_ID, @@ -89,6 +90,12 @@ export class EnterpriseSearchPlugin implements Plugin { ) { const config = this.config; const log = this.logger; + const PLUGIN_IDS = [ + ENTERPRISE_SEARCH_OVERVIEW_PLUGIN.ID, + ENTERPRISE_SEARCH_CONTENT_PLUGIN.ID, + APP_SEARCH_PLUGIN.ID, + WORKPLACE_SEARCH_PLUGIN.ID, + ]; if (customIntegrations) { registerEnterpriseSearchIntegrations(http, customIntegrations); @@ -107,17 +114,8 @@ export class EnterpriseSearchPlugin implements Plugin { name: ENTERPRISE_SEARCH_OVERVIEW_PLUGIN.NAME, order: 0, category: DEFAULT_APP_CATEGORIES.enterpriseSearch, - app: [ - 'kibana', - ENTERPRISE_SEARCH_OVERVIEW_PLUGIN.ID, - APP_SEARCH_PLUGIN.ID, - WORKPLACE_SEARCH_PLUGIN.ID, - ], - catalogue: [ - ENTERPRISE_SEARCH_OVERVIEW_PLUGIN.ID, - APP_SEARCH_PLUGIN.ID, - WORKPLACE_SEARCH_PLUGIN.ID, - ], + app: ['kibana', ...PLUGIN_IDS], + catalogue: PLUGIN_IDS, privileges: null, }); @@ -130,16 +128,18 @@ export class EnterpriseSearchPlugin implements Plugin { const dependencies = { config, security, spaces, request, log }; const { hasAppSearchAccess, hasWorkplaceSearchAccess } = await checkAccess(dependencies); - const showEnterpriseSearchOverview = hasAppSearchAccess || hasWorkplaceSearchAccess; + const showEnterpriseSearch = hasAppSearchAccess || hasWorkplaceSearchAccess; return { navLinks: { - enterpriseSearch: showEnterpriseSearchOverview, + enterpriseSearch: showEnterpriseSearch, + enterpriseSearchContent: showEnterpriseSearch, appSearch: hasAppSearchAccess, workplaceSearch: hasWorkplaceSearchAccess, }, catalogue: { - enterpriseSearch: showEnterpriseSearchOverview, + enterpriseSearch: showEnterpriseSearch, + enterpriseSearchContent: showEnterpriseSearch, appSearch: hasAppSearchAccess, workplaceSearch: hasWorkplaceSearchAccess, }, diff --git a/x-pack/test/ui_capabilities/security_and_spaces/tests/catalogue.ts b/x-pack/test/ui_capabilities/security_and_spaces/tests/catalogue.ts index 7347f201807ab..4c6f4fce0b5b6 100644 --- a/x-pack/test/ui_capabilities/security_and_spaces/tests/catalogue.ts +++ b/x-pack/test/ui_capabilities/security_and_spaces/tests/catalogue.ts @@ -65,6 +65,7 @@ export default function catalogueTests({ getService }: FtrProviderContext) { const exceptions = [ 'monitoring', 'enterpriseSearch', + 'enterpriseSearchContent', 'appSearch', 'workplaceSearch', 'spaces', @@ -89,6 +90,7 @@ export default function catalogueTests({ getService }: FtrProviderContext) { 'ml_file_data_visualizer', 'monitoring', 'enterpriseSearch', + 'enterpriseSearchContent', 'appSearch', 'workplaceSearch', 'spaces', diff --git a/x-pack/test/ui_capabilities/security_and_spaces/tests/nav_links.ts b/x-pack/test/ui_capabilities/security_and_spaces/tests/nav_links.ts index 479e3090151b9..bd990e7434fc8 100644 --- a/x-pack/test/ui_capabilities/security_and_spaces/tests/nav_links.ts +++ b/x-pack/test/ui_capabilities/security_and_spaces/tests/nav_links.ts @@ -55,6 +55,7 @@ export default function navLinksTests({ getService }: FtrProviderContext) { navLinksBuilder.except( 'monitoring', 'enterpriseSearch', + 'enterpriseSearchContent', 'appSearch', 'workplaceSearch', 'osquery' diff --git a/x-pack/test/ui_capabilities/spaces_only/tests/catalogue.ts b/x-pack/test/ui_capabilities/spaces_only/tests/catalogue.ts index e694b5be6e024..389749829a041 100644 --- a/x-pack/test/ui_capabilities/spaces_only/tests/catalogue.ts +++ b/x-pack/test/ui_capabilities/spaces_only/tests/catalogue.ts @@ -25,8 +25,9 @@ export default function catalogueTests({ getService }: FtrProviderContext) { ]; const uiCapabilitiesExceptions = [ - // enterprise_search plugin is loaded but disabled because security isn't enabled in ES. That means the following 3 capabilities are disabled + // enterprise_search plugin is loaded but disabled because security isn't enabled in ES. That means the following 4 capabilities are disabled 'enterpriseSearch', + 'enterpriseSearchContent', 'appSearch', 'workplaceSearch', ]; diff --git a/x-pack/test/ui_capabilities/spaces_only/tests/nav_links.ts b/x-pack/test/ui_capabilities/spaces_only/tests/nav_links.ts index 4ef919ebb46aa..6ac59638dac2e 100644 --- a/x-pack/test/ui_capabilities/spaces_only/tests/nav_links.ts +++ b/x-pack/test/ui_capabilities/spaces_only/tests/nav_links.ts @@ -17,8 +17,9 @@ export default function navLinksTests({ getService }: FtrProviderContext) { const featuresService: FeaturesService = getService('features'); const uiCapabilitiesExceptions = [ - // enterprise_search plugin is loaded but disabled because security isn't enabled in ES. That means the following 3 capabilities are disabled + // enterprise_search plugin is loaded but disabled because security isn't enabled in ES. That means the following 4 capabilities are disabled 'enterpriseSearch', + 'enterpriseSearchContent', 'appSearch', 'workplaceSearch', ];