-
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
[Index management] Move to new platform "plugins" folder #58109
Changes from 13 commits
4984cbf
73568a7
42abf51
3034bcc
a64cc92
7bcef05
52b8bcc
a26999f
517f639
383cf0e
dfd7d4d
0be4ad1
5e33714
2330607
32b4724
56f3338
f5cd28b
40fcf7e
acca91e
e6bb10a
43233d8
108ff98
4443ae1
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 |
---|---|---|
|
@@ -20,7 +20,7 @@ import { addAllExtensions } from './np_ready/extend_index_management'; | |
if (chrome.getInjected('ilmUiEnabled')) { | ||
// We have to initialize this outside of the NP lifecycle, otherwise these extensions won't | ||
// be available in Index Management unless the user visits ILM first. | ||
addAllExtensions(); | ||
addAllExtensions((npSetup.plugins as any).indexManagement.extensionsService); | ||
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 think this will cause issues if the index_management plugin is disabled. 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. Good catch, I added a check. I think this bug is present on master then.. but not for long 😊 |
||
|
||
// This method handles the cleanup needed when route is scope is destroyed. It also prevents Angular | ||
// from destroying scope when route changes and both old route and new route are this same route. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,36 +4,26 @@ | |
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { resolve } from 'path'; | ||
import { Legacy } from 'kibana'; | ||
import { PLUGIN } from './common/constants'; | ||
import { plugin as initServerPlugin, Dependencies } from './server'; | ||
|
||
export type ServerFacade = Legacy.Server; | ||
|
||
export function indexManagement(kibana: any) { | ||
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. This file needs to stay until all dependent apps have migrated to the "plugins" folder. |
||
return new kibana.Plugin({ | ||
id: PLUGIN.id, | ||
id: 'index_management', | ||
configPrefix: 'xpack.index_management', | ||
publicDir: resolve(__dirname, 'public'), | ||
require: ['kibana', 'elasticsearch', 'xpack_main'], | ||
// TODO: Remove once All dependent apps have migrated to NP | ||
config(Joi: any) { | ||
return Joi.object({ | ||
// display menu item | ||
ui: Joi.object({ | ||
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. Is this needed? I don't think 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. Actually, I'm not quite sure I follow why the legacy config is needed, since it didn't exist previously. Can you explain? 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 thought those were necessary but apparently not. I think that previously we forgot to add them though (at least the I removed everything but |
||
enabled: Joi.boolean().default(true), | ||
}).default(), | ||
|
||
uiExports: { | ||
styleSheetPaths: resolve(__dirname, 'public/index.scss'), | ||
managementSections: ['plugins/index_management'], | ||
// enable plugin | ||
enabled: Joi.boolean().default(true), | ||
}).default(); | ||
}, | ||
|
||
init(server: ServerFacade) { | ||
const coreSetup = server.newPlatform.setup.core; | ||
const coreInitializerContext = server.newPlatform.coreContext; | ||
const pluginsSetup: Dependencies = { | ||
licensing: server.newPlatform.setup.plugins.licensing as any, | ||
}; | ||
|
||
const serverPlugin = initServerPlugin(coreInitializerContext as any); | ||
const serverPublicApi = serverPlugin.setup(coreSetup, pluginsSetup); | ||
|
||
server.expose('addIndexManagementDataEnricher', serverPublicApi.indexDataEnricher.add); | ||
isEnabled(config: any) { | ||
return ( | ||
config.get('xpack.index_management.enabled') && config.get('xpack.index_management.enabled') | ||
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. should this just be 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. Lol 😄 |
||
); | ||
}, | ||
}); | ||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,10 +77,10 @@ export class RollupsServerPlugin implements Plugin<void, void, any, any> { | |
} | ||
|
||
if ( | ||
serverShim.plugins.index_management && | ||
serverShim.plugins.index_management.addIndexManagementDataEnricher | ||
serverShim.plugins.indexManagement && | ||
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. nit: can 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. Good call! 👍 |
||
serverShim.plugins.indexManagement.indexDataEnricher | ||
) { | ||
serverShim.plugins.index_management.addIndexManagementDataEnricher(rollupDataEnricher); | ||
serverShim.plugins.indexManagement.indexDataEnricher.add(rollupDataEnricher); | ||
} | ||
|
||
if (metrics) { | ||
|
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.
I think this is going to cause issues if index management is disabled.
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.
Good catch, I added a check.