@opengeoweb/taf 15.3.0 → 17.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.esm.js +881 -348
- package/package.json +8 -8
- package/src/index.d.ts +0 -7
- package/src/lib/NafDemo.stories.d.ts +0 -7
- package/src/lib/TafDemo.stories.d.ts +0 -8
- package/src/lib/components/AutoTaf/AutoTaf.d.ts +0 -9
- package/src/lib/components/AutoTaf/AutoTaf.spec.d.ts +0 -1
- package/src/lib/components/AutoTaf/AutoTaf.stories.d.ts +0 -8
- package/src/lib/components/AutoTaf/index.d.ts +0 -1
- package/src/lib/components/ComponentsLookUp/ComponentsLookUp.d.ts +0 -38
- package/src/lib/components/ComponentsLookUp/ComponentsLookUp.spec.d.ts +0 -1
- package/src/lib/components/ComponentsLookUp/index.d.ts +0 -1
- package/src/lib/components/IssuesPane/IssuesButton.d.ts +0 -10
- package/src/lib/components/IssuesPane/IssuesButton.spec.d.ts +0 -1
- package/src/lib/components/IssuesPane/IssuesPane.d.ts +0 -14
- package/src/lib/components/IssuesPane/IssuesPane.spec.d.ts +0 -1
- package/src/lib/components/IssuesPane/IssuesPane.stories.d.ts +0 -9
- package/src/lib/components/IssuesPane/IssuesPaneWrapper.d.ts +0 -4
- package/src/lib/components/IssuesPane/IssuesPaneWrapper.spec.d.ts +0 -1
- package/src/lib/components/IssuesPane/index.d.ts +0 -2
- package/src/lib/components/IssuesPane/types.d.ts +0 -16
- package/src/lib/components/IssuesPane/utils.d.ts +0 -8
- package/src/lib/components/IssuesPane/utils.spec.d.ts +0 -1
- package/src/lib/components/Providers/Providers.d.ts +0 -22
- package/src/lib/components/Providers/index.d.ts +0 -1
- package/src/lib/components/ResponsiveWrapper/ResponsiveWrapper.d.ts +0 -4
- package/src/lib/components/ResponsiveWrapper/ResponsiveWrapper.spec.d.ts +0 -1
- package/src/lib/components/Spinner/Spinner.d.ts +0 -4
- package/src/lib/components/Spinner/Spinner.spec.d.ts +0 -1
- package/src/lib/components/Spinner/Spinner.stories.d.ts +0 -10
- package/src/lib/components/StatusIcon/StatusIcon.d.ts +0 -8
- package/src/lib/components/StatusIcon/StatusIcon.spec.d.ts +0 -1
- package/src/lib/components/TabPanel/TabPanel.d.ts +0 -8
- package/src/lib/components/TabPanel/TabPanel.spec.d.ts +0 -1
- package/src/lib/components/TabPanel/index.d.ts +0 -1
- package/src/lib/components/TafAvatar/TafAvatar.d.ts +0 -8
- package/src/lib/components/TafAvatar/index.d.ts +0 -1
- package/src/lib/components/TafForm/TafForm.d.ts +0 -16
- package/src/lib/components/TafForm/TafForm.editor.spec.d.ts +0 -1
- package/src/lib/components/TafForm/TafForm.spec.d.ts +0 -1
- package/src/lib/components/TafForm/TafForm.statusChanges.spec.d.ts +0 -1
- package/src/lib/components/TafForm/TafForm.stories.d.ts +0 -27
- package/src/lib/components/TafForm/TafForm.validations.spec.d.ts +0 -1
- package/src/lib/components/TafForm/TafFormButtons/TafFormButtons.d.ts +0 -12
- package/src/lib/components/TafForm/TafFormButtons/TafFormButtons.spec.d.ts +0 -1
- package/src/lib/components/TafForm/TafFormButtons/TafFormOptionsButton.d.ts +0 -11
- package/src/lib/components/TafForm/TafFormButtons/TafFormOptionsButton.spec.d.ts +0 -1
- package/src/lib/components/TafForm/TafFormRow/DragHandle.d.ts +0 -8
- package/src/lib/components/TafForm/TafFormRow/DragHandle.spec.d.ts +0 -1
- package/src/lib/components/TafForm/TafFormRow/TafFormRow.d.ts +0 -4
- package/src/lib/components/TafForm/TafFormRow/TafFormRow.spec.d.ts +0 -1
- package/src/lib/components/TafForm/TafFormRow/TafFormTextField.d.ts +0 -30
- package/src/lib/components/TafForm/TafFormRow/TafFormTextField.spec.d.ts +0 -1
- package/src/lib/components/TafForm/TafFormRow/types.d.ts +0 -31
- package/src/lib/components/TafForm/TafFormRow/validations/change.d.ts +0 -4
- package/src/lib/components/TafForm/TafFormRow/validations/change.spec.d.ts +0 -1
- package/src/lib/components/TafForm/TafFormRow/validations/clouds.d.ts +0 -34
- package/src/lib/components/TafForm/TafFormRow/validations/clouds.spec.d.ts +0 -1
- package/src/lib/components/TafForm/TafFormRow/validations/probability.d.ts +0 -2
- package/src/lib/components/TafForm/TafFormRow/validations/probability.spec.d.ts +0 -1
- package/src/lib/components/TafForm/TafFormRow/validations/utils.d.ts +0 -2
- package/src/lib/components/TafForm/TafFormRow/validations/utils.spec.d.ts +0 -1
- package/src/lib/components/TafForm/TafFormRow/validations/validField.d.ts +0 -21
- package/src/lib/components/TafForm/TafFormRow/validations/validField.spec.d.ts +0 -1
- package/src/lib/components/TafForm/TafFormRow/validations/visibility.d.ts +0 -12
- package/src/lib/components/TafForm/TafFormRow/validations/visibility.spec.d.ts +0 -1
- package/src/lib/components/TafForm/TafFormRow/validations/weather.d.ts +0 -15
- package/src/lib/components/TafForm/TafFormRow/validations/weather.spec.d.ts +0 -1
- package/src/lib/components/TafForm/TafFormRow/validations/wind.d.ts +0 -16
- package/src/lib/components/TafForm/TafFormRow/validations/wind.spec.d.ts +0 -1
- package/src/lib/components/TafForm/index.d.ts +0 -1
- package/src/lib/components/TafForm/utils.d.ts +0 -73
- package/src/lib/components/TafForm/utils.spec.d.ts +0 -1
- package/src/lib/components/TafHeader/TafHeader.d.ts +0 -8
- package/src/lib/components/TafHeader/TafHeader.spec.d.ts +0 -1
- package/src/lib/components/TafLayout/LocationTabs/LocationTabs.d.ts +0 -10
- package/src/lib/components/TafLayout/LocationTabs/LocationTabs.spec.d.ts +0 -1
- package/src/lib/components/TafLayout/LocationTabs/LocationTabs.stories.d.ts +0 -8
- package/src/lib/components/TafLayout/LocationTabs/index.d.ts +0 -1
- package/src/lib/components/TafLayout/TacOverview/AdverseWeatherTacMessage.d.ts +0 -8
- package/src/lib/components/TafLayout/TacOverview/AdverseWeatherTacMessage.spec.d.ts +0 -1
- package/src/lib/components/TafLayout/TacOverview/AdverseWeatherTacMessage.stories.d.ts +0 -8
- package/src/lib/components/TafLayout/TacOverview/ExportButton.d.ts +0 -7
- package/src/lib/components/TafLayout/TacOverview/ExportButton.spec.d.ts +0 -1
- package/src/lib/components/TafLayout/TacOverview/TacContainer.d.ts +0 -13
- package/src/lib/components/TafLayout/TacOverview/TacContainer.spec.d.ts +0 -1
- package/src/lib/components/TafLayout/TacOverview/TacContainerLayout.d.ts +0 -10
- package/src/lib/components/TafLayout/TacOverview/TacOverview.d.ts +0 -12
- package/src/lib/components/TafLayout/TacOverview/TacOverview.spec.d.ts +0 -1
- package/src/lib/components/TafLayout/TacOverview/TacOverview.stories.d.ts +0 -10
- package/src/lib/components/TafLayout/TacOverview/TacOverviewMobile.d.ts +0 -12
- package/src/lib/components/TafLayout/TacOverview/TacOverviewMobile.spec.d.ts +0 -1
- package/src/lib/components/TafLayout/TacOverview/TacOverviewMobile.stories.d.ts +0 -9
- package/src/lib/components/TafLayout/TacOverview/index.d.ts +0 -2
- package/src/lib/components/TafLayout/TafLayout.d.ts +0 -10
- package/src/lib/components/TafLayout/TafLayout.issuespane.spec.d.ts +0 -1
- package/src/lib/components/TafLayout/TafLayout.snackbar.spec.d.ts +0 -1
- package/src/lib/components/TafLayout/TafLayout.spec.d.ts +0 -1
- package/src/lib/components/TafLayout/TafLayout.stories.d.ts +0 -13
- package/src/lib/components/TafLayout/TafLayout.tacoverview.spec.d.ts +0 -1
- package/src/lib/components/TafLayout/TafPanel/TafPanel.d.ts +0 -23
- package/src/lib/components/TafLayout/TafPanel/TafPanel.spec.d.ts +0 -1
- package/src/lib/components/TafLayout/TafPanel/TafPanel.stories.d.ts +0 -11
- package/src/lib/components/TafLayout/TafPanel/index.d.ts +0 -1
- package/src/lib/components/TafLayout/TopTabs/TopTabs.d.ts +0 -9
- package/src/lib/components/TafLayout/TopTabs/TopTabs.spec.d.ts +0 -1
- package/src/lib/components/TafLayout/TopTabs/TopTabs.stories.d.ts +0 -8
- package/src/lib/components/TafLayout/TopTabs/index.d.ts +0 -1
- package/src/lib/components/TafLayout/utils.d.ts +0 -47
- package/src/lib/components/TafLayout/utils.spec.d.ts +0 -1
- package/src/lib/components/TafModule/TafModule.d.ts +0 -9
- package/src/lib/components/TafModule/TafModule.spec.d.ts +0 -1
- package/src/lib/components/TafModule/TafModule.stories.d.ts +0 -62
- package/src/lib/components/TafModule/TafModuleProvider.d.ts +0 -23
- package/src/lib/components/TafModule/index.d.ts +0 -1
- package/src/lib/components/TafRemarkField/TafRemarkField.d.ts +0 -7
- package/src/lib/components/TafRemarkField/TafRemarkField.spec.d.ts +0 -1
- package/src/lib/components/TafRemarkField/index.d.ts +0 -1
- package/src/lib/components/TafWrapper/TafConfigWrapper.d.ts +0 -13
- package/src/lib/components/TafWrapper/TafWrapper.d.ts +0 -3
- package/src/lib/components/TafWrapper/TafWrapper.spec.d.ts +0 -1
- package/src/lib/components/TafWrapper/index.d.ts +0 -1
- package/src/lib/types.d.ts +0 -173
- package/src/lib/utils/dateFormats.d.ts +0 -2
- package/src/lib/utils/i18n.d.ts +0 -6
- package/src/lib/utils/mockdata/fakeTafConfig.d.ts +0 -2
- package/src/lib/utils/mockdata/fakeTafList.d.ts +0 -26
- package/src/lib/utils/mockdata/naf/fakeNafConfig.d.ts +0 -2
- package/src/lib/utils/mockdata/naf/fakeNafList.d.ts +0 -12
- package/src/lib/utils/taf-api/api.d.ts +0 -7
- package/src/lib/utils/taf-api/fakeApi.d.ts +0 -4
- package/src/lib/utils/taf-api/hooks.d.ts +0 -25
- package/src/lib/utils/utils.d.ts +0 -1
- package/src/lib/utils/weatherPhenomena.d.ts +0 -422
package/index.esm.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
1
|
import { Chip, Box, Typography, Grid, Button, TextField, LinearProgress, MenuList, MenuItem, Card, Tabs, Tab, Backdrop, CircularProgress } from '@mui/material';
|
|
3
2
|
import React, { useState, useEffect } from 'react';
|
|
4
3
|
import { useFormContext, useFieldArray, Controller } from 'react-hook-form';
|
|
@@ -11,6 +10,7 @@ import { SHARED_NAMESPACE, CustomTooltip, ToolContainerDraggable, Avatar, getIni
|
|
|
11
10
|
import { snackbarActions, snackbarTypes } from '@opengeoweb/snackbar';
|
|
12
11
|
import 'i18next';
|
|
13
12
|
import { useTranslation } from 'react-i18next';
|
|
13
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
14
14
|
import ReactDOM from 'react-dom';
|
|
15
15
|
import { ThumbsUp, DragHandle as DragHandle$1, Add, Delete, Close, Clock, Cancel, Success, Edit, Export, ListItem } from '@opengeoweb/theme';
|
|
16
16
|
import { isEqual } from 'lodash';
|
|
@@ -679,6 +679,7 @@ function _regeneratorRuntime() {
|
|
|
679
679
|
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
680
680
|
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
681
681
|
* */
|
|
682
|
+
|
|
682
683
|
var getCustomError = function getCustomError(error, isChangeGroup, rowIndex) {
|
|
683
684
|
return Object.assign({}, error, {
|
|
684
685
|
isChangeGroup: isChangeGroup,
|
|
@@ -766,12 +767,30 @@ var getErrors = function getErrors(errors) {
|
|
|
766
767
|
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
767
768
|
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
768
769
|
* */
|
|
770
|
+
|
|
769
771
|
var TAF_NAMESPACE = 'taf';
|
|
770
772
|
var ns = [TAF_NAMESPACE, SHARED_NAMESPACE];
|
|
771
773
|
var useTafTranslation = function useTafTranslation() {
|
|
772
774
|
return useTranslation(ns);
|
|
773
775
|
};
|
|
774
776
|
|
|
777
|
+
/* *
|
|
778
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
779
|
+
* you may not use this file except in compliance with the License.
|
|
780
|
+
* You may obtain a copy of the License at
|
|
781
|
+
*
|
|
782
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
783
|
+
*
|
|
784
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
785
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
786
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
787
|
+
* See the License for the specific language governing permissions and
|
|
788
|
+
* limitations under the License.
|
|
789
|
+
*
|
|
790
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
791
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
792
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
793
|
+
* */
|
|
775
794
|
var IssuesButton = function IssuesButton(_ref) {
|
|
776
795
|
var _ref$errors = _ref.errors,
|
|
777
796
|
errors = _ref$errors === void 0 ? {} : _ref$errors,
|
|
@@ -806,9 +825,9 @@ var IssuesButton = function IssuesButton(_ref) {
|
|
|
806
825
|
};
|
|
807
826
|
toggleIssuesPane(newPosition);
|
|
808
827
|
};
|
|
809
|
-
return jsx(CustomTooltip, {
|
|
828
|
+
return /*#__PURE__*/jsx(CustomTooltip, {
|
|
810
829
|
title: t('issues-button-title'),
|
|
811
|
-
children: jsx(Chip, {
|
|
830
|
+
children: /*#__PURE__*/jsx(Chip, {
|
|
812
831
|
className: "status-" + errorStatus,
|
|
813
832
|
"data-testid": "issuesButton",
|
|
814
833
|
label: getIssuesLabel(totalErrors, t),
|
|
@@ -830,6 +849,23 @@ var IssuesButton = function IssuesButton(_ref) {
|
|
|
830
849
|
});
|
|
831
850
|
};
|
|
832
851
|
|
|
852
|
+
/* *
|
|
853
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
854
|
+
* you may not use this file except in compliance with the License.
|
|
855
|
+
* You may obtain a copy of the License at
|
|
856
|
+
*
|
|
857
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
858
|
+
*
|
|
859
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
860
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
861
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
862
|
+
* See the License for the specific language governing permissions and
|
|
863
|
+
* limitations under the License.
|
|
864
|
+
*
|
|
865
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
866
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
867
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
868
|
+
* */
|
|
833
869
|
var getPaneTitle = function getPaneTitle(sumOfErrors, t) {
|
|
834
870
|
switch (sumOfErrors) {
|
|
835
871
|
case 0:
|
|
@@ -899,7 +935,7 @@ var IssuesPane = function IssuesPane(_ref) {
|
|
|
899
935
|
var _useTafTranslation = useTafTranslation(),
|
|
900
936
|
t = _useTafTranslation.t;
|
|
901
937
|
var rootElement = document.getElementById(MODAL_DIALOG_ELEMENT) || document.body;
|
|
902
|
-
return /*#__PURE__*/ReactDOM.createPortal(jsx(ToolContainerDraggable, {
|
|
938
|
+
return /*#__PURE__*/ReactDOM.createPortal(/*#__PURE__*/jsx(ToolContainerDraggable, {
|
|
903
939
|
bounds: "parent",
|
|
904
940
|
cancel: "",
|
|
905
941
|
"data-testid": "moveable-issues-pane",
|
|
@@ -917,27 +953,30 @@ var IssuesPane = function IssuesPane(_ref) {
|
|
|
917
953
|
height: '200px'
|
|
918
954
|
},
|
|
919
955
|
title: getPaneTitle(errorList.length, t),
|
|
920
|
-
children: jsxs(Box, {
|
|
956
|
+
children: /*#__PURE__*/jsxs(Box, {
|
|
921
957
|
component: "div",
|
|
922
958
|
sx: {
|
|
923
959
|
marginTop: '16px',
|
|
924
960
|
marginLeft: '24px'
|
|
925
961
|
},
|
|
926
|
-
children: [errorList.length === 0 && jsx(Box, {
|
|
962
|
+
children: [errorList.length === 0 && /*#__PURE__*/jsx(Box, {
|
|
927
963
|
component: "div",
|
|
928
964
|
"data-testid": "zeroIssuesImage",
|
|
929
965
|
sx: {
|
|
930
966
|
fontSize: '4rem'
|
|
931
967
|
},
|
|
932
|
-
children: jsx(ThumbsUp, {
|
|
968
|
+
children: /*#__PURE__*/jsx(ThumbsUp, {
|
|
933
969
|
sx: {
|
|
934
970
|
height: '69px',
|
|
935
971
|
width: '58px'
|
|
936
972
|
}
|
|
937
973
|
})
|
|
938
974
|
}), errorList.length > 0 && errorList.map(function (error, index) {
|
|
939
|
-
return jsx(Typography, {
|
|
940
|
-
"data-testid": "errorMessage"
|
|
975
|
+
return /*#__PURE__*/jsx(Typography, {
|
|
976
|
+
"data-testid": "errorMessage"
|
|
977
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
978
|
+
,
|
|
979
|
+
|
|
941
980
|
variant: "body1",
|
|
942
981
|
children: getErrorMessage(error, index)
|
|
943
982
|
}, "message-" + index);
|
|
@@ -946,15 +985,33 @@ var IssuesPane = function IssuesPane(_ref) {
|
|
|
946
985
|
}), rootElement);
|
|
947
986
|
};
|
|
948
987
|
|
|
988
|
+
/* *
|
|
989
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
990
|
+
* you may not use this file except in compliance with the License.
|
|
991
|
+
* You may obtain a copy of the License at
|
|
992
|
+
*
|
|
993
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
994
|
+
*
|
|
995
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
996
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
997
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
998
|
+
* See the License for the specific language governing permissions and
|
|
999
|
+
* limitations under the License.
|
|
1000
|
+
*
|
|
1001
|
+
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
1002
|
+
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
1003
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
1004
|
+
* */
|
|
1005
|
+
|
|
949
1006
|
var TafAvatar = function TafAvatar(_ref) {
|
|
950
1007
|
var editor = _ref.editor,
|
|
951
1008
|
_ref$tooltipPlacement = _ref.tooltipPlacement,
|
|
952
1009
|
tooltipPlacement = _ref$tooltipPlacement === void 0 ? 'bottom' : _ref$tooltipPlacement;
|
|
953
|
-
return jsx(CustomTooltip, {
|
|
1010
|
+
return /*#__PURE__*/jsx(CustomTooltip, {
|
|
954
1011
|
placement: tooltipPlacement,
|
|
955
1012
|
title: "Editor: " + editor,
|
|
956
|
-
children: jsx("span", {
|
|
957
|
-
children: jsx(Avatar, {
|
|
1013
|
+
children: /*#__PURE__*/jsx("span", {
|
|
1014
|
+
children: /*#__PURE__*/jsx(Avatar, {
|
|
958
1015
|
size: "small",
|
|
959
1016
|
children: getInitials(editor)
|
|
960
1017
|
})
|
|
@@ -962,6 +1019,23 @@ var TafAvatar = function TafAvatar(_ref) {
|
|
|
962
1019
|
});
|
|
963
1020
|
};
|
|
964
1021
|
|
|
1022
|
+
/* *
|
|
1023
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1024
|
+
* you may not use this file except in compliance with the License.
|
|
1025
|
+
* You may obtain a copy of the License at
|
|
1026
|
+
*
|
|
1027
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1028
|
+
*
|
|
1029
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1030
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1031
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1032
|
+
* See the License for the specific language governing permissions and
|
|
1033
|
+
* limitations under the License.
|
|
1034
|
+
*
|
|
1035
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
1036
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
1037
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
1038
|
+
* */
|
|
965
1039
|
var tafActionToDraftAction = function tafActionToDraftAction(tafAction) {
|
|
966
1040
|
switch (tafAction) {
|
|
967
1041
|
case 'AMEND':
|
|
@@ -1005,22 +1079,22 @@ var ViewModeButtons = function ViewModeButtons(_ref) {
|
|
|
1005
1079
|
onTafViewModeButtonPress = _ref.onTafViewModeButtonPress;
|
|
1006
1080
|
var _useTafTranslation = useTafTranslation(),
|
|
1007
1081
|
t = _useTafTranslation.t;
|
|
1008
|
-
return !canBe.includes('CANCELLED') && !canBe.includes('CORRECTED') && !canBe.includes('AMENDED') ? null : jsxs(Fragment, {
|
|
1009
|
-
children: [canBe.includes('CANCELLED') && jsx(Button, {
|
|
1082
|
+
return !canBe.includes('CANCELLED') && !canBe.includes('CORRECTED') && !canBe.includes('AMENDED') ? null : /*#__PURE__*/jsxs(Fragment, {
|
|
1083
|
+
children: [canBe.includes('CANCELLED') && /*#__PURE__*/jsx(Button, {
|
|
1010
1084
|
"data-testid": "canceltaf",
|
|
1011
1085
|
onClick: function onClick() {
|
|
1012
1086
|
return onTafViewModeButtonPress('CANCEL');
|
|
1013
1087
|
},
|
|
1014
1088
|
variant: "tertiary",
|
|
1015
1089
|
children: t('button-cancel')
|
|
1016
|
-
}), canBe.includes('CORRECTED') && jsx(Button, {
|
|
1090
|
+
}), canBe.includes('CORRECTED') && /*#__PURE__*/jsx(Button, {
|
|
1017
1091
|
"data-testid": "correcttaf",
|
|
1018
1092
|
onClick: function onClick() {
|
|
1019
1093
|
return onTafViewModeButtonPress('CORRECT');
|
|
1020
1094
|
},
|
|
1021
1095
|
variant: "tertiary",
|
|
1022
1096
|
children: t('button-correct')
|
|
1023
|
-
}), canBe.includes('AMENDED') && jsx(Button, {
|
|
1097
|
+
}), canBe.includes('AMENDED') && /*#__PURE__*/jsx(Button, {
|
|
1024
1098
|
"data-testid": "amendtaf",
|
|
1025
1099
|
onClick: function onClick() {
|
|
1026
1100
|
return onTafViewModeButtonPress('AMEND');
|
|
@@ -1040,13 +1114,13 @@ var TafFormButtons = function TafFormButtons(_ref2) {
|
|
|
1040
1114
|
onTafViewModeButtonPress = _ref2.onTafViewModeButtonPress;
|
|
1041
1115
|
var _useTafTranslation2 = useTafTranslation(),
|
|
1042
1116
|
t = _useTafTranslation2.t;
|
|
1043
|
-
return jsxs(Grid, {
|
|
1117
|
+
return /*#__PURE__*/jsxs(Grid, {
|
|
1044
1118
|
columns: 24,
|
|
1045
1119
|
container: true,
|
|
1046
1120
|
sx: [{
|
|
1047
1121
|
justifyContent: 'flex-end'
|
|
1048
1122
|
}].concat(Array.isArray(buttonsStyle) ? buttonsStyle : [buttonsStyle]),
|
|
1049
|
-
children: [jsx(Grid, {
|
|
1123
|
+
children: [/*#__PURE__*/jsx(Grid, {
|
|
1050
1124
|
columns: 24,
|
|
1051
1125
|
container: true,
|
|
1052
1126
|
size: {
|
|
@@ -1056,11 +1130,11 @@ var TafFormButtons = function TafFormButtons(_ref2) {
|
|
|
1056
1130
|
sx: {
|
|
1057
1131
|
justifyContent: 'flex-end'
|
|
1058
1132
|
},
|
|
1059
|
-
children: isFormDisabled ? jsx(ViewModeButtons, {
|
|
1133
|
+
children: isFormDisabled ? /*#__PURE__*/jsx(ViewModeButtons, {
|
|
1060
1134
|
canBe: canBe,
|
|
1061
1135
|
onTafViewModeButtonPress: onTafViewModeButtonPress
|
|
1062
|
-
}) : jsxs(Fragment, {
|
|
1063
|
-
children: [jsx(Button, {
|
|
1136
|
+
}) : /*#__PURE__*/jsxs(Fragment, {
|
|
1137
|
+
children: [/*#__PURE__*/jsx(Button, {
|
|
1064
1138
|
"data-testid": "cleartaf",
|
|
1065
1139
|
onClick: function onClick() {
|
|
1066
1140
|
// Simply discard the changes and close the dialog.
|
|
@@ -1068,37 +1142,39 @@ var TafFormButtons = function TafFormButtons(_ref2) {
|
|
|
1068
1142
|
},
|
|
1069
1143
|
variant: "tertiary",
|
|
1070
1144
|
children: t('button-clear')
|
|
1071
|
-
}), jsx(Button, {
|
|
1145
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
1072
1146
|
"data-testid": "savedrafttaf",
|
|
1073
1147
|
onClick: function onClick() {
|
|
1074
|
-
/* Save the TAF as draft:
|
|
1148
|
+
/* Save the TAF as draft:
|
|
1075
1149
|
if action NEW or DRAFT - new status will be DRAFT -- default
|
|
1076
|
-
if action AMEND - new status will be DRAFT_AMENDED
|
|
1150
|
+
if action AMEND - new status will be DRAFT_AMENDED
|
|
1077
1151
|
if action CORRECT - new status will be DRAFT_CORRECTED
|
|
1078
1152
|
if action DRAFT_AMEND - new status will be DRAFT_AMENDED
|
|
1079
1153
|
if action DRAFT_CORRECT - new status will be DRAFT_CORRECTED
|
|
1080
1154
|
*/
|
|
1155
|
+
|
|
1081
1156
|
onTafEditModeButtonPress(tafActionToDraftAction(tafAction));
|
|
1082
1157
|
},
|
|
1083
1158
|
variant: "tertiary",
|
|
1084
1159
|
children: t('button-save')
|
|
1085
|
-
}), jsx(Button, {
|
|
1160
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
1086
1161
|
"data-testid": "publishtaf",
|
|
1087
1162
|
onClick: function onClick() {
|
|
1088
|
-
/* Publish the TAF:
|
|
1163
|
+
/* Publish the TAF:
|
|
1089
1164
|
if action NEW or DRAFT - new status will be PUBLISHED -- default
|
|
1090
|
-
if action AMEND - new status will be AMENDED
|
|
1165
|
+
if action AMEND - new status will be AMENDED
|
|
1091
1166
|
if action CORRECT - new status will be CORRECTED
|
|
1092
1167
|
if action DRAFT_AMEND - new status will be AMENDED
|
|
1093
1168
|
if action DRAFT_CORRECT - new status will be CORRECTED
|
|
1094
1169
|
*/
|
|
1170
|
+
|
|
1095
1171
|
onTafEditModeButtonPress(tafActionToPublishAction(tafAction));
|
|
1096
1172
|
},
|
|
1097
1173
|
variant: "tertiary",
|
|
1098
1174
|
children: t('button-publish')
|
|
1099
1175
|
})]
|
|
1100
1176
|
})
|
|
1101
|
-
}), jsx(Grid, {
|
|
1177
|
+
}), /*#__PURE__*/jsx(Grid, {
|
|
1102
1178
|
columns: 24,
|
|
1103
1179
|
size: {
|
|
1104
1180
|
sm: 1
|
|
@@ -1107,13 +1183,30 @@ var TafFormButtons = function TafFormButtons(_ref2) {
|
|
|
1107
1183
|
});
|
|
1108
1184
|
};
|
|
1109
1185
|
|
|
1186
|
+
/* *
|
|
1187
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1188
|
+
* you may not use this file except in compliance with the License.
|
|
1189
|
+
* You may obtain a copy of the License at
|
|
1190
|
+
*
|
|
1191
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1192
|
+
*
|
|
1193
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1194
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1195
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1196
|
+
* See the License for the specific language governing permissions and
|
|
1197
|
+
* limitations under the License.
|
|
1198
|
+
*
|
|
1199
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
1200
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
1201
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
1202
|
+
* */
|
|
1110
1203
|
var DragHandle = function DragHandle(_ref) {
|
|
1111
1204
|
var _ref$isSorting = _ref.isSorting,
|
|
1112
1205
|
isSorting = _ref$isSorting === void 0 ? false : _ref$isSorting,
|
|
1113
1206
|
_ref$isDisabled = _ref.isDisabled,
|
|
1114
1207
|
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
|
|
1115
1208
|
index = _ref.index;
|
|
1116
|
-
return jsx(CustomIconButton, {
|
|
1209
|
+
return /*#__PURE__*/jsx(CustomIconButton, {
|
|
1117
1210
|
className: "handle",
|
|
1118
1211
|
"data-testid": "dragHandle-" + index,
|
|
1119
1212
|
disableRipple: true,
|
|
@@ -1129,7 +1222,7 @@ var DragHandle = function DragHandle(_ref) {
|
|
|
1129
1222
|
}
|
|
1130
1223
|
}
|
|
1131
1224
|
},
|
|
1132
|
-
children: jsx(DragHandle$1, {})
|
|
1225
|
+
children: /*#__PURE__*/jsx(DragHandle$1, {})
|
|
1133
1226
|
});
|
|
1134
1227
|
};
|
|
1135
1228
|
|
|
@@ -1192,6 +1285,7 @@ var formatCloudsToString = function formatCloudsToString(clouds) {
|
|
|
1192
1285
|
// Format Cloud
|
|
1193
1286
|
return Object.assign({}, list, (_Object$assign2 = {}, _Object$assign2[key] = formatSingleCloud(clouds[key]), _Object$assign2));
|
|
1194
1287
|
}
|
|
1288
|
+
|
|
1195
1289
|
// Format No Significant Clouds
|
|
1196
1290
|
return Object.assign({}, list, (_Object$assign3 = {}, _Object$assign3[key] = clouds[key], _Object$assign3));
|
|
1197
1291
|
}
|
|
@@ -1206,6 +1300,7 @@ var formatCloudsToString = function formatCloudsToString(clouds) {
|
|
|
1206
1300
|
return list;
|
|
1207
1301
|
}, clouds);
|
|
1208
1302
|
};
|
|
1303
|
+
|
|
1209
1304
|
// parsers
|
|
1210
1305
|
var parseSingleCloud = function parseSingleCloud(value) {
|
|
1211
1306
|
if (!value) {
|
|
@@ -1261,6 +1356,7 @@ var parseCloudsToObject = function parseCloudsToObject(clouds) {
|
|
|
1261
1356
|
return rest;
|
|
1262
1357
|
}, clouds);
|
|
1263
1358
|
};
|
|
1359
|
+
|
|
1264
1360
|
// messages
|
|
1265
1361
|
var invalidCloud1Message = 'Invalid cloud input, expected either <coverage><height><type(optional)> with coverage FEW, SCT, BKN or OVC and height consisting of 3 digits or NSC';
|
|
1266
1362
|
var invalidCloudMessage = 'Invalid cloud input, expected <coverage><height><type(optional)> with coverage FEW, SCT, BKN or OVC and height consisting of 3 digits';
|
|
@@ -1282,6 +1378,7 @@ var invalidCloudWithNSCMessage = 'Invalid cloud input, other cloud groups are no
|
|
|
1282
1378
|
var invalidCloudWithPreviousType = 'Invalid cloud input, only one significant convective cloud group with CB/TCU is allowed';
|
|
1283
1379
|
var invalidCloudCAVOKMessage = 'Invalid cloud input, when CAVOK is used, cloud groups must be empty';
|
|
1284
1380
|
var invalidCloud4TypeMissingMessage = 'Invalid cloud input for fourth group, CB or TCU required if no other significant convective cloud group present';
|
|
1381
|
+
|
|
1285
1382
|
// validations
|
|
1286
1383
|
var isLengthValid = function isLengthValid(value) {
|
|
1287
1384
|
var onlyDigitsOrSpecificLetters = /^[0-9FEWSCTBKNOVU]+$/;
|
|
@@ -1295,10 +1392,12 @@ var isHeightValid = function isHeightValid(height) {
|
|
|
1295
1392
|
if (!/^[0-9]+$/.exec(height)) {
|
|
1296
1393
|
return invalidCloudHeightMessage;
|
|
1297
1394
|
}
|
|
1395
|
+
|
|
1298
1396
|
// check if its 3 digits
|
|
1299
1397
|
if (height.length !== 3) {
|
|
1300
1398
|
return invalidCloudHeightMessage;
|
|
1301
1399
|
}
|
|
1400
|
+
|
|
1302
1401
|
// Parse to integer to check for steps
|
|
1303
1402
|
var intHeight = parseInt(height, 10);
|
|
1304
1403
|
if (intHeight > 49) {
|
|
@@ -1325,6 +1424,7 @@ var isVerticalVisibilityValid = function isVerticalVisibilityValid(value, weathe
|
|
|
1325
1424
|
if (!/^[0-9]+$/.exec(value)) {
|
|
1326
1425
|
return invalidVerticalVisibilityMessage;
|
|
1327
1426
|
}
|
|
1427
|
+
|
|
1328
1428
|
// check if its 3 digits
|
|
1329
1429
|
if (value.length !== 3) {
|
|
1330
1430
|
return invalidVerticalVisibilityMessage;
|
|
@@ -1352,11 +1452,13 @@ var sharedCloudValidations = function sharedCloudValidations(_ref) {
|
|
|
1352
1452
|
if (!isLengthValid(value)) {
|
|
1353
1453
|
errorMessages.push(canBeNSC ? invalidCloud1Message : invalidCloudMessage);
|
|
1354
1454
|
}
|
|
1455
|
+
|
|
1355
1456
|
// Validate coverage
|
|
1356
1457
|
var coverage = value.substring(0, 3);
|
|
1357
1458
|
if (!isCoverageValid(coverage)) {
|
|
1358
1459
|
errorMessages.push(invalidCloudCoverageMessage);
|
|
1359
1460
|
}
|
|
1461
|
+
|
|
1360
1462
|
// Validate height
|
|
1361
1463
|
var height = value.substring(3, 6);
|
|
1362
1464
|
var isValidHeight = isHeightValid(height);
|
|
@@ -1364,11 +1466,13 @@ var sharedCloudValidations = function sharedCloudValidations(_ref) {
|
|
|
1364
1466
|
// Return height errors if any
|
|
1365
1467
|
errorMessages.push(isValidHeight);
|
|
1366
1468
|
}
|
|
1469
|
+
|
|
1367
1470
|
// Validate type
|
|
1368
1471
|
var type = value.substring(6, 9);
|
|
1369
1472
|
if (!isTypeValid(type)) {
|
|
1370
1473
|
errorMessages.push(invalidCLoudTypeMessage);
|
|
1371
1474
|
}
|
|
1475
|
+
|
|
1372
1476
|
// Validate combination of height and type
|
|
1373
1477
|
if (!isHeightAllowedWithType(height, type)) {
|
|
1374
1478
|
errorMessages.push(invalidHeightTypeCombinationMessage);
|
|
@@ -1386,6 +1490,7 @@ var validateFirstCloud = function validateFirstCloud(value, visibilityValue, wea
|
|
|
1386
1490
|
var trimmedWeather1Value = getFieldValue(weatherfield1);
|
|
1387
1491
|
var trimmedWeather2Value = getFieldValue(weatherfield2);
|
|
1388
1492
|
var trimmedWeather3Value = getFieldValue(weatherfield3);
|
|
1493
|
+
|
|
1389
1494
|
// Field can be left empty
|
|
1390
1495
|
if (!trimmedValueFirstCloud.length) {
|
|
1391
1496
|
return true;
|
|
@@ -1393,10 +1498,12 @@ var validateFirstCloud = function validateFirstCloud(value, visibilityValue, wea
|
|
|
1393
1498
|
if (trimmedValueFirstCloud && trimmedValueVisibility === 'CAVOK') {
|
|
1394
1499
|
return invalidCloudCAVOKMessage;
|
|
1395
1500
|
}
|
|
1501
|
+
|
|
1396
1502
|
// Check for No Signicant Clouds
|
|
1397
1503
|
if (trimmedValueFirstCloud === 'NSC') {
|
|
1398
1504
|
return true;
|
|
1399
1505
|
}
|
|
1506
|
+
|
|
1400
1507
|
// Validate Vertical Visibility
|
|
1401
1508
|
if (isVerticalVisibility(trimmedValueFirstCloud)) {
|
|
1402
1509
|
if (
|
|
@@ -1414,6 +1521,7 @@ var validateFirstCloud = function validateFirstCloud(value, visibilityValue, wea
|
|
|
1414
1521
|
canBeNSC: true
|
|
1415
1522
|
}),
|
|
1416
1523
|
errorMessages = _sharedCloudValidatio.errorMessages;
|
|
1524
|
+
|
|
1417
1525
|
// Return first error if any
|
|
1418
1526
|
return errorMessages.length ? errorMessages[0] : true;
|
|
1419
1527
|
};
|
|
@@ -1421,18 +1529,22 @@ var validateSecondCloud = function validateSecondCloud(firstCloudValue, secondCl
|
|
|
1421
1529
|
var trimmedValueFirstCloud = getFieldValue(firstCloudValue);
|
|
1422
1530
|
var trimmedValueSecondCloud = getFieldValue(secondCloudValue);
|
|
1423
1531
|
var visibilityValue = getFieldValue(visibilityFieldValue);
|
|
1532
|
+
|
|
1424
1533
|
// Field can be left empty
|
|
1425
1534
|
if (!trimmedValueSecondCloud.length) {
|
|
1426
1535
|
return true;
|
|
1427
1536
|
}
|
|
1537
|
+
|
|
1428
1538
|
// If Cloud1 is NSC, Cloud2 has to be empty
|
|
1429
1539
|
if (trimmedValueFirstCloud === 'NSC' && trimmedValueSecondCloud !== '') {
|
|
1430
1540
|
return invalidCloudWithNSCMessage;
|
|
1431
1541
|
}
|
|
1542
|
+
|
|
1432
1543
|
// If Cloud1 is empty Cloud2 should be empty
|
|
1433
1544
|
if (trimmedValueFirstCloud === '') {
|
|
1434
1545
|
return invalidCloudWithPreviousEmptyCloud;
|
|
1435
1546
|
}
|
|
1547
|
+
|
|
1436
1548
|
// Generic validations
|
|
1437
1549
|
var _sharedCloudValidatio2 = sharedCloudValidations({
|
|
1438
1550
|
value: trimmedValueSecondCloud
|
|
@@ -1445,6 +1557,7 @@ var validateSecondCloud = function validateSecondCloud(firstCloudValue, secondCl
|
|
|
1445
1557
|
if (errorMessages.length) {
|
|
1446
1558
|
return errorMessages[0];
|
|
1447
1559
|
}
|
|
1560
|
+
|
|
1448
1561
|
// Cloud2 specific validations - only to be applied when cloud1 does not contain type CB/TCU
|
|
1449
1562
|
var typeCloud1 = trimmedValueFirstCloud.substring(6, 9);
|
|
1450
1563
|
if (typeCloud1 !== 'CB' && typeCloud1 !== 'TCU') {
|
|
@@ -1458,10 +1571,12 @@ var validateSecondCloud = function validateSecondCloud(firstCloudValue, secondCl
|
|
|
1458
1571
|
if (validateFirstCloud(trimmedValueFirstCloud, visibilityValue, '', '', '') !== true) {
|
|
1459
1572
|
return true;
|
|
1460
1573
|
}
|
|
1574
|
+
|
|
1461
1575
|
// If Cloud1 contains a type, Cloud2 cannot contain a type
|
|
1462
1576
|
if (type !== '' && typeCloud1 !== '') {
|
|
1463
1577
|
return invalidCloudWithPreviousType;
|
|
1464
1578
|
}
|
|
1579
|
+
|
|
1465
1580
|
// Cloud2 height has to be greater than Cloud1 height
|
|
1466
1581
|
if (!isVerticalVisibility(trimmedValueFirstCloud)) {
|
|
1467
1582
|
var cloud1Height = trimmedValueFirstCloud.substring(3, 6);
|
|
@@ -1469,6 +1584,7 @@ var validateSecondCloud = function validateSecondCloud(firstCloudValue, secondCl
|
|
|
1469
1584
|
return invalidCloudHeightComparedToPreviousMessage;
|
|
1470
1585
|
}
|
|
1471
1586
|
}
|
|
1587
|
+
|
|
1472
1588
|
// If Cloud1 contains Vertical Visibility then Cloud2 type is required
|
|
1473
1589
|
if (isVerticalVisibility(trimmedValueFirstCloud) && type === '') {
|
|
1474
1590
|
return invalidCloud2WithVerticalVisibilityMessage;
|
|
@@ -1480,18 +1596,22 @@ var validateThirdCloud = function validateThirdCloud(firstCloudValue, secondClou
|
|
|
1480
1596
|
var trimmedValueSecondCloud = getFieldValue(secondCloudValue);
|
|
1481
1597
|
var trimmedValueThirdCloud = getFieldValue(thirdCloudValue);
|
|
1482
1598
|
var visibilityValue = getFieldValue(visibilityFieldValue);
|
|
1599
|
+
|
|
1483
1600
|
// Field can be left empty
|
|
1484
1601
|
if (!trimmedValueThirdCloud.length) {
|
|
1485
1602
|
return true;
|
|
1486
1603
|
}
|
|
1604
|
+
|
|
1487
1605
|
// If Cloud1 is NSC, Cloud3 has to be empty
|
|
1488
1606
|
if (trimmedValueFirstCloud === 'NSC' && trimmedValueThirdCloud !== '') {
|
|
1489
1607
|
return invalidCloudWithNSCMessage;
|
|
1490
1608
|
}
|
|
1609
|
+
|
|
1491
1610
|
// If Cloud1 or Cloud2 is empty Cloud3 should be empty
|
|
1492
1611
|
if (trimmedValueFirstCloud === '' || trimmedValueSecondCloud === '') {
|
|
1493
1612
|
return invalidCloudWithPreviousEmptyCloud;
|
|
1494
1613
|
}
|
|
1614
|
+
|
|
1495
1615
|
// Generic validations
|
|
1496
1616
|
var _sharedCloudValidatio3 = sharedCloudValidations({
|
|
1497
1617
|
value: trimmedValueThirdCloud
|
|
@@ -1504,6 +1624,7 @@ var validateThirdCloud = function validateThirdCloud(firstCloudValue, secondClou
|
|
|
1504
1624
|
if (errorMessages.length) {
|
|
1505
1625
|
return errorMessages[0];
|
|
1506
1626
|
}
|
|
1627
|
+
|
|
1507
1628
|
// Cloud3 specific validations
|
|
1508
1629
|
// Without a type specified in cloud group 1 or 2, this group counts as #3 and coverage can not be FEW or SCT
|
|
1509
1630
|
var typeCloud1 = trimmedValueFirstCloud.substring(6, 9);
|
|
@@ -1516,24 +1637,29 @@ var validateThirdCloud = function validateThirdCloud(firstCloudValue, secondClou
|
|
|
1516
1637
|
// In case we do have a CB/TCU group in one of the previous clouf groups. This cloudgroup should be evaluated as if it was the second group
|
|
1517
1638
|
return invalidCloud2CoverageTypeCombinationMessage;
|
|
1518
1639
|
}
|
|
1640
|
+
|
|
1519
1641
|
// If Cloud1 is not valid, skip further validation of Cloud3
|
|
1520
1642
|
// No need to pass the weatherfields as their content does not influence what happens below
|
|
1521
1643
|
// Since in case of VV the third field should be empty anyways
|
|
1522
1644
|
if (validateFirstCloud(trimmedValueFirstCloud, visibilityValue, '', '', '') !== true) {
|
|
1523
1645
|
return true;
|
|
1524
1646
|
}
|
|
1647
|
+
|
|
1525
1648
|
// If Cloud1 contains Vertical Visibility then Cloud3 should be empty
|
|
1526
1649
|
if (isVerticalVisibility(trimmedValueFirstCloud)) {
|
|
1527
1650
|
return invalidCloudWithVerticalVisibilityMessage;
|
|
1528
1651
|
}
|
|
1652
|
+
|
|
1529
1653
|
// If Cloud2 is not valid, skip further validation of Cloud3
|
|
1530
1654
|
if (validateSecondCloud(trimmedValueFirstCloud, trimmedValueSecondCloud, visibilityValue) !== true) {
|
|
1531
1655
|
return true;
|
|
1532
1656
|
}
|
|
1657
|
+
|
|
1533
1658
|
// If one of the previous groups contains a type, Cloud3 cannot contain a type
|
|
1534
1659
|
if (type !== '' && (typeCloud1 !== '' || typeCloud2 !== '')) {
|
|
1535
1660
|
return invalidCloudWithPreviousType;
|
|
1536
1661
|
}
|
|
1662
|
+
|
|
1537
1663
|
// Cloud3 height has to be greater than Cloud2 height
|
|
1538
1664
|
var cloud2Height = trimmedValueSecondCloud.substring(3, 6);
|
|
1539
1665
|
if (height <= cloud2Height) {
|
|
@@ -1547,18 +1673,22 @@ var validateFourthCloud = function validateFourthCloud(firstCloudValue, secondCl
|
|
|
1547
1673
|
var trimmedValueThirdCloud = getFieldValue(thirdCloudValue);
|
|
1548
1674
|
var trimmedValueFourthCloud = getFieldValue(fourthCloudValue);
|
|
1549
1675
|
var visibilityValue = getFieldValue(visibilityFieldValue);
|
|
1676
|
+
|
|
1550
1677
|
// Field can be left empty
|
|
1551
1678
|
if (!trimmedValueFourthCloud.length) {
|
|
1552
1679
|
return true;
|
|
1553
1680
|
}
|
|
1681
|
+
|
|
1554
1682
|
// If Cloud1 is NSC, Cloud4 has to be empty
|
|
1555
1683
|
if (trimmedValueFirstCloud === 'NSC' && trimmedValueFourthCloud !== '') {
|
|
1556
1684
|
return invalidCloudWithNSCMessage;
|
|
1557
1685
|
}
|
|
1686
|
+
|
|
1558
1687
|
// If Cloud 1, 2 or 3 is empty Cloud4 should be empty
|
|
1559
1688
|
if (trimmedValueFirstCloud === '' || trimmedValueSecondCloud === '' || trimmedValueThirdCloud === '') {
|
|
1560
1689
|
return invalidCloudWithPreviousEmptyCloud;
|
|
1561
1690
|
}
|
|
1691
|
+
|
|
1562
1692
|
// Generic validations
|
|
1563
1693
|
var _sharedCloudValidatio4 = sharedCloudValidations({
|
|
1564
1694
|
value: trimmedValueFourthCloud
|
|
@@ -1571,6 +1701,7 @@ var validateFourthCloud = function validateFourthCloud(firstCloudValue, secondCl
|
|
|
1571
1701
|
if (errorMessages.length) {
|
|
1572
1702
|
return errorMessages[0];
|
|
1573
1703
|
}
|
|
1704
|
+
|
|
1574
1705
|
// Cloud4 specific validations
|
|
1575
1706
|
// If none of the previous cloud groups contains a type, the fourth group must contain a type if not empty
|
|
1576
1707
|
var typeCloud1 = trimmedValueFirstCloud.substring(6, 9);
|
|
@@ -1584,6 +1715,7 @@ var validateFourthCloud = function validateFourthCloud(firstCloudValue, secondCl
|
|
|
1584
1715
|
// We have a CB/TCU group in one of the previous cloud groups. This group should be evaluated as if it was the third group
|
|
1585
1716
|
return invalidCloud3CoverageTypeCombinationMessage;
|
|
1586
1717
|
}
|
|
1718
|
+
|
|
1587
1719
|
// If Cloud1 is not valid, skip further validation of Cloud4
|
|
1588
1720
|
// No need to pass the weatherfields as their content does not influence what happens below
|
|
1589
1721
|
// Since in case of VV the fourth field should be empty anyways
|
|
@@ -1594,6 +1726,7 @@ var validateFourthCloud = function validateFourthCloud(firstCloudValue, secondCl
|
|
|
1594
1726
|
if (isVerticalVisibility(trimmedValueFirstCloud)) {
|
|
1595
1727
|
return invalidCloudWithVerticalVisibilityMessage;
|
|
1596
1728
|
}
|
|
1729
|
+
|
|
1597
1730
|
// If Cloud3 is not valid, skip further validation of Cloud4
|
|
1598
1731
|
if (validateThirdCloud(trimmedValueFirstCloud, trimmedValueSecondCloud, trimmedValueThirdCloud, visibilityValue) !== true) {
|
|
1599
1732
|
return true;
|
|
@@ -1602,6 +1735,7 @@ var validateFourthCloud = function validateFourthCloud(firstCloudValue, secondCl
|
|
|
1602
1735
|
if (type !== '' && (typeCloud1 !== '' || typeCloud2 !== '' || typeCloud3 !== '')) {
|
|
1603
1736
|
return invalidCloudWithPreviousType;
|
|
1604
1737
|
}
|
|
1738
|
+
|
|
1605
1739
|
// Cloud4 height has to be greater than Cloud3 height
|
|
1606
1740
|
var cloud3Height = trimmedValueThirdCloud.substring(3, 6);
|
|
1607
1741
|
if (height <= cloud3Height) {
|
|
@@ -1631,6 +1765,7 @@ var FORMAT_DAYS_HOURS = 'ddHH';
|
|
|
1631
1765
|
var FORMAT_DAYS_HOURS_MINUTES = 'ddHHmm';
|
|
1632
1766
|
var lengthFM = 6;
|
|
1633
1767
|
var lengthBECMGTEMPO = 9;
|
|
1768
|
+
|
|
1634
1769
|
// formatters
|
|
1635
1770
|
var formatValidToString = function formatValidToString(valid) {
|
|
1636
1771
|
// Ensure end of valid period if midnight is shown as 24 and not 00
|
|
@@ -1655,12 +1790,14 @@ var getValidityTimeStamp = function getValidityTimeStamp(sectionType, sections,
|
|
|
1655
1790
|
seconds: 0,
|
|
1656
1791
|
milliseconds: 0
|
|
1657
1792
|
});
|
|
1793
|
+
|
|
1658
1794
|
// if start and hour is the same but minutes != 00 for the startTaf - set the minutes to account for AMENDED tafs which do not start on the hour
|
|
1659
1795
|
var shouldUpdateMinutesSeconds = sectionType === 'start' && startTaf.getDate() === clonedStartTafDate.getDate() && startTaf.getUTCHours() === clonedStartTafDate.getUTCHours() && startTaf.getMinutes() !== clonedStartTafDate.getMinutes();
|
|
1660
1796
|
var updatedStartTafDate = shouldUpdateMinutesSeconds ? dateUtils.set(clonedStartTafDate, {
|
|
1661
1797
|
minutes: startTaf.getMinutes(),
|
|
1662
1798
|
seconds: startTaf.getSeconds()
|
|
1663
1799
|
}) : clonedStartTafDate;
|
|
1800
|
+
|
|
1664
1801
|
// Only proceed if has not bubbled dates overflow to months and not bubbled hours overflow to days
|
|
1665
1802
|
var isSameTime = updatedStartTafDate.getDate() === sections.day && updatedStartTafDate.getUTCHours() === sections.hour && updatedStartTafDate.getMinutes() === sections.min;
|
|
1666
1803
|
var isOverflowing = updatedStartTafDate.getDate() === sections.day + 1 && sections.hour === 24 && sections.min === 0;
|
|
@@ -1674,6 +1811,7 @@ var getValidityTimeStamp = function getValidityTimeStamp(sectionType, sections,
|
|
|
1674
1811
|
}
|
|
1675
1812
|
return updatedStartTafDate;
|
|
1676
1813
|
};
|
|
1814
|
+
|
|
1677
1815
|
// parsers
|
|
1678
1816
|
var parseValidToObject = function parseValidToObject(value, tafStart, tafEnd) {
|
|
1679
1817
|
if (!value) {
|
|
@@ -1688,6 +1826,7 @@ var parseValidToObject = function parseValidToObject(value, tafStart, tafEnd) {
|
|
|
1688
1826
|
var startSections = getSections(startEnd[0], format);
|
|
1689
1827
|
var startDate = getValidityTimeStamp('start', startSections, tafStartDate, tafEndDate);
|
|
1690
1828
|
var startString = dateUtils.dateToString(startDate);
|
|
1829
|
+
|
|
1691
1830
|
// If we only have start value - return that otherwise, also get end time
|
|
1692
1831
|
if (startEnd.length < 2) {
|
|
1693
1832
|
return {
|
|
@@ -1702,6 +1841,7 @@ var parseValidToObject = function parseValidToObject(value, tafStart, tafEnd) {
|
|
|
1702
1841
|
end: endString
|
|
1703
1842
|
};
|
|
1704
1843
|
};
|
|
1844
|
+
|
|
1705
1845
|
// messages
|
|
1706
1846
|
var invalidValidityDaysHoursStartMessage = 'Invalid validity start period, expected a date value between 00 and 31 and an hour value between 00 and 23';
|
|
1707
1847
|
var invalidValidityDaysHoursEndMessage = 'Invalid validity end period, expected a date value between 00 and 31 and an hour value between 01 and 24';
|
|
@@ -1713,7 +1853,9 @@ var invalidChangeValidInterFieldMessage = 'Invalid validity period, expected DDH
|
|
|
1713
1853
|
var invalidBECMGDurationValidInterFieldMessage = 'Invalid validity period, for BECMG only validity periods with a duration of 1, 2, 3 or 4 hours are allowed';
|
|
1714
1854
|
var invalidTEMPODurationValidInterfieldMessage = 'Invalid validity period, for TEMPO a validity period of at least 1 hour is required';
|
|
1715
1855
|
var invalidChangeGroupOverlapsWithFM = 'The valid time of a change group cannot overlap with the valid time of a following FM group. This change group should end before or at the hour of the start of the FM group';
|
|
1856
|
+
|
|
1716
1857
|
// Validations
|
|
1858
|
+
|
|
1717
1859
|
// Ensure all individual sections are correct (DD HH mm etc)
|
|
1718
1860
|
var validateValidSections = function validateValidSections(sections, isStartEnd) {
|
|
1719
1861
|
var validateMsg = [];
|
|
@@ -1727,6 +1869,7 @@ var validateValidSections = function validateValidSections(sections, isStartEnd)
|
|
|
1727
1869
|
}
|
|
1728
1870
|
return validateMsg;
|
|
1729
1871
|
};
|
|
1872
|
+
|
|
1730
1873
|
// Validate to ensure valid dates are passed
|
|
1731
1874
|
var validateIsValidDates = function validateIsValidDates(value, tafStart, tafEnd) {
|
|
1732
1875
|
var tafStartDate = dateUtils.utc(tafStart);
|
|
@@ -1734,8 +1877,10 @@ var validateIsValidDates = function validateIsValidDates(value, tafStart, tafEnd
|
|
|
1734
1877
|
var startEnd = value.split('/');
|
|
1735
1878
|
var format = !value.includes('/') ? FORMAT_DAYS_HOURS_MINUTES : FORMAT_DAYS_HOURS;
|
|
1736
1879
|
var validateMsg = [];
|
|
1880
|
+
|
|
1737
1881
|
// Validate start time
|
|
1738
1882
|
var startSections = getSections(startEnd[0], format);
|
|
1883
|
+
|
|
1739
1884
|
// Validate individual sections for start
|
|
1740
1885
|
var sectionValidationStart = validateValidSections(startSections, 'start');
|
|
1741
1886
|
// If invalid start - return with errors
|
|
@@ -1743,13 +1888,16 @@ var validateIsValidDates = function validateIsValidDates(value, tafStart, tafEnd
|
|
|
1743
1888
|
return sectionValidationStart;
|
|
1744
1889
|
}
|
|
1745
1890
|
var startTimestamp = getValidityTimeStamp('start', startSections, tafStartDate, tafEndDate);
|
|
1891
|
+
|
|
1746
1892
|
// Validate start is within the taf validity bounds
|
|
1747
1893
|
if (startTimestamp < tafStartDate || startTimestamp > tafEndDate) {
|
|
1748
1894
|
validateMsg.push(invalidValidityStartTimeMessage);
|
|
1749
1895
|
}
|
|
1896
|
+
|
|
1750
1897
|
// Validate end time
|
|
1751
1898
|
if (startEnd.length > 1) {
|
|
1752
1899
|
var endSections = getSections(startEnd[1], FORMAT_DAYS_HOURS);
|
|
1900
|
+
|
|
1753
1901
|
// Validate individual sections for end
|
|
1754
1902
|
var sectionValidationEnd = validateValidSections(endSections, 'end');
|
|
1755
1903
|
// If invalid end - return with errors
|
|
@@ -1757,10 +1905,12 @@ var validateIsValidDates = function validateIsValidDates(value, tafStart, tafEnd
|
|
|
1757
1905
|
return sectionValidationEnd;
|
|
1758
1906
|
}
|
|
1759
1907
|
var endTimestamp = getValidityTimeStamp('end', endSections, tafStartDate, tafEndDate);
|
|
1908
|
+
|
|
1760
1909
|
// Validate end is not before start
|
|
1761
1910
|
if (endTimestamp < startTimestamp) {
|
|
1762
1911
|
validateMsg.push(invalidValidityPeriodMessage);
|
|
1763
1912
|
}
|
|
1913
|
+
|
|
1764
1914
|
// Validate end is within the taf validity bounds
|
|
1765
1915
|
if (endTimestamp < tafStartDate || endTimestamp > tafEndDate) {
|
|
1766
1916
|
validateMsg.push(invalidValidityEndTimeMessage);
|
|
@@ -1768,18 +1918,21 @@ var validateIsValidDates = function validateIsValidDates(value, tafStart, tafEnd
|
|
|
1768
1918
|
}
|
|
1769
1919
|
return validateMsg;
|
|
1770
1920
|
};
|
|
1921
|
+
|
|
1771
1922
|
// Main validation function
|
|
1772
1923
|
var validateValidField = function validateValidField(value, tafStart, tafEnd) {
|
|
1773
1924
|
var trimmedValue = getFieldValue(value);
|
|
1774
1925
|
if (!trimmedValue.length) {
|
|
1775
1926
|
return true;
|
|
1776
1927
|
}
|
|
1928
|
+
|
|
1777
1929
|
// Validate length and ensure it doesn't contain any other characters than numbers and / and has either XXXX/XXXX or XXXXXX format
|
|
1778
1930
|
if (trimmedValue.length < lengthFM || trimmedValue.length > lengthBECMGTEMPO || !(/^[0-9]{4}\/[0-9]{4}$/.exec(trimmedValue) || /^[0-9]{6}$/.exec(trimmedValue)) ||
|
|
1779
1931
|
// only allow dates with / fully typed
|
|
1780
1932
|
tafStart != null && tafStart.includes('/') && trimmedValue.length !== lengthBECMGTEMPO || tafEnd != null && tafEnd.includes('/') && trimmedValue.length !== lengthBECMGTEMPO) {
|
|
1781
1933
|
return invalidChangeValidInterFieldMessage;
|
|
1782
1934
|
}
|
|
1935
|
+
|
|
1783
1936
|
// Ensure valid date(s) can be made
|
|
1784
1937
|
var validDateErrors = validateIsValidDates(trimmedValue, tafStart, tafEnd);
|
|
1785
1938
|
if (validDateErrors.length !== 0) {
|
|
@@ -1813,18 +1966,21 @@ var validateValidChangeGroupInterField = function validateValidChangeGroupInterF
|
|
|
1813
1966
|
trimmedValue.length < lengthBECMGTEMPO && trimmedValueChange !== 'FM') {
|
|
1814
1967
|
return invalidChangeValidInterFieldMessage;
|
|
1815
1968
|
}
|
|
1969
|
+
|
|
1816
1970
|
// Ensure BECMG changegroup duration for BECMG and TEMPO
|
|
1817
1971
|
if (trimmedValueChange === 'BECMG' || trimmedValueChange === 'TEMPO') {
|
|
1818
1972
|
var tafStartDate = dateUtils.utc(tafStart);
|
|
1819
1973
|
var tafEndDate = dateUtils.utc(tafEnd);
|
|
1820
1974
|
var startEnd = trimmedValue.split('/');
|
|
1821
1975
|
var format = !trimmedValue.includes('/') ? FORMAT_DAYS_HOURS_MINUTES : FORMAT_DAYS_HOURS;
|
|
1976
|
+
|
|
1822
1977
|
// Validate start time
|
|
1823
1978
|
var startSections = getSections(startEnd[0], format);
|
|
1824
1979
|
var startTimestamp = getValidityTimeStamp('start', startSections, tafStartDate, tafEndDate);
|
|
1825
1980
|
var endSections = getSections(startEnd[1], FORMAT_DAYS_HOURS);
|
|
1826
1981
|
var endTimestamp = getValidityTimeStamp('end', endSections, tafStartDate, tafEndDate);
|
|
1827
1982
|
var timeDifference = dateUtils.differenceInHours(endTimestamp, startTimestamp, 'ceil');
|
|
1983
|
+
|
|
1828
1984
|
// Ensure BECMG changegroup has duration of 1,2,3,4 hours
|
|
1829
1985
|
if (trimmedValueChange === 'BECMG') {
|
|
1830
1986
|
if (
|
|
@@ -1844,6 +2000,7 @@ var validateValidChangeGroupInterField = function validateValidChangeGroupInterF
|
|
|
1844
2000
|
}
|
|
1845
2001
|
return true;
|
|
1846
2002
|
};
|
|
2003
|
+
|
|
1847
2004
|
// validate previous changeGroup
|
|
1848
2005
|
var validProbChangeOrder = ['FM', 'BECMG', 'TEMPO', 'PROB40', 'PROB30', 'PROB40 TEMPO', 'PROB30 TEMPO'];
|
|
1849
2006
|
var invalidPreviousChangeGroupIsBeforeMessage = 'Valid time should be after previous valid time';
|
|
@@ -1857,18 +2014,21 @@ var validatePreviousChangeGroup = function validatePreviousChangeGroup(currentCh
|
|
|
1857
2014
|
var previousValid = getFieldValue(previousChangeGroup.valid);
|
|
1858
2015
|
var previousChange = getFieldValue(previousChangeGroup.change || '');
|
|
1859
2016
|
var previousProbability = getFieldValue(previousChangeGroup.probability || '');
|
|
2017
|
+
|
|
1860
2018
|
// get the parsed values
|
|
1861
2019
|
var validValue = parseValidToObject(valid, tafStart, tafEnd);
|
|
1862
2020
|
var previousValidValue = parseValidToObject(previousValid, tafStart, tafEnd);
|
|
1863
2021
|
if (!validValue || !previousValidValue || !change.length && !probability.length) {
|
|
1864
2022
|
return true;
|
|
1865
2023
|
}
|
|
2024
|
+
|
|
1866
2025
|
// validate is valid time before
|
|
1867
2026
|
var currentStartTime = dateUtils.utc(validValue.start);
|
|
1868
2027
|
var previousRowStartTime = dateUtils.utc(previousValidValue.start);
|
|
1869
2028
|
if (dateUtils.isBefore(currentStartTime, previousRowStartTime)) {
|
|
1870
2029
|
return invalidPreviousChangeGroupIsBeforeMessage;
|
|
1871
2030
|
}
|
|
2031
|
+
|
|
1872
2032
|
// validate same valid time
|
|
1873
2033
|
if (dateUtils.isEqual(currentStartTime, previousRowStartTime)) {
|
|
1874
2034
|
// validate change/probability order
|
|
@@ -1884,6 +2044,7 @@ var validatePreviousChangeGroup = function validatePreviousChangeGroup(currentCh
|
|
|
1884
2044
|
}
|
|
1885
2045
|
return true;
|
|
1886
2046
|
};
|
|
2047
|
+
|
|
1887
2048
|
// validate overlapping validity when one of the following changegroups is FM
|
|
1888
2049
|
var validateOverlapWithFM = function validateOverlapWithFM(currentChangeGroup, nextChangeGroups, tafStart, tafEnd) {
|
|
1889
2050
|
var valid = getFieldValue(currentChangeGroup.valid);
|
|
@@ -1938,6 +2099,7 @@ function (list, item) {
|
|
|
1938
2099
|
var _Object$assign;
|
|
1939
2100
|
return Object.assign({}, list, (_Object$assign = {}, _Object$assign[item.key] = item, _Object$assign));
|
|
1940
2101
|
}, {});
|
|
2102
|
+
|
|
1941
2103
|
// formatters
|
|
1942
2104
|
// if passed true - visibility is CAVOK, if passed a number - prepend zeroes to size 4
|
|
1943
2105
|
var formatVisibilityToString = function formatVisibilityToString(value) {
|
|
@@ -1953,6 +2115,7 @@ var formatVisibilityToString = function formatVisibilityToString(value) {
|
|
|
1953
2115
|
var size = configAsObject$1.range.size;
|
|
1954
2116
|
return prependZeroes(value.range, size);
|
|
1955
2117
|
};
|
|
2118
|
+
|
|
1956
2119
|
// parsers
|
|
1957
2120
|
// returns object with validity if passed numbers - returns object with cavOK: true if passed CAVOK
|
|
1958
2121
|
var parseVisibilityToObject = function parseVisibilityToObject(value) {
|
|
@@ -1969,12 +2132,14 @@ var parseVisibilityToObject = function parseVisibilityToObject(value) {
|
|
|
1969
2132
|
}
|
|
1970
2133
|
};
|
|
1971
2134
|
};
|
|
2135
|
+
|
|
1972
2136
|
// messages
|
|
1973
2137
|
var invalidVisibilityMessage = 'Invalid visibility, expected either a 4 digit visibility range in meters or CAVOK';
|
|
1974
2138
|
var invalidVisibilityRangeMessage = 'Invalid visibility, expected a 4 digit range in meters';
|
|
1975
2139
|
var invalidVisibilityRange50mStepMessage = 'Invalid visibility, a range between 0000 and 0800 must be rounded to the nearest 50m';
|
|
1976
2140
|
var invalidVisibilityRange100mStepMessage = 'Invalid visibility, a range between 0800 and 5000 must be rounded to the nearest 100m';
|
|
1977
2141
|
var invalidVisibilityRange1000mStepMessage = 'Invalid visibility, a range between 5000 and 9000 must be rounded to the nearest 1000m';
|
|
2142
|
+
|
|
1978
2143
|
// validations
|
|
1979
2144
|
var validateRange = function validateRange(value) {
|
|
1980
2145
|
// check if not too many digits
|
|
@@ -1994,6 +2159,7 @@ var validateRange = function validateRange(value) {
|
|
|
1994
2159
|
}
|
|
1995
2160
|
return true;
|
|
1996
2161
|
};
|
|
2162
|
+
|
|
1997
2163
|
// Main validation function
|
|
1998
2164
|
var validateVisibilityField = function validateVisibilityField(value) {
|
|
1999
2165
|
var trimmedValue = getFieldValue(value);
|
|
@@ -2004,12 +2170,15 @@ var validateVisibilityField = function validateVisibilityField(value) {
|
|
|
2004
2170
|
if (trimmedValue.length < 4 || trimmedValue.length > 5 || !/^[0-9CAVOK]+$/.exec(trimmedValue)) {
|
|
2005
2171
|
return invalidVisibilityMessage;
|
|
2006
2172
|
}
|
|
2173
|
+
|
|
2007
2174
|
// if not a number - only option is CAVOK
|
|
2008
2175
|
if (!/^[0-9]+$/.exec(trimmedValue)) {
|
|
2009
2176
|
return trimmedValue === 'CAVOK' || invalidVisibilityMessage;
|
|
2010
2177
|
}
|
|
2178
|
+
|
|
2011
2179
|
// validate range
|
|
2012
2180
|
var rangeValidation = validateRange(trimmedValue);
|
|
2181
|
+
|
|
2013
2182
|
// return first error, if no error then no error!
|
|
2014
2183
|
return rangeValidation === true || rangeValidation;
|
|
2015
2184
|
};
|
|
@@ -2032,9 +2201,7 @@ var validateVisibilityField = function validateVisibilityField(value) {
|
|
|
2032
2201
|
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
2033
2202
|
* */
|
|
2034
2203
|
// Source: http://codes.wmo.int/49-2/_AerodromePresentOrForecastWeather
|
|
2035
|
-
var WeatherPhenomena
|
|
2036
|
-
(function (WeatherPhenomena) {
|
|
2037
|
-
// weather phenomena from http://codes.wmo.int/49-2/_AerodromePresentOrForecastWeather
|
|
2204
|
+
var WeatherPhenomena = /*#__PURE__*/function (WeatherPhenomena) {
|
|
2038
2205
|
WeatherPhenomena["+DS"] = "+DS";
|
|
2039
2206
|
WeatherPhenomena["+DZ"] = "+DZ";
|
|
2040
2207
|
WeatherPhenomena["+DZPL"] = "+DZPL";
|
|
@@ -2434,11 +2601,9 @@ var WeatherPhenomena;
|
|
|
2434
2601
|
WeatherPhenomena["VCSS"] = "VCSS";
|
|
2435
2602
|
WeatherPhenomena["VCTS"] = "VCTS";
|
|
2436
2603
|
WeatherPhenomena["VCVA"] = "VCVA";
|
|
2437
|
-
// Additional codes from https://codes.wmo.int/306/4678
|
|
2438
2604
|
WeatherPhenomena["+FC"] = "+FC";
|
|
2439
2605
|
WeatherPhenomena["-DS"] = "-DS";
|
|
2440
2606
|
WeatherPhenomena["-SS"] = "-SS";
|
|
2441
|
-
// Additional codes added o fmi-avi-msgconverter
|
|
2442
2607
|
WeatherPhenomena["FZRASN"] = "FZRASN";
|
|
2443
2608
|
WeatherPhenomena["FZRAPL"] = "FZRAPL";
|
|
2444
2609
|
WeatherPhenomena["FZRASG"] = "FZRASG";
|
|
@@ -2457,7 +2622,8 @@ var WeatherPhenomena;
|
|
|
2457
2622
|
WeatherPhenomena["+FZDZSG"] = "+FZDZSG";
|
|
2458
2623
|
WeatherPhenomena["+FZDZSN"] = "+FZDZSN";
|
|
2459
2624
|
WeatherPhenomena["+FZDZPL"] = "+FZDZPL";
|
|
2460
|
-
|
|
2625
|
+
return WeatherPhenomena;
|
|
2626
|
+
}({});
|
|
2461
2627
|
|
|
2462
2628
|
/* *
|
|
2463
2629
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -2476,6 +2642,7 @@ var WeatherPhenomena;
|
|
|
2476
2642
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
2477
2643
|
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
2478
2644
|
* */
|
|
2645
|
+
|
|
2479
2646
|
// messages
|
|
2480
2647
|
var invalidWeatherMessage = 'Invalid weather input, expected NSW or a valid weather code';
|
|
2481
2648
|
var invalidWeatherCodeMessage = 'Invalid weather input, invalid weather code';
|
|
@@ -2487,6 +2654,7 @@ var invalidWeatherCAVOKMessage = 'Invalid weather input, when CAVOK is used, wea
|
|
|
2487
2654
|
var invalidWeatherVisibilityBelow5000 = 'Invalid weather input, weather codes FU, DU, HZ, DRDU and BLDU need to be combined with a visibility of 5000m or less';
|
|
2488
2655
|
var invalidWeatherBRVisibility = 'Invalid weather input, weather code BR needs to be combined with a visibility between 1000 and 5000m';
|
|
2489
2656
|
var invalidWeatherFGVisibility = 'Invalid weather input, weather code FG needs to be combined with a visibility below 1000m';
|
|
2657
|
+
|
|
2490
2658
|
// validations
|
|
2491
2659
|
var WeatherVisibilityBelow5000 = [WeatherPhenomena.FU, WeatherPhenomena.DU, WeatherPhenomena.HZ, WeatherPhenomena.DRDU, WeatherPhenomena.BLDU];
|
|
2492
2660
|
var validateWeatherField = function validateWeatherField(value, visibilityFieldValue, NSWAllowed) {
|
|
@@ -2495,22 +2663,27 @@ var validateWeatherField = function validateWeatherField(value, visibilityFieldV
|
|
|
2495
2663
|
}
|
|
2496
2664
|
var trimmedValue = getFieldValue(value);
|
|
2497
2665
|
var visibilityValue = getFieldValue(visibilityFieldValue);
|
|
2666
|
+
|
|
2498
2667
|
// if empty, validate as true
|
|
2499
2668
|
if (trimmedValue === '') {
|
|
2500
2669
|
return true;
|
|
2501
2670
|
}
|
|
2671
|
+
|
|
2502
2672
|
// In case of NSW - validate if allowed
|
|
2503
2673
|
if (trimmedValue === 'NSW' && !NSWAllowed) {
|
|
2504
2674
|
return invalidWeatherNSWMessage;
|
|
2505
2675
|
}
|
|
2676
|
+
|
|
2506
2677
|
// Check if cavOK - then weather group should be empty
|
|
2507
2678
|
if (trimmedValue && visibilityValue === 'CAVOK') {
|
|
2508
2679
|
return invalidWeatherCAVOKMessage;
|
|
2509
2680
|
}
|
|
2681
|
+
|
|
2510
2682
|
// Validate if entered weather is one of the allowed weather phenomena
|
|
2511
2683
|
if (!(trimmedValue in WeatherPhenomena) && trimmedValue !== 'NSW') {
|
|
2512
2684
|
return NSWAllowed ? invalidWeatherMessage : invalidWeatherCodeMessage;
|
|
2513
2685
|
}
|
|
2686
|
+
|
|
2514
2687
|
// Validate the weather code in combination with the visibility range
|
|
2515
2688
|
var visibilityRange = parseInt(visibilityValue, 10);
|
|
2516
2689
|
if (WeatherVisibilityBelow5000.includes(trimmedValue) && visibilityRange > 5000) {
|
|
@@ -2522,25 +2695,30 @@ var validateWeatherField = function validateWeatherField(value, visibilityFieldV
|
|
|
2522
2695
|
if (trimmedValue === WeatherPhenomena.FG && visibilityRange >= 1000) {
|
|
2523
2696
|
return invalidWeatherFGVisibility;
|
|
2524
2697
|
}
|
|
2698
|
+
|
|
2525
2699
|
// Everything validated ok - return true
|
|
2526
2700
|
return true;
|
|
2527
2701
|
};
|
|
2528
2702
|
var validateSecondWeatherField = function validateSecondWeatherField(weather1Value, weather2Value, visibilityFieldValue) {
|
|
2529
2703
|
var trimmedWeather2Value = getFieldValue(weather2Value);
|
|
2530
2704
|
var visibilityValue = getFieldValue(visibilityFieldValue);
|
|
2705
|
+
|
|
2531
2706
|
// Field can be left empty
|
|
2532
2707
|
if (!trimmedWeather2Value.length) {
|
|
2533
2708
|
return true;
|
|
2534
2709
|
}
|
|
2535
2710
|
var trimmedWeather1Value = getFieldValue(weather1Value);
|
|
2711
|
+
|
|
2536
2712
|
// If weather1 is NSW weather2 should be empty
|
|
2537
2713
|
if (trimmedWeather1Value === 'NSW' && trimmedWeather2Value !== '') {
|
|
2538
2714
|
return invalidWeatherNonEmptyNSWGroups;
|
|
2539
2715
|
}
|
|
2716
|
+
|
|
2540
2717
|
// If weather1 is empty weather2 should be empty
|
|
2541
2718
|
if (trimmedWeather1Value === '') {
|
|
2542
2719
|
return invalidWeatherWithPreviousEmptyWeather;
|
|
2543
2720
|
}
|
|
2721
|
+
|
|
2544
2722
|
// If weather1 must be different from weather2
|
|
2545
2723
|
if (trimmedWeather1Value === trimmedWeather2Value) {
|
|
2546
2724
|
return invalidWeatherNonUniqueValue;
|
|
@@ -2550,20 +2728,24 @@ var validateSecondWeatherField = function validateSecondWeatherField(weather1Val
|
|
|
2550
2728
|
var validateThirdWeatherField = function validateThirdWeatherField(weather1Value, weather2Value, weather3Value, visibilityFieldValue) {
|
|
2551
2729
|
var trimmedWeather3Value = getFieldValue(weather3Value);
|
|
2552
2730
|
var visibilityValue = getFieldValue(visibilityFieldValue);
|
|
2731
|
+
|
|
2553
2732
|
// Field can be left empty
|
|
2554
2733
|
if (!trimmedWeather3Value.length) {
|
|
2555
2734
|
return true;
|
|
2556
2735
|
}
|
|
2557
2736
|
var trimmedWeather1Value = getFieldValue(weather1Value);
|
|
2558
2737
|
var trimmedWeather2Value = getFieldValue(weather2Value);
|
|
2738
|
+
|
|
2559
2739
|
// If weather1 is NSW weather3 should be empty
|
|
2560
2740
|
if (trimmedWeather1Value === 'NSW' && trimmedWeather3Value !== '') {
|
|
2561
2741
|
return invalidWeatherNonEmptyNSWGroups;
|
|
2562
2742
|
}
|
|
2743
|
+
|
|
2563
2744
|
// If weather1 or weather2 is empty weather3 should be empty
|
|
2564
2745
|
if (trimmedWeather1Value === '' || trimmedWeather2Value === '') {
|
|
2565
2746
|
return invalidWeatherWithPreviousEmptyWeather;
|
|
2566
2747
|
}
|
|
2748
|
+
|
|
2567
2749
|
// If weather3 must be different from weather1 and weather2
|
|
2568
2750
|
if (trimmedWeather1Value === trimmedWeather3Value || trimmedWeather2Value === trimmedWeather3Value) {
|
|
2569
2751
|
return invalidWeatherNonUniqueValue;
|
|
@@ -2622,6 +2804,7 @@ function (list, item) {
|
|
|
2622
2804
|
var _Object$assign;
|
|
2623
2805
|
return Object.assign({}, list, (_Object$assign = {}, _Object$assign[item.key] = item, _Object$assign));
|
|
2624
2806
|
}, {});
|
|
2807
|
+
|
|
2625
2808
|
// wind formatters:
|
|
2626
2809
|
var formatWindValues = function formatWindValues(key, value) {
|
|
2627
2810
|
switch (key) {
|
|
@@ -2661,6 +2844,7 @@ var formatWindValues = function formatWindValues(key, value) {
|
|
|
2661
2844
|
return value;
|
|
2662
2845
|
}
|
|
2663
2846
|
};
|
|
2847
|
+
|
|
2664
2848
|
// Format incoming Wind object
|
|
2665
2849
|
var formatWindToString = function formatWindToString(value) {
|
|
2666
2850
|
if (!value) {
|
|
@@ -2687,6 +2871,7 @@ var extractValidateWindSections = function extractValidateWindSections(value, va
|
|
|
2687
2871
|
// Get first 3 chars as they are ALWAYS the direction
|
|
2688
2872
|
var direction = obj.remainder.slice(0, size);
|
|
2689
2873
|
var remainder = obj.remainder.substring(size);
|
|
2874
|
+
|
|
2690
2875
|
// Validate direction
|
|
2691
2876
|
if (validation) {
|
|
2692
2877
|
var valDirection = validateDirection(direction);
|
|
@@ -2711,6 +2896,7 @@ var extractValidateWindSections = function extractValidateWindSections(value, va
|
|
|
2711
2896
|
var dirLength = obj.remainder.length && obj.remainder.startsWith('P') ? maxSize : minSize;
|
|
2712
2897
|
var speed = obj.remainder.slice(0, dirLength);
|
|
2713
2898
|
var _remainder = obj.remainder.substring(dirLength);
|
|
2899
|
+
|
|
2714
2900
|
// Validate speed
|
|
2715
2901
|
if (validation) {
|
|
2716
2902
|
var valSpeed = validateSpeed(speed);
|
|
@@ -2739,6 +2925,7 @@ var extractValidateWindSections = function extractValidateWindSections(value, va
|
|
|
2739
2925
|
var _dirLength = rest.startsWith('P') ? _maxSize : _minSize;
|
|
2740
2926
|
var gust = rest.slice(0, _dirLength);
|
|
2741
2927
|
var _remainder2 = rest.substring(_dirLength);
|
|
2928
|
+
|
|
2742
2929
|
// Validate gusts
|
|
2743
2930
|
if (validation) {
|
|
2744
2931
|
var valGust = validateGust(gust);
|
|
@@ -2782,6 +2969,7 @@ var extractValidateWindSections = function extractValidateWindSections(value, va
|
|
|
2782
2969
|
validations: []
|
|
2783
2970
|
});
|
|
2784
2971
|
};
|
|
2972
|
+
|
|
2785
2973
|
// parsers
|
|
2786
2974
|
var parseWindToObject = function parseWindToObject(value) {
|
|
2787
2975
|
// Create wind object from passed string
|
|
@@ -2799,6 +2987,7 @@ var parseWindToObject = function parseWindToObject(value) {
|
|
|
2799
2987
|
});
|
|
2800
2988
|
return windObject;
|
|
2801
2989
|
};
|
|
2990
|
+
|
|
2802
2991
|
// messages
|
|
2803
2992
|
var invalidWindMessage = 'Invalid wind, expected <direction><speed><gusts(optional)> with direction consisting of 3 digits or VRB and speed and gusts of 2 digits or P99';
|
|
2804
2993
|
var invalidWindDirectionMessage = 'Invalid wind direction, expected a direction equal to 3 digits or VRB';
|
|
@@ -2811,12 +3000,14 @@ var invalidGustForWindP99Message = 'Invalid wind speed and gust combination, if
|
|
|
2811
3000
|
var invalidWindSpeedForDirectionZeroMessage = 'Invalid wind speed, if direction is 000, speed can only be 00';
|
|
2812
3001
|
var invalidWindSpeedForDirectionNonZeroMessage = 'Invalid wind speed, if direction is not 000, speed can not be 00';
|
|
2813
3002
|
var invalidWindVRBWindDirectionMessage = 'Invalid wind direction, VRB can only be used in combination with windspeeds smaller than 3 or in combination with gusts and showers';
|
|
3003
|
+
|
|
2814
3004
|
// validations
|
|
2815
3005
|
var validateDirection = function validateDirection(value) {
|
|
2816
3006
|
// if not a number
|
|
2817
3007
|
if (!/^[0-9]+$/.exec(value)) {
|
|
2818
3008
|
return value === 'VRB' || invalidWindDirectionMessage;
|
|
2819
3009
|
}
|
|
3010
|
+
|
|
2820
3011
|
// Parse to integer to check for direction min and max
|
|
2821
3012
|
var intDir = parseInt(value, 10);
|
|
2822
3013
|
if (intDir > 360 || intDir < 0) {
|
|
@@ -2867,6 +3058,7 @@ var validateWindInterSection = function validateWindInterSection(speed, gust, di
|
|
|
2867
3058
|
return invalidWindVRBWindDirectionMessage;
|
|
2868
3059
|
}
|
|
2869
3060
|
}
|
|
3061
|
+
|
|
2870
3062
|
// Validate gust
|
|
2871
3063
|
if (gust === '') {
|
|
2872
3064
|
return true;
|
|
@@ -2879,6 +3071,7 @@ var validateWindInterSection = function validateWindInterSection(speed, gust, di
|
|
|
2879
3071
|
}
|
|
2880
3072
|
return true;
|
|
2881
3073
|
};
|
|
3074
|
+
|
|
2882
3075
|
// Main validation function
|
|
2883
3076
|
var validateWindField = function validateWindField(value, weatherfield1, weatherfield2, weatherfield3) {
|
|
2884
3077
|
var trimmedWindValue = getFieldValue(value);
|
|
@@ -2892,6 +3085,7 @@ var validateWindField = function validateWindField(value, weatherfield1, weather
|
|
|
2892
3085
|
if (trimmedWindValue.length < 5 || trimmedWindValue.length > 12 || !/^[0-9VRBPGKT]+$/.exec(trimmedWindValue)) {
|
|
2893
3086
|
return invalidWindMessage;
|
|
2894
3087
|
}
|
|
3088
|
+
|
|
2895
3089
|
// First validate individual sections
|
|
2896
3090
|
var windValidationIndv = extractValidateWindSections(trimmedWindValue, true);
|
|
2897
3091
|
if (windValidationIndv.validations.length !== 0) {
|
|
@@ -2899,6 +3093,7 @@ var validateWindField = function validateWindField(value, weatherfield1, weather
|
|
|
2899
3093
|
return typeof error === 'string';
|
|
2900
3094
|
});
|
|
2901
3095
|
}
|
|
3096
|
+
|
|
2902
3097
|
// Then do any intersection validation
|
|
2903
3098
|
return validateWindInterSection(windValidationIndv.speed, windValidationIndv.gust, windValidationIndv.direction, trimmedWeather1Value, trimmedWeather2Value, trimmedWeather3Value);
|
|
2904
3099
|
};
|
|
@@ -3045,6 +3240,7 @@ var getTafConfig = /*#__PURE__*/function () {
|
|
|
3045
3240
|
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
3046
3241
|
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
3047
3242
|
* */
|
|
3243
|
+
|
|
3048
3244
|
var isTafConfigLocationFixedPeriod = function isTafConfigLocationFixedPeriod(location) {
|
|
3049
3245
|
return location.activity_period !== undefined;
|
|
3050
3246
|
};
|
|
@@ -3092,6 +3288,7 @@ var getBaseTime = function getBaseTime(baseTime, location, tafConfig) {
|
|
|
3092
3288
|
var startTimeIndex = configLocation.valid_start_times.findLastIndex(function (hour) {
|
|
3093
3289
|
return currentBaseTime.getUTCHours() >= hour;
|
|
3094
3290
|
});
|
|
3291
|
+
|
|
3095
3292
|
// when current hour is lower than then first item in valid_start_times. we need to move to the last hour of the previous day
|
|
3096
3293
|
if (startTimeIndex === -1) {
|
|
3097
3294
|
var lastStartTimeIndex = configLocation.valid_start_times.length - 1;
|
|
@@ -3119,6 +3316,7 @@ var getBaseTime = function getBaseTime(baseTime, location, tafConfig) {
|
|
|
3119
3316
|
minutes: 0,
|
|
3120
3317
|
seconds: 0
|
|
3121
3318
|
});
|
|
3319
|
+
|
|
3122
3320
|
// If next start time is earlier than or equal to current start time, it means we've wrapped to the next day
|
|
3123
3321
|
if (nextStartTimeHour <= configLocation.valid_start_times[startTimeIndex]) {
|
|
3124
3322
|
nextBaseTime = dateUtils.add(nextBaseTime, {
|
|
@@ -3131,6 +3329,7 @@ var getBaseTime = function getBaseTime(baseTime, location, tafConfig) {
|
|
|
3131
3329
|
nextBaseTime: nextBaseTime
|
|
3132
3330
|
};
|
|
3133
3331
|
};
|
|
3332
|
+
|
|
3134
3333
|
/**
|
|
3135
3334
|
* If we don't have a taf to get the baseTime from, we calculate it based on the current time and the activity_period from the config.
|
|
3136
3335
|
* @param tafConfig
|
|
@@ -3590,6 +3789,7 @@ var emptyBaseForecast = {
|
|
|
3590
3789
|
}
|
|
3591
3790
|
};
|
|
3592
3791
|
var MIN_NUMBER_CHANGE_GROUP = 5;
|
|
3792
|
+
|
|
3593
3793
|
// formatters
|
|
3594
3794
|
var formatIssueTime = function formatIssueTime(issueDate) {
|
|
3595
3795
|
var issueDateAsString = dateUtils.dateToString(new Date(issueDate), DATE_FORMAT_ISSUE_TIME);
|
|
@@ -3746,8 +3946,9 @@ function parseFormValues(row, tafStart, tafEnd) {
|
|
|
3746
3946
|
case 'probability':
|
|
3747
3947
|
// If empty, remove it from the list
|
|
3748
3948
|
if (!reducedRow[key]) {
|
|
3749
|
-
list
|
|
3750
|
-
|
|
3949
|
+
var _ref = list;
|
|
3950
|
+
_ref[key];
|
|
3951
|
+
var _rest5 = _objectWithoutPropertiesLoose(_ref, [key].map(_toPropertyKey));
|
|
3751
3952
|
return _rest5;
|
|
3752
3953
|
}
|
|
3753
3954
|
return list;
|
|
@@ -3817,6 +4018,7 @@ var convertTafValuesToObject = function convertTafValuesToObject(formData) {
|
|
|
3817
4018
|
}
|
|
3818
4019
|
}, parsedFormValues);
|
|
3819
4020
|
};
|
|
4021
|
+
|
|
3820
4022
|
// Ensure we have enough data to retrieve a TAC - we only need to check for wind and visibility/ cavok as those are the only ones required in all cases
|
|
3821
4023
|
var shouldRetrieveTAC = function shouldRetrieveTAC(product) {
|
|
3822
4024
|
var _product$baseForecast;
|
|
@@ -3890,9 +4092,9 @@ var useDragOrder = function useDragOrder(trigger, move) {
|
|
|
3890
4092
|
var _React$useState3 = React.useState([null, null]),
|
|
3891
4093
|
lastDragOrder = _React$useState3[0],
|
|
3892
4094
|
setLastDragOrder = _React$useState3[1];
|
|
3893
|
-
var onChangeOrder = function onChangeOrder(
|
|
3894
|
-
var oldIndex =
|
|
3895
|
-
newIndex =
|
|
4095
|
+
var onChangeOrder = function onChangeOrder(_ref2) {
|
|
4096
|
+
var oldIndex = _ref2.oldIndex,
|
|
4097
|
+
newIndex = _ref2.newIndex;
|
|
3896
4098
|
if (oldIndex === undefined || newIndex === undefined) {
|
|
3897
4099
|
return;
|
|
3898
4100
|
}
|
|
@@ -3900,10 +4102,11 @@ var useDragOrder = function useDragOrder(trigger, move) {
|
|
|
3900
4102
|
setLastDragOrder([oldIndex, newIndex]);
|
|
3901
4103
|
setActiveDraggingIndex(false);
|
|
3902
4104
|
};
|
|
3903
|
-
var onStartDrag = function onStartDrag(
|
|
3904
|
-
var oldIndex =
|
|
4105
|
+
var onStartDrag = function onStartDrag(_ref3) {
|
|
4106
|
+
var oldIndex = _ref3.oldIndex;
|
|
3905
4107
|
return setActiveDraggingIndex(oldIndex);
|
|
3906
4108
|
};
|
|
4109
|
+
|
|
3907
4110
|
// triggers validation AFTER render of new sorted elements
|
|
3908
4111
|
React.useEffect(function () {
|
|
3909
4112
|
var oldIndex = lastDragOrder[0],
|
|
@@ -3919,6 +4122,7 @@ var useDragOrder = function useDragOrder(trigger, move) {
|
|
|
3919
4122
|
onStartDrag: onStartDrag
|
|
3920
4123
|
};
|
|
3921
4124
|
};
|
|
4125
|
+
|
|
3922
4126
|
// dialog utils
|
|
3923
4127
|
var getConfirmationDialogTitle = function getConfirmationDialogTitle(action, t) {
|
|
3924
4128
|
if (action === 'CLEAR') {
|
|
@@ -3938,6 +4142,7 @@ var getConfirmationDialogTitle = function getConfirmationDialogTitle(action, t)
|
|
|
3938
4142
|
}
|
|
3939
4143
|
return t('confirm-cancel-title');
|
|
3940
4144
|
};
|
|
4145
|
+
|
|
3941
4146
|
// Check if the amended/corrected TAF has been changed. Only compare the fields users are able to fill in
|
|
3942
4147
|
// (i.e. exclude baseforecast valid time as that gets updated when doing an amendment automatically outside of the users influence)
|
|
3943
4148
|
var isTafAmendedCorrectedChanged = function isTafAmendedCorrectedChanged(originalTaf, currentTaf) {
|
|
@@ -4034,10 +4239,12 @@ var getMessageType = function getMessageType(taf, tafAction) {
|
|
|
4034
4239
|
}
|
|
4035
4240
|
return taf.messageType;
|
|
4036
4241
|
};
|
|
4242
|
+
|
|
4037
4243
|
// For corrections and amendment we need to add the previousValidStart and End for the TAC converter
|
|
4038
4244
|
var getAmendedCorrectedTafTimes = function getAmendedCorrectedTafTimes(taf, tafAction) {
|
|
4039
4245
|
var previousValidDateStart = taf.previousValidDateStart && tafAction !== 'AMEND' ? taf.previousValidDateStart : taf.validDateStart;
|
|
4040
4246
|
var previousValidDateEnd = taf.previousValidDateEnd && tafAction !== 'AMEND' ? taf.previousValidDateEnd : taf.validDateEnd;
|
|
4247
|
+
|
|
4041
4248
|
// For amendment change valid start time to current time
|
|
4042
4249
|
// only do this if we're already within the validity period
|
|
4043
4250
|
var now = dateUtils.utc();
|
|
@@ -4233,16 +4440,34 @@ var TafModuleProvider = function TafModuleProvider(_ref3) {
|
|
|
4233
4440
|
var contextState = useTafModuleState({
|
|
4234
4441
|
onPreventCloseView: onPreventCloseView
|
|
4235
4442
|
});
|
|
4236
|
-
return jsx(TafModuleContext.Provider, {
|
|
4443
|
+
return /*#__PURE__*/jsx(TafModuleContext.Provider, {
|
|
4237
4444
|
value: contextState,
|
|
4238
4445
|
children: children
|
|
4239
4446
|
});
|
|
4240
4447
|
};
|
|
4241
4448
|
|
|
4449
|
+
/* *
|
|
4450
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4451
|
+
* you may not use this file except in compliance with the License.
|
|
4452
|
+
* You may obtain a copy of the License at
|
|
4453
|
+
*
|
|
4454
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
4455
|
+
*
|
|
4456
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
4457
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
4458
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4459
|
+
* See the License for the specific language governing permissions and
|
|
4460
|
+
* limitations under the License.
|
|
4461
|
+
*
|
|
4462
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
4463
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
4464
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
4465
|
+
* */
|
|
4466
|
+
|
|
4242
4467
|
var TAF_MODULE_ID = 'tafmodule';
|
|
4243
4468
|
var ResponsiveWrapper = function ResponsiveWrapper(_ref) {
|
|
4244
4469
|
var children = _ref.children;
|
|
4245
|
-
return jsx(Box, {
|
|
4470
|
+
return /*#__PURE__*/jsx(Box, {
|
|
4246
4471
|
sx: {
|
|
4247
4472
|
containerType: 'inline-size',
|
|
4248
4473
|
containerName: TAF_MODULE_ID,
|
|
@@ -4352,7 +4577,7 @@ var BaseTextField = /*#__PURE__*/React.memo(function (_ref2) {
|
|
|
4352
4577
|
props = _objectWithoutPropertiesLoose(_ref2, _excluded$4);
|
|
4353
4578
|
var theme = useTheme();
|
|
4354
4579
|
var styling = textFieldStyle(theme, shouldPreventUppercase);
|
|
4355
|
-
return jsx(TextField, Object.assign({
|
|
4580
|
+
return /*#__PURE__*/jsx(TextField, Object.assign({
|
|
4356
4581
|
"data-text-align": textAlign,
|
|
4357
4582
|
sx: [styling].concat(Array.isArray(sx) ? sx : [sx]),
|
|
4358
4583
|
type: "text",
|
|
@@ -4391,6 +4616,9 @@ var TafFormTextField = function TafFormTextField(_ref3) {
|
|
|
4391
4616
|
maxLength = _React$useState[0],
|
|
4392
4617
|
setMaxLength = _React$useState[1];
|
|
4393
4618
|
var onKeyDown = React.useCallback(function (event) {
|
|
4619
|
+
if (event.ctrlKey || event.altKey || event.metaKey) {
|
|
4620
|
+
return;
|
|
4621
|
+
}
|
|
4394
4622
|
var target = event.target;
|
|
4395
4623
|
var currentValue = target.value,
|
|
4396
4624
|
selectionStart = target.selectionStart,
|
|
@@ -4436,19 +4664,19 @@ var TafFormTextField = function TafFormTextField(_ref3) {
|
|
|
4436
4664
|
onBlur();
|
|
4437
4665
|
}, [onBlur, name, setValue, shouldPreventUppercase]);
|
|
4438
4666
|
var hasError = !!fieldErrors;
|
|
4439
|
-
return jsx(Grid, {
|
|
4667
|
+
return /*#__PURE__*/jsx(Grid, {
|
|
4440
4668
|
sx: {
|
|
4441
4669
|
width: TEXTFIELD_WIDTH_PERCENTAGE + "%",
|
|
4442
4670
|
minWidth: TEXTFIELD_MIN_WIDTH
|
|
4443
4671
|
},
|
|
4444
|
-
children: jsx(Controller, {
|
|
4672
|
+
children: /*#__PURE__*/jsx(Controller, {
|
|
4445
4673
|
control: control,
|
|
4446
4674
|
defaultValue: defaultValue,
|
|
4447
4675
|
name: name,
|
|
4448
4676
|
render: function render(_ref4) {
|
|
4449
4677
|
var field = _ref4.field;
|
|
4450
4678
|
var displayValue = formatter ? formatter(field.value) : getDisplayValue(field.value, disabled);
|
|
4451
|
-
return jsx(BaseTextField, {
|
|
4679
|
+
return /*#__PURE__*/jsx(BaseTextField, {
|
|
4452
4680
|
autoFocus: autoFocus,
|
|
4453
4681
|
disabled: disabled,
|
|
4454
4682
|
error: hasError,
|
|
@@ -4478,6 +4706,23 @@ var TafFormTextField = function TafFormTextField(_ref3) {
|
|
|
4478
4706
|
});
|
|
4479
4707
|
};
|
|
4480
4708
|
|
|
4709
|
+
/* *
|
|
4710
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4711
|
+
* you may not use this file except in compliance with the License.
|
|
4712
|
+
* You may obtain a copy of the License at
|
|
4713
|
+
*
|
|
4714
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
4715
|
+
*
|
|
4716
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
4717
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
4718
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4719
|
+
* See the License for the specific language governing permissions and
|
|
4720
|
+
* limitations under the License.
|
|
4721
|
+
*
|
|
4722
|
+
* Copyright 2026 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
4723
|
+
* Copyright 2026 - Finnish Meteorological Institute (FMI)
|
|
4724
|
+
* Copyright 2026 - The Norwegian Meteorological Institute (MET Norway)
|
|
4725
|
+
* */
|
|
4481
4726
|
var TafRemarkField = function TafRemarkField(_ref) {
|
|
4482
4727
|
var disabled = _ref.disabled,
|
|
4483
4728
|
isEditor = _ref.isEditor;
|
|
@@ -4487,7 +4732,7 @@ var TafRemarkField = function TafRemarkField(_ref) {
|
|
|
4487
4732
|
control = _useFormContext.control,
|
|
4488
4733
|
setValue = _useFormContext.setValue,
|
|
4489
4734
|
trigger = _useFormContext.trigger;
|
|
4490
|
-
return jsx(Box, {
|
|
4735
|
+
return /*#__PURE__*/jsx(Box, {
|
|
4491
4736
|
sx: {
|
|
4492
4737
|
display: 'flex',
|
|
4493
4738
|
flexDirection: 'row',
|
|
@@ -4503,12 +4748,12 @@ var TafRemarkField = function TafRemarkField(_ref) {
|
|
|
4503
4748
|
lg: '10px'
|
|
4504
4749
|
}
|
|
4505
4750
|
},
|
|
4506
|
-
children: jsx(Controller, {
|
|
4751
|
+
children: /*#__PURE__*/jsx(Controller, {
|
|
4507
4752
|
control: control,
|
|
4508
4753
|
name: "remark",
|
|
4509
4754
|
render: function render(_ref2) {
|
|
4510
4755
|
var field = _ref2.field;
|
|
4511
|
-
return jsx(BaseTextField, {
|
|
4756
|
+
return /*#__PURE__*/jsx(BaseTextField, {
|
|
4512
4757
|
disabled: disabled,
|
|
4513
4758
|
inputRef: field.ref,
|
|
4514
4759
|
label: t('remark'),
|
|
@@ -4521,7 +4766,7 @@ var TafRemarkField = function TafRemarkField(_ref) {
|
|
|
4521
4766
|
field.onChange(event.currentTarget.value.toUpperCase());
|
|
4522
4767
|
},
|
|
4523
4768
|
onKeyDown: function onKeyDown(event) {
|
|
4524
|
-
if (event.key.toUpperCase() === 'D' && !field.value) {
|
|
4769
|
+
if (event.key.toUpperCase() === 'D' && !field.value && !event.ctrlKey && !event.altKey && !event.metaKey) {
|
|
4525
4770
|
event.preventDefault();
|
|
4526
4771
|
setValue('remark', 'DUE TO LACK OF DATA NO ');
|
|
4527
4772
|
}
|
|
@@ -4567,9 +4812,12 @@ var TafRemarkField = function TafRemarkField(_ref) {
|
|
|
4567
4812
|
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
4568
4813
|
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
4569
4814
|
* */
|
|
4815
|
+
|
|
4816
|
+
|
|
4570
4817
|
// messages
|
|
4571
4818
|
var invalidChangeMessage = 'Invalid Change input, only BECMG, TEMPO or FM are allowed';
|
|
4572
4819
|
var invalidChangeProbCombinationMessage = 'A probability is only allowed in combination with TEMPO or an empty Change input';
|
|
4820
|
+
|
|
4573
4821
|
// validations
|
|
4574
4822
|
var validateChangeField = function validateChangeField(value) {
|
|
4575
4823
|
var trimmedValue = getFieldValue(value);
|
|
@@ -4602,8 +4850,11 @@ var validateChangeFieldInterField = function validateChangeFieldInterField(value
|
|
|
4602
4850
|
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
4603
4851
|
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
4604
4852
|
* */
|
|
4853
|
+
|
|
4854
|
+
|
|
4605
4855
|
// messages
|
|
4606
4856
|
var invalidProbabilityMessage = 'Invalid Probability input, only PROB30 or PROB40 are allowed';
|
|
4857
|
+
|
|
4607
4858
|
// validations
|
|
4608
4859
|
var validateProbabilityField = function validateProbabilityField(value) {
|
|
4609
4860
|
var trimmedValue = getFieldValue(value);
|
|
@@ -4675,7 +4926,7 @@ var TafConfigWrapper = function TafConfigWrapper(_ref) {
|
|
|
4675
4926
|
};
|
|
4676
4927
|
}, [tafConfig]);
|
|
4677
4928
|
if (isLoggedIn && isFetching) {
|
|
4678
|
-
return jsx(LinearProgress, {
|
|
4929
|
+
return /*#__PURE__*/jsx(LinearProgress, {
|
|
4679
4930
|
color: "secondary",
|
|
4680
4931
|
"data-testid": "tafconfig-loading-bar",
|
|
4681
4932
|
sx: {
|
|
@@ -4684,7 +4935,7 @@ var TafConfigWrapper = function TafConfigWrapper(_ref) {
|
|
|
4684
4935
|
});
|
|
4685
4936
|
}
|
|
4686
4937
|
if (errorMessage || !tafConfig) {
|
|
4687
|
-
return jsx(AlertBanner, {
|
|
4938
|
+
return /*#__PURE__*/jsx(AlertBanner, {
|
|
4688
4939
|
actionButtonProps: !errorMessage || (errorMessage == null ? void 0 : errorMessage.title) !== ERROR_AUTH ? {
|
|
4689
4940
|
title: t('error-title-retry'),
|
|
4690
4941
|
onClick: onFetchConfig
|
|
@@ -4695,16 +4946,33 @@ var TafConfigWrapper = function TafConfigWrapper(_ref) {
|
|
|
4695
4946
|
title: errorMessage ? errorMessage.title : ERROR_CONFIG
|
|
4696
4947
|
});
|
|
4697
4948
|
}
|
|
4698
|
-
return jsx(TafConfigContext.Provider, {
|
|
4949
|
+
return /*#__PURE__*/jsx(TafConfigContext.Provider, {
|
|
4699
4950
|
value: contextValue,
|
|
4700
4951
|
children: children
|
|
4701
4952
|
});
|
|
4702
4953
|
};
|
|
4703
4954
|
|
|
4704
|
-
|
|
4705
|
-
|
|
4706
|
-
|
|
4707
|
-
|
|
4955
|
+
/* *
|
|
4956
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4957
|
+
* you may not use this file except in compliance with the License.
|
|
4958
|
+
* You may obtain a copy of the License at
|
|
4959
|
+
*
|
|
4960
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
4961
|
+
*
|
|
4962
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
4963
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
4964
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4965
|
+
* See the License for the specific language governing permissions and
|
|
4966
|
+
* limitations under the License.
|
|
4967
|
+
*
|
|
4968
|
+
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
4969
|
+
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
4970
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
4971
|
+
* */
|
|
4972
|
+
var TafFormOptionsButton = function TafFormOptionsButton(_ref) {
|
|
4973
|
+
var isChangeGroup = _ref.isChangeGroup,
|
|
4974
|
+
addChangeGroupBelow = _ref.addChangeGroupBelow,
|
|
4975
|
+
addChangeGroupAbove = _ref.addChangeGroupAbove,
|
|
4708
4976
|
removeChangeGroup = _ref.removeChangeGroup,
|
|
4709
4977
|
clearRow = _ref.clearRow,
|
|
4710
4978
|
index = _ref.index;
|
|
@@ -4712,27 +4980,27 @@ var TafFormOptionsButton = function TafFormOptionsButton(_ref) {
|
|
|
4712
4980
|
t = _useTafTranslation.t;
|
|
4713
4981
|
var insertAbove = {
|
|
4714
4982
|
text: t('options-insert-above'),
|
|
4715
|
-
icon: jsx(Add, {}),
|
|
4983
|
+
icon: /*#__PURE__*/jsx(Add, {}),
|
|
4716
4984
|
action: addChangeGroupAbove
|
|
4717
4985
|
};
|
|
4718
4986
|
var insertBelow = {
|
|
4719
4987
|
text: t('options-insert-below'),
|
|
4720
|
-
icon: jsx(Add, {}),
|
|
4988
|
+
icon: /*#__PURE__*/jsx(Add, {}),
|
|
4721
4989
|
action: addChangeGroupBelow
|
|
4722
4990
|
};
|
|
4723
4991
|
var deleteRow = {
|
|
4724
4992
|
text: t('options-delete'),
|
|
4725
|
-
icon: jsx(Delete, {}),
|
|
4993
|
+
icon: /*#__PURE__*/jsx(Delete, {}),
|
|
4726
4994
|
action: removeChangeGroup
|
|
4727
4995
|
};
|
|
4728
4996
|
var clear = {
|
|
4729
4997
|
text: t('options-clear'),
|
|
4730
|
-
icon: jsx(Close, {}),
|
|
4998
|
+
icon: /*#__PURE__*/jsx(Close, {}),
|
|
4731
4999
|
action: clearRow
|
|
4732
5000
|
};
|
|
4733
5001
|
var menuItemsBaseForecast = [insertBelow, clear];
|
|
4734
5002
|
var menuItemsChangeGroup = [insertAbove, insertBelow, deleteRow, clear];
|
|
4735
|
-
return jsx(ToggleMenu, {
|
|
5003
|
+
return /*#__PURE__*/jsx(ToggleMenu, {
|
|
4736
5004
|
buttonSx: {
|
|
4737
5005
|
marginTop: '10px',
|
|
4738
5006
|
marginLeft: '4px'
|
|
@@ -4784,6 +5052,7 @@ var TafFormRow = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
4784
5052
|
trigger = _useFormContext.trigger;
|
|
4785
5053
|
var _useTafConfigContext = useTafConfigContext(),
|
|
4786
5054
|
tafConfig = _useTafConfigContext.tafConfig;
|
|
5055
|
+
|
|
4787
5056
|
// cross-field required validation
|
|
4788
5057
|
var _getRequiredCrossFiel = getRequiredCrossFields(fieldNames),
|
|
4789
5058
|
mainFields = _getRequiredCrossFiel[0],
|
|
@@ -4794,24 +5063,29 @@ var TafFormRow = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
4794
5063
|
return !!field;
|
|
4795
5064
|
});
|
|
4796
5065
|
};
|
|
5066
|
+
|
|
4797
5067
|
// Used to validate the required field for change groups: Valid
|
|
4798
5068
|
var validateRequiredMain = function validateRequiredMain(value) {
|
|
4799
5069
|
return isNotRequiredForAction(value) !== true && isChangeGroup && !value.length && (hasFieldsValue(subFields) || hasFieldsValue(mainFields) || hasFieldsValue(mainOptionalFields)) ? 'Valid is required' : true;
|
|
4800
5070
|
};
|
|
5071
|
+
|
|
4801
5072
|
// Used to ensure either probability or change is entered, or both
|
|
4802
5073
|
var validateRequiredMainOptional = function validateRequiredMainOptional(value) {
|
|
4803
5074
|
return isNotRequiredForAction(value) !== true && isChangeGroup && (hasFieldsValue(mainFields) || hasFieldsValue(subFields)) && !hasFieldsValue(mainOptionalFields) ? 'Probability or change is required' : true;
|
|
4804
5075
|
};
|
|
5076
|
+
|
|
4805
5077
|
// Used to ensure one wind, visibility, weather or cloud is entered when start editing a changegroup and all of these are empty
|
|
4806
5078
|
var validateRequiredSub = function validateRequiredSub(value) {
|
|
4807
5079
|
return isNotRequiredForAction(value) !== true && isChangeGroup && (hasFieldsValue(mainFields) || hasFieldsValue(mainOptionalFields)) && !hasFieldsValue(subFields) ? 'Wind, visibility, weather or cloud is required' : true;
|
|
4808
5080
|
};
|
|
5081
|
+
|
|
4809
5082
|
// Used to validate the combination of change group and wind, visibility, weather and/or cloud data entered
|
|
4810
5083
|
var _validateRequiredMainFields = function validateRequiredMainFields(value, fieldName) {
|
|
4811
5084
|
var changeField = getValues(namePrefix + ".change");
|
|
4812
5085
|
var visibilityField = getValues(namePrefix + ".visibility");
|
|
4813
5086
|
var isFM = (changeField == null ? void 0 : changeField.trim()) === 'FM';
|
|
4814
5087
|
var isCAVOK = (visibilityField == null ? void 0 : visibilityField.trim()) === 'CAVOK';
|
|
5088
|
+
|
|
4815
5089
|
// it is possible to send a empty row when the remark field has "DUE TO LACK OF DATA NO NAF" in it
|
|
4816
5090
|
var remark = getValues('remark');
|
|
4817
5091
|
if ((tafConfig == null ? void 0 : tafConfig.type) === 'NAF' && (remark == null ? void 0 : remark.toUpperCase()) === 'DUE TO LACK OF DATA NO NAF') {
|
|
@@ -4870,8 +5144,8 @@ var TafFormRow = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
4870
5144
|
return true;
|
|
4871
5145
|
}, [index, isChangeGroup, getValues]);
|
|
4872
5146
|
var getPreviousValidFields = function getPreviousValidFields(rowIndex) {
|
|
4873
|
-
var
|
|
4874
|
-
changeGroups =
|
|
5147
|
+
var _ref2 = getValues(),
|
|
5148
|
+
changeGroups = _ref2.changeGroups;
|
|
4875
5149
|
var previousChangeGroups = changeGroups.slice(0, rowIndex);
|
|
4876
5150
|
var validFields = previousChangeGroups.map(function (_element, index) {
|
|
4877
5151
|
return getFieldFromRow('valid', index)[0];
|
|
@@ -4887,7 +5161,7 @@ var TafFormRow = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
4887
5161
|
var clearRow = React.useCallback(function () {
|
|
4888
5162
|
onClearRow(index);
|
|
4889
5163
|
}, [onClearRow, index]);
|
|
4890
|
-
return jsxs(Grid, Object.assign({
|
|
5164
|
+
return /*#__PURE__*/jsxs(Grid, Object.assign({
|
|
4891
5165
|
container: true,
|
|
4892
5166
|
"data-testid": "row-" + namePrefix,
|
|
4893
5167
|
ref: ref
|
|
@@ -4913,30 +5187,30 @@ var TafFormRow = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
4913
5187
|
opacity: 0.5
|
|
4914
5188
|
}
|
|
4915
5189
|
}].concat(Array.isArray(props.sx) ? props.sx : [props.sx]),
|
|
4916
|
-
children: [jsxs(Grid, {
|
|
5190
|
+
children: [/*#__PURE__*/jsxs(Grid, {
|
|
4917
5191
|
container: true,
|
|
4918
5192
|
size: "grow",
|
|
4919
5193
|
sx: {
|
|
4920
5194
|
justifyContent: 'flex-end'
|
|
4921
5195
|
},
|
|
4922
|
-
children: [!isChangeGroup && jsxs(Fragment, {
|
|
4923
|
-
children: [jsx(TafFormTextField, {
|
|
5196
|
+
children: [!isChangeGroup && /*#__PURE__*/jsxs(Fragment, {
|
|
5197
|
+
children: [/*#__PURE__*/jsx(TafFormTextField, {
|
|
4924
5198
|
disabled: true,
|
|
4925
5199
|
label: "Type",
|
|
4926
5200
|
name: fieldNames.messageType
|
|
4927
|
-
}), jsx(TafFormTextField, {
|
|
5201
|
+
}), /*#__PURE__*/jsx(TafFormTextField, {
|
|
4928
5202
|
disabled: true,
|
|
4929
5203
|
label: "Location",
|
|
4930
5204
|
name: "location"
|
|
4931
|
-
}), jsx(TafFormTextField, {
|
|
5205
|
+
}), /*#__PURE__*/jsx(TafFormTextField, {
|
|
4932
5206
|
disabled: true,
|
|
4933
5207
|
formatter: formatIssueTime,
|
|
4934
5208
|
label: "Issue time",
|
|
4935
5209
|
name: "issueDate",
|
|
4936
5210
|
shouldPreventUppercase: true
|
|
4937
5211
|
})]
|
|
4938
|
-
}), isChangeGroup ? jsxs(Fragment, {
|
|
4939
|
-
children: [jsx(Box, {
|
|
5212
|
+
}), isChangeGroup ? /*#__PURE__*/jsxs(Fragment, {
|
|
5213
|
+
children: [/*#__PURE__*/jsx(Box, {
|
|
4940
5214
|
sx: {
|
|
4941
5215
|
display: 'flex',
|
|
4942
5216
|
justifyContent: 'center',
|
|
@@ -4944,7 +5218,7 @@ var TafFormRow = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
4944
5218
|
minWidth: 60
|
|
4945
5219
|
},
|
|
4946
5220
|
children: !disabled && dragHandle
|
|
4947
|
-
}), jsx(TafFormTextField, {
|
|
5221
|
+
}), /*#__PURE__*/jsx(TafFormTextField, {
|
|
4948
5222
|
autoComplete: [{
|
|
4949
5223
|
key: '3',
|
|
4950
5224
|
value: 'PROB30'
|
|
@@ -4968,7 +5242,7 @@ var TafFormRow = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
4968
5242
|
validateProbabilityField: validateProbabilityField
|
|
4969
5243
|
}
|
|
4970
5244
|
}
|
|
4971
|
-
}), jsx(TafFormTextField, {
|
|
5245
|
+
}), /*#__PURE__*/jsx(TafFormTextField, {
|
|
4972
5246
|
autoComplete: [{
|
|
4973
5247
|
key: 'T',
|
|
4974
5248
|
value: 'TEMPO'
|
|
@@ -5000,9 +5274,10 @@ var TafFormRow = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
5000
5274
|
}
|
|
5001
5275
|
}
|
|
5002
5276
|
})]
|
|
5003
|
-
}) : null, jsx(TafFormTextField, {
|
|
5004
|
-
defaultValue: getDefaultValue('valid', field)
|
|
5277
|
+
}) : null, /*#__PURE__*/jsx(TafFormTextField, {
|
|
5278
|
+
defaultValue: getDefaultValue('valid', field)
|
|
5005
5279
|
// always disabled for baseforecast row
|
|
5280
|
+
,
|
|
5006
5281
|
disabled: !isChangeGroup ? true : disabled,
|
|
5007
5282
|
label: "Valid",
|
|
5008
5283
|
name: fieldNames.valid,
|
|
@@ -5026,7 +5301,7 @@ var TafFormRow = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
5026
5301
|
validateNextRows: validateNextRows
|
|
5027
5302
|
}
|
|
5028
5303
|
}
|
|
5029
|
-
}), jsx(TafFormTextField, {
|
|
5304
|
+
}), /*#__PURE__*/jsx(TafFormTextField, {
|
|
5030
5305
|
autoFocus: !isChangeGroup,
|
|
5031
5306
|
defaultValue: getDefaultValue('wind', field),
|
|
5032
5307
|
disabled: disabled,
|
|
@@ -5048,7 +5323,7 @@ var TafFormRow = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
5048
5323
|
}
|
|
5049
5324
|
}
|
|
5050
5325
|
}
|
|
5051
|
-
}), jsx(TafFormTextField, {
|
|
5326
|
+
}), /*#__PURE__*/jsx(TafFormTextField, {
|
|
5052
5327
|
autoComplete: [{
|
|
5053
5328
|
key: 'C',
|
|
5054
5329
|
value: 'CAVOK'
|
|
@@ -5070,30 +5345,24 @@ var TafFormRow = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
5070
5345
|
validateVisibilityField: validateVisibilityField
|
|
5071
5346
|
}
|
|
5072
5347
|
}
|
|
5073
|
-
}), jsx(TafFormTextField, {
|
|
5348
|
+
}), /*#__PURE__*/jsx(TafFormTextField, {
|
|
5074
5349
|
defaultValue: getDefaultValue('weather.weather1', field),
|
|
5075
5350
|
disabled: disabled,
|
|
5076
5351
|
label: "Weather",
|
|
5077
5352
|
name: fieldNames.weather1,
|
|
5078
|
-
onBlur: function () {
|
|
5079
|
-
var
|
|
5080
|
-
|
|
5081
|
-
|
|
5082
|
-
|
|
5083
|
-
|
|
5084
|
-
|
|
5085
|
-
|
|
5086
|
-
|
|
5087
|
-
|
|
5088
|
-
|
|
5089
|
-
|
|
5090
|
-
|
|
5091
|
-
}));
|
|
5092
|
-
function onBlur() {
|
|
5093
|
-
return _onBlur.apply(this, arguments);
|
|
5094
|
-
}
|
|
5095
|
-
return onBlur;
|
|
5096
|
-
}(),
|
|
5353
|
+
onBlur: /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
5354
|
+
var fields;
|
|
5355
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
5356
|
+
while (1) switch (_context.prev = _context.next) {
|
|
5357
|
+
case 0:
|
|
5358
|
+
fields = isChangeGroup ? [].concat(subFields, mainFields) : [];
|
|
5359
|
+
return _context.abrupt("return", trigger([].concat(fields, [fieldNames.weather2, fieldNames.weather3, fieldNames.wind, fieldNames.cloud1])));
|
|
5360
|
+
case 2:
|
|
5361
|
+
case "end":
|
|
5362
|
+
return _context.stop();
|
|
5363
|
+
}
|
|
5364
|
+
}, _callee);
|
|
5365
|
+
})),
|
|
5097
5366
|
rules: {
|
|
5098
5367
|
validate: {
|
|
5099
5368
|
validateRequiredMainFields: function validateRequiredMainFields(value) {
|
|
@@ -5105,30 +5374,24 @@ var TafFormRow = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
5105
5374
|
}
|
|
5106
5375
|
}
|
|
5107
5376
|
}
|
|
5108
|
-
}), jsx(TafFormTextField, {
|
|
5377
|
+
}), /*#__PURE__*/jsx(TafFormTextField, {
|
|
5109
5378
|
defaultValue: getDefaultValue('weather.weather2', field),
|
|
5110
5379
|
disabled: disabled,
|
|
5111
5380
|
label: "Weather",
|
|
5112
5381
|
name: fieldNames.weather2,
|
|
5113
|
-
onBlur: function () {
|
|
5114
|
-
var
|
|
5115
|
-
|
|
5116
|
-
|
|
5117
|
-
|
|
5118
|
-
|
|
5119
|
-
|
|
5120
|
-
|
|
5121
|
-
|
|
5122
|
-
|
|
5123
|
-
|
|
5124
|
-
|
|
5125
|
-
|
|
5126
|
-
}));
|
|
5127
|
-
function onBlur() {
|
|
5128
|
-
return _onBlur2.apply(this, arguments);
|
|
5129
|
-
}
|
|
5130
|
-
return onBlur;
|
|
5131
|
-
}(),
|
|
5382
|
+
onBlur: /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
5383
|
+
var fields;
|
|
5384
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
5385
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
5386
|
+
case 0:
|
|
5387
|
+
fields = isChangeGroup ? [].concat(subFields, mainFields) : [];
|
|
5388
|
+
return _context2.abrupt("return", trigger([].concat(fields, [fieldNames.weather3, fieldNames.wind, fieldNames.cloud1])));
|
|
5389
|
+
case 2:
|
|
5390
|
+
case "end":
|
|
5391
|
+
return _context2.stop();
|
|
5392
|
+
}
|
|
5393
|
+
}, _callee2);
|
|
5394
|
+
})),
|
|
5132
5395
|
rules: {
|
|
5133
5396
|
validate: {
|
|
5134
5397
|
validateSecondWeatherField: function validateSecondWeatherField$1(value) {
|
|
@@ -5136,28 +5399,22 @@ var TafFormRow = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
5136
5399
|
}
|
|
5137
5400
|
}
|
|
5138
5401
|
}
|
|
5139
|
-
}), jsx(TafFormTextField, {
|
|
5402
|
+
}), /*#__PURE__*/jsx(TafFormTextField, {
|
|
5140
5403
|
defaultValue: getDefaultValue('weather.weather3', field),
|
|
5141
5404
|
disabled: disabled,
|
|
5142
5405
|
label: "Weather",
|
|
5143
5406
|
name: fieldNames.weather3,
|
|
5144
|
-
onBlur: function () {
|
|
5145
|
-
|
|
5146
|
-
|
|
5147
|
-
|
|
5148
|
-
|
|
5149
|
-
|
|
5150
|
-
|
|
5151
|
-
|
|
5152
|
-
|
|
5153
|
-
|
|
5154
|
-
|
|
5155
|
-
}));
|
|
5156
|
-
function onBlur() {
|
|
5157
|
-
return _onBlur3.apply(this, arguments);
|
|
5158
|
-
}
|
|
5159
|
-
return onBlur;
|
|
5160
|
-
}(),
|
|
5407
|
+
onBlur: /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
5408
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
5409
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
5410
|
+
case 0:
|
|
5411
|
+
return _context3.abrupt("return", trigger([fieldNames.wind, fieldNames.cloud1]));
|
|
5412
|
+
case 1:
|
|
5413
|
+
case "end":
|
|
5414
|
+
return _context3.stop();
|
|
5415
|
+
}
|
|
5416
|
+
}, _callee3);
|
|
5417
|
+
})),
|
|
5161
5418
|
rules: {
|
|
5162
5419
|
validate: {
|
|
5163
5420
|
validateThirdWeatherField: function validateThirdWeatherField$1(value) {
|
|
@@ -5165,30 +5422,24 @@ var TafFormRow = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
5165
5422
|
}
|
|
5166
5423
|
}
|
|
5167
5424
|
}
|
|
5168
|
-
}), jsx(TafFormTextField, {
|
|
5425
|
+
}), /*#__PURE__*/jsx(TafFormTextField, {
|
|
5169
5426
|
defaultValue: getDefaultValue('cloud.cloud1', field),
|
|
5170
5427
|
disabled: disabled,
|
|
5171
5428
|
label: "Cloud",
|
|
5172
5429
|
name: fieldNames.cloud1,
|
|
5173
|
-
onBlur: function () {
|
|
5174
|
-
var
|
|
5175
|
-
|
|
5176
|
-
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
|
|
5180
|
-
|
|
5181
|
-
|
|
5182
|
-
|
|
5183
|
-
|
|
5184
|
-
|
|
5185
|
-
|
|
5186
|
-
}));
|
|
5187
|
-
function onBlur() {
|
|
5188
|
-
return _onBlur4.apply(this, arguments);
|
|
5189
|
-
}
|
|
5190
|
-
return onBlur;
|
|
5191
|
-
}(),
|
|
5430
|
+
onBlur: /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
5431
|
+
var fields;
|
|
5432
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
5433
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
5434
|
+
case 0:
|
|
5435
|
+
fields = isChangeGroup ? [].concat(subFields, mainFields) : [];
|
|
5436
|
+
return _context4.abrupt("return", trigger([].concat(fields, [fieldNames.cloud2, fieldNames.cloud3, fieldNames.cloud4])));
|
|
5437
|
+
case 2:
|
|
5438
|
+
case "end":
|
|
5439
|
+
return _context4.stop();
|
|
5440
|
+
}
|
|
5441
|
+
}, _callee4);
|
|
5442
|
+
})),
|
|
5192
5443
|
rules: {
|
|
5193
5444
|
validate: {
|
|
5194
5445
|
validateRequiredMainFields: function validateRequiredMainFields(value) {
|
|
@@ -5200,28 +5451,22 @@ var TafFormRow = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
5200
5451
|
}
|
|
5201
5452
|
}
|
|
5202
5453
|
}
|
|
5203
|
-
}), jsx(TafFormTextField, {
|
|
5454
|
+
}), /*#__PURE__*/jsx(TafFormTextField, {
|
|
5204
5455
|
defaultValue: getDefaultValue('cloud.cloud2', field),
|
|
5205
5456
|
disabled: disabled,
|
|
5206
5457
|
label: "Cloud",
|
|
5207
5458
|
name: fieldNames.cloud2,
|
|
5208
|
-
onBlur: function () {
|
|
5209
|
-
|
|
5210
|
-
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
|
|
5215
|
-
|
|
5216
|
-
|
|
5217
|
-
|
|
5218
|
-
|
|
5219
|
-
}));
|
|
5220
|
-
function onBlur() {
|
|
5221
|
-
return _onBlur5.apply(this, arguments);
|
|
5222
|
-
}
|
|
5223
|
-
return onBlur;
|
|
5224
|
-
}(),
|
|
5459
|
+
onBlur: /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
5460
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
5461
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
5462
|
+
case 0:
|
|
5463
|
+
return _context5.abrupt("return", trigger([fieldNames.cloud3, fieldNames.cloud4]));
|
|
5464
|
+
case 1:
|
|
5465
|
+
case "end":
|
|
5466
|
+
return _context5.stop();
|
|
5467
|
+
}
|
|
5468
|
+
}, _callee5);
|
|
5469
|
+
})),
|
|
5225
5470
|
rules: {
|
|
5226
5471
|
validate: {
|
|
5227
5472
|
validateSecondCloud: function validateSecondCloud$1(value) {
|
|
@@ -5229,28 +5474,22 @@ var TafFormRow = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
5229
5474
|
}
|
|
5230
5475
|
}
|
|
5231
5476
|
}
|
|
5232
|
-
}), jsx(TafFormTextField, {
|
|
5477
|
+
}), /*#__PURE__*/jsx(TafFormTextField, {
|
|
5233
5478
|
defaultValue: getDefaultValue('cloud.cloud3', field),
|
|
5234
5479
|
disabled: disabled,
|
|
5235
5480
|
label: "Cloud",
|
|
5236
5481
|
name: fieldNames.cloud3,
|
|
5237
|
-
onBlur: function () {
|
|
5238
|
-
|
|
5239
|
-
|
|
5240
|
-
|
|
5241
|
-
|
|
5242
|
-
|
|
5243
|
-
|
|
5244
|
-
|
|
5245
|
-
|
|
5246
|
-
|
|
5247
|
-
|
|
5248
|
-
}));
|
|
5249
|
-
function onBlur() {
|
|
5250
|
-
return _onBlur6.apply(this, arguments);
|
|
5251
|
-
}
|
|
5252
|
-
return onBlur;
|
|
5253
|
-
}(),
|
|
5482
|
+
onBlur: /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
5483
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
5484
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
5485
|
+
case 0:
|
|
5486
|
+
return _context6.abrupt("return", trigger(fieldNames.cloud4));
|
|
5487
|
+
case 1:
|
|
5488
|
+
case "end":
|
|
5489
|
+
return _context6.stop();
|
|
5490
|
+
}
|
|
5491
|
+
}, _callee6);
|
|
5492
|
+
})),
|
|
5254
5493
|
rules: {
|
|
5255
5494
|
validate: {
|
|
5256
5495
|
validateThirdCloud: function validateThirdCloud$1(value) {
|
|
@@ -5258,7 +5497,7 @@ var TafFormRow = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
5258
5497
|
}
|
|
5259
5498
|
}
|
|
5260
5499
|
}
|
|
5261
|
-
}), jsx(TafFormTextField, {
|
|
5500
|
+
}), /*#__PURE__*/jsx(TafFormTextField, {
|
|
5262
5501
|
defaultValue: getDefaultValue('cloud.cloud4', field),
|
|
5263
5502
|
disabled: disabled,
|
|
5264
5503
|
label: "Cloud",
|
|
@@ -5271,7 +5510,7 @@ var TafFormRow = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
5271
5510
|
}
|
|
5272
5511
|
}
|
|
5273
5512
|
})]
|
|
5274
|
-
}), !disabled && jsx(Grid, {
|
|
5513
|
+
}), !disabled && /*#__PURE__*/jsx(Grid, {
|
|
5275
5514
|
container: true,
|
|
5276
5515
|
sx: {
|
|
5277
5516
|
justifyContent: 'flex-end',
|
|
@@ -5280,7 +5519,7 @@ var TafFormRow = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
5280
5519
|
marginBottom: '14px',
|
|
5281
5520
|
minWidth: 28
|
|
5282
5521
|
},
|
|
5283
|
-
children: jsx(TafFormOptionsButton, {
|
|
5522
|
+
children: /*#__PURE__*/jsx(TafFormOptionsButton, {
|
|
5284
5523
|
addChangeGroupAbove: addChangeGroupAbove,
|
|
5285
5524
|
addChangeGroupBelow: addChangeGroupBelow,
|
|
5286
5525
|
clearRow: clearRow,
|
|
@@ -5294,7 +5533,6 @@ var TafFormRow = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
5294
5533
|
}));
|
|
5295
5534
|
});
|
|
5296
5535
|
|
|
5297
|
-
// prevents default functionality
|
|
5298
5536
|
var noop = function noop() {};
|
|
5299
5537
|
var TafForm = /*#__PURE__*/React.memo(function (_ref) {
|
|
5300
5538
|
var tafFromBackend = _ref.tafFromBackend,
|
|
@@ -5360,11 +5598,12 @@ var TafForm = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
5360
5598
|
_useTafModuleContext$2 = _useTafModuleContext.onPreventCloseView,
|
|
5361
5599
|
onPreventCloseView = _useTafModuleContext$2 === void 0 ? function () {} : _useTafModuleContext$2,
|
|
5362
5600
|
useFieldArrayMethods = _useTafModuleContext.useFieldArrayMethods;
|
|
5363
|
-
var
|
|
5364
|
-
|
|
5365
|
-
|
|
5366
|
-
|
|
5367
|
-
|
|
5601
|
+
var _ref4 = useFieldArrayMethods,
|
|
5602
|
+
fields = _ref4.fields,
|
|
5603
|
+
insert = _ref4.insert,
|
|
5604
|
+
remove = _ref4.remove,
|
|
5605
|
+
move = _ref4.move,
|
|
5606
|
+
replace = _ref4.replace;
|
|
5368
5607
|
var _useFormContext = useFormContext(),
|
|
5369
5608
|
handleSubmit = _useFormContext.handleSubmit,
|
|
5370
5609
|
trigger = _useFormContext.trigger,
|
|
@@ -5379,6 +5618,7 @@ var TafForm = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
5379
5618
|
var errors = formState.errors,
|
|
5380
5619
|
isFormDirty = formState.isDirty;
|
|
5381
5620
|
usePreventBrowserClose(isFormDirty && !isDisabled);
|
|
5621
|
+
|
|
5382
5622
|
// Needed to be able to show a confirmation dialog on closing parent view
|
|
5383
5623
|
React.useEffect(function () {
|
|
5384
5624
|
onPreventCloseView(isFormDirty);
|
|
@@ -5390,7 +5630,7 @@ var TafForm = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
5390
5630
|
console.log('submit:', convertTafValuesToObject(data));
|
|
5391
5631
|
};
|
|
5392
5632
|
var showConfirmDialog = /*#__PURE__*/function () {
|
|
5393
|
-
var
|
|
5633
|
+
var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(action) {
|
|
5394
5634
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
5395
5635
|
while (1) switch (_context3.prev = _context3.next) {
|
|
5396
5636
|
case 0:
|
|
@@ -5410,7 +5650,7 @@ var TafForm = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
5410
5650
|
}, _callee3);
|
|
5411
5651
|
}));
|
|
5412
5652
|
return function showConfirmDialog(_x) {
|
|
5413
|
-
return
|
|
5653
|
+
return _ref5.apply(this, arguments);
|
|
5414
5654
|
};
|
|
5415
5655
|
}();
|
|
5416
5656
|
var resetFormValues = function resetFormValues(formData, keepDirty) {
|
|
@@ -5450,7 +5690,7 @@ var TafForm = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
5450
5690
|
}));
|
|
5451
5691
|
}, [dispatch]);
|
|
5452
5692
|
var setIsEditor = /*#__PURE__*/function () {
|
|
5453
|
-
var
|
|
5693
|
+
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(checked) {
|
|
5454
5694
|
var username, didSucceed;
|
|
5455
5695
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
5456
5696
|
while (1) switch (_context4.prev = _context4.next) {
|
|
@@ -5477,7 +5717,7 @@ var TafForm = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
5477
5717
|
}, _callee4);
|
|
5478
5718
|
}));
|
|
5479
5719
|
return function setIsEditor(_x2) {
|
|
5480
|
-
return
|
|
5720
|
+
return _ref6.apply(this, arguments);
|
|
5481
5721
|
};
|
|
5482
5722
|
}();
|
|
5483
5723
|
var onSwitchMode = function onSwitchMode(event) {
|
|
@@ -5532,7 +5772,7 @@ var TafForm = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
5532
5772
|
case 'PUBLISH':
|
|
5533
5773
|
toggleIsDraft(false);
|
|
5534
5774
|
void handleSubmit(/*#__PURE__*/function () {
|
|
5535
|
-
var
|
|
5775
|
+
var _ref8 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(data) {
|
|
5536
5776
|
var didSucceed;
|
|
5537
5777
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
5538
5778
|
while (1) switch (_context6.prev = _context6.next) {
|
|
@@ -5555,7 +5795,7 @@ var TafForm = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
5555
5795
|
}, _callee6);
|
|
5556
5796
|
}));
|
|
5557
5797
|
return function (_x3) {
|
|
5558
|
-
return
|
|
5798
|
+
return _ref8.apply(this, arguments);
|
|
5559
5799
|
};
|
|
5560
5800
|
}())().then(function () {
|
|
5561
5801
|
var hasFormErrors = Object.keys(errors).length;
|
|
@@ -5614,6 +5854,7 @@ var TafForm = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
5614
5854
|
void trigger(); // trigger all fields validation
|
|
5615
5855
|
});
|
|
5616
5856
|
};
|
|
5857
|
+
|
|
5617
5858
|
// TODO: https://gitlab.com/opengeoweb/opengeoweb/-/issues/726 insert (react-hook-form) does not work well with focus (only last row will get focus), so added this dirty solution. This can be fixed in a better way in react-hook-form v7
|
|
5618
5859
|
var focusFirstInput = function focusFirstInput(rowIndex) {
|
|
5619
5860
|
var selector = rowIndex === -1 ? "[name=\"baseForecast.wind\"]" : "[name=\"changeGroups[" + rowIndex + "].probability\"]";
|
|
@@ -5622,6 +5863,7 @@ var TafForm = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
5622
5863
|
nextRowFirstInput.focus();
|
|
5623
5864
|
}
|
|
5624
5865
|
};
|
|
5866
|
+
|
|
5625
5867
|
// adding rows and validation don't work well combined, with always skipping validation of fields of rows above the one the inserted row. A setTimeout prevents this issue
|
|
5626
5868
|
var setFocusAndValidate = function setFocusAndValidate(rowIndex) {
|
|
5627
5869
|
return setTimeout(function () {
|
|
@@ -5681,9 +5923,10 @@ var TafForm = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
5681
5923
|
setIsDisabled(!isEditor || isDefaultDisabled);
|
|
5682
5924
|
// set validate flag to validate after the values have been set
|
|
5683
5925
|
setShouldValidate(true);
|
|
5926
|
+
|
|
5684
5927
|
// register validate method to use in parent components
|
|
5685
5928
|
var onValidateFormPromise = /*#__PURE__*/function () {
|
|
5686
|
-
var
|
|
5929
|
+
var _ref0 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
5687
5930
|
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
5688
5931
|
while (1) switch (_context8.prev = _context8.next) {
|
|
5689
5932
|
case 0:
|
|
@@ -5706,7 +5949,7 @@ var TafForm = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
5706
5949
|
}, _callee8);
|
|
5707
5950
|
}));
|
|
5708
5951
|
return function onValidateFormPromise() {
|
|
5709
|
-
return
|
|
5952
|
+
return _ref0.apply(this, arguments);
|
|
5710
5953
|
};
|
|
5711
5954
|
}();
|
|
5712
5955
|
if (registerValidateForm) {
|
|
@@ -5746,8 +5989,8 @@ var TafForm = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
5746
5989
|
}
|
|
5747
5990
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
5748
5991
|
}, [shouldValidate, isDisabled]);
|
|
5749
|
-
return jsxs(Fragment, {
|
|
5750
|
-
children: [jsxs(Box, {
|
|
5992
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
5993
|
+
children: [/*#__PURE__*/jsxs(Box, {
|
|
5751
5994
|
sx: {
|
|
5752
5995
|
display: 'flex',
|
|
5753
5996
|
flexDirection: 'row',
|
|
@@ -5762,31 +6005,32 @@ var TafForm = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
5762
6005
|
sm: '8px'
|
|
5763
6006
|
}
|
|
5764
6007
|
},
|
|
5765
|
-
children: [jsx(SwitchButton, {
|
|
6008
|
+
children: [/*#__PURE__*/jsx(SwitchButton, {
|
|
5766
6009
|
checked: isEditor,
|
|
5767
6010
|
onChange: onSwitchMode
|
|
5768
|
-
}), jsx(Box, {
|
|
6011
|
+
}), /*#__PURE__*/jsx(Box, {
|
|
5769
6012
|
sx: {
|
|
5770
6013
|
width: '16px',
|
|
5771
6014
|
marginLeft: 1
|
|
5772
6015
|
},
|
|
5773
|
-
children: !!editor && jsx(TafAvatar, {
|
|
6016
|
+
children: !!editor && /*#__PURE__*/jsx(TafAvatar, {
|
|
5774
6017
|
editor: editor
|
|
5775
6018
|
})
|
|
5776
6019
|
})]
|
|
5777
|
-
}), jsxs("form", {
|
|
6020
|
+
}), /*#__PURE__*/jsxs("form", {
|
|
5778
6021
|
"data-testid": "taf-form",
|
|
5779
6022
|
onSubmit: handleSubmit(onSubmit),
|
|
5780
6023
|
ref: formRef,
|
|
5781
|
-
children: [jsx(TafFormRow, {
|
|
6024
|
+
children: [/*#__PURE__*/jsx(TafFormRow, {
|
|
5782
6025
|
disabled: isDisabled,
|
|
5783
6026
|
isNotRequiredForAction: isNotRequiredForAction,
|
|
5784
6027
|
onAddChangeGroupBelow: onAddRow,
|
|
5785
6028
|
onClearRow: _onClearRow
|
|
5786
|
-
}), jsx(ReactSortable, {
|
|
6029
|
+
}), /*#__PURE__*/jsx(ReactSortable, {
|
|
5787
6030
|
animation: 200,
|
|
5788
|
-
direction: "vertical"
|
|
6031
|
+
direction: "vertical"
|
|
5789
6032
|
// hover props
|
|
6033
|
+
,
|
|
5790
6034
|
forceFallback: false,
|
|
5791
6035
|
handle: ".handle",
|
|
5792
6036
|
list: fields,
|
|
@@ -5797,12 +6041,13 @@ var TafForm = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
5797
6041
|
Sortable.ghost.style.opacity = '1';
|
|
5798
6042
|
}
|
|
5799
6043
|
},
|
|
5800
|
-
setList: noop
|
|
6044
|
+
setList: noop // we don't use this function because we order with our own methods
|
|
6045
|
+
,
|
|
5801
6046
|
tag: "div",
|
|
5802
6047
|
children: fields.map(function (item, index) {
|
|
5803
|
-
return jsx(TafFormRow, {
|
|
6048
|
+
return /*#__PURE__*/jsx(TafFormRow, {
|
|
5804
6049
|
disabled: isDisabled,
|
|
5805
|
-
dragHandle: jsx(DragHandle, {
|
|
6050
|
+
dragHandle: /*#__PURE__*/jsx(DragHandle, {
|
|
5806
6051
|
index: index,
|
|
5807
6052
|
isDisabled: fields.length === 1 || isDisabled,
|
|
5808
6053
|
isSorting: activeDraggingIndex === index
|
|
@@ -5821,10 +6066,10 @@ var TafForm = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
5821
6066
|
onRemoveChangeGroup: onRemoverow
|
|
5822
6067
|
}, item.id);
|
|
5823
6068
|
})
|
|
5824
|
-
}), shouldEnableRemark ? jsx(TafRemarkField, {
|
|
6069
|
+
}), shouldEnableRemark ? /*#__PURE__*/jsx(TafRemarkField, {
|
|
5825
6070
|
disabled: isDisabled,
|
|
5826
6071
|
isEditor: isEditor
|
|
5827
|
-
}) : null, !isDisabled && isEditor ? jsx(Grid, {
|
|
6072
|
+
}) : null, !isDisabled && isEditor ? /*#__PURE__*/jsx(Grid, {
|
|
5828
6073
|
container: true,
|
|
5829
6074
|
sx: {
|
|
5830
6075
|
justifyContent: 'space-between',
|
|
@@ -5832,21 +6077,21 @@ var TafForm = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
5832
6077
|
marginLeft: 1.5,
|
|
5833
6078
|
marginTop: 1
|
|
5834
6079
|
},
|
|
5835
|
-
children: jsx(Grid, {
|
|
5836
|
-
children: jsx(IssuesButton, {
|
|
6080
|
+
children: /*#__PURE__*/jsx(Grid, {
|
|
6081
|
+
children: /*#__PURE__*/jsx(IssuesButton, {
|
|
5837
6082
|
errors: errors,
|
|
5838
6083
|
isIssuesPaneOpen: isIssuesPaneOpen,
|
|
5839
6084
|
setIsIssuesPaneOpen: setIsIssuesPaneOpen
|
|
5840
6085
|
})
|
|
5841
6086
|
})
|
|
5842
|
-
}) : null, isEditor ? jsx(TafFormButtons, {
|
|
6087
|
+
}) : null, isEditor ? /*#__PURE__*/jsx(TafFormButtons, {
|
|
5843
6088
|
canBe: tafFromBackend.canbe,
|
|
5844
6089
|
isFormDisabled: isDisabled,
|
|
5845
6090
|
onTafEditModeButtonPress: onTafEditModeButtonPress,
|
|
5846
6091
|
onTafViewModeButtonPress: onTafViewModeButtonPress,
|
|
5847
6092
|
tafAction: tafAction
|
|
5848
6093
|
}) : null, hiddenInputFields.map(function (field) {
|
|
5849
|
-
return jsx(ReactHookFormHiddenInput, {
|
|
6094
|
+
return /*#__PURE__*/jsx(ReactHookFormHiddenInput, {
|
|
5850
6095
|
"data-testid": field,
|
|
5851
6096
|
name: field
|
|
5852
6097
|
}, field);
|
|
@@ -5860,14 +6105,31 @@ var TafForm = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
5860
6105
|
prevProps.tafFromBackend.editor === nextProps.tafFromBackend.editor;
|
|
5861
6106
|
});
|
|
5862
6107
|
|
|
6108
|
+
/* *
|
|
6109
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6110
|
+
* you may not use this file except in compliance with the License.
|
|
6111
|
+
* You may obtain a copy of the License at
|
|
6112
|
+
*
|
|
6113
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
6114
|
+
*
|
|
6115
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
6116
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
6117
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6118
|
+
* See the License for the specific language governing permissions and
|
|
6119
|
+
* limitations under the License.
|
|
6120
|
+
*
|
|
6121
|
+
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6122
|
+
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
6123
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
6124
|
+
* */
|
|
5863
6125
|
var IconWithTooltip = function IconWithTooltip(_ref) {
|
|
5864
6126
|
var title = _ref.title,
|
|
5865
6127
|
children = _ref.children;
|
|
5866
|
-
return jsx(CustomTooltip, {
|
|
6128
|
+
return /*#__PURE__*/jsx(CustomTooltip, {
|
|
5867
6129
|
"data-testid": "statusIcon-tooltip",
|
|
5868
6130
|
placement: "right",
|
|
5869
6131
|
title: title,
|
|
5870
|
-
children: jsx(Box, {
|
|
6132
|
+
children: /*#__PURE__*/jsx(Box, {
|
|
5871
6133
|
component: "span",
|
|
5872
6134
|
children: children
|
|
5873
6135
|
})
|
|
@@ -5882,9 +6144,9 @@ var StatusIcon = function StatusIcon(_ref2) {
|
|
|
5882
6144
|
case 'DRAFT':
|
|
5883
6145
|
case 'DRAFT_AMENDED':
|
|
5884
6146
|
case 'DRAFT_CORRECTED':
|
|
5885
|
-
return jsx(IconWithTooltip, {
|
|
6147
|
+
return /*#__PURE__*/jsx(IconWithTooltip, {
|
|
5886
6148
|
title: getTafStatusLabel(t, status),
|
|
5887
|
-
children: jsx(Edit, {
|
|
6149
|
+
children: /*#__PURE__*/jsx(Edit, {
|
|
5888
6150
|
"data-testid": "status-draft",
|
|
5889
6151
|
sx: {
|
|
5890
6152
|
color: 'geowebColors.buttons.tertiary.default.color'
|
|
@@ -5894,14 +6156,14 @@ var StatusIcon = function StatusIcon(_ref2) {
|
|
|
5894
6156
|
case 'PUBLISHED':
|
|
5895
6157
|
case 'CORRECTED':
|
|
5896
6158
|
case 'AMENDED':
|
|
5897
|
-
return jsx(IconWithTooltip, {
|
|
6159
|
+
return /*#__PURE__*/jsx(IconWithTooltip, {
|
|
5898
6160
|
title: getTafStatusLabel(t, status),
|
|
5899
|
-
children: timeSlot === 'ACTIVE' ? jsx(Success, {
|
|
6161
|
+
children: timeSlot === 'ACTIVE' ? /*#__PURE__*/jsx(Success, {
|
|
5900
6162
|
"data-testid": "status-active",
|
|
5901
6163
|
sx: {
|
|
5902
6164
|
color: 'geowebColors.functional.success'
|
|
5903
6165
|
}
|
|
5904
|
-
}) : jsx(Clock, {
|
|
6166
|
+
}) : /*#__PURE__*/jsx(Clock, {
|
|
5905
6167
|
"data-testid": "status-upcoming",
|
|
5906
6168
|
sx: {
|
|
5907
6169
|
color: 'geowebColors.functional.success'
|
|
@@ -5909,9 +6171,9 @@ var StatusIcon = function StatusIcon(_ref2) {
|
|
|
5909
6171
|
})
|
|
5910
6172
|
});
|
|
5911
6173
|
case 'CANCELLED':
|
|
5912
|
-
return jsx(IconWithTooltip, {
|
|
6174
|
+
return /*#__PURE__*/jsx(IconWithTooltip, {
|
|
5913
6175
|
title: getTafStatusLabel(t, status),
|
|
5914
|
-
children: jsx(Cancel, {
|
|
6176
|
+
children: /*#__PURE__*/jsx(Cancel, {
|
|
5915
6177
|
"data-testid": "status-cancelled",
|
|
5916
6178
|
sx: {
|
|
5917
6179
|
color: 'geowebColors.captions.captionError.rgba'
|
|
@@ -5919,9 +6181,9 @@ var StatusIcon = function StatusIcon(_ref2) {
|
|
|
5919
6181
|
})
|
|
5920
6182
|
});
|
|
5921
6183
|
case 'EXPIRED':
|
|
5922
|
-
return jsx(IconWithTooltip, {
|
|
6184
|
+
return /*#__PURE__*/jsx(IconWithTooltip, {
|
|
5923
6185
|
title: getTafStatusLabel(t, status),
|
|
5924
|
-
children: jsx(Clock, {
|
|
6186
|
+
children: /*#__PURE__*/jsx(Clock, {
|
|
5925
6187
|
"data-testid": "status-expired",
|
|
5926
6188
|
sx: {
|
|
5927
6189
|
transform: 'scaleX(-1)',
|
|
@@ -5935,6 +6197,23 @@ var StatusIcon = function StatusIcon(_ref2) {
|
|
|
5935
6197
|
}
|
|
5936
6198
|
};
|
|
5937
6199
|
|
|
6200
|
+
/* *
|
|
6201
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6202
|
+
* you may not use this file except in compliance with the License.
|
|
6203
|
+
* You may obtain a copy of the License at
|
|
6204
|
+
*
|
|
6205
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
6206
|
+
*
|
|
6207
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
6208
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
6209
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6210
|
+
* See the License for the specific language governing permissions and
|
|
6211
|
+
* limitations under the License.
|
|
6212
|
+
*
|
|
6213
|
+
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6214
|
+
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
6215
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
6216
|
+
* */
|
|
5938
6217
|
var LocationTabs = function LocationTabs(_ref) {
|
|
5939
6218
|
var tafList = _ref.tafList,
|
|
5940
6219
|
_ref$activeIndex = _ref.activeIndex,
|
|
@@ -5944,7 +6223,7 @@ var LocationTabs = function LocationTabs(_ref) {
|
|
|
5944
6223
|
timeSlot = _ref.timeSlot;
|
|
5945
6224
|
var _useFormContext = useFormContext(),
|
|
5946
6225
|
isDirty = _useFormContext.formState.isDirty;
|
|
5947
|
-
return jsx(MenuList, {
|
|
6226
|
+
return /*#__PURE__*/jsx(MenuList, {
|
|
5948
6227
|
"data-testid": "location-tabs",
|
|
5949
6228
|
sx: {
|
|
5950
6229
|
paddingTop: '32px'
|
|
@@ -5952,7 +6231,7 @@ var LocationTabs = function LocationTabs(_ref) {
|
|
|
5952
6231
|
children: tafList.map(function (_ref2, index) {
|
|
5953
6232
|
var taf = _ref2.taf,
|
|
5954
6233
|
editor = _ref2.editor;
|
|
5955
|
-
return jsxs(MenuItem, {
|
|
6234
|
+
return /*#__PURE__*/jsxs(MenuItem, {
|
|
5956
6235
|
onClick: function onClick() {
|
|
5957
6236
|
return onChangeTab(index, isDirty);
|
|
5958
6237
|
},
|
|
@@ -5975,17 +6254,17 @@ var LocationTabs = function LocationTabs(_ref) {
|
|
|
5975
6254
|
zIndex: 1
|
|
5976
6255
|
}
|
|
5977
6256
|
},
|
|
5978
|
-
children: [editor ? jsx(Box$1, {
|
|
6257
|
+
children: [editor ? /*#__PURE__*/jsx(Box$1, {
|
|
5979
6258
|
sx: {
|
|
5980
6259
|
position: 'absolute',
|
|
5981
6260
|
top: '4px',
|
|
5982
6261
|
left: '8px'
|
|
5983
6262
|
},
|
|
5984
|
-
children: jsx(TafAvatar, {
|
|
6263
|
+
children: /*#__PURE__*/jsx(TafAvatar, {
|
|
5985
6264
|
editor: editor,
|
|
5986
6265
|
tooltipPlacement: "right"
|
|
5987
6266
|
})
|
|
5988
|
-
}) : null, jsx(Box$1, {
|
|
6267
|
+
}) : null, /*#__PURE__*/jsx(Box$1, {
|
|
5989
6268
|
component: "span",
|
|
5990
6269
|
"data-testid": "taf-location",
|
|
5991
6270
|
sx: {
|
|
@@ -5994,7 +6273,7 @@ var LocationTabs = function LocationTabs(_ref) {
|
|
|
5994
6273
|
letterSpacing: '0.09px'
|
|
5995
6274
|
},
|
|
5996
6275
|
children: taf.location
|
|
5997
|
-
}), jsx(Box$1, {
|
|
6276
|
+
}), /*#__PURE__*/jsx(Box$1, {
|
|
5998
6277
|
component: "span",
|
|
5999
6278
|
sx: {
|
|
6000
6279
|
position: 'absolute',
|
|
@@ -6002,7 +6281,7 @@ var LocationTabs = function LocationTabs(_ref) {
|
|
|
6002
6281
|
width: '24px',
|
|
6003
6282
|
height: '24px'
|
|
6004
6283
|
},
|
|
6005
|
-
children: jsx(StatusIcon, {
|
|
6284
|
+
children: /*#__PURE__*/jsx(StatusIcon, {
|
|
6006
6285
|
status: taf.status,
|
|
6007
6286
|
timeSlot: timeSlot
|
|
6008
6287
|
})
|
|
@@ -6018,7 +6297,7 @@ var TabPanel = function TabPanel(_ref) {
|
|
|
6018
6297
|
value = _ref.value,
|
|
6019
6298
|
index = _ref.index,
|
|
6020
6299
|
other = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
6021
|
-
return jsx(Box, Object.assign({
|
|
6300
|
+
return /*#__PURE__*/jsx(Box, Object.assign({
|
|
6022
6301
|
"aria-labelledby": "simple-tab-" + index,
|
|
6023
6302
|
"data-testid": "tab-panel-" + index,
|
|
6024
6303
|
hidden: value !== index,
|
|
@@ -6029,11 +6308,29 @@ var TabPanel = function TabPanel(_ref) {
|
|
|
6029
6308
|
}));
|
|
6030
6309
|
};
|
|
6031
6310
|
|
|
6311
|
+
/* *
|
|
6312
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6313
|
+
* you may not use this file except in compliance with the License.
|
|
6314
|
+
* You may obtain a copy of the License at
|
|
6315
|
+
*
|
|
6316
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
6317
|
+
*
|
|
6318
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
6319
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
6320
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6321
|
+
* See the License for the specific language governing permissions and
|
|
6322
|
+
* limitations under the License.
|
|
6323
|
+
*
|
|
6324
|
+
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6325
|
+
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
6326
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
6327
|
+
* */
|
|
6328
|
+
|
|
6032
6329
|
var TafHeader = function TafHeader(_ref) {
|
|
6033
6330
|
var title = _ref.title,
|
|
6034
6331
|
_ref$sx = _ref.sx,
|
|
6035
6332
|
sx = _ref$sx === void 0 ? {} : _ref$sx;
|
|
6036
|
-
return jsx(Typography, {
|
|
6333
|
+
return /*#__PURE__*/jsx(Typography, {
|
|
6037
6334
|
sx: Object.assign({
|
|
6038
6335
|
textAlign: 'center',
|
|
6039
6336
|
fontWeight: 500,
|
|
@@ -6044,10 +6341,28 @@ var TafHeader = function TafHeader(_ref) {
|
|
|
6044
6341
|
});
|
|
6045
6342
|
};
|
|
6046
6343
|
|
|
6344
|
+
/* *
|
|
6345
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6346
|
+
* you may not use this file except in compliance with the License.
|
|
6347
|
+
* You may obtain a copy of the License at
|
|
6348
|
+
*
|
|
6349
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
6350
|
+
*
|
|
6351
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
6352
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
6353
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6354
|
+
* See the License for the specific language governing permissions and
|
|
6355
|
+
* limitations under the License.
|
|
6356
|
+
*
|
|
6357
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6358
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
6359
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
6360
|
+
* */
|
|
6361
|
+
|
|
6047
6362
|
var AdverseWeatherTACMessage = function AdverseWeatherTACMessage(_ref) {
|
|
6048
6363
|
var TAC = _ref.TAC,
|
|
6049
6364
|
isActive = _ref.isActive;
|
|
6050
|
-
return jsx(Box$1, {
|
|
6365
|
+
return /*#__PURE__*/jsx(Box$1, {
|
|
6051
6366
|
"data-testid": "adverse-weather-tac",
|
|
6052
6367
|
sx: {
|
|
6053
6368
|
fontSize: '12px',
|
|
@@ -6056,13 +6371,13 @@ var AdverseWeatherTACMessage = function AdverseWeatherTACMessage(_ref) {
|
|
|
6056
6371
|
color: 'geowebColors.captions.captionStatus.rgba'
|
|
6057
6372
|
},
|
|
6058
6373
|
children: TAC == null ? void 0 : TAC.tac.map(function (line, index) {
|
|
6059
|
-
return jsx(Box$1, {
|
|
6374
|
+
return /*#__PURE__*/jsx(Box$1, {
|
|
6060
6375
|
component: "span",
|
|
6061
6376
|
sx: {
|
|
6062
6377
|
display: 'block'
|
|
6063
6378
|
},
|
|
6064
6379
|
children: line.map(function (word, index) {
|
|
6065
|
-
return jsx(Box$1, {
|
|
6380
|
+
return /*#__PURE__*/jsx(Box$1, {
|
|
6066
6381
|
component: "span",
|
|
6067
6382
|
sx: Object.assign({
|
|
6068
6383
|
display: 'inline',
|
|
@@ -6082,12 +6397,29 @@ var AdverseWeatherTACMessage = function AdverseWeatherTACMessage(_ref) {
|
|
|
6082
6397
|
});
|
|
6083
6398
|
};
|
|
6084
6399
|
|
|
6400
|
+
/* *
|
|
6401
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6402
|
+
* you may not use this file except in compliance with the License.
|
|
6403
|
+
* You may obtain a copy of the License at
|
|
6404
|
+
*
|
|
6405
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
6406
|
+
*
|
|
6407
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
6408
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
6409
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6410
|
+
* See the License for the specific language governing permissions and
|
|
6411
|
+
* limitations under the License.
|
|
6412
|
+
*
|
|
6413
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6414
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
6415
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
6416
|
+
* */
|
|
6085
6417
|
var ExportButton = function ExportButton(_ref) {
|
|
6086
6418
|
var onClick = _ref.onClick,
|
|
6087
6419
|
isHidden = _ref.isHidden;
|
|
6088
6420
|
var _useTafTranslation = useTafTranslation(),
|
|
6089
6421
|
t = _useTafTranslation.t;
|
|
6090
|
-
return isHidden ? null : jsx(CustomIconButton, {
|
|
6422
|
+
return isHidden ? null : /*#__PURE__*/jsx(CustomIconButton, {
|
|
6091
6423
|
"data-testid": "export-tac-button",
|
|
6092
6424
|
onClick: onClick,
|
|
6093
6425
|
tooltipProps: {
|
|
@@ -6095,14 +6427,32 @@ var ExportButton = function ExportButton(_ref) {
|
|
|
6095
6427
|
placement: 'left'
|
|
6096
6428
|
},
|
|
6097
6429
|
variant: "tool",
|
|
6098
|
-
children: jsx(Export, {})
|
|
6430
|
+
children: /*#__PURE__*/jsx(Export, {})
|
|
6099
6431
|
});
|
|
6100
6432
|
};
|
|
6101
6433
|
|
|
6434
|
+
/* *
|
|
6435
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6436
|
+
* you may not use this file except in compliance with the License.
|
|
6437
|
+
* You may obtain a copy of the License at
|
|
6438
|
+
*
|
|
6439
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
6440
|
+
*
|
|
6441
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
6442
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
6443
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6444
|
+
* See the License for the specific language governing permissions and
|
|
6445
|
+
* limitations under the License.
|
|
6446
|
+
*
|
|
6447
|
+
* Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6448
|
+
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
6449
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
6450
|
+
* */
|
|
6451
|
+
|
|
6102
6452
|
var TacHighLight = function TacHighLight(_ref) {
|
|
6103
6453
|
var isActive = _ref.isActive,
|
|
6104
6454
|
children = _ref.children;
|
|
6105
|
-
return jsx(Box, {
|
|
6455
|
+
return /*#__PURE__*/jsx(Box, {
|
|
6106
6456
|
component: "span",
|
|
6107
6457
|
sx: Object.assign({
|
|
6108
6458
|
display: 'inline',
|
|
@@ -6140,7 +6490,8 @@ var TacContainer = function TacContainer(_ref2) {
|
|
|
6140
6490
|
setValue = _useFormContext.setValue;
|
|
6141
6491
|
var _useTafModuleContext = useTafModuleContext(),
|
|
6142
6492
|
useFieldArrayMethods = _useTafModuleContext.useFieldArrayMethods;
|
|
6143
|
-
var
|
|
6493
|
+
var _ref3 = useFieldArrayMethods,
|
|
6494
|
+
replace = _ref3.replace;
|
|
6144
6495
|
var showSnackbar = React.useCallback(function (message) {
|
|
6145
6496
|
dispatch(snackbarActions.openSnackbar({
|
|
6146
6497
|
type: snackbarTypes.SnackbarMessageType.VERBATIM_MESSAGE,
|
|
@@ -6178,7 +6529,7 @@ var TacContainer = function TacContainer(_ref2) {
|
|
|
6178
6529
|
}
|
|
6179
6530
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
6180
6531
|
}, [isActive]);
|
|
6181
|
-
return jsxs(Box, {
|
|
6532
|
+
return /*#__PURE__*/jsxs(Box, {
|
|
6182
6533
|
"aria-label": location,
|
|
6183
6534
|
className: isActive ? 'active' : undefined,
|
|
6184
6535
|
"data-location": location,
|
|
@@ -6186,19 +6537,19 @@ var TacContainer = function TacContainer(_ref2) {
|
|
|
6186
6537
|
sx: {
|
|
6187
6538
|
marginBottom: '20px'
|
|
6188
6539
|
},
|
|
6189
|
-
children: [jsxs(Box, {
|
|
6540
|
+
children: [/*#__PURE__*/jsxs(Box, {
|
|
6190
6541
|
sx: {
|
|
6191
6542
|
display: 'flex',
|
|
6192
6543
|
alignItems: 'center',
|
|
6193
6544
|
justifyContent: 'space-between',
|
|
6194
6545
|
height: 24
|
|
6195
6546
|
},
|
|
6196
|
-
children: [jsxs(Box, {
|
|
6547
|
+
children: [/*#__PURE__*/jsxs(Box, {
|
|
6197
6548
|
sx: {
|
|
6198
6549
|
display: 'flex',
|
|
6199
6550
|
alignItems: 'center'
|
|
6200
6551
|
},
|
|
6201
|
-
children: [jsx(Box, {
|
|
6552
|
+
children: [/*#__PURE__*/jsx(Box, {
|
|
6202
6553
|
sx: {
|
|
6203
6554
|
width: 24,
|
|
6204
6555
|
height: 24,
|
|
@@ -6208,11 +6559,11 @@ var TacContainer = function TacContainer(_ref2) {
|
|
|
6208
6559
|
alignItems: 'center',
|
|
6209
6560
|
justifyContent: 'center'
|
|
6210
6561
|
},
|
|
6211
|
-
children: jsx(StatusIcon, {
|
|
6562
|
+
children: /*#__PURE__*/jsx(StatusIcon, {
|
|
6212
6563
|
status: status,
|
|
6213
6564
|
timeSlot: timeSlot
|
|
6214
6565
|
})
|
|
6215
|
-
}), jsxs(Typography, {
|
|
6566
|
+
}), /*#__PURE__*/jsxs(Typography, {
|
|
6216
6567
|
sx: Object.assign({
|
|
6217
6568
|
lineHeight: 1
|
|
6218
6569
|
}, isActive && {
|
|
@@ -6220,7 +6571,7 @@ var TacContainer = function TacContainer(_ref2) {
|
|
|
6220
6571
|
padding: '0 2px',
|
|
6221
6572
|
marginLeft: '-2px'
|
|
6222
6573
|
}),
|
|
6223
|
-
children: [jsx(Typography, {
|
|
6574
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
6224
6575
|
component: "span",
|
|
6225
6576
|
"data-testid": "tafLocation",
|
|
6226
6577
|
sx: {
|
|
@@ -6228,7 +6579,7 @@ var TacContainer = function TacContainer(_ref2) {
|
|
|
6228
6579
|
color: 'geowebColors.captions.captionInformation.rgba'
|
|
6229
6580
|
},
|
|
6230
6581
|
children: location
|
|
6231
|
-
}), jsx(Typography, {
|
|
6582
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
6232
6583
|
component: "span",
|
|
6233
6584
|
"data-testid": "tafLocationLabel",
|
|
6234
6585
|
sx: {
|
|
@@ -6238,20 +6589,20 @@ var TacContainer = function TacContainer(_ref2) {
|
|
|
6238
6589
|
children: locationLabel
|
|
6239
6590
|
})]
|
|
6240
6591
|
})]
|
|
6241
|
-
}), jsx(ExportButton, {
|
|
6592
|
+
}), /*#__PURE__*/jsx(ExportButton, {
|
|
6242
6593
|
isHidden: isFormDisabled || tacHasError(TAC, t),
|
|
6243
6594
|
onClick: handleExport
|
|
6244
6595
|
})]
|
|
6245
|
-
}), jsx(Box, {
|
|
6596
|
+
}), /*#__PURE__*/jsx(Box, {
|
|
6246
6597
|
sx: {
|
|
6247
6598
|
fontSize: '12px',
|
|
6248
6599
|
letterSpacing: '0.4px',
|
|
6249
6600
|
color: 'geowebColors.captions.captionStatus.rgba'
|
|
6250
6601
|
},
|
|
6251
|
-
children: typeof TAC === 'string' ? jsx(TacHighLight, {
|
|
6602
|
+
children: typeof TAC === 'string' ? /*#__PURE__*/jsx(TacHighLight, {
|
|
6252
6603
|
isActive: isActive,
|
|
6253
6604
|
children: TAC
|
|
6254
|
-
}) : jsx(AdverseWeatherTACMessage, {
|
|
6605
|
+
}) : /*#__PURE__*/jsx(AdverseWeatherTACMessage, {
|
|
6255
6606
|
TAC: TAC,
|
|
6256
6607
|
isActive: isActive
|
|
6257
6608
|
})
|
|
@@ -6259,6 +6610,23 @@ var TacContainer = function TacContainer(_ref2) {
|
|
|
6259
6610
|
});
|
|
6260
6611
|
};
|
|
6261
6612
|
|
|
6613
|
+
/* *
|
|
6614
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6615
|
+
* you may not use this file except in compliance with the License.
|
|
6616
|
+
* You may obtain a copy of the License at
|
|
6617
|
+
*
|
|
6618
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
6619
|
+
*
|
|
6620
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
6621
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
6622
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6623
|
+
* See the License for the specific language governing permissions and
|
|
6624
|
+
* limitations under the License.
|
|
6625
|
+
*
|
|
6626
|
+
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6627
|
+
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
6628
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
6629
|
+
* */
|
|
6262
6630
|
var TacOverview = function TacOverview(_ref) {
|
|
6263
6631
|
var _ref$upcomingTafs = _ref.upcomingTafs,
|
|
6264
6632
|
upcomingTafs = _ref$upcomingTafs === void 0 ? [] : _ref$upcomingTafs,
|
|
@@ -6310,7 +6678,7 @@ var TacOverview = function TacOverview(_ref) {
|
|
|
6310
6678
|
clearTimeout(timer);
|
|
6311
6679
|
};
|
|
6312
6680
|
}, [activeLocation, activeTab]);
|
|
6313
|
-
return jsxs(Card, {
|
|
6681
|
+
return /*#__PURE__*/jsxs(Card, {
|
|
6314
6682
|
sx: {
|
|
6315
6683
|
maxHeight: '100%',
|
|
6316
6684
|
overflow: 'hidden',
|
|
@@ -6318,18 +6686,18 @@ var TacOverview = function TacOverview(_ref) {
|
|
|
6318
6686
|
flexDirection: 'column'
|
|
6319
6687
|
},
|
|
6320
6688
|
variant: "outlined",
|
|
6321
|
-
children: [jsxs(Box, {
|
|
6689
|
+
children: [/*#__PURE__*/jsxs(Box, {
|
|
6322
6690
|
sx: {
|
|
6323
6691
|
zIndex: 1
|
|
6324
6692
|
},
|
|
6325
|
-
children: [!hideTitle && jsx(TafHeader, {
|
|
6693
|
+
children: [!hideTitle && /*#__PURE__*/jsx(TafHeader, {
|
|
6326
6694
|
title: t('tac-overview')
|
|
6327
|
-
}), jsx(Tabs, {
|
|
6695
|
+
}), /*#__PURE__*/jsx(Tabs, {
|
|
6328
6696
|
"aria-label": "tabs",
|
|
6329
6697
|
onChange: onChangeTab,
|
|
6330
6698
|
value: activeTab,
|
|
6331
6699
|
children: tabs.map(function (tab, index) {
|
|
6332
|
-
return jsx(Tab, Object.assign({
|
|
6700
|
+
return /*#__PURE__*/jsx(Tab, Object.assign({
|
|
6333
6701
|
"data-testid": "tab-" + index,
|
|
6334
6702
|
label: tab.title,
|
|
6335
6703
|
sx: {
|
|
@@ -6338,7 +6706,7 @@ var TacOverview = function TacOverview(_ref) {
|
|
|
6338
6706
|
}, muiTabA11yProps(index)), tab.title);
|
|
6339
6707
|
})
|
|
6340
6708
|
})]
|
|
6341
|
-
}), jsx(Box, {
|
|
6709
|
+
}), /*#__PURE__*/jsx(Box, {
|
|
6342
6710
|
ref: scrollRef,
|
|
6343
6711
|
sx: {
|
|
6344
6712
|
padding: {
|
|
@@ -6351,12 +6719,12 @@ var TacOverview = function TacOverview(_ref) {
|
|
|
6351
6719
|
overflow: 'auto'
|
|
6352
6720
|
},
|
|
6353
6721
|
children: tabs.map(function (tab, index) {
|
|
6354
|
-
return jsx(TabPanel, {
|
|
6722
|
+
return /*#__PURE__*/jsx(TabPanel, {
|
|
6355
6723
|
index: index,
|
|
6356
6724
|
value: activeTab,
|
|
6357
6725
|
children: tab.tafList.map(function (_ref2) {
|
|
6358
6726
|
var taf = _ref2.taf;
|
|
6359
|
-
return jsx(TacContainer, {
|
|
6727
|
+
return /*#__PURE__*/jsx(TacContainer, {
|
|
6360
6728
|
isActive: isActiveLocation(taf.location),
|
|
6361
6729
|
isFormDisabled: isFormDisabled,
|
|
6362
6730
|
taf: taf
|
|
@@ -6368,6 +6736,24 @@ var TacOverview = function TacOverview(_ref) {
|
|
|
6368
6736
|
});
|
|
6369
6737
|
};
|
|
6370
6738
|
|
|
6739
|
+
/* *
|
|
6740
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6741
|
+
* you may not use this file except in compliance with the License.
|
|
6742
|
+
* You may obtain a copy of the License at
|
|
6743
|
+
*
|
|
6744
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
6745
|
+
*
|
|
6746
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
6747
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
6748
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6749
|
+
* See the License for the specific language governing permissions and
|
|
6750
|
+
* limitations under the License.
|
|
6751
|
+
*
|
|
6752
|
+
* Copyright 2025 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6753
|
+
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
6754
|
+
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
6755
|
+
* */
|
|
6756
|
+
|
|
6371
6757
|
var TacContainerLayout = function TacContainerLayout(_ref) {
|
|
6372
6758
|
var location = _ref.location,
|
|
6373
6759
|
_ref$isActive = _ref.isActive,
|
|
@@ -6378,7 +6764,7 @@ var TacContainerLayout = function TacContainerLayout(_ref) {
|
|
|
6378
6764
|
var _useTafConfigContext = useTafConfigContext(),
|
|
6379
6765
|
tafConfig = _useTafConfigContext.tafConfig;
|
|
6380
6766
|
var locationLabel = getLocationSetting(location, tafConfig.locations).label;
|
|
6381
|
-
return jsxs(Box, {
|
|
6767
|
+
return /*#__PURE__*/jsxs(Box, {
|
|
6382
6768
|
"aria-label": location,
|
|
6383
6769
|
className: isActive ? 'active' : undefined,
|
|
6384
6770
|
"data-location": location,
|
|
@@ -6386,19 +6772,19 @@ var TacContainerLayout = function TacContainerLayout(_ref) {
|
|
|
6386
6772
|
sx: {
|
|
6387
6773
|
marginBottom: '20px'
|
|
6388
6774
|
},
|
|
6389
|
-
children: [jsxs(Box, {
|
|
6775
|
+
children: [/*#__PURE__*/jsxs(Box, {
|
|
6390
6776
|
sx: {
|
|
6391
6777
|
display: 'flex',
|
|
6392
6778
|
alignItems: 'center',
|
|
6393
6779
|
justifyContent: 'space-between',
|
|
6394
6780
|
height: 24
|
|
6395
6781
|
},
|
|
6396
|
-
children: [jsxs(Box, {
|
|
6782
|
+
children: [/*#__PURE__*/jsxs(Box, {
|
|
6397
6783
|
sx: {
|
|
6398
6784
|
display: 'flex',
|
|
6399
6785
|
alignItems: 'center'
|
|
6400
6786
|
},
|
|
6401
|
-
children: [jsx(Box, {
|
|
6787
|
+
children: [/*#__PURE__*/jsx(Box, {
|
|
6402
6788
|
sx: {
|
|
6403
6789
|
width: 24,
|
|
6404
6790
|
height: 24,
|
|
@@ -6409,7 +6795,7 @@ var TacContainerLayout = function TacContainerLayout(_ref) {
|
|
|
6409
6795
|
justifyContent: 'center'
|
|
6410
6796
|
},
|
|
6411
6797
|
children: statusSlot
|
|
6412
|
-
}), jsxs(Typography, {
|
|
6798
|
+
}), /*#__PURE__*/jsxs(Typography, {
|
|
6413
6799
|
sx: Object.assign({
|
|
6414
6800
|
lineHeight: 1
|
|
6415
6801
|
}, isActive && {
|
|
@@ -6417,7 +6803,7 @@ var TacContainerLayout = function TacContainerLayout(_ref) {
|
|
|
6417
6803
|
padding: '0 2px',
|
|
6418
6804
|
marginLeft: '-2px'
|
|
6419
6805
|
}),
|
|
6420
|
-
children: [jsx(Typography, {
|
|
6806
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
6421
6807
|
component: "span",
|
|
6422
6808
|
"data-testid": "tafLocation",
|
|
6423
6809
|
sx: {
|
|
@@ -6425,7 +6811,7 @@ var TacContainerLayout = function TacContainerLayout(_ref) {
|
|
|
6425
6811
|
color: 'geowebColors.captions.captionInformation.rgba'
|
|
6426
6812
|
},
|
|
6427
6813
|
children: location
|
|
6428
|
-
}), jsx(Typography, {
|
|
6814
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
6429
6815
|
component: "span",
|
|
6430
6816
|
"data-testid": "tafLocationLabel",
|
|
6431
6817
|
sx: {
|
|
@@ -6436,7 +6822,7 @@ var TacContainerLayout = function TacContainerLayout(_ref) {
|
|
|
6436
6822
|
})]
|
|
6437
6823
|
})]
|
|
6438
6824
|
}), exportBtnSlot]
|
|
6439
|
-
}), jsx(Box, {
|
|
6825
|
+
}), /*#__PURE__*/jsx(Box, {
|
|
6440
6826
|
sx: {
|
|
6441
6827
|
fontSize: '12px',
|
|
6442
6828
|
letterSpacing: '0.4px',
|
|
@@ -6447,9 +6833,26 @@ var TacContainerLayout = function TacContainerLayout(_ref) {
|
|
|
6447
6833
|
});
|
|
6448
6834
|
};
|
|
6449
6835
|
|
|
6836
|
+
/* *
|
|
6837
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6838
|
+
* you may not use this file except in compliance with the License.
|
|
6839
|
+
* You may obtain a copy of the License at
|
|
6840
|
+
*
|
|
6841
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
6842
|
+
*
|
|
6843
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
6844
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
6845
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6846
|
+
* See the License for the specific language governing permissions and
|
|
6847
|
+
* limitations under the License.
|
|
6848
|
+
*
|
|
6849
|
+
* Copyright 2025 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6850
|
+
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
6851
|
+
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
6852
|
+
* */
|
|
6450
6853
|
var Message = function Message(_ref) {
|
|
6451
6854
|
var text = _ref.text;
|
|
6452
|
-
return jsx(Typography, {
|
|
6855
|
+
return /*#__PURE__*/jsx(Typography, {
|
|
6453
6856
|
sx: {
|
|
6454
6857
|
fontSize: '12px',
|
|
6455
6858
|
fontWeight: 'normal',
|
|
@@ -6479,12 +6882,12 @@ var AutoTaf = function AutoTaf(_ref2) {
|
|
|
6479
6882
|
var renderAutoTaf = function renderAutoTaf(tafList) {
|
|
6480
6883
|
var autoTafLocations = getAutoTafLocations(tafConfig == null ? void 0 : tafConfig.autoTAFlocations);
|
|
6481
6884
|
if (!autoTafLocations) {
|
|
6482
|
-
return jsx(Message, {
|
|
6885
|
+
return /*#__PURE__*/jsx(Message, {
|
|
6483
6886
|
text: t('autotaf-no-config')
|
|
6484
6887
|
});
|
|
6485
6888
|
}
|
|
6486
6889
|
if (tafList.length === 0) {
|
|
6487
|
-
return jsx(Message, {
|
|
6890
|
+
return /*#__PURE__*/jsx(Message, {
|
|
6488
6891
|
text: t('autotaf-no-data')
|
|
6489
6892
|
});
|
|
6490
6893
|
}
|
|
@@ -6493,23 +6896,23 @@ var AutoTaf = function AutoTaf(_ref2) {
|
|
|
6493
6896
|
return tafFromBackend.taf.location === tafLocation;
|
|
6494
6897
|
});
|
|
6495
6898
|
if (foundLocation) {
|
|
6496
|
-
return jsx(TacContainer, {
|
|
6899
|
+
return /*#__PURE__*/jsx(TacContainer, {
|
|
6497
6900
|
isActive: foundLocation.taf.location === (activeTaf == null ? void 0 : activeTaf.taf.location),
|
|
6498
6901
|
isFormDisabled: isFormDisabled,
|
|
6499
6902
|
taf: foundLocation.taf
|
|
6500
6903
|
}, tafLocation);
|
|
6501
6904
|
}
|
|
6502
|
-
return jsx(TacContainerLayout, {
|
|
6905
|
+
return /*#__PURE__*/jsx(TacContainerLayout, {
|
|
6503
6906
|
isActive: tafLocation === (activeTaf == null ? void 0 : activeTaf.taf.location),
|
|
6504
6907
|
location: tafLocation,
|
|
6505
|
-
children: jsx(TacHighLight, {
|
|
6908
|
+
children: /*#__PURE__*/jsx(TacHighLight, {
|
|
6506
6909
|
isActive: tafLocation === (activeTaf == null ? void 0 : activeTaf.taf.location),
|
|
6507
6910
|
children: t('autotaf-no-location')
|
|
6508
6911
|
})
|
|
6509
6912
|
}, tafLocation);
|
|
6510
6913
|
});
|
|
6511
6914
|
};
|
|
6512
|
-
return jsxs(Card, {
|
|
6915
|
+
return /*#__PURE__*/jsxs(Card, {
|
|
6513
6916
|
"data-testid": "autotaf",
|
|
6514
6917
|
sx: {
|
|
6515
6918
|
my: 1,
|
|
@@ -6522,12 +6925,12 @@ var AutoTaf = function AutoTaf(_ref2) {
|
|
|
6522
6925
|
}
|
|
6523
6926
|
},
|
|
6524
6927
|
variant: "outlined",
|
|
6525
|
-
children: [jsx(TafHeader, {
|
|
6928
|
+
children: [/*#__PURE__*/jsx(TafHeader, {
|
|
6526
6929
|
sx: {
|
|
6527
6930
|
textTransform: 'uppercase'
|
|
6528
6931
|
},
|
|
6529
6932
|
title: t('autotaf')
|
|
6530
|
-
}), jsx(Box, {
|
|
6933
|
+
}), /*#__PURE__*/jsx(Box, {
|
|
6531
6934
|
ref: scrollRef,
|
|
6532
6935
|
sx: {
|
|
6533
6936
|
padding: {
|
|
@@ -6543,6 +6946,23 @@ var AutoTaf = function AutoTaf(_ref2) {
|
|
|
6543
6946
|
});
|
|
6544
6947
|
};
|
|
6545
6948
|
|
|
6949
|
+
/* *
|
|
6950
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6951
|
+
* you may not use this file except in compliance with the License.
|
|
6952
|
+
* You may obtain a copy of the License at
|
|
6953
|
+
*
|
|
6954
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
6955
|
+
*
|
|
6956
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
6957
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
6958
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6959
|
+
* See the License for the specific language governing permissions and
|
|
6960
|
+
* limitations under the License.
|
|
6961
|
+
*
|
|
6962
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6963
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
6964
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
6965
|
+
* */
|
|
6546
6966
|
var TacOverviewMobile = function TacOverviewMobile(_ref) {
|
|
6547
6967
|
var upcomingTafs = _ref.upcomingTafs,
|
|
6548
6968
|
currentTafs = _ref.currentTafs,
|
|
@@ -6559,8 +6979,8 @@ var TacOverviewMobile = function TacOverviewMobile(_ref) {
|
|
|
6559
6979
|
var onClose = function onClose() {
|
|
6560
6980
|
return setIsOpen(false);
|
|
6561
6981
|
};
|
|
6562
|
-
return jsxs(Fragment, {
|
|
6563
|
-
children: [jsx(CustomIconButton, {
|
|
6982
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
6983
|
+
children: [/*#__PURE__*/jsx(CustomIconButton, {
|
|
6564
6984
|
"data-testid": "tac-overview-mobile-button",
|
|
6565
6985
|
isSelected: isOpen,
|
|
6566
6986
|
onClick: function onClick() {
|
|
@@ -6576,8 +6996,8 @@ var TacOverviewMobile = function TacOverviewMobile(_ref) {
|
|
|
6576
6996
|
top: '42px'
|
|
6577
6997
|
},
|
|
6578
6998
|
variant: "tool",
|
|
6579
|
-
children: jsx(ListItem, {})
|
|
6580
|
-
}), jsxs(CustomDialog, {
|
|
6999
|
+
children: /*#__PURE__*/jsx(ListItem, {})
|
|
7000
|
+
}), /*#__PURE__*/jsxs(CustomDialog, {
|
|
6581
7001
|
"data-testid": "tac-overview-mobile",
|
|
6582
7002
|
fullWidth: true,
|
|
6583
7003
|
hasLayout: false,
|
|
@@ -6587,18 +7007,18 @@ var TacOverviewMobile = function TacOverviewMobile(_ref) {
|
|
|
6587
7007
|
sx: {
|
|
6588
7008
|
height: '100%'
|
|
6589
7009
|
},
|
|
6590
|
-
children: [jsx(ToolHeader, {
|
|
7010
|
+
children: [/*#__PURE__*/jsx(ToolHeader, {
|
|
6591
7011
|
isDraggable: false,
|
|
6592
7012
|
onClose: onClose,
|
|
6593
7013
|
size: "small",
|
|
6594
7014
|
title: t('tac-overview')
|
|
6595
|
-
}), jsx(TacOverview, {
|
|
7015
|
+
}), /*#__PURE__*/jsx(TacOverview, {
|
|
6596
7016
|
activeTaf: activeTaf,
|
|
6597
7017
|
currentTafs: currentTafs,
|
|
6598
7018
|
expiredTafs: expiredTafs,
|
|
6599
7019
|
hideTitle: true,
|
|
6600
7020
|
upcomingTafs: upcomingTafs
|
|
6601
|
-
}), !!autoTafs && jsx(AutoTaf, {
|
|
7021
|
+
}), !!autoTafs && /*#__PURE__*/jsx(AutoTaf, {
|
|
6602
7022
|
activeTaf: activeTaf,
|
|
6603
7023
|
tafList: autoTafs
|
|
6604
7024
|
})]
|
|
@@ -6606,11 +7026,29 @@ var TacOverviewMobile = function TacOverviewMobile(_ref) {
|
|
|
6606
7026
|
});
|
|
6607
7027
|
};
|
|
6608
7028
|
|
|
7029
|
+
/* *
|
|
7030
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7031
|
+
* you may not use this file except in compliance with the License.
|
|
7032
|
+
* You may obtain a copy of the License at
|
|
7033
|
+
*
|
|
7034
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
7035
|
+
*
|
|
7036
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
7037
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
7038
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
7039
|
+
* See the License for the specific language governing permissions and
|
|
7040
|
+
* limitations under the License.
|
|
7041
|
+
*
|
|
7042
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
7043
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
7044
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
7045
|
+
* */
|
|
7046
|
+
|
|
6609
7047
|
var Spinner = function Spinner(props) {
|
|
6610
|
-
return jsx(Backdrop, Object.assign({
|
|
7048
|
+
return /*#__PURE__*/jsx(Backdrop, Object.assign({
|
|
6611
7049
|
open: true
|
|
6612
7050
|
}, props, {
|
|
6613
|
-
children: jsx(CircularProgress, {
|
|
7051
|
+
children: /*#__PURE__*/jsx(CircularProgress, {
|
|
6614
7052
|
color: "inherit",
|
|
6615
7053
|
"data-testid": "spinner"
|
|
6616
7054
|
})
|
|
@@ -6724,29 +7162,29 @@ var TafPanel = function TafPanel(_ref) {
|
|
|
6724
7162
|
return _ref4.apply(this, arguments);
|
|
6725
7163
|
};
|
|
6726
7164
|
}();
|
|
6727
|
-
return jsxs(TabPanel, {
|
|
7165
|
+
return /*#__PURE__*/jsxs(TabPanel, {
|
|
6728
7166
|
"data-testid": "taf-panel" + (activeTafIndex === index ? '-active' : ''),
|
|
6729
7167
|
index: index,
|
|
6730
7168
|
value: activeTafIndex,
|
|
6731
|
-
children: [jsx(TafHeader, {
|
|
7169
|
+
children: [/*#__PURE__*/jsx(TafHeader, {
|
|
6732
7170
|
sx: {
|
|
6733
7171
|
marginBottom: '4px'
|
|
6734
7172
|
},
|
|
6735
7173
|
title: getTafStatusLabel(t, tafFromBackend.taf.status, tafAction, isFormDisabled)
|
|
6736
|
-
}), isLoading ? jsx(Spinner, {
|
|
7174
|
+
}), isLoading ? /*#__PURE__*/jsx(Spinner, {
|
|
6737
7175
|
"data-testid": "taf-loading",
|
|
6738
7176
|
sx: {
|
|
6739
7177
|
position: 'absolute',
|
|
6740
7178
|
zIndex: 1,
|
|
6741
7179
|
color: 'geowebColors.backdrops.white.fill'
|
|
6742
7180
|
}
|
|
6743
|
-
}) : null, error ? jsx(AlertBanner, {
|
|
7181
|
+
}) : null, error ? /*#__PURE__*/jsx(AlertBanner, {
|
|
6744
7182
|
dataTestId: "taf-error",
|
|
6745
7183
|
info: error.message,
|
|
6746
7184
|
severity: severity,
|
|
6747
7185
|
shouldClose: true,
|
|
6748
7186
|
title: error.title
|
|
6749
|
-
}) : null, jsx(Box, {
|
|
7187
|
+
}) : null, /*#__PURE__*/jsx(Box, {
|
|
6750
7188
|
sx: {
|
|
6751
7189
|
marginTop: {
|
|
6752
7190
|
xs: '44px',
|
|
@@ -6754,7 +7192,7 @@ var TafPanel = function TafPanel(_ref) {
|
|
|
6754
7192
|
},
|
|
6755
7193
|
padding: 1
|
|
6756
7194
|
},
|
|
6757
|
-
children: jsx(TafForm, {
|
|
7195
|
+
children: /*#__PURE__*/jsx(TafForm, {
|
|
6758
7196
|
isDisabled: isFormDisabled,
|
|
6759
7197
|
isIssuesPaneOpen: isIssuesPaneOpen,
|
|
6760
7198
|
onFormAction: onTafAction,
|
|
@@ -6769,6 +7207,23 @@ var TafPanel = function TafPanel(_ref) {
|
|
|
6769
7207
|
});
|
|
6770
7208
|
};
|
|
6771
7209
|
|
|
7210
|
+
/* *
|
|
7211
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7212
|
+
* you may not use this file except in compliance with the License.
|
|
7213
|
+
* You may obtain a copy of the License at
|
|
7214
|
+
*
|
|
7215
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
7216
|
+
*
|
|
7217
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
7218
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
7219
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
7220
|
+
* See the License for the specific language governing permissions and
|
|
7221
|
+
* limitations under the License.
|
|
7222
|
+
*
|
|
7223
|
+
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
7224
|
+
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
7225
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
7226
|
+
* */
|
|
6772
7227
|
var TopTabs = function TopTabs(_ref) {
|
|
6773
7228
|
var timeSlot = _ref.timeSlot,
|
|
6774
7229
|
tafFromBackend = _ref.tafFromBackend,
|
|
@@ -6794,14 +7249,14 @@ var TopTabs = function TopTabs(_ref) {
|
|
|
6794
7249
|
var onChangeTab = function onChangeTab(_event, newValue) {
|
|
6795
7250
|
onChangeTimeSlot(tabs[newValue].timeSlot, isDirty);
|
|
6796
7251
|
};
|
|
6797
|
-
return jsx(Tabs, {
|
|
7252
|
+
return /*#__PURE__*/jsx(Tabs, {
|
|
6798
7253
|
"aria-label": "timeslot-tabs",
|
|
6799
7254
|
"data-testid": "timeslot-tabs",
|
|
6800
7255
|
onChange: onChangeTab,
|
|
6801
7256
|
value: activeTab,
|
|
6802
7257
|
variant: "fullWidth",
|
|
6803
7258
|
children: tabs.map(function (tab, index) {
|
|
6804
|
-
return jsx(Tab, Object.assign({
|
|
7259
|
+
return /*#__PURE__*/jsx(Tab, Object.assign({
|
|
6805
7260
|
"data-testid": "toptab-" + index,
|
|
6806
7261
|
label: tab.title,
|
|
6807
7262
|
sx: {
|
|
@@ -6812,11 +7267,28 @@ var TopTabs = function TopTabs(_ref) {
|
|
|
6812
7267
|
});
|
|
6813
7268
|
};
|
|
6814
7269
|
|
|
7270
|
+
/* *
|
|
7271
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7272
|
+
* you may not use this file except in compliance with the License.
|
|
7273
|
+
* You may obtain a copy of the License at
|
|
7274
|
+
*
|
|
7275
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
7276
|
+
*
|
|
7277
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
7278
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
7279
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
7280
|
+
* See the License for the specific language governing permissions and
|
|
7281
|
+
* limitations under the License.
|
|
7282
|
+
*
|
|
7283
|
+
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
7284
|
+
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
7285
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
7286
|
+
* */
|
|
6815
7287
|
var IssuesPaneWrapper = function IssuesPaneWrapper(props) {
|
|
6816
7288
|
var _useFormContext = useFormContext(),
|
|
6817
7289
|
errors = _useFormContext.formState.errors;
|
|
6818
7290
|
var errorList = filterDuplicateErrors(getErrors(errors));
|
|
6819
|
-
return jsx(IssuesPane, Object.assign({
|
|
7291
|
+
return /*#__PURE__*/jsx(IssuesPane, Object.assign({
|
|
6820
7292
|
errorList: errorList
|
|
6821
7293
|
}, props));
|
|
6822
7294
|
};
|
|
@@ -7045,6 +7517,7 @@ var TafLayout = function TafLayout(_ref) {
|
|
|
7045
7517
|
var updatedLocations = timeSlot === 'ACTIVE' ? newSortedTafs.current : newSortedTafs.upcoming;
|
|
7046
7518
|
updateSortedTafs(sortTafTimeSlots(tafList, tafConfig));
|
|
7047
7519
|
setLocations(updatedLocations);
|
|
7520
|
+
|
|
7048
7521
|
// update active index
|
|
7049
7522
|
var previousActiveLocationUUID = (_locations$activeTafI = locations[activeTafIndex]) == null || (_locations$activeTafI = _locations$activeTafI.taf) == null ? void 0 : _locations$activeTafI.uuid;
|
|
7050
7523
|
var newTafLocationIndex = getNewTafLocationIndex(updatedLocations, previousActiveLocationUUID);
|
|
@@ -7065,8 +7538,8 @@ var TafLayout = function TafLayout(_ref) {
|
|
|
7065
7538
|
return null;
|
|
7066
7539
|
}
|
|
7067
7540
|
var activeTaf = locations[activeTafIndex];
|
|
7068
|
-
return jsxs(Fragment, {
|
|
7069
|
-
children: [jsx(Box, {
|
|
7541
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
7542
|
+
children: [/*#__PURE__*/jsx(Box, {
|
|
7070
7543
|
component: "div",
|
|
7071
7544
|
id: MODAL_DIALOG_ELEMENT,
|
|
7072
7545
|
sx: {
|
|
@@ -7076,12 +7549,12 @@ var TafLayout = function TafLayout(_ref) {
|
|
|
7076
7549
|
overflow: 'hidden',
|
|
7077
7550
|
pointerEvents: 'none'
|
|
7078
7551
|
}
|
|
7079
|
-
}), jsx(Box, {
|
|
7552
|
+
}), /*#__PURE__*/jsx(Box, {
|
|
7080
7553
|
sx: {
|
|
7081
7554
|
height: '100%',
|
|
7082
7555
|
maxHeight: '100%'
|
|
7083
7556
|
},
|
|
7084
|
-
children: jsxs(Box, {
|
|
7557
|
+
children: /*#__PURE__*/jsxs(Box, {
|
|
7085
7558
|
sx: {
|
|
7086
7559
|
minWidth: 320,
|
|
7087
7560
|
margin: 'auto',
|
|
@@ -7089,35 +7562,35 @@ var TafLayout = function TafLayout(_ref) {
|
|
|
7089
7562
|
display: 'flex',
|
|
7090
7563
|
flexDirection: 'column'
|
|
7091
7564
|
},
|
|
7092
|
-
children: [jsxs(Grid, {
|
|
7565
|
+
children: [/*#__PURE__*/jsxs(Grid, {
|
|
7093
7566
|
container: true,
|
|
7094
7567
|
spacing: 2,
|
|
7095
7568
|
sx: {
|
|
7096
7569
|
paddingLeft: 1,
|
|
7097
7570
|
paddingRight: 1
|
|
7098
7571
|
},
|
|
7099
|
-
children: [jsx(Grid, {
|
|
7572
|
+
children: [/*#__PURE__*/jsx(Grid, {
|
|
7100
7573
|
size: {
|
|
7101
7574
|
xs: 12,
|
|
7102
7575
|
sm: 9
|
|
7103
7576
|
},
|
|
7104
|
-
children: jsx(TopTabs, {
|
|
7577
|
+
children: /*#__PURE__*/jsx(TopTabs, {
|
|
7105
7578
|
onChangeTimeSlot: onChangeTimeSlot,
|
|
7106
7579
|
tafFromBackend: lastCurrentTaf,
|
|
7107
7580
|
timeSlot: timeSlot
|
|
7108
7581
|
})
|
|
7109
|
-
}), jsx(Grid, {
|
|
7582
|
+
}), /*#__PURE__*/jsx(Grid, {
|
|
7110
7583
|
size: {
|
|
7111
7584
|
xs: 12,
|
|
7112
7585
|
sm: 3
|
|
7113
7586
|
},
|
|
7114
|
-
children: lastUpdateTime ? jsx(LastUpdateTime, {
|
|
7587
|
+
children: lastUpdateTime ? /*#__PURE__*/jsx(LastUpdateTime, {
|
|
7115
7588
|
dataTestId: "lastupdated-time",
|
|
7116
7589
|
lastUpdateTime: lastUpdateTime,
|
|
7117
7590
|
onPressRefresh: onUpdateTaf
|
|
7118
7591
|
}) : null
|
|
7119
7592
|
})]
|
|
7120
|
-
}), jsxs(Grid, {
|
|
7593
|
+
}), /*#__PURE__*/jsxs(Grid, {
|
|
7121
7594
|
container: true,
|
|
7122
7595
|
spacing: 2,
|
|
7123
7596
|
sx: {
|
|
@@ -7127,27 +7600,27 @@ var TafLayout = function TafLayout(_ref) {
|
|
|
7127
7600
|
paddingTop: 2,
|
|
7128
7601
|
overflow: 'auto'
|
|
7129
7602
|
},
|
|
7130
|
-
children: [jsx(Grid, {
|
|
7603
|
+
children: [/*#__PURE__*/jsx(Grid, {
|
|
7131
7604
|
size: {
|
|
7132
7605
|
xs: 3,
|
|
7133
7606
|
sm: 1
|
|
7134
7607
|
},
|
|
7135
|
-
children: jsx(LocationTabs, {
|
|
7608
|
+
children: /*#__PURE__*/jsx(LocationTabs, {
|
|
7136
7609
|
activeIndex: activeTafIndex,
|
|
7137
7610
|
onChangeTab: onChangeLocationTab,
|
|
7138
7611
|
tafList: locations,
|
|
7139
7612
|
timeSlot: timeSlot
|
|
7140
7613
|
})
|
|
7141
|
-
}), jsx(Grid, {
|
|
7614
|
+
}), /*#__PURE__*/jsx(Grid, {
|
|
7142
7615
|
size: "grow",
|
|
7143
|
-
children: jsxs(Card, {
|
|
7616
|
+
children: /*#__PURE__*/jsxs(Card, {
|
|
7144
7617
|
sx: {
|
|
7145
7618
|
marginBottom: '12px',
|
|
7146
7619
|
position: 'relative',
|
|
7147
7620
|
minHeight: locations.length * 62 + 32
|
|
7148
7621
|
},
|
|
7149
7622
|
variant: "outlined",
|
|
7150
|
-
children: [jsx(TacOverviewMobile, Object.assign({
|
|
7623
|
+
children: [/*#__PURE__*/jsx(TacOverviewMobile, Object.assign({
|
|
7151
7624
|
activeTaf: activeTaf,
|
|
7152
7625
|
currentTafs: current,
|
|
7153
7626
|
expiredTafs: expired,
|
|
@@ -7155,7 +7628,7 @@ var TafLayout = function TafLayout(_ref) {
|
|
|
7155
7628
|
}, isAutoTafEnabled && {
|
|
7156
7629
|
autoTafs: autoTafList
|
|
7157
7630
|
})), locations.length > 0 ? locations.map(function (tafFromBackend, index) {
|
|
7158
|
-
return jsx(TafPanel, {
|
|
7631
|
+
return /*#__PURE__*/jsx(TafPanel, {
|
|
7159
7632
|
activeTafIndex: activeTafIndex,
|
|
7160
7633
|
error: error,
|
|
7161
7634
|
index: index,
|
|
@@ -7171,7 +7644,7 @@ var TafLayout = function TafLayout(_ref) {
|
|
|
7171
7644
|
tafAction: tafAction,
|
|
7172
7645
|
tafFromBackend: tafFromBackend
|
|
7173
7646
|
}, tafFromBackend.taf.uuid);
|
|
7174
|
-
}) : jsx(Typography, {
|
|
7647
|
+
}) : /*#__PURE__*/jsx(Typography, {
|
|
7175
7648
|
sx: {
|
|
7176
7649
|
margin: 1
|
|
7177
7650
|
},
|
|
@@ -7179,7 +7652,7 @@ var TafLayout = function TafLayout(_ref) {
|
|
|
7179
7652
|
children: t('no-locations-message')
|
|
7180
7653
|
})]
|
|
7181
7654
|
})
|
|
7182
|
-
}), jsxs(Grid, {
|
|
7655
|
+
}), /*#__PURE__*/jsxs(Grid, {
|
|
7183
7656
|
size: {
|
|
7184
7657
|
xs: 0,
|
|
7185
7658
|
sm: 3
|
|
@@ -7193,13 +7666,13 @@ var TafLayout = function TafLayout(_ref) {
|
|
|
7193
7666
|
display: 'flex',
|
|
7194
7667
|
flexDirection: 'column'
|
|
7195
7668
|
}),
|
|
7196
|
-
children: [jsx(TacOverview, {
|
|
7669
|
+
children: [/*#__PURE__*/jsx(TacOverview, {
|
|
7197
7670
|
activeTaf: activeTaf,
|
|
7198
7671
|
currentTafs: current,
|
|
7199
7672
|
expiredTafs: expired,
|
|
7200
7673
|
isFormDisabled: isFormDisabled,
|
|
7201
7674
|
upcomingTafs: upcoming
|
|
7202
|
-
}), isAutoTafEnabled ? jsx(AutoTaf, {
|
|
7675
|
+
}), isAutoTafEnabled ? /*#__PURE__*/jsx(AutoTaf, {
|
|
7203
7676
|
activeTaf: activeTaf,
|
|
7204
7677
|
isFormDisabled: isFormDisabled,
|
|
7205
7678
|
tafList: autoTafList
|
|
@@ -7207,7 +7680,7 @@ var TafLayout = function TafLayout(_ref) {
|
|
|
7207
7680
|
})]
|
|
7208
7681
|
})]
|
|
7209
7682
|
})
|
|
7210
|
-
}), jsx(IssuesPaneWrapper, {
|
|
7683
|
+
}), /*#__PURE__*/jsx(IssuesPaneWrapper, {
|
|
7211
7684
|
handleClose: onCloseIssuesPane,
|
|
7212
7685
|
isOpen: isIssuesPaneOpen,
|
|
7213
7686
|
onUserHasDragged: onUserHasDragged,
|
|
@@ -7220,7 +7693,7 @@ var _excluded$1 = ["children"];
|
|
|
7220
7693
|
var TafWrapper = function TafWrapper(_ref) {
|
|
7221
7694
|
var children = _ref.children,
|
|
7222
7695
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
7223
|
-
return jsx(ReactHookFormProvider, {
|
|
7696
|
+
return /*#__PURE__*/jsx(ReactHookFormProvider, {
|
|
7224
7697
|
options: {
|
|
7225
7698
|
mode: 'onTouched',
|
|
7226
7699
|
reValidateMode: 'onChange',
|
|
@@ -7243,7 +7716,7 @@ var TafWrapper = function TafWrapper(_ref) {
|
|
|
7243
7716
|
IS_DRAFT: false
|
|
7244
7717
|
}
|
|
7245
7718
|
},
|
|
7246
|
-
children: jsx(TafModuleProvider, Object.assign({}, props, {
|
|
7719
|
+
children: /*#__PURE__*/jsx(TafModuleProvider, Object.assign({}, props, {
|
|
7247
7720
|
children: children
|
|
7248
7721
|
}))
|
|
7249
7722
|
});
|
|
@@ -7292,21 +7765,21 @@ var TafModule = function TafModule(_ref) {
|
|
|
7292
7765
|
setErrorMessage(null);
|
|
7293
7766
|
}
|
|
7294
7767
|
}, [t, tafListError]);
|
|
7295
|
-
return jsx(ResponsiveWrapper, {
|
|
7296
|
-
children: jsxs(Box, {
|
|
7768
|
+
return /*#__PURE__*/jsx(ResponsiveWrapper, {
|
|
7769
|
+
children: /*#__PURE__*/jsxs(Box, {
|
|
7297
7770
|
component: "div",
|
|
7298
7771
|
"data-testid": "tafmodule",
|
|
7299
7772
|
id: "tafmodule",
|
|
7300
7773
|
sx: {
|
|
7301
7774
|
height: '100%'
|
|
7302
7775
|
},
|
|
7303
|
-
children: [isFetching ? jsx(LinearProgress$1, {
|
|
7776
|
+
children: [isFetching ? /*#__PURE__*/jsx(LinearProgress$1, {
|
|
7304
7777
|
color: "secondary",
|
|
7305
7778
|
"data-testid": "loading-bar",
|
|
7306
7779
|
sx: {
|
|
7307
7780
|
marginBottom: '-4px'
|
|
7308
7781
|
}
|
|
7309
|
-
}) : null, errorMessage ? jsx(AlertBanner, {
|
|
7782
|
+
}) : null, errorMessage ? /*#__PURE__*/jsx(AlertBanner, {
|
|
7310
7783
|
actionButtonProps: {
|
|
7311
7784
|
title: t('error-title-retry'),
|
|
7312
7785
|
onClick: onUpdateTaf
|
|
@@ -7315,7 +7788,7 @@ var TafModule = function TafModule(_ref) {
|
|
|
7315
7788
|
info: errorMessage.info,
|
|
7316
7789
|
severity: "error",
|
|
7317
7790
|
title: errorMessage.title
|
|
7318
|
-
}) : null, jsx(TafLayout, {
|
|
7791
|
+
}) : null, /*#__PURE__*/jsx(TafLayout, {
|
|
7319
7792
|
isAutoTafEnabled: isAutoTafEnabled,
|
|
7320
7793
|
lastUpdateTime: lastUpdateTime,
|
|
7321
7794
|
onUpdateTaf: onUpdateTaf,
|
|
@@ -7330,10 +7803,10 @@ var Wrapper = function Wrapper(_ref3) {
|
|
|
7330
7803
|
_ref3$type = _ref3.type,
|
|
7331
7804
|
type = _ref3$type === void 0 ? 'TAF' : _ref3$type,
|
|
7332
7805
|
props = _objectWithoutPropertiesLoose(_ref3, _excluded);
|
|
7333
|
-
return jsx(TafWrapper, Object.assign({}, props, {
|
|
7334
|
-
children: jsx(TafConfigWrapper, {
|
|
7806
|
+
return /*#__PURE__*/jsx(TafWrapper, Object.assign({}, props, {
|
|
7807
|
+
children: /*#__PURE__*/jsx(TafConfigWrapper, {
|
|
7335
7808
|
type: type,
|
|
7336
|
-
children: jsx(TafModule, {
|
|
7809
|
+
children: /*#__PURE__*/jsx(TafModule, {
|
|
7337
7810
|
isAutoTafEnabled: isAutoTafEnabled,
|
|
7338
7811
|
type: type
|
|
7339
7812
|
})
|
|
@@ -7341,6 +7814,23 @@ var Wrapper = function Wrapper(_ref3) {
|
|
|
7341
7814
|
}));
|
|
7342
7815
|
};
|
|
7343
7816
|
|
|
7817
|
+
/* *
|
|
7818
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7819
|
+
* you may not use this file except in compliance with the License.
|
|
7820
|
+
* You may obtain a copy of the License at
|
|
7821
|
+
*
|
|
7822
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
7823
|
+
*
|
|
7824
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
7825
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
7826
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
7827
|
+
* See the License for the specific language governing permissions and
|
|
7828
|
+
* limitations under the License.
|
|
7829
|
+
*
|
|
7830
|
+
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
7831
|
+
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
7832
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
7833
|
+
* */
|
|
7344
7834
|
var tafScreenPreset = {
|
|
7345
7835
|
id: 'screenConfigTaf',
|
|
7346
7836
|
title: 'TAF',
|
|
@@ -7357,12 +7847,15 @@ var tafScreenPreset = {
|
|
|
7357
7847
|
syncGroups: [],
|
|
7358
7848
|
mosaicNode: 'taf'
|
|
7359
7849
|
};
|
|
7850
|
+
|
|
7851
|
+
// base type for connected modules
|
|
7852
|
+
|
|
7360
7853
|
var TafApiWrapper = function TafApiWrapper(_ref) {
|
|
7361
7854
|
var config = _ref.config,
|
|
7362
7855
|
onPreventCloseView = _ref.onPreventCloseView,
|
|
7363
7856
|
initialProps = _ref.initialProps;
|
|
7364
|
-
return config ? jsx(ErrorBoundary, {
|
|
7365
|
-
children: jsx(Wrapper, {
|
|
7857
|
+
return config ? /*#__PURE__*/jsx(ErrorBoundary, {
|
|
7858
|
+
children: /*#__PURE__*/jsx(Wrapper, {
|
|
7366
7859
|
isAutoTafEnabled: initialProps == null ? void 0 : initialProps.isAutoTafEnabled,
|
|
7367
7860
|
onPreventCloseView: onPreventCloseView,
|
|
7368
7861
|
type: initialProps == null ? void 0 : initialProps.type
|
|
@@ -7384,10 +7877,10 @@ ConnectedModuleWrapper) {
|
|
|
7384
7877
|
switch (componentType) {
|
|
7385
7878
|
case 'TafModule':
|
|
7386
7879
|
if (ConnectedModuleWrapper) {
|
|
7387
|
-
return jsx(ConnectedModuleWrapper, {
|
|
7880
|
+
return /*#__PURE__*/jsx(ConnectedModuleWrapper, {
|
|
7388
7881
|
auth: auth,
|
|
7389
7882
|
component: function component(props) {
|
|
7390
|
-
return jsx(TafApiWrapper, Object.assign({}, props, {
|
|
7883
|
+
return /*#__PURE__*/jsx(TafApiWrapper, Object.assign({}, props, {
|
|
7391
7884
|
initialProps: initialProps
|
|
7392
7885
|
}));
|
|
7393
7886
|
},
|
|
@@ -7397,7 +7890,7 @@ ConnectedModuleWrapper) {
|
|
|
7397
7890
|
payload: payload
|
|
7398
7891
|
});
|
|
7399
7892
|
}
|
|
7400
|
-
return jsx(TafApiWrapper, {
|
|
7893
|
+
return /*#__PURE__*/jsx(TafApiWrapper, {
|
|
7401
7894
|
auth: auth,
|
|
7402
7895
|
config: config,
|
|
7403
7896
|
"data-testid": "tafmodule",
|
|
@@ -7409,6 +7902,24 @@ ConnectedModuleWrapper) {
|
|
|
7409
7902
|
}
|
|
7410
7903
|
};
|
|
7411
7904
|
|
|
7905
|
+
/* *
|
|
7906
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7907
|
+
* you may not use this file except in compliance with the License.
|
|
7908
|
+
* You may obtain a copy of the License at
|
|
7909
|
+
*
|
|
7910
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
7911
|
+
*
|
|
7912
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
7913
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
7914
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
7915
|
+
* See the License for the specific language governing permissions and
|
|
7916
|
+
* limitations under the License.
|
|
7917
|
+
*
|
|
7918
|
+
* Copyright 2026 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
7919
|
+
* Copyright 2026 - Finnish Meteorological Institute (FMI)
|
|
7920
|
+
* Copyright 2026 - The Norwegian Meteorological Institute (MET Norway)
|
|
7921
|
+
* */
|
|
7922
|
+
|
|
7412
7923
|
var fakeTafConfig = {
|
|
7413
7924
|
type: 'TAF',
|
|
7414
7925
|
location_indicator_mwo: 'EHDB',
|
|
@@ -8536,6 +9047,7 @@ var fakeDraftAmendmentTaf = {
|
|
|
8536
9047
|
}]
|
|
8537
9048
|
}
|
|
8538
9049
|
};
|
|
9050
|
+
|
|
8539
9051
|
// Filter out the changegroups for testing purposes as the valid times get adjusted
|
|
8540
9052
|
var _fakeDraftAmendmentTa = fakeDraftAmendmentTaf.taf;
|
|
8541
9053
|
_fakeDraftAmendmentTa.changeGroups;
|
|
@@ -8558,6 +9070,7 @@ var _fakeDraftAmendmentTa = fakeDraftAmendmentTaf.taf;
|
|
|
8558
9070
|
})
|
|
8559
9071
|
})
|
|
8560
9072
|
});
|
|
9073
|
+
|
|
8561
9074
|
// Use as the original previous TAF for TAF above
|
|
8562
9075
|
({
|
|
8563
9076
|
taf: Object.assign({}, fakeDraftAmendmentWithoutChangeGroups, {
|
|
@@ -8619,6 +9132,7 @@ var fakeAmendmentTaf = {
|
|
|
8619
9132
|
}
|
|
8620
9133
|
}
|
|
8621
9134
|
};
|
|
9135
|
+
|
|
8622
9136
|
// Only use for display purposes in the list!
|
|
8623
9137
|
({
|
|
8624
9138
|
taf: Object.assign({}, fakeAmendmentTaf.taf, {
|
|
@@ -8638,6 +9152,24 @@ var fakeAmendmentTaf = {
|
|
|
8638
9152
|
})
|
|
8639
9153
|
});
|
|
8640
9154
|
|
|
9155
|
+
/* *
|
|
9156
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9157
|
+
* you may not use this file except in compliance with the License.
|
|
9158
|
+
* You may obtain a copy of the License at
|
|
9159
|
+
*
|
|
9160
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9161
|
+
*
|
|
9162
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
9163
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9164
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9165
|
+
* See the License for the specific language governing permissions and
|
|
9166
|
+
* limitations under the License.
|
|
9167
|
+
*
|
|
9168
|
+
* Copyright 2026 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9169
|
+
* Copyright 2026 - Finnish Meteorological Institute (FMI)
|
|
9170
|
+
* Copyright 2026 - The Norwegian Meteorological Institute (MET Norway)
|
|
9171
|
+
* */
|
|
9172
|
+
|
|
8641
9173
|
var fakeNafConfig = {
|
|
8642
9174
|
type: 'NAF',
|
|
8643
9175
|
location_indicator_mwo: 'EHAK',
|
|
@@ -8748,6 +9280,7 @@ function withLocationDates(location, cb) {
|
|
|
8748
9280
|
currentIndex = locationConfig.valid_start_times.length - 1;
|
|
8749
9281
|
}
|
|
8750
9282
|
var upcomingIndex = (currentIndex + 1) % locationConfig.valid_start_times.length;
|
|
9283
|
+
|
|
8751
9284
|
// If upcoming start time is earlier than or equal to current start time, we've wrapped to the next day
|
|
8752
9285
|
var upcomingWrapsToNextDay = locationConfig.valid_start_times[upcomingIndex] <= locationConfig.valid_start_times[currentIndex];
|
|
8753
9286
|
var _getDateRange = getDateRange(locationConfig, currentIndex, currentIsYesterday ? -1 : 0),
|