@opengeoweb/sigmet-airmet 4.17.0 → 4.19.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.d.ts +1 -0
- package/index.esm.js +360 -52
- package/index.umd.js +366 -48
- package/lib/components/ComponentsLookUp/AirmetComponentsLookUp.d.ts +11 -0
- package/lib/components/ComponentsLookUp/AirmetComponentsLookUp.spec.d.ts +1 -0
- package/lib/components/ComponentsLookUp/AviationProductApiWrapper.d.ts +9 -0
- package/lib/components/ComponentsLookUp/AviationProductApiWrapper.spec.d.ts +1 -0
- package/lib/components/ComponentsLookUp/SigmetComponentsLookUp.d.ts +11 -0
- package/lib/components/ComponentsLookUp/SigmetComponentsLookUp.spec.d.ts +1 -0
- package/lib/components/ComponentsLookUp/index.d.ts +2 -0
- package/lib/components/MapViewGeoJson/MapViewGeoJson.d.ts +2 -1
- package/lib/components/MapViewGeoJson/constants.d.ts +1 -1
- package/lib/components/MapViewGeoJson/utils.d.ts +3 -3
- package/lib/components/MetInfoWrapper/DownloadSigmetAirmetConfigWrapper.d.ts +1 -1
- package/lib/components/ProductForms/ProductFormFields/Levels.d.ts +2 -2
- package/lib/components/ProductForms/ProductFormFields/SelectFIR.d.ts +1 -1
- package/lib/components/ProductForms/utils.d.ts +3 -2
- package/lib/utils/api.d.ts +1 -1
- package/package.json +13 -12
package/index.d.ts
CHANGED
package/index.esm.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default from 'react';
|
|
3
|
-
import { Box, Button, FormControlLabel, Radio, Grid, Typography, Checkbox, MenuItem, FormHelperText, useTheme, Dialog, DialogTitle, DialogContent, Card, LinearProgress, List,
|
|
3
|
+
import { Box, Button, FormControlLabel, Radio, Grid, Typography, Checkbox, MenuItem, FormHelperText, useTheme, Dialog, DialogTitle, DialogContent, Card, LinearProgress, List, ListItemButton, Backdrop, CircularProgress } from '@mui/material';
|
|
4
4
|
import { useFormContext } from 'react-hook-form';
|
|
5
5
|
import { useDraftFormHelpers, ReactHookFormRadioGroup, ReactHookFormSelect, ReactHookFormNumberField, isInteger, isValidMax, isValidMin, isEmpty, ReactHookFormDateTime, isValidDate, isBefore, isBetween, hasMaxFeaturePoints, hasMulitpleIntersections, ReactHookFormHiddenInput, isMaximumOneDrawing, hasIntersectionWithFIR, isValidGeoJsonCoordinates, isXHoursBefore, isAfter, isXHoursAfter, ReactHookFormTextField, isLatitude, isNonOrBothCoordinates, isLongitude, ReactHookFormFormControl, isGeometryDirty, ReactHookFormProvider, defaultFormOptions } from '@opengeoweb/form-fields';
|
|
6
|
-
import { useApiContext, useApi, createApiInstance, createNonAuthApiInstance } from '@opengeoweb/api';
|
|
6
|
+
import { useApiContext, useApi, createApiInstance, createNonAuthApiInstance, ApiProvider } from '@opengeoweb/api';
|
|
7
7
|
import produce, { produce as produce$1 } from 'immer';
|
|
8
8
|
import * as turf from '@turf/turf';
|
|
9
9
|
import { polygonToLineString, booleanClockwise, rewind } from '@turf/turf';
|
|
10
10
|
import moment from 'moment';
|
|
11
|
-
import { ToggleMenu, CustomTooltip, useIsMounted, StatusTag, AlertBanner, ConfirmationServiceProvider, usePreventBrowserClose, useConfirmationDialog, isAxiosError, getAxiosErrorMessage, usePoller } from '@opengeoweb/shared';
|
|
11
|
+
import { ToggleMenu, CustomTooltip, useIsMounted, StatusTag, AlertBanner, ConfirmationServiceProvider, usePreventBrowserClose, useConfirmationDialog, isAxiosError, getAxiosErrorMessage, usePoller, ErrorBoundary } from '@opengeoweb/shared';
|
|
12
12
|
import { layerTypes, mapSelectors, generateMapId, generateTimesliderId, SyncGroups, generateLayerId, mapActions, publicLayers, MapControls, LayerManagerMapButtonConnect, LegendMapButtonConnect, MultiDimensionSelectMapButtonsConnect, MapViewConnect, MapViewLayer, TimeSliderConnect, LegendConnect, DockedLayerManagerConnect } from '@opengeoweb/core';
|
|
13
13
|
import { Location, DrawRegion, DrawPolygon, DrawFIRLand, Delete, ChevronLeft, Edit, Success, Clock } from '@opengeoweb/theme';
|
|
14
14
|
import { debounce } from 'lodash';
|
|
@@ -294,10 +294,10 @@ var StartOrEndDrawing;
|
|
|
294
294
|
|
|
295
295
|
var srsAndBboxDefault = {
|
|
296
296
|
bbox: {
|
|
297
|
-
left: -
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
297
|
+
left: -911501,
|
|
298
|
+
right: 3738819,
|
|
299
|
+
top: 11688874,
|
|
300
|
+
bottom: 5930186
|
|
301
301
|
},
|
|
302
302
|
srs: 'EPSG:3857'
|
|
303
303
|
};
|
|
@@ -443,7 +443,10 @@ var geoJSONTemplate = {
|
|
|
443
443
|
};
|
|
444
444
|
|
|
445
445
|
var getHoursBeforeValidity = function getHoursBeforeValidity(phenomenon, fir, config) {
|
|
446
|
-
if (!fir)
|
|
446
|
+
if (!fir) {
|
|
447
|
+
return 4;
|
|
448
|
+
}
|
|
449
|
+
|
|
447
450
|
var _config$fir_areas$fir = config.fir_areas[fir],
|
|
448
451
|
hours_before_validity = _config$fir_areas$fir.hours_before_validity,
|
|
449
452
|
va_hours_before_validity = _config$fir_areas$fir.va_hours_before_validity,
|
|
@@ -463,7 +466,10 @@ var getHoursBeforeValidity = function getHoursBeforeValidity(phenomenon, fir, co
|
|
|
463
466
|
}
|
|
464
467
|
};
|
|
465
468
|
var getMaxHoursOfValidity = function getMaxHoursOfValidity(phenomenon, fir, config) {
|
|
466
|
-
if (!fir)
|
|
469
|
+
if (!fir) {
|
|
470
|
+
return 4;
|
|
471
|
+
}
|
|
472
|
+
|
|
467
473
|
var _config$fir_areas$fir2 = config.fir_areas[fir],
|
|
468
474
|
max_hours_of_validity = _config$fir_areas$fir2.max_hours_of_validity,
|
|
469
475
|
va_max_hours_of_validity = _config$fir_areas$fir2.va_max_hours_of_validity,
|
|
@@ -595,13 +601,25 @@ var getFirOptions = function getFirOptions(productConfig) {
|
|
|
595
601
|
return optionsFIR;
|
|
596
602
|
};
|
|
597
603
|
var getLevelInFeet = function getLevelInFeet(level, unit) {
|
|
598
|
-
if (LevelUnits[unit] === 'm')
|
|
599
|
-
|
|
604
|
+
if (LevelUnits[unit] === 'm') {
|
|
605
|
+
return level / 0.3048;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
if (LevelUnits[unit] === 'FL') {
|
|
609
|
+
return level * 100;
|
|
610
|
+
}
|
|
611
|
+
|
|
600
612
|
return level;
|
|
601
613
|
};
|
|
602
614
|
var isLevelLower = function isLevelLower(ownValue, ownUnit, otherValue, otherUnit) {
|
|
603
|
-
if (typeof ownValue === 'string' && !ownValue.length)
|
|
604
|
-
|
|
615
|
+
if (typeof ownValue === 'string' && !ownValue.length) {
|
|
616
|
+
return true;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
if (ownUnit === otherUnit && typeof ownValue === 'number') {
|
|
620
|
+
return ownValue < otherValue;
|
|
621
|
+
} // not same units - convert both to feet and compare
|
|
622
|
+
|
|
605
623
|
|
|
606
624
|
var ownValueFeet = getLevelInFeet(ownValue, ownUnit);
|
|
607
625
|
var otherValueFeet = getLevelInFeet(otherValue, otherUnit);
|
|
@@ -626,7 +644,10 @@ var getDialogtitle = function getDialogtitle(product, productType) {
|
|
|
626
644
|
return "".concat(productName, " Cancels ").concat(product.cancelsAirmetSequenceId);
|
|
627
645
|
};
|
|
628
646
|
var getProductFormMode = function getProductFormMode(canBeOptions, productListItem) {
|
|
629
|
-
if (productListItem === null)
|
|
647
|
+
if (productListItem === null) {
|
|
648
|
+
return 'new';
|
|
649
|
+
}
|
|
650
|
+
|
|
630
651
|
return canBeOptions.includes('PUBLISHED') ? 'edit' : 'view';
|
|
631
652
|
};
|
|
632
653
|
var buttonStyle = {
|
|
@@ -712,7 +733,7 @@ var getProductFormLifecycleButtons = function getProductFormLifecycleButtons(can
|
|
|
712
733
|
})));
|
|
713
734
|
};
|
|
714
735
|
var hasValue = function hasValue(value) {
|
|
715
|
-
return value !== null && value.toString() !== 'NaN';
|
|
736
|
+
return value !== null && value.toString() !== 'NaN' && value !== '';
|
|
716
737
|
};
|
|
717
738
|
var prepareFormValues = function prepareFormValues(product) {
|
|
718
739
|
return Object.keys(product).reduce(function (list, key) {
|
|
@@ -770,9 +791,19 @@ var createAirmetPostParameter = function createAirmetPostParameter(airmetToPost,
|
|
|
770
791
|
};
|
|
771
792
|
var getConfirmationDialogTitle = function getConfirmationDialogTitle(action, productType) {
|
|
772
793
|
var product = productType.toUpperCase();
|
|
773
|
-
|
|
774
|
-
if (action === '
|
|
775
|
-
|
|
794
|
+
|
|
795
|
+
if (action === 'CLOSED') {
|
|
796
|
+
return "Close ".concat(product);
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
if (action === 'DISCARDED') {
|
|
800
|
+
return "Discard ".concat(product);
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
if (action === 'PUBLISHED') {
|
|
804
|
+
return 'Publish';
|
|
805
|
+
}
|
|
806
|
+
|
|
776
807
|
return "Cancel ".concat(product);
|
|
777
808
|
};
|
|
778
809
|
var getConfirmationDialogContent = function getConfirmationDialogContent(action, productType) {
|
|
@@ -782,7 +813,9 @@ var getConfirmationDialogContent = function getConfirmationDialogContent(action,
|
|
|
782
813
|
return "Are you sure you would like to discard this ".concat(product, "? Its properties will be lost");
|
|
783
814
|
}
|
|
784
815
|
|
|
785
|
-
if (action === 'CLOSED')
|
|
816
|
+
if (action === 'CLOSED') {
|
|
817
|
+
return 'Do you want to save any changes made?';
|
|
818
|
+
}
|
|
786
819
|
|
|
787
820
|
if (action === 'PUBLISHED') {
|
|
788
821
|
return "Are you sure you want to publish this ".concat(product, "?");
|
|
@@ -916,6 +949,11 @@ var triggerValidations = function triggerValidations(fieldNames, getValues, trig
|
|
|
916
949
|
}
|
|
917
950
|
});
|
|
918
951
|
};
|
|
952
|
+
var getProjection = function getProjection(productConfig) {
|
|
953
|
+
var _a;
|
|
954
|
+
|
|
955
|
+
return ((_a = productConfig.mapPreset) === null || _a === void 0 ? void 0 : _a.proj) || undefined;
|
|
956
|
+
};
|
|
919
957
|
|
|
920
958
|
var getDrawModeFromSelectionType = function getDrawModeFromSelectionType(selectionType) {
|
|
921
959
|
switch (selectionType) {
|
|
@@ -943,7 +981,10 @@ var getDrawModeFromSelectionType = function getDrawModeFromSelectionType(selecti
|
|
|
943
981
|
|
|
944
982
|
|
|
945
983
|
var addFeatureProperties = function addFeatureProperties(geojson, featureProperties) {
|
|
946
|
-
if (!geojson)
|
|
984
|
+
if (!geojson) {
|
|
985
|
+
return null;
|
|
986
|
+
}
|
|
987
|
+
|
|
947
988
|
return produce(geojson, function (draft) {
|
|
948
989
|
if (draft.features && draft.features.length > 0 && draft.features[0].properties) {
|
|
949
990
|
Object.keys(featureProperties).forEach(function (key) {
|
|
@@ -1053,7 +1094,11 @@ var useDrawMode = function useDrawMode(productConfig, initialGeometry, currentSe
|
|
|
1053
1094
|
setLayersDrawModes(newGeoJSONDrawMode);
|
|
1054
1095
|
var intersections = createInterSections(_cleanGeoJSON);
|
|
1055
1096
|
setLayerGeoJSONs(intersections);
|
|
1056
|
-
|
|
1097
|
+
|
|
1098
|
+
if (updateCallback) {
|
|
1099
|
+
updateCallback(intersections);
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1057
1102
|
break;
|
|
1058
1103
|
}
|
|
1059
1104
|
|
|
@@ -1076,7 +1121,11 @@ var useDrawMode = function useDrawMode(productConfig, initialGeometry, currentSe
|
|
|
1076
1121
|
var _intersections = createInterSections(_cleanGeoJSON2);
|
|
1077
1122
|
|
|
1078
1123
|
setLayerGeoJSONs(_intersections);
|
|
1079
|
-
|
|
1124
|
+
|
|
1125
|
+
if (updateCallback) {
|
|
1126
|
+
updateCallback(_intersections);
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1080
1129
|
break;
|
|
1081
1130
|
}
|
|
1082
1131
|
|
|
@@ -1089,7 +1138,11 @@ var useDrawMode = function useDrawMode(productConfig, initialGeometry, currentSe
|
|
|
1089
1138
|
var _intersections2 = createInterSections(_cleanGeoJSON3);
|
|
1090
1139
|
|
|
1091
1140
|
setLayerGeoJSONs(_intersections2);
|
|
1092
|
-
|
|
1141
|
+
|
|
1142
|
+
if (updateCallback) {
|
|
1143
|
+
updateCallback(_intersections2);
|
|
1144
|
+
}
|
|
1145
|
+
|
|
1093
1146
|
break;
|
|
1094
1147
|
}
|
|
1095
1148
|
}
|
|
@@ -1505,8 +1558,8 @@ var DrawTools = function DrawTools(_ref) {
|
|
|
1505
1558
|
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
1506
1559
|
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
1507
1560
|
* */
|
|
1508
|
-
var DEFAULT_ROUNDING_LEVELS_FL =
|
|
1509
|
-
var DEFAULT_ROUNDING_LEVELS_FT =
|
|
1561
|
+
var DEFAULT_ROUNDING_LEVELS_FL = 5;
|
|
1562
|
+
var DEFAULT_ROUNDING_LEVELS_FT = 500;
|
|
1510
1563
|
var DEFAULT_ROUNDING_LEVELS_M = 1;
|
|
1511
1564
|
var getLevelInvalidStepsForFLUnitMessage = function getLevelInvalidStepsForFLUnitMessage() {
|
|
1512
1565
|
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEFAULT_ROUNDING_LEVELS_FL;
|
|
@@ -2258,7 +2311,9 @@ var noIntersectionMessage = 'The end position needs to be (partly) inside the FI
|
|
|
2258
2311
|
var maximum6PointsMessage = 'The end position drawing allows a maximum of 6 individual points';
|
|
2259
2312
|
|
|
2260
2313
|
var _validateMovementSteps = function validateMovementSteps(value, unit, productConfig, selectedFIR) {
|
|
2261
|
-
if (isEmpty(value))
|
|
2314
|
+
if (isEmpty(value)) {
|
|
2315
|
+
return true;
|
|
2316
|
+
}
|
|
2262
2317
|
|
|
2263
2318
|
var _getActiveFIRArea = getActiveFIRArea(selectedFIR, productConfig),
|
|
2264
2319
|
_getActiveFIRArea$mov = _getActiveFIRArea.movement_rounding_kt,
|
|
@@ -2934,7 +2989,9 @@ var getInvalidSurfaceVisibilityFrom750StepsMessage = function getInvalidSurfaceV
|
|
|
2934
2989
|
};
|
|
2935
2990
|
|
|
2936
2991
|
var _validateSurfaceVisibility = function validateSurfaceVisibility(value, productConfig, selectedFIR) {
|
|
2937
|
-
if (isEmpty(value))
|
|
2992
|
+
if (isEmpty(value)) {
|
|
2993
|
+
return true;
|
|
2994
|
+
}
|
|
2938
2995
|
|
|
2939
2996
|
var _getActiveFIRArea = getActiveFIRArea(selectedFIR, productConfig),
|
|
2940
2997
|
_getActiveFIRArea$vis = _getActiveFIRArea.visibility_rounding_below,
|
|
@@ -3064,7 +3121,9 @@ var invalidSurfaceWindDirectionStepsMessage = function invalidSurfaceWindDirecti
|
|
|
3064
3121
|
};
|
|
3065
3122
|
|
|
3066
3123
|
var _validateSurfaceWindDirection = function validateSurfaceWindDirection(value, productConfig, selectedFIR) {
|
|
3067
|
-
if (isEmpty(value))
|
|
3124
|
+
if (isEmpty(value)) {
|
|
3125
|
+
return true;
|
|
3126
|
+
}
|
|
3068
3127
|
|
|
3069
3128
|
var _getActiveFIRArea = getActiveFIRArea(selectedFIR, productConfig),
|
|
3070
3129
|
_getActiveFIRArea$win = _getActiveFIRArea.wind_direction_rounding,
|
|
@@ -3741,6 +3800,7 @@ var allowOneGeoJSONFeature = function allowOneGeoJSONFeature(mode, geojson) {
|
|
|
3741
3800
|
var MapViewGeoJson = function MapViewGeoJson(_ref) {
|
|
3742
3801
|
var geoJSONs = _ref.geoJSONs,
|
|
3743
3802
|
initialBaseLayers = _ref.baseLayers,
|
|
3803
|
+
initialProjection = _ref.projection,
|
|
3744
3804
|
_ref$setLayerGeoJSONs = _ref.setLayerGeoJSONs,
|
|
3745
3805
|
setLayerGeoJSONs = _ref$setLayerGeoJSONs === void 0 ? function () {} : _ref$setLayerGeoJSONs,
|
|
3746
3806
|
_ref$layerDrawModes = _ref.layerDrawModes,
|
|
@@ -3808,10 +3868,11 @@ var MapViewGeoJson = function MapViewGeoJson(_ref) {
|
|
|
3808
3868
|
mapId: mapId,
|
|
3809
3869
|
layers: baseLayers
|
|
3810
3870
|
}));
|
|
3871
|
+
var projection = initialProjection || srsAndBboxDefault;
|
|
3811
3872
|
dispatch(mapActions.setBbox({
|
|
3812
3873
|
mapId: mapId,
|
|
3813
|
-
bbox:
|
|
3814
|
-
srs:
|
|
3874
|
+
bbox: projection.bbox,
|
|
3875
|
+
srs: projection.srs
|
|
3815
3876
|
}));
|
|
3816
3877
|
syncGroupAddGroup({
|
|
3817
3878
|
groupId: 'Time_SigmetAirmet',
|
|
@@ -3922,6 +3983,7 @@ var ProductFormLayout = function ProductFormLayout(_a) {
|
|
|
3922
3983
|
|
|
3923
3984
|
var theme = useTheme();
|
|
3924
3985
|
var baseLayers = getBaseLayers(productConfig);
|
|
3986
|
+
var projection = getProjection(productConfig);
|
|
3925
3987
|
return /*#__PURE__*/React__default.createElement(Grid, {
|
|
3926
3988
|
container: true,
|
|
3927
3989
|
sx: _defineProperty({
|
|
@@ -3943,7 +4005,8 @@ var ProductFormLayout = function ProductFormLayout(_a) {
|
|
|
3943
4005
|
padding: 0
|
|
3944
4006
|
})
|
|
3945
4007
|
}, /*#__PURE__*/React__default.createElement(MapViewGeoJson, Object.assign({
|
|
3946
|
-
baseLayers: baseLayers
|
|
4008
|
+
baseLayers: baseLayers,
|
|
4009
|
+
projection: projection
|
|
3947
4010
|
}, geojsonProps))), /*#__PURE__*/React__default.createElement(Grid, {
|
|
3948
4011
|
item: true,
|
|
3949
4012
|
xs: 12,
|
|
@@ -4124,15 +4187,15 @@ var fir_areas$1 = {
|
|
|
4124
4187
|
"EGPX"
|
|
4125
4188
|
],
|
|
4126
4189
|
level_min: {
|
|
4127
|
-
FT:
|
|
4190
|
+
FT: 500,
|
|
4128
4191
|
FL: 50
|
|
4129
4192
|
},
|
|
4130
4193
|
level_max: {
|
|
4131
|
-
FT:
|
|
4194
|
+
FT: 4500,
|
|
4132
4195
|
FL: 650
|
|
4133
4196
|
},
|
|
4134
|
-
level_rounding_FL:
|
|
4135
|
-
level_rounding_FT:
|
|
4197
|
+
level_rounding_FL: 5,
|
|
4198
|
+
level_rounding_FT: 500,
|
|
4136
4199
|
level_rounding_M: 1,
|
|
4137
4200
|
movement_min: {
|
|
4138
4201
|
KT: 5,
|
|
@@ -5455,7 +5518,16 @@ var mapPreset$1 = {
|
|
|
5455
5518
|
format: "image/png",
|
|
5456
5519
|
enabled: true
|
|
5457
5520
|
}
|
|
5458
|
-
]
|
|
5521
|
+
],
|
|
5522
|
+
proj: {
|
|
5523
|
+
bbox: {
|
|
5524
|
+
left: -1205884.85699446,
|
|
5525
|
+
bottom: 5808323.764379622,
|
|
5526
|
+
right: 2219822.701688853,
|
|
5527
|
+
top: 8298305.647311475
|
|
5528
|
+
},
|
|
5529
|
+
srs: "EPSG:3857"
|
|
5530
|
+
}
|
|
5459
5531
|
};
|
|
5460
5532
|
var sigmetDefaultConfig = {
|
|
5461
5533
|
location_indicator_mwo: location_indicator_mwo$1,
|
|
@@ -5645,15 +5717,15 @@ var fir_areas = {
|
|
|
5645
5717
|
visibility_rounding_below: 50,
|
|
5646
5718
|
visibility_rounding_above: 100,
|
|
5647
5719
|
level_min: {
|
|
5648
|
-
FT:
|
|
5720
|
+
FT: 500,
|
|
5649
5721
|
FL: 50
|
|
5650
5722
|
},
|
|
5651
5723
|
level_max: {
|
|
5652
|
-
FT:
|
|
5724
|
+
FT: 4500,
|
|
5653
5725
|
FL: 100
|
|
5654
5726
|
},
|
|
5655
|
-
level_rounding_FL:
|
|
5656
|
-
level_rounding_FT:
|
|
5727
|
+
level_rounding_FL: 5,
|
|
5728
|
+
level_rounding_FT: 500,
|
|
5657
5729
|
level_rounding_M: 1,
|
|
5658
5730
|
movement_min: {
|
|
5659
5731
|
KT: 5,
|
|
@@ -6987,7 +7059,16 @@ var mapPreset = {
|
|
|
6987
7059
|
format: "image/png",
|
|
6988
7060
|
enabled: true
|
|
6989
7061
|
}
|
|
6990
|
-
]
|
|
7062
|
+
],
|
|
7063
|
+
proj: {
|
|
7064
|
+
bbox: {
|
|
7065
|
+
left: -1205884.85699446,
|
|
7066
|
+
bottom: 5808323.764379622,
|
|
7067
|
+
right: 2219822.701688853,
|
|
7068
|
+
top: 8298305.647311475
|
|
7069
|
+
},
|
|
7070
|
+
srs: "EPSG:3857"
|
|
7071
|
+
}
|
|
6991
7072
|
};
|
|
6992
7073
|
var airmetDefaultConfig = {
|
|
6993
7074
|
location_indicator_mwo: location_indicator_mwo,
|
|
@@ -7746,6 +7827,43 @@ var properties$1 = {
|
|
|
7746
7827
|
"layerType"
|
|
7747
7828
|
]
|
|
7748
7829
|
}
|
|
7830
|
+
},
|
|
7831
|
+
proj: {
|
|
7832
|
+
type: "object",
|
|
7833
|
+
properties: {
|
|
7834
|
+
bbox: {
|
|
7835
|
+
type: "object",
|
|
7836
|
+
properties: {
|
|
7837
|
+
left: {
|
|
7838
|
+
type: "number"
|
|
7839
|
+
},
|
|
7840
|
+
right: {
|
|
7841
|
+
type: "number"
|
|
7842
|
+
},
|
|
7843
|
+
top: {
|
|
7844
|
+
type: "number"
|
|
7845
|
+
},
|
|
7846
|
+
bottom: {
|
|
7847
|
+
type: "number"
|
|
7848
|
+
}
|
|
7849
|
+
},
|
|
7850
|
+
additionalProperties: false,
|
|
7851
|
+
required: [
|
|
7852
|
+
"left",
|
|
7853
|
+
"right",
|
|
7854
|
+
"top",
|
|
7855
|
+
"bottom"
|
|
7856
|
+
]
|
|
7857
|
+
},
|
|
7858
|
+
srs: {
|
|
7859
|
+
type: "string"
|
|
7860
|
+
}
|
|
7861
|
+
},
|
|
7862
|
+
additionalProperties: false,
|
|
7863
|
+
required: [
|
|
7864
|
+
"bbox",
|
|
7865
|
+
"srs"
|
|
7866
|
+
]
|
|
7749
7867
|
}
|
|
7750
7868
|
}
|
|
7751
7869
|
}
|
|
@@ -7904,6 +8022,43 @@ var properties = {
|
|
|
7904
8022
|
"layerType"
|
|
7905
8023
|
]
|
|
7906
8024
|
}
|
|
8025
|
+
},
|
|
8026
|
+
proj: {
|
|
8027
|
+
type: "object",
|
|
8028
|
+
properties: {
|
|
8029
|
+
bbox: {
|
|
8030
|
+
type: "object",
|
|
8031
|
+
properties: {
|
|
8032
|
+
left: {
|
|
8033
|
+
type: "number"
|
|
8034
|
+
},
|
|
8035
|
+
right: {
|
|
8036
|
+
type: "number"
|
|
8037
|
+
},
|
|
8038
|
+
top: {
|
|
8039
|
+
type: "number"
|
|
8040
|
+
},
|
|
8041
|
+
bottom: {
|
|
8042
|
+
type: "number"
|
|
8043
|
+
}
|
|
8044
|
+
},
|
|
8045
|
+
additionalProperties: false,
|
|
8046
|
+
required: [
|
|
8047
|
+
"left",
|
|
8048
|
+
"right",
|
|
8049
|
+
"top",
|
|
8050
|
+
"bottom"
|
|
8051
|
+
]
|
|
8052
|
+
},
|
|
8053
|
+
srs: {
|
|
8054
|
+
type: "string"
|
|
8055
|
+
}
|
|
8056
|
+
},
|
|
8057
|
+
additionalProperties: false,
|
|
8058
|
+
required: [
|
|
8059
|
+
"bbox",
|
|
8060
|
+
"srs"
|
|
8061
|
+
]
|
|
7907
8062
|
}
|
|
7908
8063
|
}
|
|
7909
8064
|
}
|
|
@@ -9063,9 +9218,8 @@ var ProductList = function ProductList(_ref) {
|
|
|
9063
9218
|
}
|
|
9064
9219
|
}, productList.map(function (productListItem, index) {
|
|
9065
9220
|
var product = productListItem[productType];
|
|
9066
|
-
return /*#__PURE__*/React__default.createElement(
|
|
9221
|
+
return /*#__PURE__*/React__default.createElement(ListItemButton, {
|
|
9067
9222
|
"data-testid": "productListItem",
|
|
9068
|
-
button: true,
|
|
9069
9223
|
onClick: function onClick() {
|
|
9070
9224
|
onClickProductRow(productListItem);
|
|
9071
9225
|
},
|
|
@@ -9452,8 +9606,12 @@ var MetInfoWrapper = function MetInfoWrapper(_ref) {
|
|
|
9452
9606
|
|
|
9453
9607
|
var toggleDialogOpen = function toggleDialogOpen() {
|
|
9454
9608
|
var shouldRefreshList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
9609
|
+
|
|
9455
9610
|
// Refresh list on closing dialog
|
|
9456
|
-
if (isFormDialogOpen === true && shouldRefreshList)
|
|
9611
|
+
if (isFormDialogOpen === true && shouldRefreshList) {
|
|
9612
|
+
getNewProductList();
|
|
9613
|
+
}
|
|
9614
|
+
|
|
9457
9615
|
setIsFormDialogOpen(!isFormDialogOpen);
|
|
9458
9616
|
};
|
|
9459
9617
|
|
|
@@ -9471,8 +9629,14 @@ var MetInfoWrapper = function MetInfoWrapper(_ref) {
|
|
|
9471
9629
|
};
|
|
9472
9630
|
|
|
9473
9631
|
return /*#__PURE__*/React__default.createElement(Box$1, {
|
|
9474
|
-
"data-testid": "sigmetAirmetComponent"
|
|
9632
|
+
"data-testid": "sigmetAirmetComponent",
|
|
9633
|
+
sx: {
|
|
9634
|
+
padding: '24px',
|
|
9635
|
+
height: '100%',
|
|
9636
|
+
overflowY: 'auto'
|
|
9637
|
+
}
|
|
9475
9638
|
}, /*#__PURE__*/React__default.createElement(ProductList, {
|
|
9639
|
+
"data-testid": "sigmetAirmetList",
|
|
9476
9640
|
productList: productList,
|
|
9477
9641
|
productType: productType,
|
|
9478
9642
|
isLoading: isLoadingList,
|
|
@@ -9508,14 +9672,14 @@ var ERROR_TITLE = 'Something went wrong with loading the configuration file';
|
|
|
9508
9672
|
|
|
9509
9673
|
var DownloadSigmetAirmetConfigWrapper = function DownloadSigmetAirmetConfigWrapper(_ref) {
|
|
9510
9674
|
var productType = _ref.productType,
|
|
9511
|
-
|
|
9675
|
+
productConfigKey = _ref.productConfigKey;
|
|
9512
9676
|
|
|
9513
9677
|
var _useApiContext = useApiContext(),
|
|
9514
9678
|
api = _useApiContext.api;
|
|
9515
9679
|
|
|
9516
9680
|
var getConfigurationRequest = api[productType === 'sigmet' ? 'getSigmetConfiguration' : 'getAirmetConfiguration'];
|
|
9517
9681
|
|
|
9518
|
-
var _useApi = useApi(getConfigurationRequest,
|
|
9682
|
+
var _useApi = useApi(getConfigurationRequest, productConfigKey),
|
|
9519
9683
|
productConfig = _useApi.result,
|
|
9520
9684
|
isConfigLoading = _useApi.isLoading,
|
|
9521
9685
|
error = _useApi.error;
|
|
@@ -9564,8 +9728,8 @@ var DownloadSigmetAirmetConfigWrapper = function DownloadSigmetAirmetConfigWrapp
|
|
|
9564
9728
|
|
|
9565
9729
|
var getApiRoutes = function getApiRoutes(axiosInstance, nonAuthAxiosInstance) {
|
|
9566
9730
|
return {
|
|
9567
|
-
getSigmetConfiguration: function getSigmetConfiguration(
|
|
9568
|
-
return nonAuthAxiosInstance.get("/assets/".concat(
|
|
9731
|
+
getSigmetConfiguration: function getSigmetConfiguration(productConfigKey) {
|
|
9732
|
+
return nonAuthAxiosInstance.get("/assets/".concat(productConfigKey));
|
|
9569
9733
|
},
|
|
9570
9734
|
getSigmetList: function getSigmetList() {
|
|
9571
9735
|
return axiosInstance.get('/sigmetlist');
|
|
@@ -9576,8 +9740,8 @@ var getApiRoutes = function getApiRoutes(axiosInstance, nonAuthAxiosInstance) {
|
|
|
9576
9740
|
getSigmetTAC: function getSigmetTAC(sigmetData) {
|
|
9577
9741
|
return axiosInstance.post('/sigmet2tac', Object.assign({}, sigmetData));
|
|
9578
9742
|
},
|
|
9579
|
-
getAirmetConfiguration: function getAirmetConfiguration(
|
|
9580
|
-
return nonAuthAxiosInstance.get("/assets/".concat(
|
|
9743
|
+
getAirmetConfiguration: function getAirmetConfiguration(productConfigKey) {
|
|
9744
|
+
return nonAuthAxiosInstance.get("/assets/".concat(productConfigKey));
|
|
9581
9745
|
},
|
|
9582
9746
|
getAirmetList: function getAirmetList() {
|
|
9583
9747
|
return axiosInstance.get('/airmetlist');
|
|
@@ -9597,4 +9761,148 @@ var createApi = function createApi(props) {
|
|
|
9597
9761
|
return getApiRoutes(axiosInstance, nonAuthAxiosInstance);
|
|
9598
9762
|
};
|
|
9599
9763
|
|
|
9600
|
-
|
|
9764
|
+
/* *
|
|
9765
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9766
|
+
* you may not use this file except in compliance with the License.
|
|
9767
|
+
* You may obtain a copy of the License at
|
|
9768
|
+
*
|
|
9769
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9770
|
+
*
|
|
9771
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
9772
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9773
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9774
|
+
* See the License for the specific language governing permissions and
|
|
9775
|
+
* limitations under the License.
|
|
9776
|
+
*
|
|
9777
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9778
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
9779
|
+
* */
|
|
9780
|
+
var AviationProductApiWrapper = function AviationProductApiWrapper(_ref) {
|
|
9781
|
+
var config = _ref.config,
|
|
9782
|
+
auth = _ref.auth,
|
|
9783
|
+
onSetAuth = _ref.onSetAuth,
|
|
9784
|
+
productConfigKey = _ref.productConfigKey,
|
|
9785
|
+
productType = _ref.productType;
|
|
9786
|
+
return config ? /*#__PURE__*/React.createElement(ApiProvider, {
|
|
9787
|
+
config: {
|
|
9788
|
+
baseURL: config.baseURL,
|
|
9789
|
+
appURL: config.appURL,
|
|
9790
|
+
authTokenURL: config.authTokenURL,
|
|
9791
|
+
authClientId: config.authClientId
|
|
9792
|
+
},
|
|
9793
|
+
auth: auth,
|
|
9794
|
+
onSetAuth: onSetAuth,
|
|
9795
|
+
createApi: createApi
|
|
9796
|
+
}, /*#__PURE__*/React.createElement(ErrorBoundary, null, /*#__PURE__*/React.createElement(DownloadSigmetAirmetConfigWrapper, {
|
|
9797
|
+
productType: productType,
|
|
9798
|
+
productConfigKey: productConfigKey
|
|
9799
|
+
}))) : null;
|
|
9800
|
+
};
|
|
9801
|
+
|
|
9802
|
+
/* *
|
|
9803
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9804
|
+
* you may not use this file except in compliance with the License.
|
|
9805
|
+
* You may obtain a copy of the License at
|
|
9806
|
+
*
|
|
9807
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9808
|
+
*
|
|
9809
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
9810
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9811
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9812
|
+
* See the License for the specific language governing permissions and
|
|
9813
|
+
* limitations under the License.
|
|
9814
|
+
*
|
|
9815
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9816
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
9817
|
+
* */
|
|
9818
|
+
var SigmetComponentsLookUp = function SigmetComponentsLookUp(payload, _ref) {
|
|
9819
|
+
var config = _ref.config,
|
|
9820
|
+
auth = _ref.auth,
|
|
9821
|
+
onSetAuth = _ref.onSetAuth,
|
|
9822
|
+
productConfigKey = _ref.productConfigKey;
|
|
9823
|
+
var ConnectedModuleWrapper = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
9824
|
+
var componentType = payload.componentType;
|
|
9825
|
+
|
|
9826
|
+
switch (componentType) {
|
|
9827
|
+
case 'SigmetModule':
|
|
9828
|
+
if (ConnectedModuleWrapper) {
|
|
9829
|
+
return /*#__PURE__*/React.createElement(ConnectedModuleWrapper, {
|
|
9830
|
+
component: AviationProductApiWrapper,
|
|
9831
|
+
payload: payload,
|
|
9832
|
+
"data-testid": "sigmetModule",
|
|
9833
|
+
config: config,
|
|
9834
|
+
auth: auth,
|
|
9835
|
+
onSetAuth: onSetAuth,
|
|
9836
|
+
productConfigKey: productConfigKey,
|
|
9837
|
+
productType: "sigmet"
|
|
9838
|
+
});
|
|
9839
|
+
}
|
|
9840
|
+
|
|
9841
|
+
return /*#__PURE__*/React.createElement(AviationProductApiWrapper, {
|
|
9842
|
+
"data-testid": "sigmetModule",
|
|
9843
|
+
config: config,
|
|
9844
|
+
auth: auth,
|
|
9845
|
+
onSetAuth: onSetAuth,
|
|
9846
|
+
productConfigKey: productConfigKey,
|
|
9847
|
+
productType: "sigmet"
|
|
9848
|
+
});
|
|
9849
|
+
|
|
9850
|
+
default:
|
|
9851
|
+
return null;
|
|
9852
|
+
}
|
|
9853
|
+
};
|
|
9854
|
+
|
|
9855
|
+
/* *
|
|
9856
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9857
|
+
* you may not use this file except in compliance with the License.
|
|
9858
|
+
* You may obtain a copy of the License at
|
|
9859
|
+
*
|
|
9860
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9861
|
+
*
|
|
9862
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
9863
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9864
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9865
|
+
* See the License for the specific language governing permissions and
|
|
9866
|
+
* limitations under the License.
|
|
9867
|
+
*
|
|
9868
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9869
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
9870
|
+
* */
|
|
9871
|
+
var AirmetComponentsLookUp = function AirmetComponentsLookUp(payload, _ref) {
|
|
9872
|
+
var config = _ref.config,
|
|
9873
|
+
auth = _ref.auth,
|
|
9874
|
+
onSetAuth = _ref.onSetAuth,
|
|
9875
|
+
productConfigKey = _ref.productConfigKey;
|
|
9876
|
+
var ConnectedModuleWrapper = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
9877
|
+
var componentType = payload.componentType;
|
|
9878
|
+
|
|
9879
|
+
switch (componentType) {
|
|
9880
|
+
case 'AirmetModule':
|
|
9881
|
+
if (ConnectedModuleWrapper) {
|
|
9882
|
+
return /*#__PURE__*/React.createElement(ConnectedModuleWrapper, {
|
|
9883
|
+
component: AviationProductApiWrapper,
|
|
9884
|
+
payload: payload,
|
|
9885
|
+
"data-testid": "airmetModule",
|
|
9886
|
+
config: config,
|
|
9887
|
+
auth: auth,
|
|
9888
|
+
onSetAuth: onSetAuth,
|
|
9889
|
+
productConfigKey: productConfigKey,
|
|
9890
|
+
productType: "airmet"
|
|
9891
|
+
});
|
|
9892
|
+
}
|
|
9893
|
+
|
|
9894
|
+
return /*#__PURE__*/React.createElement(AviationProductApiWrapper, {
|
|
9895
|
+
"data-testid": "airmetModule",
|
|
9896
|
+
config: config,
|
|
9897
|
+
auth: auth,
|
|
9898
|
+
onSetAuth: onSetAuth,
|
|
9899
|
+
productConfigKey: productConfigKey,
|
|
9900
|
+
productType: "airmet"
|
|
9901
|
+
});
|
|
9902
|
+
|
|
9903
|
+
default:
|
|
9904
|
+
return null;
|
|
9905
|
+
}
|
|
9906
|
+
};
|
|
9907
|
+
|
|
9908
|
+
export { AirmetComponentsLookUp, AirmetForm, AirmetPhenomena, CloudLevelUnits, ContentDialog, Direction, DownloadSigmetAirmetConfigWrapper, LevelUnits, MapDrawMode, MapViewGeoJson, MetInfoWrapper, MovementUnit, ProductList, ProductListRow, ProductStatusDescription, SigmetComponentsLookUp, SigmetForm, SigmetPhenomena, StartOrEndDrawing, VisibilityCause, WindUnit, createApi, isInstanceOfAirmet, isInstanceOfCancelAirmet, isInstanceOfCancelSigmet, isInstanceOfCancelSigmetOrAirmet, isInstanceOfSigmet, isInstanceOfSigmetOrAirmet };
|