@opengeoweb/workspace 9.8.0 → 9.10.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 +242 -268
- package/package.json +7 -6
- package/src/index.d.ts +1 -1
- package/src/lib/components/MapPresetsFormDialog/MapPresetsForm.d.ts +2 -2
- package/src/lib/components/WorkspaceSelectList/WorkspaceSelectList.d.ts +0 -1
- package/src/lib/components/WorkspaceViewTitle/WorkspaceViewTitleConnect.d.ts +1 -1
- package/src/lib/store/viewPresetsList/types.d.ts +4 -4
- package/src/lib/store/workspace/reducer.d.ts +3 -1
- package/src/lib/store/workspace/sagas.d.ts +1 -0
- package/src/lib/store/workspace/selectors.d.ts +14 -3
- package/src/lib/store/workspace/types.d.ts +7 -3
- package/src/lib/store/workspaceList/types.d.ts +2 -2
- package/src/lib/store/workspaceList/utils.d.ts +2 -0
- package/src/lib/storyUtils/componentsLookUp.d.ts +2 -1
- package/src/lib/utils/api.d.ts +2 -2
- package/src/lib/utils/routes.d.ts +2 -2
- package/src/lib/components/WorkspaceMenu/utils.d.ts +0 -4
- package/src/lib/components/WorkspaceMenu/utils.spec.d.ts +0 -1
package/index.esm.js
CHANGED
|
@@ -3,13 +3,13 @@ import { chunk, cloneDeep, isEqual, isEmpty, isString } from 'lodash';
|
|
|
3
3
|
import { syncGroupsTypes, syncGroupsActions, layerActions, mapStoreActions, uiActions, genericActions, mapActions, layerTypes, mapEnums, genericSelectors, mapSelectors, syncGroupsSelectors, routerActions, coreModuleConfig, uiSelectors } from '@opengeoweb/store';
|
|
4
4
|
import { createApiInstance, createNonAuthApiInstance, getApi, createFakeApiInstance, ApiProvider, useApiContext } from '@opengeoweb/api';
|
|
5
5
|
import { getLeaves, MosaicContext, getAndAssertNodeAtPathExists, createBalancedTreeFromLeaves, MosaicWindow, Mosaic } from 'react-mosaic-component';
|
|
6
|
-
import { debounce, takeEvery, takeLatest, all, put, delay,
|
|
7
|
-
import { isAxiosError, getAxiosErrorMessage, withEggs, ConfirmationServiceProvider, useConfirmationDialog, CustomIconButton, AlertBanner, CustomTooltip, SearchHighlight, ToggleMenu,
|
|
6
|
+
import { debounce, takeEvery, takeLatest, all, put, delay, select, call, takeLeading } from 'redux-saga/effects';
|
|
7
|
+
import { isAxiosError, getAxiosErrorMessage, withEggs, ConfirmationServiceProvider, useConfirmationDialog, CustomIconButton, AlertBanner, CustomTooltip, SearchHighlight, ToggleMenu, usePrevious, renderCounter, ToolContainer, CustomToggleButton, ConfirmationDialog } from '@opengeoweb/shared';
|
|
8
8
|
import { snackbarActions, SnackbarWrapperConnect } from '@opengeoweb/snackbar';
|
|
9
9
|
import * as React from 'react';
|
|
10
10
|
import React__default, { useCallback } from 'react';
|
|
11
11
|
import { ThemeWrapper, lightTheme, SplitVertical, SplitHorizontal, Expand, UnExpand, Close, Delete, Preset, PresetWorkspace, PresetTiles, Search, Clear, WebAssetOff } from '@opengeoweb/theme';
|
|
12
|
-
import { Provider, useDispatch, useSelector } from 'react-redux';
|
|
12
|
+
import { Provider, useDispatch, useSelector, useStore, shallowEqual } from 'react-redux';
|
|
13
13
|
import { timeSeriesModuleConfig } from '@opengeoweb/timeseries';
|
|
14
14
|
import { AuthenticationProvider, useAuthenticationContext } from '@opengeoweb/authentication';
|
|
15
15
|
import { createStore } from '@redux-eggs/redux-toolkit';
|
|
@@ -17,6 +17,7 @@ import { getSagaExtension } from '@redux-eggs/saga-extension';
|
|
|
17
17
|
import { produce } from 'immer';
|
|
18
18
|
import { LinearProgress, Typography, ListItem, ListItemButton, ListItemIcon, ListItemText, Grid, useTheme, Chip, Stack, debounce as debounce$1, TextField, InputAdornment, Box, Backdrop, Menu, ListSubheader, MenuItem, Tabs } from '@mui/material';
|
|
19
19
|
import 'react-mosaic-component/react-mosaic-component.css';
|
|
20
|
+
import AutoSizer from 'react-virtualized-auto-sizer';
|
|
20
21
|
import { FixedSizeList } from 'react-window';
|
|
21
22
|
import { Box as Box$1 } from '@mui/system';
|
|
22
23
|
import { ReactHookFormTextField, ReactHookFormHiddenInput, ReactHookFormProvider, defaultFormOptions } from '@opengeoweb/form-fields';
|
|
@@ -1304,6 +1305,13 @@ var emptyMapWorkspace = {
|
|
|
1304
1305
|
mosaicNode: '1_screen',
|
|
1305
1306
|
viewType: 'singleWindow'
|
|
1306
1307
|
};
|
|
1308
|
+
var createCustomEmptyMapWorkspace = function createCustomEmptyMapWorkspace(customMapPreset) {
|
|
1309
|
+
var customEmptyMapWorkspace = cloneDeep(emptyMapWorkspace);
|
|
1310
|
+
if (customMapPreset) {
|
|
1311
|
+
customEmptyMapWorkspace.views.byId['1_screen'].initialProps.mapPreset = customMapPreset;
|
|
1312
|
+
}
|
|
1313
|
+
return customEmptyMapWorkspace;
|
|
1314
|
+
};
|
|
1307
1315
|
var constructFilterParams = function constructFilterParams(filters, searchQuery) {
|
|
1308
1316
|
// get filters
|
|
1309
1317
|
var _filters$reduce = filters.reduce(function (filterList, filter) {
|
|
@@ -1364,13 +1372,17 @@ var initialState$1 = {
|
|
|
1364
1372
|
mosaicNode: undefined,
|
|
1365
1373
|
isLoading: false,
|
|
1366
1374
|
error: undefined,
|
|
1367
|
-
hasChanges: false
|
|
1375
|
+
hasChanges: false,
|
|
1376
|
+
intialViewMapPreset: undefined
|
|
1368
1377
|
};
|
|
1369
1378
|
var workspacePresetChangeActions = [viewPresetActions.selectViewPreset, viewPresetActions.setActiveViewPresetId, syncGroupsActions.syncGroupRemoveGroup, syncGroupsActions.syncGroupAddGroup];
|
|
1370
1379
|
var slice$1 = createSlice({
|
|
1371
1380
|
initialState: initialState$1,
|
|
1372
1381
|
name: 'workspace',
|
|
1373
1382
|
reducers: {
|
|
1383
|
+
setInitialViewMapPreset: function setInitialViewMapPreset(draft, action) {
|
|
1384
|
+
draft.intialViewMapPreset = action.payload.preset;
|
|
1385
|
+
},
|
|
1374
1386
|
addWorkspaceView: function addWorkspaceView(draft, action) {
|
|
1375
1387
|
var newId = action.payload.id;
|
|
1376
1388
|
draft.views.allIds.push(newId);
|
|
@@ -1439,6 +1451,9 @@ var slice$1 = createSlice({
|
|
|
1439
1451
|
draft.scope = workspacePreset.scope;
|
|
1440
1452
|
draft.syncGroups = [];
|
|
1441
1453
|
},
|
|
1454
|
+
changeToEmptyMapWorkspace: function changeToEmptyMapWorkspace(draft) {
|
|
1455
|
+
return draft;
|
|
1456
|
+
},
|
|
1442
1457
|
setPreset: function setPreset(draft, action) {
|
|
1443
1458
|
// do not change anything when the preset is already set
|
|
1444
1459
|
if (draft.id === action.payload.workspacePreset.id) {
|
|
@@ -1691,6 +1706,15 @@ var workspaceStore = function workspaceStore(store) {
|
|
|
1691
1706
|
var getWorkspaceState = createSelector(workspaceStore, function (store) {
|
|
1692
1707
|
return store || initialState$1;
|
|
1693
1708
|
});
|
|
1709
|
+
/**
|
|
1710
|
+
* Gets intialViewMapPreset from workspace state
|
|
1711
|
+
*
|
|
1712
|
+
* @param {object} store store: object - Store object
|
|
1713
|
+
* @returns {MapPreset | undefined} returnType: MapPreset
|
|
1714
|
+
*/
|
|
1715
|
+
var getInitialViewMapPreset = createSelector(getWorkspaceState, function (state) {
|
|
1716
|
+
return state && state.intialViewMapPreset;
|
|
1717
|
+
});
|
|
1694
1718
|
/**
|
|
1695
1719
|
* Gets mosaicNode from workspace state
|
|
1696
1720
|
*
|
|
@@ -1820,6 +1844,7 @@ var getViewPresetToSendToBackend = createSelector(getViewById, mapSelectors.getM
|
|
|
1820
1844
|
var selectors = /*#__PURE__*/Object.freeze({
|
|
1821
1845
|
__proto__: null,
|
|
1822
1846
|
getWorkspaceState: getWorkspaceState,
|
|
1847
|
+
getInitialViewMapPreset: getInitialViewMapPreset,
|
|
1823
1848
|
getMosaicNode: getMosaicNode,
|
|
1824
1849
|
getViewById: getViewById,
|
|
1825
1850
|
getViewIds: getViewIds,
|
|
@@ -2598,7 +2623,7 @@ var viewPresetsListFullContent = [
|
|
|
2598
2623
|
endTime: "NOW+PT2H00M",
|
|
2599
2624
|
shouldEndtimeOverride: true
|
|
2600
2625
|
},
|
|
2601
|
-
shouldAutoUpdate:
|
|
2626
|
+
shouldAutoUpdate: false,
|
|
2602
2627
|
shouldAnimate: true
|
|
2603
2628
|
}
|
|
2604
2629
|
}
|
|
@@ -3982,10 +4007,11 @@ var getWorkspaceRouteUrl = function getWorkspaceRouteUrl(workspaceId) {
|
|
|
3982
4007
|
return workspaceId ? routes.workspaceDetail.replace(':workspaceId', workspaceId) : routes.workspace;
|
|
3983
4008
|
};
|
|
3984
4009
|
|
|
3985
|
-
var _marked$2 = /*#__PURE__*/_regeneratorRuntime().mark(
|
|
3986
|
-
_marked2$2 = /*#__PURE__*/_regeneratorRuntime().mark(
|
|
3987
|
-
_marked3 = /*#__PURE__*/_regeneratorRuntime().mark(
|
|
3988
|
-
_marked4 = /*#__PURE__*/_regeneratorRuntime().mark(
|
|
4010
|
+
var _marked$2 = /*#__PURE__*/_regeneratorRuntime().mark(changeToEmptyMapWorkspaceSaga),
|
|
4011
|
+
_marked2$2 = /*#__PURE__*/_regeneratorRuntime().mark(updateViewsSaga),
|
|
4012
|
+
_marked3 = /*#__PURE__*/_regeneratorRuntime().mark(fetchWorkspaceSaga),
|
|
4013
|
+
_marked4 = /*#__PURE__*/_regeneratorRuntime().mark(saveWorkspacePresetSaga),
|
|
4014
|
+
_marked5 = /*#__PURE__*/_regeneratorRuntime().mark(workspaceSaga);
|
|
3989
4015
|
var setPreset = workspaceActions.setPreset,
|
|
3990
4016
|
updateWorkspaceViews = workspaceActions.updateWorkspaceViews,
|
|
3991
4017
|
changePreset = workspaceActions.changePreset;
|
|
@@ -4017,43 +4043,62 @@ function changePresetSaga(_ref) {
|
|
|
4017
4043
|
}, _callee);
|
|
4018
4044
|
})();
|
|
4019
4045
|
}
|
|
4020
|
-
function
|
|
4021
|
-
|
|
4046
|
+
function changeToEmptyMapWorkspaceSaga() {
|
|
4047
|
+
var intialViewMapPreset;
|
|
4048
|
+
return _regeneratorRuntime().wrap(function changeToEmptyMapWorkspaceSaga$(_context2) {
|
|
4022
4049
|
while (1) switch (_context2.prev = _context2.next) {
|
|
4023
4050
|
case 0:
|
|
4024
4051
|
_context2.next = 2;
|
|
4025
|
-
return
|
|
4052
|
+
return select(getInitialViewMapPreset);
|
|
4026
4053
|
case 2:
|
|
4054
|
+
intialViewMapPreset = _context2.sent;
|
|
4055
|
+
_context2.next = 5;
|
|
4056
|
+
return put(changePreset({
|
|
4057
|
+
workspacePreset: createCustomEmptyMapWorkspace(intialViewMapPreset)
|
|
4058
|
+
}));
|
|
4059
|
+
case 5:
|
|
4027
4060
|
case "end":
|
|
4028
4061
|
return _context2.stop();
|
|
4029
4062
|
}
|
|
4030
4063
|
}, _marked$2);
|
|
4031
4064
|
}
|
|
4065
|
+
function updateViewsSaga() {
|
|
4066
|
+
return _regeneratorRuntime().wrap(function updateViewsSaga$(_context3) {
|
|
4067
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
4068
|
+
case 0:
|
|
4069
|
+
_context3.next = 2;
|
|
4070
|
+
return call(window.dispatchEvent, new Event('resize'));
|
|
4071
|
+
case 2:
|
|
4072
|
+
case "end":
|
|
4073
|
+
return _context3.stop();
|
|
4074
|
+
}
|
|
4075
|
+
}, _marked2$2);
|
|
4076
|
+
}
|
|
4032
4077
|
function fetchWorkspaceViewPresetSaga(_ref2) {
|
|
4033
4078
|
var payload = _ref2.payload;
|
|
4034
4079
|
return /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
4035
4080
|
var viewPresetId, mosaicNodeId, workspaceApi, _yield$call, data, syncGroupIds;
|
|
4036
|
-
return _regeneratorRuntime().wrap(function _callee2$(
|
|
4037
|
-
while (1) switch (
|
|
4081
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context4) {
|
|
4082
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
4038
4083
|
case 0:
|
|
4039
4084
|
viewPresetId = payload.viewPresetId, mosaicNodeId = payload.mosaicNodeId;
|
|
4040
|
-
|
|
4041
|
-
|
|
4085
|
+
_context4.prev = 1;
|
|
4086
|
+
_context4.next = 4;
|
|
4042
4087
|
return put(workspaceActions.updateWorkspaceView({
|
|
4043
4088
|
mosaicNodeId: mosaicNodeId,
|
|
4044
4089
|
viewPreset: getViewPresetState(viewPresetId, mosaicNodeId, 'loading')
|
|
4045
4090
|
}));
|
|
4046
4091
|
case 4:
|
|
4047
|
-
|
|
4092
|
+
_context4.next = 6;
|
|
4048
4093
|
return call(getWorkspaceApi);
|
|
4049
4094
|
case 6:
|
|
4050
|
-
workspaceApi =
|
|
4051
|
-
|
|
4095
|
+
workspaceApi = _context4.sent;
|
|
4096
|
+
_context4.next = 9;
|
|
4052
4097
|
return call(workspaceApi.getViewPreset, viewPresetId);
|
|
4053
4098
|
case 9:
|
|
4054
|
-
_yield$call =
|
|
4099
|
+
_yield$call = _context4.sent;
|
|
4055
4100
|
data = _yield$call.data;
|
|
4056
|
-
|
|
4101
|
+
_context4.next = 13;
|
|
4057
4102
|
return put(viewPresetActions.fetchedViewPreset({
|
|
4058
4103
|
viewPreset: data,
|
|
4059
4104
|
viewPresetId: data.id,
|
|
@@ -4063,10 +4108,10 @@ function fetchWorkspaceViewPresetSaga(_ref2) {
|
|
|
4063
4108
|
// sync all connected syncgroups of viewPreset to the store
|
|
4064
4109
|
syncGroupIds = data.initialProps.syncGroupsIds || [];
|
|
4065
4110
|
if (!(syncGroupIds && syncGroupIds.length)) {
|
|
4066
|
-
|
|
4111
|
+
_context4.next = 17;
|
|
4067
4112
|
break;
|
|
4068
4113
|
}
|
|
4069
|
-
|
|
4114
|
+
_context4.next = 17;
|
|
4070
4115
|
return all(syncGroupIds.map(function (syncGroupId) {
|
|
4071
4116
|
return put(syncGroupsActions.syncGroupAddTarget({
|
|
4072
4117
|
groupId: syncGroupId,
|
|
@@ -4075,63 +4120,63 @@ function fetchWorkspaceViewPresetSaga(_ref2) {
|
|
|
4075
4120
|
}));
|
|
4076
4121
|
}));
|
|
4077
4122
|
case 17:
|
|
4078
|
-
|
|
4123
|
+
_context4.next = 19;
|
|
4079
4124
|
return put(workspaceActions.updateWorkspaceView({
|
|
4080
4125
|
mosaicNodeId: mosaicNodeId,
|
|
4081
4126
|
viewPreset: data
|
|
4082
4127
|
}));
|
|
4083
4128
|
case 19:
|
|
4084
|
-
|
|
4129
|
+
_context4.next = 25;
|
|
4085
4130
|
break;
|
|
4086
4131
|
case 21:
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4132
|
+
_context4.prev = 21;
|
|
4133
|
+
_context4.t0 = _context4["catch"](1);
|
|
4134
|
+
_context4.next = 25;
|
|
4090
4135
|
return put(workspaceActions.updateWorkspaceView({
|
|
4091
4136
|
mosaicNodeId: mosaicNodeId,
|
|
4092
4137
|
viewPreset: getViewPresetState(viewPresetId, mosaicNodeId, 'error')
|
|
4093
4138
|
}));
|
|
4094
4139
|
case 25:
|
|
4095
4140
|
case "end":
|
|
4096
|
-
return
|
|
4141
|
+
return _context4.stop();
|
|
4097
4142
|
}
|
|
4098
4143
|
}, _callee2, null, [[1, 21]]);
|
|
4099
4144
|
})();
|
|
4100
4145
|
}
|
|
4101
4146
|
function fetchWorkspaceSaga(action) {
|
|
4102
4147
|
var payload, workspaceId, workspaceApi, _yield$call2, workspaceData, fullLoadingWorkspace, workspaceIdsInBatches, _iterator, _step, batchCall, errorType;
|
|
4103
|
-
return _regeneratorRuntime().wrap(function fetchWorkspaceSaga$(
|
|
4104
|
-
while (1) switch (
|
|
4148
|
+
return _regeneratorRuntime().wrap(function fetchWorkspaceSaga$(_context5) {
|
|
4149
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
4105
4150
|
case 0:
|
|
4106
4151
|
payload = action.payload;
|
|
4107
4152
|
workspaceId = payload.workspaceId;
|
|
4108
|
-
|
|
4109
|
-
|
|
4153
|
+
_context5.prev = 2;
|
|
4154
|
+
_context5.next = 5;
|
|
4110
4155
|
return put(routerActions.navigateToUrl({
|
|
4111
4156
|
url: getWorkspaceRouteUrl(workspaceId)
|
|
4112
4157
|
}));
|
|
4113
4158
|
case 5:
|
|
4114
|
-
|
|
4159
|
+
_context5.next = 7;
|
|
4115
4160
|
return put(workspaceListActions.toggleWorkspaceDialog({
|
|
4116
4161
|
isWorkspaceListDialogOpen: false
|
|
4117
4162
|
}));
|
|
4118
4163
|
case 7:
|
|
4119
|
-
|
|
4164
|
+
_context5.next = 9;
|
|
4120
4165
|
return call(getWorkspaceApi);
|
|
4121
4166
|
case 9:
|
|
4122
|
-
workspaceApi =
|
|
4123
|
-
|
|
4167
|
+
workspaceApi = _context5.sent;
|
|
4168
|
+
_context5.next = 12;
|
|
4124
4169
|
return call(workspaceApi.getWorkspacePreset, workspaceId);
|
|
4125
4170
|
case 12:
|
|
4126
|
-
_yield$call2 =
|
|
4171
|
+
_yield$call2 = _context5.sent;
|
|
4127
4172
|
workspaceData = _yield$call2.data;
|
|
4128
4173
|
if (workspaceData) {
|
|
4129
|
-
|
|
4174
|
+
_context5.next = 16;
|
|
4130
4175
|
break;
|
|
4131
4176
|
}
|
|
4132
4177
|
throw new Error(ERROR_NOT_FOUND);
|
|
4133
4178
|
case 16:
|
|
4134
|
-
|
|
4179
|
+
_context5.next = 18;
|
|
4135
4180
|
return put(workspaceActions.loadedWorkspace({
|
|
4136
4181
|
workspaceId: workspaceId,
|
|
4137
4182
|
workspace: workspaceData
|
|
@@ -4139,7 +4184,7 @@ function fetchWorkspaceSaga(action) {
|
|
|
4139
4184
|
case 18:
|
|
4140
4185
|
// show all views inside a workspace as loading
|
|
4141
4186
|
fullLoadingWorkspace = getLoadingWorkspace(workspaceData);
|
|
4142
|
-
|
|
4187
|
+
_context5.next = 21;
|
|
4143
4188
|
return put(workspaceActions.changePreset({
|
|
4144
4189
|
workspacePreset: fullLoadingWorkspace
|
|
4145
4190
|
}));
|
|
@@ -4147,15 +4192,15 @@ function fetchWorkspaceSaga(action) {
|
|
|
4147
4192
|
// fetch all individual view presets in batches
|
|
4148
4193
|
workspaceIdsInBatches = getListInChunks(workspaceData.views);
|
|
4149
4194
|
_iterator = _createForOfIteratorHelper(workspaceIdsInBatches);
|
|
4150
|
-
|
|
4195
|
+
_context5.prev = 23;
|
|
4151
4196
|
_iterator.s();
|
|
4152
4197
|
case 25:
|
|
4153
4198
|
if ((_step = _iterator.n()).done) {
|
|
4154
|
-
|
|
4199
|
+
_context5.next = 31;
|
|
4155
4200
|
break;
|
|
4156
4201
|
}
|
|
4157
4202
|
batchCall = _step.value;
|
|
4158
|
-
|
|
4203
|
+
_context5.next = 29;
|
|
4159
4204
|
return all(batchCall.map(function (view) {
|
|
4160
4205
|
return call(fetchWorkspaceViewPresetSaga, workspaceActions.fetchWorkspaceViewPreset({
|
|
4161
4206
|
mosaicNodeId: view.mosaicNodeId,
|
|
@@ -4163,113 +4208,113 @@ function fetchWorkspaceSaga(action) {
|
|
|
4163
4208
|
}));
|
|
4164
4209
|
}));
|
|
4165
4210
|
case 29:
|
|
4166
|
-
|
|
4211
|
+
_context5.next = 25;
|
|
4167
4212
|
break;
|
|
4168
4213
|
case 31:
|
|
4169
|
-
|
|
4214
|
+
_context5.next = 36;
|
|
4170
4215
|
break;
|
|
4171
4216
|
case 33:
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
_iterator.e(
|
|
4217
|
+
_context5.prev = 33;
|
|
4218
|
+
_context5.t0 = _context5["catch"](23);
|
|
4219
|
+
_iterator.e(_context5.t0);
|
|
4175
4220
|
case 36:
|
|
4176
|
-
|
|
4221
|
+
_context5.prev = 36;
|
|
4177
4222
|
_iterator.f();
|
|
4178
|
-
return
|
|
4223
|
+
return _context5.finish(36);
|
|
4179
4224
|
case 39:
|
|
4180
|
-
|
|
4225
|
+
_context5.next = 46;
|
|
4181
4226
|
break;
|
|
4182
4227
|
case 41:
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
errorType =
|
|
4186
|
-
|
|
4228
|
+
_context5.prev = 41;
|
|
4229
|
+
_context5.t1 = _context5["catch"](2);
|
|
4230
|
+
errorType = _context5.t1.message === ERROR_NOT_FOUND ? WorkspaceErrorType.NOT_FOUND : WorkspaceErrorType.GENERIC;
|
|
4231
|
+
_context5.next = 46;
|
|
4187
4232
|
return put(workspaceActions.errorWorkspace({
|
|
4188
4233
|
workspaceId: workspaceId,
|
|
4189
4234
|
error: {
|
|
4190
|
-
message: getErrorMessage(
|
|
4235
|
+
message: getErrorMessage(_context5.t1),
|
|
4191
4236
|
type: errorType
|
|
4192
4237
|
}
|
|
4193
4238
|
}));
|
|
4194
4239
|
case 46:
|
|
4195
4240
|
case "end":
|
|
4196
|
-
return
|
|
4241
|
+
return _context5.stop();
|
|
4197
4242
|
}
|
|
4198
|
-
},
|
|
4243
|
+
}, _marked3, null, [[2, 41], [23, 33, 36, 39]]);
|
|
4199
4244
|
}
|
|
4200
4245
|
function saveWorkspacePresetSaga(action) {
|
|
4201
4246
|
var workspace, workspaceApi;
|
|
4202
|
-
return _regeneratorRuntime().wrap(function saveWorkspacePresetSaga$(
|
|
4203
|
-
while (1) switch (
|
|
4247
|
+
return _regeneratorRuntime().wrap(function saveWorkspacePresetSaga$(_context6) {
|
|
4248
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
4204
4249
|
case 0:
|
|
4205
4250
|
workspace = action.payload.workspace;
|
|
4206
|
-
|
|
4207
|
-
|
|
4251
|
+
_context6.prev = 1;
|
|
4252
|
+
_context6.next = 4;
|
|
4208
4253
|
return call(getWorkspaceApi);
|
|
4209
4254
|
case 4:
|
|
4210
|
-
workspaceApi =
|
|
4211
|
-
|
|
4255
|
+
workspaceApi = _context6.sent;
|
|
4256
|
+
_context6.next = 7;
|
|
4212
4257
|
return call(workspaceApi.saveWorkspacePreset, workspace.id, workspace);
|
|
4213
4258
|
case 7:
|
|
4214
|
-
|
|
4259
|
+
_context6.next = 9;
|
|
4215
4260
|
return put(workspaceActions.loadedWorkspace(undefined));
|
|
4216
4261
|
case 9:
|
|
4217
|
-
|
|
4262
|
+
_context6.next = 11;
|
|
4218
4263
|
return put(workspaceListActions.onSuccessWorkspacePresetAction({
|
|
4219
4264
|
action: WorkspacePresetAction.SAVE,
|
|
4220
4265
|
workspaceId: workspace.id,
|
|
4221
4266
|
title: workspace.title
|
|
4222
4267
|
}));
|
|
4223
4268
|
case 11:
|
|
4224
|
-
|
|
4269
|
+
_context6.next = 17;
|
|
4225
4270
|
break;
|
|
4226
4271
|
case 13:
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4272
|
+
_context6.prev = 13;
|
|
4273
|
+
_context6.t0 = _context6["catch"](1);
|
|
4274
|
+
_context6.next = 17;
|
|
4230
4275
|
return put(workspaceActions.errorWorkspace({
|
|
4231
4276
|
workspaceId: workspace.id,
|
|
4232
4277
|
error: {
|
|
4233
|
-
message:
|
|
4278
|
+
message: _context6.t0.message,
|
|
4234
4279
|
type: WorkspaceErrorType.SAVE
|
|
4235
4280
|
}
|
|
4236
4281
|
}));
|
|
4237
4282
|
case 17:
|
|
4238
4283
|
case "end":
|
|
4239
|
-
return
|
|
4284
|
+
return _context6.stop();
|
|
4240
4285
|
}
|
|
4241
|
-
},
|
|
4286
|
+
}, _marked4, null, [[1, 13]]);
|
|
4242
4287
|
}
|
|
4243
4288
|
function registerMapSaga(_ref3) {
|
|
4244
4289
|
var payload = _ref3.payload;
|
|
4245
4290
|
return /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
4246
4291
|
var _a, mapId, viewType, workspaceState, mapPresetId;
|
|
4247
|
-
return _regeneratorRuntime().wrap(function _callee3$(
|
|
4248
|
-
while (1) switch (
|
|
4292
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context7) {
|
|
4293
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
4249
4294
|
case 0:
|
|
4250
4295
|
mapId = payload.mapId;
|
|
4251
|
-
|
|
4296
|
+
_context7.next = 3;
|
|
4252
4297
|
return select(getViewType);
|
|
4253
4298
|
case 3:
|
|
4254
|
-
viewType =
|
|
4299
|
+
viewType = _context7.sent;
|
|
4255
4300
|
if (!(viewType === 'tiledWindow')) {
|
|
4256
|
-
|
|
4301
|
+
_context7.next = 11;
|
|
4257
4302
|
break;
|
|
4258
4303
|
}
|
|
4259
|
-
|
|
4304
|
+
_context7.next = 7;
|
|
4260
4305
|
return select(getWorkspaceState);
|
|
4261
4306
|
case 7:
|
|
4262
|
-
workspaceState =
|
|
4307
|
+
workspaceState = _context7.sent;
|
|
4263
4308
|
// if it can't find the id, it's a view with multiple maps
|
|
4264
4309
|
mapPresetId = ((_a = workspaceState.views.byId[mapId]) === null || _a === void 0 ? void 0 : _a.id) || workspaceState.views.byId[workspaceState.views.allIds[0]].id;
|
|
4265
|
-
|
|
4310
|
+
_context7.next = 11;
|
|
4266
4311
|
return put(viewPresetActions.registerViewPreset({
|
|
4267
4312
|
panelId: mapId,
|
|
4268
4313
|
viewPresetId: mapPresetId
|
|
4269
4314
|
}));
|
|
4270
4315
|
case 11:
|
|
4271
4316
|
case "end":
|
|
4272
|
-
return
|
|
4317
|
+
return _context7.stop();
|
|
4273
4318
|
}
|
|
4274
4319
|
}, _callee3);
|
|
4275
4320
|
})();
|
|
@@ -4278,58 +4323,61 @@ function unregisterMapSaga(_ref4) {
|
|
|
4278
4323
|
var payload = _ref4.payload;
|
|
4279
4324
|
return /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
4280
4325
|
var mapId, viewType;
|
|
4281
|
-
return _regeneratorRuntime().wrap(function _callee4$(
|
|
4282
|
-
while (1) switch (
|
|
4326
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context8) {
|
|
4327
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
4283
4328
|
case 0:
|
|
4284
4329
|
mapId = payload.mapId;
|
|
4285
|
-
|
|
4330
|
+
_context8.next = 3;
|
|
4286
4331
|
return select(getViewType);
|
|
4287
4332
|
case 3:
|
|
4288
|
-
viewType =
|
|
4333
|
+
viewType = _context8.sent;
|
|
4289
4334
|
if (!(viewType === 'tiledWindow')) {
|
|
4290
|
-
|
|
4335
|
+
_context8.next = 7;
|
|
4291
4336
|
break;
|
|
4292
4337
|
}
|
|
4293
|
-
|
|
4338
|
+
_context8.next = 7;
|
|
4294
4339
|
return put(viewPresetActions.unregisterViewPreset({
|
|
4295
4340
|
panelId: mapId
|
|
4296
4341
|
}));
|
|
4297
4342
|
case 7:
|
|
4298
4343
|
case "end":
|
|
4299
|
-
return
|
|
4344
|
+
return _context8.stop();
|
|
4300
4345
|
}
|
|
4301
4346
|
}, _callee4);
|
|
4302
4347
|
})();
|
|
4303
4348
|
}
|
|
4304
4349
|
function workspaceSaga() {
|
|
4305
|
-
return _regeneratorRuntime().wrap(function workspaceSaga$(
|
|
4306
|
-
while (1) switch (
|
|
4350
|
+
return _regeneratorRuntime().wrap(function workspaceSaga$(_context9) {
|
|
4351
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
4307
4352
|
case 0:
|
|
4308
|
-
|
|
4353
|
+
_context9.next = 2;
|
|
4309
4354
|
return takeLatest(mapStoreActions.registerMap, registerMapSaga);
|
|
4310
4355
|
case 2:
|
|
4311
|
-
|
|
4356
|
+
_context9.next = 4;
|
|
4312
4357
|
return takeLatest(mapStoreActions.unregisterMap, unregisterMapSaga);
|
|
4313
4358
|
case 4:
|
|
4314
|
-
|
|
4359
|
+
_context9.next = 6;
|
|
4315
4360
|
return takeLatest(changePreset.type, changePresetSaga);
|
|
4316
4361
|
case 6:
|
|
4317
|
-
|
|
4362
|
+
_context9.next = 8;
|
|
4318
4363
|
return takeLatest(workspaceActions.fetchWorkspace.type, fetchWorkspaceSaga);
|
|
4319
4364
|
case 8:
|
|
4320
|
-
|
|
4365
|
+
_context9.next = 10;
|
|
4321
4366
|
return takeLatest(workspaceActions.saveWorkspacePreset, saveWorkspacePresetSaga);
|
|
4322
4367
|
case 10:
|
|
4323
|
-
|
|
4324
|
-
return
|
|
4368
|
+
_context9.next = 12;
|
|
4369
|
+
return takeLatest(workspaceActions.changeToEmptyMapWorkspace.type, changeToEmptyMapWorkspaceSaga);
|
|
4325
4370
|
case 12:
|
|
4326
|
-
|
|
4327
|
-
return
|
|
4371
|
+
_context9.next = 14;
|
|
4372
|
+
return takeEvery(workspaceActions.fetchWorkspaceViewPreset.type, fetchWorkspaceViewPresetSaga);
|
|
4328
4373
|
case 14:
|
|
4374
|
+
_context9.next = 16;
|
|
4375
|
+
return debounce(100, updateWorkspaceViews.type, updateViewsSaga);
|
|
4376
|
+
case 16:
|
|
4329
4377
|
case "end":
|
|
4330
|
-
return
|
|
4378
|
+
return _context9.stop();
|
|
4331
4379
|
}
|
|
4332
|
-
},
|
|
4380
|
+
}, _marked5);
|
|
4333
4381
|
}
|
|
4334
4382
|
|
|
4335
4383
|
/* *
|
|
@@ -5671,31 +5719,6 @@ var WorkspaceSelectListRow = function WorkspaceSelectListRow(_ref) {
|
|
|
5671
5719
|
}, /*#__PURE__*/React__default.createElement(Delete, null))))))));
|
|
5672
5720
|
};
|
|
5673
5721
|
|
|
5674
|
-
// Gets element height incl padding, border and margins
|
|
5675
|
-
var useGetElementHeight = function useGetElementHeight(ref, defaultHeight) {
|
|
5676
|
-
var _React$useState = React__default.useState(defaultHeight),
|
|
5677
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
5678
|
-
height = _React$useState2[0],
|
|
5679
|
-
setHeight = _React$useState2[1];
|
|
5680
|
-
React__default.useLayoutEffect(function () {
|
|
5681
|
-
var element = ref === null || ref === void 0 ? void 0 : ref.current;
|
|
5682
|
-
if (element) {
|
|
5683
|
-
setHeight(element.offsetHeight);
|
|
5684
|
-
}
|
|
5685
|
-
var observer = new ResizeObserver(function () {
|
|
5686
|
-
var height = getHeight(element);
|
|
5687
|
-
height && setHeight(height);
|
|
5688
|
-
});
|
|
5689
|
-
observer.observe(element);
|
|
5690
|
-
return function () {
|
|
5691
|
-
observer.disconnect();
|
|
5692
|
-
};
|
|
5693
|
-
}, [ref]);
|
|
5694
|
-
return {
|
|
5695
|
-
height: height
|
|
5696
|
-
};
|
|
5697
|
-
};
|
|
5698
|
-
|
|
5699
5722
|
/* *
|
|
5700
5723
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5701
5724
|
* you may not use this file except in compliance with the License.
|
|
@@ -5868,7 +5891,7 @@ var SearchField = function SearchField(_ref3) {
|
|
|
5868
5891
|
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
5869
5892
|
* */
|
|
5870
5893
|
var DEFAULT_FILTER_HEIGHT = 85;
|
|
5871
|
-
var WorkspaceFilter =
|
|
5894
|
+
var WorkspaceFilter = function WorkspaceFilter(_ref) {
|
|
5872
5895
|
var filters = _ref.filters,
|
|
5873
5896
|
_ref$onClickFilterChi = _ref.onClickFilterChip,
|
|
5874
5897
|
onClickFilterChip = _ref$onClickFilterChi === void 0 ? function () {} : _ref$onClickFilterChi,
|
|
@@ -5877,7 +5900,6 @@ var WorkspaceFilter = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
5877
5900
|
isAllSelected = _ref.isAllSelected,
|
|
5878
5901
|
searchQuery = _ref.searchQuery;
|
|
5879
5902
|
return /*#__PURE__*/React.createElement(Box, {
|
|
5880
|
-
ref: ref,
|
|
5881
5903
|
sx: {
|
|
5882
5904
|
marginBottom: '8px'
|
|
5883
5905
|
}
|
|
@@ -5891,7 +5913,7 @@ var WorkspaceFilter = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
5891
5913
|
onChipClick: onClickFilterChip,
|
|
5892
5914
|
isAllSelected: isAllSelected
|
|
5893
5915
|
})));
|
|
5894
|
-
}
|
|
5916
|
+
};
|
|
5895
5917
|
|
|
5896
5918
|
var emptyWorkspaceListItem = {
|
|
5897
5919
|
id: emptyMapWorkspace.id,
|
|
@@ -5900,63 +5922,12 @@ var emptyWorkspaceListItem = {
|
|
|
5900
5922
|
viewType: emptyMapWorkspace.viewType,
|
|
5901
5923
|
"abstract": emptyMapWorkspace["abstract"]
|
|
5902
5924
|
};
|
|
5903
|
-
var DEFAULT_DIALOG_HEIGHT = 900;
|
|
5904
5925
|
var MIN_HEIGHT_SCROLLABLE_LIST = 88; // Slightly less than 2 rows
|
|
5905
5926
|
var LIST_PADDING_TOP = 8;
|
|
5906
|
-
var DEFAULT_PARENT_PADDING = 8;
|
|
5907
5927
|
var DEFAULT_RESULTS_HEIGHT = 22;
|
|
5908
|
-
|
|
5909
|
-
|
|
5910
|
-
|
|
5911
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
5912
|
-
dialogHeight = _React$useState2[0],
|
|
5913
|
-
setDialogHeight = _React$useState2[1];
|
|
5914
|
-
// Used to store the padding height surrounding the list and the filters
|
|
5915
|
-
var _React$useState3 = React.useState(DEFAULT_PARENT_PADDING),
|
|
5916
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
5917
|
-
parentPaddingHeight = _React$useState4[0],
|
|
5918
|
-
setParentPaddingHeight = _React$useState4[1];
|
|
5919
|
-
// Obtain the height of the results div
|
|
5920
|
-
var resultsRef = React.useRef(null);
|
|
5921
|
-
var _useGetElementHeight = useGetElementHeight(resultsRef, DEFAULT_RESULTS_HEIGHT),
|
|
5922
|
-
resultsHeight = _useGetElementHeight.height;
|
|
5923
|
-
// Obtain the height of the filters and search
|
|
5924
|
-
var _useGetElementHeight2 = useGetElementHeight(ref, DEFAULT_FILTER_HEIGHT),
|
|
5925
|
-
filterHeight = _useGetElementHeight2.height;
|
|
5926
|
-
// Obtain the height of of the list dialog content
|
|
5927
|
-
React.useLayoutEffect(function () {
|
|
5928
|
-
var _a, _b, _c, _d;
|
|
5929
|
-
var dialogElement = (_d = (_c = (_b = (_a = resultsRef.current) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.parentElement) === null || _c === void 0 ? void 0 : _c.parentElement) === null || _d === void 0 ? void 0 : _d.parentElement;
|
|
5930
|
-
setDialogHeight(dialogElement.offsetHeight);
|
|
5931
|
-
var observer = new ResizeObserver(function () {
|
|
5932
|
-
var height = getHeight(dialogElement);
|
|
5933
|
-
height && setDialogHeight(height);
|
|
5934
|
-
});
|
|
5935
|
-
observer.observe(dialogElement);
|
|
5936
|
-
return function () {
|
|
5937
|
-
observer.disconnect();
|
|
5938
|
-
};
|
|
5939
|
-
}, [resultsRef]);
|
|
5940
|
-
// Obtain the padding height surrounding the list and the filters
|
|
5941
|
-
React.useEffect(function () {
|
|
5942
|
-
var _a, _b;
|
|
5943
|
-
var parentElement = (_b = (_a = resultsRef.current) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.parentElement;
|
|
5944
|
-
var style = getComputedStyle(parentElement);
|
|
5945
|
-
var paddingTop = parseInt(style.paddingTop, 10);
|
|
5946
|
-
paddingTop && setParentPaddingHeight(paddingTop);
|
|
5947
|
-
}, []);
|
|
5948
|
-
var heightOtherElements = filterHeight + resultsHeight + LIST_PADDING_TOP + 2 * parentPaddingHeight;
|
|
5949
|
-
// row height = height + margin
|
|
5950
|
-
var rowHeight = WORKSPACE_SELECT_LIST_ROW_HEIGHT + 4;
|
|
5951
|
-
var availableSpaceForList = dialogHeight - heightOtherElements;
|
|
5952
|
-
var listHeight = availableSpaceForList && availableSpaceForList < MIN_HEIGHT_SCROLLABLE_LIST ? MIN_HEIGHT_SCROLLABLE_LIST : availableSpaceForList;
|
|
5953
|
-
return {
|
|
5954
|
-
resultsRef: resultsRef,
|
|
5955
|
-
rowHeight: rowHeight,
|
|
5956
|
-
listHeight: listHeight
|
|
5957
|
-
};
|
|
5958
|
-
};
|
|
5959
|
-
var WorkspaceSelectList = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
5928
|
+
// row height = height + margin
|
|
5929
|
+
var rowHeight = WORKSPACE_SELECT_LIST_ROW_HEIGHT + 4;
|
|
5930
|
+
var WorkspaceSelectList = function WorkspaceSelectList(_ref) {
|
|
5960
5931
|
var workspacePresets = _ref.workspacePresets,
|
|
5961
5932
|
currentSelectedId = _ref.currentSelectedId,
|
|
5962
5933
|
onClickPreset = _ref.onClickPreset,
|
|
@@ -5968,49 +5939,53 @@ var WorkspaceSelectList = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
5968
5939
|
newPreset = _ref$newPreset === void 0 ? emptyWorkspaceListItem : _ref$newPreset,
|
|
5969
5940
|
_ref$testIdPrefix = _ref.testIdPrefix,
|
|
5970
5941
|
testIdPrefix = _ref$testIdPrefix === void 0 ? 'workspace' : _ref$testIdPrefix;
|
|
5971
|
-
var
|
|
5972
|
-
|
|
5973
|
-
|
|
5974
|
-
listHeight = _useGetRequiredHeight.listHeight;
|
|
5975
|
-
// Height of other elements in dialog besides the list:
|
|
5976
|
-
// filter, results text , padding list top and 2x padding around dialog children (top & bottom)
|
|
5977
|
-
var items = !hideNewWorkspace ? [newPreset].concat(_toConsumableArray(workspacePresets)) : workspacePresets;
|
|
5978
|
-
// console.log(filterHeight, resultsHeight, parentPaddingHeight);
|
|
5942
|
+
var items = React.useMemo(function () {
|
|
5943
|
+
return !hideNewWorkspace ? [newPreset].concat(_toConsumableArray(workspacePresets)) : workspacePresets;
|
|
5944
|
+
}, [hideNewWorkspace, newPreset, workspacePresets]);
|
|
5979
5945
|
return /*#__PURE__*/React.createElement(Box, {
|
|
5980
|
-
"data-testid": "".concat(testIdPrefix, "-selectList")
|
|
5946
|
+
"data-testid": "".concat(testIdPrefix, "-selectList"),
|
|
5947
|
+
sx: {
|
|
5948
|
+
height: "calc(100% - ".concat(DEFAULT_FILTER_HEIGHT, "px)"),
|
|
5949
|
+
minHeight: MIN_HEIGHT_SCROLLABLE_LIST
|
|
5950
|
+
}
|
|
5981
5951
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
5982
|
-
ref: resultsRef,
|
|
5983
5952
|
sx: {
|
|
5984
5953
|
marginBottom: '4px',
|
|
5985
5954
|
fontSize: '12px'
|
|
5986
5955
|
}
|
|
5987
|
-
}, workspacePresets.length, " results"), /*#__PURE__*/React.createElement(
|
|
5988
|
-
|
|
5989
|
-
|
|
5990
|
-
|
|
5991
|
-
|
|
5992
|
-
|
|
5993
|
-
|
|
5994
|
-
|
|
5995
|
-
|
|
5996
|
-
|
|
5997
|
-
|
|
5998
|
-
|
|
5999
|
-
|
|
6000
|
-
|
|
6001
|
-
|
|
6002
|
-
|
|
6003
|
-
|
|
6004
|
-
|
|
6005
|
-
|
|
6006
|
-
|
|
6007
|
-
|
|
6008
|
-
|
|
6009
|
-
|
|
6010
|
-
|
|
5956
|
+
}, workspacePresets.length, " results"), /*#__PURE__*/React.createElement(AutoSizer, null, function (_ref2) {
|
|
5957
|
+
var _ref2$height = _ref2.height,
|
|
5958
|
+
height = _ref2$height === void 0 ? 0 : _ref2$height,
|
|
5959
|
+
_ref2$width = _ref2.width,
|
|
5960
|
+
width = _ref2$width === void 0 ? 0 : _ref2$width;
|
|
5961
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
5962
|
+
sx: {
|
|
5963
|
+
paddingTop: "".concat(LIST_PADDING_TOP, "px")
|
|
5964
|
+
}
|
|
5965
|
+
}, /*#__PURE__*/React.createElement(FixedSizeList, {
|
|
5966
|
+
height: height - DEFAULT_RESULTS_HEIGHT,
|
|
5967
|
+
width: width,
|
|
5968
|
+
itemCount: items.length,
|
|
5969
|
+
itemSize: rowHeight
|
|
5970
|
+
}, function (_ref3) {
|
|
5971
|
+
var index = _ref3.index,
|
|
5972
|
+
style = _ref3.style;
|
|
5973
|
+
var preset = items[index];
|
|
5974
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
5975
|
+
style: style,
|
|
5976
|
+
key: preset.id || 'emptyPreset'
|
|
5977
|
+
}, /*#__PURE__*/React.createElement(WorkspaceSelectListRow, {
|
|
5978
|
+
workspacePreset: preset,
|
|
5979
|
+
onClickPreset: onClickPreset,
|
|
5980
|
+
onClickWorkspacePresetOption: onClickWorkspacePresetOption,
|
|
5981
|
+
isEditable: isLoggedIn,
|
|
5982
|
+
searchQuery: searchQuery,
|
|
5983
|
+
isSelected: currentSelectedId === preset.id || currentSelectedId === '' && preset.id === undefined,
|
|
5984
|
+
testIdPrefix: testIdPrefix
|
|
5985
|
+
}));
|
|
6011
5986
|
}));
|
|
6012
|
-
}))
|
|
6013
|
-
}
|
|
5987
|
+
}));
|
|
5988
|
+
};
|
|
6014
5989
|
|
|
6015
5990
|
/* *
|
|
6016
5991
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -6032,7 +6007,6 @@ var ERROR_TITLE = 'View presets not available';
|
|
|
6032
6007
|
var ERROR_RETRY = 'Try again';
|
|
6033
6008
|
var ViewPresetMenuListConnect = function ViewPresetMenuListConnect(_ref) {
|
|
6034
6009
|
var panelId = _ref.panelId;
|
|
6035
|
-
var filterRef = React.useRef(null);
|
|
6036
6010
|
var viewPresets = useSelector(function (store) {
|
|
6037
6011
|
return getFilteredViewPresetListForView(store, panelId);
|
|
6038
6012
|
});
|
|
@@ -6172,7 +6146,10 @@ var ViewPresetMenuListConnect = function ViewPresetMenuListConnect(_ref) {
|
|
|
6172
6146
|
});
|
|
6173
6147
|
var shouldHideNewWorkspace = !isAllSelectedForFilters || viewPresetListSearchQuery.length > 0;
|
|
6174
6148
|
return /*#__PURE__*/React.createElement("div", {
|
|
6175
|
-
"data-testid": "viewpreset-selectlist-connect"
|
|
6149
|
+
"data-testid": "viewpreset-selectlist-connect",
|
|
6150
|
+
style: {
|
|
6151
|
+
height: '100%'
|
|
6152
|
+
}
|
|
6176
6153
|
}, isViewPresetsListFetching && ( /*#__PURE__*/React.createElement(LinearProgress, {
|
|
6177
6154
|
"data-testid": "loading-bar",
|
|
6178
6155
|
color: "secondary",
|
|
@@ -6189,15 +6166,15 @@ var ViewPresetMenuListConnect = function ViewPresetMenuListConnect(_ref) {
|
|
|
6189
6166
|
}
|
|
6190
6167
|
})), /*#__PURE__*/React.createElement(Box, {
|
|
6191
6168
|
sx: {
|
|
6192
|
-
padding: 1
|
|
6169
|
+
padding: 1,
|
|
6170
|
+
height: '100%'
|
|
6193
6171
|
}
|
|
6194
6172
|
}, !errorViewPresetsList && ( /*#__PURE__*/React.createElement(WorkspaceFilter, {
|
|
6195
6173
|
filters: viewPresetListFilters,
|
|
6196
6174
|
onClickFilterChip: onClickFilterChip,
|
|
6197
6175
|
isAllSelected: isAllSelectedForFilters,
|
|
6198
6176
|
searchQuery: viewPresetListSearchQuery,
|
|
6199
|
-
onSearch: onSearchFilter
|
|
6200
|
-
ref: filterRef
|
|
6177
|
+
onSearch: onSearchFilter
|
|
6201
6178
|
})), /*#__PURE__*/React.createElement(WorkspaceSelectList, {
|
|
6202
6179
|
workspacePresets: viewPresets,
|
|
6203
6180
|
currentSelectedId: activeViewPresetId || undefined,
|
|
@@ -6210,8 +6187,7 @@ var ViewPresetMenuListConnect = function ViewPresetMenuListConnect(_ref) {
|
|
|
6210
6187
|
isLoggedIn: isLoggedIn,
|
|
6211
6188
|
hideNewWorkspace: shouldHideNewWorkspace,
|
|
6212
6189
|
searchQuery: viewPresetListSearchQuery,
|
|
6213
|
-
testIdPrefix: "viewpreset"
|
|
6214
|
-
ref: filterRef
|
|
6190
|
+
testIdPrefix: "viewpreset"
|
|
6215
6191
|
})));
|
|
6216
6192
|
};
|
|
6217
6193
|
|
|
@@ -6438,17 +6414,22 @@ var getPresetTitle = function getPresetTitle(title, hasChanges, isNew) {
|
|
|
6438
6414
|
}
|
|
6439
6415
|
return title;
|
|
6440
6416
|
};
|
|
6441
|
-
var
|
|
6417
|
+
var WorkspaceViewTitleConnectNoMemo = function WorkspaceViewTitleConnectNoMemo(_ref) {
|
|
6442
6418
|
var panelId = _ref.panelId,
|
|
6443
6419
|
isViewPresetDialogOpen = _ref.isViewPresetDialogOpen;
|
|
6444
6420
|
var dispatch = useDispatch();
|
|
6445
6421
|
var theme = useTheme();
|
|
6446
|
-
var
|
|
6447
|
-
return mapSelectors.getMapPreset(store, panelId);
|
|
6448
|
-
});
|
|
6422
|
+
var store = useStore();
|
|
6449
6423
|
var workspaceView = useSelector(function (store) {
|
|
6450
|
-
|
|
6451
|
-
|
|
6424
|
+
var _a;
|
|
6425
|
+
var _ref2 = (_a = getViewById(store, panelId)) !== null && _a !== void 0 ? _a : {},
|
|
6426
|
+
title = _ref2.title,
|
|
6427
|
+
scope = _ref2.scope;
|
|
6428
|
+
return {
|
|
6429
|
+
title: title,
|
|
6430
|
+
scope: scope
|
|
6431
|
+
};
|
|
6432
|
+
}, shallowEqual);
|
|
6452
6433
|
var hasMapPresetChanges = useSelector(function (store) {
|
|
6453
6434
|
return getViewPresetHasChanges(store, panelId);
|
|
6454
6435
|
});
|
|
@@ -6470,7 +6451,7 @@ var WorkspaceViewTitleConnect = function WorkspaceViewTitleConnect(_ref) {
|
|
|
6470
6451
|
viewPreset: Object.assign(Object.assign({}, emptyMapViewPreset), {
|
|
6471
6452
|
title: title,
|
|
6472
6453
|
initialProps: {
|
|
6473
|
-
mapPreset:
|
|
6454
|
+
mapPreset: mapSelectors.getMapPreset(store.getState(), panelId),
|
|
6474
6455
|
syncGroupsIds: relatedSyncGroupIds
|
|
6475
6456
|
}
|
|
6476
6457
|
})
|
|
@@ -6497,7 +6478,7 @@ var WorkspaceViewTitleConnect = function WorkspaceViewTitleConnect(_ref) {
|
|
|
6497
6478
|
formValues: {
|
|
6498
6479
|
title: formTitle,
|
|
6499
6480
|
initialProps: {
|
|
6500
|
-
mapPreset:
|
|
6481
|
+
mapPreset: mapSelectors.getMapPreset(store.getState(), panelId),
|
|
6501
6482
|
syncGroupsIds: relatedSyncGroupIds
|
|
6502
6483
|
}
|
|
6503
6484
|
}
|
|
@@ -6513,33 +6494,25 @@ var WorkspaceViewTitleConnect = function WorkspaceViewTitleConnect(_ref) {
|
|
|
6513
6494
|
formValues: {
|
|
6514
6495
|
title: formTitle,
|
|
6515
6496
|
initialProps: {
|
|
6516
|
-
mapPreset:
|
|
6497
|
+
mapPreset: mapSelectors.getMapPreset(store.getState(), panelId),
|
|
6517
6498
|
syncGroupsIds: relatedSyncGroupIds
|
|
6518
6499
|
}
|
|
6519
6500
|
}
|
|
6520
6501
|
});
|
|
6521
6502
|
};
|
|
6522
|
-
var toggleViewPresetDialog = React.useCallback(function (
|
|
6523
|
-
var panelId =
|
|
6524
|
-
isViewPresetDialogOpen =
|
|
6503
|
+
var toggleViewPresetDialog = React.useCallback(function (_ref3) {
|
|
6504
|
+
var panelId = _ref3.panelId,
|
|
6505
|
+
isViewPresetDialogOpen = _ref3.isViewPresetDialogOpen;
|
|
6525
6506
|
dispatch(viewPresetActions.toggleViewPresetListDialog({
|
|
6526
6507
|
panelId: panelId,
|
|
6527
6508
|
isViewPresetListDialogOpen: isViewPresetDialogOpen
|
|
6528
6509
|
}));
|
|
6529
6510
|
}, [dispatch]);
|
|
6530
6511
|
var isNewActive = activeMapPresetId === '';
|
|
6531
|
-
var title =
|
|
6532
|
-
var viewScope = workspaceView
|
|
6512
|
+
var title = workspaceView.title || MAPPRESET_ACTIVE_TITLE;
|
|
6513
|
+
var viewScope = workspaceView.scope;
|
|
6533
6514
|
var fullTitle = getPresetTitle(title, hasMapPresetChanges, isNewActive);
|
|
6534
|
-
|
|
6535
|
-
// This component renders on every change in the mapstate.
|
|
6536
|
-
// This is because selectors like mapSelectors.getMapPreset are used in the component.
|
|
6537
|
-
// The data from this selector is not used during a render, so it is wasting renders.
|
|
6538
|
-
// The data is need only in the callback functions - not the component itself
|
|
6539
|
-
// To prevent unneeded renders, this code should be rewritten by using refs, or move the logic to sagas.
|
|
6540
|
-
// You can use the renderCounter to check the nubmer of renders.
|
|
6541
|
-
// Also check https://xam-react-coe.medium.com/react-useselector-without-re-render-225686bee3f
|
|
6542
|
-
renderCounter.count(WorkspaceViewTitleConnect.name);
|
|
6515
|
+
renderCounter.count(WorkspaceViewTitleConnectNoMemo.name);
|
|
6543
6516
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CustomIconButton, {
|
|
6544
6517
|
"data-testid": "open-viewpresets",
|
|
6545
6518
|
sx: {
|
|
@@ -6575,6 +6548,7 @@ var WorkspaceViewTitleConnect = function WorkspaceViewTitleConnect(_ref) {
|
|
|
6575
6548
|
id: "viewpreset-options-toolbutton"
|
|
6576
6549
|
}));
|
|
6577
6550
|
};
|
|
6551
|
+
var WorkspaceViewTitleConnect = /*#__PURE__*/React.memo(WorkspaceViewTitleConnectNoMemo);
|
|
6578
6552
|
|
|
6579
6553
|
/* *
|
|
6580
6554
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -6964,7 +6938,6 @@ var WorkspaceViewConnect = function WorkspaceViewConnect(_ref) {
|
|
|
6964
6938
|
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
6965
6939
|
* */
|
|
6966
6940
|
var WorkspaceSelectListConnect = function WorkspaceSelectListConnect() {
|
|
6967
|
-
var filterRef = React.useRef(null);
|
|
6968
6941
|
var currentView = useSelector(function (store) {
|
|
6969
6942
|
return getWorkspaceState(store);
|
|
6970
6943
|
});
|
|
@@ -7024,9 +6997,7 @@ var WorkspaceSelectListConnect = function WorkspaceSelectListConnect() {
|
|
|
7024
6997
|
dispatch(workspaceListActions.toggleWorkspaceDialog({
|
|
7025
6998
|
isWorkspaceListDialogOpen: false
|
|
7026
6999
|
}));
|
|
7027
|
-
dispatch(workspaceActions.
|
|
7028
|
-
workspacePreset: emptyMapWorkspace
|
|
7029
|
-
}));
|
|
7000
|
+
dispatch(workspaceActions.changeToEmptyMapWorkspace());
|
|
7030
7001
|
}, [dispatch]);
|
|
7031
7002
|
var onClickWorkspace = function onClickWorkspace(id) {
|
|
7032
7003
|
if (id === emptyMapWorkspace.id) {
|
|
@@ -7098,7 +7069,10 @@ var WorkspaceSelectListConnect = function WorkspaceSelectListConnect() {
|
|
|
7098
7069
|
});
|
|
7099
7070
|
var shouldHideNewWorkspace = !isAllSelected || workspaceSearchQuery.length > 0;
|
|
7100
7071
|
return /*#__PURE__*/React.createElement("div", {
|
|
7101
|
-
"data-testid": "workspace-selectlist-connect"
|
|
7072
|
+
"data-testid": "workspace-selectlist-connect",
|
|
7073
|
+
style: {
|
|
7074
|
+
height: '100%'
|
|
7075
|
+
}
|
|
7102
7076
|
}, isFetching && ( /*#__PURE__*/React.createElement(LinearProgress, {
|
|
7103
7077
|
"data-testid": "loading-bar",
|
|
7104
7078
|
color: "secondary",
|
|
@@ -7125,15 +7099,15 @@ var WorkspaceSelectListConnect = function WorkspaceSelectListConnect() {
|
|
|
7125
7099
|
}
|
|
7126
7100
|
})))), /*#__PURE__*/React.createElement(Box, {
|
|
7127
7101
|
sx: {
|
|
7128
|
-
padding: 1
|
|
7102
|
+
padding: 1,
|
|
7103
|
+
height: '100%'
|
|
7129
7104
|
}
|
|
7130
7105
|
}, !error && ( /*#__PURE__*/React.createElement(WorkspaceFilter, {
|
|
7131
7106
|
filters: workspaceListFilters,
|
|
7132
7107
|
onClickFilterChip: onClickFilterChip,
|
|
7133
7108
|
isAllSelected: isAllSelected,
|
|
7134
7109
|
searchQuery: workspaceSearchQuery,
|
|
7135
|
-
onSearch: searchFilter
|
|
7136
|
-
ref: filterRef
|
|
7110
|
+
onSearch: searchFilter
|
|
7137
7111
|
})), /*#__PURE__*/React.createElement(WorkspaceSelectList, {
|
|
7138
7112
|
workspacePresets: workspacePresets,
|
|
7139
7113
|
currentSelectedId: currentView.id || '',
|
|
@@ -7141,8 +7115,7 @@ var WorkspaceSelectListConnect = function WorkspaceSelectListConnect() {
|
|
|
7141
7115
|
onClickWorkspacePresetOption: onClickWorkspacePresetOption,
|
|
7142
7116
|
hideNewWorkspace: shouldHideNewWorkspace,
|
|
7143
7117
|
isLoggedIn: isLoggedIn,
|
|
7144
|
-
searchQuery: workspaceSearchQuery
|
|
7145
|
-
ref: filterRef
|
|
7118
|
+
searchQuery: workspaceSearchQuery
|
|
7146
7119
|
})));
|
|
7147
7120
|
};
|
|
7148
7121
|
|
|
@@ -7699,9 +7672,12 @@ var WorkspaceTopBar = function WorkspaceTopBar(_ref) {
|
|
|
7699
7672
|
"aria-label": "workspace-bar-tabs",
|
|
7700
7673
|
sx: {
|
|
7701
7674
|
width: '100%',
|
|
7675
|
+
height: '100%',
|
|
7702
7676
|
minHeight: 'auto',
|
|
7703
7677
|
'.MuiTabs-flexContainer': {
|
|
7704
|
-
flexDirection: 'column'
|
|
7678
|
+
flexDirection: 'column',
|
|
7679
|
+
justifyContent: 'center',
|
|
7680
|
+
height: '100%'
|
|
7705
7681
|
}
|
|
7706
7682
|
}
|
|
7707
7683
|
}, /*#__PURE__*/React.createElement(WorkspaceTabConnect, {
|
|
@@ -8041,10 +8017,8 @@ var WorkspaceDetail = function WorkspaceDetail(_ref) {
|
|
|
8041
8017
|
workspace: workspaceData
|
|
8042
8018
|
}));
|
|
8043
8019
|
}, [dispatch, workspaceData]);
|
|
8044
|
-
var
|
|
8045
|
-
dispatch(workspaceActions.
|
|
8046
|
-
workspacePreset: newScreenPreset
|
|
8047
|
-
}));
|
|
8020
|
+
var changeToEmptyMapWorkspace = React.useCallback(function () {
|
|
8021
|
+
dispatch(workspaceActions.changeToEmptyMapWorkspace());
|
|
8048
8022
|
}, [dispatch]);
|
|
8049
8023
|
var navigateToUrl = React.useCallback(function (url) {
|
|
8050
8024
|
dispatch(routerActions.navigateToUrl({
|
|
@@ -8052,7 +8026,7 @@ var WorkspaceDetail = function WorkspaceDetail(_ref) {
|
|
|
8052
8026
|
}));
|
|
8053
8027
|
}, [dispatch]);
|
|
8054
8028
|
var setEmptyWorkSpace = function setEmptyWorkSpace() {
|
|
8055
|
-
|
|
8029
|
+
changeToEmptyMapWorkspace();
|
|
8056
8030
|
navigateToUrl(routes.root);
|
|
8057
8031
|
};
|
|
8058
8032
|
React.useEffect(function () {
|
|
@@ -8118,4 +8092,4 @@ var WorkspaceDetail = function WorkspaceDetail(_ref) {
|
|
|
8118
8092
|
}))))), /*#__PURE__*/React.createElement(MapPresetsFormDialogConnect, null));
|
|
8119
8093
|
};
|
|
8120
8094
|
|
|
8121
|
-
export { ComponentsLookUpWrapper, WorkspaceDetail, WorkspaceErrorType, WorkspaceModuleProvider, WorkspacePresetAction, WorkspaceTopBar, WorkspaceViewConnect, WorkspaceWrapperProviderWithStore, workspaceActions as actions, createBalancedMosaicNode, defaultAuthConfig, emptyMapWorkspace, getWorkspaceRouteUrl, selectors, viewPresetActions, workspaceListActions, workspaceModuleConfig, reducer$1 as workspaceReducer, routes as workspaceRoutes };
|
|
8095
|
+
export { ComponentsLookUpWrapper, WorkspaceDetail, WorkspaceErrorType, WorkspaceModuleProvider, WorkspacePresetAction, WorkspaceTopBar, WorkspaceViewConnect, WorkspaceWrapperProviderWithStore, workspaceActions as actions, createBalancedMosaicNode, createCustomEmptyMapWorkspace, defaultAuthConfig, emptyMapWorkspace, getWorkspaceRouteUrl, selectors, viewPresetActions, workspaceListActions, workspaceModuleConfig, reducer$1 as workspaceReducer, routes as workspaceRoutes };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/workspace",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.10.0",
|
|
4
4
|
"description": "GeoWeb Workspace library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"react-redux": "^8.1.3",
|
|
12
12
|
"@opengeoweb/shared": "*",
|
|
13
|
-
"@mui/material": "5.
|
|
13
|
+
"@mui/material": "~5.15.11",
|
|
14
14
|
"@opengeoweb/form-fields": "*",
|
|
15
15
|
"@opengeoweb/store": "*",
|
|
16
16
|
"@opengeoweb/api": "*",
|
|
17
|
-
"react-hook-form": "7.
|
|
17
|
+
"react-hook-form": "^7.50.1",
|
|
18
18
|
"@opengeoweb/core": "*",
|
|
19
19
|
"@opengeoweb/theme": "*",
|
|
20
20
|
"@reduxjs/toolkit": "^1.9.7",
|
|
@@ -26,15 +26,16 @@
|
|
|
26
26
|
"redux-saga": "^1.2.3",
|
|
27
27
|
"react-mosaic-component": "^6.1.0",
|
|
28
28
|
"lodash": "^4.17.21",
|
|
29
|
-
"@emotion/react": "^11.11.1",
|
|
30
29
|
"@redux-eggs/core": "^2.2.0",
|
|
31
30
|
"@redux-eggs/redux-toolkit": "^2.2.0",
|
|
32
31
|
"@redux-eggs/saga-extension": "^2.2.0",
|
|
33
|
-
"immer": "^
|
|
32
|
+
"immer": "^10.0.3",
|
|
34
33
|
"axios": "1.5.0",
|
|
35
34
|
"@opengeoweb/taf": "*",
|
|
36
35
|
"@opengeoweb/sigmet-airmet": "*",
|
|
37
|
-
"@opengeoweb/warnings": "*"
|
|
36
|
+
"@opengeoweb/warnings": "*",
|
|
37
|
+
"react-virtualized-auto-sizer": "^1.0.21",
|
|
38
|
+
"@opengeoweb/timeslider": "*"
|
|
38
39
|
},
|
|
39
40
|
"peerDependencies": {
|
|
40
41
|
"react": "18"
|
package/src/index.d.ts
CHANGED
|
@@ -10,5 +10,5 @@ export * from './lib/components/WorkspaceView';
|
|
|
10
10
|
export * from './lib/components/WorkspaceTopBar';
|
|
11
11
|
export * from './lib/components/WorkspaceDetail';
|
|
12
12
|
export { routes as workspaceRoutes, getWorkspaceRouteUrl, } from './lib/utils/routes';
|
|
13
|
-
export { emptyMapWorkspace } from './lib/store/workspaceList/utils';
|
|
13
|
+
export { emptyMapWorkspace, createCustomEmptyMapWorkspace, } from './lib/store/workspaceList/utils';
|
|
14
14
|
export type { WorkspaceModuleStore } from './lib/store/config';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { mapTypes } from '@opengeoweb/store';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { PresetAction } from '../../store/viewPresets/types';
|
|
4
|
-
export
|
|
4
|
+
export interface MapPresetFormValues {
|
|
5
5
|
title?: string;
|
|
6
6
|
initialProps?: {
|
|
7
7
|
mapPreset: mapTypes.MapPreset;
|
|
8
8
|
syncGroupsIds?: string[];
|
|
9
9
|
};
|
|
10
|
-
}
|
|
10
|
+
}
|
|
11
11
|
interface MapPresetsFormProps {
|
|
12
12
|
error?: string;
|
|
13
13
|
onSubmit?: () => void;
|
|
@@ -13,6 +13,5 @@ export interface WorkspaceSelectListProps extends BoxProps {
|
|
|
13
13
|
newPreset?: WorkspacePresetListItem;
|
|
14
14
|
testIdPrefix?: string;
|
|
15
15
|
}
|
|
16
|
-
export declare const DEFAULT_DIALOG_HEIGHT = 900;
|
|
17
16
|
declare const WorkspaceSelectList: React.FC<WorkspaceSelectListProps>;
|
|
18
17
|
export default WorkspaceSelectList;
|
|
@@ -10,5 +10,5 @@ interface WorkspaceViewTitleConnectProps {
|
|
|
10
10
|
export declare const NEW_TITLE_SUFFIX = "(not saved)";
|
|
11
11
|
export declare const EXISTING_TITLE_SUFFIX = "(modified)";
|
|
12
12
|
export declare const getPresetTitle: (title: string, hasChanges: boolean, isNew: boolean) => string;
|
|
13
|
-
export declare const WorkspaceViewTitleConnect: React.
|
|
13
|
+
export declare const WorkspaceViewTitleConnect: React.NamedExoticComponent<WorkspaceViewTitleConnectProps>;
|
|
14
14
|
export {};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { EntityState } from '@reduxjs/toolkit';
|
|
2
2
|
export type PresetScope = 'user' | 'system';
|
|
3
|
-
export
|
|
3
|
+
export interface ViewPresetListItem {
|
|
4
4
|
id: string;
|
|
5
5
|
title: string;
|
|
6
6
|
date: string;
|
|
7
7
|
scope: PresetScope;
|
|
8
|
-
}
|
|
9
|
-
export
|
|
8
|
+
}
|
|
9
|
+
export interface FetchViewPresetsListParams {
|
|
10
10
|
scope?: string;
|
|
11
11
|
search?: string;
|
|
12
|
-
}
|
|
12
|
+
}
|
|
13
13
|
export type ViewPresetListState = EntityState<ViewPresetListItem>;
|
|
14
14
|
export interface LoadViewPresetsPayload {
|
|
15
15
|
viewPresets: ViewPresetListItem[];
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { Reducer } from '@reduxjs/toolkit';
|
|
2
|
-
import { WorkspaceAddViewPayload, WorkspaceDeleteViewPayload, WorkspaceState, WorkspaceSetPresetPayload, WorkspaceSetPreventCloseViewPayload, WorkspaceUpdateViewPayload, WorkspaceUpdateViewsPayload, WorkspaceErrorWorkspacePayload, WorkspaceFetchedWorkspacePayload, WorkspaceFetchWorkspacePayload, WorkspaceFetchWorkspaceViewPresetPayload, WorkspaceSaveWorkspacePresetPayload } from './types';
|
|
2
|
+
import { WorkspaceAddViewPayload, WorkspaceDeleteViewPayload, WorkspaceState, WorkspaceSetPresetPayload, WorkspaceSetPreventCloseViewPayload, WorkspaceUpdateViewPayload, WorkspaceUpdateViewsPayload, WorkspaceErrorWorkspacePayload, WorkspaceFetchedWorkspacePayload, WorkspaceFetchWorkspacePayload, WorkspaceFetchWorkspaceViewPresetPayload, WorkspaceSaveWorkspacePresetPayload, WorkspaceSetInitialViewMapPresetPayload } from './types';
|
|
3
3
|
export declare const initialState: WorkspaceState;
|
|
4
4
|
export declare const reducer: Reducer<WorkspaceState>;
|
|
5
5
|
export declare const workspaceActions: {
|
|
6
|
+
setInitialViewMapPreset: import("@reduxjs/toolkit").ActionCreatorWithPayload<WorkspaceSetInitialViewMapPresetPayload, "workspace/setInitialViewMapPreset">;
|
|
6
7
|
addWorkspaceView: import("@reduxjs/toolkit").ActionCreatorWithPayload<WorkspaceAddViewPayload, "workspace/addWorkspaceView">;
|
|
7
8
|
deleteWorkspaceView: import("@reduxjs/toolkit").ActionCreatorWithPayload<WorkspaceDeleteViewPayload, "workspace/deleteWorkspaceView">;
|
|
8
9
|
updateWorkspaceViews: import("@reduxjs/toolkit").ActionCreatorWithPayload<WorkspaceUpdateViewsPayload, "workspace/updateWorkspaceViews">;
|
|
9
10
|
updateWorkspaceView: import("@reduxjs/toolkit").ActionCreatorWithPayload<WorkspaceUpdateViewPayload, "workspace/updateWorkspaceView">;
|
|
10
11
|
changePreset: import("@reduxjs/toolkit").ActionCreatorWithPayload<WorkspaceSetPresetPayload, "workspace/changePreset">;
|
|
12
|
+
changeToEmptyMapWorkspace: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"workspace/changeToEmptyMapWorkspace">;
|
|
11
13
|
setPreset: import("@reduxjs/toolkit").ActionCreatorWithPayload<WorkspaceSetPresetPayload, "workspace/setPreset">;
|
|
12
14
|
setPreventCloseView: import("@reduxjs/toolkit").ActionCreatorWithPayload<WorkspaceSetPreventCloseViewPayload, "workspace/setPreventCloseView">;
|
|
13
15
|
fetchWorkspace: import("@reduxjs/toolkit").ActionCreatorWithPayload<WorkspaceFetchWorkspacePayload, "workspace/fetchWorkspace">;
|
|
@@ -2,6 +2,7 @@ import { SagaIterator } from 'redux-saga';
|
|
|
2
2
|
import { mapStoreActions } from '@opengeoweb/store';
|
|
3
3
|
import { workspaceActions } from './reducer';
|
|
4
4
|
export declare function changePresetSaga({ payload, }: ReturnType<typeof workspaceActions.changePreset>): SagaIterator;
|
|
5
|
+
export declare function changeToEmptyMapWorkspaceSaga(): SagaIterator;
|
|
5
6
|
export declare function updateViewsSaga(): SagaIterator;
|
|
6
7
|
export declare function fetchWorkspaceViewPresetSaga({ payload, }: ReturnType<typeof workspaceActions.fetchWorkspaceViewPreset>): SagaIterator;
|
|
7
8
|
export declare function fetchWorkspaceSaga(action: ReturnType<typeof workspaceActions.fetchWorkspace>): SagaIterator;
|
|
@@ -11,6 +11,17 @@ export declare const getWorkspaceState: ((state: AppStore) => WorkspaceState) &
|
|
|
11
11
|
}> & {
|
|
12
12
|
clearCache: () => void;
|
|
13
13
|
};
|
|
14
|
+
/**
|
|
15
|
+
* Gets intialViewMapPreset from workspace state
|
|
16
|
+
*
|
|
17
|
+
* @param {object} store store: object - Store object
|
|
18
|
+
* @returns {MapPreset | undefined} returnType: MapPreset
|
|
19
|
+
*/
|
|
20
|
+
export declare const getInitialViewMapPreset: ((state: AppStore) => import("@opengeoweb/store").MapPreset | undefined) & import("reselect").OutputSelectorFields<(args_0: WorkspaceState) => import("@opengeoweb/store").MapPreset | undefined, {
|
|
21
|
+
clearCache: () => void;
|
|
22
|
+
}> & {
|
|
23
|
+
clearCache: () => void;
|
|
24
|
+
};
|
|
14
25
|
/**
|
|
15
26
|
* Gets mosaicNode from workspace state
|
|
16
27
|
*
|
|
@@ -147,17 +158,17 @@ export declare const getViewPresetToSendToBackend: ((state: any, viewId: any) =>
|
|
|
147
158
|
scope: import("./types").PresetScope;
|
|
148
159
|
title: string;
|
|
149
160
|
initialProps: {
|
|
150
|
-
mapPreset: import("
|
|
161
|
+
mapPreset: import("@opengeoweb/store").MapPreset;
|
|
151
162
|
syncGroupsIds: string[];
|
|
152
163
|
};
|
|
153
164
|
componentType: "Map";
|
|
154
165
|
keywords: string;
|
|
155
|
-
}) & import("reselect").OutputSelectorFields<(args_0: WorkspaceViewType | undefined, args_1: import("
|
|
166
|
+
}) & import("reselect").OutputSelectorFields<(args_0: WorkspaceViewType | undefined, args_1: import("@opengeoweb/store").MapPreset, args_2: string[]) => {
|
|
156
167
|
id: string | undefined;
|
|
157
168
|
scope: import("./types").PresetScope;
|
|
158
169
|
title: string;
|
|
159
170
|
initialProps: {
|
|
160
|
-
mapPreset: import("
|
|
171
|
+
mapPreset: import("@opengeoweb/store").MapPreset;
|
|
161
172
|
syncGroupsIds: string[];
|
|
162
173
|
};
|
|
163
174
|
componentType: "Map";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { syncGroupsTypes } from '@opengeoweb/store';
|
|
2
|
+
import { MapPreset, syncGroupsTypes } from '@opengeoweb/store';
|
|
3
3
|
import { MosaicNode } from 'react-mosaic-component';
|
|
4
4
|
type InitialPropsWorkspaceViewType = Record<string, unknown>;
|
|
5
5
|
export type WorkspaceViewPresetComponentsLookupType = 'ViewError' | 'ViewLoading';
|
|
@@ -42,6 +42,7 @@ export interface WorkspaceState extends WorkspacePreset {
|
|
|
42
42
|
isLoading?: boolean;
|
|
43
43
|
error?: WorkspaceError;
|
|
44
44
|
hasChanges?: boolean;
|
|
45
|
+
intialViewMapPreset?: MapPreset;
|
|
45
46
|
}
|
|
46
47
|
export interface WorkspacePresetFromBE {
|
|
47
48
|
id?: string;
|
|
@@ -69,6 +70,9 @@ export declare enum WorkspacePresetAction {
|
|
|
69
70
|
SAVE_ALL = "SAVE_ALL",
|
|
70
71
|
DUPLICATE = "DUPLICATE"
|
|
71
72
|
}
|
|
73
|
+
export interface WorkspaceSetInitialViewMapPresetPayload {
|
|
74
|
+
preset: MapPreset;
|
|
75
|
+
}
|
|
72
76
|
export interface WorkspaceAddViewPayload {
|
|
73
77
|
id: string;
|
|
74
78
|
componentType: string;
|
|
@@ -100,12 +104,12 @@ export interface WorkspaceComponentLookupPayload {
|
|
|
100
104
|
}
|
|
101
105
|
export type WorkspaceLookupFunctionType = (payload: WorkspaceComponentLookupPayload) => React.ReactElement;
|
|
102
106
|
export type PresetScope = 'user' | 'system';
|
|
103
|
-
export
|
|
107
|
+
export interface ViewPresetListItem {
|
|
104
108
|
id: string;
|
|
105
109
|
title: string;
|
|
106
110
|
date: string;
|
|
107
111
|
scope: PresetScope;
|
|
108
|
-
}
|
|
112
|
+
}
|
|
109
113
|
export interface WorkspaceFetchWorkspacePayload {
|
|
110
114
|
workspaceId: string;
|
|
111
115
|
}
|
|
@@ -14,10 +14,10 @@ export interface WorkspaceListFilter {
|
|
|
14
14
|
isSelected?: boolean;
|
|
15
15
|
isDisabled?: boolean;
|
|
16
16
|
}
|
|
17
|
-
export
|
|
17
|
+
export interface FetchWorkspaceParams {
|
|
18
18
|
scope?: string;
|
|
19
19
|
search?: string;
|
|
20
|
-
}
|
|
20
|
+
}
|
|
21
21
|
export type WorkspaceListEntityState = EntityState<WorkspacePresetListItem>;
|
|
22
22
|
export type WorkspacePresetFormValues = {
|
|
23
23
|
title?: string;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { MapPreset } from '@opengeoweb/store';
|
|
1
2
|
import { WorkspacePreset, WorkspacePresetAction } from '../workspace/types';
|
|
2
3
|
import { FetchWorkspaceParams, WorkspaceListFilter } from './types';
|
|
3
4
|
export declare const getSnackbarMessage: (action: WorkspacePresetAction, title: string) => string;
|
|
4
5
|
export declare const emptyMapWorkspace: WorkspacePreset;
|
|
6
|
+
export declare const createCustomEmptyMapWorkspace: (customMapPreset?: MapPreset) => WorkspacePreset;
|
|
5
7
|
export declare const constructFilterParams: (filters: WorkspaceListFilter[], searchQuery: string) => FetchWorkspaceParams;
|
|
6
8
|
export declare const generateUID: () => string;
|
|
7
9
|
export declare const getGeneratedViewPresetTitle: (workspaceTitle: string, uid: string) => string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ComponentsLookUpPayload as CoreComponentsLookUpPayload } from '@opengeoweb/core';
|
|
3
3
|
import { ComponentsLookUpPayload as TimeseriesComponentsLookUpPayload } from '@opengeoweb/timeseries';
|
|
4
|
+
import { ComponentsLookUpPayload as TimesliderComponentsLookUpPayload } from '@opengeoweb/timeslider';
|
|
4
5
|
import { ComponentsLookUpPayload as TafComponentsLookUpPayload } from '@opengeoweb/taf';
|
|
5
6
|
import { SigmetComponentsLookUpPayload, AirmetComponentsLookUpPayload } from '@opengeoweb/sigmet-airmet';
|
|
6
7
|
import { ComponentsLookUpPayload as WarningListComponentsLookUpPayLoad } from '@opengeoweb/warnings';
|
|
@@ -9,4 +10,4 @@ import { ComponentsLookUpPayload as WarningListComponentsLookUpPayLoad } from '@
|
|
|
9
10
|
* @param payload
|
|
10
11
|
* @returns
|
|
11
12
|
*/
|
|
12
|
-
export declare const componentsLookUp: (payload: CoreComponentsLookUpPayload | TimeseriesComponentsLookUpPayload | TafComponentsLookUpPayload | SigmetComponentsLookUpPayload | AirmetComponentsLookUpPayload | WarningListComponentsLookUpPayLoad) => React.ReactElement;
|
|
13
|
+
export declare const componentsLookUp: (payload: CoreComponentsLookUpPayload | TimeseriesComponentsLookUpPayload | TafComponentsLookUpPayload | SigmetComponentsLookUpPayload | AirmetComponentsLookUpPayload | WarningListComponentsLookUpPayLoad | TimesliderComponentsLookUpPayload) => React.ReactElement;
|
package/src/lib/utils/api.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { ViewPreset } from '../store/viewPresets/types';
|
|
|
5
5
|
import { FetchViewPresetsListParams } from '../store/viewPresetsList/types';
|
|
6
6
|
export declare const API_NAME = "workspacepresets";
|
|
7
7
|
export declare const getIdFromUrl: (url: string) => string;
|
|
8
|
-
export
|
|
8
|
+
export interface PresetsApi {
|
|
9
9
|
getWorkspacePresets: (params?: FetchWorkspaceParams) => Promise<{
|
|
10
10
|
data: WorkspacePresetListItem[];
|
|
11
11
|
}>;
|
|
@@ -24,5 +24,5 @@ export type PresetsApi = {
|
|
|
24
24
|
saveViewPreset: (viewPresetId: string, data: ViewPreset) => Promise<void>;
|
|
25
25
|
saveViewPresetAs: (data: ViewPreset) => Promise<string>;
|
|
26
26
|
deleteViewPreset: (viewPresetId: string) => Promise<void>;
|
|
27
|
-
}
|
|
27
|
+
}
|
|
28
28
|
export declare const createApi: (props: CreateApiProps) => PresetsApi;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
interface WorkspaceRoutes {
|
|
2
2
|
root: string;
|
|
3
3
|
workspace: string;
|
|
4
4
|
workspaceDetail: string;
|
|
5
|
-
}
|
|
5
|
+
}
|
|
6
6
|
export declare const routes: WorkspaceRoutes;
|
|
7
7
|
export declare const getWorkspaceRouteUrl: (workspaceId?: string) => string;
|
|
8
8
|
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|