@opengeoweb/sigmet-airmet 1.2.5 → 2.1.2

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.
@@ -1,14 +1,12 @@
1
1
  import * as React from 'react';
2
2
  import React__default from 'react';
3
3
  import { makeStyles, FormControlLabel, Radio, Grid, Typography, SvgIcon, Tooltip, Button, Checkbox, MenuItem, FormHelperText, Dialog, DialogTitle, DialogContent, Card, CardContent, List, ListItem, Backdrop, CircularProgress } from '@material-ui/core';
4
- import { MuiPickersUtilsProvider } from '@material-ui/pickers';
5
- import MomentUtils from '@date-io/moment';
6
4
  import { useFormContext } from 'react-hook-form';
7
5
  import { ReactHookFormRadioGroup, ReactHookFormSelect, ReactHookFormNumberField, isInteger, isValidMax, isValidMin, isEmpty, ReactHookFormDateTime, isValidDate, isBefore, isBetween, hasMaxFeaturePoints, hasMulitpleIntersections, ReactHookFormHiddenInput, isMaximumOneDrawing, hasIntersectionWithFIR, isValidGeoJsonCoordinates, isXHoursBefore, isAfter, isXHoursAfter, ReactHookFormTextField, containsNoCommas, isLatitude, isNonOrBothCoordinates, isLongitude, errorMessages, isGeometryDirty, ReactHookFormProvider, defaultFormOptions } from '@opengeoweb/form-fields';
8
6
  import { useApiContext, useApi, createApiInstance } from '@opengeoweb/api';
9
7
  import produce, { produce as produce$1 } from 'immer';
10
8
  import { useDispatch, useSelector, shallowEqual } from 'react-redux';
11
- import { mapSelectors, generateMapId, generateTimesliderId, SyncGroups, generateLayerId, mapActions, publicLayers, KNMIlayers, LayerManagerMapButtonConnect, MapViewConnect, MapViewLayer, TimeSliderConnect } from '@opengeoweb/core';
9
+ import { mapTypes, mapSelectors, generateMapId, generateTimesliderId, SyncGroups, generateLayerId, mapActions, publicLayers, MapControls, LayerManagerMapButtonConnect, MapViewConnect, MapViewLayer, TimeSliderConnect } from '@opengeoweb/core';
12
10
  import * as turf from '@turf/turf';
13
11
  import { polygonToLineString, booleanClockwise, rewind } from '@turf/turf';
14
12
  import { useDraftFormHelpers, useIsMounted, StatusTag, AlertBanner, usePreventBrowserClose, useConfirmationDialog, isAxiosError, getAxiosErrorMessage, ConfirmationServiceProvider, usePoller } from '@opengeoweb/shared';
@@ -17,6 +15,109 @@ import moment from 'moment';
17
15
  import { debounce } from 'lodash';
18
16
  import { Skeleton } from '@material-ui/lab';
19
17
 
18
+ function _typeof(obj) {
19
+ "@babel/helpers - typeof";
20
+
21
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
22
+ _typeof = function (obj) {
23
+ return typeof obj;
24
+ };
25
+ } else {
26
+ _typeof = function (obj) {
27
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
28
+ };
29
+ }
30
+
31
+ return _typeof(obj);
32
+ }
33
+
34
+ function _defineProperty(obj, key, value) {
35
+ if (key in obj) {
36
+ Object.defineProperty(obj, key, {
37
+ value: value,
38
+ enumerable: true,
39
+ configurable: true,
40
+ writable: true
41
+ });
42
+ } else {
43
+ obj[key] = value;
44
+ }
45
+
46
+ return obj;
47
+ }
48
+
49
+ function _slicedToArray(arr, i) {
50
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
51
+ }
52
+
53
+ function _toConsumableArray(arr) {
54
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
55
+ }
56
+
57
+ function _arrayWithoutHoles(arr) {
58
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
59
+ }
60
+
61
+ function _arrayWithHoles(arr) {
62
+ if (Array.isArray(arr)) return arr;
63
+ }
64
+
65
+ function _iterableToArray(iter) {
66
+ if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
67
+ }
68
+
69
+ function _iterableToArrayLimit(arr, i) {
70
+ if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
71
+ var _arr = [];
72
+ var _n = true;
73
+ var _d = false;
74
+ var _e = undefined;
75
+
76
+ try {
77
+ for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
78
+ _arr.push(_s.value);
79
+
80
+ if (i && _arr.length === i) break;
81
+ }
82
+ } catch (err) {
83
+ _d = true;
84
+ _e = err;
85
+ } finally {
86
+ try {
87
+ if (!_n && _i["return"] != null) _i["return"]();
88
+ } finally {
89
+ if (_d) throw _e;
90
+ }
91
+ }
92
+
93
+ return _arr;
94
+ }
95
+
96
+ function _unsupportedIterableToArray(o, minLen) {
97
+ if (!o) return;
98
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
99
+ var n = Object.prototype.toString.call(o).slice(8, -1);
100
+ if (n === "Object" && o.constructor) n = o.constructor.name;
101
+ if (n === "Map" || n === "Set") return Array.from(o);
102
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
103
+ }
104
+
105
+ function _arrayLikeToArray(arr, len) {
106
+ if (len == null || len > arr.length) len = arr.length;
107
+
108
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
109
+
110
+ return arr2;
111
+ }
112
+
113
+ function _nonIterableSpread() {
114
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
115
+ }
116
+
117
+ function _nonIterableRest() {
118
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
119
+ }
120
+
20
121
  var srsAndBboxDefault = {
21
122
  bbox: {
22
123
  left: -1205884.85699446,
@@ -332,6 +433,43 @@ var StartOrEndDrawing;
332
433
  StartOrEndDrawing["end"] = "end";
333
434
  })(StartOrEndDrawing || (StartOrEndDrawing = {}));
334
435
 
