@opengeoweb/workspace 9.22.0 → 9.24.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 +275 -421
- package/package.json +2 -3
- package/src/index.d.ts +1 -1
- 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/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/components/WorkspaceFilter/FilterChip.d.ts +0 -10
- package/src/lib/components/WorkspaceFilter/FilterList.d.ts +0 -9
- package/src/lib/components/WorkspaceFilter/FilterList.spec.d.ts +0 -1
- package/src/lib/components/WorkspaceFilter/SearchField.d.ts +0 -8
- package/src/lib/components/WorkspaceFilter/SearchField.spec.d.ts +0 -1
- package/src/lib/components/WorkspaceFilter/WorkspaceFilter.d.ts +0 -13
- package/src/lib/components/WorkspaceFilter/WorkspaceFilter.spec.d.ts +0 -1
- package/src/lib/components/WorkspaceFilter/WorkspaceFilter.stories.d.ts +0 -25
- package/src/lib/store/viewPresets/sagas.d.ts +0 -9
- package/src/lib/store/viewPresets/sagas.spec.d.ts +0 -1
- /package/src/lib/{components/WorkspaceFilter/FilterChip.spec.d.ts → store/viewPresets/listener.integration.spec.d.ts} +0 -0
package/index.esm.js
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
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, Resizable, ToolContainer, renderCounter, CustomToggleButton, ConfirmationDialog } from '@opengeoweb/shared';
|
|
7
|
+
import { SHARED_NAMESPACE, sharedTranslations, isAxiosAuthError, getAxiosErrorMessage, isAxiosError, withEggs, ConfirmationServiceProvider, useConfirmationDialog, CustomIconButton, AlertBanner, CustomTooltip, SearchHighlight, ToggleMenu, DEFAULT_FILTER_HEIGHT, usePrevious, Filter, 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
11
|
import { FORM_FIELDS_NAMESPACE, formFieldsTranslations, ReactHookFormTextField, ReactHookFormHiddenInput, ReactHookFormProvider, defaultFormOptions } from '@opengeoweb/form-fields';
|
|
12
12
|
import { takeLatest, takeEvery, debounce, delay, put, all, select, call as call$g, takeLeading } from 'redux-saga/effects';
|
|
13
13
|
import { snackbarActions, SnackbarWrapperConnect } from '@opengeoweb/snackbar';
|
|
14
|
+
import { isAxiosError as isAxiosError$1 } from 'axios';
|
|
14
15
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
15
|
-
import { ThemeWrapper, lightTheme, SplitVertical, SplitHorizontal, Expand, UnExpand, Close, Delete, Preset, PresetWorkspace, PresetTiles,
|
|
16
|
+
import { ThemeWrapper, lightTheme, SplitVertical, SplitHorizontal, Expand, UnExpand, Close, Delete, Preset, PresetWorkspace, PresetTiles, CloudLoading, CloudIdle, WebAssetOff } from '@opengeoweb/theme';
|
|
16
17
|
import { Provider, useDispatch, useSelector, useStore, shallowEqual } from 'react-redux';
|
|
17
18
|
import { timeSeriesModuleConfig } from '@opengeoweb/timeseries';
|
|
18
19
|
import { AuthenticationProvider, useAuthenticationContext } from '@opengeoweb/authentication';
|
|
@@ -21,20 +22,15 @@ import { getSagaExtension } from '@redux-eggs/saga-extension';
|
|
|
21
22
|
import { produce } from 'immer';
|
|
22
23
|
import * as React from 'react';
|
|
23
24
|
import React__default, { useCallback } from 'react';
|
|
24
|
-
import { LinearProgress, Typography, ListItem, ListItemButton, ListItemIcon, ListItemText, Grid,
|
|
25
|
+
import { LinearProgress, Typography, ListItem, ListItemButton, ListItemIcon, ListItemText, Grid, Box, Backdrop, Menu, ListSubheader, MenuItem, useTheme, Tabs } from '@mui/material';
|
|
25
26
|
import 'react-mosaic-component/react-mosaic-component.css';
|
|
26
27
|
import AutoSizer from 'react-virtualized-auto-sizer';
|
|
27
28
|
import { FixedSizeList } from 'react-window';
|
|
28
|
-
import { Box as Box$1 } from '@mui/system';
|
|
29
29
|
import { useFormContext } from 'react-hook-form';
|
|
30
30
|
|
|
31
31
|
var en = {
|
|
32
32
|
"workspace-menu": "Workspace menu",
|
|
33
33
|
"workspace-new": "New workspace",
|
|
34
|
-
"workspace-my-presets": "My presets",
|
|
35
|
-
"workspace-system-presets": "System presets",
|
|
36
|
-
"workspace-all-button": "All",
|
|
37
|
-
"workspace-search": "Search",
|
|
38
34
|
"workspace-loading": "Loading",
|
|
39
35
|
"workspace-options": "Options",
|
|
40
36
|
"workspace-results": "results",
|
|
@@ -90,73 +86,65 @@ var en = {
|
|
|
90
86
|
"workspace-viewpreset-menu": "View presets menu"
|
|
91
87
|
};
|
|
92
88
|
var fi = {
|
|
93
|
-
"workspace-menu": "
|
|
94
|
-
"workspace-new": "
|
|
95
|
-
"workspace-
|
|
96
|
-
"workspace-
|
|
97
|
-
"workspace-
|
|
98
|
-
"workspace-
|
|
99
|
-
"
|
|
100
|
-
"workspace-
|
|
101
|
-
"workspace-
|
|
102
|
-
"workspace-
|
|
103
|
-
"
|
|
104
|
-
"workspace-
|
|
105
|
-
"
|
|
106
|
-
"workspace-
|
|
107
|
-
"workspace-
|
|
108
|
-
"workspace-
|
|
109
|
-
"
|
|
110
|
-
"workspace-
|
|
111
|
-
"workspace-
|
|
112
|
-
"workspace-dialog-
|
|
113
|
-
"workspace-
|
|
114
|
-
"workspace-
|
|
115
|
-
"workspace-
|
|
116
|
-
"workspace-
|
|
117
|
-
"workspace-
|
|
118
|
-
"workspace-
|
|
119
|
-
"workspace-
|
|
120
|
-
"workspace-
|
|
121
|
-
"workspace-
|
|
122
|
-
"workspace-control-
|
|
123
|
-
"workspace-control-
|
|
124
|
-
"workspace-control-
|
|
125
|
-
"workspace-
|
|
126
|
-
"workspace-
|
|
127
|
-
"workspace-
|
|
128
|
-
"workspace-
|
|
129
|
-
"workspace-mappreset-
|
|
130
|
-
"workspace-
|
|
131
|
-
"workspace-
|
|
132
|
-
"workspace-mappreset-dialog-title": "
|
|
133
|
-
"workspace-mappreset-save
|
|
134
|
-
"workspace-mappreset-
|
|
135
|
-
"workspace-
|
|
136
|
-
"workspace-
|
|
137
|
-
"workspace-
|
|
138
|
-
"workspace-
|
|
139
|
-
"workspace-list-
|
|
140
|
-
"workspace-list-success-save
|
|
141
|
-
"workspace-
|
|
142
|
-
"workspace-
|
|
143
|
-
"workspace-
|
|
144
|
-
"workspace-
|
|
145
|
-
"workspace-
|
|
146
|
-
"workspace-
|
|
147
|
-
"workspace-viewpreset-
|
|
148
|
-
"workspace-viewpreset-success-save-as": "ei käännetty",
|
|
149
|
-
"workspace-viewpreset-success-edit": "ei käännetty",
|
|
150
|
-
"workspace-viewpreset-success-save": "ei käännetty",
|
|
151
|
-
"workspace-viewpreset-menu": "ei käännetty"
|
|
89
|
+
"workspace-menu": "Workspace menu",
|
|
90
|
+
"workspace-new": "Uusi workspace",
|
|
91
|
+
"workspace-loading": "Ladataan",
|
|
92
|
+
"workspace-options": "Valinnat",
|
|
93
|
+
"workspace-results": "tulokset",
|
|
94
|
+
"workspace-delete": "Poista",
|
|
95
|
+
"workspce-clear": "Tyhjennä",
|
|
96
|
+
"workspace-save": "Tallenna",
|
|
97
|
+
"workspace-save-as": "Tallenna nimellä",
|
|
98
|
+
"workspace-save-incl-viewpresets": "Tallenna (sisältäen viewpresetit)",
|
|
99
|
+
"workspace-edit": "Muokkaa (nimeä)",
|
|
100
|
+
"workspace-edit-both": "Muokkaa (nimeä ja tiivistelmää)",
|
|
101
|
+
"geoweb-welcome": "Tervetuloa Geoweb-sovellukseen. Valitse jokin preset avataksesi uusia näkymiä",
|
|
102
|
+
"workspace-modified-new": "muokattu",
|
|
103
|
+
"workspace-modified-existing": "ei tallennettu",
|
|
104
|
+
"workspace-dialog-delete": "Poista workspace",
|
|
105
|
+
"workspace-duplicate": "Monista",
|
|
106
|
+
"workspace-cancel": "Peruuta",
|
|
107
|
+
"workspace-dialog-name": "Nimi",
|
|
108
|
+
"workspace-dialog-abstract": "Tiivistelmä",
|
|
109
|
+
"workspace-dialog-confirm-delete-message": "Oletko varma, että haluat poistaa workspace presetin: \"{{TITLE}}\"?",
|
|
110
|
+
"workspace-error-fetch": "Workspace listan hakeminen epäonnistui",
|
|
111
|
+
"workspace-error-fetch-detail": "Workspacen \"{{WORKSPACE_ID}}\" hakeminen epäonnistui",
|
|
112
|
+
"workspace-retry": "Yritä uudelleen",
|
|
113
|
+
"workspace-delete-tooltip": "Poista preset",
|
|
114
|
+
"workspace-control-split-horizontal": "Jaa ikkuna vaakasuoraan",
|
|
115
|
+
"workspace-control-split-vertical": "Jaa ikkuna pystysuoraan",
|
|
116
|
+
"workspace-control-expand": "Laajenna ikkuna",
|
|
117
|
+
"workspace-control-unexpand": "Supista ikkuna",
|
|
118
|
+
"workspace-control-close": "Sulje ikkuna",
|
|
119
|
+
"workspace-control-close-message-title": "Hups",
|
|
120
|
+
"workspace-control-close-message-description": "Oletko varma, että haluat sulkea tämän ikkunan? Kaikki muutokset menetetään",
|
|
121
|
+
"workspace-mappreset-delete-message": "Haluatko varmasti poistaa map presetin: \"{{TITLE}}\"?",
|
|
122
|
+
"workspace-viewpresets-fail-fetch": "Näkymän \"{{VIEWPRESET_ID}}\" hakeminen epäonnistui",
|
|
123
|
+
"workspace-viewpresets-error": "View presetit eivät ole käytettävissä",
|
|
124
|
+
"workspace-mappreset-dialog-title": "Map presetin nimi",
|
|
125
|
+
"workspace-mappreset-save-as": "Tallenna map preset nimellä",
|
|
126
|
+
"workspace-mappreset-new": "Uusi map preset",
|
|
127
|
+
"workspace-mappreset-dialog-title-delete": "Poista map preset",
|
|
128
|
+
"workspace-mappreset-dialog-title-edit": "Muokkaa map presettiä",
|
|
129
|
+
"workspace-mappreset-error-save": "Map presetin tallentaminen epäonnistui. Yritä myöhemmin uudelleen",
|
|
130
|
+
"workspace-mappreset-error-fetch": "Map presettien hakeminen epäonnistui",
|
|
131
|
+
"workspace-list-error": "Workspace presettien hakeminen epäonnistui",
|
|
132
|
+
"workspace-list-success-save-all": "Workspace \"{{TITLE}}\" ja siihen sisältyvät viewpresetit tallennettu onnistuneesti",
|
|
133
|
+
"workspace-list-success-delete": "Workspace \"{{TITLE}}\" poistettu onnistuneesti",
|
|
134
|
+
"workspace-list-success-duplicate": "Workspace \"{{TITLE}}\" tallennettu onnistuneesti",
|
|
135
|
+
"workspace-list-success-edit": "Workspacea \"{{TITLE}}\" muokattu onnistuneesti",
|
|
136
|
+
"workspace-list-success-save": "Workspace \"{{TITLE}}\" tallennettu onnistuneesti",
|
|
137
|
+
"workspace-save-error": "Workspacen \"{{TITLE}}\" tallentaminen epäonnistui",
|
|
138
|
+
"workspace-error-generic": "Jotain meni mönkään. Yritä uudelleen.",
|
|
139
|
+
"workspace-viewpreset-success-delete": "Map preset \"{{TITLE}}\" poistettu onnistuneesti",
|
|
140
|
+
"workspace-viewpreset-success-save-as": "Uusi map preset \"{{TITLE}}\" tallennettu onnistuneesti",
|
|
141
|
+
"workspace-viewpreset-success-edit": "Map presettiä \"{{TITLE}}\" muokattu onnistuneesti",
|
|
142
|
+
"workspace-viewpreset-success-save": "Map preset \"{{TITLE}}\" tallennettu onnistuneesti",
|
|
143
|
+
"workspace-viewpreset-menu": "View preset menu"
|
|
152
144
|
};
|
|
153
145
|
var no = {
|
|
154
146
|
"workspace-menu": "Arbeidsrommeny",
|
|
155
147
|
"workspace-new": "Nytt arbeidsrom",
|
|
156
|
-
"workspace-my-presets": "Mine presets",
|
|
157
|
-
"workspace-system-presets": "System presets",
|
|
158
|
-
"workspace-all-button": "Alle",
|
|
159
|
-
"workspace-search": "Søk",
|
|
160
148
|
"workspace-loading": "Laster",
|
|
161
149
|
"workspace-options": "Valg",
|
|
162
150
|
"workspace-results": "resultater",
|
|
@@ -214,10 +202,6 @@ var no = {
|
|
|
214
202
|
var nl = {
|
|
215
203
|
"workspace-menu": "Workspace menu",
|
|
216
204
|
"workspace-new": "Nieuwe workspace",
|
|
217
|
-
"workspace-my-presets": "Mijn presets",
|
|
218
|
-
"workspace-system-presets": "Systeem presets",
|
|
219
|
-
"workspace-all-button": "Alle",
|
|
220
|
-
"workspace-search": "Zoeken",
|
|
221
205
|
"workspace-loading": "Laden",
|
|
222
206
|
"workspace-options": "Opties",
|
|
223
207
|
"workspace-results": "resultaten",
|
|
@@ -1735,13 +1719,13 @@ var WorkspaceErrorType;
|
|
|
1735
1719
|
})(WorkspaceErrorType || (WorkspaceErrorType = {}));
|
|
1736
1720
|
|
|
1737
1721
|
const workspaceListFilterOptions = [{
|
|
1738
|
-
label: '
|
|
1722
|
+
label: 'shared-filter-my-presets',
|
|
1739
1723
|
id: 'user',
|
|
1740
1724
|
type: 'scope',
|
|
1741
1725
|
isSelected: true,
|
|
1742
1726
|
isDisabled: false
|
|
1743
1727
|
}, {
|
|
1744
|
-
label: '
|
|
1728
|
+
label: 'shared-filter-system-presets',
|
|
1745
1729
|
id: 'system',
|
|
1746
1730
|
type: 'scope',
|
|
1747
1731
|
isSelected: true,
|
|
@@ -2885,13 +2869,13 @@ var PresetAction;
|
|
|
2885
2869
|
})(PresetAction || (PresetAction = {}));
|
|
2886
2870
|
|
|
2887
2871
|
const viewPresetsListFilterOptions = [{
|
|
2888
|
-
label: '
|
|
2872
|
+
label: 'shared-filter-my-presets',
|
|
2889
2873
|
id: 'user',
|
|
2890
2874
|
type: 'scope',
|
|
2891
2875
|
isSelected: true,
|
|
2892
2876
|
isDisabled: false
|
|
2893
2877
|
}, {
|
|
2894
|
-
label: '
|
|
2878
|
+
label: 'shared-filter-system-presets',
|
|
2895
2879
|
id: 'system',
|
|
2896
2880
|
type: 'scope',
|
|
2897
2881
|
isSelected: true,
|
|
@@ -3588,7 +3572,7 @@ const initWorkspaceTestI18n = () => {
|
|
|
3588
3572
|
});
|
|
3589
3573
|
};
|
|
3590
3574
|
initWorkspaceTestI18n();
|
|
3591
|
-
const ns = [WORKSPACE_NAMESPACE];
|
|
3575
|
+
const ns = [WORKSPACE_NAMESPACE, SHARED_NAMESPACE];
|
|
3592
3576
|
const translateKeyOutsideComponents = (key, params = undefined) => i18n.t(key, Object.assign({
|
|
3593
3577
|
ns
|
|
3594
3578
|
}, params));
|
|
@@ -4064,7 +4048,6 @@ const getSnackbarMessage = (action, title) => {
|
|
|
4064
4048
|
});
|
|
4065
4049
|
}
|
|
4066
4050
|
};
|
|
4067
|
-
const getPresetsApi = () => getApi(API_NAME);
|
|
4068
4051
|
const emptyMapViewPreset = {
|
|
4069
4052
|
componentType: 'Map',
|
|
4070
4053
|
keywords: '',
|
|
@@ -7515,12 +7498,56 @@ function* submitFormWorkspaceDialogSaga({
|
|
|
7515
7498
|
}));
|
|
7516
7499
|
}
|
|
7517
7500
|
}
|
|
7518
|
-
function* rootSaga
|
|
7501
|
+
function* rootSaga() {
|
|
7519
7502
|
yield takeLeading(workspaceListActions.fetchWorkspaceList.type, fetchWorkspaceListSaga);
|
|
7520
7503
|
yield takeLatest(workspaceListActions.onSuccessWorkspacePresetAction, onSuccessWorkspacePresetsActionSaga);
|
|
7521
7504
|
yield takeLatest(workspaceListActions.submitFormWorkspaceActionDialogOptions, submitFormWorkspaceDialogSaga);
|
|
7522
7505
|
}
|
|
7523
7506
|
|
|
7507
|
+
/******************************************************************************
|
|
7508
|
+
Copyright (c) Microsoft Corporation.
|
|
7509
|
+
|
|
7510
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
7511
|
+
purpose with or without fee is hereby granted.
|
|
7512
|
+
|
|
7513
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
7514
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
7515
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
7516
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
7517
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
7518
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
7519
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
7520
|
+
***************************************************************************** */
|
|
7521
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
7522
|
+
|
|
7523
|
+
|
|
7524
|
+
function __rest(s, e) {
|
|
7525
|
+
var t = {};
|
|
7526
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
7527
|
+
t[p] = s[p];
|
|
7528
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7529
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7530
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
7531
|
+
t[p[i]] = s[p[i]];
|
|
7532
|
+
}
|
|
7533
|
+
return t;
|
|
7534
|
+
}
|
|
7535
|
+
|
|
7536
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
7537
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
7538
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
7539
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
7540
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7541
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7542
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
7543
|
+
});
|
|
7544
|
+
}
|
|
7545
|
+
|
|
7546
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
7547
|
+
var e = new Error(message);
|
|
7548
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
7549
|
+
};
|
|
7550
|
+
|
|
7524
7551
|
/* *
|
|
7525
7552
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7526
7553
|
* you may not use this file except in compliance with the License.
|
|
@@ -7538,7 +7565,7 @@ function* rootSaga$1() {
|
|
|
7538
7565
|
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
7539
7566
|
* */
|
|
7540
7567
|
const processError = (error, component, errorMessageKey) => {
|
|
7541
|
-
const message = isAxiosError(error) ? getAxiosErrorMessage(error) : translateKeyOutsideComponents(errorMessageKey);
|
|
7568
|
+
const message = isAxiosError$1(error) ? getAxiosErrorMessage(error) : translateKeyOutsideComponents(errorMessageKey);
|
|
7542
7569
|
const errorType = isAxiosAuthError(error) ? ViewPresetErrorType.AUTH : ViewPresetErrorType.GENERIC;
|
|
7543
7570
|
return {
|
|
7544
7571
|
message,
|
|
@@ -7546,161 +7573,180 @@ const processError = (error, component, errorMessageKey) => {
|
|
|
7546
7573
|
errorType
|
|
7547
7574
|
};
|
|
7548
7575
|
};
|
|
7549
|
-
|
|
7550
|
-
|
|
7551
|
-
|
|
7552
|
-
|
|
7553
|
-
|
|
7554
|
-
|
|
7555
|
-
|
|
7556
|
-
|
|
7557
|
-
viewPresets
|
|
7558
|
-
|
|
7559
|
-
|
|
7560
|
-
|
|
7561
|
-
|
|
7562
|
-
|
|
7563
|
-
|
|
7564
|
-
}
|
|
7565
|
-
|
|
7566
|
-
|
|
7567
|
-
})
|
|
7568
|
-
|
|
7569
|
-
|
|
7570
|
-
|
|
7571
|
-
|
|
7572
|
-
|
|
7573
|
-
|
|
7576
|
+
const viewPresetsListener = createListenerMiddleware();
|
|
7577
|
+
// fetch initial view presets
|
|
7578
|
+
viewPresetsListener.startListening({
|
|
7579
|
+
actionCreator: viewPresetActions.fetchInitialViewPresets,
|
|
7580
|
+
effect: (_, listenerApi) => __awaiter(void 0, void 0, void 0, function* () {
|
|
7581
|
+
listenerApi.cancelActiveListeners();
|
|
7582
|
+
try {
|
|
7583
|
+
const workspaceApi = getWorkspaceApi();
|
|
7584
|
+
// No filters so we don't need to pass any params for this viewPresets list call
|
|
7585
|
+
const {
|
|
7586
|
+
data: viewPresets
|
|
7587
|
+
} = yield workspaceApi.getViewPresets();
|
|
7588
|
+
listenerApi.dispatch(viewPresetActions.fetchedInitialViewPresets({
|
|
7589
|
+
viewPresets
|
|
7590
|
+
}));
|
|
7591
|
+
} catch (error) {
|
|
7592
|
+
listenerApi.dispatch(viewPresetActions.errorInitialViewPresets({
|
|
7593
|
+
error: processError(error, ViewPresetErrorComponent.PRESET_LIST, 'workspace-mappreset-error-fetch')
|
|
7594
|
+
}));
|
|
7595
|
+
}
|
|
7596
|
+
})
|
|
7597
|
+
});
|
|
7598
|
+
// fetch view presets
|
|
7599
|
+
viewPresetsListener.startListening({
|
|
7600
|
+
actionCreator: viewPresetActions.fetchViewPresets,
|
|
7601
|
+
effect: ({
|
|
7602
|
+
payload
|
|
7603
|
+
}, listenerApi) => __awaiter(void 0, void 0, void 0, function* () {
|
|
7604
|
+
listenerApi.cancelActiveListeners();
|
|
7574
7605
|
const {
|
|
7575
|
-
data: viewPresets
|
|
7576
|
-
} = yield call$g(presetsApi.getViewPresets, filterParams);
|
|
7577
|
-
yield put(viewPresetActions.fetchedViewPresets({
|
|
7578
|
-
viewPresets,
|
|
7579
7606
|
panelId,
|
|
7580
7607
|
filterParams
|
|
7581
|
-
}
|
|
7582
|
-
|
|
7583
|
-
|
|
7584
|
-
|
|
7585
|
-
|
|
7586
|
-
|
|
7587
|
-
|
|
7588
|
-
|
|
7589
|
-
|
|
7590
|
-
|
|
7591
|
-
})
|
|
7592
|
-
|
|
7593
|
-
|
|
7594
|
-
|
|
7595
|
-
|
|
7596
|
-
|
|
7597
|
-
|
|
7598
|
-
|
|
7599
|
-
|
|
7600
|
-
|
|
7601
|
-
|
|
7602
|
-
|
|
7603
|
-
|
|
7604
|
-
|
|
7605
|
-
|
|
7606
|
-
|
|
7607
|
-
|
|
7608
|
-
yield put(viewPresetActions.errorViewPreset({
|
|
7609
|
-
error: processError(error, ViewPresetErrorComponent.PRESET_DETAIL, 'workspace-mappreset-error-save'),
|
|
7608
|
+
} = payload;
|
|
7609
|
+
try {
|
|
7610
|
+
const workspaceApi = getWorkspaceApi();
|
|
7611
|
+
const {
|
|
7612
|
+
data: viewPresets
|
|
7613
|
+
} = yield workspaceApi.getViewPresets(filterParams);
|
|
7614
|
+
listenerApi.dispatch(viewPresetActions.fetchedViewPresets({
|
|
7615
|
+
viewPresets,
|
|
7616
|
+
panelId,
|
|
7617
|
+
filterParams
|
|
7618
|
+
}));
|
|
7619
|
+
} catch (error) {
|
|
7620
|
+
listenerApi.dispatch(viewPresetActions.errorViewPreset({
|
|
7621
|
+
error: processError(error, ViewPresetErrorComponent.PRESET_LIST, 'workspace-mappreset-error-fetch'),
|
|
7622
|
+
panelId
|
|
7623
|
+
}));
|
|
7624
|
+
}
|
|
7625
|
+
})
|
|
7626
|
+
});
|
|
7627
|
+
// save view preset
|
|
7628
|
+
viewPresetsListener.startListening({
|
|
7629
|
+
actionCreator: viewPresetActions.saveViewPreset,
|
|
7630
|
+
effect: ({
|
|
7631
|
+
payload
|
|
7632
|
+
}, listenerApi) => __awaiter(void 0, void 0, void 0, function* () {
|
|
7633
|
+
listenerApi.cancelActiveListeners();
|
|
7634
|
+
const {
|
|
7610
7635
|
panelId,
|
|
7636
|
+
viewPreset,
|
|
7611
7637
|
viewPresetId
|
|
7612
|
-
}
|
|
7613
|
-
|
|
7614
|
-
|
|
7615
|
-
|
|
7616
|
-
|
|
7617
|
-
|
|
7618
|
-
|
|
7619
|
-
|
|
7620
|
-
|
|
7621
|
-
|
|
7622
|
-
|
|
7623
|
-
|
|
7624
|
-
|
|
7625
|
-
|
|
7626
|
-
}));
|
|
7627
|
-
}
|
|
7628
|
-
// fetch existing map preset selected
|
|
7629
|
-
if (viewPresetId !== '') {
|
|
7630
|
-
yield put(workspaceActions.fetchWorkspaceViewPreset({
|
|
7631
|
-
mosaicNodeId: panelId,
|
|
7632
|
-
viewPresetId
|
|
7633
|
-
}));
|
|
7634
|
-
} else {
|
|
7635
|
-
// new map preset selected
|
|
7636
|
-
yield put(mapStoreActions.setMapPreset({
|
|
7637
|
-
mapId: panelId,
|
|
7638
|
-
initialProps: emptyMapViewPreset.initialProps
|
|
7639
|
-
}));
|
|
7640
|
-
// update workspace with new empy view map
|
|
7641
|
-
yield put(workspaceActions.updateWorkspaceView({
|
|
7642
|
-
viewPreset: emptyMapViewPreset,
|
|
7643
|
-
mosaicNodeId: panelId
|
|
7644
|
-
}));
|
|
7645
|
-
yield put(viewPresetActions.fetchedViewPreset({
|
|
7646
|
-
panelId,
|
|
7647
|
-
viewPresetId,
|
|
7648
|
-
viewPreset: emptyMapViewPreset
|
|
7649
|
-
}));
|
|
7650
|
-
}
|
|
7651
|
-
}
|
|
7652
|
-
function* onSuccessViewPresetActionSaga({
|
|
7653
|
-
payload
|
|
7654
|
-
}) {
|
|
7655
|
-
const {
|
|
7656
|
-
action,
|
|
7657
|
-
viewPresetId,
|
|
7658
|
-
title,
|
|
7659
|
-
panelId
|
|
7660
|
-
} = payload;
|
|
7661
|
-
try {
|
|
7662
|
-
yield put(snackbarActions.openSnackbar({
|
|
7663
|
-
message: getSnackbarMessage(action, title)
|
|
7664
|
-
}));
|
|
7665
|
-
const activeMapPresetId = yield select(getViewPresetActiveId, panelId);
|
|
7666
|
-
// if active preset has been deleted, select the empty new preset
|
|
7667
|
-
if (action === PresetAction.DELETE && viewPresetId === activeMapPresetId) {
|
|
7668
|
-
yield put(viewPresetActions.setActiveViewPresetId({
|
|
7638
|
+
} = payload;
|
|
7639
|
+
try {
|
|
7640
|
+
const workspaceApi = getWorkspaceApi();
|
|
7641
|
+
yield workspaceApi.saveViewPreset(viewPresetId, viewPreset);
|
|
7642
|
+
listenerApi.dispatch(snackbarActions.openSnackbar({
|
|
7643
|
+
message: getSnackbarMessage(PresetAction.SAVE, viewPreset.title)
|
|
7644
|
+
}));
|
|
7645
|
+
listenerApi.dispatch(viewPresetActions.savedViewPreset({
|
|
7646
|
+
panelId,
|
|
7647
|
+
viewPresetId
|
|
7648
|
+
}));
|
|
7649
|
+
} catch (error) {
|
|
7650
|
+
listenerApi.dispatch(viewPresetActions.errorViewPreset({
|
|
7651
|
+
error: processError(error, ViewPresetErrorComponent.PRESET_DETAIL, 'workspace-mappreset-error-save'),
|
|
7669
7652
|
panelId,
|
|
7670
|
-
viewPresetId
|
|
7653
|
+
viewPresetId
|
|
7671
7654
|
}));
|
|
7672
7655
|
}
|
|
7673
|
-
|
|
7674
|
-
|
|
7675
|
-
|
|
7676
|
-
|
|
7677
|
-
|
|
7656
|
+
})
|
|
7657
|
+
});
|
|
7658
|
+
// select view preset
|
|
7659
|
+
viewPresetsListener.startListening({
|
|
7660
|
+
actionCreator: viewPresetActions.selectViewPreset,
|
|
7661
|
+
effect: ({
|
|
7662
|
+
payload
|
|
7663
|
+
}, listenerApi) => __awaiter(void 0, void 0, void 0, function* () {
|
|
7664
|
+
listenerApi.cancelActiveListeners();
|
|
7665
|
+
const {
|
|
7678
7666
|
panelId,
|
|
7679
|
-
|
|
7680
|
-
}
|
|
7681
|
-
|
|
7682
|
-
|
|
7667
|
+
viewPresetId = ''
|
|
7668
|
+
} = payload;
|
|
7669
|
+
const isMapAnimating = mapSelectors.isAnimating(listenerApi.getState(), panelId);
|
|
7670
|
+
if (isMapAnimating) {
|
|
7671
|
+
listenerApi.dispatch(mapStoreActions.mapStopAnimation({
|
|
7672
|
+
mapId: panelId
|
|
7673
|
+
}));
|
|
7674
|
+
}
|
|
7675
|
+
// fetch existing map preset selected
|
|
7676
|
+
if (viewPresetId !== '') {
|
|
7677
|
+
listenerApi.dispatch(workspaceActions.fetchWorkspaceViewPreset({
|
|
7678
|
+
mosaicNodeId: panelId,
|
|
7679
|
+
viewPresetId
|
|
7680
|
+
}));
|
|
7681
|
+
} else {
|
|
7682
|
+
// new map preset selected
|
|
7683
|
+
listenerApi.dispatch(mapStoreActions.setMapPreset({
|
|
7684
|
+
mapId: panelId,
|
|
7685
|
+
initialProps: emptyMapViewPreset.initialProps
|
|
7686
|
+
}));
|
|
7687
|
+
// update workspace with new empy view map
|
|
7688
|
+
listenerApi.dispatch(workspaceActions.updateWorkspaceView({
|
|
7689
|
+
viewPreset: emptyMapViewPreset,
|
|
7690
|
+
mosaicNodeId: panelId
|
|
7691
|
+
}));
|
|
7692
|
+
listenerApi.dispatch(viewPresetActions.fetchedViewPreset({
|
|
7683
7693
|
panelId,
|
|
7684
|
-
|
|
7694
|
+
viewPresetId,
|
|
7695
|
+
viewPreset: emptyMapViewPreset
|
|
7685
7696
|
}));
|
|
7686
7697
|
}
|
|
7687
|
-
|
|
7688
|
-
|
|
7698
|
+
})
|
|
7699
|
+
});
|
|
7700
|
+
// success view preset
|
|
7701
|
+
viewPresetsListener.startListening({
|
|
7702
|
+
actionCreator: viewPresetActions.onSuccessViewPresetAction,
|
|
7703
|
+
effect: ({
|
|
7704
|
+
payload
|
|
7705
|
+
}, listenerApi) => __awaiter(void 0, void 0, void 0, function* () {
|
|
7706
|
+
listenerApi.cancelActiveListeners();
|
|
7707
|
+
const {
|
|
7708
|
+
action,
|
|
7709
|
+
viewPresetId,
|
|
7710
|
+
title,
|
|
7711
|
+
panelId
|
|
7712
|
+
} = payload;
|
|
7713
|
+
try {
|
|
7714
|
+
listenerApi.dispatch(snackbarActions.openSnackbar({
|
|
7715
|
+
message: getSnackbarMessage(action, title)
|
|
7716
|
+
}));
|
|
7717
|
+
const activeMapPresetId = getViewPresetActiveId(listenerApi.getState(), panelId);
|
|
7718
|
+
// if active preset has been deleted, select the empty new preset
|
|
7719
|
+
if (action === PresetAction.DELETE && viewPresetId === activeMapPresetId) {
|
|
7720
|
+
listenerApi.dispatch(viewPresetActions.setActiveViewPresetId({
|
|
7721
|
+
panelId,
|
|
7722
|
+
viewPresetId: ''
|
|
7723
|
+
}));
|
|
7724
|
+
}
|
|
7725
|
+
// Retrieve new list with current filter and search query
|
|
7726
|
+
const viewPresetFilters = getViewPresetListFiltersForView(listenerApi.getState(), panelId);
|
|
7727
|
+
// Retrieve new list with current filter
|
|
7728
|
+
const viewPresetSearchQuery = getViewPresetListSearchQueryForView(listenerApi.getState(), panelId);
|
|
7729
|
+
listenerApi.dispatch(viewPresetActions.fetchViewPresets({
|
|
7689
7730
|
panelId,
|
|
7690
|
-
|
|
7731
|
+
filterParams: constructFilterParams(viewPresetFilters, viewPresetSearchQuery)
|
|
7691
7732
|
}));
|
|
7733
|
+
if (action !== PresetAction.EDIT) {
|
|
7734
|
+
listenerApi.dispatch(viewPresetActions.setViewPresetHasChanges({
|
|
7735
|
+
panelId,
|
|
7736
|
+
hasChanges: false
|
|
7737
|
+
}));
|
|
7738
|
+
}
|
|
7739
|
+
if (action === PresetAction.SAVE_AS && viewPresetId) {
|
|
7740
|
+
listenerApi.dispatch(viewPresetActions.setActiveViewPresetId({
|
|
7741
|
+
panelId,
|
|
7742
|
+
viewPresetId
|
|
7743
|
+
}));
|
|
7744
|
+
}
|
|
7745
|
+
} catch (error) {
|
|
7746
|
+
// TODO: use error handling of mapPreset https://gitlab.com/opengeoweb/opengeoweb/-/issues/3043
|
|
7692
7747
|
}
|
|
7693
|
-
}
|
|
7694
|
-
|
|
7695
|
-
}
|
|
7696
|
-
}
|
|
7697
|
-
function* rootSaga() {
|
|
7698
|
-
yield takeLeading(viewPresetActions.fetchInitialViewPresets, fetchInitialViewPresetsSaga);
|
|
7699
|
-
yield takeLatest(viewPresetActions.fetchViewPresets, fetchViewPresetsSaga);
|
|
7700
|
-
yield takeLatest(viewPresetActions.saveViewPreset, saveViewPresetSaga);
|
|
7701
|
-
yield takeLatest(viewPresetActions.selectViewPreset, selectViewPresetSaga);
|
|
7702
|
-
yield takeLatest(viewPresetActions.onSuccessViewPresetAction, onSuccessViewPresetActionSaga);
|
|
7703
|
-
}
|
|
7748
|
+
})
|
|
7749
|
+
});
|
|
7704
7750
|
|
|
7705
7751
|
/* *
|
|
7706
7752
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -7726,51 +7772,8 @@ const workspaceModuleConfig = {
|
|
|
7726
7772
|
viewPresetsList: reducer,
|
|
7727
7773
|
viewPresets: reducer$2
|
|
7728
7774
|
},
|
|
7729
|
-
sagas: [workspaceSaga, rootSaga
|
|
7730
|
-
|
|
7731
|
-
|
|
7732
|
-
/******************************************************************************
|
|
7733
|
-
Copyright (c) Microsoft Corporation.
|
|
7734
|
-
|
|
7735
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
7736
|
-
purpose with or without fee is hereby granted.
|
|
7737
|
-
|
|
7738
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
7739
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
7740
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
7741
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
7742
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
7743
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
7744
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
7745
|
-
***************************************************************************** */
|
|
7746
|
-
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
7747
|
-
|
|
7748
|
-
|
|
7749
|
-
function __rest(s, e) {
|
|
7750
|
-
var t = {};
|
|
7751
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
7752
|
-
t[p] = s[p];
|
|
7753
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7754
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7755
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
7756
|
-
t[p[i]] = s[p[i]];
|
|
7757
|
-
}
|
|
7758
|
-
return t;
|
|
7759
|
-
}
|
|
7760
|
-
|
|
7761
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
7762
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
7763
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
7764
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
7765
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7766
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7767
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
7768
|
-
});
|
|
7769
|
-
}
|
|
7770
|
-
|
|
7771
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
7772
|
-
var e = new Error(message);
|
|
7773
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
7775
|
+
sagas: [workspaceSaga, rootSaga],
|
|
7776
|
+
middlewares: [viewPresetsListener.middleware]
|
|
7774
7777
|
};
|
|
7775
7778
|
|
|
7776
7779
|
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
@@ -8427,155 +8430,6 @@ const WorkspaceSelectListRow = ({
|
|
|
8427
8430
|
}));
|
|
8428
8431
|
};
|
|
8429
8432
|
|
|
8430
|
-
const FilterChip = ({
|
|
8431
|
-
label,
|
|
8432
|
-
id,
|
|
8433
|
-
isSelected: _isSelected = false,
|
|
8434
|
-
isDisabled: _isDisabled = false,
|
|
8435
|
-
handleClick: _handleClick = () => {}
|
|
8436
|
-
}) => {
|
|
8437
|
-
const theme = useTheme();
|
|
8438
|
-
return jsx(Chip, {
|
|
8439
|
-
size: "small",
|
|
8440
|
-
id: id,
|
|
8441
|
-
label: label,
|
|
8442
|
-
disabled: _isDisabled,
|
|
8443
|
-
variant: _isSelected ? 'filled' : 'outlined',
|
|
8444
|
-
color: _isSelected ? 'secondary' : 'default',
|
|
8445
|
-
sx: {
|
|
8446
|
-
borderColor: `${theme.palette.geowebColors.buttons.tertiary.default.borderColor}`,
|
|
8447
|
-
padding: '0px 4px'
|
|
8448
|
-
},
|
|
8449
|
-
onClick: () => _handleClick(id)
|
|
8450
|
-
});
|
|
8451
|
-
};
|
|
8452
|
-
|
|
8453
|
-
const FilterList = ({
|
|
8454
|
-
filters: _filters = workspaceListFilterOptions,
|
|
8455
|
-
onChipClick: _onChipClick = () => {},
|
|
8456
|
-
isAllSelected: _isAllSelected = false
|
|
8457
|
-
}) => {
|
|
8458
|
-
const {
|
|
8459
|
-
t
|
|
8460
|
-
} = useWorkspaceTranslation();
|
|
8461
|
-
return jsxs(Stack, Object.assign({
|
|
8462
|
-
direction: "row",
|
|
8463
|
-
spacing: 1,
|
|
8464
|
-
"data-testid": "filterList"
|
|
8465
|
-
}, {
|
|
8466
|
-
children: [jsx(FilterChip, {
|
|
8467
|
-
id: "all",
|
|
8468
|
-
label: t('workspace-all-button'),
|
|
8469
|
-
isSelected: _isAllSelected,
|
|
8470
|
-
handleClick: key => _onChipClick(key, !_isAllSelected)
|
|
8471
|
-
}), _filters.map(filter => {
|
|
8472
|
-
return jsx(FilterChip, {
|
|
8473
|
-
id: filter.id,
|
|
8474
|
-
label: t(filter.label),
|
|
8475
|
-
isSelected: _isAllSelected ? false : filter.isSelected,
|
|
8476
|
-
isDisabled: filter.isDisabled,
|
|
8477
|
-
handleClick: key => {
|
|
8478
|
-
// If they are all isSelected ensure that if one is clicked that one will be the only one set to selected
|
|
8479
|
-
const selected = _isAllSelected ? true : !filter.isSelected;
|
|
8480
|
-
_onChipClick(key, selected);
|
|
8481
|
-
}
|
|
8482
|
-
}, filter.id);
|
|
8483
|
-
})]
|
|
8484
|
-
}));
|
|
8485
|
-
};
|
|
8486
|
-
|
|
8487
|
-
const DEBOUNCE_TIMEOUT = 300;
|
|
8488
|
-
const SearchButton = ({
|
|
8489
|
-
label
|
|
8490
|
-
}) => jsx(CustomIconButton, Object.assign({
|
|
8491
|
-
tooltipTitle: label,
|
|
8492
|
-
edge: "end",
|
|
8493
|
-
size: "large"
|
|
8494
|
-
}, {
|
|
8495
|
-
children: jsx(Search, {})
|
|
8496
|
-
}));
|
|
8497
|
-
const ClearButton = ({
|
|
8498
|
-
onClick
|
|
8499
|
-
}) => jsx(CustomIconButton, Object.assign({
|
|
8500
|
-
tooltipTitle: "Clear",
|
|
8501
|
-
edge: "end",
|
|
8502
|
-
onClick: onClick,
|
|
8503
|
-
size: "large"
|
|
8504
|
-
}, {
|
|
8505
|
-
children: jsx(Clear, {})
|
|
8506
|
-
}));
|
|
8507
|
-
const SearchField = ({
|
|
8508
|
-
valueChanged,
|
|
8509
|
-
value: _value = ''
|
|
8510
|
-
}) => {
|
|
8511
|
-
const [localValue, setLocalValue] = React.useState(_value);
|
|
8512
|
-
const {
|
|
8513
|
-
t
|
|
8514
|
-
} = useWorkspaceTranslation();
|
|
8515
|
-
const label = t('workspace-search');
|
|
8516
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
8517
|
-
const handleValueChangeDebounced = React.useCallback(debounce$1(valueChanged, DEBOUNCE_TIMEOUT), []);
|
|
8518
|
-
return jsx(TextField, {
|
|
8519
|
-
variant: "filled",
|
|
8520
|
-
size: "small",
|
|
8521
|
-
sx: {
|
|
8522
|
-
'& input': {
|
|
8523
|
-
paddingTop: '18px'
|
|
8524
|
-
}
|
|
8525
|
-
},
|
|
8526
|
-
label: label,
|
|
8527
|
-
value: localValue,
|
|
8528
|
-
autoFocus: true,
|
|
8529
|
-
fullWidth: true,
|
|
8530
|
-
onChange: e => {
|
|
8531
|
-
handleValueChangeDebounced(e.target.value);
|
|
8532
|
-
setLocalValue(e.target.value);
|
|
8533
|
-
},
|
|
8534
|
-
InputProps: {
|
|
8535
|
-
endAdornment: jsx(InputAdornment, Object.assign({
|
|
8536
|
-
position: "end"
|
|
8537
|
-
}, {
|
|
8538
|
-
children: localValue ? jsx(ClearButton, {
|
|
8539
|
-
onClick: () => {
|
|
8540
|
-
setLocalValue('');
|
|
8541
|
-
valueChanged('');
|
|
8542
|
-
}
|
|
8543
|
-
}) : jsx(SearchButton, {
|
|
8544
|
-
label: label
|
|
8545
|
-
})
|
|
8546
|
-
}))
|
|
8547
|
-
}
|
|
8548
|
-
});
|
|
8549
|
-
};
|
|
8550
|
-
|
|
8551
|
-
const DEFAULT_FILTER_HEIGHT = 85;
|
|
8552
|
-
const WorkspaceFilter = ({
|
|
8553
|
-
filters,
|
|
8554
|
-
onClickFilterChip: _onClickFilterChip = () => {},
|
|
8555
|
-
onSearch: _onSearch = () => {},
|
|
8556
|
-
isAllSelected,
|
|
8557
|
-
searchQuery
|
|
8558
|
-
}) => {
|
|
8559
|
-
return jsx(Box, Object.assign({
|
|
8560
|
-
sx: {
|
|
8561
|
-
marginBottom: '8px'
|
|
8562
|
-
}
|
|
8563
|
-
}, {
|
|
8564
|
-
children: jsxs(Stack, Object.assign({
|
|
8565
|
-
spacing: 1
|
|
8566
|
-
}, {
|
|
8567
|
-
children: [jsx(SearchField, {
|
|
8568
|
-
value: searchQuery,
|
|
8569
|
-
valueChanged: _onSearch
|
|
8570
|
-
}), jsx(FilterList, {
|
|
8571
|
-
filters: filters,
|
|
8572
|
-
onChipClick: _onClickFilterChip,
|
|
8573
|
-
isAllSelected: isAllSelected
|
|
8574
|
-
})]
|
|
8575
|
-
}))
|
|
8576
|
-
}));
|
|
8577
|
-
};
|
|
8578
|
-
|
|
8579
8433
|
const MIN_HEIGHT_SCROLLABLE_LIST = 88; // Slightly less than 2 rows
|
|
8580
8434
|
const LIST_PADDING_TOP = 8;
|
|
8581
8435
|
const DEFAULT_RESULTS_HEIGHT = 22;
|
|
@@ -8807,7 +8661,7 @@ const ViewPresetMenuListConnect = ({
|
|
|
8807
8661
|
height: '100%'
|
|
8808
8662
|
}
|
|
8809
8663
|
}, {
|
|
8810
|
-
children: [!error && jsx(
|
|
8664
|
+
children: [!error && jsx(Filter, {
|
|
8811
8665
|
filters: viewPresetListFilters,
|
|
8812
8666
|
onClickFilterChip: onClickFilterChip,
|
|
8813
8667
|
isAllSelected: isAllSelectedForFilters,
|
|
@@ -9694,7 +9548,7 @@ const WorkspaceSelectListConnect = () => {
|
|
|
9694
9548
|
height: '100%'
|
|
9695
9549
|
}
|
|
9696
9550
|
}, {
|
|
9697
|
-
children: [!error && jsx(
|
|
9551
|
+
children: [!error && jsx(Filter, {
|
|
9698
9552
|
filters: workspaceListFilters,
|
|
9699
9553
|
onClickFilterChip: onClickFilterChip,
|
|
9700
9554
|
isAllSelected: isAllSelected,
|
|
@@ -9898,7 +9752,7 @@ const WorkspaceTab = ({
|
|
|
9898
9752
|
activeTab,
|
|
9899
9753
|
workspaceId
|
|
9900
9754
|
}) => {
|
|
9901
|
-
return jsxs(Box
|
|
9755
|
+
return jsxs(Box, Object.assign({
|
|
9902
9756
|
sx: {
|
|
9903
9757
|
display: 'flex',
|
|
9904
9758
|
flexDirection: 'row',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/workspace",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.24.0",
|
|
4
4
|
"description": "GeoWeb Workspace library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -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.24.0"
|
|
41
40
|
},
|
|
42
41
|
"peerDependencies": {
|
|
43
42
|
"react": "18"
|
package/src/index.d.ts
CHANGED
|
@@ -14,4 +14,4 @@ export { WORKSPACE_NAMESPACE } from './lib/utils/i18n';
|
|
|
14
14
|
export { workspaceTranslations };
|
|
15
15
|
export { routes as workspaceRoutes, getWorkspaceRouteUrl, } from './lib/utils/routes';
|
|
16
16
|
export { emptyMapWorkspace, createCustomEmptyMapWorkspace, } from './lib/store/workspaceList/utils';
|
|
17
|
-
export type { WorkspaceModuleStore } from './lib/store/
|
|
17
|
+
export type { WorkspaceModuleStore } from './lib/store/types';
|
|
@@ -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>;
|
|
@@ -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,10 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
interface FilterChipProps {
|
|
3
|
-
id: string;
|
|
4
|
-
label: string;
|
|
5
|
-
isSelected?: boolean;
|
|
6
|
-
isDisabled?: boolean;
|
|
7
|
-
handleClick?: (label: string) => void;
|
|
8
|
-
}
|
|
9
|
-
declare const FilterChip: React.FC<FilterChipProps>;
|
|
10
|
-
export default FilterChip;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { WorkspaceListFilter } from '../../store/workspaceList/types';
|
|
3
|
-
interface FilterListProps {
|
|
4
|
-
filters?: WorkspaceListFilter[];
|
|
5
|
-
onChipClick?: (id: string, selected: boolean) => void;
|
|
6
|
-
isAllSelected?: boolean;
|
|
7
|
-
}
|
|
8
|
-
declare const FilterList: React.FC<FilterListProps>;
|
|
9
|
-
export default FilterList;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { BoxProps } from '@mui/material';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { WorkspaceListFilter } from '../../store/workspaceList/types';
|
|
4
|
-
export declare const DEFAULT_FILTER_HEIGHT = 85;
|
|
5
|
-
interface WorkspaceFilterProps extends BoxProps {
|
|
6
|
-
filters: WorkspaceListFilter[];
|
|
7
|
-
onClickFilterChip?: (id: string, selected: boolean) => void;
|
|
8
|
-
onSearch?: (value: string) => void;
|
|
9
|
-
isAllSelected?: boolean;
|
|
10
|
-
searchQuery?: string;
|
|
11
|
-
}
|
|
12
|
-
declare const WorkspaceFilter: React.FC<WorkspaceFilterProps>;
|
|
13
|
-
export default WorkspaceFilter;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
declare const _default: {
|
|
3
|
-
title: string;
|
|
4
|
-
};
|
|
5
|
-
export default _default;
|
|
6
|
-
export declare const WorkspaceFilterLight: {
|
|
7
|
-
(): React.ReactElement;
|
|
8
|
-
parameters: {
|
|
9
|
-
zeplinLink: {
|
|
10
|
-
name: string;
|
|
11
|
-
link: string;
|
|
12
|
-
}[];
|
|
13
|
-
};
|
|
14
|
-
tags: string[];
|
|
15
|
-
};
|
|
16
|
-
export declare const WorkspaceFilterDark: {
|
|
17
|
-
(): React.ReactElement;
|
|
18
|
-
parameters: {
|
|
19
|
-
zeplinLink: {
|
|
20
|
-
name: string;
|
|
21
|
-
link: string;
|
|
22
|
-
}[];
|
|
23
|
-
};
|
|
24
|
-
tags: string[];
|
|
25
|
-
};
|
|
@@ -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;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|