Skip to content

Commit

Permalink
fix types and migrate uisettings
Browse files Browse the repository at this point in the history
  • Loading branch information
flash1293 committed Apr 14, 2020
1 parent a2ff0a0 commit 27d9ca0
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 23 deletions.
17 changes: 0 additions & 17 deletions x-pack/legacy/plugins/rollup/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { i18n } from '@kbn/i18n';
import { PluginInitializerContext } from 'src/core/server';
import { RollupSetup } from '../../../plugins/rollup/server';
import { PLUGIN, CONFIG_ROLLUPS } from './common';
Expand All @@ -15,22 +14,6 @@ export function rollup(kibana: any) {
id: PLUGIN.ID,
configPrefix: 'xpack.rollup',
require: ['kibana', 'elasticsearch', 'xpack_main'],
uiExports: {
uiSettingDefaults: {
[CONFIG_ROLLUPS]: {
name: i18n.translate('xpack.rollupJobs.rollupIndexPatternsTitle', {
defaultMessage: 'Enable rollup index patterns',
}),
value: true,
description: i18n.translate('xpack.rollupJobs.rollupIndexPatternsDescription', {
defaultMessage: `Enable the creation of index patterns which capture rollup indices,
which in turn enable visualizations based on rollup data. Refresh
the page to apply the changes.`,
}),
category: ['rollups'],
},
},
},
init(server: any) {
const { core: coreSetup, plugins } = server.newPlatform.setup;
const { usageCollection, metrics, indexManagement } = plugins;
Expand Down
8 changes: 4 additions & 4 deletions x-pack/plugins/rollup/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ import {
} from '../../../../src/plugins/home/public';
// @ts-ignore
import { CRUD_APP_BASE_PATH } from './crud_app/constants';
import { ManagementSetup } from '../../../../../src/plugins/management/public';
import { IndexManagementPluginSetup } from '../../../../plugins/index_management/public';
import { IndexPatternManagementSetup } from '../../../../../src/plugins/index_pattern_management/public';
import { search } from '../../../../../src/plugins/data/public';
import { ManagementSetup } from '../../../../src/plugins/management/public';
import { IndexManagementPluginSetup } from '../../index_management/public';
import { IndexPatternManagementSetup } from '../../../../src/plugins/index_pattern_management/public';
import { DataPublicPluginStart, search } from '../../../../src/plugins/data/public';
// @ts-ignore
import { setEsBaseAndXPackBase, setHttp } from './crud_app/services/index';
import { setNotifications, setFatalErrors, setUiStatsReporter } from './kibana_services';
Expand Down
23 changes: 21 additions & 2 deletions x-pack/plugins/rollup/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { Plugin, PluginInitializerContext } from 'src/core/server';
import { CoreSetup, Plugin, PluginInitializerContext } from 'src/core/server';
import { i18n } from '@kbn/i18n';
import { schema } from '@kbn/config-schema';
import { CONFIG_ROLLUPS } from '../common';

export class RollupPlugin implements Plugin<RollupSetup> {
private readonly initContext: PluginInitializerContext;
Expand All @@ -13,7 +16,23 @@ export class RollupPlugin implements Plugin<RollupSetup> {
this.initContext = initContext;
}

public setup() {
public setup(core: CoreSetup) {
core.uiSettings.register({
[CONFIG_ROLLUPS]: {
name: i18n.translate('xpack.rollupJobs.rollupIndexPatternsTitle', {
defaultMessage: 'Enable rollup index patterns',
}),
value: true,
description: i18n.translate('xpack.rollupJobs.rollupIndexPatternsDescription', {
defaultMessage: `Enable the creation of index patterns which capture rollup indices,
which in turn enable visualizations based on rollup data. Refresh
the page to apply the changes.`,
}),
category: ['rollups'],
schema: schema.boolean(),
},
});

return {
__legacy: {
config: this.initContext.config,
Expand Down

0 comments on commit 27d9ca0

Please sign in to comment.