@opengeoweb/workspace 9.21.0 → 9.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.esm.js +359 -313
- package/package.json +3 -4
- package/src/index.d.ts +2 -1
- package/src/lib/components/ResizeMenu/ResizeMenu.d.ts +6 -0
- package/src/lib/components/ResizeMenu/index.d.ts +1 -0
- package/src/lib/store/config.d.ts +1 -10
- package/src/lib/store/store.d.ts +0 -4
- package/src/lib/store/types.d.ts +13 -0
- package/src/lib/store/viewPresets/listener.d.ts +2 -0
- package/src/lib/store/viewPresets/listener.integration.spec.d.ts +1 -0
- package/src/lib/store/viewPresets/selectors.d.ts +1 -1
- package/src/lib/store/viewPresetsList/selectors.d.ts +1 -1
- package/src/lib/store/workspace/selectors.d.ts +1 -1
- package/src/lib/store/workspaceList/selectors.d.ts +1 -1
- package/src/lib/store/viewPresets/sagas.d.ts +0 -9
- /package/src/lib/{store/viewPresets/sagas.spec.d.ts → components/ResizeMenu/ResizeMenu.spec.d.ts} +0 -0
package/index.esm.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { createEntityAdapter, createSlice, createSelector } from '@reduxjs/toolkit';
|
|
1
|
+
import { createEntityAdapter, createSlice, createSelector, createListenerMiddleware } from '@reduxjs/toolkit';
|
|
2
2
|
import _, { chunk, cloneDeep, isEmpty, isEqual, isString } from 'lodash';
|
|
3
3
|
import { syncGroupsTypes, syncGroupsActions, layerActions, mapStoreActions, uiActions, genericActions, mapActions, layerTypes, mapEnums, selectorMemoizationOptions, genericSelectors, mapSelectors, syncGroupsSelectors, routerActions, coreModuleConfig, loadingIndicatorSelectors, uiSelectors } from '@opengeoweb/store';
|
|
4
4
|
import { createApiInstance, createNonAuthApiInstance, getApi, createFakeApiInstance, ApiProvider, useApiContext } from '@opengeoweb/api';
|
|
5
5
|
import { getLeaves, MosaicContext, getAndAssertNodeAtPathExists, createBalancedTreeFromLeaves, MosaicWindow, Mosaic } from 'react-mosaic-component';
|
|
6
6
|
import i18n from 'i18next';
|
|
7
|
-
import { SHARED_NAMESPACE, sharedTranslations, isAxiosAuthError, getAxiosErrorMessage, isAxiosError, withEggs, ConfirmationServiceProvider, useConfirmationDialog, CustomIconButton, AlertBanner, CustomTooltip, SearchHighlight, ToggleMenu, usePrevious, ToolContainer, renderCounter, CustomToggleButton, ConfirmationDialog } from '@opengeoweb/shared';
|
|
7
|
+
import { SHARED_NAMESPACE, sharedTranslations, isAxiosAuthError, getAxiosErrorMessage, isAxiosError, withEggs, ConfirmationServiceProvider, useConfirmationDialog, CustomIconButton, AlertBanner, CustomTooltip, SearchHighlight, ToggleMenu, usePrevious, Resizable, ToolContainer, renderCounter, CustomToggleButton, ConfirmationDialog } from '@opengeoweb/shared';
|
|
8
8
|
import { WEBMAP_REACT_NAMESPACE, webmapReactTranslations } from '@opengeoweb/webmap-react';
|
|
9
9
|
import { initReactI18next, useTranslation, I18nextProvider } from 'react-i18next';
|
|
10
10
|
import { CORE_NAMESPACE, coreTranslations } from '@opengeoweb/core';
|
|
11
|
+
import { FORM_FIELDS_NAMESPACE, formFieldsTranslations, ReactHookFormTextField, ReactHookFormHiddenInput, ReactHookFormProvider, defaultFormOptions } from '@opengeoweb/form-fields';
|
|
11
12
|
import { takeLatest, takeEvery, debounce, delay, put, all, select, call as call$g, takeLeading } from 'redux-saga/effects';
|
|
12
13
|
import { snackbarActions, SnackbarWrapperConnect } from '@opengeoweb/snackbar';
|
|
14
|
+
import { isAxiosError as isAxiosError$1 } from 'axios';
|
|
13
15
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
14
16
|
import { ThemeWrapper, lightTheme, SplitVertical, SplitHorizontal, Expand, UnExpand, Close, Delete, Preset, PresetWorkspace, PresetTiles, Search, Clear, CloudLoading, CloudIdle, WebAssetOff } from '@opengeoweb/theme';
|
|
15
17
|
import { Provider, useDispatch, useSelector, useStore, shallowEqual } from 'react-redux';
|
|
@@ -24,8 +26,6 @@ import { LinearProgress, Typography, ListItem, ListItemButton, ListItemIcon, Lis
|
|
|
24
26
|
import 'react-mosaic-component/react-mosaic-component.css';
|
|
25
27
|
import AutoSizer from 'react-virtualized-auto-sizer';
|
|
26
28
|
import { FixedSizeList } from 'react-window';
|
|
27
|
-
import { Box as Box$1 } from '@mui/system';
|
|
28
|
-
import { ReactHookFormTextField, ReactHookFormHiddenInput, ReactHookFormProvider, defaultFormOptions } from '@opengeoweb/form-fields';
|
|
29
29
|
import { useFormContext } from 'react-hook-form';
|
|
30
30
|
|
|
31
31
|
var en = {
|
|
@@ -90,65 +90,65 @@ var en = {
|
|
|
90
90
|
"workspace-viewpreset-menu": "View presets menu"
|
|
91
91
|
};
|
|
92
92
|
var fi = {
|
|
93
|
-
"workspace-menu": "
|
|
94
|
-
"workspace-new": "
|
|
95
|
-
"workspace-my-presets": "
|
|
96
|
-
"workspace-system-presets": "
|
|
97
|
-
"workspace-all-button": "
|
|
98
|
-
"workspace-search": "
|
|
99
|
-
"workspace-loading": "
|
|
100
|
-
"workspace-options": "
|
|
101
|
-
"workspace-results": "
|
|
102
|
-
"workspace-delete": "
|
|
103
|
-
"workspce-clear": "
|
|
104
|
-
"workspace-save": "
|
|
105
|
-
"workspace-save-as": "
|
|
106
|
-
"workspace-save-incl-viewpresets": "
|
|
107
|
-
"workspace-edit": "
|
|
108
|
-
"workspace-edit-both": "
|
|
109
|
-
"geoweb-welcome": "
|
|
110
|
-
"workspace-modified-new": "
|
|
111
|
-
"workspace-modified-existing": "ei
|
|
112
|
-
"workspace-dialog-delete": "
|
|
113
|
-
"workspace-duplicate": "
|
|
114
|
-
"workspace-cancel": "
|
|
115
|
-
"workspace-dialog-name": "
|
|
116
|
-
"workspace-dialog-abstract": "
|
|
117
|
-
"workspace-dialog-confirm-delete-message": "
|
|
118
|
-
"workspace-error-fetch": "
|
|
119
|
-
"workspace-error-fetch-detail": "
|
|
120
|
-
"workspace-retry": "
|
|
121
|
-
"workspace-delete-tooltip": "
|
|
122
|
-
"workspace-control-split-horizontal": "
|
|
123
|
-
"workspace-control-split-vertical": "
|
|
124
|
-
"workspace-control-expand": "
|
|
125
|
-
"workspace-control-unexpand": "
|
|
126
|
-
"workspace-control-close": "
|
|
127
|
-
"workspace-control-close-message-title": "
|
|
128
|
-
"workspace-control-close-message-description": "
|
|
129
|
-
"workspace-mappreset-delete-message": "
|
|
130
|
-
"workspace-viewpresets-fail-fetch": "
|
|
131
|
-
"workspace-viewpresets-error": "
|
|
132
|
-
"workspace-mappreset-dialog-title": "
|
|
133
|
-
"workspace-mappreset-save-as": "
|
|
134
|
-
"workspace-mappreset-new": "
|
|
135
|
-
"workspace-mappreset-dialog-title-delete": "
|
|
136
|
-
"workspace-mappreset-dialog-title-edit": "
|
|
137
|
-
"workspace-mappreset-error-save": "
|
|
138
|
-
"workspace-mappreset-error-fetch": "
|
|
139
|
-
"workspace-list-error": "
|
|
140
|
-
"workspace-list-success-save-all": "
|
|
141
|
-
"workspace-list-success-delete": "
|
|
142
|
-
"workspace-list-success-duplicate": "
|
|
143
|
-
"workspace-list-success-edit": "
|
|
144
|
-
"workspace-list-success-save": "
|
|
145
|
-
"workspace-save-error": "
|
|
146
|
-
"workspace-error-generic": "
|
|
147
|
-
"workspace-viewpreset-success-delete": "
|
|
148
|
-
"workspace-viewpreset-success-save-as": "
|
|
149
|
-
"workspace-viewpreset-success-edit": "
|
|
150
|
-
"workspace-viewpreset-success-save": "
|
|
151
|
-
"workspace-viewpreset-menu": "
|
|
93
|
+
"workspace-menu": "Workspace menu",
|
|
94
|
+
"workspace-new": "Uusi workspace",
|
|
95
|
+
"workspace-my-presets": "Omat presetit",
|
|
96
|
+
"workspace-system-presets": "Järestelmä presetit",
|
|
97
|
+
"workspace-all-button": "Kaikki",
|
|
98
|
+
"workspace-search": "Etsi",
|
|
99
|
+
"workspace-loading": "Ladataan",
|
|
100
|
+
"workspace-options": "Valinnat",
|
|
101
|
+
"workspace-results": "tulokset",
|
|
102
|
+
"workspace-delete": "Poista",
|
|
103
|
+
"workspce-clear": "Tyhjennä",
|
|
104
|
+
"workspace-save": "Tallenna",
|
|
105
|
+
"workspace-save-as": "Tallenna nimellä",
|
|
106
|
+
"workspace-save-incl-viewpresets": "Tallenna (sisältäen viewpresetit)",
|
|
107
|
+
"workspace-edit": "Muokkaa (nimeä)",
|
|
108
|
+
"workspace-edit-both": "Muokkaa (nimeä ja tiivistelmää)",
|
|
109
|
+
"geoweb-welcome": "Tervetuloa Geoweb-sovellukseen. Valitse jokin preset avataksesi uusia näkymiä",
|
|
110
|
+
"workspace-modified-new": "muokattu",
|
|
111
|
+
"workspace-modified-existing": "ei tallennettu",
|
|
112
|
+
"workspace-dialog-delete": "Poista workspace",
|
|
113
|
+
"workspace-duplicate": "Monista",
|
|
114
|
+
"workspace-cancel": "Peruuta",
|
|
115
|
+
"workspace-dialog-name": "Nimi",
|
|
116
|
+
"workspace-dialog-abstract": "Tiivistelmä",
|
|
117
|
+
"workspace-dialog-confirm-delete-message": "Oletko varma, että haluat poistaa workspace presetin: \"{{TITLE}}\"?",
|
|
118
|
+
"workspace-error-fetch": "Workspace listan hakeminen epäonnistui",
|
|
119
|
+
"workspace-error-fetch-detail": "Workspacen \"{{WORKSPACE_ID}}\" hakeminen epäonnistui",
|
|
120
|
+
"workspace-retry": "Yritä uudelleen",
|
|
121
|
+
"workspace-delete-tooltip": "Poista preset",
|
|
122
|
+
"workspace-control-split-horizontal": "Jaa ikkuna vaakasuoraan",
|
|
123
|
+
"workspace-control-split-vertical": "Jaa ikkuna pystysuoraan",
|
|
124
|
+
"workspace-control-expand": "Laajenna ikkuna",
|
|
125
|
+
"workspace-control-unexpand": "Supista ikkuna",
|
|
126
|
+
"workspace-control-close": "Sulje ikkuna",
|
|
127
|
+
"workspace-control-close-message-title": "Hups",
|
|
128
|
+
"workspace-control-close-message-description": "Oletko varma, että haluat sulkea tämän ikkunan? Kaikki muutokset menetetään",
|
|
129
|
+
"workspace-mappreset-delete-message": "Haluatko varmasti poistaa map presetin: \"{{TITLE}}\"?",
|
|
130
|
+
"workspace-viewpresets-fail-fetch": "Näkymän \"{{VIEWPRESET_ID}}\" hakeminen epäonnistui",
|
|
131
|
+
"workspace-viewpresets-error": "View presetit eivät ole käytettävissä",
|
|
132
|
+
"workspace-mappreset-dialog-title": "Map presetin nimi",
|
|
133
|
+
"workspace-mappreset-save-as": "Tallenna map preset nimellä",
|
|
134
|
+
"workspace-mappreset-new": "Uusi map preset",
|
|
135
|
+
"workspace-mappreset-dialog-title-delete": "Poista map preset",
|
|
136
|
+
"workspace-mappreset-dialog-title-edit": "Muokkaa map presettiä",
|
|
137
|
+
"workspace-mappreset-error-save": "Map presetin tallentaminen epäonnistui. Yritä myöhemmin uudelleen",
|
|
138
|
+
"workspace-mappreset-error-fetch": "Map presettien hakeminen epäonnistui",
|
|
139
|
+
"workspace-list-error": "Workspace presettien hakeminen epäonnistui",
|
|
140
|
+
"workspace-list-success-save-all": "Workspace \"{{TITLE}}\" ja siihen sisältyvät viewpresetit tallennettu onnistuneesti",
|
|
141
|
+
"workspace-list-success-delete": "Workspace \"{{TITLE}}\" poistettu onnistuneesti",
|
|
142
|
+
"workspace-list-success-duplicate": "Workspace \"{{TITLE}}\" tallennettu onnistuneesti",
|
|
143
|
+
"workspace-list-success-edit": "Workspacea \"{{TITLE}}\" muokattu onnistuneesti",
|
|
144
|
+
"workspace-list-success-save": "Workspace \"{{TITLE}}\" tallennettu onnistuneesti",
|
|
145
|
+
"workspace-save-error": "Workspacen \"{{TITLE}}\" tallentaminen epäonnistui",
|
|
146
|
+
"workspace-error-generic": "Jotain meni mönkään. Yritä uudelleen.",
|
|
147
|
+
"workspace-viewpreset-success-delete": "Map preset \"{{TITLE}}\" poistettu onnistuneesti",
|
|
148
|
+
"workspace-viewpreset-success-save-as": "Uusi map preset \"{{TITLE}}\" tallennettu onnistuneesti",
|
|
149
|
+
"workspace-viewpreset-success-edit": "Map presettiä \"{{TITLE}}\" muokattu onnistuneesti",
|
|
150
|
+
"workspace-viewpreset-success-save": "Map preset \"{{TITLE}}\" tallennettu onnistuneesti",
|
|
151
|
+
"workspace-viewpreset-menu": "View preset menu"
|
|
152
152
|
};
|
|
153
153
|
var no = {
|
|
154
154
|
"workspace-menu": "Arbeidsrommeny",
|
|
@@ -3560,25 +3560,29 @@ const initWorkspaceTestI18n = () => {
|
|
|
3560
3560
|
[WORKSPACE_NAMESPACE]: workspaceTranslations.en,
|
|
3561
3561
|
[SHARED_NAMESPACE]: sharedTranslations.en,
|
|
3562
3562
|
[CORE_NAMESPACE]: coreTranslations.en,
|
|
3563
|
-
[WEBMAP_REACT_NAMESPACE]: webmapReactTranslations.en
|
|
3563
|
+
[WEBMAP_REACT_NAMESPACE]: webmapReactTranslations.en,
|
|
3564
|
+
[FORM_FIELDS_NAMESPACE]: formFieldsTranslations.en
|
|
3564
3565
|
},
|
|
3565
3566
|
fi: {
|
|
3566
3567
|
[WORKSPACE_NAMESPACE]: workspaceTranslations.fi,
|
|
3567
3568
|
[SHARED_NAMESPACE]: sharedTranslations.fi,
|
|
3568
3569
|
[CORE_NAMESPACE]: coreTranslations.fi,
|
|
3569
|
-
[WEBMAP_REACT_NAMESPACE]: webmapReactTranslations.fi
|
|
3570
|
+
[WEBMAP_REACT_NAMESPACE]: webmapReactTranslations.fi,
|
|
3571
|
+
[FORM_FIELDS_NAMESPACE]: formFieldsTranslations.fi
|
|
3570
3572
|
},
|
|
3571
3573
|
no: {
|
|
3572
3574
|
[WORKSPACE_NAMESPACE]: workspaceTranslations.no,
|
|
3573
3575
|
[SHARED_NAMESPACE]: sharedTranslations.no,
|
|
3574
3576
|
[CORE_NAMESPACE]: coreTranslations.no,
|
|
3575
|
-
[WEBMAP_REACT_NAMESPACE]: webmapReactTranslations.no
|
|
3577
|
+
[WEBMAP_REACT_NAMESPACE]: webmapReactTranslations.no,
|
|
3578
|
+
[FORM_FIELDS_NAMESPACE]: formFieldsTranslations.no
|
|
3576
3579
|
},
|
|
3577
3580
|
nl: {
|
|
3578
3581
|
[WORKSPACE_NAMESPACE]: workspaceTranslations.nl,
|
|
3579
3582
|
[SHARED_NAMESPACE]: sharedTranslations.nl,
|
|
3580
3583
|
[CORE_NAMESPACE]: coreTranslations.nl,
|
|
3581
|
-
[WEBMAP_REACT_NAMESPACE]: webmapReactTranslations.nl
|
|
3584
|
+
[WEBMAP_REACT_NAMESPACE]: webmapReactTranslations.nl,
|
|
3585
|
+
[FORM_FIELDS_NAMESPACE]: formFieldsTranslations.nl
|
|
3582
3586
|
}
|
|
3583
3587
|
}
|
|
3584
3588
|
});
|
|
@@ -4060,7 +4064,6 @@ const getSnackbarMessage = (action, title) => {
|
|
|
4060
4064
|
});
|
|
4061
4065
|
}
|
|
4062
4066
|
};
|
|
4063
|
-
const getPresetsApi = () => getApi(API_NAME);
|
|
4064
4067
|
const emptyMapViewPreset = {
|
|
4065
4068
|
componentType: 'Map',
|
|
4066
4069
|
keywords: '',
|
|
@@ -7511,12 +7514,56 @@ function* submitFormWorkspaceDialogSaga({
|
|
|
7511
7514
|
}));
|
|
7512
7515
|
}
|
|
7513
7516
|
}
|
|
7514
|
-
function* rootSaga
|
|
7517
|
+
function* rootSaga() {
|
|
7515
7518
|
yield takeLeading(workspaceListActions.fetchWorkspaceList.type, fetchWorkspaceListSaga);
|
|
7516
7519
|
yield takeLatest(workspaceListActions.onSuccessWorkspacePresetAction, onSuccessWorkspacePresetsActionSaga);
|
|
7517
7520
|
yield takeLatest(workspaceListActions.submitFormWorkspaceActionDialogOptions, submitFormWorkspaceDialogSaga);
|
|
7518
7521
|
}
|
|
7519
7522
|
|
|
7523
|
+
/******************************************************************************
|
|
7524
|
+
Copyright (c) Microsoft Corporation.
|
|
7525
|
+
|
|
7526
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
7527
|
+
purpose with or without fee is hereby granted.
|
|
7528
|
+
|
|
7529
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
7530
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
7531
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
7532
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
7533
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
7534
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
7535
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
7536
|
+
***************************************************************************** */
|
|
7537
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
7538
|
+
|
|
7539
|
+
|
|
7540
|
+
function __rest(s, e) {
|
|
7541
|
+
var t = {};
|
|
7542
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
7543
|
+
t[p] = s[p];
|
|
7544
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7545
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7546
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
7547
|
+
t[p[i]] = s[p[i]];
|
|
7548
|
+
}
|
|
7549
|
+
return t;
|
|
7550
|
+
}
|
|
7551
|
+
|
|
7552
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
7553
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
7554
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
7555
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
7556
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7557
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7558
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
7559
|
+
});
|
|
7560
|
+
}
|
|
7561
|
+
|
|
7562
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
7563
|
+
var e = new Error(message);
|
|
7564
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
7565
|
+
};
|
|
7566
|
+
|
|
7520
7567
|
/* *
|
|
7521
7568
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7522
7569
|
* you may not use this file except in compliance with the License.
|
|
@@ -7534,7 +7581,7 @@ function* rootSaga$1() {
|
|
|
7534
7581
|
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
7535
7582
|
* */
|
|
7536
7583
|
const processError = (error, component, errorMessageKey) => {
|
|
7537
|
-
const message = isAxiosError(error) ? getAxiosErrorMessage(error) : translateKeyOutsideComponents(errorMessageKey);
|
|
7584
|
+
const message = isAxiosError$1(error) ? getAxiosErrorMessage(error) : translateKeyOutsideComponents(errorMessageKey);
|
|
7538
7585
|
const errorType = isAxiosAuthError(error) ? ViewPresetErrorType.AUTH : ViewPresetErrorType.GENERIC;
|
|
7539
7586
|
return {
|
|
7540
7587
|
message,
|
|
@@ -7542,161 +7589,180 @@ const processError = (error, component, errorMessageKey) => {
|
|
|
7542
7589
|
errorType
|
|
7543
7590
|
};
|
|
7544
7591
|
};
|
|
7545
|
-
|
|
7546
|
-
|
|
7547
|
-
|
|
7548
|
-
|
|
7549
|
-
|
|
7550
|
-
|
|
7551
|
-
|
|
7552
|
-
|
|
7553
|
-
viewPresets
|
|
7554
|
-
|
|
7555
|
-
|
|
7556
|
-
|
|
7557
|
-
|
|
7558
|
-
|
|
7559
|
-
|
|
7560
|
-
}
|
|
7561
|
-
|
|
7562
|
-
|
|
7563
|
-
})
|
|
7564
|
-
|
|
7565
|
-
|
|
7566
|
-
|
|
7567
|
-
|
|
7568
|
-
|
|
7569
|
-
|
|
7592
|
+
const viewPresetsListener = createListenerMiddleware();
|
|
7593
|
+
// fetch initial view presets
|
|
7594
|
+
viewPresetsListener.startListening({
|
|
7595
|
+
actionCreator: viewPresetActions.fetchInitialViewPresets,
|
|
7596
|
+
effect: (_, listenerApi) => __awaiter(void 0, void 0, void 0, function* () {
|
|
7597
|
+
listenerApi.cancelActiveListeners();
|
|
7598
|
+
try {
|
|
7599
|
+
const workspaceApi = getWorkspaceApi();
|
|
7600
|
+
// No filters so we don't need to pass any params for this viewPresets list call
|
|
7601
|
+
const {
|
|
7602
|
+
data: viewPresets
|
|
7603
|
+
} = yield workspaceApi.getViewPresets();
|
|
7604
|
+
listenerApi.dispatch(viewPresetActions.fetchedInitialViewPresets({
|
|
7605
|
+
viewPresets
|
|
7606
|
+
}));
|
|
7607
|
+
} catch (error) {
|
|
7608
|
+
listenerApi.dispatch(viewPresetActions.errorInitialViewPresets({
|
|
7609
|
+
error: processError(error, ViewPresetErrorComponent.PRESET_LIST, 'workspace-mappreset-error-fetch')
|
|
7610
|
+
}));
|
|
7611
|
+
}
|
|
7612
|
+
})
|
|
7613
|
+
});
|
|
7614
|
+
// fetch view presets
|
|
7615
|
+
viewPresetsListener.startListening({
|
|
7616
|
+
actionCreator: viewPresetActions.fetchViewPresets,
|
|
7617
|
+
effect: ({
|
|
7618
|
+
payload
|
|
7619
|
+
}, listenerApi) => __awaiter(void 0, void 0, void 0, function* () {
|
|
7620
|
+
listenerApi.cancelActiveListeners();
|
|
7570
7621
|
const {
|
|
7571
|
-
data: viewPresets
|
|
7572
|
-
} = yield call$g(presetsApi.getViewPresets, filterParams);
|
|
7573
|
-
yield put(viewPresetActions.fetchedViewPresets({
|
|
7574
|
-
viewPresets,
|
|
7575
7622
|
panelId,
|
|
7576
7623
|
filterParams
|
|
7577
|
-
}
|
|
7578
|
-
|
|
7579
|
-
|
|
7580
|
-
|
|
7581
|
-
|
|
7582
|
-
|
|
7583
|
-
|
|
7584
|
-
|
|
7585
|
-
|
|
7586
|
-
|
|
7587
|
-
})
|
|
7588
|
-
|
|
7589
|
-
|
|
7590
|
-
|
|
7591
|
-
|
|
7592
|
-
|
|
7593
|
-
|
|
7594
|
-
|
|
7595
|
-
|
|
7596
|
-
|
|
7597
|
-
|
|
7598
|
-
|
|
7599
|
-
|
|
7600
|
-
|
|
7601
|
-
|
|
7602
|
-
|
|
7603
|
-
|
|
7604
|
-
yield put(viewPresetActions.errorViewPreset({
|
|
7605
|
-
error: processError(error, ViewPresetErrorComponent.PRESET_DETAIL, 'workspace-mappreset-error-save'),
|
|
7624
|
+
} = payload;
|
|
7625
|
+
try {
|
|
7626
|
+
const workspaceApi = getWorkspaceApi();
|
|
7627
|
+
const {
|
|
7628
|
+
data: viewPresets
|
|
7629
|
+
} = yield workspaceApi.getViewPresets(filterParams);
|
|
7630
|
+
listenerApi.dispatch(viewPresetActions.fetchedViewPresets({
|
|
7631
|
+
viewPresets,
|
|
7632
|
+
panelId,
|
|
7633
|
+
filterParams
|
|
7634
|
+
}));
|
|
7635
|
+
} catch (error) {
|
|
7636
|
+
listenerApi.dispatch(viewPresetActions.errorViewPreset({
|
|
7637
|
+
error: processError(error, ViewPresetErrorComponent.PRESET_LIST, 'workspace-mappreset-error-fetch'),
|
|
7638
|
+
panelId
|
|
7639
|
+
}));
|
|
7640
|
+
}
|
|
7641
|
+
})
|
|
7642
|
+
});
|
|
7643
|
+
// save view preset
|
|
7644
|
+
viewPresetsListener.startListening({
|
|
7645
|
+
actionCreator: viewPresetActions.saveViewPreset,
|
|
7646
|
+
effect: ({
|
|
7647
|
+
payload
|
|
7648
|
+
}, listenerApi) => __awaiter(void 0, void 0, void 0, function* () {
|
|
7649
|
+
listenerApi.cancelActiveListeners();
|
|
7650
|
+
const {
|
|
7606
7651
|
panelId,
|
|
7652
|
+
viewPreset,
|
|
7607
7653
|
viewPresetId
|
|
7608
|
-
}
|
|
7609
|
-
|
|
7610
|
-
|
|
7611
|
-
|
|
7612
|
-
|
|
7613
|
-
|
|
7614
|
-
|
|
7615
|
-
|
|
7616
|
-
viewPresetId = ''
|
|
7617
|
-
} = payload;
|
|
7618
|
-
const isMapAnimating = yield select(mapSelectors.isAnimating, panelId);
|
|
7619
|
-
if (isMapAnimating) {
|
|
7620
|
-
yield put(mapStoreActions.mapStopAnimation({
|
|
7621
|
-
mapId: panelId
|
|
7622
|
-
}));
|
|
7623
|
-
}
|
|
7624
|
-
// fetch existing map preset selected
|
|
7625
|
-
if (viewPresetId !== '') {
|
|
7626
|
-
yield put(workspaceActions.fetchWorkspaceViewPreset({
|
|
7627
|
-
mosaicNodeId: panelId,
|
|
7628
|
-
viewPresetId
|
|
7629
|
-
}));
|
|
7630
|
-
} else {
|
|
7631
|
-
// new map preset selected
|
|
7632
|
-
yield put(mapStoreActions.setMapPreset({
|
|
7633
|
-
mapId: panelId,
|
|
7634
|
-
initialProps: emptyMapViewPreset.initialProps
|
|
7635
|
-
}));
|
|
7636
|
-
// update workspace with new empy view map
|
|
7637
|
-
yield put(workspaceActions.updateWorkspaceView({
|
|
7638
|
-
viewPreset: emptyMapViewPreset,
|
|
7639
|
-
mosaicNodeId: panelId
|
|
7640
|
-
}));
|
|
7641
|
-
yield put(viewPresetActions.fetchedViewPreset({
|
|
7642
|
-
panelId,
|
|
7643
|
-
viewPresetId,
|
|
7644
|
-
viewPreset: emptyMapViewPreset
|
|
7645
|
-
}));
|
|
7646
|
-
}
|
|
7647
|
-
}
|
|
7648
|
-
function* onSuccessViewPresetActionSaga({
|
|
7649
|
-
payload
|
|
7650
|
-
}) {
|
|
7651
|
-
const {
|
|
7652
|
-
action,
|
|
7653
|
-
viewPresetId,
|
|
7654
|
-
title,
|
|
7655
|
-
panelId
|
|
7656
|
-
} = payload;
|
|
7657
|
-
try {
|
|
7658
|
-
yield put(snackbarActions.openSnackbar({
|
|
7659
|
-
message: getSnackbarMessage(action, title)
|
|
7660
|
-
}));
|
|
7661
|
-
const activeMapPresetId = yield select(getViewPresetActiveId, panelId);
|
|
7662
|
-
// if active preset has been deleted, select the empty new preset
|
|
7663
|
-
if (action === PresetAction.DELETE && viewPresetId === activeMapPresetId) {
|
|
7664
|
-
yield put(viewPresetActions.setActiveViewPresetId({
|
|
7654
|
+
} = payload;
|
|
7655
|
+
try {
|
|
7656
|
+
const workspaceApi = getWorkspaceApi();
|
|
7657
|
+
yield workspaceApi.saveViewPreset(viewPresetId, viewPreset);
|
|
7658
|
+
listenerApi.dispatch(snackbarActions.openSnackbar({
|
|
7659
|
+
message: getSnackbarMessage(PresetAction.SAVE, viewPreset.title)
|
|
7660
|
+
}));
|
|
7661
|
+
listenerApi.dispatch(viewPresetActions.savedViewPreset({
|
|
7665
7662
|
panelId,
|
|
7666
|
-
viewPresetId
|
|
7663
|
+
viewPresetId
|
|
7664
|
+
}));
|
|
7665
|
+
} catch (error) {
|
|
7666
|
+
listenerApi.dispatch(viewPresetActions.errorViewPreset({
|
|
7667
|
+
error: processError(error, ViewPresetErrorComponent.PRESET_DETAIL, 'workspace-mappreset-error-save'),
|
|
7668
|
+
panelId,
|
|
7669
|
+
viewPresetId
|
|
7667
7670
|
}));
|
|
7668
7671
|
}
|
|
7669
|
-
|
|
7670
|
-
|
|
7671
|
-
|
|
7672
|
-
|
|
7673
|
-
|
|
7672
|
+
})
|
|
7673
|
+
});
|
|
7674
|
+
// select view preset
|
|
7675
|
+
viewPresetsListener.startListening({
|
|
7676
|
+
actionCreator: viewPresetActions.selectViewPreset,
|
|
7677
|
+
effect: ({
|
|
7678
|
+
payload
|
|
7679
|
+
}, listenerApi) => __awaiter(void 0, void 0, void 0, function* () {
|
|
7680
|
+
listenerApi.cancelActiveListeners();
|
|
7681
|
+
const {
|
|
7674
7682
|
panelId,
|
|
7675
|
-
|
|
7676
|
-
}
|
|
7677
|
-
|
|
7678
|
-
|
|
7683
|
+
viewPresetId = ''
|
|
7684
|
+
} = payload;
|
|
7685
|
+
const isMapAnimating = mapSelectors.isAnimating(listenerApi.getState(), panelId);
|
|
7686
|
+
if (isMapAnimating) {
|
|
7687
|
+
listenerApi.dispatch(mapStoreActions.mapStopAnimation({
|
|
7688
|
+
mapId: panelId
|
|
7689
|
+
}));
|
|
7690
|
+
}
|
|
7691
|
+
// fetch existing map preset selected
|
|
7692
|
+
if (viewPresetId !== '') {
|
|
7693
|
+
listenerApi.dispatch(workspaceActions.fetchWorkspaceViewPreset({
|
|
7694
|
+
mosaicNodeId: panelId,
|
|
7695
|
+
viewPresetId
|
|
7696
|
+
}));
|
|
7697
|
+
} else {
|
|
7698
|
+
// new map preset selected
|
|
7699
|
+
listenerApi.dispatch(mapStoreActions.setMapPreset({
|
|
7700
|
+
mapId: panelId,
|
|
7701
|
+
initialProps: emptyMapViewPreset.initialProps
|
|
7702
|
+
}));
|
|
7703
|
+
// update workspace with new empy view map
|
|
7704
|
+
listenerApi.dispatch(workspaceActions.updateWorkspaceView({
|
|
7705
|
+
viewPreset: emptyMapViewPreset,
|
|
7706
|
+
mosaicNodeId: panelId
|
|
7707
|
+
}));
|
|
7708
|
+
listenerApi.dispatch(viewPresetActions.fetchedViewPreset({
|
|
7679
7709
|
panelId,
|
|
7680
|
-
|
|
7710
|
+
viewPresetId,
|
|
7711
|
+
viewPreset: emptyMapViewPreset
|
|
7681
7712
|
}));
|
|
7682
7713
|
}
|
|
7683
|
-
|
|
7684
|
-
|
|
7714
|
+
})
|
|
7715
|
+
});
|
|
7716
|
+
// success view preset
|
|
7717
|
+
viewPresetsListener.startListening({
|
|
7718
|
+
actionCreator: viewPresetActions.onSuccessViewPresetAction,
|
|
7719
|
+
effect: ({
|
|
7720
|
+
payload
|
|
7721
|
+
}, listenerApi) => __awaiter(void 0, void 0, void 0, function* () {
|
|
7722
|
+
listenerApi.cancelActiveListeners();
|
|
7723
|
+
const {
|
|
7724
|
+
action,
|
|
7725
|
+
viewPresetId,
|
|
7726
|
+
title,
|
|
7727
|
+
panelId
|
|
7728
|
+
} = payload;
|
|
7729
|
+
try {
|
|
7730
|
+
listenerApi.dispatch(snackbarActions.openSnackbar({
|
|
7731
|
+
message: getSnackbarMessage(action, title)
|
|
7732
|
+
}));
|
|
7733
|
+
const activeMapPresetId = getViewPresetActiveId(listenerApi.getState(), panelId);
|
|
7734
|
+
// if active preset has been deleted, select the empty new preset
|
|
7735
|
+
if (action === PresetAction.DELETE && viewPresetId === activeMapPresetId) {
|
|
7736
|
+
listenerApi.dispatch(viewPresetActions.setActiveViewPresetId({
|
|
7737
|
+
panelId,
|
|
7738
|
+
viewPresetId: ''
|
|
7739
|
+
}));
|
|
7740
|
+
}
|
|
7741
|
+
// Retrieve new list with current filter and search query
|
|
7742
|
+
const viewPresetFilters = getViewPresetListFiltersForView(listenerApi.getState(), panelId);
|
|
7743
|
+
// Retrieve new list with current filter
|
|
7744
|
+
const viewPresetSearchQuery = getViewPresetListSearchQueryForView(listenerApi.getState(), panelId);
|
|
7745
|
+
listenerApi.dispatch(viewPresetActions.fetchViewPresets({
|
|
7685
7746
|
panelId,
|
|
7686
|
-
|
|
7747
|
+
filterParams: constructFilterParams(viewPresetFilters, viewPresetSearchQuery)
|
|
7687
7748
|
}));
|
|
7749
|
+
if (action !== PresetAction.EDIT) {
|
|
7750
|
+
listenerApi.dispatch(viewPresetActions.setViewPresetHasChanges({
|
|
7751
|
+
panelId,
|
|
7752
|
+
hasChanges: false
|
|
7753
|
+
}));
|
|
7754
|
+
}
|
|
7755
|
+
if (action === PresetAction.SAVE_AS && viewPresetId) {
|
|
7756
|
+
listenerApi.dispatch(viewPresetActions.setActiveViewPresetId({
|
|
7757
|
+
panelId,
|
|
7758
|
+
viewPresetId
|
|
7759
|
+
}));
|
|
7760
|
+
}
|
|
7761
|
+
} catch (error) {
|
|
7762
|
+
// TODO: use error handling of mapPreset https://gitlab.com/opengeoweb/opengeoweb/-/issues/3043
|
|
7688
7763
|
}
|
|
7689
|
-
}
|
|
7690
|
-
|
|
7691
|
-
}
|
|
7692
|
-
}
|
|
7693
|
-
function* rootSaga() {
|
|
7694
|
-
yield takeLeading(viewPresetActions.fetchInitialViewPresets, fetchInitialViewPresetsSaga);
|
|
7695
|
-
yield takeLatest(viewPresetActions.fetchViewPresets, fetchViewPresetsSaga);
|
|
7696
|
-
yield takeLatest(viewPresetActions.saveViewPreset, saveViewPresetSaga);
|
|
7697
|
-
yield takeLatest(viewPresetActions.selectViewPreset, selectViewPresetSaga);
|
|
7698
|
-
yield takeLatest(viewPresetActions.onSuccessViewPresetAction, onSuccessViewPresetActionSaga);
|
|
7699
|
-
}
|
|
7764
|
+
})
|
|
7765
|
+
});
|
|
7700
7766
|
|
|
7701
7767
|
/* *
|
|
7702
7768
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -7722,51 +7788,8 @@ const workspaceModuleConfig = {
|
|
|
7722
7788
|
viewPresetsList: reducer,
|
|
7723
7789
|
viewPresets: reducer$2
|
|
7724
7790
|
},
|
|
7725
|
-
sagas: [workspaceSaga, rootSaga
|
|
7726
|
-
|
|
7727
|
-
|
|
7728
|
-
/******************************************************************************
|
|
7729
|
-
Copyright (c) Microsoft Corporation.
|
|
7730
|
-
|
|
7731
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
7732
|
-
purpose with or without fee is hereby granted.
|
|
7733
|
-
|
|
7734
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
7735
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
7736
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
7737
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
7738
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
7739
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
7740
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
7741
|
-
***************************************************************************** */
|
|
7742
|
-
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
7743
|
-
|
|
7744
|
-
|
|
7745
|
-
function __rest(s, e) {
|
|
7746
|
-
var t = {};
|
|
7747
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
7748
|
-
t[p] = s[p];
|
|
7749
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7750
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7751
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
7752
|
-
t[p[i]] = s[p[i]];
|
|
7753
|
-
}
|
|
7754
|
-
return t;
|
|
7755
|
-
}
|
|
7756
|
-
|
|
7757
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
7758
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
7759
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
7760
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
7761
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7762
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7763
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
7764
|
-
});
|
|
7765
|
-
}
|
|
7766
|
-
|
|
7767
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
7768
|
-
var e = new Error(message);
|
|
7769
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
7791
|
+
sagas: [workspaceSaga, rootSaga],
|
|
7792
|
+
middlewares: [viewPresetsListener.middleware]
|
|
7770
7793
|
};
|
|
7771
7794
|
|
|
7772
7795
|
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
@@ -8596,7 +8619,8 @@ const WorkspaceSelectList = ({
|
|
|
8596
8619
|
"data-testid": `${_testIdPrefix}-selectList`,
|
|
8597
8620
|
sx: {
|
|
8598
8621
|
height: `calc(100% - ${DEFAULT_FILTER_HEIGHT}px)`,
|
|
8599
|
-
minHeight: MIN_HEIGHT_SCROLLABLE_LIST
|
|
8622
|
+
minHeight: MIN_HEIGHT_SCROLLABLE_LIST,
|
|
8623
|
+
overflow: 'hidden'
|
|
8600
8624
|
}
|
|
8601
8625
|
}, {
|
|
8602
8626
|
children: [jsxs(Box, Object.assign({
|
|
@@ -8825,6 +8849,50 @@ const ViewPresetMenuListConnect = ({
|
|
|
8825
8849
|
}));
|
|
8826
8850
|
};
|
|
8827
8851
|
|
|
8852
|
+
const ResizeMenu = ({
|
|
8853
|
+
onCloseMenu,
|
|
8854
|
+
title,
|
|
8855
|
+
children
|
|
8856
|
+
}) => {
|
|
8857
|
+
return jsx(Resizable, Object.assign({
|
|
8858
|
+
defaultSize: {
|
|
8859
|
+
width: 320,
|
|
8860
|
+
height: '90%'
|
|
8861
|
+
},
|
|
8862
|
+
minHeight: 110,
|
|
8863
|
+
minWidth: 280,
|
|
8864
|
+
style: {
|
|
8865
|
+
display: 'flex',
|
|
8866
|
+
alignItems: 'center',
|
|
8867
|
+
justifyContent: 'center'
|
|
8868
|
+
},
|
|
8869
|
+
enable: {
|
|
8870
|
+
top: true,
|
|
8871
|
+
right: true,
|
|
8872
|
+
bottom: true,
|
|
8873
|
+
left: true,
|
|
8874
|
+
topRight: true,
|
|
8875
|
+
bottomRight: true,
|
|
8876
|
+
bottomLeft: true,
|
|
8877
|
+
topLeft: true
|
|
8878
|
+
}
|
|
8879
|
+
}, {
|
|
8880
|
+
children: jsx(ToolContainer, Object.assign({
|
|
8881
|
+
title: title,
|
|
8882
|
+
onClose: onCloseMenu,
|
|
8883
|
+
style: {
|
|
8884
|
+
width: '100%',
|
|
8885
|
+
height: '100%'
|
|
8886
|
+
},
|
|
8887
|
+
onClick: event => {
|
|
8888
|
+
event.stopPropagation();
|
|
8889
|
+
}
|
|
8890
|
+
}, {
|
|
8891
|
+
children: children
|
|
8892
|
+
}))
|
|
8893
|
+
}));
|
|
8894
|
+
};
|
|
8895
|
+
|
|
8828
8896
|
const ViewPresetMenu = ({
|
|
8829
8897
|
hideBackdrop: _hideBackdrop = false,
|
|
8830
8898
|
closeMenu,
|
|
@@ -8833,41 +8901,30 @@ const ViewPresetMenu = ({
|
|
|
8833
8901
|
const {
|
|
8834
8902
|
t
|
|
8835
8903
|
} = useWorkspaceTranslation();
|
|
8836
|
-
const toolContainer = jsx(
|
|
8837
|
-
style: {
|
|
8838
|
-
width: 320,
|
|
8839
|
-
height: 'calc(100% - 80px)',
|
|
8840
|
-
position: 'absolute',
|
|
8841
|
-
top: '16px'
|
|
8842
|
-
},
|
|
8904
|
+
const toolContainer = jsx(ResizeMenu, Object.assign({
|
|
8843
8905
|
title: t('workspace-viewpreset-menu'),
|
|
8844
|
-
|
|
8845
|
-
onClick: event => {
|
|
8846
|
-
event.stopPropagation();
|
|
8847
|
-
}
|
|
8906
|
+
onCloseMenu: closeMenu
|
|
8848
8907
|
}, {
|
|
8849
8908
|
children: jsx(ViewPresetMenuListConnect, {
|
|
8850
8909
|
panelId: panelId
|
|
8851
8910
|
})
|
|
8852
8911
|
}));
|
|
8853
8912
|
renderCounter.count(ViewPresetMenu.name);
|
|
8854
|
-
return
|
|
8855
|
-
|
|
8856
|
-
|
|
8857
|
-
|
|
8858
|
-
|
|
8859
|
-
|
|
8860
|
-
|
|
8861
|
-
'
|
|
8862
|
-
|
|
8863
|
-
|
|
8864
|
-
|
|
8865
|
-
|
|
8866
|
-
|
|
8867
|
-
|
|
8868
|
-
|
|
8869
|
-
}))
|
|
8870
|
-
});
|
|
8913
|
+
return _hideBackdrop ?
|
|
8914
|
+
// Enable hiding backdrop from snapshot tests
|
|
8915
|
+
toolContainer : jsx(Backdrop, Object.assign({
|
|
8916
|
+
"data-testid": "viewpresetMenuBackdrop",
|
|
8917
|
+
open: true,
|
|
8918
|
+
sx: {
|
|
8919
|
+
'&.MuiBackdrop-root': {
|
|
8920
|
+
position: 'absolute',
|
|
8921
|
+
zIndex: 1002
|
|
8922
|
+
}
|
|
8923
|
+
},
|
|
8924
|
+
onClick: closeMenu
|
|
8925
|
+
}, {
|
|
8926
|
+
children: toolContainer
|
|
8927
|
+
}));
|
|
8871
8928
|
};
|
|
8872
8929
|
|
|
8873
8930
|
const WorkspaceOptionsNoMemo = ({
|
|
@@ -9682,37 +9739,26 @@ const WorkspaceMenu = ({
|
|
|
9682
9739
|
const {
|
|
9683
9740
|
t
|
|
9684
9741
|
} = useWorkspaceTranslation();
|
|
9685
|
-
const toolContainer = jsx(
|
|
9686
|
-
style: {
|
|
9687
|
-
width: 320,
|
|
9688
|
-
height: 'calc(100vh - 88px)',
|
|
9689
|
-
position: 'absolute',
|
|
9690
|
-
top: '16px'
|
|
9691
|
-
},
|
|
9742
|
+
const toolContainer = jsx(ResizeMenu, Object.assign({
|
|
9692
9743
|
title: t('workspace-menu'),
|
|
9693
|
-
|
|
9694
|
-
onClick: event => {
|
|
9695
|
-
event.stopPropagation();
|
|
9696
|
-
}
|
|
9744
|
+
onCloseMenu: closeMenu
|
|
9697
9745
|
}, {
|
|
9698
9746
|
children: jsx(WorkspaceSelectListConnect, {})
|
|
9699
9747
|
}));
|
|
9700
|
-
return
|
|
9701
|
-
|
|
9702
|
-
|
|
9703
|
-
|
|
9704
|
-
|
|
9705
|
-
|
|
9706
|
-
|
|
9707
|
-
'
|
|
9708
|
-
|
|
9709
|
-
|
|
9710
|
-
|
|
9711
|
-
|
|
9712
|
-
|
|
9713
|
-
|
|
9714
|
-
}))
|
|
9715
|
-
});
|
|
9748
|
+
return _hideBackdrop ?
|
|
9749
|
+
// Enable hiding backdrop from snapshot tests
|
|
9750
|
+
toolContainer : jsx(Backdrop, Object.assign({
|
|
9751
|
+
"data-testid": "workspaceMenuBackdrop",
|
|
9752
|
+
open: true,
|
|
9753
|
+
sx: {
|
|
9754
|
+
'&.MuiBackdrop-root': {
|
|
9755
|
+
top: '40px'
|
|
9756
|
+
}
|
|
9757
|
+
},
|
|
9758
|
+
onClick: closeMenu
|
|
9759
|
+
}, {
|
|
9760
|
+
children: toolContainer
|
|
9761
|
+
}));
|
|
9716
9762
|
};
|
|
9717
9763
|
|
|
9718
9764
|
const WorkspaceMenuButton = ({
|
|
@@ -9871,7 +9917,7 @@ const WorkspaceTab = ({
|
|
|
9871
9917
|
activeTab,
|
|
9872
9918
|
workspaceId
|
|
9873
9919
|
}) => {
|
|
9874
|
-
return jsxs(Box
|
|
9920
|
+
return jsxs(Box, Object.assign({
|
|
9875
9921
|
sx: {
|
|
9876
9922
|
display: 'flex',
|
|
9877
9923
|
flexDirection: 'row',
|
|
@@ -10522,4 +10568,4 @@ const WorkspaceDetail = ({
|
|
|
10522
10568
|
}));
|
|
10523
10569
|
};
|
|
10524
10570
|
|
|
10525
|
-
export { ComponentsLookUpWrapper, DemoWrapper, WorkspaceDetail, WorkspaceErrorType, WorkspaceI18nProvider, WorkspaceModuleProvider, WorkspacePresetAction, WorkspaceTopBar, WorkspaceViewConnect, WorkspaceWrapperProviderWithStore, workspaceActions as actions, createBalancedMosaicNode, createCustomEmptyMapWorkspace, defaultAuthConfig, emptyMapWorkspace, getWorkspaceRouteUrl, selectors$1 as selectors, viewPresetActions, workspaceListActions, workspaceModuleConfig, reducer$1 as workspaceReducer, routes as workspaceRoutes, workspaceTranslations };
|
|
10571
|
+
export { ComponentsLookUpWrapper, DemoWrapper, WORKSPACE_NAMESPACE, WorkspaceDetail, WorkspaceErrorType, WorkspaceI18nProvider, WorkspaceModuleProvider, WorkspacePresetAction, WorkspaceTopBar, WorkspaceViewConnect, WorkspaceWrapperProviderWithStore, workspaceActions as actions, createBalancedMosaicNode, createCustomEmptyMapWorkspace, defaultAuthConfig, emptyMapWorkspace, getWorkspaceRouteUrl, selectors$1 as selectors, viewPresetActions, workspaceListActions, workspaceModuleConfig, reducer$1 as workspaceReducer, routes as workspaceRoutes, workspaceTranslations };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/workspace",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.23.1",
|
|
4
4
|
"description": "GeoWeb Workspace library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"react-redux": "^8.1.3",
|
|
12
12
|
"@opengeoweb/shared": "*",
|
|
13
|
-
"@mui/material": "
|
|
13
|
+
"@mui/material": "^5.16.0",
|
|
14
14
|
"@opengeoweb/store": "*",
|
|
15
15
|
"@opengeoweb/api": "*",
|
|
16
16
|
"react-hook-form": "^7.50.1",
|
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
"@reduxjs/toolkit": "^1.9.7",
|
|
19
19
|
"@opengeoweb/snackbar": "*",
|
|
20
20
|
"react-window": "^1.8.10",
|
|
21
|
-
"@mui/system": "^5.15.1",
|
|
22
21
|
"lodash": "^4.17.21",
|
|
23
22
|
"@redux-eggs/core": "^2.2.0",
|
|
24
23
|
"@redux-eggs/redux-toolkit": "^2.2.0",
|
|
@@ -37,7 +36,7 @@
|
|
|
37
36
|
"@opengeoweb/warnings": "*",
|
|
38
37
|
"i18next": "^23.11.5",
|
|
39
38
|
"react-i18next": "^14.1.2",
|
|
40
|
-
"@opengeoweb/webmap-react": "9.
|
|
39
|
+
"@opengeoweb/webmap-react": "9.23.1"
|
|
41
40
|
},
|
|
42
41
|
"peerDependencies": {
|
|
43
42
|
"react": "18"
|
package/src/index.d.ts
CHANGED
|
@@ -10,7 +10,8 @@ export * from './lib/components/ComponentsLookUpWrapper';
|
|
|
10
10
|
export * from './lib/components/WorkspaceView';
|
|
11
11
|
export * from './lib/components/WorkspaceTopBar';
|
|
12
12
|
export * from './lib/components/WorkspaceDetail';
|
|
13
|
+
export { WORKSPACE_NAMESPACE } from './lib/utils/i18n';
|
|
13
14
|
export { workspaceTranslations };
|
|
14
15
|
export { routes as workspaceRoutes, getWorkspaceRouteUrl, } from './lib/utils/routes';
|
|
15
16
|
export { emptyMapWorkspace, createCustomEmptyMapWorkspace, } from './lib/store/workspaceList/utils';
|
|
16
|
-
export type { WorkspaceModuleStore } from './lib/store/
|
|
17
|
+
export type { WorkspaceModuleStore } from './lib/store/types';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ResizeMenu';
|
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
import { Egg } from '@redux-eggs/core';
|
|
2
2
|
import { Store } from '@reduxjs/toolkit';
|
|
3
|
-
import {
|
|
4
|
-
import { WorkspaceListState } from './workspaceList/types';
|
|
5
|
-
import { ViewPresetListState } from './viewPresetsList/types';
|
|
6
|
-
import { ViewPresetState } from './viewPresets/types';
|
|
7
|
-
export interface WorkspaceModuleStore {
|
|
8
|
-
workspace?: WorkspaceState;
|
|
9
|
-
workspaceList?: WorkspaceListState;
|
|
10
|
-
viewPresetsList?: ViewPresetListState;
|
|
11
|
-
viewPresets?: ViewPresetState;
|
|
12
|
-
}
|
|
3
|
+
import { WorkspaceModuleStore } from './types';
|
|
13
4
|
declare const workspaceModuleConfig: Egg<Store<WorkspaceModuleStore>>;
|
|
14
5
|
export default workspaceModuleConfig;
|
package/src/lib/store/store.d.ts
CHANGED
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
import type { CoreAppStore } from '@opengeoweb/store';
|
|
2
|
-
import type { WorkspaceModuleStore } from './config';
|
|
3
|
-
export interface AppStore extends WorkspaceModuleStore, CoreAppStore {
|
|
4
|
-
}
|
|
5
1
|
declare const store: import("@redux-eggs/core").EggExt & import("@reduxjs/toolkit/dist/configureStore").ToolkitStore<any, import("redux").AnyAction, [import("@reduxjs/toolkit").ThunkMiddleware<any, import("redux").AnyAction, undefined>]>;
|
|
6
2
|
export { store };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CoreAppStore } from '@opengeoweb/store';
|
|
2
|
+
import { WorkspaceState } from './workspace/types';
|
|
3
|
+
import { WorkspaceListState } from './workspaceList/types';
|
|
4
|
+
import { ViewPresetListState } from './viewPresetsList/types';
|
|
5
|
+
import { ViewPresetState } from './viewPresets/types';
|
|
6
|
+
export interface AppStore extends WorkspaceModuleStore, CoreAppStore {
|
|
7
|
+
}
|
|
8
|
+
export interface WorkspaceModuleStore {
|
|
9
|
+
workspace?: WorkspaceState;
|
|
10
|
+
workspaceList?: WorkspaceListState;
|
|
11
|
+
viewPresetsList?: ViewPresetListState;
|
|
12
|
+
viewPresets?: ViewPresetState;
|
|
13
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { WorkspaceModuleStore } from '../types';
|
|
2
|
+
export declare const viewPresetsListener: import("@reduxjs/toolkit").ListenerMiddlewareInstance<WorkspaceModuleStore, import("@reduxjs/toolkit").ThunkDispatch<WorkspaceModuleStore, unknown, import("redux").AnyAction>, unknown>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AppStore } from '../
|
|
1
|
+
import type { AppStore } from '../types';
|
|
2
2
|
import { ViewPresetListItem } from '../workspace/types';
|
|
3
3
|
import { ViewPresetEntity, ViewPresetError, ViewPresetState } from './types';
|
|
4
4
|
export declare const getViewPresetsStore: (store: AppStore) => ViewPresetState;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AppStore } from '../
|
|
1
|
+
import { AppStore } from '../types';
|
|
2
2
|
import { ViewPresetListItem, ViewPresetListState } from './types';
|
|
3
3
|
import { ViewPresetsListFilter } from '../viewPresets/types';
|
|
4
4
|
export declare const getViewPresetsListStore: (store: AppStore) => ViewPresetListState;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WorkspaceListState } from './types';
|
|
2
|
-
import { AppStore } from '../
|
|
2
|
+
import { AppStore } from '../types';
|
|
3
3
|
export declare const getWorkspaceListStore: (store: AppStore) => WorkspaceListState;
|
|
4
4
|
export declare const getWorkspaceList: (state: AppStore) => import("../workspace/types").WorkspacePresetListItem[];
|
|
5
5
|
export declare const getIsWorkspaceListFetching: ((state: AppStore) => boolean) & import("reselect").OutputSelectorFields<(args_0: WorkspaceListState, args_1: AppStore) => boolean, {
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { SagaIterator } from 'redux-saga';
|
|
2
|
-
import { viewPresetActions } from './reducer';
|
|
3
|
-
export declare function fetchInitialViewPresetsSaga(): SagaIterator;
|
|
4
|
-
export declare function fetchViewPresetsSaga({ payload, }: ReturnType<typeof viewPresetActions.fetchViewPresets>): SagaIterator;
|
|
5
|
-
export declare function saveViewPresetSaga({ payload, }: ReturnType<typeof viewPresetActions.saveViewPreset>): SagaIterator;
|
|
6
|
-
export declare function selectViewPresetSaga({ payload, }: ReturnType<typeof viewPresetActions.selectViewPreset>): SagaIterator;
|
|
7
|
-
export declare function onSuccessViewPresetActionSaga({ payload, }: ReturnType<typeof viewPresetActions.onSuccessViewPresetAction>): SagaIterator;
|
|
8
|
-
export declare function rootSaga(): SagaIterator;
|
|
9
|
-
export default rootSaga;
|
/package/src/lib/{store/viewPresets/sagas.spec.d.ts → components/ResizeMenu/ResizeMenu.spec.d.ts}
RENAMED
|
File without changes
|