@opengeoweb/core 2.5.0 → 2.6.0

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 (34) hide show
  1. package/index.esm.js +424 -545
  2. package/index.umd.js +470 -594
  3. package/lib/components/LayerManager/LayerManager.d.ts +2 -1
  4. package/lib/components/LayerManager/LayerManagerConnect.d.ts +1 -0
  5. package/lib/components/LayerManager/LayerSelect/LayerList/LayerListRow.d.ts +18 -0
  6. package/lib/components/LayerManager/LayerSelect/LayerList/LayerListUtils.d.ts +2 -1
  7. package/lib/components/LayerManager/LayerSelect/LayerSelectUtils.d.ts +4 -0
  8. package/lib/components/{TimeSlider/TimeSliderButtons/LoopButton/LoopButton.spec.d.ts → LayerManager/LayerSelect/LayerSelectUtils.spec.d.ts} +0 -0
  9. package/lib/components/LayerManager/LayerSelect/ServiceList/ServiceChip.d.ts +2 -2
  10. package/lib/components/LayerManager/LayerSelect/ServiceList/ServiceChipConnect.d.ts +2 -2
  11. package/lib/components/LayerManager/LayerSelect/ServiceList/ServiceList.d.ts +2 -2
  12. package/lib/components/MapWarning/MapWarningProperties.d.ts +6 -0
  13. package/lib/components/{TimeSlider/TimeSliderButtons/LoopButton/LoopButtonConnect.spec.d.ts → MapWarning/MapWarningProperties.spec.d.ts} +0 -0
  14. package/lib/components/TimeSlider/TimeSliderButtons/OptionsMenuButton/OptionsMenuButton.d.ts +0 -1
  15. package/lib/components/TimeSlider/TimeSliderButtons/TimeSliderButtons.d.ts +0 -1
  16. package/lib/index.d.ts +2 -2
  17. package/lib/store/layerSelect/sagas.d.ts +2 -1
  18. package/lib/store/mapStore/map/actions.d.ts +1 -8
  19. package/lib/store/mapStore/map/selectors.d.ts +0 -21
  20. package/lib/store/mapStore/service/reducer.d.ts +2 -8
  21. package/lib/store/mapStore/service/selectors.d.ts +6 -8
  22. package/lib/store/mapStore/service/types.d.ts +5 -8
  23. package/lib/store/mapStore/utils/helpers.d.ts +2 -0
  24. package/lib/utils/defaultConfigurations.d.ts +2 -2
  25. package/lib/utils/defaultTestSettings.d.ts +10 -199
  26. package/lib/utils/jsonPresetFilter.d.ts +2 -1
  27. package/lib/utils/localStorage.d.ts +3 -3
  28. package/lib/{components/TooltipSelect/TooltipSelect.spec.d.ts → utils/localStorage.spec.d.ts} +0 -0
  29. package/lib/utils/types.d.ts +4 -5
  30. package/package.json +8 -8
  31. package/lib/components/LayerManager/tooltipContainerStyles.d.ts +0 -2
  32. package/lib/components/TimeSlider/TimeSliderButtons/LoopButton/LoopButton.d.ts +0 -8
  33. package/lib/components/TimeSlider/TimeSliderButtons/LoopButton/LoopButtonConnect.d.ts +0 -10
  34. package/lib/components/TooltipSelect/TooltipSelect.d.ts +0 -14
package/index.umd.js CHANGED
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('reselect'), require('moment'), require('lodash'), require('react'), require('immer'), require('redux-saga/effects'), require('@opengeoweb/webmap'), require('@mui/material'), require('react-redux'), require('@mui/styles/makeStyles'), require('@opengeoweb/shared'), require('@mui/icons-material'), require('react-sortablejs'), require('@mui/styles/createStyles'), require('@mui/styles/withStyles'), require('throttle-debounce'), require('lodash.clonedeep'), require('proj4'), require('@turf/turf'), require('redux-dynamic-modules'), require('redux-dynamic-modules-saga'), require('@opengeoweb/theme')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'reselect', 'moment', 'lodash', 'react', 'immer', 'redux-saga/effects', '@opengeoweb/webmap', '@mui/material', 'react-redux', '@mui/styles/makeStyles', '@opengeoweb/shared', '@mui/icons-material', 'react-sortablejs', '@mui/styles/createStyles', '@mui/styles/withStyles', 'throttle-debounce', 'lodash.clonedeep', 'proj4', '@turf/turf', 'redux-dynamic-modules', 'redux-dynamic-modules-saga', '@opengeoweb/theme'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Core = {}, global.reselect, global.moment, global._, global.React, global.produce, global.effects, global.webmap, global.material, global.reactRedux, global.makeStyles, global.shared, global.iconsMaterial, global.reactSortablejs, global.createStyles, global.withStyles, global.throttleDebounce, global.cloneDeep, global.proj4, global.turf, global.reduxDynamicModules, global.reduxDynamicModulesSaga, global.theme));
5
- })(this, (function (exports, reselect, moment, _, React, produce, effects, webmap, material, reactRedux, makeStyles, shared, iconsMaterial, reactSortablejs, createStyles, withStyles, throttleDebounce, cloneDeep, proj4, turf, reduxDynamicModules, reduxDynamicModulesSaga, theme) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('reselect'), require('moment'), require('lodash'), require('react'), require('immer'), require('redux-saga/effects'), require('@opengeoweb/webmap'), require('react-redux'), require('@mui/material'), require('@opengeoweb/shared'), require('@mui/styles/makeStyles'), require('@mui/icons-material'), require('react-sortablejs'), require('@mui/styles/createStyles'), require('@mui/styles/withStyles'), require('throttle-debounce'), require('lodash.clonedeep'), require('proj4'), require('@turf/turf'), require('redux-dynamic-modules'), require('redux-dynamic-modules-saga'), require('@opengeoweb/theme')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'reselect', 'moment', 'lodash', 'react', 'immer', 'redux-saga/effects', '@opengeoweb/webmap', 'react-redux', '@mui/material', '@opengeoweb/shared', '@mui/styles/makeStyles', '@mui/icons-material', 'react-sortablejs', '@mui/styles/createStyles', '@mui/styles/withStyles', 'throttle-debounce', 'lodash.clonedeep', 'proj4', '@turf/turf', 'redux-dynamic-modules', 'redux-dynamic-modules-saga', '@opengeoweb/theme'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Core = {}, global.reselect, global.moment, global._, global.React, global.produce, global.effects, global.webmap, global.reactRedux, global.material, global.shared, global.makeStyles, global.iconsMaterial, global.reactSortablejs, global.createStyles, global.withStyles, global.throttleDebounce, global.cloneDeep, global.proj4, global.turf, global.reduxDynamicModules, global.reduxDynamicModulesSaga, global.theme));
5
+ })(this, (function (exports, reselect, moment, _, React, produce, effects, webmap, reactRedux, material, shared, makeStyles, iconsMaterial, reactSortablejs, createStyles, withStyles, throttleDebounce, cloneDeep, proj4, turf, reduxDynamicModules, reduxDynamicModulesSaga, theme) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -227,19 +227,6 @@
227
227
  payload: payload
228
228
  };
229
229
  };
230
- /**
231
- * Toggles loop state for map
232
- *
233
- * Example: toggleLoop({ mapId: 'mapId1', shouldLoop: true })
234
- * @param {object} payload object with mapId: string, shouldLoop: boolean
235
- */
236
-
237
- var toggleLoop = function toggleLoop(payload) {
238
- return {
239
- type: WEBMAP_TOGGLE_LOOP,
240
- payload: payload
241
- };
242
- };
243
230
  /**
244
231
  *Sets the scale of a time slider with id for a map
245
232
  *
@@ -760,7 +747,6 @@
760
747
  layerMoveLayer: layerMoveLayer,
761
748
  setActiveLayerId: setActiveLayerId,
762
749
  toggleAutoUpdate: toggleAutoUpdate,
763
- toggleLoop: toggleLoop,
764
750
  setTimeSliderScale: setTimeSliderScale,
765
751
  setTimeStep: setTimeStep,
766
752
  setAnimationDelay: setAnimationDelay,
@@ -878,6 +864,16 @@
878
864
  generatedTimesliderIds += 1;
879
865
  return "timesliderid_" + generatedTimesliderIds;
880
866
  };
867
+ var generatedServiceIds = 0;
868
+ var generateServiceId = function generateServiceId() {
869
+ generatedServiceIds += 1;
870
+ return "serviceid_" + generatedServiceIds;
871
+ };
872
+ var generatedTimeseriesIds = 0;
873
+ var generateTimeSeriesId = function generateTimeSeriesId() {
874
+ generatedTimeseriesIds += 1;
875
+ return "timeseriesid_" + generatedTimeseriesIds;
876
+ };
881
877
  /**
882
878
  * Map for registering wmlayers with their id's
883
879
  */
@@ -2410,18 +2406,6 @@
2410
2406
  var isAutoUpdating = reselect.createSelector(getMapById, function (store) {
2411
2407
  return store ? store.isAutoUpdating : false;
2412
2408
  });
2413
- /**
2414
- * Tells whether the "loop" behavior of animation is on/off
2415
- *
2416
- * Example: isLooping = isLooping(store, 'mapid_1')
2417
- * @param {object} store store: object - store object
2418
- * @param {string} mapId mapId: string - Id of the map
2419
- * @returns {boolean} returnType: boolean
2420
- */
2421
-
2422
- var isLooping = reselect.createSelector(getMapById, function (store) {
2423
- return store ? store.isLooping : false;
2424
- });
2425
2409
  /**
2426
2410
  * Gets activeLayerId for map
2427
2411
  *
@@ -2713,14 +2697,21 @@
2713
2697
  *
2714
2698
  * Example: service = getServiceByName(store, 'serviceName')
2715
2699
  * @param {object} store store: object - Store object
2716
- * @returns {Service} returnType: Service
2700
+ * @returns {ReduxService} returnType: Service
2717
2701
  */
2718
2702
 
