• 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

81.82
/web/client/components/data/query/ComboField.jsx
1
/**
2
 * Copyright 2016, 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 { getMessageById } from '../../../utils/LocaleUtils';
11
import PropTypes from 'prop-types';
12
import { Tooltip } from 'react-bootstrap';
13
import OverlayTrigger from '../../misc/OverlayTrigger';
14
import { DropdownList, Multiselect } from 'react-widgets';
15
import Message from '../../../components/I18N/Message';
16

17
class ComboField extends React.Component {
18
    static propTypes = {
1✔
19
        dropUp: PropTypes.bool,
20
        busy: PropTypes.bool,
21
        style: PropTypes.object,
22
        valueField: PropTypes.string,
23
        textField: PropTypes.string,
24
        placeholder: PropTypes.object,
25
        itemComponent: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),
26
        fieldOptions: PropTypes.array,
27
        fieldName: PropTypes.string,
28
        fieldRowId: PropTypes.number,
29
        attType: PropTypes.string,
30
        fieldValue: PropTypes.oneOfType([
31
            PropTypes.number,
32
            PropTypes.string,
33
            PropTypes.array
34
        ]),
35
        fieldException: PropTypes.oneOfType([
36
            PropTypes.object,
37
            PropTypes.string
38
        ]),
39
        comboFilter: PropTypes.oneOfType([
40
            PropTypes.bool,
41
            PropTypes.string,
42
            PropTypes.func
43
        ]),
44
        groupBy: PropTypes.oneOfType([
45
            PropTypes.string,
46
            PropTypes.func
47
        ]),
48
        multivalue: PropTypes.bool,
49
        disabled: PropTypes.bool,
50
        options: PropTypes.object,
51
        onSelect: PropTypes.func,
52
        onToggle: PropTypes.func,
53
        onSearch: PropTypes.func,
54
        onUpdateField: PropTypes.func,
55
        onClick: PropTypes.func,
56
        onUpdateExceptionField: PropTypes.func
57
    };
58

59
    static contextTypes = {
1✔
60
        messages: PropTypes.object
61
    };
62

63
    static defaultProps = {
1✔
64
        options: {},
65
        busy: false,
66
        style: {
67
            width: "100%"
68
        },
69
        placeholder: <Message msgId="queryform.comboField.default_placeholder"/>,
70
        multivalue: false,
71
        disabled: false,
72
        valueField: null,
73
        textField: null,
74
        fieldOptions: [],
75
        fieldName: null,
76
        itemComponent: null,
77
        fieldRowId: null,
78
        fieldValue: null,
79
        fieldException: null,
80
        comboFilter: false,
81
        groupBy: () => {},
82
        onSelect: () => {},
83
        onToggle: () => {},
84
        onSearch: () => {},
85
        onUpdateField: () => {},
86
        onUpdateExceptionField: () => {}
87
    };
88

89
    render() {
90
        let style = Object.assign({}, {borderColor: "#dedede"}, this.props.style);
48✔
91

92
        if (this.props.fieldException) {
48✔
93
            style = Object.assign({}, style, {borderColor: "#FF0000"});
1✔
94
        }
95

96
        const ListComponent = this.props.multivalue ? Multiselect : DropdownList;
48✔
97

98
        const list = this.props.valueField !== null && this.props.textField !== null ?
48✔
99
            (<ListComponent
100
                dropUp={this.props.dropUp}
101
                {...this.props.options}
102
                busy={this.props.busy}
103
                disabled={this.props.disabled}
104
                itemComponent={this.props.itemComponent}
105
                valueField={this.props.valueField}
106
                textField={this.props.textField}
107
                data={this.props.fieldOptions}
108
                value={this.props.fieldValue}
109
                caseSensitive={false}
110
                minLength={3}
111
                placeholder={this.props.placeholder}
112
                messages={{open: getMessageById(this.context.messages, "queryform.comboField.drop_down")}}
113
                filter={this.props.comboFilter}
114
                style={style}
115
                groupBy={this.props.groupBy}
116
                onSelect={this.props.onSelect}
UNCOV
117
                onChange={(value) => this.props.onUpdateField(this.props.fieldRowId, this.props.fieldName, this.props.multivalue ? value : value[this.props.valueField], this.props.attType)}
×
118
                onToggle={this.props.onToggle}
119
                onSearch={this.props.onSearch}/>)
120
            :
121
            (<ListComponent
122
                dropUp={this.props.dropUp}
123
                {...this.props.options}
124
                busy={this.props.busy}
125
                disabled={this.props.disabled}
126
                itemComponent={this.props.itemComponent}
127
                data={this.props.fieldOptions}
128
                value={this.props.fieldValue}
129
                caseSensitive={false}
130
                minLength={3}
131
                placeholder={this.props.placeholder}
132
                messages={{open: getMessageById(this.context.messages, "queryform.comboField.drop_down")}}
133
                filter={this.props.comboFilter}
134
                style={style}
135
                groupBy={this.props.groupBy}
136
                onSelect={this.props.onSelect}
UNCOV
137
                onChange={(value) => this.props.onUpdateField(this.props.fieldRowId, this.props.fieldName, value, this.props.attType)}
×
138
                onToggle={this.props.onToggle}
139
                onSearch={this.props.onSearch}/>)
140
        ;
141

142
        return this.props.fieldException ?
48✔
143
            <OverlayTrigger placement="bottom" overlay={(
144
                <Tooltip id={this.props.fieldRowId + "_tooltip"}>
145
                    <strong>
146
                        {this.props.fieldException}
147
                    </strong>
148
                </Tooltip>
149
            )}>
150
                {list}
151
            </OverlayTrigger>
152
            :
153
            list
154
        ;
155
    }
156
}
157

158
export default ComboField;
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