@opengeoweb/workspace 9.28.0 → 9.29.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 +756 -381
- package/package.json +1 -1
- package/src/index.d.ts +17 -17
- package/src/lib/Workspace.stories.d.ts +23 -23
- package/src/lib/WorkspaceAdmin.stories.d.ts +9 -0
- package/src/lib/components/ComponentsLookUpWrapper/ComponentsLookUpWrapper.d.ts +12 -12
- package/src/lib/components/ComponentsLookUpWrapper/ComponentsLookUpWrapper.spec.d.ts +1 -1
- package/src/lib/components/ComponentsLookUpWrapper/index.d.ts +1 -1
- package/src/lib/components/DefaultComponentsLookUp/DefaultComponentsLookUp.d.ts +17 -17
- package/src/lib/components/DefaultComponentsLookUp/DefaultComponentsLookUp.spec.d.ts +1 -1
- package/src/lib/components/DefaultComponentsLookUp/index.d.ts +1 -1
- package/src/lib/components/Providers/Providers.d.ts +27 -27
- package/src/lib/components/Providers/WorkspaceModuleProvider.d.ts +7 -7
- package/src/lib/components/Providers/WorkspaceModuleProvider.spec.d.ts +1 -1
- package/src/lib/components/Providers/index.d.ts +2 -2
- package/src/lib/components/ResizeMenu/ResizeMenu.d.ts +6 -6
- package/src/lib/components/ResizeMenu/ResizeMenu.spec.d.ts +1 -1
- package/src/lib/components/ResizeMenu/index.d.ts +1 -1
- package/src/lib/components/ViewPresetMenu/ViewPresetMenu.d.ts +8 -8
- package/src/lib/components/ViewPresetMenu/ViewPresetMenu.spec.d.ts +1 -1
- package/src/lib/components/ViewPresetMenu/ViewPresetMenu.stories.d.ts +25 -25
- package/src/lib/components/ViewPresetMenu/ViewPresetMenuListConnect.d.ts +6 -6
- package/src/lib/components/ViewPresetMenu/ViewPresetMenuListConnect.spec.d.ts +1 -1
- package/src/lib/components/ViewPresetMenu/ViewPresetsError.stories.d.ts +23 -23
- package/src/lib/components/ViewPresetMenu/index.d.ts +1 -1
- package/src/lib/components/ViewPresetsFormDialog/ViewPresetsForm.d.ts +16 -16
- package/src/lib/components/ViewPresetsFormDialog/ViewPresetsForm.spec.d.ts +1 -1
- package/src/lib/components/ViewPresetsFormDialog/ViewPresetsFormDialog.d.ts +15 -15
- package/src/lib/components/ViewPresetsFormDialog/ViewPresetsFormDialog.spec.d.ts +1 -1
- package/src/lib/components/ViewPresetsFormDialog/ViewPresetsFormDialog.stories.d.ts +25 -25
- package/src/lib/components/ViewPresetsFormDialog/ViewPresetsFormDialogConnect.d.ts +3 -3
- package/src/lib/components/ViewPresetsFormDialog/ViewPresetsFormDialogConnect.spec.d.ts +1 -1
- package/src/lib/components/ViewPresetsFormDialog/index.d.ts +1 -1
- package/src/lib/components/WorkspaceDetail/WorkspaceDetail.d.ts +10 -10
- package/src/lib/components/WorkspaceDetail/WorkspaceDetail.spec.d.ts +1 -1
- package/src/lib/components/WorkspaceDetail/WorkspaceDetail.stories.d.ts +9 -9
- package/src/lib/components/WorkspaceDetail/WorkspaceDetailError.stories.d.ts +11 -11
- package/src/lib/components/WorkspaceDetail/index.d.ts +1 -1
- package/src/lib/components/WorkspaceMenu/WorkspaceMenu.d.ts +6 -6
- package/src/lib/components/WorkspaceMenu/WorkspaceMenu.spec.d.ts +1 -1
- package/src/lib/components/WorkspaceMenu/WorkspaceMenu.stories.d.ts +13 -13
- package/src/lib/components/WorkspaceMenu/WorkspaceMenuButton.d.ts +7 -7
- package/src/lib/components/WorkspaceMenu/WorkspaceMenuButton.spec.d.ts +1 -1
- package/src/lib/components/WorkspaceMenu/WorkspaceMenuButton.stories.d.ts +23 -23
- package/src/lib/components/WorkspaceMenu/WorkspaceMenuButtonConnect.d.ts +2 -2
- package/src/lib/components/WorkspaceMenu/WorkspaceMenuButtonConnect.spec.d.ts +1 -1
- package/src/lib/components/WorkspaceMenu/index.d.ts +2 -2
- package/src/lib/components/WorkspaceOptions/WorkspaceOptions.d.ts +20 -19
- package/src/lib/components/WorkspaceOptions/WorkspaceOptions.spec.d.ts +1 -1
- package/src/lib/components/WorkspaceOptions/WorkspaceOptions.stories.d.ts +39 -39
- package/src/lib/components/WorkspaceOptions/WorkspaceOptionsConnect.d.ts +7 -7
- package/src/lib/components/WorkspaceOptions/WorkspaceOptionsConnect.spec.d.ts +1 -1
- package/src/lib/components/WorkspacePresetsFormDialog/WorkspacePresetsForm.d.ts +19 -16
- package/src/lib/components/WorkspacePresetsFormDialog/WorkspacePresetsForm.spec.d.ts +1 -1
- package/src/lib/components/WorkspacePresetsFormDialog/WorkspacePresetsFormDialog.d.ts +16 -15
- package/src/lib/components/WorkspacePresetsFormDialog/WorkspacePresetsFormDialog.spec.d.ts +1 -1
- package/src/lib/components/WorkspacePresetsFormDialog/WorkspacePresetsFormDialog.stories.d.ts +78 -48
- package/src/lib/components/WorkspacePresetsFormDialog/WorkspaceSystemPresetsForm.d.ts +7 -12
- package/src/lib/components/WorkspacePresetsFormDialog/WorkspaceSystemPresetsForm.spec.d.ts +1 -1
- package/src/lib/components/WorkspaceSelectList/WorkspaceSelectList.d.ts +17 -16
- package/src/lib/components/WorkspaceSelectList/WorkspaceSelectList.spec.d.ts +1 -1
- package/src/lib/components/WorkspaceSelectList/WorkspaceSelectListConnect.d.ts +2 -2
- package/src/lib/components/WorkspaceSelectList/WorkspaceSelectListConnect.spec.d.ts +1 -1
- package/src/lib/components/WorkspaceSelectList/WorkspaceSelectListError.stories.d.ts +6 -6
- package/src/lib/components/WorkspaceSelectList/WorkspaceSelectListRow.d.ts +17 -16
- package/src/lib/components/WorkspaceSelectList/WorkspaceSelectListRow.spec.d.ts +1 -1
- package/src/lib/components/WorkspaceSelectList/WorkspaceSelectListRow.stories.d.ts +19 -19
- package/src/lib/components/WorkspaceTab/WorkspaceTab.d.ts +7 -7
- package/src/lib/components/WorkspaceTab/WorkspaceTab.spec.d.ts +1 -1
- package/src/lib/components/WorkspaceTab/WorkspaceTabConnect.d.ts +6 -6
- package/src/lib/components/WorkspaceTab/WorkspaceTabConnect.integration.spec.d.ts +1 -1
- package/src/lib/components/WorkspaceTab/WorkspaceTabConnect.spec.d.ts +1 -1
- package/src/lib/components/WorkspaceTab/index.d.ts +1 -1
- package/src/lib/components/WorkspaceTopBar/WorkspaceTopBar.d.ts +6 -6
- package/src/lib/components/WorkspaceTopBar/WorkspaceTopBar.spec.d.ts +1 -1
- package/src/lib/components/WorkspaceTopBar/WorkspaceTopBar.stories.d.ts +53 -53
- package/src/lib/components/WorkspaceTopBar/index.d.ts +1 -1
- package/src/lib/components/WorkspaceView/LoadingIndicator/LoadingIndicatorConnect.d.ts +6 -6
- package/src/lib/components/WorkspaceView/LoadingIndicator/LoadingIndicatorConnect.spec.d.ts +1 -1
- package/src/lib/components/WorkspaceView/WorkspaceControls.d.ts +9 -9
- package/src/lib/components/WorkspaceView/WorkspaceControls.spec.d.ts +1 -1
- package/src/lib/components/WorkspaceView/WorkspaceTileConnect.d.ts +12 -12
- package/src/lib/components/WorkspaceView/WorkspaceTileConnect.spec.d.ts +1 -1
- package/src/lib/components/WorkspaceView/WorkspaceView.d.ts +16 -16
- package/src/lib/components/WorkspaceView/WorkspaceView.spec.d.ts +1 -1
- package/src/lib/components/WorkspaceView/WorkspaceViewConnect.d.ts +7 -7
- package/src/lib/components/WorkspaceView/WorkspaceViewConnect.spec.d.ts +1 -1
- package/src/lib/components/WorkspaceView/helpers.d.ts +3 -3
- package/src/lib/components/WorkspaceView/helpers.spec.d.ts +1 -1
- package/src/lib/components/WorkspaceView/index.d.ts +2 -2
- package/src/lib/components/WorkspaceViewTitle/WorkspaceViewTitleConnect.d.ts +11 -11
- package/src/lib/components/WorkspaceViewTitle/WorkspaceViewTitleConnect.spec.d.ts +1 -1
- package/src/lib/store/config.d.ts +5 -5
- package/src/lib/store/index.d.ts +1 -1
- package/src/lib/store/store.d.ts +2 -2
- package/src/lib/store/types.d.ts +13 -13
- package/src/lib/store/viewPresets/index.d.ts +2 -2
- package/src/lib/store/viewPresets/listener.d.ts +6 -2
- package/src/lib/store/viewPresets/listener.integration.spec.d.ts +1 -1
- package/src/lib/store/viewPresets/reducer.d.ts +35 -35
- package/src/lib/store/viewPresets/reducer.spec.d.ts +1 -1
- package/src/lib/store/viewPresets/selectors.d.ts +60 -60
- package/src/lib/store/viewPresets/selectors.spec.d.ts +1 -1
- package/src/lib/store/viewPresets/types.d.ts +133 -133
- package/src/lib/store/viewPresets/utils.d.ts +8 -7
- package/src/lib/store/viewPresets/utils.spec.d.ts +1 -1
- package/src/lib/store/viewPresetsList/index.d.ts +2 -2
- package/src/lib/store/viewPresetsList/reducer.d.ts +5 -5
- package/src/lib/store/viewPresetsList/reducer.spec.d.ts +1 -1
- package/src/lib/store/viewPresetsList/selectors.d.ts +10 -10
- package/src/lib/store/viewPresetsList/selectors.spec.d.ts +1 -1
- package/src/lib/store/viewPresetsList/types.d.ts +17 -17
- package/src/lib/store/workspace/listener.d.ts +4 -4
- package/src/lib/store/workspace/listener.spec.d.ts +1 -1
- package/src/lib/store/workspace/reducer.d.ts +21 -21
- package/src/lib/store/workspace/reducer.spec.d.ts +1 -1
- package/src/lib/store/workspace/selectors.d.ts +174 -170
- package/src/lib/store/workspace/selectors.spec.d.ts +1 -1
- package/src/lib/store/workspace/types.d.ts +147 -145
- package/src/lib/store/workspace/utils.d.ts +29 -29
- package/src/lib/store/workspace/utils.spec.d.ts +1 -1
- package/src/lib/store/workspaceList/index.d.ts +1 -1
- package/src/lib/store/workspaceList/listener.d.ts +11 -11
- package/src/lib/store/workspaceList/listener.spec.d.ts +1 -1
- package/src/lib/store/workspaceList/reducer.d.ts +24 -21
- package/src/lib/store/workspaceList/reducer.spec.d.ts +1 -1
- package/src/lib/store/workspaceList/selectors.d.ts +101 -41
- package/src/lib/store/workspaceList/selectors.spec.d.ts +1 -1
- package/src/lib/store/workspaceList/types.d.ts +100 -77
- package/src/lib/store/workspaceList/utils.d.ts +12 -11
- package/src/lib/store/workspaceList/utils.spec.d.ts +1 -1
- package/src/lib/storyUtils/ActionsExampleComponent.d.ts +6 -6
- package/src/lib/storyUtils/StoryWrapper.d.ts +19 -19
- package/src/lib/storyUtils/componentsLookUp.d.ts +12 -12
- package/src/lib/storyUtils/componentsLookUp.stories.d.ts +46 -46
- package/src/lib/storyUtils/useFirstTimeError.d.ts +4 -4
- package/src/lib/storyUtils/useFirstTimeError.spec.d.ts +1 -1
- package/src/lib/utils/api.d.ts +28 -28
- package/src/lib/utils/api.spec.d.ts +1 -1
- package/src/lib/utils/fakeApi.d.ts +12 -12
- package/src/lib/utils/fakeApi.spec.d.ts +1 -1
- package/src/lib/utils/fakeApi.stories.d.ts +6 -6
- package/src/lib/utils/i18n.d.ts +7 -7
- package/src/lib/utils/routes.d.ts +8 -8
- package/src/lib/utils/routes.spec.d.ts +1 -1
- package/src/lib/utils/utils.d.ts +3 -3
- package/src/lib/utils/utils.spec.d.ts +1 -1
package/index.esm.js
CHANGED
|
@@ -5,22 +5,22 @@ import { createApiInstance, createNonAuthApiInstance, getApi, createFakeApiInsta
|
|
|
5
5
|
import { getLeaves, MosaicContext, getAndAssertNodeAtPathExists, createBalancedTreeFromLeaves, MosaicWindow, Mosaic } from 'react-mosaic-component';
|
|
6
6
|
import { timeSeriesActions, TimeSeriesTypes, timeSeriesSelectors, timeSeriesModuleConfig } from '@opengeoweb/timeseries';
|
|
7
7
|
import { SHARED_NAMESPACE, sharedTranslations, PROJECTION, getAxiosErrorMessage, isAxiosAuthError, isAxiosError as isAxiosError$1, withEggs, ConfirmationServiceProvider, useConfirmationDialog, CustomIconButton, AlertBanner, CustomTooltip, SearchHighlight, ToggleMenu, DEFAULT_FILTER_HEIGHT, usePrevious, Filter, Resizable, ToolContainer, renderCounter, CustomToggleButton, ConfirmationDialog } from '@opengeoweb/shared';
|
|
8
|
+
import { snackbarTypes, snackbarActions, SnackbarWrapperConnect } from '@opengeoweb/snackbar';
|
|
8
9
|
import i18n from 'i18next';
|
|
9
10
|
import { WEBMAP_REACT_NAMESPACE, webmapReactTranslations } from '@opengeoweb/webmap-react';
|
|
10
11
|
import { initReactI18next, useTranslation, I18nextProvider } from 'react-i18next';
|
|
11
12
|
import { CORE_NAMESPACE, coreTranslations } from '@opengeoweb/core';
|
|
12
13
|
import { FORM_FIELDS_NAMESPACE, formFieldsTranslations, ReactHookFormTextField, ReactHookFormHiddenInput, ReactHookFormProvider, defaultFormOptions } from '@opengeoweb/form-fields';
|
|
13
14
|
import { isAxiosError } from 'axios';
|
|
14
|
-
import { snackbarActions, SnackbarWrapperConnect } from '@opengeoweb/snackbar';
|
|
15
15
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
16
|
-
import { ThemeWrapper, lightTheme, SplitVertical, SplitHorizontal, Expand, UnExpand, Close, Delete, Preset, PresetWorkspace, PresetTiles, CloudLoading, CloudIdle, WebAssetOff } from '@opengeoweb/theme';
|
|
16
|
+
import { ThemeWrapper, lightTheme, SplitVertical, SplitHorizontal, Expand, UnExpand, Close, Delete, Preset, PresetWorkspace, PresetTiles, CloudLoading, CloudIdle, WebAssetOff, Exclamation } from '@opengeoweb/theme';
|
|
17
17
|
import { Provider, useDispatch, useSelector, useStore, shallowEqual } from 'react-redux';
|
|
18
18
|
import { AuthenticationProvider, useAuthenticationContext, GEOWEB_ROLE_PRESETS_ADMIN } from '@opengeoweb/authentication';
|
|
19
19
|
import { createStore } from '@redux-eggs/redux-toolkit';
|
|
20
20
|
import { produce } from 'immer';
|
|
21
21
|
import * as React from 'react';
|
|
22
22
|
import React__default, { useCallback } from 'react';
|
|
23
|
-
import { LinearProgress, Typography, ListItem, ListItemButton, ListItemIcon, ListItemText,
|
|
23
|
+
import { LinearProgress, Typography, ListItem, ListItemButton, ListItemIcon, ListItemText, Grid2, Box, Backdrop, Menu, ListSubheader, MenuItem, useTheme, FormGroup, FormControlLabel, Checkbox, Tabs } from '@mui/material';
|
|
24
24
|
import 'react-mosaic-component/react-mosaic-component.css';
|
|
25
25
|
import AutoSizer from 'react-virtualized-auto-sizer';
|
|
26
26
|
import { FixedSizeList } from 'react-window';
|
|
@@ -47,7 +47,8 @@ var en = {
|
|
|
47
47
|
"workspace-cancel": "Cancel",
|
|
48
48
|
"workspace-dialog-name": "Name",
|
|
49
49
|
"workspace-dialog-abstract": "Abstract",
|
|
50
|
-
"workspace-dialog-confirm-delete-message": "Are you sure
|
|
50
|
+
"workspace-dialog-confirm-delete-message": "Are you sure you want to delete the \"{{TITLE}}\" workspace preset?",
|
|
51
|
+
"workspace-dialog-confirm-reset-message": "The system workspace preset will be reset and all changes will be lost. Are you sure you want to continue?",
|
|
51
52
|
"workspace-error-fetch": "Failed to fetch workspace list",
|
|
52
53
|
"workspace-error-fetch-detail": "Failed to fetch workspace {{WORKSPACE_ID}}",
|
|
53
54
|
"workspace-retry": "Try again",
|
|
@@ -59,7 +60,7 @@ var en = {
|
|
|
59
60
|
"workspace-control-close": "Close window",
|
|
60
61
|
"workspace-control-close-message-title": "Whoops",
|
|
61
62
|
"workspace-control-close-message-description": "Are you sure you want to close this window? All changes will be lost.",
|
|
62
|
-
"workspace-mappreset-delete-message": "Are you sure
|
|
63
|
+
"workspace-mappreset-delete-message": "Are you sure you want to delete \"{{TITLE}}\" map preset?",
|
|
63
64
|
"workspace-viewpresets-fail-fetch": "Failed to fetch view {{VIEWPRESET_ID}}",
|
|
64
65
|
"workspace-viewpresets-error": "View presets not available",
|
|
65
66
|
"workspace-mappreset-dialog-title": "Map preset name",
|
|
@@ -75,6 +76,7 @@ var en = {
|
|
|
75
76
|
"workspace-list-success-duplicate": "Workspace \"{{TITLE}}\" successfully saved",
|
|
76
77
|
"workspace-list-success-edit": "Workspace \"{{TITLE}}\" successfully edited",
|
|
77
78
|
"workspace-list-success-save": "Workspace \"{{TITLE}}\" successfully saved",
|
|
79
|
+
"workspace-list-success-reset": "Workspace \"{{TITLE}}\" has been reset succesfully",
|
|
78
80
|
"workspace-save-error": "Failed to save workspace \"{{TITLE}}\"",
|
|
79
81
|
"workspace-error-generic": "Something went wrong, try again",
|
|
80
82
|
"workspace-viewpreset-success-delete": "Map preset \"{{TITLE}}\" successfully deleted",
|
|
@@ -86,7 +88,12 @@ var en = {
|
|
|
86
88
|
"workspace-admin-select-modified-viewpresets": "Select the modified system view presets in this workspace that you want to update.",
|
|
87
89
|
"workspace-admin-save-new-viewpreset": "This new viewpreset will be added to the system presets.",
|
|
88
90
|
"workspace-admin-save-new-viewpreset-warning": "Saving changes to this system preset will impact other presets.",
|
|
89
|
-
"workspace-admin-save-new-viewpreset-title": "Save new system viewpreset"
|
|
91
|
+
"workspace-admin-save-new-viewpreset-title": "Save new system viewpreset",
|
|
92
|
+
"workspace-admin-reset-workspace": "Reset",
|
|
93
|
+
"workspace-admin-reset-workspace-title": "Reset to original",
|
|
94
|
+
"workspace-dialog-delete-system": "Delete system workspace",
|
|
95
|
+
"workspace-dialog-confirm-delete-system": "The system workspace will be deleted, but all the view presets used will remain intact.",
|
|
96
|
+
"workspace-list-success-delete-system": "\"{{TITLE}}\" has been successfully removed from the system's workspaces."
|
|
90
97
|
};
|
|
91
98
|
var fi = {
|
|
92
99
|
"workspace-menu": "Workspace menu",
|
|
@@ -110,6 +117,7 @@ var fi = {
|
|
|
110
117
|
"workspace-dialog-name": "Nimi",
|
|
111
118
|
"workspace-dialog-abstract": "Tiivistelmä",
|
|
112
119
|
"workspace-dialog-confirm-delete-message": "Oletko varma, että haluat poistaa workspace presetin: \"{{TITLE}}\"?",
|
|
120
|
+
"workspace-dialog-confirm-reset-message": "ei käännetty",
|
|
113
121
|
"workspace-error-fetch": "Workspace listan hakeminen epäonnistui",
|
|
114
122
|
"workspace-error-fetch-detail": "Workspacen \"{{WORKSPACE_ID}}\" hakeminen epäonnistui",
|
|
115
123
|
"workspace-retry": "Yritä uudelleen",
|
|
@@ -136,6 +144,7 @@ var fi = {
|
|
|
136
144
|
"workspace-list-success-delete": "Workspace \"{{TITLE}}\" poistettu onnistuneesti",
|
|
137
145
|
"workspace-list-success-duplicate": "Workspace \"{{TITLE}}\" tallennettu onnistuneesti",
|
|
138
146
|
"workspace-list-success-edit": "Workspacea \"{{TITLE}}\" muokattu onnistuneesti",
|
|
147
|
+
"workspace-list-success-reset": "ei käännetty",
|
|
139
148
|
"workspace-list-success-save": "Workspace \"{{TITLE}}\" tallennettu onnistuneesti",
|
|
140
149
|
"workspace-save-error": "Workspacen \"{{TITLE}}\" tallentaminen epäonnistui",
|
|
141
150
|
"workspace-error-generic": "Jotain meni mönkään. Yritä uudelleen.",
|
|
@@ -148,7 +157,9 @@ var fi = {
|
|
|
148
157
|
"workspace-admin-select-modified-viewpresets": "ei käännetty",
|
|
149
158
|
"workspace-admin-save-new-viewpreset": "ei käännetty",
|
|
150
159
|
"workspace-admin-save-new-viewpreset-warning": "ei käännetty",
|
|
151
|
-
"workspace-admin-save-new-viewpreset-title": "ei käännetty"
|
|
160
|
+
"workspace-admin-save-new-viewpreset-title": "ei käännetty",
|
|
161
|
+
"workspace-admin-reset-workspace": "ei käännetty",
|
|
162
|
+
"workspace-admin-reset-workspace-title": "ei käännetty"
|
|
152
163
|
};
|
|
153
164
|
var no = {
|
|
154
165
|
"workspace-menu": "Arbeidsrommeny",
|
|
@@ -172,6 +183,7 @@ var no = {
|
|
|
172
183
|
"workspace-dialog-name": "Navn",
|
|
173
184
|
"workspace-dialog-abstract": "Abstrakt",
|
|
174
185
|
"workspace-dialog-confirm-delete-message": "Er du sikker på at du vil slette \"{{TITLE}}\" arbeidsrommet?",
|
|
186
|
+
"workspace-dialog-confirm-reset-message": "ikke oversatt",
|
|
175
187
|
"workspace-error-fetch": "Feilet i å hente liste over arbeidsrom",
|
|
176
188
|
"workspace-error-fetch-detail": "Feilet i å hente arbeidsrommet {{WORKSPACE_ID}}",
|
|
177
189
|
"workspace-viewpresets-error": "Presets er ikke tilgjengelig",
|
|
@@ -198,6 +210,7 @@ var no = {
|
|
|
198
210
|
"workspace-list-success-delete": "Arbeidsrom \"{{TITLE}}\" er slettet",
|
|
199
211
|
"workspace-list-success-duplicate": "Arbeidsrom \"{{TITLE}}\" er lagret",
|
|
200
212
|
"workspace-list-success-edit": "Arbeidsrom \"{{TITLE}}\" er endret",
|
|
213
|
+
"workspace-list-success-reset": "ikke oversatt",
|
|
201
214
|
"workspace-list-success-save": "Arbeidsrom \"{{TITLE}}\" er lagret",
|
|
202
215
|
"workspace-save-error": "Feilet i å lagre arbeidsrom \"{{TITLE}}\"",
|
|
203
216
|
"workspace-error-generic": "Noe feilet, prøv igjen",
|
|
@@ -210,7 +223,9 @@ var no = {
|
|
|
210
223
|
"workspace-admin-select-modified-viewpresets": "ikke oversatt",
|
|
211
224
|
"workspace-admin-save-new-viewpreset": "ikke oversatt",
|
|
212
225
|
"workspace-admin-save-new-viewpreset-warning": "ikke oversatt",
|
|
213
|
-
"workspace-admin-save-new-viewpreset-title": "ikke oversatt"
|
|
226
|
+
"workspace-admin-save-new-viewpreset-title": "ikke oversatt",
|
|
227
|
+
"workspace-admin-reset-workspace": "ikke oversatt",
|
|
228
|
+
"workspace-admin-reset-workspace-title": "ikke oversatt"
|
|
214
229
|
};
|
|
215
230
|
var nl = {
|
|
216
231
|
"workspace-menu": "Workspace menu",
|
|
@@ -234,6 +249,7 @@ var nl = {
|
|
|
234
249
|
"workspace-dialog-name": "Naam",
|
|
235
250
|
"workspace-dialog-abstract": "Abstract",
|
|
236
251
|
"workspace-dialog-confirm-delete-message": "Weet je zeker dat je workspace preset \"{{TITLE}}\" wilt verwijderen?",
|
|
252
|
+
"workspace-dialog-confirm-reset-message": "De systeem workspace zal worden hersteld en alle aanpassing zullen worden verwijderd. Weet je zeker dat je door wilt gaan?",
|
|
237
253
|
"workspace-error-fetch": "Ophalen workspace lijst mislukt",
|
|
238
254
|
"workspace-error-fetch-detail": "Ophalen workspace {{WORKSPACE_ID}} mislukt",
|
|
239
255
|
"workspace-viewpresets-error": "View presets niet beschikbaar",
|
|
@@ -260,6 +276,7 @@ var nl = {
|
|
|
260
276
|
"workspace-list-success-delete": "Workspace \"{{TITLE}}\" succesvol verwijderd",
|
|
261
277
|
"workspace-list-success-duplicate": "Workspace \"{{TITLE}}\" succesvol opgeslagen",
|
|
262
278
|
"workspace-list-success-edit": "Workspace \"{{TITLE}}\" succesvol aangepast",
|
|
279
|
+
"workspace-list-success-reset": "Workspace\"{{TITLE}}\" herstelt naar origineel ",
|
|
263
280
|
"workspace-list-success-save": "Workspace \"{{TITLE}}\" succesvol opgeslagen",
|
|
264
281
|
"workspace-save-error": "Workspace opslaan \"{{TITLE}}\" mislukt",
|
|
265
282
|
"workspace-error-generic": "Er is iets mis gegaan, probeer het opnieuw",
|
|
@@ -272,7 +289,12 @@ var nl = {
|
|
|
272
289
|
"workspace-admin-select-modified-viewpresets": "Selecteer de aangepaste systeem viewpresets in deze workspace die je wilt aanpassen.",
|
|
273
290
|
"workspace-admin-save-new-viewpreset": "Deze nieuwe viewpreset zal worden toegevoegd aan de systeem presets.",
|
|
274
291
|
"workspace-admin-save-new-viewpreset-warning": "Het opslaan van wijzigingen aan systeem presets kan leiden tot veranderingen in andere presets.",
|
|
275
|
-
"workspace-admin-save-new-viewpreset-title": "Opslaan als systeem viewpreset"
|
|
292
|
+
"workspace-admin-save-new-viewpreset-title": "Opslaan als systeem viewpreset",
|
|
293
|
+
"workspace-admin-reset-workspace": "Workspace herstellen",
|
|
294
|
+
"workspace-admin-reset-workspace-title": "Herstellen naar origineel",
|
|
295
|
+
"workspace-dialog-delete-system": "Verwijder systeem workspace",
|
|
296
|
+
"workspace-dialog-confirm-delete-system": "Deze systeem workspace zal worden verwijderd, maar alle gebruikte viewpresets zullen intact blijven.",
|
|
297
|
+
"workspace-list-success-delete-system": "\"{{TITLE}}\" is succesvol verwijderd uit de systeem workspaces."
|
|
276
298
|
};
|
|
277
299
|
var workspaceTranslations = {
|
|
278
300
|
en: en,
|
|
@@ -1704,22 +1726,22 @@ $$e({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }
|
|
|
1704
1726
|
}
|
|
1705
1727
|
});
|
|
1706
1728
|
|
|
1707
|
-
/* *
|
|
1708
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1709
|
-
* you may not use this file except in compliance with the License.
|
|
1710
|
-
* You may obtain a copy of the License at
|
|
1711
|
-
*
|
|
1712
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1713
|
-
*
|
|
1714
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1715
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1716
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1717
|
-
* See the License for the specific language governing permissions and
|
|
1718
|
-
* limitations under the License.
|
|
1719
|
-
*
|
|
1720
|
-
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
1721
|
-
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
1722
|
-
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
1729
|
+
/* *
|
|
1730
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1731
|
+
* you may not use this file except in compliance with the License.
|
|
1732
|
+
* You may obtain a copy of the License at
|
|
1733
|
+
*
|
|
1734
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1735
|
+
*
|
|
1736
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1737
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1738
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1739
|
+
* See the License for the specific language governing permissions and
|
|
1740
|
+
* limitations under the License.
|
|
1741
|
+
*
|
|
1742
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
1743
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
1744
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
1723
1745
|
* */
|
|
1724
1746
|
var WorkspacePresetAction;
|
|
1725
1747
|
(function (WorkspacePresetAction) {
|
|
@@ -1730,6 +1752,8 @@ var WorkspacePresetAction;
|
|
|
1730
1752
|
WorkspacePresetAction["SAVE_ALL"] = "SAVE_ALL";
|
|
1731
1753
|
WorkspacePresetAction["DUPLICATE"] = "DUPLICATE";
|
|
1732
1754
|
WorkspacePresetAction["SAVE_SYSTEM_PRESET"] = "SAVE_SYSTEM_PRESET";
|
|
1755
|
+
WorkspacePresetAction["RESET"] = "RESET";
|
|
1756
|
+
WorkspacePresetAction["DELETE_SYSTEM_PRESET"] = "DELETE_SYSTEM_PRESET";
|
|
1733
1757
|
})(WorkspacePresetAction || (WorkspacePresetAction = {}));
|
|
1734
1758
|
var WorkspaceErrorType;
|
|
1735
1759
|
(function (WorkspaceErrorType) {
|
|
@@ -1790,6 +1814,20 @@ const slice$3 = createSlice({
|
|
|
1790
1814
|
isFetching: false
|
|
1791
1815
|
});
|
|
1792
1816
|
},
|
|
1817
|
+
onSuccessWorkspaceSaveDialog: (draft,
|
|
1818
|
+
// eslint-disable-next-line no-unused-vars
|
|
1819
|
+
action) => {
|
|
1820
|
+
if (!draft.workspaceActionDialog) {
|
|
1821
|
+
return;
|
|
1822
|
+
}
|
|
1823
|
+
const {
|
|
1824
|
+
presetId
|
|
1825
|
+
} = action.payload;
|
|
1826
|
+
if (presetId) {
|
|
1827
|
+
draft.workspaceActionDialog.presetId = presetId;
|
|
1828
|
+
}
|
|
1829
|
+
draft.workspaceActionDialog.hasSaved = true;
|
|
1830
|
+
},
|
|
1793
1831
|
submitFormWorkspaceActionDialogOptions: (draft,
|
|
1794
1832
|
// eslint-disable-next-line no-unused-vars
|
|
1795
1833
|
action) => {
|
|
@@ -2856,10 +2894,10 @@ const getViewType$1 = (numViews, firstViewComponentType) => {
|
|
|
2856
2894
|
// no views
|
|
2857
2895
|
return undefined;
|
|
2858
2896
|
};
|
|
2859
|
-
/**
|
|
2860
|
-
* Get all view ids from the mosaicnode state
|
|
2861
|
-
* @param mNode MosaicNode state
|
|
2862
|
-
* @returns List if string ids of all mosaic nodes.
|
|
2897
|
+
/**
|
|
2898
|
+
* Get all view ids from the mosaicnode state
|
|
2899
|
+
* @param mNode MosaicNode state
|
|
2900
|
+
* @returns List if string ids of all mosaic nodes.
|
|
2863
2901
|
*/
|
|
2864
2902
|
const makeListOfViewIds = mNode => {
|
|
2865
2903
|
return getLeaves(mNode);
|
|
@@ -3030,12 +3068,14 @@ const slice$2 = createSlice({
|
|
|
3030
3068
|
},
|
|
3031
3069
|
savedViewPreset: (draft, action) => {
|
|
3032
3070
|
const {
|
|
3033
|
-
panelId
|
|
3071
|
+
panelId,
|
|
3072
|
+
viewPresetId
|
|
3034
3073
|
} = action.payload;
|
|
3035
3074
|
const entity = draft.entities[panelId];
|
|
3036
3075
|
if (entity) {
|
|
3037
3076
|
entity.isFetching = false;
|
|
3038
3077
|
entity.hasChanges = false;
|
|
3078
|
+
entity.activeViewPresetId = viewPresetId;
|
|
3039
3079
|
viewPresetsAdapter.setOne(draft, entity);
|
|
3040
3080
|
}
|
|
3041
3081
|
},
|
|
@@ -3215,6 +3255,18 @@ const slice$2 = createSlice({
|
|
|
3215
3255
|
viewPresetsAdapter.setOne(draft, entity);
|
|
3216
3256
|
}
|
|
3217
3257
|
});
|
|
3258
|
+
builder.addCase(workspaceListActions.submitFormWorkspaceActionDialogOptions, (draft, action) => {
|
|
3259
|
+
const {
|
|
3260
|
+
data
|
|
3261
|
+
} = action.payload;
|
|
3262
|
+
if (data.views) {
|
|
3263
|
+
data.views.forEach(view => {
|
|
3264
|
+
if (draft.entities[view.mosaicNodeId]) {
|
|
3265
|
+
draft.entities[view.mosaicNodeId].error = undefined;
|
|
3266
|
+
}
|
|
3267
|
+
});
|
|
3268
|
+
}
|
|
3269
|
+
});
|
|
3218
3270
|
syncGroupChangeActions.map(syncGroupAction => builder.addCase(syncGroupAction, (draft, action) => {
|
|
3219
3271
|
const {
|
|
3220
3272
|
origin,
|
|
@@ -3555,22 +3607,22 @@ fixRegExpWellKnownSymbolLogic$2('split', function (SPLIT, nativeSplit, maybeCall
|
|
|
3555
3607
|
];
|
|
3556
3608
|
}, BUGGY || !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y);
|
|
3557
3609
|
|
|
3558
|
-
/* *
|
|
3559
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
3560
|
-
* you may not use this file except in compliance with the License.
|
|
3561
|
-
* You may obtain a copy of the License at
|
|
3562
|
-
*
|
|
3563
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
3564
|
-
*
|
|
3565
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
3566
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
3567
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3568
|
-
* See the License for the specific language governing permissions and
|
|
3569
|
-
* limitations under the License.
|
|
3570
|
-
*
|
|
3571
|
-
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
3572
|
-
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
3573
|
-
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
3610
|
+
/* *
|
|
3611
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
3612
|
+
* you may not use this file except in compliance with the License.
|
|
3613
|
+
* You may obtain a copy of the License at
|
|
3614
|
+
*
|
|
3615
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
3616
|
+
*
|
|
3617
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3618
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
3619
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3620
|
+
* See the License for the specific language governing permissions and
|
|
3621
|
+
* limitations under the License.
|
|
3622
|
+
*
|
|
3623
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
3624
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
3625
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
3574
3626
|
* */
|
|
3575
3627
|
const getCleanSearchQuery = searchQuery => searchQuery.trim().split(/\s+/).join();
|
|
3576
3628
|
const getPresetTitle = (title, hasChanges, isNew, t) => {
|
|
@@ -3633,25 +3685,61 @@ const getSnackbarMessage$1 = (action, title) => {
|
|
|
3633
3685
|
const trimmedTitle = `${title.trim()}`;
|
|
3634
3686
|
switch (action) {
|
|
3635
3687
|
case WorkspacePresetAction.SAVE_ALL:
|
|
3636
|
-
return
|
|
3637
|
-
|
|
3638
|
-
|
|
3688
|
+
return {
|
|
3689
|
+
type: snackbarTypes.SnackbarMessageType.TRANSLATABLE_MESSAGE,
|
|
3690
|
+
key: 'workspace-list-success-save-all',
|
|
3691
|
+
params: {
|
|
3692
|
+
TITLE: trimmedTitle
|
|
3693
|
+
}
|
|
3694
|
+
};
|
|
3639
3695
|
case WorkspacePresetAction.DELETE:
|
|
3640
|
-
return
|
|
3641
|
-
|
|
3642
|
-
|
|
3696
|
+
return {
|
|
3697
|
+
type: snackbarTypes.SnackbarMessageType.TRANSLATABLE_MESSAGE,
|
|
3698
|
+
key: 'workspace-list-success-delete',
|
|
3699
|
+
params: {
|
|
3700
|
+
TITLE: trimmedTitle
|
|
3701
|
+
}
|
|
3702
|
+
};
|
|
3703
|
+
case WorkspacePresetAction.DELETE_SYSTEM_PRESET:
|
|
3704
|
+
return {
|
|
3705
|
+
type: snackbarTypes.SnackbarMessageType.TRANSLATABLE_MESSAGE,
|
|
3706
|
+
key: 'workspace-list-success-delete-system',
|
|
3707
|
+
params: {
|
|
3708
|
+
TITLE: trimmedTitle
|
|
3709
|
+
}
|
|
3710
|
+
};
|
|
3643
3711
|
case WorkspacePresetAction.DUPLICATE:
|
|
3644
|
-
return
|
|
3645
|
-
|
|
3646
|
-
|
|
3712
|
+
return {
|
|
3713
|
+
type: snackbarTypes.SnackbarMessageType.TRANSLATABLE_MESSAGE,
|
|
3714
|
+
key: 'workspace-list-success-duplicate',
|
|
3715
|
+
params: {
|
|
3716
|
+
TITLE: trimmedTitle
|
|
3717
|
+
}
|
|
3718
|
+
};
|
|
3647
3719
|
case WorkspacePresetAction.EDIT:
|
|
3648
|
-
return
|
|
3649
|
-
|
|
3650
|
-
|
|
3720
|
+
return {
|
|
3721
|
+
type: snackbarTypes.SnackbarMessageType.TRANSLATABLE_MESSAGE,
|
|
3722
|
+
key: 'workspace-list-success-edit',
|
|
3723
|
+
params: {
|
|
3724
|
+
TITLE: trimmedTitle
|
|
3725
|
+
}
|
|
3726
|
+
};
|
|
3727
|
+
case WorkspacePresetAction.RESET:
|
|
3728
|
+
return {
|
|
3729
|
+
type: snackbarTypes.SnackbarMessageType.TRANSLATABLE_MESSAGE,
|
|
3730
|
+
key: 'workspace-list-success-reset',
|
|
3731
|
+
params: {
|
|
3732
|
+
TITLE: trimmedTitle
|
|
3733
|
+
}
|
|
3734
|
+
};
|
|
3651
3735
|
default:
|
|
3652
|
-
return
|
|
3653
|
-
|
|
3654
|
-
|
|
3736
|
+
return {
|
|
3737
|
+
type: snackbarTypes.SnackbarMessageType.TRANSLATABLE_MESSAGE,
|
|
3738
|
+
key: 'workspace-list-success-save',
|
|
3739
|
+
params: {
|
|
3740
|
+
TITLE: trimmedTitle
|
|
3741
|
+
}
|
|
3742
|
+
};
|
|
3655
3743
|
}
|
|
3656
3744
|
};
|
|
3657
3745
|
const getEmptyWorkspaceListItem = () => ({
|
|
@@ -3940,12 +4028,12 @@ const slice$1 = createSlice({
|
|
|
3940
4028
|
},
|
|
3941
4029
|
extraReducers: builder => {
|
|
3942
4030
|
builder.addCase(workspaceListActions.onSuccessWorkspacePresetAction, (draft, action) => {
|
|
3943
|
-
if (action.payload.action === WorkspacePresetAction.SAVE_AS || action.payload.action === WorkspacePresetAction.SAVE_ALL) {
|
|
4031
|
+
if (action.payload.action === WorkspacePresetAction.SAVE_AS || action.payload.action === WorkspacePresetAction.SAVE_ALL || action.payload.action === WorkspacePresetAction.SAVE_SYSTEM_PRESET) {
|
|
3944
4032
|
draft.id = action.payload.workspaceId;
|
|
3945
4033
|
draft.title = action.payload.title;
|
|
3946
4034
|
draft.abstract = action.payload.abstract;
|
|
3947
4035
|
draft.hasChanges = false;
|
|
3948
|
-
draft.scope = 'user';
|
|
4036
|
+
draft.scope = action.payload.scope || 'user';
|
|
3949
4037
|
}
|
|
3950
4038
|
if (action.payload.action === WorkspacePresetAction.SAVE) {
|
|
3951
4039
|
draft.hasChanges = false;
|
|
@@ -3956,7 +4044,7 @@ const slice$1 = createSlice({
|
|
|
3956
4044
|
}
|
|
3957
4045
|
// If current selected workspace is deleted
|
|
3958
4046
|
// Remove the id, rename to empty workspace and set it has changes
|
|
3959
|
-
if (action.payload.action === WorkspacePresetAction.DELETE && action.payload.workspaceId === draft.id) {
|
|
4047
|
+
if ((action.payload.action === WorkspacePresetAction.DELETE || action.payload.action === WorkspacePresetAction.DELETE_SYSTEM_PRESET) && action.payload.workspaceId === draft.id) {
|
|
3960
4048
|
delete draft.id;
|
|
3961
4049
|
draft.title = emptyMapWorkspace.title;
|
|
3962
4050
|
draft.abstract = emptyMapWorkspace.abstract;
|
|
@@ -4077,21 +4165,37 @@ const getSnackbarMessage = (action, title) => {
|
|
|
4077
4165
|
const trimmedTitle = title.trim();
|
|
4078
4166
|
switch (action) {
|
|
4079
4167
|
case PresetAction.DELETE:
|
|
4080
|
-
return
|
|
4081
|
-
|
|
4082
|
-
|
|
4168
|
+
return {
|
|
4169
|
+
key: 'workspace-viewpreset-success-delete',
|
|
4170
|
+
type: snackbarTypes.SnackbarMessageType.TRANSLATABLE_MESSAGE,
|
|
4171
|
+
params: {
|
|
4172
|
+
TITLE: trimmedTitle
|
|
4173
|
+
}
|
|
4174
|
+
};
|
|
4083
4175
|
case PresetAction.SAVE_AS:
|
|
4084
|
-
return
|
|
4085
|
-
|
|
4086
|
-
|
|
4176
|
+
return {
|
|
4177
|
+
key: 'workspace-viewpreset-success-save-as',
|
|
4178
|
+
type: snackbarTypes.SnackbarMessageType.TRANSLATABLE_MESSAGE,
|
|
4179
|
+
params: {
|
|
4180
|
+
TITLE: trimmedTitle
|
|
4181
|
+
}
|
|
4182
|
+
};
|
|
4087
4183
|
case PresetAction.EDIT:
|
|
4088
|
-
return
|
|
4089
|
-
|
|
4090
|
-
|
|
4184
|
+
return {
|
|
4185
|
+
key: 'workspace-viewpreset-success-edit',
|
|
4186
|
+
type: snackbarTypes.SnackbarMessageType.TRANSLATABLE_MESSAGE,
|
|
4187
|
+
params: {
|
|
4188
|
+
TITLE: trimmedTitle
|
|
4189
|
+
}
|
|
4190
|
+
};
|
|
4091
4191
|
default:
|
|
4092
|
-
return
|
|
4093
|
-
|
|
4094
|
-
|
|
4192
|
+
return {
|
|
4193
|
+
key: 'workspace-viewpreset-success-save',
|
|
4194
|
+
type: snackbarTypes.SnackbarMessageType.TRANSLATABLE_MESSAGE,
|
|
4195
|
+
params: {
|
|
4196
|
+
TITLE: trimmedTitle
|
|
4197
|
+
}
|
|
4198
|
+
};
|
|
4095
4199
|
}
|
|
4096
4200
|
};
|
|
4097
4201
|
const emptyViewPreset = (componentType = 'Map') => {
|
|
@@ -4153,82 +4257,82 @@ const constructFilterParams = (filters, searchQuery) => {
|
|
|
4153
4257
|
};
|
|
4154
4258
|
|
|
4155
4259
|
const workspaceStore = store => (store === null || store === void 0 ? void 0 : store.workspace) || initialState$1;
|
|
4156
|
-
/**
|
|
4157
|
-
* Gets workspace state
|
|
4158
|
-
*
|
|
4159
|
-
* @param {object} store store: object - Store object
|
|
4160
|
-
* @returns {object} returnType: WorkspaceState
|
|
4260
|
+
/**
|
|
4261
|
+
* Gets workspace state
|
|
4262
|
+
*
|
|
4263
|
+
* @param {object} store store: object - Store object
|
|
4264
|
+
* @returns {object} returnType: WorkspaceState
|
|
4161
4265
|
*/
|
|
4162
4266
|
const getWorkspaceState = createSelector(workspaceStore, store => store || initialState$1, selectorMemoizationOptions);
|
|
4163
|
-
/**
|
|
4164
|
-
* Gets intialViewMapPreset from workspace state
|
|
4165
|
-
*
|
|
4166
|
-
* @param {object} store store: object - Store object
|
|
4167
|
-
* @returns {MapPreset | undefined} returnType: MapPreset
|
|
4267
|
+
/**
|
|
4268
|
+
* Gets intialViewMapPreset from workspace state
|
|
4269
|
+
*
|
|
4270
|
+
* @param {object} store store: object - Store object
|
|
4271
|
+
* @returns {MapPreset | undefined} returnType: MapPreset
|
|
4168
4272
|
*/
|
|
4169
4273
|
const getInitialViewMapPreset = createSelector(getWorkspaceState, state => state && state.intialViewMapPreset, selectorMemoizationOptions);
|
|
4170
|
-
/**
|
|
4171
|
-
* Gets mosaicNode from workspace state
|
|
4172
|
-
*
|
|
4173
|
-
* @param {object} store store: object - Store object
|
|
4174
|
-
* @returns {MosaicNode<string>} returnType: MosaicNode<string>
|
|
4274
|
+
/**
|
|
4275
|
+
* Gets mosaicNode from workspace state
|
|
4276
|
+
*
|
|
4277
|
+
* @param {object} store store: object - Store object
|
|
4278
|
+
* @returns {MosaicNode<string>} returnType: MosaicNode<string>
|
|
4175
4279
|
*/
|
|
4176
4280
|
const getMosaicNode = createSelector(getWorkspaceState, state => state && state.mosaicNode, selectorMemoizationOptions);
|
|
4177
|
-
/**
|
|
4178
|
-
* Gets view from workspace state
|
|
4179
|
-
*
|
|
4180
|
-
* @param {object} store store: object - Store object
|
|
4181
|
-
* @param {string} viewId viewId: string - view id
|
|
4182
|
-
* @returns {object} returnType: WorkspaceViewType
|
|
4281
|
+
/**
|
|
4282
|
+
* Gets view from workspace state
|
|
4283
|
+
*
|
|
4284
|
+
* @param {object} store store: object - Store object
|
|
4285
|
+
* @param {string} viewId viewId: string - view id
|
|
4286
|
+
* @returns {object} returnType: WorkspaceViewType
|
|
4183
4287
|
*/
|
|
4184
4288
|
const getViewById = createSelector(getWorkspaceState, (store, viewId) => viewId, (store, viewId) => {
|
|
4185
4289
|
var _a, _b;
|
|
4186
4290
|
return (_b = (_a = store === null || store === void 0 ? void 0 : store.views) === null || _a === void 0 ? void 0 : _a.byId) === null || _b === void 0 ? void 0 : _b[viewId];
|
|
4187
4291
|
}, selectorMemoizationOptions);
|
|
4188
|
-
/**
|
|
4189
|
-
* Gets all view ids
|
|
4190
|
-
*
|
|
4191
|
-
* @param {object} store store: object - Store object
|
|
4192
|
-
* @returns {object} returnType: string[]
|
|
4292
|
+
/**
|
|
4293
|
+
* Gets all view ids
|
|
4294
|
+
*
|
|
4295
|
+
* @param {object} store store: object - Store object
|
|
4296
|
+
* @returns {object} returnType: string[]
|
|
4193
4297
|
*/
|
|
4194
4298
|
const getViewIds = createSelector(getWorkspaceState, store => store.views.allIds || [], selectorMemoizationOptions);
|
|
4195
|
-
/**
|
|
4196
|
-
* Gets getShouldPreventClose from workspace state
|
|
4197
|
-
*
|
|
4198
|
-
* @param {object} store store: object - Store object
|
|
4199
|
-
* @param {string} viewId viewId: string - view id
|
|
4200
|
-
* @returns {boolean} returnType: boolean
|
|
4299
|
+
/**
|
|
4300
|
+
* Gets getShouldPreventClose from workspace state
|
|
4301
|
+
*
|
|
4302
|
+
* @param {object} store store: object - Store object
|
|
4303
|
+
* @param {string} viewId viewId: string - view id
|
|
4304
|
+
* @returns {boolean} returnType: boolean
|
|
4201
4305
|
*/
|
|
4202
4306
|
const getShouldPreventClose = createSelector(getViewById, store => (store === null || store === void 0 ? void 0 : store.shouldPreventClose) || false, selectorMemoizationOptions);
|
|
4203
4307
|
const isWorkspaceLoading = createSelector(getWorkspaceState, store => (store === null || store === void 0 ? void 0 : store.isLoading) || false, selectorMemoizationOptions);
|
|
4204
4308
|
const getWorkspaceError = createSelector(getWorkspaceState, store => store === null || store === void 0 ? void 0 : store.error, selectorMemoizationOptions);
|
|
4205
|
-
/**
|
|
4206
|
-
* Gets selected workspace title
|
|
4207
|
-
*
|
|
4208
|
-
* @param {object} store store: object - Store object
|
|
4209
|
-
* @returns {string} returnType: string
|
|
4309
|
+
/**
|
|
4310
|
+
* Gets selected workspace title
|
|
4311
|
+
*
|
|
4312
|
+
* @param {object} store store: object - Store object
|
|
4313
|
+
* @returns {string} returnType: string
|
|
4210
4314
|
*/
|
|
4211
4315
|
const getSelectedWorkspaceTitle = createSelector(workspaceStore, store => store && store.title || '', selectorMemoizationOptions);
|
|
4212
4316
|
const hasWorkspaceChanges = createSelector(getWorkspaceState, store => (store === null || store === void 0 ? void 0 : store.hasChanges) || false, selectorMemoizationOptions);
|
|
4213
|
-
/**
|
|
4214
|
-
* Gets selected viewType
|
|
4215
|
-
*
|
|
4216
|
-
* @param {object} store store: object - Store object
|
|
4217
|
-
* @returns {string} returnType: string
|
|
4317
|
+
/**
|
|
4318
|
+
* Gets selected viewType
|
|
4319
|
+
*
|
|
4320
|
+
* @param {object} store store: object - Store object
|
|
4321
|
+
* @returns {string} returnType: string
|
|
4218
4322
|
*/
|
|
4219
4323
|
const getViewType = createSelector(getWorkspaceState, store => (store === null || store === void 0 ? void 0 : store.viewType) || '', selectorMemoizationOptions);
|
|
4220
|
-
/**
|
|
4221
|
-
* Gets selected workspace scope
|
|
4222
|
-
*
|
|
4223
|
-
* @param {object} store store: object - Store object
|
|
4224
|
-
* @returns {string} returnType: string
|
|
4324
|
+
/**
|
|
4325
|
+
* Gets selected workspace scope
|
|
4326
|
+
*
|
|
4327
|
+
* @param {object} store store: object - Store object
|
|
4328
|
+
* @returns {string} returnType: string
|
|
4225
4329
|
*/
|
|
4226
4330
|
const getSelectedWorkspaceScope = createSelector(workspaceStore, store => store && store.scope || 'system', selectorMemoizationOptions);
|
|
4227
|
-
/**
|
|
4228
|
-
* Gets workspace data to send to the backend
|
|
4229
|
-
*
|
|
4230
|
-
* @param {object} store store: object - Store object
|
|
4231
|
-
* @returns {object} returnType: object - WorkspacePresetFromBE
|
|
4331
|
+
/**
|
|
4332
|
+
* Gets workspace data to send to the backend
|
|
4333
|
+
*
|
|
4334
|
+
* @param {object} store store: object - Store object
|
|
4335
|
+
* @returns {object} returnType: object - WorkspacePresetFromBE
|
|
4232
4336
|
*/
|
|
4233
4337
|
const getWorkspaceData = createSelector(getWorkspaceState, getViewPresetsStore, genericSelectors.getSynchronizationGroupStore, (store, mapPresetStore, syncGroupsStore) => {
|
|
4234
4338
|
const syncGroups = (syncGroupsStore === null || syncGroupsStore === void 0 ? void 0 : syncGroupsStore.groups.allIds.map(id => {
|
|
@@ -4261,7 +4365,7 @@ const getWorkspaceData = createSelector(getWorkspaceState, getViewPresetsStore,
|
|
|
4261
4365
|
}, selectorMemoizationOptions);
|
|
4262
4366
|
const getViewComponentType = createSelector(getViewById, store => (store === null || store === void 0 ? void 0 : store.componentType) || 'Map', selectorMemoizationOptions);
|
|
4263
4367
|
const getViewPresetToSendToBackend = createSelector(getViewById, getViewComponentType, mapSelectors.getMapPreset, syncGroupsSelectors.getAllTargetGroupsForSource, timeSeriesSelectors.getTimeSeriesPreset, (workspaceView, viewComponentType, mapPreset, syncGroupsIds, timeSeriesPreset) => {
|
|
4264
|
-
const title =
|
|
4368
|
+
const title = workspaceView === null || workspaceView === void 0 ? void 0 : workspaceView.title;
|
|
4265
4369
|
const scope = (workspaceView === null || workspaceView === void 0 ? void 0 : workspaceView.scope) || 'system';
|
|
4266
4370
|
const defaultInitialProps = {
|
|
4267
4371
|
mapPreset,
|
|
@@ -4298,22 +4402,22 @@ var selectors$1 = /*#__PURE__*/Object.freeze({
|
|
|
4298
4402
|
isWorkspaceLoading: isWorkspaceLoading
|
|
4299
4403
|
});
|
|
4300
4404
|
|
|
4301
|
-
/* *
|
|
4302
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4303
|
-
* you may not use this file except in compliance with the License.
|
|
4304
|
-
* You may obtain a copy of the License at
|
|
4305
|
-
*
|
|
4306
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
4307
|
-
*
|
|
4308
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
4309
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
4310
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4311
|
-
* See the License for the specific language governing permissions and
|
|
4312
|
-
* limitations under the License.
|
|
4313
|
-
*
|
|
4314
|
-
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
4315
|
-
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
4316
|
-
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
4405
|
+
/* *
|
|
4406
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4407
|
+
* you may not use this file except in compliance with the License.
|
|
4408
|
+
* You may obtain a copy of the License at
|
|
4409
|
+
*
|
|
4410
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
4411
|
+
*
|
|
4412
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
4413
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
4414
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4415
|
+
* See the License for the specific language governing permissions and
|
|
4416
|
+
* limitations under the License.
|
|
4417
|
+
*
|
|
4418
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
4419
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
4420
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
4317
4421
|
* */
|
|
4318
4422
|
const viewPresetsListAdapter = createEntityAdapter();
|
|
4319
4423
|
const initialState = viewPresetsListAdapter.getInitialState();
|
|
@@ -4397,25 +4501,8 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
4397
4501
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
4398
4502
|
};
|
|
4399
4503
|
|
|
4400
|
-
/* *
|
|
4401
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4402
|
-
* you may not use this file except in compliance with the License.
|
|
4403
|
-
* You may obtain a copy of the License at
|
|
4404
|
-
*
|
|
4405
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
4406
|
-
*
|
|
4407
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
4408
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
4409
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4410
|
-
* See the License for the specific language governing permissions and
|
|
4411
|
-
* limitations under the License.
|
|
4412
|
-
*
|
|
4413
|
-
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
4414
|
-
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
4415
|
-
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
4416
|
-
* */
|
|
4417
4504
|
const processError = (error, component, errorMessageKey) => {
|
|
4418
|
-
const message = isAxiosError(error) ? getAxiosErrorMessage(error) :
|
|
4505
|
+
const message = isAxiosError(error) ? getAxiosErrorMessage(error) : errorMessageKey;
|
|
4419
4506
|
const errorType = isAxiosAuthError(error) ? ViewPresetErrorType.AUTH : ViewPresetErrorType.GENERIC;
|
|
4420
4507
|
return {
|
|
4421
4508
|
message,
|
|
@@ -4476,36 +4563,69 @@ viewPresetsListener.startListening({
|
|
|
4476
4563
|
}
|
|
4477
4564
|
})
|
|
4478
4565
|
});
|
|
4566
|
+
const saveViewPresetAsEffect = ({
|
|
4567
|
+
payload
|
|
4568
|
+
}, listenerApi) => __awaiter(void 0, void 0, void 0, function* () {
|
|
4569
|
+
listenerApi.cancelActiveListeners();
|
|
4570
|
+
const {
|
|
4571
|
+
panelId,
|
|
4572
|
+
viewPreset
|
|
4573
|
+
} = payload;
|
|
4574
|
+
try {
|
|
4575
|
+
const workspaceApi = getWorkspaceApi();
|
|
4576
|
+
const viewPresetId = yield workspaceApi.saveViewPresetAs(viewPreset);
|
|
4577
|
+
listenerApi.dispatch(snackbarActions.openSnackbar(getSnackbarMessage(PresetAction.SAVE, viewPreset.title)));
|
|
4578
|
+
listenerApi.dispatch(viewPresetActions.savedViewPreset({
|
|
4579
|
+
panelId,
|
|
4580
|
+
viewPresetId
|
|
4581
|
+
}));
|
|
4582
|
+
listenerApi.dispatch(viewPresetActions.fetchedViewPreset({
|
|
4583
|
+
panelId,
|
|
4584
|
+
viewPresetId,
|
|
4585
|
+
viewPreset
|
|
4586
|
+
}));
|
|
4587
|
+
return Object.assign(Object.assign({}, viewPreset), {
|
|
4588
|
+
id: viewPresetId
|
|
4589
|
+
});
|
|
4590
|
+
} catch (error) {
|
|
4591
|
+
listenerApi.dispatch(viewPresetActions.errorViewPreset({
|
|
4592
|
+
error: processError(error, ViewPresetErrorComponent.PRESET_DETAIL, 'workspace-mappreset-error-save'),
|
|
4593
|
+
panelId
|
|
4594
|
+
}));
|
|
4595
|
+
return error;
|
|
4596
|
+
}
|
|
4597
|
+
});
|
|
4598
|
+
const saveViewPresetEffect = ({
|
|
4599
|
+
payload
|
|
4600
|
+
}, listenerApi) => __awaiter(void 0, void 0, void 0, function* () {
|
|
4601
|
+
listenerApi.cancelActiveListeners();
|
|
4602
|
+
const {
|
|
4603
|
+
panelId,
|
|
4604
|
+
viewPreset,
|
|
4605
|
+
viewPresetId
|
|
4606
|
+
} = payload;
|
|
4607
|
+
try {
|
|
4608
|
+
const workspaceApi = getWorkspaceApi();
|
|
4609
|
+
yield workspaceApi.saveViewPreset(viewPresetId, viewPreset);
|
|
4610
|
+
listenerApi.dispatch(snackbarActions.openSnackbar(getSnackbarMessage(PresetAction.SAVE, viewPreset.title)));
|
|
4611
|
+
listenerApi.dispatch(viewPresetActions.savedViewPreset({
|
|
4612
|
+
panelId,
|
|
4613
|
+
viewPresetId
|
|
4614
|
+
}));
|
|
4615
|
+
return viewPreset;
|
|
4616
|
+
} catch (error) {
|
|
4617
|
+
listenerApi.dispatch(viewPresetActions.errorViewPreset({
|
|
4618
|
+
error: processError(error, ViewPresetErrorComponent.PRESET_DETAIL, 'workspace-mappreset-error-save'),
|
|
4619
|
+
panelId,
|
|
4620
|
+
viewPresetId
|
|
4621
|
+
}));
|
|
4622
|
+
return error;
|
|
4623
|
+
}
|
|
4624
|
+
});
|
|
4479
4625
|
// save view preset
|
|
4480
4626
|
viewPresetsListener.startListening({
|
|
4481
4627
|
actionCreator: viewPresetActions.saveViewPreset,
|
|
4482
|
-
effect:
|
|
4483
|
-
payload
|
|
4484
|
-
}, listenerApi) => __awaiter(void 0, void 0, void 0, function* () {
|
|
4485
|
-
listenerApi.cancelActiveListeners();
|
|
4486
|
-
const {
|
|
4487
|
-
panelId,
|
|
4488
|
-
viewPreset,
|
|
4489
|
-
viewPresetId
|
|
4490
|
-
} = payload;
|
|
4491
|
-
try {
|
|
4492
|
-
const workspaceApi = getWorkspaceApi();
|
|
4493
|
-
yield workspaceApi.saveViewPreset(viewPresetId, viewPreset);
|
|
4494
|
-
listenerApi.dispatch(snackbarActions.openSnackbar({
|
|
4495
|
-
message: getSnackbarMessage(PresetAction.SAVE, viewPreset.title)
|
|
4496
|
-
}));
|
|
4497
|
-
listenerApi.dispatch(viewPresetActions.savedViewPreset({
|
|
4498
|
-
panelId,
|
|
4499
|
-
viewPresetId
|
|
4500
|
-
}));
|
|
4501
|
-
} catch (error) {
|
|
4502
|
-
listenerApi.dispatch(viewPresetActions.errorViewPreset({
|
|
4503
|
-
error: processError(error, ViewPresetErrorComponent.PRESET_DETAIL, 'workspace-mappreset-error-save'),
|
|
4504
|
-
panelId,
|
|
4505
|
-
viewPresetId
|
|
4506
|
-
}));
|
|
4507
|
-
}
|
|
4508
|
-
})
|
|
4628
|
+
effect: saveViewPresetEffect
|
|
4509
4629
|
});
|
|
4510
4630
|
// select view preset
|
|
4511
4631
|
viewPresetsListener.startListening({
|
|
@@ -4563,9 +4683,7 @@ viewPresetsListener.startListening({
|
|
|
4563
4683
|
panelId
|
|
4564
4684
|
} = payload;
|
|
4565
4685
|
try {
|
|
4566
|
-
listenerApi.dispatch(snackbarActions.openSnackbar(
|
|
4567
|
-
message: getSnackbarMessage(action, title)
|
|
4568
|
-
}));
|
|
4686
|
+
listenerApi.dispatch(snackbarActions.openSnackbar(getSnackbarMessage(action, title)));
|
|
4569
4687
|
const activeMapPresetId = getViewPresetActiveId(listenerApi.getState(), panelId);
|
|
4570
4688
|
// if active preset has been deleted, select the empty new preset
|
|
4571
4689
|
if (action === PresetAction.DELETE && viewPresetId === activeMapPresetId) {
|
|
@@ -6024,22 +6142,22 @@ fixRegExpWellKnownSymbolLogic$1('replace', function (_, nativeReplace, maybeCall
|
|
|
6024
6142
|
];
|
|
6025
6143
|
}, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
|
|
6026
6144
|
|
|
6027
|
-
/* *
|
|
6028
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6029
|
-
* you may not use this file except in compliance with the License.
|
|
6030
|
-
* You may obtain a copy of the License at
|
|
6031
|
-
*
|
|
6032
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
6033
|
-
*
|
|
6034
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
6035
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
6036
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6037
|
-
* See the License for the specific language governing permissions and
|
|
6038
|
-
* limitations under the License.
|
|
6039
|
-
*
|
|
6040
|
-
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6041
|
-
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
6042
|
-
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
6145
|
+
/* *
|
|
6146
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6147
|
+
* you may not use this file except in compliance with the License.
|
|
6148
|
+
* You may obtain a copy of the License at
|
|
6149
|
+
*
|
|
6150
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
6151
|
+
*
|
|
6152
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
6153
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
6154
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6155
|
+
* See the License for the specific language governing permissions and
|
|
6156
|
+
* limitations under the License.
|
|
6157
|
+
*
|
|
6158
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6159
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
6160
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
6043
6161
|
* */
|
|
6044
6162
|
const routes = {
|
|
6045
6163
|
root: '/',
|
|
@@ -8726,7 +8844,7 @@ workspaceListener.startListening({
|
|
|
8726
8844
|
listenerApi.cancelActiveListeners();
|
|
8727
8845
|
// Delay before starting actual work
|
|
8728
8846
|
yield listenerApi.delay(100);
|
|
8729
|
-
/* This will trigger all maps and other components
|
|
8847
|
+
/* This will trigger all maps and other components
|
|
8730
8848
|
to get the correct size after views are updated */
|
|
8731
8849
|
window.dispatchEvent(new Event('resize'));
|
|
8732
8850
|
})
|
|
@@ -8835,27 +8953,32 @@ if ($stringify) {
|
|
|
8835
8953
|
});
|
|
8836
8954
|
}
|
|
8837
8955
|
|
|
8838
|
-
/* *
|
|
8839
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8840
|
-
* you may not use this file except in compliance with the License.
|
|
8841
|
-
* You may obtain a copy of the License at
|
|
8842
|
-
*
|
|
8843
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8844
|
-
*
|
|
8845
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
8846
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
8847
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
8848
|
-
* See the License for the specific language governing permissions and
|
|
8849
|
-
* limitations under the License.
|
|
8850
|
-
*
|
|
8851
|
-
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8852
|
-
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
8853
|
-
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
8956
|
+
/* *
|
|
8957
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8958
|
+
* you may not use this file except in compliance with the License.
|
|
8959
|
+
* You may obtain a copy of the License at
|
|
8960
|
+
*
|
|
8961
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8962
|
+
*
|
|
8963
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
8964
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
8965
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
8966
|
+
* See the License for the specific language governing permissions and
|
|
8967
|
+
* limitations under the License.
|
|
8968
|
+
*
|
|
8969
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8970
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
8971
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
8854
8972
|
* */
|
|
8973
|
+
var WorkspaceListErrorCategory;
|
|
8974
|
+
(function (WorkspaceListErrorCategory) {
|
|
8975
|
+
WorkspaceListErrorCategory["AUTH"] = "AUTH";
|
|
8976
|
+
WorkspaceListErrorCategory["GENERIC"] = "GENERIC";
|
|
8977
|
+
})(WorkspaceListErrorCategory || (WorkspaceListErrorCategory = {}));
|
|
8855
8978
|
var WorkspaceListErrorType;
|
|
8856
8979
|
(function (WorkspaceListErrorType) {
|
|
8857
|
-
WorkspaceListErrorType["
|
|
8858
|
-
WorkspaceListErrorType["
|
|
8980
|
+
WorkspaceListErrorType["TRANSLATABLE_ERROR"] = "TRANSLATABLE_ERROR";
|
|
8981
|
+
WorkspaceListErrorType["VERBATIM_ERROR"] = "VERBATIM_ERROR";
|
|
8859
8982
|
})(WorkspaceListErrorType || (WorkspaceListErrorType = {}));
|
|
8860
8983
|
|
|
8861
8984
|
const getWorkspaceListStore = store => {
|
|
@@ -8877,11 +9000,37 @@ const {
|
|
|
8877
9000
|
const getIsWorkspaceListFetching = createSelector(getWorkspaceListStore, store => store, state => {
|
|
8878
9001
|
return (state === null || state === void 0 ? void 0 : state.isFetching) || false;
|
|
8879
9002
|
}, selectorMemoizationOptions);
|
|
9003
|
+
const getWorkspaceDialogIsSaved = createSelector(getWorkspaceListStore, store => store, state => {
|
|
9004
|
+
var _a;
|
|
9005
|
+
return ((_a = state === null || state === void 0 ? void 0 : state.workspaceActionDialog) === null || _a === void 0 ? void 0 : _a.hasSaved) || false;
|
|
9006
|
+
}, selectorMemoizationOptions);
|
|
8880
9007
|
const getWorkspaceListError = createSelector(getWorkspaceListStore, store => store, state => {
|
|
8881
9008
|
return (state === null || state === void 0 ? void 0 : state.error) || undefined;
|
|
8882
9009
|
}, selectorMemoizationOptions);
|
|
8883
|
-
const getWorkspaceActionDialogDetails = createSelector(getWorkspaceListStore,
|
|
8884
|
-
|
|
9010
|
+
const getWorkspaceActionDialogDetails = createSelector(getWorkspaceListStore, getWorkspaceState, getViewPresetsStore, (workspaceListState, workspaceState, viewpresetState) => {
|
|
9011
|
+
var _a;
|
|
9012
|
+
const dialog = (workspaceListState === null || workspaceListState === void 0 ? void 0 : workspaceListState.workspaceActionDialog) || false;
|
|
9013
|
+
if (dialog) {
|
|
9014
|
+
const views = (_a = dialog.formValues.views) === null || _a === void 0 ? void 0 : _a.map(view => {
|
|
9015
|
+
const workspaceView = workspaceState.views.byId[view.mosaicNodeId];
|
|
9016
|
+
const viewComplete = viewpresetState.entities[view.mosaicNodeId];
|
|
9017
|
+
return {
|
|
9018
|
+
mosaicNodeId: view.mosaicNodeId,
|
|
9019
|
+
viewPresetId: (viewComplete === null || viewComplete === void 0 ? void 0 : viewComplete.activeViewPresetId) || view.viewPresetId,
|
|
9020
|
+
isSelected: view.isSelected,
|
|
9021
|
+
title: view.title || workspaceView.title,
|
|
9022
|
+
error: viewComplete === null || viewComplete === void 0 ? void 0 : viewComplete.error,
|
|
9023
|
+
isFetching: viewComplete === null || viewComplete === void 0 ? void 0 : viewComplete.isFetching,
|
|
9024
|
+
hasChanges: viewComplete === null || viewComplete === void 0 ? void 0 : viewComplete.hasChanges
|
|
9025
|
+
};
|
|
9026
|
+
});
|
|
9027
|
+
return Object.assign(Object.assign({}, dialog), {
|
|
9028
|
+
formValues: Object.assign(Object.assign({}, dialog.formValues), views && {
|
|
9029
|
+
views
|
|
9030
|
+
})
|
|
9031
|
+
});
|
|
9032
|
+
}
|
|
9033
|
+
return dialog;
|
|
8885
9034
|
}, selectorMemoizationOptions);
|
|
8886
9035
|
const getIsWorkspaceListDialogOpen = createSelector(getWorkspaceListStore, store => store, state => {
|
|
8887
9036
|
return (state === null || state === void 0 ? void 0 : state.isWorkspaceListDialogOpen) || false;
|
|
@@ -8911,9 +9060,9 @@ const emptyWorkspaceBEData = Object.assign(Object.assign({}, emptyMapWorkspace),
|
|
|
8911
9060
|
viewPresetId: 'emptyMap'
|
|
8912
9061
|
}]
|
|
8913
9062
|
});
|
|
8914
|
-
const saveAllViewPresets = (viewPresetEntity, workspaceTitle, store) => __awaiter(void 0, void 0, void 0, function* () {
|
|
9063
|
+
const saveAllViewPresets = (viewPresetEntity, workspaceTitle, store, emptyMapPresetTitle) => __awaiter(void 0, void 0, void 0, function* () {
|
|
8915
9064
|
var _a, _b;
|
|
8916
|
-
const workspaceApi =
|
|
9065
|
+
const workspaceApi = getWorkspaceApi();
|
|
8917
9066
|
const {
|
|
8918
9067
|
panelId,
|
|
8919
9068
|
activeViewPresetId,
|
|
@@ -8924,7 +9073,9 @@ const saveAllViewPresets = (viewPresetEntity, workspaceTitle, store) => __awaite
|
|
|
8924
9073
|
const scope = viewPreset.scope || 'system';
|
|
8925
9074
|
// saves user viewpresets with changes
|
|
8926
9075
|
if (scope === 'user' && hasChanges) {
|
|
8927
|
-
yield workspaceApi.saveViewPreset(activeViewPresetId, viewPreset)
|
|
9076
|
+
yield workspaceApi.saveViewPreset(activeViewPresetId, Object.assign(Object.assign({}, viewPreset), {
|
|
9077
|
+
title: viewPreset.title || emptyMapPresetTitle
|
|
9078
|
+
}));
|
|
8928
9079
|
store.dispatch(viewPresetActions.savedViewPreset({
|
|
8929
9080
|
panelId,
|
|
8930
9081
|
viewPresetId: activeViewPresetId
|
|
@@ -8981,13 +9132,17 @@ workspaceListListener.startListening({
|
|
|
8981
9132
|
}));
|
|
8982
9133
|
} catch (error) {
|
|
8983
9134
|
const isAuthError = isAxiosAuthError(error);
|
|
8984
|
-
const
|
|
8985
|
-
|
|
9135
|
+
const workspaceListError = isAuthError ? {
|
|
9136
|
+
type: WorkspaceListErrorType.VERBATIM_ERROR,
|
|
9137
|
+
message: getAxiosErrorMessage(error),
|
|
9138
|
+
category: WorkspaceListErrorCategory.AUTH
|
|
9139
|
+
} : {
|
|
9140
|
+
type: WorkspaceListErrorType.TRANSLATABLE_ERROR,
|
|
9141
|
+
key: 'workspace-list-error',
|
|
9142
|
+
category: WorkspaceListErrorCategory.GENERIC
|
|
9143
|
+
};
|
|
8986
9144
|
listenerApi.dispatch(workspaceListActions.errorWorkspaceList({
|
|
8987
|
-
error:
|
|
8988
|
-
type,
|
|
8989
|
-
message
|
|
8990
|
-
}
|
|
9145
|
+
error: workspaceListError
|
|
8991
9146
|
}));
|
|
8992
9147
|
}
|
|
8993
9148
|
})
|
|
@@ -9003,11 +9158,9 @@ workspaceListListener.startListening({
|
|
|
9003
9158
|
workspaceId,
|
|
9004
9159
|
title
|
|
9005
9160
|
} = payload;
|
|
9006
|
-
listenerApi.dispatch(snackbarActions.openSnackbar(
|
|
9007
|
-
message: getSnackbarMessage$1(action, title)
|
|
9008
|
-
}));
|
|
9161
|
+
listenerApi.dispatch(snackbarActions.openSnackbar(getSnackbarMessage$1(action, title)));
|
|
9009
9162
|
// if active workspace has been deleted, empty out url
|
|
9010
|
-
if (action === WorkspacePresetAction.DELETE && payload.currentActiveWorkspaceId && workspaceId === payload.currentActiveWorkspaceId) {
|
|
9163
|
+
if ((action === WorkspacePresetAction.DELETE || action === WorkspacePresetAction.DELETE_SYSTEM_PRESET) && payload.currentActiveWorkspaceId && workspaceId === payload.currentActiveWorkspaceId) {
|
|
9011
9164
|
listenerApi.dispatch(routerActions.navigateToUrl({
|
|
9012
9165
|
url: getWorkspaceRouteUrl()
|
|
9013
9166
|
}));
|
|
@@ -9066,7 +9219,7 @@ workspaceListListener.startListening({
|
|
|
9066
9219
|
}));
|
|
9067
9220
|
}
|
|
9068
9221
|
// delete
|
|
9069
|
-
if (presetAction === WorkspacePresetAction.DELETE) {
|
|
9222
|
+
if (presetAction === WorkspacePresetAction.DELETE || presetAction === WorkspacePresetAction.DELETE_SYSTEM_PRESET) {
|
|
9070
9223
|
yield workspaceApi.deleteWorkspacePreset(presetId);
|
|
9071
9224
|
const selectedWorkspace = getWorkspaceState(listenerApi.getState());
|
|
9072
9225
|
listenerApi.dispatch(workspaceListActions.onSuccessWorkspacePresetAction({
|
|
@@ -9104,7 +9257,10 @@ workspaceListListener.startListening({
|
|
|
9104
9257
|
const workspaceId = isNew ? yield workspaceApi.saveWorkspacePresetAs(data) : data.id;
|
|
9105
9258
|
// get all views
|
|
9106
9259
|
const views = getViewPresets(listenerApi.getState());
|
|
9107
|
-
const
|
|
9260
|
+
const {
|
|
9261
|
+
emptyMapPresetTitle
|
|
9262
|
+
} = payload;
|
|
9263
|
+
const savedViewPresetResult = yield Promise.all(views.map(view => saveAllViewPresets(view, data.title, listenerApi, emptyMapPresetTitle)));
|
|
9108
9264
|
const errorMessage = savedViewPresetResult.find(viewPresetResult => typeof viewPresetResult === 'string');
|
|
9109
9265
|
if (errorMessage) {
|
|
9110
9266
|
throw new Error(JSON.stringify(errorMessage));
|
|
@@ -9132,12 +9288,98 @@ workspaceListListener.startListening({
|
|
|
9132
9288
|
}));
|
|
9133
9289
|
}
|
|
9134
9290
|
}
|
|
9291
|
+
// save system presets
|
|
9292
|
+
if (presetAction === WorkspacePresetAction.SAVE_SYSTEM_PRESET) {
|
|
9293
|
+
const hasWorkspaceAlreadyBeenSaved = getWorkspaceDialogIsSaved(listenerApi.getState());
|
|
9294
|
+
let workspaceId = presetId;
|
|
9295
|
+
if (!hasWorkspaceAlreadyBeenSaved) {
|
|
9296
|
+
workspaceId = yield workspaceApi.saveWorkspacePresetAs(data);
|
|
9297
|
+
}
|
|
9298
|
+
// lock the workspace
|
|
9299
|
+
listenerApi.dispatch(workspaceListActions.onSuccessWorkspaceSaveDialog({
|
|
9300
|
+
presetId: workspaceId
|
|
9301
|
+
}));
|
|
9302
|
+
const viewPresetResults = yield Promise.all(data.views.map(view => __awaiter(void 0, void 0, void 0, function* () {
|
|
9303
|
+
const viewPresetEntity = Object.assign(Object.assign({}, getViewPresetToSendToBackend(listenerApi.getState(), view.mosaicNodeId)), {
|
|
9304
|
+
title: view.title
|
|
9305
|
+
});
|
|
9306
|
+
const shouldUpdateView = view.hasChanges && view.isSelected;
|
|
9307
|
+
// save existing views
|
|
9308
|
+
if (shouldUpdateView && view.viewPresetId !== 'emptyMap') {
|
|
9309
|
+
const payload = {
|
|
9310
|
+
panelId: view.mosaicNodeId,
|
|
9311
|
+
viewPresetId: view.viewPresetId,
|
|
9312
|
+
viewPreset: viewPresetEntity
|
|
9313
|
+
};
|
|
9314
|
+
return saveViewPresetEffect({
|
|
9315
|
+
payload
|
|
9316
|
+
}, listenerApi);
|
|
9317
|
+
}
|
|
9318
|
+
// save new views
|
|
9319
|
+
if (shouldUpdateView) {
|
|
9320
|
+
const payload = {
|
|
9321
|
+
panelId: view.mosaicNodeId,
|
|
9322
|
+
viewPresetId: '',
|
|
9323
|
+
viewPreset: viewPresetEntity
|
|
9324
|
+
};
|
|
9325
|
+
return saveViewPresetAsEffect({
|
|
9326
|
+
payload
|
|
9327
|
+
}, listenerApi);
|
|
9328
|
+
}
|
|
9329
|
+
return viewPresetEntity;
|
|
9330
|
+
})));
|
|
9331
|
+
const hasError = viewPresetResults.find(view => view.message);
|
|
9332
|
+
if (hasError) {
|
|
9333
|
+
// maybe we can use another action, but this resets fetching of the form
|
|
9334
|
+
listenerApi.dispatch(workspaceListActions.onErrorWorkspacePresetAction({
|
|
9335
|
+
error: undefined
|
|
9336
|
+
}));
|
|
9337
|
+
return;
|
|
9338
|
+
}
|
|
9339
|
+
const workspaceData = getWorkspaceData(listenerApi.getState());
|
|
9340
|
+
const newWorkspace = Object.assign(Object.assign({}, workspaceData), {
|
|
9341
|
+
id: workspaceId,
|
|
9342
|
+
title: data.title,
|
|
9343
|
+
abstract: data.abstract
|
|
9344
|
+
});
|
|
9345
|
+
yield workspaceApi.saveWorkspacePreset(workspaceId, newWorkspace);
|
|
9346
|
+
listenerApi.dispatch(workspaceListActions.onSuccessWorkspacePresetAction({
|
|
9347
|
+
action: WorkspacePresetAction.SAVE_SYSTEM_PRESET,
|
|
9348
|
+
workspaceId,
|
|
9349
|
+
title: newWorkspace.title,
|
|
9350
|
+
abstract: newWorkspace.abstract,
|
|
9351
|
+
scope: 'system'
|
|
9352
|
+
}));
|
|
9353
|
+
listenerApi.dispatch(routerActions.navigateToUrl({
|
|
9354
|
+
url: getWorkspaceRouteUrl(workspaceId)
|
|
9355
|
+
}));
|
|
9356
|
+
}
|
|
9357
|
+
// Reset
|
|
9358
|
+
if (presetAction === WorkspacePresetAction.RESET) {
|
|
9359
|
+
// In case we're resetting the `New workspace` preset
|
|
9360
|
+
if (presetId === emptyMapWorkspace.id) {
|
|
9361
|
+
listenerApi.dispatch(workspaceActions.changeToEmptyMapWorkspace());
|
|
9362
|
+
} else {
|
|
9363
|
+
listenerApi.dispatch(workspaceActions.fetchWorkspace({
|
|
9364
|
+
workspaceId: presetId
|
|
9365
|
+
}));
|
|
9366
|
+
}
|
|
9367
|
+
// workspace success handling
|
|
9368
|
+
listenerApi.dispatch(workspaceListActions.onSuccessWorkspacePresetAction({
|
|
9369
|
+
action: WorkspacePresetAction.RESET,
|
|
9370
|
+
workspaceId: presetId,
|
|
9371
|
+
title: data.title,
|
|
9372
|
+
abstract: data.abstract,
|
|
9373
|
+
scope
|
|
9374
|
+
}));
|
|
9375
|
+
}
|
|
9135
9376
|
} catch (error) {
|
|
9136
9377
|
const message = isAxiosError$1(error) ? getAxiosErrorMessage(error) : error.message;
|
|
9137
|
-
const
|
|
9378
|
+
const category = isAxiosAuthError(error) ? WorkspaceListErrorCategory.AUTH : WorkspaceListErrorCategory.GENERIC;
|
|
9138
9379
|
listenerApi.dispatch(workspaceListActions.onErrorWorkspacePresetAction({
|
|
9139
9380
|
error: {
|
|
9140
|
-
type,
|
|
9381
|
+
type: WorkspaceListErrorType.VERBATIM_ERROR,
|
|
9382
|
+
category,
|
|
9141
9383
|
message
|
|
9142
9384
|
}
|
|
9143
9385
|
}));
|
|
@@ -9145,22 +9387,22 @@ workspaceListListener.startListening({
|
|
|
9145
9387
|
})
|
|
9146
9388
|
});
|
|
9147
9389
|
|
|
9148
|
-
/* *
|
|
9149
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9150
|
-
* you may not use this file except in compliance with the License.
|
|
9151
|
-
* You may obtain a copy of the License at
|
|
9152
|
-
*
|
|
9153
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9154
|
-
*
|
|
9155
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
9156
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9157
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9158
|
-
* See the License for the specific language governing permissions and
|
|
9159
|
-
* limitations under the License.
|
|
9160
|
-
*
|
|
9161
|
-
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9162
|
-
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
9163
|
-
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
9390
|
+
/* *
|
|
9391
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9392
|
+
* you may not use this file except in compliance with the License.
|
|
9393
|
+
* You may obtain a copy of the License at
|
|
9394
|
+
*
|
|
9395
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9396
|
+
*
|
|
9397
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
9398
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9399
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9400
|
+
* See the License for the specific language governing permissions and
|
|
9401
|
+
* limitations under the License.
|
|
9402
|
+
*
|
|
9403
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9404
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
9405
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
9164
9406
|
* */
|
|
9165
9407
|
const workspaceModuleConfig = {
|
|
9166
9408
|
id: 'workspace-module',
|
|
@@ -9174,22 +9416,22 @@ const workspaceModuleConfig = {
|
|
|
9174
9416
|
};
|
|
9175
9417
|
|
|
9176
9418
|
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
9177
|
-
/* *
|
|
9178
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9179
|
-
* you may not use this file except in compliance with the License.
|
|
9180
|
-
* You may obtain a copy of the License at
|
|
9181
|
-
*
|
|
9182
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9183
|
-
*
|
|
9184
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
9185
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9186
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9187
|
-
* See the License for the specific language governing permissions and
|
|
9188
|
-
* limitations under the License.
|
|
9189
|
-
*
|
|
9190
|
-
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9191
|
-
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
9192
|
-
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
9419
|
+
/* *
|
|
9420
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9421
|
+
* you may not use this file except in compliance with the License.
|
|
9422
|
+
* You may obtain a copy of the License at
|
|
9423
|
+
*
|
|
9424
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9425
|
+
*
|
|
9426
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
9427
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9428
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9429
|
+
* See the License for the specific language governing permissions and
|
|
9430
|
+
* limitations under the License.
|
|
9431
|
+
*
|
|
9432
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9433
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
9434
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
9193
9435
|
* */
|
|
9194
9436
|
const devToolsStateSanitizer = {
|
|
9195
9437
|
stateSanitizer: state => {
|
|
@@ -9599,22 +9841,22 @@ const defaultComponentsLookUp = ({
|
|
|
9599
9841
|
}
|
|
9600
9842
|
};
|
|
9601
9843
|
|
|
9602
|
-
/* *
|
|
9603
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9604
|
-
* you may not use this file except in compliance with the License.
|
|
9605
|
-
* You may obtain a copy of the License at
|
|
9606
|
-
*
|
|
9607
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9608
|
-
*
|
|
9609
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
9610
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9611
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9612
|
-
* See the License for the specific language governing permissions and
|
|
9613
|
-
* limitations under the License.
|
|
9614
|
-
*
|
|
9615
|
-
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9616
|
-
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
9617
|
-
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
9844
|
+
/* *
|
|
9845
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9846
|
+
* you may not use this file except in compliance with the License.
|
|
9847
|
+
* You may obtain a copy of the License at
|
|
9848
|
+
*
|
|
9849
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9850
|
+
*
|
|
9851
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
9852
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9853
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9854
|
+
* See the License for the specific language governing permissions and
|
|
9855
|
+
* limitations under the License.
|
|
9856
|
+
*
|
|
9857
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9858
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
9859
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
9618
9860
|
* */
|
|
9619
9861
|
const getUniqueId = (existingIds, count = 1) => {
|
|
9620
9862
|
const newId = `${count}_screen`;
|
|
@@ -9628,22 +9870,22 @@ const createBalancedMosaicNode = currentNode => {
|
|
|
9628
9870
|
return createBalancedTreeFromLeaves(leaves);
|
|
9629
9871
|
};
|
|
9630
9872
|
|
|
9631
|
-
/* *
|
|
9632
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9633
|
-
* you may not use this file except in compliance with the License.
|
|
9634
|
-
* You may obtain a copy of the License at
|
|
9635
|
-
*
|
|
9636
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9637
|
-
*
|
|
9638
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
9639
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9640
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9641
|
-
* See the License for the specific language governing permissions and
|
|
9642
|
-
* limitations under the License.
|
|
9643
|
-
*
|
|
9644
|
-
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9645
|
-
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
9646
|
-
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
9873
|
+
/* *
|
|
9874
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9875
|
+
* you may not use this file except in compliance with the License.
|
|
9876
|
+
* You may obtain a copy of the License at
|
|
9877
|
+
*
|
|
9878
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9879
|
+
*
|
|
9880
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
9881
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9882
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9883
|
+
* See the License for the specific language governing permissions and
|
|
9884
|
+
* limitations under the License.
|
|
9885
|
+
*
|
|
9886
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9887
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
9888
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
9647
9889
|
* */
|
|
9648
9890
|
// Used to retrieve the unfiltered, general view preset list.
|
|
9649
9891
|
// To ensure you retrieve the view preset list specific for your view, use getFilteredViewPresetListForView
|
|
@@ -9697,6 +9939,7 @@ const WorkspaceSelectListRow = ({
|
|
|
9697
9939
|
onClickWorkspacePresetOption,
|
|
9698
9940
|
isOptionsMenuOpen: _isOptionsMenuOpen = false,
|
|
9699
9941
|
isEditable: _isEditable = false,
|
|
9942
|
+
isAdmin: _isAdmin = false,
|
|
9700
9943
|
searchQuery: _searchQuery = '',
|
|
9701
9944
|
testIdPrefix: _testIdPrefix = 'workspace'
|
|
9702
9945
|
}) => {
|
|
@@ -9770,26 +10013,24 @@ const WorkspaceSelectListRow = ({
|
|
|
9770
10013
|
margin: 0
|
|
9771
10014
|
}
|
|
9772
10015
|
})
|
|
9773
|
-
})), _isEditable && jsx(
|
|
10016
|
+
})), _isEditable && jsx(Grid2, Object.assign({
|
|
9774
10017
|
sx: {
|
|
9775
10018
|
minWidth: 56,
|
|
9776
10019
|
marginLeft: 2
|
|
9777
10020
|
}
|
|
9778
10021
|
}, {
|
|
9779
|
-
children: jsxs(
|
|
9780
|
-
|
|
9781
|
-
}, {
|
|
9782
|
-
children: [jsx(ToggleMenu, {
|
|
10022
|
+
children: jsxs(Grid2, {
|
|
10023
|
+
children: [!_isAdmin && jsx(ToggleMenu, {
|
|
9783
10024
|
buttonTestId: `${_testIdPrefix}-listOptionsButton`,
|
|
9784
10025
|
menuPosition: "right",
|
|
9785
10026
|
menuItems: menuItems,
|
|
9786
10027
|
menuTitle: t('workspace-options'),
|
|
9787
10028
|
isDefaultOpen: _isOptionsMenuOpen
|
|
9788
|
-
}), workspacePreset.scope === 'user' && jsx(CustomIconButton, Object.assign({
|
|
10029
|
+
}), (workspacePreset.scope === 'user' || _isAdmin) && workspacePreset.id && jsx(CustomIconButton, Object.assign({
|
|
9789
10030
|
tooltipTitle: t('workspace-delete-tooltip'),
|
|
9790
10031
|
onClick: event => {
|
|
9791
10032
|
event.stopPropagation();
|
|
9792
|
-
onClickWorkspacePresetOption(workspacePreset.id, WorkspacePresetAction.DELETE, workspacePreset);
|
|
10033
|
+
onClickWorkspacePresetOption(workspacePreset.id, _isAdmin ? WorkspacePresetAction.DELETE_SYSTEM_PRESET : WorkspacePresetAction.DELETE, workspacePreset);
|
|
9793
10034
|
},
|
|
9794
10035
|
variant: "tool",
|
|
9795
10036
|
sx: {
|
|
@@ -9799,7 +10040,7 @@ const WorkspaceSelectListRow = ({
|
|
|
9799
10040
|
}, {
|
|
9800
10041
|
children: jsx(Delete, {})
|
|
9801
10042
|
}))]
|
|
9802
|
-
})
|
|
10043
|
+
})
|
|
9803
10044
|
}))]
|
|
9804
10045
|
}))
|
|
9805
10046
|
}));
|
|
@@ -9817,6 +10058,7 @@ const WorkspaceSelectList = ({
|
|
|
9817
10058
|
onClickWorkspacePresetOption,
|
|
9818
10059
|
hideNewWorkspace,
|
|
9819
10060
|
isEditable,
|
|
10061
|
+
isAdmin,
|
|
9820
10062
|
searchQuery,
|
|
9821
10063
|
newPreset: _newPreset = getEmptyWorkspaceListItem(),
|
|
9822
10064
|
testIdPrefix: _testIdPrefix = 'workspace'
|
|
@@ -9868,6 +10110,7 @@ const WorkspaceSelectList = ({
|
|
|
9868
10110
|
onClickPreset: onClickPreset,
|
|
9869
10111
|
onClickWorkspacePresetOption: onClickWorkspacePresetOption,
|
|
9870
10112
|
isEditable: isEditable,
|
|
10113
|
+
isAdmin: isAdmin,
|
|
9871
10114
|
searchQuery: searchQuery,
|
|
9872
10115
|
isSelected: currentSelectedId === preset.id || currentSelectedId === '' && preset.id === undefined,
|
|
9873
10116
|
testIdPrefix: _testIdPrefix
|
|
@@ -10164,6 +10407,7 @@ const WorkspaceOptionsNoMemo = ({
|
|
|
10164
10407
|
handleEdit,
|
|
10165
10408
|
handleDelete,
|
|
10166
10409
|
handleSaveSystemPreset,
|
|
10410
|
+
handleResetWorkspace,
|
|
10167
10411
|
hasChanges: _hasChanges = false,
|
|
10168
10412
|
isDisabled: _isDisabled = false,
|
|
10169
10413
|
panelId,
|
|
@@ -10202,10 +10446,13 @@ const WorkspaceOptionsNoMemo = ({
|
|
|
10202
10446
|
}] : [...(handleSaveSystemPreset ? [{
|
|
10203
10447
|
title: t('workspace-admin-save-new-workspace'),
|
|
10204
10448
|
callback: handleSaveSystemPreset
|
|
10205
|
-
}] : [{
|
|
10206
|
-
title: t('workspace-admin-
|
|
10207
|
-
callback:
|
|
10208
|
-
}])
|
|
10449
|
+
}] : []), ...(handleResetWorkspace ? [{
|
|
10450
|
+
title: t('workspace-admin-reset-workspace'),
|
|
10451
|
+
callback: handleResetWorkspace
|
|
10452
|
+
}] : []), {
|
|
10453
|
+
title: t('workspace-delete'),
|
|
10454
|
+
callback: handleDelete
|
|
10455
|
+
}];
|
|
10209
10456
|
const renderButton = () => jsxs(CustomToggleButton, Object.assign({
|
|
10210
10457
|
variant: "tool",
|
|
10211
10458
|
selected: isOpen,
|
|
@@ -10914,6 +11161,18 @@ const WorkspaceSelectListConnect = () => {
|
|
|
10914
11161
|
});
|
|
10915
11162
|
break;
|
|
10916
11163
|
}
|
|
11164
|
+
case WorkspacePresetAction.DELETE_SYSTEM_PRESET:
|
|
11165
|
+
{
|
|
11166
|
+
setWorkspaceActionDialogOptions({
|
|
11167
|
+
action: workspaceAction,
|
|
11168
|
+
presetId,
|
|
11169
|
+
formValues: {
|
|
11170
|
+
title: presetTitle,
|
|
11171
|
+
scope
|
|
11172
|
+
}
|
|
11173
|
+
});
|
|
11174
|
+
break;
|
|
11175
|
+
}
|
|
10917
11176
|
}
|
|
10918
11177
|
};
|
|
10919
11178
|
const isAllSelected = workspaceListFilters.every(filter => filter.isSelected);
|
|
@@ -10921,8 +11180,6 @@ const WorkspaceSelectListConnect = () => {
|
|
|
10921
11180
|
const {
|
|
10922
11181
|
t
|
|
10923
11182
|
} = useWorkspaceTranslation();
|
|
10924
|
-
// disable edit for admin users for now
|
|
10925
|
-
const isEditable = isLoggedIn && !isAdmin;
|
|
10926
11183
|
return jsxs("div", Object.assign({
|
|
10927
11184
|
"data-testid": "workspace-selectlist-connect",
|
|
10928
11185
|
style: {
|
|
@@ -10945,9 +11202,9 @@ const WorkspaceSelectListConnect = () => {
|
|
|
10945
11202
|
}, {
|
|
10946
11203
|
children: jsx(AlertBanner, Object.assign({
|
|
10947
11204
|
title: t('workspace-error-fetch'),
|
|
10948
|
-
info: error.message,
|
|
11205
|
+
info: error.type === WorkspaceListErrorType.TRANSLATABLE_ERROR ? t(error.key, error.params) : error.message,
|
|
10949
11206
|
shouldClose: true
|
|
10950
|
-
}, error.
|
|
11207
|
+
}, error.category === WorkspaceListErrorCategory.GENERIC && {
|
|
10951
11208
|
actionButtonProps: {
|
|
10952
11209
|
title: t('workspace-retry'),
|
|
10953
11210
|
onClick: () => fetchWorkspaceList()
|
|
@@ -10971,7 +11228,8 @@ const WorkspaceSelectListConnect = () => {
|
|
|
10971
11228
|
onClickPreset: onClickWorkspace,
|
|
10972
11229
|
onClickWorkspacePresetOption: onClickWorkspacePresetOption,
|
|
10973
11230
|
hideNewWorkspace: shouldHideNewWorkspace,
|
|
10974
|
-
isEditable:
|
|
11231
|
+
isEditable: isLoggedIn,
|
|
11232
|
+
isAdmin: isAdmin,
|
|
10975
11233
|
searchQuery: workspaceSearchQuery
|
|
10976
11234
|
})]
|
|
10977
11235
|
}))]
|
|
@@ -11130,7 +11388,9 @@ const WorkspaceOptionsConnect = ({
|
|
|
11130
11388
|
setWorkspaceActionDialogOptions({
|
|
11131
11389
|
action: WorkspacePresetAction.SAVE_ALL,
|
|
11132
11390
|
presetId: workspaceId,
|
|
11133
|
-
formValues: Object.assign({}, workspaceData)
|
|
11391
|
+
formValues: Object.assign(Object.assign({}, workspaceData), {
|
|
11392
|
+
scope: 'user'
|
|
11393
|
+
})
|
|
11134
11394
|
});
|
|
11135
11395
|
};
|
|
11136
11396
|
const onSave = React.useCallback(() => {
|
|
@@ -11150,21 +11410,55 @@ const WorkspaceOptionsConnect = ({
|
|
|
11150
11410
|
action: WorkspacePresetAction.SAVE_SYSTEM_PRESET,
|
|
11151
11411
|
presetId: workspaceId,
|
|
11152
11412
|
formValues: Object.assign(Object.assign({}, workspaceData), {
|
|
11153
|
-
scope: 'system'
|
|
11154
|
-
|
|
11413
|
+
scope: 'system',
|
|
11414
|
+
views: workspaceData.views.map(view => Object.assign(Object.assign({}, view), {
|
|
11415
|
+
isSelected: false
|
|
11416
|
+
}))
|
|
11417
|
+
}),
|
|
11418
|
+
hasSaved: false
|
|
11419
|
+
});
|
|
11420
|
+
};
|
|
11421
|
+
const onResetWorkspace = () => {
|
|
11422
|
+
setWorkspaceActionDialogOptions({
|
|
11423
|
+
action: WorkspacePresetAction.RESET,
|
|
11424
|
+
presetId: workspaceId,
|
|
11425
|
+
formValues: {
|
|
11426
|
+
title
|
|
11427
|
+
}
|
|
11155
11428
|
});
|
|
11156
11429
|
};
|
|
11157
|
-
const
|
|
11430
|
+
const onDeleteSystemPreset = () => {
|
|
11431
|
+
setWorkspaceActionDialogOptions({
|
|
11432
|
+
action: WorkspacePresetAction.DELETE_SYSTEM_PRESET,
|
|
11433
|
+
presetId: workspaceId,
|
|
11434
|
+
formValues: {
|
|
11435
|
+
title
|
|
11436
|
+
}
|
|
11437
|
+
});
|
|
11438
|
+
};
|
|
11439
|
+
const isNew = workspaceId === undefined;
|
|
11440
|
+
const fullTitle = getPresetTitle(title, hasChanges, isNew || !workspaceId.length, t);
|
|
11441
|
+
const isUserPreset = workspaceScope === 'user';
|
|
11442
|
+
const getOnDelete = () => {
|
|
11443
|
+
if (isNew) {
|
|
11444
|
+
return undefined; // to disable delete option
|
|
11445
|
+
}
|
|
11446
|
+
if (isUserPreset) {
|
|
11447
|
+
return onDelete;
|
|
11448
|
+
}
|
|
11449
|
+
return isAdmin ? onDeleteSystemPreset : undefined;
|
|
11450
|
+
};
|
|
11158
11451
|
return jsx(WorkspaceOptions, {
|
|
11159
11452
|
hasChanges: hasChanges,
|
|
11160
11453
|
title: fullTitle,
|
|
11161
11454
|
activeTab: activeTab,
|
|
11162
|
-
handleDelete:
|
|
11455
|
+
handleDelete: getOnDelete(),
|
|
11163
11456
|
handleSaveAs: onSaveAs,
|
|
11164
11457
|
handleSaveAll: onSaveAll,
|
|
11165
|
-
handleSave:
|
|
11166
|
-
handleEdit:
|
|
11167
|
-
handleSaveSystemPreset: onSaveSystemPreset,
|
|
11458
|
+
handleSave: isUserPreset ? onSave : undefined,
|
|
11459
|
+
handleEdit: isUserPreset ? onEdit : undefined,
|
|
11460
|
+
handleSaveSystemPreset: isUserPreset ? undefined : onSaveSystemPreset,
|
|
11461
|
+
handleResetWorkspace: isUserPreset ? undefined : onResetWorkspace,
|
|
11168
11462
|
isDisabled: !viewIds.length || !isLoggedIn,
|
|
11169
11463
|
isAdmin: isAdmin
|
|
11170
11464
|
});
|
|
@@ -11204,35 +11498,50 @@ const HelperText = ({
|
|
|
11204
11498
|
}));
|
|
11205
11499
|
const ViewPresetItem = ({
|
|
11206
11500
|
index,
|
|
11207
|
-
viewPreset
|
|
11501
|
+
viewPreset,
|
|
11502
|
+
isLoading: _isLoading = false
|
|
11208
11503
|
}) => {
|
|
11209
11504
|
const {
|
|
11210
11505
|
t
|
|
11211
11506
|
} = useWorkspaceTranslation();
|
|
11212
11507
|
const {
|
|
11213
11508
|
setValue,
|
|
11214
|
-
watch
|
|
11509
|
+
watch,
|
|
11510
|
+
setError
|
|
11215
11511
|
} = useFormContext();
|
|
11216
11512
|
const isNew = !viewPreset.viewPresetId || viewPreset.viewPresetId === 'emptyMap';
|
|
11217
|
-
const isChecked = watch(`views.${index}.
|
|
11218
|
-
|
|
11219
|
-
const
|
|
11513
|
+
const isChecked = watch(`views.${index}.isSelected`) === true;
|
|
11514
|
+
// useState to keep the original title after posting
|
|
11515
|
+
const [viewPresetTitle] = React__default.useState(viewPreset.title || t('workspace-mappreset-new'));
|
|
11516
|
+
const label = getPresetTitle(viewPresetTitle, viewPreset.hasChanges, isNew, t);
|
|
11517
|
+
const {
|
|
11518
|
+
hasChanges,
|
|
11519
|
+
error
|
|
11520
|
+
} = viewPreset;
|
|
11521
|
+
const fieldNameTitle = `views.${index}.title`;
|
|
11220
11522
|
React__default.useEffect(() => {
|
|
11221
11523
|
const initialTitle = `${viewPresetTitle} ${viewPreset.mosaicNodeId}`;
|
|
11222
11524
|
setValue(`views.${index}.title`, initialTitle);
|
|
11223
11525
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
11224
11526
|
}, []);
|
|
11225
|
-
|
|
11226
|
-
|
|
11227
|
-
}
|
|
11527
|
+
React__default.useEffect(() => {
|
|
11528
|
+
setValue(`views.${index}.viewPresetId`, viewPreset.viewPresetId);
|
|
11529
|
+
}, [viewPreset.viewPresetId, index, setValue]);
|
|
11530
|
+
React__default.useEffect(() => {
|
|
11531
|
+
if (error) {
|
|
11532
|
+
setError(fieldNameTitle, {
|
|
11533
|
+
message: error.message
|
|
11534
|
+
});
|
|
11535
|
+
}
|
|
11536
|
+
}, [error, fieldNameTitle, setError]);
|
|
11228
11537
|
return jsxs(React__default.Fragment, {
|
|
11229
11538
|
children: [jsx(FormControlLabel, {
|
|
11230
11539
|
control: jsx(Checkbox, {}),
|
|
11231
11540
|
label: jsxs(Box, Object.assign({
|
|
11232
11541
|
component: "span",
|
|
11233
|
-
style: {
|
|
11542
|
+
style: Object.assign({}, hasChanges && {
|
|
11234
11543
|
fontStyle: 'italic'
|
|
11235
|
-
}
|
|
11544
|
+
})
|
|
11236
11545
|
}, {
|
|
11237
11546
|
children: [label, jsx(Box, Object.assign({
|
|
11238
11547
|
component: "span",
|
|
@@ -11244,43 +11553,40 @@ const ViewPresetItem = ({
|
|
|
11244
11553
|
}))]
|
|
11245
11554
|
})),
|
|
11246
11555
|
onChange: (_, isChecked) => {
|
|
11247
|
-
setValue(`views.${index}.
|
|
11556
|
+
setValue(`views.${index}.isSelected`, isChecked);
|
|
11248
11557
|
},
|
|
11249
|
-
checked: isChecked
|
|
11558
|
+
checked: isChecked || !hasChanges,
|
|
11559
|
+
disabled: _isLoading || !hasChanges
|
|
11560
|
+
}), error && !isNew && jsx(AlertBanner, {
|
|
11561
|
+
title: error.message
|
|
11250
11562
|
}), isNew && isChecked && jsxs(Fragment, {
|
|
11251
11563
|
children: [jsx(ReactHookFormTextField, {
|
|
11252
|
-
name:
|
|
11564
|
+
name: fieldNameTitle,
|
|
11253
11565
|
label: t('workspace-dialog-name'),
|
|
11254
11566
|
rules: {
|
|
11255
11567
|
required: true
|
|
11256
11568
|
},
|
|
11569
|
+
disabled: _isLoading || !hasChanges,
|
|
11257
11570
|
sx: {
|
|
11258
11571
|
marginBottom: 2
|
|
11259
|
-
}
|
|
11260
|
-
}), jsx(ReactHookFormTextField, {
|
|
11261
|
-
name: `views.${index}.abstract`,
|
|
11262
|
-
label: t('workspace-dialog-abstract'),
|
|
11263
|
-
rules: {
|
|
11264
|
-
required: false
|
|
11265
11572
|
},
|
|
11266
|
-
|
|
11267
|
-
rows: 3
|
|
11573
|
+
error: error !== undefined
|
|
11268
11574
|
}), jsx(HelperText, {
|
|
11269
11575
|
text: t('workspace-admin-save-new-viewpreset')
|
|
11270
11576
|
})]
|
|
11271
|
-
}), !isNew && isChecked && jsx(HelperText, {
|
|
11577
|
+
}), !isNew && isChecked && hasChanges && jsx(HelperText, {
|
|
11272
11578
|
text: t('workspace-admin-save-new-viewpreset-warning')
|
|
11273
11579
|
})]
|
|
11274
11580
|
}, viewPreset.mosaicNodeId);
|
|
11275
11581
|
};
|
|
11276
11582
|
const WorkspaceSystemPresetsForm = ({
|
|
11277
|
-
viewPresets: _viewPresets = []
|
|
11583
|
+
viewPresets: _viewPresets = [],
|
|
11584
|
+
isLoading: _isLoading2 = false
|
|
11278
11585
|
}) => {
|
|
11279
11586
|
const {
|
|
11280
11587
|
t
|
|
11281
11588
|
} = useWorkspaceTranslation();
|
|
11282
|
-
|
|
11283
|
-
return hasViewPresetsWithChanges ? jsxs(FormGroup, Object.assign({
|
|
11589
|
+
return _viewPresets.length ? jsxs(FormGroup, Object.assign({
|
|
11284
11590
|
sx: {
|
|
11285
11591
|
marginBottom: 2,
|
|
11286
11592
|
marginTop: 2
|
|
@@ -11291,12 +11597,14 @@ const WorkspaceSystemPresetsForm = ({
|
|
|
11291
11597
|
}), _viewPresets.map((viewPreset, index) => {
|
|
11292
11598
|
return jsx(ViewPresetItem, {
|
|
11293
11599
|
viewPreset: viewPreset,
|
|
11294
|
-
index: index
|
|
11600
|
+
index: index,
|
|
11601
|
+
isLoading: _isLoading2
|
|
11295
11602
|
}, viewPreset.mosaicNodeId);
|
|
11296
11603
|
})]
|
|
11297
11604
|
})) : null;
|
|
11298
11605
|
};
|
|
11299
11606
|
|
|
11607
|
+
const ERROR_TITLE_BE = 'Preset title already in use, please choose a different title';
|
|
11300
11608
|
const validateTitle$1 = value => {
|
|
11301
11609
|
if (!value) {
|
|
11302
11610
|
return true;
|
|
@@ -11312,11 +11620,16 @@ const WorkspacePresetsForm = ({
|
|
|
11312
11620
|
error,
|
|
11313
11621
|
onSubmit,
|
|
11314
11622
|
action,
|
|
11315
|
-
formValues
|
|
11623
|
+
formValues,
|
|
11624
|
+
isLoading: _isLoading = false,
|
|
11625
|
+
hasSavedWorkspace: _hasSavedWorkspace = false
|
|
11316
11626
|
}) => {
|
|
11317
11627
|
const {
|
|
11318
11628
|
t
|
|
11319
11629
|
} = useWorkspaceTranslation();
|
|
11630
|
+
const {
|
|
11631
|
+
setError
|
|
11632
|
+
} = useFormContext();
|
|
11320
11633
|
const titleField = 'title';
|
|
11321
11634
|
const _a = Object.assign(Object.assign({}, emptyWorkspacePreset), formValues),
|
|
11322
11635
|
{
|
|
@@ -11333,21 +11646,29 @@ const WorkspacePresetsForm = ({
|
|
|
11333
11646
|
const field = document.querySelector(`[name="${titleField}"]`);
|
|
11334
11647
|
field === null || field === void 0 ? void 0 : field.focus();
|
|
11335
11648
|
}, []);
|
|
11649
|
+
React__default.useEffect(() => {
|
|
11650
|
+
// set title error on title field
|
|
11651
|
+
if ((error === null || error === void 0 ? void 0 : error.type) === WorkspaceListErrorType.VERBATIM_ERROR && error.message === ERROR_TITLE_BE) {
|
|
11652
|
+
setError(titleField, {
|
|
11653
|
+
message: error.message
|
|
11654
|
+
});
|
|
11655
|
+
}
|
|
11656
|
+
}, [error, setError]);
|
|
11336
11657
|
const onSubmitForm = event => {
|
|
11337
11658
|
event.preventDefault();
|
|
11338
11659
|
onSubmit();
|
|
11339
11660
|
};
|
|
11340
11661
|
const hasFormInput = action === WorkspacePresetAction.DUPLICATE || action === WorkspacePresetAction.SAVE_AS || action === WorkspacePresetAction.SAVE_ALL || action === WorkspacePresetAction.EDIT || action === WorkspacePresetAction.SAVE_SYSTEM_PRESET;
|
|
11341
|
-
// disable form inputs
|
|
11342
|
-
const isDisabled =
|
|
11662
|
+
// disable form inputs
|
|
11663
|
+
const isDisabled = _hasSavedWorkspace || _isLoading;
|
|
11343
11664
|
return jsxs(Fragment, {
|
|
11344
|
-
children: [
|
|
11665
|
+
children: [error && !(error.type === WorkspaceListErrorType.VERBATIM_ERROR && error.message === ERROR_TITLE_BE) && jsx(Box, Object.assign({
|
|
11345
11666
|
sx: {
|
|
11346
11667
|
marginBottom: 2
|
|
11347
11668
|
}
|
|
11348
11669
|
}, {
|
|
11349
11670
|
children: jsx(AlertBanner, {
|
|
11350
|
-
title: error
|
|
11671
|
+
title: error.type === WorkspaceListErrorType.TRANSLATABLE_ERROR ? t(error.key, error.params) : error.message
|
|
11351
11672
|
})
|
|
11352
11673
|
})), hasFormInput && jsxs("form", Object.assign({
|
|
11353
11674
|
"data-testid": "workspace-preset-form",
|
|
@@ -11359,7 +11680,7 @@ const WorkspacePresetsForm = ({
|
|
|
11359
11680
|
}
|
|
11360
11681
|
}, {
|
|
11361
11682
|
children: jsx(ReactHookFormTextField, {
|
|
11362
|
-
name:
|
|
11683
|
+
name: titleField,
|
|
11363
11684
|
label: t('workspace-dialog-name'),
|
|
11364
11685
|
rules: {
|
|
11365
11686
|
required: true,
|
|
@@ -11368,7 +11689,8 @@ const WorkspacePresetsForm = ({
|
|
|
11368
11689
|
}
|
|
11369
11690
|
},
|
|
11370
11691
|
disabled: isDisabled,
|
|
11371
|
-
defaultValue: title
|
|
11692
|
+
defaultValue: title,
|
|
11693
|
+
error: (error === null || error === void 0 ? void 0 : error.type) === WorkspaceListErrorType.VERBATIM_ERROR && error.message === ERROR_TITLE_BE
|
|
11372
11694
|
})
|
|
11373
11695
|
})), jsx(ReactHookFormTextField, {
|
|
11374
11696
|
name: "abstract",
|
|
@@ -11381,7 +11703,8 @@ const WorkspacePresetsForm = ({
|
|
|
11381
11703
|
disabled: isDisabled,
|
|
11382
11704
|
defaultValue: abstract
|
|
11383
11705
|
}), action === WorkspacePresetAction.SAVE_SYSTEM_PRESET && jsx(WorkspaceSystemPresetsForm, {
|
|
11384
|
-
viewPresets: otherFormValues.views
|
|
11706
|
+
viewPresets: otherFormValues.views,
|
|
11707
|
+
isLoading: _isLoading
|
|
11385
11708
|
}), hiddenFields.map(({
|
|
11386
11709
|
name,
|
|
11387
11710
|
value
|
|
@@ -11390,8 +11713,20 @@ const WorkspacePresetsForm = ({
|
|
|
11390
11713
|
defaultValue: value,
|
|
11391
11714
|
"data-testid": name
|
|
11392
11715
|
}, name))]
|
|
11393
|
-
})), action === WorkspacePresetAction.DELETE && jsxs(Fragment, {
|
|
11394
|
-
children: [
|
|
11716
|
+
})), (action === WorkspacePresetAction.DELETE || action === WorkspacePresetAction.DELETE_SYSTEM_PRESET) && jsxs(Fragment, {
|
|
11717
|
+
children: [action === WorkspacePresetAction.DELETE_SYSTEM_PRESET && jsxs(Fragment, {
|
|
11718
|
+
children: [jsxs(Typography, Object.assign({
|
|
11719
|
+
variant: "body1"
|
|
11720
|
+
}, {
|
|
11721
|
+
children: [jsx(Exclamation, {
|
|
11722
|
+
sx: {
|
|
11723
|
+
color: 'geowebColors.functional.warning',
|
|
11724
|
+
position: 'relative',
|
|
11725
|
+
top: '6px'
|
|
11726
|
+
}
|
|
11727
|
+
}), t('workspace-dialog-confirm-delete-system')]
|
|
11728
|
+
})), jsx("br", {})]
|
|
11729
|
+
}), jsx(Typography, Object.assign({
|
|
11395
11730
|
variant: "body1"
|
|
11396
11731
|
}, {
|
|
11397
11732
|
children: t('workspace-dialog-confirm-delete-message', {
|
|
@@ -11401,6 +11736,21 @@ const WorkspacePresetsForm = ({
|
|
|
11401
11736
|
name: "title",
|
|
11402
11737
|
defaultValue: title
|
|
11403
11738
|
}, "title")]
|
|
11739
|
+
}), action === WorkspacePresetAction.RESET && jsxs(Box, {
|
|
11740
|
+
children: [jsxs(Typography, Object.assign({
|
|
11741
|
+
variant: "body1"
|
|
11742
|
+
}, {
|
|
11743
|
+
children: [jsx(Exclamation, {
|
|
11744
|
+
sx: {
|
|
11745
|
+
top: '6px',
|
|
11746
|
+
position: 'relative',
|
|
11747
|
+
color: 'geowebColors.functional.warning'
|
|
11748
|
+
}
|
|
11749
|
+
}), t('workspace-dialog-confirm-reset-message')]
|
|
11750
|
+
})), jsx(ReactHookFormHiddenInput, {
|
|
11751
|
+
name: "title",
|
|
11752
|
+
defaultValue: title
|
|
11753
|
+
}, "title")]
|
|
11404
11754
|
})]
|
|
11405
11755
|
});
|
|
11406
11756
|
};
|
|
@@ -11413,7 +11763,8 @@ const WorkspacePresetsFormDialog = ({
|
|
|
11413
11763
|
onClose,
|
|
11414
11764
|
onFormSubmit,
|
|
11415
11765
|
isLoading: _isLoading = false,
|
|
11416
|
-
error
|
|
11766
|
+
error,
|
|
11767
|
+
isWorkspaceSaved: _isWorkspaceSaved = false
|
|
11417
11768
|
}) => {
|
|
11418
11769
|
const {
|
|
11419
11770
|
handleSubmit: handleFormSubmit,
|
|
@@ -11423,14 +11774,21 @@ const WorkspacePresetsFormDialog = ({
|
|
|
11423
11774
|
t
|
|
11424
11775
|
} = useWorkspaceTranslation();
|
|
11425
11776
|
React__default.useEffect(() => {
|
|
11426
|
-
|
|
11427
|
-
|
|
11777
|
+
if (action !== WorkspacePresetAction.SAVE_SYSTEM_PRESET) {
|
|
11778
|
+
reset(formValues);
|
|
11779
|
+
}
|
|
11780
|
+
}, [formValues, reset, action]);
|
|
11428
11781
|
const getConfirmLabel = action => {
|
|
11429
11782
|
switch (action) {
|
|
11430
11783
|
case WorkspacePresetAction.DELETE:
|
|
11784
|
+
case WorkspacePresetAction.DELETE_SYSTEM_PRESET:
|
|
11431
11785
|
{
|
|
11432
11786
|
return t('workspace-delete');
|
|
11433
11787
|
}
|
|
11788
|
+
case WorkspacePresetAction.RESET:
|
|
11789
|
+
{
|
|
11790
|
+
return t('workspace-admin-reset-workspace');
|
|
11791
|
+
}
|
|
11434
11792
|
default:
|
|
11435
11793
|
{
|
|
11436
11794
|
return t('workspace-save');
|
|
@@ -11443,6 +11801,10 @@ const WorkspacePresetsFormDialog = ({
|
|
|
11443
11801
|
{
|
|
11444
11802
|
return t('workspace-dialog-delete');
|
|
11445
11803
|
}
|
|
11804
|
+
case WorkspacePresetAction.DELETE_SYSTEM_PRESET:
|
|
11805
|
+
{
|
|
11806
|
+
return t('workspace-dialog-delete-system');
|
|
11807
|
+
}
|
|
11446
11808
|
case WorkspacePresetAction.DUPLICATE:
|
|
11447
11809
|
{
|
|
11448
11810
|
return t('workspace-duplicate');
|
|
@@ -11459,6 +11821,10 @@ const WorkspacePresetsFormDialog = ({
|
|
|
11459
11821
|
{
|
|
11460
11822
|
return t('workspace-admin-save-new-workspace');
|
|
11461
11823
|
}
|
|
11824
|
+
case WorkspacePresetAction.RESET:
|
|
11825
|
+
{
|
|
11826
|
+
return t('workspace-admin-reset-workspace-title');
|
|
11827
|
+
}
|
|
11462
11828
|
default:
|
|
11463
11829
|
{
|
|
11464
11830
|
return t('workspace-save-as');
|
|
@@ -11500,14 +11866,18 @@ const WorkspacePresetsFormDialog = ({
|
|
|
11500
11866
|
formValues: formValues,
|
|
11501
11867
|
error: error,
|
|
11502
11868
|
onSubmit: onSubmit,
|
|
11503
|
-
action: action
|
|
11869
|
+
action: action,
|
|
11870
|
+
isLoading: _isLoading,
|
|
11871
|
+
hasSavedWorkspace: _isWorkspaceSaved
|
|
11504
11872
|
})
|
|
11505
11873
|
});
|
|
11506
11874
|
};
|
|
11507
11875
|
const WorkspacePresetsFormDialogWrapper = _a => {
|
|
11508
11876
|
var props = __rest(_a, []);
|
|
11509
11877
|
return jsx(ReactHookFormProvider, Object.assign({
|
|
11510
|
-
options: Object.assign({}, defaultFormOptions)
|
|
11878
|
+
options: Object.assign(Object.assign({}, defaultFormOptions), {
|
|
11879
|
+
defaultValues: props.formValues
|
|
11880
|
+
})
|
|
11511
11881
|
}, {
|
|
11512
11882
|
children: jsx(WorkspacePresetsFormDialog, Object.assign({}, props))
|
|
11513
11883
|
}));
|
|
@@ -11516,8 +11886,10 @@ const WorkspacePresetsFormDialogWrapper = _a => {
|
|
|
11516
11886
|
const WorkspaceTabConnect = ({
|
|
11517
11887
|
workspaceId
|
|
11518
11888
|
}) => {
|
|
11519
|
-
var _a;
|
|
11520
11889
|
const dispatch = useDispatch();
|
|
11890
|
+
const {
|
|
11891
|
+
t
|
|
11892
|
+
} = useWorkspaceTranslation();
|
|
11521
11893
|
const title = useSelector(store => getSelectedWorkspaceTitle(store));
|
|
11522
11894
|
const dialogDetails = useSelector(store => getWorkspaceActionDialogDetails(store));
|
|
11523
11895
|
const closeWorkspaceActionDialog = React.useCallback(() => {
|
|
@@ -11527,14 +11899,16 @@ const WorkspaceTabConnect = ({
|
|
|
11527
11899
|
dispatch(workspaceListActions.submitFormWorkspaceActionDialogOptions({
|
|
11528
11900
|
presetAction,
|
|
11529
11901
|
presetId,
|
|
11530
|
-
data
|
|
11902
|
+
data,
|
|
11903
|
+
emptyMapPresetTitle: t('workspace-mappreset-new')
|
|
11531
11904
|
}));
|
|
11532
11905
|
};
|
|
11533
11906
|
const presetId = typeof dialogDetails === 'object' && dialogDetails.presetId;
|
|
11534
11907
|
const action = typeof dialogDetails === 'object' && dialogDetails.action;
|
|
11535
11908
|
const formValues = typeof dialogDetails === 'object' && dialogDetails.formValues;
|
|
11536
11909
|
const isFetching = typeof dialogDetails === 'object' && dialogDetails.isFetching || false;
|
|
11537
|
-
const error = typeof dialogDetails === 'object' &&
|
|
11910
|
+
const error = typeof dialogDetails === 'object' && dialogDetails.error;
|
|
11911
|
+
const hasSavedWorkspace = typeof dialogDetails === 'object' && dialogDetails.hasSaved;
|
|
11538
11912
|
return jsxs(Fragment, {
|
|
11539
11913
|
children: [jsx(WorkspaceTab, {
|
|
11540
11914
|
activeTab: true,
|
|
@@ -11548,7 +11922,8 @@ const WorkspaceTabConnect = ({
|
|
|
11548
11922
|
formValues: formValues || undefined,
|
|
11549
11923
|
onFormSubmit: onSubmitForm,
|
|
11550
11924
|
isLoading: isFetching,
|
|
11551
|
-
error: error || undefined
|
|
11925
|
+
error: error || undefined,
|
|
11926
|
+
isWorkspaceSaved: hasSavedWorkspace
|
|
11552
11927
|
})]
|
|
11553
11928
|
});
|
|
11554
11929
|
};
|