• 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

42.86
/web/client/reducers/maplayout.js
1
/*
2
 * Copyright 2017, 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

9
import {UPDATE_DOCK_PANELS, UPDATE_MAP_LAYOUT} from '../actions/maplayout';
10

11
const DEFAULT_RIGHT_DOCK_PANELS = ['mapCatalog', 'mapTemplates', 'metadataexplorer', 'userExtensions', 'details', 'GeoProcessing'];
1✔
12
const DEFAULT_LEFT_DOCK_PANELS = [];
1✔
13

14
/**
15
 * Manages the map layout state. Determines and manages the placement of the components on the screen
16
 * @prop {object} [layout] property helps in organizing the components on the screen (ex. Leaves space for the footer, move the navBar or the background selector when the Catalog or the TOC panel is open, respectively)
17
 * @prop {object} [boundingMapRect] property treated as "padding" of the map that allows to zoom taking into account the panels that overlaps (ex. Catalog, Feature Grid)
18
 *
19
 * @memberof reducers
20
 */
21
function mapLayout(state = { layout: {}, boundingMapRect: {}, boundingSidebarRect: {}, dockPanels: { left: DEFAULT_LEFT_DOCK_PANELS, right: DEFAULT_RIGHT_DOCK_PANELS } }, action) {
6✔
22
    switch (action.type) {
21!
23
    case UPDATE_MAP_LAYOUT: {
24
        const {boundingMapRect = {}, boundingSidebarRect = {}, ...layout} = action.layout;
2✔
25
        return Object.assign({}, state, {layout: Object.assign({}, layout, layout), boundingMapRect: {...boundingMapRect}, boundingSidebarRect: {...boundingSidebarRect}});
2✔
26
    }
27
    case UPDATE_DOCK_PANELS: {
UNCOV
28
        const {name, action: operation, location} = action;
×
29
        switch (operation) {
×
30
        case 'add':
UNCOV
31
            return {
×
32
                ...state,
33
                dockPanels: {
34
                    left: location === 'left' ? ((state.dockPanels.left).includes(name) ? state.dockPanels.left : [...state.dockPanels.left, name]) : state.dockPanels.left,
×
35
                    right: location === 'right' ? ((state.dockPanels.right).includes(name) ? state.dockPanels.right : [...state.dockPanels.right, name]) : state.dockPanels.right
×
36
                }
37
            };
38
        default:
UNCOV
39
            const position = location === 'left' ? state.dockPanels.left.indexOf(name) : state.dockPanels.right.indexOf(name);
×
40
            const exists = position !== -1;
×
41
            return {
×
42
                ...state,
43
                dockPanels: {
UNCOV
44
                    left: location === 'left' ? (!exists ? state.dockPanels.left : state.dockPanels.left.filter(item => item !== name)) : state.dockPanels.left,
×
45
                    right: location === 'right' ? (!exists ? state.dockPanels.right : state.dockPanels.right.filter(item => item !== name)) : state.dockPanels.right
×
46
                }
47
            };
48
        }
49
    }
50
    default:
51
        return state;
19✔
52
    }
53
}
54

55
export default mapLayout;
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