@opengeoweb/workspace 13.2.1 → 14.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.esm.js
CHANGED
|
@@ -16,7 +16,7 @@ import { AuthenticationProvider, useAuthenticationContext, GEOWEB_ROLE_PRESETS_A
|
|
|
16
16
|
import { QueryClient, QueryClientProvider, useMutation } from '@tanstack/react-query';
|
|
17
17
|
import i18n from 'i18next';
|
|
18
18
|
import { webmapReactTranslations, WEBMAP_REACT_NAMESPACE } from '@opengeoweb/webmap-react';
|
|
19
|
-
import { coreTranslations, CORE_NAMESPACE } from '@opengeoweb/core';
|
|
19
|
+
import { coreTranslations, CORE_NAMESPACE, LoadingIndicatorProgressBar } from '@opengeoweb/core';
|
|
20
20
|
import { formFieldsTranslations, FORM_FIELDS_NAMESPACE, ReactHookFormTextField, ReactHookFormHiddenInput, ReactHookFormProvider, defaultFormOptions } from '@opengeoweb/form-fields';
|
|
21
21
|
import * as React from 'react';
|
|
22
22
|
import React__default, { useCallback, useEffect } from 'react';
|
|
@@ -993,9 +993,7 @@ var slice$3 = createSlice({
|
|
|
993
993
|
initialState: initialState$3,
|
|
994
994
|
name: 'workspaceList',
|
|
995
995
|
reducers: {
|
|
996
|
-
fetchWorkspaceList: function fetchWorkspaceList(draft,
|
|
997
|
-
// eslint-disable-next-line no-unused-vars
|
|
998
|
-
action) {
|
|
996
|
+
fetchWorkspaceList: function fetchWorkspaceList(draft, _action) {
|
|
999
997
|
draft.isFetching = true;
|
|
1000
998
|
draft.error = undefined;
|
|
1001
999
|
},
|
|
@@ -1015,9 +1013,7 @@ var slice$3 = createSlice({
|
|
|
1015
1013
|
isFetching: false
|
|
1016
1014
|
});
|
|
1017
1015
|
},
|
|
1018
|
-
onSuccessWorkspaceSaveDialog: function onSuccessWorkspaceSaveDialog(draft,
|
|
1019
|
-
// eslint-disable-next-line no-unused-vars
|
|
1020
|
-
action) {
|
|
1016
|
+
onSuccessWorkspaceSaveDialog: function onSuccessWorkspaceSaveDialog(draft, action) {
|
|
1021
1017
|
if (!draft.workspaceActionDialog) {
|
|
1022
1018
|
return;
|
|
1023
1019
|
}
|
|
@@ -1027,9 +1023,7 @@ var slice$3 = createSlice({
|
|
|
1027
1023
|
}
|
|
1028
1024
|
draft.workspaceActionDialog.hasSaved = true;
|
|
1029
1025
|
},
|
|
1030
|
-
submitFormWorkspaceActionDialogOptions: function submitFormWorkspaceActionDialogOptions(draft,
|
|
1031
|
-
// eslint-disable-next-line no-unused-vars
|
|
1032
|
-
action) {
|
|
1026
|
+
submitFormWorkspaceActionDialogOptions: function submitFormWorkspaceActionDialogOptions(draft, _action) {
|
|
1033
1027
|
if (!draft.workspaceActionDialog) {
|
|
1034
1028
|
return;
|
|
1035
1029
|
}
|
|
@@ -1040,9 +1034,7 @@ var slice$3 = createSlice({
|
|
|
1040
1034
|
delete draft.workspaceActionDialog;
|
|
1041
1035
|
},
|
|
1042
1036
|
// action is intercepted in mapPresets/listener
|
|
1043
|
-
onSuccessWorkspacePresetAction: function onSuccessWorkspacePresetAction(draft,
|
|
1044
|
-
// eslint-disable-next-line no-unused-vars
|
|
1045
|
-
action) {
|
|
1037
|
+
onSuccessWorkspacePresetAction: function onSuccessWorkspacePresetAction(draft, _action) {
|
|
1046
1038
|
delete draft.workspaceActionDialog;
|
|
1047
1039
|
},
|
|
1048
1040
|
onErrorWorkspacePresetAction: function onErrorWorkspacePresetAction(draft, action) {
|
|
@@ -1326,11 +1318,7 @@ var slice$2 = createSlice({
|
|
|
1326
1318
|
}
|
|
1327
1319
|
},
|
|
1328
1320
|
// action is intercepted in mapPresets/listener
|
|
1329
|
-
onSuccessViewPresetAction: function onSuccessViewPresetAction(
|
|
1330
|
-
// eslint-disable-next-line no-unused-vars
|
|
1331
|
-
draft,
|
|
1332
|
-
// eslint-disable-next-line no-unused-vars
|
|
1333
|
-
action) {},
|
|
1321
|
+
onSuccessViewPresetAction: function onSuccessViewPresetAction(_draft, _action) {},
|
|
1334
1322
|
registerViewPreset: function registerViewPreset(draft, action) {
|
|
1335
1323
|
var _action$payload8 = action.payload,
|
|
1336
1324
|
mapId = _action$payload8.panelId,
|
|
@@ -1618,6 +1606,7 @@ var filterAndSortPresets = function filterAndSortPresets(presets, selectedFilter
|
|
|
1618
1606
|
return [].concat(systemPresets, personalPresets, sharedPresets);
|
|
1619
1607
|
};
|
|
1620
1608
|
|
|
1609
|
+
/* eslint-disable no-redeclare */
|
|
1621
1610
|
/* *
|
|
1622
1611
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1623
1612
|
* you may not use this file except in compliance with the License.
|
|
@@ -1637,7 +1626,7 @@ var filterAndSortPresets = function filterAndSortPresets(presets, selectedFilter
|
|
|
1637
1626
|
* */
|
|
1638
1627
|
var getSnackbarMessage$1 = function getSnackbarMessage(action, title, is_shared) {
|
|
1639
1628
|
// Trim and add quotes
|
|
1640
|
-
var trimmedTitle =
|
|
1629
|
+
var trimmedTitle = title.trim();
|
|
1641
1630
|
switch (action) {
|
|
1642
1631
|
case WorkspacePresetAction.DELETE:
|
|
1643
1632
|
return {
|
|
@@ -1843,11 +1832,7 @@ var slice$1 = createSlice({
|
|
|
1843
1832
|
draft.hasChanges = true;
|
|
1844
1833
|
draft.viewType = getViewType$1(draft.views.allIds.length, action.payload.componentType);
|
|
1845
1834
|
},
|
|
1846
|
-
setNewWorkspaceView: function setNewWorkspaceView(
|
|
1847
|
-
// eslint-disable-next-line no-unused-vars
|
|
1848
|
-
draft,
|
|
1849
|
-
// eslint-disable-next-line no-unused-vars
|
|
1850
|
-
action) {},
|
|
1835
|
+
setNewWorkspaceView: function setNewWorkspaceView(_draft, _action) {},
|
|
1851
1836
|
deleteWorkspaceView: function deleteWorkspaceView(draft, action) {
|
|
1852
1837
|
var id = action.payload.id;
|
|
1853
1838
|
draft.views.allIds = draft.views.allIds.filter(function (viewId) {
|
|
@@ -1906,9 +1891,7 @@ var slice$1 = createSlice({
|
|
|
1906
1891
|
draft.scope = workspacePreset.scope;
|
|
1907
1892
|
draft.syncGroups = [];
|
|
1908
1893
|
},
|
|
1909
|
-
changeToEmptyMapWorkspace: function changeToEmptyMapWorkspace(draft,
|
|
1910
|
-
// eslint-disable-next-line no-unused-vars
|
|
1911
|
-
action) {
|
|
1894
|
+
changeToEmptyMapWorkspace: function changeToEmptyMapWorkspace(draft, action) {
|
|
1912
1895
|
return draft;
|
|
1913
1896
|
},
|
|
1914
1897
|
setPreset: function setPreset(draft, action) {
|
|
@@ -1950,9 +1933,7 @@ var slice$1 = createSlice({
|
|
|
1950
1933
|
});
|
|
1951
1934
|
},
|
|
1952
1935
|
// workspaces
|
|
1953
|
-
fetchWorkspace: function fetchWorkspace(draft,
|
|
1954
|
-
// eslint-disable-next-line no-unused-vars
|
|
1955
|
-
action) {
|
|
1936
|
+
fetchWorkspace: function fetchWorkspace(draft, _action) {
|
|
1956
1937
|
draft.isLoading = true;
|
|
1957
1938
|
draft.error = undefined;
|
|
1958
1939
|
},
|
|
@@ -1965,21 +1946,13 @@ var slice$1 = createSlice({
|
|
|
1965
1946
|
draft.title = workspace == null ? void 0 : workspace.title;
|
|
1966
1947
|
}
|
|
1967
1948
|
},
|
|
1968
|
-
errorWorkspace: function errorWorkspace(draft,
|
|
1969
|
-
// eslint-disable-next-line no-unused-vars
|
|
1970
|
-
action) {
|
|
1949
|
+
errorWorkspace: function errorWorkspace(draft, action) {
|
|
1971
1950
|
var error = action.payload.error;
|
|
1972
1951
|
draft.isLoading = false;
|
|
1973
1952
|
draft.error = error;
|
|
1974
1953
|
},
|
|
1975
|
-
fetchWorkspaceViewPreset: function fetchWorkspaceViewPreset(
|
|
1976
|
-
|
|
1977
|
-
draft,
|
|
1978
|
-
// eslint-disable-next-line no-unused-vars
|
|
1979
|
-
action) {},
|
|
1980
|
-
saveWorkspacePreset: function saveWorkspacePreset(draft,
|
|
1981
|
-
// eslint-disable-next-line no-unused-vars
|
|
1982
|
-
action) {
|
|
1954
|
+
fetchWorkspaceViewPreset: function fetchWorkspaceViewPreset(_draft, _action) {},
|
|
1955
|
+
saveWorkspacePreset: function saveWorkspacePreset(draft, _action) {
|
|
1983
1956
|
draft.isLoading = true;
|
|
1984
1957
|
draft.error = undefined;
|
|
1985
1958
|
}
|
|
@@ -2056,7 +2029,6 @@ var slice$1 = createSlice({
|
|
|
2056
2029
|
});
|
|
2057
2030
|
}
|
|
2058
2031
|
});
|
|
2059
|
-
// eslint-disable-next-line prefer-destructuring
|
|
2060
2032
|
var workspaceReducer = slice$1.reducer;
|
|
2061
2033
|
var workspaceActions = Object.assign({}, slice$1.actions);
|
|
2062
2034
|
|
|
@@ -2263,6 +2235,8 @@ var emptyViewPreset = function emptyViewPreset(componentType) {
|
|
|
2263
2235
|
},
|
|
2264
2236
|
services: []
|
|
2265
2237
|
},
|
|
2238
|
+
Soundings: undefined,
|
|
2239
|
+
// TODO: empty soundings preset https://gitlab.com/opengeoweb/opengeoweb/-/issues/6029
|
|
2266
2240
|
ViewError: undefined,
|
|
2267
2241
|
ViewLoading: undefined,
|
|
2268
2242
|
MultiMap: undefined,
|
|
@@ -4936,16 +4910,16 @@ workspaceListener.startListening({
|
|
|
4936
4910
|
workspaceListener.startListening({
|
|
4937
4911
|
actionCreator: workspaceActions.fetchWorkspace,
|
|
4938
4912
|
effect: function () {
|
|
4939
|
-
var _effect5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
4940
|
-
var payload, workspaceId, workspaceApi, _yield$workspaceApi$g2, workspaceData, fullLoadingWorkspace, workspaceIdsInBatches, errorType;
|
|
4941
|
-
return _regeneratorRuntime().wrap(function
|
|
4942
|
-
while (1) switch (
|
|
4913
|
+
var _effect5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(_ref6, listenerApi) {
|
|
4914
|
+
var payload, workspaceId, workspaceApi, _yield$workspaceApi$g2, workspaceData, fullLoadingWorkspace, workspaceIdsInBatches, actionsToDispatch, errorType;
|
|
4915
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
4916
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
4943
4917
|
case 0:
|
|
4944
4918
|
payload = _ref6.payload;
|
|
4945
4919
|
// Cancel any in-progress instances of this listener
|
|
4946
4920
|
listenerApi.cancelActiveListeners();
|
|
4947
4921
|
workspaceId = payload.workspaceId;
|
|
4948
|
-
|
|
4922
|
+
_context7.prev = 3;
|
|
4949
4923
|
listenerApi.dispatch(routerActions.navigateToUrl({
|
|
4950
4924
|
url: getWorkspaceRouteUrl(workspaceId)
|
|
4951
4925
|
}));
|
|
@@ -4954,13 +4928,13 @@ workspaceListener.startListening({
|
|
|
4954
4928
|
}));
|
|
4955
4929
|
// fetch workspace
|
|
4956
4930
|
workspaceApi = getWorkspaceApi();
|
|
4957
|
-
|
|
4931
|
+
_context7.next = 9;
|
|
4958
4932
|
return workspaceApi.getWorkspacePreset(workspaceId);
|
|
4959
4933
|
case 9:
|
|
4960
|
-
_yield$workspaceApi$g2 =
|
|
4934
|
+
_yield$workspaceApi$g2 = _context7.sent;
|
|
4961
4935
|
workspaceData = _yield$workspaceApi$g2.data;
|
|
4962
4936
|
if (workspaceData) {
|
|
4963
|
-
|
|
4937
|
+
_context7.next = 13;
|
|
4964
4938
|
break;
|
|
4965
4939
|
}
|
|
4966
4940
|
throw new Error(ERROR_NOT_FOUND);
|
|
@@ -4974,60 +4948,52 @@ workspaceListener.startListening({
|
|
|
4974
4948
|
listenerApi.dispatch(workspaceActions.changePreset({
|
|
4975
4949
|
workspacePreset: fullLoadingWorkspace
|
|
4976
4950
|
}));
|
|
4977
|
-
// fetch all individual view presets in batches
|
|
4951
|
+
// fetch all individual view presets in batches and collect all actions
|
|
4978
4952
|
workspaceIdsInBatches = getListInChunks(workspaceData.views);
|
|
4979
|
-
|
|
4953
|
+
actionsToDispatch = [];
|
|
4954
|
+
_context7.next = 20;
|
|
4980
4955
|
return Promise.all(workspaceIdsInBatches.map(/*#__PURE__*/function () {
|
|
4981
|
-
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
4982
|
-
return _regeneratorRuntime().wrap(function
|
|
4983
|
-
while (1) switch (
|
|
4956
|
+
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(batchCall) {
|
|
4957
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
4958
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
4984
4959
|
case 0:
|
|
4985
|
-
|
|
4986
|
-
return Promise.all(batchCall.map(
|
|
4987
|
-
|
|
4988
|
-
|
|
4989
|
-
|
|
4990
|
-
|
|
4991
|
-
return _context6.abrupt("return", fetchWorkspaceViewPreset(listenerApi.dispatch, view.viewPresetId, view.mosaicNodeId));
|
|
4992
|
-
case 1:
|
|
4993
|
-
case "end":
|
|
4994
|
-
return _context6.stop();
|
|
4995
|
-
}
|
|
4996
|
-
}, _callee6);
|
|
4997
|
-
}));
|
|
4998
|
-
return function (_x13) {
|
|
4999
|
-
return _ref8.apply(this, arguments);
|
|
5000
|
-
};
|
|
5001
|
-
}()));
|
|
4960
|
+
_context6.next = 2;
|
|
4961
|
+
return Promise.all(batchCall.map(function (view) {
|
|
4962
|
+
return fetchWorkspaceViewPreset(function (thunkAction) {
|
|
4963
|
+
actionsToDispatch.push(thunkAction);
|
|
4964
|
+
}, view.viewPresetId, view.mosaicNodeId);
|
|
4965
|
+
}));
|
|
5002
4966
|
case 2:
|
|
5003
4967
|
case "end":
|
|
5004
|
-
return
|
|
4968
|
+
return _context6.stop();
|
|
5005
4969
|
}
|
|
5006
|
-
},
|
|
4970
|
+
}, _callee6);
|
|
5007
4971
|
}));
|
|
5008
4972
|
return function (_x12) {
|
|
5009
4973
|
return _ref7.apply(this, arguments);
|
|
5010
4974
|
};
|
|
5011
4975
|
}()));
|
|
5012
|
-
case
|
|
5013
|
-
|
|
4976
|
+
case 20:
|
|
4977
|
+
// Trigger all actions at once
|
|
4978
|
+
actionsToDispatch.map(listenerApi.dispatch);
|
|
4979
|
+
_context7.next = 27;
|
|
5014
4980
|
break;
|
|
5015
|
-
case
|
|
5016
|
-
|
|
5017
|
-
|
|
5018
|
-
errorType =
|
|
4981
|
+
case 23:
|
|
4982
|
+
_context7.prev = 23;
|
|
4983
|
+
_context7.t0 = _context7["catch"](3);
|
|
4984
|
+
errorType = _context7.t0.message === ERROR_NOT_FOUND ? WorkspaceErrorType.NOT_FOUND : WorkspaceErrorType.GENERIC;
|
|
5019
4985
|
listenerApi.dispatch(workspaceActions.errorWorkspace({
|
|
5020
4986
|
workspaceId: workspaceId,
|
|
5021
4987
|
error: {
|
|
5022
|
-
message: getErrorMessage(
|
|
4988
|
+
message: getErrorMessage(_context7.t0),
|
|
5023
4989
|
type: errorType
|
|
5024
4990
|
}
|
|
5025
4991
|
}));
|
|
5026
|
-
case
|
|
4992
|
+
case 27:
|
|
5027
4993
|
case "end":
|
|
5028
|
-
return
|
|
4994
|
+
return _context7.stop();
|
|
5029
4995
|
}
|
|
5030
|
-
},
|
|
4996
|
+
}, _callee7, null, [[3, 23]]);
|
|
5031
4997
|
}));
|
|
5032
4998
|
function effect(_x10, _x11) {
|
|
5033
4999
|
return _effect5.apply(this, arguments);
|
|
@@ -5038,18 +5004,18 @@ workspaceListener.startListening({
|
|
|
5038
5004
|
workspaceListener.startListening({
|
|
5039
5005
|
actionCreator: workspaceActions.saveWorkspacePreset,
|
|
5040
5006
|
effect: function () {
|
|
5041
|
-
var _effect6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
5007
|
+
var _effect6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(_ref8, listenerApi) {
|
|
5042
5008
|
var payload, workspace, workspaceApi;
|
|
5043
|
-
return _regeneratorRuntime().wrap(function
|
|
5044
|
-
while (1) switch (
|
|
5009
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
5010
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
5045
5011
|
case 0:
|
|
5046
|
-
payload =
|
|
5012
|
+
payload = _ref8.payload;
|
|
5047
5013
|
// Cancel any in-progress instances of this listener
|
|
5048
5014
|
listenerApi.cancelActiveListeners();
|
|
5049
5015
|
workspace = payload.workspace;
|
|
5050
|
-
|
|
5016
|
+
_context8.prev = 3;
|
|
5051
5017
|
workspaceApi = getWorkspaceApi();
|
|
5052
|
-
|
|
5018
|
+
_context8.next = 7;
|
|
5053
5019
|
return workspaceApi.saveWorkspacePreset(workspace.id, workspace);
|
|
5054
5020
|
case 7:
|
|
5055
5021
|
listenerApi.dispatch(workspaceActions.loadedWorkspace(undefined));
|
|
@@ -5059,25 +5025,25 @@ workspaceListener.startListening({
|
|
|
5059
5025
|
title: workspace.title,
|
|
5060
5026
|
scope: workspace.scope || 'user'
|
|
5061
5027
|
}));
|
|
5062
|
-
|
|
5028
|
+
_context8.next = 14;
|
|
5063
5029
|
break;
|
|
5064
5030
|
case 11:
|
|
5065
|
-
|
|
5066
|
-
|
|
5031
|
+
_context8.prev = 11;
|
|
5032
|
+
_context8.t0 = _context8["catch"](3);
|
|
5067
5033
|
listenerApi.dispatch(workspaceActions.errorWorkspace({
|
|
5068
5034
|
workspaceId: workspace.id,
|
|
5069
5035
|
error: {
|
|
5070
|
-
message:
|
|
5036
|
+
message: _context8.t0.message,
|
|
5071
5037
|
type: WorkspaceErrorType.SAVE
|
|
5072
5038
|
}
|
|
5073
5039
|
}));
|
|
5074
5040
|
case 14:
|
|
5075
5041
|
case "end":
|
|
5076
|
-
return
|
|
5042
|
+
return _context8.stop();
|
|
5077
5043
|
}
|
|
5078
|
-
},
|
|
5044
|
+
}, _callee8, null, [[3, 11]]);
|
|
5079
5045
|
}));
|
|
5080
|
-
function effect(
|
|
5046
|
+
function effect(_x13, _x14) {
|
|
5081
5047
|
return _effect6.apply(this, arguments);
|
|
5082
5048
|
}
|
|
5083
5049
|
return effect;
|
|
@@ -5086,10 +5052,10 @@ workspaceListener.startListening({
|
|
|
5086
5052
|
workspaceListener.startListening({
|
|
5087
5053
|
actionCreator: workspaceActions.changeToEmptyMapWorkspace,
|
|
5088
5054
|
effect: function () {
|
|
5089
|
-
var _effect7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
5055
|
+
var _effect7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(action, listenerApi) {
|
|
5090
5056
|
var _action$payload, newMapPresetText, newWorkspaceText, intialViewMapPreset;
|
|
5091
|
-
return _regeneratorRuntime().wrap(function
|
|
5092
|
-
while (1) switch (
|
|
5057
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
5058
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
5093
5059
|
case 0:
|
|
5094
5060
|
_action$payload = action.payload, newMapPresetText = _action$payload.newMapPresetText, newWorkspaceText = _action$payload.newWorkspaceText; // Cancel any in-progress instances of this listener
|
|
5095
5061
|
listenerApi.cancelActiveListeners();
|
|
@@ -5099,11 +5065,11 @@ workspaceListener.startListening({
|
|
|
5099
5065
|
}));
|
|
5100
5066
|
case 4:
|
|
5101
5067
|
case "end":
|
|
5102
|
-
return
|
|
5068
|
+
return _context9.stop();
|
|
5103
5069
|
}
|
|
5104
|
-
},
|
|
5070
|
+
}, _callee9);
|
|
5105
5071
|
}));
|
|
5106
|
-
function effect(
|
|
5072
|
+
function effect(_x15, _x16) {
|
|
5107
5073
|
return _effect7.apply(this, arguments);
|
|
5108
5074
|
}
|
|
5109
5075
|
return effect;
|
|
@@ -5112,12 +5078,12 @@ workspaceListener.startListening({
|
|
|
5112
5078
|
workspaceListener.startListening({
|
|
5113
5079
|
actionCreator: workspaceActions.setNewWorkspaceView,
|
|
5114
5080
|
effect: function () {
|
|
5115
|
-
var _effect8 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
5081
|
+
var _effect8 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee0(_ref9, listenerApi) {
|
|
5116
5082
|
var payload, mosaicNodeId, componentType, newId, bbox, srs, mapPreset;
|
|
5117
|
-
return _regeneratorRuntime().wrap(function
|
|
5118
|
-
while (1) switch (
|
|
5083
|
+
return _regeneratorRuntime().wrap(function _callee0$(_context0) {
|
|
5084
|
+
while (1) switch (_context0.prev = _context0.next) {
|
|
5119
5085
|
case 0:
|
|
5120
|
-
payload =
|
|
5086
|
+
payload = _ref9.payload;
|
|
5121
5087
|
mosaicNodeId = payload.mosaicNodeId, componentType = payload.componentType, newId = payload.newId; // TODO: this would be nice to move into the openlayers store
|
|
5122
5088
|
createViewObjectForNewMap(mosaicNodeId, newId);
|
|
5123
5089
|
// Note, at some point these might no longer be necessary
|
|
@@ -5139,11 +5105,11 @@ workspaceListener.startListening({
|
|
|
5139
5105
|
}));
|
|
5140
5106
|
case 7:
|
|
5141
5107
|
case "end":
|
|
5142
|
-
return
|
|
5108
|
+
return _context0.stop();
|
|
5143
5109
|
}
|
|
5144
|
-
},
|
|
5110
|
+
}, _callee0);
|
|
5145
5111
|
}));
|
|
5146
|
-
function effect(
|
|
5112
|
+
function effect(_x17, _x18) {
|
|
5147
5113
|
return _effect8.apply(this, arguments);
|
|
5148
5114
|
}
|
|
5149
5115
|
return effect;
|
|
@@ -5152,15 +5118,15 @@ workspaceListener.startListening({
|
|
|
5152
5118
|
workspaceListener.startListening({
|
|
5153
5119
|
actionCreator: workspaceActions.updateWorkspaceViews,
|
|
5154
5120
|
effect: function () {
|
|
5155
|
-
var _effect9 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
5121
|
+
var _effect9 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee1(_, listenerApi) {
|
|
5156
5122
|
var viewIds;
|
|
5157
|
-
return _regeneratorRuntime().wrap(function
|
|
5158
|
-
while (1) switch (
|
|
5123
|
+
return _regeneratorRuntime().wrap(function _callee1$(_context1) {
|
|
5124
|
+
while (1) switch (_context1.prev = _context1.next) {
|
|
5159
5125
|
case 0:
|
|
5160
5126
|
// Cancel any in-progress instances of this listener
|
|
5161
5127
|
listenerApi.cancelActiveListeners();
|
|
5162
5128
|
// Delay before starting actual work
|
|
5163
|
-
|
|
5129
|
+
_context1.next = 3;
|
|
5164
5130
|
return listenerApi.delay(100);
|
|
5165
5131
|
case 3:
|
|
5166
5132
|
/* This will trigger all maps and other components
|
|
@@ -5168,7 +5134,7 @@ workspaceListener.startListening({
|
|
|
5168
5134
|
window.dispatchEvent(new Event('resize'));
|
|
5169
5135
|
// Adjust the bbox of the original view after the new map is added. This is a temporal solution until the OpenLayers ticket
|
|
5170
5136
|
// https://github.com/openlayers/openlayers/issues/16572 is solved.
|
|
5171
|
-
|
|
5137
|
+
_context1.next = 6;
|
|
5172
5138
|
return listenerApi.delay(10);
|
|
5173
5139
|
case 6:
|
|
5174
5140
|
viewIds = getViewIds(listenerApi.getState());
|
|
@@ -5185,11 +5151,11 @@ workspaceListener.startListening({
|
|
|
5185
5151
|
});
|
|
5186
5152
|
case 8:
|
|
5187
5153
|
case "end":
|
|
5188
|
-
return
|
|
5154
|
+
return _context1.stop();
|
|
5189
5155
|
}
|
|
5190
|
-
},
|
|
5156
|
+
}, _callee1);
|
|
5191
5157
|
}));
|
|
5192
|
-
function effect(
|
|
5158
|
+
function effect(_x19, _x20) {
|
|
5193
5159
|
return _effect9.apply(this, arguments);
|
|
5194
5160
|
}
|
|
5195
5161
|
return effect;
|
|
@@ -5558,7 +5524,7 @@ viewPresetsListener.startListening({
|
|
|
5558
5524
|
viewPresetId: viewPresetId
|
|
5559
5525
|
}));
|
|
5560
5526
|
}
|
|
5561
|
-
} catch (
|
|
5527
|
+
} catch (_error) {
|
|
5562
5528
|
// TODO: use error handling of mapPreset https://gitlab.com/opengeoweb/opengeoweb/-/issues/3043
|
|
5563
5529
|
}
|
|
5564
5530
|
case 5:
|
|
@@ -5970,7 +5936,6 @@ var useWorkspaceTranslation = function useWorkspaceTranslation() {
|
|
|
5970
5936
|
return useTranslation(ns);
|
|
5971
5937
|
};
|
|
5972
5938
|
|
|
5973
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
5974
5939
|
/* *
|
|
5975
5940
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5976
5941
|
* you may not use this file except in compliance with the License.
|
|
@@ -7267,8 +7232,10 @@ var WorkspaceMenuButton = function WorkspaceMenuButton(_ref) {
|
|
|
7267
7232
|
children: t('workspace-currently') + ": " + title
|
|
7268
7233
|
})]
|
|
7269
7234
|
}),
|
|
7270
|
-
|
|
7271
|
-
|
|
7235
|
+
slotProps: {
|
|
7236
|
+
transition: {
|
|
7237
|
+
exit: false
|
|
7238
|
+
}
|
|
7272
7239
|
},
|
|
7273
7240
|
children: jsx(CustomToggleButton, {
|
|
7274
7241
|
variant: "tool",
|
|
@@ -7328,22 +7295,33 @@ var LoadingIndicatorConnect = function LoadingIndicatorConnect(_ref) {
|
|
|
7328
7295
|
var isLoading = useSelector(function (store) {
|
|
7329
7296
|
return loadingIndicatorSelectors.isLoading(store, panelId);
|
|
7330
7297
|
});
|
|
7298
|
+
var getMapLoadingPercentage = useSelector(function (store) {
|
|
7299
|
+
return loadingIndicatorSelectors.getMapLoadingPercentage(store, panelId);
|
|
7300
|
+
});
|
|
7331
7301
|
var _useWorkspaceTranslat = useWorkspaceTranslation(),
|
|
7332
7302
|
t = _useWorkspaceTranslat.t;
|
|
7333
7303
|
return jsx(CustomTooltip, {
|
|
7334
7304
|
title: isLoading ? t('workspace-loading-indicator-loading') : t('workspace-loading-indicator-idle'),
|
|
7335
|
-
children:
|
|
7305
|
+
children: jsxs("span", {
|
|
7336
7306
|
style: {
|
|
7337
7307
|
height: '100%'
|
|
7338
7308
|
},
|
|
7339
|
-
children:
|
|
7340
|
-
"data-testid": "cloudicon-loading",
|
|
7309
|
+
children: [jsx("span", {
|
|
7341
7310
|
style: {
|
|
7342
|
-
|
|
7343
|
-
|
|
7344
|
-
|
|
7345
|
-
|
|
7346
|
-
|
|
7311
|
+
position: 'relative',
|
|
7312
|
+
zIndex: 2
|
|
7313
|
+
},
|
|
7314
|
+
children: isLoading ? jsx(CloudLoading, {
|
|
7315
|
+
"data-testid": "cloudicon-loading",
|
|
7316
|
+
style: {
|
|
7317
|
+
fill: '#186DFF'
|
|
7318
|
+
}
|
|
7319
|
+
}) : jsx(CloudIdle, {
|
|
7320
|
+
"data-testid": "cloudicon-idle"
|
|
7321
|
+
})
|
|
7322
|
+
}), getMapLoadingPercentage !== 100 && jsx(LoadingIndicatorProgressBar, {
|
|
7323
|
+
progressPercentage: getMapLoadingPercentage
|
|
7324
|
+
})]
|
|
7347
7325
|
})
|
|
7348
7326
|
});
|
|
7349
7327
|
};
|
|
@@ -7407,10 +7385,12 @@ var WorkspaceOptions = function WorkspaceOptions(_ref) {
|
|
|
7407
7385
|
}
|
|
7408
7386
|
},
|
|
7409
7387
|
children: [jsx(Options, {}), jsxs(Menu, {
|
|
7410
|
-
|
|
7411
|
-
|
|
7412
|
-
|
|
7413
|
-
|
|
7388
|
+
slotProps: {
|
|
7389
|
+
backdrop: {
|
|
7390
|
+
style: {
|
|
7391
|
+
opacity: 0,
|
|
7392
|
+
transition: 'none'
|
|
7393
|
+
}
|
|
7414
7394
|
}
|
|
7415
7395
|
},
|
|
7416
7396
|
open: isOpen && !isDisabled,
|
|
@@ -7455,8 +7435,10 @@ var WorkspaceOptions = function WorkspaceOptions(_ref) {
|
|
|
7455
7435
|
};
|
|
7456
7436
|
return isDisabled ? renderButton() : jsx(CustomTooltip, {
|
|
7457
7437
|
title: !isOpen && t('workspace-options'),
|
|
7458
|
-
|
|
7459
|
-
|
|
7438
|
+
slotProps: {
|
|
7439
|
+
transition: {
|
|
7440
|
+
exit: false
|
|
7441
|
+
}
|
|
7460
7442
|
},
|
|
7461
7443
|
children: renderButton()
|
|
7462
7444
|
});
|
|
@@ -7643,8 +7625,10 @@ var WorkspaceViewTitleConnectNoMemo = function WorkspaceViewTitleConnectNoMemo(_
|
|
|
7643
7625
|
children: t('workspace-currently') + ": " + title
|
|
7644
7626
|
})]
|
|
7645
7627
|
}),
|
|
7646
|
-
|
|
7647
|
-
|
|
7628
|
+
slotProps: {
|
|
7629
|
+
transition: {
|
|
7630
|
+
exit: false
|
|
7631
|
+
}
|
|
7648
7632
|
},
|
|
7649
7633
|
children: jsxs(CustomToggleButton, {
|
|
7650
7634
|
variant: "tool",
|
|
@@ -7842,8 +7826,8 @@ var LinkMenuConnect = function LinkMenuConnect(_ref) {
|
|
|
7842
7826
|
panelId: panelId,
|
|
7843
7827
|
mapIds: updatedMapIds
|
|
7844
7828
|
}));
|
|
7845
|
-
// Sync pin to newly added map for TimeSeries components
|
|
7846
|
-
if (!selectedMapIds.includes(mapId) && viewComponentType === 'TimeSeries') {
|
|
7829
|
+
// Sync pin to newly added map for TimeSeries or Soundings components
|
|
7830
|
+
if (!selectedMapIds.includes(mapId) && (viewComponentType === 'TimeSeries' || viewComponentType === 'Soundings')) {
|
|
7847
7831
|
// Observation station
|
|
7848
7832
|
if (sharedFeature) {
|
|
7849
7833
|
dispatch(mapActions.setMapPinLocation({
|
|
@@ -7923,8 +7907,10 @@ var LinkMenuConnect = function LinkMenuConnect(_ref) {
|
|
|
7923
7907
|
tabIndex: -1,
|
|
7924
7908
|
checked: selectedMapIds.includes(mapId),
|
|
7925
7909
|
disableRipple: true,
|
|
7926
|
-
|
|
7927
|
-
|
|
7910
|
+
slotProps: {
|
|
7911
|
+
input: {
|
|
7912
|
+
'aria-labelledby': labelId
|
|
7913
|
+
}
|
|
7928
7914
|
}
|
|
7929
7915
|
})
|
|
7930
7916
|
}), jsx(ListItemText, {
|
|
@@ -8287,7 +8273,6 @@ var WorkspaceView = function WorkspaceView(_ref) {
|
|
|
8287
8273
|
onClick: function onClick(event) {
|
|
8288
8274
|
return handleClickOnWindow(event, viewId);
|
|
8289
8275
|
},
|
|
8290
|
-
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
8291
8276
|
sx: function sx(theme) {
|
|
8292
8277
|
return {
|
|
8293
8278
|
'> *': {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/workspace",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "14.0.1",
|
|
4
4
|
"description": "GeoWeb Workspace library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -9,31 +9,32 @@
|
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"react-redux": "^9.2.0",
|
|
12
|
-
"@opengeoweb/shared": "
|
|
13
|
-
"@opengeoweb/store": "
|
|
14
|
-
"@opengeoweb/api": "
|
|
12
|
+
"@opengeoweb/shared": "14.0.1",
|
|
13
|
+
"@opengeoweb/store": "14.0.1",
|
|
14
|
+
"@opengeoweb/api": "14.0.1",
|
|
15
15
|
"react-hook-form": "^7.50.1",
|
|
16
|
-
"@opengeoweb/theme": "
|
|
16
|
+
"@opengeoweb/theme": "14.0.1",
|
|
17
17
|
"@reduxjs/toolkit": "^2.6.1",
|
|
18
|
-
"@opengeoweb/snackbar": "
|
|
18
|
+
"@opengeoweb/snackbar": "14.0.1",
|
|
19
19
|
"react-window": "^1.8.10",
|
|
20
20
|
"lodash": "^4.17.21",
|
|
21
21
|
"axios": "^1.7.7",
|
|
22
22
|
"react-virtualized-auto-sizer": "^1.0.21",
|
|
23
23
|
"react-mosaic-component": "^6.1.0",
|
|
24
|
-
"@opengeoweb/form-fields": "
|
|
25
|
-
"@opengeoweb/time-series": "
|
|
26
|
-
"@opengeoweb/authentication": "
|
|
27
|
-
"@opengeoweb/core": "
|
|
28
|
-
"@opengeoweb/taf": "
|
|
29
|
-
"@opengeoweb/sigmet-airmet": "
|
|
30
|
-
"@opengeoweb/warnings": "
|
|
31
|
-
"@opengeoweb/space-weather": "
|
|
24
|
+
"@opengeoweb/form-fields": "14.0.1",
|
|
25
|
+
"@opengeoweb/time-series": "14.0.1",
|
|
26
|
+
"@opengeoweb/authentication": "14.0.1",
|
|
27
|
+
"@opengeoweb/core": "14.0.1",
|
|
28
|
+
"@opengeoweb/taf": "14.0.1",
|
|
29
|
+
"@opengeoweb/sigmet-airmet": "14.0.1",
|
|
30
|
+
"@opengeoweb/warnings": "14.0.1",
|
|
31
|
+
"@opengeoweb/space-weather": "14.0.1",
|
|
32
32
|
"i18next": "^25.0.1",
|
|
33
33
|
"react-i18next": "^15.1.1",
|
|
34
34
|
"@mui/material": "^7.0.1",
|
|
35
|
-
"@opengeoweb/webmap-react": "
|
|
36
|
-
"@tanstack/react-query": "^5.85.5"
|
|
35
|
+
"@opengeoweb/webmap-react": "14.0.1",
|
|
36
|
+
"@tanstack/react-query": "^5.85.5",
|
|
37
|
+
"@opengeoweb/soundings": "14.0.1"
|
|
37
38
|
},
|
|
38
39
|
"peerDependencies": {
|
|
39
40
|
"react": "18",
|
package/src/lib/store/types.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { WorkspaceState } from './workspace/types';
|
|
|
3
3
|
import { WorkspaceListState } from './workspaceList/types';
|
|
4
4
|
import { ViewPresetListState } from './viewPresetsList/types';
|
|
5
5
|
import { ViewPresetState } from './viewPresets/types';
|
|
6
|
+
import { ThunkAction, UnknownAction } from '@reduxjs/toolkit';
|
|
6
7
|
export interface AppStore extends WorkspaceModuleStore, CoreAppStore {
|
|
7
8
|
}
|
|
8
9
|
export interface WorkspaceModuleStore {
|
|
@@ -11,3 +12,4 @@ export interface WorkspaceModuleStore {
|
|
|
11
12
|
viewPresetsList?: ViewPresetListState;
|
|
12
13
|
viewPresets?: ViewPresetState;
|
|
13
14
|
}
|
|
15
|
+
export type WorkspaceActionType = ThunkAction<unknown, WorkspaceModuleStore, unknown, UnknownAction>;
|
|
@@ -18,7 +18,7 @@ export declare const viewPresetsReducer: import("redux").Reducer<ViewPresetState
|
|
|
18
18
|
setViewPresetHasChanges: (draft: Draft<ViewPresetState>, action: PayloadAction<SetViewPresetHasChangePayload>) => void;
|
|
19
19
|
setActiveViewPresetId: (draft: Draft<ViewPresetState>, action: PayloadAction<SetActiveViewPresetIdPayload>) => void;
|
|
20
20
|
selectViewPreset: (draft: Draft<ViewPresetState>, action: PayloadAction<SelectViewPresetPayload>) => void;
|
|
21
|
-
onSuccessViewPresetAction: (
|
|
21
|
+
onSuccessViewPresetAction: (_draft: Draft<ViewPresetState>, _action: PayloadAction<OnSuccesViewPresetActionPayload>) => void;
|
|
22
22
|
registerViewPreset: (draft: Draft<ViewPresetState>, action: PayloadAction<RegisterViewPresetPayload>) => void;
|
|
23
23
|
unregisterViewPreset: (draft: Draft<ViewPresetState>, action: PayloadAction<UnregisterViewPresetPayload>) => void;
|
|
24
24
|
openViewPresetDialog: (draft: Draft<ViewPresetState>, action: PayloadAction<OpenViewPresetDialogPayload>) => void;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { InitialProps, SupportedComponentTypes } from '@opengeoweb/core';
|
|
2
2
|
import { SupportedComponentTypes as SupportedTimeSeriesComponentTypes } from '@opengeoweb/time-series';
|
|
3
|
+
import { SoundingsComponentType } from '@opengeoweb/soundings';
|
|
3
4
|
import { SystemScope } from '@opengeoweb/shared';
|
|
4
5
|
import { WarningListComponentType } from '@opengeoweb/warnings';
|
|
5
6
|
import { EntityState } from '@reduxjs/toolkit';
|
|
6
7
|
import { FetchViewPresetsListParams, ViewPresetListItem } from '../viewPresetsList/types';
|
|
7
8
|
import { WorkspaceViewPresetComponentsLookupType } from '../workspace/types';
|
|
8
9
|
import { PresetFilterType } from '../workspaceList/types';
|
|
9
|
-
export type WorkspaceSupportedComponentTypes = SupportedComponentTypes | SupportedTimeSeriesComponentTypes | WarningListComponentType | WorkspaceViewPresetComponentsLookupType;
|
|
10
|
+
export type WorkspaceSupportedComponentTypes = SupportedComponentTypes | SupportedTimeSeriesComponentTypes | SoundingsComponentType | WarningListComponentType | WorkspaceViewPresetComponentsLookupType;
|
|
10
11
|
export interface ViewPreset {
|
|
11
12
|
id?: string;
|
|
12
13
|
title: string;
|
|
@@ -23,16 +23,16 @@ export declare const defaultPresetFilterState: WorkspaceListFilter[];
|
|
|
23
23
|
export declare const workspaceListAdapter: import("@reduxjs/toolkit").EntityAdapter<WorkspacePresetListItem, string>;
|
|
24
24
|
export declare const initialState: WorkspaceListState;
|
|
25
25
|
export declare const workspaceListReducer: import("redux").Reducer<WorkspaceListState>, workspaceListActions: import("@reduxjs/toolkit").CaseReducerActions<{
|
|
26
|
-
fetchWorkspaceList: (draft: Draft<WorkspaceListState>,
|
|
26
|
+
fetchWorkspaceList: (draft: Draft<WorkspaceListState>, _action: PayloadAction<FetchWorkspaceList>) => void;
|
|
27
27
|
fetchedWorkspaceList: (draft: Draft<WorkspaceListState>, action: PayloadAction<FetchedWorkspaceList>) => void;
|
|
28
28
|
errorWorkspaceList: (draft: Draft<WorkspaceListState>, action: PayloadAction<ErrorWorkspaceList>) => void;
|
|
29
29
|
openWorkspaceActionDialogOptions: (draft: Draft<WorkspaceListState>, action: PayloadAction<OpenWorkspaceActionDialogPayload>) => void;
|
|
30
30
|
onSuccessWorkspaceSaveDialog: (draft: Draft<WorkspaceListState>, action: PayloadAction<{
|
|
31
31
|
presetId: string;
|
|
32
32
|
}>) => void;
|
|
33
|
-
submitFormWorkspaceActionDialogOptions: (draft: Draft<WorkspaceListState>,
|
|
33
|
+
submitFormWorkspaceActionDialogOptions: (draft: Draft<WorkspaceListState>, _action: PayloadAction<SubmitFormWorkspaceActionDialogPayload>) => void;
|
|
34
34
|
closeWorkspaceActionDialogOptions: (draft: Draft<WorkspaceListState>) => void;
|
|
35
|
-
onSuccessWorkspacePresetAction: (draft: Draft<WorkspaceListState>,
|
|
35
|
+
onSuccessWorkspacePresetAction: (draft: Draft<WorkspaceListState>, _action: PayloadAction<OnSuccesWorkspacePresetActionPayload>) => void;
|
|
36
36
|
onErrorWorkspacePresetAction: (draft: Draft<WorkspaceListState>, action: PayloadAction<OnErrorWorkspacePresetActionPayload>) => void;
|
|
37
37
|
toggleWorkspaceDialog: (draft: Draft<WorkspaceListState>, action: PayloadAction<ToggleListDialogPayload>) => void;
|
|
38
38
|
toggleSelectFilterChip: (draft: Draft<WorkspaceListState>, action: PayloadAction<ToggleSelectFilterChip>) => void;
|