From ecd5cd3e7b6aa1b6bd586e124ee5cf1760bc40a0 Mon Sep 17 00:00:00 2001 From: saidaipparla Date: Mon, 10 Oct 2016 12:07:28 +0200 Subject: [PATCH 1/4] fix #1095 changed modal layout for both on startup and empty results --- web/client/jsapi/mapstore2.css | 5 +---- web/client/product/assets/css/viewer.css | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/web/client/jsapi/mapstore2.css b/web/client/jsapi/mapstore2.css index 8147d2b650..fe5c03b9f9 100644 --- a/web/client/jsapi/mapstore2.css +++ b/web/client/jsapi/mapstore2.css @@ -446,10 +446,7 @@ #mapstore-catalog-panel { width: auto; - position: absolute; - right: 200px; - margin-top: 100px; - display: inline-block; + margin: 100px; } #mapstore-catalog-panel .record-item { diff --git a/web/client/product/assets/css/viewer.css b/web/client/product/assets/css/viewer.css index 37af5e4a0a..bf7c6d1c2a 100644 --- a/web/client/product/assets/css/viewer.css +++ b/web/client/product/assets/css/viewer.css @@ -391,10 +391,7 @@ html, body, #container, .fill { #mapstore-catalog-panel { width: auto; - position: absolute; - right: 200px; - margin-top: 100px; - display: inline-block; + margin: 100PX; } #mapstore-catalog-panel .record-item { From 47f524f74cff20199dd61dcb0ce7dc0aca899a8e Mon Sep 17 00:00:00 2001 From: saidaipparla Date: Mon, 10 Oct 2016 12:11:05 +0200 Subject: [PATCH 2/4] fix #1095 missed file --- web/client/plugins/MetadataExplorer.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/web/client/plugins/MetadataExplorer.jsx b/web/client/plugins/MetadataExplorer.jsx index 28416eb34a..38a5ccdb7e 100644 --- a/web/client/plugins/MetadataExplorer.jsx +++ b/web/client/plugins/MetadataExplorer.jsx @@ -55,6 +55,7 @@ const MetadataExplorerComponent = React.createClass({ id: "mapstore-metadata-explorer", active: false, wrap: false, + modal: true, wrapWithPanel: true, panelStyle: { minWidth: "300px", From 868ffa848a1cbf1f1262761cbbf8709c04731a07 Mon Sep 17 00:00:00 2001 From: saidaipparla Date: Mon, 10 Oct 2016 17:27:31 +0200 Subject: [PATCH 3/4] fix #1080 resetted the status for catalog widget --- web/client/actions/catalog.js | 11 ++++++++++- web/client/plugins/MetadataExplorer.jsx | 12 ++++++++++-- web/client/reducers/catalog.js | 10 +++++++++- 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/web/client/actions/catalog.js b/web/client/actions/catalog.js index 6aba32a54f..2a2808c367 100644 --- a/web/client/actions/catalog.js +++ b/web/client/actions/catalog.js @@ -15,6 +15,7 @@ const RECORD_LIST_LOADED = 'RECORD_LIST_LOADED'; const RECORD_LIST_LOAD_ERROR = 'RECORD_LIST_LOAD_ERROR'; const CHANGE_CATALOG_FORMAT = 'CHANGE_CATALOG_FORMAT'; const ADD_LAYER_ERROR = 'ADD_LAYER_ERROR'; +const RESET_STATUS = 'RESET_STATUS'; function recordsLoaded(options, result) { return { @@ -83,13 +84,21 @@ function addLayerError(error) { }; } +function resetStatus() { + return { + type: RESET_STATUS + }; +} + module.exports = { RECORD_LIST_LOADED, RECORD_LIST_LOAD_ERROR, CHANGE_CATALOG_FORMAT, ADD_LAYER_ERROR, + RESET_STATUS, getRecords, textSearch, changeCatalogFormat, - addLayerError + addLayerError, + resetStatus }; diff --git a/web/client/plugins/MetadataExplorer.jsx b/web/client/plugins/MetadataExplorer.jsx index 38a5ccdb7e..dc3e304d10 100644 --- a/web/client/plugins/MetadataExplorer.jsx +++ b/web/client/plugins/MetadataExplorer.jsx @@ -11,7 +11,7 @@ const {connect} = require('react-redux'); const assign = require('object-assign'); const {createSelector} = require("reselect"); const {Glyphicon, Panel} = require('react-bootstrap'); -const {textSearch, changeCatalogFormat, addLayerError} = require("../actions/catalog"); +const {textSearch, changeCatalogFormat, addLayerError, resetStatus} = require("../actions/catalog"); const {addLayer} = require("../actions/layers"); const {zoomToExtent} = require("../actions/map"); const {toggleControl} = require("../actions/controls"); @@ -29,6 +29,14 @@ const catalogSelector = createSelector([ records: CatalogUtils.getCatalogRecords(format, result, options) })); +const catalogClose = () => { + return (dispatch) => { + dispatch(toggleControl('metadataexplorer')); + dispatch(resetStatus()); + }; +}; + + const Catalog = connect(catalogSelector, { // add layer action to pass to the layers onZoomToExtent: zoomToExtent @@ -100,7 +108,7 @@ const MetadataExplorerPlugin = connect((state) => ({ }), { onSearch: textSearch, onLayerAdd: addLayer, - toggleControl: toggleControl.bind(null, 'metadataexplorer', null), + toggleControl: catalogClose, onChangeFormat: changeCatalogFormat, onError: addLayerError })(MetadataExplorerComponent); diff --git a/web/client/reducers/catalog.js b/web/client/reducers/catalog.js index 9d83ba63c4..3f0981516a 100644 --- a/web/client/reducers/catalog.js +++ b/web/client/reducers/catalog.js @@ -6,7 +6,7 @@ * LICENSE file in the root directory of this source tree. */ -const {RECORD_LIST_LOADED, RECORD_LIST_LOAD_ERROR, CHANGE_CATALOG_FORMAT, ADD_LAYER_ERROR} = require('../actions/catalog'); +const {RECORD_LIST_LOADED, RECORD_LIST_LOAD_ERROR, CHANGE_CATALOG_FORMAT, ADD_LAYER_ERROR, RESET_STATUS} = require('../actions/catalog'); const assign = require('object-assign'); function catalog(state = null, action) { @@ -18,6 +18,14 @@ function catalog(state = null, action) { loadingError: null, layerError: null }); + case RESET_STATUS: { + return { + result: null, + loadingError: null, + format: action.format, + layerError: null + }; + } case RECORD_LIST_LOAD_ERROR: return assign({}, state, { result: null, From be9b266390e96ffc7308f331fef9ece7c006424c Mon Sep 17 00:00:00 2001 From: saidaipparla Date: Tue, 11 Oct 2016 14:44:25 +0200 Subject: [PATCH 4/4] fix #1080 changed the name and added px --- web/client/actions/catalog.js | 10 +++++----- web/client/plugins/MetadataExplorer.jsx | 4 ++-- web/client/product/assets/css/viewer.css | 2 +- web/client/reducers/catalog.js | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/web/client/actions/catalog.js b/web/client/actions/catalog.js index 2a2808c367..0f9c96f602 100644 --- a/web/client/actions/catalog.js +++ b/web/client/actions/catalog.js @@ -15,7 +15,7 @@ const RECORD_LIST_LOADED = 'RECORD_LIST_LOADED'; const RECORD_LIST_LOAD_ERROR = 'RECORD_LIST_LOAD_ERROR'; const CHANGE_CATALOG_FORMAT = 'CHANGE_CATALOG_FORMAT'; const ADD_LAYER_ERROR = 'ADD_LAYER_ERROR'; -const RESET_STATUS = 'RESET_STATUS'; +const CATALOG_RESET = 'CATALOG_RESET'; function recordsLoaded(options, result) { return { @@ -84,9 +84,9 @@ function addLayerError(error) { }; } -function resetStatus() { +function catalogReset() { return { - type: RESET_STATUS + type: CATALOG_RESET }; } @@ -95,10 +95,10 @@ module.exports = { RECORD_LIST_LOAD_ERROR, CHANGE_CATALOG_FORMAT, ADD_LAYER_ERROR, - RESET_STATUS, + CATALOG_RESET, getRecords, textSearch, changeCatalogFormat, addLayerError, - resetStatus + catalogReset }; diff --git a/web/client/plugins/MetadataExplorer.jsx b/web/client/plugins/MetadataExplorer.jsx index dc3e304d10..6066a425b7 100644 --- a/web/client/plugins/MetadataExplorer.jsx +++ b/web/client/plugins/MetadataExplorer.jsx @@ -11,7 +11,7 @@ const {connect} = require('react-redux'); const assign = require('object-assign'); const {createSelector} = require("reselect"); const {Glyphicon, Panel} = require('react-bootstrap'); -const {textSearch, changeCatalogFormat, addLayerError, resetStatus} = require("../actions/catalog"); +const {textSearch, changeCatalogFormat, addLayerError, catalogReset} = require("../actions/catalog"); const {addLayer} = require("../actions/layers"); const {zoomToExtent} = require("../actions/map"); const {toggleControl} = require("../actions/controls"); @@ -32,7 +32,7 @@ const catalogSelector = createSelector([ const catalogClose = () => { return (dispatch) => { dispatch(toggleControl('metadataexplorer')); - dispatch(resetStatus()); + dispatch(catalogReset()); }; }; diff --git a/web/client/product/assets/css/viewer.css b/web/client/product/assets/css/viewer.css index bf7c6d1c2a..92d0fa3a1a 100644 --- a/web/client/product/assets/css/viewer.css +++ b/web/client/product/assets/css/viewer.css @@ -391,7 +391,7 @@ html, body, #container, .fill { #mapstore-catalog-panel { width: auto; - margin: 100PX; + margin: 100px; } #mapstore-catalog-panel .record-item { diff --git a/web/client/reducers/catalog.js b/web/client/reducers/catalog.js index 3f0981516a..28787752fc 100644 --- a/web/client/reducers/catalog.js +++ b/web/client/reducers/catalog.js @@ -6,7 +6,7 @@ * LICENSE file in the root directory of this source tree. */ -const {RECORD_LIST_LOADED, RECORD_LIST_LOAD_ERROR, CHANGE_CATALOG_FORMAT, ADD_LAYER_ERROR, RESET_STATUS} = require('../actions/catalog'); +const {RECORD_LIST_LOADED, RECORD_LIST_LOAD_ERROR, CHANGE_CATALOG_FORMAT, ADD_LAYER_ERROR, CATALOG_RESET} = require('../actions/catalog'); const assign = require('object-assign'); function catalog(state = null, action) { @@ -18,7 +18,7 @@ function catalog(state = null, action) { loadingError: null, layerError: null }); - case RESET_STATUS: { + case CATALOG_RESET: { return { result: null, loadingError: null,