@opengeoweb/workspace 9.18.0 → 9.19.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
CHANGED
|
@@ -4,7 +4,8 @@ import { syncGroupsTypes, syncGroupsActions, layerActions, mapStoreActions, uiAc
|
|
|
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,
|
|
7
|
+
import { SHARED_NAMESPACE, sharedTranslations, isAxiosAuthError, getAxiosErrorMessage, isAxiosError, withEggs, ConfirmationServiceProvider, useConfirmationDialog, CustomIconButton, AlertBanner, CustomTooltip, SearchHighlight, ToggleMenu, usePrevious, ToolContainer, renderCounter, CustomToggleButton, ConfirmationDialog } from '@opengeoweb/shared';
|
|
8
|
+
import { WEBMAP_REACT_NAMESPACE, webmapReactTranslations } from '@opengeoweb/webmap-react';
|
|
8
9
|
import { initReactI18next, useTranslation, I18nextProvider } from 'react-i18next';
|
|
9
10
|
import { CORE_NAMESPACE, coreTranslations } from '@opengeoweb/core';
|
|
10
11
|
import { takeLatest, takeEvery, debounce, delay, put, all, select, call as call$g, takeLeading } from 'redux-saga/effects';
|
|
@@ -589,10 +590,10 @@ var SHARED = '__core-js_shared__';
|
|
|
589
590
|
var store$4 = sharedStore.exports = globalThis$1[SHARED] || defineGlobalProperty$2(SHARED, {});
|
|
590
591
|
|
|
591
592
|
(store$4.versions || (store$4.versions = [])).push({
|
|
592
|
-
version: '3.
|
|
593
|
+
version: '3.37.1',
|
|
593
594
|
mode: 'global',
|
|
594
595
|
copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)',
|
|
595
|
-
license: 'https://github.com/zloirock/core-js/blob/v3.
|
|
596
|
+
license: 'https://github.com/zloirock/core-js/blob/v3.37.1/LICENSE',
|
|
596
597
|
source: 'https://github.com/zloirock/core-js'
|
|
597
598
|
});
|
|
598
599
|
|
|
@@ -2858,11 +2859,16 @@ const getErrorMessage = error => {
|
|
|
2858
2859
|
return suffix ? `${prefix}: ${suffix}` : prefix;
|
|
2859
2860
|
};
|
|
2860
2861
|
|
|
2861
|
-
var
|
|
2862
|
-
(function (
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
})(
|
|
2862
|
+
var ViewPresetErrorComponent;
|
|
2863
|
+
(function (ViewPresetErrorComponent) {
|
|
2864
|
+
ViewPresetErrorComponent["PRESET_DETAIL"] = "PRESET_DETAIL";
|
|
2865
|
+
ViewPresetErrorComponent["PRESET_LIST"] = "PRESET_LIST";
|
|
2866
|
+
})(ViewPresetErrorComponent || (ViewPresetErrorComponent = {}));
|
|
2867
|
+
var ViewPresetErrorType;
|
|
2868
|
+
(function (ViewPresetErrorType) {
|
|
2869
|
+
ViewPresetErrorType["AUTH"] = "AUTH";
|
|
2870
|
+
ViewPresetErrorType["GENERIC"] = "GENERIC";
|
|
2871
|
+
})(ViewPresetErrorType || (ViewPresetErrorType = {}));
|
|
2866
2872
|
var PresetAction;
|
|
2867
2873
|
(function (PresetAction) {
|
|
2868
2874
|
PresetAction["OPEN"] = "Open";
|
|
@@ -3186,7 +3192,8 @@ const slice$2 = createSlice({
|
|
|
3186
3192
|
if (entity) {
|
|
3187
3193
|
entity.error = {
|
|
3188
3194
|
message: error,
|
|
3189
|
-
|
|
3195
|
+
component: ViewPresetErrorComponent.PRESET_DETAIL,
|
|
3196
|
+
errorType: ViewPresetErrorType.GENERIC
|
|
3190
3197
|
};
|
|
3191
3198
|
entity.isFetching = false;
|
|
3192
3199
|
viewPresetsAdapter.setOne(draft, entity);
|
|
@@ -3547,22 +3554,26 @@ const initWorkspaceTestI18n = () => {
|
|
|
3547
3554
|
en: {
|
|
3548
3555
|
[WORKSPACE_NAMESPACE]: workspaceTranslations.en,
|
|
3549
3556
|
[SHARED_NAMESPACE]: sharedTranslations.en,
|
|
3550
|
-
[CORE_NAMESPACE]: coreTranslations.en
|
|
3557
|
+
[CORE_NAMESPACE]: coreTranslations.en,
|
|
3558
|
+
[WEBMAP_REACT_NAMESPACE]: webmapReactTranslations.en
|
|
3551
3559
|
},
|
|
3552
3560
|
fi: {
|
|
3553
3561
|
[WORKSPACE_NAMESPACE]: workspaceTranslations.fi,
|
|
3554
3562
|
[SHARED_NAMESPACE]: sharedTranslations.fi,
|
|
3555
|
-
[CORE_NAMESPACE]: coreTranslations.fi
|
|
3563
|
+
[CORE_NAMESPACE]: coreTranslations.fi,
|
|
3564
|
+
[WEBMAP_REACT_NAMESPACE]: webmapReactTranslations.fi
|
|
3556
3565
|
},
|
|
3557
3566
|
no: {
|
|
3558
3567
|
[WORKSPACE_NAMESPACE]: workspaceTranslations.no,
|
|
3559
3568
|
[SHARED_NAMESPACE]: sharedTranslations.no,
|
|
3560
|
-
[CORE_NAMESPACE]: coreTranslations.no
|
|
3569
|
+
[CORE_NAMESPACE]: coreTranslations.no,
|
|
3570
|
+
[WEBMAP_REACT_NAMESPACE]: webmapReactTranslations.no
|
|
3561
3571
|
},
|
|
3562
3572
|
nl: {
|
|
3563
3573
|
[WORKSPACE_NAMESPACE]: workspaceTranslations.nl,
|
|
3564
3574
|
[SHARED_NAMESPACE]: sharedTranslations.nl,
|
|
3565
|
-
[CORE_NAMESPACE]: coreTranslations.nl
|
|
3575
|
+
[CORE_NAMESPACE]: coreTranslations.nl,
|
|
3576
|
+
[WEBMAP_REACT_NAMESPACE]: webmapReactTranslations.nl
|
|
3566
3577
|
}
|
|
3567
3578
|
}
|
|
3568
3579
|
});
|
|
@@ -3985,13 +3996,7 @@ const getViewPresetsError = createSelector(getViewPresetById, (store, panelId) =
|
|
|
3985
3996
|
return viewPreset === null || viewPreset === void 0 ? void 0 : viewPreset.error;
|
|
3986
3997
|
}, selectorMemoizationOptions);
|
|
3987
3998
|
const getViewPresetDetailError = createSelector(getViewPresetsError, (store, panelId) => panelId, error => {
|
|
3988
|
-
if (error && error.
|
|
3989
|
-
return error.message;
|
|
3990
|
-
}
|
|
3991
|
-
return undefined;
|
|
3992
|
-
}, selectorMemoizationOptions);
|
|
3993
|
-
const getViewPresetListError = createSelector(getViewPresetsError, (store, panelId) => panelId, error => {
|
|
3994
|
-
if (error && error.type === 'PRESET_LIST') {
|
|
3999
|
+
if (error && error.component === 'PRESET_DETAIL') {
|
|
3995
4000
|
return error.message;
|
|
3996
4001
|
}
|
|
3997
4002
|
return undefined;
|
|
@@ -7226,6 +7231,7 @@ function* workspaceSaga() {
|
|
|
7226
7231
|
* */
|
|
7227
7232
|
var WorkspaceListErrorType;
|
|
7228
7233
|
(function (WorkspaceListErrorType) {
|
|
7234
|
+
WorkspaceListErrorType["AUTH"] = "AUTH";
|
|
7229
7235
|
WorkspaceListErrorType["GENERIC"] = "GENERIC";
|
|
7230
7236
|
})(WorkspaceListErrorType || (WorkspaceListErrorType = {}));
|
|
7231
7237
|
|
|
@@ -7298,10 +7304,13 @@ function* fetchWorkspaceListSaga({
|
|
|
7298
7304
|
workspaceList: data
|
|
7299
7305
|
}));
|
|
7300
7306
|
} catch (error) {
|
|
7307
|
+
const isAuthError = isAxiosAuthError(error);
|
|
7308
|
+
const message = isAuthError ? getAxiosErrorMessage(error) : translateKeyOutsideComponents('workspace-list-error');
|
|
7309
|
+
const type = isAuthError ? WorkspaceListErrorType.AUTH : WorkspaceListErrorType.GENERIC;
|
|
7301
7310
|
yield put(workspaceListActions.errorWorkspaceList({
|
|
7302
7311
|
error: {
|
|
7303
|
-
|
|
7304
|
-
|
|
7312
|
+
type,
|
|
7313
|
+
message
|
|
7305
7314
|
}
|
|
7306
7315
|
}));
|
|
7307
7316
|
}
|
|
@@ -7488,9 +7497,10 @@ function* submitFormWorkspaceDialogSaga({
|
|
|
7488
7497
|
}
|
|
7489
7498
|
} catch (error) {
|
|
7490
7499
|
const message = isAxiosError(error) ? getAxiosErrorMessage(error) : error.message;
|
|
7500
|
+
const type = isAxiosAuthError(error) ? WorkspaceListErrorType.AUTH : WorkspaceListErrorType.GENERIC;
|
|
7491
7501
|
yield put(workspaceListActions.onErrorWorkspacePresetAction({
|
|
7492
7502
|
error: {
|
|
7493
|
-
type
|
|
7503
|
+
type,
|
|
7494
7504
|
message
|
|
7495
7505
|
}
|
|
7496
7506
|
}));
|
|
@@ -7518,6 +7528,15 @@ function* rootSaga$1() {
|
|
|
7518
7528
|
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
7519
7529
|
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
7520
7530
|
* */
|
|
7531
|
+
const processError = (error, component, errorMessageKey) => {
|
|
7532
|
+
const message = isAxiosError(error) ? getAxiosErrorMessage(error) : translateKeyOutsideComponents(errorMessageKey);
|
|
7533
|
+
const errorType = isAxiosAuthError(error) ? ViewPresetErrorType.AUTH : ViewPresetErrorType.GENERIC;
|
|
7534
|
+
return {
|
|
7535
|
+
message,
|
|
7536
|
+
component,
|
|
7537
|
+
errorType
|
|
7538
|
+
};
|
|
7539
|
+
};
|
|
7521
7540
|
function* fetchInitialViewPresetsSaga() {
|
|
7522
7541
|
try {
|
|
7523
7542
|
const presetsApi = yield call$g(getPresetsApi);
|
|
@@ -7530,10 +7549,7 @@ function* fetchInitialViewPresetsSaga() {
|
|
|
7530
7549
|
}));
|
|
7531
7550
|
} catch (error) {
|
|
7532
7551
|
yield put(viewPresetActions.errorInitialViewPresets({
|
|
7533
|
-
error:
|
|
7534
|
-
message: translateKeyOutsideComponents('workspace-mappreset-error-fetch'),
|
|
7535
|
-
type: ViewPresetType.PRESET_LIST
|
|
7536
|
-
}
|
|
7552
|
+
error: processError(error, ViewPresetErrorComponent.PRESET_LIST, 'workspace-mappreset-error-fetch')
|
|
7537
7553
|
}));
|
|
7538
7554
|
}
|
|
7539
7555
|
}
|
|
@@ -7556,10 +7572,7 @@ function* fetchViewPresetsSaga({
|
|
|
7556
7572
|
}));
|
|
7557
7573
|
} catch (error) {
|
|
7558
7574
|
yield put(viewPresetActions.errorViewPreset({
|
|
7559
|
-
error:
|
|
7560
|
-
message: translateKeyOutsideComponents('workspace-mappreset-error-fetch'),
|
|
7561
|
-
type: ViewPresetType.PRESET_LIST
|
|
7562
|
-
},
|
|
7575
|
+
error: processError(error, ViewPresetErrorComponent.PRESET_LIST, 'workspace-mappreset-error-fetch'),
|
|
7563
7576
|
panelId
|
|
7564
7577
|
}));
|
|
7565
7578
|
}
|
|
@@ -7584,10 +7597,7 @@ function* saveViewPresetSaga({
|
|
|
7584
7597
|
}));
|
|
7585
7598
|
} catch (error) {
|
|
7586
7599
|
yield put(viewPresetActions.errorViewPreset({
|
|
7587
|
-
error:
|
|
7588
|
-
message: translateKeyOutsideComponents('workspace-mappreset-error-save'),
|
|
7589
|
-
type: ViewPresetType.PRESET_DETAIL
|
|
7590
|
-
},
|
|
7600
|
+
error: processError(error, ViewPresetErrorComponent.PRESET_DETAIL, 'workspace-mappreset-error-save'),
|
|
7591
7601
|
panelId,
|
|
7592
7602
|
viewPresetId
|
|
7593
7603
|
}));
|
|
@@ -8633,7 +8643,7 @@ const ViewPresetMenuListConnect = ({
|
|
|
8633
8643
|
const relatedSyncGroupIds = useSelector(store => syncGroupsSelectors.getAllTargetGroupsForSource(store, {
|
|
8634
8644
|
sourceId: panelId
|
|
8635
8645
|
}));
|
|
8636
|
-
const
|
|
8646
|
+
const error = useSelector(store => getViewPresetsError(store, panelId));
|
|
8637
8647
|
const isViewPresetsListFetching = useSelector(store => getViewPresetsIsFetching(store, panelId));
|
|
8638
8648
|
const {
|
|
8639
8649
|
isLoggedIn
|
|
@@ -8757,18 +8767,21 @@ const ViewPresetMenuListConnect = ({
|
|
|
8757
8767
|
width: '100%',
|
|
8758
8768
|
top: 0
|
|
8759
8769
|
}
|
|
8760
|
-
})), !isViewPresetsListFetching &&
|
|
8770
|
+
})), !isViewPresetsListFetching && error && ( /*#__PURE__*/React.createElement(AlertBanner, Object.assign({
|
|
8761
8771
|
title: t('workspace-viewpresets-error'),
|
|
8772
|
+
info: error.message,
|
|
8773
|
+
shouldClose: true
|
|
8774
|
+
}, error.errorType === ViewPresetErrorType.GENERIC && {
|
|
8762
8775
|
actionButtonProps: {
|
|
8763
8776
|
title: t('workspace-retry'),
|
|
8764
8777
|
onClick: fetchViewPresets
|
|
8765
8778
|
}
|
|
8766
|
-
})), /*#__PURE__*/React.createElement(Box, {
|
|
8779
|
+
}))), /*#__PURE__*/React.createElement(Box, {
|
|
8767
8780
|
sx: {
|
|
8768
8781
|
padding: 1,
|
|
8769
8782
|
height: '100%'
|
|
8770
8783
|
}
|
|
8771
|
-
}, !
|
|
8784
|
+
}, !error && ( /*#__PURE__*/React.createElement(WorkspaceFilter, {
|
|
8772
8785
|
filters: viewPresetListFilters,
|
|
8773
8786
|
onClickFilterChip: onClickFilterChip,
|
|
8774
8787
|
isAllSelected: isAllSelectedForFilters,
|
|
@@ -10458,6 +10471,7 @@ const FetchInitialPresets = () => {
|
|
|
10458
10471
|
return null;
|
|
10459
10472
|
};
|
|
10460
10473
|
const WorkspaceDetail = ({
|
|
10474
|
+
initialWorkspaceId,
|
|
10461
10475
|
workspaceId,
|
|
10462
10476
|
children,
|
|
10463
10477
|
componentsLookUp,
|
|
@@ -10493,10 +10507,11 @@ const WorkspaceDetail = ({
|
|
|
10493
10507
|
navigateToUrl(routes.root);
|
|
10494
10508
|
};
|
|
10495
10509
|
React.useEffect(() => {
|
|
10496
|
-
|
|
10510
|
+
const idToFetch = initialWorkspaceId || workspaceId;
|
|
10511
|
+
if (!idToFetch) {
|
|
10497
10512
|
setEmptyWorkSpace();
|
|
10498
10513
|
} else {
|
|
10499
|
-
fetchWorkspace(
|
|
10514
|
+
fetchWorkspace(idToFetch);
|
|
10500
10515
|
}
|
|
10501
10516
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
10502
10517
|
}, []);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/workspace",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.19.1",
|
|
4
4
|
"description": "GeoWeb Workspace library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"@opengeoweb/taf": "*",
|
|
36
36
|
"@opengeoweb/sigmet-airmet": "*",
|
|
37
37
|
"@opengeoweb/warnings": "*",
|
|
38
|
+
"@opengeoweb/webmap-react": "*",
|
|
38
39
|
"i18next": "^23.7.11",
|
|
39
40
|
"react-i18next": "^13.5.0"
|
|
40
41
|
},
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { WorkspaceLookupFunctionType } from '../../store/workspace/types';
|
|
3
3
|
export interface WorkspaceTopBarProps {
|
|
4
|
+
initialWorkspaceId?: string;
|
|
4
5
|
workspaceId?: string;
|
|
5
6
|
componentsLookUp: WorkspaceLookupFunctionType;
|
|
6
7
|
children?: React.ReactNode;
|
|
@@ -18,11 +18,6 @@ export declare const getViewPresetDetailError: ((state: AppStore, id: string) =>
|
|
|
18
18
|
}> & {
|
|
19
19
|
clearCache: () => void;
|
|
20
20
|
};
|
|
21
|
-
export declare const getViewPresetListError: ((state: AppStore, id: string) => string | undefined) & import("reselect").OutputSelectorFields<(args_0: ViewPresetError, args_1: string) => string | undefined, {
|
|
22
|
-
clearCache: () => void;
|
|
23
|
-
}> & {
|
|
24
|
-
clearCache: () => void;
|
|
25
|
-
};
|
|
26
21
|
export declare const getViewPresetHasChanges: ((state: AppStore, id: string) => boolean) & import("reselect").OutputSelectorFields<(args_0: ViewPresetEntity | undefined, args_1: string) => boolean, {
|
|
27
22
|
clearCache: () => void;
|
|
28
23
|
}> & {
|
|
@@ -10,12 +10,17 @@ export interface ViewPreset {
|
|
|
10
10
|
initialProps?: InitialProps;
|
|
11
11
|
scope?: PresetScope;
|
|
12
12
|
}
|
|
13
|
-
export declare enum
|
|
13
|
+
export declare enum ViewPresetErrorComponent {
|
|
14
14
|
PRESET_DETAIL = "PRESET_DETAIL",
|
|
15
15
|
PRESET_LIST = "PRESET_LIST"
|
|
16
16
|
}
|
|
17
|
+
export declare enum ViewPresetErrorType {
|
|
18
|
+
AUTH = "AUTH",
|
|
19
|
+
GENERIC = "GENERIC"
|
|
20
|
+
}
|
|
17
21
|
export type ViewPresetError = {
|
|
18
|
-
|
|
22
|
+
component: ViewPresetErrorComponent;
|
|
23
|
+
errorType: ViewPresetErrorType;
|
|
19
24
|
message: string;
|
|
20
25
|
} | undefined;
|
|
21
26
|
export interface ViewPresetsListFilter {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { EntityState } from '@reduxjs/toolkit';
|
|
2
2
|
import { WorkspacePresetListItem, WorkspacePresetAction, PresetScope, WorkspacePresetFromBE, WorkspacePreset } from '../workspace/types';
|
|
3
3
|
export declare enum WorkspaceListErrorType {
|
|
4
|
+
AUTH = "AUTH",
|
|
4
5
|
GENERIC = "GENERIC"
|
|
5
6
|
}
|
|
6
7
|
export type WorkspaceListError = {
|