Skip to content

Commit

Permalink
use existing hook for useKibana access (elastic#125809)
Browse files Browse the repository at this point in the history
(cherry picked from commit 1484609)
  • Loading branch information
hop-dev authored and kibanamachine committed Feb 22, 2022
1 parent 8e27ea5 commit 5651e21
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ import { groupBy } from 'lodash';

import type { ResolvedSimpleSavedObject } from 'src/core/public';

import { useKibana } from '../../../../../../../../../../../src/plugins/kibana_react/public';
import { Loading, Error, ExtensionWrapper } from '../../../../../components';

import type { PackageInfo, StartPlugins } from '../../../../../types';
import type { PackageInfo } from '../../../../../types';
import { InstallStatus } from '../../../../../types';

import {
Expand All @@ -37,9 +36,9 @@ interface AssetsPanelProps {

export const AssetsPage = ({ packageInfo }: AssetsPanelProps) => {
const { name, version } = packageInfo;
const { spaces } = useKibana<StartPlugins>().services;
const pkgkey = `${name}-${version}`;
const {
spaces,
savedObjects: { client: savedObjectsClient },
} = useStartServices();
const customAssetsExtension = useUIExtension(packageInfo.name, 'package-detail-assets');
Expand Down
3 changes: 3 additions & 0 deletions x-pack/plugins/fleet/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import type { SharePluginStart } from 'src/plugins/share/public';

import { once } from 'lodash';

import type { SpacesPluginStart } from '../../spaces/public';

import type { CloudStart } from '../../cloud/public';

import type { UsageCollectionSetup } from '../../../../src/plugins/usage_collection/public';
Expand Down Expand Up @@ -103,6 +105,7 @@ export interface FleetStartServices extends CoreStart, Exclude<FleetStartDeps, '
storage: Storage;
share: SharePluginStart;
cloud?: CloudSetup & CloudStart;
spaces?: SpacesPluginStart;
authz: FleetAuthz;
}

Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/fleet/public/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,3 @@ export { entries, ElasticsearchAssetType, KibanaAssetType, InstallStatus } from
export * from './intra_app_route_state';
export * from './ui_extensions';
export * from './in_memory_package_policy';
export * from './start_plugins';
12 changes: 0 additions & 12 deletions x-pack/plugins/fleet/public/types/start_plugins.ts

This file was deleted.

0 comments on commit 5651e21

Please sign in to comment.