@opengeoweb/workspace 9.7.0 → 9.9.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 +210 -155
- package/package.json +3 -4
- package/src/index.d.ts +1 -1
- package/src/lib/components/MapPresetsFormDialog/MapPresetsForm.d.ts +2 -2
- package/src/lib/components/ViewPresetMenu/ViewPresetsError.stories.d.ts +1 -0
- 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/utils/api.d.ts +2 -2
- package/src/lib/utils/routes.d.ts +2 -2
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,
|
|
6
|
+
import { debounce, takeEvery, takeLatest, all, put, delay, select, call, takeLeading } from 'redux-saga/effects';
|
|
7
7
|
import { isAxiosError, getAxiosErrorMessage, withEggs, ConfirmationServiceProvider, useConfirmationDialog, CustomIconButton, AlertBanner, CustomTooltip, SearchHighlight, ToggleMenu, getHeight, 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';
|
|
@@ -795,6 +795,21 @@ var getErrorMessage = function getErrorMessage(error) {
|
|
|
795
795
|
return suffix ? "".concat(prefix, ": ").concat(suffix) : prefix;
|
|
796
796
|
};
|
|
797
797
|
|
|
798
|
+
var ViewPresetType;
|
|
799
|
+
(function (ViewPresetType) {
|
|
800
|
+
ViewPresetType["PRESET_DETAIL"] = "PRESET_DETAIL";
|
|
801
|
+
ViewPresetType["PRESET_LIST"] = "PRESET_LIST";
|
|
802
|
+
})(ViewPresetType || (ViewPresetType = {}));
|
|
803
|
+
var PresetAction;
|
|
804
|
+
(function (PresetAction) {
|
|
805
|
+
PresetAction["OPEN"] = "Open";
|
|
806
|
+
PresetAction["DELETE"] = "Delete";
|
|
807
|
+
PresetAction["SAVE"] = "Save";
|
|
808
|
+
PresetAction["SAVE_AS"] = "Save as";
|
|
809
|
+
PresetAction["SHARE"] = "Share";
|
|
810
|
+
PresetAction["EDIT"] = "Edit";
|
|
811
|
+
})(PresetAction || (PresetAction = {}));
|
|
812
|
+
|
|
798
813
|
var viewPresetsListFilterOptions = [{
|
|
799
814
|
label: 'My presets',
|
|
800
815
|
id: 'user',
|
|
@@ -1080,11 +1095,25 @@ var slice$2 = createSlice({
|
|
|
1080
1095
|
}
|
|
1081
1096
|
},
|
|
1082
1097
|
extraReducers: function extraReducers(builder) {
|
|
1098
|
+
builder.addCase(mapActions.setMapPresetError, function (draft, action) {
|
|
1099
|
+
var _action$payload11 = action.payload,
|
|
1100
|
+
mapId = _action$payload11.mapId,
|
|
1101
|
+
error = _action$payload11.error;
|
|
1102
|
+
var entity = draft.entities[mapId];
|
|
1103
|
+
if (entity) {
|
|
1104
|
+
entity.error = {
|
|
1105
|
+
message: error,
|
|
1106
|
+
type: ViewPresetType.PRESET_DETAIL
|
|
1107
|
+
};
|
|
1108
|
+
entity.isFetching = false;
|
|
1109
|
+
viewPresetsAdapter.setOne(draft, entity);
|
|
1110
|
+
}
|
|
1111
|
+
});
|
|
1083
1112
|
syncGroupChangeActions.map(function (syncGroupAction) {
|
|
1084
1113
|
return builder.addCase(syncGroupAction, function (draft, action) {
|
|
1085
|
-
var _action$
|
|
1086
|
-
origin = _action$
|
|
1087
|
-
targetId = _action$
|
|
1114
|
+
var _action$payload12 = action.payload,
|
|
1115
|
+
origin = _action$payload12.origin,
|
|
1116
|
+
targetId = _action$payload12.targetId;
|
|
1088
1117
|
if (origin === 'user') {
|
|
1089
1118
|
var entity = draft.entities[targetId];
|
|
1090
1119
|
if (entity) {
|
|
@@ -1096,9 +1125,9 @@ var slice$2 = createSlice({
|
|
|
1096
1125
|
});
|
|
1097
1126
|
mapPresetChangeActions.map(function (mapPresetAction) {
|
|
1098
1127
|
return builder.addCase(mapPresetAction, function (draft, action) {
|
|
1099
|
-
var _action$
|
|
1100
|
-
mapId = _action$
|
|
1101
|
-
origin = _action$
|
|
1128
|
+
var _action$payload13 = action.payload,
|
|
1129
|
+
mapId = _action$payload13.mapId,
|
|
1130
|
+
origin = _action$payload13.origin;
|
|
1102
1131
|
var isChangeOriginSupported = supportedChangeOrigins.indexOf(origin) >= 0;
|
|
1103
1132
|
if (isChangeOriginSupported && mapId) {
|
|
1104
1133
|
var entity = draft.entities[mapId];
|
|
@@ -1114,21 +1143,6 @@ var slice$2 = createSlice({
|
|
|
1114
1143
|
var reducer$2 = slice$2.reducer;
|
|
1115
1144
|
var viewPresetActions = slice$2.actions;
|
|
1116
1145
|
|
|
1117
|
-
var ViewPresetType;
|
|
1118
|
-
(function (ViewPresetType) {
|
|
1119
|
-
ViewPresetType["PRESET_DETAIL"] = "PRESET_DETAIL";
|
|
1120
|
-
ViewPresetType["PRESET_LIST"] = "PRESET_LIST";
|
|
1121
|
-
})(ViewPresetType || (ViewPresetType = {}));
|
|
1122
|
-
var PresetAction;
|
|
1123
|
-
(function (PresetAction) {
|
|
1124
|
-
PresetAction["OPEN"] = "Open";
|
|
1125
|
-
PresetAction["DELETE"] = "Delete";
|
|
1126
|
-
PresetAction["SAVE"] = "Save";
|
|
1127
|
-
PresetAction["SAVE_AS"] = "Save as";
|
|
1128
|
-
PresetAction["SHARE"] = "Share";
|
|
1129
|
-
PresetAction["EDIT"] = "Edit";
|
|
1130
|
-
})(PresetAction || (PresetAction = {}));
|
|
1131
|
-
|
|
1132
1146
|
/* *
|
|
1133
1147
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1134
1148
|
* you may not use this file except in compliance with the License.
|
|
@@ -1290,6 +1304,13 @@ var emptyMapWorkspace = {
|
|
|
1290
1304
|
mosaicNode: '1_screen',
|
|
1291
1305
|
viewType: 'singleWindow'
|
|
1292
1306
|
};
|
|
1307
|
+
var createCustomEmptyMapWorkspace = function createCustomEmptyMapWorkspace(customMapPreset) {
|
|
1308
|
+
var customEmptyMapWorkspace = cloneDeep(emptyMapWorkspace);
|
|
1309
|
+
if (customMapPreset) {
|
|
1310
|
+
customEmptyMapWorkspace.views.byId['1_screen'].initialProps.mapPreset = customMapPreset;
|
|
1311
|
+
}
|
|
1312
|
+
return customEmptyMapWorkspace;
|
|
1313
|
+
};
|
|
1293
1314
|
var constructFilterParams = function constructFilterParams(filters, searchQuery) {
|
|
1294
1315
|
// get filters
|
|
1295
1316
|
var _filters$reduce = filters.reduce(function (filterList, filter) {
|
|
@@ -1350,13 +1371,17 @@ var initialState$1 = {
|
|
|
1350
1371
|
mosaicNode: undefined,
|
|
1351
1372
|
isLoading: false,
|
|
1352
1373
|
error: undefined,
|
|
1353
|
-
hasChanges: false
|
|
1374
|
+
hasChanges: false,
|
|
1375
|
+
intialViewMapPreset: undefined
|
|
1354
1376
|
};
|
|
1355
1377
|
var workspacePresetChangeActions = [viewPresetActions.selectViewPreset, viewPresetActions.setActiveViewPresetId, syncGroupsActions.syncGroupRemoveGroup, syncGroupsActions.syncGroupAddGroup];
|
|
1356
1378
|
var slice$1 = createSlice({
|
|
1357
1379
|
initialState: initialState$1,
|
|
1358
1380
|
name: 'workspace',
|
|
1359
1381
|
reducers: {
|
|
1382
|
+
setInitialViewMapPreset: function setInitialViewMapPreset(draft, action) {
|
|
1383
|
+
draft.intialViewMapPreset = action.payload.preset;
|
|
1384
|
+
},
|
|
1360
1385
|
addWorkspaceView: function addWorkspaceView(draft, action) {
|
|
1361
1386
|
var newId = action.payload.id;
|
|
1362
1387
|
draft.views.allIds.push(newId);
|
|
@@ -1425,6 +1450,9 @@ var slice$1 = createSlice({
|
|
|
1425
1450
|
draft.scope = workspacePreset.scope;
|
|
1426
1451
|
draft.syncGroups = [];
|
|
1427
1452
|
},
|
|
1453
|
+
changeToEmptyMapWorkspace: function changeToEmptyMapWorkspace(draft) {
|
|
1454
|
+
return draft;
|
|
1455
|
+
},
|
|
1428
1456
|
setPreset: function setPreset(draft, action) {
|
|
1429
1457
|
// do not change anything when the preset is already set
|
|
1430
1458
|
if (draft.id === action.payload.workspacePreset.id) {
|
|
@@ -1677,6 +1705,15 @@ var workspaceStore = function workspaceStore(store) {
|
|
|
1677
1705
|
var getWorkspaceState = createSelector(workspaceStore, function (store) {
|
|
1678
1706
|
return store || initialState$1;
|
|
1679
1707
|
});
|
|
1708
|
+
/**
|
|
1709
|
+
* Gets intialViewMapPreset from workspace state
|
|
1710
|
+
*
|
|
1711
|
+
* @param {object} store store: object - Store object
|
|
1712
|
+
* @returns {MapPreset | undefined} returnType: MapPreset
|
|
1713
|
+
*/
|
|
1714
|
+
var getInitialViewMapPreset = createSelector(getWorkspaceState, function (state) {
|
|
1715
|
+
return state && state.intialViewMapPreset;
|
|
1716
|
+
});
|
|
1680
1717
|
/**
|
|
1681
1718
|
* Gets mosaicNode from workspace state
|
|
1682
1719
|
*
|
|
@@ -1806,6 +1843,7 @@ var getViewPresetToSendToBackend = createSelector(getViewById, mapSelectors.getM
|
|
|
1806
1843
|
var selectors = /*#__PURE__*/Object.freeze({
|
|
1807
1844
|
__proto__: null,
|
|
1808
1845
|
getWorkspaceState: getWorkspaceState,
|
|
1846
|
+
getInitialViewMapPreset: getInitialViewMapPreset,
|
|
1809
1847
|
getMosaicNode: getMosaicNode,
|
|
1810
1848
|
getViewById: getViewById,
|
|
1811
1849
|
getViewIds: getViewIds,
|
|
@@ -2584,7 +2622,7 @@ var viewPresetsListFullContent = [
|
|
|
2584
2622
|
endTime: "NOW+PT2H00M",
|
|
2585
2623
|
shouldEndtimeOverride: true
|
|
2586
2624
|
},
|
|
2587
|
-
shouldAutoUpdate:
|
|
2625
|
+
shouldAutoUpdate: false,
|
|
2588
2626
|
shouldAnimate: true
|
|
2589
2627
|
}
|
|
2590
2628
|
}
|
|
@@ -3968,10 +4006,11 @@ var getWorkspaceRouteUrl = function getWorkspaceRouteUrl(workspaceId) {
|
|
|
3968
4006
|
return workspaceId ? routes.workspaceDetail.replace(':workspaceId', workspaceId) : routes.workspace;
|
|
3969
4007
|
};
|
|
3970
4008
|
|
|
3971
|
-
var _marked$2 = /*#__PURE__*/_regeneratorRuntime().mark(
|
|
3972
|
-
_marked2$2 = /*#__PURE__*/_regeneratorRuntime().mark(
|
|
3973
|
-
_marked3 = /*#__PURE__*/_regeneratorRuntime().mark(
|
|
3974
|
-
_marked4 = /*#__PURE__*/_regeneratorRuntime().mark(
|
|
4009
|
+
var _marked$2 = /*#__PURE__*/_regeneratorRuntime().mark(changeToEmptyMapWorkspaceSaga),
|
|
4010
|
+
_marked2$2 = /*#__PURE__*/_regeneratorRuntime().mark(updateViewsSaga),
|
|
4011
|
+
_marked3 = /*#__PURE__*/_regeneratorRuntime().mark(fetchWorkspaceSaga),
|
|
4012
|
+
_marked4 = /*#__PURE__*/_regeneratorRuntime().mark(saveWorkspacePresetSaga),
|
|
4013
|
+
_marked5 = /*#__PURE__*/_regeneratorRuntime().mark(workspaceSaga);
|
|
3975
4014
|
var setPreset = workspaceActions.setPreset,
|
|
3976
4015
|
updateWorkspaceViews = workspaceActions.updateWorkspaceViews,
|
|
3977
4016
|
changePreset = workspaceActions.changePreset;
|
|
@@ -4003,43 +4042,62 @@ function changePresetSaga(_ref) {
|
|
|
4003
4042
|
}, _callee);
|
|
4004
4043
|
})();
|
|
4005
4044
|
}
|
|
4006
|
-
function
|
|
4007
|
-
|
|
4045
|
+
function changeToEmptyMapWorkspaceSaga() {
|
|
4046
|
+
var intialViewMapPreset;
|
|
4047
|
+
return _regeneratorRuntime().wrap(function changeToEmptyMapWorkspaceSaga$(_context2) {
|
|
4008
4048
|
while (1) switch (_context2.prev = _context2.next) {
|
|
4009
4049
|
case 0:
|
|
4010
4050
|
_context2.next = 2;
|
|
4011
|
-
return
|
|
4051
|
+
return select(getInitialViewMapPreset);
|
|
4012
4052
|
case 2:
|
|
4053
|
+
intialViewMapPreset = _context2.sent;
|
|
4054
|
+
_context2.next = 5;
|
|
4055
|
+
return put(changePreset({
|
|
4056
|
+
workspacePreset: createCustomEmptyMapWorkspace(intialViewMapPreset)
|
|
4057
|
+
}));
|
|
4058
|
+
case 5:
|
|
4013
4059
|
case "end":
|
|
4014
4060
|
return _context2.stop();
|
|
4015
4061
|
}
|
|
4016
4062
|
}, _marked$2);
|
|
4017
4063
|
}
|
|
4064
|
+
function updateViewsSaga() {
|
|
4065
|
+
return _regeneratorRuntime().wrap(function updateViewsSaga$(_context3) {
|
|
4066
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
4067
|
+
case 0:
|
|
4068
|
+
_context3.next = 2;
|
|
4069
|
+
return call(window.dispatchEvent, new Event('resize'));
|
|
4070
|
+
case 2:
|
|
4071
|
+
case "end":
|
|
4072
|
+
return _context3.stop();
|
|
4073
|
+
}
|
|
4074
|
+
}, _marked2$2);
|
|
4075
|
+
}
|
|
4018
4076
|
function fetchWorkspaceViewPresetSaga(_ref2) {
|
|
4019
4077
|
var payload = _ref2.payload;
|
|
4020
4078
|
return /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
4021
4079
|
var viewPresetId, mosaicNodeId, workspaceApi, _yield$call, data, syncGroupIds;
|
|
4022
|
-
return _regeneratorRuntime().wrap(function _callee2$(
|
|
4023
|
-
while (1) switch (
|
|
4080
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context4) {
|
|
4081
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
4024
4082
|
case 0:
|
|
4025
4083
|
viewPresetId = payload.viewPresetId, mosaicNodeId = payload.mosaicNodeId;
|
|
4026
|
-
|
|
4027
|
-
|
|
4084
|
+
_context4.prev = 1;
|
|
4085
|
+
_context4.next = 4;
|
|
4028
4086
|
return put(workspaceActions.updateWorkspaceView({
|
|
4029
4087
|
mosaicNodeId: mosaicNodeId,
|
|
4030
4088
|
viewPreset: getViewPresetState(viewPresetId, mosaicNodeId, 'loading')
|
|
4031
4089
|
}));
|
|
4032
4090
|
case 4:
|
|
4033
|
-
|
|
4091
|
+
_context4.next = 6;
|
|
4034
4092
|
return call(getWorkspaceApi);
|
|
4035
4093
|
case 6:
|
|
4036
|
-
workspaceApi =
|
|
4037
|
-
|
|
4094
|
+
workspaceApi = _context4.sent;
|
|
4095
|
+
_context4.next = 9;
|
|
4038
4096
|
return call(workspaceApi.getViewPreset, viewPresetId);
|
|
4039
4097
|
case 9:
|
|
4040
|
-
_yield$call =
|
|
4098
|
+
_yield$call = _context4.sent;
|
|
4041
4099
|
data = _yield$call.data;
|
|
4042
|
-
|
|
4100
|
+
_context4.next = 13;
|
|
4043
4101
|
return put(viewPresetActions.fetchedViewPreset({
|
|
4044
4102
|
viewPreset: data,
|
|
4045
4103
|
viewPresetId: data.id,
|
|
@@ -4049,10 +4107,10 @@ function fetchWorkspaceViewPresetSaga(_ref2) {
|
|
|
4049
4107
|
// sync all connected syncgroups of viewPreset to the store
|
|
4050
4108
|
syncGroupIds = data.initialProps.syncGroupsIds || [];
|
|
4051
4109
|
if (!(syncGroupIds && syncGroupIds.length)) {
|
|
4052
|
-
|
|
4110
|
+
_context4.next = 17;
|
|
4053
4111
|
break;
|
|
4054
4112
|
}
|
|
4055
|
-
|
|
4113
|
+
_context4.next = 17;
|
|
4056
4114
|
return all(syncGroupIds.map(function (syncGroupId) {
|
|
4057
4115
|
return put(syncGroupsActions.syncGroupAddTarget({
|
|
4058
4116
|
groupId: syncGroupId,
|
|
@@ -4061,63 +4119,63 @@ function fetchWorkspaceViewPresetSaga(_ref2) {
|
|
|
4061
4119
|
}));
|
|
4062
4120
|
}));
|
|
4063
4121
|
case 17:
|
|
4064
|
-
|
|
4122
|
+
_context4.next = 19;
|
|
4065
4123
|
return put(workspaceActions.updateWorkspaceView({
|
|
4066
4124
|
mosaicNodeId: mosaicNodeId,
|
|
4067
4125
|
viewPreset: data
|
|
4068
4126
|
}));
|
|
4069
4127
|
case 19:
|
|
4070
|
-
|
|
4128
|
+
_context4.next = 25;
|
|
4071
4129
|
break;
|
|
4072
4130
|
case 21:
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4131
|
+
_context4.prev = 21;
|
|
4132
|
+
_context4.t0 = _context4["catch"](1);
|
|
4133
|
+
_context4.next = 25;
|
|
4076
4134
|
return put(workspaceActions.updateWorkspaceView({
|
|
4077
4135
|
mosaicNodeId: mosaicNodeId,
|
|
4078
4136
|
viewPreset: getViewPresetState(viewPresetId, mosaicNodeId, 'error')
|
|
4079
4137
|
}));
|
|
4080
4138
|
case 25:
|
|
4081
4139
|
case "end":
|
|
4082
|
-
return
|
|
4140
|
+
return _context4.stop();
|
|
4083
4141
|
}
|
|
4084
4142
|
}, _callee2, null, [[1, 21]]);
|
|
4085
4143
|
})();
|
|
4086
4144
|
}
|
|
4087
4145
|
function fetchWorkspaceSaga(action) {
|
|
4088
4146
|
var payload, workspaceId, workspaceApi, _yield$call2, workspaceData, fullLoadingWorkspace, workspaceIdsInBatches, _iterator, _step, batchCall, errorType;
|
|
4089
|
-
return _regeneratorRuntime().wrap(function fetchWorkspaceSaga$(
|
|
4090
|
-
while (1) switch (
|
|
4147
|
+
return _regeneratorRuntime().wrap(function fetchWorkspaceSaga$(_context5) {
|
|
4148
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
4091
4149
|
case 0:
|
|
4092
4150
|
payload = action.payload;
|
|
4093
4151
|
workspaceId = payload.workspaceId;
|
|
4094
|
-
|
|
4095
|
-
|
|
4152
|
+
_context5.prev = 2;
|
|
4153
|
+
_context5.next = 5;
|
|
4096
4154
|
return put(routerActions.navigateToUrl({
|
|
4097
4155
|
url: getWorkspaceRouteUrl(workspaceId)
|
|
4098
4156
|
}));
|
|
4099
4157
|
case 5:
|
|
4100
|
-
|
|
4158
|
+
_context5.next = 7;
|
|
4101
4159
|
return put(workspaceListActions.toggleWorkspaceDialog({
|
|
4102
4160
|
isWorkspaceListDialogOpen: false
|
|
4103
4161
|
}));
|
|
4104
4162
|
case 7:
|
|
4105
|
-
|
|
4163
|
+
_context5.next = 9;
|
|
4106
4164
|
return call(getWorkspaceApi);
|
|
4107
4165
|
case 9:
|
|
4108
|
-
workspaceApi =
|
|
4109
|
-
|
|
4166
|
+
workspaceApi = _context5.sent;
|
|
4167
|
+
_context5.next = 12;
|
|
4110
4168
|
return call(workspaceApi.getWorkspacePreset, workspaceId);
|
|
4111
4169
|
case 12:
|
|
4112
|
-
_yield$call2 =
|
|
4170
|
+
_yield$call2 = _context5.sent;
|
|
4113
4171
|
workspaceData = _yield$call2.data;
|
|
4114
4172
|
if (workspaceData) {
|
|
4115
|
-
|
|
4173
|
+
_context5.next = 16;
|
|
4116
4174
|
break;
|
|
4117
4175
|
}
|
|
4118
4176
|
throw new Error(ERROR_NOT_FOUND);
|
|
4119
4177
|
case 16:
|
|
4120
|
-
|
|
4178
|
+
_context5.next = 18;
|
|
4121
4179
|
return put(workspaceActions.loadedWorkspace({
|
|
4122
4180
|
workspaceId: workspaceId,
|
|
4123
4181
|
workspace: workspaceData
|
|
@@ -4125,7 +4183,7 @@ function fetchWorkspaceSaga(action) {
|
|
|
4125
4183
|
case 18:
|
|
4126
4184
|
// show all views inside a workspace as loading
|
|
4127
4185
|
fullLoadingWorkspace = getLoadingWorkspace(workspaceData);
|
|
4128
|
-
|
|
4186
|
+
_context5.next = 21;
|
|
4129
4187
|
return put(workspaceActions.changePreset({
|
|
4130
4188
|
workspacePreset: fullLoadingWorkspace
|
|
4131
4189
|
}));
|
|
@@ -4133,15 +4191,15 @@ function fetchWorkspaceSaga(action) {
|
|
|
4133
4191
|
// fetch all individual view presets in batches
|
|
4134
4192
|
workspaceIdsInBatches = getListInChunks(workspaceData.views);
|
|
4135
4193
|
_iterator = _createForOfIteratorHelper(workspaceIdsInBatches);
|
|
4136
|
-
|
|
4194
|
+
_context5.prev = 23;
|
|
4137
4195
|
_iterator.s();
|
|
4138
4196
|
case 25:
|
|
4139
4197
|
if ((_step = _iterator.n()).done) {
|
|
4140
|
-
|
|
4198
|
+
_context5.next = 31;
|
|
4141
4199
|
break;
|
|
4142
4200
|
}
|
|
4143
4201
|
batchCall = _step.value;
|
|
4144
|
-
|
|
4202
|
+
_context5.next = 29;
|
|
4145
4203
|
return all(batchCall.map(function (view) {
|
|
4146
4204
|
return call(fetchWorkspaceViewPresetSaga, workspaceActions.fetchWorkspaceViewPreset({
|
|
4147
4205
|
mosaicNodeId: view.mosaicNodeId,
|
|
@@ -4149,113 +4207,113 @@ function fetchWorkspaceSaga(action) {
|
|
|
4149
4207
|
}));
|
|
4150
4208
|
}));
|
|
4151
4209
|
case 29:
|
|
4152
|
-
|
|
4210
|
+
_context5.next = 25;
|
|
4153
4211
|
break;
|
|
4154
4212
|
case 31:
|
|
4155
|
-
|
|
4213
|
+
_context5.next = 36;
|
|
4156
4214
|
break;
|
|
4157
4215
|
case 33:
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
_iterator.e(
|
|
4216
|
+
_context5.prev = 33;
|
|
4217
|
+
_context5.t0 = _context5["catch"](23);
|
|
4218
|
+
_iterator.e(_context5.t0);
|
|
4161
4219
|
case 36:
|
|
4162
|
-
|
|
4220
|
+
_context5.prev = 36;
|
|
4163
4221
|
_iterator.f();
|
|
4164
|
-
return
|
|
4222
|
+
return _context5.finish(36);
|
|
4165
4223
|
case 39:
|
|
4166
|
-
|
|
4224
|
+
_context5.next = 46;
|
|
4167
4225
|
break;
|
|
4168
4226
|
case 41:
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
errorType =
|
|
4172
|
-
|
|
4227
|
+
_context5.prev = 41;
|
|
4228
|
+
_context5.t1 = _context5["catch"](2);
|
|
4229
|
+
errorType = _context5.t1.message === ERROR_NOT_FOUND ? WorkspaceErrorType.NOT_FOUND : WorkspaceErrorType.GENERIC;
|
|
4230
|
+
_context5.next = 46;
|
|
4173
4231
|
return put(workspaceActions.errorWorkspace({
|
|
4174
4232
|
workspaceId: workspaceId,
|
|
4175
4233
|
error: {
|
|
4176
|
-
message: getErrorMessage(
|
|
4234
|
+
message: getErrorMessage(_context5.t1),
|
|
4177
4235
|
type: errorType
|
|
4178
4236
|
}
|
|
4179
4237
|
}));
|
|
4180
4238
|
case 46:
|
|
4181
4239
|
case "end":
|
|
4182
|
-
return
|
|
4240
|
+
return _context5.stop();
|
|
4183
4241
|
}
|
|
4184
|
-
},
|
|
4242
|
+
}, _marked3, null, [[2, 41], [23, 33, 36, 39]]);
|
|
4185
4243
|
}
|
|
4186
4244
|
function saveWorkspacePresetSaga(action) {
|
|
4187
4245
|
var workspace, workspaceApi;
|
|
4188
|
-
return _regeneratorRuntime().wrap(function saveWorkspacePresetSaga$(
|
|
4189
|
-
while (1) switch (
|
|
4246
|
+
return _regeneratorRuntime().wrap(function saveWorkspacePresetSaga$(_context6) {
|
|
4247
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
4190
4248
|
case 0:
|
|
4191
4249
|
workspace = action.payload.workspace;
|
|
4192
|
-
|
|
4193
|
-
|
|
4250
|
+
_context6.prev = 1;
|
|
4251
|
+
_context6.next = 4;
|
|
4194
4252
|
return call(getWorkspaceApi);
|
|
4195
4253
|
case 4:
|
|
4196
|
-
workspaceApi =
|
|
4197
|
-
|
|
4254
|
+
workspaceApi = _context6.sent;
|
|
4255
|
+
_context6.next = 7;
|
|
4198
4256
|
return call(workspaceApi.saveWorkspacePreset, workspace.id, workspace);
|
|
4199
4257
|
case 7:
|
|
4200
|
-
|
|
4258
|
+
_context6.next = 9;
|
|
4201
4259
|
return put(workspaceActions.loadedWorkspace(undefined));
|
|
4202
4260
|
case 9:
|
|
4203
|
-
|
|
4261
|
+
_context6.next = 11;
|
|
4204
4262
|
return put(workspaceListActions.onSuccessWorkspacePresetAction({
|
|
4205
4263
|
action: WorkspacePresetAction.SAVE,
|
|
4206
4264
|
workspaceId: workspace.id,
|
|
4207
4265
|
title: workspace.title
|
|
4208
4266
|
}));
|
|
4209
4267
|
case 11:
|
|
4210
|
-
|
|
4268
|
+
_context6.next = 17;
|
|
4211
4269
|
break;
|
|
4212
4270
|
case 13:
|
|
4213
|
-
|
|
4214
|
-
|
|
4215
|
-
|
|
4271
|
+
_context6.prev = 13;
|
|
4272
|
+
_context6.t0 = _context6["catch"](1);
|
|
4273
|
+
_context6.next = 17;
|
|
4216
4274
|
return put(workspaceActions.errorWorkspace({
|
|
4217
4275
|
workspaceId: workspace.id,
|
|
4218
4276
|
error: {
|
|
4219
|
-
message:
|
|
4277
|
+
message: _context6.t0.message,
|
|
4220
4278
|
type: WorkspaceErrorType.SAVE
|
|
4221
4279
|
}
|
|
4222
4280
|
}));
|
|
4223
4281
|
case 17:
|
|
4224
4282
|
case "end":
|
|
4225
|
-
return
|
|
4283
|
+
return _context6.stop();
|
|
4226
4284
|
}
|
|
4227
|
-
},
|
|
4285
|
+
}, _marked4, null, [[1, 13]]);
|
|
4228
4286
|
}
|
|
4229
4287
|
function registerMapSaga(_ref3) {
|
|
4230
4288
|
var payload = _ref3.payload;
|
|
4231
4289
|
return /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
4232
4290
|
var _a, mapId, viewType, workspaceState, mapPresetId;
|
|
4233
|
-
return _regeneratorRuntime().wrap(function _callee3$(
|
|
4234
|
-
while (1) switch (
|
|
4291
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context7) {
|
|
4292
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
4235
4293
|
case 0:
|
|
4236
4294
|
mapId = payload.mapId;
|
|
4237
|
-
|
|
4295
|
+
_context7.next = 3;
|
|
4238
4296
|
return select(getViewType);
|
|
4239
4297
|
case 3:
|
|
4240
|
-
viewType =
|
|
4298
|
+
viewType = _context7.sent;
|
|
4241
4299
|
if (!(viewType === 'tiledWindow')) {
|
|
4242
|
-
|
|
4300
|
+
_context7.next = 11;
|
|
4243
4301
|
break;
|
|
4244
4302
|
}
|
|
4245
|
-
|
|
4303
|
+
_context7.next = 7;
|
|
4246
4304
|
return select(getWorkspaceState);
|
|
4247
4305
|
case 7:
|
|
4248
|
-
workspaceState =
|
|
4306
|
+
workspaceState = _context7.sent;
|
|
4249
4307
|
// if it can't find the id, it's a view with multiple maps
|
|
4250
4308
|
mapPresetId = ((_a = workspaceState.views.byId[mapId]) === null || _a === void 0 ? void 0 : _a.id) || workspaceState.views.byId[workspaceState.views.allIds[0]].id;
|
|
4251
|
-
|
|
4309
|
+
_context7.next = 11;
|
|
4252
4310
|
return put(viewPresetActions.registerViewPreset({
|
|
4253
4311
|
panelId: mapId,
|
|
4254
4312
|
viewPresetId: mapPresetId
|
|
4255
4313
|
}));
|
|
4256
4314
|
case 11:
|
|
4257
4315
|
case "end":
|
|
4258
|
-
return
|
|
4316
|
+
return _context7.stop();
|
|
4259
4317
|
}
|
|
4260
4318
|
}, _callee3);
|
|
4261
4319
|
})();
|
|
@@ -4264,58 +4322,61 @@ function unregisterMapSaga(_ref4) {
|
|
|
4264
4322
|
var payload = _ref4.payload;
|
|
4265
4323
|
return /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
4266
4324
|
var mapId, viewType;
|
|
4267
|
-
return _regeneratorRuntime().wrap(function _callee4$(
|
|
4268
|
-
while (1) switch (
|
|
4325
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context8) {
|
|
4326
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
4269
4327
|
case 0:
|
|
4270
4328
|
mapId = payload.mapId;
|
|
4271
|
-
|
|
4329
|
+
_context8.next = 3;
|
|
4272
4330
|
return select(getViewType);
|
|
4273
4331
|
case 3:
|
|
4274
|
-
viewType =
|
|
4332
|
+
viewType = _context8.sent;
|
|
4275
4333
|
if (!(viewType === 'tiledWindow')) {
|
|
4276
|
-
|
|
4334
|
+
_context8.next = 7;
|
|
4277
4335
|
break;
|
|
4278
4336
|
}
|
|
4279
|
-
|
|
4337
|
+
_context8.next = 7;
|
|
4280
4338
|
return put(viewPresetActions.unregisterViewPreset({
|
|
4281
4339
|
panelId: mapId
|
|
4282
4340
|
}));
|
|
4283
4341
|
case 7:
|
|
4284
4342
|
case "end":
|
|
4285
|
-
return
|
|
4343
|
+
return _context8.stop();
|
|
4286
4344
|
}
|
|
4287
4345
|
}, _callee4);
|
|
4288
4346
|
})();
|
|
4289
4347
|
}
|
|
4290
4348
|
function workspaceSaga() {
|
|
4291
|
-
return _regeneratorRuntime().wrap(function workspaceSaga$(
|
|
4292
|
-
while (1) switch (
|
|
4349
|
+
return _regeneratorRuntime().wrap(function workspaceSaga$(_context9) {
|
|
4350
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
4293
4351
|
case 0:
|
|
4294
|
-
|
|
4352
|
+
_context9.next = 2;
|
|
4295
4353
|
return takeLatest(mapStoreActions.registerMap, registerMapSaga);
|
|
4296
4354
|
case 2:
|
|
4297
|
-
|
|
4355
|
+
_context9.next = 4;
|
|
4298
4356
|
return takeLatest(mapStoreActions.unregisterMap, unregisterMapSaga);
|
|
4299
4357
|
case 4:
|
|
4300
|
-
|
|
4358
|
+
_context9.next = 6;
|
|
4301
4359
|
return takeLatest(changePreset.type, changePresetSaga);
|
|
4302
4360
|
case 6:
|
|
4303
|
-
|
|
4361
|
+
_context9.next = 8;
|
|
4304
4362
|
return takeLatest(workspaceActions.fetchWorkspace.type, fetchWorkspaceSaga);
|
|
4305
4363
|
case 8:
|
|
4306
|
-
|
|
4364
|
+
_context9.next = 10;
|
|
4307
4365
|
return takeLatest(workspaceActions.saveWorkspacePreset, saveWorkspacePresetSaga);
|
|
4308
4366
|
case 10:
|
|
4309
|
-
|
|
4310
|
-
return
|
|
4367
|
+
_context9.next = 12;
|
|
4368
|
+
return takeLatest(workspaceActions.changeToEmptyMapWorkspace.type, changeToEmptyMapWorkspaceSaga);
|
|
4311
4369
|
case 12:
|
|
4312
|
-
|
|
4313
|
-
return
|
|
4370
|
+
_context9.next = 14;
|
|
4371
|
+
return takeEvery(workspaceActions.fetchWorkspaceViewPreset.type, fetchWorkspaceViewPresetSaga);
|
|
4314
4372
|
case 14:
|
|
4373
|
+
_context9.next = 16;
|
|
4374
|
+
return debounce(100, updateWorkspaceViews.type, updateViewsSaga);
|
|
4375
|
+
case 16:
|
|
4315
4376
|
case "end":
|
|
4316
|
-
return
|
|
4377
|
+
return _context9.stop();
|
|
4317
4378
|
}
|
|
4318
|
-
},
|
|
4379
|
+
}, _marked5);
|
|
4319
4380
|
}
|
|
4320
4381
|
|
|
4321
4382
|
/* *
|
|
@@ -6424,17 +6485,22 @@ var getPresetTitle = function getPresetTitle(title, hasChanges, isNew) {
|
|
|
6424
6485
|
}
|
|
6425
6486
|
return title;
|
|
6426
6487
|
};
|
|
6427
|
-
var
|
|
6488
|
+
var WorkspaceViewTitleConnectNoMemo = function WorkspaceViewTitleConnectNoMemo(_ref) {
|
|
6428
6489
|
var panelId = _ref.panelId,
|
|
6429
6490
|
isViewPresetDialogOpen = _ref.isViewPresetDialogOpen;
|
|
6430
6491
|
var dispatch = useDispatch();
|
|
6431
6492
|
var theme = useTheme();
|
|
6432
|
-
var
|
|
6433
|
-
return mapSelectors.getMapPreset(store, panelId);
|
|
6434
|
-
});
|
|
6493
|
+
var store = useStore();
|
|
6435
6494
|
var workspaceView = useSelector(function (store) {
|
|
6436
|
-
|
|
6437
|
-
|
|
6495
|
+
var _a;
|
|
6496
|
+
var _ref2 = (_a = getViewById(store, panelId)) !== null && _a !== void 0 ? _a : {},
|
|
6497
|
+
title = _ref2.title,
|
|
6498
|
+
scope = _ref2.scope;
|
|
6499
|
+
return {
|
|
6500
|
+
title: title,
|
|
6501
|
+
scope: scope
|
|
6502
|
+
};
|
|
6503
|
+
}, shallowEqual);
|
|
6438
6504
|
var hasMapPresetChanges = useSelector(function (store) {
|
|
6439
6505
|
return getViewPresetHasChanges(store, panelId);
|
|
6440
6506
|
});
|
|
@@ -6456,7 +6522,7 @@ var WorkspaceViewTitleConnect = function WorkspaceViewTitleConnect(_ref) {
|
|
|
6456
6522
|
viewPreset: Object.assign(Object.assign({}, emptyMapViewPreset), {
|
|
6457
6523
|
title: title,
|
|
6458
6524
|
initialProps: {
|
|
6459
|
-
mapPreset:
|
|
6525
|
+
mapPreset: mapSelectors.getMapPreset(store.getState(), panelId),
|
|
6460
6526
|
syncGroupsIds: relatedSyncGroupIds
|
|
6461
6527
|
}
|
|
6462
6528
|
})
|
|
@@ -6483,7 +6549,7 @@ var WorkspaceViewTitleConnect = function WorkspaceViewTitleConnect(_ref) {
|
|
|
6483
6549
|
formValues: {
|
|
6484
6550
|
title: formTitle,
|
|
6485
6551
|
initialProps: {
|
|
6486
|
-
mapPreset:
|
|
6552
|
+
mapPreset: mapSelectors.getMapPreset(store.getState(), panelId),
|
|
6487
6553
|
syncGroupsIds: relatedSyncGroupIds
|
|
6488
6554
|
}
|
|
6489
6555
|
}
|
|
@@ -6499,33 +6565,25 @@ var WorkspaceViewTitleConnect = function WorkspaceViewTitleConnect(_ref) {
|
|
|
6499
6565
|
formValues: {
|
|
6500
6566
|
title: formTitle,
|
|
6501
6567
|
initialProps: {
|
|
6502
|
-
mapPreset:
|
|
6568
|
+
mapPreset: mapSelectors.getMapPreset(store.getState(), panelId),
|
|
6503
6569
|
syncGroupsIds: relatedSyncGroupIds
|
|
6504
6570
|
}
|
|
6505
6571
|
}
|
|
6506
6572
|
});
|
|
6507
6573
|
};
|
|
6508
|
-
var toggleViewPresetDialog = React.useCallback(function (
|
|
6509
|
-
var panelId =
|
|
6510
|
-
isViewPresetDialogOpen =
|
|
6574
|
+
var toggleViewPresetDialog = React.useCallback(function (_ref3) {
|
|
6575
|
+
var panelId = _ref3.panelId,
|
|
6576
|
+
isViewPresetDialogOpen = _ref3.isViewPresetDialogOpen;
|
|
6511
6577
|
dispatch(viewPresetActions.toggleViewPresetListDialog({
|
|
6512
6578
|
panelId: panelId,
|
|
6513
6579
|
isViewPresetListDialogOpen: isViewPresetDialogOpen
|
|
6514
6580
|
}));
|
|
6515
6581
|
}, [dispatch]);
|
|
6516
6582
|
var isNewActive = activeMapPresetId === '';
|
|
6517
|
-
var title =
|
|
6518
|
-
var viewScope = workspaceView
|
|
6583
|
+
var title = workspaceView.title || MAPPRESET_ACTIVE_TITLE;
|
|
6584
|
+
var viewScope = workspaceView.scope;
|
|
6519
6585
|
var fullTitle = getPresetTitle(title, hasMapPresetChanges, isNewActive);
|
|
6520
|
-
|
|
6521
|
-
// This component renders on every change in the mapstate.
|
|
6522
|
-
// This is because selectors like mapSelectors.getMapPreset are used in the component.
|
|
6523
|
-
// The data from this selector is not used during a render, so it is wasting renders.
|
|
6524
|
-
// The data is need only in the callback functions - not the component itself
|
|
6525
|
-
// To prevent unneeded renders, this code should be rewritten by using refs, or move the logic to sagas.
|
|
6526
|
-
// You can use the renderCounter to check the nubmer of renders.
|
|
6527
|
-
// Also check https://xam-react-coe.medium.com/react-useselector-without-re-render-225686bee3f
|
|
6528
|
-
renderCounter.count(WorkspaceViewTitleConnect.name);
|
|
6586
|
+
renderCounter.count(WorkspaceViewTitleConnectNoMemo.name);
|
|
6529
6587
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CustomIconButton, {
|
|
6530
6588
|
"data-testid": "open-viewpresets",
|
|
6531
6589
|
sx: {
|
|
@@ -6561,6 +6619,7 @@ var WorkspaceViewTitleConnect = function WorkspaceViewTitleConnect(_ref) {
|
|
|
6561
6619
|
id: "viewpreset-options-toolbutton"
|
|
6562
6620
|
}));
|
|
6563
6621
|
};
|
|
6622
|
+
var WorkspaceViewTitleConnect = /*#__PURE__*/React.memo(WorkspaceViewTitleConnectNoMemo);
|
|
6564
6623
|
|
|
6565
6624
|
/* *
|
|
6566
6625
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -7010,9 +7069,7 @@ var WorkspaceSelectListConnect = function WorkspaceSelectListConnect() {
|
|
|
7010
7069
|
dispatch(workspaceListActions.toggleWorkspaceDialog({
|
|
7011
7070
|
isWorkspaceListDialogOpen: false
|
|
7012
7071
|
}));
|
|
7013
|
-
dispatch(workspaceActions.
|
|
7014
|
-
workspacePreset: emptyMapWorkspace
|
|
7015
|
-
}));
|
|
7072
|
+
dispatch(workspaceActions.changeToEmptyMapWorkspace());
|
|
7016
7073
|
}, [dispatch]);
|
|
7017
7074
|
var onClickWorkspace = function onClickWorkspace(id) {
|
|
7018
7075
|
if (id === emptyMapWorkspace.id) {
|
|
@@ -8027,10 +8084,8 @@ var WorkspaceDetail = function WorkspaceDetail(_ref) {
|
|
|
8027
8084
|
workspace: workspaceData
|
|
8028
8085
|
}));
|
|
8029
8086
|
}, [dispatch, workspaceData]);
|
|
8030
|
-
var
|
|
8031
|
-
dispatch(workspaceActions.
|
|
8032
|
-
workspacePreset: newScreenPreset
|
|
8033
|
-
}));
|
|
8087
|
+
var changeToEmptyMapWorkspace = React.useCallback(function () {
|
|
8088
|
+
dispatch(workspaceActions.changeToEmptyMapWorkspace());
|
|
8034
8089
|
}, [dispatch]);
|
|
8035
8090
|
var navigateToUrl = React.useCallback(function (url) {
|
|
8036
8091
|
dispatch(routerActions.navigateToUrl({
|
|
@@ -8038,7 +8093,7 @@ var WorkspaceDetail = function WorkspaceDetail(_ref) {
|
|
|
8038
8093
|
}));
|
|
8039
8094
|
}, [dispatch]);
|
|
8040
8095
|
var setEmptyWorkSpace = function setEmptyWorkSpace() {
|
|
8041
|
-
|
|
8096
|
+
changeToEmptyMapWorkspace();
|
|
8042
8097
|
navigateToUrl(routes.root);
|
|
8043
8098
|
};
|
|
8044
8099
|
React.useEffect(function () {
|
|
@@ -8104,4 +8159,4 @@ var WorkspaceDetail = function WorkspaceDetail(_ref) {
|
|
|
8104
8159
|
}))))), /*#__PURE__*/React.createElement(MapPresetsFormDialogConnect, null));
|
|
8105
8160
|
};
|
|
8106
8161
|
|
|
8107
|
-
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 };
|
|
8162
|
+
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.9.0",
|
|
4
4
|
"description": "GeoWeb Workspace library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -14,7 +14,7 @@
|
|
|
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,11 +26,10 @@
|
|
|
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": "*",
|
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;
|
|
@@ -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;
|
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 {};
|