Skip to content

Commit

Permalink
removing navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
opauloh committed Dec 3, 2024
1 parent 1d03d3f commit 2a4bb6a
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 53 deletions.
13 changes: 4 additions & 9 deletions x-pack/plugins/asset_inventory/kibana.jsonc
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
{
"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",
"plugin": {
"id": "assetInventory",
"browser": true,
"server": true,
"configPath": [
"xpack",
"assetInventory"
],
"requiredPlugins": ["navigation"],
"configPath": ["xpack", "assetInventory"],
"requiredPlugins": [],
"requiredBundles": [],
"optionalPlugins": []
},
}
}
9 changes: 2 additions & 7 deletions x-pack/plugins/asset_inventory/public/application.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,11 @@ import { AssetInventoryApp } from './components/app';

export const renderApp = (
{ notifications, http }: CoreStart,
{ navigation }: AppPluginStartDependencies,
{}: AppPluginStartDependencies,
{ appBasePath, element }: AppMountParameters
) => {
ReactDOM.render(
<AssetInventoryApp
basename={appBasePath}
notifications={notifications}
http={http}
navigation={navigation}
/>,
<AssetInventoryApp basename={appBasePath} notifications={notifications} http={http} />,
element
);

Expand Down
2 changes: 0 additions & 2 deletions x-pack/plugins/asset_inventory/public/components/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
33 changes: 8 additions & 25 deletions x-pack/plugins/asset_inventory/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<AssetInventoryPluginSetup, AssetInventoryPluginStart>
{
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() {}
}
6 changes: 2 additions & 4 deletions x-pack/plugins/asset_inventory/public/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@
* 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 {}

// 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 {}
9 changes: 3 additions & 6 deletions x-pack/plugins/asset_inventory/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}

0 comments on commit 2a4bb6a

Please sign in to comment.