@opengeoweb/warnings 6.0.3 → 6.0.4
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 'react-dom';
|
|
|
4
4
|
import { Polygons, Edit, Delete } from '@opengeoweb/theme';
|
|
5
5
|
import { uiTypes, uiSelectors, uiActions, layerSelectors, drawSelectors, mapStoreActions, drawActions, snackbarActions } from '@opengeoweb/store';
|
|
6
6
|
import { MapControlButton, useSetupDialog } from '@opengeoweb/core';
|
|
7
|
-
import { dateUtils, ToggleMenu, ToolContainerDraggable, calculateDialogSizeAndPosition } from '@opengeoweb/shared';
|
|
7
|
+
import { dateUtils, ToggleMenu, ToolContainerDraggable, AlertBanner, calculateDialogSizeAndPosition } from '@opengeoweb/shared';
|
|
8
8
|
import { List, Typography, ListItem, MenuItem, ListItemText, Paper, ListItemButton, Box, Stack } from '@mui/material';
|
|
9
9
|
import { getApi, createApiInstance, createNonAuthApiInstance, createFakeApiInstance, ApiProvider } from '@opengeoweb/api';
|
|
10
10
|
|
|
@@ -1738,7 +1738,8 @@ var AreaManager = function AreaManager(_ref) {
|
|
|
1738
1738
|
_ref$onEditDrawing = _ref.onEditDrawing,
|
|
1739
1739
|
onEditDrawing = _ref$onEditDrawing === void 0 ? function () {} : _ref$onEditDrawing,
|
|
1740
1740
|
_ref$activeDrawingId = _ref.activeDrawingId,
|
|
1741
|
-
activeDrawingId = _ref$activeDrawingId === void 0 ? '' : _ref$activeDrawingId
|
|
1741
|
+
activeDrawingId = _ref$activeDrawingId === void 0 ? '' : _ref$activeDrawingId,
|
|
1742
|
+
error = _ref.error;
|
|
1742
1743
|
var minSize = DEFAULT_AREA_MANAGER_MIN_SIZE;
|
|
1743
1744
|
var startSizeCalc = calculateStartSize(minSize, size, startPosition);
|
|
1744
1745
|
var _React$useState = React.useState(startSizeCalc),
|
|
@@ -1783,7 +1784,10 @@ var AreaManager = function AreaManager(_ref) {
|
|
|
1783
1784
|
setSizeInState(dragSize);
|
|
1784
1785
|
}
|
|
1785
1786
|
}
|
|
1786
|
-
}, /*#__PURE__*/React.createElement(
|
|
1787
|
+
}, error && /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(AlertBanner, {
|
|
1788
|
+
title: error,
|
|
1789
|
+
shouldClose: true
|
|
1790
|
+
})), /*#__PURE__*/React.createElement(Drawings, {
|
|
1787
1791
|
drawings: drawingListItems,
|
|
1788
1792
|
onClickDrawing: onClickDrawing,
|
|
1789
1793
|
onClickEdit: onEditDrawing,
|
|
@@ -1847,7 +1851,8 @@ var AreaManagerConnect = function AreaManagerConnect(_ref) {
|
|
|
1847
1851
|
onCloseDialog = _useSetupDialog.onCloseDialog,
|
|
1848
1852
|
isDialogOpen = _useSetupDialog.isDialogOpen,
|
|
1849
1853
|
uiSource = _useSetupDialog.uiSource,
|
|
1850
|
-
setFocused = _useSetupDialog.setFocused
|
|
1854
|
+
setFocused = _useSetupDialog.setFocused,
|
|
1855
|
+
uiError = _useSetupDialog.uiError;
|
|
1851
1856
|
var warningsApi = getWarningsApi();
|
|
1852
1857
|
var dispatch = useDispatch();
|
|
1853
1858
|
var mapId = useSelector(function (store) {
|
|
@@ -1865,10 +1870,22 @@ var AreaManagerConnect = function AreaManagerConnect(_ref) {
|
|
|
1865
1870
|
_useState2 = _slicedToArray(_useState, 2),
|
|
1866
1871
|
drawings = _useState2[0],
|
|
1867
1872
|
setDrawings = _useState2[1];
|
|
1868
|
-
|
|
1873
|
+
var fetchDrawings = function fetchDrawings() {
|
|
1874
|
+
uiActions.setErrorDialog({
|
|
1875
|
+
error: 'error.message',
|
|
1876
|
+
type: dialogType
|
|
1877
|
+
});
|
|
1869
1878
|
warningsApi.getDrawings().then(function (response) {
|
|
1870
1879
|
setDrawings(response.data);
|
|
1880
|
+
})["catch"](function (error) {
|
|
1881
|
+
dispatch(uiActions.setErrorDialog({
|
|
1882
|
+
error: error.message,
|
|
1883
|
+
type: dialogType
|
|
1884
|
+
}));
|
|
1871
1885
|
});
|
|
1886
|
+
};
|
|
1887
|
+
useEffect(function () {
|
|
1888
|
+
fetchDrawings();
|
|
1872
1889
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1873
1890
|
}, []);
|
|
1874
1891
|
var deleteGeoJSONLayer = function deleteGeoJSONLayer() {
|
|
@@ -2001,7 +2018,8 @@ var AreaManagerConnect = function AreaManagerConnect(_ref) {
|
|
|
2001
2018
|
onClickDrawing: onClickDrawing,
|
|
2002
2019
|
onUnMount: onHideAreaManager,
|
|
2003
2020
|
onEditDrawing: onEditDrawing,
|
|
2004
|
-
activeDrawingId: activeDrawingId
|
|
2021
|
+
activeDrawingId: activeDrawingId,
|
|
2022
|
+
error: uiError
|
|
2005
2023
|
});
|
|
2006
2024
|
};
|
|
2007
2025
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/warnings",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.4",
|
|
4
4
|
"description": "GeoWeb warinings library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@mui/material": "5.12.0",
|
|
12
|
-
"@opengeoweb/api": "6.0.
|
|
13
|
-
"@opengeoweb/core": "6.0.
|
|
14
|
-
"@opengeoweb/shared": "6.0.
|
|
15
|
-
"@opengeoweb/store": "6.0.
|
|
16
|
-
"@opengeoweb/theme": "6.0.
|
|
12
|
+
"@opengeoweb/api": "6.0.4",
|
|
13
|
+
"@opengeoweb/core": "6.0.4",
|
|
14
|
+
"@opengeoweb/shared": "6.0.4",
|
|
15
|
+
"@opengeoweb/store": "6.0.4",
|
|
16
|
+
"@opengeoweb/theme": "6.0.4",
|
|
17
17
|
"@reduxjs/toolkit": "1.9.5",
|
|
18
18
|
"axios": "1.4.0",
|
|
19
19
|
"react": "18.2.0",
|