From b85f3bf1444513bbc635581b6d124b0593b2baa4 Mon Sep 17 00:00:00 2001 From: Matteo Velludini Date: Tue, 11 Oct 2016 18:11:21 +0200 Subject: [PATCH] fixed #1128 : owner defined when a map is created by SaveAsPlugin --- web/client/plugins/SaveAs.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/client/plugins/SaveAs.jsx b/web/client/plugins/SaveAs.jsx index 05be459cc8..3a0ef844fb 100644 --- a/web/client/plugins/SaveAs.jsx +++ b/web/client/plugins/SaveAs.jsx @@ -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 })); @@ -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, @@ -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()), {