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

geosolutions-it / MapStore2 / 13247679705

10 Feb 2025 06:19PM UTC coverage: 76.857% (-0.3%) from 77.161%
13247679705

Pull #10772

github

web-flow
Merge c4ffa22b6 into 20c08cf3c
Pull Request #10772: #10770: Vector files import limits

31146 of 48668 branches covered (64.0%)

23 of 26 new or added lines in 3 files covered. (88.46%)

288 existing lines in 27 files now uncovered.

38670 of 50314 relevant lines covered (76.86%)

34.39 hits per line

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

41.67
/web/client/plugins/DeleteMap.jsx
1
/*
2
 * Copyright 2022, 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 React from 'react';
10
import PropTypes from "prop-types";
11
import { Glyphicon } from 'react-bootstrap';
12
import { connect } from 'react-redux';
13
import { createSelector } from 'reselect';
14

15
import ConfirmDialog from '../components/misc/ConfirmDialog';
16
import { createPlugin } from '../utils/PluginsUtils';
17
import { deleteMap } from '../actions/maps';
18
import { toggleControl } from '../actions/controls';
19
import { mapIdSelector } from '../selectors/mapInitialConfig';
20
import { showConfirmDeleteMapModalSelector } from '../selectors/controls';
21
import Message from '../components/I18N/Message';
22
/**
23
 * @deprecated
24
 *
25
 */
26
class DeleteConfirmDialog extends React.Component {
27

28
    static propTypes = {
1✔
29
        show: PropTypes.bool,
30
        mapId: PropTypes.string,
31
        onConfirmDelete: PropTypes.func,
32
        onClose: PropTypes.func
33
    };
34

35
    static contextTypes = {
1✔
36
        router: PropTypes.object
37
    };
38

39
    static defaultProps = {
1✔
40
        show: false,
41
        mapId: '',
42
        onConfirmDelete: () => {},
43
        onClose: () => {}
44
    };
45

46
    render() {
47
        return (
1✔
48
            <ConfirmDialog
49
                show={this.props.show}
50
                onClose={this.props.onClose}
51
                title={<Message msgId="map.mapDelete" />}
52
                onConfirm={() => {
UNCOV
53
                    this.context.router.history.push("/");
×
UNCOV
54
                    this.props.onConfirmDelete(this.props.mapId);
×
55
                }}
56
                fitContent
57
            >
58
                <div className="ms-detail-body">
59
                    <Message msgId="resources.deleteConfirmMessage" />
60
                </div>
61
            </ConfirmDialog>
62
        );
63
    }
64
}
65

66
export default createPlugin('DeleteMap', {
67
    component:
68
        connect(createSelector(
69
            showConfirmDeleteMapModalSelector,
70
            mapIdSelector,
71
            (show, mapId) => {
72
                return { show, mapId };
1✔
73
            }
74
        ),
75
        {
UNCOV
76
            onConfirmDelete: (mapId) => deleteMap(mapId),
×
77
            onClose: toggleControl.bind(null, 'mapDelete', false)
78
        })(DeleteConfirmDialog),
79
    containers: {
80
        BurgerMenu: {
81
            name: 'mapDelete',
82
            position: 36,
83
            text: <Message msgId="map.mapDelete"/>,
84
            icon: <Glyphicon glyph="trash"/>,
85
            action: toggleControl.bind(null, 'mapDelete', null),
86
            tooltip: "mapDeleteDialog.mapDeleteTooltip",
87
            selector: (state) => {
UNCOV
88
                const { canDelete = false } = state?.map?.present?.info || {};
×
UNCOV
89
                return canDelete ? {} : { style: {display: "none"} };
×
90
            },
91
            priority: 2,
92
            doNotHide: true
93
        },
94
        SidebarMenu: {
95
            name: 'mapDelete',
96
            position: 36,
97
            text: <Message msgId="map.mapDelete"/>,
98
            icon: <Glyphicon glyph="trash"/>,
99
            action: toggleControl.bind(null, 'mapDelete', null),
100
            toggle: true,
101
            tooltip: "manager.deleteMap",
102
            selector: (state) => {
UNCOV
103
                const { canDelete = false } = state?.map?.present?.info || {};
×
UNCOV
104
                return canDelete ? {} : { style: {display: "none"} };
×
105
            },
106
            priority: 1,
107
            doNotHide: true
108
        }
109
    }
110
});
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

© 2026 Coveralls, Inc