From cf657fd226783cab65e9822c4be0b99239029dd1 Mon Sep 17 00:00:00 2001 From: Vijayan Balasubramanian Date: Mon, 5 Dec 2022 22:10:58 -0800 Subject: [PATCH 1/4] Add type to layer settings Include type to layer basic settings. Added function to map layer type to name, since, user is interested in name. Signed-off-by: Vijayan Balasubramanian --- .../components/layer_config/layer_basic_settings.tsx | 4 ++++ maps_dashboards/public/model/layersFunctions.ts | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/maps_dashboards/public/components/layer_config/layer_basic_settings.tsx b/maps_dashboards/public/components/layer_config/layer_basic_settings.tsx index 7b3553c1..0d2bfe7c 100644 --- a/maps_dashboards/public/components/layer_config/layer_basic_settings.tsx +++ b/maps_dashboards/public/components/layer_config/layer_basic_settings.tsx @@ -20,6 +20,7 @@ import { MAP_LAYER_DEFAULT_MAX_OPACITY, MAP_LAYER_DEFAULT_OPACITY_STEP, } from '../../../common'; +import { layersTypeNameMap } from '../../model/layersFunctions'; interface Props { selectedLayerConfig: MapLayerSpecification; @@ -41,6 +42,9 @@ export const LayerBasicSettings = ({ selectedLayerConfig, setSelectedLayerConfig return ( + + + diff --git a/maps_dashboards/public/model/layersFunctions.ts b/maps_dashboards/public/model/layersFunctions.ts index ba85847e..b6c0c2a7 100644 --- a/maps_dashboards/public/model/layersFunctions.ts +++ b/maps_dashboards/public/model/layersFunctions.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { DASHBOARDS_MAPS_LAYER_TYPE } from '../../common'; +import { DASHBOARDS_MAPS_LAYER_NAME, DASHBOARDS_MAPS_LAYER_TYPE } from '../../common'; import { OSMLayerFunctions } from './OSMLayerFunctions'; import { DocumentLayerFunctions } from './documentLayerFunctions'; @@ -11,3 +11,8 @@ export const layersFunctionMap: { [key: string]: any } = { [DASHBOARDS_MAPS_LAYER_TYPE.OPENSEARCH_MAP]: OSMLayerFunctions, [DASHBOARDS_MAPS_LAYER_TYPE.DOCUMENTS]: DocumentLayerFunctions, }; + +export const layersTypeNameMap: { [key: string]: any } = { + [DASHBOARDS_MAPS_LAYER_TYPE.OPENSEARCH_MAP]: DASHBOARDS_MAPS_LAYER_NAME.OPENSEARCH_MAP, + [DASHBOARDS_MAPS_LAYER_TYPE.DOCUMENTS]: DASHBOARDS_MAPS_LAYER_NAME.DOCUMENTS, +}; From 8a881866d31e8592caddb92a1f407dc904ddebca Mon Sep 17 00:00:00 2001 From: Vijayan Balasubramanian Date: Mon, 5 Dec 2022 22:39:12 -0800 Subject: [PATCH 2/4] Add description to layer settings Added text area to accept description. Added properties to save description. Signed-off-by: Vijayan Balasubramanian --- .../components/layer_config/layer_basic_settings.tsx | 10 ++++++++++ maps_dashboards/public/model/mapLayerType.ts | 2 ++ 2 files changed, 12 insertions(+) diff --git a/maps_dashboards/public/components/layer_config/layer_basic_settings.tsx b/maps_dashboards/public/components/layer_config/layer_basic_settings.tsx index 0d2bfe7c..83c8cc8f 100644 --- a/maps_dashboards/public/components/layer_config/layer_basic_settings.tsx +++ b/maps_dashboards/public/components/layer_config/layer_basic_settings.tsx @@ -11,6 +11,7 @@ import { EuiFormRow, EuiRange, EuiFormLabel, + EuiTextArea, } from '@elastic/eui'; import { MapLayerSpecification } from '../../model/mapLayerType'; import { @@ -40,6 +41,10 @@ export const LayerBasicSettings = ({ selectedLayerConfig, setSelectedLayerConfig setSelectedLayerConfig({ ...selectedLayerConfig, name: String(e.target.value) }); }; + const onDescriptionChange = (e: any) => { + setSelectedLayerConfig({ ...selectedLayerConfig, description: String(e.target.value) }); + }; + return ( @@ -48,6 +53,11 @@ export const LayerBasicSettings = ({ selectedLayerConfig, setSelectedLayerConfig + + + + + Date: Mon, 5 Dec 2022 22:54:20 -0800 Subject: [PATCH 3/4] Update to Zoom levels Rename Zoom text to Zoom levels on display Signed-off-by: Vijayan Balasubramanian --- .../public/components/layer_config/layer_basic_settings.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maps_dashboards/public/components/layer_config/layer_basic_settings.tsx b/maps_dashboards/public/components/layer_config/layer_basic_settings.tsx index 83c8cc8f..fe8189ae 100644 --- a/maps_dashboards/public/components/layer_config/layer_basic_settings.tsx +++ b/maps_dashboards/public/components/layer_config/layer_basic_settings.tsx @@ -58,7 +58,7 @@ export const LayerBasicSettings = ({ selectedLayerConfig, setSelectedLayerConfig - + Date: Tue, 6 Dec 2022 09:45:44 -0800 Subject: [PATCH 4/4] Update parameter type Signed-off-by: Vijayan Balasubramanian --- maps_dashboards/public/model/layersFunctions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maps_dashboards/public/model/layersFunctions.ts b/maps_dashboards/public/model/layersFunctions.ts index b6c0c2a7..6ea5aa6c 100644 --- a/maps_dashboards/public/model/layersFunctions.ts +++ b/maps_dashboards/public/model/layersFunctions.ts @@ -12,7 +12,7 @@ export const layersFunctionMap: { [key: string]: any } = { [DASHBOARDS_MAPS_LAYER_TYPE.DOCUMENTS]: DocumentLayerFunctions, }; -export const layersTypeNameMap: { [key: string]: any } = { +export const layersTypeNameMap: { [key: string]: string } = { [DASHBOARDS_MAPS_LAYER_TYPE.OPENSEARCH_MAP]: DASHBOARDS_MAPS_LAYER_NAME.OPENSEARCH_MAP, [DASHBOARDS_MAPS_LAYER_TYPE.DOCUMENTS]: DASHBOARDS_MAPS_LAYER_NAME.DOCUMENTS, };