@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.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('react'), require('immer'), require('redux-saga/effects'), require('@opengeoweb/webmap'), require('@mui/material'), require('@mui/styles/makeStyles'), require('react-redux'), require('@opengeoweb/shared'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'reselect', 'moment', 'react', 'immer', 'redux-saga/effects', '@opengeoweb/webmap', '@mui/material', '@mui/styles/makeStyles', 'react-redux', '@opengeoweb/shared', '
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Core = {}, global.reselect, global.moment, global.React, global.produce, global.effects, global.webmap, global.material, global.makeStyles, global.reactRedux, global.shared, global.
|
|
5
|
-
})(this, (function (exports, reselect, moment, React, produce, effects, webmap, material, makeStyles, reactRedux, shared,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('reselect'), require('lodash'), require('moment'), require('react'), require('immer'), require('redux-saga/effects'), require('@opengeoweb/webmap'), require('@mui/material'), require('@mui/styles/makeStyles'), require('react-redux'), 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('redux-dynamic-modules'), require('redux-dynamic-modules-saga'), require('@opengeoweb/theme')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'reselect', 'lodash', 'moment', 'react', 'immer', 'redux-saga/effects', '@opengeoweb/webmap', '@mui/material', '@mui/styles/makeStyles', 'react-redux', '@opengeoweb/shared', '@mui/icons-material', 'react-sortablejs', '@mui/styles/createStyles', '@mui/styles/withStyles', 'throttle-debounce', 'lodash.clonedeep', 'proj4', 'redux-dynamic-modules', 'redux-dynamic-modules-saga', '@opengeoweb/theme'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Core = {}, global.reselect, global._, global.moment, global.React, global.produce, global.effects, global.webmap, global.material, global.makeStyles, global.reactRedux, global.shared, global.iconsMaterial, global.reactSortablejs, global.createStyles, global.withStyles, global.throttleDebounce, global.cloneDeep, global.proj4, global.reduxDynamicModules, global.reduxDynamicModulesSaga, global.theme));
|
|
5
|
+
})(this, (function (exports, reselect, _, moment, React, produce, effects, webmap, material, makeStyles, reactRedux, shared, iconsMaterial, reactSortablejs, createStyles, withStyles, throttleDebounce, cloneDeep, proj4, 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
|
|
|
@@ -24,12 +24,12 @@
|
|
|
24
24
|
return Object.freeze(n);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
var ___default = /*#__PURE__*/_interopDefaultLegacy(_);
|
|
27
28
|
var moment__default = /*#__PURE__*/_interopDefaultLegacy(moment);
|
|
28
29
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
29
30
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
30
31
|
var produce__default = /*#__PURE__*/_interopDefaultLegacy(produce);
|
|
31
32
|
var makeStyles__default = /*#__PURE__*/_interopDefaultLegacy(makeStyles);
|
|
32
|
-
var ___default = /*#__PURE__*/_interopDefaultLegacy(_);
|
|
33
33
|
var createStyles__default = /*#__PURE__*/_interopDefaultLegacy(createStyles);
|
|
34
34
|
var withStyles__default = /*#__PURE__*/_interopDefaultLegacy(withStyles);
|
|
35
35
|
var cloneDeep__default = /*#__PURE__*/_interopDefaultLegacy(cloneDeep);
|
|
@@ -824,11 +824,6 @@
|
|
|
824
824
|
generatedTimesliderIds += 1;
|
|
825
825
|
return "timesliderid_" + generatedTimesliderIds;
|
|
826
826
|
};
|
|
827
|
-
var generatedScreenIds = 0;
|
|
828
|
-
var generateScreenId = function generateScreenId() {
|
|
829
|
-
generatedScreenIds += 1;
|
|
830
|
-
return "screen_" + generatedScreenIds;
|
|
831
|
-
};
|
|
832
827
|
/**
|
|
833
828
|
* Map for registering wmlayers with their id's
|
|
834
829
|
*/
|
|
@@ -1969,6 +1964,14 @@
|
|
|
1969
1964
|
* Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
1970
1965
|
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
1971
1966
|
* */
|
|
1967
|
+
/* TODO:, move this to a right place https://gitlab.com/opengeoweb/opengeoweb/-/issues/1802 */
|
|
1968
|
+
|
|
1969
|
+
var selectorMemoizationOptions = {
|
|
1970
|
+
memoizeOptions: {
|
|
1971
|
+
maxSize: 1000,
|
|
1972
|
+
resultEqualityCheck: _.isEqual
|
|
1973
|
+
}
|
|
1974
|
+
};
|
|
1972
1975
|
/**
|
|
1973
1976
|
* Gets the map state by mapId
|
|
1974
1977
|
*
|
|
@@ -2068,7 +2071,7 @@
|
|
|
2068
2071
|
return layerIds.map(function (layerId) {
|
|
2069
2072
|
return layers[layerId];
|
|
2070
2073
|
});
|
|
2071
|
-
});
|
|
2074
|
+
}, selectorMemoizationOptions);
|
|
2072
2075
|
/**
|
|
2073
2076
|
* Gets an array of baselayers ids for a map
|
|
2074
2077
|
*
|
|
@@ -2094,7 +2097,7 @@
|
|
|
2094
2097
|
return layerIds.map(function (layerId) {
|
|
2095
2098
|
return layers[layerId];
|
|
2096
2099
|
});
|
|
2097
|
-
});
|
|
2100
|
+
}, selectorMemoizationOptions);
|
|
2098
2101
|
/**
|
|
2099
2102
|
* Gets and array of overLayers ids for a map
|
|
2100
2103
|
*
|
|
@@ -2120,7 +2123,7 @@
|
|
|
2120
2123
|
return layerIds.map(function (layerId) {
|
|
2121
2124
|
return layers[layerId];
|
|
2122
2125
|
});
|
|
2123
|
-
});
|
|
2126
|
+
}, selectorMemoizationOptions);
|
|
2124
2127
|
/**
|
|
2125
2128
|
* Gets map dimensions
|
|
2126
2129
|
*
|
|
@@ -3830,6 +3833,7 @@
|
|
|
3830
3833
|
linked = _a.linked;
|
|
3831
3834
|
|
|
3832
3835
|
if (!draft.groups.byId[groupId]) {
|
|
3836
|
+
console.warn("SYNCGROUPS_ADD_TARGET: Group " + groupId + " does not exist.");
|
|
3833
3837
|
return;
|
|
3834
3838
|
}
|
|
3835
3839
|
|
|
@@ -4433,23 +4437,18 @@
|
|
|
4433
4437
|
layerDimensions: {
|
|
4434
4438
|
origin: origin,
|
|
4435
4439
|
layerId: wmLayer.id,
|
|
4436
|
-
dimensions: wmLayer.dimensions.map(function (
|
|
4437
|
-
var name =
|
|
4438
|
-
units =
|
|
4439
|
-
|
|
4440
|
-
dimMinValue = _a.dimMinValue,
|
|
4441
|
-
dimMaxValue = _a.dimMaxValue,
|
|
4442
|
-
dimTimeInterval = _a.dimTimeInterval,
|
|
4443
|
-
values = _a.values,
|
|
4444
|
-
synced = _a.synced;
|
|
4440
|
+
dimensions: wmLayer.dimensions.map(function (dim) {
|
|
4441
|
+
var name = dim.name,
|
|
4442
|
+
units = dim.units,
|
|
4443
|
+
synced = dim.synced;
|
|
4445
4444
|
return {
|
|
4446
4445
|
name: name,
|
|
4447
4446
|
units: units,
|
|
4448
|
-
currentValue:
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
timeInterval:
|
|
4452
|
-
values:
|
|
4447
|
+
currentValue: dim.getValue(),
|
|
4448
|
+
minValue: dim.getFirstValue(),
|
|
4449
|
+
maxValue: dim.getLastValue(),
|
|
4450
|
+
timeInterval: dim.getDimInterval(),
|
|
4451
|
+
values: dim.getValues(),
|
|
4453
4452
|
synced: synced
|
|
4454
4453
|
};
|
|
4455
4454
|
})
|
|
@@ -5078,7 +5077,7 @@
|
|
|
5078
5077
|
* Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
5079
5078
|
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
5080
5079
|
* */
|
|
5081
|
-
var useStyles$
|
|
5080
|
+
var useStyles$I = makeStyles__default["default"](function (theme) {
|
|
5082
5081
|
return {
|
|
5083
5082
|
select: {
|
|
5084
5083
|
'& ul': {
|
|
@@ -5134,7 +5133,7 @@
|
|
|
5134
5133
|
tooltipOpen = _f[0],
|
|
5135
5134
|
setTooltipOpen = _f[1];
|
|
5136
5135
|
|
|
5137
|
-
var classes = useStyles$
|
|
5136
|
+
var classes = useStyles$I();
|
|
5138
5137
|
|
|
5139
5138
|
var preventDefault = function preventDefault(event) {
|
|
5140
5139
|
event.preventDefault();
|
|
@@ -6879,9 +6878,11 @@
|
|
|
6879
6878
|
var initialState = {
|
|
6880
6879
|
filters: {
|
|
6881
6880
|
searchFilter: '',
|
|
6882
|
-
activeServices:
|
|
6883
|
-
|
|
6884
|
-
|
|
6881
|
+
activeServices: {
|
|
6882
|
+
byId: {},
|
|
6883
|
+
allIds: []
|
|
6884
|
+
},
|
|
6885
|
+
keywords: []
|
|
6885
6886
|
}
|
|
6886
6887
|
};
|
|
6887
6888
|
var reducer = function reducer(state, action) {
|
|
@@ -6898,63 +6899,25 @@
|
|
|
6898
6899
|
});
|
|
6899
6900
|
}
|
|
6900
6901
|
|
|
6901
|
-
case '
|
|
6902
|
-
{
|
|
6903
|
-
var activeServices_1 = action.payload.activeServices;
|
|
6904
|
-
return produce__default["default"](state, function (draft) {
|
|
6905
|
-
activeServices_1.forEach(function (service) {
|
|
6906
|
-
if (draft.filters.activeServices.filter(function (s) {
|
|
6907
|
-
return s.id === service;
|
|
6908
|
-
}).length === 0) draft.filters.activeServices.push({
|
|
6909
|
-
id: service,
|
|
6910
|
-
enabled: true
|
|
6911
|
-
});
|
|
6912
|
-
});
|
|
6913
|
-
});
|
|
6914
|
-
}
|
|
6915
|
-
|
|
6916
|
-
case 'LAYER_SELECT_ENABLE_ACTIVE_SERVICE':
|
|
6917
|
-
{
|
|
6918
|
-
var service_1 = action.payload.service;
|
|
6919
|
-
return produce__default["default"](state, function (draft) {
|
|
6920
|
-
var index = draft.filters.activeServices.findIndex(function (s) {
|
|
6921
|
-
return s.id === service_1;
|
|
6922
|
-
});
|
|
6923
|
-
draft.filters.activeServices[index].enabled = true;
|
|
6924
|
-
});
|
|
6925
|
-
}
|
|
6926
|
-
|
|
6927
|
-
case 'LAYER_SELECT_DISABLE_ACTIVE_SERVICE':
|
|
6928
|
-
{
|
|
6929
|
-
var service_2 = action.payload.service;
|
|
6930
|
-
return produce__default["default"](state, function (draft) {
|
|
6931
|
-
var index = draft.filters.activeServices.findIndex(function (s) {
|
|
6932
|
-
return s.id === service_2;
|
|
6933
|
-
});
|
|
6934
|
-
draft.filters.activeServices[index].enabled = false;
|
|
6935
|
-
});
|
|
6936
|
-
}
|
|
6937
|
-
|
|
6938
|
-
case 'LAYER_SELECT_ADD_NEW_KEYWORDS':
|
|
6902
|
+
case 'LAYER_SELECT_ADD_KEYWORDS_AND_ACTIVE_SERVICES':
|
|
6939
6903
|
{
|
|
6904
|
+
var _a = action.payload,
|
|
6905
|
+
serviceUrl_1 = _a.serviceUrl,
|
|
6906
|
+
keywords_1 = _a.keywords;
|
|
6940
6907
|
return produce__default["default"](state, function (draft) {
|
|
6941
6908
|
var e_1, _a;
|
|
6942
6909
|
|
|
6943
|
-
|
|
6944
|
-
|
|
6945
|
-
keywords = _b.keywords; // If store does not contain keywords from a service, add keywords and service Name
|
|
6946
|
-
|
|
6947
|
-
if (!draft.filters.addedServices.includes(serviceName)) {
|
|
6948
|
-
draft.filters.addedServices.push(serviceName);
|
|
6910
|
+
if (!draft.filters.activeServices.byId[serviceUrl_1]) {
|
|
6911
|
+
draft.filters.activeServices.byId[serviceUrl_1] = {};
|
|
6949
6912
|
|
|
6950
6913
|
var _loop_1 = function _loop_1(keyword) {
|
|
6951
|
-
var
|
|
6914
|
+
var foundKeyword = draft.filters.keywords.find(function (object) {
|
|
6952
6915
|
return object.id === keyword;
|
|
6953
6916
|
});
|
|
6954
6917
|
|
|
6955
|
-
if (
|
|
6956
|
-
|
|
6957
|
-
|
|
6918
|
+
if (foundKeyword) {
|
|
6919
|
+
foundKeyword.amount += 1;
|
|
6920
|
+
foundKeyword.amountVisible += 1;
|
|
6958
6921
|
} else {
|
|
6959
6922
|
var newKeywordObject = {
|
|
6960
6923
|
id: keyword,
|
|
@@ -6967,8 +6930,8 @@
|
|
|
6967
6930
|
};
|
|
6968
6931
|
|
|
6969
6932
|
try {
|
|
6970
|
-
for (var
|
|
6971
|
-
var keyword =
|
|
6933
|
+
for (var keywords_2 = __values(keywords_1), keywords_2_1 = keywords_2.next(); !keywords_2_1.done; keywords_2_1 = keywords_2.next()) {
|
|
6934
|
+
var keyword = keywords_2_1.value;
|
|
6972
6935
|
|
|
6973
6936
|
_loop_1(keyword);
|
|
6974
6937
|
}
|
|
@@ -6978,12 +6941,105 @@
|
|
|
6978
6941
|
};
|
|
6979
6942
|
} finally {
|
|
6980
6943
|
try {
|
|
6981
|
-
if (
|
|
6944
|
+
if (keywords_2_1 && !keywords_2_1.done && (_a = keywords_2["return"])) _a.call(keywords_2);
|
|
6982
6945
|
} finally {
|
|
6983
6946
|
if (e_1) throw e_1.error;
|
|
6984
6947
|
}
|
|
6985
6948
|
}
|
|
6986
6949
|
}
|
|
6950
|
+
|
|
6951
|
+
draft.filters.activeServices.byId[serviceUrl_1].id = serviceUrl_1;
|
|
6952
|
+
draft.filters.activeServices.byId[serviceUrl_1].enabled = true;
|
|
6953
|
+
draft.filters.activeServices.byId[serviceUrl_1].keywordsPerService = keywords_1;
|
|
6954
|
+
if (!draft.filters.activeServices.allIds.includes(serviceUrl_1)) draft.filters.activeServices.allIds.push(serviceUrl_1);
|
|
6955
|
+
});
|
|
6956
|
+
}
|
|
6957
|
+
|
|
6958
|
+
case 'LAYER_SELECT_ENABLE_ACTIVE_SERVICE':
|
|
6959
|
+
{
|
|
6960
|
+
var _b = action.payload,
|
|
6961
|
+
serviceUrl_2 = _b.serviceUrl,
|
|
6962
|
+
keywords_3 = _b.keywords;
|
|
6963
|
+
return produce__default["default"](state, function (draft) {
|
|
6964
|
+
var e_2, _a;
|
|
6965
|
+
|
|
6966
|
+
draft.filters.activeServices.byId[serviceUrl_2].enabled = true;
|
|
6967
|
+
|
|
6968
|
+
var _loop_2 = function _loop_2(keyword) {
|
|
6969
|
+
var foundObject = draft.filters.keywords.find(function (object) {
|
|
6970
|
+
return object.id === keyword;
|
|
6971
|
+
});
|
|
6972
|
+
|
|
6973
|
+
if (foundObject) {
|
|
6974
|
+
foundObject.amountVisible += 1;
|
|
6975
|
+
}
|
|
6976
|
+
};
|
|
6977
|
+
|
|
6978
|
+
try {
|
|
6979
|
+
for (var keywords_4 = __values(keywords_3), keywords_4_1 = keywords_4.next(); !keywords_4_1.done; keywords_4_1 = keywords_4.next()) {
|
|
6980
|
+
var keyword = keywords_4_1.value;
|
|
6981
|
+
|
|
6982
|
+
_loop_2(keyword);
|
|
6983
|
+
}
|
|
6984
|
+
} catch (e_2_1) {
|
|
6985
|
+
e_2 = {
|
|
6986
|
+
error: e_2_1
|
|
6987
|
+
};
|
|
6988
|
+
} finally {
|
|
6989
|
+
try {
|
|
6990
|
+
if (keywords_4_1 && !keywords_4_1.done && (_a = keywords_4["return"])) _a.call(keywords_4);
|
|
6991
|
+
} finally {
|
|
6992
|
+
if (e_2) throw e_2.error;
|
|
6993
|
+
}
|
|
6994
|
+
}
|
|
6995
|
+
});
|
|
6996
|
+
}
|
|
6997
|
+
|
|
6998
|
+
case 'LAYER_SELECT_DISABLE_ACTIVE_SERVICE':
|
|
6999
|
+
{
|
|
7000
|
+
var _c = action.payload,
|
|
7001
|
+
serviceUrl_3 = _c.serviceUrl,
|
|
7002
|
+
keywords_5 = _c.keywords;
|
|
7003
|
+
return produce__default["default"](state, function (draft) {
|
|
7004
|
+
var e_3, _a;
|
|
7005
|
+
|
|
7006
|
+
draft.filters.activeServices.byId[serviceUrl_3].enabled = false;
|
|
7007
|
+
|
|
7008
|
+
var _loop_3 = function _loop_3(keyword) {
|
|
7009
|
+
var foundObject = draft.filters.keywords.find(function (object) {
|
|
7010
|
+
return object.id === keyword;
|
|
7011
|
+
});
|
|
7012
|
+
|
|
7013
|
+
if (foundObject && foundObject.amountVisible > 0) {
|
|
7014
|
+
foundObject.amountVisible -= 1;
|
|
7015
|
+
}
|
|
7016
|
+
};
|
|
7017
|
+
|
|
7018
|
+
try {
|
|
7019
|
+
for (var keywords_6 = __values(keywords_5), keywords_6_1 = keywords_6.next(); !keywords_6_1.done; keywords_6_1 = keywords_6.next()) {
|
|
7020
|
+
var keyword = keywords_6_1.value;
|
|
7021
|
+
|
|
7022
|
+
_loop_3(keyword);
|
|
7023
|
+
}
|
|
7024
|
+
} catch (e_3_1) {
|
|
7025
|
+
e_3 = {
|
|
7026
|
+
error: e_3_1
|
|
7027
|
+
};
|
|
7028
|
+
} finally {
|
|
7029
|
+
try {
|
|
7030
|
+
if (keywords_6_1 && !keywords_6_1.done && (_a = keywords_6["return"])) _a.call(keywords_6);
|
|
7031
|
+
} finally {
|
|
7032
|
+
if (e_3) throw e_3.error;
|
|
7033
|
+
}
|
|
7034
|
+
}
|
|
7035
|
+
});
|
|
7036
|
+
}
|
|
7037
|
+
|
|
7038
|
+
case 'LAYER_SELECT_UPDATE_KEYWORDS':
|
|
7039
|
+
{
|
|
7040
|
+
return produce__default["default"](state, function (draft) {
|
|
7041
|
+
var keywords = action.payload.keywords;
|
|
7042
|
+
draft.filters.keywords = keywords;
|
|
6987
7043
|
});
|
|
6988
7044
|
}
|
|
6989
7045
|
|
|
@@ -7009,10 +7065,10 @@
|
|
|
7009
7065
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
7010
7066
|
* */
|
|
7011
7067
|
var LAYER_SELECT_SET_SEARCH_FILTER = 'LAYER_SELECT_SET_SEARCH_FILTER';
|
|
7012
|
-
var LAYER_SELECT_SET_ACTIVE_SERVICES = 'LAYER_SELECT_SET_ACTIVE_SERVICES';
|
|
7013
7068
|
var LAYER_SELECT_DISABLE_ACTIVE_SERVICE = 'LAYER_SELECT_DISABLE_ACTIVE_SERVICE';
|
|
7014
7069
|
var LAYER_SELECT_ENABLE_ACTIVE_SERVICE = 'LAYER_SELECT_ENABLE_ACTIVE_SERVICE';
|
|
7015
|
-
var
|
|
7070
|
+
var LAYER_SELECT_ADD_KEYWORDS_AND_ACTIVE_SERVICES = 'LAYER_SELECT_ADD_KEYWORDS_AND_ACTIVE_SERVICES';
|
|
7071
|
+
var LAYER_SELECT_UPDATE_KEYWORDS = 'LAYER_SELECT_UPDATE_KEYWORDS';
|
|
7016
7072
|
|
|
7017
7073
|
/* *
|
|
7018
7074
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -7043,19 +7099,6 @@
|
|
|
7043
7099
|
payload: payload
|
|
7044
7100
|
};
|
|
7045
7101
|
};
|
|
7046
|
-
/**
|
|
7047
|
-
* Sets the given array of string as active services
|
|
7048
|
-
*
|
|
7049
|
-
* Example: setActiveServices({ activeServices: ['service-1', 'service-2'] })
|
|
7050
|
-
* @param {string} payload { activeServices: string[] }
|
|
7051
|
-
*/
|
|
7052
|
-
|
|
7053
|
-
var setActiveServices = function setActiveServices(payload) {
|
|
7054
|
-
return {
|
|
7055
|
-
type: LAYER_SELECT_SET_ACTIVE_SERVICES,
|
|
7056
|
-
payload: payload
|
|
7057
|
-
};
|
|
7058
|
-
};
|
|
7059
7102
|
/**
|
|
7060
7103
|
* Activates given service in the activeServices array
|
|
7061
7104
|
*
|
|
@@ -7085,13 +7128,19 @@
|
|
|
7085
7128
|
/*
|
|
7086
7129
|
* Sets the given keywords to Layer Select store
|
|
7087
7130
|
*
|
|
7088
|
-
* Example:
|
|
7089
|
-
* @param {string[]} payload { keywords: string[] }
|
|
7131
|
+
* Example: addKeywordsAndActiveServices({ serviceUrl: 'https://service.wms', keywords: ['keyword1', 'keyword2'] })
|
|
7132
|
+
* @param {string, string[]} payload {serviceUrl: string keywords: string[] }
|
|
7090
7133
|
*/
|
|
7091
7134
|
|
|
7092
|
-
var
|
|
7135
|
+
var addKeywordsAndActiveServices = function addKeywordsAndActiveServices(payload) {
|
|
7136
|
+
return {
|
|
7137
|
+
type: LAYER_SELECT_ADD_KEYWORDS_AND_ACTIVE_SERVICES,
|
|
7138
|
+
payload: payload
|
|
7139
|
+
};
|
|
7140
|
+
};
|
|
7141
|
+
var updateKeywords = function updateKeywords(payload) {
|
|
7093
7142
|
return {
|
|
7094
|
-
type:
|
|
7143
|
+
type: LAYER_SELECT_UPDATE_KEYWORDS,
|
|
7095
7144
|
payload: payload
|
|
7096
7145
|
};
|
|
7097
7146
|
};
|
|
@@ -7112,62 +7161,26 @@
|
|
|
7112
7161
|
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
7113
7162
|
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
7114
7163
|
* */
|
|
7115
|
-
function
|
|
7116
|
-
var addedService,
|
|
7164
|
+
function newServiceAddedSaga(capturedAction) {
|
|
7165
|
+
var addedService, service, keywords;
|
|
7117
7166
|
return __generator(this, function (_a) {
|
|
7118
7167
|
switch (_a.label) {
|
|
7119
7168
|
case 0:
|
|
7120
7169
|
addedService = capturedAction.payload;
|
|
7121
|
-
|
|
7170
|
+
service = addedService.service;
|
|
7122
7171
|
keywords = addedService.layers.reduce(function (keywordAccumulator, layer) {
|
|
7123
|
-
|
|
7124
|
-
return keywordAccumulator;
|
|
7125
|
-
}
|
|
7126
|
-
|
|
7127
|
-
return keywordAccumulator.concat(layer.keywords);
|
|
7172
|
+
return keywordAccumulator.concat(layer.path, layer.keywords);
|
|
7128
7173
|
}, []);
|
|
7129
|
-
if (!(keywords.length > 0)) return [3
|
|
7130
|
-
/*break*/
|
|
7131
|
-
, 2];
|
|
7132
7174
|
return [4
|
|
7133
7175
|
/*yield*/
|
|
7134
|
-
, effects.put(
|
|
7135
|
-
|
|
7176
|
+
, effects.put(addKeywordsAndActiveServices({
|
|
7177
|
+
serviceUrl: service,
|
|
7136
7178
|
keywords: keywords
|
|
7137
7179
|
}))];
|
|
7138
7180
|
|
|
7139
7181
|
case 1:
|
|
7140
7182
|
_a.sent();
|
|
7141
7183
|
|
|
7142
|
-
_a.label = 2;
|
|
7143
|
-
|
|
7144
|
-
case 2:
|
|
7145
|
-
return [2
|
|
7146
|
-
/*return*/
|
|
7147
|
-
];
|
|
7148
|
-
}
|
|
7149
|
-
});
|
|
7150
|
-
}
|
|
7151
|
-
function newServiceAddedSagaUpdateActiveServices() {
|
|
7152
|
-
var services;
|
|
7153
|
-
return __generator(this, function (_a) {
|
|
7154
|
-
switch (_a.label) {
|
|
7155
|
-
case 0:
|
|
7156
|
-
return [4
|
|
7157
|
-
/*yield*/
|
|
7158
|
-
, effects.select(getServiceIds)];
|
|
7159
|
-
|
|
7160
|
-
case 1:
|
|
7161
|
-
services = _a.sent();
|
|
7162
|
-
return [4
|
|
7163
|
-
/*yield*/
|
|
7164
|
-
, effects.put(setActiveServices({
|
|
7165
|
-
activeServices: services
|
|
7166
|
-
}))];
|
|
7167
|
-
|
|
7168
|
-
case 2:
|
|
7169
|
-
_a.sent();
|
|
7170
|
-
|
|
7171
7184
|
return [2
|
|
7172
7185
|
/*return*/
|
|
7173
7186
|
];
|
|
@@ -7180,18 +7193,11 @@
|
|
|
7180
7193
|
case 0:
|
|
7181
7194
|
return [4
|
|
7182
7195
|
/*yield*/
|
|
7183
|
-
, effects.takeEvery(MAP_SERVICES_SET_LAYERS,
|
|
7196
|
+
, effects.takeEvery(MAP_SERVICES_SET_LAYERS, newServiceAddedSaga)];
|
|
7184
7197
|
|
|
7185
7198
|
case 1:
|
|
7186
7199
|
_a.sent();
|
|
7187
7200
|
|
|
7188
|
-
return [4
|
|
7189
|
-
/*yield*/
|
|
7190
|
-
, effects.takeLatest(MAP_SERVICES_SET_LAYERS, newServiceAddedSagaUpdateActiveServices)];
|
|
7191
|
-
|
|
7192
|
-
case 2:
|
|
7193
|
-
_a.sent();
|
|
7194
|
-
|
|
7195
7201
|
return [2
|
|
7196
7202
|
/*return*/
|
|
7197
7203
|
];
|
|
@@ -7267,7 +7273,7 @@
|
|
|
7267
7273
|
leaf: nodesToRecur.leaf,
|
|
7268
7274
|
name: nodesToRecur.name,
|
|
7269
7275
|
title: nodesToRecur.text,
|
|
7270
|
-
path: nodesToRecur.path
|
|
7276
|
+
path: nodesToRecur.path || [],
|
|
7271
7277
|
children: [],
|
|
7272
7278
|
keywords: nodesToRecur.keywords || [],
|
|
7273
7279
|
"abstract": nodesToRecur["abstract"] || ''
|
|
@@ -7303,20 +7309,20 @@
|
|
|
7303
7309
|
});
|
|
7304
7310
|
};
|
|
7305
7311
|
/**
|
|
7306
|
-
* Returns a promise with
|
|
7312
|
+
* Returns a promise with an array of flattened layerobjects from the WMS GetCapabilities document.
|
|
7307
7313
|
* @param serviceUrl The URL of the WMS service
|
|
7308
7314
|
* @param {boolean} forceReload **optional** forceReload: boolean, true will force the layers to be reloaded from the service, defaults to false
|
|
7309
7315
|
*/
|
|
7310
7316
|
|
|
7311
|
-
var
|
|
7317
|
+
var getLayersFlattenedFromService = function getLayersFlattenedFromService(serviceUrl, forceReload) {
|
|
7312
7318
|
if (forceReload === void 0) {
|
|
7313
7319
|
forceReload = false;
|
|
7314
7320
|
}
|
|
7315
7321
|
|
|
7316
7322
|
return new Promise(function (resolve, reject) {
|
|
7317
7323
|
var serviceObject = webmap.WMGetServiceFromStore(serviceUrl);
|
|
7318
|
-
serviceObject.
|
|
7319
|
-
resolve(
|
|
7324
|
+
serviceObject.getLayerObjectsFlat(function (layers) {
|
|
7325
|
+
resolve(layers);
|
|
7320
7326
|
}, function (error) {
|
|
7321
7327
|
reject(new Error(error));
|
|
7322
7328
|
}, forceReload);
|
|
@@ -8256,7 +8262,7 @@
|
|
|
8256
8262
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8257
8263
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
8258
8264
|
* */
|
|
8259
|
-
var useStyles$
|
|
8265
|
+
var useStyles$H = makeStyles__default["default"]({
|
|
8260
8266
|
buttonDiv: {
|
|
8261
8267
|
position: 'relative'
|
|
8262
8268
|
},
|
|
@@ -8292,7 +8298,7 @@
|
|
|
8292
8298
|
handleClose = _a.handleClose,
|
|
8293
8299
|
_e = _a.layerType,
|
|
8294
8300
|
layerType = _e === void 0 ? LayerType.mapLayer : _e;
|
|
8295
|
-
var classes = useStyles$
|
|
8301
|
+
var classes = useStyles$H();
|
|
8296
8302
|
|
|
8297
8303
|
var _f = __read(React__namespace.useState(''), 2),
|
|
8298
8304
|
serviceURL = _f[0],
|
|
@@ -8457,7 +8463,7 @@
|
|
|
8457
8463
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8458
8464
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
8459
8465
|
* */
|
|
8460
|
-
var useStyles$
|
|
8466
|
+
var useStyles$G = makeStyles__default["default"](function (theme) {
|
|
8461
8467
|
return {
|
|
8462
8468
|
buttonDiv: {
|
|
8463
8469
|
position: 'relative'
|
|
@@ -8492,7 +8498,7 @@
|
|
|
8492
8498
|
_f = _a.shouldFocus,
|
|
8493
8499
|
shouldFocus = _f === void 0 ? false : _f;
|
|
8494
8500
|
var ref = React__namespace.useRef(null);
|
|
8495
|
-
var classes = useStyles$
|
|
8501
|
+
var classes = useStyles$G();
|
|
8496
8502
|
|
|
8497
8503
|
var _g = __read(React__namespace.useState(false), 2),
|
|
8498
8504
|
open = _g[0],
|
|
@@ -8617,7 +8623,7 @@
|
|
|
8617
8623
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8618
8624
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
8619
8625
|
* */
|
|
8620
|
-
var useStyles$
|
|
8626
|
+
var useStyles$F = makeStyles__default["default"](function (theme) {
|
|
8621
8627
|
return {
|
|
8622
8628
|
button: {
|
|
8623
8629
|
width: '24px',
|
|
@@ -8634,7 +8640,7 @@
|
|
|
8634
8640
|
_b = _a.source,
|
|
8635
8641
|
source = _b === void 0 ? 'app' : _b;
|
|
8636
8642
|
var dispatch = reactRedux.useDispatch();
|
|
8637
|
-
var classes = useStyles$
|
|
8643
|
+
var classes = useStyles$F();
|
|
8638
8644
|
var currentActiveMapId = reactRedux.useSelector(function (store) {
|
|
8639
8645
|
return getDialogMapId(store, 'layerSelect');
|
|
8640
8646
|
});
|
|
@@ -8677,7 +8683,7 @@
|
|
|
8677
8683
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8678
8684
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
8679
8685
|
* */
|
|
8680
|
-
var useStyles$
|
|
8686
|
+
var useStyles$E = makeStyles__default["default"]({
|
|
8681
8687
|
row: {
|
|
8682
8688
|
height: '32px'
|
|
8683
8689
|
},
|
|
@@ -8701,7 +8707,7 @@
|
|
|
8701
8707
|
layerManagerWidth = _a.layerManagerWidth,
|
|
8702
8708
|
_e = _a.layerSelect,
|
|
8703
8709
|
layerSelect = _e === void 0 ? false : _e;
|
|
8704
|
-
var classes = useStyles$
|
|
8710
|
+
var classes = useStyles$E();
|
|
8705
8711
|
var columnSizes = layerManagerWidth === LayerManagerWidth.sm ? LayerManagerColumnsSmall() : LayerManagerColumnsLarge();
|
|
8706
8712
|
return /*#__PURE__*/React__namespace.createElement(material.Grid, {
|
|
8707
8713
|
container: true,
|
|
@@ -8975,7 +8981,7 @@
|
|
|
8975
8981
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8976
8982
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
8977
8983
|
* */
|
|
8978
|
-
var useStyles$
|
|
8984
|
+
var useStyles$D = makeStyles__default["default"](function (theme) {
|
|
8979
8985
|
return createStyles__default["default"]({
|
|
8980
8986
|
button: {
|
|
8981
8987
|
height: 28,
|
|
@@ -9037,7 +9043,7 @@
|
|
|
9037
9043
|
testId = _a.testId,
|
|
9038
9044
|
props = __rest(_a, ["tooltipTitle", "onClick", "isActive", "isEnabled", "icon", "testId"]);
|
|
9039
9045
|
|
|
9040
|
-
var classes = useStyles$
|
|
9046
|
+
var classes = useStyles$D({
|
|
9041
9047
|
isActive: isActive,
|
|
9042
9048
|
isEnabled: isEnabled
|
|
9043
9049
|
});
|
|
@@ -9077,7 +9083,7 @@
|
|
|
9077
9083
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9078
9084
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
9079
9085
|
* */
|
|
9080
|
-
var useStyles$
|
|
9086
|
+
var useStyles$C = makeStyles__default["default"](function (theme) {
|
|
9081
9087
|
return createStyles__default["default"]({
|
|
9082
9088
|
checkbox: {
|
|
9083
9089
|
color: 'inherit',
|
|
@@ -9100,7 +9106,7 @@
|
|
|
9100
9106
|
var isEnabled = _a.isEnabled,
|
|
9101
9107
|
title = _a.title,
|
|
9102
9108
|
onChangeEnableLayer = _a.onChangeEnableLayer;
|
|
9103
|
-
var classes = useStyles$
|
|
9109
|
+
var classes = useStyles$C(isEnabled);
|
|
9104
9110
|
|
|
9105
9111
|
var onClick = function onClick() {
|
|
9106
9112
|
onChangeEnableLayer(!isEnabled);
|
|
@@ -9156,7 +9162,7 @@
|
|
|
9156
9162
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9157
9163
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
9158
9164
|
* */
|
|
9159
|
-
var useStyles$
|
|
9165
|
+
var useStyles$B = makeStyles__default["default"](function (theme) {
|
|
9160
9166
|
return createStyles__default["default"]({
|
|
9161
9167
|
dropdownEmpty: {
|
|
9162
9168
|
paddingLeft: 8,
|
|
@@ -9179,7 +9185,7 @@
|
|
|
9179
9185
|
layers = _b === void 0 ? [] : _b,
|
|
9180
9186
|
_c = _a.isEnabled,
|
|
9181
9187
|
isEnabled = _c === void 0 ? true : _c;
|
|
9182
|
-
var classes = useStyles$
|
|
9188
|
+
var classes = useStyles$B();
|
|
9183
9189
|
var containerClass = useTooltipContainerStyles(isEnabled);
|
|
9184
9190
|
|
|
9185
9191
|
if (!layers || !layers.length) {
|
|
@@ -9252,7 +9258,7 @@
|
|
|
9252
9258
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9253
9259
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
9254
9260
|
* */
|
|
9255
|
-
var useStyles$
|
|
9261
|
+
var useStyles$A = makeStyles__default["default"](function (theme) {
|
|
9256
9262
|
return {
|
|
9257
9263
|
opacityDiv: {
|
|
9258
9264
|
height: 'calc(100% - 5px)',
|
|
@@ -9313,7 +9319,7 @@
|
|
|
9313
9319
|
onLayerChangeOpacity = _a.onLayerChangeOpacity,
|
|
9314
9320
|
_b = _a.isEnabled,
|
|
9315
9321
|
isEnabled = _b === void 0 ? true : _b;
|
|
9316
|
-
var classes = useStyles$
|
|
9322
|
+
var classes = useStyles$A();
|
|
9317
9323
|
var sliderClasses = shared.sliderStyles();
|
|
9318
9324
|
var containerClass = useTooltipContainerStyles(isEnabled);
|
|
9319
9325
|
|
|
@@ -9423,7 +9429,7 @@
|
|
|
9423
9429
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9424
9430
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
9425
9431
|
* */
|
|
9426
|
-
var useStyles$
|
|
9432
|
+
var useStyles$z = makeStyles__default["default"](function (theme) {
|
|
9427
9433
|
return createStyles__default["default"]({
|
|
9428
9434
|
icon: {
|
|
9429
9435
|
minWidth: 32,
|
|
@@ -9440,7 +9446,7 @@
|
|
|
9440
9446
|
var title = _a.title,
|
|
9441
9447
|
tooltipTitle = _a.tooltipTitle,
|
|
9442
9448
|
icon = _a.icon;
|
|
9443
|
-
var classes = useStyles$
|
|
9449
|
+
var classes = useStyles$z();
|
|
9444
9450
|
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(material.ListItemIcon, {
|
|
9445
9451
|
className: classes.icon + " icon"
|
|
9446
9452
|
}, icon), /*#__PURE__*/React__namespace.createElement(material.Tooltip, {
|
|
@@ -9468,7 +9474,7 @@
|
|
|
9468
9474
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9469
9475
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
9470
9476
|
* */
|
|
9471
|
-
var useStyles$
|
|
9477
|
+
var useStyles$y = makeStyles__default["default"](function (theme) {
|
|
9472
9478
|
return {
|
|
9473
9479
|
menu: {
|
|
9474
9480
|
backgroundColor: theme.palette.geowebColors.background.surface,
|
|
@@ -9486,7 +9492,7 @@
|
|
|
9486
9492
|
onLayerDuplicate = _a.onLayerDuplicate,
|
|
9487
9493
|
_b = _a.isEnabled,
|
|
9488
9494
|
isEnabled = _b === void 0 ? true : _b;
|
|
9489
|
-
var classes = useStyles$
|
|
9495
|
+
var classes = useStyles$y();
|
|
9490
9496
|
|
|
9491
9497
|
var _c = __read(React__namespace.useState(null), 2),
|
|
9492
9498
|
anchorEl = _c[0],
|
|
@@ -9610,7 +9616,7 @@
|
|
|
9610
9616
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9611
9617
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
9612
9618
|
* */
|
|
9613
|
-
var useStyles$
|
|
9619
|
+
var useStyles$x = makeStyles__default["default"](function () {
|
|
9614
9620
|
return createStyles__default["default"]({
|
|
9615
9621
|
icon: {
|
|
9616
9622
|
width: 20,
|
|
@@ -9624,7 +9630,7 @@
|
|
|
9624
9630
|
onClickDelete = _a.onClickDelete,
|
|
9625
9631
|
_b = _a.isEnabled,
|
|
9626
9632
|
isEnabled = _b === void 0 ? true : _b;
|
|
9627
|
-
var classes = useStyles$
|
|
9633
|
+
var classes = useStyles$x();
|
|
9628
9634
|
return /*#__PURE__*/React__namespace.createElement(LayerManagerButton, {
|
|
9629
9635
|
tooltipTitle: tooltipTitle,
|
|
9630
9636
|
onClick: onClickDelete,
|
|
@@ -9652,7 +9658,7 @@
|
|
|
9652
9658
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9653
9659
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
9654
9660
|
* */
|
|
9655
|
-
var useStyles$
|
|
9661
|
+
var useStyles$w = makeStyles__default["default"](function (theme) {
|
|
9656
9662
|
return createStyles__default["default"]({
|
|
9657
9663
|
icon: {
|
|
9658
9664
|
width: 18,
|
|
@@ -9689,7 +9695,7 @@
|
|
|
9689
9695
|
isActive = _c === void 0 ? false : _c,
|
|
9690
9696
|
_d = _a.isEnabled,
|
|
9691
9697
|
isEnabled = _d === void 0 ? true : _d;
|
|
9692
|
-
var classes = useStyles$
|
|
9698
|
+
var classes = useStyles$w({
|
|
9693
9699
|
isActive: isActive,
|
|
9694
9700
|
isEnabled: isEnabled
|
|
9695
9701
|
});
|
|
@@ -9738,7 +9744,7 @@
|
|
|
9738
9744
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9739
9745
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
9740
9746
|
* */
|
|
9741
|
-
var useStyles$
|
|
9747
|
+
var useStyles$v = makeStyles__default["default"](function (theme) {
|
|
9742
9748
|
return createStyles__default["default"]({
|
|
9743
9749
|
row: {
|
|
9744
9750
|
background: function background(isEnabled) {
|
|
@@ -9790,7 +9796,7 @@
|
|
|
9790
9796
|
layerActiveLayout = _a.layerActiveLayout,
|
|
9791
9797
|
layerManagerWidth = _a.layerManagerWidth,
|
|
9792
9798
|
dragHandle = _a.dragHandle;
|
|
9793
|
-
var classes = useStyles$
|
|
9799
|
+
var classes = useStyles$v(isEnabled);
|
|
9794
9800
|
var columnSizes = layerManagerWidth === LayerManagerWidth.sm ? LayerManagerColumnsSmall() : LayerManagerColumnsLarge();
|
|
9795
9801
|
|
|
9796
9802
|
var onClickRow = function onClickRow() {
|
|
@@ -10372,7 +10378,7 @@
|
|
|
10372
10378
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
10373
10379
|
* */
|
|
10374
10380
|
var TOOLTIP_TITLE = 'Drag a layer up or down';
|
|
10375
|
-
var useStyles$
|
|
10381
|
+
var useStyles$u = makeStyles__default["default"](function (theme) {
|
|
10376
10382
|
return {
|
|
10377
10383
|
dragHandle: {
|
|
10378
10384
|
cursor: 'grab',
|
|
@@ -10396,7 +10402,7 @@
|
|
|
10396
10402
|
index = _c === void 0 ? undefined : _c,
|
|
10397
10403
|
_d = _a.hideTooltip,
|
|
10398
10404
|
hideTooltip = _d === void 0 ? false : _d;
|
|
10399
|
-
var classes = useStyles$
|
|
10405
|
+
var classes = useStyles$u({
|
|
10400
10406
|
isDisabled: isDisabled
|
|
10401
10407
|
});
|
|
10402
10408
|
var tooltipTitle = hideTooltip ? '' : TOOLTIP_TITLE;
|
|
@@ -10429,7 +10435,7 @@
|
|
|
10429
10435
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
10430
10436
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
10431
10437
|
* */
|
|
10432
|
-
var useStyles$
|
|
10438
|
+
var useStyles$t = makeStyles__default["default"](function () {
|
|
10433
10439
|
return {
|
|
10434
10440
|
layerRows: {
|
|
10435
10441
|
width: '100%',
|
|
@@ -10495,7 +10501,7 @@
|
|
|
10495
10501
|
|
|
10496
10502
|
var isSorting = activeDragIndex !== null;
|
|
10497
10503
|
var isDragDisabled = layerIds.length === 1;
|
|
10498
|
-
var classes = useStyles$
|
|
10504
|
+
var classes = useStyles$t(isSorting);
|
|
10499
10505
|
return /*#__PURE__*/React__namespace.createElement(material.Grid, {
|
|
10500
10506
|
container: true,
|
|
10501
10507
|
item: true,
|
|
@@ -10705,7 +10711,7 @@
|
|
|
10705
10711
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
10706
10712
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
10707
10713
|
* */
|
|
10708
|
-
var useStyles$
|
|
10714
|
+
var useStyles$s = makeStyles__default["default"]({
|
|
10709
10715
|
layerRow: {
|
|
10710
10716
|
width: '100%',
|
|
10711
10717
|
height: '36px'
|
|
@@ -10728,7 +10734,7 @@
|
|
|
10728
10734
|
layerManagerWidth = _a.layerManagerWidth,
|
|
10729
10735
|
_d = _a.tooltip,
|
|
10730
10736
|
tooltip = _d === void 0 ? '' : _d;
|
|
10731
|
-
var classes = useStyles$
|
|
10737
|
+
var classes = useStyles$s();
|
|
10732
10738
|
var columnSizes = layerManagerWidth === LayerManagerWidth.sm ? LayerManagerColumnsSmall() : LayerManagerColumnsLarge();
|
|
10733
10739
|
return /*#__PURE__*/React__namespace.createElement(material.Grid, {
|
|
10734
10740
|
container: true,
|
|
@@ -10773,7 +10779,7 @@
|
|
|
10773
10779
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
10774
10780
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
10775
10781
|
* */
|
|
10776
|
-
var useStyles$
|
|
10782
|
+
var useStyles$r = makeStyles__default["default"]({
|
|
10777
10783
|
layerRowContainer: {
|
|
10778
10784
|
position: 'relative',
|
|
10779
10785
|
width: '100%',
|
|
@@ -10808,7 +10814,7 @@
|
|
|
10808
10814
|
layerSelect = _e === void 0 ? false : _e,
|
|
10809
10815
|
_f = _a.showAddLayersTooltip,
|
|
10810
10816
|
showAddLayersTooltip = _f === void 0 ? true : _f;
|
|
10811
|
-
var classes = useStyles$
|
|
10817
|
+
var classes = useStyles$r();
|
|
10812
10818
|
|
|
10813
10819
|
var _g = __read(React__namespace.useState(LayerManagerWidth.lg), 2),
|
|
10814
10820
|
layerManagerWidth = _g[0],
|
|
@@ -11035,7 +11041,7 @@
|
|
|
11035
11041
|
var getActiveServices = reselect.createSelector(layerSelectStore, function (store) {
|
|
11036
11042
|
var _a;
|
|
11037
11043
|
|
|
11038
|
-
return store ? (_a = store === null || store === void 0 ? void 0 : store.filters) === null || _a === void 0 ? void 0 : _a.activeServices :
|
|
11044
|
+
return store ? (_a = store === null || store === void 0 ? void 0 : store.filters) === null || _a === void 0 ? void 0 : _a.activeServices.byId : {};
|
|
11039
11045
|
});
|
|
11040
11046
|
/**
|
|
11041
11047
|
* Returns all ids of enabled services
|
|
@@ -11048,11 +11054,15 @@
|
|
|
11048
11054
|
var getEnabledServiceIds = reselect.createSelector(layerSelectStore, function (store) {
|
|
11049
11055
|
var _a, _b;
|
|
11050
11056
|
|
|
11051
|
-
var enabledServices = (_b = (_a = store === null || store === void 0 ? void 0 : store.filters) === null || _a === void 0 ? void 0 : _a.activeServices.filter(function (service) {
|
|
11052
|
-
|
|
11057
|
+
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) {
|
|
11058
|
+
var _a;
|
|
11059
|
+
|
|
11060
|
+
return (_a = store === null || store === void 0 ? void 0 : store.filters) === null || _a === void 0 ? void 0 : _a.activeServices.byId[service].enabled;
|
|
11053
11061
|
})) !== null && _b !== void 0 ? _b : [];
|
|
11054
11062
|
return enabledServices.map(function (service) {
|
|
11055
|
-
|
|
11063
|
+
var _a;
|
|
11064
|
+
|
|
11065
|
+
return (_a = store === null || store === void 0 ? void 0 : store.filters) === null || _a === void 0 ? void 0 : _a.activeServices.byId[service].id;
|
|
11056
11066
|
});
|
|
11057
11067
|
});
|
|
11058
11068
|
/**
|
|
@@ -11083,41 +11093,39 @@
|
|
|
11083
11093
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
11084
11094
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
11085
11095
|
* */
|
|
11086
|
-
var
|
|
11087
|
-
|
|
11088
|
-
|
|
11089
|
-
|
|
11090
|
-
|
|
11091
|
-
|
|
11092
|
-
|
|
11093
|
-
|
|
11094
|
-
|
|
11095
|
-
|
|
11096
|
-
|
|
11097
|
-
backgroundColor: theme.palette.geowebColors.buttons.primary.fill
|
|
11098
|
-
},
|
|
11099
|
-
'&.MuiButton-outlined': {
|
|
11100
|
-
color: theme.palette.geowebColors.typographyAndIcons.buttonIconTertiaryFlat
|
|
11101
|
-
},
|
|
11102
|
-
color: theme.palette.common.white
|
|
11103
|
-
},
|
|
11104
|
-
cancelButton: {
|
|
11105
|
-
border: "1px solid " + theme.palette.action.disabled,
|
|
11106
|
-
color: theme.palette.text.secondary,
|
|
11107
|
-
'&:hover': {
|
|
11108
|
-
border: "1px solid " + theme.palette.action.disabled
|
|
11109
|
-
}
|
|
11110
|
-
},
|
|
11111
|
-
container: {
|
|
11096
|
+
var style = {
|
|
11097
|
+
dialogTitle: {
|
|
11098
|
+
display: 'flex',
|
|
11099
|
+
justifyContent: 'space-between',
|
|
11100
|
+
padding: '16px 16px 20px 16px',
|
|
11101
|
+
' span': {
|
|
11102
|
+
fontSize: '2.125rem'
|
|
11103
|
+
}
|
|
11104
|
+
},
|
|
11105
|
+
container: function container(theme) {
|
|
11106
|
+
return {
|
|
11112
11107
|
'& .MuiDialog-paper': {
|
|
11113
11108
|
backgroundColor: theme.palette.geowebColors.cards.cardContainer
|
|
11114
11109
|
}
|
|
11115
|
-
}
|
|
11116
|
-
|
|
11117
|
-
|
|
11118
|
-
|
|
11119
|
-
|
|
11120
|
-
|
|
11110
|
+
};
|
|
11111
|
+
},
|
|
11112
|
+
closeBtn: function closeBtn(theme) {
|
|
11113
|
+
return {
|
|
11114
|
+
color: theme.palette.geowebColors.captions.captionDisabled.color,
|
|
11115
|
+
marginTop: 'auto',
|
|
11116
|
+
marginBottom: 'auto'
|
|
11117
|
+
};
|
|
11118
|
+
},
|
|
11119
|
+
textField: {
|
|
11120
|
+
width: '100%'
|
|
11121
|
+
},
|
|
11122
|
+
dialogContent: {
|
|
11123
|
+
padding: '8px 16px'
|
|
11124
|
+
},
|
|
11125
|
+
footerContent: {
|
|
11126
|
+
padding: '16px'
|
|
11127
|
+
}
|
|
11128
|
+
};
|
|
11121
11129
|
var ADD_HEADING = 'Add a new service';
|
|
11122
11130
|
var EDIT_HEADING = 'Edit service';
|
|
11123
11131
|
var SAVE_HEADING = 'Save service';
|
|
@@ -11143,54 +11151,60 @@
|
|
|
11143
11151
|
closePopup = _a.closePopup,
|
|
11144
11152
|
_c = _a.url,
|
|
11145
11153
|
url = _c === void 0 ? '' : _c;
|
|
11146
|
-
var classes = useStyles$r();
|
|
11147
11154
|
return /*#__PURE__*/React__namespace.createElement(material.Dialog, {
|
|
11148
11155
|
open: isOpen,
|
|
11149
11156
|
hideBackdrop: hideBackdrop,
|
|
11150
11157
|
fullWidth: true,
|
|
11151
11158
|
maxWidth: "xs",
|
|
11152
|
-
|
|
11159
|
+
sx: style.container
|
|
11153
11160
|
}, /*#__PURE__*/React__namespace.createElement(material.DialogTitle, {
|
|
11154
|
-
|
|
11161
|
+
sx: style.dialogTitle
|
|
11155
11162
|
}, /*#__PURE__*/React__namespace.createElement(material.Typography, {
|
|
11156
11163
|
variant: "h5",
|
|
11157
11164
|
component: "span"
|
|
11158
11165
|
}, getTitleForVariant(servicePopupVariant)), /*#__PURE__*/React__namespace.createElement(material.IconButton, {
|
|
11159
11166
|
size: "small",
|
|
11160
11167
|
onClick: closePopup,
|
|
11161
|
-
"data-testid": "ClosePopupButtonCross"
|
|
11168
|
+
"data-testid": "ClosePopupButtonCross",
|
|
11169
|
+
sx: style.closeBtn
|
|
11162
11170
|
}, /*#__PURE__*/React__namespace.createElement(iconsMaterial.Close, null))), /*#__PURE__*/React__namespace.createElement(material.DialogContent, {
|
|
11163
|
-
|
|
11171
|
+
sx: style.dialogContent
|
|
11164
11172
|
}, /*#__PURE__*/React__namespace.createElement(material.TextField, {
|
|
11165
|
-
|
|
11173
|
+
sx: style.textField,
|
|
11166
11174
|
variant: "filled",
|
|
11167
11175
|
label: "Service name"
|
|
11168
11176
|
})), /*#__PURE__*/React__namespace.createElement(material.DialogContent, {
|
|
11169
|
-
|
|
11177
|
+
sx: style.dialogContent
|
|
11170
11178
|
}, /*#__PURE__*/React__namespace.createElement(material.TextField, {
|
|
11171
|
-
|
|
11179
|
+
sx: style.textField,
|
|
11172
11180
|
variant: "filled",
|
|
11173
11181
|
label: "Service URL",
|
|
11174
11182
|
defaultValue: url,
|
|
11175
11183
|
id: "service-url"
|
|
11176
11184
|
})), /*#__PURE__*/React__namespace.createElement(material.DialogContent, {
|
|
11177
|
-
|
|
11185
|
+
sx: style.dialogContent
|
|
11178
11186
|
}, /*#__PURE__*/React__namespace.createElement(material.TextField, {
|
|
11179
|
-
|
|
11187
|
+
sx: style.textField,
|
|
11180
11188
|
variant: "filled",
|
|
11181
11189
|
multiline: true,
|
|
11182
11190
|
rows: 4,
|
|
11183
11191
|
label: "Abstracts",
|
|
11184
11192
|
helperText: "Short description of what this service does"
|
|
11185
|
-
})), /*#__PURE__*/React__namespace.createElement(material.DialogActions,
|
|
11186
|
-
|
|
11187
|
-
|
|
11193
|
+
})), /*#__PURE__*/React__namespace.createElement(material.DialogActions, {
|
|
11194
|
+
sx: style.footerContent
|
|
11195
|
+
}, /*#__PURE__*/React__namespace.createElement(material.Button, {
|
|
11196
|
+
variant: "tertiary",
|
|
11188
11197
|
onClick: closePopup,
|
|
11189
|
-
"data-testid": "ClosePopupButtonCancel"
|
|
11198
|
+
"data-testid": "ClosePopupButtonCancel",
|
|
11199
|
+
sx: {
|
|
11200
|
+
width: '117px'
|
|
11201
|
+
}
|
|
11190
11202
|
}, "cancel"), /*#__PURE__*/React__namespace.createElement(material.Button, {
|
|
11191
|
-
|
|
11192
|
-
|
|
11193
|
-
|
|
11203
|
+
sx: {
|
|
11204
|
+
width: '117px',
|
|
11205
|
+
marginLeft: '16px!important'
|
|
11206
|
+
},
|
|
11207
|
+
variant: "primary"
|
|
11194
11208
|
}, "save")));
|
|
11195
11209
|
};
|
|
11196
11210
|
|
|
@@ -11390,6 +11404,56 @@
|
|
|
11390
11404
|
});
|
|
11391
11405
|
};
|
|
11392
11406
|
|
|
11407
|
+
/* *
|
|
11408
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11409
|
+
* you may not use this file except in compliance with the License.
|
|
11410
|
+
* You may obtain a copy of the License at
|
|
11411
|
+
*
|
|
11412
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11413
|
+
*
|
|
11414
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11415
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11416
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11417
|
+
* See the License for the specific language governing permissions and
|
|
11418
|
+
* limitations under the License.
|
|
11419
|
+
*
|
|
11420
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
11421
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
11422
|
+
* */
|
|
11423
|
+
var filterLayersFromService = function filterLayersFromService(serviceId, services, keywords, searchString) {
|
|
11424
|
+
var activeKeywords = keywords.filter(function (keyword) {
|
|
11425
|
+
return keyword.checked;
|
|
11426
|
+
});
|
|
11427
|
+
var keywordList = activeKeywords.map(function (keyword) {
|
|
11428
|
+
return keyword.id;
|
|
11429
|
+
});
|
|
11430
|
+
var allKeywordsActive = keywords.every(function (keyword) {
|
|
11431
|
+
return keyword.checked;
|
|
11432
|
+
});
|
|
11433
|
+
|
|
11434
|
+
if (searchString === '' && allKeywordsActive) {
|
|
11435
|
+
return services[serviceId].layers.filter(function (layer) {
|
|
11436
|
+
return layer.leaf;
|
|
11437
|
+
});
|
|
11438
|
+
}
|
|
11439
|
+
|
|
11440
|
+
var searchStringArray = searchString.split(' ');
|
|
11441
|
+
return services[serviceId].layers.filter(function (layer) {
|
|
11442
|
+
return searchStringArray.every(function (search) {
|
|
11443
|
+
var layerPathAndKeywords = layer.path.concat(layer.keywords);
|
|
11444
|
+
return (!!layerPathAndKeywords && !layerPathAndKeywords.every(function (keyword) {
|
|
11445
|
+
return !keywordList.includes(keyword);
|
|
11446
|
+
}) || 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) {
|
|
11447
|
+
return !keyword.toLowerCase().includes(search.toLowerCase());
|
|
11448
|
+
}) || !!layer.path && !layer.path.every(function (group) {
|
|
11449
|
+
return !group.toLowerCase().includes(search.toLowerCase());
|
|
11450
|
+
}) || services[serviceId].name.toLowerCase().includes(search.toLowerCase()));
|
|
11451
|
+
});
|
|
11452
|
+
}).filter(function (layer) {
|
|
11453
|
+
return layer.leaf;
|
|
11454
|
+
});
|
|
11455
|
+
};
|
|
11456
|
+
|
|
11393
11457
|
/* *
|
|
11394
11458
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11395
11459
|
* you may not use this file except in compliance with the License.
|
|
@@ -11453,27 +11517,19 @@
|
|
|
11453
11517
|
var services = _a.services,
|
|
11454
11518
|
serviceIds = _a.serviceIds,
|
|
11455
11519
|
layerSelectHeight = _a.layerSelectHeight,
|
|
11456
|
-
searchString = _a.searchString
|
|
11520
|
+
searchString = _a.searchString,
|
|
11521
|
+
keywords = _a.keywords;
|
|
11457
11522
|
var classes = useStyles$p();
|
|
11458
11523
|
|
|
11459
11524
|
var _b = __read(React__namespace.useState(0), 2),
|
|
11460
11525
|
numberOfLayers = _b[0],
|
|
11461
11526
|
setNumberOfLayers = _b[1];
|
|
11462
11527
|
|
|
11463
|
-
var filterLayersFromService = React__namespace.useCallback(function (serviceId) {
|
|
11464
|
-
if (searchString === '') {
|
|
11465
|
-
return services[serviceId].layers;
|
|
11466
|
-
}
|
|
11467
|
-
|
|
11468
|
-
return services[serviceId].layers.filter(function (layer) {
|
|
11469
|
-
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());
|
|
11470
|
-
});
|
|
11471
|
-
}, [services, searchString]);
|
|
11472
11528
|
React__namespace.useEffect(function () {
|
|
11473
11529
|
setNumberOfLayers(serviceIds.reduce(function (totalNumberOfLayers, serviceId) {
|
|
11474
|
-
return totalNumberOfLayers + filterLayersFromService(serviceId).length;
|
|
11530
|
+
return totalNumberOfLayers + filterLayersFromService(serviceId, services, keywords, searchString).length;
|
|
11475
11531
|
}, 0));
|
|
11476
|
-
}, [serviceIds,
|
|
11532
|
+
}, [serviceIds, keywords, services, searchString]);
|
|
11477
11533
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
11478
11534
|
"data-testid": "layerList"
|
|
11479
11535
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
@@ -11484,7 +11540,7 @@
|
|
|
11484
11540
|
overflow: 'auto'
|
|
11485
11541
|
}
|
|
11486
11542
|
}, serviceIds.map(function (serviceId) {
|
|
11487
|
-
return filterLayersFromService(serviceId).map(function (layer) {
|
|
11543
|
+
return filterLayersFromService(serviceId, services, keywords, searchString).map(function (layer) {
|
|
11488
11544
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
11489
11545
|
key: serviceId + "-" + layer.name,
|
|
11490
11546
|
className: classes.layerRow,
|
|
@@ -11528,6 +11584,9 @@
|
|
|
11528
11584
|
var enabledServiceIds = reactRedux.useSelector(function (store) {
|
|
11529
11585
|
return getEnabledServiceIds(store);
|
|
11530
11586
|
});
|
|
11587
|
+
var keywords = reactRedux.useSelector(function (store) {
|
|
11588
|
+
return getKeywords(store);
|
|
11589
|
+
});
|
|
11531
11590
|
var searchString = reactRedux.useSelector(function (store) {
|
|
11532
11591
|
return getSearchFilter(store);
|
|
11533
11592
|
});
|
|
@@ -11535,6 +11594,7 @@
|
|
|
11535
11594
|
services: services,
|
|
11536
11595
|
serviceIds: enabledServiceIds,
|
|
11537
11596
|
layerSelectHeight: layerSelectHeight,
|
|
11597
|
+
keywords: keywords,
|
|
11538
11598
|
searchString: searchString
|
|
11539
11599
|
});
|
|
11540
11600
|
};
|
|
@@ -11642,29 +11702,31 @@
|
|
|
11642
11702
|
});
|
|
11643
11703
|
|
|
11644
11704
|
var toggleChip = function toggleChip(service) {
|
|
11645
|
-
var _a;
|
|
11646
|
-
|
|
11647
11705
|
if (service === 'all') {
|
|
11648
|
-
if (
|
|
11649
|
-
|
|
11650
|
-
|
|
11651
|
-
|
|
11652
|
-
|
|
11653
|
-
|
|
11654
|
-
|
|
11655
|
-
|
|
11656
|
-
|
|
11657
|
-
|
|
11658
|
-
|
|
11659
|
-
|
|
11660
|
-
|
|
11661
|
-
|
|
11706
|
+
if (isEnabled) {
|
|
11707
|
+
Object.values(activeServices).forEach(function (s) {
|
|
11708
|
+
if (s.enabled) dispatch(disableActiveService({
|
|
11709
|
+
serviceUrl: s.id,
|
|
11710
|
+
keywords: s.keywordsPerService
|
|
11711
|
+
}));
|
|
11712
|
+
});
|
|
11713
|
+
} else {
|
|
11714
|
+
Object.values(activeServices).forEach(function (s) {
|
|
11715
|
+
if (!s.enabled) dispatch(enableActiveService({
|
|
11716
|
+
serviceUrl: s.id,
|
|
11717
|
+
keywords: s.keywordsPerService
|
|
11718
|
+
}));
|
|
11719
|
+
});
|
|
11720
|
+
}
|
|
11721
|
+
} else if (isEnabled) {
|
|
11662
11722
|
dispatch(disableActiveService({
|
|
11663
|
-
|
|
11723
|
+
serviceUrl: service,
|
|
11724
|
+
keywords: activeServices[service].keywordsPerService
|
|
11664
11725
|
}));
|
|
11665
11726
|
} else {
|
|
11666
11727
|
dispatch(enableActiveService({
|
|
11667
|
-
|
|
11728
|
+
serviceUrl: service,
|
|
11729
|
+
keywords: activeServices[service].keywordsPerService
|
|
11668
11730
|
}));
|
|
11669
11731
|
}
|
|
11670
11732
|
};
|
|
@@ -11774,7 +11836,7 @@
|
|
|
11774
11836
|
setWidth(ref.current.scrollWidth + 50);
|
|
11775
11837
|
setMargin(Math.max(0, Math.min(width - layerSelectWidth, margin)));
|
|
11776
11838
|
}, [services, layerSelectWidth, width, margin]);
|
|
11777
|
-
var isAllEnabled = activeServices.every(function (activeService) {
|
|
11839
|
+
var isAllEnabled = Object.values(activeServices).every(function (activeService) {
|
|
11778
11840
|
return activeService.enabled;
|
|
11779
11841
|
});
|
|
11780
11842
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
@@ -11794,13 +11856,10 @@
|
|
|
11794
11856
|
}), Object.keys(services).map(function (service) {
|
|
11795
11857
|
var _a;
|
|
11796
11858
|
|
|
11797
|
-
var isServiceEnabled = (_a = activeServices.find(function (activeService) {
|
|
11798
|
-
return activeService.id === services[service].service;
|
|
11799
|
-
})) === null || _a === void 0 ? void 0 : _a.enabled;
|
|
11800
11859
|
return /*#__PURE__*/React__namespace.createElement(ServiceChipConnect, {
|
|
11801
11860
|
key: services[service].id,
|
|
11802
11861
|
service: services[service],
|
|
11803
|
-
isEnabled:
|
|
11862
|
+
isEnabled: (_a = activeServices[service]) === null || _a === void 0 ? void 0 : _a.enabled
|
|
11804
11863
|
});
|
|
11805
11864
|
})), layerSelectWidth + margin < width && /*#__PURE__*/React__namespace.createElement(iconsMaterial.ChevronRight, {
|
|
11806
11865
|
className: classes.scrollArrowRight,
|
|
@@ -12036,7 +12095,7 @@
|
|
|
12036
12095
|
color: theme.palette.geowebColors.customSlider.thumb
|
|
12037
12096
|
},
|
|
12038
12097
|
'&$checked + $track': {
|
|
12039
|
-
backgroundColor: theme.palette.geowebColors.buttons.primary.fill
|
|
12098
|
+
backgroundColor: theme.palette.geowebColors.buttons.primary["default"].fill
|
|
12040
12099
|
}
|
|
12041
12100
|
},
|
|
12042
12101
|
checked: {},
|
|
@@ -12074,7 +12133,7 @@
|
|
|
12074
12133
|
fontSize: '12px'
|
|
12075
12134
|
},
|
|
12076
12135
|
onlyByttonText: {
|
|
12077
|
-
color: theme.palette.geowebColors.buttons.primary.fill,
|
|
12136
|
+
color: theme.palette.geowebColors.buttons.primary["default"].fill,
|
|
12078
12137
|
fontSize: '14px',
|
|
12079
12138
|
fontWeight: 500
|
|
12080
12139
|
},
|
|
@@ -12184,7 +12243,7 @@
|
|
|
12184
12243
|
});
|
|
12185
12244
|
|
|
12186
12245
|
var KeywordFilterResults = function KeywordFilterResults(_a) {
|
|
12187
|
-
var
|
|
12246
|
+
var keywordObjects = _a.keywordObjects,
|
|
12188
12247
|
mapId = _a.mapId,
|
|
12189
12248
|
bounds = _a.bounds,
|
|
12190
12249
|
_b = _a.onClose,
|
|
@@ -12196,25 +12255,22 @@
|
|
|
12196
12255
|
_d = _a.order,
|
|
12197
12256
|
order = _d === void 0 ? 0 : _d,
|
|
12198
12257
|
_e = _a.source,
|
|
12199
|
-
source = _e === void 0 ? 'module' : _e
|
|
12258
|
+
source = _e === void 0 ? 'module' : _e,
|
|
12259
|
+
updateKeywords = _a.updateKeywords;
|
|
12200
12260
|
var classes = useStyles$j();
|
|
12201
12261
|
|
|
12202
12262
|
var _f = __read(React__namespace.useState(true), 2),
|
|
12203
12263
|
allSelected = _f[0],
|
|
12204
12264
|
setAllSelected = _f[1];
|
|
12205
12265
|
|
|
12206
|
-
var _g = __read(React__namespace.useState(arrayOfKeywordObjects), 2),
|
|
12207
|
-
keywordObjects = _g[0],
|
|
12208
|
-
setKeywordObjects = _g[1];
|
|
12209
|
-
|
|
12210
12266
|
var toggleSelectAll = function toggleSelectAll() {
|
|
12211
12267
|
var editedKeywords = keywordObjects.map(function (object) {
|
|
12212
12268
|
return __assign(__assign({}, object), {
|
|
12213
12269
|
checked: !allSelected
|
|
12214
12270
|
});
|
|
12215
12271
|
});
|
|
12216
|
-
setKeywordObjects(editedKeywords);
|
|
12217
12272
|
setAllSelected(!allSelected);
|
|
12273
|
+
updateKeywords(editedKeywords);
|
|
12218
12274
|
};
|
|
12219
12275
|
|
|
12220
12276
|
var toggleCheckbox = function toggleCheckbox(listIndex) {
|
|
@@ -12223,7 +12279,7 @@
|
|
|
12223
12279
|
checked: !object.checked
|
|
12224
12280
|
}) : object;
|
|
12225
12281
|
});
|
|
12226
|
-
|
|
12282
|
+
updateKeywords(editedKeywords);
|
|
12227
12283
|
};
|
|
12228
12284
|
|
|
12229
12285
|
var selectOnlyOne = function selectOnlyOne(listIndex) {
|
|
@@ -12234,7 +12290,7 @@
|
|
|
12234
12290
|
checked: false
|
|
12235
12291
|
});
|
|
12236
12292
|
});
|
|
12237
|
-
|
|
12293
|
+
updateKeywords(editedKeywords);
|
|
12238
12294
|
}; // If even one checkbox is unchecked, switch toggleAll off
|
|
12239
12295
|
// If all checkboxes becomes checked, switch toggleAll on
|
|
12240
12296
|
|
|
@@ -12245,9 +12301,6 @@
|
|
|
12245
12301
|
});
|
|
12246
12302
|
setAllSelected(checked);
|
|
12247
12303
|
}, [keywordObjects]);
|
|
12248
|
-
React__namespace.useEffect(function () {
|
|
12249
|
-
setKeywordObjects(arrayOfKeywordObjects);
|
|
12250
|
-
}, [arrayOfKeywordObjects]);
|
|
12251
12304
|
return /*#__PURE__*/React__namespace.createElement(shared.ToolContainerDraggable, {
|
|
12252
12305
|
title: showTitle ? "Filter Results " + mapId : 'Filter Results',
|
|
12253
12306
|
"data-testid": "keywordFilterResults",
|
|
@@ -12296,7 +12349,9 @@
|
|
|
12296
12349
|
}
|
|
12297
12350
|
}, keywordObjects.map(function (_a, index) {
|
|
12298
12351
|
var id = _a.id,
|
|
12299
|
-
checked = _a.checked
|
|
12352
|
+
checked = _a.checked,
|
|
12353
|
+
amountVisible = _a.amountVisible;
|
|
12354
|
+
if (amountVisible === 0) return null;
|
|
12300
12355
|
return /*#__PURE__*/React__namespace.createElement(FilterListItem, {
|
|
12301
12356
|
key: id + "-" + index,
|
|
12302
12357
|
index: index,
|
|
@@ -12353,7 +12408,12 @@
|
|
|
12353
12408
|
});
|
|
12354
12409
|
var uiIsOrderedOnTop = reactRedux.useSelector(function (store) {
|
|
12355
12410
|
return getDialogIsOrderedOnTop(store, 'keywordFilter');
|
|
12356
|
-
});
|
|
12411
|
+
});
|
|
12412
|
+
var updateKeywords$1 = React__namespace.useCallback(function (keywords) {
|
|
12413
|
+
dispatch(updateKeywords({
|
|
12414
|
+
keywords: keywords
|
|
12415
|
+
}));
|
|
12416
|
+
}, [dispatch]); // Check to ensure the currently active map is still present on screen - if not, close the dialog
|
|
12357
12417
|
|
|
12358
12418
|
React__namespace.useEffect(function () {
|
|
12359
12419
|
if (mapId !== '' && !isMapPresent) {
|
|
@@ -12389,7 +12449,7 @@
|
|
|
12389
12449
|
return getKeywords(store);
|
|
12390
12450
|
});
|
|
12391
12451
|
return /*#__PURE__*/React__namespace.createElement(KeywordFilterResults, {
|
|
12392
|
-
|
|
12452
|
+
keywordObjects: keywords,
|
|
12393
12453
|
mapId: mapId,
|
|
12394
12454
|
bounds: bounds,
|
|
12395
12455
|
isOpen: isOpenInStore,
|
|
@@ -12397,7 +12457,8 @@
|
|
|
12397
12457
|
showTitle: showTitle,
|
|
12398
12458
|
onMouseDown: onOrderDialog,
|
|
12399
12459
|
order: uiOrder,
|
|
12400
|
-
source: uiSource
|
|
12460
|
+
source: uiSource,
|
|
12461
|
+
updateKeywords: updateKeywords$1
|
|
12401
12462
|
});
|
|
12402
12463
|
};
|
|
12403
12464
|
|
|
@@ -12494,7 +12555,7 @@
|
|
|
12494
12555
|
React__namespace.useEffect(function () {
|
|
12495
12556
|
if (isOpenInStore && preloadedServices && preloadedServices.length > 0) {
|
|
12496
12557
|
preloadedServices.forEach(function (service) {
|
|
12497
|
-
|
|
12558
|
+
getLayersFlattenedFromService(service.url).then(function (layers) {
|
|
12498
12559
|
if (isMounted.current) {
|
|
12499
12560
|
serviceSetLayers$1({
|
|
12500
12561
|
id: service.id,
|
|
@@ -21170,7 +21231,7 @@
|
|
|
21170
21231
|
return /*#__PURE__*/React__namespace.createElement(shared.ToolContainerDraggable, {
|
|
21171
21232
|
startPosition: {
|
|
21172
21233
|
right: 20,
|
|
21173
|
-
top:
|
|
21234
|
+
top: 50
|
|
21174
21235
|
},
|
|
21175
21236
|
minWidth: 100,
|
|
21176
21237
|
onClose: onClose,
|
|
@@ -22785,7 +22846,6 @@
|
|
|
22785
22846
|
exports.filterNonTimeDimensions = filterNonTimeDimensions;
|
|
22786
22847
|
exports.generateLayerId = generateLayerId;
|
|
22787
22848
|
exports.generateMapId = generateMapId;
|
|
22788
|
-
exports.generateScreenId = generateScreenId;
|
|
22789
22849
|
exports.generateTimesliderId = generateTimesliderId;
|
|
22790
22850
|
exports.getFirstTimeStepForLayerId = getFirstTimeStepForLayerId;
|
|
22791
22851
|
exports.getLastTimeStepForLayerId = getLastTimeStepForLayerId;
|