Skip to content

Commit

Permalink
Fix geosolutions-it#1151 added proper keys and property types.
Browse files Browse the repository at this point in the history
 - Fixed also persistance of catalog configuration geosolutions-it#1145
  • Loading branch information
offtherailz committed Oct 14, 2016
1 parent 61f5eb4 commit 7e746ca
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 16 deletions.
1 change: 1 addition & 0 deletions web/client/components/TOC/DefaultLayer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ var DefaultLayer = React.createClass({
<Title onClick={this.props.onToggle}/>
<InlineSpinner loading={this.props.node.loading}/>
<LayersTool key="loadingerror"
id={"loadingError" + this.props.node.id}
style={{"display": this.props.node.loadingError ? "block" : "none", color: "red", cursor: "default"}}
glyph="ban-circle"
tooltip="toc.loadingerror"
Expand Down
4 changes: 2 additions & 2 deletions web/client/components/TOC/fragments/LayersTool.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const LayersTool = React.createClass({
onClick: React.PropTypes.func,
style: React.PropTypes.object,
glyph: React.PropTypes.string,
tooltip: React.PropTypes.tooltip
tooltip: React.PropTypes.string
},
getDefaultProps() {
return {
Expand All @@ -32,7 +32,7 @@ const LayersTool = React.createClass({
glyph={this.props.glyph}
onClick={(options) => this.props.onClick(this.props.node, options || {})}/>);
return this.props.tooltip ? (
<OverlayTrigger placement="bottom" overlay={(<Tooltip><strong><Message msgId={this.props.tooltip}/></strong></Tooltip>)}>
<OverlayTrigger placement="bottom" overlay={(<Tooltip id={"tooltip-" + (this.props.node && this.props.node.id)}><strong><Message msgId={this.props.tooltip}/></strong></Tooltip>)}>
{tool}
</OverlayTrigger>) : tool;

Expand Down
8 changes: 4 additions & 4 deletions web/client/components/maps/MapGrid.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ var MapGrid = React.createClass({
deleteMap: React.PropTypes.func,
resetCurrentMap: React.PropTypes.func,
updatePermissions: React.PropTypes.func,
metadataModal: React.PropTypes.object
metadataModal: React.PropTypes.func
},
getDefaultProps() {
return {
Expand Down Expand Up @@ -90,7 +90,7 @@ var MapGrid = React.createClass({
renderMetadataModal() {
if (this.props.metadataModal) {
let MetadataModal = this.props.metadataModal;
return (<MetadataModal ref="metadataModal" show={this.props.currentMap && this.props.currentMap.displayMetadataEdit} onHide={this.props.resetCurrentMap}
return (<MetadataModal key="metadataModal" ref="metadataModal" show={this.props.currentMap && this.props.currentMap.displayMetadataEdit} onHide={this.props.resetCurrentMap}
onClose={this.props.resetCurrentMap}
map={this.props.currentMap}
onSaveAll={this.props.saveAll}
Expand All @@ -105,10 +105,10 @@ var MapGrid = React.createClass({
render: function() {
return (
<Grid fluid={this.props.fluid}>
<Row>
<Row key="maps">
{this.props.loading && this.props.maps.length === 0 ? this.renderLoading() : this.renderMaps(this.props.maps || [], this.props.mapType)}
</Row>
<Row>
<Row key="bottom">
{this.props.bottom}
</Row>
{this.renderMetadataModal()}
Expand Down
2 changes: 1 addition & 1 deletion web/client/components/misc/Dialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const Dialog = React.createClass({
return React.Children.toArray(this.props.children).filter((child) => child.props.role === role);
},
render() {
const dialog = (<Draggable className="modal-content" start={this.props.start} handle=".draggable-header, .draggable-header *">
const dialog = (<Draggable start={this.props.start} handle=".draggable-header, .draggable-header *">
<div id={this.props.id} style={{zIndex: 3, ...this.props.style}} className={this.props.className + " modal-dialog-container"}>
<div className={this.props.headerClassName + " draggable-header"}>
{this.renderRole('header')}
Expand Down
2 changes: 1 addition & 1 deletion web/client/plugins/CreateNewMap.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ const CreateNewMap = React.createClass({
module.exports = {
CreateNewMapPlugin: connect((state) => ({
mapType: (state.maps && state.maps.mapType) || (state.home && state.home.mapType),
isLoggedIn: state && state.security && state.security.user
isLoggedIn: !!(state && state.security && state.security.user)
}))(CreateNewMap)
};
5 changes: 3 additions & 2 deletions web/client/plugins/MetadataExplorer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const MetadataExplorerComponent = React.createClass({
panelClassName: React.PropTypes.string,
toggleControl: React.PropTypes.func,
closeGlyph: React.PropTypes.string,
buttonStyle: React.PropTypes.string,
buttonStyle: React.PropTypes.object,
style: React.PropTypes.object
},
getDefaultProps() {
Expand All @@ -71,7 +71,8 @@ const MetadataExplorerComponent = React.createClass({
},
panelClassName: "toolbar-panel",
toggleControl: () => {},
closeGlyph: ""
closeGlyph: "",
buttonStyle: {}
};
},
render() {
Expand Down
8 changes: 4 additions & 4 deletions web/client/plugins/containers/ToolsContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const ToolsContainer = React.createClass({
})(this.props.tool);
},
renderTools() {
return this.props.tools.map((tool) => {
return this.props.tools.map((tool, i) => {
if (tool.element) {
return tool.element;
}
Expand All @@ -110,7 +110,7 @@ const ToolsContainer = React.createClass({
const Tool = this.getTool(tool);

return this.addTooltip(
<Tool tooltip={tooltip} btnSize={this.props.toolSize} bsStyle={this.props.toolStyle} help={help} key={tool.name} mapType={this.props.mapType}
<Tool tooltip={tooltip} btnSize={this.props.toolSize} bsStyle={this.props.toolStyle} help={help} key={tool.name || ("tool" + i)} mapType={this.props.mapType}
{...tool.cfg} items={tool.items || []}>
{(tool.cfg && tool.cfg.glyph) ? <Glyphicon glyph={tool.cfg.glyph}/> : tool.icon}{help} {tool.text}
</Tool>,
Expand Down Expand Up @@ -140,8 +140,8 @@ const ToolsContainer = React.createClass({
render() {
const Container = this.props.container;
return (
<span id={this.props.id}>
<Container id={this.props.id + "-container"} style={this.props.style} className={this.props.className}>
<span key={this.props.id} id={this.props.id}>
<Container key={this.props.id + "-container"} id={this.props.id + "-container"} style={this.props.style} className={this.props.className}>
{this.renderTools()}
</Container>
{this.renderPanels()}
Expand Down
4 changes: 2 additions & 2 deletions web/client/reducers/catalog.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ function catalog(state = null, action) {
layerError: null
});
case CATALOG_RESET: {
return {
return assign({}, state, {
result: null,
loadingError: null,
format: action.format,
layerError: null
};
});
}
case RECORD_LIST_LOAD_ERROR:
return assign({}, state, {
Expand Down

0 comments on commit 7e746ca

Please sign in to comment.