@opengeoweb/workspace 9.4.0 → 9.5.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
CHANGED
|
@@ -4,7 +4,7 @@ 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 { debounce, takeEvery, takeLatest, all, put, delay, call, select, takeLeading } from 'redux-saga/effects';
|
|
7
|
-
import { isAxiosError, getAxiosErrorMessage, withEggs, ConfirmationServiceProvider, useConfirmationDialog, CustomIconButton, AlertBanner, CustomTooltip, SearchHighlight, ToggleMenu, getHeight, usePrevious, ToolContainer, CustomToggleButton, ConfirmationDialog } from '@opengeoweb/shared';
|
|
7
|
+
import { isAxiosError, getAxiosErrorMessage, withEggs, ConfirmationServiceProvider, useConfirmationDialog, CustomIconButton, AlertBanner, CustomTooltip, SearchHighlight, ToggleMenu, getHeight, usePrevious, renderCounter, ToolContainer, CustomToggleButton, ConfirmationDialog } from '@opengeoweb/shared';
|
|
8
8
|
import { snackbarActions, SnackbarWrapperConnect } from '@opengeoweb/snackbar';
|
|
9
9
|
import * as React from 'react';
|
|
10
10
|
import React__default, { useCallback } from 'react';
|
|
@@ -6204,6 +6204,7 @@ var ViewPresetMenu = function ViewPresetMenu(_ref) {
|
|
|
6204
6204
|
}, /*#__PURE__*/React__default.createElement(ViewPresetMenuListConnect, {
|
|
6205
6205
|
panelId: panelId
|
|
6206
6206
|
}));
|
|
6207
|
+
renderCounter.count(ViewPresetMenu.name);
|
|
6207
6208
|
return /*#__PURE__*/React__default.createElement("div", null, hideBackdrop ?
|
|
6208
6209
|
// Enable hiding backdrop from snapshot tests
|
|
6209
6210
|
toolContainer : ( /*#__PURE__*/React__default.createElement(Backdrop, {
|
|
@@ -6482,6 +6483,15 @@ var WorkspaceViewTitleConnect = function WorkspaceViewTitleConnect(_ref) {
|
|
|
6482
6483
|
var title = (workspaceView === null || workspaceView === void 0 ? void 0 : workspaceView.title) || MAPPRESET_ACTIVE_TITLE;
|
|
6483
6484
|
var viewScope = workspaceView === null || workspaceView === void 0 ? void 0 : workspaceView.scope;
|
|
6484
6485
|
var fullTitle = getPresetTitle(title, hasMapPresetChanges, isNewActive);
|
|
6486
|
+
// TODO: https://gitlab.com/opengeoweb/opengeoweb/-/issues/4546
|
|
6487
|
+
// This component renders on every change in the mapstate.
|
|
6488
|
+
// This is because selectors like mapSelectors.getMapPreset are used in the component.
|
|
6489
|
+
// The data from this selector is not used during a render, so it is wasting renders.
|
|
6490
|
+
// The data is need only in the callback functions - not the component itself
|
|
6491
|
+
// To prevent unneeded renders, this code should be rewritten by using refs, or move the logic to sagas.
|
|
6492
|
+
// You can use the renderCounter to check the nubmer of renders.
|
|
6493
|
+
// Also check https://xam-react-coe.medium.com/react-useselector-without-re-render-225686bee3f
|
|
6494
|
+
renderCounter.count(WorkspaceViewTitleConnect.name);
|
|
6485
6495
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CustomIconButton, {
|
|
6486
6496
|
"data-testid": "open-viewpresets",
|
|
6487
6497
|
sx: {
|
package/package.json
CHANGED
|
@@ -142,9 +142,7 @@ export declare const getWorkspaceData: ((state: AppStore & import("@opengeoweb/s
|
|
|
142
142
|
}> & {
|
|
143
143
|
clearCache: () => void;
|
|
144
144
|
};
|
|
145
|
-
export declare const getViewPresetToSendToBackend: ((state:
|
|
146
|
-
sourceId: string;
|
|
147
|
-
})) => {
|
|
145
|
+
export declare const getViewPresetToSendToBackend: ((state: any, viewId: any) => {
|
|
148
146
|
id: string | undefined;
|
|
149
147
|
scope: import("./types").PresetScope;
|
|
150
148
|
title: string;
|