-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Maps] Separate layer wizards for Clusters and heatmap (#60870)
* [Maps] source registry and register seperate clusters and heat map sources * split into to registries * add EMS file source * add geojson upload layer * register rest of sources * i18n changes * ts lint errors * fix jest test * fix pew-pew source * review feedback * import registires in plugin so they exist in embeddable * remove order parameter and move all layer registies into single file * fix functionalt est * pass constructor to sourceREgistry instead of factory * review feedback Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
- Loading branch information
1 parent
325f8e0
commit 467f27b
Showing
36 changed files
with
629 additions
and
416 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
x-pack/legacy/plugins/maps/public/layers/layer_wizard_registry.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
/* eslint-disable @typescript-eslint/consistent-type-definitions */ | ||
|
||
type LayerWizard = { | ||
description: string; | ||
icon: string; | ||
isIndexingSource?: boolean; | ||
renderWizard({ | ||
onPreviewSource, | ||
inspectorAdapters, | ||
}: { | ||
onPreviewSource: () => void; | ||
inspectorAdapters: unknown; | ||
}): unknown; | ||
title: string; | ||
}; | ||
|
||
const registry: LayerWizard[] = []; | ||
|
||
export function registerLayerWizard(layerWizard: LayerWizard) { | ||
registry.push(layerWizard); | ||
} | ||
|
||
export function getLayerWizards(): LayerWizard[] { | ||
return [...registry]; | ||
} |
30 changes: 30 additions & 0 deletions
30
x-pack/legacy/plugins/maps/public/layers/load_layer_wizards.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { registerLayerWizard } from './layer_wizard_registry'; | ||
import { uploadLayerWizardConfig } from './sources/client_file_source'; | ||
import { esDocumentsLayerWizardConfig } from './sources/es_search_source'; | ||
import { clustersLayerWizardConfig, heatmapLayerWizardConfig } from './sources/es_geo_grid_source'; | ||
import { point2PointLayerWizardConfig } from './sources/es_pew_pew_source/es_pew_pew_source'; | ||
import { emsBoundariesLayerWizardConfig } from './sources/ems_file_source'; | ||
import { emsBaseMapLayerWizardConfig } from './sources/ems_tms_source'; | ||
import { kibanaRegionMapLayerWizardConfig } from './sources/kibana_regionmap_source'; | ||
import { kibanaBasemapLayerWizardConfig } from './sources/kibana_tilemap_source'; | ||
import { tmsLayerWizardConfig } from './sources/xyz_tms_source'; | ||
import { wmsLayerWizardConfig } from './sources/wms_source'; | ||
|
||
// Registration order determines display order | ||
registerLayerWizard(uploadLayerWizardConfig); | ||
registerLayerWizard(esDocumentsLayerWizardConfig); | ||
registerLayerWizard(clustersLayerWizardConfig); | ||
registerLayerWizard(heatmapLayerWizardConfig); | ||
registerLayerWizard(point2PointLayerWizardConfig); | ||
registerLayerWizard(emsBoundariesLayerWizardConfig); | ||
registerLayerWizard(emsBaseMapLayerWizardConfig); | ||
registerLayerWizard(kibanaRegionMapLayerWizardConfig); | ||
registerLayerWizard(kibanaBasemapLayerWizardConfig); | ||
registerLayerWizard(tmsLayerWizardConfig); | ||
registerLayerWizard(wmsLayerWizardConfig); |
29 changes: 0 additions & 29 deletions
29
x-pack/legacy/plugins/maps/public/layers/sources/all_sources.js
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.