Skip to content

Commit

Permalink
migrate saved object management routes to new plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
pgayvallet committed Mar 3, 2020
1 parent efe0533 commit 1f5e057
Show file tree
Hide file tree
Showing 29 changed files with 858 additions and 666 deletions.
2 changes: 0 additions & 2 deletions src/core/server/saved_objects/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ export * from './service';

export { SavedObjectsSchema } from './schema';

export { SavedObjectsManagement } from './management';

export * from './import';

export {
Expand Down
174 changes: 0 additions & 174 deletions src/core/server/saved_objects/management/management.test.ts

This file was deleted.

91 changes: 0 additions & 91 deletions src/core/server/saved_objects/management/management.ts

This file was deleted.

4 changes: 3 additions & 1 deletion src/core/server/saved_objects/saved_objects_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,9 @@ export class SavedObjectsService
};
}

public async stop() {}
public async stop() {
this.migrator$.complete();
}

private createMigrator(
kibanaConfig: KibanaConfigType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ const createRegistryMock = (): jest.Mocked<ISavedObjectTypeRegistry &
isNamespaceAgnostic: jest.fn(),
isHidden: jest.fn(),
getIndex: jest.fn(),
isImportableAndExportable: jest.fn(),
};

mock.getIndex.mockReturnValue('.kibana-test');
mock.isHidden.mockReturnValue(false);
mock.isNamespaceAgnostic.mockImplementation((type: string) => type === 'global');
mock.isImportableAndExportable.mockReturnValue(true);

return mock;
};
Expand Down
7 changes: 6 additions & 1 deletion src/core/server/saved_objects/saved_objects_type_registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ import { SavedObjectsType } from './types';
*/
export type ISavedObjectTypeRegistry = Pick<
SavedObjectTypeRegistry,
'getType' | 'getAllTypes' | 'getIndex' | 'isNamespaceAgnostic' | 'isHidden'
| 'getType'
| 'getAllTypes'
| 'getIndex'
| 'isNamespaceAgnostic'
| 'isHidden'
| 'isImportableAndExportable'
>;

/**
Expand Down
2 changes: 0 additions & 2 deletions src/legacy/core_plugins/kibana/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import { promisify } from 'util';
import { migrations } from './migrations';
import { importApi } from './server/routes/api/import';
import { exportApi } from './server/routes/api/export';
import { managementApi } from './server/routes/api/management';
import mappings from './mappings.json';
import { getUiSettingDefaults } from './ui_setting_defaults';
import { registerCspCollector } from './server/lib/csp_usage_collector';
Expand Down Expand Up @@ -322,7 +321,6 @@ export default function(kibana) {
// routes
importApi(server);
exportApi(server);
managementApi(server);
registerCspCollector(usageCollection, server);
server.injectUiAppVars('kibana', () => injectVars(server));
},
Expand Down
Loading

0 comments on commit 1f5e057

Please sign in to comment.