@opengeoweb/workspace 19.2.0 → 19.4.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/dist/index.esm.js +232 -111
- package/dist/src/lib/components/WorkspaceSelectList/WorkspaceSelectList.d.ts +1 -1
- package/dist/src/lib/store/workspace/selectors.d.ts +4 -0
- package/dist/src/lib/store/workspaceList/types.d.ts +1 -0
- package/dist/src/lib/store/workspaceList/utils.d.ts +5 -1
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -30,6 +30,7 @@ import { http, HttpResponse, delay } from 'msw';
|
|
|
30
30
|
var en = {
|
|
31
31
|
"workspace-menu": "Workspace menu",
|
|
32
32
|
"workspace-new": "New workspace",
|
|
33
|
+
"workspace-new-soundings": "New soundings workspace",
|
|
33
34
|
"workspace-loading": "Loading",
|
|
34
35
|
"workspace-options": "Options",
|
|
35
36
|
"workspace-results": "results",
|
|
@@ -179,6 +180,7 @@ var en = {
|
|
|
179
180
|
var fi = {
|
|
180
181
|
"workspace-menu": "Workspace menu",
|
|
181
182
|
"workspace-new": "Uusi workspace",
|
|
183
|
+
"workspace-new-soundings": "Uusi luotaustyötila",
|
|
182
184
|
"workspace-loading": "Ladataan",
|
|
183
185
|
"workspace-options": "Valinnat",
|
|
184
186
|
"workspace-results": "tulokset",
|
|
@@ -320,6 +322,7 @@ var fi = {
|
|
|
320
322
|
var no = {
|
|
321
323
|
"workspace-menu": "Arbeidsflater",
|
|
322
324
|
"workspace-new": "Ny arbeidsflate",
|
|
325
|
+
"workspace-new-soundings": "New soundings workspace",
|
|
323
326
|
"workspace-loading": "Laster",
|
|
324
327
|
"workspace-options": "Valg",
|
|
325
328
|
"workspace-results": "resultater",
|
|
@@ -462,6 +465,7 @@ var no = {
|
|
|
462
465
|
var nl = {
|
|
463
466
|
"workspace-menu": "Workspace menu",
|
|
464
467
|
"workspace-new": "Nieuwe workspace",
|
|
468
|
+
"workspace-new-soundings": "Nieuwe soundings workspace",
|
|
465
469
|
"workspace-loading": "Laden",
|
|
466
470
|
"workspace-options": "Opties",
|
|
467
471
|
"workspace-results": "resultaten",
|
|
@@ -1543,7 +1547,7 @@ var SUPPORTED_TIMESERIES_COMPONENT_TYPES = ['TimeSeries'];
|
|
|
1543
1547
|
// 3) Warning list components
|
|
1544
1548
|
var WARNING_LIST_COMPONENT_TYPES = ['WarningList', 'MaritimeWarnings', 'WarningsTimeline'];
|
|
1545
1549
|
// TODO: expand it and move to a more centralized place
|
|
1546
|
-
var ALL_COMPONENT_TYPES = [].concat(SUPPORTED_COMPONENT_TYPES, SUPPORTED_TIMESERIES_COMPONENT_TYPES, WARNING_LIST_COMPONENT_TYPES, AVIATION_COMPONENT_TYPES, CAP_COMPONENT_TYPES, ['TafModule', 'TrajksModule', 'SpaceweatherModule', 'Plugin']);
|
|
1550
|
+
var ALL_COMPONENT_TYPES = [].concat(SUPPORTED_COMPONENT_TYPES, SUPPORTED_TIMESERIES_COMPONENT_TYPES, WARNING_LIST_COMPONENT_TYPES, AVIATION_COMPONENT_TYPES, CAP_COMPONENT_TYPES, ['TafModule', 'TrajksModule', 'SpaceweatherModule', 'Plugin', 'Soundings']);
|
|
1547
1551
|
var ViewPresetErrorComponent;
|
|
1548
1552
|
(function (ViewPresetErrorComponent) {
|
|
1549
1553
|
ViewPresetErrorComponent["PRESET_DETAIL"] = "PRESET_DETAIL";
|
|
@@ -1815,7 +1819,7 @@ var syncGroupChangeActions = [syncGroupsActions.syncGroupRemoveTarget, syncGroup
|
|
|
1815
1819
|
var mapPresetChangeActions = [layerActions.setBaseLayers, layerActions.layerDelete, layerActions.addLayer, layerActions.duplicateMapLayer, layerActions.layerChangeEnabled, layerActions.layerChangeName, layerActions.layerChangeStyle, layerActions.layerChangeOpacity, layerActions.layerChangeDimension, layerActions.layerChangeAcceptanceTime, layerActions.SetLayerLegendVisibilityPayload, mapActions.layerMoveLayer, mapActions.setAutoLayerId, mapActions.setAutoTimestepLayerId, mapActions.setAutoUpdateLayerId, mapActions.toggleAutoUpdate, mapActions.mapStartAnimation, mapActions.mapStopAnimation, mapActions.toggleTimeSliderIsVisible, mapActions.setTimeStep, mapActions.setTimeSliderSpan, mapActions.toggleTimeSpanAuto, mapActions.setAnimationDelay, mapActions.toggleTimestepAuto, mapActions.setAnimationStartTime, mapActions.setAnimationEndTime, mapActions.changeOverlayer, uiActions.setActiveMapIdForDialog, uiActions.setToggleOpenDialog, genericActions.setBbox, mapActions.setBbox, mapActions.toggleClock, mapActions.toggleClockOptions, mapActions.setClockPositionSize, mapActions.setDockedLayerManagerSize, mapActions.setDockedLayerManagerPosition, mapActions.setDockedLayerManagerDimensions];
|
|
1816
1820
|
var pluginPresetChangeActions = [pluginsActions.setGeoWebPluginState];
|
|
1817
1821
|
var timeSeriesPresetChangeActions = [timeSeriesActions.addParameter, timeSeriesActions.addPlot, timeSeriesActions.deleteParameter, timeSeriesActions.deletePlot, timeSeriesActions.moveParameter, timeSeriesActions.movePlot, timeSeriesActions.toggleParameter, timeSeriesActions.togglePlot, timeSeriesActions.patchParameter, timeSeriesActions.updateTitle];
|
|
1818
|
-
var soundingsChangeActions = [soundingsActions.updateSelectedSource, soundingsActions.updateSelectedLocation, soundingsActions.updateDiagramType, soundingsActions.toggleLocationMarkers, soundingsActions.updateProfileDataPreferences, soundingsActions.changeSoundingPanelOrder, soundingsActions.toggleSoundingPanelVisibility, soundingsActions.setPanelIsOpen, soundingsActions.setPanelCustomWidth];
|
|
1822
|
+
var soundingsChangeActions = [soundingsActions.updateSelectedSource, soundingsActions.updateSelectedLocation, soundingsActions.updateDiagramType, soundingsActions.toggleLocationMarkers, soundingsActions.updateProfileDataPreferences, soundingsActions.changeSoundingPanelOrder, soundingsActions.toggleSoundingPanelVisibility, soundingsActions.setPanelIsOpen, soundingsActions.setPanelCustomWidth, soundingsActions.toggleLegendVisibility, soundingsActions.updateSelectedTime, soundingsActions.toggleTimeSliderVisibility];
|
|
1819
1823
|
var supportedMapActionOrigins = [layerTypes.LayerActionOrigin.layerManager, layerTypes.LayerActionOrigin.legend, layerTypes.LayerActionOrigin.wmsLoader, mapEnums.MapActionOrigin.map];
|
|
1820
1824
|
var supportedTimeSeriesActionOrigins = [TimeSeriesTypes.TimeSeriesActionOrigin.timeSeriesManager, TimeSeriesTypes.TimeSeriesActionOrigin.timeSeriesSelect];
|
|
1821
1825
|
var supportedSoundingsActionOrigins = [SoundingsTypes.SoundingsActionOrigin.soundingsComponent, SoundingsTypes.SoundingsActionOrigin.soundingsManager];
|
|
@@ -2386,6 +2390,71 @@ var createCustomEmptyMapWorkspace = function createCustomEmptyMapWorkspace(empty
|
|
|
2386
2390
|
});
|
|
2387
2391
|
return emptyWorkspacePreset;
|
|
2388
2392
|
};
|
|
2393
|
+
var LOCAL_SOUNDINGS_ID = 'newSoundingsWorkspace';
|
|
2394
|
+
var getNewSoundingsWorkspaceListItem = function getNewSoundingsWorkspaceListItem(t) {
|
|
2395
|
+
return {
|
|
2396
|
+
id: LOCAL_SOUNDINGS_ID,
|
|
2397
|
+
title: t ? t('workspace-new-soundings') : 'New soundings workspace',
|
|
2398
|
+
labels: undefined,
|
|
2399
|
+
scope: 'system',
|
|
2400
|
+
"abstract": '',
|
|
2401
|
+
viewType: 'multiWindow'
|
|
2402
|
+
};
|
|
2403
|
+
};
|
|
2404
|
+
function getNewSoundingsWorkspace(t) {
|
|
2405
|
+
return Object.assign({}, getNewSoundingsWorkspaceListItem(t), {
|
|
2406
|
+
views: {
|
|
2407
|
+
allIds: ['1_screen', '2_screen'],
|
|
2408
|
+
byId: {
|
|
2409
|
+
'1_screen': {
|
|
2410
|
+
mosaicNodeId: '1_screen',
|
|
2411
|
+
title: 'New soundings map',
|
|
2412
|
+
componentType: 'Map',
|
|
2413
|
+
initialProps: {
|
|
2414
|
+
mapPreset: {
|
|
2415
|
+
shouldShowLegend: false,
|
|
2416
|
+
shouldShowLayerManager: false
|
|
2417
|
+
}
|
|
2418
|
+
}
|
|
2419
|
+
},
|
|
2420
|
+
'2_screen': {
|
|
2421
|
+
mosaicNodeId: '2_screen',
|
|
2422
|
+
title: 'New soundings view',
|
|
2423
|
+
componentType: 'Soundings',
|
|
2424
|
+
initialProps: {}
|
|
2425
|
+
}
|
|
2426
|
+
}
|
|
2427
|
+
},
|
|
2428
|
+
linking: {
|
|
2429
|
+
'2_screen': ['1_screen']
|
|
2430
|
+
},
|
|
2431
|
+
syncGroups: [{
|
|
2432
|
+
id: 'Features_2_screen',
|
|
2433
|
+
sourcePanelId: '2_screen',
|
|
2434
|
+
type: 'SYNCGROUPS_TYPE_SETFEATURES'
|
|
2435
|
+
}],
|
|
2436
|
+
mosaicNode: {
|
|
2437
|
+
direction: 'row',
|
|
2438
|
+
first: '1_screen',
|
|
2439
|
+
second: '2_screen'
|
|
2440
|
+
}
|
|
2441
|
+
});
|
|
2442
|
+
}
|
|
2443
|
+
var getBEViewsFromState = function getBEViewsFromState(workspace) {
|
|
2444
|
+
var _workspace$views$allI, _workspace$views;
|
|
2445
|
+
var result = [];
|
|
2446
|
+
((_workspace$views$allI = workspace == null || (_workspace$views = workspace.views) == null ? void 0 : _workspace$views.allIds) != null ? _workspace$views$allI : []).forEach(function (id) {
|
|
2447
|
+
var _workspace$views$byId;
|
|
2448
|
+
var view = (_workspace$views$byId = workspace.views.byId[id]) != null ? _workspace$views$byId : {};
|
|
2449
|
+
result.push({
|
|
2450
|
+
mosaicNodeId: id,
|
|
2451
|
+
title: typeof view.title === 'string' && view.title.trim() ? view.title : id,
|
|
2452
|
+
componentType: view.componentType,
|
|
2453
|
+
initialProps: view.initialProps
|
|
2454
|
+
});
|
|
2455
|
+
});
|
|
2456
|
+
return result;
|
|
2457
|
+
};
|
|
2389
2458
|
|
|
2390
2459
|
var initialState = {
|
|
2391
2460
|
id: '',
|
|
@@ -3046,6 +3115,22 @@ var getViewPresetToSendToBackend = createSelector(getViewById, getViewComponentT
|
|
|
3046
3115
|
initialProps: (_initialPropsByCompon = initialPropsByComponentType[viewComponentType]) != null ? _initialPropsByCompon : defaultInitialProps
|
|
3047
3116
|
});
|
|
3048
3117
|
}, selectorMemoizationOptions);
|
|
3118
|
+
/**
|
|
3119
|
+
* Gets workspace data with each view's current state included in initialProps.
|
|
3120
|
+
*/
|
|
3121
|
+
var getWorkspaceToSendToBackend = function getWorkspaceToSendToBackend(store) {
|
|
3122
|
+
var workspaceData = getWorkspaceData(store);
|
|
3123
|
+
return Object.assign({}, workspaceData, {
|
|
3124
|
+
views: workspaceData.views.map(function (view) {
|
|
3125
|
+
var _presetLike$component, _presetLike$initialPr;
|
|
3126
|
+
var presetLike = getViewPresetToSendToBackend(store, view.mosaicNodeId);
|
|
3127
|
+
return Object.assign({}, view, {
|
|
3128
|
+
componentType: (_presetLike$component = presetLike.componentType) != null ? _presetLike$component : view.componentType,
|
|
3129
|
+
initialProps: (_presetLike$initialPr = presetLike.initialProps) != null ? _presetLike$initialPr : {}
|
|
3130
|
+
});
|
|
3131
|
+
})
|
|
3132
|
+
});
|
|
3133
|
+
};
|
|
3049
3134
|
|
|
3050
3135
|
var selectors$1 = /*#__PURE__*/Object.freeze({
|
|
3051
3136
|
__proto__: null,
|
|
@@ -3064,6 +3149,7 @@ var selectors$1 = /*#__PURE__*/Object.freeze({
|
|
|
3064
3149
|
getWorkspaceError: getWorkspaceError,
|
|
3065
3150
|
getWorkspaceId: getWorkspaceId,
|
|
3066
3151
|
getWorkspaceState: getWorkspaceState,
|
|
3152
|
+
getWorkspaceToSendToBackend: getWorkspaceToSendToBackend,
|
|
3067
3153
|
hasWorkspaceChanges: hasWorkspaceChanges,
|
|
3068
3154
|
isWorkspaceLoading: isWorkspaceLoading
|
|
3069
3155
|
});
|
|
@@ -3697,7 +3783,7 @@ workspaceListListener.startListening({
|
|
|
3697
3783
|
effect: function () {
|
|
3698
3784
|
var _effect2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(_ref2, listenerApi) {
|
|
3699
3785
|
var _listenerApi$getState2;
|
|
3700
|
-
var payload, workspaceState, credentials, presetId, presetAction, data, emptyMapPresetTitle, emptyWorkspacePresetTitle, scope, originalData, workspaceDataNewTitle, _originalData$views, _data$views2, _originalData, mergedViews, payloadToSave, isSaveWorkspaceAction, isSaveAsWorkspaceAction, hasWorkspaceAlreadyBeenSaved, workspaceId, workspaceData,
|
|
3786
|
+
var payload, workspaceState, credentials, presetId, presetAction, data, emptyMapPresetTitle, emptyWorkspacePresetTitle, emptySoundingsPresetTitle, scope, originalData, workspaceDataNewTitle, _originalData$views, _data$views2, _originalData, mergedViews, payloadToSave, isSaveWorkspaceAction, isSaveAsWorkspaceAction, hasWorkspaceAlreadyBeenSaved, workspaceId, workspaceData, newWorkspace, _listenerApi$getState3, _credentials, hasChanges, message, _listenerApi$getState4, category, _t;
|
|
3701
3787
|
return _regenerator().w(function (_context2) {
|
|
3702
3788
|
while (1) switch (_context2.p = _context2.n) {
|
|
3703
3789
|
case 0:
|
|
@@ -3705,7 +3791,7 @@ workspaceListListener.startListening({
|
|
|
3705
3791
|
listenerApi.cancelActiveListeners();
|
|
3706
3792
|
workspaceState = listenerApi.getState();
|
|
3707
3793
|
credentials = (_listenerApi$getState2 = listenerApi.getState().common) == null || (_listenerApi$getState2 = _listenerApi$getState2.auth) == null ? void 0 : _listenerApi$getState2.credentials;
|
|
3708
|
-
presetId = payload.presetId, presetAction = payload.presetAction, data = payload.data, emptyMapPresetTitle = payload.emptyMapPresetTitle, emptyWorkspacePresetTitle = payload.emptyWorkspacePresetTitle;
|
|
3794
|
+
presetId = payload.presetId, presetAction = payload.presetAction, data = payload.data, emptyMapPresetTitle = payload.emptyMapPresetTitle, emptyWorkspacePresetTitle = payload.emptyWorkspacePresetTitle, emptySoundingsPresetTitle = payload.emptySoundingsPresetTitle;
|
|
3709
3795
|
scope = data.scope || 'user';
|
|
3710
3796
|
_context2.p = 1;
|
|
3711
3797
|
// duplicate
|
|
@@ -3799,15 +3885,7 @@ workspaceListListener.startListening({
|
|
|
3799
3885
|
}
|
|
3800
3886
|
hasWorkspaceAlreadyBeenSaved = getWorkspaceDialogIsSaved(workspaceState);
|
|
3801
3887
|
workspaceId = presetId;
|
|
3802
|
-
workspaceData =
|
|
3803
|
-
viewsWithInitialProps = workspaceData.views.map(function (view) {
|
|
3804
|
-
var _presetLike$component, _presetLike$initialPr;
|
|
3805
|
-
var presetLike = getViewPresetToSendToBackend(listenerApi.getState(), view.mosaicNodeId);
|
|
3806
|
-
return Object.assign({}, view, {
|
|
3807
|
-
componentType: (_presetLike$component = presetLike.componentType) != null ? _presetLike$component : view.componentType,
|
|
3808
|
-
initialProps: (_presetLike$initialPr = presetLike.initialProps) != null ? _presetLike$initialPr : {}
|
|
3809
|
-
});
|
|
3810
|
-
});
|
|
3888
|
+
workspaceData = getWorkspaceToSendToBackend(listenerApi.getState());
|
|
3811
3889
|
newWorkspace = Object.assign({}, workspaceData, {
|
|
3812
3890
|
id: workspaceId,
|
|
3813
3891
|
title: data.title,
|
|
@@ -3815,7 +3893,7 @@ workspaceListListener.startListening({
|
|
|
3815
3893
|
description: data.description,
|
|
3816
3894
|
labels: data.labels,
|
|
3817
3895
|
scope: scope,
|
|
3818
|
-
views:
|
|
3896
|
+
views: workspaceData.views,
|
|
3819
3897
|
username: (credentials == null ? void 0 : credentials.username) || ''
|
|
3820
3898
|
});
|
|
3821
3899
|
if (!(!hasWorkspaceAlreadyBeenSaved && isSaveAsWorkspaceAction)) {
|
|
@@ -3871,6 +3949,12 @@ workspaceListListener.startListening({
|
|
|
3871
3949
|
newMapPresetText: emptyMapPresetTitle,
|
|
3872
3950
|
newWorkspaceText: emptyWorkspacePresetTitle
|
|
3873
3951
|
}));
|
|
3952
|
+
} else if (presetId === LOCAL_SOUNDINGS_ID) {
|
|
3953
|
+
listenerApi.dispatch(workspaceActions.changePreset({
|
|
3954
|
+
workspacePreset: Object.assign({}, getNewSoundingsWorkspace(), {
|
|
3955
|
+
title: emptySoundingsPresetTitle || getNewSoundingsWorkspace().title
|
|
3956
|
+
})
|
|
3957
|
+
}));
|
|
3874
3958
|
} else {
|
|
3875
3959
|
listenerApi.dispatch(workspaceActions.fetchWorkspace({
|
|
3876
3960
|
workspaceId: presetId
|
|
@@ -4010,10 +4094,7 @@ workspaceListener.startListening({
|
|
|
4010
4094
|
allSyncGroups.map(function (syncGroup) {
|
|
4011
4095
|
return listenerApi.dispatch(syncGroupsActions.syncGroupAddGroup(syncGroup));
|
|
4012
4096
|
});
|
|
4013
|
-
|
|
4014
|
-
newLinks: (_payload$workspacePre = payload.workspacePreset.linking) != null ? _payload$workspacePre : {}
|
|
4015
|
-
}));
|
|
4016
|
-
isTimeScrollingEnabled = (_payload$workspacePre2 = payload.workspacePreset.isTimeScrollingEnabled) != null ? _payload$workspacePre2 : false;
|
|
4097
|
+
isTimeScrollingEnabled = (_payload$workspacePre = payload.workspacePreset.isTimeScrollingEnabled) != null ? _payload$workspacePre : false;
|
|
4017
4098
|
listenerApi.dispatch(syncGroupsActions.syncGroupToggleIsTimeScrollingEnabled({
|
|
4018
4099
|
isTimeScrollingEnabled: isTimeScrollingEnabled
|
|
4019
4100
|
}));
|
|
@@ -4061,6 +4142,9 @@ workspaceListener.startListening({
|
|
|
4061
4142
|
isInline: hasInlineConfig
|
|
4062
4143
|
}));
|
|
4063
4144
|
});
|
|
4145
|
+
listenerApi.dispatch(genericActions.setLinkedMap({
|
|
4146
|
+
newLinks: (_payload$workspacePre2 = payload.workspacePreset.linking) != null ? _payload$workspacePre2 : {}
|
|
4147
|
+
}));
|
|
4064
4148
|
if (payload.markAsChanged) {
|
|
4065
4149
|
listenerApi.dispatch(workspaceActions.markWorkspaceChanged());
|
|
4066
4150
|
listenerApi.dispatch(routerActions.navigateToUrl({
|
|
@@ -7174,6 +7258,7 @@ var WorkspaceSelectListRow = function WorkspaceSelectListRow(_ref) {
|
|
|
7174
7258
|
});
|
|
7175
7259
|
}
|
|
7176
7260
|
var versions = workspacePreset.scope === 'plugin' ? (_workspacePreset$orig = (_workspacePreset$orig2 = workspacePreset.origin) == null ? void 0 : _workspacePreset$orig2.versions) != null ? _workspacePreset$orig : [] : [];
|
|
7261
|
+
var showInfoIcon = !!workspacePreset.id && workspacePreset.id !== LOCAL_SOUNDINGS_ID;
|
|
7177
7262
|
return jsx(ListItem, {
|
|
7178
7263
|
disablePadding: true,
|
|
7179
7264
|
sx: {
|
|
@@ -7273,7 +7358,7 @@ var WorkspaceSelectListRow = function WorkspaceSelectListRow(_ref) {
|
|
|
7273
7358
|
justifyContent: 'flex-end',
|
|
7274
7359
|
gap: 0.5
|
|
7275
7360
|
},
|
|
7276
|
-
children: [!!
|
|
7361
|
+
children: [!!showInfoIcon && jsx(CustomIconButton, {
|
|
7277
7362
|
"data-testid": testIdPrefix + "-listInfoButton",
|
|
7278
7363
|
isSelected: isInfoOpen,
|
|
7279
7364
|
onClick: onOpenInfoClick,
|
|
@@ -7366,7 +7451,7 @@ var WorkspaceSelectList = function WorkspaceSelectList(_ref2) {
|
|
|
7366
7451
|
isEditable = _ref2.isEditable,
|
|
7367
7452
|
isAdmin = _ref2.isAdmin,
|
|
7368
7453
|
searchQuery = _ref2.searchQuery,
|
|
7369
|
-
|
|
7454
|
+
newPresets = _ref2.newPresets,
|
|
7370
7455
|
_ref2$testIdPrefix = _ref2.testIdPrefix,
|
|
7371
7456
|
testIdPrefix = _ref2$testIdPrefix === void 0 ? 'workspace' : _ref2$testIdPrefix,
|
|
7372
7457
|
onOpenPresetInfo = _ref2.onOpenPresetInfo,
|
|
@@ -7374,10 +7459,10 @@ var WorkspaceSelectList = function WorkspaceSelectList(_ref2) {
|
|
|
7374
7459
|
onSelectVersion = _ref2.onSelectVersion;
|
|
7375
7460
|
var _useWorkspaceTranslat = useWorkspaceTranslation(),
|
|
7376
7461
|
t = _useWorkspaceTranslat.t;
|
|
7377
|
-
var newPresetTruthy = newPreset || getEmptyWorkspaceListItem(t);
|
|
7378
7462
|
var items = React.useMemo(function () {
|
|
7379
|
-
|
|
7380
|
-
|
|
7463
|
+
var newPresetsTruthy = newPresets && newPresets.length > 0 ? newPresets : [getEmptyWorkspaceListItem(t), getNewSoundingsWorkspaceListItem(t)];
|
|
7464
|
+
return !hideNewWorkspace ? [].concat(newPresetsTruthy, workspacePresets) : [].concat(workspacePresets);
|
|
7465
|
+
}, [hideNewWorkspace, newPresets, workspacePresets, t]);
|
|
7381
7466
|
return jsxs(Box, {
|
|
7382
7467
|
"data-testid": testIdPrefix + "-selectList",
|
|
7383
7468
|
sx: {
|
|
@@ -7939,9 +8024,9 @@ var ViewPresetMenuListConnect = function ViewPresetMenuListConnect(_ref) {
|
|
|
7939
8024
|
infoOpenPresetId: infoPreset == null ? void 0 : infoPreset.id,
|
|
7940
8025
|
isAdmin: isAdmin,
|
|
7941
8026
|
isEditable: isLoggedIn,
|
|
7942
|
-
|
|
8027
|
+
newPresets: [Object.assign({}, getEmptyWorkspaceListItem(t), {
|
|
7943
8028
|
title: t('workspace-mappreset-new')
|
|
7944
|
-
}),
|
|
8029
|
+
})],
|
|
7945
8030
|
onClickWorkspacePreset: selectViewPreset,
|
|
7946
8031
|
onClickWorkspacePresetOption: onClickViewPresetOption,
|
|
7947
8032
|
onOpenPresetInfo: onOpenPresetInfo,
|
|
@@ -8243,6 +8328,11 @@ var WorkspaceSelectListConnect = function WorkspaceSelectListConnect(_ref) {
|
|
|
8243
8328
|
workspaceId: workspaceId
|
|
8244
8329
|
}));
|
|
8245
8330
|
}, [dispatch]);
|
|
8331
|
+
var setPreset = React.useCallback(function (workspacePreset) {
|
|
8332
|
+
dispatch(workspaceActions.changePreset({
|
|
8333
|
+
workspacePreset: workspacePreset
|
|
8334
|
+
}));
|
|
8335
|
+
}, [dispatch]);
|
|
8246
8336
|
var setWorkspaceActionDialogOptions = React.useCallback(function (dialogOptions) {
|
|
8247
8337
|
dispatch(workspaceListActions.openWorkspaceActionDialogOptions(dialogOptions));
|
|
8248
8338
|
}, [dispatch]);
|
|
@@ -8274,8 +8364,19 @@ var WorkspaceSelectListConnect = function WorkspaceSelectListConnect(_ref) {
|
|
|
8274
8364
|
newWorkspaceText: t('workspace-new')
|
|
8275
8365
|
}));
|
|
8276
8366
|
}, [dispatch, t]);
|
|
8367
|
+
var onClickNewSoundingsPreset = React.useCallback(function (id) {
|
|
8368
|
+
dispatch(routerActions.navigateToUrl({
|
|
8369
|
+
url: getWorkspaceRouteUrl(id)
|
|
8370
|
+
}));
|
|
8371
|
+
dispatch(workspaceListActions.toggleWorkspaceDialog({
|
|
8372
|
+
isWorkspaceListDialogOpen: false
|
|
8373
|
+
}));
|
|
8374
|
+
setPreset(getNewSoundingsWorkspace(t));
|
|
8375
|
+
}, [dispatch, setPreset, t]);
|
|
8277
8376
|
var onClickWorkspacePreset = function onClickWorkspacePreset(id) {
|
|
8278
|
-
if (id ===
|
|
8377
|
+
if (id === LOCAL_SOUNDINGS_ID) {
|
|
8378
|
+
onClickNewSoundingsPreset(id);
|
|
8379
|
+
} else if (id === getEmptyMapWorkspace(t).id) {
|
|
8279
8380
|
onClickNewPreset();
|
|
8280
8381
|
} else if (!isFetching) {
|
|
8281
8382
|
fetchWorkspace(id);
|
|
@@ -8291,36 +8392,44 @@ var WorkspaceSelectListConnect = function WorkspaceSelectListConnect(_ref) {
|
|
|
8291
8392
|
}
|
|
8292
8393
|
};
|
|
8293
8394
|
var currentViewsToBE = React.useCallback(function () {
|
|
8294
|
-
|
|
8295
|
-
var ws = currentView;
|
|
8296
|
-
var result = [];
|
|
8297
|
-
((_ws$views$allIds = ws == null || (_ws$views = ws.views) == null ? void 0 : _ws$views.allIds) != null ? _ws$views$allIds : []).forEach(function (id) {
|
|
8298
|
-
var _ws$views$byId$id;
|
|
8299
|
-
var view = (_ws$views$byId$id = ws.views.byId[id]) != null ? _ws$views$byId$id : {};
|
|
8300
|
-
result.push({
|
|
8301
|
-
mosaicNodeId: id,
|
|
8302
|
-
title: typeof view.title === 'string' && view.title.trim() ? view.title : id,
|
|
8303
|
-
componentType: view.componentType,
|
|
8304
|
-
initialProps: view.initialProps
|
|
8305
|
-
});
|
|
8306
|
-
});
|
|
8307
|
-
return result;
|
|
8395
|
+
return getBEViewsFromState(currentView);
|
|
8308
8396
|
}, [currentView]);
|
|
8309
8397
|
var onClickWorkspacePresetOption = /*#__PURE__*/function () {
|
|
8310
|
-
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(presetId, workspaceAction) {
|
|
8311
|
-
var affectedPreset, presetTitle, _currentView$syncGrou, currentViews, adminMetadata, buildFormValues, url, preset, expanded, sanitized, _t;
|
|
8398
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(presetId, workspaceAction, workspacePreset) {
|
|
8399
|
+
var affectedPreset, presetTitle, _currentView$syncGrou, views, currentViews, adminMetadata, buildFormValues, url, preset, expanded, sanitized, _t;
|
|
8312
8400
|
return _regenerator().w(function (_context2) {
|
|
8313
8401
|
while (1) switch (_context2.p = _context2.n) {
|
|
8314
8402
|
case 0:
|
|
8315
8403
|
// If affectedPreset is the FE defined `New workspace` - use the definition from FE instead of BE
|
|
8316
|
-
affectedPreset =
|
|
8317
|
-
|
|
8318
|
-
|
|
8404
|
+
affectedPreset = function () {
|
|
8405
|
+
if (presetId === LOCAL_SOUNDINGS_ID) {
|
|
8406
|
+
return getNewSoundingsWorkspace(t);
|
|
8407
|
+
}
|
|
8408
|
+
return !presetId ? getEmptyMapWorkspace(t) : workspacePresets.find(function (preset) {
|
|
8409
|
+
return preset.id === presetId;
|
|
8410
|
+
});
|
|
8411
|
+
}();
|
|
8319
8412
|
presetTitle = affectedPreset == null ? void 0 : affectedPreset.title;
|
|
8320
8413
|
_t = workspaceAction;
|
|
8321
|
-
_context2.n = _t === WorkspacePresetAction.DUPLICATE ? 1 : _t === WorkspacePresetAction.EDIT ?
|
|
8414
|
+
_context2.n = _t === WorkspacePresetAction.DUPLICATE ? 1 : _t === WorkspacePresetAction.EDIT ? 3 : _t === WorkspacePresetAction.DELETE ? 5 : _t === WorkspacePresetAction.DELETE_SYSTEM_PRESET ? 6 : _t === WorkspacePresetAction.SHARE ? 7 : _t === WorkspacePresetAction.OPEN_TAB ? 8 : _t === WorkspacePresetAction.COPY_TO_CLIPBOARD ? 9 : 15;
|
|
8322
8415
|
break;
|
|
8323
8416
|
case 1:
|
|
8417
|
+
if (!(!presetId || presetId === LOCAL_SOUNDINGS_ID)) {
|
|
8418
|
+
_context2.n = 2;
|
|
8419
|
+
break;
|
|
8420
|
+
}
|
|
8421
|
+
// We are creating a duplicate workspace from new workspace/new soundings workspace
|
|
8422
|
+
views = getBEViewsFromState(affectedPreset);
|
|
8423
|
+
setWorkspaceActionDialogOptions({
|
|
8424
|
+
action: workspaceAction,
|
|
8425
|
+
presetId: undefined,
|
|
8426
|
+
formValues: Object.assign({}, affectedPreset, {
|
|
8427
|
+
scope: scope,
|
|
8428
|
+
views: views
|
|
8429
|
+
})
|
|
8430
|
+
});
|
|
8431
|
+
return _context2.a(3, 16);
|
|
8432
|
+
case 2:
|
|
8324
8433
|
currentViews = currentViewsToBE();
|
|
8325
8434
|
setWorkspaceActionDialogOptions({
|
|
8326
8435
|
action: workspaceAction,
|
|
@@ -8336,8 +8445,8 @@ var WorkspaceSelectListConnect = function WorkspaceSelectListConnect(_ref) {
|
|
|
8336
8445
|
syncGroups: (_currentView$syncGrou = currentView.syncGroups) != null ? _currentView$syncGrou : []
|
|
8337
8446
|
}
|
|
8338
8447
|
});
|
|
8339
|
-
return _context2.a(3,
|
|
8340
|
-
case
|
|
8448
|
+
return _context2.a(3, 16);
|
|
8449
|
+
case 3:
|
|
8341
8450
|
adminMetadata = isAdmin && auth != null && auth.username ? {
|
|
8342
8451
|
updated: new Date().toISOString(),
|
|
8343
8452
|
updatedBy: auth.username
|
|
@@ -8359,7 +8468,7 @@ var WorkspaceSelectListConnect = function WorkspaceSelectListConnect(_ref) {
|
|
|
8359
8468
|
}, adminMetadata);
|
|
8360
8469
|
}; // If editing the active workspace, keep using the current workspace data
|
|
8361
8470
|
if (!(presetId === (currentView == null ? void 0 : currentView.id) || !auth)) {
|
|
8362
|
-
_context2.n =
|
|
8471
|
+
_context2.n = 4;
|
|
8363
8472
|
break;
|
|
8364
8473
|
}
|
|
8365
8474
|
setWorkspaceActionDialogOptions({
|
|
@@ -8367,8 +8476,8 @@ var WorkspaceSelectListConnect = function WorkspaceSelectListConnect(_ref) {
|
|
|
8367
8476
|
presetId: presetId,
|
|
8368
8477
|
formValues: buildFormValues(currentView, currentViewsToBE())
|
|
8369
8478
|
});
|
|
8370
|
-
return _context2.a(3,
|
|
8371
|
-
case
|
|
8479
|
+
return _context2.a(3, 16);
|
|
8480
|
+
case 4:
|
|
8372
8481
|
// Open dialog immediately with basic data, then hydrate with full preset once fetched
|
|
8373
8482
|
setWorkspaceActionDialogOptions({
|
|
8374
8483
|
action: workspaceAction,
|
|
@@ -8391,8 +8500,8 @@ var WorkspaceSelectListConnect = function WorkspaceSelectListConnect(_ref) {
|
|
|
8391
8500
|
}
|
|
8392
8501
|
}));
|
|
8393
8502
|
});
|
|
8394
|
-
return _context2.a(3,
|
|
8395
|
-
case
|
|
8503
|
+
return _context2.a(3, 16);
|
|
8504
|
+
case 5:
|
|
8396
8505
|
setWorkspaceActionDialogOptions({
|
|
8397
8506
|
action: workspaceAction,
|
|
8398
8507
|
presetId: presetId,
|
|
@@ -8401,8 +8510,8 @@ var WorkspaceSelectListConnect = function WorkspaceSelectListConnect(_ref) {
|
|
|
8401
8510
|
scope: scope
|
|
8402
8511
|
}
|
|
8403
8512
|
});
|
|
8404
|
-
return _context2.a(3,
|
|
8405
|
-
case
|
|
8513
|
+
return _context2.a(3, 16);
|
|
8514
|
+
case 6:
|
|
8406
8515
|
setWorkspaceActionDialogOptions({
|
|
8407
8516
|
action: workspaceAction,
|
|
8408
8517
|
presetId: presetId,
|
|
@@ -8411,8 +8520,8 @@ var WorkspaceSelectListConnect = function WorkspaceSelectListConnect(_ref) {
|
|
|
8411
8520
|
scope: scope
|
|
8412
8521
|
}
|
|
8413
8522
|
});
|
|
8414
|
-
return _context2.a(3,
|
|
8415
|
-
case
|
|
8523
|
+
return _context2.a(3, 16);
|
|
8524
|
+
case 7:
|
|
8416
8525
|
void getWorkspace(presetId, auth).then(/*#__PURE__*/function () {
|
|
8417
8526
|
var _ref5 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(preset) {
|
|
8418
8527
|
return _regenerator().w(function (_context) {
|
|
@@ -8440,52 +8549,52 @@ var WorkspaceSelectListConnect = function WorkspaceSelectListConnect(_ref) {
|
|
|
8440
8549
|
}
|
|
8441
8550
|
}, _callee);
|
|
8442
8551
|
}));
|
|
8443
|
-
return function (
|
|
8552
|
+
return function (_x4) {
|
|
8444
8553
|
return _ref5.apply(this, arguments);
|
|
8445
8554
|
};
|
|
8446
8555
|
}());
|
|
8447
|
-
return _context2.a(3,
|
|
8448
|
-
case
|
|
8556
|
+
return _context2.a(3, 16);
|
|
8557
|
+
case 8:
|
|
8449
8558
|
url = getWorkspaceRouteUrl(presetId);
|
|
8450
8559
|
window.open(url, '_blank');
|
|
8451
|
-
return _context2.a(3,
|
|
8452
|
-
case 8:
|
|
8453
|
-
_context2.p = 8;
|
|
8454
|
-
_context2.n = 9;
|
|
8455
|
-
return getWorkspace(presetId, auth);
|
|
8560
|
+
return _context2.a(3, 16);
|
|
8456
8561
|
case 9:
|
|
8457
|
-
|
|
8562
|
+
_context2.p = 9;
|
|
8458
8563
|
_context2.n = 10;
|
|
8459
|
-
return
|
|
8564
|
+
return getWorkspace(presetId, auth);
|
|
8460
8565
|
case 10:
|
|
8566
|
+
preset = _context2.v;
|
|
8567
|
+
_context2.n = 11;
|
|
8568
|
+
return expandWorkspaceViewPresets(preset, auth);
|
|
8569
|
+
case 11:
|
|
8461
8570
|
expanded = _context2.v;
|
|
8462
8571
|
sanitized = sanitizeWorkspaceForClipboard(expanded);
|
|
8463
|
-
_context2.n =
|
|
8572
|
+
_context2.n = 12;
|
|
8464
8573
|
return writeToClipboard(JSON.stringify(sanitized, null, 2));
|
|
8465
|
-
case
|
|
8574
|
+
case 12:
|
|
8466
8575
|
dispatch(snackbarActions.openSnackbar({
|
|
8467
8576
|
type: snackbarTypes.SnackbarMessageType.VERBATIM_MESSAGE,
|
|
8468
8577
|
message: t('workspace-copy-success')
|
|
8469
8578
|
}));
|
|
8470
|
-
_context2.n =
|
|
8579
|
+
_context2.n = 14;
|
|
8471
8580
|
break;
|
|
8472
|
-
case
|
|
8473
|
-
_context2.p =
|
|
8581
|
+
case 13:
|
|
8582
|
+
_context2.p = 13;
|
|
8474
8583
|
_context2.v;
|
|
8475
8584
|
dispatch(snackbarActions.openSnackbar({
|
|
8476
8585
|
type: snackbarTypes.SnackbarMessageType.VERBATIM_MESSAGE,
|
|
8477
8586
|
message: t('workspace-error-generic')
|
|
8478
8587
|
}));
|
|
8479
|
-
case 13:
|
|
8480
|
-
return _context2.a(3, 15);
|
|
8481
8588
|
case 14:
|
|
8482
|
-
return _context2.a(3,
|
|
8589
|
+
return _context2.a(3, 16);
|
|
8483
8590
|
case 15:
|
|
8591
|
+
return _context2.a(3, 16);
|
|
8592
|
+
case 16:
|
|
8484
8593
|
return _context2.a(2);
|
|
8485
8594
|
}
|
|
8486
|
-
}, _callee2, null, [[
|
|
8595
|
+
}, _callee2, null, [[9, 13]]);
|
|
8487
8596
|
}));
|
|
8488
|
-
return function onClickWorkspacePresetOption(_x, _x2) {
|
|
8597
|
+
return function onClickWorkspacePresetOption(_x, _x2, _x3) {
|
|
8489
8598
|
return _ref2.apply(this, arguments);
|
|
8490
8599
|
};
|
|
8491
8600
|
}();
|
|
@@ -8515,10 +8624,10 @@ var WorkspaceSelectListConnect = function WorkspaceSelectListConnect(_ref) {
|
|
|
8515
8624
|
flexDirection: 'column',
|
|
8516
8625
|
height: '100%'
|
|
8517
8626
|
},
|
|
8518
|
-
tabIndex: 0,
|
|
8519
8627
|
sx: {
|
|
8520
8628
|
bgcolor: 'geowebColors.background.surface'
|
|
8521
8629
|
},
|
|
8630
|
+
tabIndex: 0,
|
|
8522
8631
|
children: [jsx(Box, {
|
|
8523
8632
|
sx: {
|
|
8524
8633
|
height: 4,
|
|
@@ -10000,42 +10109,35 @@ var WorkspaceOptionsConnect = function WorkspaceOptionsConnect(_ref) {
|
|
|
10000
10109
|
isPasteDialogOpen = _React$useState[0],
|
|
10001
10110
|
setIsPasteDialogOpen = _React$useState[1];
|
|
10002
10111
|
var onCopyToClipboard = React.useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
10003
|
-
var
|
|
10112
|
+
var workspaceWithLiveViews, sanitized, json;
|
|
10004
10113
|
return _regenerator().w(function (_context) {
|
|
10005
10114
|
while (1) switch (_context.p = _context.n) {
|
|
10006
10115
|
case 0:
|
|
10007
10116
|
_context.p = 0;
|
|
10008
|
-
|
|
10009
|
-
|
|
10010
|
-
case 1:
|
|
10011
|
-
preset = _context.v;
|
|
10012
|
-
_context.n = 2;
|
|
10013
|
-
return expandWorkspaceViewPresets(preset, auth);
|
|
10014
|
-
case 2:
|
|
10015
|
-
expanded = _context.v;
|
|
10016
|
-
sanitized = sanitizeWorkspaceForClipboard(expanded);
|
|
10117
|
+
workspaceWithLiveViews = getWorkspaceToSendToBackend(store.getState());
|
|
10118
|
+
sanitized = sanitizeWorkspaceForClipboard(workspaceWithLiveViews);
|
|
10017
10119
|
json = JSON.stringify(sanitized, null, 2);
|
|
10018
|
-
_context.n =
|
|
10120
|
+
_context.n = 1;
|
|
10019
10121
|
return writeToClipboard(json);
|
|
10020
|
-
case
|
|
10122
|
+
case 1:
|
|
10021
10123
|
dispatch(snackbarActions.openSnackbar({
|
|
10022
10124
|
type: snackbarTypes.SnackbarMessageType.VERBATIM_MESSAGE,
|
|
10023
10125
|
message: t('workspace-copy-success')
|
|
10024
10126
|
}));
|
|
10025
|
-
_context.n =
|
|
10127
|
+
_context.n = 3;
|
|
10026
10128
|
break;
|
|
10027
|
-
case
|
|
10028
|
-
_context.p =
|
|
10129
|
+
case 2:
|
|
10130
|
+
_context.p = 2;
|
|
10029
10131
|
_context.v;
|
|
10030
10132
|
dispatch(snackbarActions.openSnackbar({
|
|
10031
10133
|
type: snackbarTypes.SnackbarMessageType.VERBATIM_MESSAGE,
|
|
10032
10134
|
message: t('workspace-error-generic')
|
|
10033
10135
|
}));
|
|
10034
|
-
case
|
|
10136
|
+
case 3:
|
|
10035
10137
|
return _context.a(2);
|
|
10036
10138
|
}
|
|
10037
|
-
}, _callee, null, [[0,
|
|
10038
|
-
})), [
|
|
10139
|
+
}, _callee, null, [[0, 2]]);
|
|
10140
|
+
})), [dispatch, store, t]);
|
|
10039
10141
|
var onPasteFromClipboard = React.useCallback(function () {
|
|
10040
10142
|
setIsPasteDialogOpen(true);
|
|
10041
10143
|
}, []);
|
|
@@ -10655,29 +10757,39 @@ var WorkspaceTabConnect = function WorkspaceTabConnect(_ref) {
|
|
|
10655
10757
|
while (1) switch (_context2.n) {
|
|
10656
10758
|
case 0:
|
|
10657
10759
|
_t2 = presetAction;
|
|
10658
|
-
_context2.n = _t2 === WorkspacePresetAction.DELETE ? 1 : _t2 === WorkspacePresetAction.DELETE_SYSTEM_PRESET ? 1 : _t2 === WorkspacePresetAction.DUPLICATE ? 2 :
|
|
10760
|
+
_context2.n = _t2 === WorkspacePresetAction.DELETE ? 1 : _t2 === WorkspacePresetAction.DELETE_SYSTEM_PRESET ? 1 : _t2 === WorkspacePresetAction.DUPLICATE ? 2 : 8;
|
|
10659
10761
|
break;
|
|
10660
10762
|
case 1:
|
|
10661
10763
|
deleteWorkspace({
|
|
10662
10764
|
id: presetId
|
|
10663
10765
|
});
|
|
10664
|
-
return _context2.a(3,
|
|
10766
|
+
return _context2.a(3, 9);
|
|
10665
10767
|
case 2:
|
|
10768
|
+
if (!(!presetId || presetId === LOCAL_SOUNDINGS_ID)) {
|
|
10769
|
+
_context2.n = 3;
|
|
10770
|
+
break;
|
|
10771
|
+
}
|
|
10772
|
+
createWorkspace({
|
|
10773
|
+
data: data,
|
|
10774
|
+
action: presetAction
|
|
10775
|
+
});
|
|
10776
|
+
return _context2.a(3, 9);
|
|
10777
|
+
case 3:
|
|
10666
10778
|
if (!presetId) {
|
|
10667
|
-
_context2.n =
|
|
10779
|
+
_context2.n = 5;
|
|
10668
10780
|
break;
|
|
10669
10781
|
}
|
|
10670
|
-
_context2.n =
|
|
10782
|
+
_context2.n = 4;
|
|
10671
10783
|
return getWorkspace(presetId, auth);
|
|
10672
|
-
case
|
|
10784
|
+
case 4:
|
|
10673
10785
|
_t3 = _context2.v;
|
|
10674
|
-
_context2.n =
|
|
10786
|
+
_context2.n = 6;
|
|
10675
10787
|
break;
|
|
10676
|
-
case 4:
|
|
10677
|
-
_t3 = emptyWorkspaceBEData;
|
|
10678
10788
|
case 5:
|
|
10789
|
+
_t3 = emptyWorkspaceBEData;
|
|
10790
|
+
case 6:
|
|
10679
10791
|
oldWorkspace = _t3;
|
|
10680
|
-
_context2.n =
|
|
10792
|
+
_context2.n = 7;
|
|
10681
10793
|
return Promise.all(((_oldWorkspace$views = oldWorkspace.views) != null ? _oldWorkspace$views : []).map(/*#__PURE__*/function () {
|
|
10682
10794
|
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(view) {
|
|
10683
10795
|
var rest, _preset$id, preset, _viewPresetId, _rest, componentType, initialProps, _title;
|
|
@@ -10723,7 +10835,7 @@ var WorkspaceTabConnect = function WorkspaceTabConnect(_ref) {
|
|
|
10723
10835
|
return _ref3.apply(this, arguments);
|
|
10724
10836
|
};
|
|
10725
10837
|
}()));
|
|
10726
|
-
case
|
|
10838
|
+
case 7:
|
|
10727
10839
|
viewsToDuplicate = _context2.v;
|
|
10728
10840
|
duplicatedWorkspace = Object.assign({}, oldWorkspace, {
|
|
10729
10841
|
title: data.title,
|
|
@@ -10737,17 +10849,18 @@ var WorkspaceTabConnect = function WorkspaceTabConnect(_ref) {
|
|
|
10737
10849
|
data: duplicatedWorkspace,
|
|
10738
10850
|
action: presetAction
|
|
10739
10851
|
});
|
|
10740
|
-
return _context2.a(3,
|
|
10741
|
-
case
|
|
10852
|
+
return _context2.a(3, 9);
|
|
10853
|
+
case 8:
|
|
10742
10854
|
dispatch(workspaceListActions.submitFormWorkspaceActionDialogOptions({
|
|
10743
10855
|
presetAction: presetAction,
|
|
10744
10856
|
presetId: presetId,
|
|
10745
10857
|
data: data,
|
|
10746
10858
|
emptyMapPresetTitle: t('workspace-mappreset-new'),
|
|
10747
|
-
emptyWorkspacePresetTitle: t('workspace-new')
|
|
10859
|
+
emptyWorkspacePresetTitle: t('workspace-new'),
|
|
10860
|
+
emptySoundingsPresetTitle: t('workspace-new-soundings')
|
|
10748
10861
|
}));
|
|
10749
|
-
return _context2.a(3,
|
|
10750
|
-
case
|
|
10862
|
+
return _context2.a(3, 9);
|
|
10863
|
+
case 9:
|
|
10751
10864
|
return _context2.a(2);
|
|
10752
10865
|
}
|
|
10753
10866
|
}, _callee2);
|
|
@@ -11401,6 +11514,11 @@ var WorkspaceDetail = function WorkspaceDetail(_ref) {
|
|
|
11401
11514
|
changeToEmptyMapWorkspace();
|
|
11402
11515
|
navigateToUrl(routes.root);
|
|
11403
11516
|
};
|
|
11517
|
+
var setPreset = React.useCallback(function (workspacePreset) {
|
|
11518
|
+
dispatch(workspaceActions.changePreset({
|
|
11519
|
+
workspacePreset: workspacePreset
|
|
11520
|
+
}));
|
|
11521
|
+
}, [dispatch]);
|
|
11404
11522
|
React.useEffect(function () {
|
|
11405
11523
|
var idToFetch = workspaceId || initialWorkspaceId;
|
|
11406
11524
|
var hasWorkspaceData = workspaceState.views.allIds.length > 0;
|
|
@@ -11411,6 +11529,9 @@ var WorkspaceDetail = function WorkspaceDetail(_ref) {
|
|
|
11411
11529
|
isWorkspaceListDialogOpen: true
|
|
11412
11530
|
}));
|
|
11413
11531
|
}
|
|
11532
|
+
} else if (idToFetch === LOCAL_SOUNDINGS_ID) {
|
|
11533
|
+
// If the workspaceId is the local soundings id, we don't want to fetch it from the backend, but instead set it to an empty soundings workspace
|
|
11534
|
+
setPreset(getNewSoundingsWorkspace(t));
|
|
11414
11535
|
} else if (idToFetch) {
|
|
11415
11536
|
fetchWorkspace(idToFetch);
|
|
11416
11537
|
}
|
|
@@ -12,7 +12,7 @@ export interface WorkspaceSelectListProps extends BoxProps {
|
|
|
12
12
|
isEditable?: boolean;
|
|
13
13
|
isAdmin?: boolean;
|
|
14
14
|
searchQuery?: string;
|
|
15
|
-
|
|
15
|
+
newPresets?: WorkspacePresetListItem[];
|
|
16
16
|
testIdPrefix?: string;
|
|
17
17
|
onSelectVersion?: (presetId: string, version: string) => void;
|
|
18
18
|
}
|
|
@@ -403,4 +403,8 @@ export declare const getViewPresetToSendToBackend: ((state: any, ...params: any[
|
|
|
403
403
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
404
404
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
405
405
|
};
|
|
406
|
+
/**
|
|
407
|
+
* Gets workspace data with each view's current state included in initialProps.
|
|
408
|
+
*/
|
|
409
|
+
export declare const getWorkspaceToSendToBackend: (store: AppStore) => WorkspaceData;
|
|
406
410
|
export {};
|
|
@@ -91,6 +91,7 @@ export interface SubmitFormWorkspaceActionDialogPayload {
|
|
|
91
91
|
data: WorkspacePresetForBE;
|
|
92
92
|
emptyMapPresetTitle: string;
|
|
93
93
|
emptyWorkspacePresetTitle: string;
|
|
94
|
+
emptySoundingsPresetTitle?: string;
|
|
94
95
|
}
|
|
95
96
|
export interface OnNonDeleteSuccesWorkspacePresetActionPayload {
|
|
96
97
|
workspaceId: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { TFunction } from 'i18next';
|
|
2
2
|
import { snackbarTypes } from '@opengeoweb/snackbar';
|
|
3
3
|
import type { MapPreset } from '@opengeoweb/store';
|
|
4
|
-
import type { WorkspacePreset, WorkspacePresetListItem } from '../workspace/types';
|
|
4
|
+
import type { WorkspacePreset, WorkspacePresetListItem, WorkspaceState, WorkspaceViewsFromBE } from '../workspace/types';
|
|
5
5
|
import { WorkspacePresetAction } from '../workspace/types';
|
|
6
6
|
export declare const getSnackbarMessage: (action: WorkspacePresetAction, title: string, is_shared?: boolean) => snackbarTypes.TranslatableMessage;
|
|
7
7
|
export declare function getEmptyWorkspaceListItem(): Omit<WorkspacePresetListItem, 'title'>;
|
|
@@ -11,3 +11,7 @@ export declare function getEmptyMapWorkspace(): Omit<WorkspacePreset, 'title'>;
|
|
|
11
11
|
export declare function getEmptyMapWorkspace(t: TFunction): WorkspacePreset;
|
|
12
12
|
export declare const getEmptyWorkspacePreset: () => Omit<WorkspacePreset, "title">;
|
|
13
13
|
export declare const createCustomEmptyMapWorkspace: (emptyWorkspaceTitle: string, emptyMapWorkspaceTitle: string, customMapPreset?: MapPreset) => WorkspacePreset;
|
|
14
|
+
export declare const LOCAL_SOUNDINGS_ID = "newSoundingsWorkspace";
|
|
15
|
+
export declare const getNewSoundingsWorkspaceListItem: (t?: TFunction) => WorkspacePresetListItem;
|
|
16
|
+
export declare function getNewSoundingsWorkspace(t?: TFunction): WorkspacePreset;
|
|
17
|
+
export declare const getBEViewsFromState: (workspace: WorkspaceState) => WorkspaceViewsFromBE[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/workspace",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.4.0",
|
|
4
4
|
"description": "GeoWeb Workspace library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@opengeoweb/snackbar": "*",
|
|
31
31
|
"react-window": "^2.2.6",
|
|
32
32
|
"lodash": "^4.18.1",
|
|
33
|
-
"axios": "^1.
|
|
33
|
+
"axios": "^1.18.0",
|
|
34
34
|
"react-mosaic-component": "npm:react-mosaic-component-opengeoweb@^6.1.1-opengeoweb.1",
|
|
35
35
|
"@opengeoweb/form-fields": "*",
|
|
36
36
|
"@opengeoweb/time-series": "*",
|