Skip to content

Commit

Permalink
[7.x] xpack_main legacy plugin pre-removal cleanup (#76257) (#76358)
Browse files Browse the repository at this point in the history
* xpack_main legacy plugin pre-removal cleanup (#76257)

* cleanup xpack_main legacy plugin, remove capabilities mixin

* fix test env

* delete injectXpackSignature and related tests
# Conflicts:
#	x-pack/legacy/plugins/xpack_main/index.js
#	x-pack/scripts/functional_tests.js

* remove unused keys

* create the xpackLegacy plugin

* update plugin list

* fix type
  • Loading branch information
pgayvallet committed Sep 1, 2020
1 parent 3260536 commit 9fed654
Show file tree
Hide file tree
Showing 25 changed files with 105 additions and 852 deletions.
4 changes: 4 additions & 0 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,10 @@ in their infrastructure.
|This plugins adopts some conventions in addition to or in place of conventions in Kibana (at the time of the plugin's creation):
|{kib-repo}blob/{branch}/x-pack/plugins/xpack_legacy[xpackLegacy]
|WARNING: Missing README.
|===
include::{kibana-root}/src/plugins/dashboard/README.asciidoc[leveloffset=+1]
Expand Down
65 changes: 0 additions & 65 deletions src/legacy/server/capabilities/capabilities_mixin.test.ts

This file was deleted.

42 changes: 0 additions & 42 deletions src/legacy/server/capabilities/capabilities_mixin.ts

This file was deleted.

20 changes: 0 additions & 20 deletions src/legacy/server/capabilities/index.ts

This file was deleted.

4 changes: 0 additions & 4 deletions src/legacy/server/kbn_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import configCompleteMixin from './config/complete';
import { optimizeMixin } from '../../optimize';
import * as Plugins from './plugins';
import { savedObjectsMixin } from './saved_objects/saved_objects_mixin';
import { capabilitiesMixin } from './capabilities';
import { serverExtensionsMixin } from './server_extensions';
import { uiMixin } from '../ui';
import { i18nMixin } from './i18n';
Expand Down Expand Up @@ -115,9 +114,6 @@ export default class KbnServer {
// setup saved object routes
savedObjectsMixin,

// setup capabilities routes
capabilitiesMixin,

// setup routes that serve the @kbn/optimizer output
optimizeMixin,

Expand Down
2 changes: 1 addition & 1 deletion x-pack/.i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"xpack.licenseMgmt": "plugins/license_management",
"xpack.licensing": "plugins/licensing",
"xpack.logstash": ["plugins/logstash", "legacy/plugins/logstash"],
"xpack.main": "legacy/plugins/xpack_main",
"xpack.main": ["legacy/plugins/xpack_main", "plugins/xpack_legacy"],
"xpack.maps": ["plugins/maps", "legacy/plugins/maps"],
"xpack.ml": ["plugins/ml", "legacy/plugins/ml"],
"xpack.monitoring": ["plugins/monitoring"],
Expand Down
51 changes: 0 additions & 51 deletions x-pack/legacy/plugins/xpack_main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,9 @@
*/

import { resolve } from 'path';
import { XPACK_DEFAULT_ADMIN_EMAIL_UI_SETTING } from '../../server/lib/constants';
import { mirrorPluginStatus } from '../../server/lib/mirror_plugin_status';
import { replaceInjectedVars } from './server/lib/replace_injected_vars';
import { setupXPackMain } from './server/lib/setup_xpack_main';
import { xpackInfoRoute, settingsRoute } from './server/routes/api/v1';
import { i18n } from '@kbn/i18n';

export { callClusterFactory } from './server/lib/call_cluster_factory';

export const xpackMain = (kibana) => {
return new kibana.Plugin({
Expand All @@ -32,53 +27,7 @@ export const xpackMain = (kibana) => {
}).default();
},

uiCapabilities(server) {
const featuresPlugin = server.newPlatform.setup.plugins.features;
if (!featuresPlugin) {
throw new Error('New Platform XPack Features plugin is not available.');
}
return featuresPlugin.getFeaturesUICapabilities();
},

uiExports: {
uiSettingDefaults: {
[XPACK_DEFAULT_ADMIN_EMAIL_UI_SETTING]: {
name: i18n.translate('xpack.main.uiSettings.adminEmailTitle', {
defaultMessage: 'Admin email',
}),
// TODO: change the description when email address is used for more things?
description: i18n.translate('xpack.main.uiSettings.adminEmailDescription', {
defaultMessage:
'Recipient email address for X-Pack admin operations, such as Cluster Alert email notifications from Monitoring.',
}),
deprecation: {
message: i18n.translate('xpack.main.uiSettings.adminEmailDeprecation', {
defaultMessage:
'This setting is deprecated and will not be supported in Kibana 8.0. Please configure `monitoring.cluster_alerts.email_notifications.email_address` in your kibana.yml settings.',
}),
docLinksKey: 'kibanaGeneralSettings',
},
type: 'string', // TODO: Any way of ensuring this is a valid email address?
value: null,
},
},
replaceInjectedVars,
injectDefaultVars(server) {
const config = server.config();

return {
activeSpace: null,
spacesEnabled: config.get('xpack.spaces.enabled'),
};
},
},

init(server) {
const featuresPlugin = server.newPlatform.setup.plugins.features;
if (!featuresPlugin) {
throw new Error('New Platform XPack Features plugin is not available.');
}

mirrorPluginStatus(server.plugins.elasticsearch, this, 'yellow', 'red');

setupXPackMain(server);
Expand Down

This file was deleted.

Loading

0 comments on commit 9fed654

Please sign in to comment.