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

Fixed #1641 - Added cache param in Display layer properties #1784

Merged
merged 3 commits into from
May 4, 2017
Merged
Changes from 1 commit
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
Next Next commit
Fixed #1641 - Added cache tab in the layer properties
MV88 committed May 4, 2017
commit 6d094283d64de13d9ee3de68906607664d5bb4ea
4 changes: 1 addition & 3 deletions docma-config.json
Original file line number Diff line number Diff line change
@@ -63,12 +63,10 @@
"label": "Reference",
"items": [
{ "label": "Framework", "href": "api/framework"},

{ "separator": true },
{ "label": "JavaScript API", "href": "api/jsapi" },
{ "separator": true },
{ "label": "Plugins", "href": "api/plugins" }

]
},
{
@@ -105,7 +103,7 @@
},
"src": [
{
"framework" : [
"framework": [
"web/client/components/index.jsdoc",
"web/client/components/buttons/FullScreenButton.jsx",
"web/client/components/buttons/GlobeViewSwitcherButton.jsx",
16 changes: 14 additions & 2 deletions web/client/components/TOC/fragments/SettingsModal.jsx
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@ const ConfirmButton = require('../../buttons/ConfirmButton');
const General = require('./settings/General');
const Display = require('./settings/Display');
const WMSStyle = require('./settings/WMSStyle');
const Cache = require('./settings/Cache');
const Elevation = require('./settings/Elevation');
const Portal = require('../../misc/Portal');
const assign = require('object-assign');
@@ -129,6 +130,15 @@ const SettingsModal = React.createClass({
o/>);
}
},
renderCache() {
if (this.props.element.type === "wms") {
return (<Cache
element={this.props.element}
key="cache"
onChange={(value) => this.updateParams({tiled: value}, true)}
/>);
}
},
renderElevationTab() {
const elevationDim = this.props.getDimension(this.props.element.dimensions, 'elevation');
if (this.props.element.type === "wms" && this.props.element.dimensions && elevationDim) {
@@ -145,11 +155,13 @@ const SettingsModal = React.createClass({
const general = this.renderGeneral();
const display = this.renderDisplay();
const style = this.renderStyleTab();
const cache = this.renderCache();
const elevation = this.renderElevationTab();
const availableTabs = [<Tab eventKey={1} title={<Message msgId="layerProperties.general" />}>{general}</Tab>,
<Tab eventKey={2} title={<Message msgId="layerProperties.display" />}>{display}</Tab>,
<Tab eventKey={3} title={<Message msgId="layerProperties.style" />} disabled={!style} >{style}</Tab>]
.concat(elevation ? [<Tab eventKey={4} title={<Message msgId="layerProperties.elevation" />}>{elevation}</Tab>] : []);
<Tab eventKey={3} title={<Message msgId="layerProperties.style" />} disabled={!style} >{style}</Tab>,
<Tab eventKey={4} title={<Message msgId="layerProperties.cache" />} >{cache}</Tab>]
.concat(elevation ? [<Tab eventKey={5} title={<Message msgId="layerProperties.elevation" />}>{elevation}</Tab>] : []);
const tabs = <Tabs defaultActiveKey={1} id="layerProperties-tabs">{availableTabs}</Tabs>;
const footer = (<span role="footer">
{this.props.includeCloseButton ? <Button bsSize={this.props.buttonSize} onClick={this.onClose}>{this.props.closeText}</Button> : <span/>}
39 changes: 39 additions & 0 deletions web/client/components/TOC/fragments/settings/Cache.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Copyright 2017, GeoSolutions Sas.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/

const React = require('react');
const {Checkbox, Form, FormGroup} = require('react-bootstrap');
const Message = require('../../../I18N/Message');

/**
* Cache Settings for layer
*/
const Cache = React.createClass({
propTypes: {
element: React.PropTypes.object,
onChange: React.PropTypes.func
},
getDefaultProps() {
return {
element: {},
onChange: () => {}
};
},
render() {

return (<Form ref="cache">
<FormGroup controlId="formCache">
<Checkbox key="cache" value="tiled"
onChange={(e) => this.props.onChange(e.target.checked)} checked={this.props.element && this.props.element.tiled !== undefined ? this.props.element.tiled : true} ><Message msgId="layerProperties.cached"/></Checkbox>
</FormGroup>

</Form>);
}
});

module.exports = Cache;
6 changes: 6 additions & 0 deletions web/client/translations/data.de-DE
Original file line number Diff line number Diff line change
@@ -29,6 +29,8 @@
"general": "Generell",
"display": "Darstellung",
"style": "Stil",
"cache": "Cache",
"cached": "Verwenden Sie Cache-Optionen",
"styleCustom": "Stil \"{value}\" nutzen",
"styleListLoadError": "Es gab einen Fehler beim Laden der Liste von Stilen",
"stylesRefreshList": "Aktualisiere die Liste von Stilen",
@@ -40,6 +42,10 @@
"featureTypeError": "Layerattribute können nicht geladen werden",
"elevation": "Höhe"
},
"globeswitcher": {
"tooltipDeactivate": "Beenden Sie den 3D-Modus",
"tooltipActivate": "Geben Sie den 3D-Modus ein"
},
"background": "Hintergrund",
"language": "Sprache",
"mousePositionCoordinates": "Koordinatenanzeige",
6 changes: 6 additions & 0 deletions web/client/translations/data.en-US
Original file line number Diff line number Diff line change
@@ -29,6 +29,8 @@
"general": "General",
"display": "Display",
"style": "Style",
"cache": "Cache",
"cached": "Use cache options",
"styleCustom": "Use style named \"{value}\"",
"styleListLoadError": "There was an error loading the styles list",
"stylesRefreshList": "Refresh Styles List",
@@ -40,6 +42,10 @@
"featureTypeError": "Cannot load layer attributes",
"elevation": "Elevation"
},
"globeswitcher": {
"tooltipDeactivate": "Exit 3D Mode",
"tooltipActivate": "Enter 3D Mode"
},
"background": "Background",
"language": "Language",
"mousePositionCoordinates": "Coordinates indicator",
6 changes: 6 additions & 0 deletions web/client/translations/data.fr-FR
Original file line number Diff line number Diff line change
@@ -29,6 +29,8 @@
"general": "Général",
"display": "Affichage",
"style": "Style",
"cache": "Cache",
"cached": "Utiliser les options de cache",
"styleCustom": "Utilisez un style nommé \"{value} \"",
"styleListLoadError": "Une erreur s'est produite lors du chargement de la liste de styles",
"stylesRefreshList": "Actualiser la liste des styles",
@@ -40,6 +42,10 @@
"featureTypeError": "Impossible de charger les attributs de calque",
"elevation": "élévation"
},
"globeswitcher": {
"tooltipDeactivate": "Sortie en mode 3D",
"tooltipActivate": "Entrez le mode 3D"
},
"enable": "Activer",
"background": "Fond de plan",
"language": "langue",
6 changes: 6 additions & 0 deletions web/client/translations/data.it-IT
Original file line number Diff line number Diff line change
@@ -29,6 +29,8 @@
"general": "Generale",
"display": "Visualizzazione",
"style": "Stile",
"cache": "Cache",
"cached": "Usa la cache",
"styleCustom": "Usa stile con nome \"{value}\"",
"styleListLoadError": "Si è verificato un errore durante il caricamento della lista degli stili",
"stylesRefreshList": "Aggiorna lista degli stili",
@@ -40,6 +42,10 @@
"featureTypeError": "Impossibile caricare gli attributi del layer",
"elevation": "Elevazione"
},
"globeswitcher": {
"tooltipDeactivate": "Disattiva la modalità 3D",
"tooltipActivate": "Attiva la modalità 3D"
},
"background": "Sfondo",
"language": "Lingua",
"mousePositionCoordinates": "Indicatore di coordinate",
2 changes: 1 addition & 1 deletion web/client/utils/PluginsUtils.js
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@ const parseExpression = (state = {}, context = {}, value) => {
/*eslint-enable */
/**
* Parses a expression string "{some javascript}" and evaluate it.
* The expression will be evalueted getting as parameters the state and the context and the request.
* The expression will be evaluated getting as parameters the state and the context and the request.
* @memberof utils.PluginsUtils
* @param {object} state the state context
* @param {object} context the context element