@opengeoweb/layer-select 14.4.0 → 14.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/index.esm.js +316 -340
  2. package/package.json +8 -8
  3. package/src/lib/components/DataExplorerButtonConnect/DataExplorerButtonConnect.d.ts +1 -1
  4. package/src/lib/components/KeywordFilterButton/KeywordFilterButtonConnect.d.ts +1 -1
  5. package/src/lib/components/KeywordFilterResults/KeywordFilterResults.d.ts +3 -3
  6. package/src/lib/components/KeywordFilterResults/KeywordFilterResultsConnect.d.ts +1 -1
  7. package/src/lib/components/KeywordFilterResults/KeywordFilterResultsListItemConnect.d.ts +2 -2
  8. package/src/lib/components/KeywordFilterResults/KeywordFilterSelectAllSwitchConnect.d.ts +1 -1
  9. package/src/lib/components/LayerList/LayerAddRemoveButton.d.ts +2 -2
  10. package/src/lib/components/LayerList/LayerList.d.ts +4 -4
  11. package/src/lib/components/LayerList/LayerList.spec.d.ts +1 -1
  12. package/src/lib/components/LayerList/LayerListConnect.d.ts +1 -1
  13. package/src/lib/components/LayerList/LayerListDimensions.d.ts +1 -1
  14. package/src/lib/components/LayerList/LayerListRow.d.ts +3 -3
  15. package/src/lib/components/LayerSelect/LayerSelect.d.ts +2 -2
  16. package/src/lib/components/LayerSelect/LayerSelectButtonConnect.d.ts +1 -1
  17. package/src/lib/components/LayerSelect/LayerSelectConnect.d.ts +1 -1
  18. package/src/lib/components/LayerSelect/LayerSelectUtils.d.ts +2 -2
  19. package/src/lib/components/Providers/Providers.d.ts +4 -4
  20. package/src/lib/components/SearchField/SearchFieldConnect.d.ts +1 -1
  21. package/src/lib/components/ServiceList/ServiceChip.d.ts +2 -2
  22. package/src/lib/components/ServiceList/ServiceChipConnect.d.ts +2 -2
  23. package/src/lib/components/ServiceList/ServiceList.d.ts +2 -2
  24. package/src/lib/components/ServiceList/ServiceListConnect.d.ts +1 -1
  25. package/src/lib/components/ServiceOptionsButton/ServiceOptionsButton.d.ts +1 -1
  26. package/src/lib/components/ServiceOptionsDialog/ServiceOptionsDialog.d.ts +3 -3
  27. package/src/lib/components/ServiceOptionsDialog/ServiceOptionsDialog.stories.d.ts +2 -2
  28. package/src/lib/components/ServiceOptionsDialog/ServiceOptionsDialogConnect.d.ts +1 -1
  29. package/src/lib/components/ServicePopup/ServicePopup.d.ts +4 -4
  30. package/src/lib/components/ServicePopup/ServicePopupDialogConnect.d.ts +1 -1
  31. package/src/lib/components/ServicePopup/utils.d.ts +3 -3
  32. package/src/lib/store/index.d.ts +1 -1
  33. package/src/lib/store/listeners.d.ts +1 -1
  34. package/src/lib/store/reducer.d.ts +2 -2
  35. package/src/lib/store/selectors.d.ts +2 -2
  36. package/src/lib/store/store.d.ts +3 -3
  37. package/src/lib/store/types.d.ts +3 -3
  38. package/src/lib/store/utils.d.ts +5 -5
  39. package/src/lib/utils/i18n.d.ts +1 -1
package/index.esm.js CHANGED
@@ -1,10 +1,9 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
- import * as React from 'react';
3
- import React__default from 'react';
2
+ import React from 'react';
4
3
  import { useSelector, useDispatch } from 'react-redux';
5
4
  import { CustomIconButton, FilterOption, ToolContainerDraggable, CustomAccordion, CustomTooltip, SearchHighlight, SearchField, CustomToggleButton, AlertBanner, ToggleMenu, CustomDialog, sessionStorageProvider } from '@opengeoweb/shared';
6
- import { Filter, ArrowDropDownDown, LayersAdd, Add, Cached, Edit, Visibility, Delete, MeteoGate, Copy } from '@opengeoweb/theme';
7
5
  import { uiTypes, serviceActions, selectorMemoizationOptions, serviceSelectors, uiActions, getUserAddedServices, setUserAddedServices, layerActions, uiSelectors, layerSelectors, mapListener, serviceListener, layersListener, openlayersListener, uiReducer, layerReducer, serviceReducer, mapReducer, useSetupDialog, mapSelectors, layerTypes, mapEnums } from '@opengeoweb/store';
6
+ import { Filter, ArrowDropDownDown, LayersAdd, MeteoGate, Add, Cached, Edit, Visibility, Delete, Copy } from '@opengeoweb/theme';
8
7
  import { createEntityAdapter, createSlice, createSelector, createListenerMiddleware, isAnyOf, combineReducers, configureStore } from '@reduxjs/toolkit';
9
8
  import { compact, countBy, partition } from 'lodash';
10
9
  import { snackbarListener, snackbarReducer, snackbarTypes, snackbarActions } from '@opengeoweb/snackbar';
@@ -14,8 +13,8 @@ import { useTranslation } from 'react-i18next';
14
13
  import { FixedSizeList } from 'react-window';
15
14
  import { getDimensionsList, LayerInfoButton, clearImageCacheForAllMaps } from '@opengeoweb/webmap-react';
16
15
  import { LayerType, webmapUtils, getWMSServiceId, queryWMSServiceInfo, queryWMSLayers, invalidateWMSGetCapabilities } from '@opengeoweb/webmap';
17
- import { ReactHookFormProvider, defaultFormOptions, ReactHookFormTextField } from '@opengeoweb/form-fields';
18
16
  import { useFormContext } from 'react-hook-form';
17
+ import { ReactHookFormProvider, defaultFormOptions, ReactHookFormTextField } from '@opengeoweb/form-fields';
19
18
 
20
19
  var en = {
21
20
  "layer-select": "Layer Select",
@@ -223,11 +222,11 @@ var filterLayersFromService = function filterLayersFromService(serviceId, servic
223
222
  var searchStringArray = searchString.split(' ');
224
223
  return mapStoreService.layers.filter(function (layer) {
225
224
  return searchStringArray.every(function (search) {
226
- var _layer$name, _layer$title, _layer$abstract;
225
+ var _layer$keywords, _layer$name, _layer$title, _layer$abstract;
227
226
  var searchLowercase = search.toLowerCase();
228
227
  var layerFilterIds = layer.path.map(function (group) {
229
228
  return getFilterId('groups', group);
230
- }).concat(layer.keywords.map(function (keyword) {
229
+ }).concat(((_layer$keywords = layer.keywords) != null ? _layer$keywords : []).map(function (keyword) {
231
230
  return getFilterId('keywords', keyword);
232
231
  }));
233
232
  var isFilterInLayer = (layerFilterIds == null ? void 0 : layerFilterIds.some(function (id) {
@@ -251,23 +250,6 @@ var isUserAddedService = function isUserAddedService(scope) {
251
250
  return scope === 'user';
252
251
  };
253
252
 
254
- /* *
255
- * Licensed under the Apache License, Version 2.0 (the "License");
256
- * you may not use this file except in compliance with the License.
257
- * You may obtain a copy of the License at
258
- *
259
- * http://www.apache.org/licenses/LICENSE-2.0
260
- *
261
- * Unless required by applicable law or agreed to in writing, software
262
- * distributed under the License is distributed on an "AS IS" BASIS,
263
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
264
- * See the License for the specific language governing permissions and
265
- * limitations under the License.
266
- *
267
- * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
268
- * Copyright 2023 - Finnish Meteorological Institute (FMI)
269
- * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
270
- * */
271
253
  var layerSelectFilterAdapter = createEntityAdapter();
272
254
  var layerSelectActiveServicesAdapter = createEntityAdapter({
273
255
  selectId: function selectId(service) {
@@ -494,7 +476,7 @@ var layerSelectReducer = slice.reducer,
494
476
  * */
495
477
  var useAppSelector = useSelector;
496
478
  var layerSelectStore = function layerSelectStore(store) {
497
- return store && store.layerSelect ? store.layerSelect : null;
479
+ return store != null && store.layerSelect ? store.layerSelect : null;
498
480
  };
499
481
  /**
500
482
  * Returns search filter string
@@ -688,28 +670,6 @@ var selectors = /*#__PURE__*/Object.freeze({
688
670
  useAppSelector: useAppSelector
689
671
  });
690
672
 
691
- /* *
692
- * Licensed under the Apache License, Version 2.0 (the "License");
693
- * you may not use this file except in compliance with the License.
694
- * You may obtain a copy of the License at
695
- *
696
- * http://www.apache.org/licenses/LICENSE-2.0
697
- *
698
- * Unless required by applicable law or agreed to in writing, software
699
- * distributed under the License is distributed on an "AS IS" BASIS,
700
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
701
- * See the License for the specific language governing permissions and
702
- * limitations under the License.
703
- *
704
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
705
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
706
- * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
707
- * */
708
-
709
- var types = /*#__PURE__*/Object.freeze({
710
- __proto__: null
711
- });
712
-
713
673
  function _OverloadYield(e, d) {
714
674
  this.v = e, this.k = d;
715
675
  }
@@ -1191,11 +1151,11 @@ var KeywordFilterButtonConnect = function KeywordFilterButtonConnect(_ref) {
1191
1151
  }));
1192
1152
  }, [currentActiveMapId, dispatch, isOpenInStore, mapId, source, dialogType]);
1193
1153
  return jsx(CustomIconButton, {
1194
- variant: "tool",
1195
- onClick: openFilterResultsDialog,
1196
- isSelected: isOpenInStore,
1197
- id: "keywordFilterButton",
1198
1154
  "data-testid": "keywordFilterButton",
1155
+ id: "keywordFilterButton",
1156
+ isSelected: isOpenInStore,
1157
+ onClick: openFilterResultsDialog,
1158
+ variant: "tool",
1199
1159
  children: jsx(Filter, {})
1200
1160
  });
1201
1161
  };
@@ -1210,12 +1170,12 @@ var KeywordFilterResultsListItemConnect = function KeywordFilterResultsListItemC
1210
1170
  }));
1211
1171
  }, [dispatch]);
1212
1172
  return jsx(FilterOption, {
1213
- optionId: filter.id,
1214
1173
  checked: !!filter.checked,
1174
+ label: filter.amountVisible ? filter.name + " (" + filter.amountVisible + ")" : filter.name,
1215
1175
  onClick: function onClick(checked, only) {
1216
1176
  toggleFilter(filter.id, only);
1217
1177
  },
1218
- label: filter.amountVisible ? filter.name + " (" + filter.amountVisible + ")" : filter.name
1178
+ optionId: filter.id
1219
1179
  });
1220
1180
  };
1221
1181
 
@@ -1228,14 +1188,14 @@ var KeywordFilterSelectAllSwitchConnect = function KeywordFilterSelectAllSwitchC
1228
1188
  dispatch(layerSelectActions.toggleAllFilters());
1229
1189
  }, [dispatch]);
