diff --git a/web/client/epics/mapexport.js b/web/client/epics/mapexport.js index 0377ebf3d6..ccc48b2298 100644 --- a/web/client/epics/mapexport.js +++ b/web/client/epics/mapexport.js @@ -12,13 +12,12 @@ const {EXPORT_MAP} = require('../actions/mapexport'); const { setControlProperty } = require('../actions/controls'); const { mapSelector } = require('../selectors/map'); -const { mapInfoConfigurationSelector } = require('../selectors/mapInfo'); const { layersSelector, groupsSelector } = require('../selectors/layers'); const { mapOptionsToSaveSelector } = require('../selectors/mapsave'); const textSearchConfigSelector = state => state.searchconfig && state.searchconfig.textSearchConfig; const PersistMap = { - mapstore2: (state) => JSON.stringify(MapUtils.saveMapConfiguration(mapSelector(state), layersSelector(state), groupsSelector(state), textSearchConfigSelector(state), mapOptionsToSaveSelector(state), mapInfoConfigurationSelector(state))) + mapstore2: (state) => JSON.stringify(MapUtils.saveMapConfiguration(mapSelector(state), layersSelector(state), groupsSelector(state), textSearchConfigSelector(state), mapOptionsToSaveSelector(state))) }; diff --git a/web/client/plugins/Save.jsx b/web/client/plugins/Save.jsx index c17f90eedf..e8e2cfc4a7 100644 --- a/web/client/plugins/Save.jsx +++ b/web/client/plugins/Save.jsx @@ -23,14 +23,13 @@ const ConfigUtils = require('../utils/ConfigUtils'); const {mapSelector} = require('../selectors/map'); const {layersSelector, groupsSelector} = require('../selectors/layers'); const {mapOptionsToSaveSelector} = require('../selectors/mapsave'); -const {mapInfoConfigurationSelector} = require('../selectors/mapInfo'); const MapUtils = require('../utils/MapUtils'); const showSelector = state => state.controls && state.controls.save && state.controls.save.enabled; const textSearchConfigSelector = state => state.searchconfig && state.searchconfig.textSearchConfig; const selector = createSelector( - mapSelector, mapOptionsToSaveSelector, layersSelector, groupsSelector, showSelector, textSearchConfigSelector, mapInfoConfigurationSelector, - (map, additionalOptions, layers, groups, show, textSearchConfig, mapInfoConfiguration) => ({ + mapSelector, mapOptionsToSaveSelector, layersSelector, groupsSelector, showSelector, textSearchConfigSelector, + (map, additionalOptions, layers, groups, show, textSearchConfig) => ({ currentZoomLvl: map && map.zoom, show, map, @@ -38,8 +37,7 @@ const selector = createSelector( mapId: map && map.mapId, layers, textSearchConfig, - groups, - mapInfoConfiguration + groups })); class Save extends React.Component { @@ -53,7 +51,6 @@ class Save extends React.Component { map: PropTypes.object, layers: PropTypes.array, groups: PropTypes.array, - mapInfoConfiguration: PropTypes.object, params: PropTypes.object, textSearchConfig: PropTypes.object }; @@ -95,7 +92,7 @@ class Save extends React.Component { goForTheUpdate = () => { if (this.props.mapId) { if (this.props.map && this.props.layers) { - const resultingmap = MapUtils.saveMapConfiguration(this.props.map, this.props.layers, this.props.groups, this.props.textSearchConfig, this.props.additionalOptions, this.props.mapInfoConfiguration); + const resultingmap = MapUtils.saveMapConfiguration(this.props.map, this.props.layers, this.props.groups, this.props.textSearchConfig, this.props.additionalOptions); const {name, description} = this.props.map.info; this.props.onMapSave({id: this.props.mapId, data: resultingmap, metadata: {name, description}, category: "MAP"}); this.props.onClose(); diff --git a/web/client/plugins/SaveAs.jsx b/web/client/plugins/SaveAs.jsx index 21a042e54a..488362033a 100644 --- a/web/client/plugins/SaveAs.jsx +++ b/web/client/plugins/SaveAs.jsx @@ -42,15 +42,13 @@ const selector = createSelector( groupsSelector, mapOptionsToSaveSelector, saveAsStateSelector, - mapInfoConfigurationSelector, - (map, layers, groups, additionalOptions, saveAsState, mapInfoConfiguration) => ({ + (map, layers, groups, additionalOptions, saveAsState) => ({ currentZoomLvl: map && map.zoom, map, layers, groups, additionalOptions, - ...saveAsState, - mapInfoConfiguration + ...saveAsState })); class SaveAs extends React.Component { @@ -78,8 +76,7 @@ class SaveAs extends React.Component { metadataChanged: PropTypes.func, onMapSave: PropTypes.func, loadMapInfo: PropTypes.func, - textSearchConfig: PropTypes.object, - mapInfoConfiguration: PropTypes.object + textSearchConfig: PropTypes.object }; static contextTypes = { @@ -144,7 +141,7 @@ class SaveAs extends React.Component { // this method creates the content for the Map Resource createV2Map = () => { - return MapUtils.saveMapConfiguration(this.props.map, this.props.layers, this.props.groups, this.props.textSearchConfig, this.props.additionalOptions, this.props.mapInfoConfiguration); + return MapUtils.saveMapConfiguration(this.props.map, this.props.layers, this.props.groups, this.props.textSearchConfig, this.props.additionalOptions); }; saveMap = (id, name, description) => { diff --git a/web/client/selectors/mapsave.js b/web/client/selectors/mapsave.js index 23573af2ce..1747f806f9 100644 --- a/web/client/selectors/mapsave.js +++ b/web/client/selectors/mapsave.js @@ -9,6 +9,8 @@ const {createStructuredSelector} = require('reselect'); const {servicesSelector, selectedServiceSelector} = require('./catalog'); const {getFloatingWidgets, getCollapsedState, getFloatingWidgetsLayout} = require('./widgets'); +const { mapInfoConfigurationSelector } = require('./mapInfo'); + const mapOptionsToSaveSelector = createStructuredSelector({ catalogServices: createStructuredSelector({ @@ -19,6 +21,7 @@ const mapOptionsToSaveSelector = createStructuredSelector({ widgets: getFloatingWidgets, layouts: getFloatingWidgetsLayout, collapsed: getCollapsedState - }) + }), + mapInfoConfiguration: mapInfoConfigurationSelector }); module.exports = {mapOptionsToSaveSelector}; diff --git a/web/client/utils/__tests__/MapUtils-test.js b/web/client/utils/__tests__/MapUtils-test.js index bf0e446c74..0a9afe112d 100644 --- a/web/client/utils/__tests__/MapUtils-test.js +++ b/web/client/utils/__tests__/MapUtils-test.js @@ -435,7 +435,6 @@ describe('Test the MapUtils', () => { units: 'm', zoom: 10 }, - mapInfoConfiguration: undefined, version: 2 }); }); @@ -716,7 +715,6 @@ describe('Test the MapUtils', () => { units: 'm', zoom: 10 }, - mapInfoConfiguration: undefined, version: 2 }); }); @@ -976,7 +974,6 @@ describe('Test the MapUtils', () => { } } }, - mapInfoConfiguration: undefined, version: 2 }); }); @@ -1031,7 +1028,7 @@ describe('Test the MapUtils', () => { units: 'm', zoom: 10 }; - const saved = saveMapConfiguration(mapConfig, flat, groups, '', {}, {infoFormat: "text/html", showEmptyMessageGFI: false}); + const saved = saveMapConfiguration(mapConfig, flat, groups, '', { mapInfoConfiguration: {infoFormat: "text/html", showEmptyMessageGFI: false}}); expect(saved).toEqual({ map: { center: {crs: 'EPSG:4326', x: 0, y: 0}, @@ -1050,11 +1047,13 @@ describe('Test the MapUtils', () => { thumbURL: undefined, availableStyles: undefined, bbox: {}, + requestEncoding: undefined, capabilitiesURL: undefined, description: undefined, dimensions: [], nativeCrs: undefined, features: undefined, + queryable: undefined, featureInfo: undefined, format: undefined, group: undefined, @@ -1106,7 +1105,8 @@ describe('Test the MapUtils', () => { } } } - }, mapInfoConfiguration: { + }, + mapInfoConfiguration: { infoFormat: "text/html", showEmptyMessageGFI: false },