Skip to content

Commit 7524f0e

Browse files
author
Aaron Caldwell
authored
[7.x] Migrate Region Maps to NP (#64272) (#65735)
1 parent 24be297 commit 7524f0e

30 files changed

+185
-149
lines changed

.i18nrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"kibana_utils": "src/plugins/kibana_utils",
3535
"navigation": "src/plugins/navigation",
3636
"newsfeed": "src/plugins/newsfeed",
37-
"regionMap": "src/legacy/core_plugins/region_map",
37+
"regionMap": "src/plugins/region_map",
3838
"savedObjects": "src/plugins/saved_objects",
3939
"savedObjectsManagement": "src/plugins/saved_objects_management",
4040
"server": "src/legacy/server",

src/legacy/core_plugins/region_map/index.ts

Lines changed: 0 additions & 49 deletions
This file was deleted.

src/plugins/maps_legacy/config.ts

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -19,31 +19,7 @@
1919

2020
import { schema, TypeOf } from '@kbn/config-schema';
2121
import { configSchema as tilemapSchema } from '../tile_map/config';
22-
23-
// TODO: Pull this portion from region_map
24-
export const regionmapSchema = schema.object({
25-
includeElasticMapsService: schema.boolean({ defaultValue: true }),
26-
layers: schema.arrayOf(
27-
schema.object({
28-
url: schema.string(),
29-
format: schema.object({
30-
type: schema.string({ defaultValue: 'geojson' }),
31-
}),
32-
meta: schema.object({
33-
feature_collection_path: schema.string({ defaultValue: 'data' }),
34-
}),
35-
attribution: schema.string(),
36-
name: schema.string(),
37-
fields: schema.arrayOf(
38-
schema.object({
39-
name: schema.string(),
40-
description: schema.string(),
41-
})
42-
),
43-
}),
44-
{ defaultValue: [] }
45-
),
46-
});
22+
import { configSchema as regionmapSchema } from '../region_map/config';
4723

4824
export const configSchema = schema.object({
4925
includeElasticMapsService: schema.boolean({ defaultValue: true }),

src/plugins/maps_legacy/public/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ import {
4545
import { mapTooltipProvider } from './tooltip_provider';
4646

4747
export interface MapsLegacyConfigType {
48+
regionmap: any;
4849
emsTileLayerId: string;
4950
includeElasticMapsService: boolean;
5051
proxyElasticMapsServiceInMaps: boolean;

src/plugins/region_map/config.ts

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
import { schema, TypeOf } from '@kbn/config-schema';
21+
22+
export const configSchema = schema.object({
23+
includeElasticMapsService: schema.boolean({ defaultValue: true }),
24+
layers: schema.arrayOf(
25+
schema.object({
26+
url: schema.string(),
27+
format: schema.object({
28+
type: schema.string({ defaultValue: 'geojson' }),
29+
}),
30+
meta: schema.object({
31+
feature_collection_path: schema.string({ defaultValue: 'data' }),
32+
}),
33+
attribution: schema.string(),
34+
name: schema.string(),
35+
fields: schema.arrayOf(
36+
schema.object({
37+
name: schema.string(),
38+
description: schema.string(),
39+
})
40+
),
41+
}),
42+
{ defaultValue: [] }
43+
),
44+
});
45+
46+
export type ConfigSchema = TypeOf<typeof configSchema>;

src/plugins/region_map/kibana.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"id": "regionMap",
3+
"version": "8.0.0",
4+
"kibanaVersion": "kibana",
5+
"configPath": ["map", "regionmap"],
6+
"ui": true,
7+
"server": true,
8+
"requiredPlugins": [
9+
"visualizations",
10+
"expressions",
11+
"mapsLegacy",
12+
"data"
13+
]
14+
}

0 commit comments

Comments
 (0)