Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate SO management section to NP #61700

Merged
Merged
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
9bf165a
move libs to new plugin
pgayvallet Mar 27, 2020
3236ac6
adapt libs to use NP apis
pgayvallet Mar 27, 2020
e065f27
add required plugins
pgayvallet Mar 27, 2020
53ba5e3
add get_allowed_types route
pgayvallet Mar 27, 2020
9ff9026
move object_view components
pgayvallet Mar 27, 2020
8de9be6
add service registry
pgayvallet Mar 27, 2020
d45a77b
migrate table header component
pgayvallet Mar 27, 2020
b7f3f3d
migrate table component
pgayvallet Mar 27, 2020
0781cde
migrate saved_objects_table component
pgayvallet Mar 27, 2020
2d423b5
remove migrated legacy files
pgayvallet Mar 27, 2020
4635130
fix re-export from legacy management + section label
pgayvallet Mar 27, 2020
101380a
Merge remote-tracking branch 'upstream/master' into kbn-50308-so-mana…
pgayvallet Mar 27, 2020
83d270c
migrate services registration
pgayvallet Mar 27, 2020
fbc8931
adapt management section mock
pgayvallet Mar 27, 2020
0a8949b
fix imports
pgayvallet Mar 27, 2020
7d9d6f9
migrate flyout component
pgayvallet Mar 30, 2020
ccf3112
migrate relationships component
pgayvallet Mar 30, 2020
dfbec16
migrate saved_objects_table tests
pgayvallet Mar 30, 2020
9be3b46
migrate breadcrumb
pgayvallet Mar 30, 2020
50ccb8e
Merge remote-tracking branch 'upstream/master' into kbn-50308-so-mana…
pgayvallet Mar 30, 2020
2df3ee8
add redirect if unauthorized check
pgayvallet Mar 31, 2020
271081f
migrate translations to new savedObjectsManagement prefix
pgayvallet Mar 31, 2020
349355c
Merge remote-tracking branch 'upstream/master' into kbn-50308-so-mana…
pgayvallet Mar 31, 2020
dba1919
remove obsolete translations
pgayvallet Mar 31, 2020
4a93bb7
convert action registry to service pattern
pgayvallet Mar 31, 2020
3eb1faf
wire extra actions
pgayvallet Mar 31, 2020
912ae2b
remove importAndExportableTypes from injected vars
pgayvallet Mar 31, 2020
8dd3a29
handle newIndexPatternUrl
pgayvallet Mar 31, 2020
d8b4e4e
Merge remote-tracking branch 'upstream/master' into kbn-50308-so-mana…
pgayvallet Mar 31, 2020
121a9a2
remove duplicate dashboard dependency
pgayvallet Mar 31, 2020
ee93bc9
remove old TODO
pgayvallet Mar 31, 2020
76818da
remove old TODO
pgayvallet Mar 31, 2020
857c684
properly mock lodash in tests
pgayvallet Mar 31, 2020
fad42bc
Merge remote-tracking branch 'upstream/master' into kbn-50308-so-mana…
pgayvallet Apr 3, 2020
5a0d083
Merge remote-tracking branch 'upstream/master' into kbn-50308-so-mana…
pgayvallet Apr 6, 2020
1d810f0
add async management section loading
pgayvallet Apr 6, 2020
43a9d45
expose createSavedSearchesLoader from discover plugin contract
pgayvallet Apr 6, 2020
767c993
Merge remote-tracking branch 'upstream/master' into kbn-50308-so-mana…
pgayvallet Apr 8, 2020
9d94d9a
address most review comments
pgayvallet Apr 9, 2020
06b1675
Merge remote-tracking branch 'upstream/master' into kbn-50308-so-mana…
pgayvallet Apr 9, 2020
14420a8
fix merge conflicts
pgayvallet Apr 9, 2020
1583d98
Merge remote-tracking branch 'upstream/master' into kbn-50308-so-mana…
pgayvallet Apr 13, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/core/public/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export { overlayServiceMock } from './overlays/overlay_service.mock';
export { uiSettingsServiceMock } from './ui_settings/ui_settings_service.mock';
export { savedObjectsServiceMock } from './saved_objects/saved_objects_service.mock';
export { scopedHistoryMock } from './application/scoped_history.mock';
export { applicationServiceMock } from './application/application_service.mock';

