-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve UX #142
Improve UX #142
Conversation
8bacaad
to
32f8002
Compare
@@ -301,7 +301,7 @@ export const LayerControlPanel = memo( | |||
<EuiFlexItem> | |||
<EuiListGroupItem | |||
key={layer.id} | |||
label={layer.name} | |||
label={layer.name || layersTypeNameMap[layer.type]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For pending new layer, how about name "New " + layersTypeNameMap[layer.type]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Synced with Vijay, let's have input from UX here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated new layer name as New layer
dc12ace
to
d9eff11
Compare
|
||
function onClickAddNewLayer(layerType: string) { | ||
const initLayerConfig = getLayerConfigMap()[layerType]; | ||
initLayerConfig.name = 'New layer ' + nextLayerIndex; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about use layers.length + 1
for the new layer number? The nextLayerIndex will keep increasing even if I create a new layer but discard it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. But i don't think we have access to total layer inside Add layer panel, if not, how to get layer count without adding new dependency? or else, i have to move inside layer_control_panel. Let me see how does it look if i move it inside add_layer()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can create a function in LayerControlPanel and pass it to AddLayerPanel which can help get new layer index from layers.
const getNewLayerIndex = () => {
return layers.length + 1;
};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got error message from initLayerConfig.name = 'New layer ' + nextLayerIndex;
, we might need to change not use enum for DASHBOARDS_MAPS_LAYER_NAME
TS2322: Type 'string' is not assignable to type 'DASHBOARDS_MAPS_LAYER_NAME'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kept default value as empty string.
@@ -4,7 +4,7 @@ | |||
*/ | |||
|
|||
import { Map as Maplibre } from 'maplibre-gl'; | |||
import { DASHBOARDS_MAPS_LAYER_NAME, DASHBOARDS_MAPS_LAYER_TYPE } from '../../common'; | |||
import { DASHBOARDS_MAPS_LAYER_ICON, DASHBOARDS_MAPS_LAYER_NAME, DASHBOARDS_MAPS_LAYER_TYPE } from "../../common"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { DASHBOARDS_MAPS_LAYER_ICON, DASHBOARDS_MAPS_LAYER_NAME, DASHBOARDS_MAPS_LAYER_TYPE } from "../../common"; | |
import { | |
DASHBOARDS_MAPS_LAYER_ICON, | |
DASHBOARDS_MAPS_LAYER_NAME, | |
DASHBOARDS_MAPS_LAYER_TYPE, | |
} from '../../common'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
@@ -153,7 +156,7 @@ const TooltipTable = ({ | |||
</EuiFlexGroup> | |||
<EuiSpacer size="s" /> | |||
<EuiFlexGroup justifyContent="spaceAround" alignItems="center" gutterSize="none"> | |||
{showLayerSelection && ( | |||
{showLayerSelection && options?.length > 1 && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be >=1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need layer selection only if there are more than 1 layer.
298c475
to
d95af64
Compare
Shall we also update the layer name to "Default map" at add new layer modal? |
Default map is layer name for default layer created by Maps. We don't have to rename OpenSearch Map as default map since in future we might allow users to customize this default layer. |
maps_dashboards/public/components/add_layer_panel/add_layer_panel.tsx
Outdated
Show resolved
Hide resolved
maps_dashboards/public/components/layer_config/layer_config_panel.tsx
Outdated
Show resolved
Hide resolved
maps_dashboards/public/components/layer_config/layer_config_panel.tsx
Outdated
Show resolved
Hide resolved
Signed-off-by: Vijayan Balasubramanian <[email protected]>
Set new layer name as New layer Set default OpenSearch Map as "Default map" Added tooltip for buttons Layer type icon is added before title Signed-off-by: Vijayan Balasubramanian <[email protected]>
Show layer selection only if more than 1 layers are available. Signed-off-by: Vijayan Balasubramanian <[email protected]>
Signed-off-by: Vijayan Balasubramanian <[email protected]>
Signed-off-by: Vijayan Balasubramanian <[email protected]>
Description
Demo
Icons are updated as below and updated layer names
Add layer panel
Layer type Icon is added before tile
Issues Resolved
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.