Skip to content

Commit

Permalink
Migrate dashboard mode (#69305)
Browse files Browse the repository at this point in the history
Closes: #67469

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
  • Loading branch information
alexwizp and elasticmachine committed Jun 23, 2020
1 parent 8d5934f commit f6a4bc2
Show file tree
Hide file tree
Showing 18 changed files with 311 additions and 319 deletions.
2 changes: 1 addition & 1 deletion x-pack/.i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"xpack.dashboard": "plugins/dashboard_enhanced",
"xpack.discover": "plugins/discover_enhanced",
"xpack.crossClusterReplication": "plugins/cross_cluster_replication",
"xpack.dashboardMode": "legacy/plugins/dashboard_mode",
"xpack.dashboardMode": "plugins/dashboard_mode",
"xpack.data": "plugins/data_enhanced",
"xpack.embeddableEnhanced": "plugins/embeddable_enhanced",
"xpack.endpoint": "plugins/endpoint",
Expand Down
4 changes: 1 addition & 3 deletions x-pack/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import { xpackMain } from './legacy/plugins/xpack_main';
import { monitoring } from './legacy/plugins/monitoring';
import { security } from './legacy/plugins/security';
import { dashboardMode } from './legacy/plugins/dashboard_mode';
import { beats } from './legacy/plugins/beats_management';
import { spaces } from './legacy/plugins/spaces';
import { ingestManager } from './legacy/plugins/ingest_manager';
Expand All @@ -18,8 +17,7 @@ module.exports = function (kibana) {
monitoring(kibana),
spaces(kibana),
security(kibana),
dashboardMode(kibana),
beats(kibana),
ingestManager(kibana),
beats(kibana),
];
};
64 changes: 0 additions & 64 deletions x-pack/legacy/plugins/dashboard_mode/index.js

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 1 addition & 0 deletions x-pack/legacy/plugins/ingest_manager/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { resolve } from 'path';
export function ingestManager(kibana: any) {
return new kibana.Plugin({
id: 'ingestManager',
require: ['kibana', 'elasticsearch', 'xpack_main'],
publicDir: resolve(__dirname, '../../../plugins/ingest_manager/public'),
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@
* you may not use this file except in compliance with the Elastic License.
*/

export { createDashboardModeRequestInterceptor } from './dashboard_mode_request_interceptor';
export const UI_SETTINGS = {
CONFIG_DASHBOARD_ONLY_MODE_ROLES: 'xpackDashboardMode:roles',
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
* you may not use this file except in compliance with the Elastic License.
*/

export * from './constants';
export { UI_SETTINGS } from './constants';
7 changes: 5 additions & 2 deletions x-pack/plugins/dashboard_mode/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
"version": "8.0.0",
"kibanaVersion": "kibana",
"configPath": [
"xpack", "dashboard_mode"
"xpack",
"dashboard_mode"
],
"optionalPlugins": ["security"],
"requiredPlugins": [
"kibanaLegacy", "dashboard"
"kibanaLegacy",
"dashboard"
],
"server": true,
"ui": true
Expand Down
14 changes: 8 additions & 6 deletions x-pack/plugins/dashboard_mode/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,19 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { PluginConfigDescriptor } from 'kibana/server';

import { PluginConfigDescriptor, PluginInitializerContext } from 'kibana/server';
import { schema } from '@kbn/config-schema';

import { DashboardModeServerPlugin } from './plugin';

export const config: PluginConfigDescriptor = {
schema: schema.object({
enabled: schema.boolean({ defaultValue: true }),
}),
};

export const plugin = () => ({
setup() {},
start() {},
});
export function plugin(initializerContext: PluginInitializerContext) {
return new DashboardModeServerPlugin(initializerContext);
}

export { DashboardModeServerPlugin as Plugin };
Loading

0 comments on commit f6a4bc2

Please sign in to comment.