function createCoreSetupMock({
basePath = '',
Expand All @@ -62,9 +63,8 @@ function createCoreSetupMock({
application: applicationServiceMock.createSetupContract(),
context: contextServiceMock.createSetupContract(),
fatalErrors: fatalErrorsServiceMock.createSetupContract(),
getStartServices: jest.fn<Promise<[ReturnType<typeof createCoreStartMock>, object, any]>, []>(
() =>
Promise.resolve([createCoreStartMock({ basePath }), pluginStartDeps, pluginStartContract])
getStartServices: jest.fn<Promise<[ReturnType<typeof createCoreStartMock>, any, any]>, []>(() =>
Promise.resolve([createCoreStartMock({ basePath }), pluginStartDeps, pluginStartContract])
),
http: httpServiceMock.createSetupContract({ basePath }),
notifications: notificationServiceMock.createSetupContract(),
Expand Down
1 change: 0 additions & 1 deletion src/core/server/saved_objects/service/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ export interface SavedObjectsLegacyService {
getScopedSavedObjectsClient: SavedObjectsClientProvider['getClient'];
SavedObjectsClient: typeof SavedObjectsClient;
types: string[];
importAndExportableTypes: string[];
schema: SavedObjectsSchema;
getSavedObjectsRepository(...rest: any[]): any;
importExport: {
Expand Down
2 changes: 0 additions & 2 deletions src/core/server/server.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2028,8 +2028,6 @@ export interface SavedObjectsLegacyService {
// (undocumented)
getScopedSavedObjectsClient: SavedObjectsClientProvider['getClient'];
// (undocumented)
importAndExportableTypes: string[];
// (undocumented)
importExport: {
objectLimit: number;
importSavedObjects(options: SavedObjectsImportOptions): Promise<SavedObjectsImportResponse>;
Expand Down
3 changes: 0 additions & 3 deletions src/legacy/core_plugins/kibana/inject_vars.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@
export function injectVars(server) {
const serverConfig = server.config();

const { importAndExportableTypes } = server.savedObjects;

return {
importAndExportableTypes,
Comment on lines 23 to -26
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaced by the _allowed_types endpoint

autocompleteTerminateAfter: serverConfig.get('kibana.autocompleteTerminateAfter'),
autocompleteTimeout: serverConfig.get('kibana.autocompleteTimeout'),
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,65 +17,8 @@
* under the License.
*/

import _ from 'lodash';
import { i18n } from '@kbn/i18n';
import { npStart } from 'ui/new_platform';
import { SavedObjectLoader } from '../../../../../plugins/saved_objects/public';
import { createSavedSearchesLoader } from '../../../../../plugins/discover/public';
import { npSetup } from 'ui/new_platform';

/**
* This registry is used for the editing mode of Saved Searches, Visualizations,
* Dashboard and Time Lion saved objects.
*/
interface SavedObjectRegistryEntry {
id: string;
service: SavedObjectLoader;
title: string;
}

export interface ISavedObjectsManagementRegistry {
register(service: SavedObjectRegistryEntry): void;
all(): SavedObjectRegistryEntry[];
get(id: string): SavedObjectRegistryEntry | undefined;
}

const registry: SavedObjectRegistryEntry[] = [];

export const savedObjectManagementRegistry: ISavedObjectsManagementRegistry = {
register: (service: SavedObjectRegistryEntry) => {
registry.push(service);
},
all: () => {
return registry;
},
get: (id: string) => {
return _.find(registry, { id });
},
};

const services = {
savedObjectsClient: npStart.core.savedObjects.client,
indexPatterns: npStart.plugins.data.indexPatterns,
chrome: npStart.core.chrome,
overlays: npStart.core.overlays,
};

savedObjectManagementRegistry.register({
id: 'savedVisualizations',
service: npStart.plugins.visualizations.savedVisualizationsLoader,
title: 'visualizations',
});

savedObjectManagementRegistry.register({
id: 'savedDashboards',
service: npStart.plugins.dashboard.getSavedDashboardLoader(),
title: i18n.translate('kbn.dashboard.savedDashboardsTitle', {
defaultMessage: 'dashboards',
}),
});
const registry = npSetup.plugins.savedObjectsManagement?.serviceRegistry;

savedObjectManagementRegistry.register({
id: 'savedSearches',
service: createSavedSearchesLoader(services),
title: 'searches',
});
export const savedObjectManagementRegistry = registry!;
Comment on lines +22 to +24
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kept this for BWC but it seems there are no usages of this file in our code. Should I keep it for BWC with potential 3rd parties plugins, or should I remove it?

Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,4 @@
* under the License.
*/

import './objects';
import './index_patterns';

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading