@opengeoweb/time-series 15.3.0 → 17.0.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 +1659 -509
- package/package.json +11 -11
- package/src/index.d.ts +0 -4
- package/src/lib/TimeSeriesDemo.stories.d.ts +0 -44
- package/src/lib/components/ComponentsLookUp/componentsLookUp.d.ts +0 -23
- package/src/lib/components/ComponentsLookUp/componentsLookUp.stories.d.ts +0 -9
- package/src/lib/components/ComponentsLookUp/componentsLookup.spec.d.ts +0 -1
- package/src/lib/components/ComponentsLookUp/index.d.ts +0 -1
- package/src/lib/components/Providers/Providers.d.ts +0 -32
- package/src/lib/components/Providers/index.d.ts +0 -1
- package/src/lib/components/TimeSeries/LocationDropdown/LocationDropdown.d.ts +0 -13
- package/src/lib/components/TimeSeries/LocationDropdown/LocationDropdown.spec.d.ts +0 -1
- package/src/lib/components/TimeSeries/LocationDropdown/LocationDropdown.stories.d.ts +0 -11
- package/src/lib/components/TimeSeries/LocationDropdown/LocationDropdownHeader.d.ts +0 -7
- package/src/lib/components/TimeSeries/LocationDropdown/LocationDropdownHeader.spec.d.ts +0 -1
- package/src/lib/components/TimeSeries/LocationDropdown/LocationListItem.d.ts +0 -8
- package/src/lib/components/TimeSeries/LocationDropdown/LocationListItem.spec.d.ts +0 -1
- package/src/lib/components/TimeSeries/LocationDropdown/OverflowTooltip.d.ts +0 -9
- package/src/lib/components/TimeSeries/LocationDropdown/testData.d.ts +0 -2
- package/src/lib/components/TimeSeries/LocationInfo/LocationInfo.d.ts +0 -30
- package/src/lib/components/TimeSeries/LocationInfo/LocationInfo.spec.d.ts +0 -1
- package/src/lib/components/TimeSeries/LocationInfo/LocationInfo.stories.d.ts +0 -10
- package/src/lib/components/TimeSeries/LocationInfo/LocationInfoButtonConnect.d.ts +0 -7
- package/src/lib/components/TimeSeries/LocationInfo/LocationInfoConnect.d.ts +0 -2
- package/src/lib/components/TimeSeries/LocationSelect/LocationSelectButtonConnect.d.ts +0 -6
- package/src/lib/components/TimeSeries/LocationSelect/LocationSelectDialogConnect.d.ts +0 -2
- package/src/lib/components/TimeSeries/LocationSelect/index.d.ts +0 -1
- package/src/lib/components/TimeSeries/TimeSeriesChart.d.ts +0 -31
- package/src/lib/components/TimeSeries/TimeSeriesChart.spec.d.ts +0 -1
- package/src/lib/components/TimeSeries/TimeSeriesChart.stories.d.ts +0 -12
- package/src/lib/components/TimeSeries/TimeSeriesConnect.d.ts +0 -9
- package/src/lib/components/TimeSeries/TimeSeriesConnect.integration.spec.d.ts +0 -1
- package/src/lib/components/TimeSeries/TimeSeriesConnect.spec.d.ts +0 -1
- package/src/lib/components/TimeSeries/TimeSeriesConnect.stories.d.ts +0 -11
- package/src/lib/components/TimeSeries/TimeSeriesConnectWrapper.d.ts +0 -9
- package/src/lib/components/TimeSeries/TimeSeriesConnectWrapper.spec.d.ts +0 -1
- package/src/lib/components/TimeSeries/TimeSeriesMarkersSwitch.d.ts +0 -6
- package/src/lib/components/TimeSeries/TimeSeriesMarkersSwitch.spec.d.ts +0 -1
- package/src/lib/components/TimeSeries/TimeSeriesTopRowButton.d.ts +0 -9
- package/src/lib/components/TimeSeries/TimeSeriesTopRowButton.spec.d.ts +0 -1
- package/src/lib/components/TimeSeries/TimeSeriesTopRowButton.stories.d.ts +0 -8
- package/src/lib/components/TimeSeries/TimeSeriesView.d.ts +0 -16
- package/src/lib/components/TimeSeries/TimeSeriesView.spec.d.ts +0 -1
- package/src/lib/components/TimeSeries/TimeSeriesView.stories.d.ts +0 -9
- package/src/lib/components/TimeSeries/chartUtils.d.ts +0 -43
- package/src/lib/components/TimeSeries/chartUtils.spec.d.ts +0 -1
- package/src/lib/components/TimeSeries/types.d.ts +0 -244
- package/src/lib/components/TimeSeries/utils.d.ts +0 -21
- package/src/lib/components/TimeSeries/utils.spec.d.ts +0 -1
- package/src/lib/components/TimeSeriesAddPlot/TimeSeriesAddPlot.d.ts +0 -10
- package/src/lib/components/TimeSeriesManager/ParameterInfo/ParameterInfoButton.d.ts +0 -8
- package/src/lib/components/TimeSeriesManager/ParameterInfo/ParameterInfoButtonConnect.d.ts +0 -8
- package/src/lib/components/TimeSeriesManager/ParameterInfo/ParameterInfoDialog.d.ts +0 -43
- package/src/lib/components/TimeSeriesManager/ParameterInfo/ParameterInfoDialog.spec.d.ts +0 -1
- package/src/lib/components/TimeSeriesManager/ParameterInfo/ParameterInfoDialog.stories.d.ts +0 -15
- package/src/lib/components/TimeSeriesManager/ParameterInfo/ParameterInfoDialogConnect.d.ts +0 -2
- package/src/lib/components/TimeSeriesManager/ParameterList.d.ts +0 -15
- package/src/lib/components/TimeSeriesManager/ParameterList.spec.d.ts +0 -1
- package/src/lib/components/TimeSeriesManager/PlotRows.d.ts +0 -21
- package/src/lib/components/TimeSeriesManager/RowLayout.d.ts +0 -10
- package/src/lib/components/TimeSeriesManager/TimeSeriesManager.d.ts +0 -40
- package/src/lib/components/TimeSeriesManager/TimeSeriesManager.integration.spec.d.ts +0 -1
- package/src/lib/components/TimeSeriesManager/TimeSeriesManager.spec.d.ts +0 -1
- package/src/lib/components/TimeSeriesManager/TimeSeriesManager.stories.d.ts +0 -12
- package/src/lib/components/TimeSeriesManager/TimeSeriesManagerConnect.d.ts +0 -9
- package/src/lib/components/TimeSeriesManager/TimeSeriesManagerConnect.spec.d.ts +0 -1
- package/src/lib/components/TimeSeriesManager/TimeSeriesManagerMapButtonConnect.d.ts +0 -7
- package/src/lib/components/TimeSeriesManager/TimeSeriesManagerMapButtonConnect.spec.d.ts +0 -1
- package/src/lib/components/TimeSeriesManager/TimeSeriesManagerParameterComponents/ParameterColorSelect.d.ts +0 -11
- package/src/lib/components/TimeSeriesManager/TimeSeriesManagerParameterComponents/ParameterColorSelect.spec.d.ts +0 -1
- package/src/lib/components/TimeSeriesManager/TimeSeriesManagerParameterComponents/ParameterDimensionIdSelect.d.ts +0 -12
- package/src/lib/components/TimeSeriesManager/TimeSeriesManagerParameterComponents/ParameterDimensionIdSelect.spec.d.ts +0 -1
- package/src/lib/components/TimeSeriesManager/TimeSeriesManagerParameterComponents/ParameterDimensionSelect.d.ts +0 -10
- package/src/lib/components/TimeSeriesManager/TimeSeriesManagerParameterComponents/ParameterDimensionValueSelect.d.ts +0 -11
- package/src/lib/components/TimeSeriesManager/TimeSeriesManagerParameterComponents/ParameterDimensionValueSelect.spec.d.ts +0 -1
- package/src/lib/components/TimeSeriesManager/TimeSeriesManagerParameterComponents/ParameterNameSelect.d.ts +0 -10
- package/src/lib/components/TimeSeriesManager/TimeSeriesManagerParameterComponents/ParameterOpacitySelect.d.ts +0 -10
- package/src/lib/components/TimeSeriesManager/TimeSeriesManagerParameterComponents/ParameterOpacitySelect.spec.d.ts +0 -1
- package/src/lib/components/TimeSeriesManager/TimeSeriesManagerParameterComponents/ParameterReferenceTimeSelect.d.ts +0 -10
- package/src/lib/components/TimeSeriesManager/TimeSeriesManagerParameterComponents/ParameterReferenceTimeSelect.spec.d.ts +0 -1
- package/src/lib/components/TimeSeriesManager/TimeSeriesManagerParameterComponents/ParameterTypeSelect.d.ts +0 -10
- package/src/lib/components/TimeSeriesManager/TimeSeriesManagerParameterComponents/ParameterTypeSelect.spec.d.ts +0 -1
- package/src/lib/components/TimeSeriesManager/TimeSeriesManagerRowAccordion.d.ts +0 -16
- package/src/lib/components/TimeSeriesManager/TimeSeriesManagerRowAccordion.spec.d.ts +0 -1
- package/src/lib/components/TimeSeriesManager/index.d.ts +0 -1
- package/src/lib/components/TimeSeriesSelect/ServiceChips/ServiceChip.d.ts +0 -11
- package/src/lib/components/TimeSeriesSelect/ServiceChips/ServiceChip.spec.d.ts +0 -1
- package/src/lib/components/TimeSeriesSelect/ServiceChips/ServiceChipConnect.d.ts +0 -12
- package/src/lib/components/TimeSeriesSelect/ServiceOptionsConnect.d.ts +0 -6
- package/src/lib/components/TimeSeriesSelect/ServiceOptionsConnect.spec.d.ts +0 -1
- package/src/lib/components/TimeSeriesSelect/ServiceOptionsDialog.d.ts +0 -13
- package/src/lib/components/TimeSeriesSelect/ServiceOptionsDialog.spec.d.ts +0 -1
- package/src/lib/components/TimeSeriesSelect/ServiceOptionsDialog.stories.d.ts +0 -8
- package/src/lib/components/TimeSeriesSelect/ServicePopup/ServicePopup.d.ts +0 -18
- package/src/lib/components/TimeSeriesSelect/ServicePopup/ServicePopup.spec.d.ts +0 -1
- package/src/lib/components/TimeSeriesSelect/ServicePopup/ServicePopup.stories.d.ts +0 -11
- package/src/lib/components/TimeSeriesSelect/ServicePopup/ServicePopupConnect.d.ts +0 -6
- package/src/lib/components/TimeSeriesSelect/ServicePopup/ServicePopupConnect.spec.d.ts +0 -1
- package/src/lib/components/TimeSeriesSelect/ServicePopup/ServicePopupConnect.stories.d.ts +0 -7
- package/src/lib/components/TimeSeriesSelect/ServicePopup/ServicePopupDialogConnect.d.ts +0 -12
- package/src/lib/components/TimeSeriesSelect/ServicePopup/utils.d.ts +0 -4
- package/src/lib/components/TimeSeriesSelect/ServicePopup/utils.spec.d.ts +0 -1
- package/src/lib/components/TimeSeriesSelect/TimeSeriesSearchConnect.d.ts +0 -6
- package/src/lib/components/TimeSeriesSelect/TimeSeriesSearchConnect.spec.d.ts +0 -1
- package/src/lib/components/TimeSeriesSelect/TimeSeriesSelect.d.ts +0 -15
- package/src/lib/components/TimeSeriesSelect/TimeSeriesSelect.spec.d.ts +0 -1
- package/src/lib/components/TimeSeriesSelect/TimeSeriesSelect.stories.d.ts +0 -9
- package/src/lib/components/TimeSeriesSelect/TimeSeriesSelectButtonConnect.d.ts +0 -11
- package/src/lib/components/TimeSeriesSelect/TimeSeriesSelectButtonConnect.spec.d.ts +0 -1
- package/src/lib/components/TimeSeriesSelect/TimeSeriesSelectConnect.d.ts +0 -7
- package/src/lib/components/TimeSeriesSelect/TimeSeriesSelectConnect.spec.d.ts +0 -1
- package/src/lib/components/TimeSeriesSelect/TimeSeriesSelectList.d.ts +0 -19
- package/src/lib/components/TimeSeriesSelect/TimeSeriesSelectListConnect.d.ts +0 -12
- package/src/lib/components/TimeSeriesSelect/TimeSeriesSelectListConnect.spec.d.ts +0 -1
- package/src/lib/components/TimeSeriesSelect/TimeSeriesServiceList.d.ts +0 -9
- package/src/lib/components/TimeSeriesSelect/TimeSeriesServiceListConnect.d.ts +0 -8
- package/src/lib/components/TimeSeriesSelect/utils.d.ts +0 -16
- package/src/lib/constants.d.ts +0 -66
- package/src/lib/index.d.ts +0 -10
- package/src/lib/store/index.d.ts +0 -4
- package/src/lib/store/listeners.d.ts +0 -2
- package/src/lib/store/reducer.d.ts +0 -54
- package/src/lib/store/reducer.spec.d.ts +0 -1
- package/src/lib/store/selectors.d.ts +0 -433
- package/src/lib/store/selectors.spec.d.ts +0 -1
- package/src/lib/store/store.d.ts +0 -15
- package/src/lib/store/types.d.ts +0 -151
- package/src/lib/storybookUtils/SimpleLinkMenu.d.ts +0 -6
- package/src/lib/storybookUtils/ToggleThemeButton.d.ts +0 -2
- package/src/lib/storybookUtils/chartSeriesExampleData.d.ts +0 -4
- package/src/lib/storybookUtils/defaultStorySettings.d.ts +0 -18
- package/src/lib/utils/edrUtils.d.ts +0 -62
- package/src/lib/utils/edrUtils.spec.d.ts +0 -2
- package/src/lib/utils/fakeData/mockDimensions.d.ts +0 -2
- package/src/lib/utils/fakeData/mockGeoJSON.d.ts +0 -2
- package/src/lib/utils/fakeData/mockTimeSeriesServices.d.ts +0 -2
- package/src/lib/utils/i18n.d.ts +0 -6
- package/src/lib/utils/localStorage.d.ts +0 -3
- package/src/lib/utils/localStorage.spec.d.ts +0 -1
- package/src/lib/utils/mocks/handlers.d.ts +0 -189
- package/src/lib/utils/mocks/index.d.ts +0 -2
- package/src/lib/utils/mocks/server.d.ts +0 -1
- package/src/lib/utils/timeseries-api/api.d.ts +0 -41
- package/src/lib/utils/timeseries-api/fakeApi.d.ts +0 -1
- package/src/lib/utils/timeseries-api/hooks.d.ts +0 -69
- package/src/lib/utils/timeseries-api/hooks.spec.d.ts +0 -1
- package/src/lib/utils/utils.d.ts +0 -3
package/index.esm.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import React, { useCallback, useState, useMemo, useEffect, memo } from 'react';
|
|
1
|
+
import React, { useCallback, useMemo, useState, useEffect, memo } from 'react';
|
|
3
2
|
import { useDispatch, useSelector } from 'react-redux';
|
|
4
3
|
import { CustomIconButton, dateUtils, TooltipSelect, CustomAccordion, CustomTooltip, CustomToggleButton, ToolContainerDraggable, ToggleMenu, CustomDialog, SearchField, SearchHighlight, AlertBanner, useConfirmationDialog, SwitchButton, useResizeObserver } from '@opengeoweb/shared';
|
|
5
4
|
import { snackbarActions, snackbarTypes, snackbarListener, snackbarReducer } from '@opengeoweb/snackbar';
|
|
@@ -11,13 +10,14 @@ import { Info, ArrowDropDownDown, Copy, Delete, Visibility, VisibilityOff, TimeS
|
|
|
11
10
|
import i18n from 'i18next';
|
|
12
11
|
import { useTranslation } from 'react-i18next';
|
|
13
12
|
import '@opengeoweb/core';
|
|
13
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
14
14
|
import { createEntityAdapter, createSlice, createAction, createSelector, createListenerMiddleware, isAnyOf, combineReducers, configureStore } from '@reduxjs/toolkit';
|
|
15
15
|
import { produce } from 'immer';
|
|
16
16
|
import { v4 } from 'uuid';
|
|
17
17
|
import { center } from '@turf/turf';
|
|
18
18
|
import { MapFeatureClass } from '@opengeoweb/webmap-react';
|
|
19
19
|
import { useQueries, useQueryClient, useQuery, queryOptions } from '@tanstack/react-query';
|
|
20
|
-
import { handleResponse } from '@opengeoweb/api';
|
|
20
|
+
import { withJsonFormat, handleResponse } from '@opengeoweb/api';
|
|
21
21
|
import Box$1 from '@mui/material/Box';
|
|
22
22
|
import { useFormContext } from 'react-hook-form';
|
|
23
23
|
import { ReactHookFormProvider, defaultFormOptions, ReactHookFormTextField, ReactHookFormSelect } from '@opengeoweb/form-fields';
|
|
@@ -138,8 +138,10 @@ var en = {
|
|
|
138
138
|
"timeseries-legend": "Legend",
|
|
139
139
|
"timeseries-legend-tooltip-show": "Show legend",
|
|
140
140
|
"timeseries-legend-tooltip-hide": "Hide legend",
|
|
141
|
-
"error-
|
|
141
|
+
"error-message-general": "This parameter could not be loaded.",
|
|
142
|
+
"error-message-general-plural": "These parameters could not be loaded.",
|
|
142
143
|
"error-message-missing-collection-or-service": "No collection and/or service found for parameter.",
|
|
144
|
+
"all-plots": "All plots",
|
|
143
145
|
"timeseries-add-plot": "Add plot"
|
|
144
146
|
};
|
|
145
147
|
var fi = {
|
|
@@ -250,8 +252,10 @@ var fi = {
|
|
|
250
252
|
"timeseries-legend": "Selite",
|
|
251
253
|
"timeseries-legend-tooltip-show": "Näytä selite",
|
|
252
254
|
"timeseries-legend-tooltip-hide": "Piilota selite",
|
|
253
|
-
"error-
|
|
255
|
+
"error-message-general": "Tätä parametria ei voitu ladata.",
|
|
256
|
+
"error-message-general-plural": "Näitä parametreja ei voitu ladata.",
|
|
254
257
|
"error-message-missing-collection-or-service": "Parametrille ei löytynyt kokoelmaa ja/tai palvelua",
|
|
258
|
+
"all-plots": "Kaikki kaaviot",
|
|
255
259
|
"timeseries-add-plot": "Lisää kaavio"
|
|
256
260
|
};
|
|
257
261
|
var no = {
|
|
@@ -362,8 +366,10 @@ var no = {
|
|
|
362
366
|
"timeseries-legend": "Forklaring",
|
|
363
367
|
"timeseries-legend-tooltip-show": "Vis forklaring",
|
|
364
368
|
"timeseries-legend-tooltip-hide": "Skjul forklaring",
|
|
365
|
-
"error-
|
|
369
|
+
"error-message-general": "Denne parameteren kunne ikke lastes.",
|
|
370
|
+
"error-message-general-plural": "Disse parametrene kunne ikke lastes.",
|
|
366
371
|
"error-message-missing-collection-or-service": "Ingen kolleksjon og/eller tjeneste funnet for parameter.",
|
|
372
|
+
"all-plots": "Alle diagrammer",
|
|
367
373
|
"timeseries-add-plot": "Legg til plott"
|
|
368
374
|
};
|
|
369
375
|
var nl = {
|
|
@@ -479,8 +485,10 @@ var nl = {
|
|
|
479
485
|
"timeseries-legend": "Legenda",
|
|
480
486
|
"timeseries-legend-tooltip-show": "Toon legenda",
|
|
481
487
|
"timeseries-legend-tooltip-hide": "Verberg legenda",
|
|
482
|
-
"error-
|
|
488
|
+
"error-message-general": "Deze parameter kon niet worden geladen.",
|
|
489
|
+
"error-message-general-plural": "Deze parameters konden niet worden geladen.",
|
|
483
490
|
"error-message-missing-collection-or-service": "Geen collectie en/of service gevonden voor parameter.",
|
|
491
|
+
"all-plots": "Alle grafieken",
|
|
484
492
|
"timeseries-add-plot": "Grafiek toevoegen"
|
|
485
493
|
};
|
|
486
494
|
var timeseriesTranslations = {
|
|
@@ -507,23 +515,42 @@ var timeseriesTranslations = {
|
|
|
507
515
|
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
508
516
|
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
509
517
|
* */
|
|
518
|
+
|
|
510
519
|
var TIME_SERIES_NAMESPACE = 'timeseries';
|
|
511
520
|
var useTimeseriesTranslation = function useTimeseriesTranslation() {
|
|
512
521
|
return useTranslation(TIME_SERIES_NAMESPACE);
|
|
513
522
|
};
|
|
514
523
|
|
|
524
|
+
/* *
|
|
525
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
526
|
+
* you may not use this file except in compliance with the License.
|
|
527
|
+
* You may obtain a copy of the License at
|
|
528
|
+
*
|
|
529
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
530
|
+
*
|
|
531
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
532
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
533
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
534
|
+
* See the License for the specific language governing permissions and
|
|
535
|
+
* limitations under the License.
|
|
536
|
+
*
|
|
537
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
538
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
539
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
540
|
+
* */
|
|
541
|
+
|
|
515
542
|
var ParameterInfoButton = function ParameterInfoButton(_ref) {
|
|
516
543
|
var isOpenInStore = _ref.isOpenInStore,
|
|
517
544
|
isActive = _ref.isActive,
|
|
518
545
|
onClick = _ref.onClick;
|
|
519
546
|
var _useTimeseriesTransla = useTimeseriesTranslation(),
|
|
520
547
|
t = _useTimeseriesTransla.t;
|
|
521
|
-
return jsx(CustomIconButton, {
|
|
548
|
+
return /*#__PURE__*/jsx(CustomIconButton, {
|
|
522
549
|
"aria-label": t('timeseries-parameter-info'),
|
|
523
550
|
isSelected: !!isActive && isOpenInStore,
|
|
524
551
|
onClick: onClick,
|
|
525
552
|
variant: "flat",
|
|
526
|
-
children: jsx(Info, {})
|
|
553
|
+
children: /*#__PURE__*/jsx(Info, {})
|
|
527
554
|
});
|
|
528
555
|
};
|
|
529
556
|
|
|
@@ -854,6 +881,7 @@ function _regeneratorRuntime() {
|
|
|
854
881
|
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
855
882
|
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
856
883
|
* */
|
|
884
|
+
|
|
857
885
|
var COLOR_MAP = {
|
|
858
886
|
air_pressure_at_sea_level: 'W',
|
|
859
887
|
air_temperature_2m: 'A',
|
|
@@ -1023,7 +1051,7 @@ var getUnit = function getUnit(param, lang, fallbackLang) {
|
|
|
1023
1051
|
};
|
|
1024
1052
|
var constructParameterObject = function constructParameterObject(serviceId, collectionId, parametersById) {
|
|
1025
1053
|
return Object.keys(parametersById).map(function (parameterId) {
|
|
1026
|
-
var _parameter$unit$label, _parameter$unit, _COLOR_MAP
|
|
1054
|
+
var _parameter$unit$label, _parameter$unit, _COLOR_MAP;
|
|
1027
1055
|
var parameter = parametersById[parameterId];
|
|
1028
1056
|
return Object.assign({
|
|
1029
1057
|
plotType: 'line',
|
|
@@ -1034,7 +1062,7 @@ var constructParameterObject = function constructParameterObject(serviceId, coll
|
|
|
1034
1062
|
unit: (_parameter$unit$label = (_parameter$unit = parameter.unit) == null ? void 0 : _parameter$unit.label) != null ? _parameter$unit$label : ' ',
|
|
1035
1063
|
serviceId: serviceId,
|
|
1036
1064
|
collectionId: collectionId,
|
|
1037
|
-
color: (_COLOR_MAP
|
|
1065
|
+
color: (_COLOR_MAP = COLOR_MAP[parameter.id]) != null ? _COLOR_MAP : 'A',
|
|
1038
1066
|
opacity: 70
|
|
1039
1067
|
});
|
|
1040
1068
|
});
|
|
@@ -1062,6 +1090,7 @@ var getServiceCollectionDetails = function getServiceCollectionDetails(service,
|
|
|
1062
1090
|
// If no collections are provided, return an empty array
|
|
1063
1091
|
return collectionsParameters;
|
|
1064
1092
|
}
|
|
1093
|
+
|
|
1065
1094
|
// Only use parameters from collections that support /locations or /position
|
|
1066
1095
|
for (var _iterator = _createForOfIteratorHelperLoose(collections), _step; !(_step = _iterator()).done;) {
|
|
1067
1096
|
var _collection$data_quer2, _collection$data_quer3;
|
|
@@ -1109,6 +1138,7 @@ date) {
|
|
|
1109
1138
|
var endDate = ((_dateUtils$isoStringT2 = dateUtils.isoStringToDate(String(endTimeFromEdr), false)) != null ? _dateUtils$isoStringT2 : dateUtils.getNowUtc()).getTime();
|
|
1110
1139
|
var clippedStartDate = new Date(Math.max(startDate != null ? startDate : date, date - maxHoursBefore * HOUR_IN_MILLISECONDS));
|
|
1111
1140
|
var clippedEndDate = new Date(Math.min(endDate != null ? endDate : date, date + maxHoursAfter * HOUR_IN_MILLISECONDS));
|
|
1141
|
+
|
|
1112
1142
|
// Round the dates to minutes to make caching more likely.
|
|
1113
1143
|
clippedStartDate.setMilliseconds(0);
|
|
1114
1144
|
clippedStartDate.setSeconds(0);
|
|
@@ -1118,11 +1148,13 @@ date) {
|
|
|
1118
1148
|
var end = dateUtils.dateToString(clippedEndDate);
|
|
1119
1149
|
return [start, end];
|
|
1120
1150
|
};
|
|
1151
|
+
|
|
1121
1152
|
// 1 day to past, 10 days to future
|
|
1122
1153
|
var clipInterval = [1 * 24, 10 * 24];
|
|
1123
1154
|
var constructTimeInterval = function constructTimeInterval(collection, instance, syncgroupTimeState) {
|
|
1124
1155
|
var _instance$extent$temp, _instance$extent2, _collection$extent4;
|
|
1125
1156
|
var interval = (_instance$extent$temp = (_instance$extent2 = instance.extent) == null || (_instance$extent2 = _instance$extent2.temporal) == null ? void 0 : _instance$extent2.interval[0]) != null ? _instance$extent$temp : collection == null || (_collection$extent4 = collection.extent) == null || (_collection$extent4 = _collection$extent4.temporal) == null ? void 0 : _collection$extent4.interval[0];
|
|
1157
|
+
|
|
1126
1158
|
// If syncgroupTimeState is set, use this instead of the fixed timerange.
|
|
1127
1159
|
if ((syncgroupTimeState == null ? void 0 : syncgroupTimeState.start) !== undefined && (syncgroupTimeState == null ? void 0 : syncgroupTimeState.end) !== undefined) {
|
|
1128
1160
|
var timeRangeStartIso = dateUtils.dateToString(dateUtils.fromUnix(syncgroupTimeState.start));
|
|
@@ -1593,8 +1625,9 @@ var normalizeTimeSeriesState = function normalizeTimeSeriesState(state) {
|
|
|
1593
1625
|
return state;
|
|
1594
1626
|
}
|
|
1595
1627
|
var legacyServices = state.services || [];
|
|
1596
|
-
state
|
|
1597
|
-
|
|
1628
|
+
var _ref = state;
|
|
1629
|
+
_ref.services;
|
|
1630
|
+
var panelState = _objectWithoutPropertiesLoose(_ref, _excluded$3);
|
|
1598
1631
|
return Object.assign({}, initialState, {
|
|
1599
1632
|
services: legacyServices,
|
|
1600
1633
|
byId: Object.assign({}, initialState.byId, {
|
|
@@ -1651,7 +1684,8 @@ var timeSeriesReducer = function timeSeriesReducer(state, action) {
|
|
|
1651
1684
|
var serviceActionTypes = new Set([timeSeriesActions.loadUserAddedTimeSeriesServices.type, timeSeriesActions.addServices.type, timeSeriesActions.upsertService.type, timeSeriesActions.removeService.type, timeSeriesActions.registerTimeSeriesPreset.type]);
|
|
1652
1685
|
var nextServices = normalizedState.services;
|
|
1653
1686
|
if (action.type === timeSeriesActions.loadUserAddedTimeSeriesServices.type) {
|
|
1654
|
-
var
|
|
1687
|
+
var _ref2 = action,
|
|
1688
|
+
payload = _ref2.payload;
|
|
1655
1689
|
var servicesPayload = Array.isArray(payload) ? payload : payload.timeSeriesServices;
|
|
1656
1690
|
var newServices = [];
|
|
1657
1691
|
servicesPayload.forEach(function (service) {
|
|
@@ -1694,7 +1728,8 @@ var timeSeriesReducer = function timeSeriesReducer(state, action) {
|
|
|
1694
1728
|
}
|
|
1695
1729
|
}
|
|
1696
1730
|
if (action.type === timeSeriesActions.upsertService.type) {
|
|
1697
|
-
var
|
|
1731
|
+
var _ref3 = action,
|
|
1732
|
+
_payload = _ref3.payload;
|
|
1698
1733
|
var newService = {
|
|
1699
1734
|
id: _payload.id || generateServiceId(),
|
|
1700
1735
|
description: _payload.description,
|
|
@@ -1753,9 +1788,9 @@ var timeSeriesReducer = function timeSeriesReducer(state, action) {
|
|
|
1753
1788
|
}
|
|
1754
1789
|
var nextById = {};
|
|
1755
1790
|
var didChange = false;
|
|
1756
|
-
Object.entries(byId).forEach(function (
|
|
1757
|
-
var id =
|
|
1758
|
-
panelState =
|
|
1791
|
+
Object.entries(byId).forEach(function (_ref4) {
|
|
1792
|
+
var id = _ref4[0],
|
|
1793
|
+
panelState = _ref4[1];
|
|
1759
1794
|
var nextPanelState = panelState;
|
|
1760
1795
|
nextPanelState = addServiceFilterChipsToPanel(nextPanelState, servicesForSync);
|
|
1761
1796
|
nextPanelState = removeServiceFilterChipsFromPanel(nextPanelState, removedIdsForSync);
|
|
@@ -1768,7 +1803,8 @@ var timeSeriesReducer = function timeSeriesReducer(state, action) {
|
|
|
1768
1803
|
};
|
|
1769
1804
|
if (action.type === timeSeriesActions.registerTimeSeriesPreset.type) {
|
|
1770
1805
|
var _normalizedState$byId, _payload2$services, _Object$assign;
|
|
1771
|
-
var
|
|
1806
|
+
var _ref5 = action,
|
|
1807
|
+
_payload2 = _ref5.payload;
|
|
1772
1808
|
if (!panelId) {
|
|
1773
1809
|
return Object.assign({}, normalizedState, {
|
|
1774
1810
|
services: nextServices,
|
|
@@ -1917,6 +1953,7 @@ var generateServiceId = function generateServiceId() {
|
|
|
1917
1953
|
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
1918
1954
|
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
1919
1955
|
* */
|
|
1956
|
+
|
|
1920
1957
|
var getPanelState = function getPanelState(state, panelId) {
|
|
1921
1958
|
var timeSeriesState = state.timeSeries;
|
|
1922
1959
|
if (!timeSeriesState) {
|
|
@@ -1984,6 +2021,7 @@ var getServices = createSelector([function (state, _panelId) {
|
|
|
1984
2021
|
}
|
|
1985
2022
|
return [];
|
|
1986
2023
|
}, selectorMemoizationOptions);
|
|
2024
|
+
|
|
1987
2025
|
/**
|
|
1988
2026
|
* Returns search filter string
|
|
1989
2027
|
*
|
|
@@ -1995,6 +2033,7 @@ var getSearchFilter = createSelector(getTimeSeriesState, function (store) {
|
|
|
1995
2033
|
var _store$timeseriesSele;
|
|
1996
2034
|
return (store == null || (_store$timeseriesSele = store.timeseriesSelect) == null || (_store$timeseriesSele = _store$timeseriesSele.filters) == null ? void 0 : _store$timeseriesSele.searchFilter) || '';
|
|
1997
2035
|
});
|
|
2036
|
+
|
|
1998
2037
|
/**
|
|
1999
2038
|
* Returns all currently used parameters
|
|
2000
2039
|
*
|
|
@@ -2006,6 +2045,7 @@ var getParametersInUse = createSelector(getTimeSeriesState, function (store) {
|
|
|
2006
2045
|
var _store$plotPreset;
|
|
2007
2046
|
return (store == null || (_store$plotPreset = store.plotPreset) == null ? void 0 : _store$plotPreset.parameters) || [];
|
|
2008
2047
|
});
|
|
2048
|
+
|
|
2009
2049
|
/**
|
|
2010
2050
|
* Returns active services array
|
|
2011
2051
|
*
|
|
@@ -2032,6 +2072,7 @@ var getServiceFilterChips = function getServiceFilterChips(store, panelId) {
|
|
|
2032
2072
|
var getServiceFilterChipsById = function getServiceFilterChipsById(store, id, panelId) {
|
|
2033
2073
|
return makeServiceFilterChipsSelectors(panelId).selectById(store, id);
|
|
2034
2074
|
};
|
|
2075
|
+
|
|
2035
2076
|
/**
|
|
2036
2077
|
* Returns whether all service filter chips are enabled
|
|
2037
2078
|
*
|
|
@@ -2054,6 +2095,7 @@ var getCurrentParameterInfoDisplayed = createSelector(getTimeSeriesState, functi
|
|
|
2054
2095
|
var _store$timeseriesSele3;
|
|
2055
2096
|
return typeof (store == null || (_store$timeseriesSele3 = store.timeseriesSelect) == null ? void 0 : _store$timeseriesSele3.currentParameterInfo) === 'string' ? store.timeseriesSelect.currentParameterInfo : '';
|
|
2056
2097
|
});
|
|
2098
|
+
|
|
2057
2099
|
/**
|
|
2058
2100
|
* Returns parameter for the parameterInfo window
|
|
2059
2101
|
*
|
|
@@ -2074,6 +2116,7 @@ var getParameterInfoParameter = createSelector(getTimeSeriesState, function (sto
|
|
|
2074
2116
|
}
|
|
2075
2117
|
return store == null || (_store$timeseriesSele5 = store.timeseriesSelect) == null ? void 0 : _store$timeseriesSele5.currentParameterInfo;
|
|
2076
2118
|
});
|
|
2119
|
+
|
|
2077
2120
|
/**
|
|
2078
2121
|
* Returns parameter by id
|
|
2079
2122
|
*
|
|
@@ -2105,7 +2148,10 @@ var getTimeSeriesPreset = createSelector(getPlotState, getServices, function (pl
|
|
|
2105
2148
|
}
|
|
2106
2149
|
var presetParameters = plotState.parameters.map(function (parameter) {
|
|
2107
2150
|
var presetParam = Object.assign({}, parameter);
|
|
2108
|
-
|
|
2151
|
+
var isRelativeReferenceTime = /^latest(?:-\d+)?$/.test(presetParam.instanceId || '');
|
|
2152
|
+
if (!isRelativeReferenceTime) {
|
|
2153
|
+
delete presetParam.instanceId;
|
|
2154
|
+
}
|
|
2109
2155
|
return presetParam;
|
|
2110
2156
|
});
|
|
2111
2157
|
var usedServicesIds = chain(presetParameters).keyBy(function (param) {
|
|
@@ -2219,17 +2265,36 @@ var selectors = /*#__PURE__*/Object.freeze({
|
|
|
2219
2265
|
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
2220
2266
|
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
2221
2267
|
* */
|
|
2222
|
-
|
|
2223
|
-
|
|
2268
|
+
|
|
2269
|
+
var TimeSeriesActionOrigin = /*#__PURE__*/function (TimeSeriesActionOrigin) {
|
|
2224
2270
|
TimeSeriesActionOrigin["timeSeriesManager"] = "timeSeriesManager";
|
|
2225
2271
|
TimeSeriesActionOrigin["timeSeriesSelect"] = "timeSeriesSelect";
|
|
2226
|
-
|
|
2272
|
+
return TimeSeriesActionOrigin;
|
|
2273
|
+
}({});
|
|
2227
2274
|
|
|
2228
2275
|
var types = /*#__PURE__*/Object.freeze({
|
|
2229
2276
|
__proto__: null,
|
|
2230
|
-
|
|
2277
|
+
TimeSeriesActionOrigin: TimeSeriesActionOrigin
|
|
2231
2278
|
});
|
|
2232
2279
|
|
|
2280
|
+
/* *
|
|
2281
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2282
|
+
* you may not use this file except in compliance with the License.
|
|
2283
|
+
* You may obtain a copy of the License at
|
|
2284
|
+
*
|
|
2285
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2286
|
+
*
|
|
2287
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2288
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2289
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2290
|
+
* See the License for the specific language governing permissions and
|
|
2291
|
+
* limitations under the License.
|
|
2292
|
+
*
|
|
2293
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
2294
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
2295
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
2296
|
+
* */
|
|
2297
|
+
|
|
2233
2298
|
var ParameterInfoButtonConnect = function ParameterInfoButtonConnect(_ref) {
|
|
2234
2299
|
var parameter = _ref.parameter,
|
|
2235
2300
|
panelId = _ref.panelId;
|
|
@@ -2273,13 +2338,31 @@ var ParameterInfoButtonConnect = function ParameterInfoButtonConnect(_ref) {
|
|
|
2273
2338
|
toggleInfoDialog();
|
|
2274
2339
|
}
|
|
2275
2340
|
}, [isActive, toggleInfoDialog, isOpenForPanel, setCurrentParameterInfoDisplayed]);
|
|
2276
|
-
return jsx(ParameterInfoButton, {
|
|
2341
|
+
return /*#__PURE__*/jsx(ParameterInfoButton, {
|
|
2277
2342
|
isActive: isActive,
|
|
2278
2343
|
isOpenInStore: isOpenForPanel,
|
|
2279
2344
|
onClick: onClick
|
|
2280
2345
|
});
|
|
2281
2346
|
};
|
|
2282
2347
|
|
|
2348
|
+
/* *
|
|
2349
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2350
|
+
* you may not use this file except in compliance with the License.
|
|
2351
|
+
* You may obtain a copy of the License at
|
|
2352
|
+
*
|
|
2353
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2354
|
+
*
|
|
2355
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2356
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2357
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2358
|
+
* See the License for the specific language governing permissions and
|
|
2359
|
+
* limitations under the License.
|
|
2360
|
+
*
|
|
2361
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
2362
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
2363
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
2364
|
+
* */
|
|
2365
|
+
|
|
2283
2366
|
function getTextColor(bgColor) {
|
|
2284
2367
|
if (!bgColor) {
|
|
2285
2368
|
return '#fff';
|
|
@@ -2296,7 +2379,7 @@ var ParameterColorSelect = function ParameterColorSelect(_ref) {
|
|
|
2296
2379
|
var theme = useTheme();
|
|
2297
2380
|
var parameterColor = (_ref2 = (_parameter$color = parameter.color) != null ? _parameter$color : COLOR_MAP[parameter.propertyName]) != null ? _ref2 : '#000';
|
|
2298
2381
|
var textColor = getTextColor(COLOR_NAME_TO_HEX_MAP[parameterColor]);
|
|
2299
|
-
return jsxs(TooltipSelect, {
|
|
2382
|
+
return /*#__PURE__*/jsxs(TooltipSelect, {
|
|
2300
2383
|
SelectDisplayProps: {
|
|
2301
2384
|
'aria-label': 'timeseriesManager-color'
|
|
2302
2385
|
},
|
|
@@ -2328,12 +2411,12 @@ var ParameterColorSelect = function ParameterColorSelect(_ref) {
|
|
|
2328
2411
|
},
|
|
2329
2412
|
tooltip: t('timeseries-choose-color'),
|
|
2330
2413
|
value: parameterColor,
|
|
2331
|
-
children: [jsx(MenuItem, {
|
|
2414
|
+
children: [/*#__PURE__*/jsx(MenuItem, {
|
|
2332
2415
|
disabled: true,
|
|
2333
2416
|
children: t('timeseries-color')
|
|
2334
2417
|
}), Object.keys(COLOR_NAME_TO_HEX_MAP).map(function (name) {
|
|
2335
2418
|
var textColor = getTextColor(COLOR_NAME_TO_HEX_MAP[name]);
|
|
2336
|
-
return jsx(MenuItem, {
|
|
2419
|
+
return /*#__PURE__*/jsx(MenuItem, {
|
|
2337
2420
|
sx: {
|
|
2338
2421
|
width: useEntireWidth ? '100%' : '100px',
|
|
2339
2422
|
'&.MuiMenuItem-root ': {
|
|
@@ -2360,7 +2443,7 @@ var ParameterColorSelect = function ParameterColorSelect(_ref) {
|
|
|
2360
2443
|
}
|
|
2361
2444
|
},
|
|
2362
2445
|
value: name,
|
|
2363
|
-
children: jsx("div", {
|
|
2446
|
+
children: /*#__PURE__*/jsx("div", {
|
|
2364
2447
|
style: {
|
|
2365
2448
|
paddingTop: '8px',
|
|
2366
2449
|
color: "" + textColor,
|
|
@@ -2373,6 +2456,24 @@ var ParameterColorSelect = function ParameterColorSelect(_ref) {
|
|
|
2373
2456
|
});
|
|
2374
2457
|
};
|
|
2375
2458
|
|
|
2459
|
+
/* *
|
|
2460
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2461
|
+
* you may not use this file except in compliance with the License.
|
|
2462
|
+
* You may obtain a copy of the License at
|
|
2463
|
+
*
|
|
2464
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2465
|
+
*
|
|
2466
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2467
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2468
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2469
|
+
* See the License for the specific language governing permissions and
|
|
2470
|
+
* limitations under the License.
|
|
2471
|
+
*
|
|
2472
|
+
* Copyright 2025 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
2473
|
+
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
2474
|
+
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
2475
|
+
* */
|
|
2476
|
+
|
|
2376
2477
|
var ParameterDimensionIdSelect = function ParameterDimensionIdSelect(_ref) {
|
|
2377
2478
|
var _parameter$dimension, _parameter$dimension2;
|
|
2378
2479
|
var rowIsEnabled = _ref.rowIsEnabled,
|
|
@@ -2386,7 +2487,7 @@ var ParameterDimensionIdSelect = function ParameterDimensionIdSelect(_ref) {
|
|
|
2386
2487
|
return null;
|
|
2387
2488
|
}
|
|
2388
2489
|
var defaultDimension = hasReferenceTime ? REFERENCE_TIME_ID : customDimensions[0].id;
|
|
2389
|
-
return jsxs(TooltipSelect, {
|
|
2490
|
+
return /*#__PURE__*/jsxs(TooltipSelect, {
|
|
2390
2491
|
SelectDisplayProps: {
|
|
2391
2492
|
'aria-label': 'timeseriesManager-dimensionId'
|
|
2392
2493
|
},
|
|
@@ -2403,18 +2504,19 @@ var ParameterDimensionIdSelect = function ParameterDimensionIdSelect(_ref) {
|
|
|
2403
2504
|
};
|
|
2404
2505
|
patchParameter(newParameter);
|
|
2405
2506
|
},
|
|
2406
|
-
tooltip: t('timeseries-dimension-id') + ": " + (((_parameter$dimension = parameter.dimension) == null ? void 0 : _parameter$dimension.id) || defaultDimension)
|
|
2507
|
+
tooltip: t('timeseries-dimension-id') + ": " + (((_parameter$dimension = parameter.dimension) == null ? void 0 : _parameter$dimension.id) || defaultDimension)
|
|
2407
2508
|
// If parameter has no selected dimension id, choose reference time if it is available, otherwise the first dimension
|
|
2509
|
+
,
|
|
2408
2510
|
value: ((_parameter$dimension2 = parameter.dimension) == null ? void 0 : _parameter$dimension2.id) || defaultDimension,
|
|
2409
|
-
children: [jsx(MenuItem, {
|
|
2511
|
+
children: [/*#__PURE__*/jsx(MenuItem, {
|
|
2410
2512
|
disabled: true,
|
|
2411
2513
|
children: t('timeseries-dimension-id')
|
|
2412
|
-
}), !!hasReferenceTime && jsx(MenuItem, {
|
|
2514
|
+
}), !!hasReferenceTime && /*#__PURE__*/jsx(MenuItem, {
|
|
2413
2515
|
"data-testid": "timeseries-dimension-id-reference-time",
|
|
2414
2516
|
value: REFERENCE_TIME_ID,
|
|
2415
2517
|
children: t('timeseries-reference-time')
|
|
2416
2518
|
}, "dimensionmenu-id-reference-time"), customDimensions == null ? void 0 : customDimensions.map(function (dimension) {
|
|
2417
|
-
return jsx(MenuItem, {
|
|
2519
|
+
return /*#__PURE__*/jsx(MenuItem, {
|
|
2418
2520
|
"data-testid": "timeseries-dimension-id-" + dimension.id,
|
|
2419
2521
|
value: dimension.id,
|
|
2420
2522
|
children: dimension.id
|
|
@@ -2423,6 +2525,24 @@ var ParameterDimensionIdSelect = function ParameterDimensionIdSelect(_ref) {
|
|
|
2423
2525
|
});
|
|
2424
2526
|
};
|
|
2425
2527
|
|
|
2528
|
+
/* *
|
|
2529
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2530
|
+
* you may not use this file except in compliance with the License.
|
|
2531
|
+
* You may obtain a copy of the License at
|
|
2532
|
+
*
|
|
2533
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2534
|
+
*
|
|
2535
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2536
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2537
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2538
|
+
* See the License for the specific language governing permissions and
|
|
2539
|
+
* limitations under the License.
|
|
2540
|
+
*
|
|
2541
|
+
* Copyright 2025 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
2542
|
+
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
2543
|
+
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
2544
|
+
* */
|
|
2545
|
+
|
|
2426
2546
|
var defaultValue = 'none';
|
|
2427
2547
|
var ParameterDimensionValueSelect = function ParameterDimensionValueSelect(_ref) {
|
|
2428
2548
|
var _parameter$dimension3, _parameter$dimension4, _parameter$dimension5, _parameter$dimension6, _parameter$dimension7, _parameter$dimension8, _parameter$dimension9, _selectedDimension$va;
|
|
@@ -2438,7 +2558,7 @@ var ParameterDimensionValueSelect = function ParameterDimensionValueSelect(_ref)
|
|
|
2438
2558
|
if (!selectedDimension || !customDimensions || customDimensions.length === 0) {
|
|
2439
2559
|
return null;
|
|
2440
2560
|
}
|
|
2441
|
-
return jsxs(TooltipSelect, {
|
|
2561
|
+
return /*#__PURE__*/jsxs(TooltipSelect, {
|
|
2442
2562
|
SelectDisplayProps: {
|
|
2443
2563
|
'aria-label': 'timeseriesManager-dimensionValue'
|
|
2444
2564
|
},
|
|
@@ -2457,15 +2577,15 @@ var ParameterDimensionValueSelect = function ParameterDimensionValueSelect(_ref)
|
|
|
2457
2577
|
},
|
|
2458
2578
|
tooltip: t('timeseries-dimension-value') + ": " + (((_parameter$dimension3 = parameter.dimension) == null ? void 0 : _parameter$dimension3.value) !== undefined ? (_parameter$dimension4 = parameter.dimension) == null ? void 0 : _parameter$dimension4.value : ''),
|
|
2459
2579
|
value: ((_parameter$dimension5 = parameter.dimension) == null ? void 0 : _parameter$dimension5.value) === undefined || ((_parameter$dimension6 = parameter.dimension) == null ? void 0 : _parameter$dimension6.value) === '' ? defaultValue : (_parameter$dimension7 = parameter.dimension) == null ? void 0 : _parameter$dimension7.value,
|
|
2460
|
-
children: [jsx(MenuItem, {
|
|
2580
|
+
children: [/*#__PURE__*/jsx(MenuItem, {
|
|
2461
2581
|
disabled: true,
|
|
2462
2582
|
children: t('timeseries-dimension-value')
|
|
2463
|
-
}), (((_parameter$dimension8 = parameter.dimension) == null ? void 0 : _parameter$dimension8.value) === undefined || ((_parameter$dimension9 = parameter.dimension) == null ? void 0 : _parameter$dimension9.value) === '') && jsx(MenuItem, {
|
|
2583
|
+
}), (((_parameter$dimension8 = parameter.dimension) == null ? void 0 : _parameter$dimension8.value) === undefined || ((_parameter$dimension9 = parameter.dimension) == null ? void 0 : _parameter$dimension9.value) === '') && /*#__PURE__*/jsx(MenuItem, {
|
|
2464
2584
|
"data-testid": "timeseries-dimension-value-none",
|
|
2465
2585
|
value: "none",
|
|
2466
2586
|
children: t('timeseries-dimension-none')
|
|
2467
2587
|
}, "dimensionvaluemenu-none"), selectedDimension == null || (_selectedDimension$va = selectedDimension.values) == null ? void 0 : _selectedDimension$va.map(function (value) {
|
|
2468
|
-
return jsx(MenuItem, {
|
|
2588
|
+
return /*#__PURE__*/jsx(MenuItem, {
|
|
2469
2589
|
"data-testid": "timeseries-dimension-value-" + value,
|
|
2470
2590
|
value: value,
|
|
2471
2591
|
children: value
|
|
@@ -2474,6 +2594,24 @@ var ParameterDimensionValueSelect = function ParameterDimensionValueSelect(_ref)
|
|
|
2474
2594
|
});
|
|
2475
2595
|
};
|
|
2476
2596
|
|
|
2597
|
+
/* *
|
|
2598
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2599
|
+
* you may not use this file except in compliance with the License.
|
|
2600
|
+
* You may obtain a copy of the License at
|
|
2601
|
+
*
|
|
2602
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2603
|
+
*
|
|
2604
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2605
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2606
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2607
|
+
* See the License for the specific language governing permissions and
|
|
2608
|
+
* limitations under the License.
|
|
2609
|
+
*
|
|
2610
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
2611
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
2612
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
2613
|
+
* */
|
|
2614
|
+
|
|
2477
2615
|
var ReferenceTimeSelect = function ReferenceTimeSelect(_ref) {
|
|
2478
2616
|
var rowIsEnabled = _ref.rowIsEnabled,
|
|
2479
2617
|
parameter = _ref.parameter,
|
|
@@ -2483,10 +2621,34 @@ var ReferenceTimeSelect = function ReferenceTimeSelect(_ref) {
|
|
|
2483
2621
|
var _React$useState = React.useState(undefined),
|
|
2484
2622
|
referenceTime = _React$useState[0],
|
|
2485
2623
|
setReferenceTime = _React$useState[1];
|
|
2624
|
+
var validRefTimes = React.useMemo(function () {
|
|
2625
|
+
return refTimeList.filter(function (option) {
|
|
2626
|
+
var date = dateUtils.parseCustomDateString(option.id);
|
|
2627
|
+
return dateUtils.isValid(date);
|
|
2628
|
+
}).sort(function (instance1, instance2) {
|
|
2629
|
+
var time1 = dateUtils.parseCustomDateString(instance1.id);
|
|
2630
|
+
var time2 = dateUtils.parseCustomDateString(instance2.id);
|
|
2631
|
+
return time2.getTime() - time1.getTime();
|
|
2632
|
+
}).slice(0, 5);
|
|
2633
|
+
}, [refTimeList]);
|
|
2486
2634
|
React.useEffect(function () {
|
|
2487
2635
|
var initializeReferenceTime = function initializeReferenceTime() {
|
|
2636
|
+
// Don't override if a "latest-" value is already selected
|
|
2637
|
+
if (referenceTime != null && referenceTime.startsWith('latest-')) {
|
|
2638
|
+
return;
|
|
2639
|
+
}
|
|
2488
2640
|
var referenceTimes = refTimeList.length > 0;
|
|
2489
2641
|
if (referenceTimes) {
|
|
2642
|
+
var _parameter$instanceId;
|
|
2643
|
+
var relativeReferenceTime = (_parameter$instanceId = parameter.instanceId) == null ? void 0 : _parameter$instanceId.match(/^latest(?:-(\d+))?$/);
|
|
2644
|
+
if (relativeReferenceTime) {
|
|
2645
|
+
var _relativeReferenceTim;
|
|
2646
|
+
var index = Number((_relativeReferenceTim = relativeReferenceTime[1]) != null ? _relativeReferenceTim : 0);
|
|
2647
|
+
if (Number.isInteger(index) && index >= 0 && index < validRefTimes.length) {
|
|
2648
|
+
setReferenceTime(parameter.instanceId === 'latest' ? 'latest-0' : parameter.instanceId);
|
|
2649
|
+
return;
|
|
2650
|
+
}
|
|
2651
|
+
}
|
|
2490
2652
|
var alreadyHasReferenceTime = parameter.instanceId && refTimeList.some(function (item) {
|
|
2491
2653
|
return item.id === parameter.instanceId;
|
|
2492
2654
|
});
|
|
@@ -2506,49 +2668,70 @@ var ReferenceTimeSelect = function ReferenceTimeSelect(_ref) {
|
|
|
2506
2668
|
}
|
|
2507
2669
|
};
|
|
2508
2670
|
initializeReferenceTime();
|
|
2671
|
+
|
|
2509
2672
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2510
|
-
}, [refTimeList, parameter.instanceId]);
|
|
2673
|
+
}, [refTimeList, parameter.instanceId, validRefTimes.length]);
|
|
2511
2674
|
var isFetching = refTimeList.length === 0;
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2675
|
+
var handleReferenceTimeChange = function handleReferenceTimeChange(event) {
|
|
2676
|
+
var target = event.target;
|
|
2677
|
+
if (target.value.startsWith('latest-')) {
|
|
2678
|
+
var relativeReferenceTimeRegexp = /^latest-(\d+)$/;
|
|
2679
|
+
var relativeSelection = relativeReferenceTimeRegexp.exec(target.value);
|
|
2680
|
+
if (relativeSelection) {
|
|
2681
|
+
var newParameter = {
|
|
2682
|
+
id: parameter.id,
|
|
2683
|
+
instanceId: target.value
|
|
2684
|
+
};
|
|
2685
|
+
patchParameter(newParameter);
|
|
2686
|
+
setReferenceTime(target.value);
|
|
2687
|
+
}
|
|
2688
|
+
} else {
|
|
2525
2689
|
var selectedRefTime = refTimeList.find(function (ref) {
|
|
2526
2690
|
return ref.id === target.value;
|
|
2527
2691
|
});
|
|
2528
2692
|
if (selectedRefTime) {
|
|
2529
|
-
var
|
|
2693
|
+
var _newParameter = {
|
|
2530
2694
|
id: parameter.id,
|
|
2531
2695
|
instanceId: target.value
|
|
2532
2696
|
};
|
|
2533
|
-
patchParameter(
|
|
2697
|
+
patchParameter(_newParameter);
|
|
2534
2698
|
setReferenceTime(target.value);
|
|
2535
2699
|
} else {
|
|
2536
2700
|
console.warn("Unable to find reference time " + event.target.value);
|
|
2537
2701
|
}
|
|
2702
|
+
}
|
|
2703
|
+
};
|
|
2704
|
+
if (!referenceTime) {
|
|
2705
|
+
return null;
|
|
2706
|
+
}
|
|
2707
|
+
return refTimeList && refTimeList.length > 0 && !refTimeList.some(function (value) {
|
|
2708
|
+
return value.id === 'unvalidated';
|
|
2709
|
+
}) ? /*#__PURE__*/jsxs(TooltipSelect, {
|
|
2710
|
+
SelectDisplayProps: {
|
|
2711
|
+
'aria-label': 'timeseriesManager-refTime'
|
|
2538
2712
|
},
|
|
2713
|
+
"data-testid": "parameterReferenceTimeSelect",
|
|
2714
|
+
isEnabled: rowIsEnabled,
|
|
2715
|
+
onChange: handleReferenceTimeChange,
|
|
2539
2716
|
tooltip: t('timeseries-choose-ref-time'),
|
|
2540
2717
|
value: referenceTime,
|
|
2541
|
-
children: [!!isFetching && jsx(LinearProgress, {
|
|
2718
|
+
children: [!!isFetching && /*#__PURE__*/jsx(LinearProgress, {
|
|
2542
2719
|
color: "inherit",
|
|
2543
2720
|
"data-testid": "spinner"
|
|
2544
|
-
}), jsx(MenuItem, {
|
|
2721
|
+
}), /*#__PURE__*/jsx(MenuItem, {
|
|
2545
2722
|
disabled: true,
|
|
2546
2723
|
children: t('timeseries-reference-time')
|
|
2547
|
-
}), !!isFetching && jsx(MenuItem, {
|
|
2724
|
+
}), !!isFetching && /*#__PURE__*/jsx(MenuItem, {
|
|
2548
2725
|
value: referenceTime,
|
|
2549
2726
|
children: dateUtils.isValid(dateUtils.parseCustomDateString(referenceTime)) ? dateUtils.dateToString(dateUtils.parseCustomDateString(referenceTime), "yyyy-MM-dd'T'HH:mm:ss 'Z'") : referenceTime
|
|
2727
|
+
}), validRefTimes.map(function (value, index) {
|
|
2728
|
+
return /*#__PURE__*/jsx(MenuItem, {
|
|
2729
|
+
"data-testid": "timeseries-ref-time-latest-" + index,
|
|
2730
|
+
value: "latest-" + index,
|
|
2731
|
+
children: index > 0 ? "Latest -" + index : 'Latest'
|
|
2732
|
+
}, "latest-" + value.id);
|
|
2550
2733
|
}), refTimeList.map(function (value) {
|
|
2551
|
-
return jsx(MenuItem, {
|
|
2734
|
+
return /*#__PURE__*/jsx(MenuItem, {
|
|
2552
2735
|
"data-testid": "timeseries-ref-time-" + value.id,
|
|
2553
2736
|
value: value.id,
|
|
2554
2737
|
children: dateUtils.isValid(dateUtils.parseCustomDateString(value.id)) ? dateUtils.dateToString(dateUtils.parseCustomDateString(value.id), "yyyy-MM-dd'T'HH:mm:ss 'Z'") : value.id
|
|
@@ -2574,10 +2757,21 @@ var ReferenceTimeSelect = function ReferenceTimeSelect(_ref) {
|
|
|
2574
2757
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
2575
2758
|
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
2576
2759
|
* */
|
|
2760
|
+
|
|
2761
|
+
// properties provided by https://for.weather.fmibeta.com/sofp
|
|
2762
|
+
|
|
2763
|
+
// A copy of this type exists in libs/shared/src/lib/types/types.ts
|
|
2764
|
+
|
|
2765
|
+
// A copy of this type exists in libs/shared/src/lib/types/types.ts
|
|
2766
|
+
|
|
2767
|
+
// A copy of this type exists in libs/shared/src/lib/types/types.ts as PlotParameter
|
|
2768
|
+
|
|
2577
2769
|
var isTimeSeriesLocation = function isTimeSeriesLocation(obj) {
|
|
2578
2770
|
return 'id' in obj;
|
|
2579
2771
|
};
|
|
2580
2772
|
|
|
2773
|
+
// A copy of this type exists in libs/shared/src/lib/types/types.ts
|
|
2774
|
+
|
|
2581
2775
|
/* *
|
|
2582
2776
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2583
2777
|
* you may not use this file except in compliance with the License.
|
|
@@ -2595,6 +2789,12 @@ var isTimeSeriesLocation = function isTimeSeriesLocation(obj) {
|
|
|
2595
2789
|
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
2596
2790
|
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
2597
2791
|
* */
|
|
2792
|
+
|
|
2793
|
+
|
|
2794
|
+
/** Maps plot ID to array of error message strings */
|
|
2795
|
+
|
|
2796
|
+
/** Maps plot ID to array of failed parameter information */
|
|
2797
|
+
|
|
2598
2798
|
var createGeoJsonArrays = function createGeoJsonArrays(locations, services, hideFeatures, memoizedSelectedFeature) {
|
|
2599
2799
|
var initialAccumulator = {
|
|
2600
2800
|
obj: {},
|
|
@@ -2610,6 +2810,7 @@ var createGeoJsonArrays = function createGeoJsonArrays(locations, services, hide
|
|
|
2610
2810
|
if (!feature.geometry) {
|
|
2611
2811
|
return;
|
|
2612
2812
|
}
|
|
2813
|
+
|
|
2613
2814
|
// Geometrycollection does not have coordinates
|
|
2614
2815
|
// Single location should not be a geometry collection, exclude it here because otherwise type checking will fail
|
|
2615
2816
|
var key = JSON.stringify(feature.geometry.coordinates);
|
|
@@ -2707,13 +2908,15 @@ var getNearbyLocation = function getNearbyLocation(parameter, service, selectedL
|
|
|
2707
2908
|
}
|
|
2708
2909
|
return null;
|
|
2709
2910
|
};
|
|
2710
|
-
var getPlotsWithParameters = function getPlotsWithParameters(plots, parameters) {
|
|
2911
|
+
var getPlotsWithParameters = function getPlotsWithParameters(plots, parameters, plotErrors, failedParameters) {
|
|
2711
2912
|
var parametersByPlotId = groupBy(parameters, function (parameter) {
|
|
2712
2913
|
return parameter.plotId;
|
|
2713
2914
|
});
|
|
2714
2915
|
var plotsWithParameters = plots.map(function (plot) {
|
|
2715
2916
|
return Object.assign({}, plot, {
|
|
2716
|
-
parametersWithData: parametersByPlotId[plot.plotId]
|
|
2917
|
+
parametersWithData: parametersByPlotId[plot.plotId] || [],
|
|
2918
|
+
errors: plotErrors == null ? void 0 : plotErrors[plot.plotId],
|
|
2919
|
+
failedParameters: failedParameters == null ? void 0 : failedParameters[plot.plotId]
|
|
2717
2920
|
});
|
|
2718
2921
|
}).filter(function (plot) {
|
|
2719
2922
|
var _plot$parametersWithD;
|
|
@@ -2790,7 +2993,7 @@ var getLocations = /*#__PURE__*/function () {
|
|
|
2790
2993
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2791
2994
|
while (1) switch (_context.prev = _context.next) {
|
|
2792
2995
|
case 0:
|
|
2793
|
-
url = createUrl(serviceUrl, "/collections/" + collectionId + "/locations");
|
|
2996
|
+
url = withJsonFormat(createUrl(serviceUrl, "/collections/" + collectionId + "/locations"));
|
|
2794
2997
|
return _context.abrupt("return", fetch(url).then(handleResponse));
|
|
2795
2998
|
case 2:
|
|
2796
2999
|
case "end":
|
|
@@ -2808,7 +3011,7 @@ var getServiceInformation = /*#__PURE__*/function () {
|
|
|
2808
3011
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
2809
3012
|
while (1) switch (_context2.prev = _context2.next) {
|
|
2810
3013
|
case 0:
|
|
2811
|
-
url = createUrl(serviceUrl);
|
|
3014
|
+
url = withJsonFormat(createUrl(serviceUrl));
|
|
2812
3015
|
return _context2.abrupt("return", fetch(url).then(handleResponse));
|
|
2813
3016
|
case 2:
|
|
2814
3017
|
case "end":
|
|
@@ -2826,7 +3029,7 @@ var getCollections = /*#__PURE__*/function () {
|
|
|
2826
3029
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
2827
3030
|
while (1) switch (_context3.prev = _context3.next) {
|
|
2828
3031
|
case 0:
|
|
2829
|
-
url = createUrl(serviceUrl, '/collections');
|
|
3032
|
+
url = withJsonFormat(createUrl(serviceUrl, '/collections'));
|
|
2830
3033
|
return _context3.abrupt("return", fetch(url).then(handleResponse));
|
|
2831
3034
|
case 2:
|
|
2832
3035
|
case "end":
|
|
@@ -2844,7 +3047,7 @@ var getCollection = /*#__PURE__*/function () {
|
|
|
2844
3047
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
2845
3048
|
while (1) switch (_context4.prev = _context4.next) {
|
|
2846
3049
|
case 0:
|
|
2847
|
-
url = createUrl(serviceUrl, "/collections/" + collectionId);
|
|
3050
|
+
url = withJsonFormat(createUrl(serviceUrl, "/collections/" + collectionId));
|
|
2848
3051
|
return _context4.abrupt("return", fetch(url).then(handleResponse));
|
|
2849
3052
|
case 2:
|
|
2850
3053
|
case "end":
|
|
@@ -2862,7 +3065,7 @@ var getInstances = /*#__PURE__*/function () {
|
|
|
2862
3065
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
2863
3066
|
while (1) switch (_context5.prev = _context5.next) {
|
|
2864
3067
|
case 0:
|
|
2865
|
-
url = createUrl(serviceUrl, "/collections/" + collectionId + "/instances");
|
|
3068
|
+
url = withJsonFormat(createUrl(serviceUrl, "/collections/" + collectionId + "/instances"));
|
|
2866
3069
|
return _context5.abrupt("return", fetch(url).then(handleResponse));
|
|
2867
3070
|
case 2:
|
|
2868
3071
|
case "end":
|
|
@@ -2913,8 +3116,8 @@ var getPosition = /*#__PURE__*/function () {
|
|
|
2913
3116
|
return _ref7.apply(this, arguments);
|
|
2914
3117
|
};
|
|
2915
3118
|
}();
|
|
2916
|
-
var getErrorMessage = function getErrorMessage(
|
|
2917
|
-
return
|
|
3119
|
+
var getErrorMessage = function getErrorMessage() {
|
|
3120
|
+
return 'error-message-general';
|
|
2918
3121
|
};
|
|
2919
3122
|
var fetchEdrParameter = /*#__PURE__*/function () {
|
|
2920
3123
|
var _ref8 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(parameter, location, service, geojsonMap, intervalParam, collection, instance) {
|
|
@@ -2946,7 +3149,7 @@ var fetchEdrParameter = /*#__PURE__*/function () {
|
|
|
2946
3149
|
case 11:
|
|
2947
3150
|
_context8.prev = 11;
|
|
2948
3151
|
_context8.t0 = _context8["catch"](5);
|
|
2949
|
-
throw new Error(getErrorMessage(
|
|
3152
|
+
throw new Error(getErrorMessage());
|
|
2950
3153
|
case 14:
|
|
2951
3154
|
_context8.prev = 14;
|
|
2952
3155
|
if (!((_instance$data_querie2 = instance.data_queries) != null && _instance$data_querie2.position || (_collection$dataQueri2 = collection.dataQueries) != null && _collection$dataQueri2.position)) {
|
|
@@ -2980,11 +3183,11 @@ var fetchEdrParameter = /*#__PURE__*/function () {
|
|
|
2980
3183
|
case 31:
|
|
2981
3184
|
_context8.prev = 31;
|
|
2982
3185
|
_context8.t2 = _context8["catch"](25);
|
|
2983
|
-
throw new Error(getErrorMessage(
|
|
3186
|
+
throw new Error(getErrorMessage());
|
|
2984
3187
|
case 34:
|
|
2985
|
-
throw new Error(getErrorMessage(
|
|
3188
|
+
throw new Error(getErrorMessage());
|
|
2986
3189
|
case 35:
|
|
2987
|
-
throw new Error(getErrorMessage(
|
|
3190
|
+
throw new Error(getErrorMessage());
|
|
2988
3191
|
case 36:
|
|
2989
3192
|
case "end":
|
|
2990
3193
|
return _context8.stop();
|
|
@@ -2996,6 +3199,21 @@ var fetchEdrParameter = /*#__PURE__*/function () {
|
|
|
2996
3199
|
};
|
|
2997
3200
|
}();
|
|
2998
3201
|
|
|
3202
|
+
var getInstanceByRelativeReferenceTime = function getInstanceByRelativeReferenceTime(instances, relativeReferenceTime) {
|
|
3203
|
+
var relativeMatch = relativeReferenceTime == null ? void 0 : relativeReferenceTime.match(/^latest-(\d+)$/);
|
|
3204
|
+
if (!relativeMatch) {
|
|
3205
|
+
return null;
|
|
3206
|
+
}
|
|
3207
|
+
var index = Number(relativeMatch[1]);
|
|
3208
|
+
if (!Number.isInteger(index) || index < 0) {
|
|
3209
|
+
return null;
|
|
3210
|
+
}
|
|
3211
|
+
var sortedInstances = instances.toSorted(function (instanceA, instanceB) {
|
|
3212
|
+
return instanceB.id.localeCompare(instanceA.id);
|
|
3213
|
+
});
|
|
3214
|
+
return sortedInstances[index] || null;
|
|
3215
|
+
};
|
|
3216
|
+
|
|
2999
3217
|
// Ensures every timeseries query starts with the same query key
|
|
3000
3218
|
var generateTimeSeriesQueryKeys = function generateTimeSeriesQueryKeys(queryKeys) {
|
|
3001
3219
|
return ['time-series'].concat(queryKeys);
|
|
@@ -3255,13 +3473,11 @@ var useGetCollectionsAndInstanceDetails = function useGetCollectionsAndInstanceD
|
|
|
3255
3473
|
});
|
|
3256
3474
|
};
|
|
3257
3475
|
var useGetPlotsWithData = function useGetPlotsWithData(plotsWithoutData, selectedLocation, services, splitGeoJsonByCollection, t, syncgroupTimeState) {
|
|
3258
|
-
var _useState = useState([]),
|
|
3259
|
-
plotsWithData = _useState[0],
|
|
3260
|
-
setPlotsWithData = _useState[1];
|
|
3261
3476
|
// Create array of collections we need to query for the data
|
|
3262
3477
|
var collectionsList = useMemo(function () {
|
|
3263
3478
|
return extractUsedCollections(plotsWithoutData, services);
|
|
3264
3479
|
}, [plotsWithoutData, services]);
|
|
3480
|
+
|
|
3265
3481
|
// First fetch collection and any relevant instance data
|
|
3266
3482
|
var _useGetCollectionsAnd = useGetCollectionsAndInstanceDetails(collectionsList),
|
|
3267
3483
|
collectionDetails = _useGetCollectionsAnd.data,
|
|
@@ -3271,6 +3487,7 @@ var useGetPlotsWithData = function useGetPlotsWithData(plotsWithoutData, selecte
|
|
|
3271
3487
|
return [gjs.serviceName + "_" + gjs.collectionName, gjs];
|
|
3272
3488
|
}));
|
|
3273
3489
|
}, [splitGeoJsonByCollection]);
|
|
3490
|
+
|
|
3274
3491
|
// Construct all queries to be executed
|
|
3275
3492
|
var queries = useMemo(function () {
|
|
3276
3493
|
return plotsWithoutData.parameters.map(function (parameter) {
|
|
@@ -3280,16 +3497,17 @@ var useGetPlotsWithData = function useGetPlotsWithData(plotsWithoutData, selecte
|
|
|
3280
3497
|
var collection = collectionDetails == null ? void 0 : collectionDetails.find(function (collection) {
|
|
3281
3498
|
return collection.serviceId === parameter.serviceId && collection.collectionId === parameter.collectionId;
|
|
3282
3499
|
});
|
|
3283
|
-
var instanceInfo = parameter.instanceId && (collection == null || (_collection$allInstan = collection.allInstances) == null ? void 0 : _collection$allInstan.find(function (inst) {
|
|
3500
|
+
var instanceInfo = getInstanceByRelativeReferenceTime((collection == null ? void 0 : collection.allInstances) || [], parameter.instanceId) || parameter.instanceId && (collection == null || (_collection$allInstan = collection.allInstances) == null ? void 0 : _collection$allInstan.find(function (inst) {
|
|
3284
3501
|
return inst.id === parameter.instanceId;
|
|
3285
3502
|
})) || latestInstance((collection == null ? void 0 : collection.allInstances) || []) || {
|
|
3286
3503
|
id: ''
|
|
3287
3504
|
};
|
|
3505
|
+
|
|
3288
3506
|
// Construct timeinterval that needs to be fetched
|
|
3289
3507
|
// Create here so if new data is advertised by the collection/instance a new request is made
|
|
3290
3508
|
var intervalParam = constructTimeInterval(collection, instanceInfo, syncgroupTimeState);
|
|
3291
3509
|
return {
|
|
3292
|
-
queryKey: generateTimeSeriesQueryKeys(['get-parameter-data', parameter.propertyName, parameter.serviceId, parameter.collectionId, parameter.instanceId || 'undefined', ((_parameter$dimension = parameter.dimension) == null ? void 0 : _parameter$dimension.value) || 'undefined', intervalParam, selectedLocation.lat.toString() || 'undefined', selectedLocation.lon.toString() || 'undefined']),
|
|
3510
|
+
queryKey: generateTimeSeriesQueryKeys(['get-parameter-data', parameter.plotId, parameter.propertyName, parameter.serviceId, parameter.collectionId, parameter.instanceId || 'undefined', ((_parameter$dimension = parameter.dimension) == null ? void 0 : _parameter$dimension.value) || 'undefined', intervalParam, selectedLocation.lat.toString() || 'undefined', selectedLocation.lon.toString() || 'undefined']),
|
|
3293
3511
|
queryFn: function () {
|
|
3294
3512
|
var _queryFn7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
|
|
3295
3513
|
var edrResponse;
|
|
@@ -3338,9 +3556,16 @@ var useGetPlotsWithData = function useGetPlotsWithData(plotsWithoutData, selecte
|
|
|
3338
3556
|
var isFetching = results.some(function (result) {
|
|
3339
3557
|
return result.isFetching;
|
|
3340
3558
|
});
|
|
3341
|
-
var
|
|
3559
|
+
var parameterErrors = {};
|
|
3560
|
+
results.forEach(function (result, index) {
|
|
3342
3561
|
var _result$error;
|
|
3343
|
-
|
|
3562
|
+
if ((_result$error = result.error) != null && _result$error.message) {
|
|
3563
|
+
parameterErrors[index] = result.error.message;
|
|
3564
|
+
}
|
|
3565
|
+
});
|
|
3566
|
+
var errorsWithCount = countBy(results.map(function (result) {
|
|
3567
|
+
var _result$error2;
|
|
3568
|
+
return result == null || (_result$error2 = result.error) == null ? void 0 : _result$error2.message;
|
|
3344
3569
|
}).filter(Boolean));
|
|
3345
3570
|
var errorMessage = Object.entries(errorsWithCount).map(function (_ref) {
|
|
3346
3571
|
var message = _ref[0],
|
|
@@ -3351,17 +3576,40 @@ var useGetPlotsWithData = function useGetPlotsWithData(plotsWithoutData, selecte
|
|
|
3351
3576
|
return {
|
|
3352
3577
|
data: data,
|
|
3353
3578
|
isFetching: isFetching,
|
|
3354
|
-
error: error
|
|
3579
|
+
error: error,
|
|
3580
|
+
parameterErrors: parameterErrors
|
|
3355
3581
|
};
|
|
3356
3582
|
}
|
|
3357
3583
|
});
|
|
3358
|
-
|
|
3359
|
-
|
|
3584
|
+
|
|
3585
|
+
// Combine fetched data with parameters and plots, including errors per plot
|
|
3586
|
+
var plotsWithData = useMemo(function () {
|
|
3360
3587
|
var _results$data;
|
|
3361
3588
|
var data = (_results$data = results.data) != null && _results$data.length ? results.data : [];
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3589
|
+
|
|
3590
|
+
// Create maps of parameter errors and failed parameter names by plotId
|
|
3591
|
+
var plotErrors = {};
|
|
3592
|
+
var failedParametersByPlotId = {};
|
|
3593
|
+
plotsWithoutData.parameters.forEach(function (parameter, index) {
|
|
3594
|
+
var _results$parameterErr;
|
|
3595
|
+
var errorMessage = (_results$parameterErr = results.parameterErrors) == null ? void 0 : _results$parameterErr[index];
|
|
3596
|
+
if (errorMessage) {
|
|
3597
|
+
if (!plotErrors[parameter.plotId]) {
|
|
3598
|
+
plotErrors[parameter.plotId] = [];
|
|
3599
|
+
failedParametersByPlotId[parameter.plotId] = [];
|
|
3600
|
+
}
|
|
3601
|
+
if (!plotErrors[parameter.plotId].includes(errorMessage)) {
|
|
3602
|
+
plotErrors[parameter.plotId].push(errorMessage);
|
|
3603
|
+
}
|
|
3604
|
+
failedParametersByPlotId[parameter.plotId].push({
|
|
3605
|
+
propertyName: parameter.propertyName,
|
|
3606
|
+
serviceId: parameter.serviceId,
|
|
3607
|
+
collectionId: parameter.collectionId
|
|
3608
|
+
});
|
|
3609
|
+
}
|
|
3610
|
+
});
|
|
3611
|
+
return getPlotsWithParameters(plotsWithoutData.plots, combineParametersWithData(plotsWithoutData.parameters, data), plotErrors, failedParametersByPlotId);
|
|
3612
|
+
}, [plotsWithoutData.parameters, plotsWithoutData.plots, results.data, results.parameterErrors]);
|
|
3365
3613
|
return Object.assign({}, results, {
|
|
3366
3614
|
data: plotsWithData
|
|
3367
3615
|
});
|
|
@@ -3447,6 +3695,24 @@ var useGetLocations = function useGetLocations(options) {
|
|
|
3447
3695
|
return results;
|
|
3448
3696
|
};
|
|
3449
3697
|
|
|
3698
|
+
/* *
|
|
3699
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
3700
|
+
* you may not use this file except in compliance with the License.
|
|
3701
|
+
* You may obtain a copy of the License at
|
|
3702
|
+
*
|
|
3703
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
3704
|
+
*
|
|
3705
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3706
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
3707
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3708
|
+
* See the License for the specific language governing permissions and
|
|
3709
|
+
* limitations under the License.
|
|
3710
|
+
*
|
|
3711
|
+
* Copyright 2025 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
3712
|
+
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
3713
|
+
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
3714
|
+
* */
|
|
3715
|
+
|
|
3450
3716
|
var ParameterDimensionSelect = function ParameterDimensionSelect(_ref) {
|
|
3451
3717
|
var _collectionDetails$da, _parameter$dimension, _parameter$dimension2, _parameter$dimension3;
|
|
3452
3718
|
var rowIsEnabled = _ref.rowIsEnabled,
|
|
@@ -3480,15 +3746,16 @@ var ParameterDimensionSelect = function ParameterDimensionSelect(_ref) {
|
|
|
3480
3746
|
var hasReferenceTime = refTimeList.length > 0 && !refTimeList.some(function (value) {
|
|
3481
3747
|
return value.id === 'unvalidated';
|
|
3482
3748
|
});
|
|
3749
|
+
|
|
3483
3750
|
// Show nothing if no reference time and neither any custom dimensions
|
|
3484
3751
|
if ((!customDimensions || customDimensions.length === 0) && !hasReferenceTime) {
|
|
3485
3752
|
return null;
|
|
3486
3753
|
}
|
|
3487
|
-
return jsxs(Grid, {
|
|
3754
|
+
return /*#__PURE__*/jsxs(Grid, {
|
|
3488
3755
|
container: true,
|
|
3489
|
-
children: [jsx(Grid, {
|
|
3756
|
+
children: [/*#__PURE__*/jsx(Grid, {
|
|
3490
3757
|
size: "grow",
|
|
3491
|
-
children: jsx(ParameterDimensionIdSelect, {
|
|
3758
|
+
children: /*#__PURE__*/jsx(ParameterDimensionIdSelect, {
|
|
3492
3759
|
customDimensions: customDimensions,
|
|
3493
3760
|
hasReferenceTime: hasReferenceTime,
|
|
3494
3761
|
parameter: parameter,
|
|
@@ -3496,17 +3763,17 @@ var ParameterDimensionSelect = function ParameterDimensionSelect(_ref) {
|
|
|
3496
3763
|
rowIsEnabled: rowIsEnabled,
|
|
3497
3764
|
t: t
|
|
3498
3765
|
})
|
|
3499
|
-
}), jsx(Grid, {
|
|
3766
|
+
}), /*#__PURE__*/jsx(Grid, {
|
|
3500
3767
|
size: "grow",
|
|
3501
3768
|
children:
|
|
3502
3769
|
// Show referene time select if no dimension selected yet and reference time is available OR if reference time has been selected
|
|
3503
|
-
!((_parameter$dimension = parameter.dimension) != null && _parameter$dimension.id) && hasReferenceTime || (_parameter$dimension2 = parameter.dimension) != null && _parameter$dimension2.id && ((_parameter$dimension3 = parameter.dimension) == null ? void 0 : _parameter$dimension3.id) === REFERENCE_TIME_ID ? jsx(ReferenceTimeSelect, {
|
|
3770
|
+
!((_parameter$dimension = parameter.dimension) != null && _parameter$dimension.id) && hasReferenceTime || (_parameter$dimension2 = parameter.dimension) != null && _parameter$dimension2.id && ((_parameter$dimension3 = parameter.dimension) == null ? void 0 : _parameter$dimension3.id) === REFERENCE_TIME_ID ? /*#__PURE__*/jsx(ReferenceTimeSelect, {
|
|
3504
3771
|
parameter: parameter,
|
|
3505
3772
|
patchParameter: patchParameter,
|
|
3506
3773
|
refTimeList: refTimeList,
|
|
3507
3774
|
rowIsEnabled: rowIsEnabled,
|
|
3508
3775
|
t: t
|
|
3509
|
-
}) : jsx(ParameterDimensionValueSelect, {
|
|
3776
|
+
}) : /*#__PURE__*/jsx(ParameterDimensionValueSelect, {
|
|
3510
3777
|
customDimensions: customDimensions,
|
|
3511
3778
|
parameter: parameter,
|
|
3512
3779
|
patchParameter: patchParameter,
|
|
@@ -3517,13 +3784,31 @@ var ParameterDimensionSelect = function ParameterDimensionSelect(_ref) {
|
|
|
3517
3784
|
});
|
|
3518
3785
|
};
|
|
3519
3786
|
|
|
3787
|
+
/* *
|
|
3788
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
3789
|
+
* you may not use this file except in compliance with the License.
|
|
3790
|
+
* You may obtain a copy of the License at
|
|
3791
|
+
*
|
|
3792
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
3793
|
+
*
|
|
3794
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3795
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
3796
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3797
|
+
* See the License for the specific language governing permissions and
|
|
3798
|
+
* limitations under the License.
|
|
3799
|
+
*
|
|
3800
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
3801
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
3802
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
3803
|
+
* */
|
|
3804
|
+
|
|
3520
3805
|
var ParameterOpacitySelect = function ParameterOpacitySelect(_ref) {
|
|
3521
3806
|
var rowIsEnabled = _ref.rowIsEnabled,
|
|
3522
3807
|
parameter = _ref.parameter,
|
|
3523
3808
|
patchParameter = _ref.patchParameter,
|
|
3524
3809
|
t = _ref.t;
|
|
3525
3810
|
var opacityValues = [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100];
|
|
3526
|
-
return jsxs(TooltipSelect, {
|
|
3811
|
+
return /*#__PURE__*/jsxs(TooltipSelect, {
|
|
3527
3812
|
SelectDisplayProps: {
|
|
3528
3813
|
'aria-label': 'timeseriesManager-opacity'
|
|
3529
3814
|
},
|
|
@@ -3537,11 +3822,11 @@ var ParameterOpacitySelect = function ParameterOpacitySelect(_ref) {
|
|
|
3537
3822
|
},
|
|
3538
3823
|
tooltip: t('timeseries-choose-opacity'),
|
|
3539
3824
|
value: parameter.opacity,
|
|
3540
|
-
children: [jsx(MenuItem, {
|
|
3825
|
+
children: [/*#__PURE__*/jsx(MenuItem, {
|
|
3541
3826
|
disabled: true,
|
|
3542
3827
|
children: t('timeseries-opacity')
|
|
3543
3828
|
}), opacityValues.map(function (value) {
|
|
3544
|
-
return jsxs(MenuItem, {
|
|
3829
|
+
return /*#__PURE__*/jsxs(MenuItem, {
|
|
3545
3830
|
value: value,
|
|
3546
3831
|
children: [value, "%"]
|
|
3547
3832
|
}, value);
|
|
@@ -3549,12 +3834,30 @@ var ParameterOpacitySelect = function ParameterOpacitySelect(_ref) {
|
|
|
3549
3834
|
});
|
|
3550
3835
|
};
|
|
3551
3836
|
|
|
3837
|
+
/* *
|
|
3838
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
3839
|
+
* you may not use this file except in compliance with the License.
|
|
3840
|
+
* You may obtain a copy of the License at
|
|
3841
|
+
*
|
|
3842
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
3843
|
+
*
|
|
3844
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3845
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
3846
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3847
|
+
* See the License for the specific language governing permissions and
|
|
3848
|
+
* limitations under the License.
|
|
3849
|
+
*
|
|
3850
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
3851
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
3852
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
3853
|
+
* */
|
|
3854
|
+
|
|
3552
3855
|
var ParameterTypeSelect = function ParameterTypeSelect(_ref) {
|
|
3553
3856
|
var rowIsEnabled = _ref.rowIsEnabled,
|
|
3554
3857
|
parameter = _ref.parameter,
|
|
3555
3858
|
patchParameter = _ref.patchParameter,
|
|
3556
3859
|
t = _ref.t;
|
|
3557
|
-
return jsxs(TooltipSelect, {
|
|
3860
|
+
return /*#__PURE__*/jsxs(TooltipSelect, {
|
|
3558
3861
|
SelectDisplayProps: {
|
|
3559
3862
|
'aria-label': 'timeseriesManager-type'
|
|
3560
3863
|
},
|
|
@@ -3571,40 +3874,58 @@ var ParameterTypeSelect = function ParameterTypeSelect(_ref) {
|
|
|
3571
3874
|
},
|
|
3572
3875
|
tooltip: t('timeseries-choose-type'),
|
|
3573
3876
|
value: parameter.plotType,
|
|
3574
|
-
children: [jsx(MenuItem, {
|
|
3877
|
+
children: [/*#__PURE__*/jsx(MenuItem, {
|
|
3575
3878
|
disabled: true,
|
|
3576
3879
|
children: t('timeseries-type')
|
|
3577
|
-
}), jsx(MenuItem, {
|
|
3880
|
+
}), /*#__PURE__*/jsx(MenuItem, {
|
|
3578
3881
|
value: "line",
|
|
3579
3882
|
children: t('timeseries-line')
|
|
3580
|
-
}), jsx(MenuItem, {
|
|
3883
|
+
}), /*#__PURE__*/jsx(MenuItem, {
|
|
3581
3884
|
value: "bar",
|
|
3582
3885
|
children: t('timeseries-bar')
|
|
3583
|
-
}), jsx(MenuItem, {
|
|
3886
|
+
}), /*#__PURE__*/jsx(MenuItem, {
|
|
3584
3887
|
value: "area",
|
|
3585
3888
|
children: t('timeseries-area')
|
|
3586
|
-
}), jsx(MenuItem, {
|
|
3889
|
+
}), /*#__PURE__*/jsx(MenuItem, {
|
|
3587
3890
|
value: "scatter",
|
|
3588
3891
|
children: t('timeseries-scatter')
|
|
3589
3892
|
})]
|
|
3590
3893
|
});
|
|
3591
3894
|
};
|
|
3592
3895
|
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3896
|
+
/* *
|
|
3897
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
3898
|
+
* you may not use this file except in compliance with the License.
|
|
3899
|
+
* You may obtain a copy of the License at
|
|
3900
|
+
*
|
|
3901
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
3902
|
+
*
|
|
3903
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3904
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
3905
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3906
|
+
* See the License for the specific language governing permissions and
|
|
3907
|
+
* limitations under the License.
|
|
3908
|
+
*
|
|
3909
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
3910
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
3911
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
3912
|
+
* */
|
|
3913
|
+
|
|
3914
|
+
var ParameterNameSelect = function ParameterNameSelect(_ref) {
|
|
3915
|
+
var rowIsEnabled = _ref.rowIsEnabled,
|
|
3916
|
+
parameter = _ref.parameter,
|
|
3917
|
+
patchParameter = _ref.patchParameter,
|
|
3918
|
+
t = _ref.t;
|
|
3919
|
+
var serviceId = parameter.serviceId,
|
|
3920
|
+
collectionId = parameter.collectionId;
|
|
3921
|
+
var service = useSelector(function (store) {
|
|
3922
|
+
return getService(store, serviceId);
|
|
3923
|
+
});
|
|
3603
3924
|
var _useGetDetailsForColl = useGetDetailsForCollection(service, collectionId),
|
|
3604
3925
|
collectionDetails = _useGetDetailsForColl.data;
|
|
3605
3926
|
var parameterList = (collectionDetails == null ? void 0 : collectionDetails.parameters) || [];
|
|
3606
3927
|
var isFetching = parameterList.length === 0;
|
|
3607
|
-
return jsxs(TooltipSelect, {
|
|
3928
|
+
return /*#__PURE__*/jsxs(TooltipSelect, {
|
|
3608
3929
|
SelectDisplayProps: {
|
|
3609
3930
|
'aria-label': 'timeseriesManager-parameterName'
|
|
3610
3931
|
},
|
|
@@ -3625,17 +3946,17 @@ var ParameterNameSelect = function ParameterNameSelect(_ref) {
|
|
|
3625
3946
|
},
|
|
3626
3947
|
tooltip: "Parameter: " + parameter.propertyName + " " + (parameter.propertyLabel ? '-' : '') + " " + (parameter.propertyLabel ? parameter.propertyLabel : ''),
|
|
3627
3948
|
value: parameter.propertyName,
|
|
3628
|
-
children: [!!isFetching && jsx(LinearProgress, {
|
|
3949
|
+
children: [!!isFetching && /*#__PURE__*/jsx(LinearProgress, {
|
|
3629
3950
|
color: "inherit",
|
|
3630
3951
|
"data-testid": "spinner"
|
|
3631
|
-
}), jsx(MenuItem, {
|
|
3952
|
+
}), /*#__PURE__*/jsx(MenuItem, {
|
|
3632
3953
|
disabled: true,
|
|
3633
3954
|
children: t('timeseries-parameter')
|
|
3634
|
-
}), parameterList.length === 0 && jsx(MenuItem, {
|
|
3955
|
+
}), parameterList.length === 0 && /*#__PURE__*/jsx(MenuItem, {
|
|
3635
3956
|
value: parameter.propertyName,
|
|
3636
3957
|
children: parameter.propertyName
|
|
3637
3958
|
}), parameterList.map(function (parameter) {
|
|
3638
|
-
return jsx(MenuItem, {
|
|
3959
|
+
return /*#__PURE__*/jsx(MenuItem, {
|
|
3639
3960
|
value: parameter.propertyName,
|
|
3640
3961
|
children: parameter.propertyLabel || parameter.propertyName
|
|
3641
3962
|
}, "parametermenu" + parameter.propertyName);
|
|
@@ -3643,6 +3964,24 @@ var ParameterNameSelect = function ParameterNameSelect(_ref) {
|
|
|
3643
3964
|
});
|
|
3644
3965
|
};
|
|
3645
3966
|
|
|
3967
|
+
/* *
|
|
3968
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
3969
|
+
* you may not use this file except in compliance with the License.
|
|
3970
|
+
* You may obtain a copy of the License at
|
|
3971
|
+
*
|
|
3972
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
3973
|
+
*
|
|
3974
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3975
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
3976
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3977
|
+
* See the License for the specific language governing permissions and
|
|
3978
|
+
* limitations under the License.
|
|
3979
|
+
*
|
|
3980
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
3981
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
3982
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
3983
|
+
* */
|
|
3984
|
+
|
|
3646
3985
|
var TimeSeriesManagerRowAccordion = function TimeSeriesManagerRowAccordion(_ref) {
|
|
3647
3986
|
var panelId = _ref.panelId,
|
|
3648
3987
|
plotIsEnabled = _ref.plotIsEnabled,
|
|
@@ -3654,7 +3993,7 @@ var TimeSeriesManagerRowAccordion = function TimeSeriesManagerRowAccordion(_ref)
|
|
|
3654
3993
|
deleteParameter = _ref.deleteParameter,
|
|
3655
3994
|
toggleParameter = _ref.toggleParameter,
|
|
3656
3995
|
t = _ref.t;
|
|
3657
|
-
return jsx(CustomAccordion, {
|
|
3996
|
+
return /*#__PURE__*/jsx(CustomAccordion, {
|
|
3658
3997
|
CustomExpandIcon: ArrowDropDownDown,
|
|
3659
3998
|
"data-testid": "timeSeriesManagerRowAccordion",
|
|
3660
3999
|
defaultExpanded: false,
|
|
@@ -3667,7 +4006,7 @@ var TimeSeriesManagerRowAccordion = function TimeSeriesManagerRowAccordion(_ref)
|
|
|
3667
4006
|
},
|
|
3668
4007
|
backgroundColor: plotIsEnabled ? 'geowebColors.layerManager.tableRowDefaultCardContainer.fill' : 'geowebColors.layerManager.tableRowDisabledCardContainer.fill'
|
|
3669
4008
|
},
|
|
3670
|
-
title: jsxs(Grid, {
|
|
4009
|
+
title: /*#__PURE__*/jsxs(Grid, {
|
|
3671
4010
|
alignItems: "center",
|
|
3672
4011
|
container: true,
|
|
3673
4012
|
size: "grow",
|
|
@@ -3675,8 +4014,8 @@ var TimeSeriesManagerRowAccordion = function TimeSeriesManagerRowAccordion(_ref)
|
|
|
3675
4014
|
sx: {
|
|
3676
4015
|
pl: '14px'
|
|
3677
4016
|
},
|
|
3678
|
-
children: [jsx(Grid, {
|
|
3679
|
-
children: jsx(CustomIconButton, {
|
|
4017
|
+
children: [/*#__PURE__*/jsx(Grid, {
|
|
4018
|
+
children: /*#__PURE__*/jsx(CustomIconButton, {
|
|
3680
4019
|
"data-testid": "accordionEnableButton",
|
|
3681
4020
|
onClick: function onClick(event) {
|
|
3682
4021
|
event.stopPropagation();
|
|
@@ -3684,112 +4023,112 @@ var TimeSeriesManagerRowAccordion = function TimeSeriesManagerRowAccordion(_ref)
|
|
|
3684
4023
|
},
|
|
3685
4024
|
shouldShowAsDisabled: !plotIsEnabled,
|
|
3686
4025
|
tooltipTitle: (parameter.enabled !== false ? t('timeseries-hide') : t('timeseries-show')) + " " + parameter.propertyName,
|
|
3687
|
-
children: parameter.enabled !== false && plotIsEnabled ? jsx(Visibility, {
|
|
4026
|
+
children: parameter.enabled !== false && plotIsEnabled ? /*#__PURE__*/jsx(Visibility, {
|
|
3688
4027
|
"data-testid": "enabled-visible"
|
|
3689
|
-
}) : jsx(VisibilityOff, {
|
|
4028
|
+
}) : /*#__PURE__*/jsx(VisibilityOff, {
|
|
3690
4029
|
"data-testid": "disabled-visible"
|
|
3691
4030
|
})
|
|
3692
4031
|
})
|
|
3693
|
-
}), jsx(Grid, {
|
|
3694
|
-
children: jsx(Grid, {
|
|
4032
|
+
}), /*#__PURE__*/jsx(Grid, {
|
|
4033
|
+
children: /*#__PURE__*/jsx(Grid, {
|
|
3695
4034
|
sx: [styles.rowText],
|
|
3696
4035
|
title: parameter.collectionId,
|
|
3697
4036
|
children: parameter.collectionId
|
|
3698
4037
|
})
|
|
3699
4038
|
})]
|
|
3700
4039
|
}),
|
|
3701
|
-
children: jsxs(Grid, {
|
|
4040
|
+
children: /*#__PURE__*/jsxs(Grid, {
|
|
3702
4041
|
container: true,
|
|
3703
4042
|
direction: "column",
|
|
3704
4043
|
spacing: 2,
|
|
3705
4044
|
sx: {
|
|
3706
4045
|
padding: '16px 10px'
|
|
3707
4046
|
},
|
|
3708
|
-
children: [jsxs(Grid, {
|
|
4047
|
+
children: [/*#__PURE__*/jsxs(Grid, {
|
|
3709
4048
|
children: [" ", t('timeseries-collection')]
|
|
3710
|
-
}), jsx(Grid, {
|
|
4049
|
+
}), /*#__PURE__*/jsx(Grid, {
|
|
3711
4050
|
sx: [styles.rowText],
|
|
3712
4051
|
title: parameter.collectionId,
|
|
3713
4052
|
children: parameter.collectionId
|
|
3714
|
-
}), jsxs(Grid, {
|
|
4053
|
+
}), /*#__PURE__*/jsxs(Grid, {
|
|
3715
4054
|
children: [" ", t('timeseries-parameter')]
|
|
3716
|
-
}), jsx(Grid, {
|
|
3717
|
-
children: jsx(ParameterNameSelect, {
|
|
4055
|
+
}), /*#__PURE__*/jsx(Grid, {
|
|
4056
|
+
children: /*#__PURE__*/jsx(ParameterNameSelect, {
|
|
3718
4057
|
parameter: parameter,
|
|
3719
4058
|
patchParameter: patchParameter,
|
|
3720
4059
|
rowIsEnabled: plotIsEnabled || rowIsEnabled,
|
|
3721
4060
|
t: t
|
|
3722
4061
|
})
|
|
3723
|
-
}), jsxs(Grid, {
|
|
4062
|
+
}), /*#__PURE__*/jsxs(Grid, {
|
|
3724
4063
|
children: [" ", t('timeseries-style')]
|
|
3725
|
-
}), jsx(Grid, {
|
|
3726
|
-
children: jsx(ParameterTypeSelect, {
|
|
4064
|
+
}), /*#__PURE__*/jsx(Grid, {
|
|
4065
|
+
children: /*#__PURE__*/jsx(ParameterTypeSelect, {
|
|
3727
4066
|
parameter: parameter,
|
|
3728
4067
|
patchParameter: patchParameter,
|
|
3729
4068
|
rowIsEnabled: plotIsEnabled || rowIsEnabled,
|
|
3730
4069
|
t: t
|
|
3731
4070
|
})
|
|
3732
|
-
}), jsxs(Grid, {
|
|
4071
|
+
}), /*#__PURE__*/jsxs(Grid, {
|
|
3733
4072
|
children: [" ", t('timeseries-color')]
|
|
3734
|
-
}), jsx(Grid, {
|
|
4073
|
+
}), /*#__PURE__*/jsx(Grid, {
|
|
3735
4074
|
sx: {
|
|
3736
4075
|
width: '100%'
|
|
3737
4076
|
},
|
|
3738
|
-
children: jsx(ParameterColorSelect, {
|
|
4077
|
+
children: /*#__PURE__*/jsx(ParameterColorSelect, {
|
|
3739
4078
|
parameter: parameter,
|
|
3740
4079
|
patchParameter: patchParameter,
|
|
3741
4080
|
rowIsEnabled: plotIsEnabled || rowIsEnabled,
|
|
3742
4081
|
t: t,
|
|
3743
4082
|
useEntireWidth: true
|
|
3744
4083
|
})
|
|
3745
|
-
}), jsxs(Grid, {
|
|
4084
|
+
}), /*#__PURE__*/jsxs(Grid, {
|
|
3746
4085
|
children: [" ", t('timeseries-opacity')]
|
|
3747
|
-
}), jsx(Grid, {
|
|
3748
|
-
children: jsx(ParameterOpacitySelect, {
|
|
4086
|
+
}), /*#__PURE__*/jsx(Grid, {
|
|
4087
|
+
children: /*#__PURE__*/jsx(ParameterOpacitySelect, {
|
|
3749
4088
|
parameter: parameter,
|
|
3750
4089
|
patchParameter: patchParameter,
|
|
3751
4090
|
rowIsEnabled: plotIsEnabled || rowIsEnabled,
|
|
3752
4091
|
t: t
|
|
3753
4092
|
})
|
|
3754
|
-
}), jsxs(Grid, {
|
|
4093
|
+
}), /*#__PURE__*/jsxs(Grid, {
|
|
3755
4094
|
children: [" ", t('timeseries-dimension')]
|
|
3756
|
-
}), jsx(Grid, {
|
|
3757
|
-
children: jsx(ParameterDimensionSelect, {
|
|
4095
|
+
}), /*#__PURE__*/jsx(Grid, {
|
|
4096
|
+
children: /*#__PURE__*/jsx(ParameterDimensionSelect, {
|
|
3758
4097
|
parameter: parameter,
|
|
3759
4098
|
patchParameter: patchParameter,
|
|
3760
4099
|
rowIsEnabled: plotIsEnabled || rowIsEnabled,
|
|
3761
4100
|
t: t
|
|
3762
4101
|
})
|
|
3763
|
-
}), jsx(Grid, {
|
|
3764
|
-
children: jsxs(Grid, {
|
|
4102
|
+
}), /*#__PURE__*/jsx(Grid, {
|
|
4103
|
+
children: /*#__PURE__*/jsxs(Grid, {
|
|
3765
4104
|
container: true,
|
|
3766
4105
|
sx: {
|
|
3767
4106
|
justifyContent: 'space-evenly'
|
|
3768
4107
|
},
|
|
3769
|
-
children: [jsx(Grid, {
|
|
3770
|
-
children: jsx(ParameterInfoButtonConnect, {
|
|
4108
|
+
children: [/*#__PURE__*/jsx(Grid, {
|
|
4109
|
+
children: /*#__PURE__*/jsx(ParameterInfoButtonConnect, {
|
|
3771
4110
|
panelId: panelId,
|
|
3772
4111
|
parameter: parameter
|
|
3773
4112
|
})
|
|
3774
|
-
}), jsx(Grid, {
|
|
3775
|
-
children: jsx(CustomIconButton, {
|
|
4113
|
+
}), /*#__PURE__*/jsx(Grid, {
|
|
4114
|
+
children: /*#__PURE__*/jsx(CustomIconButton, {
|
|
3776
4115
|
"data-testid": "accordionDuplicateButton",
|
|
3777
4116
|
onClick: function onClick() {
|
|
3778
4117
|
addParameter(parameter);
|
|
3779
4118
|
},
|
|
3780
4119
|
shouldShowAsDisabled: !plotIsEnabled,
|
|
3781
4120
|
tooltipTitle: "Duplicate " + parameter.propertyName,
|
|
3782
|
-
children: jsx(Copy, {})
|
|
4121
|
+
children: /*#__PURE__*/jsx(Copy, {})
|
|
3783
4122
|
})
|
|
3784
|
-
}), jsx(Grid, {
|
|
3785
|
-
children: jsx(CustomIconButton, {
|
|
4123
|
+
}), /*#__PURE__*/jsx(Grid, {
|
|
4124
|
+
children: /*#__PURE__*/jsx(CustomIconButton, {
|
|
3786
4125
|
"data-testid": "accordionDeleteButton",
|
|
3787
4126
|
onClick: function onClick() {
|
|
3788
4127
|
deleteParameter(parameter.id);
|
|
3789
4128
|
},
|
|
3790
4129
|
shouldShowAsDisabled: !plotIsEnabled,
|
|
3791
4130
|
tooltipTitle: t('timeseries-remove') + " " + parameter.propertyName,
|
|
3792
|
-
children: jsx(Delete, {})
|
|
4131
|
+
children: /*#__PURE__*/jsx(Delete, {})
|
|
3793
4132
|
})
|
|
3794
4133
|
})]
|
|
3795
4134
|
})
|
|
@@ -3807,40 +4146,40 @@ var RowLayout = function RowLayout(_ref) {
|
|
|
3807
4146
|
dimension = _ref.dimension,
|
|
3808
4147
|
actions = _ref.actions,
|
|
3809
4148
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
3810
|
-
return jsxs(Grid, Object.assign({
|
|
4149
|
+
return /*#__PURE__*/jsxs(Grid, Object.assign({
|
|
3811
4150
|
alignItems: "center",
|
|
3812
4151
|
container: true,
|
|
3813
4152
|
justifyContent: "space-between",
|
|
3814
4153
|
spacing: 2
|
|
3815
4154
|
}, props, {
|
|
3816
|
-
children: [jsx(Grid, {
|
|
4155
|
+
children: [/*#__PURE__*/jsx(Grid, {
|
|
3817
4156
|
sx: {
|
|
3818
4157
|
width: 48
|
|
3819
4158
|
},
|
|
3820
4159
|
children: plot
|
|
3821
|
-
}), jsx(Grid, {
|
|
4160
|
+
}), /*#__PURE__*/jsx(Grid, {
|
|
3822
4161
|
className: "timeSeriesManagerCollection",
|
|
3823
4162
|
sx: {
|
|
3824
4163
|
width: 60
|
|
3825
4164
|
},
|
|
3826
4165
|
children: collection
|
|
3827
|
-
}), jsx(Grid, {
|
|
4166
|
+
}), /*#__PURE__*/jsx(Grid, {
|
|
3828
4167
|
className: "timeSeriesManagerParameter",
|
|
3829
4168
|
sx: {
|
|
3830
4169
|
width: '15%'
|
|
3831
4170
|
},
|
|
3832
4171
|
children: parameter
|
|
3833
|
-
}), jsx(Grid, {
|
|
4172
|
+
}), /*#__PURE__*/jsx(Grid, {
|
|
3834
4173
|
className: "timeSeriesManagerStyle",
|
|
3835
4174
|
sx: {
|
|
3836
4175
|
width: '25%'
|
|
3837
4176
|
},
|
|
3838
4177
|
children: style
|
|
3839
|
-
}), jsx(Grid, {
|
|
4178
|
+
}), /*#__PURE__*/jsx(Grid, {
|
|
3840
4179
|
className: "timeseriesManagerDimension",
|
|
3841
4180
|
size: "grow",
|
|
3842
4181
|
children: dimension
|
|
3843
|
-
}), jsx(Grid, {
|
|
4182
|
+
}), /*#__PURE__*/jsx(Grid, {
|
|
3844
4183
|
className: "timeSeriesManagerActions",
|
|
3845
4184
|
sx: {
|
|
3846
4185
|
width: 88,
|
|
@@ -3851,6 +4190,24 @@ var RowLayout = function RowLayout(_ref) {
|
|
|
3851
4190
|
}));
|
|
3852
4191
|
};
|
|
3853
4192
|
|
|
4193
|
+
/* *
|
|
4194
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4195
|
+
* you may not use this file except in compliance with the License.
|
|
4196
|
+
* You may obtain a copy of the License at
|
|
4197
|
+
*
|
|
4198
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
4199
|
+
*
|
|
4200
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
4201
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
4202
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4203
|
+
* See the License for the specific language governing permissions and
|
|
4204
|
+
* limitations under the License.
|
|
4205
|
+
*
|
|
4206
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
4207
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
4208
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
4209
|
+
* */
|
|
4210
|
+
|
|
3854
4211
|
var ParameterList = function ParameterList(_ref) {
|
|
3855
4212
|
var _plot$parameters, _plot$parameters2;
|
|
3856
4213
|
var panelId = _ref.panelId,
|
|
@@ -3870,7 +4227,7 @@ var ParameterList = function ParameterList(_ref) {
|
|
|
3870
4227
|
toPlotId: sort.to.id
|
|
3871
4228
|
});
|
|
3872
4229
|
}, [moveParameter]);
|
|
3873
|
-
return jsx(ReactSortable, {
|
|
4230
|
+
return /*#__PURE__*/jsx(ReactSortable, {
|
|
3874
4231
|
animation: 200,
|
|
3875
4232
|
direction: "vertical",
|
|
3876
4233
|
group: {
|
|
@@ -3886,16 +4243,17 @@ var ParameterList = function ParameterList(_ref) {
|
|
|
3886
4243
|
}) : [],
|
|
3887
4244
|
onEnd: onSortEnd,
|
|
3888
4245
|
setList: function setList() {},
|
|
3889
|
-
swapThreshold: 0.3
|
|
4246
|
+
swapThreshold: 0.3 // Nested sortable gets jumpy without this. Cant be lower because e2e will fail.
|
|
4247
|
+
,
|
|
3890
4248
|
children: (_plot$parameters2 = plot.parameters) == null ? void 0 : _plot$parameters2.map(function (parameter) {
|
|
3891
4249
|
var parameterIsEnabled = parameter.enabled !== false;
|
|
3892
4250
|
var rowIsEnabled = plotIsEnabled && parameterIsEnabled;
|
|
3893
4251
|
var styles = getStyles$1(rowIsEnabled);
|
|
3894
|
-
return jsxs(Box, {
|
|
4252
|
+
return /*#__PURE__*/jsxs(Box, {
|
|
3895
4253
|
sx: styles.plot,
|
|
3896
|
-
children: [jsx(Box, {
|
|
4254
|
+
children: [/*#__PURE__*/jsx(Box, {
|
|
3897
4255
|
className: "medium-timeseriesmanager",
|
|
3898
|
-
children: jsx(TimeSeriesManagerRowAccordion, {
|
|
4256
|
+
children: /*#__PURE__*/jsx(TimeSeriesManagerRowAccordion, {
|
|
3899
4257
|
panelId: panelId,
|
|
3900
4258
|
addParameter: addParameter,
|
|
3901
4259
|
deleteParameter: deleteParameter,
|
|
@@ -3907,49 +4265,49 @@ var ParameterList = function ParameterList(_ref) {
|
|
|
3907
4265
|
t: t,
|
|
3908
4266
|
toggleParameter: toggleParameter
|
|
3909
4267
|
})
|
|
3910
|
-
}), jsx(RowLayout, {
|
|
3911
|
-
actions: jsxs(Grid, {
|
|
4268
|
+
}), /*#__PURE__*/jsx(RowLayout, {
|
|
4269
|
+
actions: /*#__PURE__*/jsxs(Grid, {
|
|
3912
4270
|
container: true,
|
|
3913
4271
|
justifyContent: "space-between",
|
|
3914
|
-
children: [jsx(ParameterInfoButtonConnect, {
|
|
4272
|
+
children: [/*#__PURE__*/jsx(ParameterInfoButtonConnect, {
|
|
3915
4273
|
panelId: panelId,
|
|
3916
4274
|
parameter: parameter
|
|
3917
|
-
}), ' ', jsx(CustomIconButton, {
|
|
4275
|
+
}), ' ', /*#__PURE__*/jsx(CustomIconButton, {
|
|
3918
4276
|
"data-testid": "duplicateButton",
|
|
3919
4277
|
onClick: function onClick() {
|
|
3920
4278
|
addParameter(parameter);
|
|
3921
4279
|
},
|
|
3922
4280
|
shouldShowAsDisabled: !plotIsEnabled,
|
|
3923
4281
|
tooltipTitle: t('timeseries-duplicate') + " " + parameter.propertyName,
|
|
3924
|
-
children: jsx(Copy, {})
|
|
3925
|
-
}), jsx(CustomIconButton, {
|
|
4282
|
+
children: /*#__PURE__*/jsx(Copy, {})
|
|
4283
|
+
}), /*#__PURE__*/jsx(CustomIconButton, {
|
|
3926
4284
|
"data-testid": "deleteButton",
|
|
3927
4285
|
onClick: function onClick() {
|
|
3928
4286
|
deleteParameter(parameter.id);
|
|
3929
4287
|
},
|
|
3930
4288
|
shouldShowAsDisabled: !plotIsEnabled,
|
|
3931
4289
|
tooltipTitle: t('timeseries-remove') + " " + parameter.propertyName,
|
|
3932
|
-
children: jsx(Delete, {})
|
|
4290
|
+
children: /*#__PURE__*/jsx(Delete, {})
|
|
3933
4291
|
})]
|
|
3934
4292
|
}),
|
|
3935
4293
|
className: "plotRow",
|
|
3936
|
-
collection: jsx(Typography, {
|
|
4294
|
+
collection: /*#__PURE__*/jsx(Typography, {
|
|
3937
4295
|
sx: Object.assign({}, styles.rowText),
|
|
3938
4296
|
children: parameter.collectionId
|
|
3939
4297
|
}),
|
|
3940
|
-
dimension: jsx(ParameterDimensionSelect, {
|
|
4298
|
+
dimension: /*#__PURE__*/jsx(ParameterDimensionSelect, {
|
|
3941
4299
|
parameter: parameter,
|
|
3942
4300
|
patchParameter: patchParameter,
|
|
3943
4301
|
rowIsEnabled: rowIsEnabled,
|
|
3944
4302
|
t: t
|
|
3945
4303
|
}),
|
|
3946
|
-
parameter: jsx(ParameterNameSelect, {
|
|
4304
|
+
parameter: /*#__PURE__*/jsx(ParameterNameSelect, {
|
|
3947
4305
|
parameter: parameter,
|
|
3948
4306
|
patchParameter: patchParameter,
|
|
3949
4307
|
rowIsEnabled: rowIsEnabled,
|
|
3950
4308
|
t: t
|
|
3951
4309
|
}),
|
|
3952
|
-
plot: jsx(CustomIconButton, {
|
|
4310
|
+
plot: /*#__PURE__*/jsx(CustomIconButton, {
|
|
3953
4311
|
"data-testid": "enableButton",
|
|
3954
4312
|
onClick: function onClick() {
|
|
3955
4313
|
toggleParameter(parameter.id);
|
|
@@ -3959,27 +4317,27 @@ var ParameterList = function ParameterList(_ref) {
|
|
|
3959
4317
|
marginLeft: 3
|
|
3960
4318
|
},
|
|
3961
4319
|
tooltipTitle: (parameterIsEnabled ? t('timeseries-hide') : t('timeseries-show')) + " " + parameter.propertyName,
|
|
3962
|
-
children: rowIsEnabled ? jsx(Visibility, {}) : jsx(VisibilityOff, {})
|
|
4320
|
+
children: rowIsEnabled ? /*#__PURE__*/jsx(Visibility, {}) : /*#__PURE__*/jsx(VisibilityOff, {})
|
|
3963
4321
|
}),
|
|
3964
|
-
style: jsxs(Grid, {
|
|
4322
|
+
style: /*#__PURE__*/jsxs(Grid, {
|
|
3965
4323
|
container: true,
|
|
3966
|
-
children: [jsx(Grid, {
|
|
4324
|
+
children: [/*#__PURE__*/jsx(Grid, {
|
|
3967
4325
|
size: "grow",
|
|
3968
|
-
children: jsx(ParameterTypeSelect, {
|
|
4326
|
+
children: /*#__PURE__*/jsx(ParameterTypeSelect, {
|
|
3969
4327
|
parameter: parameter,
|
|
3970
4328
|
patchParameter: patchParameter,
|
|
3971
4329
|
rowIsEnabled: rowIsEnabled,
|
|
3972
4330
|
t: t
|
|
3973
4331
|
})
|
|
3974
|
-
}), jsx(Grid, {
|
|
3975
|
-
children: jsx(ParameterColorSelect, {
|
|
4332
|
+
}), /*#__PURE__*/jsx(Grid, {
|
|
4333
|
+
children: /*#__PURE__*/jsx(ParameterColorSelect, {
|
|
3976
4334
|
parameter: parameter,
|
|
3977
4335
|
patchParameter: patchParameter,
|
|
3978
4336
|
rowIsEnabled: rowIsEnabled,
|
|
3979
4337
|
t: t
|
|
3980
4338
|
})
|
|
3981
|
-
}), jsx(Grid, {
|
|
3982
|
-
children: jsx(ParameterOpacitySelect, {
|
|
4339
|
+
}), /*#__PURE__*/jsx(Grid, {
|
|
4340
|
+
children: /*#__PURE__*/jsx(ParameterOpacitySelect, {
|
|
3983
4341
|
parameter: parameter,
|
|
3984
4342
|
patchParameter: patchParameter,
|
|
3985
4343
|
rowIsEnabled: rowIsEnabled,
|
|
@@ -4019,6 +4377,24 @@ var getStyles$1 = function getStyles(isEnabled) {
|
|
|
4019
4377
|
};
|
|
4020
4378
|
};
|
|
4021
4379
|
|
|
4380
|
+
/* *
|
|
4381
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4382
|
+
* you may not use this file except in compliance with the License.
|
|
4383
|
+
* You may obtain a copy of the License at
|
|
4384
|
+
*
|
|
4385
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
4386
|
+
*
|
|
4387
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
4388
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
4389
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4390
|
+
* See the License for the specific language governing permissions and
|
|
4391
|
+
* limitations under the License.
|
|
4392
|
+
*
|
|
4393
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
4394
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
4395
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
4396
|
+
* */
|
|
4397
|
+
|
|
4022
4398
|
var TimeSeriesSelectButtonConnect = function TimeSeriesSelectButtonConnect(_ref) {
|
|
4023
4399
|
var isEnabled = _ref.isEnabled,
|
|
4024
4400
|
onClick = _ref.onClick,
|
|
@@ -4047,9 +4423,9 @@ var TimeSeriesSelectButtonConnect = function TimeSeriesSelectButtonConnect(_ref)
|
|
|
4047
4423
|
};
|
|
4048
4424
|
var isSelectOpenForCurrentPlot = plotId === selectPlotId;
|
|
4049
4425
|
var isOpenForPanel = isOpenInStore && currentSourcePanelId === panelId;
|
|
4050
|
-
return jsx(CustomTooltip, {
|
|
4426
|
+
return /*#__PURE__*/jsx(CustomTooltip, {
|
|
4051
4427
|
title: t('timeseries-add-param-to-plot'),
|
|
4052
|
-
children: jsx(CustomToggleButton, {
|
|
4428
|
+
children: /*#__PURE__*/jsx(CustomToggleButton, {
|
|
4053
4429
|
"data-testid": "timeSeriesSelectButton",
|
|
4054
4430
|
disabled: !isEnabled,
|
|
4055
4431
|
onClick: handleClick,
|
|
@@ -4064,11 +4440,29 @@ var TimeSeriesSelectButtonConnect = function TimeSeriesSelectButtonConnect(_ref)
|
|
|
4064
4440
|
}
|
|
4065
4441
|
},
|
|
4066
4442
|
variant: "tool",
|
|
4067
|
-
children: jsx(TimeSeriesSelect$1, {})
|
|
4443
|
+
children: /*#__PURE__*/jsx(TimeSeriesSelect$1, {})
|
|
4068
4444
|
})
|
|
4069
4445
|
});
|
|
4070
4446
|
};
|
|
4071
4447
|
|
|
4448
|
+
/* *
|
|
4449
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4450
|
+
* you may not use this file except in compliance with the License.
|
|
4451
|
+
* You may obtain a copy of the License at
|
|
4452
|
+
*
|
|
4453
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
4454
|
+
*
|
|
4455
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
4456
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
4457
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4458
|
+
* See the License for the specific language governing permissions and
|
|
4459
|
+
* limitations under the License.
|
|
4460
|
+
*
|
|
4461
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
4462
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
4463
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
4464
|
+
* */
|
|
4465
|
+
|
|
4072
4466
|
var PlotRows = function PlotRows(_ref) {
|
|
4073
4467
|
var panelId = _ref.panelId,
|
|
4074
4468
|
plot = _ref.plot,
|
|
@@ -4107,31 +4501,31 @@ var PlotRows = function PlotRows(_ref) {
|
|
|
4107
4501
|
setEditTitle(false);
|
|
4108
4502
|
}
|
|
4109
4503
|
};
|
|
4110
|
-
return jsxs(Box, {
|
|
4504
|
+
return /*#__PURE__*/jsxs(Box, {
|
|
4111
4505
|
sx: styles.plot,
|
|
4112
|
-
children: [jsx(RowLayout, {
|
|
4113
|
-
actions: jsxs(Grid, {
|
|
4506
|
+
children: [/*#__PURE__*/jsx(RowLayout, {
|
|
4507
|
+
actions: /*#__PURE__*/jsxs(Grid, {
|
|
4114
4508
|
container: true,
|
|
4115
4509
|
justifyContent: "space-between",
|
|
4116
|
-
children: [jsx(CustomIconButton, {
|
|
4510
|
+
children: [/*#__PURE__*/jsx(CustomIconButton, {
|
|
4117
4511
|
"data-testid": "deleteButton",
|
|
4118
4512
|
onClick: function onClick() {
|
|
4119
4513
|
deletePlot(plot.plotId);
|
|
4120
4514
|
},
|
|
4121
4515
|
shouldShowAsDisabled: !plotIsEnabled,
|
|
4122
4516
|
tooltipTitle: t('timeseries-remove') + " " + plot.title,
|
|
4123
|
-
children: jsx(Delete, {})
|
|
4124
|
-
}), jsx(CustomIconButton, {
|
|
4517
|
+
children: /*#__PURE__*/jsx(Delete, {})
|
|
4518
|
+
}), /*#__PURE__*/jsx(CustomIconButton, {
|
|
4125
4519
|
"data-testid": "openParameterListButton",
|
|
4126
4520
|
onClick: function onClick(event) {
|
|
4127
4521
|
event.stopPropagation();
|
|
4128
4522
|
setOpenParameterList(!openParameterList);
|
|
4129
4523
|
},
|
|
4130
4524
|
tooltipTitle: t('timeseries-open-param-list'),
|
|
4131
|
-
children: openParameterList ? jsx(ChevronUp, {}) : jsx(ChevronDown, {})
|
|
4525
|
+
children: openParameterList ? /*#__PURE__*/jsx(ChevronUp, {}) : /*#__PURE__*/jsx(ChevronDown, {})
|
|
4132
4526
|
})]
|
|
4133
4527
|
}),
|
|
4134
|
-
collection: jsx(TimeSeriesSelectButtonConnect, {
|
|
4528
|
+
collection: /*#__PURE__*/jsx(TimeSeriesSelectButtonConnect, {
|
|
4135
4529
|
isEnabled: plotIsEnabled,
|
|
4136
4530
|
onClick: function onClick() {
|
|
4137
4531
|
return setSelectPlotId(plot.plotId);
|
|
@@ -4141,13 +4535,13 @@ var PlotRows = function PlotRows(_ref) {
|
|
|
4141
4535
|
selectPlotId: selectPlotId,
|
|
4142
4536
|
t: t
|
|
4143
4537
|
}),
|
|
4144
|
-
parameter: jsx(ClickAwayListener, {
|
|
4538
|
+
parameter: /*#__PURE__*/jsx(ClickAwayListener, {
|
|
4145
4539
|
onClickAway: plotTitleClickAway,
|
|
4146
|
-
children: jsx(Box, {
|
|
4540
|
+
children: /*#__PURE__*/jsx(Box, {
|
|
4147
4541
|
onClick: function onClick() {
|
|
4148
4542
|
return setEditTitle(true);
|
|
4149
4543
|
},
|
|
4150
|
-
children: editTitle ? jsx(Input, {
|
|
4544
|
+
children: editTitle ? /*#__PURE__*/jsx(Input, {
|
|
4151
4545
|
"aria-label": t('timeseries-edit-title'),
|
|
4152
4546
|
defaultValue: plot.title,
|
|
4153
4547
|
inputProps: {
|
|
@@ -4158,18 +4552,19 @@ var PlotRows = function PlotRows(_ref) {
|
|
|
4158
4552
|
},
|
|
4159
4553
|
onFocus: function onFocus(event) {
|
|
4160
4554
|
return event.target.select();
|
|
4161
|
-
}
|
|
4555
|
+
}
|
|
4162
4556
|
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
|
|
4557
|
+
,
|
|
4163
4558
|
onKeyDown: function onKeyDown(e) {
|
|
4164
4559
|
return e.key === 'Enter' && plotTitleClickAway();
|
|
4165
4560
|
},
|
|
4166
4561
|
sx: Object.assign({}, styles.rowText, {
|
|
4167
4562
|
backgroundColor: 'geowebColors.textInputField.default.rgba'
|
|
4168
4563
|
})
|
|
4169
|
-
}) : jsx(CustomTooltip, {
|
|
4564
|
+
}) : /*#__PURE__*/jsx(CustomTooltip, {
|
|
4170
4565
|
placement: "top",
|
|
4171
4566
|
title: t('timeseries-edit-title'),
|
|
4172
|
-
children: jsx(Box, {
|
|
4567
|
+
children: /*#__PURE__*/jsx(Box, {
|
|
4173
4568
|
"aria-label": plot.title + ", " + t('timeseries-click-to-edit'),
|
|
4174
4569
|
sx: Object.assign({}, styles.rowText, {
|
|
4175
4570
|
minWidth: '100%',
|
|
@@ -4182,10 +4577,10 @@ var PlotRows = function PlotRows(_ref) {
|
|
|
4182
4577
|
})
|
|
4183
4578
|
})
|
|
4184
4579
|
}),
|
|
4185
|
-
plot: jsxs(Grid, {
|
|
4580
|
+
plot: /*#__PURE__*/jsxs(Grid, {
|
|
4186
4581
|
container: true,
|
|
4187
4582
|
justifyContent: "space-between",
|
|
4188
|
-
children: [jsx(CustomIconButton, {
|
|
4583
|
+
children: [/*#__PURE__*/jsx(CustomIconButton, {
|
|
4189
4584
|
className: "handle",
|
|
4190
4585
|
"data-testid": "dragHandleButton_" + rowIndex,
|
|
4191
4586
|
disableTouchRipple: true,
|
|
@@ -4198,24 +4593,24 @@ var PlotRows = function PlotRows(_ref) {
|
|
|
4198
4593
|
},
|
|
4199
4594
|
tabIndex: -1,
|
|
4200
4595
|
tooltipTitle: showTooltip ? t('timeseries-drag') : '',
|
|
4201
|
-
children: jsx(DragHandle, {})
|
|
4202
|
-
}), jsx(CustomIconButton, {
|
|
4596
|
+
children: /*#__PURE__*/jsx(DragHandle, {})
|
|
4597
|
+
}), /*#__PURE__*/jsx(CustomIconButton, {
|
|
4203
4598
|
"data-testid": "enableButton",
|
|
4204
4599
|
onClick: function onClick() {
|
|
4205
4600
|
togglePlot(plot.plotId);
|
|
4206
4601
|
},
|
|
4207
4602
|
shouldShowAsDisabled: !plotIsEnabled,
|
|
4208
4603
|
tooltipTitle: (plotIsEnabled ? t('timeseries-hide') : t('timeseries-show')) + " " + plot.title,
|
|
4209
|
-
children: plotIsEnabled ? jsx(Visibility, {}) : jsx(VisibilityOff, {})
|
|
4604
|
+
children: plotIsEnabled ? /*#__PURE__*/jsx(Visibility, {}) : /*#__PURE__*/jsx(VisibilityOff, {})
|
|
4210
4605
|
})]
|
|
4211
4606
|
}),
|
|
4212
4607
|
sx: styles.row
|
|
4213
|
-
}), jsx(Collapse, {
|
|
4608
|
+
}), /*#__PURE__*/jsx(Collapse, {
|
|
4214
4609
|
"in": openParameterList,
|
|
4215
4610
|
sx: styles.parameter,
|
|
4216
4611
|
timeout: "auto",
|
|
4217
4612
|
unmountOnExit: true,
|
|
4218
|
-
children: jsx(ParameterList, {
|
|
4613
|
+
children: /*#__PURE__*/jsx(ParameterList, {
|
|
4219
4614
|
panelId: panelId,
|
|
4220
4615
|
addParameter: addParameter,
|
|
4221
4616
|
deleteParameter: deleteParameter,
|
|
@@ -4229,6 +4624,7 @@ var PlotRows = function PlotRows(_ref) {
|
|
|
4229
4624
|
})]
|
|
4230
4625
|
}, plot.plotId);
|
|
4231
4626
|
};
|
|
4627
|
+
|
|
4232
4628
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
4233
4629
|
var getStyles = function getStyles(isEnabled) {
|
|
4234
4630
|
return {
|
|
@@ -4261,6 +4657,24 @@ var getStyles = function getStyles(isEnabled) {
|
|
|
4261
4657
|
};
|
|
4262
4658
|
};
|
|
4263
4659
|
|
|
4660
|
+
/* *
|
|
4661
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4662
|
+
* you may not use this file except in compliance with the License.
|
|
4663
|
+
* You may obtain a copy of the License at
|
|
4664
|
+
*
|
|
4665
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
4666
|
+
*
|
|
4667
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
4668
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
4669
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4670
|
+
* See the License for the specific language governing permissions and
|
|
4671
|
+
* limitations under the License.
|
|
4672
|
+
*
|
|
4673
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
4674
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
4675
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
4676
|
+
* */
|
|
4677
|
+
|
|
4264
4678
|
var AddPlotButton = function AddPlotButton(_ref) {
|
|
4265
4679
|
var handleClick = _ref.handleClick,
|
|
4266
4680
|
plotState = _ref.plotState,
|
|
@@ -4270,7 +4684,7 @@ var AddPlotButton = function AddPlotButton(_ref) {
|
|
|
4270
4684
|
var plotIndex = plotState.plots.length ? +titleRegex.exec(plotState.plots[plotState.plots.length - 1].title) : 0;
|
|
4271
4685
|
handleClick(t('timeseries-plot') + " " + (plotIndex + 1));
|
|
4272
4686
|
};
|
|
4273
|
-
return jsx(CustomIconButton, {
|
|
4687
|
+
return /*#__PURE__*/jsx(CustomIconButton, {
|
|
4274
4688
|
"data-testid": "timeSeriesAddPlotButton",
|
|
4275
4689
|
onClick: onClick,
|
|
4276
4690
|
size: "small",
|
|
@@ -4278,12 +4692,30 @@ var AddPlotButton = function AddPlotButton(_ref) {
|
|
|
4278
4692
|
border: 'none'
|
|
4279
4693
|
},
|
|
4280
4694
|
tooltipTitle: t('timeseries-add-plot'),
|
|
4281
|
-
children: jsx("span", {
|
|
4282
|
-
children: jsx(Add, {})
|
|
4695
|
+
children: /*#__PURE__*/jsx("span", {
|
|
4696
|
+
children: /*#__PURE__*/jsx(Add, {})
|
|
4283
4697
|
})
|
|
4284
4698
|
});
|
|
4285
4699
|
};
|
|
4286
4700
|
|
|
4701
|
+
/* *
|
|
4702
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4703
|
+
* you may not use this file except in compliance with the License.
|
|
4704
|
+
* You may obtain a copy of the License at
|
|
4705
|
+
*
|
|
4706
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
4707
|
+
*
|
|
4708
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
4709
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
4710
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4711
|
+
* See the License for the specific language governing permissions and
|
|
4712
|
+
* limitations under the License.
|
|
4713
|
+
*
|
|
4714
|
+
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
4715
|
+
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
4716
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
4717
|
+
* */
|
|
4718
|
+
|
|
4287
4719
|
var timeSeriesManagerStyle = {
|
|
4288
4720
|
'.timeSeriesManagerContainer': {
|
|
4289
4721
|
containerType: 'inline-size'
|
|
@@ -4378,7 +4810,7 @@ var TimeSeriesManager = function TimeSeriesManager(_ref) {
|
|
|
4378
4810
|
setIsSorting(false);
|
|
4379
4811
|
}, []);
|
|
4380
4812
|
var showTooltip = !isSorting;
|
|
4381
|
-
return jsx(ToolContainerDraggable, {
|
|
4813
|
+
return /*#__PURE__*/jsx(ToolContainerDraggable, {
|
|
4382
4814
|
className: "timeseriesmanager",
|
|
4383
4815
|
isOpen: isOpen,
|
|
4384
4816
|
minHeight: 126,
|
|
@@ -4390,40 +4822,40 @@ var TimeSeriesManager = function TimeSeriesManager(_ref) {
|
|
|
4390
4822
|
startSize: startSize,
|
|
4391
4823
|
sx: Object.assign({}, timeSeriesManagerStyle),
|
|
4392
4824
|
title: "Time Series Manager",
|
|
4393
|
-
children: jsxs(Box, {
|
|
4825
|
+
children: /*#__PURE__*/jsxs(Box, {
|
|
4394
4826
|
className: "timeSeriesManagerContainer",
|
|
4395
4827
|
sx: {
|
|
4396
4828
|
padding: '0 6px'
|
|
4397
4829
|
},
|
|
4398
|
-
children: [jsx(RowLayout, {
|
|
4830
|
+
children: [/*#__PURE__*/jsx(RowLayout, {
|
|
4399
4831
|
className: "timeSeriesManagerHeaderRow",
|
|
4400
|
-
collection: jsx(Typography, {
|
|
4832
|
+
collection: /*#__PURE__*/jsx(Typography, {
|
|
4401
4833
|
sx: {
|
|
4402
4834
|
fontSize: 12,
|
|
4403
4835
|
opacity: 0.67
|
|
4404
4836
|
},
|
|
4405
4837
|
children: t('timeseries-collection')
|
|
4406
4838
|
}),
|
|
4407
|
-
dimension: jsx(Typography, {
|
|
4839
|
+
dimension: /*#__PURE__*/jsx(Typography, {
|
|
4408
4840
|
sx: {
|
|
4409
4841
|
fontSize: 12,
|
|
4410
4842
|
opacity: 0.67
|
|
4411
4843
|
},
|
|
4412
4844
|
children: t('timeseries-dimension')
|
|
4413
4845
|
}),
|
|
4414
|
-
parameter: jsx(Typography, {
|
|
4846
|
+
parameter: /*#__PURE__*/jsx(Typography, {
|
|
4415
4847
|
sx: {
|
|
4416
4848
|
fontSize: 12,
|
|
4417
4849
|
opacity: 0.67
|
|
4418
4850
|
},
|
|
4419
4851
|
children: t('timeseries-parameter')
|
|
4420
4852
|
}),
|
|
4421
|
-
plot: jsx(AddPlotButton, {
|
|
4853
|
+
plot: /*#__PURE__*/jsx(AddPlotButton, {
|
|
4422
4854
|
handleClick: addPlot,
|
|
4423
4855
|
plotState: plotState,
|
|
4424
4856
|
t: t
|
|
4425
4857
|
}),
|
|
4426
|
-
style: jsx(Typography, {
|
|
4858
|
+
style: /*#__PURE__*/jsx(Typography, {
|
|
4427
4859
|
sx: {
|
|
4428
4860
|
fontSize: 12,
|
|
4429
4861
|
opacity: 0.67
|
|
@@ -4433,7 +4865,7 @@ var TimeSeriesManager = function TimeSeriesManager(_ref) {
|
|
|
4433
4865
|
sx: {
|
|
4434
4866
|
height: 48
|
|
4435
4867
|
}
|
|
4436
|
-
}), jsx(ReactSortable, {
|
|
4868
|
+
}), /*#__PURE__*/jsx(ReactSortable, {
|
|
4437
4869
|
animation: 200,
|
|
4438
4870
|
direction: "vertical",
|
|
4439
4871
|
group: {
|
|
@@ -4450,9 +4882,10 @@ var TimeSeriesManager = function TimeSeriesManager(_ref) {
|
|
|
4450
4882
|
onSort: onSortEnd,
|
|
4451
4883
|
onStart: onStart,
|
|
4452
4884
|
setList: function setList() {},
|
|
4453
|
-
swapThreshold: 0.3
|
|
4885
|
+
swapThreshold: 0.3 // Nested sortable gets jumpy without this. Cant be lower because e2e will fail.
|
|
4886
|
+
,
|
|
4454
4887
|
children: plotHierarchy.map(function (plot, i) {
|
|
4455
|
-
return jsx(PlotRows, {
|
|
4888
|
+
return /*#__PURE__*/jsx(PlotRows, {
|
|
4456
4889
|
addParameter: addParameter,
|
|
4457
4890
|
deleteParameter: deleteParameter,
|
|
4458
4891
|
deletePlot: deletePlot,
|
|
@@ -4475,6 +4908,24 @@ var TimeSeriesManager = function TimeSeriesManager(_ref) {
|
|
|
4475
4908
|
});
|
|
4476
4909
|
};
|
|
4477
4910
|
|
|
4911
|
+
/* *
|
|
4912
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4913
|
+
* you may not use this file except in compliance with the License.
|
|
4914
|
+
* You may obtain a copy of the License at
|
|
4915
|
+
*
|
|
4916
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
4917
|
+
*
|
|
4918
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
4919
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
4920
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4921
|
+
* See the License for the specific language governing permissions and
|
|
4922
|
+
* limitations under the License.
|
|
4923
|
+
*
|
|
4924
|
+
* Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
4925
|
+
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
4926
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
4927
|
+
* */
|
|
4928
|
+
|
|
4478
4929
|
var ParameterInfoDialog = function ParameterInfoDialog(_ref) {
|
|
4479
4930
|
var onClose = _ref.onClose,
|
|
4480
4931
|
currentParameterInfo = _ref.currentParameterInfo,
|
|
@@ -4494,7 +4945,7 @@ var ParameterInfoDialog = function ParameterInfoDialog(_ref) {
|
|
|
4494
4945
|
dialogHeight = _ref.dialogHeight;
|
|
4495
4946
|
var _useTimeseriesTransla = useTimeseriesTranslation(),
|
|
4496
4947
|
t = _useTimeseriesTransla.t;
|
|
4497
|
-
return jsx(ToolContainerDraggable, {
|
|
4948
|
+
return /*#__PURE__*/jsx(ToolContainerDraggable, {
|
|
4498
4949
|
isOpen: isOpen,
|
|
4499
4950
|
onClose: onClose,
|
|
4500
4951
|
onMouseDown: onMouseDown,
|
|
@@ -4509,48 +4960,48 @@ var ParameterInfoDialog = function ParameterInfoDialog(_ref) {
|
|
|
4509
4960
|
height: dialogHeight != null ? dialogHeight : 650
|
|
4510
4961
|
},
|
|
4511
4962
|
title: t('timeseries-info-title'),
|
|
4512
|
-
children: jsxs(Box$1, {
|
|
4963
|
+
children: /*#__PURE__*/jsxs(Box$1, {
|
|
4513
4964
|
sx: {
|
|
4514
4965
|
padding: 2
|
|
4515
4966
|
},
|
|
4516
|
-
children: [!!currentParameterInfo.propertyLabel && jsx(ParameterInfoText$1, {
|
|
4967
|
+
children: [!!currentParameterInfo.propertyLabel && /*#__PURE__*/jsx(ParameterInfoText$1, {
|
|
4517
4968
|
label: t('timeseries-info-label'),
|
|
4518
4969
|
value: currentParameterInfo.propertyLabel
|
|
4519
|
-
}), jsx(ParameterInfoText$1, {
|
|
4970
|
+
}), /*#__PURE__*/jsx(ParameterInfoText$1, {
|
|
4520
4971
|
label: t('timeseries-info-name'),
|
|
4521
4972
|
value: currentParameterInfo.propertyName
|
|
4522
|
-
}), jsx(ParameterInfoText$1, {
|
|
4973
|
+
}), /*#__PURE__*/jsx(ParameterInfoText$1, {
|
|
4523
4974
|
label: t('timeseries-info-service'),
|
|
4524
4975
|
value: (relatedService == null ? void 0 : relatedService.name) || currentParameterInfo.serviceId
|
|
4525
|
-
}), !!relatedService && jsxs(Fragment, {
|
|
4526
|
-
children: [jsx(ParameterInfoText$1, {
|
|
4976
|
+
}), !!relatedService && /*#__PURE__*/jsxs(Fragment, {
|
|
4977
|
+
children: [/*#__PURE__*/jsx(ParameterInfoText$1, {
|
|
4527
4978
|
label: t('timeseries-info-service-url'),
|
|
4528
4979
|
value: relatedService.url
|
|
4529
|
-
}), jsx(ParameterInfoText$1, {
|
|
4980
|
+
}), /*#__PURE__*/jsx(ParameterInfoText$1, {
|
|
4530
4981
|
label: t('timeseries-info-service-description'),
|
|
4531
4982
|
value: relatedService.description
|
|
4532
|
-
}), jsx(ParameterInfoText$1, {
|
|
4983
|
+
}), /*#__PURE__*/jsx(ParameterInfoText$1, {
|
|
4533
4984
|
label: t('timeseries-info-service-type'),
|
|
4534
4985
|
value: relatedService.type
|
|
4535
4986
|
})]
|
|
4536
|
-
}), jsx(ParameterInfoText$1, {
|
|
4987
|
+
}), /*#__PURE__*/jsx(ParameterInfoText$1, {
|
|
4537
4988
|
label: t('timeseries-collection-id'),
|
|
4538
4989
|
value: currentParameterInfo.collectionId
|
|
4539
|
-
}), !!(collectionInformation != null && collectionInformation.collectionTitle) && (collectionInformation == null ? void 0 : collectionInformation.collectionTitle) !== '' && jsx(ParameterInfoText$1, {
|
|
4990
|
+
}), !!(collectionInformation != null && collectionInformation.collectionTitle) && (collectionInformation == null ? void 0 : collectionInformation.collectionTitle) !== '' && /*#__PURE__*/jsx(ParameterInfoText$1, {
|
|
4540
4991
|
label: t('timeseries-collection-title'),
|
|
4541
4992
|
value: collectionInformation == null ? void 0 : collectionInformation.collectionTitle
|
|
4542
|
-
}), !!(collectionInformation != null && collectionInformation.collectionDescription) && (collectionInformation == null ? void 0 : collectionInformation.collectionDescription) !== '' && jsx(ParameterInfoText$1, {
|
|
4993
|
+
}), !!(collectionInformation != null && collectionInformation.collectionDescription) && (collectionInformation == null ? void 0 : collectionInformation.collectionDescription) !== '' && /*#__PURE__*/jsx(ParameterInfoText$1, {
|
|
4543
4994
|
label: t('timeseries-collection-description'),
|
|
4544
4995
|
value: collectionInformation == null ? void 0 : collectionInformation.collectionDescription
|
|
4545
|
-
}), jsx(QueryInfoElement, {
|
|
4996
|
+
}), /*#__PURE__*/jsx(QueryInfoElement, {
|
|
4546
4997
|
isLoadingCollectionInformation: isLoadingCollectionInformation,
|
|
4547
4998
|
queryInformation: collectionInformation
|
|
4548
|
-
}), supportsInstances ? jsx(DimensionInfoElement, {
|
|
4999
|
+
}), supportsInstances ? /*#__PURE__*/jsx(DimensionInfoElement, {
|
|
4549
5000
|
instanceInformation: instanceInformation,
|
|
4550
5001
|
isLoading: isLoadingInstanceInformation
|
|
4551
5002
|
}) :
|
|
4552
5003
|
// If no instances, display temporal and spatial extent here
|
|
4553
|
-
collectionInformation && jsx(ParameterInfoList, {
|
|
5004
|
+
collectionInformation && /*#__PURE__*/jsx(ParameterInfoList, {
|
|
4554
5005
|
label: currentParameterInfo.collectionId,
|
|
4555
5006
|
list: generateInfoList(collectionInformation, t)
|
|
4556
5007
|
}, currentParameterInfo.collectionId)]
|
|
@@ -4560,17 +5011,17 @@ var ParameterInfoDialog = function ParameterInfoDialog(_ref) {
|
|
|
4560
5011
|
var LoadingIndicator = function LoadingIndicator(_ref2) {
|
|
4561
5012
|
var subtitle = _ref2.subtitle,
|
|
4562
5013
|
textStyle = _ref2.textStyle;
|
|
4563
|
-
return jsxs(Fragment, {
|
|
4564
|
-
children: [jsx(Typography, {
|
|
5014
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
5015
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
4565
5016
|
sx: textStyle,
|
|
4566
5017
|
variant: "subtitle2",
|
|
4567
5018
|
children: subtitle
|
|
4568
|
-
}), jsx(Box$1, {
|
|
5019
|
+
}), /*#__PURE__*/jsx(Box$1, {
|
|
4569
5020
|
sx: {
|
|
4570
5021
|
position: 'relative',
|
|
4571
5022
|
marginBottom: 3
|
|
4572
5023
|
},
|
|
4573
|
-
children: jsx(LinearProgress, {
|
|
5024
|
+
children: /*#__PURE__*/jsx(LinearProgress, {
|
|
4574
5025
|
color: "secondary",
|
|
4575
5026
|
"data-testid": "loadingIndicator",
|
|
4576
5027
|
sx: {
|
|
@@ -4588,7 +5039,7 @@ var QueryInfoElement = function QueryInfoElement(_ref3) {
|
|
|
4588
5039
|
var _useTimeseriesTransla2 = useTimeseriesTranslation(),
|
|
4589
5040
|
t = _useTimeseriesTransla2.t;
|
|
4590
5041
|
if (isLoadingCollectionInformation) {
|
|
4591
|
-
return jsx(LoadingIndicator, {
|
|
5042
|
+
return /*#__PURE__*/jsx(LoadingIndicator, {
|
|
4592
5043
|
subtitle: t('timeseries-info-queries'),
|
|
4593
5044
|
textStyle: textStyle$1
|
|
4594
5045
|
});
|
|
@@ -4598,12 +5049,12 @@ var QueryInfoElement = function QueryInfoElement(_ref3) {
|
|
|
4598
5049
|
var queries = [(dataQueries == null ? void 0 : dataQueries.locations) && 'locations', (dataQueries == null ? void 0 : dataQueries.position) && 'position'].filter(Boolean);
|
|
4599
5050
|
return queries.length === 0 ? t('timeseries-info-no-data-available') : queries.join(', ');
|
|
4600
5051
|
}();
|
|
4601
|
-
return jsxs(Fragment, {
|
|
4602
|
-
children: [jsx(Typography, {
|
|
5052
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
5053
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
4603
5054
|
sx: textStyle$1,
|
|
4604
5055
|
variant: "subtitle2",
|
|
4605
5056
|
children: t('timeseries-info-queries')
|
|
4606
|
-
}), jsx(Typography, {
|
|
5057
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
4607
5058
|
sx: textStyleWithMargin$1,
|
|
4608
5059
|
variant: "body2",
|
|
4609
5060
|
children: queryInfo
|
|
@@ -4616,7 +5067,7 @@ var generateInfoList = function generateInfoList(element, t) {
|
|
|
4616
5067
|
if ((_element$extent = element.extent) != null && (_element$extent = _element$extent.temporal) != null && _element$extent.values) {
|
|
4617
5068
|
infoList.push({
|
|
4618
5069
|
label: t('timeseries-info-time'),
|
|
4619
|
-
icon: jsx(DimensionsTime, {}),
|
|
5070
|
+
icon: /*#__PURE__*/jsx(DimensionsTime, {}),
|
|
4620
5071
|
value: element.extent.temporal.values.join(', ')
|
|
4621
5072
|
});
|
|
4622
5073
|
}
|
|
@@ -4630,7 +5081,7 @@ var generateInfoList = function generateInfoList(element, t) {
|
|
|
4630
5081
|
});
|
|
4631
5082
|
infoList.push({
|
|
4632
5083
|
label: t('timeseries-info-bbox'),
|
|
4633
|
-
icon: jsx(DrawRegion, {}),
|
|
5084
|
+
icon: /*#__PURE__*/jsx(DrawRegion, {}),
|
|
4634
5085
|
value: value === 'timeseries-info-bbox-rendering' ? bbox.join(', ') : value
|
|
4635
5086
|
});
|
|
4636
5087
|
}
|
|
@@ -4642,17 +5093,17 @@ var DimensionInfoElement = function DimensionInfoElement(_ref4) {
|
|
|
4642
5093
|
var _useTimeseriesTransla3 = useTimeseriesTranslation(),
|
|
4643
5094
|
t = _useTimeseriesTransla3.t;
|
|
4644
5095
|
if (isLoading) {
|
|
4645
|
-
return jsx(LoadingIndicator, {
|
|
5096
|
+
return /*#__PURE__*/jsx(LoadingIndicator, {
|
|
4646
5097
|
subtitle: t('timeseries-info-instance-dimensions'),
|
|
4647
5098
|
textStyle: textStyle$1
|
|
4648
5099
|
});
|
|
4649
5100
|
}
|
|
4650
|
-
return jsxs(Fragment, {
|
|
4651
|
-
children: [jsx(Typography, {
|
|
5101
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
5102
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
4652
5103
|
sx: textStyle$1,
|
|
4653
5104
|
variant: "subtitle2",
|
|
4654
5105
|
children: t('timeseries-info-instance-dimensions')
|
|
4655
|
-
}), !instanceInformation || instanceInformation.length === 0 ? jsx(Typography, {
|
|
5106
|
+
}), !instanceInformation || instanceInformation.length === 0 ? /*#__PURE__*/jsx(Typography, {
|
|
4656
5107
|
sx: textStyleWithMargin$1,
|
|
4657
5108
|
variant: "body2",
|
|
4658
5109
|
children: t('timeseries-info-no-data-available')
|
|
@@ -4660,7 +5111,7 @@ var DimensionInfoElement = function DimensionInfoElement(_ref4) {
|
|
|
4660
5111
|
// eslint-disable-next-line @typescript-eslint/require-array-sort-compare
|
|
4661
5112
|
[].concat(instanceInformation).sort().reverse().map(function (element) {
|
|
4662
5113
|
var infoList = generateInfoList(element, t);
|
|
4663
|
-
return jsx(ParameterInfoList, {
|
|
5114
|
+
return /*#__PURE__*/jsx(ParameterInfoList, {
|
|
4664
5115
|
label: element.id,
|
|
4665
5116
|
list: infoList
|
|
4666
5117
|
}, element.id);
|
|
@@ -4677,12 +5128,12 @@ var textStyleWithMargin$1 = Object.assign({}, textStyle$1, {
|
|
|
4677
5128
|
var ParameterInfoText$1 = function ParameterInfoText(_ref5) {
|
|
4678
5129
|
var label = _ref5.label,
|
|
4679
5130
|
value = _ref5.value;
|
|
4680
|
-
return jsxs(Fragment, {
|
|
4681
|
-
children: [jsx(Typography, {
|
|
5131
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
5132
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
4682
5133
|
sx: textStyle$1,
|
|
4683
5134
|
variant: "subtitle2",
|
|
4684
5135
|
children: label
|
|
4685
|
-
}), jsx(Typography, {
|
|
5136
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
4686
5137
|
sx: textStyleWithMargin$1,
|
|
4687
5138
|
variant: "body2",
|
|
4688
5139
|
children: value
|
|
@@ -4695,41 +5146,41 @@ var valueStyle = Object.assign({}, textStyle$1, {
|
|
|
4695
5146
|
var ParameterInfoList = function ParameterInfoList(_ref6) {
|
|
4696
5147
|
var label = _ref6.label,
|
|
4697
5148
|
list = _ref6.list;
|
|
4698
|
-
return jsxs(Fragment, {
|
|
4699
|
-
children: [jsx(Typography, {
|
|
5149
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
5150
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
4700
5151
|
sx: textStyle$1,
|
|
4701
5152
|
variant: "subtitle2",
|
|
4702
5153
|
children: label
|
|
4703
|
-
}), list.length === 0 ? jsx(Typography, {
|
|
5154
|
+
}), list.length === 0 ? /*#__PURE__*/jsx(Typography, {
|
|
4704
5155
|
sx: textStyleWithMargin$1,
|
|
4705
5156
|
variant: "body2",
|
|
4706
5157
|
children: "-"
|
|
4707
|
-
}) : jsx(Grid, {
|
|
5158
|
+
}) : /*#__PURE__*/jsx(Grid, {
|
|
4708
5159
|
container: true,
|
|
4709
5160
|
direction: "column",
|
|
4710
5161
|
children: list.map(function (item) {
|
|
4711
|
-
return jsxs("div", {
|
|
4712
|
-
children: [jsxs(Grid, {
|
|
5162
|
+
return /*#__PURE__*/jsxs("div", {
|
|
5163
|
+
children: [/*#__PURE__*/jsxs(Grid, {
|
|
4713
5164
|
container: true,
|
|
4714
5165
|
direction: "row",
|
|
4715
|
-
children: [item.icon, jsx(Grid, {
|
|
5166
|
+
children: [item.icon, /*#__PURE__*/jsx(Grid, {
|
|
4716
5167
|
sx: {
|
|
4717
5168
|
marginLeft: '10px'
|
|
4718
5169
|
},
|
|
4719
|
-
children: jsxs(Typography, {
|
|
5170
|
+
children: /*#__PURE__*/jsxs(Typography, {
|
|
4720
5171
|
sx: textStyle$1,
|
|
4721
5172
|
variant: "body2",
|
|
4722
5173
|
children: [item.label, ":"]
|
|
4723
5174
|
})
|
|
4724
5175
|
})]
|
|
4725
|
-
}), jsx(Grid, {
|
|
5176
|
+
}), /*#__PURE__*/jsx(Grid, {
|
|
4726
5177
|
container: true,
|
|
4727
5178
|
direction: "row",
|
|
4728
5179
|
sx: {
|
|
4729
5180
|
marginBottom: 1,
|
|
4730
5181
|
paddingLeft: '34px'
|
|
4731
5182
|
},
|
|
4732
|
-
children: jsx(Typography, {
|
|
5183
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
4733
5184
|
sx: valueStyle,
|
|
4734
5185
|
variant: "body2",
|
|
4735
5186
|
children: item.value
|
|
@@ -4741,6 +5192,24 @@ var ParameterInfoList = function ParameterInfoList(_ref6) {
|
|
|
4741
5192
|
});
|
|
4742
5193
|
};
|
|
4743
5194
|
|
|
5195
|
+
/* *
|
|
5196
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5197
|
+
* you may not use this file except in compliance with the License.
|
|
5198
|
+
* You may obtain a copy of the License at
|
|
5199
|
+
*
|
|
5200
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
5201
|
+
*
|
|
5202
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
5203
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
5204
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
5205
|
+
* See the License for the specific language governing permissions and
|
|
5206
|
+
* limitations under the License.
|
|
5207
|
+
*
|
|
5208
|
+
* Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
5209
|
+
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
5210
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
5211
|
+
* */
|
|
5212
|
+
|
|
4744
5213
|
var ParameterInfoDialogConnect = function ParameterInfoDialogConnect() {
|
|
4745
5214
|
var _collection$dataQueri;
|
|
4746
5215
|
var panelId = useSelector(function (store) {
|
|
@@ -4770,7 +5239,7 @@ var ParameterInfoDialogConnect = function ParameterInfoDialogConnect() {
|
|
|
4770
5239
|
if (!currentParameterInfoDisplayed) {
|
|
4771
5240
|
return null;
|
|
4772
5241
|
}
|
|
4773
|
-
return jsx(ParameterInfoDialog, {
|
|
5242
|
+
return /*#__PURE__*/jsx(ParameterInfoDialog, {
|
|
4774
5243
|
collectionInformation: collection,
|
|
4775
5244
|
currentParameterInfo: currentParameterInfoDisplayed,
|
|
4776
5245
|
instanceInformation: instances,
|
|
@@ -4786,6 +5255,24 @@ var ParameterInfoDialogConnect = function ParameterInfoDialogConnect() {
|
|
|
4786
5255
|
});
|
|
4787
5256
|
};
|
|
4788
5257
|
|
|
5258
|
+
/* *
|
|
5259
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5260
|
+
* you may not use this file except in compliance with the License.
|
|
5261
|
+
* You may obtain a copy of the License at
|
|
5262
|
+
*
|
|
5263
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
5264
|
+
*
|
|
5265
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
5266
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
5267
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
5268
|
+
* See the License for the specific language governing permissions and
|
|
5269
|
+
* limitations under the License.
|
|
5270
|
+
*
|
|
5271
|
+
* Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
5272
|
+
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
5273
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
5274
|
+
* */
|
|
5275
|
+
|
|
4789
5276
|
var sortByService$1 = function sortByService(serviceObj) {
|
|
4790
5277
|
// Need to make a copy as we are not allowed to mutate the original serviceObj and .sort mutates
|
|
4791
5278
|
var newServiceObj = serviceObj.slice();
|
|
@@ -4845,7 +5332,7 @@ var ServiceOptionsDialog = function ServiceOptionsDialog(_ref) {
|
|
|
4845
5332
|
(_dialogRef$current = dialogRef.current) == null || _dialogRef$current.focus();
|
|
4846
5333
|
}, []);
|
|
4847
5334
|
if (!services || services.length === 0) {
|
|
4848
|
-
return jsx(Box, {
|
|
5335
|
+
return /*#__PURE__*/jsx(Box, {
|
|
4849
5336
|
onKeyDown: function onKeyDown(event) {
|
|
4850
5337
|
if (event.key !== 'Escape') {
|
|
4851
5338
|
event.stopPropagation();
|
|
@@ -4861,7 +5348,7 @@ var ServiceOptionsDialog = function ServiceOptionsDialog(_ref) {
|
|
|
4861
5348
|
children: t('timeseries-no-services')
|
|
4862
5349
|
});
|
|
4863
5350
|
}
|
|
4864
|
-
return jsxs(Box, {
|
|
5351
|
+
return /*#__PURE__*/jsxs(Box, {
|
|
4865
5352
|
"aria-label": t('timeseries-services-options'),
|
|
4866
5353
|
onKeyDown: function onKeyDown(event) {
|
|
4867
5354
|
if (event.key !== 'Escape') {
|
|
@@ -4871,21 +5358,21 @@ var ServiceOptionsDialog = function ServiceOptionsDialog(_ref) {
|
|
|
4871
5358
|
ref: dialogRef,
|
|
4872
5359
|
sx: styles.servicesContainer,
|
|
4873
5360
|
tabIndex: -1,
|
|
4874
|
-
children: [jsx(Box, {
|
|
5361
|
+
children: [/*#__PURE__*/jsx(Box, {
|
|
4875
5362
|
sx: styles.header,
|
|
4876
5363
|
children: t('timeseries-services')
|
|
4877
|
-
}), jsx(Rows, {
|
|
5364
|
+
}), /*#__PURE__*/jsx(Rows, {
|
|
4878
5365
|
openServicePopup: openServicePopup,
|
|
4879
5366
|
parametersInUse: parametersInUse,
|
|
4880
5367
|
removeService: removeService,
|
|
4881
5368
|
services: services
|
|
4882
|
-
}), jsx(Box, {
|
|
5369
|
+
}), /*#__PURE__*/jsx(Box, {
|
|
4883
5370
|
sx: styles.footer,
|
|
4884
|
-
children: jsx(Button, {
|
|
5371
|
+
children: /*#__PURE__*/jsx(Button, {
|
|
4885
5372
|
"data-testid": "add-new-ts-service",
|
|
4886
5373
|
onClick: openNewServicePopup,
|
|
4887
5374
|
onKeyDown: stopTabPropagation,
|
|
4888
|
-
startIcon: jsx(Add, {}),
|
|
5375
|
+
startIcon: /*#__PURE__*/jsx(Add, {}),
|
|
4889
5376
|
sx: styles.button,
|
|
4890
5377
|
variant: "tertiary",
|
|
4891
5378
|
children: t('timeseries-add-service')
|
|
@@ -4920,7 +5407,7 @@ var Rows = function Rows(_ref2) {
|
|
|
4920
5407
|
var sortedServices = sortByService$1(services);
|
|
4921
5408
|
var _useTimeseriesTransla2 = useTimeseriesTranslation(),
|
|
4922
5409
|
t = _useTimeseriesTransla2.t;
|
|
4923
|
-
return jsx(List, {
|
|
5410
|
+
return /*#__PURE__*/jsx(List, {
|
|
4924
5411
|
disablePadding: true,
|
|
4925
5412
|
children: sortedServices.map(function (service) {
|
|
4926
5413
|
var url = service.url,
|
|
@@ -4932,8 +5419,8 @@ var Rows = function Rows(_ref2) {
|
|
|
4932
5419
|
var openDialog = function openDialog() {
|
|
4933
5420
|
return openServicePopup(userAddedService ? 'edit' : 'show', id, url);
|
|
4934
5421
|
};
|
|
4935
|
-
return jsx(ListItem, {
|
|
4936
|
-
secondaryAction: jsxs(Grid, {
|
|
5422
|
+
return /*#__PURE__*/jsx(ListItem, {
|
|
5423
|
+
secondaryAction: /*#__PURE__*/jsxs(Grid, {
|
|
4937
5424
|
container: true,
|
|
4938
5425
|
justifyContent: "left",
|
|
4939
5426
|
sx: {
|
|
@@ -4943,60 +5430,60 @@ var Rows = function Rows(_ref2) {
|
|
|
4943
5430
|
marginLeft: 1
|
|
4944
5431
|
}
|
|
4945
5432
|
},
|
|
4946
|
-
children: [jsx(CustomTooltip, {
|
|
5433
|
+
children: [/*#__PURE__*/jsx(CustomTooltip, {
|
|
4947
5434
|
placement: "left",
|
|
4948
5435
|
slotProps: {
|
|
4949
5436
|
popper: tooltipPopperProps
|
|
4950
5437
|
},
|
|
4951
5438
|
title: t('timeseries-update-service'),
|
|
4952
|
-
children: jsx("span", {
|
|
4953
|
-
children: jsx(CustomIconButton, {
|
|
5439
|
+
children: /*#__PURE__*/jsx("span", {
|
|
5440
|
+
children: /*#__PURE__*/jsx(CustomIconButton, {
|
|
4954
5441
|
"aria-label": t('timeseries-update-service'),
|
|
4955
5442
|
disabled: true,
|
|
4956
5443
|
onClick: function onClick() {},
|
|
4957
5444
|
onKeyDown: stopTabPropagation,
|
|
4958
|
-
children: jsx(Cached, {})
|
|
5445
|
+
children: /*#__PURE__*/jsx(Cached, {})
|
|
4959
5446
|
})
|
|
4960
5447
|
})
|
|
4961
|
-
}), userAddedService ? jsx(CustomTooltip, {
|
|
5448
|
+
}), userAddedService ? /*#__PURE__*/jsx(CustomTooltip, {
|
|
4962
5449
|
placement: "left",
|
|
4963
5450
|
slotProps: {
|
|
4964
5451
|
popper: tooltipPopperProps
|
|
4965
5452
|
},
|
|
4966
5453
|
title: t('timeseries-edit-service'),
|
|
4967
|
-
children: jsx("span", {
|
|
4968
|
-
children: jsx(CustomIconButton, {
|
|
5454
|
+
children: /*#__PURE__*/jsx("span", {
|
|
5455
|
+
children: /*#__PURE__*/jsx(CustomIconButton, {
|
|
4969
5456
|
"aria-label": t('timeseries-edit-service'),
|
|
4970
5457
|
"data-testid": "edit-button-" + id,
|
|
4971
5458
|
onClick: openDialog,
|
|
4972
5459
|
onKeyDown: stopTabPropagation,
|
|
4973
|
-
children: jsx(Edit, {})
|
|
5460
|
+
children: /*#__PURE__*/jsx(Edit, {})
|
|
4974
5461
|
})
|
|
4975
5462
|
})
|
|
4976
|
-
}) : jsx(CustomTooltip, {
|
|
5463
|
+
}) : /*#__PURE__*/jsx(CustomTooltip, {
|
|
4977
5464
|
placement: "left",
|
|
4978
5465
|
slotProps: {
|
|
4979
5466
|
popper: tooltipPopperProps
|
|
4980
5467
|
},
|
|
4981
5468
|
title: t('timeseries-show-service'),
|
|
4982
|
-
children: jsx("span", {
|
|
4983
|
-
children: jsx(CustomIconButton, {
|
|
5469
|
+
children: /*#__PURE__*/jsx("span", {
|
|
5470
|
+
children: /*#__PURE__*/jsx(CustomIconButton, {
|
|
4984
5471
|
"aria-label": t('timeseries-show-service'),
|
|
4985
5472
|
"data-testid": "show-button-" + id,
|
|
4986
5473
|
onClick: openDialog,
|
|
4987
5474
|
onKeyDown: stopTabPropagation,
|
|
4988
|
-
children: jsx(Visibility, {})
|
|
5475
|
+
children: /*#__PURE__*/jsx(Visibility, {})
|
|
4989
5476
|
})
|
|
4990
5477
|
})
|
|
4991
|
-
}), !!userAddedService && jsx(Box, {
|
|
4992
|
-
children: jsx(CustomTooltip, {
|
|
5478
|
+
}), !!userAddedService && /*#__PURE__*/jsx(Box, {
|
|
5479
|
+
children: /*#__PURE__*/jsx(CustomTooltip, {
|
|
4993
5480
|
placement: "left",
|
|
4994
5481
|
slotProps: {
|
|
4995
5482
|
popper: tooltipPopperProps
|
|
4996
5483
|
},
|
|
4997
5484
|
title: deleteServiceTitle(serviceHasParametersInUse, t),
|
|
4998
|
-
children: jsx("span", {
|
|
4999
|
-
children: jsx(CustomIconButton, {
|
|
5485
|
+
children: /*#__PURE__*/jsx("span", {
|
|
5486
|
+
children: /*#__PURE__*/jsx(CustomIconButton, {
|
|
5000
5487
|
"aria-label": t('timeseries-delete-service'),
|
|
5001
5488
|
"data-testid": "remove-button-" + id,
|
|
5002
5489
|
disabled: serviceHasParametersInUse,
|
|
@@ -5006,17 +5493,17 @@ var Rows = function Rows(_ref2) {
|
|
|
5006
5493
|
}));
|
|
5007
5494
|
},
|
|
5008
5495
|
onKeyDown: stopTabPropagation,
|
|
5009
|
-
children: jsx(Delete, {})
|
|
5496
|
+
children: /*#__PURE__*/jsx(Delete, {})
|
|
5010
5497
|
})
|
|
5011
5498
|
})
|
|
5012
5499
|
})
|
|
5013
5500
|
})]
|
|
5014
5501
|
}),
|
|
5015
|
-
children: jsx(ListItemText, {
|
|
5502
|
+
children: /*#__PURE__*/jsx(ListItemText, {
|
|
5016
5503
|
style: {
|
|
5017
5504
|
fontSize: '16px'
|
|
5018
5505
|
},
|
|
5019
|
-
children: jsx(Typography, {
|
|
5506
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
5020
5507
|
noWrap: true,
|
|
5021
5508
|
style: {
|
|
5022
5509
|
textOverflow: 'ellipsis',
|
|
@@ -5030,6 +5517,24 @@ var Rows = function Rows(_ref2) {
|
|
|
5030
5517
|
});
|
|
5031
5518
|
};
|
|
5032
5519
|
|
|
5520
|
+
/* *
|
|
5521
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5522
|
+
* you may not use this file except in compliance with the License.
|
|
5523
|
+
* You may obtain a copy of the License at
|
|
5524
|
+
*
|
|
5525
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
5526
|
+
*
|
|
5527
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
5528
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
5529
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
5530
|
+
* See the License for the specific language governing permissions and
|
|
5531
|
+
* limitations under the License.
|
|
5532
|
+
*
|
|
5533
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
5534
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
5535
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
5536
|
+
* */
|
|
5537
|
+
|
|
5033
5538
|
var ServiceOptionsButtonConnect = function ServiceOptionsButtonConnect(_ref) {
|
|
5034
5539
|
var panelId = _ref.panelId;
|
|
5035
5540
|
var dispatch = useDispatch();
|
|
@@ -5067,9 +5572,9 @@ var ServiceOptionsButtonConnect = function ServiceOptionsButtonConnect(_ref) {
|
|
|
5067
5572
|
}));
|
|
5068
5573
|
}
|
|
5069
5574
|
}, [dispatch, panelId]);
|
|
5070
|
-
return jsx(ToggleMenu, {
|
|
5575
|
+
return /*#__PURE__*/jsx(ToggleMenu, {
|
|
5071
5576
|
menuPosition: "bottom",
|
|
5072
|
-
children: jsx(ServiceOptionsDialog, {
|
|
5577
|
+
children: /*#__PURE__*/jsx(ServiceOptionsDialog, {
|
|
5073
5578
|
openNewServicePopup: openNewServicePopup,
|
|
5074
5579
|
openServicePopup: openServicePopup,
|
|
5075
5580
|
parametersInUse: parametersInUse,
|
|
@@ -5096,6 +5601,7 @@ var ServiceOptionsButtonConnect = function ServiceOptionsButtonConnect(_ref) {
|
|
|
5096
5601
|
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
5097
5602
|
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
5098
5603
|
* */
|
|
5604
|
+
|
|
5099
5605
|
var validateServiceName = function validateServiceName(value, services, ownServiceName) {
|
|
5100
5606
|
if (ownServiceName === void 0) {
|
|
5101
5607
|
ownServiceName = '';
|
|
@@ -5345,16 +5851,16 @@ var ServicePopupUnwrapped = function ServicePopupUnwrapped(_ref2) {
|
|
|
5345
5851
|
var isShowPopup = servicePopupVariant === 'show';
|
|
5346
5852
|
var isServiceUrlDisabled = isShowPopup || servicePopupVariant === 'edit';
|
|
5347
5853
|
//
|
|
5348
|
-
return jsxs(CustomDialog, {
|
|
5349
|
-
actions: isShowPopup ? jsx(Button, {
|
|
5854
|
+
return /*#__PURE__*/jsxs(CustomDialog, {
|
|
5855
|
+
actions: isShowPopup ? /*#__PURE__*/jsx(Button, {
|
|
5350
5856
|
onClick: closePopup,
|
|
5351
5857
|
sx: {
|
|
5352
5858
|
width: '117px'
|
|
5353
5859
|
},
|
|
5354
5860
|
variant: "tertiary",
|
|
5355
5861
|
children: t('timeseries-close')
|
|
5356
|
-
}) : jsxs(Fragment, {
|
|
5357
|
-
children: [jsx(Button, {
|
|
5862
|
+
}) : /*#__PURE__*/jsxs(Fragment, {
|
|
5863
|
+
children: [/*#__PURE__*/jsx(Button, {
|
|
5358
5864
|
"data-testid": "closePopupButtonCancel",
|
|
5359
5865
|
onClick: closePopup,
|
|
5360
5866
|
sx: {
|
|
@@ -5362,7 +5868,7 @@ var ServicePopupUnwrapped = function ServicePopupUnwrapped(_ref2) {
|
|
|
5362
5868
|
},
|
|
5363
5869
|
variant: "tertiary",
|
|
5364
5870
|
children: t('timeseries-cancel')
|
|
5365
|
-
}), jsx(Button, {
|
|
5871
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
5366
5872
|
"data-testid": "saveServiceButton",
|
|
5367
5873
|
disabled: isSubmitDisabled || isLoading,
|
|
5368
5874
|
form: "timeseriesServicePopupForm",
|
|
@@ -5382,11 +5888,11 @@ var ServicePopupUnwrapped = function ServicePopupUnwrapped(_ref2) {
|
|
|
5382
5888
|
onClose: closePopup,
|
|
5383
5889
|
open: isOpen,
|
|
5384
5890
|
title: t(getTranslationIdForVariant(servicePopupVariant)),
|
|
5385
|
-
children: [!!isLoading && jsx(Box, {
|
|
5891
|
+
children: [!!isLoading && /*#__PURE__*/jsx(Box, {
|
|
5386
5892
|
sx: {
|
|
5387
5893
|
position: 'relative'
|
|
5388
5894
|
},
|
|
5389
|
-
children: jsx(LinearProgress, {
|
|
5895
|
+
children: /*#__PURE__*/jsx(LinearProgress, {
|
|
5390
5896
|
color: "secondary",
|
|
5391
5897
|
"data-testid": "loadingIndicator",
|
|
5392
5898
|
sx: {
|
|
@@ -5394,7 +5900,7 @@ var ServicePopupUnwrapped = function ServicePopupUnwrapped(_ref2) {
|
|
|
5394
5900
|
width: '100%'
|
|
5395
5901
|
}
|
|
5396
5902
|
})
|
|
5397
|
-
}), jsxs("form", {
|
|
5903
|
+
}), /*#__PURE__*/jsxs("form", {
|
|
5398
5904
|
id: "timeseriesServicePopupForm",
|
|
5399
5905
|
onSubmit: handleSubmit(/*#__PURE__*/function () {
|
|
5400
5906
|
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(formValues) {
|
|
@@ -5412,15 +5918,15 @@ var ServicePopupUnwrapped = function ServicePopupUnwrapped(_ref2) {
|
|
|
5412
5918
|
return _ref4.apply(this, arguments);
|
|
5413
5919
|
};
|
|
5414
5920
|
}()),
|
|
5415
|
-
children: [jsx(ReactHookFormTextField, {
|
|
5921
|
+
children: [/*#__PURE__*/jsx(ReactHookFormTextField, {
|
|
5416
5922
|
autoFocus: !shouldDisableAutoFocus,
|
|
5417
5923
|
defaultValue: serviceUrl,
|
|
5418
5924
|
disabled: isServiceUrlDisabled || isLoading,
|
|
5419
5925
|
inputSlotProps: {
|
|
5420
5926
|
disableUnderline: isShowPopup,
|
|
5421
|
-
endAdornment: isShowPopup && jsx(InputAdornment, {
|
|
5927
|
+
endAdornment: isShowPopup && /*#__PURE__*/jsx(InputAdornment, {
|
|
5422
5928
|
position: "end",
|
|
5423
|
-
children: jsx(CustomIconButton, {
|
|
5929
|
+
children: /*#__PURE__*/jsx(CustomIconButton, {
|
|
5424
5930
|
"aria-label": t('timeseries-service-url-copy'),
|
|
5425
5931
|
onClick: function onClick() {
|
|
5426
5932
|
void navigator.clipboard.writeText(serviceUrl);
|
|
@@ -5429,7 +5935,7 @@ var ServicePopupUnwrapped = function ServicePopupUnwrapped(_ref2) {
|
|
|
5429
5935
|
sx: {
|
|
5430
5936
|
marginTop: 0.5
|
|
5431
5937
|
},
|
|
5432
|
-
children: jsx(Copy, {})
|
|
5938
|
+
children: /*#__PURE__*/jsx(Copy, {})
|
|
5433
5939
|
})
|
|
5434
5940
|
})
|
|
5435
5941
|
},
|
|
@@ -5446,7 +5952,7 @@ var ServicePopupUnwrapped = function ServicePopupUnwrapped(_ref2) {
|
|
|
5446
5952
|
})
|
|
5447
5953
|
},
|
|
5448
5954
|
sx: style$1.textField
|
|
5449
|
-
}), jsx(ReactHookFormTextField, {
|
|
5955
|
+
}), /*#__PURE__*/jsx(ReactHookFormTextField, {
|
|
5450
5956
|
defaultValue: serviceName,
|
|
5451
5957
|
disabled: isShowPopup || isLoading,
|
|
5452
5958
|
inputSlotProps: {
|
|
@@ -5462,7 +5968,7 @@ var ServicePopupUnwrapped = function ServicePopupUnwrapped(_ref2) {
|
|
|
5462
5968
|
}
|
|
5463
5969
|
},
|
|
5464
5970
|
sx: style$1.textField
|
|
5465
|
-
}), jsx(ReactHookFormTextField, {
|
|
5971
|
+
}), /*#__PURE__*/jsx(ReactHookFormTextField, {
|
|
5466
5972
|
defaultValue: serviceDescription || '',
|
|
5467
5973
|
disabled: isShowPopup || isLoading,
|
|
5468
5974
|
helperText: !isShowPopup ? t('timeseries-description-helper-text') : '',
|
|
@@ -5475,7 +5981,7 @@ var ServicePopupUnwrapped = function ServicePopupUnwrapped(_ref2) {
|
|
|
5475
5981
|
name: fields.serviceDescription.name,
|
|
5476
5982
|
rows: 4,
|
|
5477
5983
|
sx: style$1.textField
|
|
5478
|
-
}), jsx(ReactHookFormSelect, {
|
|
5984
|
+
}), /*#__PURE__*/jsx(ReactHookFormSelect, {
|
|
5479
5985
|
defaultValue: serviceType || 'EDR',
|
|
5480
5986
|
disabled: true,
|
|
5481
5987
|
isReadOnly: isShowPopup,
|
|
@@ -5484,11 +5990,11 @@ var ServicePopupUnwrapped = function ServicePopupUnwrapped(_ref2) {
|
|
|
5484
5990
|
rules: {
|
|
5485
5991
|
required: true
|
|
5486
5992
|
},
|
|
5487
|
-
children: jsx(MenuItem, {
|
|
5993
|
+
children: /*#__PURE__*/jsx(MenuItem, {
|
|
5488
5994
|
value: "EDR",
|
|
5489
5995
|
children: "EDR"
|
|
5490
5996
|
})
|
|
5491
|
-
}), !isServiceUrlDisabled && jsx(InitialValidationsTrigger, {
|
|
5997
|
+
}), !isServiceUrlDisabled && /*#__PURE__*/jsx(InitialValidationsTrigger, {
|
|
5492
5998
|
getValues: getValues,
|
|
5493
5999
|
onValidField: onBlurServiceUrl,
|
|
5494
6000
|
trigger: trigger
|
|
@@ -5501,7 +6007,7 @@ var ServicePopup = function ServicePopup(props) {
|
|
|
5501
6007
|
serviceName = props.serviceName,
|
|
5502
6008
|
serviceDescription = props.serviceDescription,
|
|
5503
6009
|
serviceType = props.serviceType;
|
|
5504
|
-
return jsx(ReactHookFormProvider, {
|
|
6010
|
+
return /*#__PURE__*/jsx(ReactHookFormProvider, {
|
|
5505
6011
|
options: Object.assign({}, defaultFormOptions, {
|
|
5506
6012
|
defaultValues: {
|
|
5507
6013
|
serviceUrl: serviceUrl,
|
|
@@ -5510,10 +6016,28 @@ var ServicePopup = function ServicePopup(props) {
|
|
|
5510
6016
|
serviceType: serviceType
|
|
5511
6017
|
}
|
|
5512
6018
|
}),
|
|
5513
|
-
children: jsx(ServicePopupUnwrapped, Object.assign({}, props))
|
|
6019
|
+
children: /*#__PURE__*/jsx(ServicePopupUnwrapped, Object.assign({}, props))
|
|
5514
6020
|
});
|
|
5515
6021
|
};
|
|
5516
6022
|
|
|
6023
|
+
/* *
|
|
6024
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6025
|
+
* you may not use this file except in compliance with the License.
|
|
6026
|
+
* You may obtain a copy of the License at
|
|
6027
|
+
*
|
|
6028
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
6029
|
+
*
|
|
6030
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
6031
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
6032
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6033
|
+
* See the License for the specific language governing permissions and
|
|
6034
|
+
* limitations under the License.
|
|
6035
|
+
*
|
|
6036
|
+
* Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6037
|
+
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
6038
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
6039
|
+
* */
|
|
6040
|
+
|
|
5517
6041
|
// Extracted from ServicePopupConnect as the getActiveServices and getActiveServiceById selectors
|
|
5518
6042
|
// Result in many rerenders. By extracting we're able to only render this component and these selectors
|
|
5519
6043
|
// when the dialog is open
|
|
@@ -5549,7 +6073,7 @@ var ServicePopupDialogConnect = function ServicePopupDialogConnect(_ref) {
|
|
|
5549
6073
|
message: message
|
|
5550
6074
|
}));
|
|
5551
6075
|
}, [dispatch]);
|
|
5552
|
-
return jsx(ServicePopup, {
|
|
6076
|
+
return /*#__PURE__*/jsx(ServicePopup, {
|
|
5553
6077
|
closePopup: setServicePopupClosed,
|
|
5554
6078
|
isOpen: isOpen,
|
|
5555
6079
|
serviceDescription: activeService == null ? void 0 : activeService.description,
|
|
@@ -5562,6 +6086,24 @@ var ServicePopupDialogConnect = function ServicePopupDialogConnect(_ref) {
|
|
|
5562
6086
|
});
|
|
5563
6087
|
};
|
|
5564
6088
|
|
|
6089
|
+
/* *
|
|
6090
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6091
|
+
* you may not use this file except in compliance with the License.
|
|
6092
|
+
* You may obtain a copy of the License at
|
|
6093
|
+
*
|
|
6094
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
6095
|
+
*
|
|
6096
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
6097
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
6098
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6099
|
+
* See the License for the specific language governing permissions and
|
|
6100
|
+
* limitations under the License.
|
|
6101
|
+
*
|
|
6102
|
+
* Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6103
|
+
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
6104
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
6105
|
+
* */
|
|
6106
|
+
|
|
5565
6107
|
var ServicePopupConnect = function ServicePopupConnect(_ref) {
|
|
5566
6108
|
var panelId = _ref.panelId;
|
|
5567
6109
|
var dispatch = useDispatch();
|
|
@@ -5580,7 +6122,7 @@ var ServicePopupConnect = function ServicePopupConnect(_ref) {
|
|
|
5580
6122
|
if (!isOpen) {
|
|
5581
6123
|
return null;
|
|
5582
6124
|
}
|
|
5583
|
-
return jsx(ServicePopupDialogConnect, {
|
|
6125
|
+
return /*#__PURE__*/jsx(ServicePopupDialogConnect, {
|
|
5584
6126
|
isOpen: isOpen,
|
|
5585
6127
|
panelId: panelId,
|
|
5586
6128
|
serviceId: serviceId,
|
|
@@ -5590,14 +6132,32 @@ var ServicePopupConnect = function ServicePopupConnect(_ref) {
|
|
|
5590
6132
|
});
|
|
5591
6133
|
};
|
|
5592
6134
|
|
|
5593
|
-
|
|
5594
|
-
|
|
5595
|
-
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
|
|
5599
|
-
|
|
5600
|
-
|
|
6135
|
+
/* *
|
|
6136
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6137
|
+
* you may not use this file except in compliance with the License.
|
|
6138
|
+
* You may obtain a copy of the License at
|
|
6139
|
+
*
|
|
6140
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
6141
|
+
*
|
|
6142
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
6143
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
6144
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6145
|
+
* See the License for the specific language governing permissions and
|
|
6146
|
+
* limitations under the License.
|
|
6147
|
+
*
|
|
6148
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6149
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
6150
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
6151
|
+
* */
|
|
6152
|
+
|
|
6153
|
+
var SearchFieldConnect = function SearchFieldConnect(_ref) {
|
|
6154
|
+
var panelId = _ref.panelId;
|
|
6155
|
+
var dispatch = useDispatch();
|
|
6156
|
+
var _useTimeseriesTransla = useTimeseriesTranslation(),
|
|
6157
|
+
t = _useTimeseriesTransla.t;
|
|
6158
|
+
var searchFilter = useSelector(function (state) {
|
|
6159
|
+
return getSearchFilter(state, panelId);
|
|
6160
|
+
});
|
|
5601
6161
|
var toggleServicePopup = function toggleServicePopup(url) {
|
|
5602
6162
|
dispatch(timeSeriesActions.setServicePopup({
|
|
5603
6163
|
panelId: panelId,
|
|
@@ -5612,7 +6172,7 @@ var SearchFieldConnect = function SearchFieldConnect(_ref) {
|
|
|
5612
6172
|
panelId: panelId
|
|
5613
6173
|
}));
|
|
5614
6174
|
};
|
|
5615
|
-
return jsx(SearchField, {
|
|
6175
|
+
return /*#__PURE__*/jsx(SearchField, {
|
|
5616
6176
|
label: t('timeseries-search-ts-or-enter-url'),
|
|
5617
6177
|
onOpenServicePopup: toggleServicePopup,
|
|
5618
6178
|
searchFilter: searchFilter,
|
|
@@ -5637,6 +6197,7 @@ var SearchFieldConnect = function SearchFieldConnect(_ref) {
|
|
|
5637
6197
|
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
5638
6198
|
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
5639
6199
|
* */
|
|
6200
|
+
|
|
5640
6201
|
var filterCollectionsParametersFromService = function filterCollectionsParametersFromService(collectionList, searchString, serviceFilterChips, allFilterChipsEnabled) {
|
|
5641
6202
|
// If no search string and all filterchips are enabled, simply return the same list
|
|
5642
6203
|
if (searchString === '' && allFilterChipsEnabled) {
|
|
@@ -5657,6 +6218,7 @@ var filterCollectionsParametersFromService = function filterCollectionsParameter
|
|
|
5657
6218
|
var isSearchTextInServiceName = (_collection$serviceNa = collection.serviceName) == null ? void 0 : _collection$serviceNa.toLowerCase().includes(searchLowercase);
|
|
5658
6219
|
return isSearchTextInCollectionId || isSearchTextInCollectionTitle || isSearchTextInServiceId || isSearchTextInServiceName;
|
|
5659
6220
|
});
|
|
6221
|
+
|
|
5660
6222
|
// Not found in collection - search in parameters
|
|
5661
6223
|
var filteredParamters = collection.parameters.reduce(function (filteredParameterList, parameter) {
|
|
5662
6224
|
var parameterContainsSearch = searchStringArray.every(function (search) {
|
|
@@ -5680,6 +6242,24 @@ var filterCollectionsParametersFromService = function filterCollectionsParameter
|
|
|
5680
6242
|
}, []);
|
|
5681
6243
|
};
|
|
5682
6244
|
|
|
6245
|
+
/* *
|
|
6246
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6247
|
+
* you may not use this file except in compliance with the License.
|
|
6248
|
+
* You may obtain a copy of the License at
|
|
6249
|
+
*
|
|
6250
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
6251
|
+
*
|
|
6252
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
6253
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
6254
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6255
|
+
* See the License for the specific language governing permissions and
|
|
6256
|
+
* limitations under the License.
|
|
6257
|
+
*
|
|
6258
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6259
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
6260
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
6261
|
+
* */
|
|
6262
|
+
|
|
5683
6263
|
var RowComponent$1 = function RowComponent(_ref) {
|
|
5684
6264
|
var index = _ref.index,
|
|
5685
6265
|
style = _ref.style,
|
|
@@ -5693,9 +6273,9 @@ var RowComponent$1 = function RowComponent(_ref) {
|
|
|
5693
6273
|
t = _ref.t;
|
|
5694
6274
|
var collectionListItem = filteredCollectionList[index];
|
|
5695
6275
|
var collectionId = collectionListItem.collectionId;
|
|
5696
|
-
return jsxs(Box, {
|
|
6276
|
+
return /*#__PURE__*/jsxs(Box, {
|
|
5697
6277
|
style: style,
|
|
5698
|
-
children: [jsx(ListItem, {
|
|
6278
|
+
children: [/*#__PURE__*/jsx(ListItem, {
|
|
5699
6279
|
sx: {
|
|
5700
6280
|
backgroundColor: 'geowebColors.cards.cardContainer',
|
|
5701
6281
|
height: '44px',
|
|
@@ -5714,7 +6294,7 @@ var RowComponent$1 = function RowComponent(_ref) {
|
|
|
5714
6294
|
overflow: 'hidden'
|
|
5715
6295
|
}
|
|
5716
6296
|
},
|
|
5717
|
-
children: jsxs(ListItemButton, {
|
|
6297
|
+
children: /*#__PURE__*/jsxs(ListItemButton, {
|
|
5718
6298
|
onClick: function onClick() {
|
|
5719
6299
|
var _Object$assign;
|
|
5720
6300
|
var currentState = collectionListItemDetails[collectionId];
|
|
@@ -5725,30 +6305,30 @@ var RowComponent$1 = function RowComponent(_ref) {
|
|
|
5725
6305
|
paddingLeft: '24px',
|
|
5726
6306
|
paddingRight: '8px'
|
|
5727
6307
|
},
|
|
5728
|
-
children: [jsxs(Grid, {
|
|
6308
|
+
children: [/*#__PURE__*/jsxs(Grid, {
|
|
5729
6309
|
container: true,
|
|
5730
6310
|
size: "grow",
|
|
5731
6311
|
sx: {
|
|
5732
6312
|
justifyContent: 'space-between',
|
|
5733
6313
|
alignItems: 'center'
|
|
5734
6314
|
},
|
|
5735
|
-
children: [jsxs(Grid, {
|
|
6315
|
+
children: [/*#__PURE__*/jsxs(Grid, {
|
|
5736
6316
|
size: "grow",
|
|
5737
|
-
children: [jsx(Box, {
|
|
6317
|
+
children: [/*#__PURE__*/jsx(Box, {
|
|
5738
6318
|
sx: fontStyling(),
|
|
5739
|
-
children: jsx(SearchHighlight, {
|
|
6319
|
+
children: /*#__PURE__*/jsx(SearchHighlight, {
|
|
5740
6320
|
search: searchFilter,
|
|
5741
6321
|
text: collectionListItem.collectionTitle || collectionListItem.collectionId
|
|
5742
6322
|
})
|
|
5743
|
-
}), jsx(Box, {
|
|
6323
|
+
}), /*#__PURE__*/jsx(Box, {
|
|
5744
6324
|
sx: fontStyling(false),
|
|
5745
|
-
children: jsx(SearchHighlight, {
|
|
6325
|
+
children: /*#__PURE__*/jsx(SearchHighlight, {
|
|
5746
6326
|
search: searchFilter,
|
|
5747
6327
|
text: collectionListItem.serviceName
|
|
5748
6328
|
})
|
|
5749
6329
|
})]
|
|
5750
|
-
}), jsx(Grid, {
|
|
5751
|
-
children: jsx(ListItemText, {
|
|
6330
|
+
}), /*#__PURE__*/jsx(Grid, {
|
|
6331
|
+
children: /*#__PURE__*/jsx(ListItemText, {
|
|
5752
6332
|
primary: collectionListItem.parameters.length + " " + t('timeseries-results'),
|
|
5753
6333
|
sx: {
|
|
5754
6334
|
paddingLeft: 1,
|
|
@@ -5757,12 +6337,12 @@ var RowComponent$1 = function RowComponent(_ref) {
|
|
|
5757
6337
|
}
|
|
5758
6338
|
})
|
|
5759
6339
|
})]
|
|
5760
|
-
}), collectionListItemDetails[collectionId] ? jsx(ChevronUp, {}) : jsx(ChevronDown, {})]
|
|
6340
|
+
}), collectionListItemDetails[collectionId] ? /*#__PURE__*/jsx(ChevronUp, {}) : /*#__PURE__*/jsx(ChevronDown, {})]
|
|
5761
6341
|
})
|
|
5762
|
-
}), jsx(Collapse, {
|
|
6342
|
+
}), /*#__PURE__*/jsx(Collapse, {
|
|
5763
6343
|
"in": collectionListItemDetails[collectionId],
|
|
5764
6344
|
unmountOnExit: true,
|
|
5765
|
-
children: jsxs(List, {
|
|
6345
|
+
children: /*#__PURE__*/jsxs(List, {
|
|
5766
6346
|
sx: {
|
|
5767
6347
|
paddingBottom: DEFAULT_PARAMTER_LIST_PADDING_BOTTOM + "px",
|
|
5768
6348
|
paddingTop: 0,
|
|
@@ -5775,7 +6355,7 @@ var RowComponent$1 = function RowComponent(_ref) {
|
|
|
5775
6355
|
boxShadow: 1,
|
|
5776
6356
|
top: -5
|
|
5777
6357
|
},
|
|
5778
|
-
children: [(collectionListItem == null ? void 0 : collectionListItem.parameters.length) < 1 && jsx(ListItem, {
|
|
6358
|
+
children: [(collectionListItem == null ? void 0 : collectionListItem.parameters.length) < 1 && /*#__PURE__*/jsx(ListItem, {
|
|
5779
6359
|
role: "listitem",
|
|
5780
6360
|
sx: {
|
|
5781
6361
|
height: DEFAULT_PARAMETER_ROW_HEIGHT + 4 + "px",
|
|
@@ -5791,7 +6371,7 @@ var RowComponent$1 = function RowComponent(_ref) {
|
|
|
5791
6371
|
overflow: 'hidden'
|
|
5792
6372
|
}
|
|
5793
6373
|
},
|
|
5794
|
-
children: jsx(ListItemText, {
|
|
6374
|
+
children: /*#__PURE__*/jsx(ListItemText, {
|
|
5795
6375
|
secondary: t('timeseries-no-params'),
|
|
5796
6376
|
sx: {
|
|
5797
6377
|
paddingLeft: 1,
|
|
@@ -5804,7 +6384,7 @@ var RowComponent$1 = function RowComponent(_ref) {
|
|
|
5804
6384
|
});
|
|
5805
6385
|
var plotHasParameter = Boolean(plotParameter);
|
|
5806
6386
|
var paramDisplayName = parameter.propertyLabel ? parameter.propertyLabel + " (" + parameter.propertyName + ")" : parameter.propertyName;
|
|
5807
|
-
return jsx(ListItem, {
|
|
6387
|
+
return /*#__PURE__*/jsx(ListItem, {
|
|
5808
6388
|
"aria-label": paramDisplayName,
|
|
5809
6389
|
role: "listitem",
|
|
5810
6390
|
sx: {
|
|
@@ -5826,33 +6406,33 @@ var RowComponent$1 = function RowComponent(_ref) {
|
|
|
5826
6406
|
backgroundColor: 'geowebColors.cards.cardContainerMouseOver'
|
|
5827
6407
|
}
|
|
5828
6408
|
},
|
|
5829
|
-
children: jsxs(Grid, {
|
|
6409
|
+
children: /*#__PURE__*/jsxs(Grid, {
|
|
5830
6410
|
container: true,
|
|
5831
6411
|
size: "grow",
|
|
5832
6412
|
sx: {
|
|
5833
6413
|
justifyContent: 'space-between',
|
|
5834
6414
|
alignItems: 'center'
|
|
5835
6415
|
},
|
|
5836
|
-
children: [jsx(Grid, {
|
|
6416
|
+
children: [/*#__PURE__*/jsx(Grid, {
|
|
5837
6417
|
size: "grow",
|
|
5838
|
-
children: jsx(Box, {
|
|
6418
|
+
children: /*#__PURE__*/jsx(Box, {
|
|
5839
6419
|
sx: fontStyling(),
|
|
5840
|
-
children: jsx(SearchHighlight, {
|
|
6420
|
+
children: /*#__PURE__*/jsx(SearchHighlight, {
|
|
5841
6421
|
search: searchFilter,
|
|
5842
6422
|
text: paramDisplayName
|
|
5843
6423
|
})
|
|
5844
6424
|
})
|
|
5845
|
-
}), jsx(Grid, {
|
|
5846
|
-
children: jsxs(Box, {
|
|
6425
|
+
}), /*#__PURE__*/jsx(Grid, {
|
|
6426
|
+
children: /*#__PURE__*/jsxs(Box, {
|
|
5847
6427
|
sx: {
|
|
5848
6428
|
marginRight: '8px'
|
|
5849
6429
|
},
|
|
5850
|
-
children: [jsx(ParameterInfoButtonConnect, {
|
|
6430
|
+
children: [/*#__PURE__*/jsx(ParameterInfoButtonConnect, {
|
|
5851
6431
|
panelId: panelId,
|
|
5852
6432
|
parameter: plotParameter != null ? plotParameter : Object.assign({}, parameter, {
|
|
5853
6433
|
plotId: selectPlot.plotId
|
|
5854
6434
|
})
|
|
5855
|
-
}), jsx(CustomToggleButton, {
|
|
6435
|
+
}), /*#__PURE__*/jsx(CustomToggleButton, {
|
|
5856
6436
|
fullWidth: true,
|
|
5857
6437
|
onClick: function onClick() {
|
|
5858
6438
|
var parameterWithPlotId = Object.assign({}, parameter, {
|
|
@@ -5922,20 +6502,20 @@ var TimeSeriesSelectList = function TimeSeriesSelectList(_ref2) {
|
|
|
5922
6502
|
var filterResults = filterCollectionsParametersFromService(collectionList, searchFilter, filterChipsServices, allFilterChipsEnabled);
|
|
5923
6503
|
setFilteredCollectionList(filterResults);
|
|
5924
6504
|
}, [searchFilter, collectionList, filterChipsServices, allFilterChipsEnabled]);
|
|
5925
|
-
return jsxs(Box, {
|
|
6505
|
+
return /*#__PURE__*/jsxs(Box, {
|
|
5926
6506
|
"data-testid": "timeseriesSelectList",
|
|
5927
6507
|
sx: {
|
|
5928
6508
|
flex: 1,
|
|
5929
6509
|
minHeight: 0,
|
|
5930
6510
|
overflow: 'hidden'
|
|
5931
6511
|
},
|
|
5932
|
-
children: [jsxs(Box, {
|
|
6512
|
+
children: [/*#__PURE__*/jsxs(Box, {
|
|
5933
6513
|
sx: {
|
|
5934
6514
|
marginBottom: '4px',
|
|
5935
6515
|
fontSize: '12px'
|
|
5936
6516
|
},
|
|
5937
6517
|
children: [filteredCollectionList.length, " ", t('timeseries-results')]
|
|
5938
|
-
}), jsx(List$1, {
|
|
6518
|
+
}), /*#__PURE__*/jsx(List$1, {
|
|
5939
6519
|
rowComponent: RowComponent$1,
|
|
5940
6520
|
rowCount: filteredCollectionList.length,
|
|
5941
6521
|
rowHeight: function rowHeight(index) {
|
|
@@ -5966,6 +6546,24 @@ var TimeSeriesSelectList = function TimeSeriesSelectList(_ref2) {
|
|
|
5966
6546
|
});
|
|
5967
6547
|
};
|
|
5968
6548
|
|
|
6549
|
+
/* *
|
|
6550
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6551
|
+
* you may not use this file except in compliance with the License.
|
|
6552
|
+
* You may obtain a copy of the License at
|
|
6553
|
+
*
|
|
6554
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
6555
|
+
*
|
|
6556
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
6557
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
6558
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6559
|
+
* See the License for the specific language governing permissions and
|
|
6560
|
+
* limitations under the License.
|
|
6561
|
+
*
|
|
6562
|
+
* Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6563
|
+
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
6564
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
6565
|
+
* */
|
|
6566
|
+
|
|
5969
6567
|
var TimeSeriesSelectListConnect = /*#__PURE__*/memo(function (_ref) {
|
|
5970
6568
|
var selectPlot = _ref.selectPlot,
|
|
5971
6569
|
handleAddOrRemoveClick = _ref.handleAddOrRemoveClick,
|
|
@@ -5986,7 +6584,7 @@ var TimeSeriesSelectListConnect = /*#__PURE__*/memo(function (_ref) {
|
|
|
5986
6584
|
var searchFilter = useSelector(function (state) {
|
|
5987
6585
|
return getSearchFilter(state, panelId);
|
|
5988
6586
|
});
|
|
5989
|
-
return jsx(TimeSeriesSelectList, {
|
|
6587
|
+
return /*#__PURE__*/jsx(TimeSeriesSelectList, {
|
|
5990
6588
|
allFilterChipsEnabled: allFilterChipsEnabled,
|
|
5991
6589
|
collectionList: collectionList,
|
|
5992
6590
|
collectionListItemDetails: collectionListItemDetails,
|
|
@@ -5999,6 +6597,24 @@ var TimeSeriesSelectListConnect = /*#__PURE__*/memo(function (_ref) {
|
|
|
5999
6597
|
});
|
|
6000
6598
|
});
|
|
6001
6599
|
|
|
6600
|
+
/* *
|
|
6601
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6602
|
+
* you may not use this file except in compliance with the License.
|
|
6603
|
+
* You may obtain a copy of the License at
|
|
6604
|
+
*
|
|
6605
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
6606
|
+
*
|
|
6607
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
6608
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
6609
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6610
|
+
* See the License for the specific language governing permissions and
|
|
6611
|
+
* limitations under the License.
|
|
6612
|
+
*
|
|
6613
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6614
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
6615
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
6616
|
+
* */
|
|
6617
|
+
|
|
6002
6618
|
var style = {
|
|
6003
6619
|
borderRadius: '20px!important',
|
|
6004
6620
|
marginRight: '4px',
|
|
@@ -6019,10 +6635,10 @@ var ServiceChip = function ServiceChip(_ref) {
|
|
|
6019
6635
|
var _useTimeseriesTransla = useTimeseriesTranslation(),
|
|
6020
6636
|
t = _useTimeseriesTransla.t;
|
|
6021
6637
|
var chip = all ? 'all' : service == null ? void 0 : service.serviceUrl;
|
|
6022
|
-
return jsx(CustomTooltip, {
|
|
6638
|
+
return /*#__PURE__*/jsx(CustomTooltip, {
|
|
6023
6639
|
title: service != null && service.serviceUrl ? "URL: " + service.serviceUrl : '',
|
|
6024
|
-
children: jsx("span", {
|
|
6025
|
-
children: jsx(CustomToggleButton, {
|
|
6640
|
+
children: /*#__PURE__*/jsx("span", {
|
|
6641
|
+
children: /*#__PURE__*/jsx(CustomToggleButton, {
|
|
6026
6642
|
disabled: isDisabled,
|
|
6027
6643
|
onClick: function onClick() {
|
|
6028
6644
|
return toggleChip(chip);
|
|
@@ -6037,6 +6653,24 @@ var ServiceChip = function ServiceChip(_ref) {
|
|
|
6037
6653
|
});
|
|
6038
6654
|
};
|
|
6039
6655
|
|
|
6656
|
+
/* *
|
|
6657
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6658
|
+
* you may not use this file except in compliance with the License.
|
|
6659
|
+
* You may obtain a copy of the License at
|
|
6660
|
+
*
|
|
6661
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
6662
|
+
*
|
|
6663
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
6664
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
6665
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6666
|
+
* See the License for the specific language governing permissions and
|
|
6667
|
+
* limitations under the License.
|
|
6668
|
+
*
|
|
6669
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6670
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
6671
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
6672
|
+
* */
|
|
6673
|
+
|
|
6040
6674
|
var ServiceChipConnect = function ServiceChipConnect(_ref) {
|
|
6041
6675
|
var service = _ref.service,
|
|
6042
6676
|
isAllSelected = _ref.isAllSelected,
|
|
@@ -6063,7 +6697,7 @@ var ServiceChipConnect = function ServiceChipConnect(_ref) {
|
|
|
6063
6697
|
panelId: panelId
|
|
6064
6698
|
}));
|
|
6065
6699
|
};
|
|
6066
|
-
return jsx(ServiceChip, {
|
|
6700
|
+
return /*#__PURE__*/jsx(ServiceChip, {
|
|
6067
6701
|
isDisabled: service.isLoading,
|
|
6068
6702
|
isSelected: isAllSelected ? false : service.enabled,
|
|
6069
6703
|
service: service,
|
|
@@ -6074,7 +6708,7 @@ var AllChipConnect = function AllChipConnect(_ref2) {
|
|
|
6074
6708
|
var isAllSelected = _ref2.isAllSelected,
|
|
6075
6709
|
panelId = _ref2.panelId;
|
|
6076
6710
|
var dispatch = useDispatch();
|
|
6077
|
-
return jsx(ServiceChip, {
|
|
6711
|
+
return /*#__PURE__*/jsx(ServiceChip, {
|
|
6078
6712
|
isSelected: isAllSelected,
|
|
6079
6713
|
toggleChip: function toggleChip() {
|
|
6080
6714
|
if (!isAllSelected) {
|
|
@@ -6086,19 +6720,37 @@ var AllChipConnect = function AllChipConnect(_ref2) {
|
|
|
6086
6720
|
});
|
|
6087
6721
|
};
|
|
6088
6722
|
|
|
6723
|
+
/* *
|
|
6724
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6725
|
+
* you may not use this file except in compliance with the License.
|
|
6726
|
+
* You may obtain a copy of the License at
|
|
6727
|
+
*
|
|
6728
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
6729
|
+
*
|
|
6730
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
6731
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
6732
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6733
|
+
* See the License for the specific language governing permissions and
|
|
6734
|
+
* limitations under the License.
|
|
6735
|
+
*
|
|
6736
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6737
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
6738
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
6739
|
+
* */
|
|
6740
|
+
|
|
6089
6741
|
var TimeSeriesServiceList = function TimeSeriesServiceList(_ref) {
|
|
6090
6742
|
var filterChipsServicesById = _ref.filterChipsServicesById,
|
|
6091
6743
|
isAllSelected = _ref.isAllSelected,
|
|
6092
6744
|
panelId = _ref.panelId;
|
|
6093
6745
|
var activeServices = Object.values(filterChipsServicesById);
|
|
6094
|
-
return jsx(Box, {
|
|
6746
|
+
return /*#__PURE__*/jsx(Box, {
|
|
6095
6747
|
"data-testid": "serviceList",
|
|
6096
6748
|
sx: {
|
|
6097
6749
|
marginTop: '8px',
|
|
6098
6750
|
width: '100%',
|
|
6099
6751
|
overflow: 'hidden'
|
|
6100
6752
|
},
|
|
6101
|
-
children: jsxs(Box, {
|
|
6753
|
+
children: /*#__PURE__*/jsxs(Box, {
|
|
6102
6754
|
sx: {
|
|
6103
6755
|
width: '100%',
|
|
6104
6756
|
display: 'block',
|
|
@@ -6107,11 +6759,11 @@ var TimeSeriesServiceList = function TimeSeriesServiceList(_ref) {
|
|
|
6107
6759
|
marginBottom: '8px',
|
|
6108
6760
|
fontSize: '0.875rem'
|
|
6109
6761
|
},
|
|
6110
|
-
children: [activeServices.length ? jsx(AllChipConnect, {
|
|
6762
|
+
children: [activeServices.length ? /*#__PURE__*/jsx(AllChipConnect, {
|
|
6111
6763
|
isAllSelected: isAllSelected,
|
|
6112
6764
|
panelId: panelId
|
|
6113
6765
|
}) : null, activeServices.map(function (service) {
|
|
6114
|
-
return jsx(ServiceChipConnect, {
|
|
6766
|
+
return /*#__PURE__*/jsx(ServiceChipConnect, {
|
|
6115
6767
|
isAllSelected: isAllSelected,
|
|
6116
6768
|
panelId: panelId,
|
|
6117
6769
|
service: service
|
|
@@ -6121,6 +6773,24 @@ var TimeSeriesServiceList = function TimeSeriesServiceList(_ref) {
|
|
|
6121
6773
|
});
|
|
6122
6774
|
};
|
|
6123
6775
|
|
|
6776
|
+
/* *
|
|
6777
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6778
|
+
* you may not use this file except in compliance with the License.
|
|
6779
|
+
* You may obtain a copy of the License at
|
|
6780
|
+
*
|
|
6781
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
6782
|
+
*
|
|
6783
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
6784
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
6785
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6786
|
+
* See the License for the specific language governing permissions and
|
|
6787
|
+
* limitations under the License.
|
|
6788
|
+
*
|
|
6789
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6790
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
6791
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
6792
|
+
* */
|
|
6793
|
+
|
|
6124
6794
|
var sortByService = function sortByService(serviceObj) {
|
|
6125
6795
|
return Object.entries(serviceObj).sort(function (_ref, _ref2) {
|
|
6126
6796
|
var serviceA = _ref[1];
|
|
@@ -6141,13 +6811,31 @@ var TimeSeriesServiceListConnect = function TimeSeriesServiceListConnect(_ref4)
|
|
|
6141
6811
|
var isAllFilterchipsEnabled = useSelector(function (store) {
|
|
6142
6812
|
return getAllFilterChipsEnabled(store, panelId);
|
|
6143
6813
|
});
|
|
6144
|
-
return jsx(TimeSeriesServiceList, {
|
|
6814
|
+
return /*#__PURE__*/jsx(TimeSeriesServiceList, {
|
|
6145
6815
|
filterChipsServicesById: sortByService(filterChipsServices),
|
|
6146
6816
|
isAllSelected: isAllFilterchipsEnabled,
|
|
6147
6817
|
panelId: panelId
|
|
6148
6818
|
});
|
|
6149
6819
|
};
|
|
6150
6820
|
|
|
6821
|
+
/* *
|
|
6822
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6823
|
+
* you may not use this file except in compliance with the License.
|
|
6824
|
+
* You may obtain a copy of the License at
|
|
6825
|
+
*
|
|
6826
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
6827
|
+
*
|
|
6828
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
6829
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
6830
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6831
|
+
* See the License for the specific language governing permissions and
|
|
6832
|
+
* limitations under the License.
|
|
6833
|
+
*
|
|
6834
|
+
* Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6835
|
+
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
6836
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
6837
|
+
* */
|
|
6838
|
+
|
|
6151
6839
|
var TimeSeriesSelect = function TimeSeriesSelect(_ref) {
|
|
6152
6840
|
var panelId = _ref.panelId,
|
|
6153
6841
|
onClose = _ref.onClose,
|
|
@@ -6162,7 +6850,7 @@ var TimeSeriesSelect = function TimeSeriesSelect(_ref) {
|
|
|
6162
6850
|
var _useGetServiceCollect = useGetServiceCollectionDetails(services, isOpen),
|
|
6163
6851
|
isFetching = _useGetServiceCollect.isFetching,
|
|
6164
6852
|
error = _useGetServiceCollect.error;
|
|
6165
|
-
return jsxs(ToolContainerDraggable, {
|
|
6853
|
+
return /*#__PURE__*/jsxs(ToolContainerDraggable, {
|
|
6166
6854
|
"data-testid": "TimeSeriesSelect",
|
|
6167
6855
|
isOpen: isOpen,
|
|
6168
6856
|
minHeight: 200,
|
|
@@ -6179,21 +6867,21 @@ var TimeSeriesSelect = function TimeSeriesSelect(_ref) {
|
|
|
6179
6867
|
height: DEFAULT_DIALOG_HEIGHT
|
|
6180
6868
|
},
|
|
6181
6869
|
title: t('timeseries-select-for') + " " + selectPlot.title,
|
|
6182
|
-
children: [!!isFetching && jsx(LinearProgress, {
|
|
6870
|
+
children: [!!isFetching && /*#__PURE__*/jsx(LinearProgress, {
|
|
6183
6871
|
color: "secondary",
|
|
6184
6872
|
sx: {
|
|
6185
6873
|
width: '100%',
|
|
6186
6874
|
position: 'absolute'
|
|
6187
6875
|
}
|
|
6188
|
-
}), !!error && jsx(Box, {
|
|
6876
|
+
}), !!error && /*#__PURE__*/jsx(Box, {
|
|
6189
6877
|
sx: {
|
|
6190
6878
|
padding: '0 6px'
|
|
6191
6879
|
},
|
|
6192
|
-
children: jsx(AlertBanner, {
|
|
6880
|
+
children: /*#__PURE__*/jsx(AlertBanner, {
|
|
6193
6881
|
shouldClose: true,
|
|
6194
6882
|
title: error == null ? void 0 : error.message
|
|
6195
6883
|
})
|
|
6196
|
-
}), jsxs(Box, {
|
|
6884
|
+
}), /*#__PURE__*/jsxs(Box, {
|
|
6197
6885
|
sx: {
|
|
6198
6886
|
padding: '6px 8px',
|
|
6199
6887
|
height: "calc(100% - " + (error ? 48 : 0) + "px)",
|
|
@@ -6201,39 +6889,57 @@ var TimeSeriesSelect = function TimeSeriesSelect(_ref) {
|
|
|
6201
6889
|
flexDirection: 'column',
|
|
6202
6890
|
minHeight: 0
|
|
6203
6891
|
},
|
|
6204
|
-
children: [jsx(SearchFieldConnect, {
|
|
6892
|
+
children: [/*#__PURE__*/jsx(SearchFieldConnect, {
|
|
6205
6893
|
panelId: panelId
|
|
6206
|
-
}), jsx(Box, {
|
|
6894
|
+
}), /*#__PURE__*/jsx(Box, {
|
|
6207
6895
|
sx: {
|
|
6208
6896
|
position: 'absolute',
|
|
6209
6897
|
margin: '64px 0 0 calc(100% - 40px)',
|
|
6210
6898
|
zIndex: 2,
|
|
6211
6899
|
"float": 'right'
|
|
6212
6900
|
},
|
|
6213
|
-
children: jsx(ServiceOptionsButtonConnect, {
|
|
6901
|
+
children: /*#__PURE__*/jsx(ServiceOptionsButtonConnect, {
|
|
6214
6902
|
panelId: panelId
|
|
6215
6903
|
})
|
|
6216
|
-
}), jsx(Box, {
|
|
6904
|
+
}), /*#__PURE__*/jsx(Box, {
|
|
6217
6905
|
sx: {
|
|
6218
6906
|
paddingBottom: '6px',
|
|
6219
6907
|
paddingRight: '32px'
|
|
6220
6908
|
},
|
|
6221
|
-
children: jsx(TimeSeriesServiceListConnect, {
|
|
6909
|
+
children: /*#__PURE__*/jsx(TimeSeriesServiceListConnect, {
|
|
6222
6910
|
panelId: panelId
|
|
6223
6911
|
})
|
|
6224
|
-
}), jsx(TimeSeriesSelectListConnect, {
|
|
6912
|
+
}), /*#__PURE__*/jsx(TimeSeriesSelectListConnect, {
|
|
6225
6913
|
handleAddOrRemoveClick: handleAddOrRemoveClick,
|
|
6226
6914
|
isOpen: isOpen,
|
|
6227
6915
|
panelId: panelId,
|
|
6228
6916
|
selectPlot: selectPlot,
|
|
6229
6917
|
services: services
|
|
6230
|
-
}), jsx(ServicePopupConnect, {
|
|
6918
|
+
}), /*#__PURE__*/jsx(ServicePopupConnect, {
|
|
6231
6919
|
panelId: panelId
|
|
6232
6920
|
})]
|
|
6233
6921
|
})]
|
|
6234
6922
|
});
|
|
6235
6923
|
};
|
|
6236
6924
|
|
|
6925
|
+
/* *
|
|
6926
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6927
|
+
* you may not use this file except in compliance with the License.
|
|
6928
|
+
* You may obtain a copy of the License at
|
|
6929
|
+
*
|
|
6930
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
6931
|
+
*
|
|
6932
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
6933
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
6934
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6935
|
+
* See the License for the specific language governing permissions and
|
|
6936
|
+
* limitations under the License.
|
|
6937
|
+
*
|
|
6938
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6939
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
6940
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
6941
|
+
* */
|
|
6942
|
+
|
|
6237
6943
|
var DIALOG_TYPE = uiTypes.DialogTypes.TimeSeriesSelect;
|
|
6238
6944
|
var origin$1 = TimeSeriesActionOrigin.timeSeriesSelect;
|
|
6239
6945
|
var TimeSeriesSelectConnect = function TimeSeriesSelectConnect(_ref) {
|
|
@@ -6251,6 +6957,7 @@ var TimeSeriesSelectConnect = function TimeSeriesSelectConnect(_ref) {
|
|
|
6251
6957
|
var plot = useSelector(function (state) {
|
|
6252
6958
|
return getPlotWithParameters(state, selectPlotId, panelId);
|
|
6253
6959
|
});
|
|
6960
|
+
|
|
6254
6961
|
// If select dialog for a plot is open but the plot is deleted, close the dialog
|
|
6255
6962
|
React.useEffect(function () {
|
|
6256
6963
|
if (isDialogOpen && activePanelId === panelId && !plot) {
|
|
@@ -6276,7 +6983,7 @@ var TimeSeriesSelectConnect = function TimeSeriesSelectConnect(_ref) {
|
|
|
6276
6983
|
return getServices(state);
|
|
6277
6984
|
});
|
|
6278
6985
|
var isDialogOpenForPanel = isDialogOpen && activePanelId === panelId;
|
|
6279
|
-
return plot && services && services.length > 0 ? jsx(TimeSeriesSelect, {
|
|
6986
|
+
return plot && services && services.length > 0 ? /*#__PURE__*/jsx(TimeSeriesSelect, {
|
|
6280
6987
|
handleAddOrRemoveClick: handleAddOrRemoveClick,
|
|
6281
6988
|
isOpen: isDialogOpenForPanel,
|
|
6282
6989
|
onClose: onCloseDialog,
|
|
@@ -6288,6 +6995,24 @@ var TimeSeriesSelectConnect = function TimeSeriesSelectConnect(_ref) {
|
|
|
6288
6995
|
}) : null;
|
|
6289
6996
|
};
|
|
6290
6997
|
|
|
6998
|
+
/* *
|
|
6999
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7000
|
+
* you may not use this file except in compliance with the License.
|
|
7001
|
+
* You may obtain a copy of the License at
|
|
7002
|
+
*
|
|
7003
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
7004
|
+
*
|
|
7005
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
7006
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
7007
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
7008
|
+
* See the License for the specific language governing permissions and
|
|
7009
|
+
* limitations under the License.
|
|
7010
|
+
*
|
|
7011
|
+
* Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
7012
|
+
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
7013
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
7014
|
+
* */
|
|
7015
|
+
|
|
6291
7016
|
var DIALOG_TYPE_MANAGER = uiTypes.DialogTypes.TimeSeriesManager;
|
|
6292
7017
|
var origin = TimeSeriesActionOrigin.timeSeriesManager;
|
|
6293
7018
|
var TimeSeriesManagerConnect = function TimeSeriesManagerConnect(_ref) {
|
|
@@ -6410,8 +7135,8 @@ var TimeSeriesManagerConnect = function TimeSeriesManagerConnect(_ref) {
|
|
|
6410
7135
|
parameter: parameter
|
|
6411
7136
|
}));
|
|
6412
7137
|
};
|
|
6413
|
-
return jsxs(Fragment, {
|
|
6414
|
-
children: [!!plotState && jsx(TimeSeriesManager, {
|
|
7138
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
7139
|
+
children: [!!plotState && /*#__PURE__*/jsx(TimeSeriesManager, {
|
|
6415
7140
|
addParameter: addParameter,
|
|
6416
7141
|
addPlot: addPlot,
|
|
6417
7142
|
deleteParameter: deleteParameter,
|
|
@@ -6430,13 +7155,31 @@ var TimeSeriesManagerConnect = function TimeSeriesManagerConnect(_ref) {
|
|
|
6430
7155
|
toggleParameter: toggleParameter,
|
|
6431
7156
|
togglePlot: togglePlot,
|
|
6432
7157
|
updateTitle: updateTitle
|
|
6433
|
-
}), jsx(TimeSeriesSelectConnect, {
|
|
7158
|
+
}), /*#__PURE__*/jsx(TimeSeriesSelectConnect, {
|
|
6434
7159
|
panelId: panelId,
|
|
6435
7160
|
selectPlotId: selectPlotId
|
|
6436
|
-
}), jsx(ParameterInfoDialogConnect, {})]
|
|
7161
|
+
}), /*#__PURE__*/jsx(ParameterInfoDialogConnect, {})]
|
|
6437
7162
|
});
|
|
6438
7163
|
};
|
|
6439
7164
|
|
|
7165
|
+
/* *
|
|
7166
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7167
|
+
* you may not use this file except in compliance with the License.
|
|
7168
|
+
* You may obtain a copy of the License at
|
|
7169
|
+
*
|
|
7170
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
7171
|
+
*
|
|
7172
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
7173
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
7174
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
7175
|
+
* See the License for the specific language governing permissions and
|
|
7176
|
+
* limitations under the License.
|
|
7177
|
+
*
|
|
7178
|
+
* Copyright 2025 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
7179
|
+
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
7180
|
+
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
7181
|
+
* */
|
|
7182
|
+
|
|
6440
7183
|
var extractUsedServices = function extractUsedServices(services, feature) {
|
|
6441
7184
|
var _feature$properties;
|
|
6442
7185
|
if (!services || !(feature != null && (_feature$properties = feature.properties) != null && _feature$properties.occurrences) || feature.properties.occurrences.length < 1) {
|
|
@@ -6547,6 +7290,7 @@ var LocationInfo = function LocationInfo(_ref) {
|
|
|
6547
7290
|
properties: {},
|
|
6548
7291
|
collections: []
|
|
6549
7292
|
};
|
|
7293
|
+
|
|
6550
7294
|
// Internal properties
|
|
6551
7295
|
for (var i = 0; i < (feature == null || (_feature$properties3 = feature.properties) == null ? void 0 : _feature$properties3.occurrences.length); i += 1) {
|
|
6552
7296
|
var _feature$properties3, _feature$properties4;
|
|
@@ -6579,7 +7323,7 @@ var LocationInfo = function LocationInfo(_ref) {
|
|
|
6579
7323
|
}
|
|
6580
7324
|
return '';
|
|
6581
7325
|
}, [location, mapPinLocation]);
|
|
6582
|
-
return jsx(ToolContainerDraggable, {
|
|
7326
|
+
return /*#__PURE__*/jsx(ToolContainerDraggable, {
|
|
6583
7327
|
"data-testid": "LocationInfo",
|
|
6584
7328
|
initialMaxHeight: 800,
|
|
6585
7329
|
isOpen: isOpen,
|
|
@@ -6597,26 +7341,26 @@ var LocationInfo = function LocationInfo(_ref) {
|
|
|
6597
7341
|
height: 500
|
|
6598
7342
|
},
|
|
6599
7343
|
title: "" + t('timeseries-location-info-title'),
|
|
6600
|
-
children: jsxs(Box, {
|
|
7344
|
+
children: /*#__PURE__*/jsxs(Box, {
|
|
6601
7345
|
className: "locationInfoContainer",
|
|
6602
7346
|
sx: {
|
|
6603
7347
|
padding: '0 6px'
|
|
6604
7348
|
},
|
|
6605
|
-
children: [!!location && jsxs(Fragment, {
|
|
6606
|
-
children: [jsxs(Box, {
|
|
7349
|
+
children: [!!location && /*#__PURE__*/jsxs(Fragment, {
|
|
7350
|
+
children: [/*#__PURE__*/jsxs(Box, {
|
|
6607
7351
|
sx: {
|
|
6608
7352
|
paddingLeft: '12px',
|
|
6609
7353
|
paddingTop: '12px'
|
|
6610
7354
|
},
|
|
6611
|
-
children: [location.geometry.type === 'Point' && jsx(ParameterInfoText, {
|
|
7355
|
+
children: [location.geometry.type === 'Point' && /*#__PURE__*/jsx(ParameterInfoText, {
|
|
6612
7356
|
label: t('timeseries-location-info-coordinates'),
|
|
6613
7357
|
value: formattedCoordinates
|
|
6614
7358
|
}), Object.keys(location.properties).sort().map(function (prop) {
|
|
6615
|
-
return jsx(ParameterInfoText, {
|
|
7359
|
+
return /*#__PURE__*/jsx(ParameterInfoText, {
|
|
6616
7360
|
label: t("timeseries-location-info-" + prop),
|
|
6617
7361
|
value: location.properties[prop] || t('timeseries-location-info-no-data')
|
|
6618
7362
|
}, prop);
|
|
6619
|
-
}), jsx(Typography, {
|
|
7363
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
6620
7364
|
color: "textSecondary",
|
|
6621
7365
|
sx: Object.assign({}, textStyle, {
|
|
6622
7366
|
marginLeft: '-6px'
|
|
@@ -6624,25 +7368,25 @@ var LocationInfo = function LocationInfo(_ref) {
|
|
|
6624
7368
|
variant: "caption",
|
|
6625
7369
|
children: location.collections.length + " " + (location.collections.length === 1 ? t('timeseries-location-info-collection') : t('timeseries-location-info-collections'))
|
|
6626
7370
|
})]
|
|
6627
|
-
}), jsx(CollectionList, {
|
|
7371
|
+
}), /*#__PURE__*/jsx(CollectionList, {
|
|
6628
7372
|
collections: location.collections,
|
|
6629
7373
|
parameters: parameters
|
|
6630
7374
|
})]
|
|
6631
|
-
}), !location && !!mapPinLocation && jsx(Box, {
|
|
7375
|
+
}), !location && !!mapPinLocation && /*#__PURE__*/jsx(Box, {
|
|
6632
7376
|
sx: {
|
|
6633
7377
|
paddingLeft: '12px',
|
|
6634
7378
|
paddingTop: '12px'
|
|
6635
7379
|
},
|
|
6636
|
-
children: jsx(ParameterInfoText, {
|
|
7380
|
+
children: /*#__PURE__*/jsx(ParameterInfoText, {
|
|
6637
7381
|
label: t('timeseries-location-info-coordinates'),
|
|
6638
7382
|
value: formattedCoordinates
|
|
6639
7383
|
})
|
|
6640
|
-
}), !location && !mapPinLocation && jsx(Box, {
|
|
7384
|
+
}), !location && !mapPinLocation && /*#__PURE__*/jsx(Box, {
|
|
6641
7385
|
sx: {
|
|
6642
7386
|
paddingLeft: '12px',
|
|
6643
7387
|
paddingTop: '12px'
|
|
6644
7388
|
},
|
|
6645
|
-
children: jsx(Typography, {
|
|
7389
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
6646
7390
|
sx: textStyleWithMargin,
|
|
6647
7391
|
variant: "body2",
|
|
6648
7392
|
children: t('timeseries-location-info-no-location-selected')
|
|
@@ -6654,9 +7398,9 @@ var LocationInfo = function LocationInfo(_ref) {
|
|
|
6654
7398
|
var CollectionList = function CollectionList(_ref2) {
|
|
6655
7399
|
var collections = _ref2.collections,
|
|
6656
7400
|
parameters = _ref2.parameters;
|
|
6657
|
-
return jsx("div", {
|
|
7401
|
+
return /*#__PURE__*/jsx("div", {
|
|
6658
7402
|
children: collections.map(function (collection) {
|
|
6659
|
-
return jsx(CollectionInfo, {
|
|
7403
|
+
return /*#__PURE__*/jsx(CollectionInfo, {
|
|
6660
7404
|
collection: collection,
|
|
6661
7405
|
parameters: parameters
|
|
6662
7406
|
}, collection.properties.collectionId);
|
|
@@ -6668,18 +7412,18 @@ var CollectionInfo = function CollectionInfo(_ref3) {
|
|
|
6668
7412
|
parameters = _ref3.parameters;
|
|
6669
7413
|
var _useTimeseriesTransla2 = useTimeseriesTranslation(),
|
|
6670
7414
|
t = _useTimeseriesTransla2.t;
|
|
6671
|
-
return jsx(CustomAccordion, {
|
|
7415
|
+
return /*#__PURE__*/jsx(CustomAccordion, {
|
|
6672
7416
|
sx: {
|
|
6673
7417
|
margin: '0'
|
|
6674
7418
|
},
|
|
6675
7419
|
title: collection.properties.collectionId,
|
|
6676
|
-
children: jsxs(Box, {
|
|
7420
|
+
children: /*#__PURE__*/jsxs(Box, {
|
|
6677
7421
|
children: [Object.keys(collection.properties).sort().map(function (prop) {
|
|
6678
|
-
return jsx(ParameterInfoText, {
|
|
7422
|
+
return /*#__PURE__*/jsx(ParameterInfoText, {
|
|
6679
7423
|
label: t("timeseries-location-info-" + prop),
|
|
6680
7424
|
value: collection.properties[prop] || t('timeseries-location-info-no-data')
|
|
6681
7425
|
}, prop);
|
|
6682
|
-
}), jsx(ParameterInfoElem, {
|
|
7426
|
+
}), /*#__PURE__*/jsx(ParameterInfoElem, {
|
|
6683
7427
|
parameter: parameters ? parameters[collection.parameterIndex] : undefined
|
|
6684
7428
|
})]
|
|
6685
7429
|
})
|
|
@@ -6691,9 +7435,9 @@ var ParameterInfoElem = function ParameterInfoElem(_ref4) {
|
|
|
6691
7435
|
t = _useTimeseriesTransla3.t;
|
|
6692
7436
|
if (parameter) {
|
|
6693
7437
|
if (parameter.loading) {
|
|
6694
|
-
return jsx(ParameterInfoLabel, {
|
|
7438
|
+
return /*#__PURE__*/jsx(ParameterInfoLabel, {
|
|
6695
7439
|
label: t('timeseries-location-info-parameters'),
|
|
6696
|
-
children: jsx(LinearProgress, {
|
|
7440
|
+
children: /*#__PURE__*/jsx(LinearProgress, {
|
|
6697
7441
|
color: "secondary",
|
|
6698
7442
|
"data-testid": "loadingIndicator",
|
|
6699
7443
|
sx: {
|
|
@@ -6705,12 +7449,12 @@ var ParameterInfoElem = function ParameterInfoElem(_ref4) {
|
|
|
6705
7449
|
})
|
|
6706
7450
|
});
|
|
6707
7451
|
}
|
|
6708
|
-
return jsx(ParameterInfoText, {
|
|
7452
|
+
return /*#__PURE__*/jsx(ParameterInfoText, {
|
|
6709
7453
|
label: t('timeseries-location-info-parameters'),
|
|
6710
7454
|
value: parameter.parameters.length ? parameter.parameters.join(', ') : t('timeseries-location-info-no-data')
|
|
6711
7455
|
});
|
|
6712
7456
|
}
|
|
6713
|
-
return jsx(ParameterInfoText, {
|
|
7457
|
+
return /*#__PURE__*/jsx(ParameterInfoText, {
|
|
6714
7458
|
label: t('timeseries-location-info-parameters'),
|
|
6715
7459
|
value: t('timeseries-location-info-no-data')
|
|
6716
7460
|
});
|
|
@@ -6725,12 +7469,12 @@ var textStyleWithMargin = Object.assign({}, textStyle, {
|
|
|
6725
7469
|
var ParameterInfoLabel = function ParameterInfoLabel(_ref5) {
|
|
6726
7470
|
var label = _ref5.label,
|
|
6727
7471
|
children = _ref5.children;
|
|
6728
|
-
return jsxs(Box, {
|
|
7472
|
+
return /*#__PURE__*/jsxs(Box, {
|
|
6729
7473
|
sx: {
|
|
6730
7474
|
minWidth: '12rem',
|
|
6731
7475
|
paddingRight: '1rem'
|
|
6732
7476
|
},
|
|
6733
|
-
children: [jsx(Typography, {
|
|
7477
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
6734
7478
|
color: "textSecondary",
|
|
6735
7479
|
sx: textStyle,
|
|
6736
7480
|
variant: "caption",
|
|
@@ -6741,9 +7485,9 @@ var ParameterInfoLabel = function ParameterInfoLabel(_ref5) {
|
|
|
6741
7485
|
var ParameterInfoText = function ParameterInfoText(_ref6) {
|
|
6742
7486
|
var label = _ref6.label,
|
|
6743
7487
|
value = _ref6.value;
|
|
6744
|
-
return jsx(ParameterInfoLabel, {
|
|
7488
|
+
return /*#__PURE__*/jsx(ParameterInfoLabel, {
|
|
6745
7489
|
label: label,
|
|
6746
|
-
children: jsx(Typography, {
|
|
7490
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
6747
7491
|
sx: textStyleWithMargin,
|
|
6748
7492
|
variant: "body2",
|
|
6749
7493
|
children: value
|
|
@@ -6751,6 +7495,24 @@ var ParameterInfoText = function ParameterInfoText(_ref6) {
|
|
|
6751
7495
|
});
|
|
6752
7496
|
};
|
|
6753
7497
|
|
|
7498
|
+
/* *
|
|
7499
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7500
|
+
* you may not use this file except in compliance with the License.
|
|
7501
|
+
* You may obtain a copy of the License at
|
|
7502
|
+
*
|
|
7503
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
7504
|
+
*
|
|
7505
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
7506
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
7507
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
7508
|
+
* See the License for the specific language governing permissions and
|
|
7509
|
+
* limitations under the License.
|
|
7510
|
+
*
|
|
7511
|
+
* Copyright 2025 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
7512
|
+
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
7513
|
+
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
7514
|
+
* */
|
|
7515
|
+
|
|
6754
7516
|
var LocationInfoConnect = function LocationInfoConnect() {
|
|
6755
7517
|
var panelId = useSelector(function (store) {
|
|
6756
7518
|
return uiSelectors.getSourcePanelId(store, uiTypes.DialogTypes.TimeSeriesLocationInfo);
|
|
@@ -6759,7 +7521,7 @@ var LocationInfoConnect = function LocationInfoConnect() {
|
|
|
6759
7521
|
return getServices(state);
|
|
6760
7522
|
});
|
|
6761
7523
|
var selectedMapIds = useSelector(function (state) {
|
|
6762
|
-
return genericSelectors.
|
|
7524
|
+
return genericSelectors.getLinkedTargetIds(state, panelId);
|
|
6763
7525
|
});
|
|
6764
7526
|
var selectedFeature = useSelector(function (state) {
|
|
6765
7527
|
return genericSelectors.getSelectedFeatureAsGeoJSON(state.syncGroups, panelId);
|
|
@@ -6773,7 +7535,7 @@ var LocationInfoConnect = function LocationInfoConnect() {
|
|
|
6773
7535
|
dialogOrder = _useSetupDialog.dialogOrder,
|
|
6774
7536
|
isDialogOpen = _useSetupDialog.isDialogOpen,
|
|
6775
7537
|
onCloseDialog = _useSetupDialog.onCloseDialog;
|
|
6776
|
-
return jsx(LocationInfo, {
|
|
7538
|
+
return /*#__PURE__*/jsx(LocationInfo, {
|
|
6777
7539
|
feature: selectedFeature,
|
|
6778
7540
|
isOpen: isDialogOpen,
|
|
6779
7541
|
mapPinLocation: mapPinLocation,
|
|
@@ -6801,6 +7563,7 @@ var LocationInfoConnect = function LocationInfoConnect() {
|
|
|
6801
7563
|
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
6802
7564
|
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
6803
7565
|
* */
|
|
7566
|
+
|
|
6804
7567
|
var getUserAddedEDRServices = function getUserAddedEDRServices() {
|
|
6805
7568
|
try {
|
|
6806
7569
|
var storedString = window.localStorage.getItem('userAddedEDRServices');
|
|
@@ -6860,6 +7623,7 @@ timeseriesListener.startListening({
|
|
|
6860
7623
|
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
6861
7624
|
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
6862
7625
|
* */
|
|
7626
|
+
|
|
6863
7627
|
var timeSeriesReducersMap = {
|
|
6864
7628
|
webmap: mapReducer,
|
|
6865
7629
|
services: serviceReducer,
|
|
@@ -6887,13 +7651,13 @@ var TimeSeriesTopRowButtonUnstyled = /*#__PURE__*/React.forwardRef(function (_re
|
|
|
6887
7651
|
shortText = _ref.shortText,
|
|
6888
7652
|
longText = _ref.longText,
|
|
6889
7653
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
6890
|
-
return jsxs(CustomToggleButton, Object.assign({}, props, {
|
|
7654
|
+
return /*#__PURE__*/jsxs(CustomToggleButton, Object.assign({}, props, {
|
|
6891
7655
|
ref: ref,
|
|
6892
7656
|
variant: "tool",
|
|
6893
|
-
children: [icon, jsx("span", {
|
|
7657
|
+
children: [icon, /*#__PURE__*/jsx("span", {
|
|
6894
7658
|
className: "longText",
|
|
6895
7659
|
children: longText
|
|
6896
|
-
}), jsx("span", {
|
|
7660
|
+
}), /*#__PURE__*/jsx("span", {
|
|
6897
7661
|
className: "shortText",
|
|
6898
7662
|
children: shortText
|
|
6899
7663
|
})]
|
|
@@ -6924,6 +7688,24 @@ var TimeSeriesTopRowButton = styled(TimeSeriesTopRowButtonUnstyled)({
|
|
|
6924
7688
|
}
|
|
6925
7689
|
});
|
|
6926
7690
|
|
|
7691
|
+
/* *
|
|
7692
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7693
|
+
* you may not use this file except in compliance with the License.
|
|
7694
|
+
* You may obtain a copy of the License at
|
|
7695
|
+
*
|
|
7696
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
7697
|
+
*
|
|
7698
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
7699
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
7700
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
7701
|
+
* See the License for the specific language governing permissions and
|
|
7702
|
+
* limitations under the License.
|
|
7703
|
+
*
|
|
7704
|
+
* Copyright 2025 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
7705
|
+
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
7706
|
+
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
7707
|
+
* */
|
|
7708
|
+
|
|
6927
7709
|
var LocationInfoButtonConnect = function LocationInfoButtonConnect(_ref) {
|
|
6928
7710
|
var panelId = _ref.panelId,
|
|
6929
7711
|
t = _ref.t;
|
|
@@ -6942,12 +7724,12 @@ var LocationInfoButtonConnect = function LocationInfoButtonConnect(_ref) {
|
|
|
6942
7724
|
}));
|
|
6943
7725
|
};
|
|
6944
7726
|
var isOpenForPanel = isOpenInStore && currentSourcePanelId === panelId;
|
|
6945
|
-
return jsx(CustomTooltip, {
|
|
7727
|
+
return /*#__PURE__*/jsx(CustomTooltip, {
|
|
6946
7728
|
title: t('timeseries-location-info-title'),
|
|
6947
|
-
children: jsx("span", {
|
|
6948
|
-
children: jsx(TimeSeriesTopRowButton, {
|
|
7729
|
+
children: /*#__PURE__*/jsx("span", {
|
|
7730
|
+
children: /*#__PURE__*/jsx(TimeSeriesTopRowButton, {
|
|
6949
7731
|
"data-testid": "timeSeriesLocationInfoButton",
|
|
6950
|
-
icon: jsx(Info, {}),
|
|
7732
|
+
icon: /*#__PURE__*/jsx(Info, {}),
|
|
6951
7733
|
longText: t('timeseries-location-info-button'),
|
|
6952
7734
|
onClick: handleClick,
|
|
6953
7735
|
selected: isOpenForPanel,
|
|
@@ -6957,12 +7739,30 @@ var LocationInfoButtonConnect = function LocationInfoButtonConnect(_ref) {
|
|
|
6957
7739
|
});
|
|
6958
7740
|
};
|
|
6959
7741
|
|
|
7742
|
+
/* *
|
|
7743
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7744
|
+
* you may not use this file except in compliance with the License.
|
|
7745
|
+
* You may obtain a copy of the License at
|
|
7746
|
+
*
|
|
7747
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
7748
|
+
*
|
|
7749
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
7750
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
7751
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
7752
|
+
* See the License for the specific language governing permissions and
|
|
7753
|
+
* limitations under the License.
|
|
7754
|
+
*
|
|
7755
|
+
* Copyright 2025 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
7756
|
+
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
7757
|
+
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
7758
|
+
* */
|
|
7759
|
+
|
|
6960
7760
|
var TimeSeriesMarkersSwitch = function TimeSeriesMarkersSwitch(_ref) {
|
|
6961
7761
|
var shouldHideMarkers = _ref.shouldHideMarkers,
|
|
6962
7762
|
toggleMarkers = _ref.toggleMarkers;
|
|
6963
7763
|
var _useTimeseriesTransla = useTimeseriesTranslation(),
|
|
6964
7764
|
t = _useTimeseriesTransla.t;
|
|
6965
|
-
return jsxs(Box, {
|
|
7765
|
+
return /*#__PURE__*/jsxs(Box, {
|
|
6966
7766
|
sx: {
|
|
6967
7767
|
display: 'flex',
|
|
6968
7768
|
flexWrap: 'wrap',
|
|
@@ -6987,18 +7787,18 @@ var TimeSeriesMarkersSwitch = function TimeSeriesMarkersSwitch(_ref) {
|
|
|
6987
7787
|
}
|
|
6988
7788
|
}
|
|
6989
7789
|
},
|
|
6990
|
-
children: [jsx(Typography, {
|
|
7790
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
6991
7791
|
className: "markers-label",
|
|
6992
7792
|
sx: {
|
|
6993
7793
|
marginTop: '4px'
|
|
6994
7794
|
},
|
|
6995
7795
|
variant: "body2",
|
|
6996
7796
|
children: t('timeseries-toggle-location-markers-label')
|
|
6997
|
-
}), jsx(Box, {
|
|
7797
|
+
}), /*#__PURE__*/jsx(Box, {
|
|
6998
7798
|
sx: {
|
|
6999
7799
|
marginTop: '-5px'
|
|
7000
7800
|
},
|
|
7001
|
-
children: jsx(SwitchButton, {
|
|
7801
|
+
children: /*#__PURE__*/jsx(SwitchButton, {
|
|
7002
7802
|
activeLabel: "ON",
|
|
7003
7803
|
checked: !shouldHideMarkers,
|
|
7004
7804
|
inActiveLabel: "OFF",
|
|
@@ -7024,6 +7824,7 @@ var createParameterNames = function createParameterNames(plotsWithData) {
|
|
|
7024
7824
|
plotTitles.set(plot.plotId, plot.title);
|
|
7025
7825
|
return plot.parametersWithData;
|
|
7026
7826
|
});
|
|
7827
|
+
|
|
7027
7828
|
// count all parameters with the same name
|
|
7028
7829
|
var duplicateParameterCount = new Map();
|
|
7029
7830
|
for (var _iterator = _createForOfIteratorHelperLoose(parameters), _step; !(_step = _iterator()).done;) {
|
|
@@ -7032,6 +7833,7 @@ var createParameterNames = function createParameterNames(plotsWithData) {
|
|
|
7032
7833
|
var name = getParameterDisplayName(parameter);
|
|
7033
7834
|
duplicateParameterCount.set(name, ((_duplicateParameterCo2 = duplicateParameterCount.get(name)) != null ? _duplicateParameterCo2 : 0) + 1);
|
|
7034
7835
|
}
|
|
7836
|
+
|
|
7035
7837
|
// count per plot how many duplicate names there are
|
|
7036
7838
|
var perBaseNamePlotCounters = new Map();
|
|
7037
7839
|
return parameters.map(function (parameter) {
|
|
@@ -7054,6 +7856,7 @@ var createParameterNames = function createParameterNames(plotsWithData) {
|
|
|
7054
7856
|
}
|
|
7055
7857
|
var idx = ((_plotCounters$get = plotCounters.get(parameter.plotId)) != null ? _plotCounters$get : 0) + 1;
|
|
7056
7858
|
plotCounters.set(parameter.plotId, idx);
|
|
7859
|
+
|
|
7057
7860
|
// First occurrence in this plot → just plotId
|
|
7058
7861
|
if (idx === 1) {
|
|
7059
7862
|
var _parameter$enabled2;
|
|
@@ -7063,6 +7866,7 @@ var createParameterNames = function createParameterNames(plotsWithData) {
|
|
|
7063
7866
|
enabled: (_parameter$enabled2 = parameter.enabled) != null ? _parameter$enabled2 : true
|
|
7064
7867
|
};
|
|
7065
7868
|
}
|
|
7869
|
+
|
|
7066
7870
|
// Subsequent occurrences → plotId + index (starting at 2)
|
|
7067
7871
|
return {
|
|
7068
7872
|
name: name + " (" + plotTitles.get(parameter.plotId) + " - " + idx + ")",
|
|
@@ -7087,6 +7891,7 @@ var paramIntervals = [{
|
|
|
7087
7891
|
maxNumberOfIntervals: 6,
|
|
7088
7892
|
minNumberOfIntervals: 2
|
|
7089
7893
|
}];
|
|
7894
|
+
|
|
7090
7895
|
// Expands the given initial interval up until the number of values on range gets less than a predefined maximum number.
|
|
7091
7896
|
var expandedInterval = function expandedInterval(min, max, initialInterval, maxNumberOfIntervals) {
|
|
7092
7897
|
if (min === Infinity) {
|
|
@@ -7101,6 +7906,7 @@ var expandedInterval = function expandedInterval(min, max, initialInterval, maxN
|
|
|
7101
7906
|
}
|
|
7102
7907
|
return interval;
|
|
7103
7908
|
};
|
|
7909
|
+
|
|
7104
7910
|
// Shrinks the given initial interval down until the number of values on range gets greater than a predefined minimum number.
|
|
7105
7911
|
var shrunkInterval = function shrunkInterval(min, max, initialInterval, minNumberOfIntervals) {
|
|
7106
7912
|
if (min === Infinity) {
|
|
@@ -7125,6 +7931,7 @@ var customizedInterval = function customizedInterval(min, max, propertyNames) {
|
|
|
7125
7931
|
if (foundInterval) {
|
|
7126
7932
|
var _paramIntervals$find2, _paramIntervals$find3, _paramIntervals$find4;
|
|
7127
7933
|
// Padding applied only if percentage value is not supposed to exceed 100 or get below 0 (like humidity percentage)
|
|
7934
|
+
|
|
7128
7935
|
var isHumidityNameFound = ((_paramIntervals$find2 = paramIntervals.find(function (pres) {
|
|
7129
7936
|
return propertyNames.find(function (name) {
|
|
7130
7937
|
return pres.propertyName && name.toLowerCase().includes(pres.propertyName.toLowerCase());
|
|
@@ -7547,6 +8354,7 @@ var CalculateTimeSpan = function CalculateTimeSpan(plotsWithData) {
|
|
|
7547
8354
|
var containsForecast = {
|
|
7548
8355
|
value: false
|
|
7549
8356
|
};
|
|
8357
|
+
|
|
7550
8358
|
// Loop over all plots and find min and max values for each dataset
|
|
7551
8359
|
plotsWithData.forEach(function (plot) {
|
|
7552
8360
|
var maxValue = {
|
|
@@ -7555,6 +8363,7 @@ var CalculateTimeSpan = function CalculateTimeSpan(plotsWithData) {
|
|
|
7555
8363
|
var minValue = {
|
|
7556
8364
|
value: undefined
|
|
7557
8365
|
};
|
|
8366
|
+
|
|
7558
8367
|
// Find the min and max values for all plots
|
|
7559
8368
|
plot.parametersWithData.forEach(function (parameter) {
|
|
7560
8369
|
var firstTimestep = parameter.timestep[0];
|
|
@@ -7598,10 +8407,29 @@ var CalculateTimeSpan = function CalculateTimeSpan(plotsWithData) {
|
|
|
7598
8407
|
return newTimeSpan;
|
|
7599
8408
|
};
|
|
7600
8409
|
|
|
8410
|
+
/* *
|
|
8411
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8412
|
+
* you may not use this file except in compliance with the License.
|
|
8413
|
+
* You may obtain a copy of the License at
|
|
8414
|
+
*
|
|
8415
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8416
|
+
*
|
|
8417
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
8418
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
8419
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
8420
|
+
* See the License for the specific language governing permissions and
|
|
8421
|
+
* limitations under the License.
|
|
8422
|
+
*
|
|
8423
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8424
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
8425
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
8426
|
+
* */
|
|
8427
|
+
|
|
7601
8428
|
var useChartHeight = function useChartHeight(_ref) {
|
|
7602
8429
|
var plotsWithData = _ref.plotsWithData,
|
|
7603
8430
|
shouldShowLegend = _ref.shouldShowLegend,
|
|
7604
|
-
option = _ref.option
|
|
8431
|
+
option = _ref.option,
|
|
8432
|
+
onLegendHeightChange = _ref.onLegendHeightChange;
|
|
7605
8433
|
var getDefaultHeight = function getDefaultHeight(plotsWithData) {
|
|
7606
8434
|
return 100 + PLOT_HEIGHT * plotsWithData.length;
|
|
7607
8435
|
};
|
|
@@ -7627,8 +8455,10 @@ var useChartHeight = function useChartHeight(_ref) {
|
|
|
7627
8455
|
var legendView = echartsInstance.getViewOfComponentModel(legend);
|
|
7628
8456
|
var _legendView$group$get = legendView.group.getBoundingRect(),
|
|
7629
8457
|
height = _legendView$group$get.height;
|
|
8458
|
+
onLegendHeightChange == null || onLegendHeightChange(shouldShowLegend ? height : 0);
|
|
7630
8459
|
var grid = (_option$grid = option.grid) != null ? _option$grid : [];
|
|
7631
8460
|
var gridArray = Array.isArray(grid) ? grid : [];
|
|
8461
|
+
|
|
7632
8462
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
7633
8463
|
var newGrid = gridArray.map(function (grid) {
|
|
7634
8464
|
return Object.assign({}, grid, {
|
|
@@ -7646,7 +8476,7 @@ var useChartHeight = function useChartHeight(_ref) {
|
|
|
7646
8476
|
var newHeight = getDefaultHeight(plotsWithData) + (shouldShowLegend ? height : 0);
|
|
7647
8477
|
setChartHeight(newHeight);
|
|
7648
8478
|
echartsInstance.resize();
|
|
7649
|
-
}, [option.grid, plotsWithData, shouldShowLegend]);
|
|
8479
|
+
}, [option.grid, plotsWithData, shouldShowLegend, onLegendHeightChange]);
|
|
7650
8480
|
React.useEffect(function () {
|
|
7651
8481
|
var onHeight = function onHeight() {
|
|
7652
8482
|
var _chartRef$current2;
|
|
@@ -7700,7 +8530,8 @@ var TimeSeriesChart = function TimeSeriesChart(_ref2) {
|
|
|
7700
8530
|
animation = _ref2$animation === void 0 ? false : _ref2$animation,
|
|
7701
8531
|
_ref2$shouldShowLegen = _ref2.shouldShowLegend,
|
|
7702
8532
|
shouldShowLegend = _ref2$shouldShowLegen === void 0 ? true : _ref2$shouldShowLegen,
|
|
7703
|
-
onToggleLegendParam = _ref2.onToggleLegendParam
|
|
8533
|
+
onToggleLegendParam = _ref2.onToggleLegendParam,
|
|
8534
|
+
onLegendHeightChange = _ref2.onLegendHeightChange;
|
|
7704
8535
|
var _useThemeContext = useThemeContext(),
|
|
7705
8536
|
namedTheme = _useThemeContext.namedTheme;
|
|
7706
8537
|
var isDark = (namedTheme == null ? void 0 : namedTheme.theme.palette.mode) === 'dark';
|
|
@@ -7715,17 +8546,19 @@ var TimeSeriesChart = function TimeSeriesChart(_ref2) {
|
|
|
7715
8546
|
var _useChartHeight = useChartHeight({
|
|
7716
8547
|
plotsWithData: enabledPlots,
|
|
7717
8548
|
shouldShowLegend: shouldShowLegend,
|
|
7718
|
-
option: optionWithZoom
|
|
8549
|
+
option: optionWithZoom,
|
|
8550
|
+
onLegendHeightChange: onLegendHeightChange
|
|
7719
8551
|
}),
|
|
7720
8552
|
chartHeight = _useChartHeight.chartHeight,
|
|
7721
8553
|
chartRef = _useChartHeight.chartRef,
|
|
7722
8554
|
updateHeight = _useChartHeight.updateHeight;
|
|
7723
|
-
return option ? jsx("div", {
|
|
8555
|
+
return option ? /*#__PURE__*/jsx("div", {
|
|
7724
8556
|
"data-testid": "TimeSeriesChart",
|
|
7725
|
-
children: jsx(ReactECharts, {
|
|
8557
|
+
children: /*#__PURE__*/jsx(ReactECharts, {
|
|
7726
8558
|
notMerge: true,
|
|
7727
|
-
onChartReady: updateHeight
|
|
8559
|
+
onChartReady: updateHeight
|
|
7728
8560
|
// noop, prevent flickering when toggling legend
|
|
8561
|
+
,
|
|
7729
8562
|
onEvents: {
|
|
7730
8563
|
finished: function finished() {},
|
|
7731
8564
|
datazoom: function datazoom(params) {
|
|
@@ -7760,42 +8593,189 @@ var TimeSeriesChart = function TimeSeriesChart(_ref2) {
|
|
|
7760
8593
|
}) : null;
|
|
7761
8594
|
};
|
|
7762
8595
|
|
|
7763
|
-
|
|
7764
|
-
|
|
7765
|
-
|
|
7766
|
-
|
|
7767
|
-
|
|
7768
|
-
|
|
7769
|
-
|
|
7770
|
-
|
|
7771
|
-
|
|
7772
|
-
|
|
8596
|
+
/* *
|
|
8597
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8598
|
+
* you may not use this file except in compliance with the License.
|
|
8599
|
+
* You may obtain a copy of the License at
|
|
8600
|
+
*
|
|
8601
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8602
|
+
*
|
|
8603
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
8604
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
8605
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
8606
|
+
* See the License for the specific language governing permissions and
|
|
8607
|
+
* limitations under the License.
|
|
8608
|
+
*
|
|
8609
|
+
* Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8610
|
+
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
8611
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
8612
|
+
* */
|
|
8613
|
+
|
|
8614
|
+
var getParameterKey = function getParameterKey(param) {
|
|
8615
|
+
return param.serviceId + "|" + param.collectionId + "|" + param.propertyName;
|
|
8616
|
+
};
|
|
8617
|
+
var PlotErrorBanners = function PlotErrorBanners(_ref) {
|
|
8618
|
+
var plotsWithData = _ref.plotsWithData,
|
|
8619
|
+
parametersFailingInAllPlots = _ref.parametersFailingInAllPlots,
|
|
8620
|
+
legendHeight = _ref.legendHeight,
|
|
8621
|
+
getErrorTitle = _ref.getErrorTitle,
|
|
8622
|
+
getErrorTranslationKey = _ref.getErrorTranslationKey,
|
|
8623
|
+
t = _ref.t;
|
|
8624
|
+
return /*#__PURE__*/jsx(Fragment, {
|
|
8625
|
+
children: plotsWithData.map(function (plot, index) {
|
|
8626
|
+
var _plot$failedParameter, _plot$errors;
|
|
8627
|
+
var parametersFailingKeys = new Set(parametersFailingInAllPlots.map(getParameterKey));
|
|
8628
|
+
var plotSpecificFailedParameters = ((_plot$failedParameter = plot.failedParameters) == null ? void 0 : _plot$failedParameter.filter(function (param) {
|
|
8629
|
+
return !parametersFailingKeys.has(getParameterKey(param));
|
|
8630
|
+
})) || [];
|
|
8631
|
+
if (plotSpecificFailedParameters.length === 0) {
|
|
8632
|
+
return null;
|
|
8633
|
+
}
|
|
8634
|
+
var errorTitle = getErrorTitle(plotSpecificFailedParameters);
|
|
8635
|
+
var errorKey = ((_plot$errors = plot.errors) == null ? void 0 : _plot$errors[0]) || 'error-message-general';
|
|
8636
|
+
var translationKey = getErrorTranslationKey(errorKey, plotSpecificFailedParameters.length);
|
|
8637
|
+
var errorInfo = t(translationKey);
|
|
8638
|
+
return /*#__PURE__*/jsx(Box, {
|
|
8639
|
+
sx: {
|
|
8640
|
+
position: 'absolute',
|
|
8641
|
+
top: legendHeight + PLOT_HEIGHT * index + 35,
|
|
8642
|
+
left: 0,
|
|
8643
|
+
right: 0,
|
|
8644
|
+
zIndex: 10,
|
|
8645
|
+
pointerEvents: 'none'
|
|
8646
|
+
},
|
|
8647
|
+
children: /*#__PURE__*/jsx(Box, {
|
|
8648
|
+
sx: {
|
|
8649
|
+
pointerEvents: 'auto'
|
|
8650
|
+
},
|
|
8651
|
+
children: /*#__PURE__*/jsx(AlertBanner, {
|
|
8652
|
+
info: errorInfo,
|
|
8653
|
+
shouldClose: true,
|
|
8654
|
+
title: errorTitle
|
|
8655
|
+
})
|
|
8656
|
+
})
|
|
8657
|
+
}, "error-" + plot.plotId);
|
|
8658
|
+
})
|
|
8659
|
+
});
|
|
8660
|
+
};
|
|
8661
|
+
var TimeSeriesView = /*#__PURE__*/React.memo(function (_ref2) {
|
|
8662
|
+
var plotPreset = _ref2.plotPreset,
|
|
8663
|
+
selectedLocation = _ref2.selectedLocation,
|
|
8664
|
+
services = _ref2.services,
|
|
8665
|
+
splitGeoJsonByCollection = _ref2.splitGeoJsonByCollection,
|
|
8666
|
+
isLoading = _ref2.isLoading,
|
|
8667
|
+
_ref2$shouldShowLegen = _ref2.shouldShowLegend,
|
|
8668
|
+
shouldShowLegend = _ref2$shouldShowLegen === void 0 ? true : _ref2$shouldShowLegen,
|
|
8669
|
+
onToggleLegendParam = _ref2.onToggleLegendParam,
|
|
8670
|
+
syncgroupTimeState = _ref2.syncgroupTimeState;
|
|
7773
8671
|
var _useTimeseriesTransla = useTimeseriesTranslation(),
|
|
7774
8672
|
t = _useTimeseriesTransla.t;
|
|
8673
|
+
var _React$useState = React.useState(0),
|
|
8674
|
+
legendHeight = _React$useState[0],
|
|
8675
|
+
setLegendHeight = _React$useState[1];
|
|
7775
8676
|
var _useGetPlotsWithData = useGetPlotsWithData(plotPreset, selectedLocation, services, splitGeoJsonByCollection, t, syncgroupTimeState),
|
|
7776
8677
|
plotsWithData = _useGetPlotsWithData.data,
|
|
7777
|
-
isFetchingPlots = _useGetPlotsWithData.isFetching
|
|
7778
|
-
error = _useGetPlotsWithData.error;
|
|
8678
|
+
isFetchingPlots = _useGetPlotsWithData.isFetching;
|
|
7779
8679
|
React.useEffect(function () {
|
|
7780
8680
|
if (isLoading) {
|
|
7781
8681
|
isLoading(isFetchingPlots);
|
|
7782
8682
|
}
|
|
7783
8683
|
}, [isFetchingPlots, isLoading]);
|
|
7784
|
-
|
|
8684
|
+
var getErrorTitle = function getErrorTitle(parameters) {
|
|
8685
|
+
var propertyNames = parameters.map(function (param) {
|
|
8686
|
+
return param.propertyName;
|
|
8687
|
+
});
|
|
8688
|
+
if (propertyNames.length > 1) {
|
|
8689
|
+
return "\"" + propertyNames.join('", "') + "\"";
|
|
8690
|
+
}
|
|
8691
|
+
return "\"" + (propertyNames[0] || '') + "\"";
|
|
8692
|
+
};
|
|
8693
|
+
var getErrorTranslationKey = function getErrorTranslationKey(errorKey, parameterCount) {
|
|
8694
|
+
// Use plural translation only when multiple parameters fail with error-message-general
|
|
8695
|
+
return errorKey === 'error-message-general' && parameterCount > 1 ? 'error-message-general-plural' : errorKey;
|
|
8696
|
+
};
|
|
8697
|
+
var getCombinedErrorInfo = React.useCallback(function (parametersFailingInAllPlots, plotsWithData, totalPlotCount) {
|
|
8698
|
+
var _plotsWithData$;
|
|
8699
|
+
if (parametersFailingInAllPlots.length === 0 || totalPlotCount === 0) {
|
|
8700
|
+
return '';
|
|
8701
|
+
}
|
|
8702
|
+
var errorKey = (plotsWithData == null || (_plotsWithData$ = plotsWithData[0]) == null || (_plotsWithData$ = _plotsWithData$.errors) == null ? void 0 : _plotsWithData$[0]) || 'error-message-general';
|
|
8703
|
+
var translationKey = getErrorTranslationKey(errorKey, parametersFailingInAllPlots.length);
|
|
8704
|
+
var errorMessage = t(translationKey);
|
|
8705
|
+
return totalPlotCount === 1 ? errorMessage : t('all-plots') + ": " + errorMessage;
|
|
8706
|
+
}, [t]);
|
|
8707
|
+
var getParametersFailingInAllPlots = function getParametersFailingInAllPlots(plotsWithData, totalPlotCount) {
|
|
8708
|
+
if (!plotsWithData || totalPlotCount === 0) {
|
|
8709
|
+
return [];
|
|
8710
|
+
}
|
|
8711
|
+
var parameterCounts = {};
|
|
8712
|
+
plotsWithData.forEach(function (plot) {
|
|
8713
|
+
var _plot$failedParameter2;
|
|
8714
|
+
(_plot$failedParameter2 = plot.failedParameters) == null || _plot$failedParameter2.forEach(function (param) {
|
|
8715
|
+
var key = getParameterKey(param);
|
|
8716
|
+
if (parameterCounts[key]) {
|
|
8717
|
+
parameterCounts[key].count += 1;
|
|
8718
|
+
} else {
|
|
8719
|
+
parameterCounts[key] = {
|
|
8720
|
+
count: 1,
|
|
8721
|
+
param: param
|
|
8722
|
+
};
|
|
8723
|
+
}
|
|
8724
|
+
});
|
|
8725
|
+
});
|
|
8726
|
+
return Object.values(parameterCounts).filter(function (_ref3) {
|
|
8727
|
+
var count = _ref3.count;
|
|
8728
|
+
return count === totalPlotCount;
|
|
8729
|
+
}).map(function (_ref4) {
|
|
8730
|
+
var param = _ref4.param;
|
|
8731
|
+
return param;
|
|
8732
|
+
});
|
|
8733
|
+
};
|
|
8734
|
+
var totalPlotCount = (plotsWithData == null ? void 0 : plotsWithData.length) || 0;
|
|
8735
|
+
var parametersFailingInAllPlots = React.useMemo(function () {
|
|
8736
|
+
return getParametersFailingInAllPlots(plotsWithData, totalPlotCount);
|
|
8737
|
+
}, [plotsWithData, totalPlotCount]);
|
|
8738
|
+
var hasParametersFailingInAllPlots = parametersFailingInAllPlots.length > 0;
|
|
8739
|
+
var combinedErrorTitle = getErrorTitle(parametersFailingInAllPlots);
|
|
8740
|
+
var combinedErrorInfo = React.useMemo(function () {
|
|
8741
|
+
return hasParametersFailingInAllPlots ? getCombinedErrorInfo(parametersFailingInAllPlots, plotsWithData, totalPlotCount) : '';
|
|
8742
|
+
}, [getCombinedErrorInfo, hasParametersFailingInAllPlots, parametersFailingInAllPlots, plotsWithData, totalPlotCount]);
|
|
8743
|
+
return /*#__PURE__*/jsxs(Box, {
|
|
7785
8744
|
"data-testid": "TimeSeriesView",
|
|
7786
|
-
|
|
7787
|
-
|
|
7788
|
-
|
|
7789
|
-
|
|
7790
|
-
|
|
7791
|
-
|
|
7792
|
-
|
|
7793
|
-
|
|
7794
|
-
|
|
7795
|
-
|
|
7796
|
-
|
|
7797
|
-
|
|
7798
|
-
|
|
8745
|
+
children: [hasParametersFailingInAllPlots ? /*#__PURE__*/jsx(Card, {
|
|
8746
|
+
sx: {
|
|
8747
|
+
border: 'solid 1px',
|
|
8748
|
+
borderColor: 'geowebColors.cards.cardContainerBorder',
|
|
8749
|
+
boxShadow: 'none'
|
|
8750
|
+
},
|
|
8751
|
+
children: /*#__PURE__*/jsx(Box, {
|
|
8752
|
+
"data-testid": "TimeSeriesView-alert-banner",
|
|
8753
|
+
children: /*#__PURE__*/jsx(AlertBanner, {
|
|
8754
|
+
info: combinedErrorInfo,
|
|
8755
|
+
shouldClose: true,
|
|
8756
|
+
title: combinedErrorTitle
|
|
8757
|
+
})
|
|
8758
|
+
})
|
|
8759
|
+
}) : null, !!plotsWithData && plotsWithData.length > 0 && /*#__PURE__*/jsxs(Card, {
|
|
8760
|
+
sx: {
|
|
8761
|
+
border: 'solid 1px',
|
|
8762
|
+
borderColor: 'geowebColors.cards.cardContainerBorder',
|
|
8763
|
+
boxShadow: 'none',
|
|
8764
|
+
position: 'relative'
|
|
8765
|
+
},
|
|
8766
|
+
children: [!!plotsWithData && plotsWithData.length > 0 && /*#__PURE__*/jsx(PlotErrorBanners, {
|
|
8767
|
+
getErrorTitle: getErrorTitle,
|
|
8768
|
+
getErrorTranslationKey: getErrorTranslationKey,
|
|
8769
|
+
legendHeight: legendHeight,
|
|
8770
|
+
parametersFailingInAllPlots: parametersFailingInAllPlots,
|
|
8771
|
+
plotsWithData: plotsWithData,
|
|
8772
|
+
t: t
|
|
8773
|
+
}), /*#__PURE__*/jsx(TimeSeriesChart, {
|
|
8774
|
+
onLegendHeightChange: setLegendHeight,
|
|
8775
|
+
onToggleLegendParam: onToggleLegendParam,
|
|
8776
|
+
plotsWithData: plotsWithData,
|
|
8777
|
+
shouldShowLegend: shouldShowLegend
|
|
8778
|
+
})]
|
|
7799
8779
|
})]
|
|
7800
8780
|
});
|
|
7801
8781
|
}, function (previousProps, nextProps) {
|
|
@@ -7804,10 +8784,29 @@ var TimeSeriesView = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
7804
8784
|
var sameLocation = isEqual(previousProps.selectedLocation, nextProps.selectedLocation);
|
|
7805
8785
|
var sameGeoJson = isEqual(previousProps.splitGeoJsonByCollection, nextProps.splitGeoJsonByCollection);
|
|
7806
8786
|
var sameLegend = previousProps.shouldShowLegend === nextProps.shouldShowLegend;
|
|
8787
|
+
var sameServices = isEqual(previousProps.services, nextProps.services);
|
|
7807
8788
|
var sameTime = ((_previousProps$syncgr = previousProps.syncgroupTimeState) == null ? void 0 : _previousProps$syncgr.start) === ((_nextProps$syncgroupT = nextProps.syncgroupTimeState) == null ? void 0 : _nextProps$syncgroupT.start) && ((_previousProps$syncgr2 = previousProps.syncgroupTimeState) == null ? void 0 : _previousProps$syncgr2.end) === ((_nextProps$syncgroupT2 = nextProps.syncgroupTimeState) == null ? void 0 : _nextProps$syncgroupT2.end);
|
|
7808
|
-
return samePreset && sameLocation && sameGeoJson && sameLegend && sameTime;
|
|
8789
|
+
return samePreset && sameLocation && sameGeoJson && sameLegend && sameServices && sameTime;
|
|
7809
8790
|
});
|
|
7810
8791
|
|
|
8792
|
+
/* *
|
|
8793
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8794
|
+
* you may not use this file except in compliance with the License.
|
|
8795
|
+
* You may obtain a copy of the License at
|
|
8796
|
+
*
|
|
8797
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8798
|
+
*
|
|
8799
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
8800
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
8801
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
8802
|
+
* See the License for the specific language governing permissions and
|
|
8803
|
+
* limitations under the License.
|
|
8804
|
+
*
|
|
8805
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8806
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
8807
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
8808
|
+
* */
|
|
8809
|
+
|
|
7811
8810
|
var TOOLTIP_TITLE = 'Timeseries Manager';
|
|
7812
8811
|
var TimeSeriesManagerMapButtonConnect = function TimeSeriesManagerMapButtonConnect(_ref) {
|
|
7813
8812
|
var viewId = _ref.viewId;
|
|
@@ -7828,13 +8827,13 @@ var TimeSeriesManagerMapButtonConnect = function TimeSeriesManagerMapButtonConne
|
|
|
7828
8827
|
}));
|
|
7829
8828
|
}, [currentSourcePanelId, dispatch, isOpenInStore, viewId]);
|
|
7830
8829
|
var isOpen = currentSourcePanelId === viewId && isOpenInStore;
|
|
7831
|
-
return jsx(CustomTooltip, {
|
|
8830
|
+
return /*#__PURE__*/jsx(CustomTooltip, {
|
|
7832
8831
|
title: TOOLTIP_TITLE,
|
|
7833
|
-
children: jsx("span", {
|
|
7834
|
-
children: jsx(TimeSeriesTopRowButton, {
|
|
8832
|
+
children: /*#__PURE__*/jsx("span", {
|
|
8833
|
+
children: /*#__PURE__*/jsx(TimeSeriesTopRowButton, {
|
|
7835
8834
|
"aria-label": t('timeseries-manager'),
|
|
7836
8835
|
"data-testid": "timeSeriesManagerButton",
|
|
7837
|
-
icon: jsx(Layers, {}),
|
|
8836
|
+
icon: /*#__PURE__*/jsx(Layers, {}),
|
|
7838
8837
|
longText: t('timeseries-ts-manager'),
|
|
7839
8838
|
onClick: openTimeSeriesManagerDialog,
|
|
7840
8839
|
selected: isOpen
|
|
@@ -7843,6 +8842,23 @@ var TimeSeriesManagerMapButtonConnect = function TimeSeriesManagerMapButtonConne
|
|
|
7843
8842
|
});
|
|
7844
8843
|
};
|
|
7845
8844
|
|
|
8845
|
+
/* *
|
|
8846
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8847
|
+
* you may not use this file except in compliance with the License.
|
|
8848
|
+
* You may obtain a copy of the License at
|
|
8849
|
+
*
|
|
8850
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8851
|
+
*
|
|
8852
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
8853
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
8854
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
8855
|
+
* See the License for the specific language governing permissions and
|
|
8856
|
+
* limitations under the License.
|
|
8857
|
+
*
|
|
8858
|
+
* Copyright 2025 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8859
|
+
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
8860
|
+
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
8861
|
+
* */
|
|
7846
8862
|
var LocationSelectButtonConnect = function LocationSelectButtonConnect(_ref) {
|
|
7847
8863
|
var _timeSeriesLocation$o;
|
|
7848
8864
|
var panelId = _ref.panelId;
|
|
@@ -7886,14 +8902,14 @@ var LocationSelectButtonConnect = function LocationSelectButtonConnect(_ref) {
|
|
|
7886
8902
|
}
|
|
7887
8903
|
};
|
|
7888
8904
|
}, [dispatch, panelId]);
|
|
7889
|
-
return jsx(CustomTooltip, {
|
|
8905
|
+
return /*#__PURE__*/jsx(CustomTooltip, {
|
|
7890
8906
|
title: selectedLocationName || t('timeseries-select-location'),
|
|
7891
|
-
children: jsx("span", {
|
|
7892
|
-
children: jsx(TimeSeriesTopRowButton, {
|
|
8907
|
+
children: /*#__PURE__*/jsx("span", {
|
|
8908
|
+
children: /*#__PURE__*/jsx(TimeSeriesTopRowButton, {
|
|
7893
8909
|
"aria-label": t('timeseries-location'),
|
|
7894
8910
|
"data-testid": "locationSelectButton",
|
|
7895
8911
|
disabled: isMapPinDisabled,
|
|
7896
|
-
icon: jsx(Location, {
|
|
8912
|
+
icon: /*#__PURE__*/jsx(Location, {
|
|
7897
8913
|
sx: {
|
|
7898
8914
|
'@container time-series-container (width < 720px)': {
|
|
7899
8915
|
display: 'none'
|
|
@@ -7909,6 +8925,24 @@ var LocationSelectButtonConnect = function LocationSelectButtonConnect(_ref) {
|
|
|
7909
8925
|
});
|
|
7910
8926
|
};
|
|
7911
8927
|
|
|
8928
|
+
/* *
|
|
8929
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8930
|
+
* you may not use this file except in compliance with the License.
|
|
8931
|
+
* You may obtain a copy of the License at
|
|
8932
|
+
*
|
|
8933
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8934
|
+
*
|
|
8935
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
8936
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
8937
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
8938
|
+
* See the License for the specific language governing permissions and
|
|
8939
|
+
* limitations under the License.
|
|
8940
|
+
*
|
|
8941
|
+
* Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8942
|
+
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
8943
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
8944
|
+
* */
|
|
8945
|
+
|
|
7912
8946
|
var getUniqueServicesFromPreset = function getUniqueServicesFromPreset(parameters, services) {
|
|
7913
8947
|
if (!parameters.length || !services.length) {
|
|
7914
8948
|
return [];
|
|
@@ -7928,6 +8962,7 @@ var getUniqueServicesFromPreset = function getUniqueServicesFromPreset(parameter
|
|
|
7928
8962
|
.filter(function (item) {
|
|
7929
8963
|
return item !== null;
|
|
7930
8964
|
});
|
|
8965
|
+
|
|
7931
8966
|
// Remove duplicates
|
|
7932
8967
|
var uniqueOptions = options.filter(function (current, index, array) {
|
|
7933
8968
|
return index === array.findIndex(function (item) {
|
|
@@ -7940,11 +8975,12 @@ var useMapPin = function useMapPin(_ref2) {
|
|
|
7940
8975
|
var panelId = _ref2.panelId;
|
|
7941
8976
|
var dispatch = useDispatch();
|
|
7942
8977
|
var selectedMapIds = useSelector(function (state) {
|
|
7943
|
-
return genericSelectors.
|
|
8978
|
+
return genericSelectors.getLinkedTargetIds(state, panelId);
|
|
7944
8979
|
});
|
|
7945
8980
|
var isMapPinDisabled = useSelector(function (state) {
|
|
7946
8981
|
return getIsMapPinDisabled(state, panelId);
|
|
7947
8982
|
});
|
|
8983
|
+
|
|
7948
8984
|
/* Make sure the mappin is visible when linking new maps */
|
|
7949
8985
|
useEffect(function () {
|
|
7950
8986
|
var toggleMapPinVisibility = function toggleMapPinVisibility(displayMapPin) {
|
|
@@ -7999,7 +9035,7 @@ var TimeSeriesConnect = function TimeSeriesConnect(_ref3) {
|
|
|
7999
9035
|
return getPlotState(state, panelId);
|
|
8000
9036
|
});
|
|
8001
9037
|
var linkedMapIds = useSelector(function (state) {
|
|
8002
|
-
return genericSelectors.
|
|
9038
|
+
return genericSelectors.getLinkedTargetIds(state, panelId);
|
|
8003
9039
|
});
|
|
8004
9040
|
var panelMapId = (_linkedMapIds$ = linkedMapIds == null ? void 0 : linkedMapIds[0]) != null ? _linkedMapIds$ : plotPresetState == null ? void 0 : plotPresetState.mapId;
|
|
8005
9041
|
var timeSeriesLocation = useSelector(function (state) {
|
|
@@ -8091,10 +9127,12 @@ var TimeSeriesConnect = function TimeSeriesConnect(_ref3) {
|
|
|
8091
9127
|
var _useGetLocations = useGetLocations(serviceListForLocations),
|
|
8092
9128
|
locationsData = _useGetLocations.data,
|
|
8093
9129
|
isLocationsFetching = _useGetLocations.isFetching;
|
|
9130
|
+
|
|
8094
9131
|
/* Set the loading state based on the locations fetching status */
|
|
8095
9132
|
useEffect(function () {
|
|
8096
9133
|
isLoading(isLocationsFetching);
|
|
8097
9134
|
}, [isLoading, isLocationsFetching]);
|
|
9135
|
+
|
|
8098
9136
|
/* Create GeoJSON arrays and draw the geojson layer based on the locationsData */
|
|
8099
9137
|
useEffect(function () {
|
|
8100
9138
|
if (stableServices.length) {
|
|
@@ -8137,7 +9175,7 @@ var TimeSeriesConnect = function TimeSeriesConnect(_ref3) {
|
|
|
8137
9175
|
}));
|
|
8138
9176
|
};
|
|
8139
9177
|
var syncgroupTimeState = useSyncgroupTimeState(panelId, 1000);
|
|
8140
|
-
return jsxs(Stack, {
|
|
9178
|
+
return /*#__PURE__*/jsxs(Stack, {
|
|
8141
9179
|
"data-testid": "TimeSeriesConnect",
|
|
8142
9180
|
sx: {
|
|
8143
9181
|
padding: '20px',
|
|
@@ -8147,7 +9185,7 @@ var TimeSeriesConnect = function TimeSeriesConnect(_ref3) {
|
|
|
8147
9185
|
containerType: 'inline-size',
|
|
8148
9186
|
containerName: 'time-series-container'
|
|
8149
9187
|
},
|
|
8150
|
-
children: [jsxs(Stack, {
|
|
9188
|
+
children: [/*#__PURE__*/jsxs(Stack, {
|
|
8151
9189
|
direction: "row",
|
|
8152
9190
|
spacing: 1,
|
|
8153
9191
|
sx: {
|
|
@@ -8155,19 +9193,19 @@ var TimeSeriesConnect = function TimeSeriesConnect(_ref3) {
|
|
|
8155
9193
|
marginBottom: '4px',
|
|
8156
9194
|
marginLeft: '10px'
|
|
8157
9195
|
},
|
|
8158
|
-
children: [jsx(TimeSeriesManagerMapButtonConnect, {
|
|
9196
|
+
children: [/*#__PURE__*/jsx(TimeSeriesManagerMapButtonConnect, {
|
|
8159
9197
|
viewId: panelId
|
|
8160
|
-
}), !!geojson && jsx(LocationSelectButtonConnect, {
|
|
9198
|
+
}), !!geojson && /*#__PURE__*/jsx(LocationSelectButtonConnect, {
|
|
8161
9199
|
panelId: panelId
|
|
8162
|
-
}), jsx(LocationInfoButtonConnect, {
|
|
9200
|
+
}), /*#__PURE__*/jsx(LocationInfoButtonConnect, {
|
|
8163
9201
|
panelId: panelId,
|
|
8164
9202
|
t: t
|
|
8165
|
-
}), jsx(CustomTooltip, {
|
|
9203
|
+
}), /*#__PURE__*/jsx(CustomTooltip, {
|
|
8166
9204
|
title: isMapPinDisabled ? t('timeseries-unlock-location') : t('timeseries-lock-location'),
|
|
8167
|
-
children: jsx("span", {
|
|
8168
|
-
children: jsx(TimeSeriesTopRowButton, {
|
|
9205
|
+
children: /*#__PURE__*/jsx("span", {
|
|
9206
|
+
children: /*#__PURE__*/jsx(TimeSeriesTopRowButton, {
|
|
8169
9207
|
"data-testid": "toggleLockLocationButton",
|
|
8170
|
-
icon: isMapPinDisabled ? jsx(LockLocked, {}) : jsx(LockUnlocked, {}),
|
|
9208
|
+
icon: isMapPinDisabled ? /*#__PURE__*/jsx(LockLocked, {}) : /*#__PURE__*/jsx(LockUnlocked, {}),
|
|
8171
9209
|
longText: isMapPinDisabled ? t('timeseries-unlock-location') : t('timeseries-lock-location'),
|
|
8172
9210
|
onClick: function onClick() {
|
|
8173
9211
|
return toggleDisableMapPin();
|
|
@@ -8175,25 +9213,25 @@ var TimeSeriesConnect = function TimeSeriesConnect(_ref3) {
|
|
|
8175
9213
|
selected: isMapPinDisabled
|
|
8176
9214
|
})
|
|
8177
9215
|
})
|
|
8178
|
-
}), jsx(TimeSeriesMarkersSwitch, {
|
|
9216
|
+
}), /*#__PURE__*/jsx(TimeSeriesMarkersSwitch, {
|
|
8179
9217
|
shouldHideMarkers: shouldHideLocationMarkers,
|
|
8180
9218
|
toggleMarkers: toggleLocationMarkers
|
|
8181
|
-
}), jsx(CustomTooltip, {
|
|
9219
|
+
}), /*#__PURE__*/jsx(CustomTooltip, {
|
|
8182
9220
|
title: shouldShowLegend ? t('timeseries-legend-tooltip-hide') : t('timeseries-legend-tooltip-show'),
|
|
8183
|
-
children: jsx("span", {
|
|
8184
|
-
children: jsx(TimeSeriesTopRowButton, {
|
|
8185
|
-
icon: jsx(Menu, {}),
|
|
9221
|
+
children: /*#__PURE__*/jsx("span", {
|
|
9222
|
+
children: /*#__PURE__*/jsx(TimeSeriesTopRowButton, {
|
|
9223
|
+
icon: /*#__PURE__*/jsx(Menu, {}),
|
|
8186
9224
|
longText: t('timeseries-legend'),
|
|
8187
9225
|
onClick: toggleLegend,
|
|
8188
9226
|
selected: shouldShowLegend
|
|
8189
9227
|
})
|
|
8190
9228
|
})
|
|
8191
9229
|
})]
|
|
8192
|
-
}), !!timeSeriesLocation && !!plotPresetState && jsx(Box, {
|
|
9230
|
+
}), !!timeSeriesLocation && !!plotPresetState && /*#__PURE__*/jsx(Box, {
|
|
8193
9231
|
sx: {
|
|
8194
9232
|
overflow: 'auto'
|
|
8195
9233
|
},
|
|
8196
|
-
children: !!services && jsx(TimeSeriesView, {
|
|
9234
|
+
children: !!services && /*#__PURE__*/jsx(TimeSeriesView, {
|
|
8197
9235
|
isLoading: isLoading,
|
|
8198
9236
|
onToggleLegendParam: onToggleLegendParam,
|
|
8199
9237
|
plotPreset: plotPresetState,
|
|
@@ -8207,13 +9245,33 @@ var TimeSeriesConnect = function TimeSeriesConnect(_ref3) {
|
|
|
8207
9245
|
});
|
|
8208
9246
|
};
|
|
8209
9247
|
|
|
9248
|
+
/* *
|
|
9249
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9250
|
+
* you may not use this file except in compliance with the License.
|
|
9251
|
+
* You may obtain a copy of the License at
|
|
9252
|
+
*
|
|
9253
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9254
|
+
*
|
|
9255
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
9256
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9257
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9258
|
+
* See the License for the specific language governing permissions and
|
|
9259
|
+
* limitations under the License.
|
|
9260
|
+
*
|
|
9261
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9262
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
9263
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
9264
|
+
* */
|
|
9265
|
+
|
|
8210
9266
|
var TimeSeriesConnectWrapper = function TimeSeriesConnectWrapper(_ref) {
|
|
8211
9267
|
var panelId = _ref.panelId,
|
|
8212
9268
|
timeSeriesPreset = _ref.timeSeriesPreset,
|
|
8213
9269
|
hideLocationMarkers = _ref.hideLocationMarkers;
|
|
8214
9270
|
var dispatch = useDispatch();
|
|
9271
|
+
|
|
8215
9272
|
// The preset should only be set once the component is mounted or when it has changed.
|
|
8216
9273
|
var timeSeriesPresetRef = React.useRef();
|
|
9274
|
+
|
|
8217
9275
|
// Load services from localstorage before timeseriespresets are loaded as after that preset registering action can change ids accordingly
|
|
8218
9276
|
React.useEffect(function () {
|
|
8219
9277
|
var localStorageServices = getUserAddedEDRServices();
|
|
@@ -8232,11 +9290,28 @@ var TimeSeriesConnectWrapper = function TimeSeriesConnectWrapper(_ref) {
|
|
|
8232
9290
|
}));
|
|
8233
9291
|
}
|
|
8234
9292
|
}, [dispatch, timeSeriesPreset, timeSeriesPresetRef, hideLocationMarkers, panelId]);
|
|
8235
|
-
return jsx(TimeSeriesConnect, {
|
|
9293
|
+
return /*#__PURE__*/jsx(TimeSeriesConnect, {
|
|
8236
9294
|
panelId: panelId
|
|
8237
9295
|
});
|
|
8238
9296
|
};
|
|
8239
9297
|
|
|
9298
|
+
/* *
|
|
9299
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9300
|
+
* you may not use this file except in compliance with the License.
|
|
9301
|
+
* You may obtain a copy of the License at
|
|
9302
|
+
*
|
|
9303
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9304
|
+
*
|
|
9305
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
9306
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9307
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9308
|
+
* See the License for the specific language governing permissions and
|
|
9309
|
+
* limitations under the License.
|
|
9310
|
+
*
|
|
9311
|
+
* Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9312
|
+
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
9313
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
9314
|
+
* */
|
|
8240
9315
|
/**
|
|
8241
9316
|
* The lookup table is for registering your own components with the workspace.
|
|
8242
9317
|
* @param payload
|
|
@@ -8249,7 +9324,7 @@ var componentsLookUp = function componentsLookUp(_ref) {
|
|
|
8249
9324
|
switch (componentType) {
|
|
8250
9325
|
case 'TimeSeries':
|
|
8251
9326
|
{
|
|
8252
|
-
return jsx(TimeSeriesConnectWrapper, {
|
|
9327
|
+
return /*#__PURE__*/jsx(TimeSeriesConnectWrapper, {
|
|
8253
9328
|
hideLocationMarkers: initialProps.hideLocationMarkers,
|
|
8254
9329
|
panelId: panelId,
|
|
8255
9330
|
timeSeriesPreset: {
|
|
@@ -8263,13 +9338,31 @@ var componentsLookUp = function componentsLookUp(_ref) {
|
|
|
8263
9338
|
}
|
|
8264
9339
|
};
|
|
8265
9340
|
|
|
9341
|
+
/* *
|
|
9342
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9343
|
+
* you may not use this file except in compliance with the License.
|
|
9344
|
+
* You may obtain a copy of the License at
|
|
9345
|
+
*
|
|
9346
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9347
|
+
*
|
|
9348
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
9349
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9350
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9351
|
+
* See the License for the specific language governing permissions and
|
|
9352
|
+
* limitations under the License.
|
|
9353
|
+
*
|
|
9354
|
+
* Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9355
|
+
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
9356
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
9357
|
+
* */
|
|
9358
|
+
|
|
8266
9359
|
var LocationDropdownHeader = function LocationDropdownHeader(_ref) {
|
|
8267
9360
|
var searchTerm = _ref.searchTerm,
|
|
8268
9361
|
setSearchTerm = _ref.setSearchTerm;
|
|
8269
9362
|
var _useTimeseriesTransla = useTimeseriesTranslation(),
|
|
8270
9363
|
t = _useTimeseriesTransla.t;
|
|
8271
9364
|
t('timeseries-locataion-dropdown-select-all');
|
|
8272
|
-
return jsxs(Grid, {
|
|
9365
|
+
return /*#__PURE__*/jsxs(Grid, {
|
|
8273
9366
|
container: true,
|
|
8274
9367
|
spacing: 1,
|
|
8275
9368
|
sx: {
|
|
@@ -8277,12 +9370,12 @@ var LocationDropdownHeader = function LocationDropdownHeader(_ref) {
|
|
|
8277
9370
|
backgroundColor: 'geowebColors.background.surface',
|
|
8278
9371
|
width: '100%'
|
|
8279
9372
|
},
|
|
8280
|
-
children: [jsx(Grid, {
|
|
9373
|
+
children: [/*#__PURE__*/jsx(Grid, {
|
|
8281
9374
|
container: true,
|
|
8282
9375
|
sx: {
|
|
8283
9376
|
width: '100%'
|
|
8284
9377
|
},
|
|
8285
|
-
children: jsx(SearchField, {
|
|
9378
|
+
children: /*#__PURE__*/jsx(SearchField, {
|
|
8286
9379
|
searchFilter: searchTerm,
|
|
8287
9380
|
setSearchFilter: setSearchTerm,
|
|
8288
9381
|
small: true
|
|
@@ -8291,6 +9384,24 @@ var LocationDropdownHeader = function LocationDropdownHeader(_ref) {
|
|
|
8291
9384
|
});
|
|
8292
9385
|
};
|
|
8293
9386
|
|
|
9387
|
+
/* *
|
|
9388
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9389
|
+
* you may not use this file except in compliance with the License.
|
|
9390
|
+
* You may obtain a copy of the License at
|
|
9391
|
+
*
|
|
9392
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9393
|
+
*
|
|
9394
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
9395
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9396
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9397
|
+
* See the License for the specific language governing permissions and
|
|
9398
|
+
* limitations under the License.
|
|
9399
|
+
*
|
|
9400
|
+
* Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9401
|
+
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
9402
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
9403
|
+
* */
|
|
9404
|
+
|
|
8294
9405
|
var OverflowTooltip = function OverflowTooltip(_ref) {
|
|
8295
9406
|
var text = _ref.text,
|
|
8296
9407
|
textContainerWidth = _ref.textContainerWidth,
|
|
@@ -8313,8 +9424,8 @@ var OverflowTooltip = function OverflowTooltip(_ref) {
|
|
|
8313
9424
|
var handleMouseLeave = function handleMouseLeave() {
|
|
8314
9425
|
setIsOverflowing(false);
|
|
8315
9426
|
};
|
|
8316
|
-
return jsxs(Fragment, {
|
|
8317
|
-
children: [jsx(Tooltip, {
|
|
9427
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
9428
|
+
children: [/*#__PURE__*/jsx(Tooltip, {
|
|
8318
9429
|
"data-testid": "overflowTooltip",
|
|
8319
9430
|
onClose: function onClose() {
|
|
8320
9431
|
return setIsOpen(false);
|
|
@@ -8327,13 +9438,13 @@ var OverflowTooltip = function OverflowTooltip(_ref) {
|
|
|
8327
9438
|
open: isOpen,
|
|
8328
9439
|
placement: "top",
|
|
8329
9440
|
title: isOverflowing ? text : '',
|
|
8330
|
-
children: jsx(Box, {
|
|
9441
|
+
children: /*#__PURE__*/jsx(Box, {
|
|
8331
9442
|
sx: {
|
|
8332
9443
|
maxWidth: '100%'
|
|
8333
9444
|
},
|
|
8334
9445
|
children: children
|
|
8335
9446
|
})
|
|
8336
|
-
}), jsx("div", {
|
|
9447
|
+
}), /*#__PURE__*/jsx("div", {
|
|
8337
9448
|
"data-testid": "measurementDiv",
|
|
8338
9449
|
ref: textMeasureRef,
|
|
8339
9450
|
style: {
|
|
@@ -8347,6 +9458,24 @@ var OverflowTooltip = function OverflowTooltip(_ref) {
|
|
|
8347
9458
|
});
|
|
8348
9459
|
};
|
|
8349
9460
|
|
|
9461
|
+
/* *
|
|
9462
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9463
|
+
* you may not use this file except in compliance with the License.
|
|
9464
|
+
* You may obtain a copy of the License at
|
|
9465
|
+
*
|
|
9466
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9467
|
+
*
|
|
9468
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
9469
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9470
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9471
|
+
* See the License for the specific language governing permissions and
|
|
9472
|
+
* limitations under the License.
|
|
9473
|
+
*
|
|
9474
|
+
* Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9475
|
+
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
9476
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
9477
|
+
* */
|
|
9478
|
+
|
|
8350
9479
|
var LocationListItem = function LocationListItem(_ref) {
|
|
8351
9480
|
var location = _ref.location,
|
|
8352
9481
|
handleChange = _ref.handleChange,
|
|
@@ -8410,6 +9539,7 @@ var LocationListItem = function LocationListItem(_ref) {
|
|
|
8410
9539
|
setTextContainerWidth(textContainerRef.current.clientWidth);
|
|
8411
9540
|
}
|
|
8412
9541
|
}, [textContainerRef]);
|
|
9542
|
+
|
|
8413
9543
|
// If selection state changes and this item is now the selected one, ensure it regains focus.
|
|
8414
9544
|
React.useEffect(function () {
|
|
8415
9545
|
if (selectedLocation === location && mouseMoveRef.current) {
|
|
@@ -8427,10 +9557,10 @@ var LocationListItem = function LocationListItem(_ref) {
|
|
|
8427
9557
|
});
|
|
8428
9558
|
}
|
|
8429
9559
|
}, [selectedLocation, location]);
|
|
8430
|
-
return jsx(OverflowTooltip, {
|
|
9560
|
+
return /*#__PURE__*/jsx(OverflowTooltip, {
|
|
8431
9561
|
text: location,
|
|
8432
9562
|
textContainerWidth: textContainerWidth,
|
|
8433
|
-
children: jsx("div", {
|
|
9563
|
+
children: /*#__PURE__*/jsx("div", {
|
|
8434
9564
|
"aria-selected": selectedLocation === location,
|
|
8435
9565
|
onBlur: handleMouseLeave,
|
|
8436
9566
|
onFocus: handleMouseEnter,
|
|
@@ -8459,7 +9589,7 @@ var LocationListItem = function LocationListItem(_ref) {
|
|
|
8459
9589
|
ref: mouseMoveRef,
|
|
8460
9590
|
role: "option",
|
|
8461
9591
|
tabIndex: 0,
|
|
8462
|
-
children: jsxs(ListItem, Object.assign({
|
|
9592
|
+
children: /*#__PURE__*/jsxs(ListItem, Object.assign({
|
|
8463
9593
|
"data-testid": "locationDropdownListItem",
|
|
8464
9594
|
role: "listitem"
|
|
8465
9595
|
}, !isDisabled && {
|
|
@@ -8474,11 +9604,11 @@ var LocationListItem = function LocationListItem(_ref) {
|
|
|
8474
9604
|
fontSize: '12px',
|
|
8475
9605
|
backgroundColor: isHovering ? theme.palette.geowebColors.buttons.tool.mouseOver.fill : undefined
|
|
8476
9606
|
},
|
|
8477
|
-
children: [jsx(ListItemIcon, {
|
|
9607
|
+
children: [/*#__PURE__*/jsx(ListItemIcon, {
|
|
8478
9608
|
sx: {
|
|
8479
9609
|
minWidth: '42px'
|
|
8480
9610
|
},
|
|
8481
|
-
children: jsx(Checkbox, {
|
|
9611
|
+
children: /*#__PURE__*/jsx(Checkbox, {
|
|
8482
9612
|
checked: selectedLocation === location,
|
|
8483
9613
|
color: "secondary",
|
|
8484
9614
|
disabled: isDisabled,
|
|
@@ -8503,11 +9633,12 @@ var LocationListItem = function LocationListItem(_ref) {
|
|
|
8503
9633
|
'&&:hover': {
|
|
8504
9634
|
backgroundColor: 'transparent'
|
|
8505
9635
|
}
|
|
8506
|
-
}
|
|
9636
|
+
}
|
|
8507
9637
|
// Remove from tab order so row wrapper is the single focus target
|
|
9638
|
+
,
|
|
8508
9639
|
tabIndex: -1
|
|
8509
9640
|
})
|
|
8510
|
-
}), jsx(Typography, {
|
|
9641
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
8511
9642
|
ref: textContainerRef,
|
|
8512
9643
|
sx: {
|
|
8513
9644
|
fontSize: '16px',
|
|
@@ -8524,6 +9655,24 @@ var LocationListItem = function LocationListItem(_ref) {
|
|
|
8524
9655
|
});
|
|
8525
9656
|
};
|
|
8526
9657
|
|
|
9658
|
+
/* *
|
|
9659
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9660
|
+
* you may not use this file except in compliance with the License.
|
|
9661
|
+
* You may obtain a copy of the License at
|
|
9662
|
+
*
|
|
9663
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9664
|
+
*
|
|
9665
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
9666
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9667
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9668
|
+
* See the License for the specific language governing permissions and
|
|
9669
|
+
* limitations under the License.
|
|
9670
|
+
*
|
|
9671
|
+
* Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9672
|
+
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
9673
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
9674
|
+
* */
|
|
9675
|
+
|
|
8527
9676
|
var RowComponent = function RowComponent(_ref) {
|
|
8528
9677
|
var _feature$properties;
|
|
8529
9678
|
var index = _ref.index,
|
|
@@ -8534,9 +9683,9 @@ var RowComponent = function RowComponent(_ref) {
|
|
|
8534
9683
|
_ref$isDisabled = _ref.isDisabled,
|
|
8535
9684
|
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled;
|
|
8536
9685
|
var feature = features[index];
|
|
8537
|
-
return jsx("div", {
|
|
9686
|
+
return /*#__PURE__*/jsx("div", {
|
|
8538
9687
|
style: Object.assign({}, style),
|
|
8539
|
-
children: jsx(LocationListItem, {
|
|
9688
|
+
children: /*#__PURE__*/jsx(LocationListItem, {
|
|
8540
9689
|
handleChange: handleChange,
|
|
8541
9690
|
isDisabled: isDisabled,
|
|
8542
9691
|
location: (_feature$properties = feature.properties) == null ? void 0 : _feature$properties.name,
|
|
@@ -8603,7 +9752,7 @@ var FocusableListWrapper = function FocusableListWrapper(_ref2) {
|
|
|
8603
9752
|
onKeyDown = _ref2.onKeyDown,
|
|
8604
9753
|
ariaLabel = _ref2['aria-label'];
|
|
8605
9754
|
var fv = useFocusVisible();
|
|
8606
|
-
return jsx("div", {
|
|
9755
|
+
return /*#__PURE__*/jsx("div", {
|
|
8607
9756
|
"aria-label": ariaLabel,
|
|
8608
9757
|
onBlur: fv.onBlur,
|
|
8609
9758
|
onFocus: fv.onFocus,
|
|
@@ -8688,7 +9837,7 @@ var LocationDropdown = function LocationDropdown(_ref3) {
|
|
|
8688
9837
|
behavior: 'smooth'
|
|
8689
9838
|
});
|
|
8690
9839
|
};
|
|
8691
|
-
return jsx(Box, {
|
|
9840
|
+
return /*#__PURE__*/jsx(Box, {
|
|
8692
9841
|
"data-testid": "locationDropdownContainer",
|
|
8693
9842
|
ref: listContainerRef,
|
|
8694
9843
|
sx: {
|
|
@@ -8697,9 +9846,9 @@ var LocationDropdown = function LocationDropdown(_ref3) {
|
|
|
8697
9846
|
overflowY: 'auto',
|
|
8698
9847
|
backgroundColor: 'geowebColors.background.surface'
|
|
8699
9848
|
},
|
|
8700
|
-
children: jsxs(Grid, {
|
|
9849
|
+
children: /*#__PURE__*/jsxs(Grid, {
|
|
8701
9850
|
container: true,
|
|
8702
|
-
children: [jsx(Grid, {
|
|
9851
|
+
children: [/*#__PURE__*/jsx(Grid, {
|
|
8703
9852
|
container: true,
|
|
8704
9853
|
size: {
|
|
8705
9854
|
xs: 12
|
|
@@ -8710,7 +9859,7 @@ var LocationDropdown = function LocationDropdown(_ref3) {
|
|
|
8710
9859
|
zIndex: 1,
|
|
8711
9860
|
backgroundColor: 'white'
|
|
8712
9861
|
},
|
|
8713
|
-
children: jsx(LocationDropdownHeader, {
|
|
9862
|
+
children: /*#__PURE__*/jsx(LocationDropdownHeader, {
|
|
8714
9863
|
searchTerm: searchTerm,
|
|
8715
9864
|
setSearchTerm: setSearchTerm
|
|
8716
9865
|
})
|
|
@@ -8719,17 +9868,18 @@ var LocationDropdown = function LocationDropdown(_ref3) {
|
|
|
8719
9868
|
var serviceName = object.serviceName,
|
|
8720
9869
|
collectionName = object.collectionName;
|
|
8721
9870
|
var collectionGeoJson = object.geoJson;
|
|
9871
|
+
|
|
8722
9872
|
// Find location from the collection that matches the selected location
|
|
8723
9873
|
var collectionSelectedLocation = collectionGeoJson.features.find(function (feature) {
|
|
8724
9874
|
var _feature$properties4;
|
|
8725
9875
|
return selectedLocationNames.includes((_feature$properties4 = feature.properties) == null ? void 0 : _feature$properties4.name);
|
|
8726
9876
|
});
|
|
8727
|
-
return jsx(Box, {
|
|
9877
|
+
return /*#__PURE__*/jsx(Box, {
|
|
8728
9878
|
"data-testid": "serviceDropdown",
|
|
8729
9879
|
sx: {
|
|
8730
9880
|
width: '100%'
|
|
8731
9881
|
},
|
|
8732
|
-
children: jsx(CustomAccordion, {
|
|
9882
|
+
children: /*#__PURE__*/jsx(CustomAccordion, {
|
|
8733
9883
|
amountOfItems: collectionGeoJson.features.length || 0,
|
|
8734
9884
|
"data-testid": "locationDropdownCollectionAccordion",
|
|
8735
9885
|
defaultExpanded: defaultExpanded || false,
|
|
@@ -8739,10 +9889,10 @@ var LocationDropdown = function LocationDropdown(_ref3) {
|
|
|
8739
9889
|
},
|
|
8740
9890
|
title: collectionName,
|
|
8741
9891
|
title2: serviceName,
|
|
8742
|
-
children: jsx(FocusableListWrapper, {
|
|
9892
|
+
children: /*#__PURE__*/jsx(FocusableListWrapper, {
|
|
8743
9893
|
"aria-label": "Locations list",
|
|
8744
9894
|
onKeyDown: handleKeyDown,
|
|
8745
|
-
children: jsx(List$1, {
|
|
9895
|
+
children: /*#__PURE__*/jsx(List$1, {
|
|
8746
9896
|
listRef: listRef,
|
|
8747
9897
|
rowComponent: RowComponent,
|
|
8748
9898
|
rowCount: collectionGeoJson.features.length,
|
|
@@ -8788,7 +9938,7 @@ var LocationSelectDialogConnect = function LocationSelectDialogConnect() {
|
|
|
8788
9938
|
return panelId ? genericSelectors.selectSharedData(state, panelId) : undefined;
|
|
8789
9939
|
});
|
|
8790
9940
|
var selectedMapIds = useSelector(function (state) {
|
|
8791
|
-
return panelId ? genericSelectors.
|
|
9941
|
+
return panelId ? genericSelectors.getLinkedTargetIds(state, panelId) : emptyMapIdList;
|
|
8792
9942
|
});
|
|
8793
9943
|
var isMapPinDisabled = useSelector(function (state) {
|
|
8794
9944
|
return panelId ? getIsMapPinDisabled(state, panelId) : false;
|
|
@@ -8874,7 +10024,7 @@ var LocationSelectDialogConnect = function LocationSelectDialogConnect() {
|
|
|
8874
10024
|
if (!panelId) {
|
|
8875
10025
|
return null;
|
|
8876
10026
|
}
|
|
8877
|
-
return jsx(ToolContainerDraggable, {
|
|
10027
|
+
return /*#__PURE__*/jsx(ToolContainerDraggable, {
|
|
8878
10028
|
bounds: "parent",
|
|
8879
10029
|
isOpen: isDialogOpen,
|
|
8880
10030
|
minWidth: 264,
|
|
@@ -8890,7 +10040,7 @@ var LocationSelectDialogConnect = function LocationSelectDialogConnect() {
|
|
|
8890
10040
|
height: 500
|
|
8891
10041
|
},
|
|
8892
10042
|
title: t('locations'),
|
|
8893
|
-
children: jsx(LocationDropdown, {
|
|
10043
|
+
children: /*#__PURE__*/jsx(LocationDropdown, {
|
|
8894
10044
|
geoJson: geojson,
|
|
8895
10045
|
handleChange: onChangeLocation,
|
|
8896
10046
|
isDisabled: isMapPinDisabled,
|