1230
1190
  return jsx(Switch, {
1191
+ checked: allFiltersActive,
1192
+ "data-testid": "customSwitch",
1193
+ onChange: toggleFilters,
1231
1194
  slotProps: {
1232
1195
  input: {
1233
1196
  'aria-label': 'All'
1234
1197
  }
1235
- },
1236
- checked: allFiltersActive,
1237
- onChange: toggleFilters,
1238
- "data-testid": "customSwitch"
1198
+ }
1239
1199
  });
1240
1200
  };
1241
1201
 
@@ -1283,27 +1243,27 @@ var KeywordFilterResults = function KeywordFilterResults(_ref) {
1283
1243
  var _useLayerSelectTransl = useLayerSelectTranslation(),
1284
1244
  t = _useLayerSelectTransl.t;
1285
1245
  return jsxs(ToolContainerDraggable, {
1286
- title: t('groups-and-keywords-dialog-title'),
1246
+ bounds: bounds,
1287
1247
  "data-testid": "keywordFilterResults",
1288
- startSize: {
1289
- width: 349,
1290
- height: 600
1291
- },
1292
- minWidth: 312,
1293
- minHeight: 192,
1294
1248
  isOpen: isOpen,
1249
+ minHeight: 192,
1250
+ minWidth: 312,
1295
1251
  onClose: onClose,
1296
- bounds: bounds,
1297
1252
  onMouseDown: onMouseDown,
1298
1253
  order: order,
1299
1254
  source: source,
1255
+ startSize: {
1256
+ width: 349,
1257
+ height: 600
1258
+ },
1259
+ title: t('groups-and-keywords-dialog-title'),
1300
1260
  children: [jsxs(Grid, {
1261
+ alignItems: "center",
1301
1262
  container: true,
1263
+ justifyContent: "space-between",
1302
1264
  size: {
1303
1265
  xs: 12
1304
1266
  },
1305
- justifyContent: "space-between",
1306
- alignItems: "center",
1307
1267
  sx: {
1308
1268
  backgroundColor: 'background.paper',
1309
1269
  position: 'sticky',
@@ -1311,31 +1271,31 @@ var KeywordFilterResults = function KeywordFilterResults(_ref) {
1311
1271
  zIndex: 100
1312
1272
  },
1313
1273
  children: [jsx(Grid, {
1274
+ alignItems: "center",
1314
1275
  container: true,
1276
+ justifyContent: "flex-start",
1315
1277
  size: {
1316
1278
  xs: 6
1317
1279
  },
1318
- justifyContent: "flex-start",
1319
- alignItems: "center",
1320
1280
  sx: {
1321
1281
  padding: '15px 15px 0 24px'
1322
1282
  },
1323
1283
  children: t('select-all')
1324
1284
  }), jsx(Grid, {
1285
+ alignContent: "center",
1325
1286
  container: true,
1287
+ justifyContent: "flex-end",
1326
1288
  size: {
1327
1289
  xs: 6
1328
1290
  },
1329
- justifyContent: "flex-end",
1330
- alignContent: "center",
1331
1291
  sx: {
1332
1292
  padding: '15px 15px 0 15px'
1333
1293
  },
1334
1294
  children: jsx(KeywordFilterSelectAllSwitchConnect, {})
1335
1295
  })]
1336
1296
  }), jsx(CustomAccordion, {
1337
- title: t('groups'),
1338
1297
  detailsSx: accordionDetailsStyle,
1298
+ title: t('groups'),
1339
1299
  children: jsx(List, {
1340
1300
  dense: true,
1341
1301
  style: listStyle,
@@ -1346,8 +1306,8 @@ var KeywordFilterResults = function KeywordFilterResults(_ref) {
1346
1306
  })
1347
1307
  })
1348
1308
  }), jsx(CustomAccordion, {
1349
- title: t('keywords'),
1350
1309
  detailsSx: accordionDetailsStyle,
1310
+ title: t('keywords'),
1351
1311
  children: jsx(List, {
1352
1312
  dense: true,
1353
1313
  style: listStyle,
@@ -1375,12 +1335,12 @@ var KeywordFilterResultsConnect = function KeywordFilterResultsConnect(_ref) {
1375
1335
  var filters = useAppSelector(getFilters);
1376
1336
  return jsx(KeywordFilterResults, {
1377
1337
  bounds: bounds,
1338
+ filters: filters,
1378
1339
  isOpen: isDialogOpen,
1379
1340
  onClose: onCloseDialog,
1380
1341
  onMouseDown: setDialogOrder,
1381
1342
  order: dialogOrder,
1382
- source: uiSource,
1383
- filters: filters
1343
+ source: uiSource
1384
1344
  });
1385
1345
  };
1386
1346
 
@@ -1424,7 +1384,8 @@ var LayerAddRemoveButton = function LayerAddRemoveButton(_ref) {
1424
1384
  });
1425
1385
  };
1426
1386
  var handleClose = function handleClose(event) {
1427
- if (anchorRef.current && anchorRef.current.contains(event.target)) {
1387
+ var _anchorRef$current;
1388
+ if ((_anchorRef$current = anchorRef.current) != null && _anchorRef$current.contains(event.target)) {
1428
1389
  return;
1429
1390
  }
1430
1391
  setOpen(false);
@@ -1442,25 +1403,15 @@ var LayerAddRemoveButton = function LayerAddRemoveButton(_ref) {
1442
1403
  };
1443
1404
  return jsxs(Fragment, {
1444
1405
  children: [jsxs(ToggleButtonGroup, {
1445
- ref: anchorRef,
1446
1406
  fullWidth: true,
1407
+ ref: anchorRef,
1447
1408
  style: {
1448
1409
  height: '32px'
1449
1410
  },
1450
1411
  children: [jsx(ToggleButton, {
1451
- "data-testid": "layerAddRemoveButton-" + layer.name,
1452
- value: "selected",
1453
- selected: !!foundLayer,
1454
1412
  className: "tool",
1455
- style: {
1456
- borderRadius: '3px 0 0 3px',
1457
- height: 'inherit',
1458
- minWidth: '62px',
1459
- fontSize: '12px'
1460
- },
1461
- onMouseDown: function onMouseDown(e) {
1462
- e.stopPropagation();
1463
- },
1413
+ "data-testid": "layerAddRemoveButton-" + layer.name,
1414
+ fullWidth: true,
1464
1415
  onClick: function onClick() {
1465
1416
  !foundLayer ? addLayer({
1466
1417
  serviceUrl: serviceUrl,
@@ -1470,7 +1421,17 @@ var LayerAddRemoveButton = function LayerAddRemoveButton(_ref) {
1470
1421
  layerIndex: foundLayerIndex
1471
1422
  });
1472
1423
  },
1473
- fullWidth: true,
1424
+ onMouseDown: function onMouseDown(e) {
1425
+ e.stopPropagation();
1426
+ },
1427
+ selected: !!foundLayer,
1428
+ style: {
1429
+ borderRadius: '3px 0 0 3px',
1430
+ height: 'inherit',
1431
+ minWidth: '62px',
1432
+ fontSize: '12px'
1433
+ },
1434
+ value: "selected",
1474
1435
  children: !foundLayer ? t('add') : t('remove')
1475
1436
  }), jsx(Box, {
1476
1437
  sx: {
@@ -1478,20 +1439,20 @@ var LayerAddRemoveButton = function LayerAddRemoveButton(_ref) {
1478
1439
  backgroundColor: foundLayer || layerExistsInWorkspace ? 'geowebColors.buttons.primary.default.borderColor' : 'geowebColors.buttons.secondary.default.fill'
1479
1440
  }
1480
1441
  }), jsx(ToggleButton, {
1442
+ className: "tool",
1481
1443
  "data-testid": "layerAddRemoveButton-dropdown-" + layer.name,
1482
- value: "dropdown",
1483
- selected: !!layerExistsInWorkspace,
1484
1444
  onClick: handleToggle,
1485
- className: "tool",
1486
1445
  onMouseDown: function onMouseDown(e) {
1487
1446
  e.stopPropagation();
1488
1447
  },
1448
+ selected: !!layerExistsInWorkspace,
1489
1449
  style: {
1490
1450
  marginLeft: '0',
1491
1451
  minWidth: '32px',
1492
1452
  borderRadius: '0 3px 3px 0',
1493
1453
  height: 'inherit'
1494
1454
  },
1455
+ value: "dropdown",
1495
1456
  children: jsx(ArrowDropDownDown, {
1496
1457
  style: {
1497
1458
  marginRight: '1px'
@@ -1499,14 +1460,14 @@ var LayerAddRemoveButton = function LayerAddRemoveButton(_ref) {
1499
1460
  })
1500
1461
  })]
1501
1462
  }), jsx(Popper, {
1502
- open: open,
1503
1463
  anchorEl: anchorRef.current,
1504
- role: undefined,
1505
- transition: true,
1464
+ open: open,
1506
1465
  placement: "bottom-end",
1466
+ role: undefined,
1507
1467
  style: {
1508
1468
  zIndex: 1300
1509
1469
  },
1470
+ transition: true,
1510
1471
  children: function children(_ref2) {
1511
1472
  var TransitionProps = _ref2.TransitionProps,
1512
1473
  placement = _ref2.placement;
@@ -1520,8 +1481,8 @@ var LayerAddRemoveButton = function LayerAddRemoveButton(_ref) {
1520
1481
  children: jsxs(MenuList, {
1521
1482
  autoFocusItem: true,
1522
1483
  children: [jsx(MenuItem, {
1523
- onClick: handleAddAll,
1524
1484
  disabled: existsInAllMaps,
1485
+ onClick: handleAddAll,
1525
1486
  children: t('add-to-all-maps')
1526
1487
  }), jsx(MenuItem, {
1527
1488
  disabled: !layerExistsInWorkspace,
@@ -1541,7 +1502,7 @@ var LayerAddRemoveButton = function LayerAddRemoveButton(_ref) {
1541
1502
 
1542
1503
  var LayerListDimensions = function LayerListDimensions(_ref) {
1543
1504
  var dimensions = _ref.dimensions;
1544
- if (!dimensions || !dimensions.length) {
1505
+ if (!(dimensions != null && dimensions.length)) {
1545
1506
  return null;
1546
1507
  }
1547
1508
  return jsx(Fragment, {
@@ -1686,7 +1647,7 @@ var layerInfoStyle = {
1686
1647
  lineHeight: 1
1687
1648
  };
1688
1649
  var LayerListRow = function LayerListRow(_ref) {
1689
- var _layer$keywords;
1650
+ var _layer$keywords, _layer$keywords2;
1690
1651
  var layer = _ref.layer,
1691
1652
  service = _ref.service,
1692
1653
  allLayers = _ref.allLayers,
@@ -1707,10 +1668,10 @@ var LayerListRow = function LayerListRow(_ref) {
1707
1668
  var columns = widthToColumns(layerSelectWidth);
1708
1669
  var dimensions = getDimensionsList(layer.dimensions);
1709
1670
  return jsxs(Grid, {
1710
- "data-testid": "layerListLayerRow",
1671
+ alignItems: "center",
1711
1672
  container: true,
1673
+ "data-testid": "layerListLayerRow",
1712
1674
  justifyContent: "center",
1713
- alignItems: "center",
1714
1675
  sx: {
1715
1676
  backgroundColor: 'geowebColors.cards.cardContainer',
1716
1677
  padding: '8px',
@@ -1736,8 +1697,8 @@ var LayerListRow = function LayerListRow(_ref) {
1736
1697
  overflow: 'hidden'
1737
1698
  },
1738
1699
  children: jsx(SearchHighlight, {
1739
- text: layer.title,
1740
- search: searchFilter
1700
+ search: searchFilter,
1701
+ text: layer.title
1741
1702
  })
1742
1703
  })
1743
1704
  }), jsxs(Grid, {
@@ -1753,8 +1714,8 @@ var LayerListRow = function LayerListRow(_ref) {
1753
1714
  overflow: 'hidden'
1754
1715
  },
1755
1716
  children: jsx(SearchHighlight, {
1756
- text: service.name,
1757
- search: searchFilter
1717
+ search: searchFilter,
1718
+ text: service.name
1758
1719
  })
1759
1720
  }), jsx(LayerInfoButton, {
1760
1721
  isActive: hasActiveLayer,
@@ -1764,12 +1725,12 @@ var LayerListRow = function LayerListRow(_ref) {
1764
1725
  sx: columns.column2,
1765
1726
  children: [jsx(Grid, {
1766
1727
  sx: columns.column3,
1767
- children: layer["abstract"] && jsx(Typography, {
1728
+ children: !!layer["abstract"] && jsx(Typography, {
1768
1729
  "data-testid": "layerAbstract",
1769
1730
  sx: layerInfoStyle,
1770
1731
  children: jsx(SearchHighlight, {
1771
- text: layer["abstract"],
1772
- search: searchFilter
1732
+ search: searchFilter,
1733
+ text: layer["abstract"]
1773
1734
  })
1774
1735
  })
1775
1736
  }), jsxs(Grid, {
@@ -1785,42 +1746,42 @@ var LayerListRow = function LayerListRow(_ref) {
1785
1746
  children: [layer.path.length > 0 && jsxs(Typography, {
1786
1747
  sx: layerInfoStyle,
1787
1748
  children: [t('groups'), ":", ' ', jsx(SearchHighlight, {
1788
- text: layer.path.join(' / '),
1789
- search: searchFilter
1749
+ search: searchFilter,
1750
+ text: layer.path.join(' / ')
1790
1751
  })]
1791
1752
  }), ((_layer$keywords = layer.keywords) == null ? void 0 : _layer$keywords.length) > 0 && jsxs(Typography, {
1792
1753
  sx: layerInfoStyle,
1793
1754
  children: [t('keywords'), ":", ' ', jsx(SearchHighlight, {
1794
- text: layer.keywords.slice().sort(function (textA, textB) {
1755
+ search: searchFilter,
1756
+ text: ((_layer$keywords2 = layer.keywords) != null ? _layer$keywords2 : []).slice().sort(function (textA, textB) {
1795
1757
  return textA.localeCompare(textB);
1796
- }).join(', '),
1797
- search: searchFilter
1758
+ }).join(', ')
1798
1759
  })]
1799
1760
  })]
1800
1761
  })]
1801
1762
  })]
1802
1763
  })]
1803
1764
  }), jsx(Grid, {
1765
+ alignItems: "center",
1804
1766
  container: true,
1805
- sx: columns.column9,
1806
1767
  justifyContent: "flex-end",
1807
- alignItems: "center",
1768
+ sx: columns.column9,
1808
1769
  children: jsx(Box, {
1770
+ alignItems: "flex-start",
1809
1771
  sx: (columns.column7, {
1810
1772
  width: '100%',
1811
1773
  paddingLeft: '16px'
1812
1774
  }),
1813
- alignItems: "flex-start",
1814
1775
  children: jsx(LayerAddRemoveButton, {
1815
- layer: layer,
1816
- serviceUrl: service.serviceUrl,
1817
- allMapIds: allMapIds,
1818
- allLayers: allLayers,
1819
1776
  addLayer: addLayer,
1820
1777
  addLayerToAllMaps: addLayerToAllMaps,
1778
+ allLayers: allLayers,
1779
+ allMapIds: allMapIds,
1821
1780
  deleteLayer: deleteLayer,
1781
+ layer: layer,
1782
+ mapLayers: mapLayers,
1822
1783
  removeLayerFromAllMaps: removeLayerFromAllMaps,
1823
- mapLayers: mapLayers
1784
+ serviceUrl: service.serviceUrl
1824
1785
  })
1825
1786
  })
1826
1787
  })]
@@ -1871,26 +1832,26 @@ var LayerList = function LayerList(_ref) {
1871
1832
  var isActiveLayer = isLayerInfoVisibleInStore && (currentLayerInfo == null ? void 0 : currentLayerInfo.serviceUrl) === service.serviceUrl && (currentLayerInfo == null ? void 0 : currentLayerInfo.layerName) === filter.name;
1872
1833
  return jsx("div", {
1873
1834
  style: style,
1874
- children: service && jsx(LayerListRow, {
1875
- layer: filter,
1876
- service: service,
1877
- allLayers: allLayers,
1878
- allMapIds: allMapIds,
1835
+ children: !!service && jsx(LayerListRow, {
1879
1836
  addLayer: addLayer,
1880
1837
  addLayerToAllMaps: addLayerToAllMaps,
1838
+ allLayers: allLayers,
1839
+ allMapIds: allMapIds,
1881
1840
  deleteLayer: deleteLayer,
1882
- removeLayerFromAllMaps: removeLayerFromAllMaps,
1883
- mapLayers: mapLayers,
1884
- layerSelectWidth: layerSelectWidth,
1885
- searchFilter: searchFilter,
1886
1841
  hasActiveLayer: isActiveLayer,
1842
+ layer: filter,
1843
+ layerSelectWidth: layerSelectWidth,
1844
+ mapLayers: mapLayers,
1887
1845
  onToggleActiveLayer: function onToggleActiveLayer() {
1888
1846
  return _onToggleActiveLayer({
1889
1847
  serviceUrl: service == null ? void 0 : service.serviceUrl,
1890
1848
  layerName: filter.name,
1891
1849
  isActiveLayer: isActiveLayer
1892
1850
  });
1893
- }
1851
+ },
1852
+ removeLayerFromAllMaps: removeLayerFromAllMaps,
1853
+ searchFilter: searchFilter,
1854
+ service: service
1894
1855
  })
1895
1856
  }, filter.name);
1896
1857
  }
@@ -2013,24 +1974,24 @@ var LayerListConnect = function LayerListConnect(_ref) {
2013
1974
  }
2014
1975
  }, [mapId, dispatch]);
2015
1976
  return jsx(LayerList, {
2016
- filteredLayers: filteredLayers,
2017
- services: services,
2018
- allLayers: allLayers,
2019
- allMapIds: allMapIds,
2020
- layerSelectHeight: layerSelectHeight,
2021
- serviceListHeight: serviceListHeight,
2022
- layerSelectWidth: layerSelectWidth,
2023
1977
  addLayer: function addLayer(params) {
2024
1978
  return _addLayer(params, mapId);
2025
1979
  },
2026
1980
  addLayerToAllMaps: addLayerToAllMaps,
1981
+ allLayers: allLayers,
1982
+ allMapIds: allMapIds,
1983
+ currentLayerInfo: currentLayerInfo,
2027
1984
  deleteLayer: deleteLayer,
2028
- removeLayerFromAllMaps: removeLayerFromAllMaps,
2029
- mapLayers: mapLayers,
2030
- searchFilter: searchFilter,
1985
+ filteredLayers: filteredLayers,
2031
1986
  isLayerInfoVisibleInStore: isLayerInfoVisibleInStore,
1987
+ layerSelectHeight: layerSelectHeight,
1988
+ layerSelectWidth: layerSelectWidth,
1989
+ mapLayers: mapLayers,
2032
1990
  onToggleActiveLayer: onToggleActiveLayer,
2033
- currentLayerInfo: currentLayerInfo
1991
+ removeLayerFromAllMaps: removeLayerFromAllMaps,
1992
+ searchFilter: searchFilter,
1993
+ serviceListHeight: serviceListHeight,
1994
+ services: services
2034
1995
  });
2035
1996
  };
2036
1997
 
@@ -2069,15 +2030,50 @@ var LayerSelectButtonConnect = function LayerSelectButtonConnect(_ref) {
2069
2030
  }));
2070
2031
  }, [currentActiveMapId, dispatch, isOpenInStore, mapId, source, dialogType]);
2071
2032
  return jsx(CustomIconButton, {
2033
+ "data-testid": "layerSelectButton",
2034
+ id: "layerSelectButton",
2072
2035
  onClick: openLayerSelectDialog,
2073
2036
  sx: style$2,
2074
- id: "layerSelectButton",
2075
- "data-testid": "layerSelectButton",
2076
2037
  tooltipTitle: tooltipTitle || t('layer-select-button-tooltip'),
2077
2038
  children: icon
2078
2039
  });
2079
2040
  };
2080
2041
 
2042
+ var DataExplorerButtonConnect = function DataExplorerButtonConnect(_ref) {
2043
+ var mapId = _ref.mapId,
2044
+ _ref$source = _ref.source,
2045
+ source = _ref$source === void 0 ? 'app' : _ref$source;
2046
+ var dispatch = useDispatch();
2047
+ var dialogType = uiTypes.DialogTypes.DataExplorer;
2048
+ var currentActiveMapId = useSelector(function (store) {
2049
+ return uiSelectors.getDialogMapId(store, dialogType);
2050
+ });
2051
+ var isOpenInStore = useSelector(function (store) {
2052
+ return uiSelectors.getisDialogOpen(store, dialogType);
2053
+ });
2054
+ var openDataExplorerDialog = React.useCallback(function () {
2055
+ dispatch(uiActions.setActiveMapIdForDialog({
2056
+ type: dialogType,
2057
+ setOpen: currentActiveMapId !== mapId ? true : !isOpenInStore,
2058
+ source: source,
2059
+ mapId: mapId,
2060
+ origin: mapEnums.MapActionOrigin.map
2061
+ }));
2062
+ }, [dispatch, dialogType, currentActiveMapId, mapId, isOpenInStore, source]);
2063
+ return jsx(CustomTooltip, {
2064
+ title: "MeteoGate Data Explorer",
2065
+ children: jsx(CustomIconButton, {
2066
+ "data-testid": "dataExplorerButton",
2067
+ isSelected: currentActiveMapId !== mapId ? false : isOpenInStore,
2068
+ onClick: openDataExplorerDialog,
2069
+ variant: "tool",
2070
+ children: jsx(MeteoGate, {
2071
+ sx: {}
2072
+ })
2073
+ })
2074
+ });
2075
+ };
2076
+
2081
2077
  var SearchFieldConnect = function SearchFieldConnect() {
2082
2078
  var dispatch = useDispatch();
2083
2079
  var searchFilter = useAppSelector(function (store) {
@@ -2096,9 +2092,9 @@ var SearchFieldConnect = function SearchFieldConnect() {
2096
2092
  }));
2097
2093
  };
2098
2094
  return jsx(SearchField, {
2099
- setSearchFilter: setSearchFilter,
2095
+ onOpenServicePopup: toggleServicePopup,
2100
2096
  searchFilter: searchFilter,
2101
- onOpenServicePopup: toggleServicePopup
2097
+ setSearchFilter: setSearchFilter
2102
2098
  });
2103
2099
  };
2104
2100
 
@@ -2124,22 +2120,20 @@ var ServiceChip = function ServiceChip(_ref) {
2124
2120
  t = _useLayerSelectTransl.t;
2125
2121
  var _useTheme = useTheme(),
2126
2122
  geowebColors = _useTheme.palette.geowebColors;
2127
- var chip = all ? 'all' : service && service.serviceUrl;
2123
+ var chip = all ? 'all' : service == null ? void 0 : service.serviceUrl;
2128
2124
  return jsx(CustomTooltip, {
2129
2125
  title: service != null && service["abstract"] ? "Abstract: " + service["abstract"] : '',
2130
2126
  children: jsx("span", {
2131
2127
  children: jsx(CustomToggleButton, {
2132
- variant: "boxed",
2133
- selected: Boolean(isSelected),
2134
- tabIndex: 0,
2135
2128
  "data-testid": all ? 'serviceChipAll' : 'serviceChip',
2129
+ disabled: isDisabled,
2136
2130
  onClick: function onClick() {
2137
2131
  return toggleChip(chip);
2138
2132
  },
2139
2133
  onKeyDown: function onKeyDown() {
2140
2134
  return toggleChip(chip);
2141
2135
  },
2142
- disabled: isDisabled,
2136
+ selected: Boolean(isSelected),
2143
2137
  sx: Object.assign({}, style$1, isInSearch && Object.assign({
2144
2138
  backgroundColor: geowebColors.chip.highlightDefault.rgba + "!important",
2145
2139
  '&:hover': {
@@ -2151,6 +2145,8 @@ var ServiceChip = function ServiceChip(_ref) {
2151
2145
  backgroundColor: geowebColors.chip.highlightActiveMouseOver.rgba + "!important"
2152
2146
  }
2153
2147
  })),
2148
+ tabIndex: 0,
2149
+ variant: "boxed",
2154
2150
  children: service ? service.serviceName : t('all')
2155
2151
  })
2156
2152
  })
@@ -2181,36 +2177,38 @@ var ServiceChipConnect = function ServiceChipConnect(_ref) {
2181
2177
  }));
2182
2178
  };
2183
2179
  return jsx(ServiceChip, {
2184
- service: service,
2185
- toggleChip: toggleChip,
2186
- isSelected: isAllSelected ? false : service.enabled,
2187
2180
  isDisabled: service.isLoading,
2188
- isInSearch: isInSearch
2181
+ isInSearch: isInSearch,
2182
+ isSelected: isAllSelected ? false : service.enabled,
2183
+ service: service,
2184
+ toggleChip: toggleChip
2189
2185
  });
2190
2186
  };
2191
2187
  var AllChipConnect = function AllChipConnect(_ref2) {
2192
2188
  var isAllSelected = _ref2.isAllSelected;
2193
2189
  var dispatch = useDispatch();
2194
2190
  return jsx(ServiceChip, {
2191
+ isSelected: isAllSelected,
2195
2192
  toggleChip: function toggleChip() {
2196
2193
  if (!isAllSelected) {
2197
2194
  dispatch(layerSelectActions.enableAllActiveServices());
2198
2195
  }
2199
- },
2200
- isSelected: isAllSelected
2196
+ }
2201
2197
  });
2202
2198
  };
2203
2199
 
2204
2200
  var ServiceList = function ServiceList(_ref) {
2201
+ var _ref$current;
2205
2202
  var activeServicesById = _ref.activeServicesById,
2206
2203
  setHeight = _ref.setHeight;
2207
2204
  var ref = React.useRef(null);
2208
2205
  var _React$useState = React.useState(0),
2209
2206
  serviceListHeight = _React$useState[0],
2210
2207
  setServiceListHeight = _React$useState[1];
2211
- var clientHeight = ref && ref.current && ref.current.clientHeight && ref.current.clientHeight;
2208
+ var clientHeight = (ref == null || (_ref$current = ref.current) == null ? void 0 : _ref$current.clientHeight) && ref.current.clientHeight;
2212
2209
  React.useEffect(function () {
2213
- if (ref && ref.current && ref.current.clientHeight) {
2210
+ var _ref$current2;
2211
+ if (ref != null && (_ref$current2 = ref.current) != null && _ref$current2.clientHeight) {
2214
2212
  setServiceListHeight(ref.current.clientHeight);
2215
2213
  }
2216
2214
  }, [activeServicesById, clientHeight]);
@@ -2223,13 +2221,14 @@ var ServiceList = function ServiceList(_ref) {
2223
2221
  return activeService.enabled;
2224
2222
  });
2225
2223
  return jsx(Box, {
2224
+ "data-testid": "serviceList",
2226
2225
  sx: {
2227
2226
  marginTop: '8px',
2228
2227
  width: '100%',
2229
2228
  overflow: 'hidden'
2230
2229
  },
2231
- "data-testid": "serviceList",
2232
2230
  children: jsxs(Box, {
2231
+ ref: ref,
2233
2232
  sx: {
2234
2233
  width: '100%',
2235
2234
  display: 'block',
@@ -2240,13 +2239,12 @@ var ServiceList = function ServiceList(_ref) {
2240
2239
  marginBottom: '8px',
2241
2240
  fontSize: '0.875rem'
2242
2241
  },
2243
- ref: ref,
2244
- children: [(activeServicesIds == null ? void 0 : activeServicesIds.length) && jsx(AllChipConnect, {
2242
+ children: [!!(activeServicesIds != null && activeServicesIds.length) && jsx(AllChipConnect, {
2245
2243
  isAllSelected: isAllSelected
2246
2244
  }), activeServices.map(function (service) {
2247
2245
  return jsx(ServiceChipConnect, {
2248
- service: service,
2249
- isAllSelected: isAllSelected
2246
+ isAllSelected: isAllSelected,
2247
+ service: service
2250
2248
  }, service.serviceUrl);
2251
2249
  })]
2252
2250
  })
@@ -2259,8 +2257,8 @@ var ServiceListConnect = function ServiceListConnect(_ref) {
2259
2257
  return getFilteredActiveServices(store);
2260
2258
  });
2261
2259
  return jsx(ServiceList, {
2262
- setHeight: setHeight,
2263
- activeServicesById: sortByService(filteredActiveServices)
2260
+ activeServicesById: sortByService(filteredActiveServices),
2261
+ setHeight: setHeight
2264
2262
  });
2265
2263
  };
2266
2264
 
@@ -2332,45 +2330,45 @@ var ServiceOptionsDialog = function ServiceOptionsDialog(_ref) {
2332
2330
  (_dialogRef$current = dialogRef.current) == null || _dialogRef$current.focus();
2333
2331
  }, []);
2334
2332
  return jsxs(Box, {
2335
- sx: styles.servicesContainer,
2336
2333
  "data-testid": "ServiceDialog",
2337
2334
  onKeyDown: function onKeyDown(event) {
2338
2335
  if (event.key !== 'Escape') {
2339
2336
  event.stopPropagation();
2340
2337
  }
2341
2338
  },
2342
- tabIndex: -1,
2343
2339
  ref: dialogRef,
2340
+ sx: styles.servicesContainer,
2341
+ tabIndex: -1,
2344
2342
  children: [jsxs(Box, {
2345
2343
  sx: styles.header,
2346
2344
  children: [jsx(Box, {
2347
2345
  sx: styles.text,
2348
2346
  children: t('services')
2349
- }), error && jsx(AlertBanner, {
2350
- title: error,
2351
- shouldClose: true
2352
- })]
2347
+ }), error ? jsx(AlertBanner, {
2348
+ shouldClose: true,
2349
+ title: error
2350
+ }) : null]
2353
2351
  }), jsx(Backdrop, {
2352
+ open: isLoading,
2354
2353
  sx: Object.assign({}, styles.loading, {
2355
2354
  backgroundSize: 'cover'
2356
2355
  }),
2357
- open: isLoading,
2358
2356
  children: jsx(CircularProgress, {})
2359
2357
  }), jsx(Rows, {
2360
- services: services,
2361
- layerSelectRemoveService: layerSelectRemoveService,
2362
2358
  layerSelectReloadService: layerSelectReloadService,
2363
- setServicePopupInfo: setServicePopupInfo,
2364
- selectedLayers: selectedLayers
2359
+ layerSelectRemoveService: layerSelectRemoveService,
2360
+ selectedLayers: selectedLayers,
2361
+ services: services,
2362
+ setServicePopupInfo: setServicePopupInfo
2365
2363
  }), jsx(Box, {
2366
2364
  sx: styles.footer,
2367
2365
  children: jsx(Button, {
2366
+ "data-testid": "openAddServiceButton",
2368
2367
  onClick: openAddService,
2369
2368
  onKeyDown: stopTabPropagation,
2370
- "data-testid": "openAddServiceButton",
2369
+ startIcon: jsx(Add, {}),
2371
2370
  sx: styles.button,
2372
2371
  variant: "tertiary",
2373
- startIcon: jsx(Add, {}),
2374
2372
  children: t('add-a-new-service')
2375
2373
  })
2376
2374
  })]
@@ -2441,31 +2439,30 @@ var Rows = function Rows(_ref2) {
2441
2439
  },
2442
2440
  children: [jsx(CustomTooltip, {
2443
2441
  "data-testid": "updateServiceTooltip",
2444
- title: t('update-service-title'),
2445
2442
  placement: tooltipPlacement(),
2446
2443
  slotProps: {
2447
2444
  popper: tooltipPopperProps
2448
2445
  },
2446
+ title: t('update-service-title'),
2449
2447
  children: jsx(CustomIconButton, {
2450
- "data-testid": "updateServiceButton",
2451
2448
  "aria-label": "Update layers from WMS service",
2452
- onKeyDown: stopTabPropagation,
2449
+ "data-testid": "updateServiceButton",
2453
2450
  onClick: function onClick() {
2454
2451
  layerSelectReloadService(serviceUrl);
2455
2452
  },
2453
+ onKeyDown: stopTabPropagation,
2456
2454
  children: jsx(Cached, {})
2457
2455
  })
2458
2456
  }), userAddedService ? jsx(CustomTooltip, {
2459
- title: t('edit-service-title'),
2460
2457
  placement: tooltipPlacement(),
2461
2458
  slotProps: {
2462
2459
  popper: tooltipPopperProps
2463
2460
  },
2461
+ title: t('edit-service-title'),
2464
2462
  children: jsx("span", {
2465
2463
  children: jsx(CustomIconButton, {
2466
2464
  "aria-label": "edit service",
2467
2465
  "data-testid": "openEditServiceButton",
2468
- onKeyDown: stopTabPropagation,
2469
2466
  onClick: function onClick() {
2470
2467
  setServicePopupInfo({
2471
2468
  isOpen: true,
@@ -2474,20 +2471,20 @@ var Rows = function Rows(_ref2) {
2474
2471
  variant: 'edit'
2475
2472
  });
2476
2473
  },
2474
+ onKeyDown: stopTabPropagation,
2477
2475
  children: jsx(Edit, {})
2478
2476
  })
2479
2477
  })
2480
2478
  }) : jsx(CustomTooltip, {
2481
- title: t('show-service-title'),
2482
2479
  placement: tooltipPlacement(),
2483
2480
  slotProps: {
2484
2481
  popper: tooltipPopperProps
2485
2482
  },
2483
+ title: t('show-service-title'),
2486
2484
  children: jsx("span", {
2487
2485
  children: jsx(CustomIconButton, {
2488
2486
  "aria-label": "show service",
2489
2487
  "data-testid": "openShowServiceButton",
2490
- onKeyDown: stopTabPropagation,
2491
2488
  onClick: function onClick() {
2492
2489
  setServicePopupInfo({
2493
2490
  isOpen: true,
@@ -2496,26 +2493,27 @@ var Rows = function Rows(_ref2) {
2496
2493
  variant: 'show'
2497
2494
  });
2498
2495
  },
2496
+ onKeyDown: stopTabPropagation,
2499
2497
  children: jsx(Visibility, {})
2500
2498
  })
2501
2499
  })
2502
- }), userAddedService && jsx(Box, {
2500
+ }), !!userAddedService && jsx(Box, {
2503
2501
  children: jsx(CustomTooltip, {
2504
- title: deleteServiceTitle(t, serviceHasActiveLayers),
2502
+ "data-testid": "removeServiceTooltip",
2503
+ placement: tooltipPlacement(),
2505
2504
  slotProps: {
2506
2505
  popper: tooltipPopperProps
2507
2506
  },
2508
- placement: tooltipPlacement(),
2509
- "data-testid": "removeServiceTooltip",
2507
+ title: deleteServiceTitle(t, serviceHasActiveLayers),
2510
2508
  children: jsx("span", {
2511
2509
  children: jsx(CustomIconButton, {
2512
- "data-testid": "removeServiceButton",
2513
2510
  "aria-label": "delete service",
2511
+ "data-testid": "removeServiceButton",
2514
2512
  disabled: serviceHasActiveLayers,
2515
- onKeyDown: stopTabPropagation,
2516
2513
  onClick: function onClick() {
2517
2514
  return layerSelectRemoveService(serviceId, serviceUrl, serviceName);
2518
2515
  },
2516
+ onKeyDown: stopTabPropagation,
2519
2517
  children: jsx(Delete, {})
2520
2518
  })
2521
2519
  })
@@ -2703,15 +2701,15 @@ var ServiceOptionsDialogConnect = function ServiceOptionsDialogConnect(_ref) {
2703
2701
  service = getService(services, serviceUrl);
2704
2702
  serviceSetLayers({
2705
2703
  id: layersForService.id,
2706
- name: service && service.serviceName || layersForService.name,
2704
+ name: (service == null ? void 0 : service.serviceName) || layersForService.name,
2707
2705
  serviceUrl: serviceUrl,
2708
- "abstract": service && service["abstract"] || layersForService["abstract"],
2706
+ "abstract": (service == null ? void 0 : service["abstract"]) || layersForService["abstract"],
2709
2707
  layers: layersForService.layers,
2710
- scope: service && service.scope || 'user',
2708
+ scope: (service == null ? void 0 : service.scope) || 'user',
2711
2709
  isUpdating: true
2712
2710
  });
2713
2711
  clearImageCacheForAllMaps();
2714
- serviceTitle = service && service.serviceName || layersForService.name;
2712
+ serviceTitle = (service == null ? void 0 : service.serviceName) || layersForService.name;
2715
2713
  showSnackbar(getServiceSuccesUpdateMessage(serviceTitle));
2716
2714
  _context.next = 16;
2717
2715
  break;
@@ -2736,13 +2734,13 @@ var ServiceOptionsDialogConnect = function ServiceOptionsDialogConnect(_ref) {
2736
2734
  };
2737
2735
  }(), [serviceSetLayers, services, showSnackbar, t]);
2738
2736
  return jsx(ServiceOptionsDialog, {
2737
+ error: error,
2738
+ isLoading: isLoading,
2739
+ layerSelectReloadService: layerSelectReloadService,
2740
+ layerSelectRemoveService: layerSelectRemoveService,
2739
2741
  selectedLayers: selectedLayers,
2740
2742
  services: services,
2741
- layerSelectRemoveService: layerSelectRemoveService,
2742
- layerSelectReloadService: layerSelectReloadService,
2743
- setServicePopupInfo: setServicePopupInfo,
2744
- isLoading: isLoading,
2745
- error: error
2743
+ setServicePopupInfo: setServicePopupInfo
2746
2744
  });
2747
2745
  };
2748
2746
 
@@ -2757,41 +2755,6 @@ var ServiceOptionsButton = function ServiceOptionsButton(_ref) {
2757
2755
  });
2758
2756
  };
2759
2757
 
2760
- var DataExplorerButtonConnect = function DataExplorerButtonConnect(_ref) {
2761
- var mapId = _ref.mapId,
2762
- _ref$source = _ref.source,
2763
- source = _ref$source === void 0 ? 'app' : _ref$source;
2764
- var dispatch = useDispatch();
2765
- var dialogType = uiTypes.DialogTypes.DataExplorer;
2766
- var currentActiveMapId = useSelector(function (store) {
2767
- return uiSelectors.getDialogMapId(store, dialogType);
2768
- });
2769
- var isOpenInStore = useSelector(function (store) {
2770
- return uiSelectors.getisDialogOpen(store, dialogType);
2771
- });
2772
- var openDataExplorerDialog = React.useCallback(function () {
2773
- dispatch(uiActions.setActiveMapIdForDialog({
2774
- type: dialogType,
2775
- setOpen: currentActiveMapId !== mapId ? true : !isOpenInStore,
2776
- source: source,
2777
- mapId: mapId,
2778
- origin: mapEnums.MapActionOrigin.map
2779
- }));
2780
- }, [dispatch, dialogType, currentActiveMapId, mapId, isOpenInStore, source]);
2781
- return jsx(CustomTooltip, {
2782
- title: "MeteoGate Data Explorer",
2783
- children: jsx(CustomIconButton, {
2784
- variant: "tool",
2785
- "data-testid": "dataExplorerButton",
2786
- onClick: openDataExplorerDialog,
2787
- isSelected: currentActiveMapId !== mapId ? false : isOpenInStore,
2788
- children: jsx(MeteoGate, {
2789
- sx: {}
2790
- })
2791
- })
2792
- });
2793
- };
2794
-
2795
2758
  var LayerSelect = function LayerSelect(_ref) {
2796
2759
  var mapId = _ref.mapId,
2797
2760
  bounds = _ref.bounds,
@@ -2836,29 +2799,12 @@ var LayerSelect = function LayerSelect(_ref) {
2836
2799
  }
2837
2800
  };
2838
2801
  return jsxs(ToolContainerDraggable, {
2839
- title: showTitle ? "Layer Select " + mapId : 'Layer Select',
2840
- startSize: {
2841
- width: width,
2842
- height: height
2843
- },
2844
- minWidth: 320,
2845
- minHeight: 126,
2846
- startPosition: {
2847
- top: 150,
2848
- left: 100
2849
- },
2850
- isOpen: isOpen,
2851
- onResizeStop: function onResizeStop(_event, _direction, node) {
2852
- var width = node.offsetWidth,
2853
- height = node.offsetHeight;
2854
- onChangeSize({
2855
- width: width,
2856
- height: height
2857
- });
2858
- },
2859
- onClose: onClose,
2860
2802
  bounds: bounds,
2861
2803
  "data-testid": "layerSelectWindow",
2804
+ isOpen: isOpen,
2805
+ minHeight: 126,
2806
+ minWidth: 320,
2807
+ onClose: onClose,
2862
2808
  onMouseDown: function onMouseDown(event) {
2863
2809
  var target = event.target;
2864
2810
  var isButtonInScrollableList = target.closest('.layerInfoButton') || target.closest('.layerAddRemoveButton');
@@ -2869,8 +2815,25 @@ var LayerSelect = function LayerSelect(_ref) {
2869
2815
  }
2870
2816
  _onMouseDown(event);
2871
2817
  },
2818
+ onResizeStop: function onResizeStop(_event, _direction, node) {
2819
+ var width = node.offsetWidth,
2820
+ height = node.offsetHeight;
2821
+ onChangeSize({
2822
+ width: width,
2823
+ height: height
2824
+ });
2825
+ },
2872
2826
  order: order,
2873
2827
  source: source,
2828
+ startPosition: {
2829
+ top: 150,
2830
+ left: 100
2831
+ },
2832
+ startSize: {
2833
+ width: width,
2834
+ height: height
2835
+ },
2836
+ title: showTitle ? "Layer Select " + mapId : 'Layer Select',
2874
2837
  children: [jsx(Box, {
2875
2838
  sx: {
2876
2839
  padding: '4px 16px 0 16px'
@@ -2888,11 +2851,11 @@ var LayerSelect = function LayerSelect(_ref) {
2888
2851
  children: [jsx(Grid, {
2889
2852
  size: 12,
2890
2853
  children: jsx(KeywordFilterButtonConnect, {
2891
- mapId: mapId,
2892
2854
  isMultiMap: isMultiMap,
2855
+ mapId: mapId,
2893
2856
  source: source
2894
2857
  })
2895
- }), hasDataExplorer && jsx(Grid, {
2858
+ }), !!hasDataExplorer && jsx(Grid, {
2896
2859
  size: 12,
2897
2860
  children: jsx(DataExplorerButtonConnect, {
2898
2861
  mapId: mapId
@@ -2920,10 +2883,10 @@ var LayerSelect = function LayerSelect(_ref) {
2920
2883
  padding: '0 16px'
2921
2884
  },
2922
2885
  children: jsx(LayerListConnect, {
2923
- mapId: mapId,
2924
2886
  layerSelectHeight: height,
2925
- serviceListHeight: serviceListHeight,
2926
- layerSelectWidth: width
2887
+ layerSelectWidth: width,
2888
+ mapId: mapId,
2889
+ serviceListHeight: serviceListHeight
2927
2890
  })
2928
2891
  })]
2929
2892
  });
@@ -3129,51 +3092,34 @@ var ServicePopupUnwrapped = function ServicePopupUnwrapped(_ref2) {
3129
3092
  var isShowPopup = servicePopupVariant === 'show';
3130
3093
  var isServiceUrlDisabled = isShowPopup || servicePopupVariant === 'edit';
3131
3094
  return jsx(CustomDialog, {
3132
- open: isOpen,
3133
- hideBackdrop: hideBackdrop,
3134
- fullWidth: true,
3135
- maxWidth: "xs",
3136
- "data-testid": "servicePopup",
3137
- title: getTitleForVariant(t, servicePopupVariant),
3138
- sx: {
3139
- '& .MuiDialog-paper': {
3140
- backgroundColor: "geowebColors.cards.cardContainer",
3141
- maxWidth: 458
3142
- }
3143
- },
3144
- onClose: function onClose() {
3145
- return closePopup && closePopup();
3146
- },
3147
3095
  actions: isShowPopup ? jsx(Button, {
3148
3096
  onClick: function onClick() {
3149
3097
  return closePopup();
3150
3098
  },
3151
- variant: "tertiary",
3152
3099
  sx: {
3153
3100
  width: {
3154
3101
  xs: '100%',
3155
3102
  sm: '117px'
3156
3103
  }
3157
3104
  },
3105
+ variant: "tertiary",
3158
3106
  children: t('close')
3159
3107
  }) : jsxs(Fragment, {
3160
3108
  children: [jsx(Button, {
3161
- onClick: closePopup,
3162
3109
  "data-testid": "closePopupButtonCancel",
3163
- variant: "tertiary",
3110
+ onClick: closePopup,
3164
3111
  sx: {
3165
3112
  width: {
3166
3113
  xs: '100%',
3167
3114
  sm: '117px'
3168
3115
  }
3169
3116
  },
3117
+ variant: "tertiary",
3170
3118
  children: t('cancel')
3171
3119
  }), jsx(Button, {
3172
- type: "submit",
3173
- variant: "primary",
3174
- form: "servicePopupForm",
3175
- disabled: isSubmitDisabled || isLoading,
3176
3120
  "data-testid": "saveServiceButton",
3121
+ disabled: isSubmitDisabled || isLoading,
3122
+ form: "servicePopupForm",
3177
3123
  sx: {
3178
3124
  marginLeft: {
3179
3125
  xs: '0px!important',
@@ -3184,21 +3130,51 @@ var ServicePopupUnwrapped = function ServicePopupUnwrapped(_ref2) {
3184
3130
  sm: '117px'
3185
3131
  }
3186
3132
  },
3133
+ type: "submit",
3134
+ variant: "primary",
3187
3135
  children: t('save')
3188
3136
  })]
3189
3137
  }),
3138
+ "data-testid": "servicePopup",
3139
+ fullWidth: true,
3140
+ hideBackdrop: hideBackdrop,
3141
+ maxWidth: "xs",
3142
+ onClose: function onClose() {
3143
+ return closePopup == null ? void 0 : closePopup();
3144
+ },
3145
+ open: isOpen,
3146
+ sx: {
3147
+ '& .MuiDialog-paper': {
3148
+ backgroundColor: "geowebColors.cards.cardContainer",
3149
+ maxWidth: 458
3150
+ }
3151
+ },
3152
+ title: getTitleForVariant(t, servicePopupVariant),
3190
3153
  children: jsxs("form", {
3191
3154
  id: "servicePopupForm",
3192
- onSubmit: handleSubmit(function (formValues) {
3193
- return addNewService(formValues);
3194
- }),
3195
- children: [isLoading && jsx(Box, {
3155
+ onSubmit: handleSubmit(/*#__PURE__*/function () {
3156
+ var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(formValues) {
3157
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
3158
+ while (1) switch (_context3.prev = _context3.next) {
3159
+ case 0:
3160
+ return _context3.abrupt("return", addNewService(formValues));
3161
+ case 1:
3162
+ case "end":
3163
+ return _context3.stop();
3164
+ }
3165
+ }, _callee3);
3166
+ }));
3167
+ return function (_x3) {
3168
+ return _ref5.apply(this, arguments);
3169
+ };
3170
+ }()),
3171
+ children: [!!isLoading && jsx(Box, {
3196
3172
  sx: {
3197
3173
  position: 'relative'
3198
3174
  },
3199
3175
  children: jsx(LinearProgress, {
3200
- "data-testid": "loadingIndicator",
3201
3176
  color: "secondary",
3177
+ "data-testid": "loadingIndicator",
3202
3178
  sx: {
3203
3179
  position: 'absolute',
3204
3180
  width: '100%',
@@ -3206,21 +3182,9 @@ var ServicePopupUnwrapped = function ServicePopupUnwrapped(_ref2) {
3206
3182
  }
3207
3183
  })
3208
3184
  }), jsx(ReactHookFormTextField, {
3209
- name: FormFields.serviceUrl,
3210
- label: t('service-url-label'),
3211
- onFocus: onFocusServiceUrl,
3212
3185
  autoFocus: !shouldDisableAutoFocus,
3213
- onBlur: onBlurServiceUrl,
3214
- onKeyDown: onKeyDownServiceUrl,
3215
- sx: style.textField,
3216
- rules: {
3217
- required: true,
3218
- validate: Object.assign({}, !isServiceUrlDisabled && {
3219
- onValidateServiceUrl: onValidateServiceUrl
3220
- })
3221
- },
3186
+ defaultValue: serviceUrl,
3222
3187
  disabled: isServiceUrlDisabled || isLoading,
3223
- isReadOnly: isShowPopup,
3224
3188
  inputSlotProps: {
3225
3189
  disableUnderline: isShowPopup,
3226
3190
  endAdornment: isShowPopup && jsx(InputAdornment, {
@@ -3238,46 +3202,58 @@ var ServicePopupUnwrapped = function ServicePopupUnwrapped(_ref2) {
3238
3202
  })
3239
3203
  })
3240
3204
  },
3241
- defaultValue: serviceUrl
3205
+ isReadOnly: isShowPopup,
3206
+ label: t('service-url-label'),
3207
+ name: FormFields.serviceUrl,
3208
+ onBlur: onBlurServiceUrl,
3209
+ onFocus: onFocusServiceUrl,
3210
+ onKeyDown: onKeyDownServiceUrl,
3211
+ rules: {
3212
+ required: true,
3213
+ validate: Object.assign({}, !isServiceUrlDisabled && {
3214
+ onValidateServiceUrl: onValidateServiceUrl
3215
+ })
3216
+ },
3217
+ sx: style.textField
3242
3218
  }), jsx(ReactHookFormTextField, {
3243
- name: FormFields.serviceName,
3219
+ defaultValue: serviceName,
3220
+ disabled: isShowPopup || isLoading,
3221
+ inputSlotProps: {
3222
+ disableUnderline: isShowPopup
3223
+ },
3224
+ isReadOnly: isShowPopup,
3244
3225
  label: t('service-name-label'),
3226
+ name: FormFields.serviceName,
3245
3227
  rules: {
3246
3228
  required: true,
3247
3229
  validate: {
3248
3230
  onValidateServiceName: onValidateServiceName
3249
3231
  }
3250
3232
  },
3233
+ sx: style.textField
3234
+ }), jsx(ReactHookFormTextField, {
3235
+ defaultValue: "",
3251
3236
  disabled: isShowPopup || isLoading,
3252
- isReadOnly: isShowPopup,
3237
+ helperText: !isShowPopup ? t('service-popup-helper-text') : '',
3253
3238
  inputSlotProps: {
3254
3239
  disableUnderline: isShowPopup
3255
3240
  },
3256
- sx: style.textField,
3257
- defaultValue: serviceName
3258
- }), jsx(ReactHookFormTextField, {
3241
+ isReadOnly: isShowPopup,
3242
+ label: t('service-abstracts-label'),
3259
3243
  multiline: true,
3260
- rows: 4,
3261
3244
  name: FormFields.serviceAbstracts,
3262
- label: t('service-abstracts-label'),
3263
- disabled: isShowPopup || isLoading,
3264
- isReadOnly: isShowPopup,
3265
- inputSlotProps: {
3266
- disableUnderline: isShowPopup
3267
- },
3268
- helperText: !isShowPopup ? t('service-popup-helper-text') : '',
3269
- sx: style.textField,
3270
- defaultValue: ""
3245
+ rows: 4,
3246
+ sx: style.textField
3271
3247
  }), !isServiceUrlDisabled && jsx(InitialValidationsTrigger, {
3272
- trigger: trigger,
3273
3248
  getValues: getValues,
3274
- onValidField: fetchServiceData
3249
+ onValidField: fetchServiceData,
3250
+ trigger: trigger
3275
3251
  })]
3276
3252
  })
3277
3253
  });
3278
3254
  };
3279
- var ServicePopup = function ServicePopup(_ref5) {
3280
- var props = Object.assign({}, (_objectDestructuringEmpty(_ref5), _ref5));
3255
+ var ServicePopup = function ServicePopup(_ref6) {
3256
+ var props = Object.assign({}, (_objectDestructuringEmpty(_ref6), _ref6));
3281
3257
  return jsx(ReactHookFormProvider, {
3282
3258
  options: Object.assign({}, defaultFormOptions, {
3283
3259
  defaultValues: {
@@ -3308,25 +3284,25 @@ var ServicePopupDialogConnect = function ServicePopupDialogConnect(_ref) {
3308
3284
  var activeService = useAppSelector(function (store) {
3309
3285
  return getActiveServiceById(store, serviceId);
3310
3286
  });
3311
- var serviceSetLayers = React__default.useCallback(function (payload) {
3287
+ var serviceSetLayers = React.useCallback(function (payload) {
3312
3288
  dispatch(serviceActions.serviceSetLayers(payload));
3313
3289
  }, [dispatch]);
3314
- var showSnackbar = React__default.useCallback(function (message) {
3290
+ var showSnackbar = React.useCallback(function (message) {
3315
3291
  dispatch(snackbarActions.openSnackbar({
3316
3292
  type: snackbarTypes.SnackbarMessageType.VERBATIM_MESSAGE,
3317
3293
  message: message
3318
3294
  }));
3319
3295
  }, [dispatch]);
3320
3296
  return jsx(ServicePopup, {
3321
- servicePopupVariant: variant,
3322
- isOpen: isOpen,
3323
3297
  closePopup: setServicePopupClosed,
3324
- services: services,
3325
- serviceSetLayers: serviceSetLayers,
3298
+ isOpen: isOpen,
3299
+ serviceAbstracts: activeService == null ? void 0 : activeService["abstract"],
3326
3300
  serviceId: serviceId,
3327
- serviceUrl: url || (activeService == null ? void 0 : activeService.serviceUrl),
3328
3301
  serviceName: activeService == null ? void 0 : activeService.serviceName,
3329
- serviceAbstracts: activeService == null ? void 0 : activeService["abstract"],
3302
+ servicePopupVariant: variant,
3303
+ serviceSetLayers: serviceSetLayers,
3304
+ serviceUrl: url || (activeService == null ? void 0 : activeService.serviceUrl),
3305
+ services: services,
3330
3306
  showSnackbar: showSnackbar
3331
3307
  });
3332
3308
  };
@@ -3340,7 +3316,7 @@ var ServicePopupConnect = function ServicePopupConnect() {
3340
3316
  url = _useAppSelector.url,
3341
3317
  serviceId = _useAppSelector.serviceId,
3342
3318
  variant = _useAppSelector.variant;
3343
- var setServicePopupClosed = React__default.useCallback(function () {
3319
+ var setServicePopupClosed = React.useCallback(function () {
3344
3320
  dispatch(layerSelectActions.closeServicePopupOpen());
3345
3321
  }, [dispatch]);
3346
3322
  if (!isOpen) {
@@ -3349,9 +3325,9 @@ var ServicePopupConnect = function ServicePopupConnect() {
3349
3325
  return jsx(ServicePopupDialogConnect, {
3350
3326
  isOpen: isOpen,
3351
3327
  serviceId: serviceId,
3352
- variant: variant,
3328
+ setServicePopupClosed: setServicePopupClosed,
3353
3329
  url: url,
3354
- setServicePopupClosed: setServicePopupClosed
3330
+ variant: variant
3355
3331
  });
3356
3332
  };
3357
3333
 
@@ -3384,21 +3360,21 @@ var LayerSelectConnect = function LayerSelectConnect(_ref) {
3384
3360
  var hasDataExplorer = !!config.GW_DATA_EXPLORER_CONFIGURATION_FILENAME;
3385
3361
  return jsxs(Fragment, {
3386
3362
  children: [jsx(LayerSelect, {
3387
- mapId: mapId || initialMapId,
3388
3363
  bounds: bounds,
3364
+ hasDataExplorer: hasDataExplorer,
3365
+ isMultiMap: isMultiMap,
3389
3366
  isOpen: isDialogOpen,
3367
+ mapId: mapId || initialMapId,
3390
3368
  onClose: onCloseDialog,
3391
- showTitle: showTitle,
3392
3369
  onMouseDown: setDialogOrder,
3393
3370
  order: dialogOrder,
3394
- source: uiSource,
3395
- isMultiMap: isMultiMap,
3396
- hasDataExplorer: hasDataExplorer
3371
+ showTitle: showTitle,
3372
+ source: uiSource
3397
3373
  }), jsx(KeywordFilterResultsConnect, {
3398
- mapId: mapId || initialMapId,
3399
- isMultiMap: isMultiMap
3374
+ isMultiMap: isMultiMap,
3375
+ mapId: mapId || initialMapId
3400
3376
  }), jsx(ServicePopupConnect, {})]
3401
3377
  });
3402
3378
  };
3403
3379
 
3404
- export { AllChipConnect, DataExplorerButtonConnect, KeywordFilterButtonConnect, KeywordFilterResults, KeywordFilterResultsConnect, KeywordFilterResultsListItemConnect, KeywordFilterSelectAllSwitchConnect, LAYER_SELECT_NAMESPACE, LayerAddRemoveButton, LayerList, LayerListConnect, LayerListDimensions, LayerListRow, LayerSelectButtonConnect, LayerSelectConnect, SearchFieldConnect, ServiceChip, ServiceChipConnect, ServiceList, ServiceListConnect, ServiceOptionsButton, ServiceOptionsDialog, ServiceOptionsDialogConnect, ServicePopup, ServicePopupConnect, ServicePopupDialogConnect, createMockStore, getServiceSuccesUpdateMessage, getSuccesMessage, isUserAddedService, layerSelectActions, initialState as layerSelectInitialState, layerSelectListener, layerSelectMiddlewares, layerSelectReducer, layerSelectReducersMap, selectors as layerSelectSelectors, layerSelectTranslations, types as layerSelectTypes, useAppSelector };
3380
+ export { AllChipConnect, DataExplorerButtonConnect, KeywordFilterButtonConnect, KeywordFilterResults, KeywordFilterResultsConnect, KeywordFilterResultsListItemConnect, KeywordFilterSelectAllSwitchConnect, LAYER_SELECT_NAMESPACE, LayerAddRemoveButton, LayerList, LayerListConnect, LayerListDimensions, LayerListRow, LayerSelectButtonConnect, LayerSelectConnect, SearchFieldConnect, ServiceChip, ServiceChipConnect, ServiceList, ServiceListConnect, ServiceOptionsButton, ServiceOptionsDialog, ServiceOptionsDialogConnect, ServicePopup, ServicePopupConnect, ServicePopupDialogConnect, createMockStore, getServiceSuccesUpdateMessage, getSuccesMessage, isUserAddedService, layerSelectActions, initialState as layerSelectInitialState, layerSelectListener, layerSelectMiddlewares, layerSelectReducer, layerSelectReducersMap, selectors as layerSelectSelectors, layerSelectTranslations, useAppSelector };