kibana/x-pack/plugins/observability/public/plugin.ts

97 lines
3.3 KiB
TypeScript
Raw Normal View History

/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import { BehaviorSubject } from 'rxjs';
import { i18n } from '@kbn/i18n';
import { DataPublicPluginSetup } from '../../../../src/plugins/data/public';
import {
AppMountParameters,
AppUpdater,
CoreSetup,
DEFAULT_APP_CATEGORIES,
Plugin as PluginClass,
PluginInitializerContext,
CoreStart,
} from '../../../../src/core/public';
import { HomePublicPluginSetup } from '../../../../src/plugins/home/public';
import { registerDataHandler } from './data_handler';
import { toggleOverviewLinkInNav } from './toggle_overview_link_in_nav';
export interface ObservabilityPluginSetup {
dashboard: { register: typeof registerDataHandler };
}
export interface ObservabilityPluginSetupDeps {
home?: HomePublicPluginSetup;
data: DataPublicPluginSetup;
}
export type ObservabilityPluginStart = void;
export class Plugin implements PluginClass<ObservabilityPluginSetup, ObservabilityPluginStart> {
private readonly appUpdater$ = new BehaviorSubject<AppUpdater>(() => ({}));
constructor(context: PluginInitializerContext) {}
public setup(core: CoreSetup, plugins: ObservabilityPluginSetupDeps) {
core.application.register({
id: 'observability-overview',
title: 'Overview',
order: 8000,
euiIconType: 'logoObservability',
appRoute: '/app/observability',
updater$: this.appUpdater$,
category: DEFAULT_APP_CATEGORIES.observability,
mount: async (params: AppMountParameters<unknown>) => {
// Load application bundle
const { renderApp } = await import('./application');
// Get start services
const [coreStart] = await core.getStartServices();
return renderApp(coreStart, plugins, params);
},
});
if (plugins.home) {
plugins.home.featureCatalogue.registerSolution({
id: 'observability',
title: i18n.translate('xpack.observability.featureCatalogueTitle', {
defaultMessage: 'Observability',
}),
subtitle: i18n.translate('xpack.observability.featureCatalogueSubtitle', {
defaultMessage: 'Centralize & monitor',
}),
[Core UI] Kibana Overview Page (#75827) * Added kibana landing page Created kivana_overview plugin Removed test from home plugin Added CSS Fixed page header links Added news feed Fixed spacers between news items [Core UI] Kibana Overview Page Style Tweaks (#76712) Fixed link to index management Added solution cards to kibana landing page Added solution links Fixed ts errors Using publishReplay() to support multiple consumers in newsfeed plugin Added createNewsFeed$ to newsfeed plugin start Added tests Removed unnecessary export Hides overview link when other Kibana apps are not available Added icon to overview plugin Removed question mark from news feed title Updated plugin-list Fixed i18n errors Revert snapshot Updated getting started page copy Hide news feed when no news feed results Disables Kibana overview page when kibana apps are unavailable Updated snapshots Refactor to use KibanaContextProvider Fixed security tests Fixed newsfeed api test Moved overview_footer and overview_header to kibana-react plugin [Core UI] Kibana Overview Page Style Fixes (#78677) * Fixed a11y issues * Made newsfeed optional dep of kibana overview plugin * Removed duplicate license copy * Fixed management security test * Added toast to change default route button * Updated snapshots * Simplified toast notification * Fixed i18n error * Assigned kibana_overview plugin to Core UI in CODEOWNERS * Updated snapshots * Fix import * [Core UI] Kibana Overview Page Style Fixes, Part 3 (#78970) * fix overview cards not stretching height equally * change var name for better specificity * [Core UI] Kibana Overview Page Style Fixes, Part 4 (#79136) * Adds support for all newsfeed plugin config settings in createNewsFeed$ * Fixed type * Updated kibana overview page route * Fixed imports in page_footer and page_header * Update Kibana overview graphics (#79534) * Updated snapshots * Updated snapshots * Changes newsfeed endpoint to kibana analytics in kibana_overview plugin * Renamed components * Fixed overview page footer and header component class names * Removed extraneous files * Fixed import * Replaced SVGs with optimized SVGs * Fixed header and footer in home and kibana overview pages * Updated snapshots * Changed url_forwarding plugin appRoute * Fixed aria-labelledby value * Updated snapshots * Added base paths Co-authored-by: Michael Marcialis <michael.marcialis@elastic.co> Co-authored-by: Ryan Keairns <contactryank@gmail.com>
2020-10-06 18:13:31 +02:00
description: i18n.translate('xpack.observability.featureCatalogueDescription', {
defaultMessage:
'Consolidate your logs, metrics, application traces, and system availability with purpose-built UIs.',
}),
appDescriptions: [
i18n.translate('xpack.observability.featureCatalogueDescription1', {
defaultMessage: 'Monitor infrastructure metrics.',
}),
i18n.translate('xpack.observability.featureCatalogueDescription2', {
defaultMessage: 'Trace application requests.',
}),
i18n.translate('xpack.observability.featureCatalogueDescription3', {
defaultMessage: 'Measure SLAs and react to issues.',
}),
],
icon: 'logoObservability',
[Core UI] Kibana Overview Page (#75827) * Added kibana landing page Created kivana_overview plugin Removed test from home plugin Added CSS Fixed page header links Added news feed Fixed spacers between news items [Core UI] Kibana Overview Page Style Tweaks (#76712) Fixed link to index management Added solution cards to kibana landing page Added solution links Fixed ts errors Using publishReplay() to support multiple consumers in newsfeed plugin Added createNewsFeed$ to newsfeed plugin start Added tests Removed unnecessary export Hides overview link when other Kibana apps are not available Added icon to overview plugin Removed question mark from news feed title Updated plugin-list Fixed i18n errors Revert snapshot Updated getting started page copy Hide news feed when no news feed results Disables Kibana overview page when kibana apps are unavailable Updated snapshots Refactor to use KibanaContextProvider Fixed security tests Fixed newsfeed api test Moved overview_footer and overview_header to kibana-react plugin [Core UI] Kibana Overview Page Style Fixes (#78677) * Fixed a11y issues * Made newsfeed optional dep of kibana overview plugin * Removed duplicate license copy * Fixed management security test * Added toast to change default route button * Updated snapshots * Simplified toast notification * Fixed i18n error * Assigned kibana_overview plugin to Core UI in CODEOWNERS * Updated snapshots * Fix import * [Core UI] Kibana Overview Page Style Fixes, Part 3 (#78970) * fix overview cards not stretching height equally * change var name for better specificity * [Core UI] Kibana Overview Page Style Fixes, Part 4 (#79136) * Adds support for all newsfeed plugin config settings in createNewsFeed$ * Fixed type * Updated kibana overview page route * Fixed imports in page_footer and page_header * Update Kibana overview graphics (#79534) * Updated snapshots * Updated snapshots * Changes newsfeed endpoint to kibana analytics in kibana_overview plugin * Renamed components * Fixed overview page footer and header component class names * Removed extraneous files * Fixed import * Replaced SVGs with optimized SVGs * Fixed header and footer in home and kibana overview pages * Updated snapshots * Changed url_forwarding plugin appRoute * Fixed aria-labelledby value * Updated snapshots * Added base paths Co-authored-by: Michael Marcialis <michael.marcialis@elastic.co> Co-authored-by: Ryan Keairns <contactryank@gmail.com>
2020-10-06 18:13:31 +02:00
path: '/app/observability/landing',
order: 200,
});
}
return {
dashboard: { register: registerDataHandler },
};
}
public start({ application }: CoreStart) {
toggleOverviewLinkInNav(this.appUpdater$, application);
}
}