|
17 | 17 | * under the License. |
18 | 18 | */ |
19 | 19 |
|
20 | | -import { schema, TypeOf } from '@kbn/config-schema'; |
21 | | -import { PluginInitializerContext } from 'src/core/server'; |
| 20 | +import { PluginInitializerContext, PluginConfigDescriptor } from 'src/core/server'; |
| 21 | +import { VisTypeTimeseriesConfig, config as configSchema } from './config'; |
22 | 22 | import { VisTypeTimeseriesPlugin } from './plugin'; |
| 23 | + |
23 | 24 | export { VisTypeTimeseriesSetup, Framework } from './plugin'; |
24 | 25 |
|
25 | | -export const config = { |
26 | | - schema: schema.object({ |
27 | | - enabled: schema.boolean({ defaultValue: true }), |
28 | | - }), |
29 | | -}; |
| 26 | +export const config: PluginConfigDescriptor<VisTypeTimeseriesConfig> = { |
| 27 | + deprecations: ({ unused, renameFromRoot }) => [ |
| 28 | + // In Kibana v7.8 plugin id was renamed from 'metrics' to 'vis_type_timeseries': |
| 29 | + renameFromRoot('metrics.enabled', 'vis_type_timeseries.enabled', true), |
| 30 | + renameFromRoot('metrics.chartResolution', 'vis_type_timeseries.chartResolution', true), |
| 31 | + renameFromRoot('metrics.minimumBucketSize', 'vis_type_timeseries.minimumBucketSize', true), |
30 | 32 |
|
31 | | -export type VisTypeTimeseriesConfig = TypeOf<typeof config.schema>; |
| 33 | + // Unused properties which should be removed after releasing Kibana v8.0: |
| 34 | + unused('chartResolution'), |
| 35 | + unused('minimumBucketSize'), |
| 36 | + ], |
| 37 | + schema: configSchema, |
| 38 | +}; |
32 | 39 |
|
33 | 40 | export { ValidationTelemetryServiceSetup } from './validation_telemetry'; |
34 | 41 |
|
|
0 commit comments