-
Notifications
You must be signed in to change notification settings - Fork 8.3k
/
Copy pathindex.ts
118 lines (115 loc) · 4.54 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import _ from 'lodash';
import { i18n } from '@kbn/i18n';
import { AddConfigDeprecation } from '@kbn/config';
import { PluginInitializerContext } from 'src/core/server';
import { PluginConfigDescriptor } from 'kibana/server';
import { MapsPlugin } from './plugin';
import { configSchema, MapsXPackConfig } from '../config';
export const config: PluginConfigDescriptor<MapsXPackConfig> = {
// exposeToBrowser specifies kibana.yml settings to expose to the browser
// the value `true` in this context signals configuration is exposed to browser
exposeToBrowser: {
enabled: true,
showMapVisualizationTypes: true,
showMapsInspectorAdapter: true,
preserveDrawingBuffer: true,
},
schema: configSchema,
deprecations: ({ deprecate }) => [
deprecate('enabled', '8.0.0'),
(
completeConfig: Record<string, any>,
rootPath: string,
addDeprecation: AddConfigDeprecation
) => {
if (_.get(completeConfig, 'xpack.maps.showMapVisualizationTypes') === undefined) {
return completeConfig;
}
addDeprecation({
configPath: 'xpack.maps.showMapVisualizationTypes',
message: i18n.translate('xpack.maps.deprecation.showMapVisualizationTypes.message', {
defaultMessage:
'xpack.maps.showMapVisualizationTypes is deprecated and is no longer used',
}),
correctiveActions: {
manualSteps: [
i18n.translate('xpack.maps.deprecation.showMapVisualizationTypes.step1', {
defaultMessage:
'Remove "xpack.maps.showMapVisualizationTypes" in the Kibana config file, CLI flag, or environment variable (in Docker only).',
}),
],
},
});
return completeConfig;
},
(
completeConfig: Record<string, any>,
rootPath: string,
addDeprecation: AddConfigDeprecation,
{ branch }
) => {
if (_.get(completeConfig, 'map.proxyElasticMapsServiceInMaps') === undefined) {
return completeConfig;
}
addDeprecation({
configPath: 'map.proxyElasticMapsServiceInMaps',
documentationUrl: `https://www.elastic.co/guide/en/kibana/${branch}/maps-connect-to-ems.html#elastic-maps-server`,
message: i18n.translate('xpack.maps.deprecation.proxyEMS.message', {
defaultMessage: 'map.proxyElasticMapsServiceInMaps is deprecated and is no longer used',
}),
correctiveActions: {
manualSteps: [
i18n.translate('xpack.maps.deprecation.proxyEMS.step1', {
defaultMessage:
'Remove "map.proxyElasticMapsServiceInMaps" in the Kibana config file, CLI flag, or environment variable (in Docker only).',
}),
i18n.translate('xpack.maps.deprecation.proxyEMS.step2', {
defaultMessage: 'Host Elastic Maps Service locally.',
}),
],
},
});
return completeConfig;
},
(
completeConfig: Record<string, any>,
rootPath: string,
addDeprecation: AddConfigDeprecation
) => {
if (_.get(completeConfig, 'map.regionmap') === undefined) {
return completeConfig;
}
addDeprecation({
configPath: 'map.regionmap',
message: i18n.translate('xpack.maps.deprecation.regionmap.message', {
defaultMessage: 'map.regionmap is deprecated and is no longer used',
}),
correctiveActions: {
manualSteps: [
i18n.translate('xpack.maps.deprecation.regionmap.step1', {
defaultMessage:
'Remove "map.regionmap" in the Kibana config file, CLI flag, or environment variable (in Docker only).',
}),
i18n.translate('xpack.maps.deprecation.regionmap.step2', {
defaultMessage:
'Use "Upload GeoJSON" to upload each layer defined by "map.regionmap.layers".',
}),
i18n.translate('xpack.maps.deprecation.regionmap.step3', {
defaultMessage:
'Update all maps with "Configured GeoJSON" layers. Use Choropleth layer wizard to build a replacement layer. Delete "Configured GeoJSON" layer from your map.',
}),
],
},
});
return completeConfig;
},
],
};
export const plugin = (initializerContext: PluginInitializerContext) =>
new MapsPlugin(initializerContext);