6
6
* LICENSE file in the root directory of this source tree.
7
7
*/
8
8
import React , { useEffect } from 'react' ;
9
- import { FormGroup , ControlLabel , Checkbox , Button as ButtonRB , Glyphicon , InputGroup } from "react-bootstrap" ;
9
+ import { FormGroup , ControlLabel , Checkbox , Button as ButtonRB , Glyphicon , InputGroup , Tooltip } from "react-bootstrap" ;
10
10
import RS from 'react-select' ;
11
11
import { isNil , camelCase } from "lodash" ;
12
12
@@ -19,6 +19,8 @@ import CSWFilters from "./CSWFilters";
19
19
import Message from "../../../I18N/Message" ;
20
20
import WMSDomainAliases from "./WMSDomainAliases" ;
21
21
import tooltip from '../../../misc/enhancers/buttonTooltip' ;
22
+ import OverlayTrigger from '../../../misc/OverlayTrigger' ;
23
+ import FormControl from '../../../misc/DebouncedFormControl' ;
22
24
23
25
const Button = tooltip ( ButtonRB ) ;
24
26
const Select = localizedProps ( 'noResultsText' ) ( RS ) ;
@@ -48,6 +50,7 @@ const getServerTypeOptions = () => {
48
50
* - Filters (Option allows user to configure the ogcFilter with custom filtering conditions
49
51
* *staticFilter: filter to fetch all record applied always i.e even when no search text is present
50
52
* *dynamicFilter: filter when search text is present and is applied in conjunction with static filter
53
+ * - sortBy: Configure sort by operation using the propert name (with namespace prefixed) and the sort order. By default the sort order is 'ASC'
51
54
*
52
55
* **WMS|CSW**
53
56
* - tileSize: Option allows to select and configure the default tile size of the layer to be requested with
@@ -218,9 +221,40 @@ export default ({
218
221
onChange = { event => onChangeServiceProperty ( "layerOptions" , { ...service . layerOptions , tileSize : event && event . value } ) } />
219
222
</ InputGroup >
220
223
</ FormGroup >
224
+
221
225
{ ! isNil ( service . type ) && service . type === "csw" &&
222
- < CSWFilters filter = { service ?. filter } onChangeServiceProperty = { onChangeServiceProperty } />
223
- }
226
+ < >
227
+ < hr style = { { margin : "8px 0" } } />
228
+ < FormGroup className = "form-group-flex sort-by" >
229
+ < ControlLabel className = "strong" style = { { display : 'flex' , alignItems : "center" } } >
230
+ < Message msgId = "catalog.sortBy.label" />
231
+ < OverlayTrigger placement = { "bottom" } overlay = { < Tooltip id = { "sortby" } >
232
+ < Message msgId = { "catalog.sortBy.tooltip" } />
233
+ </ Tooltip > } >
234
+ < Glyphicon
235
+ style = { { marginLeft : 4 } }
236
+ glyph = { "info-sign" }
237
+ />
238
+ </ OverlayTrigger >
239
+ </ ControlLabel >
240
+ < InputGroup style = { { display : "flex" } } >
241
+ < FormControl
242
+ type = "text"
243
+ placeholder = { "catalog.sortBy.placeholder" }
244
+ style = { { textOverflow : "ellipsis" , flex : 1.5 } }
245
+ value = { service ?. sortBy ?. name }
246
+ onChange = { value => onChangeServiceProperty ( "sortBy" , { ...service ?. sortBy , name : value } ) }
247
+ />
248
+ < Select
249
+ clearable = { false }
250
+ wrapperStyle = { { flex : 1 } }
251
+ value = { service ?. sortBy ?. order ?? "ASC" }
252
+ options = { [ "ASC" , "DESC" ] . map ( value => ( { value, label : value } ) ) }
253
+ onChange = { event => onChangeServiceProperty ( "sortBy" , { ...service ?. sortBy , order : event && event . value } ) } />
254
+ </ InputGroup >
255
+ </ FormGroup >
256
+ < CSWFilters filter = { service ?. filter } onChangeServiceProperty = { onChangeServiceProperty } />
257
+ </ > }
224
258
{ ! isNil ( service . type ) && service . type === "wms" && ( < WMSDomainAliases service = { service } onChangeServiceProperty = { onChangeServiceProperty } /> ) }
225
259
</ CommonAdvancedSettings > ) ;
226
260
} ;
0 commit comments