From 2a4bb6a4f9894d51a106633216f66d0e6ed86b7a Mon Sep 17 00:00:00 2001 From: Paulo Henrique Date: Mon, 2 Dec 2024 20:43:48 -0800 Subject: [PATCH] removing navigation --- x-pack/plugins/asset_inventory/kibana.jsonc | 13 +++----- .../asset_inventory/public/application.tsx | 9 ++--- .../asset_inventory/public/components/app.tsx | 2 -- .../plugins/asset_inventory/public/plugin.ts | 33 +++++-------------- .../plugins/asset_inventory/public/types.ts | 6 ++-- x-pack/plugins/asset_inventory/tsconfig.json | 9 ++--- 6 files changed, 19 insertions(+), 53 deletions(-) diff --git a/x-pack/plugins/asset_inventory/kibana.jsonc b/x-pack/plugins/asset_inventory/kibana.jsonc index 5605517f2ed68..dbb813be7aa4e 100644 --- a/x-pack/plugins/asset_inventory/kibana.jsonc +++ b/x-pack/plugins/asset_inventory/kibana.jsonc @@ -1,9 +1,7 @@ { "type": "plugin", "id": "@kbn/asset-inventory-plugin", - "owner": [ - "@elastic/kibana-cloud-security-posture" - ], + "owner": ["@elastic/kibana-cloud-security-posture"], "group": "security", "visibility": "private", "description": "Centralized asset inventory experience within the Elastic Security solution. A central place for users to view and manage all their assets from different environments", @@ -11,12 +9,9 @@ "id": "assetInventory", "browser": true, "server": true, - "configPath": [ - "xpack", - "assetInventory" - ], - "requiredPlugins": ["navigation"], + "configPath": ["xpack", "assetInventory"], + "requiredPlugins": [], "requiredBundles": [], "optionalPlugins": [] - }, + } } diff --git a/x-pack/plugins/asset_inventory/public/application.tsx b/x-pack/plugins/asset_inventory/public/application.tsx index a5fa4ac80dc5a..f442f01d17f7c 100644 --- a/x-pack/plugins/asset_inventory/public/application.tsx +++ b/x-pack/plugins/asset_inventory/public/application.tsx @@ -12,16 +12,11 @@ import { AssetInventoryApp } from './components/app'; export const renderApp = ( { notifications, http }: CoreStart, - { navigation }: AppPluginStartDependencies, + {}: AppPluginStartDependencies, { appBasePath, element }: AppMountParameters ) => { ReactDOM.render( - , + , element ); diff --git a/x-pack/plugins/asset_inventory/public/components/app.tsx b/x-pack/plugins/asset_inventory/public/components/app.tsx index 7147fed242947..924091034353b 100644 --- a/x-pack/plugins/asset_inventory/public/components/app.tsx +++ b/x-pack/plugins/asset_inventory/public/components/app.tsx @@ -9,13 +9,11 @@ import { FormattedMessage, I18nProvider } from '@kbn/i18n-react'; import { BrowserRouter as Router } from '@kbn/shared-ux-router'; import { EuiPageTemplate, EuiTitle } from '@elastic/eui'; import type { CoreStart } from '@kbn/core/public'; -import type { NavigationPublicPluginStart } from '@kbn/navigation-plugin/public'; interface AssetInventoryAppDeps { basename: string; notifications: CoreStart['notifications']; http: CoreStart['http']; - navigation: NavigationPublicPluginStart; } export const AssetInventoryApp = ({ basename }: AssetInventoryAppDeps) => { diff --git a/x-pack/plugins/asset_inventory/public/plugin.ts b/x-pack/plugins/asset_inventory/public/plugin.ts index f70e94ef8fc52..fd2841f5b2335 100644 --- a/x-pack/plugins/asset_inventory/public/plugin.ts +++ b/x-pack/plugins/asset_inventory/public/plugin.ts @@ -4,49 +4,32 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { i18n } from '@kbn/i18n'; import type { AppMountParameters, CoreSetup, CoreStart, Plugin } from '@kbn/core/public'; import type { AssetInventoryPluginSetup, AssetInventoryPluginStart, AppPluginStartDependencies, } from './types'; -import { PLUGIN_NAME } from '../common'; export class AssetInventoryPlugin implements Plugin { public setup(core: CoreSetup): AssetInventoryPluginSetup { - // Register an application into the side navigation menu - core.application.register({ - id: 'assetInventory', - title: PLUGIN_NAME, - async mount(params: AppMountParameters) { + return {}; + } + public start( + coreStart: CoreStart, + depsStart: AppPluginStartDependencies + ): AssetInventoryPluginStart { + return { + getAssetInventoryPage: async (params: AppMountParameters) => { // Load application bundle const { renderApp } = await import('./application'); - // Get start services as specified in kibana.json - const [coreStart, depsStart] = await core.getStartServices(); // Render the application return renderApp(coreStart, depsStart as AppPluginStartDependencies, params); }, - }); - - // Return methods that should be available to other plugins - return { - getGreeting() { - return i18n.translate('assetInventory.greetingText', { - defaultMessage: 'Hello from {name}!', - values: { - name: PLUGIN_NAME, - }, - }); - }, }; } - public start(core: CoreStart): AssetInventoryPluginStart { - return {}; - } - public stop() {} } diff --git a/x-pack/plugins/asset_inventory/public/types.ts b/x-pack/plugins/asset_inventory/public/types.ts index a0640270cd0e6..a551b4d231c3d 100644 --- a/x-pack/plugins/asset_inventory/public/types.ts +++ b/x-pack/plugins/asset_inventory/public/types.ts @@ -4,7 +4,6 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import type { NavigationPublicPluginStart } from '@kbn/navigation-plugin/public'; // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface AssetInventoryPluginSetup {} @@ -12,6 +11,5 @@ export interface AssetInventoryPluginSetup {} // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface AssetInventoryPluginStart {} -export interface AppPluginStartDependencies { - navigation: NavigationPublicPluginStart; -} +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface AppPluginStartDependencies {} diff --git a/x-pack/plugins/asset_inventory/tsconfig.json b/x-pack/plugins/asset_inventory/tsconfig.json index b0a5740e51e74..b5fd1b8cc75e6 100644 --- a/x-pack/plugins/asset_inventory/tsconfig.json +++ b/x-pack/plugins/asset_inventory/tsconfig.json @@ -11,17 +11,14 @@ "public/**/*.json", "server/**/*.ts", "server/**/*.json", - "../../../typings/**/*", - ], - "exclude": [ - "target/**/*" + "../../../typings/**/*" ], + "exclude": ["target/**/*"], "kbn_references": [ "@kbn/core", "@kbn/i18n-react", "@kbn/shared-ux-router", - "@kbn/navigation-plugin", "@kbn/i18n", - "@kbn/securitysolution-es-utils", + "@kbn/securitysolution-es-utils" ] }