forked from geosolutions-it/geonode-mapstore-client
-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Client - Filter panel state should be consistent with the latest user…
… action (#127)
- Loading branch information
1 parent
c511411
commit 189fbcc
Showing
5 changed files
with
71 additions
and
9 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
geonode_mapstore_client/client/js/actions/gnfiltersPanel.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
* Copyright 2021, GeoSolutions Sas. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
export const ON_TOGGLE_FILTER = 'GEONODE:ON_TOGGLE_FILTER'; | ||
|
||
export function toggleFiltersPanel() { | ||
return { | ||
type: ON_TOGGLE_FILTER | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
geonode_mapstore_client/client/js/reducers/gnfiltersPanel.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright 2021, GeoSolutions Sas. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import { ON_TOGGLE_FILTER } from '@js/actions/gnfiltersPanel'; | ||
|
||
const gnfiltersPanel = (state = {isToggle: false}, action) => { | ||
switch (action.type) { | ||
case ON_TOGGLE_FILTER: | ||
return { | ||
...state, | ||
isToggle: !state.isToggle | ||
}; | ||
default: | ||
return state; | ||
} | ||
}; | ||
|
||
export default gnfiltersPanel; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters