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

geosolutions-it / MapStore2 / 13154348213

05 Feb 2025 09:34AM UTC coverage: 76.842% (-0.3%) from 77.161%
13154348213

Pull #10788

github

web-flow
Merge 5d3648e56 into 490d96d88
Pull Request #10788: #10787: add missing documentation part related to interactive legend for wfs layer

31092 of 48599 branches covered (63.98%)

38627 of 50268 relevant lines covered (76.84%)

34.4 hits per line

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

75.0
/web/client/plugins/Save.jsx
1
/*
2
* Copyright 2019, 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 React from 'react';
9
import {compose} from 'recompose';
10
import {connect} from 'react-redux';
11
import {createSelector} from 'reselect';
12
import {Glyphicon} from 'react-bootstrap';
13
import Message from '../components/I18N/Message';
14
import {mapInfoSelector} from '../selectors/map';
15
import { isLoggedIn } from '../selectors/security';
16
import { createPlugin } from '../utils/PluginsUtils';
17
import {toggleControl} from '../actions/controls';
18
import {resetMapSaveError} from '../actions/config';
19
import SaveBaseDialog from './maps/MapSave';
20

21
const showMapSaveSelector = state => state.controls && state.controls.mapSave && state.controls.mapSave.enabled;
4✔
22

23
/**
24
 * Plugin for Save Map. Allows to re-save an existing map (using the persistence API). Note: creation of new Map is implemented by {@link #plugins.SaveAs|SaveAs} plugin.
25
 * @deprecated
26
 * @prop {boolean} [cfg.disablePermission=false] disable the permission selector in the tool. Can be used in context when permissions are not needed (resources are private only/using plugin with another API)
27
 * @name Save
28
 * @class
29
 * @memberof plugins
30
 */
31
export default createPlugin('Save', {
32
    component: compose(
33
        connect(createSelector(
34
            showMapSaveSelector,
35
            mapInfoSelector,
36
            (show, resource) => ({show, resource})),
2✔
37
        {
38
            onClose: toggleControl.bind(null, 'mapSave', false),
39
            onResetMapSaveError: resetMapSaveError
40
        }))(SaveBaseDialog),
41
    containers: {
42
        BurgerMenu: {
43
            name: 'mapSave',
44
            position: 30,
45
            text: <Message msgId="save"/>,
46
            icon: <Glyphicon glyph="floppy-open"/>,
47
            action: toggleControl.bind(null, 'mapSave', null),
48
            tooltip: "saveDialog.saveTooltip",
49
            // display the BurgerMenu button only if the map can be edited
50
            selector: createSelector(
51
                isLoggedIn,
52
                mapInfoSelector,
53
                (loggedIn, {canEdit, id} = {}) => ({
3✔
54
                    style: loggedIn && id && canEdit ? {} : { display: "none" }// the resource is new (no resource) or if present, is editable
10✔
55
                })
56
            ),
57
            priority: 2,
58
            doNotHide: true
59
        },
60
        SidebarMenu: {
61
            name: 'mapSave',
62
            position: 30,
63
            icon: <Glyphicon glyph="floppy-disk"/>,
64
            text: <Message msgId="save"/>,
65
            action: toggleControl.bind(null, 'mapSave', null),
66
            toggle: true,
67
            tooltip: "saveDialog.saveTooltip",
68
            // display the button only if the map can be edited
69
            selector: createSelector(
70
                isLoggedIn,
71
                mapInfoSelector,
72
                (loggedIn, {canEdit, id} = {}) => ({
×
73
                    style: loggedIn && id && canEdit ? {} : { display: "none" }// the resource is new (no resource) or if present, is editable
×
74
                })
75
            ),
76
            priority: 1,
77
            doNotHide: true
78
        }
79
    }
80
});
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