@opengeoweb/sigmet-airmet 4.3.0 → 4.5.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 +194 -82
- package/index.umd.js +211 -76
- package/lib/components/ProductForms/ProductFormFields/Change.d.ts +2 -5
- package/lib/components/ProductForms/ProductFormFields/CloudLevels.d.ts +2 -6
- package/lib/components/ProductForms/ProductFormFields/IssuedAt.d.ts +1 -0
- package/lib/components/ProductForms/ProductFormFields/Levels.d.ts +2 -8
- package/lib/components/ProductForms/ProductFormFields/ObservationForecast.d.ts +2 -5
- package/lib/components/ProductForms/ProductFormFields/ObservationForecastTime.d.ts +2 -4
- package/lib/components/ProductForms/ProductFormFields/Phenomenon.d.ts +2 -7
- package/lib/components/ProductForms/ProductFormFields/Progress.d.ts +2 -6
- package/lib/components/ProductForms/ProductFormFields/SelectFIR.d.ts +2 -6
- package/lib/components/ProductForms/ProductFormFields/SurfaceVisibility.d.ts +2 -5
- package/lib/components/ProductForms/ProductFormFields/SurfaceWind.d.ts +2 -5
- package/lib/components/ProductForms/ProductFormFields/Type.d.ts +2 -5
- package/lib/components/ProductForms/ProductFormFields/ValidFrom.d.ts +2 -7
- package/lib/components/ProductForms/ProductFormFields/ValidUntil.d.ts +2 -7
- package/lib/components/ProductForms/ProductFormFields/VolcanicFields.d.ts +2 -3
- package/lib/components/ProductForms/utils.d.ts +1 -0
- package/lib/components/ProductList/ProductList.stories.d.ts +2 -0
- package/lib/types.d.ts +6 -0
- package/lib/utils/store.d.ts +1 -1
- package/package.json +14 -12
package/index.esm.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default from 'react';
|
|
3
|
-
import { FormControlLabel, Radio, Grid, Typography,
|
|
3
|
+
import { FormControlLabel, Radio, Grid, Typography, Box, Button, Checkbox, MenuItem, FormHelperText, useTheme, Dialog, DialogTitle, DialogContent, Card, List, ListItem, Skeleton, Backdrop, CircularProgress } from '@mui/material';
|
|
4
4
|
import { useFormContext } from 'react-hook-form';
|
|
5
|
-
import { ReactHookFormRadioGroup, ReactHookFormSelect, ReactHookFormNumberField, isInteger, isValidMax, isValidMin, isEmpty, ReactHookFormDateTime, isValidDate, isBefore, isBetween, hasMaxFeaturePoints, hasMulitpleIntersections, ReactHookFormHiddenInput, isMaximumOneDrawing, hasIntersectionWithFIR, isValidGeoJsonCoordinates, isXHoursBefore, isAfter, isXHoursAfter, ReactHookFormTextField, containsNoCommas, isLatitude, isNonOrBothCoordinates, isLongitude, errorMessages, isGeometryDirty, ReactHookFormProvider, defaultFormOptions } from '@opengeoweb/form-fields';
|
|
5
|
+
import { ReactHookFormRadioGroup, ReactHookFormSelect, ReactHookFormNumberField, isInteger, isValidMax, isValidMin, isEmpty, ReactHookFormDateTime, isValidDate, isBefore, isBetween, hasMaxFeaturePoints, hasMulitpleIntersections, ReactHookFormHiddenInput, isMaximumOneDrawing, hasIntersectionWithFIR, isValidGeoJsonCoordinates, isXHoursBefore, isAfter, isXHoursAfter, ReactHookFormTextField, containsNoCommas, isLatitude, isNonOrBothCoordinates, isLongitude, errorMessages, ReactHookFormFormControl, isGeometryDirty, ReactHookFormProvider, defaultFormOptions } from '@opengeoweb/form-fields';
|
|
6
6
|
import { useApiContext, useApi, createApiInstance } from '@opengeoweb/api';
|
|
7
7
|
import produce, { produce as produce$1 } from 'immer';
|
|
8
8
|
import * as turf from '@turf/turf';
|
|
9
9
|
import { polygonToLineString, booleanClockwise, rewind } from '@turf/turf';
|
|
10
|
-
import { useDraftFormHelpers, ToggleMenu, useIsMounted, StatusTag, AlertBanner, usePreventBrowserClose, useConfirmationDialog, isAxiosError, getAxiosErrorMessage, ConfirmationServiceProvider, usePoller } from '@opengeoweb/shared';
|
|
10
|
+
import { useDraftFormHelpers, CustomTooltip, ToggleMenu, useIsMounted, IS_JEST, StatusTag, AlertBanner, usePreventBrowserClose, useConfirmationDialog, isAxiosError, getAxiosErrorMessage, ConfirmationServiceProvider, usePoller } from '@opengeoweb/shared';
|
|
11
11
|
import { Location, DrawRegion, DrawPolygon, DrawFIRLand, Delete, ChevronLeft, Edit, Success, Clock } from '@opengeoweb/theme';
|
|
12
12
|
import moment from 'moment';
|
|
13
13
|
import { debounce } from 'lodash';
|
|
@@ -1038,9 +1038,6 @@ var Change = function Change(_ref) {
|
|
|
1038
1038
|
var isDisabled = _ref.isDisabled,
|
|
1039
1039
|
isReadOnly = _ref.isReadOnly;
|
|
1040
1040
|
|
|
1041
|
-
var _useFormContext = useFormContext(),
|
|
1042
|
-
watch = _useFormContext.watch;
|
|
1043
|
-
|
|
1044
1041
|
var _useDraftFormHelpers = useDraftFormHelpers(),
|
|
1045
1042
|
isRequired = _useDraftFormHelpers.isRequired;
|
|
1046
1043
|
|
|
@@ -1057,18 +1054,19 @@ var Change = function Change(_ref) {
|
|
|
1057
1054
|
isRequired: isRequired
|
|
1058
1055
|
}
|
|
1059
1056
|
},
|
|
1060
|
-
disabled: isDisabled
|
|
1061
|
-
|
|
1057
|
+
disabled: isDisabled,
|
|
1058
|
+
isReadOnly: isReadOnly
|
|
1059
|
+
}, /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
|
|
1062
1060
|
value: "WKN",
|
|
1063
1061
|
label: "Weakening",
|
|
1064
1062
|
disabled: isDisabled,
|
|
1065
1063
|
"data-testid": "change-WKN"
|
|
1066
|
-
}),
|
|
1064
|
+
}), /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
|
|
1067
1065
|
value: "NC",
|
|
1068
1066
|
label: "No change",
|
|
1069
1067
|
disabled: isDisabled,
|
|
1070
1068
|
"data-testid": "change-NC"
|
|
1071
|
-
}),
|
|
1069
|
+
}), /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
|
|
1072
1070
|
value: "INTSF",
|
|
1073
1071
|
label: "Intensifying",
|
|
1074
1072
|
disabled: isDisabled,
|
|
@@ -1119,7 +1117,7 @@ var DrawTools = function DrawTools(_ref) {
|
|
|
1119
1117
|
spacing: 1
|
|
1120
1118
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
1121
1119
|
item: true
|
|
1122
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
1120
|
+
}, /*#__PURE__*/React__default.createElement(CustomTooltip, {
|
|
1123
1121
|
title: "Drop a point as ".concat(type, " position")
|
|
1124
1122
|
}, /*#__PURE__*/React__default.createElement(Radio, {
|
|
1125
1123
|
icon: /*#__PURE__*/React__default.createElement(Location, null),
|
|
@@ -1133,7 +1131,7 @@ var DrawTools = function DrawTools(_ref) {
|
|
|
1133
1131
|
sx: styles$1.radioInput
|
|
1134
1132
|
}))), /*#__PURE__*/React__default.createElement(Grid, {
|
|
1135
1133
|
item: true
|
|
1136
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
1134
|
+
}, /*#__PURE__*/React__default.createElement(CustomTooltip, {
|
|
1137
1135
|
title: "Draw a box as ".concat(type, " position")
|
|
1138
1136
|
}, /*#__PURE__*/React__default.createElement(Radio, {
|
|
1139
1137
|
icon: /*#__PURE__*/React__default.createElement(DrawRegion, null),
|
|
@@ -1146,7 +1144,7 @@ var DrawTools = function DrawTools(_ref) {
|
|
|
1146
1144
|
sx: styles$1.radioInput
|
|
1147
1145
|
}))), /*#__PURE__*/React__default.createElement(Grid, {
|
|
1148
1146
|
item: true
|
|
1149
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
1147
|
+
}, /*#__PURE__*/React__default.createElement(CustomTooltip, {
|
|
1150
1148
|
title: "Draw a shape as ".concat(type, " position")
|
|
1151
1149
|
}, /*#__PURE__*/React__default.createElement(Radio, {
|
|
1152
1150
|
icon: /*#__PURE__*/React__default.createElement(DrawPolygon, null),
|
|
@@ -1159,7 +1157,7 @@ var DrawTools = function DrawTools(_ref) {
|
|
|
1159
1157
|
sx: styles$1.radioInput
|
|
1160
1158
|
}))), /*#__PURE__*/React__default.createElement(Grid, {
|
|
1161
1159
|
item: true
|
|
1162
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
1160
|
+
}, /*#__PURE__*/React__default.createElement(CustomTooltip, {
|
|
1163
1161
|
title: "Set FIR as ".concat(type, " position")
|
|
1164
1162
|
}, /*#__PURE__*/React__default.createElement(Radio, {
|
|
1165
1163
|
icon: /*#__PURE__*/React__default.createElement(DrawFIRLand, null),
|
|
@@ -1172,7 +1170,7 @@ var DrawTools = function DrawTools(_ref) {
|
|
|
1172
1170
|
sx: styles$1.radioInput
|
|
1173
1171
|
}))), /*#__PURE__*/React__default.createElement(Grid, {
|
|
1174
1172
|
item: true
|
|
1175
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
1173
|
+
}, /*#__PURE__*/React__default.createElement(CustomTooltip, {
|
|
1176
1174
|
title: "Remove geometry"
|
|
1177
1175
|
}, /*#__PURE__*/React__default.createElement(Radio, {
|
|
1178
1176
|
icon: /*#__PURE__*/React__default.createElement(Delete, null),
|
|
@@ -1600,6 +1598,10 @@ var rewindGeometry = function rewindGeometry(geoJSON) {
|
|
|
1600
1598
|
}
|
|
1601
1599
|
});
|
|
1602
1600
|
};
|
|
1601
|
+
var getFieldLabel = function getFieldLabel(title, isDisabled) {
|
|
1602
|
+
var action = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'Select';
|
|
1603
|
+
return isDisabled ? title : "".concat(action, " ").concat(title.toLowerCase());
|
|
1604
|
+
};
|
|
1603
1605
|
|
|
1604
1606
|
var location_indicator_mwo$1 = "EHDB";
|
|
1605
1607
|
var firareas$1 = {
|
|
@@ -1769,6 +1771,7 @@ var Levels = function Levels(_ref) {
|
|
|
1769
1771
|
}
|
|
1770
1772
|
},
|
|
1771
1773
|
disabled: isDisabled,
|
|
1774
|
+
isReadOnly: isReadOnly,
|
|
1772
1775
|
onChange: function onChange() {
|
|
1773
1776
|
// Reset default value for the level value to '' so when it rerenders it uses this empty default value
|
|
1774
1777
|
var currentValues = getValues();
|
|
@@ -1788,7 +1791,7 @@ var Levels = function Levels(_ref) {
|
|
|
1788
1791
|
|
|
1789
1792
|
clearErrors(['level', 'lowerLevel']);
|
|
1790
1793
|
}
|
|
1791
|
-
},
|
|
1794
|
+
}, /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
|
|
1792
1795
|
value: "AT",
|
|
1793
1796
|
label: "At",
|
|
1794
1797
|
checked: watch('levelInfoMode') === 'AT' || watch('levelInfoMode') === 'TOPS',
|
|
@@ -1805,7 +1808,7 @@ var Levels = function Levels(_ref) {
|
|
|
1805
1808
|
item: true,
|
|
1806
1809
|
xs: 12,
|
|
1807
1810
|
md: 3
|
|
1808
|
-
},
|
|
1811
|
+
}, /*#__PURE__*/React__default.createElement(FormControlLabel, {
|
|
1809
1812
|
control: /*#__PURE__*/React__default.createElement(Checkbox, {
|
|
1810
1813
|
checked: watch('levelInfoMode') === 'TOPS',
|
|
1811
1814
|
onChange: function onChange() {
|
|
@@ -1832,6 +1835,7 @@ var Levels = function Levels(_ref) {
|
|
|
1832
1835
|
},
|
|
1833
1836
|
sx: styles$2.unit,
|
|
1834
1837
|
disabled: isDisabled,
|
|
1838
|
+
isReadOnly: isReadOnly,
|
|
1835
1839
|
defaultValue: 'FL',
|
|
1836
1840
|
onChange: function onChange() {
|
|
1837
1841
|
if (getValues('level.value') || getValues('level.value') === 0) {
|
|
@@ -1875,8 +1879,9 @@ var Levels = function Levels(_ref) {
|
|
|
1875
1879
|
}
|
|
1876
1880
|
},
|
|
1877
1881
|
disabled: isDisabled,
|
|
1882
|
+
isReadOnly: isReadOnly,
|
|
1878
1883
|
autoFocus: true
|
|
1879
|
-
}))) : null,
|
|
1884
|
+
}))) : null, /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
|
|
1880
1885
|
value: "BETW",
|
|
1881
1886
|
label: "Between",
|
|
1882
1887
|
checked: watch('levelInfoMode') === 'BETW' || watch('levelInfoMode') === 'BETW_SFC',
|
|
@@ -1910,6 +1915,7 @@ var Levels = function Levels(_ref) {
|
|
|
1910
1915
|
},
|
|
1911
1916
|
sx: styles$2.unit,
|
|
1912
1917
|
disabled: isDisabled,
|
|
1918
|
+
isReadOnly: isReadOnly,
|
|
1913
1919
|
defaultValue: 'FL',
|
|
1914
1920
|
onChange: function onChange() {
|
|
1915
1921
|
trigger([].concat(_toConsumableArray(getValues('level.value') || getValues('level.value') === 0 ? ['level.value'] : []), _toConsumableArray(getValues('lowerLevel.value') || getValues('lowerLevel.value') === 0 ? ['lowerLevel.value'] : []), ['lowerLevel.unit']));
|
|
@@ -1951,6 +1957,7 @@ var Levels = function Levels(_ref) {
|
|
|
1951
1957
|
}
|
|
1952
1958
|
},
|
|
1953
1959
|
disabled: isDisabled,
|
|
1960
|
+
isReadOnly: isReadOnly,
|
|
1954
1961
|
onChange: function onChange() {
|
|
1955
1962
|
return (getValues('lowerLevel.value') || getValues('lowerLevel.value') === 0) && trigger('lowerLevel.value');
|
|
1956
1963
|
},
|
|
@@ -1966,7 +1973,7 @@ var Levels = function Levels(_ref) {
|
|
|
1966
1973
|
item: true,
|
|
1967
1974
|
xs: 12,
|
|
1968
1975
|
md: 3
|
|
1969
|
-
},
|
|
1976
|
+
}, /*#__PURE__*/React__default.createElement(FormControlLabel, {
|
|
1970
1977
|
control: /*#__PURE__*/React__default.createElement(Checkbox, {
|
|
1971
1978
|
checked: watch('levelInfoMode') === 'BETW_SFC',
|
|
1972
1979
|
onChange: function onChange() {
|
|
@@ -2000,6 +2007,7 @@ var Levels = function Levels(_ref) {
|
|
|
2000
2007
|
},
|
|
2001
2008
|
sx: styles$2.unit,
|
|
2002
2009
|
disabled: isDisabled,
|
|
2010
|
+
isReadOnly: isReadOnly,
|
|
2003
2011
|
defaultValue: getValues('level.unit') || 'FL',
|
|
2004
2012
|
onChange: function onChange() {
|
|
2005
2013
|
if (getValues('lowerLevel.value') || getValues('lowerLevel.value') === 0) {
|
|
@@ -2048,8 +2056,9 @@ var Levels = function Levels(_ref) {
|
|
|
2048
2056
|
}
|
|
2049
2057
|
}
|
|
2050
2058
|
},
|
|
2051
|
-
disabled: isDisabled
|
|
2052
|
-
|
|
2059
|
+
disabled: isDisabled,
|
|
2060
|
+
isReadOnly: isReadOnly
|
|
2061
|
+
}))))) : null, /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
|
|
2053
2062
|
value: "ABV",
|
|
2054
2063
|
label: "Above",
|
|
2055
2064
|
disabled: isDisabled,
|
|
@@ -2066,7 +2075,7 @@ var Levels = function Levels(_ref) {
|
|
|
2066
2075
|
item: true,
|
|
2067
2076
|
xs: 12,
|
|
2068
2077
|
md: 3
|
|
2069
|
-
},
|
|
2078
|
+
}, /*#__PURE__*/React__default.createElement(FormControlLabel, {
|
|
2070
2079
|
control: /*#__PURE__*/React__default.createElement(Checkbox, {
|
|
2071
2080
|
checked: watch('levelInfoMode') === 'TOPS_ABV',
|
|
2072
2081
|
onChange: function onChange() {
|
|
@@ -2092,6 +2101,7 @@ var Levels = function Levels(_ref) {
|
|
|
2092
2101
|
},
|
|
2093
2102
|
sx: styles$2.unit,
|
|
2094
2103
|
disabled: isDisabled,
|
|
2104
|
+
isReadOnly: isReadOnly,
|
|
2095
2105
|
defaultValue: 'FL',
|
|
2096
2106
|
onChange: function onChange() {
|
|
2097
2107
|
if (getValues('level.value') || getValues('level.value') === 0) {
|
|
@@ -2134,6 +2144,7 @@ var Levels = function Levels(_ref) {
|
|
|
2134
2144
|
}
|
|
2135
2145
|
},
|
|
2136
2146
|
disabled: isDisabled,
|
|
2147
|
+
isReadOnly: isReadOnly,
|
|
2137
2148
|
autoFocus: true
|
|
2138
2149
|
}))) : null)));
|
|
2139
2150
|
};
|
|
@@ -2186,7 +2197,8 @@ var ObservationForecast = function ObservationForecast(_ref) {
|
|
|
2186
2197
|
if (getValues('observationOrForecastTime')) {
|
|
2187
2198
|
trigger('observationOrForecastTime');
|
|
2188
2199
|
}
|
|
2189
|
-
}
|
|
2200
|
+
},
|
|
2201
|
+
isReadOnly: isReadOnly
|
|
2190
2202
|
}, (!isReadOnly || watch('isObservationOrForecast') === 'OBS') && /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
|
|
2191
2203
|
value: "OBS",
|
|
2192
2204
|
label: "Observed",
|
|
@@ -2230,12 +2242,14 @@ var ObservationForecastTime = function ObservationForecastTime(_ref) {
|
|
|
2230
2242
|
var _useFormContext = useFormContext(),
|
|
2231
2243
|
watch = _useFormContext.watch;
|
|
2232
2244
|
|
|
2245
|
+
var label = getFieldLabel('Date and time', isReadOnly);
|
|
2233
2246
|
return (!isReadOnly || watch('observationOrForecastTime') !== null) && /*#__PURE__*/React__default.createElement(ProductFormFieldLayout, {
|
|
2234
2247
|
title: "At"
|
|
2235
2248
|
}, /*#__PURE__*/React__default.createElement(ReactHookFormDateTime, {
|
|
2236
2249
|
disablePast: watch('isObservationOrForecast') === 'FCST',
|
|
2237
2250
|
disableFuture: watch('isObservationOrForecast') === 'OBS',
|
|
2238
2251
|
name: "observationOrForecastTime",
|
|
2252
|
+
label: label,
|
|
2239
2253
|
rules: {
|
|
2240
2254
|
validate: {
|
|
2241
2255
|
isValidDate: isValidDate,
|
|
@@ -2248,6 +2262,7 @@ var ObservationForecastTime = function ObservationForecastTime(_ref) {
|
|
|
2248
2262
|
}
|
|
2249
2263
|
},
|
|
2250
2264
|
disabled: isDisabled,
|
|
2265
|
+
isReadOnly: isReadOnly,
|
|
2251
2266
|
helperText: helperText,
|
|
2252
2267
|
onChange: onChange,
|
|
2253
2268
|
sx: styles$2.helperText
|
|
@@ -2257,6 +2272,7 @@ var ObservationForecastTime = function ObservationForecastTime(_ref) {
|
|
|
2257
2272
|
var Phenomenon = function Phenomenon(_ref) {
|
|
2258
2273
|
var productType = _ref.productType,
|
|
2259
2274
|
isDisabled = _ref.isDisabled,
|
|
2275
|
+
isReadOnly = _ref.isReadOnly,
|
|
2260
2276
|
_ref$onChange = _ref.onChange,
|
|
2261
2277
|
_onChange = _ref$onChange === void 0 ? function () {
|
|
2262
2278
|
return null;
|
|
@@ -2268,15 +2284,17 @@ var Phenomenon = function Phenomenon(_ref) {
|
|
|
2268
2284
|
trigger = _useFormContext.trigger;
|
|
2269
2285
|
|
|
2270
2286
|
var phenomenaList = productType === 'sigmet' ? SigmetPhenomena : AirmetPhenomena;
|
|
2287
|
+
var label = getFieldLabel('Phenomenon', isReadOnly);
|
|
2271
2288
|
return /*#__PURE__*/React__default.createElement(ProductFormFieldLayout, {
|
|
2272
2289
|
title: "What"
|
|
2273
2290
|
}, /*#__PURE__*/React__default.createElement(ReactHookFormSelect, {
|
|
2274
2291
|
name: "phenomenon",
|
|
2275
|
-
label:
|
|
2292
|
+
label: label,
|
|
2276
2293
|
rules: {
|
|
2277
2294
|
required: true
|
|
2278
2295
|
},
|
|
2279
2296
|
disabled: isDisabled,
|
|
2297
|
+
isReadOnly: isReadOnly,
|
|
2280
2298
|
"data-testid": "phenomenon",
|
|
2281
2299
|
onChange: function onChange() {
|
|
2282
2300
|
if (getValues('movementType') === 'NO_VA_EXP') {
|
|
@@ -2498,18 +2516,19 @@ var Progress = function Progress(_ref) {
|
|
|
2498
2516
|
},
|
|
2499
2517
|
onChange: function onChange() {
|
|
2500
2518
|
return setDrawModeType ? setDrawModeType(MapDrawMode.DELETE, StartOrEndDrawing.end) : null;
|
|
2501
|
-
}
|
|
2502
|
-
|
|
2519
|
+
},
|
|
2520
|
+
isReadOnly: isReadOnly
|
|
2521
|
+
}, watch('phenomenon') === 'VA_CLD' && /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
|
|
2503
2522
|
value: "NO_VA_EXP",
|
|
2504
2523
|
label: "No volcanic ash expected",
|
|
2505
2524
|
disabled: isDisabled,
|
|
2506
2525
|
"data-testid": "movementType-NO_VA_EXP"
|
|
2507
|
-
}),
|
|
2526
|
+
}), /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
|
|
2508
2527
|
value: "STATIONARY",
|
|
2509
2528
|
label: "Stationary",
|
|
2510
2529
|
disabled: isDisabled,
|
|
2511
2530
|
"data-testid": "movementType-STATIONARY"
|
|
2512
|
-
}),
|
|
2531
|
+
}), /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
|
|
2513
2532
|
value: "MOVEMENT",
|
|
2514
2533
|
label: "Movement",
|
|
2515
2534
|
disabled: isDisabled,
|
|
@@ -2525,6 +2544,7 @@ var Progress = function Progress(_ref) {
|
|
|
2525
2544
|
},
|
|
2526
2545
|
sx: styles$2.movement,
|
|
2527
2546
|
disabled: isDisabled,
|
|
2547
|
+
isReadOnly: isReadOnly,
|
|
2528
2548
|
"data-testid": "movement-movementDirection",
|
|
2529
2549
|
onChange: function onChange(event) {
|
|
2530
2550
|
event.stopPropagation();
|
|
@@ -2552,6 +2572,7 @@ var Progress = function Progress(_ref) {
|
|
|
2552
2572
|
},
|
|
2553
2573
|
sx: styles$2.unit,
|
|
2554
2574
|
disabled: isDisabled,
|
|
2575
|
+
isReadOnly: isReadOnly,
|
|
2555
2576
|
defaultValue: 'KT',
|
|
2556
2577
|
"data-testid": "movement-movementUnit",
|
|
2557
2578
|
onChange: function onChange(event) {
|
|
@@ -2596,11 +2617,12 @@ var Progress = function Progress(_ref) {
|
|
|
2596
2617
|
}
|
|
2597
2618
|
},
|
|
2598
2619
|
disabled: isDisabled,
|
|
2620
|
+
isReadOnly: isReadOnly,
|
|
2599
2621
|
"data-testid": "movement-movementSpeed",
|
|
2600
2622
|
onChange: function onChange(event) {
|
|
2601
2623
|
return event && event.stopPropagation();
|
|
2602
2624
|
}
|
|
2603
|
-
})))), productType === 'sigmet' &&
|
|
2625
|
+
})))), productType === 'sigmet' && /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
|
|
2604
2626
|
value: "FORECAST_POSITION",
|
|
2605
2627
|
label: "End position",
|
|
2606
2628
|
disabled: isDisabled,
|
|
@@ -2671,7 +2693,8 @@ var Progress = function Progress(_ref) {
|
|
|
2671
2693
|
|
|
2672
2694
|
var SelectFIR = function SelectFIR(_ref) {
|
|
2673
2695
|
var productType = _ref.productType,
|
|
2674
|
-
isDisabled = _ref.isDisabled
|
|
2696
|
+
isDisabled = _ref.isDisabled,
|
|
2697
|
+
isReadOnly = _ref.isReadOnly;
|
|
2675
2698
|
|
|
2676
2699
|
var _useFormContext = useFormContext(),
|
|
2677
2700
|
setValue = _useFormContext.setValue;
|
|
@@ -2691,13 +2714,14 @@ var SelectFIR = function SelectFIR(_ref) {
|
|
|
2691
2714
|
sx: styles$2.containerItem
|
|
2692
2715
|
}, /*#__PURE__*/React__default.createElement(ReactHookFormSelect, {
|
|
2693
2716
|
name: "locationIndicatorATSR",
|
|
2694
|
-
label:
|
|
2717
|
+
label: isReadOnly ? 'FIR' : 'Select FIR',
|
|
2695
2718
|
rules: {
|
|
2696
2719
|
validate: {
|
|
2697
2720
|
isRequired: isRequired
|
|
2698
2721
|
}
|
|
2699
2722
|
},
|
|
2700
2723
|
disabled: isDisabled,
|
|
2724
|
+
isReadOnly: isReadOnly,
|
|
2701
2725
|
defaultValue: defaultATSR,
|
|
2702
2726
|
onChange: function onChange(changeEvent) {
|
|
2703
2727
|
setValue('locationIndicatorATSU', allFIRS[changeEvent.target.value].location_indicator_atsu);
|
|
@@ -2744,9 +2768,6 @@ var Type = function Type(_ref) {
|
|
|
2744
2768
|
var isReadOnly = _ref.isReadOnly,
|
|
2745
2769
|
isDisabled = _ref.isDisabled;
|
|
2746
2770
|
|
|
2747
|
-
var _useFormContext = useFormContext(),
|
|
2748
|
-
watch = _useFormContext.watch;
|
|
2749
|
-
|
|
2750
2771
|
var _useDraftFormHelpers = useDraftFormHelpers(),
|
|
2751
2772
|
isRequired = _useDraftFormHelpers.isRequired;
|
|
2752
2773
|
|
|
@@ -2764,18 +2785,19 @@ var Type = function Type(_ref) {
|
|
|
2764
2785
|
}
|
|
2765
2786
|
},
|
|
2766
2787
|
disabled: isDisabled,
|
|
2788
|
+
isReadOnly: isReadOnly,
|
|
2767
2789
|
defaultValue: "NORMAL"
|
|
2768
|
-
},
|
|
2790
|
+
}, /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
|
|
2769
2791
|
value: "NORMAL",
|
|
2770
2792
|
label: "Normal",
|
|
2771
2793
|
disabled: isDisabled,
|
|
2772
2794
|
"data-testid": "type-NORMAL"
|
|
2773
|
-
}),
|
|
2795
|
+
}), /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
|
|
2774
2796
|
value: "TEST",
|
|
2775
2797
|
label: "Test",
|
|
2776
2798
|
disabled: isDisabled,
|
|
2777
2799
|
"data-testid": "type-TEST"
|
|
2778
|
-
}),
|
|
2800
|
+
}), /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
|
|
2779
2801
|
value: "EXERCISE",
|
|
2780
2802
|
label: "Exercise",
|
|
2781
2803
|
disabled: isDisabled,
|
|
@@ -2808,6 +2830,7 @@ var getValidFromXHoursBeforeMessage = function getValidFromXHoursBeforeMessage(h
|
|
|
2808
2830
|
var ValidFrom = function ValidFrom(_ref) {
|
|
2809
2831
|
var productType = _ref.productType,
|
|
2810
2832
|
isDisabled = _ref.isDisabled,
|
|
2833
|
+
isReadOnly = _ref.isReadOnly,
|
|
2811
2834
|
_ref$onChange = _ref.onChange,
|
|
2812
2835
|
_onChange = _ref$onChange === void 0 ? function () {
|
|
2813
2836
|
return null;
|
|
@@ -2821,11 +2844,13 @@ var ValidFrom = function ValidFrom(_ref) {
|
|
|
2821
2844
|
isRequired = _useDraftFormHelpers.isRequired;
|
|
2822
2845
|
|
|
2823
2846
|
var config = productType === 'sigmet' ? sigmetConfig : airmetConfig;
|
|
2847
|
+
var label = getFieldLabel('Date and time', isReadOnly);
|
|
2824
2848
|
return /*#__PURE__*/React__default.createElement(ProductFormFieldLayout, {
|
|
2825
2849
|
title: "Valid from"
|
|
2826
2850
|
}, /*#__PURE__*/React__default.createElement(ReactHookFormDateTime, {
|
|
2827
2851
|
disablePast: true,
|
|
2828
2852
|
name: "validDateStart",
|
|
2853
|
+
label: label,
|
|
2829
2854
|
defaultNullValue: moment.utc().add(VALID_FROM_TIME_DELAY_IN_MINUTES, 'minutes').format('YYYY-MM-DDTHH:mm:ss[Z]'),
|
|
2830
2855
|
rules: {
|
|
2831
2856
|
validate: {
|
|
@@ -2853,6 +2878,7 @@ var ValidFrom = function ValidFrom(_ref) {
|
|
|
2853
2878
|
_onChange();
|
|
2854
2879
|
},
|
|
2855
2880
|
disabled: isDisabled,
|
|
2881
|
+
isReadOnly: isReadOnly,
|
|
2856
2882
|
"data-testid": "valid-from"
|
|
2857
2883
|
}));
|
|
2858
2884
|
};
|
|
@@ -2882,6 +2908,7 @@ var getDefaultHoursValid = function getDefaultHoursValid(productType) {
|
|
|
2882
2908
|
var ValidUntil = function ValidUntil(_ref) {
|
|
2883
2909
|
var productType = _ref.productType,
|
|
2884
2910
|
isDisabled = _ref.isDisabled,
|
|
2911
|
+
isReadOnly = _ref.isReadOnly,
|
|
2885
2912
|
_ref$onChange = _ref.onChange,
|
|
2886
2913
|
_onChange = _ref$onChange === void 0 ? function () {
|
|
2887
2914
|
return null;
|
|
@@ -2894,6 +2921,7 @@ var ValidUntil = function ValidUntil(_ref) {
|
|
|
2894
2921
|
var _useDraftFormHelpers = useDraftFormHelpers(),
|
|
2895
2922
|
isRequired = _useDraftFormHelpers.isRequired;
|
|
2896
2923
|
|
|
2924
|
+
var label = getFieldLabel('Date and time', isReadOnly);
|
|
2897
2925
|
var config = productType === 'sigmet' ? sigmetConfig : airmetConfig;
|
|
2898
2926
|
var defaultHoursValid = getDefaultHoursValid(productType);
|
|
2899
2927
|
return /*#__PURE__*/React__default.createElement(ProductFormFieldLayout, {
|
|
@@ -2901,6 +2929,7 @@ var ValidUntil = function ValidUntil(_ref) {
|
|
|
2901
2929
|
}, /*#__PURE__*/React__default.createElement(ReactHookFormDateTime, {
|
|
2902
2930
|
disablePast: true,
|
|
2903
2931
|
name: "validDateEnd",
|
|
2932
|
+
label: label,
|
|
2904
2933
|
defaultNullValue: moment.utc().add(defaultHoursValid, 'hour').add(VALID_FROM_TIME_DELAY_IN_MINUTES, 'minutes').format('YYYY-MM-DDTHH:mm:ss[Z]'),
|
|
2905
2934
|
rules: {
|
|
2906
2935
|
validate: {
|
|
@@ -2917,6 +2946,7 @@ var ValidUntil = function ValidUntil(_ref) {
|
|
|
2917
2946
|
}
|
|
2918
2947
|
},
|
|
2919
2948
|
disabled: isDisabled,
|
|
2949
|
+
isReadOnly: isReadOnly,
|
|
2920
2950
|
onChange: function onChange() {
|
|
2921
2951
|
if (getValues('validDateStart')) {
|
|
2922
2952
|
trigger('validDateStart');
|
|
@@ -2984,7 +3014,8 @@ var VolcanicFields = function VolcanicFields(_ref) {
|
|
|
2984
3014
|
},
|
|
2985
3015
|
disabled: isDisabled,
|
|
2986
3016
|
helperText: helperText,
|
|
2987
|
-
upperCase: true
|
|
3017
|
+
upperCase: true,
|
|
3018
|
+
isReadOnly: isReadOnly
|
|
2988
3019
|
})), (!isReadOnly || !!watch('vaSigmetVolcanoCoordinates.latitude')) && /*#__PURE__*/React__default.createElement(Grid, {
|
|
2989
3020
|
item: true,
|
|
2990
3021
|
xs: 6
|
|
@@ -3008,7 +3039,8 @@ var VolcanicFields = function VolcanicFields(_ref) {
|
|
|
3008
3039
|
helperText: helperText,
|
|
3009
3040
|
onChange: function onChange() {
|
|
3010
3041
|
return trigger('vaSigmetVolcanoCoordinates.longitude');
|
|
3011
|
-
}
|
|
3042
|
+
},
|
|
3043
|
+
isReadOnly: isReadOnly
|
|
3012
3044
|
})), (!isReadOnly || !!watch('vaSigmetVolcanoCoordinates.longitude')) && /*#__PURE__*/React__default.createElement(Grid, {
|
|
3013
3045
|
item: true,
|
|
3014
3046
|
xs: 6
|
|
@@ -3032,7 +3064,8 @@ var VolcanicFields = function VolcanicFields(_ref) {
|
|
|
3032
3064
|
onChange: function onChange() {
|
|
3033
3065
|
return trigger('vaSigmetVolcanoCoordinates.latitude');
|
|
3034
3066
|
},
|
|
3035
|
-
sx: styles$2.helperText
|
|
3067
|
+
sx: styles$2.helperText,
|
|
3068
|
+
isReadOnly: isReadOnly
|
|
3036
3069
|
}))));
|
|
3037
3070
|
};
|
|
3038
3071
|
|
|
@@ -3068,6 +3101,7 @@ var validateSurfaceVisibility = function validateSurfaceVisibility(value) {
|
|
|
3068
3101
|
|
|
3069
3102
|
var SurfaceVisibility = function SurfaceVisibility(_ref) {
|
|
3070
3103
|
var isDisabled = _ref.isDisabled,
|
|
3104
|
+
isReadOnly = _ref.isReadOnly,
|
|
3071
3105
|
_ref$onChange = _ref.onChange,
|
|
3072
3106
|
_onChange = _ref$onChange === void 0 ? function () {
|
|
3073
3107
|
return null;
|
|
@@ -3076,6 +3110,8 @@ var SurfaceVisibility = function SurfaceVisibility(_ref) {
|
|
|
3076
3110
|
var _useDraftFormHelpers = useDraftFormHelpers(),
|
|
3077
3111
|
isRequired = _useDraftFormHelpers.isRequired;
|
|
3078
3112
|
|
|
3113
|
+
var visibilityLabel = getFieldLabel('Visibility', isReadOnly);
|
|
3114
|
+
var visibilityCauseLabel = getFieldLabel('Cause', isReadOnly);
|
|
3079
3115
|
return /*#__PURE__*/React__default.createElement(Grid, {
|
|
3080
3116
|
item: true,
|
|
3081
3117
|
container: true,
|
|
@@ -3097,7 +3133,7 @@ var SurfaceVisibility = function SurfaceVisibility(_ref) {
|
|
|
3097
3133
|
}, /*#__PURE__*/React__default.createElement(ReactHookFormNumberField, {
|
|
3098
3134
|
name: "visibilityValue",
|
|
3099
3135
|
"data-testid": "surfaceVisibility-visibilityValue",
|
|
3100
|
-
label:
|
|
3136
|
+
label: visibilityLabel,
|
|
3101
3137
|
helperText: "Value in meters",
|
|
3102
3138
|
rules: {
|
|
3103
3139
|
min: {
|
|
@@ -3113,19 +3149,21 @@ var SurfaceVisibility = function SurfaceVisibility(_ref) {
|
|
|
3113
3149
|
validateSurfaceVisibility: validateSurfaceVisibility
|
|
3114
3150
|
}
|
|
3115
3151
|
},
|
|
3116
|
-
disabled: isDisabled
|
|
3152
|
+
disabled: isDisabled,
|
|
3153
|
+
isReadOnly: isReadOnly
|
|
3117
3154
|
})), /*#__PURE__*/React__default.createElement(Grid, {
|
|
3118
3155
|
item: true,
|
|
3119
3156
|
xs: 12
|
|
3120
3157
|
}, /*#__PURE__*/React__default.createElement(ReactHookFormSelect, {
|
|
3121
3158
|
name: "visibilityCause",
|
|
3122
|
-
label:
|
|
3159
|
+
label: visibilityCauseLabel,
|
|
3123
3160
|
rules: {
|
|
3124
3161
|
validate: {
|
|
3125
3162
|
isRequired: isRequired
|
|
3126
3163
|
}
|
|
3127
3164
|
},
|
|
3128
3165
|
disabled: isDisabled,
|
|
3166
|
+
isReadOnly: isReadOnly,
|
|
3129
3167
|
"data-testid": "surfaceVisibility-visibilityCause",
|
|
3130
3168
|
onChange: function onChange(event) {
|
|
3131
3169
|
event.stopPropagation();
|
|
@@ -3166,6 +3204,7 @@ var validateSurfaceWindDirection = function validateSurfaceWindDirection(value)
|
|
|
3166
3204
|
|
|
3167
3205
|
var SurfaceWind = function SurfaceWind(_ref) {
|
|
3168
3206
|
var isDisabled = _ref.isDisabled,
|
|
3207
|
+
isReadOnly = _ref.isReadOnly,
|
|
3169
3208
|
_ref$onChange = _ref.onChange,
|
|
3170
3209
|
_onChange = _ref$onChange === void 0 ? function () {
|
|
3171
3210
|
return null;
|
|
@@ -3185,6 +3224,8 @@ var SurfaceWind = function SurfaceWind(_ref) {
|
|
|
3185
3224
|
var selectedFIR = watch('locationIndicatorATSR'); // Get allowed speed units based on selected FIR - if no FIR selected, allow all units
|
|
3186
3225
|
|
|
3187
3226
|
var allowedWindUnitsForFir = getAllowedUnits(selectedFIR, allowedUnits, 'surfacewind_unit', WindUnit);
|
|
3227
|
+
var windLabel = getFieldLabel('Wind direction', isReadOnly, 'Set');
|
|
3228
|
+
var speedLabel = getFieldLabel('Speed', isReadOnly, 'Set');
|
|
3188
3229
|
return /*#__PURE__*/React__default.createElement(Grid, {
|
|
3189
3230
|
item: true,
|
|
3190
3231
|
container: true,
|
|
@@ -3205,7 +3246,7 @@ var SurfaceWind = function SurfaceWind(_ref) {
|
|
|
3205
3246
|
sx: styles$2.surfaceWind
|
|
3206
3247
|
}, /*#__PURE__*/React__default.createElement(ReactHookFormNumberField, {
|
|
3207
3248
|
name: "windDirection",
|
|
3208
|
-
label:
|
|
3249
|
+
label: windLabel,
|
|
3209
3250
|
helperText: "Value in degrees",
|
|
3210
3251
|
rules: {
|
|
3211
3252
|
min: {
|
|
@@ -3222,6 +3263,7 @@ var SurfaceWind = function SurfaceWind(_ref) {
|
|
|
3222
3263
|
}
|
|
3223
3264
|
},
|
|
3224
3265
|
disabled: isDisabled,
|
|
3266
|
+
isReadOnly: isReadOnly,
|
|
3225
3267
|
"data-testid": "surfaceWind-windDirection"
|
|
3226
3268
|
})), /*#__PURE__*/React__default.createElement(Grid, {
|
|
3227
3269
|
item: true,
|
|
@@ -3240,6 +3282,7 @@ var SurfaceWind = function SurfaceWind(_ref) {
|
|
|
3240
3282
|
},
|
|
3241
3283
|
sx: styles$2.unit,
|
|
3242
3284
|
disabled: isDisabled,
|
|
3285
|
+
isReadOnly: isReadOnly,
|
|
3243
3286
|
defaultValue: 'KT',
|
|
3244
3287
|
"data-testid": "surfaceWind-windUnit",
|
|
3245
3288
|
onChange: function onChange() {
|
|
@@ -3259,7 +3302,7 @@ var SurfaceWind = function SurfaceWind(_ref) {
|
|
|
3259
3302
|
xs: 7
|
|
3260
3303
|
}, /*#__PURE__*/React__default.createElement(ReactHookFormNumberField, {
|
|
3261
3304
|
name: "windSpeed",
|
|
3262
|
-
label:
|
|
3305
|
+
label: speedLabel,
|
|
3263
3306
|
rules: {
|
|
3264
3307
|
validate: {
|
|
3265
3308
|
isRequired: isRequired,
|
|
@@ -3277,6 +3320,7 @@ var SurfaceWind = function SurfaceWind(_ref) {
|
|
|
3277
3320
|
}
|
|
3278
3321
|
},
|
|
3279
3322
|
disabled: isDisabled,
|
|
3323
|
+
isReadOnly: isReadOnly,
|
|
3280
3324
|
"data-testid": "surfaceWind-windSpeed"
|
|
3281
3325
|
})))));
|
|
3282
3326
|
};
|
|
@@ -3373,7 +3417,10 @@ var CloudLevels = function CloudLevels(_ref) {
|
|
|
3373
3417
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
3374
3418
|
item: true,
|
|
3375
3419
|
xs: 4
|
|
3376
|
-
}, (!isReadOnly || watch('cloudLevelInfoMode') === 'BETW_ABV' || watch('cloudLevelInfoMode') === 'BETW_SFC_ABV') && /*#__PURE__*/React__default.createElement(
|
|
3420
|
+
}, (!isReadOnly || watch('cloudLevelInfoMode') === 'BETW_ABV' || watch('cloudLevelInfoMode') === 'BETW_SFC_ABV') && /*#__PURE__*/React__default.createElement(ReactHookFormFormControl, {
|
|
3421
|
+
disabled: isDisabled,
|
|
3422
|
+
isReadOnly: isReadOnly
|
|
3423
|
+
}, /*#__PURE__*/React__default.createElement(FormControlLabel, {
|
|
3377
3424
|
control: /*#__PURE__*/React__default.createElement(Checkbox, {
|
|
3378
3425
|
checked: watch('cloudLevelInfoMode') === 'BETW_ABV' || watch('cloudLevelInfoMode') === 'BETW_SFC_ABV',
|
|
3379
3426
|
onChange: function onChange() {
|
|
@@ -3409,7 +3456,7 @@ var CloudLevels = function CloudLevels(_ref) {
|
|
|
3409
3456
|
}),
|
|
3410
3457
|
"data-testid": "cloudLevels-Above",
|
|
3411
3458
|
label: "Above"
|
|
3412
|
-
})), /*#__PURE__*/React__default.createElement(Grid, {
|
|
3459
|
+
}))), /*#__PURE__*/React__default.createElement(Grid, {
|
|
3413
3460
|
item: true,
|
|
3414
3461
|
xs: 3
|
|
3415
3462
|
}, /*#__PURE__*/React__default.createElement(ReactHookFormSelect, {
|
|
@@ -3423,6 +3470,7 @@ var CloudLevels = function CloudLevels(_ref) {
|
|
|
3423
3470
|
},
|
|
3424
3471
|
sx: styles$2.unit,
|
|
3425
3472
|
disabled: isDisabled,
|
|
3473
|
+
isReadOnly: isReadOnly,
|
|
3426
3474
|
defaultValue: 'FT',
|
|
3427
3475
|
onChange: function onChange() {
|
|
3428
3476
|
if (getValues('cloudLevel.value') || getValues('cloudLevel.value') === 0) {
|
|
@@ -3471,6 +3519,7 @@ var CloudLevels = function CloudLevels(_ref) {
|
|
|
3471
3519
|
}
|
|
3472
3520
|
},
|
|
3473
3521
|
disabled: isDisabled,
|
|
3522
|
+
isReadOnly: isReadOnly,
|
|
3474
3523
|
onChange: function onChange() {
|
|
3475
3524
|
return (getValues('cloudLowerLevel.value') || getValues('cloudLowerLevel.value') === 0) && trigger('cloudLowerLevel.value');
|
|
3476
3525
|
}
|
|
@@ -3481,7 +3530,10 @@ var CloudLevels = function CloudLevels(_ref) {
|
|
|
3481
3530
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
3482
3531
|
item: true,
|
|
3483
3532
|
xs: 4
|
|
3484
|
-
}, (!isReadOnly || watch('cloudLevelInfoMode') === 'BETW_SFC' || watch('cloudLevelInfoMode') === 'BETW_SFC_ABV') && /*#__PURE__*/React__default.createElement(
|
|
3533
|
+
}, (!isReadOnly || watch('cloudLevelInfoMode') === 'BETW_SFC' || watch('cloudLevelInfoMode') === 'BETW_SFC_ABV') && /*#__PURE__*/React__default.createElement(ReactHookFormFormControl, {
|
|
3534
|
+
disabled: isDisabled,
|
|
3535
|
+
isReadOnly: isReadOnly
|
|
3536
|
+
}, /*#__PURE__*/React__default.createElement(FormControlLabel, {
|
|
3485
3537
|
control: /*#__PURE__*/React__default.createElement(Checkbox, {
|
|
3486
3538
|
checked: watch('cloudLevelInfoMode') === 'BETW_SFC' || watch('cloudLevelInfoMode') === 'BETW_SFC_ABV',
|
|
3487
3539
|
onChange: function onChange() {
|
|
@@ -3517,7 +3569,7 @@ var CloudLevels = function CloudLevels(_ref) {
|
|
|
3517
3569
|
}),
|
|
3518
3570
|
"data-testid": "cloudLevels-SFC",
|
|
3519
3571
|
label: "SFC"
|
|
3520
|
-
})), watch('cloudLevelInfoMode') !== 'BETW_SFC' && watch('cloudLevelInfoMode') !== 'BETW_SFC_ABV' && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Grid, {
|
|
3572
|
+
}))), watch('cloudLevelInfoMode') !== 'BETW_SFC' && watch('cloudLevelInfoMode') !== 'BETW_SFC_ABV' && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Grid, {
|
|
3521
3573
|
item: true,
|
|
3522
3574
|
xs: 3
|
|
3523
3575
|
}, /*#__PURE__*/React__default.createElement(ReactHookFormSelect, {
|
|
@@ -3531,6 +3583,7 @@ var CloudLevels = function CloudLevels(_ref) {
|
|
|
3531
3583
|
},
|
|
3532
3584
|
sx: styles$2.unit,
|
|
3533
3585
|
disabled: isDisabled,
|
|
3586
|
+
isReadOnly: isReadOnly,
|
|
3534
3587
|
defaultValue: getValues('cloudLevel.unit') ? getValues('cloudLevel.unit') : 'FT',
|
|
3535
3588
|
onChange: function onChange() {
|
|
3536
3589
|
if (getValues('cloudLowerLevel.value') || getValues('cloudLowerLevel.value') === 0) {
|
|
@@ -3582,7 +3635,8 @@ var CloudLevels = function CloudLevels(_ref) {
|
|
|
3582
3635
|
}
|
|
3583
3636
|
}
|
|
3584
3637
|
},
|
|
3585
|
-
disabled: isDisabled
|
|
3638
|
+
disabled: isDisabled,
|
|
3639
|
+
isReadOnly: isReadOnly
|
|
3586
3640
|
})))))));
|
|
3587
3641
|
};
|
|
3588
3642
|
|
|
@@ -3715,7 +3769,8 @@ var ProductFormTAC = function ProductFormTAC(_ref) {
|
|
|
3715
3769
|
* */
|
|
3716
3770
|
|
|
3717
3771
|
var IssuedAt = function IssuedAt(_ref) {
|
|
3718
|
-
var date = _ref.date
|
|
3772
|
+
var date = _ref.date,
|
|
3773
|
+
isReadOnly = _ref.isReadOnly;
|
|
3719
3774
|
return /*#__PURE__*/React__default.createElement(ProductFormFieldLayout, {
|
|
3720
3775
|
title: "Issued at"
|
|
3721
3776
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
@@ -3725,7 +3780,7 @@ var IssuedAt = function IssuedAt(_ref) {
|
|
|
3725
3780
|
variant: "body2",
|
|
3726
3781
|
sx: Object.assign(Object.assign({}, styles$2.body), {
|
|
3727
3782
|
fontSize: '1rem',
|
|
3728
|
-
color: 'geowebColors.buttons.primary.disabled.color'
|
|
3783
|
+
color: isReadOnly ? 'geowebColors.typographyAndIcons.text' : 'geowebColors.buttons.primary.disabled.color'
|
|
3729
3784
|
})
|
|
3730
3785
|
}, date)));
|
|
3731
3786
|
};
|
|
@@ -4154,6 +4209,7 @@ var SigmetForm = function SigmetForm(_ref) {
|
|
|
4154
4209
|
}, !isCancelSigmet && /*#__PURE__*/React__default.createElement(Phenomenon, {
|
|
4155
4210
|
productType: "sigmet",
|
|
4156
4211
|
isDisabled: isDisabled,
|
|
4212
|
+
isReadOnly: isReadOnly,
|
|
4157
4213
|
onChange: onChangeForm
|
|
4158
4214
|
}), !isCancelSigmet && /*#__PURE__*/React__default.createElement(ObservationForecast, {
|
|
4159
4215
|
isDisabled: isDisabled,
|
|
@@ -4170,14 +4226,17 @@ var SigmetForm = function SigmetForm(_ref) {
|
|
|
4170
4226
|
}), /*#__PURE__*/React__default.createElement(ValidFrom, {
|
|
4171
4227
|
productType: "sigmet",
|
|
4172
4228
|
isDisabled: isDisabled,
|
|
4229
|
+
isReadOnly: isReadOnly,
|
|
4173
4230
|
onChange: onChangeForm
|
|
4174
4231
|
}), /*#__PURE__*/React__default.createElement(ValidUntil, {
|
|
4175
4232
|
productType: "sigmet",
|
|
4176
4233
|
isDisabled: isDisabled,
|
|
4234
|
+
isReadOnly: isReadOnly,
|
|
4177
4235
|
onChange: onChangeForm
|
|
4178
4236
|
}), /*#__PURE__*/React__default.createElement(SelectFIR, {
|
|
4179
4237
|
productType: "sigmet",
|
|
4180
|
-
isDisabled: isDisabled
|
|
4238
|
+
isDisabled: isDisabled,
|
|
4239
|
+
isReadOnly: isReadOnly
|
|
4181
4240
|
}), /*#__PURE__*/React__default.createElement(StartGeometry, {
|
|
4182
4241
|
isReadOnly: isReadOnly,
|
|
4183
4242
|
drawMode: drawMode,
|
|
@@ -4211,7 +4270,8 @@ var SigmetForm = function SigmetForm(_ref) {
|
|
|
4211
4270
|
sx: styles$2.body,
|
|
4212
4271
|
"data-testid": "vaSigmetMoveToFIR"
|
|
4213
4272
|
}, "Volcanic Cloud is moving in the direction of:", ' ', /*#__PURE__*/React__default.createElement("b", null, " ", watch('vaSigmetMoveToFIR'))))), /*#__PURE__*/React__default.createElement(IssuedAt, {
|
|
4214
|
-
date: getProductIssueDate(initialSigmet, initialCancelSigmet)
|
|
4273
|
+
date: getProductIssueDate(initialSigmet, initialCancelSigmet),
|
|
4274
|
+
isReadOnly: isReadOnly
|
|
4215
4275
|
}), /*#__PURE__*/React__default.createElement(Tac, {
|
|
4216
4276
|
tac: tac
|
|
4217
4277
|
}, /*#__PURE__*/React__default.createElement(ReactHookFormHiddenInput, {
|
|
@@ -4343,11 +4403,14 @@ var AirmetForm = function AirmetForm(_ref) {
|
|
|
4343
4403
|
}, !isCancelAirmet && /*#__PURE__*/React__default.createElement(Phenomenon, {
|
|
4344
4404
|
productType: "airmet",
|
|
4345
4405
|
isDisabled: isDisabled,
|
|
4406
|
+
isReadOnly: isReadOnly,
|
|
4346
4407
|
onChange: onChangeForm
|
|
4347
4408
|
}), !isCancelAirmet && phenomenon === 'SFC_VIS' && /*#__PURE__*/React__default.createElement(SurfaceVisibility, {
|
|
4409
|
+
isReadOnly: isReadOnly,
|
|
4348
4410
|
isDisabled: isDisabled,
|
|
4349
4411
|
onChange: onChangeForm
|
|
4350
4412
|
}), !isCancelAirmet && phenomenon === 'SFC_WIND' && /*#__PURE__*/React__default.createElement(SurfaceWind, {
|
|
4413
|
+
isReadOnly: isReadOnly,
|
|
4351
4414
|
isDisabled: isDisabled,
|
|
4352
4415
|
onChange: onChangeForm
|
|
4353
4416
|
}), !isCancelAirmet && /*#__PURE__*/React__default.createElement(ObservationForecast, {
|
|
@@ -4360,14 +4423,17 @@ var AirmetForm = function AirmetForm(_ref) {
|
|
|
4360
4423
|
onChange: onChangeForm
|
|
4361
4424
|
}), /*#__PURE__*/React__default.createElement(ValidFrom, {
|
|
4362
4425
|
productType: "airmet",
|
|
4426
|
+
isReadOnly: isReadOnly,
|
|
4363
4427
|
isDisabled: isDisabled,
|
|
4364
4428
|
onChange: onChangeForm
|
|
4365
4429
|
}), /*#__PURE__*/React__default.createElement(ValidUntil, {
|
|
4366
4430
|
productType: "airmet",
|
|
4431
|
+
isReadOnly: isReadOnly,
|
|
4367
4432
|
isDisabled: isDisabled,
|
|
4368
4433
|
onChange: onChangeForm
|
|
4369
4434
|
}), /*#__PURE__*/React__default.createElement(SelectFIR, {
|
|
4370
4435
|
productType: "airmet",
|
|
4436
|
+
isReadOnly: isReadOnly,
|
|
4371
4437
|
isDisabled: isDisabled
|
|
4372
4438
|
}), /*#__PURE__*/React__default.createElement(StartGeometry, {
|
|
4373
4439
|
isReadOnly: isReadOnly,
|
|
@@ -4394,6 +4460,7 @@ var AirmetForm = function AirmetForm(_ref) {
|
|
|
4394
4460
|
isDisabled: isDisabled,
|
|
4395
4461
|
isReadOnly: isReadOnly
|
|
4396
4462
|
}), /*#__PURE__*/React__default.createElement(IssuedAt, {
|
|
4463
|
+
isReadOnly: isReadOnly,
|
|
4397
4464
|
date: getProductIssueDate(initialAirmet, initialCancelAirmet)
|
|
4398
4465
|
}), /*#__PURE__*/React__default.createElement(Tac, {
|
|
4399
4466
|
tac: tac
|
|
@@ -4537,8 +4604,7 @@ var ContentDialog = function ContentDialog(_a) {
|
|
|
4537
4604
|
var styles = {
|
|
4538
4605
|
activeStatus: {
|
|
4539
4606
|
color: '#72bb23',
|
|
4540
|
-
paddingLeft: '6px'
|
|
4541
|
-
paddingTop: '2px'
|
|
4607
|
+
paddingLeft: '6px'
|
|
4542
4608
|
},
|
|
4543
4609
|
font: {
|
|
4544
4610
|
fontWeight: 'normal'
|
|
@@ -4566,21 +4632,30 @@ var getStatusTagList = function getStatusTagList(product) {
|
|
|
4566
4632
|
if (cancelsSeqId !== null) {
|
|
4567
4633
|
return /*#__PURE__*/React__default.createElement(StatusTag, {
|
|
4568
4634
|
content: "cancels ".concat(cancelsSeqId),
|
|
4569
|
-
color: "red"
|
|
4635
|
+
color: "red",
|
|
4636
|
+
sx: {
|
|
4637
|
+
width: '80px'
|
|
4638
|
+
}
|
|
4570
4639
|
});
|
|
4571
4640
|
}
|
|
4572
4641
|
|
|
4573
4642
|
if (product.status === 'CANCELLED') {
|
|
4574
4643
|
return /*#__PURE__*/React__default.createElement(StatusTag, {
|
|
4575
4644
|
content: "cancelled ".concat(product.sequence),
|
|
4576
|
-
color: "red"
|
|
4645
|
+
color: "red",
|
|
4646
|
+
sx: {
|
|
4647
|
+
width: '80px'
|
|
4648
|
+
}
|
|
4577
4649
|
});
|
|
4578
4650
|
}
|
|
4579
4651
|
|
|
4580
4652
|
if (moment(product.validDateEnd) < moment.utc(new Date())) {
|
|
4581
4653
|
return /*#__PURE__*/React__default.createElement(StatusTag, {
|
|
4582
4654
|
content: "expired",
|
|
4583
|
-
color: "grey"
|
|
4655
|
+
color: "grey",
|
|
4656
|
+
sx: {
|
|
4657
|
+
width: '80px'
|
|
4658
|
+
}
|
|
4584
4659
|
});
|
|
4585
4660
|
}
|
|
4586
4661
|
|
|
@@ -4588,7 +4663,8 @@ var getStatusTagList = function getStatusTagList(product) {
|
|
|
4588
4663
|
content: product.status.toLowerCase(),
|
|
4589
4664
|
color: product.status === 'PUBLISHED' ? 'green' : 'grey',
|
|
4590
4665
|
sx: {
|
|
4591
|
-
marginRight: '0!important'
|
|
4666
|
+
marginRight: '0!important',
|
|
4667
|
+
width: '80px'
|
|
4592
4668
|
}
|
|
4593
4669
|
});
|
|
4594
4670
|
};
|
|
@@ -4668,36 +4744,67 @@ var ProductListRow = function ProductListRow(_ref2) {
|
|
|
4668
4744
|
variant: "outlined",
|
|
4669
4745
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
4670
4746
|
sx: function sx(theme) {
|
|
4671
|
-
return
|
|
4747
|
+
return Object.assign({
|
|
4672
4748
|
width: '100%',
|
|
4673
|
-
|
|
4674
|
-
|
|
4675
|
-
|
|
4676
|
-
|
|
4677
|
-
|
|
4678
|
-
|
|
4679
|
-
|
|
4680
|
-
|
|
4681
|
-
|
|
4682
|
-
|
|
4683
|
-
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
|
|
4749
|
+
'.wrapper-container': _defineProperty({
|
|
4750
|
+
paddingLeft: 1,
|
|
4751
|
+
paddingRight: 1,
|
|
4752
|
+
paddingTop: 1.5,
|
|
4753
|
+
paddingBottom: 1.5,
|
|
4754
|
+
'&:last-child': {
|
|
4755
|
+
paddingBottom: 1.5
|
|
4756
|
+
}
|
|
4757
|
+
}, theme.breakpoints.up('sm'), {
|
|
4758
|
+
paddingLeft: 4,
|
|
4759
|
+
paddingRight: 4,
|
|
4760
|
+
paddingTop: 2,
|
|
4761
|
+
paddingBottom: 2,
|
|
4762
|
+
'&:last-child': {
|
|
4763
|
+
paddingBottom: 2
|
|
4764
|
+
}
|
|
4765
|
+
})
|
|
4766
|
+
}, !IS_JEST && {
|
|
4767
|
+
'@container (max-width: 768px)': {
|
|
4768
|
+
'.wrapper-container:not(.container-query-polyfill)': {
|
|
4769
|
+
paddingLeft: 1,
|
|
4770
|
+
paddingRight: 1,
|
|
4771
|
+
paddingTop: 1.5,
|
|
4772
|
+
paddingBottom: 1.5
|
|
4773
|
+
},
|
|
4774
|
+
'.col-1:not(.container-query-polyfill)': {
|
|
4775
|
+
maxWidth: '25%',
|
|
4776
|
+
flexBasis: '25%'
|
|
4777
|
+
},
|
|
4778
|
+
'.col-2:not(.container-query-polyfill)': {
|
|
4779
|
+
maxWidth: '75%',
|
|
4780
|
+
flexBasis: '75%'
|
|
4781
|
+
},
|
|
4782
|
+
'.col-3:not(.container-query-polyfill)': {
|
|
4783
|
+
maxWidth: '100%',
|
|
4784
|
+
flexBasis: '100%'
|
|
4785
|
+
},
|
|
4786
|
+
'.col-4:not(.container-query-polyfill)': {
|
|
4787
|
+
maxWidth: '100%',
|
|
4788
|
+
flexBasis: '100%',
|
|
4789
|
+
justifyContent: 'center'
|
|
4790
|
+
}
|
|
4687
4791
|
}
|
|
4688
4792
|
});
|
|
4689
4793
|
}
|
|
4794
|
+
}, /*#__PURE__*/React__default.createElement(Box, {
|
|
4795
|
+
className: "wrapper-container"
|
|
4690
4796
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
4691
4797
|
container: true,
|
|
4692
4798
|
alignItems: "center",
|
|
4693
4799
|
spacing: 2
|
|
4694
4800
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
4801
|
+
className: "col-1",
|
|
4695
4802
|
item: true,
|
|
4696
4803
|
xs: 3,
|
|
4697
4804
|
sm: 1
|
|
4698
4805
|
}, phenomenon !== null && /*#__PURE__*/React__default.createElement(ProductListRowHeader, {
|
|
4699
4806
|
title: productType.toUpperCase()
|
|
4700
|
-
}), /*#__PURE__*/React__default.createElement(
|
|
4807
|
+
}), /*#__PURE__*/React__default.createElement(CustomTooltip, {
|
|
4701
4808
|
title: phenomenon !== null ? getPhenomenon(productType, phenomenon) : '',
|
|
4702
4809
|
placement: "bottom-start"
|
|
4703
4810
|
}, /*#__PURE__*/React__default.createElement(Typography, {
|
|
@@ -4705,12 +4812,13 @@ var ProductListRow = function ProductListRow(_ref2) {
|
|
|
4705
4812
|
noWrap: true,
|
|
4706
4813
|
sx: styles.font
|
|
4707
4814
|
}, phenomenon !== null ? phenomenon : 'Cancel'))), /*#__PURE__*/React__default.createElement(Grid, {
|
|
4815
|
+
className: "col-2",
|
|
4708
4816
|
item: true,
|
|
4709
4817
|
xs: 9,
|
|
4710
4818
|
sm: 3
|
|
4711
4819
|
}, /*#__PURE__*/React__default.createElement(ProductListRowHeader, {
|
|
4712
4820
|
title: "Issue time"
|
|
4713
|
-
}), /*#__PURE__*/React__default.createElement(
|
|
4821
|
+
}), /*#__PURE__*/React__default.createElement(CustomTooltip, {
|
|
4714
4822
|
title: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(ProductListRowHeader, {
|
|
4715
4823
|
title: "TAC"
|
|
4716
4824
|
}), /*#__PURE__*/React__default.createElement(Typography, {
|
|
@@ -4745,9 +4853,10 @@ var ProductListRow = function ProductListRow(_ref2) {
|
|
|
4745
4853
|
sx: styles.font,
|
|
4746
4854
|
"data-testid": "issueTime"
|
|
4747
4855
|
}, product.issueDate ? "".concat(moment.utc(product.issueDate).format('DD MMM YYYY, HH:mm'), " UTC") : '(Not published)'))), /*#__PURE__*/React__default.createElement(Grid, {
|
|
4856
|
+
className: "col-3",
|
|
4748
4857
|
item: true,
|
|
4749
4858
|
xs: 12,
|
|
4750
|
-
sm:
|
|
4859
|
+
sm: 5
|
|
4751
4860
|
}, /*#__PURE__*/React__default.createElement(ProductListRowHeader, {
|
|
4752
4861
|
title: "Valid time"
|
|
4753
4862
|
}), /*#__PURE__*/React__default.createElement(Typography, {
|
|
@@ -4756,10 +4865,12 @@ var ProductListRow = function ProductListRow(_ref2) {
|
|
|
4756
4865
|
"data-testid": "validTime"
|
|
4757
4866
|
}, validTime)), /*#__PURE__*/React__default.createElement(Grid, {
|
|
4758
4867
|
item: true,
|
|
4868
|
+
className: "col-4",
|
|
4759
4869
|
xs: 12,
|
|
4760
|
-
sm:
|
|
4870
|
+
sm: 3,
|
|
4761
4871
|
container: true,
|
|
4762
4872
|
justifyContent: "center",
|
|
4873
|
+
alignItems: "center",
|
|
4763
4874
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
4764
4875
|
sx: function sx(theme) {
|
|
4765
4876
|
return _defineProperty({}, theme.breakpoints.up('sm'), {
|
|
@@ -4778,7 +4889,7 @@ var ProductListRow = function ProductListRow(_ref2) {
|
|
|
4778
4889
|
},
|
|
4779
4890
|
variant: "flat",
|
|
4780
4891
|
startIcon: /*#__PURE__*/React__default.createElement(Edit, null)
|
|
4781
|
-
}, "DRAFT") : getStatusTagList(product, cancelsSeqId), product.status === 'PUBLISHED' && cancelsSeqId === null && getActiveStatus(product))));
|
|
4892
|
+
}, "DRAFT") : getStatusTagList(product, cancelsSeqId), product.status === 'PUBLISHED' && cancelsSeqId === null && getActiveStatus(product)))));
|
|
4782
4893
|
};
|
|
4783
4894
|
|
|
4784
4895
|
/* *
|
|
@@ -4833,7 +4944,8 @@ var ProductList = function ProductList(_ref) {
|
|
|
4833
4944
|
dataTestId: "productList-alert"
|
|
4834
4945
|
}), productList && /*#__PURE__*/React__default.createElement(List, {
|
|
4835
4946
|
sx: {
|
|
4836
|
-
paddingTop: 4
|
|
4947
|
+
paddingTop: 4,
|
|
4948
|
+
containerType: 'inline-size'
|
|
4837
4949
|
}
|
|
4838
4950
|
}, productList.map(function (productListItem, index) {
|
|
4839
4951
|
var product = productListItem[productType];
|
|
@@ -4845,7 +4957,7 @@ var ProductList = function ProductList(_ref) {
|
|
|
4845
4957
|
},
|
|
4846
4958
|
key: product.sequence && product.issueDate ? "".concat(product.sequence, "-").concat(product.issueDate) : "draft-".concat(index),
|
|
4847
4959
|
sx: {
|
|
4848
|
-
padding:
|
|
4960
|
+
padding: 0.25
|
|
4849
4961
|
}
|
|
4850
4962
|
}, /*#__PURE__*/React__default.createElement(ProductListRow, {
|
|
4851
4963
|
product: product,
|