Skip to content

Commit

Permalink
Move src/legacy/server/index_patterns to data plugin (server) (Remo…
Browse files Browse the repository at this point in the history
…ve step) (#61618)

* Removed legacy index pattern

* fix type

* remove unnecessary import

* Removed old references to indexPatternsServiceFactory

Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
VladLasitsa and elasticmachine committed Apr 2, 2020
1 parent fa4699f commit 486d75c
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 99 deletions.
1 change: 0 additions & 1 deletion kibana.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import * as LegacyKibanaServer from './src/legacy/server/kbn_server';
*/
// eslint-disable-next-line @typescript-eslint/no-namespace
export namespace Legacy {
export type IndexPatternsService = LegacyKibanaServer.IndexPatternsService;
export type KibanaConfig = LegacyKibanaServer.KibanaConfig;
export type Request = LegacyKibanaServer.Request;
export type ResponseToolkit = LegacyKibanaServer.ResponseToolkit;
Expand Down
25 changes: 0 additions & 25 deletions src/legacy/server/index_patterns/index.ts

This file was deleted.

56 changes: 0 additions & 56 deletions src/legacy/server/index_patterns/mixin.ts

This file was deleted.

3 changes: 0 additions & 3 deletions src/legacy/server/kbn_server.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ import { LegacyConfig, ILegacyService, ILegacyInternals } from '../../core/serve
import { ApmOssPlugin } from '../core_plugins/apm_oss';
import { CallClusterWithRequest, ElasticsearchPlugin } from '../core_plugins/elasticsearch';
import { UsageCollectionSetup } from '../../plugins/usage_collection/server';
import { IndexPatternsServiceFactory } from './index_patterns';
import { Capabilities } from '../../core/server';
import { UiSettingsServiceFactoryOptions } from '../../legacy/ui/ui_settings/ui_settings_service_factory';
import { HomeServerPluginSetup } from '../../plugins/home/server';
Expand All @@ -68,7 +67,6 @@ declare module 'hapi' {

interface Server {
config: () => KibanaConfig;
indexPatternsServiceFactory: IndexPatternsServiceFactory;
savedObjects: SavedObjectsLegacyService;
injectUiAppVars: (pluginName: string, getAppVars: () => { [key: string]: any }) => void;
getHiddenUiAppById(appId: string): UiApp;
Expand Down Expand Up @@ -175,5 +173,4 @@ export default class KbnServer {
export { Server, Request, ResponseToolkit } from 'hapi';

// Re-export commonly accessed api types.
export { IndexPatternsFetcher as IndexPatternsService } from './index_patterns';
export { SavedObjectsLegacyService, SavedObjectsClient } from 'src/core/server';
2 changes: 0 additions & 2 deletions src/legacy/server/kbn_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import pidMixin from './pid';
import configCompleteMixin from './config/complete';
import optimizeMixin from '../../optimize';
import * as Plugins from './plugins';
import { indexPatternsMixin } from './index_patterns';
import { savedObjectsMixin } from './saved_objects/saved_objects_mixin';
import { capabilitiesMixin } from './capabilities';
import { serverExtensionsMixin } from './server_extensions';
Expand Down Expand Up @@ -114,7 +113,6 @@ export default class KbnServer {

// setup this.uiBundles
uiMixin,
indexPatternsMixin,

// setup saved object routes
savedObjectsMixin,
Expand Down
5 changes: 0 additions & 5 deletions src/legacy/server/saved_objects/saved_objects_mixin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,6 @@ describe('Saved Objects Mixin', () => {
get: stubConfig,
};
},
indexPatternsServiceFactory: () => {
return {
getFieldsForWildcard: jest.fn(),
};
},
plugins: {
elasticsearch: {
getCluster: () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ export interface InfraServerPluginDeps {
spaces: SpacesPluginSetup;
usageCollection: UsageCollectionSetup;
metrics: VisTypeTimeseriesSetup;
indexPatterns: {
indexPatternsServiceFactory: any;
};
features: FeaturesPluginSetup;
apm: APMPluginContract;
alerting: AlertingPluginContract;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
/* eslint-disable @typescript-eslint/array-type */

import { GraphQLSchema } from 'graphql';
import { Legacy } from 'kibana';
import { runHttpQuery } from 'apollo-server-core';
import { schema, TypeOf } from '@kbn/config-schema';
import {
Expand Down Expand Up @@ -217,9 +216,7 @@ export class KibanaFramework {
});
}

public getIndexPatternsService(
requestContext: RequestHandlerContext
): Legacy.IndexPatternsService {
public getIndexPatternsService(requestContext: RequestHandlerContext): IndexPatternsFetcher {
return new IndexPatternsFetcher((...rest: Parameters<APICaller>) => {
rest[1] = rest[1] || {};
rest[1].allowNoIndices = true;
Expand Down

0 comments on commit 486d75c

Please sign in to comment.