@opengeoweb/sigmet-airmet 3.0.0 → 4.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 +134 -176
- package/index.umd.js +134 -173
- package/lib/components/ProductForms/ProductForm.styles.d.ts +45 -1
- package/lib/components/ProductList/ProductListRow.d.ts +1 -1
- package/lib/utils/__mocks__/api.d.ts +1 -20
- package/lib/utils/api.d.ts +17 -0
- package/lib/utils/fakeApi.d.ts +2 -6
- package/package.json +8 -8
package/index.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default from 'react';
|
|
3
|
-
import { FormControlLabel, Radio, Grid, Typography, Tooltip, Button, Checkbox, MenuItem, FormHelperText, Dialog, DialogTitle, DialogContent, Card, CardContent, List, ListItem, Skeleton, Backdrop, CircularProgress } from '@mui/material';
|
|
3
|
+
import { FormControlLabel, Radio, Grid, Typography, Tooltip, Button, Checkbox, MenuItem, FormHelperText, Box, Dialog, DialogTitle, DialogContent, Card, CardContent, List, ListItem, Skeleton, Backdrop, CircularProgress } from '@mui/material';
|
|
4
4
|
import { useFormContext } from 'react-hook-form';
|
|
5
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';
|
|
6
6
|
import { useApiContext, useApi, createApiInstance } from '@opengeoweb/api';
|
|
@@ -9,7 +9,6 @@ import { useDispatch, useSelector, shallowEqual } from 'react-redux';
|
|
|
9
9
|
import { mapTypes, mapSelectors, generateMapId, generateTimesliderId, SyncGroups, generateLayerId, mapActions, publicLayers, MapControls, LayerManagerMapButtonConnect, LegendMapButtonConnect, MultiDimensionSelectMapButtonsConnect, MapViewConnect, MapViewLayer, TimeSliderConnect, LegendConnect } from '@opengeoweb/core';
|
|
10
10
|
import * as turf from '@turf/turf';
|
|
11
11
|
import { polygonToLineString, booleanClockwise, rewind } from '@turf/turf';
|
|
12
|
-
import makeStyles from '@mui/styles/makeStyles';
|
|
13
12
|
import { useDraftFormHelpers, useIsMounted, StatusTag, AlertBanner, usePreventBrowserClose, useConfirmationDialog, isAxiosError, getAxiosErrorMessage, ConfirmationServiceProvider, usePoller } from '@opengeoweb/shared';
|
|
14
13
|
import { Location, DrawRegion, DrawPolygon, DrawFIRLand, Delete, ChevronLeft, Info, Edit, Success, Clock } from '@opengeoweb/theme';
|
|
15
14
|
import moment from 'moment';
|
|
@@ -1118,7 +1117,7 @@ var createInterSections = function createInterSections(geoJSONs) {
|
|
|
1118
1117
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
1119
1118
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
1120
1119
|
* */
|
|
1121
|
-
var
|
|
1120
|
+
var styles$4 = {
|
|
1122
1121
|
productForm: {
|
|
1123
1122
|
overflowY: 'scroll',
|
|
1124
1123
|
overflowX: 'hidden',
|
|
@@ -1135,19 +1134,19 @@ var useStyles$6 = makeStyles({
|
|
|
1135
1134
|
paddingTop: '8px'
|
|
1136
1135
|
},
|
|
1137
1136
|
volcanicField: {
|
|
1138
|
-
marginBottom:
|
|
1137
|
+
marginBottom: 2
|
|
1139
1138
|
},
|
|
1140
1139
|
surfaceVisibility: {
|
|
1141
|
-
marginBottom:
|
|
1140
|
+
marginBottom: 2
|
|
1142
1141
|
},
|
|
1143
1142
|
surfaceWind: {
|
|
1144
|
-
marginBottom:
|
|
1143
|
+
marginBottom: 2
|
|
1145
1144
|
},
|
|
1146
1145
|
levelField: {
|
|
1147
|
-
marginBottom:
|
|
1146
|
+
marginBottom: 2
|
|
1148
1147
|
},
|
|
1149
1148
|
movement: {
|
|
1150
|
-
marginBottom:
|
|
1149
|
+
marginBottom: 2
|
|
1151
1150
|
},
|
|
1152
1151
|
latitude: {
|
|
1153
1152
|
width: '97%'
|
|
@@ -1162,7 +1161,7 @@ var useStyles$6 = makeStyles({
|
|
|
1162
1161
|
drawSection: {
|
|
1163
1162
|
padding: '10px 0px'
|
|
1164
1163
|
}
|
|
1165
|
-
}
|
|
1164
|
+
};
|
|
1166
1165
|
|
|
1167
1166
|
/*! *****************************************************************************
|
|
1168
1167
|
Copyright (c) Microsoft Corporation.
|
|
@@ -1250,12 +1249,11 @@ var Change = function Change(_ref) {
|
|
|
1250
1249
|
var _useDraftFormHelpers = useDraftFormHelpers(),
|
|
1251
1250
|
isRequired = _useDraftFormHelpers.isRequired;
|
|
1252
1251
|
|
|
1253
|
-
var classes = useStyles$6();
|
|
1254
1252
|
return /*#__PURE__*/React__default.createElement(Grid, {
|
|
1255
1253
|
item: true,
|
|
1256
1254
|
container: true,
|
|
1257
1255
|
spacing: 2,
|
|
1258
|
-
|
|
1256
|
+
sx: styles$4.containerItem
|
|
1259
1257
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
1260
1258
|
item: true,
|
|
1261
1259
|
xs: 4,
|
|
@@ -1263,7 +1261,7 @@ var Change = function Change(_ref) {
|
|
|
1263
1261
|
justifyContent: "flex-end"
|
|
1264
1262
|
}, /*#__PURE__*/React__default.createElement(Typography, {
|
|
1265
1263
|
variant: "subtitle1",
|
|
1266
|
-
|
|
1264
|
+
sx: styles$4.label
|
|
1267
1265
|
}, "Change")), /*#__PURE__*/React__default.createElement(Grid, {
|
|
1268
1266
|
item: true,
|
|
1269
1267
|
xs: 8,
|
|
@@ -1314,7 +1312,7 @@ var Change = function Change(_ref) {
|
|
|
1314
1312
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
1315
1313
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
1316
1314
|
* */
|
|
1317
|
-
var
|
|
1315
|
+
var styles$3 = {
|
|
1318
1316
|
drawButtons: {
|
|
1319
1317
|
color: '#0075a9',
|
|
1320
1318
|
borderRadius: '5px',
|
|
@@ -1328,14 +1326,13 @@ var useStyles$5 = makeStyles({
|
|
|
1328
1326
|
border: 'solid 1px #0075a9',
|
|
1329
1327
|
padding: '2px'
|
|
1330
1328
|
}
|
|
1331
|
-
}
|
|
1329
|
+
};
|
|
1332
1330
|
|
|
1333
1331
|
var DrawTools = function DrawTools(_ref) {
|
|
1334
1332
|
var _ref$type = _ref.type,
|
|
1335
1333
|
type = _ref$type === void 0 ? '' : _ref$type,
|
|
1336
1334
|
drawMode = _ref.drawMode,
|
|
1337
1335
|
setDrawMode = _ref.setDrawMode;
|
|
1338
|
-
var classes = useStyles$5();
|
|
1339
1336
|
return /*#__PURE__*/React__default.createElement(Grid, {
|
|
1340
1337
|
item: true,
|
|
1341
1338
|
xs: 12,
|
|
@@ -1348,11 +1345,11 @@ var DrawTools = function DrawTools(_ref) {
|
|
|
1348
1345
|
title: "Drop a point as ".concat(type, " position")
|
|
1349
1346
|
}, /*#__PURE__*/React__default.createElement(Radio, {
|
|
1350
1347
|
icon: /*#__PURE__*/React__default.createElement(Location, {
|
|
1351
|
-
|
|
1348
|
+
sx: styles$3.drawButtons
|
|
1352
1349
|
}),
|
|
1353
1350
|
value: true,
|
|
1354
1351
|
checkedIcon: /*#__PURE__*/React__default.createElement(Location, {
|
|
1355
|
-
|
|
1352
|
+
sx: styles$3.drawButtonsSelected
|
|
1356
1353
|
}),
|
|
1357
1354
|
checked: drawMode === MapDrawMode.POINT,
|
|
1358
1355
|
onChange: function onChange() {
|
|
@@ -1365,10 +1362,10 @@ var DrawTools = function DrawTools(_ref) {
|
|
|
1365
1362
|
title: "Draw a box as ".concat(type, " position")
|
|
1366
1363
|
}, /*#__PURE__*/React__default.createElement(Radio, {
|
|
1367
1364
|
icon: /*#__PURE__*/React__default.createElement(DrawRegion, {
|
|
1368
|
-
|
|
1365
|
+
sx: styles$3.drawButtons
|
|
1369
1366
|
}),
|
|
1370
1367
|
checkedIcon: /*#__PURE__*/React__default.createElement(DrawRegion, {
|
|
1371
|
-
|
|
1368
|
+
sx: styles$3.drawButtonsSelected
|
|
1372
1369
|
}),
|
|
1373
1370
|
checked: drawMode === MapDrawMode.BOX,
|
|
1374
1371
|
onChange: function onChange() {
|
|
@@ -1381,10 +1378,10 @@ var DrawTools = function DrawTools(_ref) {
|
|
|
1381
1378
|
title: "Draw a shape as ".concat(type, " position")
|
|
1382
1379
|
}, /*#__PURE__*/React__default.createElement(Radio, {
|
|
1383
1380
|
icon: /*#__PURE__*/React__default.createElement(DrawPolygon, {
|
|
1384
|
-
|
|
1381
|
+
sx: styles$3.drawButtons
|
|
1385
1382
|
}),
|
|
1386
1383
|
checkedIcon: /*#__PURE__*/React__default.createElement(DrawPolygon, {
|
|
1387
|
-
|
|
1384
|
+
sx: styles$3.drawButtonsSelected
|
|
1388
1385
|
}),
|
|
1389
1386
|
checked: drawMode === MapDrawMode.POLYGON,
|
|
1390
1387
|
onChange: function onChange() {
|
|
@@ -1397,10 +1394,10 @@ var DrawTools = function DrawTools(_ref) {
|
|
|
1397
1394
|
title: "Set FIR as ".concat(type, " position")
|
|
1398
1395
|
}, /*#__PURE__*/React__default.createElement(Radio, {
|
|
1399
1396
|
icon: /*#__PURE__*/React__default.createElement(DrawFIRLand, {
|
|
1400
|
-
|
|
1397
|
+
sx: styles$3.drawButtons
|
|
1401
1398
|
}),
|
|
1402
1399
|
checkedIcon: /*#__PURE__*/React__default.createElement(DrawFIRLand, {
|
|
1403
|
-
|
|
1400
|
+
sx: styles$3.drawButtonsSelected
|
|
1404
1401
|
}),
|
|
1405
1402
|
checked: drawMode === MapDrawMode.FIR,
|
|
1406
1403
|
onChange: function onChange() {
|
|
@@ -1413,10 +1410,10 @@ var DrawTools = function DrawTools(_ref) {
|
|
|
1413
1410
|
title: "Remove geometry"
|
|
1414
1411
|
}, /*#__PURE__*/React__default.createElement(Radio, {
|
|
1415
1412
|
icon: /*#__PURE__*/React__default.createElement(Delete, {
|
|
1416
|
-
|
|
1413
|
+
sx: styles$3.drawButtons
|
|
1417
1414
|
}),
|
|
1418
1415
|
checkedIcon: /*#__PURE__*/React__default.createElement(Delete, {
|
|
1419
|
-
|
|
1416
|
+
sx: styles$3.drawButtonsSelected
|
|
1420
1417
|
}),
|
|
1421
1418
|
checked: drawMode === MapDrawMode.DELETE,
|
|
1422
1419
|
onChange: function onChange() {
|
|
@@ -1948,7 +1945,6 @@ var Levels = function Levels(_ref) {
|
|
|
1948
1945
|
var _useDraftFormHelpers = useDraftFormHelpers(),
|
|
1949
1946
|
isRequired = _useDraftFormHelpers.isRequired;
|
|
1950
1947
|
|
|
1951
|
-
var classes = useStyles$6();
|
|
1952
1948
|
var config = productType === 'sigmet' ? sigmetConfig : airmetConfig;
|
|
1953
1949
|
|
|
1954
1950
|
var _useProductSettings = useProductSettings(config),
|
|
@@ -1961,7 +1957,7 @@ var Levels = function Levels(_ref) {
|
|
|
1961
1957
|
item: true,
|
|
1962
1958
|
container: true,
|
|
1963
1959
|
spacing: 2,
|
|
1964
|
-
|
|
1960
|
+
sx: styles$4.containerItem
|
|
1965
1961
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
1966
1962
|
item: true,
|
|
1967
1963
|
xs: 4,
|
|
@@ -1969,7 +1965,7 @@ var Levels = function Levels(_ref) {
|
|
|
1969
1965
|
justifyContent: "flex-end"
|
|
1970
1966
|
}, /*#__PURE__*/React__default.createElement(Typography, {
|
|
1971
1967
|
variant: "subtitle1",
|
|
1972
|
-
|
|
1968
|
+
sx: styles$4.label
|
|
1973
1969
|
}, "Levels")), /*#__PURE__*/React__default.createElement(Grid, {
|
|
1974
1970
|
item: true,
|
|
1975
1971
|
xs: 8,
|
|
@@ -2042,7 +2038,7 @@ var Levels = function Levels(_ref) {
|
|
|
2042
2038
|
isRequired: isRequired
|
|
2043
2039
|
}
|
|
2044
2040
|
},
|
|
2045
|
-
|
|
2041
|
+
sx: styles$4.unit,
|
|
2046
2042
|
disabled: isDisabled,
|
|
2047
2043
|
defaultValue: 'FL',
|
|
2048
2044
|
onChange: function onChange() {
|
|
@@ -2116,7 +2112,7 @@ var Levels = function Levels(_ref) {
|
|
|
2116
2112
|
}
|
|
2117
2113
|
}
|
|
2118
2114
|
},
|
|
2119
|
-
|
|
2115
|
+
sx: styles$4.unit,
|
|
2120
2116
|
disabled: isDisabled,
|
|
2121
2117
|
defaultValue: 'FL',
|
|
2122
2118
|
onChange: function onChange() {
|
|
@@ -2135,7 +2131,7 @@ var Levels = function Levels(_ref) {
|
|
|
2135
2131
|
}, /*#__PURE__*/React__default.createElement(ReactHookFormNumberField, {
|
|
2136
2132
|
name: "level.value",
|
|
2137
2133
|
label: "Upper level",
|
|
2138
|
-
|
|
2134
|
+
sx: styles$4.levelField,
|
|
2139
2135
|
rules: {
|
|
2140
2136
|
validate: {
|
|
2141
2137
|
isRequired: isRequired,
|
|
@@ -2200,7 +2196,7 @@ var Levels = function Levels(_ref) {
|
|
|
2200
2196
|
}
|
|
2201
2197
|
}
|
|
2202
2198
|
},
|
|
2203
|
-
|
|
2199
|
+
sx: styles$4.unit,
|
|
2204
2200
|
disabled: isDisabled,
|
|
2205
2201
|
defaultValue: getValues('level.unit') || 'FL',
|
|
2206
2202
|
onChange: function onChange() {
|
|
@@ -2286,7 +2282,7 @@ var Levels = function Levels(_ref) {
|
|
|
2286
2282
|
isRequired: isRequired
|
|
2287
2283
|
}
|
|
2288
2284
|
},
|
|
2289
|
-
|
|
2285
|
+
sx: styles$4.unit,
|
|
2290
2286
|
disabled: isDisabled,
|
|
2291
2287
|
defaultValue: 'FL',
|
|
2292
2288
|
onChange: function onChange() {
|
|
@@ -2432,7 +2428,6 @@ var ObservationForecastTime = function ObservationForecastTime(_ref) {
|
|
|
2432
2428
|
var _useFormContext = useFormContext(),
|
|
2433
2429
|
watch = _useFormContext.watch;
|
|
2434
2430
|
|
|
2435
|
-
var classes = useStyles$6();
|
|
2436
2431
|
return (!isReadOnly || watch('observationOrForecastTime') !== null) && /*#__PURE__*/React__default.createElement(Grid, {
|
|
2437
2432
|
item: true,
|
|
2438
2433
|
container: true,
|
|
@@ -2444,7 +2439,7 @@ var ObservationForecastTime = function ObservationForecastTime(_ref) {
|
|
|
2444
2439
|
justifyContent: "flex-end"
|
|
2445
2440
|
}, /*#__PURE__*/React__default.createElement(Typography, {
|
|
2446
2441
|
variant: "subtitle1",
|
|
2447
|
-
|
|
2442
|
+
sx: styles$4.label
|
|
2448
2443
|
}, "At")), /*#__PURE__*/React__default.createElement(Grid, {
|
|
2449
2444
|
item: true,
|
|
2450
2445
|
xs: 8,
|
|
@@ -2484,7 +2479,6 @@ var Phenomenon = function Phenomenon(_ref) {
|
|
|
2484
2479
|
setValue = _useFormContext.setValue,
|
|
2485
2480
|
trigger = _useFormContext.trigger;
|
|
2486
2481
|
|
|
2487
|
-
var classes = useStyles$6();
|
|
2488
2482
|
var phenomenaList = productType === 'sigmet' ? SigmetPhenomena : AirmetPhenomena;
|
|
2489
2483
|
return /*#__PURE__*/React__default.createElement(Grid, {
|
|
2490
2484
|
item: true,
|
|
@@ -2497,7 +2491,7 @@ var Phenomenon = function Phenomenon(_ref) {
|
|
|
2497
2491
|
justifyContent: "flex-end"
|
|
2498
2492
|
}, /*#__PURE__*/React__default.createElement(Typography, {
|
|
2499
2493
|
variant: "subtitle1",
|
|
2500
|
-
|
|
2494
|
+
sx: styles$4.label
|
|
2501
2495
|
}, "What")), /*#__PURE__*/React__default.createElement(Grid, {
|
|
2502
2496
|
item: true,
|
|
2503
2497
|
xs: 8,
|
|
@@ -2568,7 +2562,6 @@ var StartGeometry = function StartGeometry(_ref) {
|
|
|
2568
2562
|
drawMode = _ref.drawMode,
|
|
2569
2563
|
geoJSONs = _ref.geoJSONs,
|
|
2570
2564
|
setDrawModeType = _ref.setDrawModeType;
|
|
2571
|
-
var classes = useStyles$6();
|
|
2572
2565
|
|
|
2573
2566
|
var _useFormContext = useFormContext(),
|
|
2574
2567
|
errors = _useFormContext.errors,
|
|
@@ -2581,7 +2574,7 @@ var StartGeometry = function StartGeometry(_ref) {
|
|
|
2581
2574
|
item: true,
|
|
2582
2575
|
container: true,
|
|
2583
2576
|
spacing: 2,
|
|
2584
|
-
|
|
2577
|
+
sx: styles$4.drawSection
|
|
2585
2578
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
2586
2579
|
item: true,
|
|
2587
2580
|
xs: 4,
|
|
@@ -2589,7 +2582,7 @@ var StartGeometry = function StartGeometry(_ref) {
|
|
|
2589
2582
|
justifyContent: "flex-end"
|
|
2590
2583
|
}, /*#__PURE__*/React__default.createElement(Typography, {
|
|
2591
2584
|
variant: "subtitle1",
|
|
2592
|
-
|
|
2585
|
+
sx: styles$4.label
|
|
2593
2586
|
}, "Start position")), /*#__PURE__*/React__default.createElement(Grid, {
|
|
2594
2587
|
item: true,
|
|
2595
2588
|
xs: 8,
|
|
@@ -2602,7 +2595,7 @@ var StartGeometry = function StartGeometry(_ref) {
|
|
|
2602
2595
|
}
|
|
2603
2596
|
}), drawMode[StartOrEndDrawing.start] && /*#__PURE__*/React__default.createElement(FormHelperText, {
|
|
2604
2597
|
variant: "filled",
|
|
2605
|
-
|
|
2598
|
+
sx: styles$4.quitDrawModeMessage
|
|
2606
2599
|
}, exitDrawModeMessage), !!errors.startGeometry && /*#__PURE__*/React__default.createElement(FormHelperText, {
|
|
2607
2600
|
error: true,
|
|
2608
2601
|
variant: "filled"
|
|
@@ -2710,8 +2703,6 @@ var Progress = function Progress(_ref) {
|
|
|
2710
2703
|
return null;
|
|
2711
2704
|
} : _ref$onChange;
|
|
2712
2705
|
|
|
2713
|
-
var classes = useStyles$6();
|
|
2714
|
-
|
|
2715
2706
|
var _useFormContext = useFormContext(),
|
|
2716
2707
|
watch = _useFormContext.watch,
|
|
2717
2708
|
getValues = _useFormContext.getValues,
|
|
@@ -2735,7 +2726,7 @@ var Progress = function Progress(_ref) {
|
|
|
2735
2726
|
item: true,
|
|
2736
2727
|
container: true,
|
|
2737
2728
|
spacing: 2,
|
|
2738
|
-
|
|
2729
|
+
sx: styles$4.containerItem
|
|
2739
2730
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
2740
2731
|
item: true,
|
|
2741
2732
|
xs: 4,
|
|
@@ -2743,7 +2734,7 @@ var Progress = function Progress(_ref) {
|
|
|
2743
2734
|
justifyContent: "flex-end"
|
|
2744
2735
|
}, /*#__PURE__*/React__default.createElement(Typography, {
|
|
2745
2736
|
variant: "subtitle1",
|
|
2746
|
-
|
|
2737
|
+
sx: styles$4.label
|
|
2747
2738
|
}, "Progress")), /*#__PURE__*/React__default.createElement(Grid, {
|
|
2748
2739
|
item: true,
|
|
2749
2740
|
xs: 8,
|
|
@@ -2787,7 +2778,7 @@ var Progress = function Progress(_ref) {
|
|
|
2787
2778
|
rules: {
|
|
2788
2779
|
validate: isRequired
|
|
2789
2780
|
},
|
|
2790
|
-
|
|
2781
|
+
sx: styles$4.movement,
|
|
2791
2782
|
disabled: isDisabled,
|
|
2792
2783
|
"data-testid": "movement-movementDirection",
|
|
2793
2784
|
onChange: function onChange(event) {
|
|
@@ -2814,7 +2805,7 @@ var Progress = function Progress(_ref) {
|
|
|
2814
2805
|
rules: {
|
|
2815
2806
|
validate: isRequired
|
|
2816
2807
|
},
|
|
2817
|
-
|
|
2808
|
+
sx: styles$4.unit,
|
|
2818
2809
|
disabled: isDisabled,
|
|
2819
2810
|
defaultValue: 'KT',
|
|
2820
2811
|
"data-testid": "movement-movementUnit",
|
|
@@ -2873,7 +2864,7 @@ var Progress = function Progress(_ref) {
|
|
|
2873
2864
|
item: true,
|
|
2874
2865
|
xs: 12,
|
|
2875
2866
|
"data-testid": "endGeometry",
|
|
2876
|
-
|
|
2867
|
+
sx: styles$4.drawSection
|
|
2877
2868
|
}, !isReadOnly && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(DrawTools, {
|
|
2878
2869
|
"data-testid": "endGeometry-drawTools",
|
|
2879
2870
|
type: StartOrEndDrawing.end,
|
|
@@ -2883,7 +2874,7 @@ var Progress = function Progress(_ref) {
|
|
|
2883
2874
|
}
|
|
2884
2875
|
}), drawMode[StartOrEndDrawing.end] && /*#__PURE__*/React__default.createElement(FormHelperText, {
|
|
2885
2876
|
variant: "filled",
|
|
2886
|
-
|
|
2877
|
+
sx: styles$4.quitDrawModeMessage
|
|
2887
2878
|
}, exitDrawModeMessage), !!errors.endGeometry && /*#__PURE__*/React__default.createElement(FormHelperText, {
|
|
2888
2879
|
error: true,
|
|
2889
2880
|
variant: "filled"
|
|
@@ -2936,7 +2927,6 @@ var Progress = function Progress(_ref) {
|
|
|
2936
2927
|
var SelectFIR = function SelectFIR(_ref) {
|
|
2937
2928
|
var productType = _ref.productType,
|
|
2938
2929
|
isDisabled = _ref.isDisabled;
|
|
2939
|
-
var classes = useStyles$6();
|
|
2940
2930
|
|
|
2941
2931
|
var _useFormContext = useFormContext(),
|
|
2942
2932
|
setValue = _useFormContext.setValue;
|
|
@@ -2955,7 +2945,7 @@ var SelectFIR = function SelectFIR(_ref) {
|
|
|
2955
2945
|
item: true,
|
|
2956
2946
|
container: true,
|
|
2957
2947
|
spacing: 2,
|
|
2958
|
-
|
|
2948
|
+
sx: styles$4.containerItem
|
|
2959
2949
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
2960
2950
|
item: true,
|
|
2961
2951
|
xs: 4,
|
|
@@ -2963,7 +2953,7 @@ var SelectFIR = function SelectFIR(_ref) {
|
|
|
2963
2953
|
justifyContent: "flex-end"
|
|
2964
2954
|
}, /*#__PURE__*/React__default.createElement(Typography, {
|
|
2965
2955
|
variant: "subtitle1",
|
|
2966
|
-
|
|
2956
|
+
sx: styles$4.label
|
|
2967
2957
|
}, "Where")), /*#__PURE__*/React__default.createElement(Grid, {
|
|
2968
2958
|
item: true,
|
|
2969
2959
|
xs: 8,
|
|
@@ -3030,12 +3020,11 @@ var Type = function Type(_ref) {
|
|
|
3030
3020
|
var _useDraftFormHelpers = useDraftFormHelpers(),
|
|
3031
3021
|
isRequired = _useDraftFormHelpers.isRequired;
|
|
3032
3022
|
|
|
3033
|
-
var classes = useStyles$6();
|
|
3034
3023
|
return /*#__PURE__*/React__default.createElement(Grid, {
|
|
3035
3024
|
item: true,
|
|
3036
3025
|
container: true,
|
|
3037
3026
|
spacing: 2,
|
|
3038
|
-
|
|
3027
|
+
sx: styles$4.containerItem
|
|
3039
3028
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
3040
3029
|
item: true,
|
|
3041
3030
|
xs: 4,
|
|
@@ -3043,7 +3032,7 @@ var Type = function Type(_ref) {
|
|
|
3043
3032
|
justifyContent: "flex-end"
|
|
3044
3033
|
}, /*#__PURE__*/React__default.createElement(Typography, {
|
|
3045
3034
|
variant: "subtitle1",
|
|
3046
|
-
|
|
3035
|
+
sx: styles$4.label
|
|
3047
3036
|
}, "Type")), /*#__PURE__*/React__default.createElement(Grid, {
|
|
3048
3037
|
item: true,
|
|
3049
3038
|
xs: 8,
|
|
@@ -3109,8 +3098,6 @@ var ValidFrom = function ValidFrom(_ref) {
|
|
|
3109
3098
|
getValues = _useFormContext.getValues,
|
|
3110
3099
|
trigger = _useFormContext.trigger;
|
|
3111
3100
|
|
|
3112
|
-
var classes = useStyles$6();
|
|
3113
|
-
|
|
3114
3101
|
var _useDraftFormHelpers = useDraftFormHelpers(),
|
|
3115
3102
|
isRequired = _useDraftFormHelpers.isRequired;
|
|
3116
3103
|
|
|
@@ -3126,7 +3113,7 @@ var ValidFrom = function ValidFrom(_ref) {
|
|
|
3126
3113
|
justifyContent: "flex-end"
|
|
3127
3114
|
}, /*#__PURE__*/React__default.createElement(Typography, {
|
|
3128
3115
|
variant: "subtitle1",
|
|
3129
|
-
|
|
3116
|
+
sx: styles$4.label
|
|
3130
3117
|
}, "Valid from")), /*#__PURE__*/React__default.createElement(Grid, {
|
|
3131
3118
|
item: true,
|
|
3132
3119
|
xs: 8,
|
|
@@ -3206,7 +3193,6 @@ var ValidUntil = function ValidUntil(_ref) {
|
|
|
3206
3193
|
var _useDraftFormHelpers = useDraftFormHelpers(),
|
|
3207
3194
|
isRequired = _useDraftFormHelpers.isRequired;
|
|
3208
3195
|
|
|
3209
|
-
var classes = useStyles$6();
|
|
3210
3196
|
var config = productType === 'sigmet' ? sigmetConfig : airmetConfig;
|
|
3211
3197
|
var defaultHoursValid = getDefaultHoursValid(productType);
|
|
3212
3198
|
return /*#__PURE__*/React__default.createElement(Grid, {
|
|
@@ -3220,7 +3206,7 @@ var ValidUntil = function ValidUntil(_ref) {
|
|
|
3220
3206
|
justifyContent: "flex-end"
|
|
3221
3207
|
}, /*#__PURE__*/React__default.createElement(Typography, {
|
|
3222
3208
|
variant: "subtitle1",
|
|
3223
|
-
|
|
3209
|
+
sx: styles$4.label
|
|
3224
3210
|
}, "Valid until")), /*#__PURE__*/React__default.createElement(Grid, {
|
|
3225
3211
|
item: true,
|
|
3226
3212
|
xs: 8,
|
|
@@ -3289,7 +3275,6 @@ var VolcanicFields = function VolcanicFields(_ref) {
|
|
|
3289
3275
|
trigger = _useFormContext.trigger,
|
|
3290
3276
|
getValues = _useFormContext.getValues;
|
|
3291
3277
|
|
|
3292
|
-
var classes = useStyles$6();
|
|
3293
3278
|
return /*#__PURE__*/React__default.createElement(Grid, {
|
|
3294
3279
|
item: true,
|
|
3295
3280
|
container: true,
|
|
@@ -3307,7 +3292,7 @@ var VolcanicFields = function VolcanicFields(_ref) {
|
|
|
3307
3292
|
}, (!isReadOnly || !!watch('vaSigmetVolcanoName')) && /*#__PURE__*/React__default.createElement(Grid, {
|
|
3308
3293
|
item: true,
|
|
3309
3294
|
xs: 12,
|
|
3310
|
-
|
|
3295
|
+
sx: styles$4.volcanicField
|
|
3311
3296
|
}, /*#__PURE__*/React__default.createElement(ReactHookFormTextField, {
|
|
3312
3297
|
name: "vaSigmetVolcanoName",
|
|
3313
3298
|
label: "Volcano name",
|
|
@@ -3335,7 +3320,7 @@ var VolcanicFields = function VolcanicFields(_ref) {
|
|
|
3335
3320
|
}
|
|
3336
3321
|
}
|
|
3337
3322
|
},
|
|
3338
|
-
|
|
3323
|
+
sx: styles$4.latitude,
|
|
3339
3324
|
disabled: isDisabled,
|
|
3340
3325
|
helperText: helperText,
|
|
3341
3326
|
onChange: function onChange() {
|
|
@@ -3404,8 +3389,6 @@ var SurfaceVisibility = function SurfaceVisibility(_ref) {
|
|
|
3404
3389
|
return null;
|
|
3405
3390
|
} : _ref$onChange;
|
|
3406
3391
|
|
|
3407
|
-
var classes = useStyles$6();
|
|
3408
|
-
|
|
3409
3392
|
var _useDraftFormHelpers = useDraftFormHelpers(),
|
|
3410
3393
|
isRequired = _useDraftFormHelpers.isRequired;
|
|
3411
3394
|
|
|
@@ -3426,7 +3409,7 @@ var SurfaceVisibility = function SurfaceVisibility(_ref) {
|
|
|
3426
3409
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
3427
3410
|
item: true,
|
|
3428
3411
|
xs: 12,
|
|
3429
|
-
|
|
3412
|
+
sx: styles$4.surfaceVisibility
|
|
3430
3413
|
}, /*#__PURE__*/React__default.createElement(ReactHookFormNumberField, {
|
|
3431
3414
|
name: "visibilityValue",
|
|
3432
3415
|
"data-testid": "surfaceVisibility-visibilityValue",
|
|
@@ -3512,8 +3495,6 @@ var SurfaceWind = function SurfaceWind(_ref) {
|
|
|
3512
3495
|
var _useDraftFormHelpers = useDraftFormHelpers(),
|
|
3513
3496
|
isRequired = _useDraftFormHelpers.isRequired;
|
|
3514
3497
|
|
|
3515
|
-
var classes = useStyles$6();
|
|
3516
|
-
|
|
3517
3498
|
var _useProductSettings = useProductSettings(airmetConfig),
|
|
3518
3499
|
allowedUnits = _useProductSettings.allowedUnits;
|
|
3519
3500
|
|
|
@@ -3537,7 +3518,7 @@ var SurfaceWind = function SurfaceWind(_ref) {
|
|
|
3537
3518
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
3538
3519
|
item: true,
|
|
3539
3520
|
xs: 12,
|
|
3540
|
-
|
|
3521
|
+
sx: styles$4.surfaceWind
|
|
3541
3522
|
}, /*#__PURE__*/React__default.createElement(ReactHookFormNumberField, {
|
|
3542
3523
|
name: "windDirection",
|
|
3543
3524
|
label: "Set wind direction",
|
|
@@ -3573,7 +3554,7 @@ var SurfaceWind = function SurfaceWind(_ref) {
|
|
|
3573
3554
|
isRequired: isRequired
|
|
3574
3555
|
}
|
|
3575
3556
|
},
|
|
3576
|
-
|
|
3557
|
+
sx: styles$4.unit,
|
|
3577
3558
|
disabled: isDisabled,
|
|
3578
3559
|
defaultValue: 'KT',
|
|
3579
3560
|
"data-testid": "surfaceWind-windUnit",
|
|
@@ -3671,8 +3652,6 @@ var CloudLevels = function CloudLevels(_ref) {
|
|
|
3671
3652
|
var _useDraftFormHelpers = useDraftFormHelpers(),
|
|
3672
3653
|
isRequired = _useDraftFormHelpers.isRequired;
|
|
3673
3654
|
|
|
3674
|
-
var classes = useStyles$6();
|
|
3675
|
-
|
|
3676
3655
|
var _useProductSettings = useProductSettings(airmetConfig),
|
|
3677
3656
|
allowedUnits = _useProductSettings.allowedUnits;
|
|
3678
3657
|
|
|
@@ -3683,7 +3662,7 @@ var CloudLevels = function CloudLevels(_ref) {
|
|
|
3683
3662
|
item: true,
|
|
3684
3663
|
container: true,
|
|
3685
3664
|
spacing: 2,
|
|
3686
|
-
|
|
3665
|
+
sx: styles$4.containerItem
|
|
3687
3666
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
3688
3667
|
item: true,
|
|
3689
3668
|
xs: 4,
|
|
@@ -3691,7 +3670,7 @@ var CloudLevels = function CloudLevels(_ref) {
|
|
|
3691
3670
|
justifyContent: "flex-end"
|
|
3692
3671
|
}, /*#__PURE__*/React__default.createElement(Typography, {
|
|
3693
3672
|
variant: "subtitle1",
|
|
3694
|
-
|
|
3673
|
+
sx: styles$4.label
|
|
3695
3674
|
}, "Levels")), /*#__PURE__*/React__default.createElement(Grid, {
|
|
3696
3675
|
item: true,
|
|
3697
3676
|
xs: 8,
|
|
@@ -3758,7 +3737,7 @@ var CloudLevels = function CloudLevels(_ref) {
|
|
|
3758
3737
|
isRequired: isRequired
|
|
3759
3738
|
}
|
|
3760
3739
|
},
|
|
3761
|
-
|
|
3740
|
+
sx: styles$4.unit,
|
|
3762
3741
|
disabled: isDisabled,
|
|
3763
3742
|
defaultValue: 'FT',
|
|
3764
3743
|
onChange: function onChange() {
|
|
@@ -3787,7 +3766,7 @@ var CloudLevels = function CloudLevels(_ref) {
|
|
|
3787
3766
|
name: "cloudLevel.value",
|
|
3788
3767
|
label: "Upper level",
|
|
3789
3768
|
"data-testid": "cloudLevel-value",
|
|
3790
|
-
|
|
3769
|
+
sx: styles$4.levelField,
|
|
3791
3770
|
rules: {
|
|
3792
3771
|
validate: {
|
|
3793
3772
|
isRequired: isRequired,
|
|
@@ -3866,7 +3845,7 @@ var CloudLevels = function CloudLevels(_ref) {
|
|
|
3866
3845
|
isRequired: isRequired
|
|
3867
3846
|
}
|
|
3868
3847
|
},
|
|
3869
|
-
|
|
3848
|
+
sx: styles$4.unit,
|
|
3870
3849
|
disabled: isDisabled,
|
|
3871
3850
|
defaultValue: getValues('cloudLevel.unit') ? getValues('cloudLevel.unit') : 'FT',
|
|
3872
3851
|
onChange: function onChange() {
|
|
@@ -3923,7 +3902,7 @@ var CloudLevels = function CloudLevels(_ref) {
|
|
|
3923
3902
|
})))))));
|
|
3924
3903
|
};
|
|
3925
3904
|
|
|
3926
|
-
var
|
|
3905
|
+
var styles$2 = {
|
|
3927
3906
|
tacOutput: {
|
|
3928
3907
|
paddingTop: '16px',
|
|
3929
3908
|
whiteSpace: 'break-spaces'
|
|
@@ -3938,7 +3917,7 @@ var useStyles$4 = makeStyles({
|
|
|
3938
3917
|
backgroundColor: '#F4F4F4'
|
|
3939
3918
|
}
|
|
3940
3919
|
}
|
|
3941
|
-
}
|
|
3920
|
+
};
|
|
3942
3921
|
var noTAC = 'Missing data: no TAC can be generated'; // Ensure we have enough data to retrieve a TAC
|
|
3943
3922
|
|
|
3944
3923
|
var shouldRetrieveTAC = function shouldRetrieveTAC(product) {
|
|
@@ -4022,17 +4001,17 @@ var useTAC = function useTAC(initialProduct, getTAC) {
|
|
|
4022
4001
|
|
|
4023
4002
|
var ProductFormTAC = function ProductFormTAC(_ref) {
|
|
4024
4003
|
var tac = _ref.tac;
|
|
4025
|
-
var classes = useStyles$4();
|
|
4026
4004
|
var tacLines = tac.split('\n');
|
|
4027
4005
|
return /*#__PURE__*/React__default.createElement(Typography, {
|
|
4028
4006
|
variant: "body2",
|
|
4029
4007
|
component: "div",
|
|
4030
|
-
|
|
4008
|
+
sx: styles$2.tacOutput,
|
|
4031
4009
|
"data-testid": "productform-tac-message"
|
|
4032
4010
|
}, tacLines.map(function (line) {
|
|
4033
|
-
return /*#__PURE__*/React__default.createElement(
|
|
4011
|
+
return /*#__PURE__*/React__default.createElement(Box, {
|
|
4012
|
+
component: "p",
|
|
4034
4013
|
key: line,
|
|
4035
|
-
|
|
4014
|
+
sx: styles$2.tacLine,
|
|
4036
4015
|
"data-testid": "productform-tac-message-line"
|
|
4037
4016
|
}, line);
|
|
4038
4017
|
}));
|
|
@@ -4048,7 +4027,6 @@ var SigmetForm = function SigmetForm(_ref) {
|
|
|
4048
4027
|
initialCancelSigmet = _ref$initialCancelSig === void 0 ? null : _ref$initialCancelSig,
|
|
4049
4028
|
_ref$showMap = _ref.showMap,
|
|
4050
4029
|
showMap = _ref$showMap === void 0 ? true : _ref$showMap;
|
|
4051
|
-
var classes = useStyles$6();
|
|
4052
4030
|
|
|
4053
4031
|
var _useApiContext = useApiContext(),
|
|
4054
4032
|
api = _useApiContext.api;
|
|
@@ -4214,13 +4192,13 @@ var SigmetForm = function SigmetForm(_ref) {
|
|
|
4214
4192
|
xs: 12
|
|
4215
4193
|
}, /*#__PURE__*/React__default.createElement(Typography, {
|
|
4216
4194
|
variant: "body2",
|
|
4217
|
-
|
|
4195
|
+
sx: styles$4.body,
|
|
4218
4196
|
"data-testid": "vaSigmetMoveToFIR"
|
|
4219
4197
|
}, "Volcanic Cloud is moving in the direction of:", ' ', /*#__PURE__*/React__default.createElement("b", null, " ", watch('vaSigmetMoveToFIR')))))), /*#__PURE__*/React__default.createElement(Grid, {
|
|
4220
4198
|
item: true,
|
|
4221
4199
|
container: true,
|
|
4222
4200
|
spacing: 2,
|
|
4223
|
-
|
|
4201
|
+
sx: styles$4.containerItem
|
|
4224
4202
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
4225
4203
|
item: true,
|
|
4226
4204
|
xs: 4,
|
|
@@ -4228,7 +4206,7 @@ var SigmetForm = function SigmetForm(_ref) {
|
|
|
4228
4206
|
justifyContent: "flex-end"
|
|
4229
4207
|
}, /*#__PURE__*/React__default.createElement(Typography, {
|
|
4230
4208
|
variant: "subtitle1",
|
|
4231
|
-
|
|
4209
|
+
sx: styles$4.label
|
|
4232
4210
|
}, "Issued at")), /*#__PURE__*/React__default.createElement(Grid, {
|
|
4233
4211
|
item: true,
|
|
4234
4212
|
xs: 8,
|
|
@@ -4239,7 +4217,7 @@ var SigmetForm = function SigmetForm(_ref) {
|
|
|
4239
4217
|
xs: 12
|
|
4240
4218
|
}, /*#__PURE__*/React__default.createElement(Typography, {
|
|
4241
4219
|
variant: "body2",
|
|
4242
|
-
|
|
4220
|
+
sx: styles$4.body
|
|
4243
4221
|
}, getProductIssueDate(initialSigmet, initialCancelSigmet)))), /*#__PURE__*/React__default.createElement(Grid, {
|
|
4244
4222
|
item: true,
|
|
4245
4223
|
container: true,
|
|
@@ -4251,7 +4229,7 @@ var SigmetForm = function SigmetForm(_ref) {
|
|
|
4251
4229
|
justifyContent: "flex-end"
|
|
4252
4230
|
}, /*#__PURE__*/React__default.createElement(Typography, {
|
|
4253
4231
|
variant: "subtitle1",
|
|
4254
|
-
|
|
4232
|
+
sx: styles$4.label
|
|
4255
4233
|
}, "TAC")), /*#__PURE__*/React__default.createElement(Grid, {
|
|
4256
4234
|
item: true,
|
|
4257
4235
|
xs: 8,
|
|
@@ -4312,7 +4290,7 @@ var SigmetForm = function SigmetForm(_ref) {
|
|
|
4312
4290
|
})), /*#__PURE__*/React__default.createElement(Grid, {
|
|
4313
4291
|
item: true,
|
|
4314
4292
|
xs: 4,
|
|
4315
|
-
|
|
4293
|
+
sx: styles$4.productForm
|
|
4316
4294
|
}, renderForm())));
|
|
4317
4295
|
};
|
|
4318
4296
|
|
|
@@ -4326,7 +4304,6 @@ var AirmetForm = function AirmetForm(_ref) {
|
|
|
4326
4304
|
initialCancelAirmet = _ref$initialCancelAir === void 0 ? null : _ref$initialCancelAir,
|
|
4327
4305
|
_ref$showMap = _ref.showMap,
|
|
4328
4306
|
showMap = _ref$showMap === void 0 ? true : _ref$showMap;
|
|
4329
|
-
var classes = useStyles$6();
|
|
4330
4307
|
|
|
4331
4308
|
var _useApiContext = useApiContext(),
|
|
4332
4309
|
api = _useApiContext.api;
|
|
@@ -4458,7 +4435,7 @@ var AirmetForm = function AirmetForm(_ref) {
|
|
|
4458
4435
|
item: true,
|
|
4459
4436
|
container: true,
|
|
4460
4437
|
spacing: 2,
|
|
4461
|
-
|
|
4438
|
+
sx: styles$4.containerItem
|
|
4462
4439
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
4463
4440
|
item: true,
|
|
4464
4441
|
xs: 4,
|
|
@@ -4466,7 +4443,7 @@ var AirmetForm = function AirmetForm(_ref) {
|
|
|
4466
4443
|
justifyContent: "flex-end"
|
|
4467
4444
|
}, /*#__PURE__*/React__default.createElement(Typography, {
|
|
4468
4445
|
variant: "subtitle1",
|
|
4469
|
-
|
|
4446
|
+
sx: styles$4.label
|
|
4470
4447
|
}, "Issued at")), /*#__PURE__*/React__default.createElement(Grid, {
|
|
4471
4448
|
item: true,
|
|
4472
4449
|
xs: 8,
|
|
@@ -4477,7 +4454,7 @@ var AirmetForm = function AirmetForm(_ref) {
|
|
|
4477
4454
|
xs: 12
|
|
4478
4455
|
}, /*#__PURE__*/React__default.createElement(Typography, {
|
|
4479
4456
|
variant: "body2",
|
|
4480
|
-
|
|
4457
|
+
sx: styles$4.body
|
|
4481
4458
|
}, getProductIssueDate(initialAirmet, initialCancelAirmet)))), /*#__PURE__*/React__default.createElement(Grid, {
|
|
4482
4459
|
item: true,
|
|
4483
4460
|
container: true,
|
|
@@ -4489,7 +4466,7 @@ var AirmetForm = function AirmetForm(_ref) {
|
|
|
4489
4466
|
justifyContent: "flex-end"
|
|
4490
4467
|
}, /*#__PURE__*/React__default.createElement(Typography, {
|
|
4491
4468
|
variant: "subtitle1",
|
|
4492
|
-
|
|
4469
|
+
sx: styles$4.label
|
|
4493
4470
|
}, "TAC")), /*#__PURE__*/React__default.createElement(Grid, {
|
|
4494
4471
|
item: true,
|
|
4495
4472
|
xs: 8,
|
|
@@ -4549,11 +4526,11 @@ var AirmetForm = function AirmetForm(_ref) {
|
|
|
4549
4526
|
})), /*#__PURE__*/React__default.createElement(Grid, {
|
|
4550
4527
|
item: true,
|
|
4551
4528
|
xs: 4,
|
|
4552
|
-
|
|
4529
|
+
sx: styles$4.productForm
|
|
4553
4530
|
}, renderForm())));
|
|
4554
4531
|
};
|
|
4555
4532
|
|
|
4556
|
-
var
|
|
4533
|
+
var styles$1 = {
|
|
4557
4534
|
dialogHeader: {
|
|
4558
4535
|
boxShadow: '0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14)',
|
|
4559
4536
|
zIndex: 1,
|
|
@@ -4566,17 +4543,13 @@ var useStyles$3 = makeStyles({
|
|
|
4566
4543
|
},
|
|
4567
4544
|
dialogChildren: {
|
|
4568
4545
|
display: 'flex',
|
|
4569
|
-
padding:
|
|
4546
|
+
padding: '20px',
|
|
4570
4547
|
minHeight: 200,
|
|
4571
4548
|
minWidth: 400,
|
|
4572
|
-
height: '100%'
|
|
4573
|
-
|
|
4574
|
-
dialog: {
|
|
4575
|
-
'& .MuiDialogContent-root': {
|
|
4576
|
-
paddingTop: 20
|
|
4577
|
-
}
|
|
4549
|
+
height: '100%',
|
|
4550
|
+
paddingTop: '20px!important'
|
|
4578
4551
|
}
|
|
4579
|
-
}
|
|
4552
|
+
};
|
|
4580
4553
|
|
|
4581
4554
|
var ContentDialog = function ContentDialog(_a) {
|
|
4582
4555
|
var open = _a.open,
|
|
@@ -4589,8 +4562,6 @@ var ContentDialog = function ContentDialog(_a) {
|
|
|
4589
4562
|
alertBanner = _a$alertBanner === void 0 ? null : _a$alertBanner,
|
|
4590
4563
|
other = __rest(_a, ["open", "toggleDialogStatus", "title", "children", "options", "onClose", "alertBanner"]);
|
|
4591
4564
|
|
|
4592
|
-
var classes = useStyles$3();
|
|
4593
|
-
|
|
4594
4565
|
var handleClose = function handleClose() {
|
|
4595
4566
|
if (onClose) {
|
|
4596
4567
|
onClose();
|
|
@@ -4603,10 +4574,9 @@ var ContentDialog = function ContentDialog(_a) {
|
|
|
4603
4574
|
"data-testid": "contentDialog",
|
|
4604
4575
|
open: open,
|
|
4605
4576
|
onClose: handleClose,
|
|
4606
|
-
maxWidth: other.maxWidth ? other.maxWidth : 'lg'
|
|
4607
|
-
className: classes.dialog
|
|
4577
|
+
maxWidth: other.maxWidth ? other.maxWidth : 'lg'
|
|
4608
4578
|
}, other), /*#__PURE__*/React.createElement(DialogTitle, {
|
|
4609
|
-
|
|
4579
|
+
sx: styles$1.dialogHeader
|
|
4610
4580
|
}, /*#__PURE__*/React.createElement(Grid, {
|
|
4611
4581
|
container: true,
|
|
4612
4582
|
alignItems: "center"
|
|
@@ -4627,7 +4597,7 @@ var ContentDialog = function ContentDialog(_a) {
|
|
|
4627
4597
|
}, "BACK"))), /*#__PURE__*/React.createElement(Grid, {
|
|
4628
4598
|
item: true,
|
|
4629
4599
|
xs: true,
|
|
4630
|
-
|
|
4600
|
+
sx: styles$1.dialogTitle
|
|
4631
4601
|
}, /*#__PURE__*/React.createElement(Typography, {
|
|
4632
4602
|
"data-testid": "dialogTitle",
|
|
4633
4603
|
variant: "h6"
|
|
@@ -4637,11 +4607,31 @@ var ContentDialog = function ContentDialog(_a) {
|
|
|
4637
4607
|
}, /*#__PURE__*/React.createElement(Grid, {
|
|
4638
4608
|
container: true
|
|
4639
4609
|
}, options)))), alertBanner !== null && alertBanner, /*#__PURE__*/React.createElement(DialogContent, {
|
|
4640
|
-
|
|
4610
|
+
sx: styles$1.dialogChildren
|
|
4641
4611
|
}, children));
|
|
4642
4612
|
};
|
|
4643
4613
|
|
|
4644
|
-
var
|
|
4614
|
+
var styles = {
|
|
4615
|
+
cardWrapper: {
|
|
4616
|
+
width: '100%'
|
|
4617
|
+
},
|
|
4618
|
+
cardContent: {
|
|
4619
|
+
width: '100%',
|
|
4620
|
+
padding: '14px',
|
|
4621
|
+
'&:last-child': {
|
|
4622
|
+
paddingBottom: '14px'
|
|
4623
|
+
}
|
|
4624
|
+
},
|
|
4625
|
+
activeStatus: {
|
|
4626
|
+
color: '#72bb23',
|
|
4627
|
+
paddingLeft: '6px',
|
|
4628
|
+
paddingTop: '2px'
|
|
4629
|
+
},
|
|
4630
|
+
font: {
|
|
4631
|
+
fontWeight: 'normal'
|
|
4632
|
+
}
|
|
4633
|
+
};
|
|
4634
|
+
var getActiveStatus = function getActiveStatus(product) {
|
|
4645
4635
|
// do not return an icon if product is expired
|
|
4646
4636
|
if (moment(product.validDateEnd) < moment.utc(new Date())) {
|
|
4647
4637
|
return null;
|
|
@@ -4650,10 +4640,10 @@ var getActiveStatus = function getActiveStatus(product, className) {
|
|
|
4650
4640
|
var active = moment(product.validDateStart) <= moment.utc(new Date());
|
|
4651
4641
|
return active ? /*#__PURE__*/React__default.createElement(Success, {
|
|
4652
4642
|
"data-testid": "status-active",
|
|
4653
|
-
|
|
4643
|
+
sx: styles.activeStatus
|
|
4654
4644
|
}) : /*#__PURE__*/React__default.createElement(Clock, {
|
|
4655
4645
|
"data-testid": "status-inactive",
|
|
4656
|
-
|
|
4646
|
+
sx: styles.activeStatus
|
|
4657
4647
|
});
|
|
4658
4648
|
};
|
|
4659
4649
|
|
|
@@ -4703,27 +4693,6 @@ var getCancelSeqId = function getCancelSeqId(product) {
|
|
|
4703
4693
|
return product.cancelsAirmetSequenceId;
|
|
4704
4694
|
};
|
|
4705
4695
|
|
|
4706
|
-
var useStyles$2 = makeStyles({
|
|
4707
|
-
cardWrapper: {
|
|
4708
|
-
width: '100%'
|
|
4709
|
-
},
|
|
4710
|
-
cardContent: {
|
|
4711
|
-
width: '100%',
|
|
4712
|
-
padding: 14,
|
|
4713
|
-
'&:last-child': {
|
|
4714
|
-
paddingBottom: 14
|
|
4715
|
-
}
|
|
4716
|
-
},
|
|
4717
|
-
activeStatus: {
|
|
4718
|
-
color: '#72bb23',
|
|
4719
|
-
paddingLeft: '6px',
|
|
4720
|
-
paddingTop: '2px'
|
|
4721
|
-
},
|
|
4722
|
-
font: {
|
|
4723
|
-
fontWeight: 'normal'
|
|
4724
|
-
}
|
|
4725
|
-
});
|
|
4726
|
-
|
|
4727
4696
|
var formatValidTime = function formatValidTime(startDate, endDate, format) {
|
|
4728
4697
|
if (!startDate || !endDate) {
|
|
4729
4698
|
return '-';
|
|
@@ -4735,7 +4704,6 @@ var formatValidTime = function formatValidTime(startDate, endDate, format) {
|
|
|
4735
4704
|
var ProductListRow = function ProductListRow(_ref) {
|
|
4736
4705
|
var product = _ref.product,
|
|
4737
4706
|
productType = _ref.productType;
|
|
4738
|
-
var classes = useStyles$2();
|
|
4739
4707
|
|
|
4740
4708
|
var _useApiContext = useApiContext(),
|
|
4741
4709
|
api = _useApiContext.api;
|
|
@@ -4772,9 +4740,9 @@ var ProductListRow = function ProductListRow(_ref) {
|
|
|
4772
4740
|
return /*#__PURE__*/React__default.createElement(Card, {
|
|
4773
4741
|
elevation: 0,
|
|
4774
4742
|
variant: "outlined",
|
|
4775
|
-
|
|
4743
|
+
sx: styles.cardWrapper
|
|
4776
4744
|
}, /*#__PURE__*/React__default.createElement(CardContent, {
|
|
4777
|
-
|
|
4745
|
+
sx: styles.cardContent
|
|
4778
4746
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
4779
4747
|
container: true,
|
|
4780
4748
|
alignItems: "center",
|
|
@@ -4792,7 +4760,7 @@ var ProductListRow = function ProductListRow(_ref) {
|
|
|
4792
4760
|
}, productType.toUpperCase()), /*#__PURE__*/React__default.createElement(Typography, {
|
|
4793
4761
|
variant: "subtitle2",
|
|
4794
4762
|
noWrap: true,
|
|
4795
|
-
|
|
4763
|
+
sx: styles.font
|
|
4796
4764
|
}, phenomenon !== null ? phenomenon : 'Cancel'))), /*#__PURE__*/React__default.createElement(Grid, {
|
|
4797
4765
|
item: true,
|
|
4798
4766
|
xs: 3,
|
|
@@ -4819,7 +4787,7 @@ var ProductListRow = function ProductListRow(_ref) {
|
|
|
4819
4787
|
variant: "overline"
|
|
4820
4788
|
}, "Issue time"), /*#__PURE__*/React__default.createElement(Typography, {
|
|
4821
4789
|
variant: "subtitle2",
|
|
4822
|
-
|
|
4790
|
+
sx: styles.font,
|
|
4823
4791
|
"data-testid": "issueTime"
|
|
4824
4792
|
}, product.issueDate ? "".concat(moment.utc(product.issueDate).format('DD MMM YYYY, HH:mm'), " UTC") : '(Not published)')), /*#__PURE__*/React__default.createElement(Grid, {
|
|
4825
4793
|
item: true,
|
|
@@ -4831,7 +4799,7 @@ var ProductListRow = function ProductListRow(_ref) {
|
|
|
4831
4799
|
variant: "overline"
|
|
4832
4800
|
}, "Valid time"), /*#__PURE__*/React__default.createElement(Typography, {
|
|
4833
4801
|
variant: "subtitle2",
|
|
4834
|
-
|
|
4802
|
+
sx: styles.font,
|
|
4835
4803
|
"data-testid": "validTime"
|
|
4836
4804
|
}, validTime)), /*#__PURE__*/React__default.createElement(Grid, {
|
|
4837
4805
|
item: true,
|
|
@@ -4845,7 +4813,7 @@ var ProductListRow = function ProductListRow(_ref) {
|
|
|
4845
4813
|
startIcon: /*#__PURE__*/React__default.createElement(Edit, {
|
|
4846
4814
|
color: "secondary"
|
|
4847
4815
|
})
|
|
4848
|
-
}, "Draft") : getStatusTagList(product, cancelsSeqId), product.status === 'PUBLISHED' && cancelsSeqId === null && getActiveStatus(product
|
|
4816
|
+
}, "Draft") : getStatusTagList(product, cancelsSeqId), product.status === 'PUBLISHED' && cancelsSeqId === null && getActiveStatus(product)))));
|
|
4849
4817
|
};
|
|
4850
4818
|
|
|
4851
4819
|
/* *
|
|
@@ -4864,19 +4832,6 @@ var ProductListRow = function ProductListRow(_ref) {
|
|
|
4864
4832
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
4865
4833
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
4866
4834
|
* */
|
|
4867
|
-
var useStyles$1 = makeStyles({
|
|
4868
|
-
errorMessage: {
|
|
4869
|
-
width: '1200px',
|
|
4870
|
-
marginTop: '10px'
|
|
4871
|
-
},
|
|
4872
|
-
listBody: {
|
|
4873
|
-
width: '100%',
|
|
4874
|
-
minHeight: '600px'
|
|
4875
|
-
},
|
|
4876
|
-
listItem: {
|
|
4877
|
-
padding: '2px'
|
|
4878
|
-
}
|
|
4879
|
-
});
|
|
4880
4835
|
|
|
4881
4836
|
var ProductList = function ProductList(_ref) {
|
|
4882
4837
|
var productType = _ref.productType,
|
|
@@ -4885,7 +4840,6 @@ var ProductList = function ProductList(_ref) {
|
|
|
4885
4840
|
error = _ref.error,
|
|
4886
4841
|
onClickProductRow = _ref.onClickProductRow,
|
|
4887
4842
|
onClickNewProduct = _ref.onClickNewProduct;
|
|
4888
|
-
var classes = useStyles$1();
|
|
4889
4843
|
return /*#__PURE__*/React__default.createElement(Grid, {
|
|
4890
4844
|
container: true,
|
|
4891
4845
|
direction: "column",
|
|
@@ -4901,7 +4855,10 @@ var ProductList = function ProductList(_ref) {
|
|
|
4901
4855
|
onClick: onClickNewProduct
|
|
4902
4856
|
}, "Create a new ", productType.toUpperCase())), /*#__PURE__*/React__default.createElement(Grid, {
|
|
4903
4857
|
item: true,
|
|
4904
|
-
|
|
4858
|
+
sx: {
|
|
4859
|
+
width: '100%',
|
|
4860
|
+
minHeight: '600px'
|
|
4861
|
+
}
|
|
4905
4862
|
}, error && /*#__PURE__*/React__default.createElement(AlertBanner, {
|
|
4906
4863
|
severity: "error",
|
|
4907
4864
|
title: "An error has occurred while retrieving the list, please try again",
|
|
@@ -4916,7 +4873,9 @@ var ProductList = function ProductList(_ref) {
|
|
|
4916
4873
|
onClickProductRow(productListItem);
|
|
4917
4874
|
},
|
|
4918
4875
|
key: product.sequence && product.issueDate ? "".concat(product.sequence, "-").concat(product.issueDate) : "draft-".concat(index),
|
|
4919
|
-
|
|
4876
|
+
sx: {
|
|
4877
|
+
padding: '2px'
|
|
4878
|
+
}
|
|
4920
4879
|
}, /*#__PURE__*/React__default.createElement(ProductListRow, {
|
|
4921
4880
|
product: product,
|
|
4922
4881
|
productType: productType
|
|
@@ -4979,13 +4938,6 @@ var CancelSigmetVolcanicMovements = function CancelSigmetVolcanicMovements(_ref)
|
|
|
4979
4938
|
})));
|
|
4980
4939
|
};
|
|
4981
4940
|
|
|
4982
|
-
var useStyles = makeStyles({
|
|
4983
|
-
backdrop: {
|
|
4984
|
-
zIndex: 1500,
|
|
4985
|
-
color: '#fff'
|
|
4986
|
-
}
|
|
4987
|
-
});
|
|
4988
|
-
|
|
4989
4941
|
var isVAPhenomenon = function isVAPhenomenon(product, action) {
|
|
4990
4942
|
return action === 'CANCELLED' && product !== null && !isInstanceOfCancelSigmetOrAirmet(product) && product.phenomenon === 'VA_CLD';
|
|
4991
4943
|
};
|
|
@@ -5008,7 +4960,6 @@ var ProductFormDialogContent = function ProductFormDialogContent(_ref) {
|
|
|
5008
4960
|
productType = _ref.productType,
|
|
5009
4961
|
productCanBe = _ref.productCanBe,
|
|
5010
4962
|
product = _ref.product;
|
|
5011
|
-
var classes = useStyles();
|
|
5012
4963
|
|
|
5013
4964
|
var _useApiContext = useApiContext(),
|
|
5014
4965
|
api = _useApiContext.api;
|
|
@@ -5193,7 +5144,10 @@ var ProductFormDialogContent = function ProductFormDialogContent(_ref) {
|
|
|
5193
5144
|
}), /*#__PURE__*/React.createElement(DraftFieldHelper, null), /*#__PURE__*/React.createElement(Backdrop, {
|
|
5194
5145
|
"data-testid": "loader",
|
|
5195
5146
|
open: showLoader,
|
|
5196
|
-
|
|
5147
|
+
sx: {
|
|
5148
|
+
zIndex: 1500,
|
|
5149
|
+
color: '#fff'
|
|
5150
|
+
}
|
|
5197
5151
|
}, /*#__PURE__*/React.createElement(CircularProgress, {
|
|
5198
5152
|
color: "inherit"
|
|
5199
5153
|
})));
|
|
@@ -5346,13 +5300,12 @@ var MetInfoWrapper = function MetInfoWrapper(_ref) {
|
|
|
5346
5300
|
* See the License for the specific language governing permissions and
|
|
5347
5301
|
* limitations under the License.
|
|
5348
5302
|
*
|
|
5349
|
-
* Copyright
|
|
5350
|
-
* Copyright
|
|
5303
|
+
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
5304
|
+
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
5351
5305
|
* */
|
|
5352
|
-
|
|
5353
|
-
|
|
5306
|
+
|
|
5307
|
+
var getApiRoutes = function getApiRoutes(axiosInstance) {
|
|
5354
5308
|
return {
|
|
5355
|
-
// api data
|
|
5356
5309
|
getSigmetList: function getSigmetList() {
|
|
5357
5310
|
return axiosInstance.get('/sigmetlist');
|
|
5358
5311
|
},
|
|
@@ -5362,16 +5315,21 @@ var createApi = function createApi(url, appUrl, auth, setAuth, authTokenUrl, aut
|
|
|
5362
5315
|
getSigmetTAC: function getSigmetTAC(sigmetData) {
|
|
5363
5316
|
return axiosInstance.post('/sigmet2tac', Object.assign({}, sigmetData));
|
|
5364
5317
|
},
|
|
5365
|
-
postAirmet: function postAirmet(formData) {
|
|
5366
|
-
return axiosInstance.post('/airmet', Object.assign({}, formData));
|
|
5367
|
-
},
|
|
5368
5318
|
getAirmetList: function getAirmetList() {
|
|
5369
5319
|
return axiosInstance.get('/airmetlist');
|
|
5370
5320
|
},
|
|
5321
|
+
postAirmet: function postAirmet(formData) {
|
|
5322
|
+
return axiosInstance.post('/airmet', Object.assign({}, formData));
|
|
5323
|
+
},
|
|
5371
5324
|
getAirmetTAC: function getAirmetTAC(sigmetData) {
|
|
5372
5325
|
return axiosInstance.post('/airmet2tac', Object.assign({}, sigmetData));
|
|
5373
5326
|
}
|
|
5374
5327
|
};
|
|
5375
5328
|
};
|
|
5376
5329
|
|
|
5330
|
+
var createApi = function createApi(url, appUrl, auth, setAuth, authTokenUrl, authClientId) {
|
|
5331
|
+
var axiosInstance = createApiInstance(url, appUrl, auth, setAuth, authTokenUrl, authClientId);
|
|
5332
|
+
return getApiRoutes(axiosInstance);
|
|
5333
|
+
};
|
|
5334
|
+
|
|
5377
5335
|
export { AirmetForm, ContentDialog, MapViewGeoJson, MetInfoWrapper, ProductList, ProductListRow, SigmetForm, createApi };
|