-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Changes from 37 commits
9bf165a
3236ac6
e065f27
53ba5e3
9ff9026
8de9be6
d45a77b
b7f3f3d
0781cde
2d423b5
4635130
101380a
83d270c
fbc8931
0a8949b
7d9d6f9
ccf3112
dfbec16
9be3b46
50ccb8e
2df3ee8
271081f
349355c
dba1919
4a93bb7
3eb1faf
912ae2b
8dd3a29
d8b4e4e
121a9a2
ee93bc9
76818da
857c684
fad42bc
5a0d083
1d810f0
43a9d45
767c993
9d94d9a
06b1675
14420a8
1583d98
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
---|---|---|
|
@@ -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.
There was a problem hiding this comment.
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