Skip to content

Commit

Permalink
fixed #1128 : owner defined when a map is created by SaveAsPlugin
Browse files Browse the repository at this point in the history
  • Loading branch information
MV88 committed Oct 11, 2016
1 parent 451d9c1 commit b85f3bf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion web/client/plugins/SaveAs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const selector = createSelector(mapSelector, stateSelector, layersSelector, (map
mapType: (state && ((state.home && state.home.mapType) || (state.maps && state.maps.mapType))) || "leaflet",
newMapId: state.currentMap && state.currentMap.newMapId,
map,
user: state.security && state.security.user,
currentMap: state.currentMap,
layers
}));
Expand All @@ -37,6 +38,7 @@ const SaveAs = React.createClass({
show: React.PropTypes.bool,
newMapId: React.PropTypes.number,
map: React.PropTypes.object,
user: React.PropTypes.object,
mapType: React.PropTypes.string,
layers: React.PropTypes.array,
params: React.PropTypes.object,
Expand Down Expand Up @@ -139,9 +141,11 @@ const SaveAs = React.createClass({
saveMap(id, name, description) {
this.props.editMap(this.props.map);
let thumbComponent = this.refs.metadataModal.refs.thumbnail;
let attributes = {"owner": this.props.user && this.props.user.name || null};
let metadata = {
name,
description
description,
attributes
};
thumbComponent.getThumbnailDataUri( (data) => {
this.props.onMapSave(metadata, JSON.stringify(this.createV2Map()), {
Expand Down

0 comments on commit b85f3bf

Please sign in to comment.