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

[Enterprise Search] Add Content plugin #129108

Merged
merged 5 commits into from
Apr 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Expand Up @@ -134,6 +134,7 @@ export const applicationUsageSchema = {
apm: commonSchema,
canvas: commonSchema,
enterpriseSearch: commonSchema,
enterpriseSearchContent: commonSchema,
appSearch: commonSchema,
workplaceSearch: commonSchema,
graph: commonSchema,
Expand Down
131 changes: 131 additions & 0 deletions src/plugins/telemetry/schema/oss_plugins.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
24 changes: 24 additions & 0 deletions x-pack/plugins/enterprise_search/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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,
Expand Down
28 changes: 14 additions & 14 deletions x-pack/plugins/enterprise_search/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand All @@ -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,
});

Expand All @@ -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,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export default function catalogueTests({ getService }: FtrProviderContext) {
const exceptions = [
'monitoring',
'enterpriseSearch',
'enterpriseSearchContent',
'appSearch',
'workplaceSearch',
'spaces',
Expand All @@ -89,6 +90,7 @@ export default function catalogueTests({ getService }: FtrProviderContext) {
'ml_file_data_visualizer',
'monitoring',
'enterpriseSearch',
'enterpriseSearchContent',
'appSearch',
'workplaceSearch',
'spaces',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export default function navLinksTests({ getService }: FtrProviderContext) {
navLinksBuilder.except(
'monitoring',
'enterpriseSearch',
'enterpriseSearchContent',
'appSearch',
'workplaceSearch',
'osquery'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
];
Expand Down