diff --git a/web/client/components/data/featuregrid/toolbars/Toolbar.jsx b/web/client/components/data/featuregrid/toolbars/Toolbar.jsx index 7785db0de8..d9d4d860fb 100644 --- a/web/client/components/data/featuregrid/toolbars/Toolbar.jsx +++ b/web/client/components/data/featuregrid/toolbars/Toolbar.jsx @@ -24,7 +24,7 @@ const getSaveMessageId = ({saving, saved}) => { return "featuregrid.toolbar.saveChanges"; }; -module.exports = ({events = {}, mode = "VIEW", selectedCount, hasChanges, hasGeometry, hasNewFeatures, isSimpleGeom, isDrawing = false, isEditingAllowed, saving = false, saved = false} = {}) => +module.exports = ({events = {}, mode = "VIEW", selectedCount, hasChanges, hasGeometry, hasNewFeatures, isSimpleGeom, isDrawing = false, isEditingAllowed, saving = false, saved = false, isDownloadOpen, isColumnsOpen} = {}) => ( }> @@ -52,9 +52,9 @@ module.exports = ({events = {}, mode = "VIEW", selectedCount, hasChanges, hasGeo }> - + }> - + ); diff --git a/web/client/components/data/featuregrid/toolbars/__tests__/Toolbar-test.jsx b/web/client/components/data/featuregrid/toolbars/__tests__/Toolbar-test.jsx index 3eeaa3bdd5..ea70531bfd 100644 --- a/web/client/components/data/featuregrid/toolbars/__tests__/Toolbar-test.jsx +++ b/web/client/components/data/featuregrid/toolbars/__tests__/Toolbar-test.jsx @@ -215,6 +215,11 @@ describe('Featuregrid toolbar component', () => { expect(isVisibleButton(button)).toBe(true); button.click(); expect(events.settings).toHaveBeenCalled(); + ReactDOM.render(, document.getElementById("container")); + button = document.getElementById("fg-grid-settings"); + expect(isVisibleButton(button)).toBe(true); + expect(button.className).toExist(); + expect(button.className.indexOf("success") >= 0).toBe(true); ReactDOM.render(, document.getElementById("container")); button = document.getElementById("fg-grid-settings"); expect(isVisibleButton(button)).toBe(false); @@ -228,6 +233,4 @@ describe('Featuregrid toolbar component', () => { button = document.getElementById("fg-grid-settings"); expect(isVisibleButton(button)).toBe(false); }); - - }); diff --git a/web/client/examples/featuregrid/index.html b/web/client/examples/featuregrid/index.html index e0dfdafb1e..057ad4af4e 100644 --- a/web/client/examples/featuregrid/index.html +++ b/web/client/examples/featuregrid/index.html @@ -15,7 +15,7 @@ - +
diff --git a/web/client/plugins/featuregrid/panels/index.jsx b/web/client/plugins/featuregrid/panels/index.jsx index 2092809015..ddb7faede4 100644 --- a/web/client/plugins/featuregrid/panels/index.jsx +++ b/web/client/plugins/featuregrid/panels/index.jsx @@ -23,6 +23,8 @@ const Toolbar = connect( isDrawing: isDrawingSelector, isSimpleGeom: isSimpleGeomSelector, selectedCount: selectedFeaturesCount, + isDownloadOpen: state => state && state.controls && state.controls.wfsdownload && state.controls.wfsdownload.enabled, + isColumnsOpen: state => state && state.featuregrid && state.featuregrid.tools && state.featuregrid.tools.settings, isEditingAllowed: (state) => isAdminUserSelector(state) || canEditSelector(state) }), (dispatch) => ({events: bindActionCreators(toolbarEvents, dispatch)})