@opengeoweb/workspace 9.12.0 → 9.13.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 +48 -28
- package/package.json +1 -1
- package/src/lib/components/WorkspaceView/LoadingIndicator/LoadingIndicatorConnect.d.ts +6 -0
- package/src/lib/store/workspace/reducer.d.ts +2 -1
- package/src/lib/store/workspace/sagas.d.ts +1 -0
- package/src/lib/store/workspace/types.d.ts +5 -0
- package/src/lib/components/WorkspaceView/LoadingIndicator/LoadingIndicator.d.ts +0 -6
- /package/src/lib/components/WorkspaceView/LoadingIndicator/{LoadingIndicator.spec.d.ts → LoadingIndicatorConnect.spec.d.ts} +0 -0
package/index.esm.js
CHANGED
|
@@ -3366,6 +3366,11 @@ const slice$1 = createSlice({
|
|
|
3366
3366
|
draft.hasChanges = true;
|
|
3367
3367
|
draft.viewType = getViewType$1(draft.views.allIds.length, action.payload.componentType);
|
|
3368
3368
|
},
|
|
3369
|
+
setNewWorkspaceView: (
|
|
3370
|
+
// eslint-disable-next-line no-unused-vars
|
|
3371
|
+
draft,
|
|
3372
|
+
// eslint-disable-next-line no-unused-vars
|
|
3373
|
+
action) => {},
|
|
3369
3374
|
deleteWorkspaceView: (draft, action) => {
|
|
3370
3375
|
const {
|
|
3371
3376
|
id
|
|
@@ -6491,6 +6496,31 @@ function* saveWorkspacePresetSaga(action) {
|
|
|
6491
6496
|
}));
|
|
6492
6497
|
}
|
|
6493
6498
|
}
|
|
6499
|
+
function* setNewWorkspaceViewSaga({
|
|
6500
|
+
payload
|
|
6501
|
+
}) {
|
|
6502
|
+
const {
|
|
6503
|
+
mosaicNodeId,
|
|
6504
|
+
componentType,
|
|
6505
|
+
newId
|
|
6506
|
+
} = payload;
|
|
6507
|
+
const bbox = yield select(mapSelectors.getBbox, mosaicNodeId);
|
|
6508
|
+
const srs = yield select(mapSelectors.getSrs, mosaicNodeId);
|
|
6509
|
+
const mapPreset = bbox.bottom ? {
|
|
6510
|
+
proj: {
|
|
6511
|
+
bbox,
|
|
6512
|
+
srs
|
|
6513
|
+
}
|
|
6514
|
+
} : {};
|
|
6515
|
+
yield put(workspaceActions.addWorkspaceView({
|
|
6516
|
+
componentType,
|
|
6517
|
+
id: newId,
|
|
6518
|
+
initialProps: {
|
|
6519
|
+
mapPreset,
|
|
6520
|
+
syncGroupsIds: []
|
|
6521
|
+
}
|
|
6522
|
+
}));
|
|
6523
|
+
}
|
|
6494
6524
|
function* registerMapSaga({
|
|
6495
6525
|
payload
|
|
6496
6526
|
}) {
|
|
@@ -6530,6 +6560,7 @@ function* workspaceSaga() {
|
|
|
6530
6560
|
yield takeLatest(workspaceActions.saveWorkspacePreset, saveWorkspacePresetSaga);
|
|
6531
6561
|
yield takeLatest(workspaceActions.changeToEmptyMapWorkspace.type, changeToEmptyMapWorkspaceSaga);
|
|
6532
6562
|
yield takeEvery(workspaceActions.fetchWorkspaceViewPreset.type, fetchWorkspaceViewPresetSaga);
|
|
6563
|
+
yield takeEvery(workspaceActions.setNewWorkspaceView.type, setNewWorkspaceViewSaga);
|
|
6533
6564
|
yield debounce(100, updateWorkspaceViews.type, updateViewsSaga);
|
|
6534
6565
|
}
|
|
6535
6566
|
|
|
@@ -8307,10 +8338,11 @@ const WorkspaceOptions = /*#__PURE__*/React.memo(WorkspaceOptionsNoMemo);
|
|
|
8307
8338
|
* Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8308
8339
|
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
8309
8340
|
* */
|
|
8310
|
-
const
|
|
8311
|
-
|
|
8341
|
+
const LoadingIndicatorConnect = ({
|
|
8342
|
+
panelId
|
|
8312
8343
|
}) => {
|
|
8313
|
-
|
|
8344
|
+
const isLoading = useSelector(store => loadingIndicatorSelectors.isLoading(store, panelId));
|
|
8345
|
+
return isLoading ? ( /*#__PURE__*/React.createElement(CloudLoading, {
|
|
8314
8346
|
"data-testid": "cloudicon-loading",
|
|
8315
8347
|
style: {
|
|
8316
8348
|
fill: '#186DFF'
|
|
@@ -8368,7 +8400,6 @@ const WorkspaceViewTitleConnectNoMemo = ({
|
|
|
8368
8400
|
const hasMapPresetChanges = useSelector(store => getViewPresetHasChanges(store, panelId));
|
|
8369
8401
|
const activeMapPresetId = useSelector(store => getViewPresetActiveId(store, panelId));
|
|
8370
8402
|
const relatedSyncGroupIds = useSelector(store => syncGroupsSelectors.getAllTargetGroupsForSource(store, panelId));
|
|
8371
|
-
const isLoading = useSelector(store => loadingIndicatorSelectors.isLoading(store, panelId));
|
|
8372
8403
|
const isNewActive = activeMapPresetId === '';
|
|
8373
8404
|
const title = workspaceView.title || MAPPRESET_ACTIVE_TITLE;
|
|
8374
8405
|
const viewScope = workspaceView.scope;
|
|
@@ -8443,6 +8474,12 @@ const WorkspaceViewTitleConnectNoMemo = ({
|
|
|
8443
8474
|
isViewPresetListDialogOpen: isViewPresetDialogOpen
|
|
8444
8475
|
}));
|
|
8445
8476
|
}, [dispatch]);
|
|
8477
|
+
const onClickOpenViewPreset = React.useCallback(() => {
|
|
8478
|
+
toggleViewPresetDialog({
|
|
8479
|
+
panelId,
|
|
8480
|
+
isViewPresetDialogOpen: !isViewPresetDialogOpen
|
|
8481
|
+
});
|
|
8482
|
+
}, [isViewPresetDialogOpen, panelId, toggleViewPresetDialog]);
|
|
8446
8483
|
const style = React.useMemo(() => customIconStyles(theme, isViewPresetDialogOpen), [isViewPresetDialogOpen, theme]);
|
|
8447
8484
|
const presetIcon = React.useMemo(() => /*#__PURE__*/React.createElement(Preset, null), []);
|
|
8448
8485
|
renderCounter.count(WorkspaceViewTitleConnectNoMemo.name);
|
|
@@ -8450,12 +8487,7 @@ const WorkspaceViewTitleConnectNoMemo = ({
|
|
|
8450
8487
|
"data-testid": "open-viewpresets",
|
|
8451
8488
|
sx: style,
|
|
8452
8489
|
variant: "tool",
|
|
8453
|
-
onClick:
|
|
8454
|
-
toggleViewPresetDialog({
|
|
8455
|
-
panelId,
|
|
8456
|
-
isViewPresetDialogOpen: !isViewPresetDialogOpen
|
|
8457
|
-
});
|
|
8458
|
-
}, [isViewPresetDialogOpen, panelId, toggleViewPresetDialog]),
|
|
8490
|
+
onClick: onClickOpenViewPreset,
|
|
8459
8491
|
tooltipTitle: VIEW_PRESET_MENU_TOOLTIP,
|
|
8460
8492
|
isSelected: isViewPresetDialogOpen
|
|
8461
8493
|
}, presetIcon), /*#__PURE__*/React.createElement(WorkspaceOptions, {
|
|
@@ -8467,8 +8499,8 @@ const WorkspaceViewTitleConnectNoMemo = ({
|
|
|
8467
8499
|
handleSaveAs: onSaveAs,
|
|
8468
8500
|
handleEdit: viewScope === 'user' ? onEdit : undefined,
|
|
8469
8501
|
id: "viewpreset-options-toolbutton"
|
|
8470
|
-
}), /*#__PURE__*/React.createElement(
|
|
8471
|
-
|
|
8502
|
+
}), /*#__PURE__*/React.createElement(LoadingIndicatorConnect, {
|
|
8503
|
+
panelId: panelId
|
|
8472
8504
|
}));
|
|
8473
8505
|
};
|
|
8474
8506
|
const WorkspaceViewTitleConnect = /*#__PURE__*/React.memo(WorkspaceViewTitleConnectNoMemo);
|
|
@@ -8496,16 +8528,13 @@ const WorkspaceTileConnect = /*#__PURE__*/React.memo(({
|
|
|
8496
8528
|
}) => {
|
|
8497
8529
|
const dispatch = useDispatch();
|
|
8498
8530
|
const view = useSelector(store => getViewById(store, _mosaicNodeId));
|
|
8499
|
-
// TODO: make bbox and srs work independent of core lib https://gitlab.com/opengeoweb/opengeoweb/-/issues/1525
|
|
8500
|
-
const bbox = useSelector(store => mapSelectors.getBbox(store, _mosaicNodeId));
|
|
8501
|
-
const srs = useSelector(store => mapSelectors.getSrs(store, _mosaicNodeId));
|
|
8502
8531
|
const viewIds = useSelector(store => getViewIds(store));
|
|
8503
8532
|
const shouldPreventCloseView = useSelector(store => getShouldPreventClose(store, _mosaicNodeId));
|
|
8504
8533
|
const isViewPresetDialogOpen = useSelector(store => getIsViewPresetListDialogOpen(store, _mosaicNodeId));
|
|
8505
8534
|
const isViewPresetsFetching = useSelector(store => getViewPresetsIsFetching(store, _mosaicNodeId));
|
|
8506
8535
|
const errorViewPreset = useSelector(store => getViewPresetDetailError(store, _mosaicNodeId));
|
|
8507
8536
|
const addView = React.useCallback(view => {
|
|
8508
|
-
dispatch(workspaceActions.
|
|
8537
|
+
dispatch(workspaceActions.setNewWorkspaceView(view));
|
|
8509
8538
|
}, [dispatch]);
|
|
8510
8539
|
const registerView = React.useCallback(({
|
|
8511
8540
|
panelId,
|
|
@@ -8534,22 +8563,13 @@ const WorkspaceTileConnect = /*#__PURE__*/React.memo(({
|
|
|
8534
8563
|
}, [dispatch]);
|
|
8535
8564
|
const createNode = React.useCallback(() => {
|
|
8536
8565
|
const newId = getUniqueId(viewIds);
|
|
8537
|
-
const mapPreset = bbox.bottom ? {
|
|
8538
|
-
proj: {
|
|
8539
|
-
bbox,
|
|
8540
|
-
srs
|
|
8541
|
-
}
|
|
8542
|
-
} : {};
|
|
8543
8566
|
addView({
|
|
8544
8567
|
componentType: 'Map',
|
|
8545
|
-
|
|
8546
|
-
|
|
8547
|
-
mapPreset,
|
|
8548
|
-
syncGroupsIds: []
|
|
8549
|
-
}
|
|
8568
|
+
mosaicNodeId: _mosaicNodeId,
|
|
8569
|
+
newId
|
|
8550
8570
|
});
|
|
8551
8571
|
return newId;
|
|
8552
|
-
}, [
|
|
8572
|
+
}, [addView, _mosaicNodeId, viewIds]);
|
|
8553
8573
|
const title = (view === null || view === void 0 ? void 0 : view.title) || (view === null || view === void 0 ? void 0 : view.id) || _mosaicNodeId;
|
|
8554
8574
|
React.useEffect(() => {
|
|
8555
8575
|
const viewPresetId = (view === null || view === void 0 ? void 0 : view.id) || '';
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Reducer } from '@reduxjs/toolkit';
|
|
2
|
-
import { WorkspaceAddViewPayload, WorkspaceDeleteViewPayload, WorkspaceState, WorkspaceSetPresetPayload, WorkspaceSetPreventCloseViewPayload, WorkspaceUpdateViewPayload, WorkspaceUpdateViewsPayload, WorkspaceErrorWorkspacePayload, WorkspaceFetchedWorkspacePayload, WorkspaceFetchWorkspacePayload, WorkspaceFetchWorkspaceViewPresetPayload, WorkspaceSaveWorkspacePresetPayload, WorkspaceSetInitialViewMapPresetPayload } from './types';
|
|
2
|
+
import { WorkspaceAddViewPayload, WorkspaceDeleteViewPayload, WorkspaceState, WorkspaceSetPresetPayload, WorkspaceSetPreventCloseViewPayload, WorkspaceUpdateViewPayload, WorkspaceUpdateViewsPayload, WorkspaceErrorWorkspacePayload, WorkspaceFetchedWorkspacePayload, WorkspaceFetchWorkspacePayload, WorkspaceFetchWorkspaceViewPresetPayload, WorkspaceSaveWorkspacePresetPayload, WorkspaceSetInitialViewMapPresetPayload, WorkspaceSetNewViewPayload } from './types';
|
|
3
3
|
export declare const initialState: WorkspaceState;
|
|
4
4
|
export declare const reducer: Reducer<WorkspaceState>;
|
|
5
5
|
export declare const workspaceActions: {
|
|
6
6
|
setInitialViewMapPreset: import("@reduxjs/toolkit").ActionCreatorWithPayload<WorkspaceSetInitialViewMapPresetPayload, "workspace/setInitialViewMapPreset">;
|
|
7
7
|
addWorkspaceView: import("@reduxjs/toolkit").ActionCreatorWithPayload<WorkspaceAddViewPayload, "workspace/addWorkspaceView">;
|
|
8
|
+
setNewWorkspaceView: import("@reduxjs/toolkit").ActionCreatorWithPayload<WorkspaceSetNewViewPayload, "workspace/setNewWorkspaceView">;
|
|
8
9
|
deleteWorkspaceView: import("@reduxjs/toolkit").ActionCreatorWithPayload<WorkspaceDeleteViewPayload, "workspace/deleteWorkspaceView">;
|
|
9
10
|
updateWorkspaceViews: import("@reduxjs/toolkit").ActionCreatorWithPayload<WorkspaceUpdateViewsPayload, "workspace/updateWorkspaceViews">;
|
|
10
11
|
updateWorkspaceView: import("@reduxjs/toolkit").ActionCreatorWithPayload<WorkspaceUpdateViewPayload, "workspace/updateWorkspaceView">;
|
|
@@ -7,6 +7,7 @@ export declare function updateViewsSaga(): SagaIterator;
|
|
|
7
7
|
export declare function fetchWorkspaceViewPresetSaga({ payload, }: ReturnType<typeof workspaceActions.fetchWorkspaceViewPreset>): SagaIterator;
|
|
8
8
|
export declare function fetchWorkspaceSaga(action: ReturnType<typeof workspaceActions.fetchWorkspace>): SagaIterator;
|
|
9
9
|
export declare function saveWorkspacePresetSaga(action: ReturnType<typeof workspaceActions.saveWorkspacePreset>): SagaIterator;
|
|
10
|
+
export declare function setNewWorkspaceViewSaga({ payload, }: ReturnType<typeof workspaceActions.setNewWorkspaceView>): SagaIterator;
|
|
10
11
|
export declare function registerMapSaga({ payload, }: ReturnType<typeof mapStoreActions.registerMap>): SagaIterator;
|
|
11
12
|
export declare function unregisterMapSaga({ payload, }: ReturnType<typeof mapStoreActions.unregisterMap>): SagaIterator;
|
|
12
13
|
declare function workspaceSaga(): SagaIterator;
|
|
@@ -78,6 +78,11 @@ export interface WorkspaceAddViewPayload {
|
|
|
78
78
|
componentType: string;
|
|
79
79
|
initialProps: InitialPropsWorkspaceViewType;
|
|
80
80
|
}
|
|
81
|
+
export interface WorkspaceSetNewViewPayload {
|
|
82
|
+
mosaicNodeId: string;
|
|
83
|
+
newId: string;
|
|
84
|
+
componentType: string;
|
|
85
|
+
}
|
|
81
86
|
export interface WorkspaceDeleteViewPayload {
|
|
82
87
|
id: string;
|
|
83
88
|
}
|