• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

geosolutions-it / MapStore2 / 19710972030

26 Nov 2025 03:38PM UTC coverage: 76.665% (-0.3%) from 76.929%
19710972030

Pull #11119

github

web-flow
Fix maven publish (#11739)
Pull Request #11119: Layer Selection Plugin on ArcGIS, WFS & WMS layers

32272 of 50209 branches covered (64.28%)

3 of 3 new or added lines in 2 files covered. (100.0%)

3018 existing lines in 249 files now uncovered.

40157 of 52380 relevant lines covered (76.66%)

37.9 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

73.68
/web/client/utils/MapHistoryUtils.js
1
/**
2
 * Copyright 2015, GeoSolutions Sas.
3
 * All rights reserved.
4
 *
5
 * This source code is licensed under the BSD-style license found in the
6
 * LICENSE file in the root directory of this source tree.
7
 */
8
import undoable, {ActionTypes} from 'redux-undo';
9
import { isEqual } from 'lodash';
10

11
const mapConfigHistoryUtil = (reducer) => {
1✔
12
    return (state, action) => {
1✔
13
        let newState = reducer(state, action);
17✔
14
        let unredoState;
15
        // If undo modified the state we change mapStateSource
16
        if (action.type === ActionTypes.UNDO && state.past.length > 0) {
17!
UNCOV
17
            let mapC = Object.assign({}, newState.present, {mapStateSource: "undoredo", style: state.present.style, resize: state.present.resize});
×
UNCOV
18
            unredoState = Object.assign({}, newState, {present: mapC});
×
19
        } else if (action.type === ActionTypes.REDO && state.future.length > 0) {
17!
20
            let mapC = Object.assign({}, newState.present, {mapStateSource: "undoredo", style: state.present.style, resize: state.present.resize});
×
UNCOV
21
            unredoState = Object.assign({}, newState, {present: mapC});
×
22
        }
23
        return unredoState || {past: newState.past, present: newState.present, future: newState.future};
17✔
24
    };
25
};
26

27

28
export const createHistory = (mapState) => {
1✔
29
    if (mapState && mapState.map && mapState.map.center) {
59✔
30
        return Object.assign({}, mapState, {
4✔
31
            map: {
32
                past: [],
33
                present: mapState.map,
34
                future: []
35
            }
36
        });
37
    }
38
    return mapState;
55✔
39
};
40

41
export const mapConfigHistory = (reducer) => mapConfigHistoryUtil(undoable(reducer, {
1✔
42
    filter: (action, currentState, previousState) => {
43
        let bool = false;
17✔
44
        if (previousState && previousState.mapStateSource && previousState.mapStateSource === 'map'
17!
45
                && previousState.center && previousState.zoom !== undefined) {
46
            // Check geometry part
UNCOV
47
            bool = !(isEqual(currentState.center, previousState.center) && currentState.zoom === previousState.zoom);
×
48
        }
49
        return bool;
17✔
50
    }
51
}));
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc