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

geosolutions-it / MapStore2 / 12831531306

17 Jan 2025 03:01PM UTC coverage: 77.182% (+0.07%) from 77.115%
12831531306

Pull #10746

github

web-flow
Merge 501dbaeea into 4e4dabc03
Pull Request #10746: Fix #10739 Changing correctly resolutions limits when switching map CRS

30373 of 47156 branches covered (64.41%)

34 of 43 new or added lines in 2 files covered. (79.07%)

126 existing lines in 15 files now uncovered.

37769 of 48935 relevant lines covered (77.18%)

35.14 hits per line

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

92.31
/web/client/plugins/TOC/components/VisibilityCheck.jsx
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

9
import React from 'react';
10
import { Glyphicon } from 'react-bootstrap';
11
import tooltip from '../../../components/misc/enhancers/tooltip';
12
const Button = tooltip(({ children, ...props }) => <button {...props}>{children}</button>);
142✔
13

14
/**
15
 * VisibilityCheck shows the checkbox or radio button to apply visibility to a node
16
 * @prop {boolean} hide hide the component
17
 * @prop {boolean} value the visibility value
18
 * @prop {function} onChange callback that returns the changed value on click
19
 * @prop {boolean} mutuallyExclusive if true change the icon from checkbox to radio button
20
 */
21
const VisibilityCheck = ({
1✔
22
    hide,
23
    value,
24
    onChange,
25
    mutuallyExclusive
26
}) => {
27

28
    const getIcon = () => {
148✔
29
        if (mutuallyExclusive) {
142✔
30
            return value ? 'radio-on' : 'radio-off';
3✔
31
        }
32
        return value ? 'checkbox-on' : 'checkbox-off';
139✔
33
    };
34

35
    if (hide) {
148✔
36
        return null;
6✔
37
    }
38
    return (
142✔
39
        <Button
40
            className={`ms-visibility-check${value ? ' active' : ''}`}
142✔
41
            onClick={(event) => {
42
                event.stopPropagation();
9✔
43
                event.preventDefault();
9✔
44
                onChange(!value);
9✔
45
            }}
46
            onContextMenu={(event) => {
UNCOV
47
                event.stopPropagation();
×
48
            }}
49
        >
50
            <Glyphicon glyph={getIcon()} />
51
        </Button>
52
    );
53
};
54

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