• 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

40.0
/web/client/components/mapcontrols/searchservicesconfig/WFSServiceProps.jsx
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
import React from 'react';
9

10
import { FormGroup, ControlLabel, FormControl } from 'react-bootstrap';
11
import Message from '../../I18N/Message';
12
import PropTypes from 'prop-types';
13

14
// const weburl = new RegExp(/((([A-Za-z]{3,9}:(?:\/\/)?)(?:[\-;:&=\+\$,\w]+@)?[A-Za-z0-9\.\-]+|(?:www\.|[\-;:&=\+\$,\w]+@)[A-Za-z0-9\.\-]+)((?:\/[\+~%\/\.\w\-_]*)?\??(?:[\-\+=&;%@\.\w_]*)#?(?:[\.\!\/\\\w]*))?)/);
15
function validate(service = {}) {
×
UNCOV
16
    const {options = {}, name = ''} = service;
×
17
    const {url = '', typeName = '', queriableAttributes = ''} = options;
×
18
    // const p = url.search(weburl);
UNCOV
19
    return name.length > 0 && url.length > 0 && typeName.length > 0 && queriableAttributes.length > 0;
×
20
}
21

22
class WFSServiceProps extends React.Component {
23
    static propTypes = {
1✔
24
        service: PropTypes.object,
25
        onPropertyChange: PropTypes.func
26
    };
27

28
    static defaultProps = {
1✔
29
        service: {},
30
        onPropertyChange: () => {}
31
    };
32

33
    render() {
34
        const {service} = this.props;
1✔
35
        const {options = {}} = service;
1✔
36
        return (
1✔
37
            <form>
38
                <span className="wfs-required-props-title"><Message msgId="search.s_wfs_props_label" /></span>
39
                <FormGroup>
40
                    <ControlLabel>
41
                        <Message msgId="search.s_name" />
42
                    </ControlLabel>
43
                    <FormControl
44
                        value={service.name}
45
                        key="name"
46
                        type="text"
47
                        onChange={this.updateName}/>
48
                </FormGroup>
49
                <FormGroup>
50
                    <ControlLabel>
51
                        <Message msgId="search.s_url" />
52
                    </ControlLabel>
53
                    <FormControl
54
                        value={options.url}
55
                        key="url"
56
                        type="text"
57
                        onChange={this.updateProp.bind(null, "url")}/>
58
                </FormGroup>
59
                <FormGroup>
60
                    <ControlLabel>
61
                        <Message msgId="search.s_layer" />
62
                    </ControlLabel>
63
                    <FormControl
64
                        value={options.typeName}
65
                        key="typeName"
66
                        type="text"
67
                        onChange={this.updateProp.bind(null, "typeName")}/>
68
                </FormGroup>
69
                <FormGroup>
70
                    <ControlLabel>
71
                        <Message msgId="search.s_attributes" />
72
                    </ControlLabel>
73
                    <FormControl
74
                        value={([options.queriableAttributes] || []).join(",")}
1!
75
                        key="queriableAttributes"
76
                        type="text"
77
                        onChange={this.updateProp.bind(null, "queriableAttributes")}/>
78
                </FormGroup>
79
            </form>);
80
    }
81

82
    updateProp = (prop, event) => {
1✔
UNCOV
83
        let value = event.target.value;
×
84
        if (prop === "queriableAttributes") {
×
85
            value = value.split(",");
×
86
        }
UNCOV
87
        const options = Object.assign({}, this.props.service.options, {[prop]: value} );
×
88
        this.props.onPropertyChange("service", Object.assign({}, this.props.service, {options}));
×
89
    };
90

91
    updateName = (event) => {
1✔
UNCOV
92
        const value = event.target.value;
×
93
        this.props.onPropertyChange("service", Object.assign({}, this.props.service, {name: value}));
×
94
    };
95

96
    updateMaxFeatures = (val) => {
1✔
UNCOV
97
        const options = Object.assign({}, this.props.service.options, {maxFeatures: parseFloat(val[0], 10)});
×
98
        this.props.onPropertyChange("service", Object.assign({}, this.props.service, {options}));
×
99
    };
100
}
101

102
export default { Element: WFSServiceProps, validate};
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