@opengeoweb/core 2.1.4 → 2.2.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.
- package/index.esm.js +358 -305
- package/index.umd.js +361 -301
- package/lib/components/CustomSwitch/CustomSwitch.stories.d.ts +4 -0
- package/lib/components/LayerManager/LayerSelect/KeywordFilterResults/KeywordFilterResults.d.ts +2 -1
- package/lib/components/{Mapcontrols/MapControlButton.spec.d.ts → LayerManager/LayerSelect/KeywordFilterResults/keywordFilterResultsConnect.spec.d.ts} +0 -0
- package/lib/components/LayerManager/LayerSelect/LayerList/LayerList.d.ts +2 -0
- package/lib/components/LayerManager/LayerSelect/LayerList/LayerListUtils.d.ts +3 -0
- package/lib/components/{Mapcontrols/MapControls.spec.d.ts → LayerManager/LayerSelect/LayerList/LayerListUtils.spec.d.ts} +0 -0
- package/lib/components/LayerManager/LayerSelect/ServiceList/ServiceList.d.ts +2 -2
- package/lib/components/{Mapcontrols → MapControls}/MapControlButton.d.ts +0 -0
- package/lib/components/{Mapcontrols/ZoomControls.spec.d.ts → MapControls/MapControlButton.spec.d.ts} +0 -0
- package/lib/components/{Mapcontrols → MapControls}/MapControls.d.ts +0 -0
- package/lib/components/{Mapcontrols/ZoomControlsConnect.spec.d.ts → MapControls/MapControls.spec.d.ts} +0 -0
- package/lib/components/{Mapcontrols → MapControls}/ZoomControls.d.ts +0 -0
- package/lib/components/MapControls/ZoomControls.spec.d.ts +1 -0
- package/lib/components/{Mapcontrols → MapControls}/ZoomControlsConnect.d.ts +0 -0
- package/lib/components/MapControls/ZoomControlsConnect.spec.d.ts +1 -0
- package/lib/components/{Mapcontrols → MapControls}/index.d.ts +0 -0
- package/lib/components/MapView/MapViewConnect.SelectorTest.stories.d.ts +2 -0
- package/lib/components/MapView/MapViewConnect.stories.d.ts +1 -0
- package/lib/components/SyncGroups/selector.d.ts +13 -2
- package/lib/index.d.ts +2 -2
- package/lib/store/advancedLayerStore/selectors.d.ts +13 -2
- package/lib/store/generic/selectors.d.ts +21 -3
- package/lib/store/generic/synchronizationGroups/selectors.d.ts +13 -1
- package/lib/store/layerSelect/actions.d.ts +3 -9
- package/lib/store/layerSelect/constants.d.ts +2 -2
- package/lib/store/layerSelect/sagas.d.ts +1 -2
- package/lib/store/layerSelect/selectors.d.ts +53 -6
- package/lib/store/layerSelect/types.d.ts +35 -26
- package/lib/store/mapStore/layers/selectors.d.ts +208 -16
- package/lib/store/mapStore/map/selectors.d.ts +427 -33
- package/lib/store/mapStore/service/selectors.d.ts +78 -7
- package/lib/store/mapStore/service/types.d.ts +1 -1
- package/lib/store/mapStore/utils/helpers.d.ts +0 -1
- package/lib/store/ui/selectors.d.ts +65 -5
- package/lib/utils/defaultTestSettings.d.ts +7 -7
- package/lib/utils/getCapabilities.d.ts +2 -2
- package/package.json +6 -6
package/index.esm.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createSelector } from 'reselect';
|
|
2
|
+
import _, { isEqual, debounce } from 'lodash';
|
|
2
3
|
import moment from 'moment';
|
|
3
4
|
import * as React from 'react';
|
|
4
5
|
import React__default, { useState, Component, useRef, useEffect } from 'react';
|
|
@@ -9,7 +10,6 @@ import { Tooltip, Select, Grid, InputLabel, IconButton, Paper, Box, Typography,
|
|
|
9
10
|
import makeStyles from '@mui/styles/makeStyles';
|
|
10
11
|
import { connect, useDispatch, useSelector, Provider } from 'react-redux';
|
|
11
12
|
import { sliderStyles, CustomSlider, ToolContainerDraggable, useIsMounted } from '@opengeoweb/shared';
|
|
12
|
-
import _, { debounce } from 'lodash';
|
|
13
13
|
import { Cached, Add, MoreVert, FileCopy, Delete, DragIndicator, Close, ChevronLeft, ChevronRight, Link, LinkOff, DeleteForever } from '@mui/icons-material';
|
|
14
14
|
import { Sortable, ReactSortable } from 'react-sortablejs';
|
|
15
15
|
import createStyles from '@mui/styles/createStyles';
|
|
@@ -810,11 +810,6 @@ var generateTimesliderId = function generateTimesliderId() {
|
|
|
810
810
|
generatedTimesliderIds += 1;
|
|
811
811
|
return "timesliderid_".concat(generatedTimesliderIds);
|
|
812
812
|
};
|
|
813
|
-
var generatedScreenIds = 0;
|
|
814
|
-
var generateScreenId = function generateScreenId() {
|
|
815
|
-
generatedScreenIds += 1;
|
|
816
|
-
return "screen_".concat(generatedScreenIds);
|
|
817
|
-
};
|
|
818
813
|
/**
|
|
819
814
|
* Map for registering wmlayers with their id's
|
|
820
815
|
*/
|
|
@@ -2092,6 +2087,14 @@ var utils = /*#__PURE__*/Object.freeze({
|
|
|
2092
2087
|
* Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
2093
2088
|
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
2094
2089
|
* */
|
|
2090
|
+
/* TODO:, move this to a right place https://gitlab.com/opengeoweb/opengeoweb/-/issues/1802 */
|
|
2091
|
+
|
|
2092
|
+
var selectorMemoizationOptions = {
|
|
2093
|
+
memoizeOptions: {
|
|
2094
|
+
maxSize: 1000,
|
|
2095
|
+
resultEqualityCheck: isEqual
|
|
2096
|
+
}
|
|
2097
|
+
};
|
|
2095
2098
|
/**
|
|
2096
2099
|
* Gets the map state by mapId
|
|
2097
2100
|
*
|
|
@@ -2191,7 +2194,7 @@ var getMapLayers = createSelector(getLayerIds, getLayersById, function (layerIds
|
|
|
2191
2194
|
return layerIds.map(function (layerId) {
|
|
2192
2195
|
return layers[layerId];
|
|
2193
2196
|
});
|
|
2194
|
-
});
|
|
2197
|
+
}, selectorMemoizationOptions);
|
|
2195
2198
|
/**
|
|
2196
2199
|
* Gets an array of baselayers ids for a map
|
|
2197
2200
|
*
|
|
@@ -2217,7 +2220,7 @@ var getMapBaseLayers = createSelector(getMapBaseLayersIds, getLayersById, functi
|
|
|
2217
2220
|
return layerIds.map(function (layerId) {
|
|
2218
2221
|
return layers[layerId];
|
|
2219
2222
|
});
|
|
2220
|
-
});
|
|
2223
|
+
}, selectorMemoizationOptions);
|
|
2221
2224
|
/**
|
|
2222
2225
|
* Gets and array of overLayers ids for a map
|
|
2223
2226
|
*
|
|
@@ -2243,7 +2246,7 @@ var getMapOverLayers = createSelector(getMapOverLayersIds, getLayersById, functi
|
|
|
2243
2246
|
return layerIds.map(function (layerId) {
|
|
2244
2247
|
return layers[layerId];
|
|
2245
2248
|
});
|
|
2246
|
-
});
|
|
2249
|
+
}, selectorMemoizationOptions);
|
|
2247
2250
|
/**
|
|
2248
2251
|
* Gets map dimensions
|
|
2249
2252
|
*
|
|
@@ -3964,6 +3967,7 @@ var reducer$4 = function reducer() {
|
|
|
3964
3967
|
linked = _action$payload2.linked;
|
|
3965
3968
|
|
|
3966
3969
|
if (!draft.groups.byId[groupId]) {
|
|
3970
|
+
console.warn("SYNCGROUPS_ADD_TARGET: Group ".concat(groupId, " does not exist."));
|
|
3967
3971
|
return;
|
|
3968
3972
|
}
|
|
3969
3973
|
|
|
@@ -4566,23 +4570,18 @@ var setServiceMetadata = function setServiceMetadata(wmLayer, mapId, webMapJSIns
|
|
|
4566
4570
|
layerDimensions: {
|
|
4567
4571
|
origin: origin,
|
|
4568
4572
|
layerId: wmLayer.id,
|
|
4569
|
-
dimensions: wmLayer.dimensions.map(function (
|
|
4570
|
-
var name =
|
|
4571
|
-
units =
|
|
4572
|
-
|
|
4573
|
-
dimMinValue = _ref2.dimMinValue,
|
|
4574
|
-
dimMaxValue = _ref2.dimMaxValue,
|
|
4575
|
-
dimTimeInterval = _ref2.dimTimeInterval,
|
|
4576
|
-
values = _ref2.values,
|
|
4577
|
-
synced = _ref2.synced;
|
|
4573
|
+
dimensions: wmLayer.dimensions.map(function (dim) {
|
|
4574
|
+
var name = dim.name,
|
|
4575
|
+
units = dim.units,
|
|
4576
|
+
synced = dim.synced;
|
|
4578
4577
|
return {
|
|
4579
4578
|
name: name,
|
|
4580
4579
|
units: units,
|
|
4581
|
-
currentValue:
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
timeInterval:
|
|
4585
|
-
values:
|
|
4580
|
+
currentValue: dim.getValue(),
|
|
4581
|
+
minValue: dim.getFirstValue(),
|
|
4582
|
+
maxValue: dim.getLastValue(),
|
|
4583
|
+
timeInterval: dim.getDimInterval(),
|
|
4584
|
+
values: dim.getValues(),
|
|
4586
4585
|
synced: synced
|
|
4587
4586
|
};
|
|
4588
4587
|
})
|
|
@@ -4599,7 +4598,7 @@ var setServiceMetadata = function setServiceMetadata(wmLayer, mapId, webMapJSIns
|
|
|
4599
4598
|
|
|
4600
4599
|
var _marked$4 = /*#__PURE__*/regeneratorRuntime.mark(setTimeSaga),
|
|
4601
4600
|
_marked2$4 = /*#__PURE__*/regeneratorRuntime.mark(setBBoxSaga),
|
|
4602
|
-
_marked3$
|
|
4601
|
+
_marked3$3 = /*#__PURE__*/regeneratorRuntime.mark(layerActionsSaga),
|
|
4603
4602
|
_marked4$2 = /*#__PURE__*/regeneratorRuntime.mark(addLayerActionsSaga),
|
|
4604
4603
|
_marked5$1 = /*#__PURE__*/regeneratorRuntime.mark(deleteLayerActionsSaga),
|
|
4605
4604
|
_marked6$1 = /*#__PURE__*/regeneratorRuntime.mark(moveLayerActionsSaga),
|
|
@@ -4709,7 +4708,7 @@ function layerActionsSaga(_ref3) {
|
|
|
4709
4708
|
return _context3.stop();
|
|
4710
4709
|
}
|
|
4711
4710
|
}
|
|
4712
|
-
}, _marked3$
|
|
4711
|
+
}, _marked3$3);
|
|
4713
4712
|
}
|
|
4714
4713
|
function addLayerActionsSaga(_ref4) {
|
|
4715
4714
|
var payload, type, targets;
|
|
@@ -4949,7 +4948,7 @@ function rootSaga$4() {
|
|
|
4949
4948
|
|
|
4950
4949
|
var _marked$3 = /*#__PURE__*/regeneratorRuntime.mark(updateSourceValueWhenLinkingComponentToGroupSaga),
|
|
4951
4950
|
_marked2$3 = /*#__PURE__*/regeneratorRuntime.mark(addGroupTargetSaga),
|
|
4952
|
-
_marked3$
|
|
4951
|
+
_marked3$2 = /*#__PURE__*/regeneratorRuntime.mark(linkGroupTargetSaga),
|
|
4953
4952
|
_marked4$1 = /*#__PURE__*/regeneratorRuntime.mark(rootSaga$3);
|
|
4954
4953
|
function updateSourceValueWhenLinkingComponentToGroupSaga(groupId, targetToUpdate) {
|
|
4955
4954
|
var group;
|
|
@@ -5065,7 +5064,7 @@ function linkGroupTargetSaga(_ref2) {
|
|
|
5065
5064
|
return _context3.stop();
|
|
5066
5065
|
}
|
|
5067
5066
|
}
|
|
5068
|
-
}, _marked3$
|
|
5067
|
+
}, _marked3$2);
|
|
5069
5068
|
}
|
|
5070
5069
|
|
|
5071
5070
|
function rootSaga$3() {
|
|
@@ -5112,7 +5111,7 @@ var synchronizationGroupConfig = {
|
|
|
5112
5111
|
sagas: [rootSaga$4, rootSaga$3]
|
|
5113
5112
|
};
|
|
5114
5113
|
|
|
5115
|
-
var useStyles$
|
|
5114
|
+
var useStyles$I = makeStyles(function (theme) {
|
|
5116
5115
|
return {
|
|
5117
5116
|
select: {
|
|
5118
5117
|
'& ul': {
|
|
@@ -5170,7 +5169,7 @@ var TooltipSelect = function TooltipSelect(_a) {
|
|
|
5170
5169
|
tooltipOpen = _React$useState4[0],
|
|
5171
5170
|
setTooltipOpen = _React$useState4[1];
|
|
5172
5171
|
|
|
5173
|
-
var classes = useStyles$
|
|
5172
|
+
var classes = useStyles$I();
|
|
5174
5173
|
|
|
5175
5174
|
var preventDefault = function preventDefault(event) {
|
|
5176
5175
|
event.preventDefault();
|
|
@@ -5516,7 +5515,7 @@ var getDialogSource = createSelector(getDialogDetailsByType, function (details)
|
|
|
5516
5515
|
|
|
5517
5516
|
var _marked$2 = /*#__PURE__*/regeneratorRuntime.mark(registerMapUISaga),
|
|
5518
5517
|
_marked2$2 = /*#__PURE__*/regeneratorRuntime.mark(unregisterUIMapSaga),
|
|
5519
|
-
_marked3$
|
|
5518
|
+
_marked3$1 = /*#__PURE__*/regeneratorRuntime.mark(rootSaga$2);
|
|
5520
5519
|
function registerMapUISaga() {
|
|
5521
5520
|
var fields, source;
|
|
5522
5521
|
return regeneratorRuntime.wrap(function registerMapUISaga$(_context) {
|
|
@@ -5623,7 +5622,7 @@ function rootSaga$2() {
|
|
|
5623
5622
|
return _context3.stop();
|
|
5624
5623
|
}
|
|
5625
5624
|
}
|
|
5626
|
-
}, _marked3$
|
|
5625
|
+
}, _marked3$1);
|
|
5627
5626
|
}
|
|
5628
5627
|
|
|
5629
5628
|
/* *
|
|
@@ -6365,7 +6364,7 @@ var reducer$1 = function reducer() {
|
|
|
6365
6364
|
|
|
6366
6365
|
var _marked$1 = /*#__PURE__*/regeneratorRuntime.mark(startAnimationSaga),
|
|
6367
6366
|
_marked2$1 = /*#__PURE__*/regeneratorRuntime.mark(stopAnimationSaga),
|
|
6368
|
-
_marked3
|
|
6367
|
+
_marked3 = /*#__PURE__*/regeneratorRuntime.mark(deleteLayerSaga),
|
|
6369
6368
|
_marked4 = /*#__PURE__*/regeneratorRuntime.mark(updateAnimation),
|
|
6370
6369
|
_marked5 = /*#__PURE__*/regeneratorRuntime.mark(setLayerDimensionsSaga),
|
|
6371
6370
|
_marked6 = /*#__PURE__*/regeneratorRuntime.mark(toggleAutoUpdateSaga),
|
|
@@ -6468,7 +6467,7 @@ function deleteLayerSaga(_ref3) {
|
|
|
6468
6467
|
return _context3.stop();
|
|
6469
6468
|
}
|
|
6470
6469
|
}
|
|
6471
|
-
}, _marked3
|
|
6470
|
+
}, _marked3);
|
|
6472
6471
|
}
|
|
6473
6472
|
function updateAnimation(mapId, maxValue) {
|
|
6474
6473
|
var animationStart, animationStartUnix, animationEnd, animationEndUnix, t, deltaT, start, end, isAnimating$1, timeStep;
|
|
@@ -6774,9 +6773,11 @@ var moduleConfig = {
|
|
|
6774
6773
|
var initialState = {
|
|
6775
6774
|
filters: {
|
|
6776
6775
|
searchFilter: '',
|
|
6777
|
-
activeServices:
|
|
6778
|
-
|
|
6779
|
-
|
|
6776
|
+
activeServices: {
|
|
6777
|
+
byId: {},
|
|
6778
|
+
allIds: []
|
|
6779
|
+
},
|
|
6780
|
+
keywords: []
|
|
6780
6781
|
}
|
|
6781
6782
|
};
|
|
6782
6783
|
var reducer = function reducer() {
|
|
@@ -6792,52 +6793,14 @@ var reducer = function reducer() {
|
|
|
6792
6793
|
});
|
|
6793
6794
|
}
|
|
6794
6795
|
|
|
6795
|
-
case '
|
|
6796
|
-
{
|
|
6797
|
-
var activeServices = action.payload.activeServices;
|
|
6798
|
-
return produce(state, function (draft) {
|
|
6799
|
-
activeServices.forEach(function (service) {
|
|
6800
|
-
if (draft.filters.activeServices.filter(function (s) {
|
|
6801
|
-
return s.id === service;
|
|
6802
|
-
}).length === 0) draft.filters.activeServices.push({
|
|
6803
|
-
id: service,
|
|
6804
|
-
enabled: true
|
|
6805
|
-
});
|
|
6806
|
-
});
|
|
6807
|
-
});
|
|
6808
|
-
}
|
|
6809
|
-
|
|
6810
|
-
case 'LAYER_SELECT_ENABLE_ACTIVE_SERVICE':
|
|
6811
|
-
{
|
|
6812
|
-
var service = action.payload.service;
|
|
6813
|
-
return produce(state, function (draft) {
|
|
6814
|
-
var index = draft.filters.activeServices.findIndex(function (s) {
|
|
6815
|
-
return s.id === service;
|
|
6816
|
-
});
|
|
6817
|
-
draft.filters.activeServices[index].enabled = true;
|
|
6818
|
-
});
|
|
6819
|
-
}
|
|
6820
|
-
|
|
6821
|
-
case 'LAYER_SELECT_DISABLE_ACTIVE_SERVICE':
|
|
6822
|
-
{
|
|
6823
|
-
var _service = action.payload.service;
|
|
6824
|
-
return produce(state, function (draft) {
|
|
6825
|
-
var index = draft.filters.activeServices.findIndex(function (s) {
|
|
6826
|
-
return s.id === _service;
|
|
6827
|
-
});
|
|
6828
|
-
draft.filters.activeServices[index].enabled = false;
|
|
6829
|
-
});
|
|
6830
|
-
}
|
|
6831
|
-
|
|
6832
|
-
case 'LAYER_SELECT_ADD_NEW_KEYWORDS':
|
|
6796
|
+
case 'LAYER_SELECT_ADD_KEYWORDS_AND_ACTIVE_SERVICES':
|
|
6833
6797
|
{
|
|
6798
|
+
var _action$payload = action.payload,
|
|
6799
|
+
serviceUrl = _action$payload.serviceUrl,
|
|
6800
|
+
keywords = _action$payload.keywords;
|
|
6834
6801
|
return produce(state, function (draft) {
|
|
6835
|
-
|
|
6836
|
-
|
|
6837
|
-
keywords = _action$payload.keywords; // If store does not contain keywords from a service, add keywords and service Name
|
|
6838
|
-
|
|
6839
|
-
if (!draft.filters.addedServices.includes(serviceName)) {
|
|
6840
|
-
draft.filters.addedServices.push(serviceName);
|
|
6802
|
+
if (!draft.filters.activeServices.byId[serviceUrl]) {
|
|
6803
|
+
draft.filters.activeServices.byId[serviceUrl] = {};
|
|
6841
6804
|
|
|
6842
6805
|
var _iterator = _createForOfIteratorHelper(keywords),
|
|
6843
6806
|
_step;
|
|
@@ -6845,13 +6808,13 @@ var reducer = function reducer() {
|
|
|
6845
6808
|
try {
|
|
6846
6809
|
var _loop = function _loop() {
|
|
6847
6810
|
var keyword = _step.value;
|
|
6848
|
-
var
|
|
6811
|
+
var foundKeyword = draft.filters.keywords.find(function (object) {
|
|
6849
6812
|
return object.id === keyword;
|
|
6850
6813
|
});
|
|
6851
6814
|
|
|
6852
|
-
if (
|
|
6853
|
-
|
|
6854
|
-
|
|
6815
|
+
if (foundKeyword) {
|
|
6816
|
+
foundKeyword.amount += 1;
|
|
6817
|
+
foundKeyword.amountVisible += 1;
|
|
6855
6818
|
} else {
|
|
6856
6819
|
var newKeywordObject = {
|
|
6857
6820
|
id: keyword,
|
|
@@ -6872,6 +6835,87 @@ var reducer = function reducer() {
|
|
|
6872
6835
|
_iterator.f();
|
|
6873
6836
|
}
|
|
6874
6837
|
}
|
|
6838
|
+
|
|
6839
|
+
draft.filters.activeServices.byId[serviceUrl].id = serviceUrl;
|
|
6840
|
+
draft.filters.activeServices.byId[serviceUrl].enabled = true;
|
|
6841
|
+
draft.filters.activeServices.byId[serviceUrl].keywordsPerService = keywords;
|
|
6842
|
+
if (!draft.filters.activeServices.allIds.includes(serviceUrl)) draft.filters.activeServices.allIds.push(serviceUrl);
|
|
6843
|
+
});
|
|
6844
|
+
}
|
|
6845
|
+
|
|
6846
|
+
case 'LAYER_SELECT_ENABLE_ACTIVE_SERVICE':
|
|
6847
|
+
{
|
|
6848
|
+
var _action$payload2 = action.payload,
|
|
6849
|
+
_serviceUrl = _action$payload2.serviceUrl,
|
|
6850
|
+
_keywords = _action$payload2.keywords;
|
|
6851
|
+
return produce(state, function (draft) {
|
|
6852
|
+
draft.filters.activeServices.byId[_serviceUrl].enabled = true;
|
|
6853
|
+
|
|
6854
|
+
var _iterator2 = _createForOfIteratorHelper(_keywords),
|
|
6855
|
+
_step2;
|
|
6856
|
+
|
|
6857
|
+
try {
|
|
6858
|
+
var _loop2 = function _loop2() {
|
|
6859
|
+
var keyword = _step2.value;
|
|
6860
|
+
var foundObject = draft.filters.keywords.find(function (object) {
|
|
6861
|
+
return object.id === keyword;
|
|
6862
|
+
});
|
|
6863
|
+
|
|
6864
|
+
if (foundObject) {
|
|
6865
|
+
foundObject.amountVisible += 1;
|
|
6866
|
+
}
|
|
6867
|
+
};
|
|
6868
|
+
|
|
6869
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
6870
|
+
_loop2();
|
|
6871
|
+
}
|
|
6872
|
+
} catch (err) {
|
|
6873
|
+
_iterator2.e(err);
|
|
6874
|
+
} finally {
|
|
6875
|
+
_iterator2.f();
|
|
6876
|
+
}
|
|
6877
|
+
});
|
|
6878
|
+
}
|
|
6879
|
+
|
|
6880
|
+
case 'LAYER_SELECT_DISABLE_ACTIVE_SERVICE':
|
|
6881
|
+
{
|
|
6882
|
+
var _action$payload3 = action.payload,
|
|
6883
|
+
_serviceUrl2 = _action$payload3.serviceUrl,
|
|
6884
|
+
_keywords2 = _action$payload3.keywords;
|
|
6885
|
+
return produce(state, function (draft) {
|
|
6886
|
+
draft.filters.activeServices.byId[_serviceUrl2].enabled = false;
|
|
6887
|
+
|
|
6888
|
+
var _iterator3 = _createForOfIteratorHelper(_keywords2),
|
|
6889
|
+
_step3;
|
|
6890
|
+
|
|
6891
|
+
try {
|
|
6892
|
+
var _loop3 = function _loop3() {
|
|
6893
|
+
var keyword = _step3.value;
|
|
6894
|
+
var foundObject = draft.filters.keywords.find(function (object) {
|
|
6895
|
+
return object.id === keyword;
|
|
6896
|
+
});
|
|
6897
|
+
|
|
6898
|
+
if (foundObject && foundObject.amountVisible > 0) {
|
|
6899
|
+
foundObject.amountVisible -= 1;
|
|
6900
|
+
}
|
|
6901
|
+
};
|
|
6902
|
+
|
|
6903
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
6904
|
+
_loop3();
|
|
6905
|
+
}
|
|
6906
|
+
} catch (err) {
|
|
6907
|
+
_iterator3.e(err);
|
|
6908
|
+
} finally {
|
|
6909
|
+
_iterator3.f();
|
|
6910
|
+
}
|
|
6911
|
+
});
|
|
6912
|
+
}
|
|
6913
|
+
|
|
6914
|
+
case 'LAYER_SELECT_UPDATE_KEYWORDS':
|
|
6915
|
+
{
|
|
6916
|
+
return produce(state, function (draft) {
|
|
6917
|
+
var keywords = action.payload.keywords;
|
|
6918
|
+
draft.filters.keywords = keywords;
|
|
6875
6919
|
});
|
|
6876
6920
|
}
|
|
6877
6921
|
|
|
@@ -6897,10 +6941,10 @@ var reducer = function reducer() {
|
|
|
6897
6941
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
6898
6942
|
* */
|
|
6899
6943
|
var LAYER_SELECT_SET_SEARCH_FILTER = 'LAYER_SELECT_SET_SEARCH_FILTER';
|
|
6900
|
-
var LAYER_SELECT_SET_ACTIVE_SERVICES = 'LAYER_SELECT_SET_ACTIVE_SERVICES';
|
|
6901
6944
|
var LAYER_SELECT_DISABLE_ACTIVE_SERVICE = 'LAYER_SELECT_DISABLE_ACTIVE_SERVICE';
|
|
6902
6945
|
var LAYER_SELECT_ENABLE_ACTIVE_SERVICE = 'LAYER_SELECT_ENABLE_ACTIVE_SERVICE';
|
|
6903
|
-
var
|
|
6946
|
+
var LAYER_SELECT_ADD_KEYWORDS_AND_ACTIVE_SERVICES = 'LAYER_SELECT_ADD_KEYWORDS_AND_ACTIVE_SERVICES';
|
|
6947
|
+
var LAYER_SELECT_UPDATE_KEYWORDS = 'LAYER_SELECT_UPDATE_KEYWORDS';
|
|
6904
6948
|
|
|
6905
6949
|
/* *
|
|
6906
6950
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -6931,19 +6975,6 @@ var setSearchFilter = function setSearchFilter(payload) {
|
|
|
6931
6975
|
payload: payload
|
|
6932
6976
|
};
|
|
6933
6977
|
};
|
|
6934
|
-
/**
|
|
6935
|
-
* Sets the given array of string as active services
|
|
6936
|
-
*
|
|
6937
|
-
* Example: setActiveServices({ activeServices: ['service-1', 'service-2'] })
|
|
6938
|
-
* @param {string} payload { activeServices: string[] }
|
|
6939
|
-
*/
|
|
6940
|
-
|
|
6941
|
-
var setActiveServices = function setActiveServices(payload) {
|
|
6942
|
-
return {
|
|
6943
|
-
type: LAYER_SELECT_SET_ACTIVE_SERVICES,
|
|
6944
|
-
payload: payload
|
|
6945
|
-
};
|
|
6946
|
-
};
|
|
6947
6978
|
/**
|
|
6948
6979
|
* Activates given service in the activeServices array
|
|
6949
6980
|
*
|
|
@@ -6973,96 +7004,64 @@ var disableActiveService = function disableActiveService(payload) {
|
|
|
6973
7004
|
/*
|
|
6974
7005
|
* Sets the given keywords to Layer Select store
|
|
6975
7006
|
*
|
|
6976
|
-
* Example:
|
|
6977
|
-
* @param {string[]} payload { keywords: string[] }
|
|
7007
|
+
* Example: addKeywordsAndActiveServices({ serviceUrl: 'https://service.wms', keywords: ['keyword1', 'keyword2'] })
|
|
7008
|
+
* @param {string, string[]} payload {serviceUrl: string keywords: string[] }
|
|
6978
7009
|
*/
|
|
6979
7010
|
|
|
6980
|
-
var
|
|
7011
|
+
var addKeywordsAndActiveServices = function addKeywordsAndActiveServices(payload) {
|
|
7012
|
+
return {
|
|
7013
|
+
type: LAYER_SELECT_ADD_KEYWORDS_AND_ACTIVE_SERVICES,
|
|
7014
|
+
payload: payload
|
|
7015
|
+
};
|
|
7016
|
+
};
|
|
7017
|
+
var updateKeywords = function updateKeywords(payload) {
|
|
6981
7018
|
return {
|
|
6982
|
-
type:
|
|
7019
|
+
type: LAYER_SELECT_UPDATE_KEYWORDS,
|
|
6983
7020
|
payload: payload
|
|
6984
7021
|
};
|
|
6985
7022
|
};
|
|
6986
7023
|
|
|
6987
|
-
var _marked = /*#__PURE__*/regeneratorRuntime.mark(
|
|
6988
|
-
_marked2 = /*#__PURE__*/regeneratorRuntime.mark(
|
|
6989
|
-
|
|
6990
|
-
|
|
6991
|
-
|
|
6992
|
-
return regeneratorRuntime.wrap(function newServiceAddedSagaUpdateKeywords$(_context) {
|
|
7024
|
+
var _marked = /*#__PURE__*/regeneratorRuntime.mark(newServiceAddedSaga),
|
|
7025
|
+
_marked2 = /*#__PURE__*/regeneratorRuntime.mark(rootSaga);
|
|
7026
|
+
function newServiceAddedSaga(capturedAction) {
|
|
7027
|
+
var addedService, service, keywords;
|
|
7028
|
+
return regeneratorRuntime.wrap(function newServiceAddedSaga$(_context) {
|
|
6993
7029
|
while (1) {
|
|
6994
7030
|
switch (_context.prev = _context.next) {
|
|
6995
7031
|
case 0:
|
|
6996
7032
|
addedService = capturedAction.payload;
|
|
6997
|
-
|
|
7033
|
+
service = addedService.service;
|
|
6998
7034
|
keywords = addedService.layers.reduce(function (keywordAccumulator, layer) {
|
|
6999
|
-
|
|
7000
|
-
return keywordAccumulator;
|
|
7001
|
-
}
|
|
7002
|
-
|
|
7003
|
-
return keywordAccumulator.concat(layer.keywords);
|
|
7035
|
+
return keywordAccumulator.concat(layer.path, layer.keywords);
|
|
7004
7036
|
}, []);
|
|
7005
|
-
|
|
7006
|
-
|
|
7007
|
-
|
|
7008
|
-
break;
|
|
7009
|
-
}
|
|
7010
|
-
|
|
7011
|
-
_context.next = 6;
|
|
7012
|
-
return put(addNewKeywords({
|
|
7013
|
-
serviceName: serviceName,
|
|
7037
|
+
_context.next = 5;
|
|
7038
|
+
return put(addKeywordsAndActiveServices({
|
|
7039
|
+
serviceUrl: service,
|
|
7014
7040
|
keywords: keywords
|
|
7015
7041
|
}));
|
|
7016
7042
|
|
|
7017
|
-
case
|
|
7043
|
+
case 5:
|
|
7018
7044
|
case "end":
|
|
7019
7045
|
return _context.stop();
|
|
7020
7046
|
}
|
|
7021
7047
|
}
|
|
7022
7048
|
}, _marked);
|
|
7023
7049
|
}
|
|
7024
|
-
function
|
|
7025
|
-
|
|
7026
|
-
return regeneratorRuntime.wrap(function newServiceAddedSagaUpdateActiveServices$(_context2) {
|
|
7050
|
+
function rootSaga() {
|
|
7051
|
+
return regeneratorRuntime.wrap(function rootSaga$(_context2) {
|
|
7027
7052
|
while (1) {
|
|
7028
7053
|
switch (_context2.prev = _context2.next) {
|
|
7029
7054
|
case 0:
|
|
7030
7055
|
_context2.next = 2;
|
|
7031
|
-
return
|
|
7056
|
+
return takeEvery(MAP_SERVICES_SET_LAYERS, newServiceAddedSaga);
|
|
7032
7057
|
|
|
7033
7058
|
case 2:
|
|
7034
|
-
services = _context2.sent;
|
|
7035
|
-
_context2.next = 5;
|
|
7036
|
-
return put(setActiveServices({
|
|
7037
|
-
activeServices: services
|
|
7038
|
-
}));
|
|
7039
|
-
|
|
7040
|
-
case 5:
|
|
7041
7059
|
case "end":
|
|
7042
7060
|
return _context2.stop();
|
|
7043
7061
|
}
|
|
7044
7062
|
}
|
|
7045
7063
|
}, _marked2);
|
|
7046
7064
|
}
|
|
7047
|
-
function rootSaga() {
|
|
7048
|
-
return regeneratorRuntime.wrap(function rootSaga$(_context3) {
|
|
7049
|
-
while (1) {
|
|
7050
|
-
switch (_context3.prev = _context3.next) {
|
|
7051
|
-
case 0:
|
|
7052
|
-
_context3.next = 2;
|
|
7053
|
-
return takeEvery(MAP_SERVICES_SET_LAYERS, newServiceAddedSagaUpdateKeywords);
|
|
7054
|
-
|
|
7055
|
-
case 2:
|
|
7056
|
-
_context3.next = 4;
|
|
7057
|
-
return takeLatest(MAP_SERVICES_SET_LAYERS, newServiceAddedSagaUpdateActiveServices);
|
|
7058
|
-
|
|
7059
|
-
case 4:
|
|
7060
|
-
case "end":
|
|
7061
|
-
return _context3.stop();
|
|
7062
|
-
}
|
|
7063
|
-
}
|
|
7064
|
-
}, _marked3);
|
|
7065
|
-
}
|
|
7066
7065
|
|
|
7067
7066
|
/* *
|
|
7068
7067
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -7132,7 +7131,7 @@ var recurseNodes = function recurseNodes(nodesToRecur) {
|
|
|
7132
7131
|
leaf: nodesToRecur.leaf,
|
|
7133
7132
|
name: nodesToRecur.name,
|
|
7134
7133
|
title: nodesToRecur.text,
|
|
7135
|
-
path: nodesToRecur.path
|
|
7134
|
+
path: nodesToRecur.path || [],
|
|
7136
7135
|
children: [],
|
|
7137
7136
|
keywords: nodesToRecur.keywords || [],
|
|
7138
7137
|
"abstract": nodesToRecur["abstract"] || ''
|
|
@@ -7165,17 +7164,17 @@ var getLayersFromService = function getLayersFromService(serviceUrl) {
|
|
|
7165
7164
|
});
|
|
7166
7165
|
};
|
|
7167
7166
|
/**
|
|
7168
|
-
* Returns a promise with
|
|
7167
|
+
* Returns a promise with an array of flattened layerobjects from the WMS GetCapabilities document.
|
|
7169
7168
|
* @param serviceUrl The URL of the WMS service
|
|
7170
7169
|
* @param {boolean} forceReload **optional** forceReload: boolean, true will force the layers to be reloaded from the service, defaults to false
|
|
7171
7170
|
*/
|
|
7172
7171
|
|
|
7173
|
-
var
|
|
7172
|
+
var getLayersFlattenedFromService = function getLayersFlattenedFromService(serviceUrl) {
|
|
7174
7173
|
var forceReload = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
7175
7174
|
return new Promise(function (resolve, reject) {
|
|
7176
7175
|
var serviceObject = WMGetServiceFromStore(serviceUrl);
|
|
7177
|
-
serviceObject.
|
|
7178
|
-
resolve(
|
|
7176
|
+
serviceObject.getLayerObjectsFlat(function (layers) {
|
|
7177
|
+
resolve(layers);
|
|
7179
7178
|
}, function (error) {
|
|
7180
7179
|
reject(new Error(error));
|
|
7181
7180
|
}, forceReload);
|
|
@@ -8086,7 +8085,7 @@ var defaultConfigurations = /*#__PURE__*/Object.freeze({
|
|
|
8086
8085
|
preloadedDefaultMapServices: preloadedDefaultMapServices
|
|
8087
8086
|
});
|
|
8088
8087
|
|
|
8089
|
-
var useStyles$
|
|
8088
|
+
var useStyles$H = makeStyles({
|
|
8090
8089
|
buttonDiv: {
|
|
8091
8090
|
position: 'relative'
|
|
8092
8091
|
},
|
|
@@ -8122,7 +8121,7 @@ var AddLayersPopup = function AddLayersPopup(_ref) {
|
|
|
8122
8121
|
handleClose = _ref.handleClose,
|
|
8123
8122
|
_ref$layerType = _ref.layerType,
|
|
8124
8123
|
layerType = _ref$layerType === void 0 ? LayerType.mapLayer : _ref$layerType;
|
|
8125
|
-
var classes = useStyles$
|
|
8124
|
+
var classes = useStyles$H();
|
|
8126
8125
|
|
|
8127
8126
|
var _React$useState = React.useState(''),
|
|
8128
8127
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -8276,7 +8275,7 @@ var AddLayersPopup = function AddLayersPopup(_ref) {
|
|
|
8276
8275
|
}, "Close")));
|
|
8277
8276
|
};
|
|
8278
8277
|
|
|
8279
|
-
var useStyles$
|
|
8278
|
+
var useStyles$G = makeStyles(function (theme) {
|
|
8280
8279
|
return {
|
|
8281
8280
|
buttonDiv: {
|
|
8282
8281
|
position: 'relative'
|
|
@@ -8311,7 +8310,7 @@ var AddLayersButton = function AddLayersButton(_ref) {
|
|
|
8311
8310
|
_ref$shouldFocus = _ref.shouldFocus,
|
|
8312
8311
|
shouldFocus = _ref$shouldFocus === void 0 ? false : _ref$shouldFocus;
|
|
8313
8312
|
var ref = React.useRef(null);
|
|
8314
|
-
var classes = useStyles$
|
|
8313
|
+
var classes = useStyles$G();
|
|
8315
8314
|
|
|
8316
8315
|
var _React$useState = React.useState(false),
|
|
8317
8316
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -8437,7 +8436,7 @@ var widthToWidthClass = function widthToWidthClass(w) {
|
|
|
8437
8436
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8438
8437
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
8439
8438
|
* */
|
|
8440
|
-
var useStyles$
|
|
8439
|
+
var useStyles$F = makeStyles(function (theme) {
|
|
8441
8440
|
return {
|
|
8442
8441
|
button: {
|
|
8443
8442
|
width: '24px',
|
|
@@ -8454,7 +8453,7 @@ var LayerSelectButtonConnect = function LayerSelectButtonConnect(_ref) {
|
|
|
8454
8453
|
_ref$source = _ref.source,
|
|
8455
8454
|
source = _ref$source === void 0 ? 'app' : _ref$source;
|
|
8456
8455
|
var dispatch = useDispatch();
|
|
8457
|
-
var classes = useStyles$
|
|
8456
|
+
var classes = useStyles$F();
|
|
8458
8457
|
var currentActiveMapId = useSelector(function (store) {
|
|
8459
8458
|
return getDialogMapId(store, 'layerSelect');
|
|
8460
8459
|
});
|
|
@@ -8497,7 +8496,7 @@ var LayerSelectButtonConnect = function LayerSelectButtonConnect(_ref) {
|
|
|
8497
8496
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8498
8497
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
8499
8498
|
* */
|
|
8500
|
-
var useStyles$
|
|
8499
|
+
var useStyles$E = makeStyles({
|
|
8501
8500
|
row: {
|
|
8502
8501
|
height: '32px'
|
|
8503
8502
|
},
|
|
@@ -8521,7 +8520,7 @@ var DescriptionRow = function DescriptionRow(_ref) {
|
|
|
8521
8520
|
layerManagerWidth = _ref.layerManagerWidth,
|
|
8522
8521
|
_ref$layerSelect = _ref.layerSelect,
|
|
8523
8522
|
layerSelect = _ref$layerSelect === void 0 ? false : _ref$layerSelect;
|
|
8524
|
-
var classes = useStyles$
|
|
8523
|
+
var classes = useStyles$E();
|
|
8525
8524
|
var columnSizes = layerManagerWidth === LayerManagerWidth.sm ? LayerManagerColumnsSmall() : LayerManagerColumnsLarge();
|
|
8526
8525
|
return /*#__PURE__*/React.createElement(Grid, {
|
|
8527
8526
|
container: true,
|
|
@@ -8779,7 +8778,7 @@ var DimensionSelect = function DimensionSelect(_ref) {
|
|
|
8779
8778
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8780
8779
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
8781
8780
|
* */
|
|
8782
|
-
var useStyles$
|
|
8781
|
+
var useStyles$D = makeStyles(function (theme) {
|
|
8783
8782
|
return createStyles({
|
|
8784
8783
|
button: {
|
|
8785
8784
|
height: 28,
|
|
@@ -8841,7 +8840,7 @@ var LayerManagerButton = function LayerManagerButton(_a) {
|
|
|
8841
8840
|
testId = _a.testId,
|
|
8842
8841
|
props = __rest(_a, ["tooltipTitle", "onClick", "isActive", "isEnabled", "icon", "testId"]);
|
|
8843
8842
|
|
|
8844
|
-
var classes = useStyles$
|
|
8843
|
+
var classes = useStyles$D({
|
|
8845
8844
|
isActive: isActive,
|
|
8846
8845
|
isEnabled: isEnabled
|
|
8847
8846
|
});
|
|
@@ -8881,7 +8880,7 @@ var LayerManagerButton = function LayerManagerButton(_a) {
|
|
|
8881
8880
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8882
8881
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
8883
8882
|
* */
|
|
8884
|
-
var useStyles$
|
|
8883
|
+
var useStyles$C = makeStyles(function (theme) {
|
|
8885
8884
|
return createStyles({
|
|
8886
8885
|
checkbox: {
|
|
8887
8886
|
color: 'inherit',
|
|
@@ -8904,7 +8903,7 @@ var EnableLayer = function EnableLayer(_ref) {
|
|
|
8904
8903
|
var isEnabled = _ref.isEnabled,
|
|
8905
8904
|
title = _ref.title,
|
|
8906
8905
|
onChangeEnableLayer = _ref.onChangeEnableLayer;
|
|
8907
|
-
var classes = useStyles$
|
|
8906
|
+
var classes = useStyles$C(isEnabled);
|
|
8908
8907
|
|
|
8909
8908
|
var onClick = function onClick() {
|
|
8910
8909
|
onChangeEnableLayer(!isEnabled);
|
|
@@ -8960,7 +8959,7 @@ var EnableLayer = function EnableLayer(_ref) {
|
|
|
8960
8959
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8961
8960
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
8962
8961
|
* */
|
|
8963
|
-
var useStyles$
|
|
8962
|
+
var useStyles$B = makeStyles(function (theme) {
|
|
8964
8963
|
return createStyles({
|
|
8965
8964
|
dropdownEmpty: {
|
|
8966
8965
|
paddingLeft: 8,
|
|
@@ -8983,7 +8982,7 @@ var RenderLayers = function RenderLayers(_ref) {
|
|
|
8983
8982
|
layers = _ref$layers === void 0 ? [] : _ref$layers,
|
|
8984
8983
|
_ref$isEnabled = _ref.isEnabled,
|
|
8985
8984
|
isEnabled = _ref$isEnabled === void 0 ? true : _ref$isEnabled;
|
|
8986
|
-
var classes = useStyles$
|
|
8985
|
+
var classes = useStyles$B();
|
|
8987
8986
|
var containerClass = useTooltipContainerStyles(isEnabled);
|
|
8988
8987
|
|
|
8989
8988
|
if (!layers || !layers.length) {
|
|
@@ -9040,7 +9039,7 @@ var RenderLayers = function RenderLayers(_ref) {
|
|
|
9040
9039
|
}));
|
|
9041
9040
|
};
|
|
9042
9041
|
|
|
9043
|
-
var useStyles$
|
|
9042
|
+
var useStyles$A = makeStyles(function (theme) {
|
|
9044
9043
|
return {
|
|
9045
9044
|
opacityDiv: {
|
|
9046
9045
|
height: 'calc(100% - 5px)',
|
|
@@ -9101,7 +9100,7 @@ var OpacitySelect = function OpacitySelect(_ref) {
|
|
|
9101
9100
|
onLayerChangeOpacity = _ref.onLayerChangeOpacity,
|
|
9102
9101
|
_ref$isEnabled = _ref.isEnabled,
|
|
9103
9102
|
isEnabled = _ref$isEnabled === void 0 ? true : _ref$isEnabled;
|
|
9104
|
-
var classes = useStyles$
|
|
9103
|
+
var classes = useStyles$A();
|
|
9105
9104
|
var sliderClasses = sliderStyles();
|
|
9106
9105
|
var containerClass = useTooltipContainerStyles(isEnabled);
|
|
9107
9106
|
|
|
@@ -9213,7 +9212,7 @@ var OpacitySelect = function OpacitySelect(_ref) {
|
|
|
9213
9212
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9214
9213
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
9215
9214
|
* */
|
|
9216
|
-
var useStyles$
|
|
9215
|
+
var useStyles$z = makeStyles(function (theme) {
|
|
9217
9216
|
return createStyles({
|
|
9218
9217
|
icon: {
|
|
9219
9218
|
minWidth: 32,
|
|
@@ -9230,7 +9229,7 @@ var MenuItemButton = function MenuItemButton(_ref) {
|
|
|
9230
9229
|
var title = _ref.title,
|
|
9231
9230
|
tooltipTitle = _ref.tooltipTitle,
|
|
9232
9231
|
icon = _ref.icon;
|
|
9233
|
-
var classes = useStyles$
|
|
9232
|
+
var classes = useStyles$z();
|
|
9234
9233
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ListItemIcon, {
|
|
9235
9234
|
className: "".concat(classes.icon, " icon")
|
|
9236
9235
|
}, icon), /*#__PURE__*/React.createElement(Tooltip, {
|
|
@@ -9242,7 +9241,7 @@ var MenuItemButton = function MenuItemButton(_ref) {
|
|
|
9242
9241
|
}, title)));
|
|
9243
9242
|
};
|
|
9244
9243
|
|
|
9245
|
-
var useStyles$
|
|
9244
|
+
var useStyles$y = makeStyles(function (theme) {
|
|
9246
9245
|
return {
|
|
9247
9246
|
menu: {
|
|
9248
9247
|
backgroundColor: theme.palette.geowebColors.background.surface,
|
|
@@ -9260,7 +9259,7 @@ var LayerManagerMenuButton = function LayerManagerMenuButton(_ref) {
|
|
|
9260
9259
|
onLayerDuplicate = _ref.onLayerDuplicate,
|
|
9261
9260
|
_ref$isEnabled = _ref.isEnabled,
|
|
9262
9261
|
isEnabled = _ref$isEnabled === void 0 ? true : _ref$isEnabled;
|
|
9263
|
-
var classes = useStyles$
|
|
9262
|
+
var classes = useStyles$y();
|
|
9264
9263
|
|
|
9265
9264
|
var _React$useState = React.useState(null),
|
|
9266
9265
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -9385,7 +9384,7 @@ var RenderStyles = function RenderStyles(_ref) {
|
|
|
9385
9384
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9386
9385
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
9387
9386
|
* */
|
|
9388
|
-
var useStyles$
|
|
9387
|
+
var useStyles$x = makeStyles(function () {
|
|
9389
9388
|
return createStyles({
|
|
9390
9389
|
icon: {
|
|
9391
9390
|
width: 20,
|
|
@@ -9399,7 +9398,7 @@ var DeleteButton = function DeleteButton(_ref) {
|
|
|
9399
9398
|
onClickDelete = _ref.onClickDelete,
|
|
9400
9399
|
_ref$isEnabled = _ref.isEnabled,
|
|
9401
9400
|
isEnabled = _ref$isEnabled === void 0 ? true : _ref$isEnabled;
|
|
9402
|
-
var classes = useStyles$
|
|
9401
|
+
var classes = useStyles$x();
|
|
9403
9402
|
return /*#__PURE__*/React.createElement(LayerManagerButton, {
|
|
9404
9403
|
tooltipTitle: tooltipTitle,
|
|
9405
9404
|
onClick: onClickDelete,
|
|
@@ -9427,7 +9426,7 @@ var DeleteButton = function DeleteButton(_ref) {
|
|
|
9427
9426
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9428
9427
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
9429
9428
|
* */
|
|
9430
|
-
var useStyles$
|
|
9429
|
+
var useStyles$w = makeStyles(function (theme) {
|
|
9431
9430
|
return createStyles({
|
|
9432
9431
|
icon: {
|
|
9433
9432
|
width: 18,
|
|
@@ -9464,7 +9463,7 @@ var ActivateLayer = function ActivateLayer(_ref2) {
|
|
|
9464
9463
|
isActive = _ref2$isActive === void 0 ? false : _ref2$isActive,
|
|
9465
9464
|
_ref2$isEnabled = _ref2.isEnabled,
|
|
9466
9465
|
isEnabled = _ref2$isEnabled === void 0 ? true : _ref2$isEnabled;
|
|
9467
|
-
var classes = useStyles$
|
|
9466
|
+
var classes = useStyles$w({
|
|
9468
9467
|
isActive: isActive,
|
|
9469
9468
|
isEnabled: isEnabled
|
|
9470
9469
|
});
|
|
@@ -9513,7 +9512,7 @@ var ActivateLayer = function ActivateLayer(_ref2) {
|
|
|
9513
9512
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9514
9513
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
9515
9514
|
* */
|
|
9516
|
-
var useStyles$
|
|
9515
|
+
var useStyles$v = makeStyles(function (theme) {
|
|
9517
9516
|
return createStyles({
|
|
9518
9517
|
row: {
|
|
9519
9518
|
background: function background(isEnabled) {
|
|
@@ -9564,7 +9563,7 @@ var LayerRow = function LayerRow(_ref) {
|
|
|
9564
9563
|
layerActiveLayout = _ref.layerActiveLayout,
|
|
9565
9564
|
layerManagerWidth = _ref.layerManagerWidth,
|
|
9566
9565
|
dragHandle = _ref.dragHandle;
|
|
9567
|
-
var classes = useStyles$
|
|
9566
|
+
var classes = useStyles$v(isEnabled);
|
|
9568
9567
|
var columnSizes = layerManagerWidth === LayerManagerWidth.sm ? LayerManagerColumnsSmall() : LayerManagerColumnsLarge();
|
|
9569
9568
|
|
|
9570
9569
|
var onClickRow = function onClickRow() {
|
|
@@ -10146,7 +10145,7 @@ var LayerRowConnect = function LayerRowConnect(_ref) {
|
|
|
10146
10145
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
10147
10146
|
* */
|
|
10148
10147
|
var TOOLTIP_TITLE = 'Drag a layer up or down';
|
|
10149
|
-
var useStyles$
|
|
10148
|
+
var useStyles$u = makeStyles(function (theme) {
|
|
10150
10149
|
return {
|
|
10151
10150
|
dragHandle: {
|
|
10152
10151
|
cursor: 'grab',
|
|
@@ -10170,7 +10169,7 @@ var DragHandle = function DragHandle(_ref2) {
|
|
|
10170
10169
|
index = _ref2$index === void 0 ? undefined : _ref2$index,
|
|
10171
10170
|
_ref2$hideTooltip = _ref2.hideTooltip,
|
|
10172
10171
|
hideTooltip = _ref2$hideTooltip === void 0 ? false : _ref2$hideTooltip;
|
|
10173
|
-
var classes = useStyles$
|
|
10172
|
+
var classes = useStyles$u({
|
|
10174
10173
|
isDisabled: isDisabled
|
|
10175
10174
|
});
|
|
10176
10175
|
var tooltipTitle = hideTooltip ? '' : TOOLTIP_TITLE;
|
|
@@ -10187,7 +10186,7 @@ var DragHandle = function DragHandle(_ref2) {
|
|
|
10187
10186
|
});
|
|
10188
10187
|
};
|
|
10189
10188
|
|
|
10190
|
-
var useStyles$
|
|
10189
|
+
var useStyles$t = makeStyles(function () {
|
|
10191
10190
|
return {
|
|
10192
10191
|
layerRows: {
|
|
10193
10192
|
width: '100%',
|
|
@@ -10254,7 +10253,7 @@ var LayerContainerRow = function LayerContainerRow(_ref) {
|
|
|
10254
10253
|
|
|
10255
10254
|
var isSorting = activeDragIndex !== null;
|
|
10256
10255
|
var isDragDisabled = layerIds.length === 1;
|
|
10257
|
-
var classes = useStyles$
|
|
10256
|
+
var classes = useStyles$t(isSorting);
|
|
10258
10257
|
return /*#__PURE__*/React.createElement(Grid, {
|
|
10259
10258
|
container: true,
|
|
10260
10259
|
item: true,
|
|
@@ -10464,7 +10463,7 @@ var BaseLayersConnect = function BaseLayersConnect(_ref) {
|
|
|
10464
10463
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
10465
10464
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
10466
10465
|
* */
|
|
10467
|
-
var useStyles$
|
|
10466
|
+
var useStyles$s = makeStyles({
|
|
10468
10467
|
layerRow: {
|
|
10469
10468
|
width: '100%',
|
|
10470
10469
|
height: '36px'
|
|
@@ -10487,7 +10486,7 @@ var BaseLayerRow = function BaseLayerRow(_ref) {
|
|
|
10487
10486
|
layerManagerWidth = _ref.layerManagerWidth,
|
|
10488
10487
|
_ref$tooltip = _ref.tooltip,
|
|
10489
10488
|
tooltip = _ref$tooltip === void 0 ? '' : _ref$tooltip;
|
|
10490
|
-
var classes = useStyles$
|
|
10489
|
+
var classes = useStyles$s();
|
|
10491
10490
|
var columnSizes = layerManagerWidth === LayerManagerWidth.sm ? LayerManagerColumnsSmall() : LayerManagerColumnsLarge();
|
|
10492
10491
|
return /*#__PURE__*/React.createElement(Grid, {
|
|
10493
10492
|
container: true,
|
|
@@ -10516,7 +10515,7 @@ var BaseLayerRow = function BaseLayerRow(_ref) {
|
|
|
10516
10515
|
})));
|
|
10517
10516
|
};
|
|
10518
10517
|
|
|
10519
|
-
var useStyles$
|
|
10518
|
+
var useStyles$r = makeStyles({
|
|
10520
10519
|
layerRowContainer: {
|
|
10521
10520
|
position: 'relative',
|
|
10522
10521
|
width: '100%',
|
|
@@ -10551,7 +10550,7 @@ var LayerManager = function LayerManager(_ref) {
|
|
|
10551
10550
|
layerSelect = _ref$layerSelect === void 0 ? false : _ref$layerSelect,
|
|
10552
10551
|
_ref$showAddLayersToo = _ref.showAddLayersTooltip,
|
|
10553
10552
|
showAddLayersTooltip = _ref$showAddLayersToo === void 0 ? true : _ref$showAddLayersToo;
|
|
10554
|
-
var classes = useStyles$
|
|
10553
|
+
var classes = useStyles$r();
|
|
10555
10554
|
|
|
10556
10555
|
var _React$useState = React.useState(LayerManagerWidth.lg),
|
|
10557
10556
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -10779,7 +10778,7 @@ var getSearchFilter = createSelector(layerSelectStore, function (store) {
|
|
|
10779
10778
|
var getActiveServices = createSelector(layerSelectStore, function (store) {
|
|
10780
10779
|
var _a;
|
|
10781
10780
|
|
|
10782
|
-
return store ? (_a = store === null || store === void 0 ? void 0 : store.filters) === null || _a === void 0 ? void 0 : _a.activeServices :
|
|
10781
|
+
return store ? (_a = store === null || store === void 0 ? void 0 : store.filters) === null || _a === void 0 ? void 0 : _a.activeServices.byId : {};
|
|
10783
10782
|
});
|
|
10784
10783
|
/**
|
|
10785
10784
|
* Returns all ids of enabled services
|
|
@@ -10792,11 +10791,15 @@ var getActiveServices = createSelector(layerSelectStore, function (store) {
|
|
|
10792
10791
|
var getEnabledServiceIds = createSelector(layerSelectStore, function (store) {
|
|
10793
10792
|
var _a, _b;
|
|
10794
10793
|
|
|
10795
|
-
var enabledServices = (_b = (_a = store === null || store === void 0 ? void 0 : store.filters) === null || _a === void 0 ? void 0 : _a.activeServices.filter(function (service) {
|
|
10796
|
-
|
|
10794
|
+
var enabledServices = (_b = (_a = store === null || store === void 0 ? void 0 : store.filters) === null || _a === void 0 ? void 0 : _a.activeServices.allIds.filter(function (service) {
|
|
10795
|
+
var _a;
|
|
10796
|
+
|
|
10797
|
+
return (_a = store === null || store === void 0 ? void 0 : store.filters) === null || _a === void 0 ? void 0 : _a.activeServices.byId[service].enabled;
|
|
10797
10798
|
})) !== null && _b !== void 0 ? _b : [];
|
|
10798
10799
|
return enabledServices.map(function (service) {
|
|
10799
|
-
|
|
10800
|
+
var _a;
|
|
10801
|
+
|
|
10802
|
+
return (_a = store === null || store === void 0 ? void 0 : store.filters) === null || _a === void 0 ? void 0 : _a.activeServices.byId[service].id;
|
|
10800
10803
|
});
|
|
10801
10804
|
});
|
|
10802
10805
|
/**
|
|
@@ -10827,41 +10830,39 @@ var getKeywords = createSelector(layerSelectStore, function (store) {
|
|
|
10827
10830
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
10828
10831
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
10829
10832
|
* */
|
|
10830
|
-
var
|
|
10831
|
-
|
|
10832
|
-
|
|
10833
|
-
|
|
10834
|
-
|
|
10835
|
-
|
|
10836
|
-
|
|
10837
|
-
|
|
10838
|
-
|
|
10839
|
-
|
|
10840
|
-
|
|
10841
|
-
backgroundColor: theme.palette.geowebColors.buttons.primary.fill
|
|
10842
|
-
},
|
|
10843
|
-
'&.MuiButton-outlined': {
|
|
10844
|
-
color: theme.palette.geowebColors.typographyAndIcons.buttonIconTertiaryFlat
|
|
10845
|
-
},
|
|
10846
|
-
color: theme.palette.common.white
|
|
10847
|
-
},
|
|
10848
|
-
cancelButton: {
|
|
10849
|
-
border: "1px solid ".concat(theme.palette.action.disabled),
|
|
10850
|
-
color: theme.palette.text.secondary,
|
|
10851
|
-
'&:hover': {
|
|
10852
|
-
border: "1px solid ".concat(theme.palette.action.disabled)
|
|
10853
|
-
}
|
|
10854
|
-
},
|
|
10855
|
-
container: {
|
|
10833
|
+
var style = {
|
|
10834
|
+
dialogTitle: {
|
|
10835
|
+
display: 'flex',
|
|
10836
|
+
justifyContent: 'space-between',
|
|
10837
|
+
padding: '16px 16px 20px 16px',
|
|
10838
|
+
' span': {
|
|
10839
|
+
fontSize: '2.125rem'
|
|
10840
|
+
}
|
|
10841
|
+
},
|
|
10842
|
+
container: function container(theme) {
|
|
10843
|
+
return {
|
|
10856
10844
|
'& .MuiDialog-paper': {
|
|
10857
10845
|
backgroundColor: theme.palette.geowebColors.cards.cardContainer
|
|
10858
10846
|
}
|
|
10859
|
-
}
|
|
10860
|
-
|
|
10861
|
-
|
|
10862
|
-
|
|
10863
|
-
|
|
10864
|
-
|
|
10847
|
+
};
|
|
10848
|
+
},
|
|
10849
|
+
closeBtn: function closeBtn(theme) {
|
|
10850
|
+
return {
|
|
10851
|
+
color: theme.palette.geowebColors.captions.captionDisabled.color,
|
|
10852
|
+
marginTop: 'auto',
|
|
10853
|
+
marginBottom: 'auto'
|
|
10854
|
+
};
|
|
10855
|
+
},
|
|
10856
|
+
textField: {
|
|
10857
|
+
width: '100%'
|
|
10858
|
+
},
|
|
10859
|
+
dialogContent: {
|
|
10860
|
+
padding: '8px 16px'
|
|
10861
|
+
},
|
|
10862
|
+
footerContent: {
|
|
10863
|
+
padding: '16px'
|
|
10864
|
+
}
|
|
10865
|
+
};
|
|
10865
10866
|
var ADD_HEADING = 'Add a new service';
|
|
10866
10867
|
var EDIT_HEADING = 'Edit service';
|
|
10867
10868
|
var SAVE_HEADING = 'Save service';
|
|
@@ -10887,54 +10888,60 @@ var ServicePopup = function ServicePopup(_ref) {
|
|
|
10887
10888
|
closePopup = _ref.closePopup,
|
|
10888
10889
|
_ref$url = _ref.url,
|
|
10889
10890
|
url = _ref$url === void 0 ? '' : _ref$url;
|
|
10890
|
-
var classes = useStyles$r();
|
|
10891
10891
|
return /*#__PURE__*/React.createElement(Dialog, {
|
|
10892
10892
|
open: isOpen,
|
|
10893
10893
|
hideBackdrop: hideBackdrop,
|
|
10894
10894
|
fullWidth: true,
|
|
10895
10895
|
maxWidth: "xs",
|
|
10896
|
-
|
|
10896
|
+
sx: style.container
|
|
10897
10897
|
}, /*#__PURE__*/React.createElement(DialogTitle, {
|
|
10898
|
-
|
|
10898
|
+
sx: style.dialogTitle
|
|
10899
10899
|
}, /*#__PURE__*/React.createElement(Typography, {
|
|
10900
10900
|
variant: "h5",
|
|
10901
10901
|
component: "span"
|
|
10902
10902
|
}, getTitleForVariant(servicePopupVariant)), /*#__PURE__*/React.createElement(IconButton, {
|
|
10903
10903
|
size: "small",
|
|
10904
10904
|
onClick: closePopup,
|
|
10905
|
-
"data-testid": "ClosePopupButtonCross"
|
|
10905
|
+
"data-testid": "ClosePopupButtonCross",
|
|
10906
|
+
sx: style.closeBtn
|
|
10906
10907
|
}, /*#__PURE__*/React.createElement(Close, null))), /*#__PURE__*/React.createElement(DialogContent, {
|
|
10907
|
-
|
|
10908
|
+
sx: style.dialogContent
|
|
10908
10909
|
}, /*#__PURE__*/React.createElement(TextField, {
|
|
10909
|
-
|
|
10910
|
+
sx: style.textField,
|
|
10910
10911
|
variant: "filled",
|
|
10911
10912
|
label: "Service name"
|
|
10912
10913
|
})), /*#__PURE__*/React.createElement(DialogContent, {
|
|
10913
|
-
|
|
10914
|
+
sx: style.dialogContent
|
|
10914
10915
|
}, /*#__PURE__*/React.createElement(TextField, {
|
|
10915
|
-
|
|
10916
|
+
sx: style.textField,
|
|
10916
10917
|
variant: "filled",
|
|
10917
10918
|
label: "Service URL",
|
|
10918
10919
|
defaultValue: url,
|
|
10919
10920
|
id: "service-url"
|
|
10920
10921
|
})), /*#__PURE__*/React.createElement(DialogContent, {
|
|
10921
|
-
|
|
10922
|
+
sx: style.dialogContent
|
|
10922
10923
|
}, /*#__PURE__*/React.createElement(TextField, {
|
|
10923
|
-
|
|
10924
|
+
sx: style.textField,
|
|
10924
10925
|
variant: "filled",
|
|
10925
10926
|
multiline: true,
|
|
10926
10927
|
rows: 4,
|
|
10927
10928
|
label: "Abstracts",
|
|
10928
10929
|
helperText: "Short description of what this service does"
|
|
10929
|
-
})), /*#__PURE__*/React.createElement(DialogActions,
|
|
10930
|
-
|
|
10931
|
-
|
|
10930
|
+
})), /*#__PURE__*/React.createElement(DialogActions, {
|
|
10931
|
+
sx: style.footerContent
|
|
10932
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
10933
|
+
variant: "tertiary",
|
|
10932
10934
|
onClick: closePopup,
|
|
10933
|
-
"data-testid": "ClosePopupButtonCancel"
|
|
10935
|
+
"data-testid": "ClosePopupButtonCancel",
|
|
10936
|
+
sx: {
|
|
10937
|
+
width: '117px'
|
|
10938
|
+
}
|
|
10934
10939
|
}, "cancel"), /*#__PURE__*/React.createElement(Button, {
|
|
10935
|
-
|
|
10936
|
-
|
|
10937
|
-
|
|
10940
|
+
sx: {
|
|
10941
|
+
width: '117px',
|
|
10942
|
+
marginLeft: '16px!important'
|
|
10943
|
+
},
|
|
10944
|
+
variant: "primary"
|
|
10938
10945
|
}, "save")));
|
|
10939
10946
|
};
|
|
10940
10947
|
|
|
@@ -11103,6 +11110,56 @@ var SearchFieldConnect = function SearchFieldConnect() {
|
|
|
11103
11110
|
});
|
|
11104
11111
|
};
|
|
11105
11112
|
|
|
11113
|
+
/* *
|
|
11114
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11115
|
+
* you may not use this file except in compliance with the License.
|
|
11116
|
+
* You may obtain a copy of the License at
|
|
11117
|
+
*
|
|
11118
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11119
|
+
*
|
|
11120
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11121
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11122
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11123
|
+
* See the License for the specific language governing permissions and
|
|
11124
|
+
* limitations under the License.
|
|
11125
|
+
*
|
|
11126
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
11127
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
11128
|
+
* */
|
|
11129
|
+
var filterLayersFromService = function filterLayersFromService(serviceId, services, keywords, searchString) {
|
|
11130
|
+
var activeKeywords = keywords.filter(function (keyword) {
|
|
11131
|
+
return keyword.checked;
|
|
11132
|
+
});
|
|
11133
|
+
var keywordList = activeKeywords.map(function (keyword) {
|
|
11134
|
+
return keyword.id;
|
|
11135
|
+
});
|
|
11136
|
+
var allKeywordsActive = keywords.every(function (keyword) {
|
|
11137
|
+
return keyword.checked;
|
|
11138
|
+
});
|
|
11139
|
+
|
|
11140
|
+
if (searchString === '' && allKeywordsActive) {
|
|
11141
|
+
return services[serviceId].layers.filter(function (layer) {
|
|
11142
|
+
return layer.leaf;
|
|
11143
|
+
});
|
|
11144
|
+
}
|
|
11145
|
+
|
|
11146
|
+
var searchStringArray = searchString.split(' ');
|
|
11147
|
+
return services[serviceId].layers.filter(function (layer) {
|
|
11148
|
+
return searchStringArray.every(function (search) {
|
|
11149
|
+
var layerPathAndKeywords = layer.path.concat(layer.keywords);
|
|
11150
|
+
return (!!layerPathAndKeywords && !layerPathAndKeywords.every(function (keyword) {
|
|
11151
|
+
return !keywordList.includes(keyword);
|
|
11152
|
+
}) || 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) {
|
|
11153
|
+
return !keyword.toLowerCase().includes(search.toLowerCase());
|
|
11154
|
+
}) || !!layer.path && !layer.path.every(function (group) {
|
|
11155
|
+
return !group.toLowerCase().includes(search.toLowerCase());
|
|
11156
|
+
}) || services[serviceId].name.toLowerCase().includes(search.toLowerCase()));
|
|
11157
|
+
});
|
|
11158
|
+
}).filter(function (layer) {
|
|
11159
|
+
return layer.leaf;
|
|
11160
|
+
});
|
|
11161
|
+
};
|
|
11162
|
+
|
|
11106
11163
|
var useStyles$p = makeStyles(function (theme) {
|
|
11107
11164
|
return {
|
|
11108
11165
|
layerRow: {
|
|
@@ -11150,7 +11207,8 @@ var LayerList = function LayerList(_ref) {
|
|
|
11150
11207
|
var services = _ref.services,
|
|
11151
11208
|
serviceIds = _ref.serviceIds,
|
|
11152
11209
|
layerSelectHeight = _ref.layerSelectHeight,
|
|
11153
|
-
searchString = _ref.searchString
|
|
11210
|
+
searchString = _ref.searchString,
|
|
11211
|
+
keywords = _ref.keywords;
|
|
11154
11212
|
var classes = useStyles$p();
|
|
11155
11213
|
|
|
11156
11214
|
var _React$useState = React.useState(0),
|
|
@@ -11158,20 +11216,11 @@ var LayerList = function LayerList(_ref) {
|
|
|
11158
11216
|
numberOfLayers = _React$useState2[0],
|
|
11159
11217
|
setNumberOfLayers = _React$useState2[1];
|
|
11160
11218
|
|
|
11161
|
-
var filterLayersFromService = React.useCallback(function (serviceId) {
|
|
11162
|
-
if (searchString === '') {
|
|
11163
|
-
return services[serviceId].layers;
|
|
11164
|
-
}
|
|
11165
|
-
|
|
11166
|
-
return services[serviceId].layers.filter(function (layer) {
|
|
11167
|
-
return searchString === '' || !!layer.name && layer.name.toLowerCase().includes(searchString.toLowerCase()) || !!layer.text && layer.text.toLowerCase().includes(searchString.toLowerCase()) || !!layer["abstract"] && layer["abstract"].toLowerCase().includes(searchString.toLowerCase());
|
|
11168
|
-
});
|
|
11169
|
-
}, [services, searchString]);
|
|
11170
11219
|
React.useEffect(function () {
|
|
11171
11220
|
setNumberOfLayers(serviceIds.reduce(function (totalNumberOfLayers, serviceId) {
|
|
11172
|
-
return totalNumberOfLayers + filterLayersFromService(serviceId).length;
|
|
11221
|
+
return totalNumberOfLayers + filterLayersFromService(serviceId, services, keywords, searchString).length;
|
|
11173
11222
|
}, 0));
|
|
11174
|
-
}, [serviceIds,
|
|
11223
|
+
}, [serviceIds, keywords, services, searchString]);
|
|
11175
11224
|
return /*#__PURE__*/React.createElement("div", {
|
|
11176
11225
|
"data-testid": "layerList"
|
|
11177
11226
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -11182,7 +11231,7 @@ var LayerList = function LayerList(_ref) {
|
|
|
11182
11231
|
overflow: 'auto'
|
|
11183
11232
|
}
|
|
11184
11233
|
}, serviceIds.map(function (serviceId) {
|
|
11185
|
-
return filterLayersFromService(serviceId).map(function (layer) {
|
|
11234
|
+
return filterLayersFromService(serviceId, services, keywords, searchString).map(function (layer) {
|
|
11186
11235
|
return /*#__PURE__*/React.createElement("div", {
|
|
11187
11236
|
key: "".concat(serviceId, "-").concat(layer.name),
|
|
11188
11237
|
className: classes.layerRow,
|
|
@@ -11226,6 +11275,9 @@ var LayerListConnect = function LayerListConnect(_ref) {
|
|
|
11226
11275
|
var enabledServiceIds = useSelector(function (store) {
|
|
11227
11276
|
return getEnabledServiceIds(store);
|
|
11228
11277
|
});
|
|
11278
|
+
var keywords = useSelector(function (store) {
|
|
11279
|
+
return getKeywords(store);
|
|
11280
|
+
});
|
|
11229
11281
|
var searchString = useSelector(function (store) {
|
|
11230
11282
|
return getSearchFilter(store);
|
|
11231
11283
|
});
|
|
@@ -11233,6 +11285,7 @@ var LayerListConnect = function LayerListConnect(_ref) {
|
|
|
11233
11285
|
services: services,
|
|
11234
11286
|
serviceIds: enabledServiceIds,
|
|
11235
11287
|
layerSelectHeight: layerSelectHeight,
|
|
11288
|
+
keywords: keywords,
|
|
11236
11289
|
searchString: searchString
|
|
11237
11290
|
});
|
|
11238
11291
|
};
|
|
@@ -11340,29 +11393,31 @@ var ServiceChipConnect = function ServiceChipConnect(_ref) {
|
|
|
11340
11393
|
});
|
|
11341
11394
|
|
|
11342
11395
|
var toggleChip = function toggleChip(service) {
|
|
11343
|
-
var _a;
|
|
11344
|
-
|
|
11345
11396
|
if (service === 'all') {
|
|
11346
|
-
if (
|
|
11347
|
-
|
|
11348
|
-
|
|
11349
|
-
|
|
11350
|
-
|
|
11351
|
-
|
|
11352
|
-
|
|
11353
|
-
|
|
11354
|
-
|
|
11355
|
-
|
|
11356
|
-
|
|
11357
|
-
|
|
11358
|
-
|
|
11359
|
-
|
|
11397
|
+
if (isEnabled) {
|
|
11398
|
+
Object.values(activeServices).forEach(function (s) {
|
|
11399
|
+
if (s.enabled) dispatch(disableActiveService({
|
|
11400
|
+
serviceUrl: s.id,
|
|
11401
|
+
keywords: s.keywordsPerService
|
|
11402
|
+
}));
|
|
11403
|
+
});
|
|
11404
|
+
} else {
|
|
11405
|
+
Object.values(activeServices).forEach(function (s) {
|
|
11406
|
+
if (!s.enabled) dispatch(enableActiveService({
|
|
11407
|
+
serviceUrl: s.id,
|
|
11408
|
+
keywords: s.keywordsPerService
|
|
11409
|
+
}));
|
|
11410
|
+
});
|
|
11411
|
+
}
|
|
11412
|
+
} else if (isEnabled) {
|
|
11360
11413
|
dispatch(disableActiveService({
|
|
11361
|
-
|
|
11414
|
+
serviceUrl: service,
|
|
11415
|
+
keywords: activeServices[service].keywordsPerService
|
|
11362
11416
|
}));
|
|
11363
11417
|
} else {
|
|
11364
11418
|
dispatch(enableActiveService({
|
|
11365
|
-
|
|
11419
|
+
serviceUrl: service,
|
|
11420
|
+
keywords: activeServices[service].keywordsPerService
|
|
11366
11421
|
}));
|
|
11367
11422
|
}
|
|
11368
11423
|
};
|
|
@@ -11458,7 +11513,7 @@ var ServiceList = function ServiceList(_ref4) {
|
|
|
11458
11513
|
setWidth(ref.current.scrollWidth + 50);
|
|
11459
11514
|
setMargin(Math.max(0, Math.min(width - layerSelectWidth, margin)));
|
|
11460
11515
|
}, [services, layerSelectWidth, width, margin]);
|
|
11461
|
-
var isAllEnabled = activeServices.every(function (activeService) {
|
|
11516
|
+
var isAllEnabled = Object.values(activeServices).every(function (activeService) {
|
|
11462
11517
|
return activeService.enabled;
|
|
11463
11518
|
});
|
|
11464
11519
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -11478,13 +11533,10 @@ var ServiceList = function ServiceList(_ref4) {
|
|
|
11478
11533
|
}), Object.keys(services).map(function (service) {
|
|
11479
11534
|
var _a;
|
|
11480
11535
|
|
|
11481
|
-
var isServiceEnabled = (_a = activeServices.find(function (activeService) {
|
|
11482
|
-
return activeService.id === services[service].service;
|
|
11483
|
-
})) === null || _a === void 0 ? void 0 : _a.enabled;
|
|
11484
11536
|
return /*#__PURE__*/React.createElement(ServiceChipConnect, {
|
|
11485
11537
|
key: services[service].id,
|
|
11486
11538
|
service: services[service],
|
|
11487
|
-
isEnabled:
|
|
11539
|
+
isEnabled: (_a = activeServices[service]) === null || _a === void 0 ? void 0 : _a.enabled
|
|
11488
11540
|
});
|
|
11489
11541
|
})), layerSelectWidth + margin < width && /*#__PURE__*/React.createElement(ChevronRight, {
|
|
11490
11542
|
className: classes.scrollArrowRight,
|
|
@@ -11691,7 +11743,7 @@ var CustomSwitch = withStyles(function (theme) {
|
|
|
11691
11743
|
color: theme.palette.geowebColors.customSlider.thumb
|
|
11692
11744
|
},
|
|
11693
11745
|
'&$checked + $track': {
|
|
11694
|
-
backgroundColor: theme.palette.geowebColors.buttons.primary.fill
|
|
11746
|
+
backgroundColor: theme.palette.geowebColors.buttons.primary["default"].fill
|
|
11695
11747
|
}
|
|
11696
11748
|
},
|
|
11697
11749
|
checked: {},
|
|
@@ -11713,7 +11765,7 @@ var useStyles$k = makeStyles(function (theme) {
|
|
|
11713
11765
|
fontSize: '12px'
|
|
11714
11766
|
},
|
|
11715
11767
|
onlyByttonText: {
|
|
11716
|
-
color: theme.palette.geowebColors.buttons.primary.fill,
|
|
11768
|
+
color: theme.palette.geowebColors.buttons.primary["default"].fill,
|
|
11717
11769
|
fontSize: '14px',
|
|
11718
11770
|
fontWeight: 500
|
|
11719
11771
|
},
|
|
@@ -11808,7 +11860,7 @@ var useStyles$j = makeStyles(function (theme) {
|
|
|
11808
11860
|
});
|
|
11809
11861
|
|
|
11810
11862
|
var KeywordFilterResults = function KeywordFilterResults(_ref) {
|
|
11811
|
-
var
|
|
11863
|
+
var keywordObjects = _ref.keywordObjects,
|
|
11812
11864
|
mapId = _ref.mapId,
|
|
11813
11865
|
bounds = _ref.bounds,
|
|
11814
11866
|
_ref$onClose = _ref.onClose,
|
|
@@ -11820,7 +11872,8 @@ var KeywordFilterResults = function KeywordFilterResults(_ref) {
|
|
|
11820
11872
|
_ref$order = _ref.order,
|
|
11821
11873
|
order = _ref$order === void 0 ? 0 : _ref$order,
|
|
11822
11874
|
_ref$source = _ref.source,
|
|
11823
|
-
source = _ref$source === void 0 ? 'module' : _ref$source
|
|
11875
|
+
source = _ref$source === void 0 ? 'module' : _ref$source,
|
|
11876
|
+
updateKeywords = _ref.updateKeywords;
|
|
11824
11877
|
var classes = useStyles$j();
|
|
11825
11878
|
|
|
11826
11879
|
var _React$useState = React.useState(true),
|
|
@@ -11828,19 +11881,14 @@ var KeywordFilterResults = function KeywordFilterResults(_ref) {
|
|
|
11828
11881
|
allSelected = _React$useState2[0],
|
|
11829
11882
|
setAllSelected = _React$useState2[1];
|
|
11830
11883
|
|
|
11831
|
-
var _React$useState3 = React.useState(arrayOfKeywordObjects),
|
|
11832
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
11833
|
-
keywordObjects = _React$useState4[0],
|
|
11834
|
-
setKeywordObjects = _React$useState4[1];
|
|
11835
|
-
|
|
11836
11884
|
var toggleSelectAll = function toggleSelectAll() {
|
|
11837
11885
|
var editedKeywords = keywordObjects.map(function (object) {
|
|
11838
11886
|
return Object.assign(Object.assign({}, object), {
|
|
11839
11887
|
checked: !allSelected
|
|
11840
11888
|
});
|
|
11841
11889
|
});
|
|
11842
|
-
setKeywordObjects(editedKeywords);
|
|
11843
11890
|
setAllSelected(!allSelected);
|
|
11891
|
+
updateKeywords(editedKeywords);
|
|
11844
11892
|
};
|
|
11845
11893
|
|
|
11846
11894
|
var toggleCheckbox = function toggleCheckbox(listIndex) {
|
|
@@ -11849,7 +11897,7 @@ var KeywordFilterResults = function KeywordFilterResults(_ref) {
|
|
|
11849
11897
|
checked: !object.checked
|
|
11850
11898
|
}) : object;
|
|
11851
11899
|
});
|
|
11852
|
-
|
|
11900
|
+
updateKeywords(editedKeywords);
|
|
11853
11901
|
};
|
|
11854
11902
|
|
|
11855
11903
|
var selectOnlyOne = function selectOnlyOne(listIndex) {
|
|
@@ -11860,7 +11908,7 @@ var KeywordFilterResults = function KeywordFilterResults(_ref) {
|
|
|
11860
11908
|
checked: false
|
|
11861
11909
|
});
|
|
11862
11910
|
});
|
|
11863
|
-
|
|
11911
|
+
updateKeywords(editedKeywords);
|
|
11864
11912
|
}; // If even one checkbox is unchecked, switch toggleAll off
|
|
11865
11913
|
// If all checkboxes becomes checked, switch toggleAll on
|
|
11866
11914
|
|
|
@@ -11871,9 +11919,6 @@ var KeywordFilterResults = function KeywordFilterResults(_ref) {
|
|
|
11871
11919
|
});
|
|
11872
11920
|
setAllSelected(checked);
|
|
11873
11921
|
}, [keywordObjects]);
|
|
11874
|
-
React.useEffect(function () {
|
|
11875
|
-
setKeywordObjects(arrayOfKeywordObjects);
|
|
11876
|
-
}, [arrayOfKeywordObjects]);
|
|
11877
11922
|
return /*#__PURE__*/React.createElement(ToolContainerDraggable, {
|
|
11878
11923
|
title: showTitle ? "Filter Results ".concat(mapId) : 'Filter Results',
|
|
11879
11924
|
"data-testid": "keywordFilterResults",
|
|
@@ -11922,7 +11967,9 @@ var KeywordFilterResults = function KeywordFilterResults(_ref) {
|
|
|
11922
11967
|
}
|
|
11923
11968
|
}, keywordObjects.map(function (_ref2, index) {
|
|
11924
11969
|
var id = _ref2.id,
|
|
11925
|
-
checked = _ref2.checked
|
|
11970
|
+
checked = _ref2.checked,
|
|
11971
|
+
amountVisible = _ref2.amountVisible;
|
|
11972
|
+
if (amountVisible === 0) return null;
|
|
11926
11973
|
return /*#__PURE__*/React.createElement(FilterListItem, {
|
|
11927
11974
|
key: "".concat(id, "-").concat(index),
|
|
11928
11975
|
index: index,
|
|
@@ -11979,7 +12026,12 @@ var KeywordFilterResultsConnect = function KeywordFilterResultsConnect(_ref) {
|
|
|
11979
12026
|
});
|
|
11980
12027
|
var uiIsOrderedOnTop = useSelector(function (store) {
|
|
11981
12028
|
return getDialogIsOrderedOnTop(store, 'keywordFilter');
|
|
11982
|
-
});
|
|
12029
|
+
});
|
|
12030
|
+
var updateKeywords$1 = React.useCallback(function (keywords) {
|
|
12031
|
+
dispatch(updateKeywords({
|
|
12032
|
+
keywords: keywords
|
|
12033
|
+
}));
|
|
12034
|
+
}, [dispatch]); // Check to ensure the currently active map is still present on screen - if not, close the dialog
|
|
11983
12035
|
|
|
11984
12036
|
React.useEffect(function () {
|
|
11985
12037
|
if (mapId !== '' && !isMapPresent) {
|
|
@@ -12015,7 +12067,7 @@ var KeywordFilterResultsConnect = function KeywordFilterResultsConnect(_ref) {
|
|
|
12015
12067
|
return getKeywords(store);
|
|
12016
12068
|
});
|
|
12017
12069
|
return /*#__PURE__*/React.createElement(KeywordFilterResults, {
|
|
12018
|
-
|
|
12070
|
+
keywordObjects: keywords,
|
|
12019
12071
|
mapId: mapId,
|
|
12020
12072
|
bounds: bounds,
|
|
12021
12073
|
isOpen: isOpenInStore,
|
|
@@ -12023,7 +12075,8 @@ var KeywordFilterResultsConnect = function KeywordFilterResultsConnect(_ref) {
|
|
|
12023
12075
|
showTitle: showTitle,
|
|
12024
12076
|
onMouseDown: onOrderDialog,
|
|
12025
12077
|
order: uiOrder,
|
|
12026
|
-
source: uiSource
|
|
12078
|
+
source: uiSource,
|
|
12079
|
+
updateKeywords: updateKeywords$1
|
|
12027
12080
|
});
|
|
12028
12081
|
};
|
|
12029
12082
|
|
|
@@ -12123,7 +12176,7 @@ var LayerSelectConnect = function LayerSelectConnect(_ref) {
|
|
|
12123
12176
|
React.useEffect(function () {
|
|
12124
12177
|
if (isOpenInStore && preloadedServices && preloadedServices.length > 0) {
|
|
12125
12178
|
preloadedServices.forEach(function (service) {
|
|
12126
|
-
|
|
12179
|
+
getLayersFlattenedFromService(service.url).then(function (layers) {
|
|
12127
12180
|
if (isMounted.current) {
|
|
12128
12181
|
serviceSetLayers$1({
|
|
12129
12182
|
id: service.id,
|
|
@@ -20748,7 +20801,7 @@ var LegendDialog = function LegendDialog(_ref) {
|
|
|
20748
20801
|
return /*#__PURE__*/React.createElement(ToolContainerDraggable, {
|
|
20749
20802
|
startPosition: {
|
|
20750
20803
|
right: 20,
|
|
20751
|
-
top:
|
|
20804
|
+
top: 50
|
|
20752
20805
|
},
|
|
20753
20806
|
minWidth: 100,
|
|
20754
20807
|
onClose: onClose,
|
|
@@ -22257,4 +22310,4 @@ var CoreThemeStoreProvider = function CoreThemeStoreProvider(_ref2) {
|
|
|
22257
22310
|
}, children)));
|
|
22258
22311
|
};
|
|
22259
22312
|
|
|
22260
|
-
export { ConfigurableConnectedMap, ConfigurableMapWithSliderConnect, CoreThemeProvider, CoreThemeStoreProvider, HarmRefTimePreset, HarmonieTempAndPrecipPreset, LayerManagerConnect, LayerManagerMapButtonConnect, Legend, LegendConnect, LegendMapButtonConnect, MapControls, MapView, MapViewConnect, MapViewLayer, MultiDimensionSelectMapButtonsConnect, MultiMapMultiDimensionSelectConnect as MultiMapDimensionSelectConnect, MultiMapViewConnect, ReactMapView, ReactMapViewLayer, SyncGroupViewerConnect, index as SyncGroups, TimeSliderConnect, TooltipSelect, ZoomControlConnect, ZoomControls, componentsLookUp, coreModuleConfig, dateFormat, defaultConfigurations, filterNonTimeDimensions, generateLayerId, generateMapId,
|
|
22313
|
+
export { ConfigurableConnectedMap, ConfigurableMapWithSliderConnect, CoreThemeProvider, CoreThemeStoreProvider, HarmRefTimePreset, HarmonieTempAndPrecipPreset, LayerManagerConnect, LayerManagerMapButtonConnect, Legend, LegendConnect, LegendMapButtonConnect, MapControls, MapView, MapViewConnect, MapViewLayer, MultiDimensionSelectMapButtonsConnect, MultiMapMultiDimensionSelectConnect as MultiMapDimensionSelectConnect, MultiMapViewConnect, ReactMapView, ReactMapViewLayer, SyncGroupViewerConnect, index as SyncGroups, TimeSliderConnect, TooltipSelect, ZoomControlConnect, ZoomControls, componentsLookUp, coreModuleConfig, dateFormat, defaultConfigurations, filterNonTimeDimensions, generateLayerId, generateMapId, generateTimesliderId, getFirstTimeStepForLayerId, getLastTimeStepForLayerId, getNextTimeStepForLayerId, getPreviousTimeStepForLayerId, getWMJSDimensionForLayerAndDimension, getWMJSMapById, getWMJSTimeDimensionForLayerId, getWMLayerById, reducer$6 as layerReducer, makeMapPreset, actions$3 as mapActions, constants$1 as mapConstants, selectors as mapSelectors, types$2 as mapTypes, utils as mapUtils, publicLayers, publicServices, registerWMJSMap, registerWMLayer, store, actions as syncGroupActions, synchronizationGroupConfig as synchronizationGroupModuleConfig, testLayers, actions$2 as uiActions, types$1 as uiTypes, useStyles$3 as useStyles };
|