Skip to content

Commit

Permalink
#2215: fixed some tooltips, fixed removing groups on layer removed, f…
Browse files Browse the repository at this point in the history
…ixed problem with dot in group name
  • Loading branch information
mbarto committed May 27, 2019
1 parent ac66332 commit be13354
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 4 deletions.
1 change: 1 addition & 0 deletions web/client/components/TOC/DefaultGroup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class DefaultGroup extends React.Component {
(<VisibilityCheck
node={this.props.node}
key="visibility"
tooltip="toc.toggleGroupVisibility"
checkType={this.props.visibilityCheckType}
propertiesChangeHandler={this.props.propertiesChangeHandler}/>)
:
Expand Down
7 changes: 4 additions & 3 deletions web/client/components/TOC/Toolbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class Toolbar extends React.Component {
createWidgetTooltip: '',
addLayerTooltip: '',
addGroupTooltip: '',
addSubGroupTooltip: '',
zoomToTooltip: {
LAYER: '',
LAYERS: ''
Expand Down Expand Up @@ -199,7 +200,7 @@ class Toolbar extends React.Component {
<OverlayTrigger
key="addGroup"
placement="top"
overlay={<Tooltip id="toc-tooltip-addGroup">{this.props.text.addGroupTooltip}</Tooltip>}>
overlay={<Tooltip id="toc-tooltip-addGroup">{this.getStatus() === 'GROUP' ? this.props.text.addSubGroupTooltip : this.props.text.addGroupTooltip}</Tooltip>}>
<Button key="addGroup" bsStyle="primary" className="square-button-md" onClick={this.addGroup}>
<Glyphicon glyph="add-folder" />
</Button>
Expand All @@ -226,7 +227,7 @@ class Toolbar extends React.Component {
<OverlayTrigger
key="settings"
placement="top"
overlay={<Tooltip id="toc-tooltip-settings">{this.props.text.settingsTooltip[status ? 'LAYER_LOAD_ERROR' && 'LAYER' : status]}</Tooltip>}>
overlay={<Tooltip id="toc-tooltip-settings">{this.props.text.settingsTooltip[status === 'LAYER_LOAD_ERROR' ? 'LAYER' : status]}</Tooltip>}>
<Button active={this.props.settings.expanded} bsStyle={this.props.settings.expanded ? 'success' : 'primary'} className="square-button-md" onClick={() => { this.showSettings(status); }}>
<Glyphicon glyph="wrench"/>
</Button>
Expand Down Expand Up @@ -365,7 +366,7 @@ class Toolbar extends React.Component {

removeNodes = () => {
this.props.selectedLayers.forEach((layer) => {
this.props.onToolsActions.onRemove(layer.id, 'layers', layer);
this.props.onToolsActions.onRemove(layer.id, 'layers');
});
this.props.onToolsActions.onClear();
this.closeDeleteDialog();
Expand Down
1 change: 1 addition & 0 deletions web/client/plugins/TOC.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ class LayerTree extends React.Component {
addLayer: <Message msgId="toc.addLayer"/>,
addLayerTooltip: <Message msgId="toc.addLayer" />,
addGroupTooltip: <Message msgId="toc.addGroup" />,
addSubGroupTooltip: <Message msgId="toc.addSubGroup" />,
createWidgetTooltip: <Message msgId="toc.createWidget"/>,
zoomToTooltip: {
LAYER: <Message msgId="toc.toolZoomToLayerTooltip"/>,
Expand Down
3 changes: 2 additions & 1 deletion web/client/reducers/layers.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,9 @@ function layers(state = { flat: [] }, action) {
});
}
case ADD_GROUP: {
const id = action.group.replace(/\./g, '\${dot}');
const newGroups = insertNode(state.groups, {
id: action.parent ? (action.parent + '.' + action.group) : action.group,
id: action.parent ? (action.parent + '.' + id) : id,
title: action.group,
name: action.group,
nodes: [],
Expand Down
2 changes: 2 additions & 0 deletions web/client/translations/data.de-DE
Original file line number Diff line number Diff line change
Expand Up @@ -378,10 +378,12 @@
},
"toc": {
"toggleLayerVisibility": "Ändere die Ebenen Sichtbarkeit",
"toggleGroupVisibility": "Gruppensichtbarkeit umschalten",
"displayLegendAndTools": "Legende und Werkzeuge zeigen",
"zoomToLayerExtent": "Zoome auf Ausdehung der Ebene",
"addLayer": "Ebene hinzufügen",
"addGroup": "Gruppe hinzufügen",
"addSubGroup": "Fügen Sie der ausgewählten Gruppe eine Untergruppe hinzu",
"toolZoomToLayerTooltip": "Zoom auf den ausgewählten Ebenen",
"toolZoomToLayersTooltip": "Zoom auf ausgewählte Ebenen",
"toolLayerSettingsTooltip": "Ausgewählte Ebeneneinstellungen",
Expand Down
2 changes: 2 additions & 0 deletions web/client/translations/data.en-US
Original file line number Diff line number Diff line change
Expand Up @@ -378,10 +378,12 @@
},
"toc": {
"toggleLayerVisibility": "Toggle layer visibility",
"toggleGroupVisibility": "Toggle group visibility",
"displayLegendAndTools": "Display legend and tools",
"zoomToLayerExtent": "Zoom to layer extent",
"addLayer": "Add Layer",
"addGroup": "Add Group",
"addSubGroup": "Add sub group to the selected group",
"toolZoomToLayerTooltip": "Zoom to selected layer extent",
"toolZoomToLayersTooltip": "Zoom to selected layers extent",
"toolLayerSettingsTooltip": "Selected layer settings",
Expand Down
2 changes: 2 additions & 0 deletions web/client/translations/data.es-ES
Original file line number Diff line number Diff line change
Expand Up @@ -378,10 +378,12 @@
},
"toc": {
"toggleLayerVisibility": "Activar / desactivar la visibilidad del mapa",
"toggleGroupVisibility": "Alternar la visibilidad del grupo",
"displayLegendAndTools": "Mostrar la leyenda y las herramientas",
"zoomToLayerExtent": "Zoom sobre la extensión del mapa",
"addLayer": "Añadir capa",
"addGroup": "Añadir grupo",
"addSubGroup": "Añadir subgrupo al grupo seleccionado",
"toolZoomToLayerTooltip": "Zoom a la extensión de capa seleccionada",
"toolZoomToLayersTooltip": "Zoom a la extensión de capas seleccionadas",
"toolLayerSettingsTooltip": "Configuración de capa seleccionada",
Expand Down
2 changes: 2 additions & 0 deletions web/client/translations/data.fr-FR
Original file line number Diff line number Diff line change
Expand Up @@ -379,10 +379,12 @@
},
"toc": {
"toggleLayerVisibility": "Activer / désactiver la visibilité du calque",
"toggleGroupVisibility": "Basculer la visibilité du groupe",
"displayLegendAndTools": "Afficher la légende et les outils",
"zoomToLayerExtent": "Zoomer sur l'étendue du calque",
"addLayer": "Ajouter la couche",
"addGroup": "Ajouter un groupe",
"addSubGroup": "Ajouter un sous-groupe au groupe sélectionné",
"toolZoomToLayerTooltip": "Zoomer sur l'extension de la couche sélectionnée",
"toolZoomToLayersTooltip": "Zoomer sur l'extension des couches sélectionnées",
"toolLayerSettingsTooltip": "Réglages de la couche sélectionnée",
Expand Down
2 changes: 2 additions & 0 deletions web/client/translations/data.it-IT
Original file line number Diff line number Diff line change
Expand Up @@ -378,10 +378,12 @@
},
"toc": {
"toggleLayerVisibility": "Attiva o disattiva la visibilità del livello",
"toggleGroupVisibility": "Attiva o disattiva la visibilità del gruppo",
"displayLegendAndTools": "Visualizza legenda e strumenti aggiuntivi",
"zoomToLayerExtent": "Zoom all' estensione del livello",
"addLayer": "Aggiungi Livello",
"addGroup": "Aggiungi Gruppo",
"addSubGroup": "Aggiungi sotto gruppo al gruppo selezionato",
"toolZoomToLayerTooltip": "Zoom all' estensione del livello",
"toolZoomToLayersTooltip": "Zoom all' estensione del livelli",
"toolLayerSettingsTooltip": "Modifica proprietà del livello selezionato",
Expand Down

0 comments on commit be13354

Please sign in to comment.