436
+ /* *
437
+ * Licensed under the Apache License, Version 2.0 (the "License");
438
+ * you may not use this file except in compliance with the License.
439
+ * You may obtain a copy of the License at
440
+ *
441
+ * http://www.apache.org/licenses/LICENSE-2.0
442
+ *
443
+ * Unless required by applicable law or agreed to in writing, software
444
+ * distributed under the License is distributed on an "AS IS" BASIS,
445
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
446
+ * See the License for the specific language governing permissions and
447
+ * limitations under the License.
448
+ *
449
+ * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
450
+ * Copyright 2021 - Finnish Meteorological Institute (FMI)
451
+ * */
452
+ var adagucBaseUrl = 'https://adaguc-server-geoweb.geoweb.knmi.cloud/adagucserver';
453
+ var KNMIGeoWebSigmetAirmetOverlays = {
454
+ name: 'SigmetAirmetOverlays',
455
+ url: "".concat(adagucBaseUrl, "?dataset=OVL-sigmetairmet"),
456
+ id: 'sigmetairmetoverlays'
457
+ };
458
+ var northSeaPlatforms = {
459
+ service: KNMIGeoWebSigmetAirmetOverlays.url,
460
+ name: 'northseastations',
461
+ format: 'image/png',
462
+ layerType: mapTypes.LayerType.overLayer,
463
+ enabled: true
464
+ };
465
+ var majorAirportsEHAA = {
466
+ service: KNMIGeoWebSigmetAirmetOverlays.url,
467
+ name: 'airports',
468
+ format: 'image/png',
469
+ layerType: mapTypes.LayerType.overLayer,
470
+ enabled: true
471
+ };
472
+
335
473
  /* *
336
474
  * Licensed under the Apache License, Version 2.0 (the "License");
337
475
  * you may not use this file except in compliance with the License.
@@ -382,14 +520,18 @@ var MapViewGeoJson = function MapViewGeoJson(_ref) {
382
520
  _ref$exitDrawModeCall2 = _ref.exitDrawModeCallbackEnd,
383
521
  exitDrawModeCallbackEnd = _ref$exitDrawModeCall2 === void 0 ? function () {} : _ref$exitDrawModeCall2;
384
522
  var dispatch = useDispatch();
523
+ var firstMap = useSelector(function (store) {
524
+ return mapSelectors.getFirstMap(store);
525
+ }, shallowEqual);
526
+ var firstMapId = firstMap && firstMap.id ? firstMap.id : null;
385
527
  var mapLayers = useSelector(function (store) {
386
- return mapSelectors.getMapLayers(store, 'main-map');
528
+ return mapSelectors.getMapLayers(store, firstMapId);
387
529
  }, shallowEqual);
388
530
  var mapDimensions = useSelector(function (store) {
389
- return mapSelectors.getMapDimensions(store, 'main-map');
531
+ return mapSelectors.getMapDimensions(store, firstMapId);
390
532
  }, shallowEqual);
391
- var mapId = React.useRef("sigmet-" + generateMapId()).current;
392
- var timesliderId = React.useRef("sigmet-" + generateTimesliderId()).current;
533
+ var mapId = React.useRef("sigmet-".concat(generateMapId())).current;
534
+ var timesliderId = React.useRef("sigmet-".concat(generateTimesliderId())).current;
393
535
  var syncGroupAddGroup = React.useCallback(function (payload) {
394
536
  return dispatch(SyncGroups.actions.syncGroupAddGroup(payload));
395
537
  }, [dispatch]);
@@ -422,13 +564,13 @@ var MapViewGeoJson = function MapViewGeoJson(_ref) {
422
564
  dispatch(mapActions.setBaseLayers({
423
565
  mapId: mapId,
424
566
  layers: [Object.assign(Object.assign({}, publicLayers.baseLayerGrey), {
425
- id: "baselayer-" + mapId
567
+ id: "baselayer-".concat(mapId)
426
568
  }), Object.assign(Object.assign({}, publicLayers.overLayer), {
427
- id: "countryborders-" + mapId
428
- }), Object.assign(Object.assign({}, KNMIlayers.northSeaPlatforms), {
429
- id: "northseaplatforms-" + mapId
430
- }), Object.assign(Object.assign({}, KNMIlayers.majorAirportsEHAA), {
431
- id: "majorairportsehaa-" + mapId
569
+ id: "countryborders-".concat(mapId)
570
+ }), Object.assign(Object.assign({}, northSeaPlatforms), {
571
+ id: "northseaplatforms-".concat(mapId)
572
+ }), Object.assign(Object.assign({}, majorAirportsEHAA), {
573
+ id: "majorairportsehaa-".concat(mapId)
432
574
  })]
433
575
  }));
434
576
  dispatch(mapActions.setBbox({
@@ -456,24 +598,17 @@ var MapViewGeoJson = function MapViewGeoJson(_ref) {
456
598
  height: '99%'
457
599
  },
458
600
  "data-testid": "MapView"
459
- }, /*#__PURE__*/React.createElement("div", {
460
- style: {
461
- position: 'absolute',
462
- left: '20px',
463
- top: '20px',
464
- zIndex: 50
465
- }
466
- }, /*#__PURE__*/React.createElement(LayerManagerMapButtonConnect, {
601
+ }, /*#__PURE__*/React.createElement(MapControls, null, /*#__PURE__*/React.createElement(LayerManagerMapButtonConnect, {
467
602
  source: "module",
468
603
  mapId: mapId
469
604
  })), /*#__PURE__*/React.createElement(MapViewConnect, {
470
605
  mapId: mapId
471
606
  }, /*#__PURE__*/React.createElement(MapViewLayer, {
472
- id: "geojsonlayer-fir-" + mapId,
607
+ id: "geojsonlayer-fir-".concat(mapId),
473
608
  isInEditMode: false,
474
609
  geojson: geoJSONs.fir
475
610
  }), /*#__PURE__*/React.createElement(MapViewLayer, {
476
- id: "geojsonlayer-end-" + mapId,
611
+ id: "geojsonlayer-end-".concat(mapId),
477
612
  isInEditMode: drawMode.end !== null && layerDrawModes.end !== null,
478
613
  geojson: geoJSONs.end,
479
614
  drawMode: layerDrawModes.end,
@@ -492,7 +627,7 @@ var MapViewGeoJson = function MapViewGeoJson(_ref) {
492
627
  },
493
628
  featureNrToEdit: 0
494
629
  }), /*#__PURE__*/React.createElement(MapViewLayer, {
495
- id: "geojsonlayer-start-" + mapId,
630
+ id: "geojsonlayer-start-".concat(mapId),
496
631
  isInEditMode: drawMode.start !== null && layerDrawModes.start !== null,
497
632
  geojson: geoJSONs.start,
498
633
  drawMode: layerDrawModes.start,
@@ -511,11 +646,11 @@ var MapViewGeoJson = function MapViewGeoJson(_ref) {
511
646
  },
512
647
  featureNrToEdit: 0
513
648
  }), /*#__PURE__*/React.createElement(MapViewLayer, {
514
- id: "geojsonlayer-intersection-end-" + mapId,
649
+ id: "geojsonlayer-intersection-end-".concat(mapId),
515
650
  isInEditMode: false,
516
651
  geojson: geoJSONs.intersectionEnd
517
652
  }), /*#__PURE__*/React.createElement(MapViewLayer, {
518
- id: "geojsonlayer-intersection-start-" + mapId,
653
+ id: "geojsonlayer-intersection-start-".concat(mapId),
519
654
  isInEditMode: false,
520
655
  geojson: geoJSONs.intersectionStart
521
656
  })), /*#__PURE__*/React.createElement("div", {
@@ -714,23 +849,6 @@ var isFir = function isFir(geojson) {
714
849
  return geojson && geojson.features && geojson.features[0].properties['selectionType'] === 'fir';
715
850
  };
716
851
 
717
- /* *
718
- * Licensed under the Apache License, Version 2.0 (the "License");
719
- * you may not use this file except in compliance with the License.
720
- * You may obtain a copy of the License at
721
- *
722
- * http://www.apache.org/licenses/LICENSE-2.0
723
- *
724
- * Unless required by applicable law or agreed to in writing, software
725
- * distributed under the License is distributed on an "AS IS" BASIS,
726
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
727
- * See the License for the specific language governing permissions and
728
- * limitations under the License.
729
- *
730
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
731
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
732
- * */
733
-
734
852
  var getDrawModeFromSelectionType = function getDrawModeFromSelectionType(selectionType) {
735
853
  switch (selectionType) {
736
854
  case 'point':
@@ -767,10 +885,8 @@ var addFeatureProperties = function addFeatureProperties(geojson, featurePropert
767
885
  });
768
886
  };
769
887
 
770
- var useDrawMode = function useDrawMode(initialGeometry) {
771
- if (initialGeometry === void 0) {
772
- initialGeometry = null;
773
- }
888
+ var useDrawMode = function useDrawMode() {
889
+ var initialGeometry = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
774
890
 
775
891
  var getInitialLayerDrawModes = function getInitialLayerDrawModes(startorEnd) {
776
892
  return initialGeometry && initialGeometry[startorEnd] ? getDrawModeFromSelectionType(initialGeometry[startorEnd].features[0].properties.selectionType) : null;
@@ -782,21 +898,23 @@ var useDrawMode = function useDrawMode(initialGeometry) {
782
898
  start: null,
783
899
  end: null
784
900
  }),
785
- drawMode = _React$useState[0],
786
- setDrawMode = _React$useState[1];
901
+ _React$useState2 = _slicedToArray(_React$useState, 2),
902
+ drawMode = _React$useState2[0],
903
+ setDrawMode = _React$useState2[1];
787
904
  /* Drawmode for the layers */
788
905
 
789
906
 
790
- var _React$useState2 = React.useState({
907
+ var _React$useState3 = React.useState({
791
908
  start: getInitialLayerDrawModes('start'),
792
909
  end: getInitialLayerDrawModes('end')
793
910
  }),
794
- layerDrawModes = _React$useState2[0],
795
- setLayersDrawModes = _React$useState2[1];
911
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
912
+ layerDrawModes = _React$useState4[0],
913
+ setLayersDrawModes = _React$useState4[1];
796
914
  /* GeoJSONs for the layers */
797
915
 
798
916
 
799
- var _React$useState3 = React.useState(function () {
917
+ var _React$useState5 = React.useState(function () {
800
918
  return {
801
919
  start: addFeatureProperties(initialGeometry && initialGeometry.start, featurePropsStart),
802
920
  end: addFeatureProperties(initialGeometry && initialGeometry.end, featurePropsEnd),
@@ -805,8 +923,9 @@ var useDrawMode = function useDrawMode(initialGeometry) {
805
923
  fir: addFeatureProperties(getFir(), featurePropsFIR)
806
924
  };
807
925
  }),
808
- geoJSONs = _React$useState3[0],
809
- setLayerGeoJSONs = _React$useState3[1];
926
+ _React$useState6 = _slicedToArray(_React$useState5, 2),
927
+ geoJSONs = _React$useState6[0],
928
+ setLayerGeoJSONs = _React$useState6[1];
810
929
  /**
811
930
  *
812
931
  * @param mapDrawMode Can be 'POINT' | 'BOX' | 'POLYGON' | 'FIR' | 'DELETE'
@@ -1259,7 +1378,7 @@ var DrawTools = function DrawTools(_ref) {
1259
1378
  }, /*#__PURE__*/React__default.createElement(Grid, {
1260
1379
  item: true
1261
1380
  }, /*#__PURE__*/React__default.createElement(Tooltip, {
1262
- title: "Drop a point as " + type + " position"
1381
+ title: "Drop a point as ".concat(type, " position")
1263
1382
  }, /*#__PURE__*/React__default.createElement(Radio, {
1264
1383
  icon: /*#__PURE__*/React__default.createElement(LocationOn, {
1265
1384
  className: classes.drawButtons
@@ -1276,7 +1395,7 @@ var DrawTools = function DrawTools(_ref) {
1276
1395
  }))), /*#__PURE__*/React__default.createElement(Grid, {
1277
1396
  item: true
1278
1397
  }, /*#__PURE__*/React__default.createElement(Tooltip, {
1279
- title: "Draw a box as " + type + " position"
1398
+ title: "Draw a box as ".concat(type, " position")
1280
1399
  }, /*#__PURE__*/React__default.createElement(Radio, {
1281
1400
  icon: /*#__PURE__*/React__default.createElement(RegionDraw, {
1282
1401
  className: classes.drawButtons
@@ -1292,7 +1411,7 @@ var DrawTools = function DrawTools(_ref) {
1292
1411
  }))), /*#__PURE__*/React__default.createElement(Grid, {
1293
1412
  item: true
1294
1413
  }, /*#__PURE__*/React__default.createElement(Tooltip, {
1295
- title: "Draw a shape as " + type + " position"
1414
+ title: "Draw a shape as ".concat(type, " position")
1296
1415
  }, /*#__PURE__*/React__default.createElement(Radio, {
1297
1416
  icon: /*#__PURE__*/React__default.createElement(PolygonDraw, {
1298
1417
  className: classes.drawButtons
@@ -1308,7 +1427,7 @@ var DrawTools = function DrawTools(_ref) {
1308
1427
  }))), /*#__PURE__*/React__default.createElement(Grid, {
1309
1428
  item: true
1310
1429
  }, /*#__PURE__*/React__default.createElement(Tooltip, {
1311
- title: "Set FIR as " + type + " position"
1430
+ title: "Set FIR as ".concat(type, " position")
1312
1431
  }, /*#__PURE__*/React__default.createElement(Radio, {
1313
1432
  icon: /*#__PURE__*/React__default.createElement(FIRDraw, {
1314
1433
  className: classes.drawButtons
@@ -1340,22 +1459,6 @@ var DrawTools = function DrawTools(_ref) {
1340
1459
  }))));
1341
1460
  };
1342
1461
 
1343
- function _typeof(obj) {
1344
- "@babel/helpers - typeof";
1345
-
1346
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
1347
- _typeof = function (obj) {
1348
- return typeof obj;
1349
- };
1350
- } else {
1351
- _typeof = function (obj) {
1352
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
1353
- };
1354
- }
1355
-
1356
- return _typeof(obj);
1357
- }
1358
-
1359
1462
  var getHoursBeforeValidity = function getHoursBeforeValidity(phenomenon, fir, config) {
1360
1463
  if (!fir) return 4;
1361
1464
  var _config$firareas$fir = config.firareas[fir],
@@ -1513,9 +1616,7 @@ var useProductSettings = function useProductSettings(productConfig) {
1513
1616
  });
1514
1617
  var allowedUnits = Object.keys(firData).reduce(function (list, key) {
1515
1618
  if (firData[key].units) {
1516
- var _Object$assign;
1517
-
1518
- return Object.assign(Object.assign({}, list), (_Object$assign = {}, _Object$assign[key] = firData[key].units, _Object$assign));
1619
+ return Object.assign(Object.assign({}, list), _defineProperty({}, key, firData[key].units));
1519
1620
  }
1520
1621
 
1521
1622
  return list;
@@ -1545,19 +1646,19 @@ var getDialogtitle = function getDialogtitle(product, productType) {
1545
1646
  var productName = productType.toUpperCase();
1546
1647
 
1547
1648
  if (product === null) {
1548
- return "New " + productName;
1649
+ return "New ".concat(productName);
1549
1650
  }
1550
1651
 
1551
1652
  if (!isInstanceOfCancelSigmetOrAirmet(product)) {
1552
1653
  var phenomenon = productType === 'sigmet' ? SigmetPhenomena[product.phenomenon] : AirmetPhenomena[product.phenomenon];
1553
- return productName + " " + phenomenon + " - " + (product.status === 'DRAFT' ? 'saved as draft' : ProductStatusDescription[product.status]);
1654
+ return "".concat(productName, " ").concat(phenomenon, " - ").concat(product.status === 'DRAFT' ? 'saved as draft' : ProductStatusDescription[product.status]);
1554
1655
  }
1555
1656
 
1556
1657
  if (isInstanceOfCancelSigmet(product)) {
1557
- return productName + " Cancels " + product.cancelsSigmetSequenceId;
1658
+ return "".concat(productName, " Cancels ").concat(product.cancelsSigmetSequenceId);
1558
1659
  }
1559
1660
 
1560
- return productName + " Cancels " + product.cancelsAirmetSequenceId;
1661
+ return "".concat(productName, " Cancels ").concat(product.cancelsAirmetSequenceId);
1561
1662
  };
1562
1663
  var getProductFormMode = function getProductFormMode(canBeOptions, productListItem) {
1563
1664
  if (productListItem === null) return 'new';
@@ -1610,20 +1711,16 @@ var hasValue = function hasValue(value) {
1610
1711
  };
1611
1712
  var removeEmptyNumberFieldValues = function removeEmptyNumberFieldValues(product) {
1612
1713
  return Object.keys(product).reduce(function (list, key) {
1613
- var _ref2;
1614
-
1615
1714
  var value = product[key]; // check if nested object has value
1616
1715
 
1617
1716
  if (_typeof(value) === 'object' && value !== null && value !== undefined) {
1618
- var _ref;
1619
-
1620
1717
  var hasNaNValue = Object.keys(value).reduce(function (total, valKey) {
1621
1718
  return !hasValue(value[valKey]) || total;
1622
1719
  }, false);
1623
- return Object.assign(Object.assign({}, list), !hasNaNValue && (_ref = {}, _ref[key] = value, _ref));
1720
+ return Object.assign(Object.assign({}, list), !hasNaNValue && _defineProperty({}, key, value));
1624
1721
  }
1625
1722
 
1626
- return Object.assign(Object.assign({}, list), hasValue(value) && (_ref2 = {}, _ref2[key] = value, _ref2));
1723
+ return Object.assign(Object.assign({}, list), hasValue(value) && _defineProperty({}, key, value));
1627
1724
  }, {});
1628
1725
  };
1629
1726
  var createSigmetPostParameter = function createSigmetPostParameter(sigmetToPost, newStatus, previousUuid) {
@@ -1650,24 +1747,24 @@ var createAirmetPostParameter = function createAirmetPostParameter(airmetToPost,
1650
1747
  };
1651
1748
  var getConfirmationDialogTitle = function getConfirmationDialogTitle(action, productType) {
1652
1749
  var product = productType.toUpperCase();
1653
- if (action === 'CLOSED') return "Close " + product;
1654
- if (action === 'DISCARDED') return "Discard " + product;
1750
+ if (action === 'CLOSED') return "Close ".concat(product);
1751
+ if (action === 'DISCARDED') return "Discard ".concat(product);
1655
1752
  if (action === 'PUBLISHED') return 'Publish';
1656
- return "Cancel " + product;
1753
+ return "Cancel ".concat(product);
1657
1754
  };
1658
1755
  var getConfirmationDialogContent = function getConfirmationDialogContent(action, productType) {
1659
1756
  var product = productType.toUpperCase();
1660
- if (action === 'DISCARDED') return "Are you sure you would like to discard this " + product + "? Its properties will be lost";
1757
+ if (action === 'DISCARDED') return "Are you sure you would like to discard this ".concat(product, "? Its properties will be lost");
1661
1758
  if (action === 'CLOSED') return 'Do you want to save any changes made?';
1662
- if (action === 'PUBLISHED') return "Are you sure you want to publish this " + product + "?";
1663
- return "Are you sure you want to cancel this " + product + "?";
1759
+ if (action === 'PUBLISHED') return "Are you sure you want to publish this ".concat(product, "?");
1760
+ return "Are you sure you want to cancel this ".concat(product, "?");
1664
1761
  };
1665
1762
  var getConfirmationDialogButtonLabel = function getConfirmationDialogButtonLabel(action, productType) {
1666
1763
  var product = productType.toUpperCase();
1667
1764
 
1668
1765
  switch (action) {
1669
1766
  case 'DISCARDED':
1670
- return "Discard " + product;
1767
+ return "Discard ".concat(product);
1671
1768
 
1672
1769
  case 'PUBLISHED':
1673
1770
  return 'Publish';
@@ -1690,11 +1787,11 @@ var getConfirmationDialogCancelLabel = function getConfirmationDialogCancelLabel
1690
1787
  };
1691
1788
  var getProductIssueDate = function getProductIssueDate(initialProduct, initialCancelProduct) {
1692
1789
  if (initialProduct !== null && (initialProduct.status === 'PUBLISHED' || initialProduct.status === 'EXPIRED') && initialProduct.issueDate) {
1693
- return moment.utc(initialProduct.issueDate).format('YYYY/MM/DD HH:mm') + " UTC";
1790
+ return "".concat(moment.utc(initialProduct.issueDate).format('YYYY/MM/DD HH:mm'), " UTC");
1694
1791
  }
1695
1792
 
1696
1793
  if (initialCancelProduct !== null && initialCancelProduct.issueDate) {
1697
- return moment.utc(initialCancelProduct.issueDate).format('YYYY/MM/DD HH:mm') + " UTC";
1794
+ return "".concat(moment.utc(initialCancelProduct.issueDate).format('YYYY/MM/DD HH:mm'), " UTC");
1698
1795
  }
1699
1796
 
1700
1797
  return '(Not published)';
@@ -1705,9 +1802,7 @@ var extractUnitsToShow = function extractUnitsToShow(allowedUnits, unitType) {
1705
1802
  var unit = allowedUnits[key];
1706
1803
 
1707
1804
  if (unitType[unit]) {
1708
- var _Object$assign2;
1709
-
1710
- return Object.assign(Object.assign({}, list), (_Object$assign2 = {}, _Object$assign2[unit] = unitType[unit], _Object$assign2));
1805
+ return Object.assign(Object.assign({}, list), _defineProperty({}, unit, unitType[unit]));
1711
1806
  }
1712
1807
 
1713
1808
  return list;
@@ -1833,22 +1928,6 @@ var airmetConfig = {
1833
1928
  active_firs: active_firs
1834
1929
  };
1835
1930
 
1836
- /* *
1837
- * Licensed under the Apache License, Version 2.0 (the "License");
1838
- * you may not use this file except in compliance with the License.
1839
- * You may obtain a copy of the License at
1840
- *
1841
- * http://www.apache.org/licenses/LICENSE-2.0
1842
- *
1843
- * Unless required by applicable law or agreed to in writing, software
1844
- * distributed under the License is distributed on an "AS IS" BASIS,
1845
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1846
- * See the License for the specific language governing permissions and
1847
- * limitations under the License.
1848
- *
1849
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1850
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
1851
- * */
1852
1931
  var invalidLevelsTill4900FTStepsMessage = 'Levels must be rounded to the nearest 100ft';
1853
1932
  var invalidLevelsFrom50FLStepsMessage = 'Levels must be rounded to the nearest 5';
1854
1933
 
@@ -2023,12 +2102,12 @@ var Levels = function Levels(_ref) {
2023
2102
  isInteger: isInteger,
2024
2103
  max: function max(value) {
2025
2104
  return (// The max level depends on the unit
2026
- isValidMax(value, getMaxLevelValue(getValues('level.unit'), productType)) || "The maximum level in " + LevelUnits[getValues('level.unit')] + " is " + getMaxLevelValue(getValues('level.unit'), productType)
2105
+ isValidMax(value, getMaxLevelValue(getValues('level.unit'), productType)) || "The maximum level in ".concat(LevelUnits[getValues('level.unit')], " is ").concat(getMaxLevelValue(getValues('level.unit'), productType))
2027
2106
  );
2028
2107
  },
2029
2108
  min: function min(value) {
2030
2109
  return (// The min level depends on the unit
2031
- isValidMin(value, getMinLevelValue(getValues('level.unit'))) || "The minimum level in " + LevelUnits[getValues('level.unit')] + " is " + getMinLevelValue(getValues('level.unit'))
2110
+ isValidMin(value, getMinLevelValue(getValues('level.unit'))) || "The minimum level in ".concat(LevelUnits[getValues('level.unit')], " is ").concat(getMinLevelValue(getValues('level.unit')))
2032
2111
  );
2033
2112
  },
2034
2113
  validateLevels: function validateLevels(value) {
@@ -2073,7 +2152,7 @@ var Levels = function Levels(_ref) {
2073
2152
  disabled: isDisabled,
2074
2153
  defaultValue: 'FL',
2075
2154
  onChange: function onChange() {
2076
- trigger([].concat(getValues('level.value') || getValues('level.value') === 0 ? ['level.value'] : [], getValues('lowerLevel.value') || getValues('lowerLevel.value') === 0 ? ['lowerLevel.value'] : [], ['lowerLevel.unit']));
2155
+ trigger([].concat(_toConsumableArray(getValues('level.value') || getValues('level.value') === 0 ? ['level.value'] : []), _toConsumableArray(getValues('lowerLevel.value') || getValues('lowerLevel.value') === 0 ? ['lowerLevel.value'] : []), ['lowerLevel.unit']));
2077
2156
 
2078
2157
  _onChange();
2079
2158
  }
@@ -2095,12 +2174,12 @@ var Levels = function Levels(_ref) {
2095
2174
  isInteger: isInteger,
2096
2175
  max: function max(value) {
2097
2176
  return (// The max level depends on the unit
2098
- isValidMax(value, getMaxLevelValue(getValues('level.unit'), productType)) || "The maximum level in " + LevelUnits[getValues('level.unit')] + " is " + getMaxLevelValue(getValues('level.unit'), productType)
2177
+ isValidMax(value, getMaxLevelValue(getValues('level.unit'), productType)) || "The maximum level in ".concat(LevelUnits[getValues('level.unit')], " is ").concat(getMaxLevelValue(getValues('level.unit'), productType))
2099
2178
  );
2100
2179
  },
2101
2180
  min: function min(value) {
2102
2181
  return (// The min level depends on the unit
2103
- isValidMin(value, getMinLevelValue(getValues('level.unit'))) || "The minimum level in " + LevelUnits[getValues('level.unit')] + " is " + getMinLevelValue(getValues('level.unit'))
2182
+ isValidMin(value, getMinLevelValue(getValues('level.unit'))) || "The minimum level in ".concat(LevelUnits[getValues('level.unit')], " is ").concat(getMinLevelValue(getValues('level.unit')))
2104
2183
  );
2105
2184
  },
2106
2185
  validateLevels: function validateLevels(value) {
@@ -2182,12 +2261,12 @@ var Levels = function Levels(_ref) {
2182
2261
  isInteger: isInteger,
2183
2262
  max: function max(value) {
2184
2263
  return (// The max level depends on the unit
2185
- isValidMax(value, getMaxLevelValue(getValues('lowerLevel.unit'), productType)) || "The maximum level in " + LevelUnits[getValues('lowerLevel.unit')] + " is " + getMaxLevelValue(getValues('lowerLevel.unit'), productType)
2264
+ isValidMax(value, getMaxLevelValue(getValues('lowerLevel.unit'), productType)) || "The maximum level in ".concat(LevelUnits[getValues('lowerLevel.unit')], " is ").concat(getMaxLevelValue(getValues('lowerLevel.unit'), productType))
2186
2265
  );
2187
2266
  },
2188
2267
  min: function min(value) {
2189
2268
  return (// The min level depends on the unit
2190
- isValidMin(value, getMinLevelValue(getValues('lowerLevel.unit'))) || "The minimum level in " + LevelUnits[getValues('lowerLevel.unit')] + " is " + getMinLevelValue(getValues('lowerLevel.unit'))
2269
+ isValidMin(value, getMinLevelValue(getValues('lowerLevel.unit'))) || "The minimum level in ".concat(LevelUnits[getValues('lowerLevel.unit')], " is ").concat(getMinLevelValue(getValues('lowerLevel.unit')))
2191
2270
  );
2192
2271
  },
2193
2272
  isLevelLower: function isLevelLower$1(value) {
@@ -2266,12 +2345,12 @@ var Levels = function Levels(_ref) {
2266
2345
  isInteger: isInteger,
2267
2346
  max: function max(value) {
2268
2347
  return (// The max level depends on the unit
2269
- isValidMax(value, getMaxLevelValue(getValues('level.unit'), productType)) || "The maximum level in " + LevelUnits[getValues('level.unit')] + " is " + getMaxLevelValue(getValues('level.unit'), productType)
2348
+ isValidMax(value, getMaxLevelValue(getValues('level.unit'), productType)) || "The maximum level in ".concat(LevelUnits[getValues('level.unit')], " is ").concat(getMaxLevelValue(getValues('level.unit'), productType))
2270
2349
  );
2271
2350
  },
2272
2351
  min: function min(value) {
2273
2352
  return (// The min level depends on the unit
2274
- isValidMin(value, getMinLevelValue(getValues('level.unit'))) || "The minimum level in " + LevelUnits[getValues('level.unit')] + " is " + getMinLevelValue(getValues('level.unit'))
2353
+ isValidMin(value, getMinLevelValue(getValues('level.unit'))) || "The minimum level in ".concat(LevelUnits[getValues('level.unit')], " is ").concat(getMinLevelValue(getValues('level.unit')))
2275
2354
  );
2276
2355
  },
2277
2356
  validateLevels: function validateLevels(value) {
@@ -2424,23 +2503,6 @@ var ObservationForecastTime = function ObservationForecastTime(_ref) {
2424
2503
  })));
2425
2504
  };
2426
2505
 
2427
- /* *
2428
- * Licensed under the Apache License, Version 2.0 (the "License");
2429
- * you may not use this file except in compliance with the License.
2430
- * You may obtain a copy of the License at
2431
- *
2432
- * http://www.apache.org/licenses/LICENSE-2.0
2433
- *
2434
- * Unless required by applicable law or agreed to in writing, software
2435
- * distributed under the License is distributed on an "AS IS" BASIS,
2436
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2437
- * See the License for the specific language governing permissions and
2438
- * limitations under the License.
2439
- *
2440
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2441
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
2442
- * */
2443
-
2444
2506
  var Phenomenon = function Phenomenon(_ref) {
2445
2507
  var productType = _ref.productType,
2446
2508
  isDisabled = _ref.isDisabled,
@@ -2499,7 +2561,7 @@ var Phenomenon = function Phenomenon(_ref) {
2499
2561
 
2500
2562
  _onChange();
2501
2563
 
2502
- return trigger([].concat(getValues('validDateStart') ? ['validDateStart'] : [], getValues('validDateEnd') ? ['validDateEnd'] : []));
2564
+ return trigger([].concat(_toConsumableArray(getValues('validDateStart') ? ['validDateStart'] : []), _toConsumableArray(getValues('validDateEnd') ? ['validDateEnd'] : [])));
2503
2565
  },
2504
2566
  autoFocus: true
2505
2567
  }, Object.keys(phenomenaList).map(function (key) {
@@ -2813,12 +2875,12 @@ var Progress = function Progress(_ref) {
2813
2875
  isInteger: isInteger,
2814
2876
  min: function min(value) {
2815
2877
  return (// The max level depends on the unit
2816
- isValidMin(value, getMinMovementSpeedValue(getValues('movementUnit'))) || "The minimum level in " + MovementUnit[getValues('movementUnit')] + " is " + getMinMovementSpeedValue(getValues('movementUnit'))
2878
+ isValidMin(value, getMinMovementSpeedValue(getValues('movementUnit'))) || "The minimum level in ".concat(MovementUnit[getValues('movementUnit')], " is ").concat(getMinMovementSpeedValue(getValues('movementUnit')))
2817
2879
  );
2818
2880
  },
2819
2881
  max: function max(value) {
2820
2882
  return (// The max level depends on the unit
2821
- isValidMax(value, getMaxMovementSpeedValue(getValues('movementUnit'))) || "The maximum level in " + MovementUnit[getValues('movementUnit')] + " is " + getMaxMovementSpeedValue(getValues('movementUnit'))
2883
+ isValidMax(value, getMaxMovementSpeedValue(getValues('movementUnit'))) || "The maximum level in ".concat(MovementUnit[getValues('movementUnit')], " is ").concat(getMaxMovementSpeedValue(getValues('movementUnit')))
2822
2884
  );
2823
2885
  },
2824
2886
  validateMovementSteps: function validateMovementSteps(value) {
@@ -2953,7 +3015,7 @@ var SelectFIR = function SelectFIR(_ref) {
2953
3015
  }
2954
3016
  }, optionsFIR.map(function (fir) {
2955
3017
  return /*#__PURE__*/React__default.createElement(MenuItem, {
2956
- key: fir.ATSR + "-" + fir.FIR,
3018
+ key: "".concat(fir.ATSR, "-").concat(fir.FIR),
2957
3019
  value: fir.ATSR
2958
3020
  }, fir.FIR);
2959
3021
  })), /*#__PURE__*/React__default.createElement(ReactHookFormHiddenInput, {
@@ -3113,7 +3175,7 @@ var ValidFrom = function ValidFrom(_ref) {
3113
3175
  },
3114
3176
  // The current time can be no more than 4 hours before the validity start (12 for VA/TC SIGMET)
3115
3177
  isCurrentTimeXHoursBeforeValue: function isCurrentTimeXHoursBeforeValue(value) {
3116
- return isXHoursBefore(moment.utc().format(), value, getHoursBeforeValidity(getValues('phenomenon'), getValues('locationIndicatorATSR'), config)) || "Valid from time can be no more than " + getHoursBeforeValidity(getValues('phenomenon'), getValues('locationIndicatorATSR'), config) + " hours after current time";
3178
+ return isXHoursBefore(moment.utc().format(), value, getHoursBeforeValidity(getValues('phenomenon'), getValues('locationIndicatorATSR'), config)) || "Valid from time can be no more than ".concat(getHoursBeforeValidity(getValues('phenomenon'), getValues('locationIndicatorATSR'), config), " hours after current time");
3117
3179
  }
3118
3180
  }
3119
3181
  },
@@ -3207,7 +3269,7 @@ var ValidUntil = function ValidUntil(_ref) {
3207
3269
  },
3208
3270
  // Validity end can be no more than 4 hours after validity start (6 for VA/TC SIGMET)
3209
3271
  isXHoursAfter: function isXHoursAfter$1(value) {
3210
- return isXHoursAfter(value, getValues('validDateStart'), getMaxHoursOfValidity(getValues('phenomenon'), getValues('locationIndicatorATSR'), config)) || "Valid until time can be no more than " + getMaxHoursOfValidity(getValues('phenomenon'), getValues('locationIndicatorATSR'), config) + " hours after Valid from time";
3272
+ return isXHoursAfter(value, getValues('validDateStart'), getMaxHoursOfValidity(getValues('phenomenon'), getValues('locationIndicatorATSR'), config)) || "Valid until time can be no more than ".concat(getMaxHoursOfValidity(getValues('phenomenon'), getValues('locationIndicatorATSR'), config), " hours after Valid from time");
3211
3273
  }
3212
3274
  }
3213
3275
  },
@@ -3568,12 +3630,12 @@ var SurfaceWind = function SurfaceWind(_ref) {
3568
3630
  isInteger: isInteger,
3569
3631
  min: function min(value) {
3570
3632
  return (// The min level depends on the unit
3571
- isValidMin(value, getMinWindSpeedValue(getValues('windUnit'))) || "The minimum wind speed in " + WindUnit[getValues('windUnit')] + " is " + getMinWindSpeedValue(getValues('windUnit'))
3633
+ isValidMin(value, getMinWindSpeedValue(getValues('windUnit'))) || "The minimum wind speed in ".concat(WindUnit[getValues('windUnit')], " is ").concat(getMinWindSpeedValue(getValues('windUnit')))
3572
3634
  );
3573
3635
  },
3574
3636
  max: function max(value) {
3575
3637
  return (// The max level depends on the unit
3576
- isValidMax(value, getMaxWindSpeedValue(getValues('windUnit'))) || "The maximum wind speed in " + WindUnit[getValues('windUnit')] + " is " + getMaxWindSpeedValue(getValues('windUnit'))
3638
+ isValidMax(value, getMaxWindSpeedValue(getValues('windUnit'))) || "The maximum wind speed in ".concat(WindUnit[getValues('windUnit')], " is ").concat(getMaxWindSpeedValue(getValues('windUnit')))
3577
3639
  );
3578
3640
  }
3579
3641
  }
@@ -3760,12 +3822,12 @@ var CloudLevels = function CloudLevels(_ref) {
3760
3822
  isInteger: isInteger,
3761
3823
  min: function min(value) {
3762
3824
  return (// The min level depends on the unit
3763
- isValidMin(value, getMinCloudLevelValue(getValues('cloudLevel.unit'))) || "The minimum level in " + CloudLevelUnits[getValues('cloudLevel.unit')] + " is " + getMinCloudLevelValue(getValues('cloudLevel.unit'))
3825
+ isValidMin(value, getMinCloudLevelValue(getValues('cloudLevel.unit'))) || "The minimum level in ".concat(CloudLevelUnits[getValues('cloudLevel.unit')], " is ").concat(getMinCloudLevelValue(getValues('cloudLevel.unit')))
3764
3826
  );
3765
3827
  },
3766
3828
  max: function max(value) {
3767
3829
  return (// The max level depends on the unit
3768
- isValidMax(value, getMaxCloudLevelValue(getValues('cloudLevel.unit'))) || "The maximum level in " + CloudLevelUnits[getValues('cloudLevel.unit')] + " is " + getMaxCloudLevelValue(getValues('cloudLevel.unit'))
3830
+ isValidMax(value, getMaxCloudLevelValue(getValues('cloudLevel.unit'))) || "The maximum level in ".concat(CloudLevelUnits[getValues('cloudLevel.unit')], " is ").concat(getMaxCloudLevelValue(getValues('cloudLevel.unit')))
3769
3831
  );
3770
3832
  },
3771
3833
  step: function step(value) {
@@ -3867,12 +3929,12 @@ var CloudLevels = function CloudLevels(_ref) {
3867
3929
  isInteger: isInteger,
3868
3930
  min: function min(value) {
3869
3931
  return (// The min level depends on the unit
3870
- isValidMin(value, getMinCloudLowerLevelValue(getValues('cloudLowerLevel.unit'))) || "The minimum level in " + CloudLevelUnits[getValues('cloudLowerLevel.unit')] + " is " + getMinCloudLowerLevelValue(getValues('cloudLowerLevel.unit'))
3932
+ isValidMin(value, getMinCloudLowerLevelValue(getValues('cloudLowerLevel.unit'))) || "The minimum level in ".concat(CloudLevelUnits[getValues('cloudLowerLevel.unit')], " is ").concat(getMinCloudLowerLevelValue(getValues('cloudLowerLevel.unit')))
3871
3933
  );
3872
3934
  },
3873
3935
  max: function max(value) {
3874
3936
  return (// The max level depends on the unit
3875
- isValidMax(value, getMaxCloudLowerLevelValue(getValues('cloudLowerLevel.unit'))) || "The maximum level in " + CloudLevelUnits[getValues('cloudLowerLevel.unit')] + " is " + getMaxCloudLowerLevelValue(getValues('cloudLowerLevel.unit'))
3937
+ isValidMax(value, getMaxCloudLowerLevelValue(getValues('cloudLowerLevel.unit'))) || "The maximum level in ".concat(CloudLevelUnits[getValues('cloudLowerLevel.unit')], " is ").concat(getMaxCloudLowerLevelValue(getValues('cloudLowerLevel.unit')))
3876
3938
  );
3877
3939
  },
3878
3940
  isLevelLower: function isLevelLower$1(value) {
@@ -3921,8 +3983,9 @@ var shouldRetrieveTAC = function shouldRetrieveTAC(product) {
3921
3983
  };
3922
3984
  var useTAC = function useTAC(initialProduct, getTAC) {
3923
3985
  var _React$useState = React__default.useState(noTAC),
3924
- TAC = _React$useState[0],
3925
- setTAC = _React$useState[1];
3986
+ _React$useState2 = _slicedToArray(_React$useState, 2),
3987
+ TAC = _React$useState2[0],
3988
+ setTAC = _React$useState2[1];
3926
3989
 
3927
3990
  var _useIsMounted = useIsMounted(),
3928
3991
  isMounted = _useIsMounted.isMounted;
@@ -4003,23 +4066,6 @@ var ProductFormTAC = function ProductFormTAC(_ref) {
4003
4066
  }));
4004
4067
  };
4005
4068
 
4006
- /* *
4007
- * Licensed under the Apache License, Version 2.0 (the "License");
4008
- * you may not use this file except in compliance with the License.
4009
- * You may obtain a copy of the License at
4010
- *
4011
- * http://www.apache.org/licenses/LICENSE-2.0
4012
- *
4013
- * Unless required by applicable law or agreed to in writing, software
4014
- * distributed under the License is distributed on an "AS IS" BASIS,
4015
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4016
- * See the License for the specific language governing permissions and
4017
- * limitations under the License.
4018
- *
4019
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
4020
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
4021
- * */
4022
-
4023
4069
  var SigmetForm = function SigmetForm(_ref) {
4024
4070
  var mode = _ref.mode,
4025
4071
  _ref$isCancelSigmet = _ref.isCancelSigmet,
@@ -4027,7 +4073,9 @@ var SigmetForm = function SigmetForm(_ref) {
4027
4073
  _ref$initialSigmet = _ref.initialSigmet,
4028
4074
  initialSigmet = _ref$initialSigmet === void 0 ? null : _ref$initialSigmet,
4029
4075
  _ref$initialCancelSig = _ref.initialCancelSigmet,
4030
- initialCancelSigmet = _ref$initialCancelSig === void 0 ? null : _ref$initialCancelSig;
4076
+ initialCancelSigmet = _ref$initialCancelSig === void 0 ? null : _ref$initialCancelSig,
4077
+ _ref$showMap = _ref.showMap,
4078
+ showMap = _ref$showMap === void 0 ? true : _ref$showMap;
4031
4079
  var classes = useStyles$6();
4032
4080
 
4033
4081
  var _useApiContext = useApiContext(),
@@ -4040,15 +4088,17 @@ var SigmetForm = function SigmetForm(_ref) {
4040
4088
  getValues = _useFormContext.getValues;
4041
4089
 
4042
4090
  var _React$useState = React__default.useState(mode === 'view'),
4043
- isDisabled = _React$useState[0],
4044
- setIsDisabled = _React$useState[1];
4091
+ _React$useState2 = _slicedToArray(_React$useState, 2),
4092
+ isDisabled = _React$useState2[0],
4093
+ setIsDisabled = _React$useState2[1];
4045
4094
 
4046
4095
  var isReadOnly = mode === 'view';
4047
4096
  var helperText = isDisabled ? '' : 'Optional';
4048
4097
 
4049
4098
  var _useTAC = useTAC(initialSigmet !== null ? initialSigmet : initialCancelSigmet, api.getSigmetTAC),
4050
- tac = _useTAC[0],
4051
- updateTac = _useTAC[1];
4099
+ _useTAC2 = _slicedToArray(_useTAC, 2),
4100
+ tac = _useTAC2[0],
4101
+ updateTac = _useTAC2[1];
4052
4102
 
4053
4103
  var onChangeForm = function onChangeForm() {
4054
4104
  updateTac(getValues());
@@ -4131,7 +4181,7 @@ var SigmetForm = function SigmetForm(_ref) {
4131
4181
  }, /*#__PURE__*/React__default.createElement(Grid, {
4132
4182
  item: true,
4133
4183
  xs: 8
4134
- }, /*#__PURE__*/React__default.createElement(MapViewGeoJson, {
4184
+ }, showMap && /*#__PURE__*/React__default.createElement(MapViewGeoJson, {
4135
4185
  geoJSONs: geoJSONs,
4136
4186
  setLayerGeoJSONs: function setLayerGeoJSONs(geoJSONs) {
4137
4187
  return _setLayerGeoJSONs(createInterSections(geoJSONs));
@@ -4145,8 +4195,6 @@ var SigmetForm = function SigmetForm(_ref) {
4145
4195
  item: true,
4146
4196
  xs: 4,
4147
4197
  className: classes.productForm
4148
- }, /*#__PURE__*/React__default.createElement(MuiPickersUtilsProvider, {
4149
- utils: MomentUtils
4150
4198
  }, /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Grid, {
4151
4199
  container: true,
4152
4200
  direction: "column",
@@ -4283,26 +4331,9 @@ var SigmetForm = function SigmetForm(_ref) {
4283
4331
  }))), /*#__PURE__*/React__default.createElement(Type, {
4284
4332
  isDisabled: isDisabled,
4285
4333
  isReadOnly: isReadOnly
4286
- }))))));
4334
+ })))));
4287
4335
  };
4288
4336
 
4289
- /* *
4290
- * Licensed under the Apache License, Version 2.0 (the "License");
4291
- * you may not use this file except in compliance with the License.
4292
- * You may obtain a copy of the License at
4293
- *
4294
- * http://www.apache.org/licenses/LICENSE-2.0
4295
- *
4296
- * Unless required by applicable law or agreed to in writing, software
4297
- * distributed under the License is distributed on an "AS IS" BASIS,
4298
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4299
- * See the License for the specific language governing permissions and
4300
- * limitations under the License.
4301
- *
4302
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
4303
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
4304
- * */
4305
-
4306
4337
  var AirmetForm = function AirmetForm(_ref) {
4307
4338
  var mode = _ref.mode,
4308
4339
  _ref$isCancelAirmet = _ref.isCancelAirmet,
@@ -4310,7 +4341,9 @@ var AirmetForm = function AirmetForm(_ref) {
4310
4341
  _ref$initialAirmet = _ref.initialAirmet,
4311
4342
  initialAirmet = _ref$initialAirmet === void 0 ? null : _ref$initialAirmet,
4312
4343
  _ref$initialCancelAir = _ref.initialCancelAirmet,
4313
- initialCancelAirmet = _ref$initialCancelAir === void 0 ? null : _ref$initialCancelAir;
4344
+ initialCancelAirmet = _ref$initialCancelAir === void 0 ? null : _ref$initialCancelAir,
4345
+ _ref$showMap = _ref.showMap,
4346
+ showMap = _ref$showMap === void 0 ? true : _ref$showMap;
4314
4347
  var classes = useStyles$6();
4315
4348
 
4316
4349
  var _useApiContext = useApiContext(),
@@ -4325,15 +4358,17 @@ var AirmetForm = function AirmetForm(_ref) {
4325
4358
  var phenomenon = watch('phenomenon');
4326
4359
 
4327
4360
  var _React$useState = React__default.useState(mode === 'view'),
4328
- isDisabled = _React$useState[0],
4329
- setIsDisabled = _React$useState[1];
4361
+ _React$useState2 = _slicedToArray(_React$useState, 2),
4362
+ isDisabled = _React$useState2[0],
4363
+ setIsDisabled = _React$useState2[1];
4330
4364
 
4331
4365
  var isReadOnly = mode === 'view';
4332
4366
  var helperText = isDisabled ? '' : 'Optional';
4333
4367
 
4334
4368
  var _useTAC = useTAC(initialAirmet !== null ? initialAirmet : initialCancelAirmet, api.getAirmetTAC),
4335
- tac = _useTAC[0],
4336
- updateTac = _useTAC[1];
4369
+ _useTAC2 = _slicedToArray(_useTAC, 2),
4370
+ tac = _useTAC2[0],
4371
+ updateTac = _useTAC2[1];
4337
4372
 
4338
4373
  var onChangeForm = function onChangeForm() {
4339
4374
  updateTac(getValues());
@@ -4394,7 +4429,7 @@ var AirmetForm = function AirmetForm(_ref) {
4394
4429
  }, /*#__PURE__*/React__default.createElement(Grid, {
4395
4430
  item: true,
4396
4431
  xs: 8
4397
- }, /*#__PURE__*/React__default.createElement(MapViewGeoJson, {
4432
+ }, showMap && /*#__PURE__*/React__default.createElement(MapViewGeoJson, {
4398
4433
  geoJSONs: geoJSONs,
4399
4434
  setLayerGeoJSONs: function setLayerGeoJSONs(geoJSONs) {
4400
4435
  return _setLayerGeoJSONs(createInterSections(geoJSONs));
@@ -4407,8 +4442,6 @@ var AirmetForm = function AirmetForm(_ref) {
4407
4442
  item: true,
4408
4443
  xs: 4,
4409
4444
  className: classes.productForm
4410
- }, /*#__PURE__*/React__default.createElement(MuiPickersUtilsProvider, {
4411
- utils: MomentUtils
4412
4445
  }, /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Grid, {
4413
4446
  container: true,
4414
4447
  direction: "column",
@@ -4525,7 +4558,7 @@ var AirmetForm = function AirmetForm(_ref) {
4525
4558
  }))), /*#__PURE__*/React__default.createElement(Type, {
4526
4559
  isDisabled: isDisabled,
4527
4560
  isReadOnly: isReadOnly
4528
- }))))));
4561
+ })))));
4529
4562
  };
4530
4563
 
4531
4564
  var useStyles$3 = makeStyles({
@@ -4613,22 +4646,6 @@ var ContentDialog = function ContentDialog(_a) {
4613
4646
  }, children));
4614
4647
  };
4615
4648
 
4616
- /* *
4617
- * Licensed under the Apache License, Version 2.0 (the "License");
4618
- * you may not use this file except in compliance with the License.
4619
- * You may obtain a copy of the License at
4620
- *
4621
- * http://www.apache.org/licenses/LICENSE-2.0
4622
- *
4623
- * Unless required by applicable law or agreed to in writing, software
4624
- * distributed under the License is distributed on an "AS IS" BASIS,
4625
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4626
- * See the License for the specific language governing permissions and
4627
- * limitations under the License.
4628
- *
4629
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
4630
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
4631
- * */
4632
4649
  var getActiveStatus = function getActiveStatus(product, className) {
4633
4650
  // do not return an icon if product is expired
4634
4651
  if (moment(product.validDateEnd) < moment.utc(new Date())) {
@@ -4647,21 +4664,19 @@ var getActiveStatus = function getActiveStatus(product, className) {
4647
4664
  });
4648
4665
  };
4649
4666
 
4650
- var getStatusTagList = function getStatusTagList(product, cancelsSeqId) {
4651
- if (cancelsSeqId === void 0) {
4652
- cancelsSeqId = null;
4653
- }
4667
+ var getStatusTagList = function getStatusTagList(product) {
4668
+ var cancelsSeqId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
4654
4669
 
4655
4670
  if (cancelsSeqId !== null) {
4656
4671
  return /*#__PURE__*/React__default.createElement(StatusTag, {
4657
- content: "cancels " + cancelsSeqId,
4672
+ content: "cancels ".concat(cancelsSeqId),
4658
4673
  color: "red"
4659
4674
  });
4660
4675
  }
4661
4676
 
4662
4677
  if (product.status === 'CANCELLED') {
4663
4678
  return /*#__PURE__*/React__default.createElement(StatusTag, {
4664
- content: "cancelled " + product.sequence,
4679
+ content: "cancelled ".concat(product.sequence),
4665
4680
  color: "red"
4666
4681
  });
4667
4682
  }
@@ -4720,7 +4735,7 @@ var formatValidTime = function formatValidTime(startDate, endDate, format) {
4720
4735
  return '-';
4721
4736
  }
4722
4737
 
4723
- return moment.utc(startDate).format('DD MMM YYYY, HH:mm') + " - " + moment.utc(endDate).format(format) + " UTC";
4738
+ return "".concat(moment.utc(startDate).format('DD MMM YYYY, HH:mm'), " - ").concat(moment.utc(endDate).format(format), " UTC");
4724
4739
  };
4725
4740
 
4726
4741
  var ProductListRow = function ProductListRow(_ref) {
@@ -4735,8 +4750,9 @@ var ProductListRow = function ProductListRow(_ref) {
4735
4750
  isMounted = _useIsMounted.isMounted;
4736
4751
 
4737
4752
  var _React$useState = React__default.useState(''),
4738
- TAC = _React$useState[0],
4739
- setTAC = _React$useState[1];
4753
+ _React$useState2 = _slicedToArray(_React$useState, 2),
4754
+ TAC = _React$useState2[0],
4755
+ setTAC = _React$useState2[1];
4740
4756
 
4741
4757
  var apiCall = productType === 'sigmet' ? api.getSigmetTAC : api.getAirmetTAC;
4742
4758
  React__default.useEffect(function () {
@@ -4812,7 +4828,7 @@ var ProductListRow = function ProductListRow(_ref) {
4812
4828
  variant: "subtitle2",
4813
4829
  className: classes.font,
4814
4830
  "data-testid": "issueTime"
4815
- }, product.issueDate ? moment.utc(product.issueDate).format('DD MMM YYYY, HH:mm') + " UTC" : '(Not published)')), /*#__PURE__*/React__default.createElement(Grid, {
4831
+ }, product.issueDate ? "".concat(moment.utc(product.issueDate).format('DD MMM YYYY, HH:mm'), " UTC") : '(Not published)')), /*#__PURE__*/React__default.createElement(Grid, {
4816
4832
  item: true,
4817
4833
  xs: 12,
4818
4834
  sm: 8,
@@ -4907,7 +4923,7 @@ var ProductList = function ProductList(_ref) {
4907
4923
  onClick: function onClick() {
4908
4924
  onClickProductRow(productListItem);
4909
4925
  },
4910
- key: product.sequence && product.issueDate ? product.sequence + "-" + product.issueDate : "draft-" + index,
4926
+ key: product.sequence && product.issueDate ? "".concat(product.sequence, "-").concat(product.issueDate) : "draft-".concat(index),
4911
4927
  className: classes.listItem
4912
4928
  }, /*#__PURE__*/React__default.createElement(ProductListRow, {
4913
4929
  product: product,
@@ -5023,16 +5039,19 @@ var ProductFormDialogContent = function ProductFormDialogContent(_ref) {
5023
5039
  var confirmationDialog = useConfirmationDialog();
5024
5040
 
5025
5041
  var _React$useState = React.useState(false),
5026
- showLoader = _React$useState[0],
5027
- setLoader = _React$useState[1];
5042
+ _React$useState2 = _slicedToArray(_React$useState, 2),
5043
+ showLoader = _React$useState2[0],
5044
+ setLoader = _React$useState2[1];
5028
5045
 
5029
- var _React$useState2 = React.useState(false),
5030
- errorStoreMessage = _React$useState2[0],
5031
- setErrorStoreMessage = _React$useState2[1];
5046
+ var _React$useState3 = React.useState(false),
5047
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
5048
+ errorStoreMessage = _React$useState4[0],
5049
+ setErrorStoreMessage = _React$useState4[1];
5032
5050
 
5033
- var _React$useState3 = React.useState(''),
5034
- errorStoreMessageText = _React$useState3[0],
5035
- setErrorStoreMessageText = _React$useState3[1];
5051
+ var _React$useState5 = React.useState(''),
5052
+ _React$useState6 = _slicedToArray(_React$useState5, 2),
5053
+ errorStoreMessageText = _React$useState6[0],
5054
+ setErrorStoreMessageText = _React$useState6[1];
5036
5055
 
5037
5056
  React.useEffect(function () {
5038
5057
  // set the values of the newly selected product
@@ -5243,22 +5262,6 @@ var ProductFormDialog = function ProductFormDialog(_ref) {
5243
5262
  })));
5244
5263
  };
5245
5264
 
5246
- /* *
5247
- * Licensed under the Apache License, Version 2.0 (the "License");
5248
- * you may not use this file except in compliance with the License.
5249
- * You may obtain a copy of the License at
5250
- *
5251
- * http://www.apache.org/licenses/LICENSE-2.0
5252
- *
5253
- * Unless required by applicable law or agreed to in writing, software
5254
- * distributed under the License is distributed on an "AS IS" BASIS,
5255
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5256
- * See the License for the specific language governing permissions and
5257
- * limitations under the License.
5258
- *
5259
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
5260
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
5261
- * */
5262
5265
  /**
5263
5266
  * Shows the list of Sigmets or Airmets and allows to create, edit and view Sigmets/Airmets.
5264
5267
  * Needs to be wrapped in the ApiProvider.
@@ -5276,12 +5279,14 @@ var MetInfoWrapper = function MetInfoWrapper(_ref) {
5276
5279
  api = _useApiContext.api;
5277
5280
 
5278
5281
  var _React$useState = React__default.useState(false),
5279
- isFormDialogOpen = _React$useState[0],
5280
- setIsFormDialogOpen = _React$useState[1];
5282
+ _React$useState2 = _slicedToArray(_React$useState, 2),
5283
+ isFormDialogOpen = _React$useState2[0],
5284
+ setIsFormDialogOpen = _React$useState2[1];
5281
5285
 
5282
- var _React$useState2 = React__default.useState(null),
5283
- selectedProduct = _React$useState2[0],
5284
- setSelectedProduct = _React$useState2[1]; // Retrieve list of products
5286
+ var _React$useState3 = React__default.useState(null),
5287
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
5288
+ selectedProduct = _React$useState4[0],
5289
+ setSelectedProduct = _React$useState4[1]; // Retrieve list of products
5285
5290
 
5286
5291
 
5287
5292
  var _useApi = useApi(productType === 'sigmet' ? api.getSigmetList : api.getAirmetList),
@@ -5352,8 +5357,8 @@ var MetInfoWrapper = function MetInfoWrapper(_ref) {
5352
5357
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
5353
5358
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
5354
5359
  * */
5355
- var createApi = function createApi(url, appUrl, auth, setAuth, authTokenUrl) {
5356
- var axiosInstance = createApiInstance(url, appUrl, auth, setAuth, authTokenUrl);
5360
+ var createApi = function createApi(url, appUrl, auth, setAuth, authTokenUrl, authClientId) {
5361
+ var axiosInstance = createApiInstance(url, appUrl, auth, setAuth, authTokenUrl, authClientId);
5357
5362
  return {
5358
5363
  // api data
5359
5364
  getSigmetList: function getSigmetList() {