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

geosolutions-it / MapStore2 / 12882591459

21 Jan 2025 08:07AM UTC coverage: 77.203% (+0.07%) from 77.13%
12882591459

Pull #10712

github

web-flow
Merge e1da172c8 into d3d0ee6c5
Pull Request #10712: Enhancing User Session #10657

30454 of 47261 branches covered (64.44%)

145 of 185 new or added lines in 15 files covered. (78.38%)

432 existing lines in 29 files now uncovered.

37881 of 49067 relevant lines covered (77.2%)

35.0 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

© 2026 Coveralls, Inc