Skip to content

Commit

Permalink
remove type dependency between index_management and fleet (#89699)
Browse files Browse the repository at this point in the history
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
mshustov and kibanamachine authored Feb 1, 2021
1 parent 391ab72 commit 4380c49
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ describe('Data Streams tab', () => {

test('when Fleet is enabled, links to Fleet', async () => {
testBed = await setup({
plugins: { fleet: { hi: 'ok' } },
plugins: { isFleetEnabled: true },
});

await act(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ import React, { createContext, useContext } from 'react';
import { ScopedHistory } from 'kibana/public';
import { ManagementAppMountParams } from 'src/plugins/management/public';
import { UsageCollectionSetup } from 'src/plugins/usage_collection/public';
import { CoreSetup, CoreStart } from '../../../../../src/core/public';

import { FleetSetup } from '../../../fleet/public';
import { CoreSetup, CoreStart } from '../../../../../src/core/public';
import { UiMetricService, NotificationService, HttpService } from './services';
import { ExtensionsService } from '../services';
import { SharePluginStart } from '../../../../../src/plugins/share/public';
Expand All @@ -24,7 +23,7 @@ export interface AppDependencies {
};
plugins: {
usageCollection: UsageCollectionSetup;
fleet?: FleetSetup;
isFleetEnabled: boolean;
};
services: {
uiMetricService: UiMetricService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { CoreSetup } from 'src/core/public';
import { ManagementAppMountParams } from 'src/plugins/management/public/';
import { UsageCollectionSetup } from 'src/plugins/usage_collection/public';

import { FleetSetup } from '../../../fleet/public';
import { UIM_APP_NAME } from '../../common/constants';
import { PLUGIN } from '../../common/constants/plugin';
import { ExtensionsService } from '../services';
Expand Down Expand Up @@ -50,7 +49,7 @@ export async function mountManagementSection(
usageCollection: UsageCollectionSetup,
params: ManagementAppMountParams,
extensionsService: ExtensionsService,
fleet?: FleetSetup
isFleetEnabled: boolean
) {
const { element, setBreadcrumbs, history } = params;
const [core, startDependencies] = await coreSetup.getStartServices();
Expand Down Expand Up @@ -80,7 +79,7 @@ export async function mountManagementSection(
},
plugins: {
usageCollection,
fleet,
isFleetEnabled,
},
services: { httpService, notificationService, uiMetricService, extensionsService },
history,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const DataStreamList: React.FunctionComponent<RouteComponentProps<MatchPa

const {
core: { getUrlForApp },
plugins: { fleet },
plugins: { isFleetEnabled },
} = useAppContext();

const [isIncludeStatsChecked, setIsIncludeStatsChecked] = useState(false);
Expand Down Expand Up @@ -203,7 +203,7 @@ export const DataStreamList: React.FunctionComponent<RouteComponentProps<MatchPa
defaultMessage="Data streams store time-series data across multiple indices."
/>
{' ' /* We need this space to separate these two sentences. */}
{fleet ? (
{isFleetEnabled ? (
<FormattedMessage
id="xpack.idxMgmt.dataStreamList.emptyPrompt.noDataStreamsCtaIngestManagerMessage"
defaultMessage="Get started with data streams in {link}."
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/index_management/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class IndexMgmtUIPlugin {
usageCollection,
params,
this.extensionsService,
fleet
Boolean(fleet)
);
},
});
Expand Down
3 changes: 1 addition & 2 deletions x-pack/plugins/index_management/public/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/

import { ExtensionsSetup } from './services';
import { FleetSetup } from '../../fleet/public';
import { UsageCollectionSetup } from '../../../../src/plugins/usage_collection/public';
import { ManagementSetup } from '../../../../src/plugins/management/public';
import { SharePluginStart } from '../../../../src/plugins/share/public';
Expand All @@ -15,7 +14,7 @@ export interface IndexManagementPluginSetup {
}

export interface SetupDependencies {
fleet?: FleetSetup;
fleet?: unknown;
usageCollection: UsageCollectionSetup;
management: ManagementSetup;
}
Expand Down

0 comments on commit 4380c49

Please sign in to comment.