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

[SearchProfiler] Move out of legacy #55331

Merged
Merged
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,6 @@
/x-pack/legacy/plugins/license_management/ @elastic/es-ui
/x-pack/legacy/plugins/remote_clusters/ @elastic/es-ui
/x-pack/legacy/plugins/rollup/ @elastic/es-ui
/x-pack/legacy/plugins/searchprofiler/ @elastic/es-ui
/x-pack/plugins/searchprofiler/ @elastic/es-ui
/x-pack/legacy/plugins/snapshot_restore/ @elastic/es-ui
/x-pack/legacy/plugins/watcher/ @elastic/es-ui
4 changes: 2 additions & 2 deletions x-pack/.i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
"xpack.ml": "legacy/plugins/ml",
"xpack.monitoring": "legacy/plugins/monitoring",
"xpack.remoteClusters": "legacy/plugins/remote_clusters",
"xpack.reporting": [ "plugins/reporting", "legacy/plugins/reporting" ],
"xpack.reporting": ["plugins/reporting", "legacy/plugins/reporting"],
"xpack.rollupJobs": "legacy/plugins/rollup",
"xpack.searchProfiler": "legacy/plugins/searchprofiler",
"xpack.searchProfiler": "plugins/searchprofiler",
"xpack.security": ["legacy/plugins/security", "plugins/security"],
"xpack.server": "legacy/server",
"xpack.siem": "legacy/plugins/siem",
Expand Down
26 changes: 0 additions & 26 deletions x-pack/legacy/plugins/searchprofiler/README.md

This file was deleted.

47 changes: 5 additions & 42 deletions x-pack/legacy/plugins/searchprofiler/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@
*/

import { resolve } from 'path';
import Boom from 'boom';

import { CoreSetup } from 'src/core/server';
import { Server } from 'src/legacy/server/kbn_server';
import { LegacySetup } from './server/np_ready/types';
import { plugin } from './server/np_ready';
// TODO:
// Until we can process SCSS in new platform, this part of Searchprofiler
// legacy must remain here.

export const searchprofiler = (kibana: any) => {
const publicSrc = resolve(__dirname, 'public');
Expand All @@ -22,43 +20,8 @@ export const searchprofiler = (kibana: any) => {
publicDir: publicSrc,

uiExports: {
// NP Ready
devTools: [`${publicSrc}/legacy`],
styleSheetPaths: `${publicSrc}/np_ready/application/index.scss`,
// Legacy
home: ['plugins/searchprofiler/register_feature'],
},
init(server: Server) {
const serverPlugin = plugin();
const thisPlugin = this;

const commonRouteConfig = {
pre: [
function forbidApiAccess() {
const licenseCheckResults = server.plugins.xpack_main.info
.feature(thisPlugin.id)
.getLicenseCheckResults();
if (licenseCheckResults.showAppLink && licenseCheckResults.enableAppLink) {
return null;
} else {
throw Boom.forbidden(licenseCheckResults.message);
}
},
],
};

const legacySetup: LegacySetup = {
route: (args: Parameters<typeof server.route>[0]) => server.route(args),
plugins: {
__LEGACY: {
thisPlugin,
xpackMain: server.plugins.xpack_main,
elasticsearch: server.plugins.elasticsearch,
commonRouteConfig,
},
},
};
serverPlugin.setup({} as CoreSetup, legacySetup);
styleSheetPaths: `${publicSrc}/index.scss`,
},
init() {},
});
};
28 changes: 0 additions & 28 deletions x-pack/legacy/plugins/searchprofiler/public/legacy.ts

This file was deleted.

62 changes: 0 additions & 62 deletions x-pack/legacy/plugins/searchprofiler/public/np_ready/plugin.ts

This file was deleted.

28 changes: 0 additions & 28 deletions x-pack/legacy/plugins/searchprofiler/public/register_feature.js

This file was deleted.

This file was deleted.

This file was deleted.

Loading