@opengeoweb/sigmet-airmet 12.12.0 → 13.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 +357 -184
- package/package.json +12 -12
- package/src/lib/components/ProductForms/AirmetForm/AirmetForm.d.ts +1 -0
- package/src/lib/components/ProductForms/ProductFormFields/DegreesMinutesField.d.ts +11 -0
- package/src/lib/components/ProductForms/ProductFormFields/DegreesMinutesField.spec.d.ts +1 -0
- package/src/lib/components/ProductForms/ProductFormFields/ValidFrom.d.ts +4 -1
- package/src/lib/components/ProductForms/ProductFormFields/VolcanicFields.d.ts +1 -0
- package/src/lib/components/ProductForms/ProductFormTac.d.ts +0 -7
- package/src/lib/components/ProductForms/SigmetForm/SigmetForm.d.ts +1 -0
- package/src/lib/components/ProductForms/utils.d.ts +5 -5
- package/src/lib/types.d.ts +1 -0
package/index.esm.js
CHANGED
|
@@ -3,9 +3,9 @@ import { createApiInstance, useApiContext, useApi, ApiProvider, createFakeApiIns
|
|
|
3
3
|
import { PROJECTION, useIsMounted, dateUtils, CustomTooltip, usePrevious, ConfirmationServiceProvider, usePreventBrowserClose, useConfirmationDialog, CustomDialog, AlertBanner, isAxiosError, getAxiosErrorMessage, StatusTag, usePoller, ErrorBoundary } from '@opengeoweb/shared';
|
|
4
4
|
import { Box as Box$1 } from '@mui/system';
|
|
5
5
|
import * as React from 'react';
|
|
6
|
-
import React__default, { useRef, useEffect, useCallback } from 'react';
|
|
7
|
-
import { FormControlLabel, Radio, Grid, Typography, Box, Checkbox, MenuItem, FormHelperText, useTheme, Backdrop, CircularProgress, Card, Button, LinearProgress, List, ListItemButton } from '@mui/material';
|
|
8
|
-
import { useFormContext } from 'react-hook-form';
|
|
6
|
+
import React__default, { useState, useRef, useEffect, useCallback } from 'react';
|
|
7
|
+
import { FormControlLabel, Radio, Grid, Typography, Box, Checkbox, MenuItem, FormHelperText, TextField, useTheme, Backdrop, CircularProgress, Card, Button, LinearProgress, List, ListItemButton } from '@mui/material';
|
|
8
|
+
import { useFormContext, Controller } from 'react-hook-form';
|
|
9
9
|
import { FORM_FIELDS_NAMESPACE, useDraftFormHelpers, ReactHookFormRadioGroup, hasValidGeometry, ReactHookFormSelect, ReactHookFormNumberField, isInteger, isValidMin, isValidMax, isEmpty, ReactHookFormDateTime, countIntersectionPoints, hasMulitpleIntersections, ReactHookFormHiddenInput, hasIntersectionWithFIR, isValidGeoJsonCoordinates, isMaximumOneDrawing, isXHoursBefore, isXHoursAfter, ReactHookFormTextField, isLatitude, isNonOrBothCoordinates, isLongitude, ReactHookFormFormControl, isGeometryDirty, ReactHookFormProvider, defaultFormOptions } from '@opengeoweb/form-fields';
|
|
10
10
|
import { defaultIntersectionStyleProperties, defaultGeoJSONStyleProperties, addSelectionTypeToGeoJSON, DRAWMODE, defaultPoint, addGeoJSONProperties, defaultBox, defaultPolygon, defaultDelete, getIcon, addFeatureProperties, OpenLayersFeatureLayer, genericOpenLayersFeatureStyle, OpenLayersMapDraw, useMapDrawTool, rewindGeometry } from '@opengeoweb/webmap-react';
|
|
11
11
|
import i18n from 'i18next';
|
|
@@ -110,7 +110,9 @@ var en = {
|
|
|
110
110
|
"issued-at": "Issued at",
|
|
111
111
|
"volcano-name": "Volcano name",
|
|
112
112
|
latitude: "Latitude",
|
|
113
|
+
"latitude-degrees-and-minutes": "Latitude (deg and min)",
|
|
113
114
|
longitude: "Longitude",
|
|
115
|
+
"longitude-degrees-and-minutes": "Longitude (deg and min)",
|
|
114
116
|
"tac-missing-data": "Missing data: no TAC can be generated",
|
|
115
117
|
"invalid-surface-wind-direction-message": "Direction must be rounded to the nearest {{value}} deg.",
|
|
116
118
|
"surface-wind-label": "wind direction",
|
|
@@ -270,127 +272,130 @@ var fi = {
|
|
|
270
272
|
};
|
|
271
273
|
var no = {
|
|
272
274
|
"sigmet-airmet": "sigmet",
|
|
273
|
-
levels: "
|
|
274
|
-
"not-published": "(
|
|
275
|
-
"valid-time": "
|
|
276
|
-
"vulcanic-ash-description": "
|
|
277
|
-
"vulcanic-VA-SIGMET-text": "
|
|
278
|
-
"vulcanic-cloud-moving-text": "
|
|
279
|
-
unknown: "
|
|
280
|
-
"create-new-product": "
|
|
281
|
-
discard: "
|
|
282
|
-
renew: "
|
|
283
|
-
save: "
|
|
284
|
-
cancel: "
|
|
285
|
-
"yes-cancel": "
|
|
286
|
-
publish: "
|
|
287
|
-
draft: "
|
|
275
|
+
levels: "Levels",
|
|
276
|
+
"not-published": "(Not published)",
|
|
277
|
+
"valid-time": "Valid time",
|
|
278
|
+
"vulcanic-ash-description": "Use the FIR to indicate the direction the Volcanic Ash is moving to",
|
|
279
|
+
"vulcanic-VA-SIGMET-text": "Cancel VA SIGMET without VA MOV TO information",
|
|
280
|
+
"vulcanic-cloud-moving-text": "Volcanic Cloud is moving in the direction of",
|
|
281
|
+
unknown: "Unknown",
|
|
282
|
+
"create-new-product": "Lag en ny {{ product }}",
|
|
283
|
+
discard: "DISCARD",
|
|
284
|
+
renew: "Renew {{product}}",
|
|
285
|
+
save: "Save",
|
|
286
|
+
cancel: "Cancel",
|
|
287
|
+
"yes-cancel": "Yes, cancel {{product}}",
|
|
288
|
+
publish: "Publish",
|
|
289
|
+
draft: "DRAFT",
|
|
288
290
|
"error-title": "Noe gikk galt med innlasting av konfigurasjonfil",
|
|
289
291
|
"error-auth-login": "Denne delen er passordbeskyttet. Vennligst logg inn.",
|
|
290
292
|
"error-backend": "En feil har oppstått ved nedlasting av listen, vennligst prøv igjen.",
|
|
291
|
-
"saved-as-draft": "
|
|
292
|
-
cancels: "
|
|
293
|
-
close: "
|
|
294
|
-
"discard-non-capitalized": "
|
|
295
|
-
"are-you-sure-you-want-to-discard": "
|
|
293
|
+
"saved-as-draft": "saved as draft",
|
|
294
|
+
cancels: "Cancels",
|
|
295
|
+
close: "Close",
|
|
296
|
+
"discard-non-capitalized": "Discard",
|
|
297
|
+
"are-you-sure-you-want-to-discard": "Are you sure you would like to discard this {{product}}? Its properties will be lost",
|
|
296
298
|
"are-you-sure-amend": "Are you sure you want to amend this {{product}}?",
|
|
297
|
-
"save-changes-made": "
|
|
298
|
-
"publish-this-product": "
|
|
299
|
-
"cancel-this-product": "
|
|
300
|
-
"save-and-close": "
|
|
301
|
-
"discard-and-close": "
|
|
302
|
-
"drop-a-point-as": "
|
|
303
|
-
"draw-a-box-as": "
|
|
304
|
-
"draw-a-shape-as": "
|
|
305
|
-
"set-a-fir-as": "
|
|
306
|
-
"remove-geometry": "
|
|
307
|
-
"valid-until-time": "
|
|
308
|
-
"discard-product": "
|
|
299
|
+
"save-changes-made": "Do you want to save any changes made?",
|
|
300
|
+
"publish-this-product": "Are you sure you want to publish this {{product}}?",
|
|
301
|
+
"cancel-this-product": "Are you sure you want to cancel this {{product}}?",
|
|
302
|
+
"save-and-close": "Save and close",
|
|
303
|
+
"discard-and-close": "Discard and close",
|
|
304
|
+
"drop-a-point-as": "Drop a point as {{type}} position",
|
|
305
|
+
"draw-a-box-as": "Draw a box as {{type}} position",
|
|
306
|
+
"draw-a-shape-as": "Draw a shape as {{type}} position",
|
|
307
|
+
"set-a-fir-as": "Set FIR as {{type}} position",
|
|
308
|
+
"remove-geometry": "Remove geometry",
|
|
309
|
+
"valid-until-time": "Valid until time has to be after Valid from time",
|
|
310
|
+
"discard-product": "Discard {{product}}",
|
|
309
311
|
"amend-product": "Amend {{product}}",
|
|
310
|
-
"issue-time": "
|
|
312
|
+
"issue-time": "Issue time",
|
|
311
313
|
"type-title": "Type",
|
|
312
|
-
"phenomenon-title": "
|
|
313
|
-
"observation-label": "
|
|
314
|
-
"forecast-label": "
|
|
315
|
-
"valid-from-before-current-error": "
|
|
316
|
-
"valid-from-time-error": "
|
|
317
|
-
"date-and-time": "
|
|
318
|
-
"valid-from": "
|
|
319
|
-
"valid-until": "
|
|
320
|
-
"valid-until-time-error": "
|
|
321
|
-
"select-fir-title": "
|
|
322
|
-
"select-fir-label": "
|
|
323
|
-
"geometry-coodinates-empty-message": "
|
|
324
|
-
"geometry-no-intersection-message": "
|
|
325
|
-
"geometry-exit-draw-mode-message": "
|
|
326
|
-
"geometry-max-feature-points-message": "
|
|
327
|
-
"geometry-multi-intersections-message": "
|
|
328
|
-
"geometry-maximum-points-message": "
|
|
329
|
-
"geometry-more-than-6-points-message": "
|
|
330
|
-
"geometry-intersection-above-6-points-message": "
|
|
331
|
-
"geometry-only-one-start-position-drawing": "
|
|
332
|
-
"progress-get-movement-step-valktmessage": "
|
|
333
|
-
"progress-get-movement-step-valkmhmessage": "
|
|
334
|
-
"progress-coordinate-empty-message": "
|
|
335
|
-
"progress-no-intersection-message": "
|
|
336
|
-
"invalid-unit": "
|
|
337
|
-
"progress-maximumPointsMessage": "
|
|
338
|
-
"progress-more-than-6-points-message": "
|
|
339
|
-
"progress-intersection-above-6-points-message": "
|
|
340
|
-
"progress-radio-button-label-no-va-exp": "
|
|
341
|
-
"progress-radio-button-label-stationary": "
|
|
342
|
-
"progress-radio-button-label-movement": "
|
|
343
|
-
"progress-radio-button-label-end-potision": "
|
|
344
|
-
"progress-movement-direction-label": "
|
|
345
|
-
"progress-movement-unit-label": "
|
|
346
|
-
"progress-movement-speed-label": "
|
|
347
|
-
"progress-the-minimum-level-in-movement": "
|
|
348
|
-
"progress-the-maxium-level-in-movement": "
|
|
349
|
-
"progress-only-one-position-drawing": "
|
|
350
|
-
at: "
|
|
351
|
-
select: "
|
|
352
|
-
"observation-forecast-error": "
|
|
353
|
-
"start-position": "
|
|
354
|
-
between: "
|
|
355
|
-
above: "
|
|
356
|
-
change: "
|
|
357
|
-
weakening: "
|
|
358
|
-
"no-change": "
|
|
359
|
-
intensifying: "
|
|
360
|
-
"issued-at": "
|
|
361
|
-
"volcano-name": "
|
|
362
|
-
latitude: "
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
"
|
|
366
|
-
"
|
|
367
|
-
"surface-wind-
|
|
368
|
-
"surface-wind-
|
|
369
|
-
"surface-wind-
|
|
370
|
-
"surface-wind-
|
|
371
|
-
"surface-wind-
|
|
372
|
-
"
|
|
373
|
-
"
|
|
374
|
-
|
|
375
|
-
"
|
|
376
|
-
|
|
377
|
-
"levels-get-level-invalid-steps-for-
|
|
378
|
-
"levels-invalid-unit-message": "
|
|
379
|
-
"levels-
|
|
380
|
-
|
|
381
|
-
"levels-
|
|
382
|
-
|
|
383
|
-
"levels-
|
|
384
|
-
"
|
|
385
|
-
"levels-
|
|
386
|
-
"
|
|
387
|
-
|
|
388
|
-
"
|
|
389
|
-
|
|
390
|
-
"surface-visibility
|
|
391
|
-
"surface-visibility-
|
|
392
|
-
"surface-visibility-
|
|
393
|
-
|
|
314
|
+
"phenomenon-title": "What",
|
|
315
|
+
"observation-label": "Observed",
|
|
316
|
+
"forecast-label": "Forecast",
|
|
317
|
+
"valid-from-before-current-error": "Valid from time cannot be before current time",
|
|
318
|
+
"valid-from-time-error": "Valid from time can be no more than {{hours}} hours after current time",
|
|
319
|
+
"date-and-time": "Date and time",
|
|
320
|
+
"valid-from": "Valid from",
|
|
321
|
+
"valid-until": "Valid until",
|
|
322
|
+
"valid-until-time-error": "Valid until time can be no more than {{hours}} hours after Valid from time",
|
|
323
|
+
"select-fir-title": "Where",
|
|
324
|
+
"select-fir-label": "Select FIR",
|
|
325
|
+
"geometry-coodinates-empty-message": "A start position drawing is required",
|
|
326
|
+
"geometry-no-intersection-message": "The start position needs to be (partly) inside the FIR",
|
|
327
|
+
"geometry-exit-draw-mode-message": "Press ESC to exit draw mode",
|
|
328
|
+
"geometry-max-feature-points-message": "Intersection of the drawn polygon with the FIR-boundary has more than 6 individual points. Check if the TAC in the preview corresponds to the intended area.",
|
|
329
|
+
"geometry-multi-intersections-message": "The drawn polygon has multiple intersections with the FIR-boundary. The drawn polygon will be used for the TAC-code.",
|
|
330
|
+
"geometry-maximum-points-message": "The start position drawing allows a maximum of {{maxPoints}} individual points",
|
|
331
|
+
"geometry-more-than-6-points-message": "The start/end position drawing has exceeded 6 individual points. The TAC has a total of {{totalDrawnPoints}} points. If possible, reduce the number of points.",
|
|
332
|
+
"geometry-intersection-above-6-points-message": "The start/end position of the intersected polygon has {{intersectingPolygonPointsTotal}} points, and the intersection of the drawn polygon with the FIR-boundary has exceeded 6 individual points. Check if the TAC in the preview corresponds to the intended area.",
|
|
333
|
+
"geometry-only-one-start-position-drawing": "Only one start position drawing is allowed",
|
|
334
|
+
"progress-get-movement-step-valktmessage": "Speed should be rounded to the nearest {{value}}kt",
|
|
335
|
+
"progress-get-movement-step-valkmhmessage": "Speed should be rounded to the nearest {{value}}kmh",
|
|
336
|
+
"progress-coordinate-empty-message": "An end position drawing is required when selecting End position",
|
|
337
|
+
"progress-no-intersection-message": "The end position needs to be (partly) inside the FIR",
|
|
338
|
+
"invalid-unit": "Invalid unit",
|
|
339
|
+
"progress-maximumPointsMessage": "The end position drawing allows a maximum of {{maxPoints}} individual points",
|
|
340
|
+
"progress-more-than-6-points-message": "The start/end position drawing has exceeded 6 individual points. The TAC has a total of {{totalDrawnPoints}} points. If possible, reduce the number of points.",
|
|
341
|
+
"progress-intersection-above-6-points-message": "The start/end position of the intersected polygon has {{intersectingPolygonPointsTotal}} points, and the intersection of the drawn polygon with the FIR-boundary has exceeded 6 individual points. Check if the TAC in the preview corresponds to the intended area.",
|
|
342
|
+
"progress-radio-button-label-no-va-exp": "No volcanic ash expected",
|
|
343
|
+
"progress-radio-button-label-stationary": "Stationary",
|
|
344
|
+
"progress-radio-button-label-movement": "Movement",
|
|
345
|
+
"progress-radio-button-label-end-potision": "End position",
|
|
346
|
+
"progress-movement-direction-label": "Set direction",
|
|
347
|
+
"progress-movement-unit-label": "Unit",
|
|
348
|
+
"progress-movement-speed-label": "Step speed",
|
|
349
|
+
"progress-the-minimum-level-in-movement": "The minimum level in {{movementUnitType}} is {{movementUnit}}",
|
|
350
|
+
"progress-the-maxium-level-in-movement": "The maximum level in {{movementUnitType}} is {{movementUnit}}",
|
|
351
|
+
"progress-only-one-position-drawing": "Only one end position drawing is allowed",
|
|
352
|
+
at: "At",
|
|
353
|
+
select: "Select",
|
|
354
|
+
"observation-forecast-error": "Observation time cannot be in the future",
|
|
355
|
+
"start-position": "Start position",
|
|
356
|
+
between: "Between",
|
|
357
|
+
above: "Above",
|
|
358
|
+
change: "Change",
|
|
359
|
+
weakening: "Weakening",
|
|
360
|
+
"no-change": "No change",
|
|
361
|
+
intensifying: "Intensifying",
|
|
362
|
+
"issued-at": "Issued at",
|
|
363
|
+
"volcano-name": "Volcano name",
|
|
364
|
+
latitude: "Latitude",
|
|
365
|
+
"latitude-degrees-and-minutes": "Latitude (deg and min)",
|
|
366
|
+
longitude: "Longitude",
|
|
367
|
+
"longitude-degrees-and-minutes": "Longitude (deg and min)",
|
|
368
|
+
"tac-missing-data": "Missing data: no TAC can be generated",
|
|
369
|
+
"invalid-surface-wind-direction-message": "Direction must be rounded to the nearest {{value}} deg.",
|
|
370
|
+
"surface-wind-label": "wind direction",
|
|
371
|
+
"surface-wind-speed-label": "speed",
|
|
372
|
+
"surface-wind-helper-text": "Value in degrees",
|
|
373
|
+
"surface-wind-rule-min-max-message": "Direction should be between 10 and 360 deg.",
|
|
374
|
+
"surface-wind-minimum-wind-speed": "The minimum wind speed in {{windUnit}} is {{minWindSpeedValue}}",
|
|
375
|
+
"surface-wind-maximum-wind-speed": "The maximum wind speed in {{windUnit}} is {{maxWindSpeedValue}}",
|
|
376
|
+
"invalid-surface-visibility-till-750-steps-message": "A visibility below 750m must be rounded to the nearest {{value}}m",
|
|
377
|
+
"invalid-surface-visibility-from-750-steps-message": "A visibility above 750m must be rounded to the nearest {{value}}m",
|
|
378
|
+
set: "Set",
|
|
379
|
+
"levels-get-level-invalid-steps-for-fl-unit-message": "Levels must be rounded to the nearest {{value}}",
|
|
380
|
+
"levels-get-level-invalid-steps-for-ft-unit-message": "Levels must be rounded to the nearest {{value}}ft",
|
|
381
|
+
"levels-get-level-invalid-steps-for-m-unit-message": "Levels must be rounded to the nearest {{value}}m",
|
|
382
|
+
"levels-invalid-unit-message": "Level unit not defined",
|
|
383
|
+
"levels-invalid-level-unit-combination-message": "Invalid unit combination",
|
|
384
|
+
level: "Level",
|
|
385
|
+
"levels-the-minimum-level": "The minimum level in {{levelUnit}} is {{minLevelValue}}",
|
|
386
|
+
"levels-the-maximum-level": "The maximum level in {{levelUnit}} is {{maxLevelValue}}",
|
|
387
|
+
"levels-upper-level-label": "Upper level",
|
|
388
|
+
"unit-label": "Unit",
|
|
389
|
+
"levels-lower-level-label": "Lower level",
|
|
390
|
+
"levels-tops-label": "Top",
|
|
391
|
+
progress: "Progress",
|
|
392
|
+
"surface-visibility": "Visibility",
|
|
393
|
+
"surface-visibility-cause": "Cause",
|
|
394
|
+
"surface-visibility-minimum-visibility": "The minimum visibility in meters is {{minimumVisibility}}",
|
|
395
|
+
"surface-visibility-maximum-visibility": "The maximum visibility in meters is {{maximumVisibility}}",
|
|
396
|
+
"surface-visibility-helper-text": "Value in meters",
|
|
397
|
+
"surface-visibility-between-time": "Forecast time should lie between the valid start and valid end time",
|
|
398
|
+
phenomenon: "Phenomenon"
|
|
394
399
|
};
|
|
395
400
|
var nl = {
|
|
396
401
|
"sigmet-airmet": "sigmet",
|
|
@@ -4795,17 +4800,6 @@ var hasMaxFeaturePoints = function hasMaxFeaturePoints(geojson, maxPoints) {
|
|
|
4795
4800
|
}
|
|
4796
4801
|
return false;
|
|
4797
4802
|
};
|
|
4798
|
-
// Uses same logic as the backend
|
|
4799
|
-
// https://gitlab.com/opengeoweb/avi-msgconverter/geoweb-knmi-avi-messageservices/-/blob/master/src/main/java/nl/knmi/geoweb/backend/product/sigmetairmet/SigmetAirmetUtils.java?ref_type=heads#L440
|
|
4800
|
-
function getTacGeometry(_ref) {
|
|
4801
|
-
var startGeometry = _ref.startGeometry,
|
|
4802
|
-
startGeometryIntersect = _ref.startGeometryIntersect,
|
|
4803
|
-
maxPoints = _ref.maxPoints;
|
|
4804
|
-
if (startGeometryIntersect && startGeometryIntersect.features.length > 0 && !hasMaxFeaturePoints(startGeometryIntersect, maxPoints)) {
|
|
4805
|
-
return startGeometryIntersect;
|
|
4806
|
-
}
|
|
4807
|
-
return startGeometry;
|
|
4808
|
-
}
|
|
4809
4803
|
var DEFAULT_MINIMUM_SURFACE_LEVEL = 0;
|
|
4810
4804
|
var getMinCloudLevelValue = function getMinCloudLevelValue(unit, selectedFIR, productConfig) {
|
|
4811
4805
|
// Use first FIR in list if no FIR selected
|
|
@@ -4953,13 +4947,13 @@ var getProductFormMode = function getProductFormMode(canBeOptions, productListIt
|
|
|
4953
4947
|
}
|
|
4954
4948
|
return canBeOptions.includes('PUBLISHED') ? 'edit' : 'view';
|
|
4955
4949
|
};
|
|
4956
|
-
var getLifecycleActions = function getLifecycleActions(
|
|
4957
|
-
var canBe =
|
|
4958
|
-
onButtonPress =
|
|
4959
|
-
productType =
|
|
4960
|
-
|
|
4961
|
-
areActionsDisabled =
|
|
4962
|
-
t =
|
|
4950
|
+
var getLifecycleActions = function getLifecycleActions(_ref) {
|
|
4951
|
+
var canBe = _ref.canBe,
|
|
4952
|
+
onButtonPress = _ref.onButtonPress,
|
|
4953
|
+
productType = _ref.productType,
|
|
4954
|
+
_ref$areActionsDisabl = _ref.areActionsDisabled,
|
|
4955
|
+
areActionsDisabled = _ref$areActionsDisabl === void 0 ? false : _ref$areActionsDisabl,
|
|
4956
|
+
t = _ref.t;
|
|
4963
4957
|
var hasDiscardButton = canBe.includes('DISCARDED');
|
|
4964
4958
|
var onDiscard = function onDiscard() {
|
|
4965
4959
|
return onButtonPress(ProductAction.DISCARD);
|
|
@@ -5011,7 +5005,7 @@ var hasValue = function hasValue(value) {
|
|
|
5011
5005
|
};
|
|
5012
5006
|
var prepareFormValues = function prepareFormValues(product) {
|
|
5013
5007
|
return Object.keys(product).reduce(function (list, key) {
|
|
5014
|
-
var
|
|
5008
|
+
var _ref3;
|
|
5015
5009
|
var value = product[key];
|
|
5016
5010
|
// remove hidden form values
|
|
5017
5011
|
if (key === 'IS_DRAFT') {
|
|
@@ -5031,14 +5025,14 @@ var prepareFormValues = function prepareFormValues(product) {
|
|
|
5031
5025
|
}
|
|
5032
5026
|
// check if nested object has value
|
|
5033
5027
|
if (typeof value === 'object' && value !== null && value !== undefined) {
|
|
5034
|
-
var
|
|
5028
|
+
var _ref2;
|
|
5035
5029
|
var hasNaNValue = Object.keys(value).reduce(function (total, valKey) {
|
|
5036
5030
|
var keyValue = value[valKey];
|
|
5037
5031
|
return !hasValue(String(keyValue)) || total;
|
|
5038
5032
|
}, false);
|
|
5039
|
-
return Object.assign({}, list, !hasNaNValue && (
|
|
5033
|
+
return Object.assign({}, list, !hasNaNValue && (_ref2 = {}, _ref2[key] = value, _ref2));
|
|
5040
5034
|
}
|
|
5041
|
-
return Object.assign({}, list, hasValue(value) && (
|
|
5035
|
+
return Object.assign({}, list, hasValue(value) && (_ref3 = {}, _ref3[key] = value, _ref3));
|
|
5042
5036
|
}, {});
|
|
5043
5037
|
};
|
|
5044
5038
|
var createSigmetPostParameter = function createSigmetPostParameter(sigmetToPost, newStatus, previousUuid) {
|
|
@@ -5327,6 +5321,56 @@ var useFormLayers = function useFormLayers(layers) {
|
|
|
5327
5321
|
formFeatures: formLayers
|
|
5328
5322
|
}, sourcePanelId);
|
|
5329
5323
|
};
|
|
5324
|
+
function degreesMinutesToDecimal(input) {
|
|
5325
|
+
var raw = input.toString().trim();
|
|
5326
|
+
var negative = raw.startsWith('-');
|
|
5327
|
+
var digits = raw.replace(/[^0-9]/g, '');
|
|
5328
|
+
var sign = negative ? -1 : 1;
|
|
5329
|
+
if (digits.length <= 2) {
|
|
5330
|
+
var _deg = parseInt(digits || '0', 10);
|
|
5331
|
+
return sign * _deg;
|
|
5332
|
+
}
|
|
5333
|
+
// split into degrees + minutes
|
|
5334
|
+
var deg = parseInt(digits.slice(0, digits.length - 2), 10);
|
|
5335
|
+
var min = parseInt(digits.slice(-2), 10);
|
|
5336
|
+
// normalize minutes overflow (e.g. 65 → 1°05′)
|
|
5337
|
+
var extraDeg = Math.floor(min / 60);
|
|
5338
|
+
min %= 60;
|
|
5339
|
+
return sign * (deg + extraDeg + min / 60);
|
|
5340
|
+
}
|
|
5341
|
+
function decimalToDegreesMinutes(value) {
|
|
5342
|
+
var sign = value < 0 ? '-' : '';
|
|
5343
|
+
var abs = Math.abs(value);
|
|
5344
|
+
var degrees = Math.floor(abs);
|
|
5345
|
+
var minutes = Math.round((abs - degrees) * 60);
|
|
5346
|
+
// normalize rounding overflow (e.g. 59.9 min → +1 degree)
|
|
5347
|
+
if (minutes === 60) {
|
|
5348
|
+
abs += 1;
|
|
5349
|
+
return decimalToDegreesMinutes(sign === '-' ? -abs : abs);
|
|
5350
|
+
}
|
|
5351
|
+
return "" + sign + degrees + "\xB0" + minutes.toString().padStart(2, '0') + "\u2032";
|
|
5352
|
+
}
|
|
5353
|
+
var getSequenceStyling = function getSequenceStyling(product, hasTac) {
|
|
5354
|
+
if (hasTac === void 0) {
|
|
5355
|
+
hasTac = false;
|
|
5356
|
+
}
|
|
5357
|
+
if (hasTac && !product || product && product.status === 'DRAFT' || product && product.status === '') {
|
|
5358
|
+
return {
|
|
5359
|
+
fontWeight: 'lighter',
|
|
5360
|
+
color: 'geowebColors.typographyAndIcons.inactiveText'
|
|
5361
|
+
};
|
|
5362
|
+
}
|
|
5363
|
+
return {};
|
|
5364
|
+
};
|
|
5365
|
+
var findSequenceNumber = function findSequenceNumber(tac, noTac) {
|
|
5366
|
+
var _tac$split$find;
|
|
5367
|
+
var tacLines = tac.split('\n');
|
|
5368
|
+
var hasTac = tacLines.length > 0 && tac !== noTac;
|
|
5369
|
+
var sequenceRegex = /^([A-Z]\d{2}|\d{1,2})$/;
|
|
5370
|
+
return hasTac ? (_tac$split$find = tac.split(/\s+/).find(function (word) {
|
|
5371
|
+
return sequenceRegex.test(word);
|
|
5372
|
+
})) != null ? _tac$split$find : null : null;
|
|
5373
|
+
};
|
|
5330
5374
|
|
|
5331
5375
|
var styles$1 = {
|
|
5332
5376
|
radioInput: {
|
|
@@ -6733,6 +6777,8 @@ var ValidFrom = function ValidFrom(_ref) {
|
|
|
6733
6777
|
var productConfig = _ref.productConfig,
|
|
6734
6778
|
isDisabled = _ref.isDisabled,
|
|
6735
6779
|
isReadOnly = _ref.isReadOnly,
|
|
6780
|
+
_ref$isAmending = _ref.isAmending,
|
|
6781
|
+
isAmending = _ref$isAmending === void 0 ? false : _ref$isAmending,
|
|
6736
6782
|
_ref$onChange = _ref.onChange,
|
|
6737
6783
|
_onChange = _ref$onChange === void 0 ? function () {} : _ref$onChange,
|
|
6738
6784
|
_ref$onUserChange = _ref.onUserChange,
|
|
@@ -6741,10 +6787,35 @@ var ValidFrom = function ValidFrom(_ref) {
|
|
|
6741
6787
|
t = _useSigmetAirmetTrans.t;
|
|
6742
6788
|
var _useFormContext = useFormContext(),
|
|
6743
6789
|
getValues = _useFormContext.getValues,
|
|
6790
|
+
setValue = _useFormContext.setValue,
|
|
6744
6791
|
trigger = _useFormContext.trigger;
|
|
6745
6792
|
var _useDraftFormHelpers = useDraftFormHelpers(),
|
|
6746
6793
|
isRequired = _useDraftFormHelpers.isRequired;
|
|
6747
6794
|
var label = getFieldLabel(t, t('date-and-time'), isReadOnly);
|
|
6795
|
+
// Update input field to now if amending exceeds the current minute
|
|
6796
|
+
React__default.useEffect(function () {
|
|
6797
|
+
if (!isAmending) {
|
|
6798
|
+
return undefined;
|
|
6799
|
+
}
|
|
6800
|
+
var updateNow = function updateNow() {
|
|
6801
|
+
setValue('validDateStart', dateUtils.getCurrentTimeAsString(), {
|
|
6802
|
+
shouldValidate: true
|
|
6803
|
+
});
|
|
6804
|
+
};
|
|
6805
|
+
updateNow();
|
|
6806
|
+
var intervalId;
|
|
6807
|
+
var msUntilNextMinute = 60000 - Date.now() % 60000;
|
|
6808
|
+
var timeoutId = setTimeout(function () {
|
|
6809
|
+
updateNow();
|
|
6810
|
+
intervalId = setInterval(updateNow, 60000);
|
|
6811
|
+
}, msUntilNextMinute);
|
|
6812
|
+
return function () {
|
|
6813
|
+
clearTimeout(timeoutId);
|
|
6814
|
+
if (intervalId) {
|
|
6815
|
+
clearInterval(intervalId);
|
|
6816
|
+
}
|
|
6817
|
+
};
|
|
6818
|
+
}, [isAmending, setValue]);
|
|
6748
6819
|
return jsx(ProductFormFieldLayout, {
|
|
6749
6820
|
title: t('valid-from'),
|
|
6750
6821
|
children: jsx(ReactHookFormDateTime, {
|
|
@@ -6752,18 +6823,19 @@ var ValidFrom = function ValidFrom(_ref) {
|
|
|
6752
6823
|
name: "validDateStart",
|
|
6753
6824
|
label: label,
|
|
6754
6825
|
defaultNullValue: getDefaultValidFromValue(productConfig),
|
|
6755
|
-
rules: {
|
|
6826
|
+
rules: isAmending ? {} // skip validation, auto-controlled
|
|
6827
|
+
: {
|
|
6756
6828
|
validate: {
|
|
6757
6829
|
isRequired: isRequired,
|
|
6758
6830
|
isValidDate: dateUtils.isValidIsoDateString,
|
|
6759
|
-
// The validity start
|
|
6831
|
+
// The validity start cannot be before the current time
|
|
6760
6832
|
isValueBeforeCurrentTime: function isValueBeforeCurrentTime(value) {
|
|
6761
6833
|
return isXHoursBefore(value, dateUtils.getCurrentTimeAsString(), 0) || t('valid-from-before-current-error');
|
|
6762
6834
|
},
|
|
6763
6835
|
// The current time can be no more than 4 hours before the validity start (12 for VA/TC SIGMET)
|
|
6764
6836
|
isCurrentTimeXHoursBeforeValue: function isCurrentTimeXHoursBeforeValue(value) {
|
|
6765
6837
|
var isValid = isXHoursBefore(dateUtils.getCurrentTimeAsString(), value, getHoursBeforeValidity(getValues('phenomenon'), getValues('locationIndicatorATSR'), productConfig));
|
|
6766
|
-
return isValid
|
|
6838
|
+
return isValid || getValidFromXHoursBeforeMessage(t, getHoursBeforeValidity(getValues('phenomenon'), getValues('locationIndicatorATSR'), productConfig));
|
|
6767
6839
|
}
|
|
6768
6840
|
}
|
|
6769
6841
|
},
|
|
@@ -6772,7 +6844,7 @@ var ValidFrom = function ValidFrom(_ref) {
|
|
|
6772
6844
|
triggerValidations(['validDateEnd', 'observationOrForecastTime'], getValues, trigger);
|
|
6773
6845
|
_onChange();
|
|
6774
6846
|
},
|
|
6775
|
-
disabled: isDisabled,
|
|
6847
|
+
disabled: isDisabled || isAmending,
|
|
6776
6848
|
isReadOnly: isReadOnly,
|
|
6777
6849
|
"data-testid": "valid-from",
|
|
6778
6850
|
sx: Object.assign({}, styles$2.helperText, {
|
|
@@ -6872,10 +6944,106 @@ var ValidUntil = function ValidUntil(_ref) {
|
|
|
6872
6944
|
});
|
|
6873
6945
|
};
|
|
6874
6946
|
|
|
6947
|
+
var DegreesMinutesField = function DegreesMinutesField(_ref) {
|
|
6948
|
+
var name = _ref.name,
|
|
6949
|
+
label = _ref.label,
|
|
6950
|
+
_ref$disabled = _ref.disabled,
|
|
6951
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
6952
|
+
_ref$isReadOnly = _ref.isReadOnly,
|
|
6953
|
+
isReadOnly = _ref$isReadOnly === void 0 ? false : _ref$isReadOnly,
|
|
6954
|
+
_ref$size = _ref.size,
|
|
6955
|
+
size = _ref$size === void 0 ? 'small' : _ref$size,
|
|
6956
|
+
_ref$isLongitude = _ref.isLongitude,
|
|
6957
|
+
isLongitude = _ref$isLongitude === void 0 ? false : _ref$isLongitude;
|
|
6958
|
+
var _useSigmetAirmetTrans = useSigmetAirmetTranslation(),
|
|
6959
|
+
t = _useSigmetAirmetTrans.t;
|
|
6960
|
+
var _useFormContext = useFormContext(),
|
|
6961
|
+
control = _useFormContext.control;
|
|
6962
|
+
var _useState = useState(null),
|
|
6963
|
+
localInput = _useState[0],
|
|
6964
|
+
setLocalInput = _useState[1];
|
|
6965
|
+
var _useState2 = useState(false),
|
|
6966
|
+
isEditing = _useState2[0],
|
|
6967
|
+
setIsEditing = _useState2[1];
|
|
6968
|
+
return jsx(Controller, {
|
|
6969
|
+
name: name,
|
|
6970
|
+
control: control,
|
|
6971
|
+
rules: {
|
|
6972
|
+
validate: function validate(value) {
|
|
6973
|
+
if (value == null || isNaN(value)) {
|
|
6974
|
+
return true;
|
|
6975
|
+
} // let empty pass
|
|
6976
|
+
if (!isLongitude && (value < -90 || value > 90)) {
|
|
6977
|
+
return t('form-fields-error-latitude-minutes');
|
|
6978
|
+
}
|
|
6979
|
+
if (isLongitude && (value < -180 || value > 180)) {
|
|
6980
|
+
return t('form-fields-error-longitude-minutes');
|
|
6981
|
+
}
|
|
6982
|
+
return true;
|
|
6983
|
+
}
|
|
6984
|
+
},
|
|
6985
|
+
render: function render(_ref2) {
|
|
6986
|
+
var _fieldState$error;
|
|
6987
|
+
var field = _ref2.field,
|
|
6988
|
+
fieldState = _ref2.fieldState;
|
|
6989
|
+
var value = field.value,
|
|
6990
|
+
onChange = field.onChange;
|
|
6991
|
+
var handleChange = function handleChange(e) {
|
|
6992
|
+
setLocalInput(e.target.value);
|
|
6993
|
+
setIsEditing(true);
|
|
6994
|
+
};
|
|
6995
|
+
var handleBlur = function handleBlur() {
|
|
6996
|
+
if (localInput != null && localInput !== '-' && localInput !== '') {
|
|
6997
|
+
var input = localInput.replace(/[^\d-]/g, '');
|
|
6998
|
+
var negative = input.startsWith('-');
|
|
6999
|
+
var digits = input.replace(/[^0-9]/g, '');
|
|
7000
|
+
// Latitude: 4 digits (DDMM), Longitude: 5 (DDDMM)
|
|
7001
|
+
var maxLen = isLongitude ? 5 : 4;
|
|
7002
|
+
if (digits.length > maxLen) {
|
|
7003
|
+
digits = digits.slice(0, maxLen);
|
|
7004
|
+
}
|
|
7005
|
+
var normalized = negative ? "-" + digits : digits;
|
|
7006
|
+
try {
|
|
7007
|
+
var decimal = degreesMinutesToDecimal(normalized);
|
|
7008
|
+
onChange(decimal);
|
|
7009
|
+
} catch (_unused) {
|
|
7010
|
+
// Invalid, do not update form value
|
|
7011
|
+
}
|
|
7012
|
+
}
|
|
7013
|
+
setIsEditing(false);
|
|
7014
|
+
setLocalInput(null);
|
|
7015
|
+
};
|
|
7016
|
+
var displayValue;
|
|
7017
|
+
if (isEditing) {
|
|
7018
|
+
displayValue = localInput != null ? localInput : '';
|
|
7019
|
+
} else if (value != null) {
|
|
7020
|
+
displayValue = decimalToDegreesMinutes(value);
|
|
7021
|
+
} else {
|
|
7022
|
+
displayValue = '';
|
|
7023
|
+
}
|
|
7024
|
+
return jsx(TextField, {
|
|
7025
|
+
placeholder: isLongitude ? 'DDD°MM′' : 'DD°MM′',
|
|
7026
|
+
label: label,
|
|
7027
|
+
value: displayValue,
|
|
7028
|
+
onChange: handleChange,
|
|
7029
|
+
onBlur: handleBlur,
|
|
7030
|
+
disabled: disabled,
|
|
7031
|
+
InputProps: {
|
|
7032
|
+
readOnly: isReadOnly
|
|
7033
|
+
},
|
|
7034
|
+
size: size,
|
|
7035
|
+
error: !!fieldState.error,
|
|
7036
|
+
helperText: (_fieldState$error = fieldState.error) == null ? void 0 : _fieldState$error.message
|
|
7037
|
+
});
|
|
7038
|
+
}
|
|
7039
|
+
});
|
|
7040
|
+
};
|
|
7041
|
+
|
|
6875
7042
|
var VolcanicFields = function VolcanicFields(_ref) {
|
|
6876
7043
|
var isDisabled = _ref.isDisabled,
|
|
6877
7044
|
isReadOnly = _ref.isReadOnly,
|
|
6878
|
-
helperText = _ref.helperText
|
|
7045
|
+
helperText = _ref.helperText,
|
|
7046
|
+
degreesAndMinutes = _ref.degreesAndMinutes;
|
|
6879
7047
|
var _useSigmetAirmetTrans = useSigmetAirmetTranslation(),
|
|
6880
7048
|
t = _useSigmetAirmetTrans.t;
|
|
6881
7049
|
var _useFormContext = useFormContext(),
|
|
@@ -6913,11 +7081,22 @@ var VolcanicFields = function VolcanicFields(_ref) {
|
|
|
6913
7081
|
})
|
|
6914
7082
|
}), (!isReadOnly || !!watch('vaSigmetVolcanoCoordinates.latitude')) && jsx(Grid, {
|
|
6915
7083
|
size: 6,
|
|
6916
|
-
children: jsx(
|
|
7084
|
+
children: degreesAndMinutes ? jsx(DegreesMinutesField, {
|
|
7085
|
+
name: "vaSigmetVolcanoCoordinates.latitude",
|
|
7086
|
+
label: t('latitude-degrees-and-minutes'),
|
|
7087
|
+
disabled: isDisabled,
|
|
7088
|
+
isReadOnly: isReadOnly
|
|
7089
|
+
}) : jsx(ReactHookFormNumberField, {
|
|
6917
7090
|
name: "vaSigmetVolcanoCoordinates.latitude",
|
|
6918
|
-
"data-testid": "vaSigmetVolcanoCoordinates.latitude",
|
|
6919
7091
|
label: t('latitude'),
|
|
6920
7092
|
inputMode: "decimal",
|
|
7093
|
+
size: "small",
|
|
7094
|
+
sx: styles$2.latitude,
|
|
7095
|
+
disabled: isDisabled,
|
|
7096
|
+
isReadOnly: isReadOnly,
|
|
7097
|
+
onChange: function onChange() {
|
|
7098
|
+
return trigger('vaSigmetVolcanoCoordinates.longitude');
|
|
7099
|
+
},
|
|
6921
7100
|
rules: {
|
|
6922
7101
|
required: true,
|
|
6923
7102
|
validate: {
|
|
@@ -6926,24 +7105,27 @@ var VolcanicFields = function VolcanicFields(_ref) {
|
|
|
6926
7105
|
return isNonOrBothCoordinates(value, getValues('vaSigmetVolcanoCoordinates.longitude'));
|
|
6927
7106
|
}
|
|
6928
7107
|
}
|
|
6929
|
-
}
|
|
6930
|
-
size: "small",
|
|
6931
|
-
sx: Object.assign({}, styles$2.latitude),
|
|
6932
|
-
disabled: isDisabled,
|
|
6933
|
-
onChange: function onChange() {
|
|
6934
|
-
return trigger('vaSigmetVolcanoCoordinates.longitude');
|
|
6935
|
-
},
|
|
6936
|
-
isReadOnly: isReadOnly
|
|
7108
|
+
}
|
|
6937
7109
|
})
|
|
6938
7110
|
}), (!isReadOnly || !!watch('vaSigmetVolcanoCoordinates.longitude')) && jsx(Grid, {
|
|
6939
7111
|
size: 6,
|
|
6940
|
-
children: jsx(
|
|
7112
|
+
children: degreesAndMinutes ? jsx(DegreesMinutesField, {
|
|
7113
|
+
name: "vaSigmetVolcanoCoordinates.longitude",
|
|
7114
|
+
label: t('longitude-degrees-and-minutes'),
|
|
7115
|
+
disabled: isDisabled,
|
|
7116
|
+
isReadOnly: isReadOnly,
|
|
7117
|
+
isLongitude: true
|
|
7118
|
+
}) : jsx(ReactHookFormNumberField, {
|
|
6941
7119
|
name: "vaSigmetVolcanoCoordinates.longitude",
|
|
6942
|
-
"data-testid": "vaSigmetVolcanoCoordinates.longitude",
|
|
6943
7120
|
label: t('longitude'),
|
|
6944
7121
|
inputMode: "decimal",
|
|
6945
7122
|
size: "small",
|
|
6946
|
-
sx:
|
|
7123
|
+
sx: styles$2.latitude,
|
|
7124
|
+
disabled: isDisabled,
|
|
7125
|
+
isReadOnly: isReadOnly,
|
|
7126
|
+
onChange: function onChange() {
|
|
7127
|
+
return trigger('vaSigmetVolcanoCoordinates.latitude');
|
|
7128
|
+
},
|
|
6947
7129
|
rules: {
|
|
6948
7130
|
required: true,
|
|
6949
7131
|
validate: {
|
|
@@ -6952,12 +7134,7 @@ var VolcanicFields = function VolcanicFields(_ref) {
|
|
|
6952
7134
|
return isNonOrBothCoordinates(value, getValues('vaSigmetVolcanoCoordinates.latitude'));
|
|
6953
7135
|
}
|
|
6954
7136
|
}
|
|
6955
|
-
}
|
|
6956
|
-
disabled: isDisabled,
|
|
6957
|
-
onChange: function onChange() {
|
|
6958
|
-
return trigger('vaSigmetVolcanoCoordinates.latitude');
|
|
6959
|
-
},
|
|
6960
|
-
isReadOnly: isReadOnly
|
|
7137
|
+
}
|
|
6961
7138
|
})
|
|
6962
7139
|
})]
|
|
6963
7140
|
})
|
|
@@ -7755,27 +7932,13 @@ var useTAC = function useTAC(t, initialProduct, getTAC, hasErrors, omitChange) {
|
|
|
7755
7932
|
};
|
|
7756
7933
|
return [TAC, delayedQuery];
|
|
7757
7934
|
};
|
|
7758
|
-
var getSequenceStyling = function getSequenceStyling(product, hasTac) {
|
|
7759
|
-
if (hasTac === void 0) {
|
|
7760
|
-
hasTac = false;
|
|
7761
|
-
}
|
|
7762
|
-
if (hasTac && !product || product && product.status === 'DRAFT' || product && product.status === '') {
|
|
7763
|
-
return {
|
|
7764
|
-
fontWeight: 'lighter',
|
|
7765
|
-
color: 'geowebColors.typographyAndIcons.inactiveText'
|
|
7766
|
-
};
|
|
7767
|
-
}
|
|
7768
|
-
return {};
|
|
7769
|
-
};
|
|
7770
7935
|
var ProductFormTAC = function ProductFormTAC(_ref3) {
|
|
7771
|
-
var _tacLines$0$split$;
|
|
7772
7936
|
var tac = _ref3.tac,
|
|
7773
7937
|
product = _ref3.product;
|
|
7774
|
-
var tacLines = tac.split('\n');
|
|
7775
7938
|
var _useSigmetAirmetTrans = useSigmetAirmetTranslation(),
|
|
7776
7939
|
t = _useSigmetAirmetTrans.t;
|
|
7777
|
-
var hasTac =
|
|
7778
|
-
var sequenceNumberInTac =
|
|
7940
|
+
var hasTac = tac.split('\n').length > 0 && tac !== noTAC(t);
|
|
7941
|
+
var sequenceNumberInTac = findSequenceNumber(tac, noTAC(t));
|
|
7779
7942
|
var sequenceStyle = getSequenceStyling(product, hasTac);
|
|
7780
7943
|
return jsx(Typography, {
|
|
7781
7944
|
variant: "body2",
|
|
@@ -8224,7 +8387,8 @@ var SigmetForm = function SigmetForm(_ref) {
|
|
|
8224
8387
|
product = _ref.product,
|
|
8225
8388
|
getTAC = _ref.getTAC,
|
|
8226
8389
|
storedGeoJSON = _ref.storedGeoJSON,
|
|
8227
|
-
storedEndGeoJSON = _ref.storedEndGeoJSON
|
|
8390
|
+
storedEndGeoJSON = _ref.storedEndGeoJSON,
|
|
8391
|
+
isAmending = _ref.isAmending;
|
|
8228
8392
|
var _useSigmetAirmetTrans = useSigmetAirmetTranslation(),
|
|
8229
8393
|
t = _useSigmetAirmetTrans.t;
|
|
8230
8394
|
var _useApiContext = useApiContext(),
|
|
@@ -8389,6 +8553,11 @@ var SigmetForm = function SigmetForm(_ref) {
|
|
|
8389
8553
|
// update available phenomena for the FIR
|
|
8390
8554
|
setPhenomenaList(newPhenomenaList);
|
|
8391
8555
|
};
|
|
8556
|
+
// Get coordinates format for VA_CLD eruption point
|
|
8557
|
+
var firConfig = Object.values(productConfig.fir_areas).find(function (fir) {
|
|
8558
|
+
return fir.location_indicator_atsr === watch('locationIndicatorATSR');
|
|
8559
|
+
});
|
|
8560
|
+
var degreesAndMinutes = (firConfig == null ? void 0 : firConfig.va_cld_degrees_minutes) === true;
|
|
8392
8561
|
var renderForm = function renderForm() {
|
|
8393
8562
|
return jsxs(Grid, {
|
|
8394
8563
|
container: true,
|
|
@@ -8418,10 +8587,12 @@ var SigmetForm = function SigmetForm(_ref) {
|
|
|
8418
8587
|
}), !isCancelSigmet && hasVolcanicAshes && !isShortTest() && jsx(VolcanicFields, {
|
|
8419
8588
|
isDisabled: isDisabled,
|
|
8420
8589
|
isReadOnly: isReadOnly,
|
|
8421
|
-
helperText: helperText
|
|
8590
|
+
helperText: helperText,
|
|
8591
|
+
degreesAndMinutes: degreesAndMinutes
|
|
8422
8592
|
}), jsx(ValidFrom, {
|
|
8423
8593
|
productConfig: productConfig,
|
|
8424
8594
|
isDisabled: isDisabled,
|
|
8595
|
+
isAmending: isAmending,
|
|
8425
8596
|
isReadOnly: isReadOnly,
|
|
8426
8597
|
onChange: onChangeForm,
|
|
8427
8598
|
onUserChange: function onUserChange() {
|
|
@@ -8579,7 +8750,8 @@ var AirmetForm = function AirmetForm(_ref) {
|
|
|
8579
8750
|
productConfig = _ref$productConfig === void 0 ? airmetConfig : _ref$productConfig,
|
|
8580
8751
|
product = _ref.product,
|
|
8581
8752
|
getTAC = _ref.getTAC,
|
|
8582
|
-
storedGeoJSON = _ref.storedGeoJSON
|
|
8753
|
+
storedGeoJSON = _ref.storedGeoJSON,
|
|
8754
|
+
isAmending = _ref.isAmending;
|
|
8583
8755
|
var _useFormContext2 = useFormContext(),
|
|
8584
8756
|
watch = _useFormContext2.watch,
|
|
8585
8757
|
setValue = _useFormContext2.setValue,
|
|
@@ -8735,6 +8907,7 @@ var AirmetForm = function AirmetForm(_ref) {
|
|
|
8735
8907
|
}), jsx(ValidFrom, {
|
|
8736
8908
|
productConfig: productConfig,
|
|
8737
8909
|
isDisabled: isDisabled,
|
|
8910
|
+
isAmending: isAmending,
|
|
8738
8911
|
isReadOnly: isReadOnly,
|
|
8739
8912
|
onChange: onChangeForm,
|
|
8740
8913
|
onUserChange: function onUserChange() {
|
|
@@ -11912,4 +12085,4 @@ var createApi = function createApi() {
|
|
|
11912
12085
|
return getApiRoutes(createFakeApiInstance());
|
|
11913
12086
|
};
|
|
11914
12087
|
|
|
11915
|
-
export { AirmetComponentsLookUp, AirmetForm, AirmetType, CancelSigmetVolcanicMovements, CloudLevelUnits, DEFAULT_MINIMUM_SURFACE_LEVEL, DEFAULT_MIN_MOVEMENT_SPEED, DEFAULT_MIN_VISIBILITY, DEFAULT_MIN_WIND_SPEED, Direction, DownloadSigmetAirmetConfigWrapper, LevelUnits, MapViewGeoJson, MetInfoWrapper, MovementUnit, ProductAction, ProductFormDialog, Wrapper as ProductFormDialogContent, ProductList, ProductListRow, ProductStatusDescription, SA_NAMESPACE, SigmetComponentsLookUp, SigmetForm, SigmetType, StartOrEndDrawing, VisibilityCause, WindUnit, airmetConfig, createAirmetPostParameter, createApi$1 as createApi, createApi as createFakeApi, createSigmetPostParameter, extractUnitsToShow, fakeAirmetList, fakeSigmetList, firSelectionType, getActiveFIRArea, getAllFirAreas, getAllowedUnits, getBaseLayers, getConfirmationDialogButtonLabel, getConfirmationDialogCancelLabel, getConfirmationDialogContent, getConfirmationDialogTitle, getDefaultPhenomena, getDefaultValidFromValue, getDefaultValidUntilValue, getDefaultValidityMinutesFromConfig, getDialogtitle, getDrawTools, getFieldLabel, getFir, getFirArea, getFirOptions, getHoursBeforeValidity, getLevelInFeet, getLifecycleActions, getMaxCloudLevelValue, getMaxCloudLowerLevelValue, getMaxHoursOfValidity, getMaxLevelValue, getMaxMovementSpeedValue, getMaxPolygonPoints, getMaxVisibilityValue, getMaxWindSpeedValue, getMinCloudLevelValue, getMinCloudLowerLevelValue, getMinLevelValue, getMinMovementSpeedValue, getMinVisibilityValue, getMinWindSpeedValue, getOmitChangeFromConfig, getPhenomenon, getProductFormMode, getProductIssueDate, getProjection,
|
|
12088
|
+
export { AirmetComponentsLookUp, AirmetForm, AirmetType, CancelSigmetVolcanicMovements, CloudLevelUnits, DEFAULT_MINIMUM_SURFACE_LEVEL, DEFAULT_MIN_MOVEMENT_SPEED, DEFAULT_MIN_VISIBILITY, DEFAULT_MIN_WIND_SPEED, Direction, DownloadSigmetAirmetConfigWrapper, LevelUnits, MapViewGeoJson, MetInfoWrapper, MovementUnit, ProductAction, ProductFormDialog, Wrapper as ProductFormDialogContent, ProductList, ProductListRow, ProductStatusDescription, SA_NAMESPACE, SigmetComponentsLookUp, SigmetForm, SigmetType, StartOrEndDrawing, VisibilityCause, WindUnit, airmetConfig, createAirmetPostParameter, createApi$1 as createApi, createApi as createFakeApi, createSigmetPostParameter, decimalToDegreesMinutes, degreesMinutesToDecimal, extractUnitsToShow, fakeAirmetList, fakeSigmetList, findSequenceNumber, firSelectionType, getActiveFIRArea, getAllFirAreas, getAllowedUnits, getBaseLayers, getConfirmationDialogButtonLabel, getConfirmationDialogCancelLabel, getConfirmationDialogContent, getConfirmationDialogTitle, getDefaultPhenomena, getDefaultValidFromValue, getDefaultValidUntilValue, getDefaultValidityMinutesFromConfig, getDialogtitle, getDrawTools, getFieldLabel, getFir, getFirArea, getFirOptions, getHoursBeforeValidity, getLevelInFeet, getLifecycleActions, getMaxCloudLevelValue, getMaxCloudLowerLevelValue, getMaxHoursOfValidity, getMaxLevelValue, getMaxMovementSpeedValue, getMaxPolygonPoints, getMaxVisibilityValue, getMaxWindSpeedValue, getMinCloudLevelValue, getMinCloudLowerLevelValue, getMinLevelValue, getMinMovementSpeedValue, getMinVisibilityValue, getMinWindSpeedValue, getOmitChangeFromConfig, getPhenomenon, getProductFormMode, getProductIssueDate, getProjection, getSequenceStyling, getToolIcon, getValidFromDelayTimeMinutesFromConfig, getValidFromXHoursBeforeMessage, hasMaxFeaturePoints, hasValue, isFir, isInstanceOfAirmet, isInstanceOfCancelAirmet, isInstanceOfCancelSigmet, isInstanceOfCancelSigmetOrAirmet, isInstanceOfSigmet, isInstanceOfSigmetOrAirmet, isLevelLower, isVAPhenomenon, prepareCancelSigmet, prepareFormValues, prepareProductValues, sigmetAirmetTranslations as saTranslations, sigmetConfig, triggerValidations, updateDrawToolsWithFir, useDelayedFormValues, useFormLayers, useShortTestHelpers };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/sigmet-airmet",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "13.0.0",
|
|
4
4
|
"description": "GeoWeb Sigmet/Airmet library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -8,17 +8,17 @@
|
|
|
8
8
|
"url": "git@gitlab.com:opengeoweb/opengeoweb.git"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@opengeoweb/api": "
|
|
12
|
-
"@opengeoweb/shared": "
|
|
13
|
-
"@opengeoweb/theme": "
|
|
14
|
-
"@opengeoweb/store": "
|
|
15
|
-
"@opengeoweb/webmap": "
|
|
16
|
-
"@opengeoweb/webmap-react": "
|
|
11
|
+
"@opengeoweb/api": "13.0.0",
|
|
12
|
+
"@opengeoweb/shared": "13.0.0",
|
|
13
|
+
"@opengeoweb/theme": "13.0.0",
|
|
14
|
+
"@opengeoweb/store": "13.0.0",
|
|
15
|
+
"@opengeoweb/webmap": "13.0.0",
|
|
16
|
+
"@opengeoweb/webmap-react": "13.0.0",
|
|
17
17
|
"react-redux": "^9.2.0",
|
|
18
|
-
"@opengeoweb/core": "
|
|
19
|
-
"@opengeoweb/authentication": "
|
|
20
|
-
"@mui/system": "^7.
|
|
21
|
-
"@opengeoweb/form-fields": "
|
|
18
|
+
"@opengeoweb/core": "13.0.0",
|
|
19
|
+
"@opengeoweb/authentication": "13.0.0",
|
|
20
|
+
"@mui/system": "^7.3.2",
|
|
21
|
+
"@opengeoweb/form-fields": "13.0.0",
|
|
22
22
|
"react-hook-form": "^7.50.1",
|
|
23
23
|
"axios": "^1.7.7",
|
|
24
24
|
"lodash": "^4.17.21",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"i18next": "^25.0.1",
|
|
27
27
|
"@mui/material": "^7.0.1",
|
|
28
28
|
"react-i18next": "^15.1.1",
|
|
29
|
-
"@tanstack/react-query": "^5.
|
|
29
|
+
"@tanstack/react-query": "^5.85.5",
|
|
30
30
|
"@types/geojson": "^7946.0.14"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface Props {
|
|
3
|
+
name: string;
|
|
4
|
+
label: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
isReadOnly?: boolean;
|
|
7
|
+
size?: 'small' | 'medium';
|
|
8
|
+
isLongitude?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const DegreesMinutesField: React.FC<Props>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -3,5 +3,8 @@ import { TFunction } from 'i18next';
|
|
|
3
3
|
import { ConfigurableFormFieldProps, ProductConfig } from '../../../types';
|
|
4
4
|
export declare const getValidFromXHoursBeforeMessage: (t: TFunction, hours: number) => string;
|
|
5
5
|
export declare const getDefaultValidFromValue: (productConfig: ProductConfig) => string;
|
|
6
|
-
|
|
6
|
+
interface ValidFromProps extends ConfigurableFormFieldProps {
|
|
7
|
+
isAmending?: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare const ValidFrom: React.FC<ValidFromProps>;
|
|
7
10
|
export default ValidFrom;
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { FormFieldProps } from '../../../types';
|
|
3
3
|
interface VolcanicFieldsProps extends FormFieldProps {
|
|
4
4
|
helperText: string;
|
|
5
|
+
degreesAndMinutes?: boolean;
|
|
5
6
|
}
|
|
6
7
|
declare const VolcanicFields: React.FC<VolcanicFieldsProps>;
|
|
7
8
|
export default VolcanicFields;
|
|
@@ -14,12 +14,5 @@ interface ProductFormTACProps {
|
|
|
14
14
|
tac: string;
|
|
15
15
|
product?: AviationProduct;
|
|
16
16
|
}
|
|
17
|
-
export declare const getSequenceStyling: (product?: ProductFormTACProps["product"], hasTac?: boolean) => {
|
|
18
|
-
fontWeight: string;
|
|
19
|
-
color: string;
|
|
20
|
-
} | {
|
|
21
|
-
fontWeight?: undefined;
|
|
22
|
-
color?: undefined;
|
|
23
|
-
};
|
|
24
17
|
declare const ProductFormTAC: React.FC<ProductFormTACProps>;
|
|
25
18
|
export default ProductFormTAC;
|
|
@@ -4,6 +4,7 @@ import { DrawMode, OpenLayersLayerProps } from '@opengeoweb/webmap-react';
|
|
|
4
4
|
import { TFunction } from 'i18next';
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import { FieldValues, UseFormGetValues, UseFormTrigger } from 'react-hook-form';
|
|
7
|
+
import { SxProps } from '@mui/material';
|
|
7
8
|
import { ATSRLocation, Airmet, AirmetConfig, AirmetFromBackend, AirmetFromFrontend, AviationPhenomenon, AviationProduct, CancelAirmet, CancelSigmet, FIRConfigAirmet, FIRConfigSigmet, FIRLocationGeoJson, Firareas, ICAOLocation, LevelUnits, ProductAction, ProductCanbe, ProductConfig, ProductStatus, ProductType, Sigmet, SigmetFromBackend, SigmetFromFrontend, StartOrEndDrawing } from '../../types';
|
|
8
9
|
export declare const getDefaultPhenomena: (productConfig: ProductConfig, currentFir?: string) => {
|
|
9
10
|
phenomena: AviationPhenomenon[];
|
|
@@ -17,11 +18,6 @@ export declare const getFirArea: (selectedFIR: string, productConfig: ProductCon
|
|
|
17
18
|
export declare const getActiveFIRArea: (selectedFIR: string, productConfig: ProductConfig) => FIRConfigSigmet | FIRConfigAirmet;
|
|
18
19
|
export declare const getMaxPolygonPoints: (selectedFIR: string, productConfig: ProductConfig) => number;
|
|
19
20
|
export declare const hasMaxFeaturePoints: (geojson: GeoJSON.FeatureCollection, maxPoints: number) => boolean;
|
|
20
|
-
export declare function getTacGeometry({ startGeometry, startGeometryIntersect, maxPoints, }: {
|
|
21
|
-
startGeometry: GeoJSON.FeatureCollection;
|
|
22
|
-
startGeometryIntersect?: GeoJSON.FeatureCollection;
|
|
23
|
-
maxPoints: number;
|
|
24
|
-
}): GeoJSON.FeatureCollection;
|
|
25
21
|
export declare const DEFAULT_MINIMUM_SURFACE_LEVEL = 0;
|
|
26
22
|
export declare const getMinCloudLevelValue: (unit: string, selectedFIR: string, productConfig: AirmetConfig) => number;
|
|
27
23
|
export declare const getMinCloudLowerLevelValue: (unit: string, selectedFIR: string, productConfig: AirmetConfig) => number;
|
|
@@ -87,4 +83,8 @@ export declare const getDrawTools: (t: TFunction, type: StartOrEndDrawing, firSh
|
|
|
87
83
|
export declare const updateDrawToolsWithFir: (drawTools: DrawMode[], newFirShape: GeoJSON.FeatureCollection) => DrawMode[];
|
|
88
84
|
export declare const getToolIcon: (selectionType: string) => React.ReactElement;
|
|
89
85
|
export declare const useFormLayers: (layers: OpenLayersLayerProps[]) => void;
|
|
86
|
+
export declare function degreesMinutesToDecimal(input: string | number): number;
|
|
87
|
+
export declare function decimalToDegreesMinutes(value: number): string;
|
|
88
|
+
export declare const getSequenceStyling: (product?: AviationProduct, hasTac?: boolean) => SxProps;
|
|
89
|
+
export declare const findSequenceNumber: (tac: string, noTac: string) => string | null;
|
|
90
90
|
export {};
|
package/src/lib/types.d.ts
CHANGED
|
@@ -358,6 +358,7 @@ export interface FIRConfigSigmet extends FIRArea {
|
|
|
358
358
|
tc_hours_before_validity: number;
|
|
359
359
|
va_max_hours_of_validity: number;
|
|
360
360
|
va_hours_before_validity: number;
|
|
361
|
+
va_cld_degrees_minutes?: boolean;
|
|
361
362
|
adjacent_firs: string[];
|
|
362
363
|
area_preset: string;
|
|
363
364
|
}
|