@opengeoweb/sigmet-airmet 12.13.0 → 13.1.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 +346 -162
- 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 -0
- 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",
|
|
@@ -5316,6 +5321,56 @@ var useFormLayers = function useFormLayers(layers) {
|
|
|
5316
5321
|
formFeatures: formLayers
|
|
5317
5322
|
}, sourcePanelId);
|
|
5318
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
|
+
};
|
|
5319
5374
|
|
|
5320
5375
|
var styles$1 = {
|
|
5321
5376
|
radioInput: {
|
|
@@ -6722,6 +6777,8 @@ var ValidFrom = function ValidFrom(_ref) {
|
|
|
6722
6777
|
var productConfig = _ref.productConfig,
|
|
6723
6778
|
isDisabled = _ref.isDisabled,
|
|
6724
6779
|
isReadOnly = _ref.isReadOnly,
|
|
6780
|
+
_ref$isAmending = _ref.isAmending,
|
|
6781
|
+
isAmending = _ref$isAmending === void 0 ? false : _ref$isAmending,
|
|
6725
6782
|
_ref$onChange = _ref.onChange,
|
|
6726
6783
|
_onChange = _ref$onChange === void 0 ? function () {} : _ref$onChange,
|
|
6727
6784
|
_ref$onUserChange = _ref.onUserChange,
|
|
@@ -6730,10 +6787,35 @@ var ValidFrom = function ValidFrom(_ref) {
|
|
|
6730
6787
|
t = _useSigmetAirmetTrans.t;
|
|
6731
6788
|
var _useFormContext = useFormContext(),
|
|
6732
6789
|
getValues = _useFormContext.getValues,
|
|
6790
|
+
setValue = _useFormContext.setValue,
|
|
6733
6791
|
trigger = _useFormContext.trigger;
|
|
6734
6792
|
var _useDraftFormHelpers = useDraftFormHelpers(),
|
|
6735
6793
|
isRequired = _useDraftFormHelpers.isRequired;
|
|
6736
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]);
|
|
6737
6819
|
return jsx(ProductFormFieldLayout, {
|
|
6738
6820
|
title: t('valid-from'),
|
|
6739
6821
|
children: jsx(ReactHookFormDateTime, {
|
|
@@ -6741,18 +6823,19 @@ var ValidFrom = function ValidFrom(_ref) {
|
|
|
6741
6823
|
name: "validDateStart",
|
|
6742
6824
|
label: label,
|
|
6743
6825
|
defaultNullValue: getDefaultValidFromValue(productConfig),
|
|
6744
|
-
rules: {
|
|
6826
|
+
rules: isAmending ? {} // skip validation, auto-controlled
|
|
6827
|
+
: {
|
|
6745
6828
|
validate: {
|
|
6746
6829
|
isRequired: isRequired,
|
|
6747
6830
|
isValidDate: dateUtils.isValidIsoDateString,
|
|
6748
|
-
// The validity start
|
|
6831
|
+
// The validity start cannot be before the current time
|
|
6749
6832
|
isValueBeforeCurrentTime: function isValueBeforeCurrentTime(value) {
|
|
6750
6833
|
return isXHoursBefore(value, dateUtils.getCurrentTimeAsString(), 0) || t('valid-from-before-current-error');
|
|
6751
6834
|
},
|
|
6752
6835
|
// The current time can be no more than 4 hours before the validity start (12 for VA/TC SIGMET)
|
|
6753
6836
|
isCurrentTimeXHoursBeforeValue: function isCurrentTimeXHoursBeforeValue(value) {
|
|
6754
6837
|
var isValid = isXHoursBefore(dateUtils.getCurrentTimeAsString(), value, getHoursBeforeValidity(getValues('phenomenon'), getValues('locationIndicatorATSR'), productConfig));
|
|
6755
|
-
return isValid
|
|
6838
|
+
return isValid || getValidFromXHoursBeforeMessage(t, getHoursBeforeValidity(getValues('phenomenon'), getValues('locationIndicatorATSR'), productConfig));
|
|
6756
6839
|
}
|
|
6757
6840
|
}
|
|
6758
6841
|
},
|
|
@@ -6761,7 +6844,7 @@ var ValidFrom = function ValidFrom(_ref) {
|
|
|
6761
6844
|
triggerValidations(['validDateEnd', 'observationOrForecastTime'], getValues, trigger);
|
|
6762
6845
|
_onChange();
|
|
6763
6846
|
},
|
|
6764
|
-
disabled: isDisabled,
|
|
6847
|
+
disabled: isDisabled || isAmending,
|
|
6765
6848
|
isReadOnly: isReadOnly,
|
|
6766
6849
|
"data-testid": "valid-from",
|
|
6767
6850
|
sx: Object.assign({}, styles$2.helperText, {
|
|
@@ -6861,10 +6944,106 @@ var ValidUntil = function ValidUntil(_ref) {
|
|
|
6861
6944
|
});
|
|
6862
6945
|
};
|
|
6863
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
|
+
|
|
6864
7042
|
var VolcanicFields = function VolcanicFields(_ref) {
|
|
6865
7043
|
var isDisabled = _ref.isDisabled,
|
|
6866
7044
|
isReadOnly = _ref.isReadOnly,
|
|
6867
|
-
helperText = _ref.helperText
|
|
7045
|
+
helperText = _ref.helperText,
|
|
7046
|
+
degreesAndMinutes = _ref.degreesAndMinutes;
|
|
6868
7047
|
var _useSigmetAirmetTrans = useSigmetAirmetTranslation(),
|
|
6869
7048
|
t = _useSigmetAirmetTrans.t;
|
|
6870
7049
|
var _useFormContext = useFormContext(),
|
|
@@ -6902,11 +7081,22 @@ var VolcanicFields = function VolcanicFields(_ref) {
|
|
|
6902
7081
|
})
|
|
6903
7082
|
}), (!isReadOnly || !!watch('vaSigmetVolcanoCoordinates.latitude')) && jsx(Grid, {
|
|
6904
7083
|
size: 6,
|
|
6905
|
-
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, {
|
|
6906
7090
|
name: "vaSigmetVolcanoCoordinates.latitude",
|
|
6907
|
-
"data-testid": "vaSigmetVolcanoCoordinates.latitude",
|
|
6908
7091
|
label: t('latitude'),
|
|
6909
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
|
+
},
|
|
6910
7100
|
rules: {
|
|
6911
7101
|
required: true,
|
|
6912
7102
|
validate: {
|
|
@@ -6915,24 +7105,27 @@ var VolcanicFields = function VolcanicFields(_ref) {
|
|
|
6915
7105
|
return isNonOrBothCoordinates(value, getValues('vaSigmetVolcanoCoordinates.longitude'));
|
|
6916
7106
|
}
|
|
6917
7107
|
}
|
|
6918
|
-
}
|
|
6919
|
-
size: "small",
|
|
6920
|
-
sx: Object.assign({}, styles$2.latitude),
|
|
6921
|
-
disabled: isDisabled,
|
|
6922
|
-
onChange: function onChange() {
|
|
6923
|
-
return trigger('vaSigmetVolcanoCoordinates.longitude');
|
|
6924
|
-
},
|
|
6925
|
-
isReadOnly: isReadOnly
|
|
7108
|
+
}
|
|
6926
7109
|
})
|
|
6927
7110
|
}), (!isReadOnly || !!watch('vaSigmetVolcanoCoordinates.longitude')) && jsx(Grid, {
|
|
6928
7111
|
size: 6,
|
|
6929
|
-
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, {
|
|
6930
7119
|
name: "vaSigmetVolcanoCoordinates.longitude",
|
|
6931
|
-
"data-testid": "vaSigmetVolcanoCoordinates.longitude",
|
|
6932
7120
|
label: t('longitude'),
|
|
6933
7121
|
inputMode: "decimal",
|
|
6934
7122
|
size: "small",
|
|
6935
|
-
sx:
|
|
7123
|
+
sx: styles$2.latitude,
|
|
7124
|
+
disabled: isDisabled,
|
|
7125
|
+
isReadOnly: isReadOnly,
|
|
7126
|
+
onChange: function onChange() {
|
|
7127
|
+
return trigger('vaSigmetVolcanoCoordinates.latitude');
|
|
7128
|
+
},
|
|
6936
7129
|
rules: {
|
|
6937
7130
|
required: true,
|
|
6938
7131
|
validate: {
|
|
@@ -6941,12 +7134,7 @@ var VolcanicFields = function VolcanicFields(_ref) {
|
|
|
6941
7134
|
return isNonOrBothCoordinates(value, getValues('vaSigmetVolcanoCoordinates.latitude'));
|
|
6942
7135
|
}
|
|
6943
7136
|
}
|
|
6944
|
-
}
|
|
6945
|
-
disabled: isDisabled,
|
|
6946
|
-
onChange: function onChange() {
|
|
6947
|
-
return trigger('vaSigmetVolcanoCoordinates.latitude');
|
|
6948
|
-
},
|
|
6949
|
-
isReadOnly: isReadOnly
|
|
7137
|
+
}
|
|
6950
7138
|
})
|
|
6951
7139
|
})]
|
|
6952
7140
|
})
|
|
@@ -7744,27 +7932,13 @@ var useTAC = function useTAC(t, initialProduct, getTAC, hasErrors, omitChange) {
|
|
|
7744
7932
|
};
|
|
7745
7933
|
return [TAC, delayedQuery];
|
|
7746
7934
|
};
|
|
7747
|
-
var getSequenceStyling = function getSequenceStyling(product, hasTac) {
|
|
7748
|
-
if (hasTac === void 0) {
|
|
7749
|
-
hasTac = false;
|
|
7750
|
-
}
|
|
7751
|
-
if (hasTac && !product || product && product.status === 'DRAFT' || product && product.status === '') {
|
|
7752
|
-
return {
|
|
7753
|
-
fontWeight: 'lighter',
|
|
7754
|
-
color: 'geowebColors.typographyAndIcons.inactiveText'
|
|
7755
|
-
};
|
|
7756
|
-
}
|
|
7757
|
-
return {};
|
|
7758
|
-
};
|
|
7759
7935
|
var ProductFormTAC = function ProductFormTAC(_ref3) {
|
|
7760
|
-
var _tacLines$0$split$;
|
|
7761
7936
|
var tac = _ref3.tac,
|
|
7762
7937
|
product = _ref3.product;
|
|
7763
|
-
var tacLines = tac.split('\n');
|
|
7764
7938
|
var _useSigmetAirmetTrans = useSigmetAirmetTranslation(),
|
|
7765
7939
|
t = _useSigmetAirmetTrans.t;
|
|
7766
|
-
var hasTac =
|
|
7767
|
-
var sequenceNumberInTac =
|
|
7940
|
+
var hasTac = tac.split('\n').length > 0 && tac !== noTAC(t);
|
|
7941
|
+
var sequenceNumberInTac = findSequenceNumber(tac, noTAC(t));
|
|
7768
7942
|
var sequenceStyle = getSequenceStyling(product, hasTac);
|
|
7769
7943
|
return jsx(Typography, {
|
|
7770
7944
|
variant: "body2",
|
|
@@ -8213,7 +8387,8 @@ var SigmetForm = function SigmetForm(_ref) {
|
|
|
8213
8387
|
product = _ref.product,
|
|
8214
8388
|
getTAC = _ref.getTAC,
|
|
8215
8389
|
storedGeoJSON = _ref.storedGeoJSON,
|
|
8216
|
-
storedEndGeoJSON = _ref.storedEndGeoJSON
|
|
8390
|
+
storedEndGeoJSON = _ref.storedEndGeoJSON,
|
|
8391
|
+
isAmending = _ref.isAmending;
|
|
8217
8392
|
var _useSigmetAirmetTrans = useSigmetAirmetTranslation(),
|
|
8218
8393
|
t = _useSigmetAirmetTrans.t;
|
|
8219
8394
|
var _useApiContext = useApiContext(),
|
|
@@ -8378,6 +8553,11 @@ var SigmetForm = function SigmetForm(_ref) {
|
|
|
8378
8553
|
// update available phenomena for the FIR
|
|
8379
8554
|
setPhenomenaList(newPhenomenaList);
|
|
8380
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;
|
|
8381
8561
|
var renderForm = function renderForm() {
|
|
8382
8562
|
return jsxs(Grid, {
|
|
8383
8563
|
container: true,
|
|
@@ -8407,10 +8587,12 @@ var SigmetForm = function SigmetForm(_ref) {
|
|
|
8407
8587
|
}), !isCancelSigmet && hasVolcanicAshes && !isShortTest() && jsx(VolcanicFields, {
|
|
8408
8588
|
isDisabled: isDisabled,
|
|
8409
8589
|
isReadOnly: isReadOnly,
|
|
8410
|
-
helperText: helperText
|
|
8590
|
+
helperText: helperText,
|
|
8591
|
+
degreesAndMinutes: degreesAndMinutes
|
|
8411
8592
|
}), jsx(ValidFrom, {
|
|
8412
8593
|
productConfig: productConfig,
|
|
8413
8594
|
isDisabled: isDisabled,
|
|
8595
|
+
isAmending: isAmending,
|
|
8414
8596
|
isReadOnly: isReadOnly,
|
|
8415
8597
|
onChange: onChangeForm,
|
|
8416
8598
|
onUserChange: function onUserChange() {
|
|
@@ -8568,7 +8750,8 @@ var AirmetForm = function AirmetForm(_ref) {
|
|
|
8568
8750
|
productConfig = _ref$productConfig === void 0 ? airmetConfig : _ref$productConfig,
|
|
8569
8751
|
product = _ref.product,
|
|
8570
8752
|
getTAC = _ref.getTAC,
|
|
8571
|
-
storedGeoJSON = _ref.storedGeoJSON
|
|
8753
|
+
storedGeoJSON = _ref.storedGeoJSON,
|
|
8754
|
+
isAmending = _ref.isAmending;
|
|
8572
8755
|
var _useFormContext2 = useFormContext(),
|
|
8573
8756
|
watch = _useFormContext2.watch,
|
|
8574
8757
|
setValue = _useFormContext2.setValue,
|
|
@@ -8724,6 +8907,7 @@ var AirmetForm = function AirmetForm(_ref) {
|
|
|
8724
8907
|
}), jsx(ValidFrom, {
|
|
8725
8908
|
productConfig: productConfig,
|
|
8726
8909
|
isDisabled: isDisabled,
|
|
8910
|
+
isAmending: isAmending,
|
|
8727
8911
|
isReadOnly: isReadOnly,
|
|
8728
8912
|
onChange: onChangeForm,
|
|
8729
8913
|
onUserChange: function onUserChange() {
|
|
@@ -11901,4 +12085,4 @@ var createApi = function createApi() {
|
|
|
11901
12085
|
return getApiRoutes(createFakeApiInstance());
|
|
11902
12086
|
};
|
|
11903
12087
|
|
|
11904
|
-
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, 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 };
|
|
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.1.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.1.0",
|
|
12
|
+
"@opengeoweb/shared": "13.1.0",
|
|
13
|
+
"@opengeoweb/theme": "13.1.0",
|
|
14
|
+
"@opengeoweb/store": "13.1.0",
|
|
15
|
+
"@opengeoweb/webmap": "13.1.0",
|
|
16
|
+
"@opengeoweb/webmap-react": "13.1.0",
|
|
17
17
|
"react-redux": "^9.2.0",
|
|
18
|
-
"@opengeoweb/core": "
|
|
19
|
-
"@opengeoweb/authentication": "
|
|
20
|
-
"@mui/system": "^7.3.
|
|
21
|
-
"@opengeoweb/form-fields": "
|
|
18
|
+
"@opengeoweb/core": "13.1.0",
|
|
19
|
+
"@opengeoweb/authentication": "13.1.0",
|
|
20
|
+
"@mui/system": "^7.3.2",
|
|
21
|
+
"@opengeoweb/form-fields": "13.1.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[];
|
|
@@ -82,4 +83,8 @@ export declare const getDrawTools: (t: TFunction, type: StartOrEndDrawing, firSh
|
|
|
82
83
|
export declare const updateDrawToolsWithFir: (drawTools: DrawMode[], newFirShape: GeoJSON.FeatureCollection) => DrawMode[];
|
|
83
84
|
export declare const getToolIcon: (selectionType: string) => React.ReactElement;
|
|
84
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;
|
|
85
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
|
}
|