@opengeoweb/taf 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.esm.js +94 -30
- package/index.umd.js +104 -34
- package/package.json +14 -13
package/index.esm.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default from 'react';
|
|
3
|
-
import { Grid, Button,
|
|
3
|
+
import { Grid, Button, Chip, Box, Typography, FormLabel, Switch, TextField, Card, Tabs, Tab, Dialog, MenuList, MenuItem, Backdrop, CircularProgress } from '@mui/material';
|
|
4
4
|
import { useFormContext, Controller, useFieldArray } from 'react-hook-form';
|
|
5
5
|
import { useDispatch } from 'react-redux';
|
|
6
6
|
import { ReactSortable } from 'react-sortablejs';
|
|
7
7
|
import Sortable from 'sortablejs';
|
|
8
8
|
import { useAuthenticationContext } from '@opengeoweb/authentication';
|
|
9
9
|
import { HIDDEN_INPUT_HELPER_IS_DRAFT, getDeepProperty, useDraftFormHelpers, ReactHookFormHiddenInput, ReactHookFormProvider } from '@opengeoweb/form-fields';
|
|
10
|
-
import { useIsMounted, CustomTooltip, ToolContainerDraggable, Avatar, getInitials, ToggleMenu, useConfirmationDialog, usePreventBrowserClose, ToolButton, ToolHeader, AlertBanner, getErrorMessage as getErrorMessage$1, getWarningMessage, ConfirmationServiceProvider, usePoller, ErrorBoundary } from '@opengeoweb/shared';
|
|
10
|
+
import { useIsMounted, CustomIconButton, CustomTooltip, ToolContainerDraggable, Avatar, getInitials, ToggleMenu, useConfirmationDialog, usePreventBrowserClose, ToolButton, ToolHeader, AlertBanner, getErrorMessage as getErrorMessage$1, getWarningMessage, ConfirmationServiceProvider, usePoller, ErrorBoundary } from '@opengeoweb/shared';
|
|
11
11
|
import { snackbarActions } from '@opengeoweb/core';
|
|
12
12
|
import moment from 'moment';
|
|
13
13
|
import { isEqual } from 'lodash';
|
|
@@ -390,7 +390,10 @@ var getValidityTimeStamp = function getValidityTimeStamp(sectionType, sections,
|
|
|
390
390
|
|
|
391
391
|
|
|
392
392
|
var parseValidToObject = function parseValidToObject(value, tafStart, tafEnd) {
|
|
393
|
-
if (!value)
|
|
393
|
+
if (!value) {
|
|
394
|
+
return null;
|
|
395
|
+
} // Create valid object from passed string
|
|
396
|
+
|
|
394
397
|
|
|
395
398
|
var trimmedValue = value.trim();
|
|
396
399
|
var tafStartMoment = moment.utc(tafStart);
|
|
@@ -453,7 +456,10 @@ var validateIsValidDates = function validateIsValidDates(value, tafStart, tafEnd
|
|
|
453
456
|
|
|
454
457
|
var sectionValidationStart = validateValidSections(startSections, 'start'); // If invalid start - return with errors
|
|
455
458
|
|
|
456
|
-
if (sectionValidationStart.length)
|
|
459
|
+
if (sectionValidationStart.length) {
|
|
460
|
+
return sectionValidationStart;
|
|
461
|
+
}
|
|
462
|
+
|
|
457
463
|
var startTimestamp = getValidityTimeStamp('start', startSections, tafStartMoment, tafEndMoment); // Validate start is within the taf validity bounds
|
|
458
464
|
|
|
459
465
|
if (startTimestamp < tafStartMoment || startTimestamp > tafEndMoment) {
|
|
@@ -466,7 +472,10 @@ var validateIsValidDates = function validateIsValidDates(value, tafStart, tafEnd
|
|
|
466
472
|
|
|
467
473
|
var sectionValidationEnd = validateValidSections(endSections, 'end'); // If invalid end - return with errors
|
|
468
474
|
|
|
469
|
-
if (sectionValidationEnd.length)
|
|
475
|
+
if (sectionValidationEnd.length) {
|
|
476
|
+
return sectionValidationEnd;
|
|
477
|
+
}
|
|
478
|
+
|
|
470
479
|
var endTimestamp = getValidityTimeStamp('end', endSections, tafStartMoment, tafEndMoment); // Validate end is not before start
|
|
471
480
|
|
|
472
481
|
if (endTimestamp < startTimestamp) {
|
|
@@ -604,7 +613,11 @@ var validatePreviousChangeGroup = function validatePreviousChangeGroup(currentCh
|
|
|
604
613
|
|
|
605
614
|
var validateOverlapWithFM = function validateOverlapWithFM(currentChangeGroup, nextChangeGroups, tafStart, tafEnd) {
|
|
606
615
|
var valid = getFieldValue(currentChangeGroup.valid);
|
|
607
|
-
|
|
616
|
+
|
|
617
|
+
if (!valid || !nextChangeGroups.length) {
|
|
618
|
+
return true;
|
|
619
|
+
}
|
|
620
|
+
|
|
608
621
|
var validValue = parseValidToObject(valid, tafStart, tafEnd);
|
|
609
622
|
var currentRowEndTime = moment(validValue.end);
|
|
610
623
|
var firstFMChangeGroup = nextChangeGroups.find(function (nextChangeGroup) {
|
|
@@ -1650,14 +1663,20 @@ var validateWindField = function validateWindField(value, weatherfield1, weather
|
|
|
1650
1663
|
};
|
|
1651
1664
|
|
|
1652
1665
|
var formatSingleCloud = function formatSingleCloud(value) {
|
|
1653
|
-
if (!value)
|
|
1666
|
+
if (!value) {
|
|
1667
|
+
return null;
|
|
1668
|
+
}
|
|
1669
|
+
|
|
1654
1670
|
return value.type ? "".concat(value.coverage).concat(prependZeroes(value.height, 3)).concat(value.type) : "".concat(value.coverage).concat(prependZeroes(value.height, 3));
|
|
1655
1671
|
}; // TODO: clouds type = Clouds, but couldn't get it to work properly https://gitlab.com/opengeoweb/opengeoweb/-/issues/119
|
|
1656
1672
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
1657
1673
|
|
|
1658
1674
|
|
|
1659
1675
|
var formatCloudsToString = function formatCloudsToString(clouds) {
|
|
1660
|
-
if (!clouds)
|
|
1676
|
+
if (!clouds) {
|
|
1677
|
+
return null;
|
|
1678
|
+
}
|
|
1679
|
+
|
|
1661
1680
|
return Object.keys(clouds).reduce(function (list, key) {
|
|
1662
1681
|
// only format it if it has a value
|
|
1663
1682
|
if (clouds[key]) {
|
|
@@ -1691,7 +1710,10 @@ var formatCloudsToString = function formatCloudsToString(clouds) {
|
|
|
1691
1710
|
}; // parsers
|
|
1692
1711
|
|
|
1693
1712
|
var parseSingleCloud = function parseSingleCloud(value) {
|
|
1694
|
-
if (!value)
|
|
1713
|
+
if (!value) {
|
|
1714
|
+
return null;
|
|
1715
|
+
}
|
|
1716
|
+
|
|
1695
1717
|
var trimmedCloud = value.trim();
|
|
1696
1718
|
var cloudType = trimmedCloud.substring(6, 9);
|
|
1697
1719
|
return Object.assign({
|
|
@@ -1705,7 +1727,10 @@ var parseSingleCloud = function parseSingleCloud(value) {
|
|
|
1705
1727
|
|
|
1706
1728
|
|
|
1707
1729
|
var parseCloudsToObject = function parseCloudsToObject(clouds) {
|
|
1708
|
-
if (!clouds)
|
|
1730
|
+
if (!clouds) {
|
|
1731
|
+
return null;
|
|
1732
|
+
}
|
|
1733
|
+
|
|
1709
1734
|
return Object.keys(clouds).reduce(function (list, key) {
|
|
1710
1735
|
// only parse it if it has a value
|
|
1711
1736
|
if (clouds[key] && clouds[key].trim()) {
|
|
@@ -2554,7 +2579,11 @@ var useDragOrder = function useDragOrder(trigger, move) {
|
|
|
2554
2579
|
var onChangeOrder = function onChangeOrder(_ref) {
|
|
2555
2580
|
var oldIndex = _ref.oldIndex,
|
|
2556
2581
|
newIndex = _ref.newIndex;
|
|
2557
|
-
|
|
2582
|
+
|
|
2583
|
+
if (oldIndex === undefined || newIndex === undefined) {
|
|
2584
|
+
return;
|
|
2585
|
+
}
|
|
2586
|
+
|
|
2558
2587
|
move(oldIndex, newIndex);
|
|
2559
2588
|
onUpdatelastDragOrder([oldIndex, newIndex]);
|
|
2560
2589
|
setActiveDraggingIndex(false);
|
|
@@ -2584,17 +2613,35 @@ var useDragOrder = function useDragOrder(trigger, move) {
|
|
|
2584
2613
|
}; // dialog utils
|
|
2585
2614
|
|
|
2586
2615
|
var getConfirmationDialogTitle = function getConfirmationDialogTitle(action) {
|
|
2587
|
-
if (action === 'CLEAR')
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
if (action === '
|
|
2616
|
+
if (action === 'CLEAR') {
|
|
2617
|
+
return 'Clear TAF';
|
|
2618
|
+
}
|
|
2619
|
+
|
|
2620
|
+
if (action === 'PUBLISH') {
|
|
2621
|
+
return 'Publish';
|
|
2622
|
+
}
|
|
2623
|
+
|
|
2624
|
+
if (action === 'AMEND') {
|
|
2625
|
+
return 'This TAF is an amendment';
|
|
2626
|
+
}
|
|
2627
|
+
|
|
2628
|
+
if (action === 'CORRECT') {
|
|
2629
|
+
return 'This TAF is a correction';
|
|
2630
|
+
}
|
|
2631
|
+
|
|
2632
|
+
if (action === 'CANCEL') {
|
|
2633
|
+
return 'Cancel TAF';
|
|
2634
|
+
}
|
|
2635
|
+
|
|
2592
2636
|
return 'Cancel TAF';
|
|
2593
2637
|
}; // Check if the amended/corrected TAF has been changed. Only compare the fields users are able to fill in
|
|
2594
2638
|
// (i.e. exclude baseforecast valid time as that gets updated when doing an amendment automatically outside of the users influence)
|
|
2595
2639
|
|
|
2596
2640
|
var isTafAmendedCorrectedChanged = function isTafAmendedCorrectedChanged(originalTaf, currentTaf) {
|
|
2597
|
-
if (originalTaf === null || currentTaf === null)
|
|
2641
|
+
if (originalTaf === null || currentTaf === null) {
|
|
2642
|
+
return false;
|
|
2643
|
+
}
|
|
2644
|
+
|
|
2598
2645
|
var originalBaseF = originalTaf.baseForecast,
|
|
2599
2646
|
originalChG = originalTaf.changeGroups;
|
|
2600
2647
|
var currentBaseF = currentTaf.baseForecast,
|
|
@@ -2846,8 +2893,8 @@ var getFormRowPosition = function getFormRowPosition(formRow) {
|
|
|
2846
2893
|
* See the License for the specific language governing permissions and
|
|
2847
2894
|
* limitations under the License.
|
|
2848
2895
|
*
|
|
2849
|
-
* Copyright
|
|
2850
|
-
* Copyright
|
|
2896
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
2897
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
2851
2898
|
* */
|
|
2852
2899
|
|
|
2853
2900
|
var DragHandle = function DragHandle(_ref) {
|
|
@@ -2856,18 +2903,21 @@ var DragHandle = function DragHandle(_ref) {
|
|
|
2856
2903
|
_ref$isDisabled = _ref.isDisabled,
|
|
2857
2904
|
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
|
|
2858
2905
|
index = _ref.index;
|
|
2859
|
-
return /*#__PURE__*/React__default.createElement(
|
|
2906
|
+
return /*#__PURE__*/React__default.createElement(CustomIconButton, {
|
|
2860
2907
|
className: "handle",
|
|
2861
2908
|
"data-testid": "dragHandle-".concat(index),
|
|
2862
2909
|
disableRipple: true,
|
|
2863
2910
|
disabled: isDisabled,
|
|
2864
|
-
size: "large",
|
|
2865
2911
|
sx: {
|
|
2866
|
-
|
|
2867
|
-
'
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2912
|
+
cursor: isSorting ? 'grabbing' : 'grab',
|
|
2913
|
+
'&.MuiButtonBase-root.MuiIconButton-root': {
|
|
2914
|
+
width: 50,
|
|
2915
|
+
height: 50,
|
|
2916
|
+
color: 'geowebColors.greys.accessible',
|
|
2917
|
+
'&:hover': {
|
|
2918
|
+
backgroundColor: 'transparent'
|
|
2919
|
+
}
|
|
2920
|
+
}
|
|
2871
2921
|
}
|
|
2872
2922
|
}, /*#__PURE__*/React__default.createElement(DragHandle$1, null));
|
|
2873
2923
|
};
|
|
@@ -2909,7 +2959,11 @@ var getIssuesLabel = function getIssuesLabel(sumOfErrors) {
|
|
|
2909
2959
|
var getErrorValues = function getErrorValues(fieldErrors) {
|
|
2910
2960
|
var isChangeGroup = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
2911
2961
|
var rowIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : -1;
|
|
2912
|
-
|
|
2962
|
+
|
|
2963
|
+
if (!fieldErrors) {
|
|
2964
|
+
return [];
|
|
2965
|
+
}
|
|
2966
|
+
|
|
2913
2967
|
return Object.keys(fieldErrors).reduce(function (list, key) {
|
|
2914
2968
|
var error = Object.assign({}, fieldErrors[key]);
|
|
2915
2969
|
|
|
@@ -4643,7 +4697,10 @@ var TafForm = /*#__PURE__*/React__default.memo(function (_ref) {
|
|
|
4643
4697
|
forceFallback: false,
|
|
4644
4698
|
onStart: function onStart(event) {
|
|
4645
4699
|
onStartDrag(event);
|
|
4646
|
-
|
|
4700
|
+
|
|
4701
|
+
if (Sortable.ghost) {
|
|
4702
|
+
Sortable.ghost.style.opacity = '1';
|
|
4703
|
+
}
|
|
4647
4704
|
}
|
|
4648
4705
|
}, fields.map(function (item, index) {
|
|
4649
4706
|
return /*#__PURE__*/React__default.createElement(TafFormRow, {
|
|
@@ -4933,7 +4990,11 @@ var getNewTafLocationIndex = function getNewTafLocationIndex(tafLocations, previ
|
|
|
4933
4990
|
};
|
|
4934
4991
|
var getPreviousTaf = function getPreviousTaf(tafList, currentTaf) {
|
|
4935
4992
|
var previousId = currentTaf.taf.previousId;
|
|
4936
|
-
|
|
4993
|
+
|
|
4994
|
+
if (!previousId) {
|
|
4995
|
+
return null;
|
|
4996
|
+
}
|
|
4997
|
+
|
|
4937
4998
|
var previousTaf = tafList.find(function (taf) {
|
|
4938
4999
|
return taf.taf.uuid === previousId;
|
|
4939
5000
|
});
|
|
@@ -5282,7 +5343,10 @@ var TacOverview = function TacOverview(_ref) {
|
|
|
5282
5343
|
};
|
|
5283
5344
|
|
|
5284
5345
|
var scrollToPosition = React__default.useCallback(function () {
|
|
5285
|
-
if (!scrollRef.current)
|
|
5346
|
+
if (!scrollRef.current) {
|
|
5347
|
+
return;
|
|
5348
|
+
}
|
|
5349
|
+
|
|
5286
5350
|
var containerTop = scrollRef.current.getBoundingClientRect().top;
|
|
5287
5351
|
var firstLocation = scrollRef.current.querySelector("[data-location=\"".concat(activeLocation, "\"]"));
|
|
5288
5352
|
var paddingTop = parseInt(getComputedStyle(scrollRef.current).paddingTop, 10);
|
package/index.umd.js
CHANGED
|
@@ -384,7 +384,10 @@
|
|
|
384
384
|
|
|
385
385
|
|
|
386
386
|
var parseValidToObject = function parseValidToObject(value, tafStart, tafEnd) {
|
|
387
|
-
if (!value)
|
|
387
|
+
if (!value) {
|
|
388
|
+
return null;
|
|
389
|
+
} // Create valid object from passed string
|
|
390
|
+
|
|
388
391
|
|
|
389
392
|
var trimmedValue = value.trim();
|
|
390
393
|
var tafStartMoment = moment__default["default"].utc(tafStart);
|
|
@@ -447,7 +450,10 @@
|
|
|
447
450
|
|
|
448
451
|
var sectionValidationStart = validateValidSections(startSections, 'start'); // If invalid start - return with errors
|
|
449
452
|
|
|
450
|
-
if (sectionValidationStart.length)
|
|
453
|
+
if (sectionValidationStart.length) {
|
|
454
|
+
return sectionValidationStart;
|
|
455
|
+
}
|
|
456
|
+
|
|
451
457
|
var startTimestamp = getValidityTimeStamp('start', startSections, tafStartMoment, tafEndMoment); // Validate start is within the taf validity bounds
|
|
452
458
|
|
|
453
459
|
if (startTimestamp < tafStartMoment || startTimestamp > tafEndMoment) {
|
|
@@ -460,7 +466,10 @@
|
|
|
460
466
|
|
|
461
467
|
var sectionValidationEnd = validateValidSections(endSections, 'end'); // If invalid end - return with errors
|
|
462
468
|
|
|
463
|
-
if (sectionValidationEnd.length)
|
|
469
|
+
if (sectionValidationEnd.length) {
|
|
470
|
+
return sectionValidationEnd;
|
|
471
|
+
}
|
|
472
|
+
|
|
464
473
|
var endTimestamp = getValidityTimeStamp('end', endSections, tafStartMoment, tafEndMoment); // Validate end is not before start
|
|
465
474
|
|
|
466
475
|
if (endTimestamp < startTimestamp) {
|
|
@@ -598,7 +607,11 @@
|
|
|
598
607
|
|
|
599
608
|
var validateOverlapWithFM = function validateOverlapWithFM(currentChangeGroup, nextChangeGroups, tafStart, tafEnd) {
|
|
600
609
|
var valid = getFieldValue(currentChangeGroup.valid);
|
|
601
|
-
|
|
610
|
+
|
|
611
|
+
if (!valid || !nextChangeGroups.length) {
|
|
612
|
+
return true;
|
|
613
|
+
}
|
|
614
|
+
|
|
602
615
|
var validValue = parseValidToObject(valid, tafStart, tafEnd);
|
|
603
616
|
var currentRowEndTime = moment__default["default"](validValue.end);
|
|
604
617
|
var firstFMChangeGroup = nextChangeGroups.find(function (nextChangeGroup) {
|
|
@@ -1648,14 +1661,20 @@
|
|
|
1648
1661
|
};
|
|
1649
1662
|
|
|
1650
1663
|
var formatSingleCloud = function formatSingleCloud(value) {
|
|
1651
|
-
if (!value)
|
|
1664
|
+
if (!value) {
|
|
1665
|
+
return null;
|
|
1666
|
+
}
|
|
1667
|
+
|
|
1652
1668
|
return value.type ? "" + value.coverage + prependZeroes(value.height, 3) + value.type : "" + value.coverage + prependZeroes(value.height, 3);
|
|
1653
1669
|
}; // TODO: clouds type = Clouds, but couldn't get it to work properly https://gitlab.com/opengeoweb/opengeoweb/-/issues/119
|
|
1654
1670
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
1655
1671
|
|
|
1656
1672
|
|
|
1657
1673
|
var formatCloudsToString = function formatCloudsToString(clouds) {
|
|
1658
|
-
if (!clouds)
|
|
1674
|
+
if (!clouds) {
|
|
1675
|
+
return null;
|
|
1676
|
+
}
|
|
1677
|
+
|
|
1659
1678
|
return Object.keys(clouds).reduce(function (list, key) {
|
|
1660
1679
|
// only format it if it has a value
|
|
1661
1680
|
var _a, _b, _c, _d;
|
|
@@ -1691,7 +1710,10 @@
|
|
|
1691
1710
|
}; // parsers
|
|
1692
1711
|
|
|
1693
1712
|
var parseSingleCloud = function parseSingleCloud(value) {
|
|
1694
|
-
if (!value)
|
|
1713
|
+
if (!value) {
|
|
1714
|
+
return null;
|
|
1715
|
+
}
|
|
1716
|
+
|
|
1695
1717
|
var trimmedCloud = value.trim();
|
|
1696
1718
|
var cloudType = trimmedCloud.substring(6, 9);
|
|
1697
1719
|
return __assign({
|
|
@@ -1705,7 +1727,10 @@
|
|
|
1705
1727
|
|
|
1706
1728
|
|
|
1707
1729
|
var parseCloudsToObject = function parseCloudsToObject(clouds) {
|
|
1708
|
-
if (!clouds)
|
|
1730
|
+
if (!clouds) {
|
|
1731
|
+
return null;
|
|
1732
|
+
}
|
|
1733
|
+
|
|
1709
1734
|
return Object.keys(clouds).reduce(function (list, key) {
|
|
1710
1735
|
var _a, _b, _c, _d; // only parse it if it has a value
|
|
1711
1736
|
|
|
@@ -2555,7 +2580,11 @@
|
|
|
2555
2580
|
var onChangeOrder = function onChangeOrder(_a) {
|
|
2556
2581
|
var oldIndex = _a.oldIndex,
|
|
2557
2582
|
newIndex = _a.newIndex;
|
|
2558
|
-
|
|
2583
|
+
|
|
2584
|
+
if (oldIndex === undefined || newIndex === undefined) {
|
|
2585
|
+
return;
|
|
2586
|
+
}
|
|
2587
|
+
|
|
2559
2588
|
move(oldIndex, newIndex);
|
|
2560
2589
|
onUpdatelastDragOrder([oldIndex, newIndex]);
|
|
2561
2590
|
setActiveDraggingIndex(false);
|
|
@@ -2585,17 +2614,35 @@
|
|
|
2585
2614
|
}; // dialog utils
|
|
2586
2615
|
|
|
2587
2616
|
var getConfirmationDialogTitle = function getConfirmationDialogTitle(action) {
|
|
2588
|
-
if (action === 'CLEAR')
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
if (action === '
|
|
2617
|
+
if (action === 'CLEAR') {
|
|
2618
|
+
return 'Clear TAF';
|
|
2619
|
+
}
|
|
2620
|
+
|
|
2621
|
+
if (action === 'PUBLISH') {
|
|
2622
|
+
return 'Publish';
|
|
2623
|
+
}
|
|
2624
|
+
|
|
2625
|
+
if (action === 'AMEND') {
|
|
2626
|
+
return 'This TAF is an amendment';
|
|
2627
|
+
}
|
|
2628
|
+
|
|
2629
|
+
if (action === 'CORRECT') {
|
|
2630
|
+
return 'This TAF is a correction';
|
|
2631
|
+
}
|
|
2632
|
+
|
|
2633
|
+
if (action === 'CANCEL') {
|
|
2634
|
+
return 'Cancel TAF';
|
|
2635
|
+
}
|
|
2636
|
+
|
|
2593
2637
|
return 'Cancel TAF';
|
|
2594
2638
|
}; // Check if the amended/corrected TAF has been changed. Only compare the fields users are able to fill in
|
|
2595
2639
|
// (i.e. exclude baseforecast valid time as that gets updated when doing an amendment automatically outside of the users influence)
|
|
2596
2640
|
|
|
2597
2641
|
var isTafAmendedCorrectedChanged = function isTafAmendedCorrectedChanged(originalTaf, currentTaf) {
|
|
2598
|
-
if (originalTaf === null || currentTaf === null)
|
|
2642
|
+
if (originalTaf === null || currentTaf === null) {
|
|
2643
|
+
return false;
|
|
2644
|
+
}
|
|
2645
|
+
|
|
2599
2646
|
var originalBaseF = originalTaf.baseForecast,
|
|
2600
2647
|
originalChG = originalTaf.changeGroups;
|
|
2601
2648
|
var currentBaseF = currentTaf.baseForecast,
|
|
@@ -2853,8 +2900,8 @@
|
|
|
2853
2900
|
* See the License for the specific language governing permissions and
|
|
2854
2901
|
* limitations under the License.
|
|
2855
2902
|
*
|
|
2856
|
-
* Copyright
|
|
2857
|
-
* Copyright
|
|
2903
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
2904
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
2858
2905
|
* */
|
|
2859
2906
|
|
|
2860
2907
|
var DragHandle = function DragHandle(_a) {
|
|
@@ -2863,18 +2910,21 @@
|
|
|
2863
2910
|
_c = _a.isDisabled,
|
|
2864
2911
|
isDisabled = _c === void 0 ? false : _c,
|
|
2865
2912
|
index = _a.index;
|
|
2866
|
-
return /*#__PURE__*/React__default["default"].createElement(
|
|
2913
|
+
return /*#__PURE__*/React__default["default"].createElement(shared.CustomIconButton, {
|
|
2867
2914
|
className: "handle",
|
|
2868
2915
|
"data-testid": "dragHandle-" + index,
|
|
2869
2916
|
disableRipple: true,
|
|
2870
2917
|
disabled: isDisabled,
|
|
2871
|
-
size: "large",
|
|
2872
2918
|
sx: {
|
|
2873
|
-
|
|
2874
|
-
'
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2919
|
+
cursor: isSorting ? 'grabbing' : 'grab',
|
|
2920
|
+
'&.MuiButtonBase-root.MuiIconButton-root': {
|
|
2921
|
+
width: 50,
|
|
2922
|
+
height: 50,
|
|
2923
|
+
color: 'geowebColors.greys.accessible',
|
|
2924
|
+
'&:hover': {
|
|
2925
|
+
backgroundColor: 'transparent'
|
|
2926
|
+
}
|
|
2927
|
+
}
|
|
2878
2928
|
}
|
|
2879
2929
|
}, /*#__PURE__*/React__default["default"].createElement(theme.DragHandle, null));
|
|
2880
2930
|
};
|
|
@@ -2922,7 +2972,10 @@
|
|
|
2922
2972
|
rowIndex = -1;
|
|
2923
2973
|
}
|
|
2924
2974
|
|
|
2925
|
-
if (!fieldErrors)
|
|
2975
|
+
if (!fieldErrors) {
|
|
2976
|
+
return [];
|
|
2977
|
+
}
|
|
2978
|
+
|
|
2926
2979
|
return Object.keys(fieldErrors).reduce(function (list, key) {
|
|
2927
2980
|
var error = __assign({}, fieldErrors[key]);
|
|
2928
2981
|
|
|
@@ -4662,7 +4715,10 @@
|
|
|
4662
4715
|
forceFallback: false,
|
|
4663
4716
|
onStart: function onStart(event) {
|
|
4664
4717
|
onStartDrag(event);
|
|
4665
|
-
|
|
4718
|
+
|
|
4719
|
+
if (Sortable__default["default"].ghost) {
|
|
4720
|
+
Sortable__default["default"].ghost.style.opacity = '1';
|
|
4721
|
+
}
|
|
4666
4722
|
}
|
|
4667
4723
|
}, fields.map(function (item, index) {
|
|
4668
4724
|
return /*#__PURE__*/React__default["default"].createElement(TafFormRow, {
|
|
@@ -4947,7 +5003,11 @@
|
|
|
4947
5003
|
};
|
|
4948
5004
|
var getPreviousTaf = function getPreviousTaf(tafList, currentTaf) {
|
|
4949
5005
|
var previousId = currentTaf.taf.previousId;
|
|
4950
|
-
|
|
5006
|
+
|
|
5007
|
+
if (!previousId) {
|
|
5008
|
+
return null;
|
|
5009
|
+
}
|
|
5010
|
+
|
|
4951
5011
|
var previousTaf = tafList.find(function (taf) {
|
|
4952
5012
|
return taf.taf.uuid === previousId;
|
|
4953
5013
|
});
|
|
@@ -5307,7 +5367,10 @@
|
|
|
5307
5367
|
};
|
|
5308
5368
|
|
|
5309
5369
|
var scrollToPosition = React__default["default"].useCallback(function () {
|
|
5310
|
-
if (!scrollRef.current)
|
|
5370
|
+
if (!scrollRef.current) {
|
|
5371
|
+
return;
|
|
5372
|
+
}
|
|
5373
|
+
|
|
5311
5374
|
var containerTop = scrollRef.current.getBoundingClientRect().top;
|
|
5312
5375
|
var firstLocation = scrollRef.current.querySelector("[data-location=\"" + activeLocation + "\"]");
|
|
5313
5376
|
var paddingTop = parseInt(getComputedStyle(scrollRef.current).paddingTop, 10);
|
|
@@ -5695,9 +5758,12 @@
|
|
|
5695
5758
|
case 2:
|
|
5696
5759
|
_a.sent();
|
|
5697
5760
|
|
|
5698
|
-
if (!isMounted.current)
|
|
5699
|
-
|
|
5700
|
-
|
|
5761
|
+
if (!isMounted.current) {
|
|
5762
|
+
return [2
|
|
5763
|
+
/*return*/
|
|
5764
|
+
];
|
|
5765
|
+
}
|
|
5766
|
+
|
|
5701
5767
|
setLoading(false);
|
|
5702
5768
|
setError(null);
|
|
5703
5769
|
return [3
|
|
@@ -5706,9 +5772,13 @@
|
|
|
5706
5772
|
|
|
5707
5773
|
case 3:
|
|
5708
5774
|
error_1 = _a.sent();
|
|
5709
|
-
|
|
5710
|
-
|
|
5711
|
-
|
|
5775
|
+
|
|
5776
|
+
if (!isMounted.current) {
|
|
5777
|
+
return [2
|
|
5778
|
+
/*return*/
|
|
5779
|
+
];
|
|
5780
|
+
}
|
|
5781
|
+
|
|
5712
5782
|
newErrorr = errorParser ? errorParser(error_1, params) : error_1;
|
|
5713
5783
|
setLoading(false);
|
|
5714
5784
|
setError(newErrorr);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/taf",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.19.0",
|
|
4
4
|
"description": "GeoWeb TAF library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -12,43 +12,44 @@
|
|
|
12
12
|
"typings": "./index.d.ts",
|
|
13
13
|
"dependencies": {},
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"@opengeoweb/api": "4.
|
|
15
|
+
"@opengeoweb/api": "4.19.0",
|
|
16
16
|
"react": "^18.2.0",
|
|
17
17
|
"axios": "^0.25.0",
|
|
18
|
-
"@opengeoweb/shared": "4.
|
|
19
|
-
"@mui/material": "^5.
|
|
20
|
-
"@opengeoweb/theme": "4.
|
|
18
|
+
"@opengeoweb/shared": "4.19.0",
|
|
19
|
+
"@mui/material": "^5.12.0",
|
|
20
|
+
"@opengeoweb/theme": "4.19.0",
|
|
21
|
+
"@mui/x-date-pickers": "^6.2.1",
|
|
21
22
|
"react-draggable": "^4.4.5",
|
|
22
23
|
"re-resizable": "^6.9.0",
|
|
23
24
|
"@redux-eggs/core": "^2.2.0",
|
|
24
25
|
"react-redux": "^8.0.4",
|
|
25
26
|
"lodash": "^4.17.20",
|
|
26
27
|
"date-fns": "^2.29.3",
|
|
27
|
-
"@opengeoweb/core": "4.
|
|
28
|
+
"@opengeoweb/core": "4.19.0",
|
|
28
29
|
"moment": "^2.29.0",
|
|
29
|
-
"@opengeoweb/webmap": "4.
|
|
30
|
+
"@opengeoweb/webmap": "4.19.0",
|
|
30
31
|
"throttle-debounce": "^3.0.1",
|
|
31
32
|
"proj4": "^2.6.2",
|
|
32
33
|
"react-intl": "^5.17.5",
|
|
33
34
|
"react-sortablejs": "^6.1.4",
|
|
34
35
|
"sortablejs": "^1.15.0",
|
|
35
36
|
"immer": "^9.0.15",
|
|
37
|
+
"@reduxjs/toolkit": "^1.8.3",
|
|
36
38
|
"react-window": "^1.8.7",
|
|
37
|
-
"@opengeoweb/form-fields": "4.
|
|
39
|
+
"@opengeoweb/form-fields": "4.19.0",
|
|
38
40
|
"react-hook-form": "^7.41.5",
|
|
39
41
|
"moment-timezone": "^0.5.31",
|
|
40
|
-
"
|
|
41
|
-
"@reduxjs/toolkit": "^1.8.3",
|
|
42
|
+
"react-resize-detector": "^9.1.0",
|
|
42
43
|
"lodash.clonedeep": "^4.5.0",
|
|
43
44
|
"@turf/turf": "^5.1.6",
|
|
44
45
|
"react-router-dom": "^6.4.2",
|
|
45
|
-
"@mui/system": "^5.
|
|
46
|
+
"@mui/system": "^5.12.0",
|
|
46
47
|
"redux-saga": "^1.2.1",
|
|
47
48
|
"@redux-eggs/redux-toolkit": "^2.2.0",
|
|
48
49
|
"@redux-eggs/saga-extension": "^2.2.0",
|
|
49
50
|
"react-dom": "^18.2.0",
|
|
50
|
-
"@opengeoweb/authentication": "4.
|
|
51
|
+
"@opengeoweb/authentication": "4.19.0",
|
|
51
52
|
"query-string": "^6.13.7",
|
|
52
|
-
"@emotion/react": "^11.10.
|
|
53
|
+
"@emotion/react": "^11.10.6"
|
|
53
54
|
}
|
|
54
55
|
}
|