Skip to content

Commit

Permalink
NP cleanup and removal of legacy server directory
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonrhodes committed Jan 3, 2020
1 parent d850940 commit ea99934
Show file tree
Hide file tree
Showing 134 changed files with 22 additions and 13,817 deletions.
58 changes: 13 additions & 45 deletions x-pack/legacy/plugins/infra/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,6 @@
import { i18n } from '@kbn/i18n';
import JoiNamespace from 'joi';
import { resolve } from 'path';
import { PluginInitializerContext } from 'src/core/server';
import { UsageCollectionSetup } from 'src/plugins/usage_collection/server';
import KbnServer from 'src/legacy/server/kbn_server';
import { getConfigSchema } from './server/kibana.index';
import { savedObjectMappings } from './server/saved_objects';
import { plugin, InfraServerPluginDeps } from './server/new_platform_index';
import { InfraSetup } from '../../../plugins/infra/server';
import { PluginSetupContract as FeaturesPluginSetup } from '../../../plugins/features/server';
import { SpacesPluginSetup } from '../../../plugins/spaces/server';
import { VisTypeTimeseriesSetup } from '../../../../src/plugins/vis_type_timeseries/server';
import { APMPluginContract } from '../../../plugins/apm/server';

export const APP_ID = 'infra';

Expand Down Expand Up @@ -70,45 +59,24 @@ export function infra(kibana: any) {
url: `/app/${APP_ID}#/logs`,
},
],
mappings: savedObjectMappings,
// mappings: savedObjectMappings,
},
config(Joi: typeof JoiNamespace) {
return getConfigSchema(Joi);
return Joi.object({
enabled: Joi.boolean().default(true),
})
.unknown()
.default();
},
init(legacyServer: any) {
const { newPlatform } = legacyServer as KbnServer;
const { core, plugins } = newPlatform.setup;

const infraSetup = (plugins.infra as unknown) as InfraSetup; // chef's kiss

const initContext = ({
config: infraSetup.__legacy.config,
} as unknown) as PluginInitializerContext;
// NP_TODO: Use real types from the other plugins as they are migrated
const pluginDeps: InfraServerPluginDeps = {
home: legacyServer.newPlatform.setup.plugins.home,
usageCollection: plugins.usageCollection as UsageCollectionSetup,
indexPatterns: {
indexPatternsServiceFactory: legacyServer.indexPatternsServiceFactory,
// NP_TODO: How do we move this to new platform?
legacyServer.addAppLinksToSampleDataset('logs', [
{
path: `/app/${APP_ID}#/logs`,
label: logsSampleDataLinkLabel,
icon: 'logsApp',
},
metrics: plugins.metrics as VisTypeTimeseriesSetup,
spaces: plugins.spaces as SpacesPluginSetup,
features: plugins.features as FeaturesPluginSetup,
apm: plugins.apm as APMPluginContract,
};

const infraPluginInstance = plugin(initContext);
infraPluginInstance.setup(core, pluginDeps);

// NP_TODO: EVERYTHING BELOW HERE IS LEGACY

const libs = infraPluginInstance.getLibs();

// NP_NOTE: Left here for now for legacy plugins to consume
legacyServer.expose(
'defineInternalSourceConfiguration',
libs.sources.defineInternalSourceConfiguration.bind(libs.sources)
);
]);
},
});
}
65 changes: 0 additions & 65 deletions x-pack/legacy/plugins/infra/server/features.ts

This file was deleted.

19 changes: 0 additions & 19 deletions x-pack/legacy/plugins/infra/server/graphql/index.ts

This file was deleted.

This file was deleted.

175 changes: 0 additions & 175 deletions x-pack/legacy/plugins/infra/server/graphql/log_entries/resolvers.ts

This file was deleted.

Loading

0 comments on commit ea99934

Please sign in to comment.