@opengeoweb/time-series 14.3.0 → 14.4.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 +28 -14
- package/package.json +10 -10
- package/src/lib/utils/timeseries-api/hooks.d.ts +2 -1
package/index.esm.js
CHANGED
|
@@ -6,7 +6,7 @@ import { mapUtils, selectorMemoizationOptions, genericSelectors, uiSelectors, ui
|
|
|
6
6
|
import { snackbarActions, snackbarTypes, snackbarListener, snackbarReducer } from '@opengeoweb/snackbar';
|
|
7
7
|
import { dateUtils, CustomTooltip, CustomToggleButton, TooltipSelect, CustomIconButton, CustomAccordion, ToolContainerDraggable, SearchHighlight, SearchField, ToggleMenu, CustomDialog, AlertBanner, useConfirmationDialog, SwitchButton, useResizeObserver } from '@opengeoweb/shared';
|
|
8
8
|
import { MenuItem, useTheme, LinearProgress, Grid, Box, Typography, ClickAwayListener, Input, Collapse, ListItem, ListItemButton, ListItemText, List, Button, InputAdornment, Card, styled, Stack, Tooltip, ListItemIcon, Checkbox } from '@mui/material';
|
|
9
|
-
import { isString, trim, trimStart, compact, chain, groupBy, sortBy, uniqBy, isEqual } from 'lodash';
|
|
9
|
+
import { isString, trim, trimStart, compact, chain, groupBy, countBy, sortBy, uniqBy, isEqual } from 'lodash';
|
|
10
10
|
import { ReactSortable } from 'react-sortablejs';
|
|
11
11
|
import i18n from 'i18next';
|
|
12
12
|
import { useTranslation } from 'react-i18next';
|
|
@@ -141,6 +141,7 @@ var en = {
|
|
|
141
141
|
"timeseries-legend-tooltip-show": "Show legend",
|
|
142
142
|
"timeseries-legend-tooltip-hide": "Hide legend",
|
|
143
143
|
"error-title": "Some parameters could not be loaded.",
|
|
144
|
+
"error-message-missing-collection-or-service": "No collection and/or service found for parameter.",
|
|
144
145
|
"timeseries-add-plot": "Add plot"
|
|
145
146
|
};
|
|
146
147
|
var fi = {
|
|
@@ -252,6 +253,7 @@ var fi = {
|
|
|
252
253
|
"timeseries-legend-tooltip-show": "Näytä selite",
|
|
253
254
|
"timeseries-legend-tooltip-hide": "Piilota selite",
|
|
254
255
|
"error-title": "Joitain parametreja ei pystytty lataamaan",
|
|
256
|
+
"error-message-missing-collection-or-service": "Parametrille ei löytynyt kokoelmaa ja/tai palvelua",
|
|
255
257
|
"timeseries-add-plot": "Lisää kaavio"
|
|
256
258
|
};
|
|
257
259
|
var no = {
|
|
@@ -362,7 +364,8 @@ var no = {
|
|
|
362
364
|
"timeseries-legend": "Forklaring",
|
|
363
365
|
"timeseries-legend-tooltip-show": "Vis forklaring",
|
|
364
366
|
"timeseries-legend-tooltip-hide": "Skjul forklaring",
|
|
365
|
-
"error-title": "ikke
|
|
367
|
+
"error-title": "Noen parametere kunne ikke lastes.",
|
|
368
|
+
"error-message-missing-collection-or-service": "Ingen kolleksjon og/eller tjeneste funnet for parameter.",
|
|
366
369
|
"timeseries-add-plot": "Legg til plott"
|
|
367
370
|
};
|
|
368
371
|
var nl = {
|
|
@@ -479,6 +482,7 @@ var nl = {
|
|
|
479
482
|
"timeseries-legend-tooltip-show": "Toon legenda",
|
|
480
483
|
"timeseries-legend-tooltip-hide": "Verberg legenda",
|
|
481
484
|
"error-title": "Sommige parameters konden niet worden geladen.",
|
|
485
|
+
"error-message-missing-collection-or-service": "Geen collectie en/of service gevonden voor parameter.",
|
|
482
486
|
"timeseries-add-plot": "Grafiek toevoegen"
|
|
483
487
|
};
|
|
484
488
|
var timeseriesTranslations = {
|
|
@@ -2775,7 +2779,7 @@ var useGetCollectionsAndInstanceDetails = function useGetCollectionsAndInstanceD
|
|
|
2775
2779
|
}
|
|
2776
2780
|
});
|
|
2777
2781
|
};
|
|
2778
|
-
var useGetPlotsWithData = function useGetPlotsWithData(plotsWithoutData, selectedLocation, services, splitGeoJsonByCollection) {
|
|
2782
|
+
var useGetPlotsWithData = function useGetPlotsWithData(plotsWithoutData, selectedLocation, services, splitGeoJsonByCollection, t) {
|
|
2779
2783
|
var _useState = useState([]),
|
|
2780
2784
|
plotsWithData = _useState[0],
|
|
2781
2785
|
setPlotsWithData = _useState[1];
|
|
@@ -2785,7 +2789,8 @@ var useGetPlotsWithData = function useGetPlotsWithData(plotsWithoutData, selecte
|
|
|
2785
2789
|
}, [plotsWithoutData, services]);
|
|
2786
2790
|
// First fetch collection and any relevant instance data
|
|
2787
2791
|
var _useGetCollectionsAnd = useGetCollectionsAndInstanceDetails(collectionsList),
|
|
2788
|
-
collectionDetails = _useGetCollectionsAnd.data
|
|
2792
|
+
collectionDetails = _useGetCollectionsAnd.data,
|
|
2793
|
+
isDetailsFetching = _useGetCollectionsAnd.isFetching;
|
|
2789
2794
|
var geojsonMap = useMemo(function () {
|
|
2790
2795
|
return new Map(splitGeoJsonByCollection.map(function (gjs) {
|
|
2791
2796
|
return [gjs.serviceName + "_" + gjs.collectionName, gjs];
|
|
@@ -2794,8 +2799,9 @@ var useGetPlotsWithData = function useGetPlotsWithData(plotsWithoutData, selecte
|
|
|
2794
2799
|
// Construct all queries to be executed
|
|
2795
2800
|
var queries = useMemo(function () {
|
|
2796
2801
|
return plotsWithoutData.parameters.map(function (parameter) {
|
|
2797
|
-
var _collection$allInstan, _parameter$dimension;
|
|
2798
|
-
|
|
2802
|
+
var _collectionsList, _collection$allInstan, _parameter$dimension;
|
|
2803
|
+
// Note: service can be undefined
|
|
2804
|
+
var service = (_collectionsList = collectionsList[parameter.serviceId + "-" + parameter.collectionId]) == null ? void 0 : _collectionsList.service;
|
|
2799
2805
|
var collection = collectionDetails == null ? void 0 : collectionDetails.find(function (collection) {
|
|
2800
2806
|
return collection.serviceId === parameter.serviceId && collection.collectionId === parameter.collectionId;
|
|
2801
2807
|
});
|
|
@@ -2815,11 +2821,11 @@ var useGetPlotsWithData = function useGetPlotsWithData(plotsWithoutData, selecte
|
|
|
2815
2821
|
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
2816
2822
|
while (1) switch (_context7.prev = _context7.next) {
|
|
2817
2823
|
case 0:
|
|
2818
|
-
if (collection) {
|
|
2824
|
+
if (!(!collection || !service)) {
|
|
2819
2825
|
_context7.next = 2;
|
|
2820
2826
|
break;
|
|
2821
2827
|
}
|
|
2822
|
-
throw new Error('
|
|
2828
|
+
throw new Error('error-message-missing-collection-or-service');
|
|
2823
2829
|
case 2:
|
|
2824
2830
|
_context7.next = 4;
|
|
2825
2831
|
return fetchEdrParameter(parameter, selectedLocation, service, geojsonMap, intervalParam, collection, instanceInfo);
|
|
@@ -2837,12 +2843,15 @@ var useGetPlotsWithData = function useGetPlotsWithData(plotsWithoutData, selecte
|
|
|
2837
2843
|
}
|
|
2838
2844
|
return queryFn;
|
|
2839
2845
|
}(),
|
|
2840
|
-
enabled: !!parameter && !!selectedLocation.lon && !!selectedLocation.lat &&
|
|
2846
|
+
enabled: !!parameter && !!selectedLocation.lon && !!selectedLocation.lat && (
|
|
2847
|
+
// This condition allows us to see errors about missing collections/services
|
|
2848
|
+
// that can not be explained by unfinished previous queries
|
|
2849
|
+
!isDetailsFetching || !!collection && !!service),
|
|
2841
2850
|
refetchInterval: 5 * 60 * 1000,
|
|
2842
2851
|
retry: false
|
|
2843
2852
|
};
|
|
2844
2853
|
});
|
|
2845
|
-
}, [collectionDetails, geojsonMap, plotsWithoutData.parameters, selectedLocation, collectionsList]);
|
|
2854
|
+
}, [collectionDetails, geojsonMap, plotsWithoutData.parameters, selectedLocation, collectionsList, isDetailsFetching]);
|
|
2846
2855
|
var results = useQueries({
|
|
2847
2856
|
queries: queries,
|
|
2848
2857
|
combine: function combine(results) {
|
|
@@ -2854,10 +2863,15 @@ var useGetPlotsWithData = function useGetPlotsWithData(plotsWithoutData, selecte
|
|
|
2854
2863
|
var isFetching = results.some(function (result) {
|
|
2855
2864
|
return result.isFetching;
|
|
2856
2865
|
});
|
|
2857
|
-
var
|
|
2866
|
+
var errorsWithCount = countBy(results.map(function (result) {
|
|
2858
2867
|
var _result$error;
|
|
2859
2868
|
return result == null || (_result$error = result.error) == null ? void 0 : _result$error.message;
|
|
2860
|
-
}).filter(Boolean)
|
|
2869
|
+
}).filter(Boolean));
|
|
2870
|
+
var errorMessage = Object.entries(errorsWithCount).map(function (_ref) {
|
|
2871
|
+
var message = _ref[0],
|
|
2872
|
+
count = _ref[1];
|
|
2873
|
+
return "\"" + t(message) + "\" (x" + count + ")";
|
|
2874
|
+
}).join(', ');
|
|
2861
2875
|
var error = errorMessage ? new Error(errorMessage) : null;
|
|
2862
2876
|
return {
|
|
2863
2877
|
data: data,
|
|
@@ -7158,7 +7172,7 @@ var TimeSeriesView = /*#__PURE__*/React__default.memo(function (_ref) {
|
|
|
7158
7172
|
onToggleLegendParam = _ref.onToggleLegendParam;
|
|
7159
7173
|
var _useTimeseriesTransla = useTimeseriesTranslation(),
|
|
7160
7174
|
t = _useTimeseriesTransla.t;
|
|
7161
|
-
var _useGetPlotsWithData = useGetPlotsWithData(plotPreset, selectedLocation, services, splitGeoJsonByCollection),
|
|
7175
|
+
var _useGetPlotsWithData = useGetPlotsWithData(plotPreset, selectedLocation, services, splitGeoJsonByCollection, t),
|
|
7162
7176
|
plotsWithData = _useGetPlotsWithData.data,
|
|
7163
7177
|
isFetchingPlots = _useGetPlotsWithData.isFetching,
|
|
7164
7178
|
error = _useGetPlotsWithData.error;
|
|
@@ -7176,7 +7190,7 @@ var TimeSeriesView = /*#__PURE__*/React__default.memo(function (_ref) {
|
|
|
7176
7190
|
},
|
|
7177
7191
|
children: [error && jsx(AlertBanner, {
|
|
7178
7192
|
title: t('error-title'),
|
|
7179
|
-
info: "
|
|
7193
|
+
info: "" + error.message,
|
|
7180
7194
|
shouldClose: true
|
|
7181
7195
|
}), plotsWithData && jsx(TimeSeriesChart, {
|
|
7182
7196
|
plotsWithData: plotsWithData,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/time-series",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.4.0",
|
|
4
4
|
"description": "GeoWeb time-series library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -9,26 +9,26 @@
|
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"immer": "^10.0.3",
|
|
12
|
-
"@opengeoweb/shared": "14.
|
|
12
|
+
"@opengeoweb/shared": "14.4.0",
|
|
13
13
|
"@reduxjs/toolkit": "^2.6.1",
|
|
14
14
|
"react-redux": "^9.2.0",
|
|
15
|
-
"@opengeoweb/webmap": "14.
|
|
16
|
-
"@opengeoweb/webmap-react": "14.
|
|
15
|
+
"@opengeoweb/webmap": "14.4.0",
|
|
16
|
+
"@opengeoweb/webmap-react": "14.4.0",
|
|
17
17
|
"lodash": "^4.17.21",
|
|
18
|
-
"@opengeoweb/api": "14.
|
|
19
|
-
"@opengeoweb/theme": "14.
|
|
20
|
-
"@opengeoweb/store": "14.
|
|
18
|
+
"@opengeoweb/api": "14.4.0",
|
|
19
|
+
"@opengeoweb/theme": "14.4.0",
|
|
20
|
+
"@opengeoweb/store": "14.4.0",
|
|
21
21
|
"echarts-for-react": "^3.0.2",
|
|
22
22
|
"echarts": "^5.4.3",
|
|
23
23
|
"react-sortablejs": "^6.1.4",
|
|
24
|
-
"@opengeoweb/snackbar": "14.
|
|
24
|
+
"@opengeoweb/snackbar": "14.4.0",
|
|
25
25
|
"react-window": "^1.8.10",
|
|
26
26
|
"react-virtualized-auto-sizer": "^1.0.21",
|
|
27
27
|
"msw": "^2.7.3",
|
|
28
28
|
"i18next": "^25.0.1",
|
|
29
29
|
"react-i18next": "^15.1.1",
|
|
30
|
-
"@opengeoweb/core": "14.
|
|
31
|
-
"@opengeoweb/form-fields": "14.
|
|
30
|
+
"@opengeoweb/core": "14.4.0",
|
|
31
|
+
"@opengeoweb/form-fields": "14.4.0",
|
|
32
32
|
"@mui/material": "^7.0.1",
|
|
33
33
|
"react-hook-form": "^7.61.1",
|
|
34
34
|
"uuid": "^10.0.0",
|
|
@@ -5,6 +5,7 @@ import { EDRServiceInformation } from './api';
|
|
|
5
5
|
import { TimeseriesCollectionDetail } from '../../components/TimeSeriesSelect/utils';
|
|
6
6
|
import { EDRCollection, EDRInstance, GeoJsonWithService, PlotWithData, PointerLocation, UseGetLocationReturnTypeProperties } from '../../components/TimeSeries/types';
|
|
7
7
|
import { ParameterCollectionQueryData } from '../../components/TimeSeries/utils';
|
|
8
|
+
import { TFunction } from 'i18next';
|
|
8
9
|
interface CombinedResult<T> {
|
|
9
10
|
data: T | undefined;
|
|
10
11
|
isFetching: boolean;
|
|
@@ -50,7 +51,7 @@ export declare const useGetDetailsForCollection: (service: TimeSeriesService, co
|
|
|
50
51
|
export declare const useGetInstances: (serviceUrl: string, collectionId: string, supportsInstances?: boolean) => UseQueryResult<EDRInstance[]>;
|
|
51
52
|
export declare const useGetServiceCollectionDetails: (services: TimeSeriesService[], isOpen: boolean) => CombinedResult<TimeseriesCollectionDetail[]>;
|
|
52
53
|
export declare const useGetCollectionsAndInstanceDetails: (queryData: Record<string, ParameterCollectionQueryData>) => CombinedResult<TimeseriesCollectionDetail[]>;
|
|
53
|
-
export declare const useGetPlotsWithData: (plotsWithoutData: PlotPreset, selectedLocation: PointerLocation, services: TimeSeriesService[], splitGeoJsonByCollection: GeoJsonWithService[]) => {
|
|
54
|
+
export declare const useGetPlotsWithData: (plotsWithoutData: PlotPreset, selectedLocation: PointerLocation, services: TimeSeriesService[], splitGeoJsonByCollection: GeoJsonWithService[], t: TFunction) => {
|
|
54
55
|
data: PlotWithData[] | undefined;
|
|
55
56
|
isFetching: boolean;
|
|
56
57
|
error: Error | null | undefined;
|