Skip to content
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

[Backport 4.x][Fixes #1072] Dataset legend must show the dataset's title instead of Geoserver's layername #1101

Merged
merged 1 commit into from
Jul 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions geonode_mapstore_client/client/js/plugins/Legend.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { layersSelector } from '@mapstore/framework/selectors/layers';
import OpacitySlider from '@mapstore/framework/components/TOC/fragments/OpacitySlider';
import { updateNode } from '@mapstore/framework/actions/layers';
import VisibilityCheck from '@mapstore/framework/components/TOC/fragments/VisibilityCheck';
import Message from '@mapstore/framework/components/I18N/HTML';

function Legend({
layers,
Expand All @@ -30,14 +31,14 @@ function Legend({
return layers.length > 0 && <div className="shadow gn-legend-wrapper" style={{width: expandLegend ? 'auto' : '80px'}}>
<div onClick={expand} className="gn-legend-head">
<span role="button" className={`identify-icon glyphicon glyphicon-chevron-${expandLegend ? 'down' : 'right'}`} title="Expand layer legend" />
<span className="gn-legend-list-item">Legend</span>
<span className="gn-legend-list-item"><Message msgId="gnviewer.legend" /></span>
</div>
<ul className="gn-legend-list" style={{display: expandLegend ? 'inline-block' : 'none'}}>
{layers.map((layer, ind) => <Fragment key={ind}>
<li className="gn-legend-list-item"><VisibilityCheck key="visibilitycheck"
tooltip={layer.loadingError === 'Warning' ? 'toc.toggleLayerVisibilityWarning' : 'toc.toggleLayerVisibility'}
node={layer}
propertiesChangeHandler={(id, options) => onUpdateNode(id, 'layers', options)} /><p>{layer.name || layer.title}</p></li>
propertiesChangeHandler={(id, options) => onUpdateNode(id, 'layers', options)} /><p>{layer.title}</p></li>
<li className="gn-legend-bottom">
<OpacitySlider
opacity={layer.opacity}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@
"legendWidth": "Legendensymbolbreite",
"legendHeight": "Höhe des Legendensymbols",
"legendPreview": "Legendenvorschau",
"legend": "Legende",
"nodeTooltipContent": "Tooltip-Inhalt",
"nodeTooltipPlacement": "Tooltip-Platzierung",

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@
"legendWidth": "Legend symbol width",
"legendHeight": "Legend symbol height",
"legendPreview": "Legend preview",
"legend": "Legend",
"nodeTooltipContent": "Tooltip content",
"nodeTooltipPlacement": "Tooltip placement",

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@
"legendWidth": "Ancho del símbolo de leyenda",
"legendHeight": "Altura del símbolo de leyenda",
"legendPreview": "Vista previa de la leyenda",
"legend": "Leyenda",
"nodeTooltipContent": "Contenido de la información sobre herramientas",
"nodeTooltipPlacement": "Ubicación de información sobre herramientas",
"zoomToLayer": "Zoom a la extensión de la capa",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@
"legendWidth": "Largeur du symbole de la légende",
"legendHeight": "Hauteur du symbole de la légende",
"legendPreview": "Aperçu de la légende",
"legend": "Légende",
"nodeTooltipContent": "Contenu de l'info-bulle",
"nodeTooltipPlacement": "Placement de l'info-bulle",

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@
"legendWidth": "Larghezza simbolo legenda",
"legendHeight": "Altezza simbolo legenda",
"legendPreview": "Anteprima legenda",
"legend": "Legenda",
"nodeTooltipContent": "Contenuto tooltip",
"nodeTooltipPlacement": "Posizionamento tooltip",

Expand Down