2719
- var getServiceByName = reselect.createSelector([servicesStore, function (state, serviceName) {
2720
- return serviceName;
2721
- }], function (serviceState, serviceName) {
2722
- if (serviceState && serviceState.byId && serviceState.byId[serviceName]) {
2723
- return serviceState.byId[serviceName];
2703
+ var getServiceByName = reselect.createSelector([servicesStore, function (state, serviceUrl) {
2704
+ return serviceUrl;
2705
+ }], function (serviceState, serviceUrl) {
2706
+ var foundServiceIndex = serviceState.allIds.findIndex(function (id) {
2707
+ return serviceState.byId[id].serviceUrl === serviceUrl;
2708
+ });
2709
+ /* Add the service based on a url */
2710
+
2711
+ var id = foundServiceIndex !== -1 ? serviceState.allIds[foundServiceIndex] : null;
2712
+
2713
+ if (serviceState && serviceState.byId && serviceState.byId[id]) {
2714
+ return serviceState.byId[id];
2724
2715
  }
2725
2716
 
2726
2717
  return null;
@@ -2790,9 +2781,8 @@
2790
2781
  var services = store ? store.byId : {};
2791
2782
  var arrayOfServiceObjects = Object.keys(services).map(function (key) {
2792
2783
  return {
2793
- id: services[key].id,
2794
2784
  name: services[key].name,
2795
- service: services[key].service
2785
+ serviceUrl: services[key].serviceUrl
2796
2786
  };
2797
2787
  });
2798
2788
  return arrayOfServiceObjects;
@@ -2837,7 +2827,6 @@
2837
2827
  getAnimationStartTime: getAnimationStartTime,
2838
2828
  getAnimationEndTime: getAnimationEndTime,
2839
2829
  isAutoUpdating: isAutoUpdating,
2840
- isLooping: isLooping,
2841
2830
  getActiveLayerId: getActiveLayerId,
2842
2831
  getMapTimeSliderScale: getMapTimeSliderScale,
2843
2832
  getMapTimeStep: getMapTimeStep,
@@ -4731,9 +4720,8 @@
4731
4720
  var updateObject = {
4732
4721
  origin: ORIGIN_REACTMAPVIEWPARSELAYER,
4733
4722
  serviceLayers: {
4734
- id: wmLayer.service,
4735
4723
  name: wmLayer.title,
4736
- service: wmLayer.service,
4724
+ serviceUrl: wmLayer.service,
4737
4725
  layers: layers,
4738
4726
  isUserAddedService: false
4739
4727
  },
@@ -5564,155 +5552,6 @@
5564
5552
  sagas: [rootSaga$4, rootSaga$3]
5565
5553
  };
5566
5554
 
5567
- /* *
5568
- * Licensed under the Apache License, Version 2.0 (the "License");
5569
- * you may not use this file except in compliance with the License.
5570
- * You may obtain a copy of the License at
5571
- *
5572
- * http://www.apache.org/licenses/LICENSE-2.0
5573
- *
5574
- * Unless required by applicable law or agreed to in writing, software
5575
- * distributed under the License is distributed on an "AS IS" BASIS,
5576
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5577
- * See the License for the specific language governing permissions and
5578
- * limitations under the License.
5579
- *
5580
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
5581
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
5582
- * */
5583
-
5584
- var TooltipSelect = function TooltipSelect(_a) {
5585
- var tooltip = _a.tooltip,
5586
- _b = _a.list,
5587
- list = _b === void 0 ? [] : _b,
5588
- _c = _a.currentIndex,
5589
- currentIndex = _c === void 0 ? -1 : _c,
5590
- _d = _a.onChangeMouseWheel,
5591
- onChangeMouseWheel = _d === void 0 ? function () {} : _d,
5592
- _e = _a.requiresCtrlToChange,
5593
- requiresCtrlToChange = _e === void 0 ? false : _e,
5594
- props = __rest(_a, ["tooltip", "list", "currentIndex", "onChangeMouseWheel", "requiresCtrlToChange"]);
5595
-
5596
- props.disableUnderline;
5597
- var otherProps = __rest(props, ["disableUnderline"]);
5598
-
5599
- var _f = __read(React__namespace.useState(false), 2),
5600
- selectOpen = _f[0],
5601
- setSelectOpen = _f[1];
5602
-
5603
- var _g = __read(React__namespace.useState(false), 2),
5604
- tooltipOpen = _g[0],
5605
- setTooltipOpen = _g[1];
5606
-
5607
- var preventDefault = function preventDefault(event) {
5608
- event.preventDefault();
5609
- event.stopPropagation();
5610
- };
5611
-
5612
- var enableScroll = React__namespace.useCallback(function () {
5613
- document.removeEventListener('wheel', preventDefault, false);
5614
- }, []);
5615
- var disableScroll = React__namespace.useCallback(function () {
5616
- document.addEventListener('wheel', preventDefault, {
5617
- passive: false
5618
- });
5619
- }, []);
5620
- var onWheel = React__namespace.useCallback(function (event) {
5621
- if (requiresCtrlToChange && (event.ctrlKey || event.metaKey) || !requiresCtrlToChange) {
5622
- disableScroll();
5623
- if (selectOpen) return;
5624
- var direction = event.deltaY < 0 ? 1 : -1;
5625
- var newValue = list[Math.min(Math.max(currentIndex - direction, 0), list.length - 1)];
5626
- onChangeMouseWheel(newValue);
5627
- } else enableScroll();
5628
- }, [selectOpen, currentIndex, list, onChangeMouseWheel, enableScroll, disableScroll, requiresCtrlToChange]);
5629
- var onOpen = React__namespace.useCallback(function () {
5630
- setSelectOpen(true);
5631
- setTooltipOpen(false);
5632
- }, []);
5633
- var onClose = React__namespace.useCallback(function () {
5634
- setSelectOpen(false);
5635
- }, []);
5636
- var onMouseEnter = React__namespace.useCallback(function () {
5637
- if (!requiresCtrlToChange) {
5638
- disableScroll();
5639
- }
5640
-
5641
- if (!selectOpen) setTooltipOpen(true);
5642
- }, [selectOpen, disableScroll, requiresCtrlToChange]);
5643
- var onMouseLeave = React__namespace.useCallback(function () {
5644
- enableScroll();
5645
- setTooltipOpen(false);
5646
- }, [enableScroll]);
5647
- var onFocus = React__namespace.useCallback(function () {
5648
- if (!requiresCtrlToChange) {
5649
- disableScroll();
5650
- }
5651
-
5652
- setTooltipOpen(true);
5653
- }, [disableScroll, requiresCtrlToChange]);
5654
- var onBlur = React__namespace.useCallback(function () {
5655
- enableScroll();
5656
- setTooltipOpen(false);
5657
- }, [enableScroll]);
5658
- return /*#__PURE__*/React__namespace.createElement(material.Tooltip, {
5659
- title: tooltip,
5660
- placement: "top",
5661
- open: tooltipOpen
5662
- }, /*#__PURE__*/React__namespace.createElement(material.Select, __assign({
5663
- onOpen: onOpen,
5664
- onClose: onClose,
5665
- onMouseEnter: onMouseEnter,
5666
- onMouseLeave: onMouseLeave,
5667
- onFocus: onFocus,
5668
- onBlur: onBlur,
5669
- onWheel: onWheel,
5670
- MenuProps: {
5671
- BackdropProps: {
5672
- sx: {
5673
- '&.MuiBackdrop-root': {
5674
- backgroundColor: 'transparent'
5675
- }
5676
- }
5677
- },
5678
- sx: {
5679
- '& ul': {
5680
- backgroundColor: 'geowebColors.background.surface'
5681
- },
5682
- '& li': {
5683
- fontSize: '16px',
5684
- padding: '12px',
5685
- '&:hover': {
5686
- backgroundColor: 'geowebColors.buttons.tool.mouseOver.fill'
5687
- },
5688
- '&.Mui-selected': {
5689
- color: 'geowebColors.buttons.tool.active.color',
5690
- backgroundColor: 'geowebColors.buttons.tool.active.fill',
5691
- boxShadow: "none",
5692
- '&:hover': {
5693
- backgroundColor: 'geowebColors.buttons.tool.activeMouseOver.fill'
5694
- },
5695
- '&:focus': {
5696
- backgroundColor: 'geowebColors.buttons.tool.activeMouseOver.fill'
5697
- }
5698
- },
5699
- '&:after': {
5700
- background: 'none!important'
5701
- },
5702
- '&.Mui-disabled': {
5703
- fontSize: '12px',
5704
- opacity: 0.67,
5705
- padding: '0px 12px',
5706
- '&.MuiMenuItem-root': {
5707
- minHeight: '30px!important'
5708
- }
5709
- }
5710
- }
5711
- }
5712
- }
5713
- }, otherProps)));
5714
- };
5715
-
5716
5555
  /* *
5717
5556
  * Licensed under the Apache License, Version 2.0 (the "License");
5718
5557
  * you may not use this file except in compliance with the License.
@@ -6803,12 +6642,14 @@
6803
6642
  switch (action.type) {
6804
6643
  case MAP_SERVICES_SET_LAYERS:
6805
6644
  return produce__default["default"](state, function (draft) {
6806
- if (!draft.byId[action.payload.service]) draft.byId[action.payload.service] = {};
6807
- draft.byId[action.payload.service].id = action.payload.id;
6808
- draft.byId[action.payload.service].name = action.payload.name;
6809
- draft.byId[action.payload.service].service = action.payload.service;
6810
- draft.byId[action.payload.service].layers = action.payload.layers;
6811
- if (!draft.allIds.includes(action.payload.service)) draft.allIds.push(action.payload.service);
6645
+ var foundServiceIndex = draft.allIds.findIndex(function (id) {
6646
+ return draft.byId[id].serviceUrl === action.payload.serviceUrl;
6647
+ });
6648
+ /* Add the service based on a url */
6649
+
6650
+ var id = foundServiceIndex !== -1 ? draft.allIds[foundServiceIndex] : generateServiceId();
6651
+ draft.byId[id] = __assign({}, action.payload);
6652
+ if (!draft.allIds.includes(id)) draft.allIds.push(id);
6812
6653
  });
6813
6654
 
6814
6655
  case WEBMAP_UPDATE_LAYER_INFO:
@@ -6824,11 +6665,16 @@
6824
6665
 
6825
6666
  case MAP_SERVICES_REMOVE_SERVICE:
6826
6667
  return produce__default["default"](state, function (draft) {
6827
- if (draft.byId[action.payload.serviceUrl]) {
6668
+ var foundServiceIndex = draft.allIds.findIndex(function (id) {
6669
+ return draft.byId[id].serviceUrl === action.payload.serviceUrl;
6670
+ });
6671
+
6672
+ if (foundServiceIndex !== -1) {
6673
+ var serviceId_1 = draft.allIds[foundServiceIndex];
6828
6674
  draft.allIds = draft.allIds.filter(function (id) {
6829
- return id !== action.payload.serviceUrl;
6675
+ return id !== serviceId_1;
6830
6676
  });
6831
- delete draft.byId[action.payload.serviceUrl];
6677
+ delete draft.byId[serviceId_1];
6832
6678
  }
6833
6679
  });
6834
6680
 
@@ -7676,6 +7522,22 @@
7676
7522
  };
7677
7523
  };
7678
7524
 
7525
+ function _typeof(obj) {
7526
+ "@babel/helpers - typeof";
7527
+
7528
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
7529
+ _typeof = function (obj) {
7530
+ return typeof obj;
7531
+ };
7532
+ } else {
7533
+ _typeof = function (obj) {
7534
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
7535
+ };
7536
+ }
7537
+
7538
+ return _typeof(obj);
7539
+ }
7540
+
7679
7541
  /* *
7680
7542
  * Licensed under the Apache License, Version 2.0 (the "License");
7681
7543
  * you may not use this file except in compliance with the License.
@@ -7692,9 +7554,34 @@
7692
7554
  * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
7693
7555
  * Copyright 2022 - Finnish Meteorological Institute (FMI)
7694
7556
  * */
7557
+ var mergePresetsAndUserAddedServices = function mergePresetsAndUserAddedServices(presets, userAddedServices) {
7558
+ return Object.values(__assign(__assign({}, presets.reduce(function (byId, preset) {
7559
+ var _a;
7560
+
7561
+ return __assign(__assign({}, byId), (_a = {}, _a[preset.id] = preset, _a));
7562
+ }, {})), userAddedServices));
7563
+ };
7564
+ var isService = function isService(param) {
7565
+ var serviceParam = param;
7566
+ return !!((serviceParam === null || serviceParam === void 0 ? void 0 : serviceParam.id) && (serviceParam === null || serviceParam === void 0 ? void 0 : serviceParam.name) && (serviceParam === null || serviceParam === void 0 ? void 0 : serviceParam.url));
7567
+ };
7568
+
7695
7569
  var getUserAddedServices = function getUserAddedServices() {
7696
7570
  try {
7697
- return JSON.parse(window.localStorage.getItem('userAddedServices')) || {};
7571
+ var storedString = window.localStorage.getItem('userAddedServices');
7572
+ var parsedData = JSON.parse(storedString);
7573
+
7574
+ if (parsedData && _typeof(parsedData) === 'object') {
7575
+ return Object.entries(parsedData).reduce(function (userServices, _a) {
7576
+ var _b;
7577
+
7578
+ var _c = __read(_a, 2),
7579
+ serviceUrl = _c[0],
7580
+ service = _c[1];
7581
+
7582
+ return __assign(__assign({}, userServices), isService(service) ? (_b = {}, _b[serviceUrl] = service, _b) : {});
7583
+ }, {});
7584
+ }
7698
7585
  } catch (e) {
7699
7586
  console.error('Unable to read services from localStorage: ', e);
7700
7587
  }
@@ -7726,19 +7613,19 @@
7726
7613
  * Copyright 2022 - Finnish Meteorological Institute (FMI)
7727
7614
  * */
7728
7615
  function newServiceAddedSaga(capturedAction) {
7729
- var addedService, service, keywords;
7616
+ var addedService, serviceUrl, keywords;
7730
7617
  return __generator(this, function (_a) {
7731
7618
  switch (_a.label) {
7732
7619
  case 0:
7733
7620
  addedService = capturedAction.payload;
7734
- service = addedService.service;
7621
+ serviceUrl = addedService.serviceUrl;
7735
7622
  keywords = addedService.layers.reduce(function (keywordAccumulator, layer) {
7736
7623
  return keywordAccumulator.concat(layer.path, layer.keywords);
7737
7624
  }, []);
7738
7625
  return [4
7739
7626
  /*yield*/
7740
7627
  , effects.put(addKeywordsAndActiveServices({
7741
- serviceUrl: service,
7628
+ serviceUrl: serviceUrl,
7742
7629
  keywords: keywords
7743
7630
  }))];
7744
7631
 
@@ -7777,20 +7664,27 @@
7777
7664
  var _b;
7778
7665
 
7779
7666
  var payload = _a.payload;
7780
- var id = payload.id,
7781
- isUserAddedService = payload.isUserAddedService,
7667
+ var isUserAddedService = payload.isUserAddedService,
7782
7668
  name = payload.name,
7783
- service = payload.service;
7669
+ serviceUrl = payload.serviceUrl;
7784
7670
  if (!isUserAddedService) return;
7785
7671
  var localStorageServices = getUserAddedServices();
7786
- setUserAddedServices({
7787
- byId: __assign(__assign({}, localStorageServices.byId), (_b = {}, _b[service] = {
7788
- id: id,
7789
- name: name,
7790
- service: service
7791
- }, _b)),
7792
- allIds: __spreadArray([], __read(new Set(__spreadArray(__spreadArray([], __read(localStorageServices.allIds || [])), [service]))))
7793
- });
7672
+ setUserAddedServices(__assign(__assign({}, localStorageServices), (_b = {}, _b[serviceUrl] = {
7673
+ id: serviceUrl,
7674
+ name: name,
7675
+ url: serviceUrl
7676
+ }, _b)));
7677
+ }
7678
+ function removeServiceFromLocalStorageSaga(_a) {
7679
+ var payload = _a.payload;
7680
+ var serviceUrl = payload.serviceUrl;
7681
+ var localStorageServices = getUserAddedServices();
7682
+ if (!localStorageServices[serviceUrl]) return;
7683
+
7684
+ var updatedServices = __assign({}, localStorageServices);
7685
+
7686
+ delete updatedServices[serviceUrl];
7687
+ setUserAddedServices(updatedServices);
7794
7688
  }
7795
7689
  function rootSaga() {
7796
7690
  return __generator(this, function (_a) {
@@ -7817,6 +7711,13 @@
7817
7711
  case 3:
7818
7712
  _a.sent();
7819
7713
 
7714
+ return [4
7715
+ /*yield*/
7716
+ , effects.takeEvery(MAP_SERVICES_REMOVE_SERVICE, removeServiceFromLocalStorageSaga)];
7717
+
7718
+ case 4:
7719
+ _a.sent();
7720
+
7820
7721
  return [2
7821
7722
  /*return*/
7822
7723
  ];
@@ -8175,7 +8076,7 @@
8175
8076
  * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
8176
8077
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
8177
8078
  * */
8178
- var connectRedux$7 = reactRedux.connect(function (store, props) {
8079
+ var connectRedux$6 = reactRedux.connect(function (store, props) {
8179
8080
  return {
8180
8081
  loadedLayers: getMapLayers(store, props.mapId)
8181
8082
  };
@@ -8238,7 +8139,7 @@
8238
8139
  });
8239
8140
  };
8240
8141
 
8241
- var WMSLayerTreeConnect = connectRedux$7(ConnectedTree);
8142
+ var WMSLayerTreeConnect = connectRedux$6(ConnectedTree);
8242
8143
 
8243
8144
  /* *
8244
8145
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -8613,7 +8514,7 @@
8613
8514
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
8614
8515
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
8615
8516
  * */
8616
- var useStyles$w = makeStyles__default["default"]({
8517
+ var useStyles$u = makeStyles__default["default"]({
8617
8518
  buttonDiv: {
8618
8519
  position: 'relative'
8619
8520
  },
@@ -8649,7 +8550,7 @@
8649
8550
  handleClose = _a.handleClose,
8650
8551
  _e = _a.layerType,
8651
8552
  layerType = _e === void 0 ? LayerType.mapLayer : _e;
8652
- var classes = useStyles$w();
8553
+ var classes = useStyles$u();
8653
8554
 
8654
8555
  var _f = __read(React__namespace.useState(''), 2),
8655
8556
  serviceURL = _f[0],
@@ -8813,7 +8714,7 @@
8813
8714
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
8814
8715
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
8815
8716
  * */
8816
- var styles$1 = {
8717
+ var styles$2 = {
8817
8718
  buttonDiv: {
8818
8719
  position: 'relative'
8819
8720
  },
@@ -8864,7 +8765,7 @@
8864
8765
  title: tooltip
8865
8766
  }, /*#__PURE__*/React__namespace.createElement(material.IconButton, {
8866
8767
  onClick: handleClose,
8867
- sx: styles$1.button,
8768
+ sx: styles$2.button,
8868
8769
  disableRipple: true,
8869
8770
  "data-testid": "addLayersButton",
8870
8771
  ref: ref,
@@ -9029,7 +8930,7 @@
9029
8930
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9030
8931
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
9031
8932
  * */
9032
- var useStyles$v = makeStyles__default["default"]({
8933
+ var useStyles$t = makeStyles__default["default"]({
9033
8934
  row: {
9034
8935
  height: '32px'
9035
8936
  },
@@ -9053,7 +8954,7 @@
9053
8954
  layerManagerWidth = _a.layerManagerWidth,
9054
8955
  _e = _a.layerSelect,
9055
8956
  layerSelect = _e === void 0 ? false : _e;
9056
- var classes = useStyles$v();
8957
+ var classes = useStyles$t();
9057
8958
  var columnSizes = layerManagerWidth === LayerManagerWidth.sm ? LayerManagerColumnsSmall() : LayerManagerColumnsLarge();
9058
8959
  return /*#__PURE__*/React__namespace.createElement(material.Grid, {
9059
8960
  container: true,
@@ -9097,65 +8998,6 @@
9097
8998
  }));
9098
8999
  };
9099
9000
 
9100
- /* *
9101
- * Licensed under the Apache License, Version 2.0 (the "License");
9102
- * you may not use this file except in compliance with the License.
9103
- * You may obtain a copy of the License at
9104
- *
9105
- * http://www.apache.org/licenses/LICENSE-2.0
9106
- *
9107
- * Unless required by applicable law or agreed to in writing, software
9108
- * distributed under the License is distributed on an "AS IS" BASIS,
9109
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9110
- * See the License for the specific language governing permissions and
9111
- * limitations under the License.
9112
- *
9113
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9114
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
9115
- * */
9116
- var useTooltipContainerStyles = makeStyles__default["default"](function (theme) {
9117
- return createStyles__default["default"]({
9118
- textContainer: {
9119
- width: '100%',
9120
- height: 32,
9121
- fontWeight: 500,
9122
- fontSize: theme.palette.geowebColors.layerManager.tableRowDefaultText.fontSize,
9123
- color: function color(isEnabled) {
9124
- return isEnabled ? theme.palette.geowebColors.layerManager.tableRowDefaultText.rgba : theme.palette.geowebColors.layerManager.tableRowDisabledText.rgba;
9125
- },
9126
- '& .MuiOutlinedInput-input': {
9127
- padding: '6px 24px 6px 8px'
9128
- },
9129
- '& .MuiOutlinedInput-notchedOutline': {
9130
- borderColor: 'transparent!important'
9131
- },
9132
- '&:hover .MuiSelect-select': {
9133
- backgroundColor: theme.palette.geowebColors.buttons.tool.mouseOver.fill
9134
- },
9135
- '&.Mui-focused .MuiSelect-select': {
9136
- outline: theme.palette.geowebColors.buttons.focusDefault.outline,
9137
- backgroundColor: theme.palette.geowebColors.buttons.tool.mouseOver.fill
9138
- },
9139
- '&:hover&.MuiButton-root': {
9140
- backgroundColor: theme.palette.geowebColors.buttons.tool.mouseOver.fill
9141
- },
9142
- '&:focus&.MuiButton-root': {
9143
- outline: theme.palette.geowebColors.buttons.focusDefault.outline,
9144
- backgroundColor: theme.palette.geowebColors.buttons.tool.mouseOver.fill
9145
- },
9146
- '& .MuiSvgIcon-root': {
9147
- transition: 'none',
9148
- fill: function fill(isEnabled) {
9149
- return isEnabled ? theme.palette.geowebColors.buttons.flat["default"].color : theme.palette.geowebColors.buttons.flat.disabled.color;
9150
- }
9151
- },
9152
- '&>div': {
9153
- paddingLeft: 8
9154
- }
9155
- }
9156
- });
9157
- });
9158
-
9159
9001
  /* *
9160
9002
  * Licensed under the Apache License, Version 2.0 (the "License");
9161
9003
  * you may not use this file except in compliance with the License.
@@ -9179,7 +9021,6 @@
9179
9021
  _b = _a.layerDimensions,
9180
9022
  layerDimensions = _b === void 0 ? [] : _b,
9181
9023
  isEnabled = _a.isEnabled;
9182
- var classes = useTooltipContainerStyles(isEnabled);
9183
9024
 
9184
9025
  var _c = __read(React__namespace.useState(layerDimensions.length ? layerDimensions[0].name : ''), 2),
9185
9026
  activeDimName = _c[0],
@@ -9256,7 +9097,7 @@
9256
9097
  }, /*#__PURE__*/React__namespace.createElement(material.Grid, {
9257
9098
  item: true,
9258
9099
  xs: 12
9259
- }, /*#__PURE__*/React__namespace.createElement(TooltipSelect, {
9100
+ }, /*#__PURE__*/React__namespace.createElement(shared.TooltipSelect, {
9260
9101
  disableUnderline: true,
9261
9102
  tooltip: "Select the dimension to adjust, currently it is set to " + activeDimName + " with value " + activeDim.currentValue,
9262
9103
  inputProps: {
@@ -9264,7 +9105,7 @@
9264
9105
  'data-testid': 'selectDimension'
9265
9106
  }
9266
9107
  },
9267
- className: classes.textContainer,
9108
+ isEnabled: isEnabled,
9268
9109
  value: activeDimName,
9269
9110
  list: dimNameList,
9270
9111
  currentIndex: dimNameCurrentIndex,
@@ -9282,7 +9123,7 @@
9282
9123
  key: dimension.name,
9283
9124
  value: dimension.name
9284
9125
  }, dimension.name);
9285
- })), /*#__PURE__*/React__namespace.createElement(TooltipSelect, {
9126
+ })), /*#__PURE__*/React__namespace.createElement(shared.TooltipSelect, {
9286
9127
  disableUnderline: true,
9287
9128
  tooltip: "Dimension " + activeDimName + " is set to " + activeDim.currentValue + " with units " + activeDim.units,
9288
9129
  inputProps: {
@@ -9290,7 +9131,7 @@
9290
9131
  'data-testid': 'selectDimensionValue'
9291
9132
  }
9292
9133
  },
9293
- className: classes.textContainer,
9134
+ isEnabled: isEnabled,
9294
9135
  value: activeDim && activeDim.currentValue,
9295
9136
  list: dimValueList,
9296
9137
  currentIndex: dimValueCurrentIndex,
@@ -9327,7 +9168,7 @@
9327
9168
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9328
9169
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
9329
9170
  * */
9330
- var useStyles$u = makeStyles__default["default"](function (theme) {
9171
+ var useStyles$s = makeStyles__default["default"](function (theme) {
9331
9172
  return createStyles__default["default"]({
9332
9173
  dropdownEmpty: {
9333
9174
  paddingLeft: 8,
@@ -9377,8 +9218,7 @@
9377
9218
  layers = _b === void 0 ? [] : _b,
9378
9219
  _c = _a.isEnabled,
9379
9220
  isEnabled = _c === void 0 ? true : _c;
9380
- var classes = useStyles$u();
9381
- var containerClass = useTooltipContainerStyles(isEnabled);
9221
+ var classes = useStyles$s();
9382
9222
 
9383
9223
  if (!layers || !layers.length) {
9384
9224
  return /*#__PURE__*/React__namespace.createElement("div", {
@@ -9404,7 +9244,7 @@
9404
9244
  value: layer.name
9405
9245
  };
9406
9246
  });
9407
- return /*#__PURE__*/React__namespace.createElement(TooltipSelect, {
9247
+ return /*#__PURE__*/React__namespace.createElement(shared.TooltipSelect, {
9408
9248
  disableUnderline: true,
9409
9249
  tooltip: "Select a layer",
9410
9250
  inputProps: {
@@ -9412,7 +9252,7 @@
9412
9252
  'data-testid': 'selectLayer'
9413
9253
  }
9414
9254
  },
9415
- className: containerClass.textContainer,
9255
+ isEnabled: isEnabled,
9416
9256
  value: currentValue,
9417
9257
  list: list,
9418
9258
  currentIndex: currentIndex,
@@ -9420,15 +9260,27 @@
9420
9260
  onChangeMouseWheel: function onChangeMouseWheel(e) {
9421
9261
  return onChangeLayerName(e.value);
9422
9262
  },
9423
- requiresCtrlToChange: true
9263
+ requiresCtrlToChange: true,
9264
+ renderValue: function renderValue(value) {
9265
+ return extendedLayers.find(function (layer) {
9266
+ return layer.name === value;
9267
+ }).text;
9268
+ }
9424
9269
  }, /*#__PURE__*/React__namespace.createElement(material.MenuItem, {
9425
9270
  disabled: true
9426
- }, "Layer"), extendedLayers.map(function (layerFromServiceLayers) {
9271
+ }, "Layer"), extendedLayers.map(function (layerFromServiceLayers, currentIndex) {
9427
9272
  return /*#__PURE__*/React__namespace.createElement(material.MenuItem, {
9428
9273
  key: layerFromServiceLayers.name,
9429
9274
  value: layerFromServiceLayers.name,
9430
- disabled: !layerFromServiceLayers.leaf
9431
- }, layerFromServiceLayers.text);
9275
+ disabled: !layerFromServiceLayers.leaf,
9276
+ sx: {
9277
+ '& .MuiSvgIcon-root': {
9278
+ marginLeft: '28px'
9279
+ }
9280
+ }
9281
+ }, layerFromServiceLayers.text, currentIndex === layers.length && /*#__PURE__*/React__namespace.createElement(shared.AlertIcon, {
9282
+ severity: "error"
9283
+ }));
9432
9284
  }));
9433
9285
  };
9434
9286
 
@@ -9448,7 +9300,7 @@
9448
9300
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9449
9301
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
9450
9302
  * */
9451
- var useStyles$t = makeStyles__default["default"](function (theme) {
9303
+ var useStyles$r = makeStyles__default["default"](function (theme) {
9452
9304
  return {
9453
9305
  opacityDiv: {
9454
9306
  height: 'calc(100% - 5px)',
@@ -9509,9 +9361,8 @@
9509
9361
  onLayerChangeOpacity = _a.onLayerChangeOpacity,
9510
9362
  _b = _a.isEnabled,
9511
9363
  isEnabled = _b === void 0 ? true : _b;
9512
- var classes = useStyles$t();
9364
+ var classes = useStyles$r();
9513
9365
  var sliderClasses = shared.sliderStyles();
9514
- var containerClass = useTooltipContainerStyles(isEnabled);
9515
9366
 
9516
9367
  var _c = __read(React__namespace.useState(false), 2),
9517
9368
  open = _c[0],
@@ -9521,22 +9372,8 @@
9521
9372
  tooltipOpen = _d[0],
9522
9373
  setTooltipOpen = _d[1];
9523
9374
 
9524
- var preventDefault = function preventDefault(event) {
9525
- event.preventDefault();
9526
- event.stopPropagation();
9527
- };
9528
-
9529
- var enableScroll = React__namespace.useCallback(function () {
9530
- document.removeEventListener('wheel', preventDefault, false);
9531
- }, []);
9532
- var disableScroll = React__namespace.useCallback(function () {
9533
- document.addEventListener('wheel', preventDefault, {
9534
- passive: false
9535
- });
9536
- }, []);
9537
9375
  var onWheel = React__namespace.useCallback(function (event) {
9538
9376
  if (event.ctrlKey || event.metaKey) {
9539
- disableScroll();
9540
9377
  var multiplier = event.altKey ? 10 : 1;
9541
9378
  var direction = event.deltaY > 0 ? 0.01 * multiplier : -0.01 * multiplier;
9542
9379
  var newValue_1 = Math.min(Math.max(currentOpacity - direction, 0), 1); // Kind of "one frame debouncer", meant to dampen too fast slider movement
@@ -9544,8 +9381,8 @@
9544
9381
  window.requestAnimationFrame(function () {
9545
9382
  onLayerChangeOpacity(newValue_1);
9546
9383
  });
9547
- } else enableScroll();
9548
- }, [currentOpacity, onLayerChangeOpacity, disableScroll, enableScroll]);
9384
+ }
9385
+ }, [currentOpacity, onLayerChangeOpacity]);
9549
9386
  var onClickButton = React__namespace.useCallback(function () {
9550
9387
  setOpen(!open);
9551
9388
  }, [open]);
@@ -9558,23 +9395,21 @@
9558
9395
  if (!open) setTooltipOpen(true);
9559
9396
  }, [open]);
9560
9397
  var onMouseLeave = React__namespace.useCallback(function () {
9561
- enableScroll();
9562
9398
  setTooltipOpen(false);
9563
- }, [enableScroll]);
9399
+ }, []);
9564
9400
  var onFocus = React__namespace.useCallback(function () {
9565
9401
  setTooltipOpen(true);
9566
9402
  }, []);
9567
9403
  var onBlur = React__namespace.useCallback(function () {
9568
- enableScroll();
9569
9404
  setTooltipOpen(false);
9570
- }, [enableScroll]);
9405
+ }, []);
9571
9406
  return /*#__PURE__*/React__namespace.createElement("div", {
9572
9407
  className: classes.opacityDiv,
9573
9408
  onWheel: onWheel,
9574
9409
  "data-testid": "scrollOpacity"
9575
9410
  }, /*#__PURE__*/React__namespace.createElement(material.Tooltip, {
9576
9411
  title: tooltipTitle,
9577
- className: containerClass.textContainer,
9412
+ sx: shared.tooltipContainerStyles(isEnabled),
9578
9413
  placement: "top",
9579
9414
  open: tooltipOpen
9580
9415
  }, /*#__PURE__*/React__namespace.createElement(material.Button, {
@@ -9665,7 +9500,6 @@
9665
9500
  onChangeLayerStyle = _a.onChangeLayerStyle,
9666
9501
  _b = _a.isEnabled,
9667
9502
  isEnabled = _b === void 0 ? true : _b;
9668
- var classes = useTooltipContainerStyles(isEnabled);
9669
9503
  var styles = [{
9670
9504
  title: 'default',
9671
9505
  name: 'default',
@@ -9692,7 +9526,7 @@
9692
9526
  var currentIndex = styles.findIndex(function (style) {
9693
9527
  return currentStyle === style.name;
9694
9528
  });
9695
- return /*#__PURE__*/React__namespace.createElement(TooltipSelect, {
9529
+ return /*#__PURE__*/React__namespace.createElement(shared.TooltipSelect, {
9696
9530
  disableUnderline: true,
9697
9531
  tooltip: "Select a style for layer " + layerName,
9698
9532
  inputProps: {
@@ -9700,7 +9534,7 @@
9700
9534
  'data-testid': 'selectStyle'
9701
9535
  }
9702
9536
  },
9703
- className: classes.textContainer,
9537
+ isEnabled: isEnabled,
9704
9538
  value: currentStyle,
9705
9539
  list: list,
9706
9540
  currentIndex: currentIndex,
@@ -9735,7 +9569,7 @@
9735
9569
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9736
9570
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
9737
9571
  * */
9738
- var useStyles$s = makeStyles__default["default"](function (theme) {
9572
+ var useStyles$q = makeStyles__default["default"](function (theme) {
9739
9573
  return createStyles__default["default"]({
9740
9574
  svgIcon: {
9741
9575
  fill: function fill(_a) {
@@ -9764,7 +9598,7 @@
9764
9598
  isActive = _c === void 0 ? false : _c,
9765
9599
  _d = _a.isEnabled,
9766
9600
  isEnabled = _d === void 0 ? true : _d;
9767
- var classes = useStyles$s({
9601
+ var classes = useStyles$q({
9768
9602
  isActive: isActive,
9769
9603
  isEnabled: isEnabled
9770
9604
  });
@@ -9817,7 +9651,7 @@
9817
9651
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9818
9652
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
9819
9653
  * */
9820
- var useStyles$r = makeStyles__default["default"](function (theme) {
9654
+ var useStyles$p = makeStyles__default["default"](function (theme) {
9821
9655
  return createStyles__default["default"]({
9822
9656
  row: {
9823
9657
  background: function background(isEnabled) {
@@ -9871,7 +9705,7 @@
9871
9705
  layerActiveLayout = _a.layerActiveLayout,
9872
9706
  layerManagerWidth = _a.layerManagerWidth,
9873
9707
  dragHandle = _a.dragHandle;
9874
- var classes = useStyles$r(isEnabled);
9708
+ var classes = useStyles$p(isEnabled);
9875
9709
  var columnSizes = layerManagerWidth === LayerManagerWidth.sm ? LayerManagerColumnsSmall() : LayerManagerColumnsLarge();
9876
9710
 
9877
9711
  var onClickRow = function onClickRow() {
@@ -10513,7 +10347,7 @@
10513
10347
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
10514
10348
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
10515
10349
  * */
10516
- var useStyles$q = makeStyles__default["default"](function () {
10350
+ var useStyles$o = makeStyles__default["default"](function () {
10517
10351
  return {
10518
10352
  layerRows: {
10519
10353
  width: '100%',
@@ -10533,6 +10367,11 @@
10533
10367
  var mapId = _a.mapId,
10534
10368
  layerManagerWidth = _a.layerManagerWidth;
10535
10369
  var dispatch = reactRedux.useDispatch();
10370
+
10371
+ var _b = __read(React__namespace.useState(false), 2),
10372
+ keyPressed = _b[0],
10373
+ setKeyPressed = _b[1];
10374
+
10536
10375
  var layerIds = reactRedux.useSelector(function (store) {
10537
10376
  return getLayerIds(store, mapId);
10538
10377
  });
@@ -10548,9 +10387,9 @@
10548
10387
  }));
10549
10388
  }, [dispatch]);
10550
10389
 
10551
- var _b = __read(React__namespace.useState(null), 2),
10552
- activeDragIndex = _b[0],
10553
- setActiveDragIndex = _b[1];
10390
+ var _c = __read(React__namespace.useState(null), 2),
10391
+ activeDragIndex = _c[0],
10392
+ setActiveDragIndex = _c[1];
10554
10393
 
10555
10394
  var onSetList = function onSetList() {}; // since we use activeDragIndex, we don't need inner state handling of ReactSortable
10556
10395
 
@@ -10579,7 +10418,43 @@
10579
10418
 
10580
10419
  var isSorting = activeDragIndex !== null;
10581
10420
  var isDragDisabled = layerIds.length === 1;
10582
- var classes = useStyles$q(isSorting);
10421
+ var classes = useStyles$o(isSorting);
10422
+
10423
+ var keyPressedTrue = function keyPressedTrue(event) {
10424
+ if (event.ctrlKey || event.metaKey) {
10425
+ setKeyPressed(true);
10426
+ }
10427
+ };
10428
+
10429
+ var keyPressedFalse = function keyPressedFalse() {
10430
+ setKeyPressed(false);
10431
+ };
10432
+
10433
+ React__namespace.useEffect(function () {
10434
+ window.addEventListener('keydown', keyPressedTrue);
10435
+ window.addEventListener('keyup', keyPressedFalse);
10436
+ return function () {
10437
+ window.removeEventListener('keydown', keyPressedTrue);
10438
+ window.removeEventListener('keyup', keyPressedFalse);
10439
+ };
10440
+ }, []);
10441
+ var preventDefault = React__namespace.useCallback(function (event) {
10442
+ event.preventDefault();
10443
+ event.stopPropagation();
10444
+ }, []);
10445
+ React__namespace.useEffect(function () {
10446
+ if (keyPressed === true) {
10447
+ window.addEventListener('wheel', preventDefault, {
10448
+ passive: false
10449
+ });
10450
+ } else {
10451
+ window.removeEventListener('wheel', preventDefault);
10452
+ }
10453
+
10454
+ return function () {
10455
+ return window.removeEventListener('wheel', preventDefault);
10456
+ };
10457
+ }, [keyPressed, preventDefault]);
10583
10458
  return /*#__PURE__*/React__namespace.createElement(material.Grid, {
10584
10459
  container: true,
10585
10460
  item: true,
@@ -10635,7 +10510,6 @@
10635
10510
  var selectedBaseLayers = _a.selectedBaseLayers,
10636
10511
  availableBaseLayers = _a.availableBaseLayers,
10637
10512
  onChangeBaseLayers = _a.onChangeBaseLayers;
10638
- var classes = useTooltipContainerStyles();
10639
10513
 
10640
10514
  if (!availableBaseLayers || !availableBaseLayers.length) {
10641
10515
  return /*#__PURE__*/React__namespace.createElement("div", null, "No service available");
@@ -10654,7 +10528,7 @@
10654
10528
  style: {
10655
10529
  width: '100%'
10656
10530
  }
10657
- }, /*#__PURE__*/React__namespace.createElement(TooltipSelect, {
10531
+ }, /*#__PURE__*/React__namespace.createElement(shared.TooltipSelect, {
10658
10532
  disableUnderline: true,
10659
10533
  tooltip: "Select base layer",
10660
10534
  inputProps: {
@@ -10665,7 +10539,7 @@
10665
10539
  style: {
10666
10540
  maxWidth: '100%'
10667
10541
  },
10668
- className: classes.textContainer,
10542
+ isEnabled: true,
10669
10543
  value: selectedBaseLayerId,
10670
10544
  list: list,
10671
10545
  currentIndex: currentIndex,
@@ -10789,7 +10663,7 @@
10789
10663
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
10790
10664
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
10791
10665
  * */
10792
- var useStyles$p = makeStyles__default["default"]({
10666
+ var useStyles$n = makeStyles__default["default"]({
10793
10667
  layerRow: {
10794
10668
  width: '100%',
10795
10669
  height: '36px'
@@ -10812,7 +10686,7 @@
10812
10686
  layerManagerWidth = _a.layerManagerWidth,
10813
10687
  _d = _a.tooltip,
10814
10688
  tooltip = _d === void 0 ? '' : _d;
10815
- var classes = useStyles$p();
10689
+ var classes = useStyles$n();
10816
10690
  var columnSizes = layerManagerWidth === LayerManagerWidth.sm ? LayerManagerColumnsSmall() : LayerManagerColumnsLarge();
10817
10691
  return /*#__PURE__*/React__namespace.createElement(material.Grid, {
10818
10692
  container: true,
@@ -10857,7 +10731,7 @@
10857
10731
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
10858
10732
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
10859
10733
  * */
10860
- var useStyles$o = makeStyles__default["default"]({
10734
+ var styles$1 = {
10861
10735
  layerRowContainer: {
10862
10736
  position: 'relative',
10863
10737
  width: '100%',
@@ -10871,7 +10745,7 @@
10871
10745
  width: '100%',
10872
10746
  boxSizing: 'border-box'
10873
10747
  }
10874
- });
10748
+ };
10875
10749
 
10876
10750
  var LayerManager = function LayerManager(_a) {
10877
10751
  var mapId = _a.mapId,
@@ -10891,12 +10765,13 @@
10891
10765
  _e = _a.layerSelect,
10892
10766
  layerSelect = _e === void 0 ? false : _e,
10893
10767
  _f = _a.showAddLayersTooltip,
10894
- showAddLayersTooltip = _f === void 0 ? true : _f;
10895
- var classes = useStyles$o();
10768
+ showAddLayersTooltip = _f === void 0 ? true : _f,
10769
+ _g = _a.leftComponent,
10770
+ leftComponent = _g === void 0 ? null : _g;
10896
10771
 
10897
- var _g = __read(React__namespace.useState(LayerManagerWidth.lg), 2),
10898
- layerManagerWidth = _g[0],
10899
- setLayerManagerWidth = _g[1];
10772
+ var _h = __read(React__namespace.useState(LayerManagerWidth.lg), 2),
10773
+ layerManagerWidth = _h[0],
10774
+ setLayerManagerWidth = _h[1];
10900
10775
 
10901
10776
  var onChangeSize = function onChangeSize(_a) {
10902
10777
  var width = _a.width;
@@ -10923,13 +10798,14 @@
10923
10798
  "data-testid": "layerManagerWindow",
10924
10799
  onMouseDown: onMouseDown,
10925
10800
  order: order,
10926
- source: source
10927
- }, /*#__PURE__*/React__namespace.createElement("div", {
10928
- className: classes.layerManagerContainer
10801
+ source: source,
10802
+ leftComponent: leftComponent
10803
+ }, /*#__PURE__*/React__namespace.createElement(material.Box, {
10804
+ sx: styles$1.layerManagerContainer
10929
10805
  }, /*#__PURE__*/React__namespace.createElement(material.Grid, {
10930
10806
  container: true,
10931
10807
  "data-testid": "layerManagerRowContainer",
10932
- className: classes.layerRowContainer
10808
+ sx: styles$1.layerRowContainer
10933
10809
  }, /*#__PURE__*/React__namespace.createElement(DescriptionRow, {
10934
10810
  mapId: mapId,
10935
10811
  tooltip: showAddLayersTooltip ? 'Add Layers' : '',
@@ -11310,9 +11186,8 @@
11310
11186
  }
11311
11187
 
11312
11188
  serviceSetLayers({
11313
- id: serviceUrl,
11314
11189
  name: serviceName,
11315
- service: serviceUrl,
11190
+ serviceUrl: serviceUrl,
11316
11191
  layers: serviceLayers,
11317
11192
  isUserAddedService: true
11318
11193
  });
@@ -11731,6 +11606,65 @@
11731
11606
  });
11732
11607
  };
11733
11608
 
11609
+ /* *
11610
+ * Licensed under the Apache License, Version 2.0 (the "License");
11611
+ * you may not use this file except in compliance with the License.
11612
+ * You may obtain a copy of the License at
11613
+ *
11614
+ * http://www.apache.org/licenses/LICENSE-2.0
11615
+ *
11616
+ * Unless required by applicable law or agreed to in writing, software
11617
+ * distributed under the License is distributed on an "AS IS" BASIS,
11618
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11619
+ * See the License for the specific language governing permissions and
11620
+ * limitations under the License.
11621
+ *
11622
+ * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
11623
+ * Copyright 2021 - Finnish Meteorological Institute (FMI)
11624
+ * */
11625
+ var getMapStoreServiceFromLayerSelectServiceId = function getMapStoreServiceFromLayerSelectServiceId(services, serviceId) {
11626
+ /*
11627
+ Because the mapStore services redux store is refactored,
11628
+ the id's do not match anymore with the layerSelect services redux store.
11629
+ The following code ensures that the right mapStore service is found based on the id in the layerSelect store.
11630
+ TODO: https://gitlab.com/opengeoweb/opengeoweb/-/issues/1883
11631
+ */
11632
+ var mapStoreServiceIndex = Object.keys(services).findIndex(function (serviceKey) {
11633
+ return services[serviceKey].serviceUrl === serviceId;
11634
+ });
11635
+
11636
+ if (mapStoreServiceIndex === -1) {
11637
+ console.warn("serviceId " + serviceId + " not found");
11638
+ return null;
11639
+ }
11640
+
11641
+ return services[Object.keys(services)[mapStoreServiceIndex]];
11642
+ };
11643
+ var filterLayersFromService = function filterLayersFromService(serviceId, services, keywordIds, allKeywordsActive, searchString) {
11644
+ var mapStoreService = getMapStoreServiceFromLayerSelectServiceId(services, serviceId);
11645
+ if (!mapStoreService) return [];
11646
+
11647
+ if (searchString === '' && allKeywordsActive) {
11648
+ return mapStoreService.layers.filter(function (layer) {
11649
+ return layer.leaf;
11650
+ });
11651
+ }
11652
+
11653
+ var searchStringArray = searchString.split(' ');
11654
+ return mapStoreService.layers.filter(function (layer) {
11655
+ return searchStringArray.every(function (search) {
11656
+ var layerPathAndKeywords = layer.path.concat(layer.keywords);
11657
+ return (!!layerPathAndKeywords && !layerPathAndKeywords.every(function (keyword) {
11658
+ return !keywordIds.includes(keyword);
11659
+ }) || allKeywordsActive) && (!!layer.name && layer.name.toLowerCase().includes(search.toLowerCase()) || !!layer.text && layer.text.toLowerCase().includes(search.toLowerCase()) || !!layer["abstract"] && layer["abstract"].toLowerCase().includes(search.toLowerCase()) || !!layerPathAndKeywords && !layerPathAndKeywords.every(function (keyword) {
11660
+ return !keyword.toLowerCase().includes(search.toLowerCase());
11661
+ }) || mapStoreService.name.toLowerCase().includes(search.toLowerCase()));
11662
+ });
11663
+ }).filter(function (layer) {
11664
+ return layer.leaf;
11665
+ });
11666
+ };
11667
+
11734
11668
  /* *
11735
11669
  * Licensed under the Apache License, Version 2.0 (the "License");
11736
11670
  * you may not use this file except in compliance with the License.
@@ -11788,29 +11722,103 @@
11788
11722
  * See the License for the specific language governing permissions and
11789
11723
  * limitations under the License.
11790
11724
  *
11791
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
11792
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
11725
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
11726
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
11793
11727
  * */
11794
- var filterLayersFromService = function filterLayersFromService(serviceId, services, keywordIds, allKeywordsActive, searchString) {
11795
- if (searchString === '' && allKeywordsActive) {
11796
- return services[serviceId].layers.filter(function (layer) {
11797
- return layer.leaf;
11798
- });
11799
- }
11800
11728
 
11801
- var searchStringArray = searchString.split(' ');
11802
- return services[serviceId].layers.filter(function (layer) {
11803
- return searchStringArray.every(function (search) {
11804
- var layerPathAndKeywords = layer.path.concat(layer.keywords);
11805
- return (!!layerPathAndKeywords && !layerPathAndKeywords.every(function (keyword) {
11806
- return !keywordIds.includes(keyword);
11807
- }) || allKeywordsActive) && (!!layer.name && layer.name.toLowerCase().includes(search.toLowerCase()) || !!layer.text && layer.text.toLowerCase().includes(search.toLowerCase()) || !!layer["abstract"] && layer["abstract"].toLowerCase().includes(search.toLowerCase()) || !!layerPathAndKeywords && !layerPathAndKeywords.every(function (keyword) {
11808
- return !keyword.toLowerCase().includes(search.toLowerCase());
11809
- }) || services[serviceId].name.toLowerCase().includes(search.toLowerCase()));
11810
- });
11811
- }).filter(function (layer) {
11812
- return layer.leaf;
11813
- });
11729
+ var LayerListRow = function LayerListRow(_a) {
11730
+ var layer = _a.layer,
11731
+ layerIndex = _a.layerIndex,
11732
+ serviceId = _a.serviceId,
11733
+ addLayer = _a.addLayer,
11734
+ deleteLayer = _a.deleteLayer,
11735
+ mapLayers = _a.mapLayers;
11736
+ return /*#__PURE__*/React__default["default"].createElement(material.Grid, {
11737
+ "data-testid": "layerListLayerRow",
11738
+ container: true,
11739
+ item: true,
11740
+ xs: 12,
11741
+ justifyContent: "center",
11742
+ alignItems: "center",
11743
+ sx: {
11744
+ backgroundColor: 'geowebColors.cards.cardContainer',
11745
+ paddingLeft: '12px',
11746
+ marginBottom: '4px',
11747
+ height: '64px',
11748
+ border: 'solid 1px',
11749
+ borderColor: 'geowebColors.cards.cardContainerBorder'
11750
+ }
11751
+ }, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
11752
+ container: true,
11753
+ item: true,
11754
+ xs: 10
11755
+ }, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
11756
+ container: true,
11757
+ item: true,
11758
+ xs: 12
11759
+ }, /*#__PURE__*/React__default["default"].createElement(material.Box, {
11760
+ sx: {
11761
+ fontSize: '12px',
11762
+ height: '24px',
11763
+ lineHeight: '24px',
11764
+ fontWeight: 500,
11765
+ WebkitLineClamp: 1,
11766
+ display: '-webkit-box',
11767
+ WebkitBoxOrient: 'vertical',
11768
+ textOverflow: 'ellipsis',
11769
+ overflow: 'hidden'
11770
+ }
11771
+ }, layer.text)), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
11772
+ container: true,
11773
+ item: true,
11774
+ xs: 4
11775
+ }, /*#__PURE__*/React__default["default"].createElement(material.Box, {
11776
+ sx: {
11777
+ fontSize: '12px',
11778
+ height: '24px',
11779
+ lineHeight: '24px',
11780
+ WebkitLineClamp: 1,
11781
+ display: '-webkit-box',
11782
+ WebkitBoxOrient: 'vertical',
11783
+ textOverflow: 'ellipsis',
11784
+ overflow: 'hidden'
11785
+ }
11786
+ }, layer.name)), layer["abstract"] ? /*#__PURE__*/React__default["default"].createElement(material.Grid, {
11787
+ "data-testid": "layerAbstract",
11788
+ container: true,
11789
+ item: true,
11790
+ xs: 8,
11791
+ sx: {
11792
+ fontSize: '10px',
11793
+ height: '30px',
11794
+ paddingLeft: '20px',
11795
+ WebkitLineClamp: 2,
11796
+ display: '-webkit-box',
11797
+ WebkitBoxOrient: 'vertical',
11798
+ textOverflow: 'ellipsis',
11799
+ overflow: 'hidden'
11800
+ }
11801
+ }, layer["abstract"]) : null), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
11802
+ container: true,
11803
+ item: true,
11804
+ xs: 2,
11805
+ justifyContent: "flex-end",
11806
+ alignItems: "center"
11807
+ }, /*#__PURE__*/React__default["default"].createElement(material.Box, {
11808
+ sx: {
11809
+ width: '80px',
11810
+ height: '48px',
11811
+ marginRight: '8px',
11812
+ paddingTop: '4px'
11813
+ }
11814
+ }, /*#__PURE__*/React__default["default"].createElement(LayerAddRemoveButton, {
11815
+ layer: layer,
11816
+ layerIndex: layerIndex,
11817
+ serviceId: serviceId,
11818
+ addLayer: addLayer,
11819
+ deleteLayer: deleteLayer,
11820
+ mapLayers: mapLayers
11821
+ }))));
11814
11822
  };
11815
11823
 
11816
11824
  /* *
@@ -11826,56 +11834,9 @@
11826
11834
  * See the License for the specific language governing permissions and
11827
11835
  * limitations under the License.
11828
11836
  *
11829
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
11830
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
11837
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
11838
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
11831
11839
  * */
11832
- var useStyles$n = makeStyles__default["default"](function (theme) {
11833
- return {
11834
- layerRow: {
11835
- background: theme.palette.geowebColors.cards.cardContainer,
11836
- padding: '8px 0px 8px 12px',
11837
- marginBottom: '4px',
11838
- height: '64px',
11839
- border: "solid 1px " + theme.palette.geowebColors.cards.cardContainerBorder,
11840
- display: 'grid',
11841
- gridTemplateColumns: '1fr 0.1fr',
11842
- gridGap: '20px'
11843
- },
11844
- layerText: {
11845
- fontSize: '12px',
11846
- fontWeight: 500,
11847
- overflow: 'clip',
11848
- height: '20px',
11849
- textOverflow: 'ellipsis'
11850
- },
11851
- layerName: {
11852
- fontSize: '12px',
11853
- height: '24px',
11854
- overflow: 'clip',
11855
- "float": 'left',
11856
- paddingTop: '6px',
11857
- whiteSpace: 'nowrap'
11858
- },
11859
- layerNameMaxWidth: {
11860
- maxWidth: '270px'
11861
- },
11862
- layerAbstract: {
11863
- fontSize: '10px',
11864
- paddingLeft: '200px',
11865
- overflow: 'clip',
11866
- height: '30px'
11867
- },
11868
- resultCount: {
11869
- marginBottom: '4px',
11870
- fontSize: '12px'
11871
- },
11872
- layerButton: {
11873
- marginRight: '8px',
11874
- marginTop: '4px',
11875
- width: '80px'
11876
- }
11877
- };
11878
- });
11879
11840
 
11880
11841
  var LayerList = function LayerList(_a) {
11881
11842
  var services = _a.services,
@@ -11887,7 +11848,6 @@
11887
11848
  mapLayers = _a.mapLayers,
11888
11849
  keywordIds = _a.keywordIds,
11889
11850
  allKeywordsActive = _a.allKeywordsActive;
11890
- var classes = useStyles$n();
11891
11851
 
11892
11852
  var _b = __read(React__namespace.useState(0), 2),
11893
11853
  numberOfLayers = _b[0],
@@ -11898,42 +11858,29 @@
11898
11858
  return totalNumberOfLayers + filterLayersFromService(serviceId, services, keywordIds, allKeywordsActive, searchString).length;
11899
11859
  }, 0));
11900
11860
  }, [serviceIds, keywordIds, services, searchString, allKeywordsActive]);
11901
- return /*#__PURE__*/React__namespace.createElement("div", {
11861
+ return /*#__PURE__*/React__namespace.createElement(material.Box, {
11902
11862
  "data-testid": "layerList"
11903
- }, /*#__PURE__*/React__namespace.createElement("div", {
11904
- className: classes.resultCount
11905
- }, numberOfLayers, " results"), /*#__PURE__*/React__namespace.createElement("div", {
11906
- style: {
11863
+ }, /*#__PURE__*/React__namespace.createElement(material.Box, {
11864
+ sx: {
11865
+ marginBottom: '4px',
11866
+ fontSize: '12px'
11867
+ }
11868
+ }, numberOfLayers, " results"), /*#__PURE__*/React__namespace.createElement(material.Box, {
11869
+ sx: {
11907
11870
  height: layerSelectHeight - 199,
11908
11871
  overflow: 'auto'
11909
11872
  }
11910
11873
  }, serviceIds.map(function (serviceId) {
11911
11874
  return filterLayersFromService(serviceId, services, keywordIds, allKeywordsActive, searchString).map(function (layer, layerIndex) {
11912
- return /*#__PURE__*/React__namespace.createElement("div", {
11913
- key: serviceId + "-" + layer.name + "-" + layer.text
11914
- }, /*#__PURE__*/React__namespace.createElement("div", {
11915
- key: serviceId + "-" + layer.name,
11916
- className: classes.layerRow,
11917
- "data-testid": "layerListLayerRow"
11918
- }, /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("div", {
11919
- className: classes.layerText
11920
- }, layer.text), /*#__PURE__*/React__namespace.createElement("div", null, layer["abstract"] ? /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement("div", {
11921
- className: classes.layerName + " " + classes.layerNameMaxWidth
11922
- }, layer.name), /*#__PURE__*/React__namespace.createElement("div", {
11923
- className: classes.layerAbstract,
11924
- "data-testid": "layerAbstract"
11925
- }, layer["abstract"])) : /*#__PURE__*/React__namespace.createElement("div", {
11926
- className: classes.layerName
11927
- }, layer.name))), /*#__PURE__*/React__namespace.createElement("div", {
11928
- className: classes.layerButton
11929
- }, /*#__PURE__*/React__namespace.createElement(LayerAddRemoveButton, {
11875
+ return /*#__PURE__*/React__namespace.createElement(LayerListRow, {
11876
+ key: layer.name,
11930
11877
  layer: layer,
11931
11878
  layerIndex: layerIndex,
11932
11879
  serviceId: serviceId,
11933
11880
  addLayer: addLayer,
11934
11881
  deleteLayer: deleteLayer,
11935
11882
  mapLayers: mapLayers
11936
- }))));
11883
+ });
11937
11884
  });
11938
11885
  })));
11939
11886
  };
@@ -12067,10 +12014,10 @@
12067
12014
  tabIndex: 0,
12068
12015
  "data-testid": all ? 'serviceChipAll' : 'serviceChip',
12069
12016
  onClick: function onClick() {
12070
- return toggleChip(all ? 'all' : service && service.service);
12017
+ return toggleChip(all ? 'all' : service && service.serviceUrl);
12071
12018
  },
12072
12019
  onKeyPress: function onKeyPress() {
12073
- return toggleChip(all ? 'all' : service && service.service);
12020
+ return toggleChip(all ? 'all' : service && service.serviceUrl);
12074
12021
  },
12075
12022
  sx: style
12076
12023
  }, service ? service.name : 'All');
@@ -12301,13 +12248,14 @@
12301
12248
  key: "All",
12302
12249
  all: true,
12303
12250
  isEnabled: isAllEnabled
12304
- }), Object.keys(services).map(function (service) {
12251
+ }), Object.keys(services).map(function (serviceId) {
12305
12252
  var _a;
12306
12253
 
12254
+ var service = services[serviceId];
12307
12255
  return /*#__PURE__*/React__namespace.createElement(ServiceChipConnect, {
12308
- key: services[service].id,
12309
- service: services[service],
12310
- isEnabled: (_a = activeServices[service]) === null || _a === void 0 ? void 0 : _a.enabled
12256
+ key: serviceId,
12257
+ service: service,
12258
+ isEnabled: (_a = activeServices[service.serviceUrl]) === null || _a === void 0 ? void 0 : _a.enabled
12311
12259
  });
12312
12260
  })), layerSelectWidth + margin < width && /*#__PURE__*/React__namespace.createElement(iconsMaterial.ChevronRight, {
12313
12261
  className: classes.scrollArrowRight,
@@ -12456,7 +12404,7 @@
12456
12404
  }, /*#__PURE__*/React__namespace.createElement(material.Tooltip, {
12457
12405
  title: "Edit Service"
12458
12406
  }, /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(material.IconButton, {
12459
- disabled: isDisabled(service.service),
12407
+ disabled: isDisabled(service.serviceUrl),
12460
12408
  "data-testid": "openEditServiceButton",
12461
12409
  size: "large"
12462
12410
  }, /*#__PURE__*/React__namespace.createElement(material.SvgIcon, null, /*#__PURE__*/React__namespace.createElement("g", null, /*#__PURE__*/React__namespace.createElement("path", {
@@ -12466,9 +12414,9 @@
12466
12414
  title: "Delete Service"
12467
12415
  }, /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(material.IconButton, {
12468
12416
  size: "large",
12469
- disabled: isDisabled(service.service),
12417
+ disabled: isDisabled(service.serviceUrl),
12470
12418
  onClick: function onClick() {
12471
- return mapStoreRemoveService(service.service);
12419
+ return mapStoreRemoveService(service.serviceUrl);
12472
12420
  },
12473
12421
  "data-testid": "removeServiceButton"
12474
12422
  }, /*#__PURE__*/React__namespace.createElement(material.SvgIcon, null, /*#__PURE__*/React__namespace.createElement("g", null, /*#__PURE__*/React__namespace.createElement("path", {
@@ -13179,13 +13127,12 @@
13179
13127
  }, [dispatch]);
13180
13128
  React__namespace.useEffect(function () {
13181
13129
  if (isOpenInStore && preloadedServices && preloadedServices.length > 0) {
13182
- preloadedServices.forEach(function (service) {
13130
+ mergePresetsAndUserAddedServices(preloadedServices, getUserAddedServices()).forEach(function (service) {
13183
13131
  getLayersFlattenedFromService(service.url).then(function (layers) {
13184
13132
  if (isMounted.current) {
13185
13133
  serviceSetLayers$1({
13186
- id: service.id,
13187
13134
  name: service.name,
13188
- service: service.url,
13135
+ serviceUrl: service.url,
13189
13136
  layers: layers,
13190
13137
  isUserAddedService: false
13191
13138
  });
@@ -13245,7 +13192,9 @@
13245
13192
  _b = _a.showTitle,
13246
13193
  showTitle = _b === void 0 ? false : _b,
13247
13194
  _c = _a.layerSelect,
13248
- layerSelect = _c === void 0 ? false : _c;
13195
+ layerSelect = _c === void 0 ? false : _c,
13196
+ _d = _a.leftComponent,
13197
+ leftComponent = _d === void 0 ? null : _d;
13249
13198
  var dispatch = reactRedux.useDispatch();
13250
13199
  var isOpenInStore = reactRedux.useSelector(function (store) {
13251
13200
  return getisDialogOpen(store, 'layerManager');
@@ -13314,8 +13263,11 @@
13314
13263
  onMouseDown: onOrderDialog,
13315
13264
  order: uiOrder,
13316
13265
  source: uiSource,
13317
- layerSelect: layerSelect
13318
- }), layerSelect && /*#__PURE__*/React__namespace.createElement(LayerSelectConnect, null));
13266
+ layerSelect: layerSelect,
13267
+ leftComponent: leftComponent
13268
+ }), layerSelect && /*#__PURE__*/React__namespace.createElement(LayerSelectConnect, {
13269
+ preloadedServices: preloadedMapServices
13270
+ }));
13319
13271
  };
13320
13272
 
13321
13273
  /* *
@@ -14283,60 +14235,6 @@
14283
14235
  }, "AUTO")))))));
14284
14236
  };
14285
14237
 
14286
- /* *
14287
- * Licensed under the Apache License, Version 2.0 (the "License");
14288
- * you may not use this file except in compliance with the License.
14289
- * You may obtain a copy of the License at
14290
- *
14291
- * http://www.apache.org/licenses/LICENSE-2.0
14292
- *
14293
- * Unless required by applicable law or agreed to in writing, software
14294
- * distributed under the License is distributed on an "AS IS" BASIS,
14295
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14296
- * See the License for the specific language governing permissions and
14297
- * limitations under the License.
14298
- *
14299
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
14300
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
14301
- * */
14302
- var svgLoopPath = {
14303
- title: 'Loop',
14304
- src: 'M20.029 10.371c.24-.013.487.078.67.246.176.162.278.38.288.615.001 0 .22 1.941-1.458 3.79-1.124 1.224-2.718 1.844-4.74 1.844H6.96v1.288c0 .43-.284.654-.564.654-.14 0-.277-.05-.41-.148l-2.671-1.948c-.2-.147-.314-.36-.314-.587 0-.229.114-.443.315-.588l2.67-1.95c.134-.096.272-.145.41-.145.28 0 .563.224.563.653v1.116h7.832c1.417 0 2.59-.465 3.393-1.342 1.025-1.13 1.011-2.28.998-2.5-.023-.508.355-.954.842-.998zM17.605 5c.14 0 .277.05.41.148l2.671 1.947c.2.147.314.36.314.587 0 .23-.114.444-.315.589l-2.67 1.949c-.134.096-.272.146-.41.146-.28 0-.563-.224-.563-.654V8.597H9.21c-1.416 0-2.59.465-3.393 1.342-1.025 1.13-1.011 2.329-.999 2.558.024.508-.354.954-.841.998l-.05.002c-.228 0-.454-.09-.626-.248-.176-.163-.278-.38-.288-.614-.002 0-.227-1.993 1.458-3.849 1.124-1.224 2.718-1.845 4.74-1.845h7.83V5.654c0-.429.284-.654.564-.654z'
14305
- };
14306
- var svgLoopOffPath = {
14307
- title: 'Loop off',
14308
- src: 'M15.154 3.26l1.827.814-1.278 2.867h1.339V5.654c0-.429.283-.654.563-.654.14 0 .277.05.41.148l2.671 1.947c.2.147.314.36.314.587 0 .23-.114.444-.315.589l-2.67 1.949c-.134.096-.272.146-.41.146-.28 0-.563-.224-.563-.654V8.597h-2.076l-2.944 6.613h2.768c1.328 0 2.442-.408 3.238-1.182l.155-.16c1.025-1.129 1.011-2.279.998-2.499-.023-.508.355-.954.842-.998.247-.013.493.078.676.246.176.162.278.38.288.615.001 0 .22 1.941-1.458 3.79-1.124 1.224-2.718 1.844-4.74 1.844h-3.504l-2.439 5.478-1.827-.813 2.077-4.666H6.958v1.29c0 .429-.283.653-.563.653-.14 0-.277-.05-.41-.148l-2.671-1.948c-.2-.147-.314-.36-.314-.587 0-.229.114-.443.315-.588l2.67-1.95c.134-.096.272-.145.41-.145.28 0 .563.224.563.653v1.116h2.875l2.944-6.614H9.21c-1.322 0-2.432.405-3.228 1.172l-.165.17c-1.025 1.13-1.011 2.329-.999 2.558.024.508-.354.954-.841.998l-.05.002c-.228 0-.454-.09-.626-.248-.176-.163-.278-.38-.288-.614-.002 0-.227-1.993 1.458-3.849 1.124-1.224 2.718-1.845 4.74-1.845h4.303l1.64-3.68z'
14309
- };
14310
-
14311
- var LoopButton = function LoopButton(_a) {
14312
- var _b = _a.isLooping,
14313
- isLooping = _b === void 0 ? true : _b,
14314
- _c = _a.isDisabled,
14315
- isDisabled = _c === void 0 ? false : _c,
14316
- _d = _a.onToggleLoop,
14317
- onToggleLoop = _d === void 0 ? function () {
14318
- return null;
14319
- } : _d;
14320
- var loopButtonPath = isLooping ? svgLoopOffPath : svgLoopPath;
14321
- return /*#__PURE__*/React__namespace.createElement(material.Tooltip, {
14322
- title: loopButtonPath.title
14323
- }, /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(shared.ToolButton, {
14324
- onClick: function onClick() {
14325
- return onToggleLoop();
14326
- },
14327
- active: isLooping,
14328
- disabled: isDisabled,
14329
- "data-testid": "loopButton"
14330
- }, /*#__PURE__*/React__namespace.createElement(material.SvgIcon, null, /*#__PURE__*/React__namespace.createElement("rect", {
14331
- width: 24,
14332
- height: 24,
14333
- fill: "transparent"
14334
- }), /*#__PURE__*/React__namespace.createElement("path", {
14335
- "data-testid": isLooping ? 'loop-off-svg-path' : 'loop-svg-path',
14336
- d: loopButtonPath.src
14337
- })))));
14338
- };
14339
-
14340
14238
  /* *
14341
14239
  * Licensed under the Apache License, Version 2.0 (the "License");
14342
14240
  * you may not use this file except in compliance with the License.
@@ -14810,7 +14708,6 @@
14810
14708
 
14811
14709
  var OptionsMenuButton = function OptionsMenuButton(_a) {
14812
14710
  var autoUpdateBtn = _a.autoUpdateBtn,
14813
- loopBtn = _a.loopBtn,
14814
14711
  speedBtn = _a.speedBtn,
14815
14712
  timeStepBtn = _a.timeStepBtn;
14816
14713
 
@@ -14873,9 +14770,6 @@
14873
14770
  })), /*#__PURE__*/React__namespace.createElement(material.Grid, {
14874
14771
  item: true,
14875
14772
  xs: "auto"
14876
- }, loopBtn || /*#__PURE__*/React__namespace.createElement(LoopButton, null)), /*#__PURE__*/React__namespace.createElement(material.Grid, {
14877
- item: true,
14878
- xs: "auto"
14879
14773
  }, autoUpdateBtn || /*#__PURE__*/React__namespace.createElement(AutoUpdateButton, null)))));
14880
14774
  };
14881
14775
 
@@ -14964,7 +14858,6 @@
14964
14858
 
14965
14859
  var TimeSliderButtons = function TimeSliderButtons(_a) {
14966
14860
  var autoUpdateBtn = _a.autoUpdateBtn,
14967
- loopBtn = _a.loopBtn,
14968
14861
  optionsMenuBtn = _a.optionsMenuBtn,
14969
14862
  playBtn = _a.playBtn,
14970
14863
  speedBtn = _a.speedBtn,
@@ -14975,7 +14868,7 @@
14975
14868
  "data-testid": "timeSliderButtons"
14976
14869
  }, matches ? /*#__PURE__*/React__namespace.createElement(material.Grid, {
14977
14870
  container: true,
14978
- spacing: 1,
14871
+ spacing: 2,
14979
14872
  className: classes.buttonContainerBig
14980
14873
  }, /*#__PURE__*/React__namespace.createElement(material.Grid, {
14981
14874
  item: true
@@ -14993,8 +14886,6 @@
14993
14886
  }
14994
14887
  })), /*#__PURE__*/React__namespace.createElement(material.Grid, {
14995
14888
  item: true
14996
- }, loopBtn || /*#__PURE__*/React__namespace.createElement(LoopButton, null)), /*#__PURE__*/React__namespace.createElement(material.Grid, {
14997
- item: true
14998
14889
  }, autoUpdateBtn || /*#__PURE__*/React__namespace.createElement(AutoUpdateButton, null)), /*#__PURE__*/React__namespace.createElement(material.Grid, {
14999
14890
  item: true
15000
14891
  }, playBtn || /*#__PURE__*/React__namespace.createElement(PlayButton, null))) : /*#__PURE__*/React__namespace.createElement(material.Grid, {
@@ -17112,14 +17003,14 @@
17112
17003
  * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
17113
17004
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
17114
17005
  * */
17115
- var connectRedux$6 = reactRedux.connect(function (store, props) {
17006
+ var connectRedux$5 = reactRedux.connect(function (store, props) {
17116
17007
  return {
17117
17008
  isAutoUpdating: isAutoUpdating(store, props.mapId)
17118
17009
  };
17119
17010
  }, {
17120
17011
  toggleAutoUpdate: toggleAutoUpdate
17121
17012
  });
17122
- var AutoUpdateButtonConnectComponent = connectRedux$6(function (_a) {
17013
+ var AutoUpdateButtonConnectComponent = connectRedux$5(function (_a) {
17123
17014
  var mapId = _a.mapId,
17124
17015
  isAutoUpdating = _a.isAutoUpdating,
17125
17016
  toggleAutoUpdate = _a.toggleAutoUpdate;
@@ -17137,54 +17028,7 @@
17137
17028
  disabled: false
17138
17029
  });
17139
17030
  });
17140
- var AutoUpdateButtonConnect = connectRedux$6(AutoUpdateButtonConnectComponent);
17141
-
17142
- /* *
17143
- * Licensed under the Apache License, Version 2.0 (the "License");
17144
- * you may not use this file except in compliance with the License.
17145
- * You may obtain a copy of the License at
17146
- *
17147
- * http://www.apache.org/licenses/LICENSE-2.0
17148
- *
17149
- * Unless required by applicable law or agreed to in writing, software
17150
- * distributed under the License is distributed on an "AS IS" BASIS,
17151
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17152
- * See the License for the specific language governing permissions and
17153
- * limitations under the License.
17154
- *
17155
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
17156
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
17157
- * */
17158
- var connectRedux$5 = reactRedux.connect(function (store, props) {
17159
- return {
17160
- isLooping: isLooping(store, props.mapId)
17161
- };
17162
- }, {
17163
- mapToggleLoop: toggleLoop
17164
- });
17165
- var LoopButtonConnect = connectRedux$5(function (_a) {
17166
- var mapId = _a.mapId,
17167
- _b = _a.isLooping,
17168
- isLooping = _b === void 0 ? true : _b,
17169
- _c = _a.isDisabled,
17170
- isDisabled = _c === void 0 ? false : _c,
17171
- mapToggleLoop = _a.mapToggleLoop;
17172
-
17173
- var onMapToggleLoop = function onMapToggleLoop() {
17174
- mapToggleLoop({
17175
- mapId: mapId,
17176
- shouldLoop: !isLooping
17177
- });
17178
- };
17179
-
17180
- return /*#__PURE__*/React__default["default"].createElement(LoopButton, {
17181
- isLooping: isLooping,
17182
- isDisabled: isDisabled,
17183
- onToggleLoop: function onToggleLoop() {
17184
- onMapToggleLoop();
17185
- }
17186
- });
17187
- });
17031
+ var AutoUpdateButtonConnect = connectRedux$5(AutoUpdateButtonConnectComponent);
17188
17032
 
17189
17033
  /* *
17190
17034
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -17315,9 +17159,6 @@
17315
17159
  autoUpdateBtn: /*#__PURE__*/React__namespace.createElement(AutoUpdateButtonConnect, {
17316
17160
  mapId: mapId
17317
17161
  }),
17318
- loopBtn: /*#__PURE__*/React__namespace.createElement(LoopButtonConnect, {
17319
- mapId: mapId
17320
- }),
17321
17162
  speedBtn: /*#__PURE__*/React__namespace.createElement(SpeedButtonConnect, {
17322
17163
  mapId: mapId
17323
17164
  }),
@@ -17421,9 +17262,6 @@
17421
17262
  autoUpdateBtn: /*#__PURE__*/React__namespace.createElement(AutoUpdateButtonConnect, {
17422
17263
  mapId: mapId
17423
17264
  }),
17424
- loopBtn: /*#__PURE__*/React__namespace.createElement(LoopButtonConnect, {
17425
- mapId: mapId
17426
- }),
17427
17265
  optionsMenuBtn: /*#__PURE__*/React__namespace.createElement(OptionsMenuButtonConnect, {
17428
17266
  mapId: mapId
17429
17267
  }),
@@ -18475,22 +18313,6 @@
18475
18313
  }));
18476
18314
  };
18477
18315
 
18478
- function _typeof(obj) {
18479
- "@babel/helpers - typeof";
18480
-
18481
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
18482
- _typeof = function (obj) {
18483
- return typeof obj;
18484
- };
18485
- } else {
18486
- _typeof = function (obj) {
18487
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
18488
- };
18489
- }
18490
-
18491
- return _typeof(obj);
18492
- }
18493
-
18494
18316
  /* *
18495
18317
  * Licensed under the Apache License, Version 2.0 (the "License");
18496
18318
  * you may not use this file except in compliance with the License.
@@ -24120,6 +23942,57 @@
24120
23942
  }, children)));
24121
23943
  };
24122
23944
 
23945
+ /* *
23946
+ * Licensed under the Apache License, Version 2.0 (the "License");
23947
+ * you may not use this file except in compliance with the License.
23948
+ * You may obtain a copy of the License at
23949
+ *
23950
+ * http://www.apache.org/licenses/LICENSE-2.0
23951
+ *
23952
+ * Unless required by applicable law or agreed to in writing, software
23953
+ * distributed under the License is distributed on an "AS IS" BASIS,
23954
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23955
+ * See the License for the specific language governing permissions and
23956
+ * limitations under the License.
23957
+ *
23958
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
23959
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
23960
+ * */
23961
+ var MapWarningProperties = function MapWarningProperties(_a) {
23962
+ var selectedFeatureProperties = _a.selectedFeatureProperties;
23963
+ return /*#__PURE__*/React__default["default"].createElement("div", {
23964
+ "data-testid": "map-warning-properties",
23965
+ style: {
23966
+ width: '100%',
23967
+ height: '15%',
23968
+ marginTop: '30px',
23969
+ marginLeft: '100px',
23970
+ position: 'relative',
23971
+ zIndex: 10000,
23972
+ backgroundColor: '#CCCCCCC0',
23973
+ padding: '0px 20px 20px',
23974
+ overflow: 'auto',
23975
+ fontSize: '11px'
23976
+ }
23977
+ }, /*#__PURE__*/React__default["default"].createElement("h1", {
23978
+ "data-testid": "map-warning-properties-title"
23979
+ }, selectedFeatureProperties.country), selectedFeatureProperties.details[0].event && /*#__PURE__*/React__default["default"].createElement("pre", {
23980
+ "data-testid": "map-warning-properties-row"
23981
+ }, "Event: ", selectedFeatureProperties.details[0].event), selectedFeatureProperties.details[0].sent && /*#__PURE__*/React__default["default"].createElement("pre", {
23982
+ "data-testid": "map-warning-properties-row"
23983
+ }, "Sent:", ' ', moment__default["default"].utc(selectedFeatureProperties.details[0].sent).format('DD MMM YYYY, HH:mm'), ' ', "UTC"), selectedFeatureProperties.details[0].expires && /*#__PURE__*/React__default["default"].createElement("pre", {
23984
+ "data-testid": "map-warning-properties-row"
23985
+ }, "Expires:", ' ', moment__default["default"].utc(selectedFeatureProperties.details[0].expires).format('DD MMM YYYY, HH:mm'), ' ', "UTC"), selectedFeatureProperties.details[0].web && /*#__PURE__*/React__default["default"].createElement("pre", {
23986
+ "data-testid": "map-warning-properties-row"
23987
+ }, "Web: ", selectedFeatureProperties.details[0].web), selectedFeatureProperties.details[0].sender && /*#__PURE__*/React__default["default"].createElement("pre", {
23988
+ "data-testid": "map-warning-properties-row"
23989
+ }, "Sender: ", selectedFeatureProperties.details[0].sender), selectedFeatureProperties.details[0].identifier && /*#__PURE__*/React__default["default"].createElement("pre", {
23990
+ "data-testid": "map-warning-properties-row"
23991
+ }, "Identifier: ", selectedFeatureProperties.details[0].identifier), selectedFeatureProperties.details[0].area && /*#__PURE__*/React__default["default"].createElement("pre", {
23992
+ "data-testid": "map-warning-properties-row"
23993
+ }, "area: ", selectedFeatureProperties.details[0].area));
23994
+ };
23995
+
24123
23996
  exports.ConfigurableConnectedMap = ConfigurableConnectedMap;
24124
23997
  exports.ConfigurableMapWithSliderConnect = ConfigurableMapWithSliderConnect;
24125
23998
  exports.CoreThemeProvider = CoreThemeProvider;
@@ -24135,6 +24008,7 @@
24135
24008
  exports.MapView = MapView;
24136
24009
  exports.MapViewConnect = MapViewConnect;
24137
24010
  exports.MapViewLayer = MapViewLayer;
24011
+ exports.MapWarningProperties = MapWarningProperties;
24138
24012
  exports.MultiDimensionSelectMapButtonsConnect = MultiDimensionSelectMapButtonsConnect;
24139
24013
  exports.MultiMapDimensionSelectConnect = MultiMapMultiDimensionSelectConnect;
24140
24014
  exports.MultiMapViewConnect = MultiMapViewConnect;
@@ -24143,7 +24017,6 @@
24143
24017
  exports.SyncGroupViewerConnect = SyncGroupViewerConnect;
24144
24018
  exports.SyncGroups = index;
24145
24019
  exports.TimeSliderConnect = TimeSliderConnect;
24146
- exports.TooltipSelect = TooltipSelect;
24147
24020
  exports.ZoomControlConnect = ZoomControlConnect;
24148
24021
  exports.ZoomControls = ZoomControls;
24149
24022
  exports.componentsLookUp = componentsLookUp;
@@ -24160,6 +24033,8 @@
24160
24033
  exports.filterSrs = filterSrs;
24161
24034
  exports.generateLayerId = generateLayerId;
24162
24035
  exports.generateMapId = generateMapId;
24036
+ exports.generateServiceId = generateServiceId;
24037
+ exports.generateTimeSeriesId = generateTimeSeriesId;
24163
24038
  exports.generateTimesliderId = generateTimesliderId;
24164
24039
  exports.getFirstTimeStepForLayerId = getFirstTimeStepForLayerId;
24165
24040
  exports.getInitialPresets = getInitialPresets;
@@ -24185,6 +24060,7 @@
24185
24060
  exports.store = store;
24186
24061
  exports.syncGroupActions = actions;
24187
24062
  exports.synchronizationGroupModuleConfig = synchronizationGroupConfig;
24063
+ exports.synchronizationGroupsConfig = synchronizationGroupConfig;
24188
24064
  exports.testLayers = testLayers;
24189
24065
  exports.uiActions = actions$2;
24190
24066
  exports.uiModuleConfig = uiModuleConfig;