@opengeoweb/sigmet-airmet 9.29.1 → 9.31.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
3
  import React__default from 'react';
4
- import { FormControlLabel, Radio, Grid, Typography, Box, Button, Checkbox, MenuItem, FormHelperText, useTheme, Dialog, DialogTitle, DialogContent, Card, LinearProgress, List, ListItemButton, Backdrop, CircularProgress } from '@mui/material';
4
+ import { FormControlLabel, Radio, Grid2, Typography, Box, Button, Checkbox, MenuItem, FormHelperText, useTheme, Dialog, DialogTitle, DialogContent, Card, LinearProgress, List, ListItemButton, Backdrop, CircularProgress } from '@mui/material';
5
5
  import { useFormContext } from 'react-hook-form';
6
6
  import { FORM_FIELDS_NAMESPACE, useDraftFormHelpers, ReactHookFormRadioGroup, hasValidGeometry, ReactHookFormSelect, ReactHookFormNumberField, isInteger, isValidMax, isValidMin, isEmpty, ReactHookFormDateTime, countIntersectionPoints, hasMulitpleIntersections, ReactHookFormHiddenInput, isMaximumOneDrawing, isValidGeoJsonCoordinates, hasIntersectionWithFIR, isXHoursBefore, isXHoursAfter, ReactHookFormTextField, isLatitude, isNonOrBothCoordinates, isLongitude, ReactHookFormFormControl, isGeometryDirty, ReactHookFormProvider, defaultFormOptions } from '@opengeoweb/form-fields';
7
7
  import { useApiContext, useApi, createApiInstance, createNonAuthApiInstance, createFakeApiInstance, ApiProvider } from '@opengeoweb/api';
@@ -2287,6 +2287,16 @@ var StartOrEndDrawing;
2287
2287
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
2288
2288
  * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
2289
2289
  * */
2290
+ const formStyles = {
2291
+ '.MuiSelect-select.MuiInputBase-input.MuiFilledInput-input': {
2292
+ paddingTop: '17px',
2293
+ paddingBottom: '0px'
2294
+ },
2295
+ '.MuiInputBase-input.MuiFilledInput-input': {
2296
+ paddingTop: '15px',
2297
+ paddingBottom: '2px'
2298
+ }
2299
+ };
2290
2300
  const styles$2 = {
2291
2301
  label: {
2292
2302
  fontSize: '0.875rem',
@@ -2297,10 +2307,10 @@ const styles$2 = {
2297
2307
  paddingTop: '17px'
2298
2308
  },
2299
2309
  containerItem: {
2310
+ marginTop: -1,
2300
2311
  ' .MuiTypography-subtitle1': {
2301
2312
  marginTop: 1
2302
2313
  },
2303
- paddingTop: '8px!important',
2304
2314
  '+ .MuiGrid-item': {
2305
2315
  paddingTop: 0
2306
2316
  },
@@ -2316,13 +2326,19 @@ const styles$2 = {
2316
2326
  }
2317
2327
  },
2318
2328
  volcanicField: {
2319
- marginBottom: 2
2329
+ marginBottom: '14px',
2330
+ '.MuiFormHelperText-root': {
2331
+ marginTop: '2px'
2332
+ }
2320
2333
  },
2321
2334
  surfaceVisibility: {
2322
2335
  marginBottom: 2
2323
2336
  },
2324
2337
  surfaceWind: {
2325
- marginBottom: 2
2338
+ marginBottom: 2,
2339
+ ' .MuiFormHelperText-root': {
2340
+ lineHeight: '1.33em'
2341
+ }
2326
2342
  },
2327
2343
  levelField: {
2328
2344
  marginBottom: 2
@@ -2334,21 +2350,38 @@ const styles$2 = {
2334
2350
  width: '97%',
2335
2351
  '.MuiFormControl-root.MuiTextField-root': {
2336
2352
  margin: 0
2353
+ },
2354
+ '.MuiFormHelperText-root': {
2355
+ marginTop: '3px',
2356
+ lineHeight: '1.33em'
2337
2357
  }
2338
2358
  },
2339
2359
  unit: {
2340
2360
  width: '95%'
2341
2361
  },
2342
2362
  quitDrawModeMessage: {
2343
- paddingBottom: '10px',
2344
2363
  opacity: '1'
2345
2364
  },
2346
2365
  drawSection: {
2347
- '+ .MuiGrid-item': {
2348
- paddingTop: 5
2366
+ ' .MuiTypography-subtitle1': {
2367
+ marginTop: 1
2368
+ },
2369
+ '.MuiFormHelperText-root': {
2370
+ marginTop: '-21px',
2371
+ lineHeight: '1.33em'
2349
2372
  },
2373
+ '.MuiFormHelperText-root.Mui-error': {
2374
+ marginTop: '-21px',
2375
+ marginBottom: '-10px',
2376
+ lineHeight: '1.33em'
2377
+ }
2378
+ },
2379
+ drawSectionProgress: {
2350
2380
  ' .MuiTypography-subtitle1': {
2351
2381
  marginTop: 1
2382
+ },
2383
+ '.MuiFormHelperText-root': {
2384
+ marginTop: 0
2352
2385
  }
2353
2386
  },
2354
2387
  helperText: {
@@ -2449,16 +2482,14 @@ const ProductFormFieldLayout = _a => {
2449
2482
  children
2450
2483
  } = _a,
2451
2484
  props = __rest(_a, ["title", "children"]);
2452
- return jsxs(Grid, Object.assign({
2453
- item: true,
2485
+ return jsxs(Grid2, Object.assign({
2454
2486
  container: true,
2455
2487
  spacing: 3
2456
2488
  }, props, {
2457
- children: [jsx(Grid, Object.assign({
2458
- item: true,
2459
- xs: 4,
2489
+ children: [jsx(Grid2, Object.assign({
2460
2490
  container: true,
2461
- justifyContent: "flex-end"
2491
+ justifyContent: "flex-end",
2492
+ size: 4
2462
2493
  }, {
2463
2494
  children: title && jsx(Typography, Object.assign({
2464
2495
  variant: "subtitle1",
@@ -2466,11 +2497,10 @@ const ProductFormFieldLayout = _a => {
2466
2497
  }, {
2467
2498
  children: title
2468
2499
  }))
2469
- })), jsx(Grid, Object.assign({
2470
- item: true,
2471
- xs: 8,
2500
+ })), jsx(Grid2, Object.assign({
2472
2501
  container: true,
2473
- justifyContent: "flex-start"
2502
+ justifyContent: "flex-start",
2503
+ size: 8
2474
2504
  }, {
2475
2505
  children: children
2476
2506
  }))]
@@ -2548,39 +2578,43 @@ const Change = ({
2548
2578
  const fieldsDisabled = isDisabled || isShortTest();
2549
2579
  return jsx(ProductFormFieldLayout, Object.assign({
2550
2580
  title: t('change'),
2551
- sx: styles$2.containerItem
2581
+ sx: {
2582
+ '.MuiButtonBase-root.MuiRadio-root': {
2583
+ padding: '6px',
2584
+ marginLeft: '3px'
2585
+ },
2586
+ '.MuiTypography-root.MuiTypography-subtitle1': {
2587
+ marginTop: 1
2588
+ },
2589
+ marginTop: -1
2590
+ }
2552
2591
  }, {
2553
- children: jsx(Grid, Object.assign({
2554
- item: true,
2555
- xs: 12
2592
+ children: jsxs(ReactHookFormRadioGroup, Object.assign({
2593
+ name: "change",
2594
+ rules: {
2595
+ validate: {
2596
+ isRequired
2597
+ }
2598
+ },
2599
+ disabled: fieldsDisabled,
2600
+ isReadOnly: isReadOnly
2556
2601
  }, {
2557
- children: jsxs(ReactHookFormRadioGroup, Object.assign({
2558
- name: "change",
2559
- rules: {
2560
- validate: {
2561
- isRequired
2562
- }
2563
- },
2602
+ children: [jsx(RadioButtonAndLabel, {
2603
+ value: "WKN",
2604
+ label: t('weakening'),
2564
2605
  disabled: fieldsDisabled,
2565
- isReadOnly: isReadOnly
2566
- }, {
2567
- children: [jsx(RadioButtonAndLabel, {
2568
- value: "WKN",
2569
- label: t('weakening'),
2570
- disabled: fieldsDisabled,
2571
- "data-testid": "change-WKN"
2572
- }), jsx(RadioButtonAndLabel, {
2573
- value: "NC",
2574
- label: t('no-change'),
2575
- disabled: fieldsDisabled,
2576
- "data-testid": "change-NC"
2577
- }), jsx(RadioButtonAndLabel, {
2578
- value: "INTSF",
2579
- label: t('intensifying'),
2580
- disabled: fieldsDisabled,
2581
- "data-testid": "change-INTSF"
2582
- })]
2583
- }))
2606
+ "data-testid": "change-WKN"
2607
+ }), jsx(RadioButtonAndLabel, {
2608
+ value: "NC",
2609
+ label: t('no-change'),
2610
+ disabled: fieldsDisabled,
2611
+ "data-testid": "change-NC"
2612
+ }), jsx(RadioButtonAndLabel, {
2613
+ value: "INTSF",
2614
+ label: t('intensifying'),
2615
+ disabled: fieldsDisabled,
2616
+ "data-testid": "change-INTSF"
2617
+ })]
2584
2618
  }))
2585
2619
  }));
2586
2620
  };
@@ -3557,33 +3591,29 @@ const DrawTools = ({
3557
3591
  onChangeTool,
3558
3592
  isDisabled: _isDisabled = false
3559
3593
  }) => {
3560
- return jsx(Grid, Object.assign({
3561
- item: true,
3562
- xs: 12,
3563
- container: true,
3564
- justifyContent: "space-between",
3594
+ return jsx(Box, Object.assign({
3565
3595
  "data-testid": "drawtools",
3566
- spacing: 1
3596
+ sx: {
3597
+ display: 'flex',
3598
+ width: '100%',
3599
+ justifyContent: 'space-between'
3600
+ }
3567
3601
  }, {
3568
- children: tools.map(tool => jsx(Grid, Object.assign({
3569
- item: true
3602
+ children: tools.map(tool => jsx(CustomTooltip, Object.assign({
3603
+ title: tool.title
3570
3604
  }, {
3571
- children: jsx(CustomTooltip, Object.assign({
3572
- title: tool.title
3573
- }, {
3574
- children: jsx(Radio, {
3575
- icon: getToolIcon(tool.selectionType),
3576
- value: true,
3577
- checkedIcon: getToolIcon(tool.selectionType),
3578
- checked: activeTool === tool.drawModeId,
3579
- disabled: _isDisabled,
3580
- onChange: () => {
3581
- onChangeTool(tool);
3582
- },
3583
- "data-testid": tool.drawModeId,
3584
- sx: styles$1.radioInput
3585
- })
3586
- }))
3605
+ children: jsx(Radio, {
3606
+ icon: getToolIcon(tool.selectionType),
3607
+ value: true,
3608
+ checkedIcon: getToolIcon(tool.selectionType),
3609
+ checked: activeTool === tool.drawModeId,
3610
+ disabled: _isDisabled,
3611
+ onChange: () => {
3612
+ onChangeTool(tool);
3613
+ },
3614
+ "data-testid": tool.drawModeId,
3615
+ sx: styles$1.radioInput
3616
+ })
3587
3617
  }), tool.drawModeId))
3588
3618
  }));
3589
3619
  };
@@ -3743,82 +3773,168 @@ const Levels = ({
3743
3773
  }, [getValues, isRadioactiveCloud, levelInfoMode, radioactiveCloudLevel, setValue, trigger, unregister]);
3744
3774
  return jsx(ProductFormFieldLayout, Object.assign({
3745
3775
  title: t('levels'),
3746
- sx: styles$2.containerItem
3776
+ sx: Object.assign(Object.assign({}, styles$2.containerItem), {
3777
+ '.MuiFormHelperText-root.Mui-error': {
3778
+ marginBottom: '-16px'
3779
+ }
3780
+ })
3747
3781
  }, {
3748
- children: jsx(Grid, Object.assign({
3749
- item: true,
3750
- xs: 12
3751
- }, {
3752
- children: jsxs(ReactHookFormRadioGroup, Object.assign({
3753
- name: "levelInfoMode",
3754
- rules: {
3755
- validate: {
3756
- isRequired
3757
- }
3758
- },
3759
- disabled: fieldsDisabled,
3760
- isReadOnly: isReadOnly,
3761
- onChange: () => {
3762
- // Reset default value for the level value to '' so when it rerenders it uses this empty default value
3763
- setValue('level.unit', 'FL');
3764
- setValue('level.value', null);
3765
- // Clear out errors for the levels
3766
- clearErrors(['level', 'lowerLevel']);
3782
+ children: jsxs(ReactHookFormRadioGroup, Object.assign({
3783
+ name: "levelInfoMode",
3784
+ rules: {
3785
+ validate: {
3786
+ isRequired
3767
3787
  }
3788
+ },
3789
+ disabled: fieldsDisabled,
3790
+ isReadOnly: isReadOnly,
3791
+ onChange: () => {
3792
+ // Reset default value for the level value to '' so when it rerenders it uses this empty default value
3793
+ setValue('level.unit', 'FL');
3794
+ setValue('level.value', null);
3795
+ // Clear out errors for the levels
3796
+ clearErrors(['level', 'lowerLevel']);
3797
+ }
3798
+ }, {
3799
+ children: [jsx(RadioButtonAndLabel, {
3800
+ value: "AT",
3801
+ label: t('at'),
3802
+ checked: levelInfoMode === 'AT' || levelInfoMode === 'TOPS',
3803
+ "data-testid": "levels-AT",
3804
+ disabled: fieldsDisabled
3805
+ }), (levelInfoMode === 'AT' || levelInfoMode === 'TOPS') && !isRadioactiveCloud ? jsxs(Grid2, Object.assign({
3806
+ container: true,
3807
+ spacing: 2,
3808
+ justifyItems: "flex-end",
3809
+ alignItems: "flex-start"
3768
3810
  }, {
3769
- children: [jsx(RadioButtonAndLabel, {
3770
- value: "AT",
3771
- label: t('at'),
3772
- checked: levelInfoMode === 'AT' || levelInfoMode === 'TOPS',
3773
- "data-testid": "levels-AT",
3774
- disabled: fieldsDisabled
3775
- }), (levelInfoMode === 'AT' || levelInfoMode === 'TOPS') && !isRadioactiveCloud ? jsxs(Grid, Object.assign({
3776
- item: true,
3777
- xs: 12,
3778
- container: true,
3779
- spacing: 2,
3780
- justifyItems: "flex-end",
3781
- alignItems: "flex-end"
3782
- }, {
3783
- children: [jsx(Grid, Object.assign({
3784
- item: true,
3811
+ children: [jsx(Grid2, Object.assign({
3812
+ size: {
3785
3813
  xs: 12,
3786
3814
  md: 3
3787
- }, {
3788
- children: jsx(FormControlLabel, {
3789
- control: jsx(Checkbox, {
3790
- checked: levelInfoMode === 'TOPS',
3791
- onChange: () => {
3792
- setValue('levelInfoMode', getValues('levelInfoMode') === 'AT' ? 'TOPS' : 'AT', {
3793
- shouldDirty: true
3794
- });
3795
- },
3796
- color: "secondary",
3797
- disabled: isDisabled
3798
- }),
3799
- "data-testid": "levels-TOPS",
3800
- label: t('levels-tops-label')
3801
- })
3802
- })), jsx(Grid, Object.assign({
3803
- item: true,
3815
+ }
3816
+ }, {
3817
+ children: jsx(FormControlLabel, {
3818
+ control: jsx(Checkbox, {
3819
+ checked: levelInfoMode === 'TOPS',
3820
+ onChange: () => {
3821
+ setValue('levelInfoMode', getValues('levelInfoMode') === 'AT' ? 'TOPS' : 'AT', {
3822
+ shouldDirty: true
3823
+ });
3824
+ },
3825
+ color: "secondary",
3826
+ disabled: isDisabled
3827
+ }),
3828
+ "data-testid": "levels-TOPS",
3829
+ label: t('levels-tops-label')
3830
+ })
3831
+ })), jsx(Grid2, Object.assign({
3832
+ size: {
3804
3833
  xs: 4,
3805
3834
  md: 3
3835
+ }
3836
+ }, {
3837
+ children: jsx(ReactHookFormSelect, Object.assign({
3838
+ name: "level.unit",
3839
+ label: t('unit-label'),
3840
+ rules: {
3841
+ validate: {
3842
+ isRequired
3843
+ }
3844
+ },
3845
+ sx: styles$2.unit,
3846
+ size: "small",
3847
+ disabled: isDisabled,
3848
+ isReadOnly: isReadOnly,
3849
+ defaultValue: 'FL',
3850
+ onChange: () => {
3851
+ triggerValidations(['level.value'], getValues, trigger);
3852
+ _onChange();
3853
+ }
3854
+ }, {
3855
+ children: Object.keys(allowedLevelUnitsForFir).map(key => jsx(MenuItem, Object.assign({
3856
+ value: key
3857
+ }, {
3858
+ children: allowedLevelUnitsForFir[key]
3859
+ }), key))
3860
+ }))
3861
+ })), jsx(Grid2, Object.assign({
3862
+ size: {
3863
+ xs: 8,
3864
+ md: 6
3865
+ }
3866
+ }, {
3867
+ children: jsx(ReactHookFormNumberField, {
3868
+ name: "level.value",
3869
+ "data-testid": "level.value",
3870
+ label: t('level'),
3871
+ rules: {
3872
+ validate: {
3873
+ isRequired,
3874
+ isInteger,
3875
+ max: value =>
3876
+ // The max level depends on the unit
3877
+ isValidMax(value, getMaxLevelValue(getValues('level.unit'), getFIRValue(), productConfig)) || t('levels-the-maximum-level', {
3878
+ levelUnit: LevelUnits[getValues('level.unit')],
3879
+ maxLevelValue: getMaxLevelValue(getValues('level.unit'), getFIRValue(), productConfig)
3880
+ }),
3881
+ min: value =>
3882
+ // The min level depends on the unit
3883
+ isValidMin(value, getMinLevelValue(getValues('level.unit'), getFIRValue(), productConfig)) || t('levels-the-minimum-level', {
3884
+ levelUnit: LevelUnits[getValues('level.unit')],
3885
+ minLevelValue: getMinLevelValue(getValues('level.unit'), getFIRValue(), productConfig)
3886
+ }),
3887
+ validateLevels: value =>
3888
+ // level step depends on the unit
3889
+ validateLevels(value, getValues('level.unit'), productConfig, getFIRValue())
3890
+ }
3891
+ },
3892
+ size: "small",
3893
+ disabled: isDisabled,
3894
+ isReadOnly: isReadOnly,
3895
+ autoFocus: true
3896
+ })
3897
+ }))]
3898
+ })) : null, jsx(RadioButtonAndLabel, {
3899
+ value: "BETW",
3900
+ label: t('between'),
3901
+ checked: levelInfoMode === 'BETW' || levelInfoMode === 'BETW_SFC',
3902
+ "data-testid": "levels-BETW",
3903
+ disabled: fieldsDisabled
3904
+ }), levelInfoMode === 'BETW' || levelInfoMode === 'BETW_SFC' ? jsxs(Fragment, {
3905
+ children: [jsxs(Grid2, Object.assign({
3906
+ container: true,
3907
+ spacing: 2
3908
+ }, {
3909
+ children: [jsx(Grid2, {
3910
+ size: {
3911
+ xs: 12,
3912
+ md: 3
3913
+ }
3914
+ }), jsx(Grid2, Object.assign({
3915
+ size: {
3916
+ xs: 4,
3917
+ md: 3
3918
+ }
3806
3919
  }, {
3807
3920
  children: jsx(ReactHookFormSelect, Object.assign({
3808
3921
  name: "level.unit",
3809
3922
  label: t('unit-label'),
3810
3923
  rules: {
3811
3924
  validate: {
3812
- isRequired
3925
+ isRequired,
3926
+ validateLevelUnitCombinations: value =>
3927
+ // level step depends on the unit
3928
+ validateLevelUnitCombinations(value, levelInfoMode === 'BETW_SFC' ? 'SFC' : getValues('lowerLevel.unit'), t) === true
3813
3929
  }
3814
3930
  },
3815
- sx: styles$2.unit,
3816
3931
  size: "small",
3817
- disabled: isDisabled,
3932
+ sx: styles$2.unit,
3933
+ disabled: fieldsDisabled,
3818
3934
  isReadOnly: isReadOnly,
3819
3935
  defaultValue: 'FL',
3820
3936
  onChange: () => {
3821
- triggerValidations(['level.value'], getValues, trigger);
3937
+ triggerValidations(['level.value', 'lowerLevel.value', 'lowerLevel.unit'], getValues, trigger);
3822
3938
  _onChange();
3823
3939
  }
3824
3940
  }, {
@@ -3828,15 +3944,18 @@ const Levels = ({
3828
3944
  children: allowedLevelUnitsForFir[key]
3829
3945
  }), key))
3830
3946
  }))
3831
- })), jsx(Grid, Object.assign({
3832
- item: true,
3833
- xs: 8,
3834
- md: 6
3947
+ })), jsx(Grid2, Object.assign({
3948
+ size: {
3949
+ xs: 8,
3950
+ md: 6
3951
+ }
3835
3952
  }, {
3836
3953
  children: jsx(ReactHookFormNumberField, {
3954
+ value: level || '',
3837
3955
  name: "level.value",
3838
- "data-testid": "level.value",
3839
- label: t('level'),
3956
+ label: t('levels-upper-level-label'),
3957
+ sx: styles$2.levelField,
3958
+ size: "small",
3840
3959
  rules: {
3841
3960
  validate: {
3842
3961
  isRequired,
@@ -3858,52 +3977,67 @@ const Levels = ({
3858
3977
  validateLevels(value, getValues('level.unit'), productConfig, getFIRValue())
3859
3978
  }
3860
3979
  },
3861
- size: "small",
3862
- disabled: isDisabled,
3980
+ disabled: fieldsDisabled,
3863
3981
  isReadOnly: isReadOnly,
3982
+ onChange: () => {
3983
+ triggerValidations(['lowerLevel.value'], getValues, trigger);
3984
+ },
3864
3985
  autoFocus: true
3865
3986
  })
3866
3987
  }))]
3867
- })) : null, jsx(RadioButtonAndLabel, {
3868
- value: "BETW",
3869
- label: t('between'),
3870
- checked: levelInfoMode === 'BETW' || levelInfoMode === 'BETW_SFC',
3871
- "data-testid": "levels-BETW",
3872
- disabled: fieldsDisabled
3873
- }), levelInfoMode === 'BETW' || levelInfoMode === 'BETW_SFC' ? jsxs(Fragment, {
3874
- children: [jsxs(Grid, Object.assign({
3875
- item: true,
3876
- xs: 12,
3877
- container: true,
3878
- spacing: 2
3879
- }, {
3880
- children: [jsx(Grid, {
3881
- item: true,
3988
+ })), jsxs(Grid2, Object.assign({
3989
+ container: true,
3990
+ spacing: 2,
3991
+ justifyItems: "flex-end",
3992
+ alignItems: "flex-start"
3993
+ }, {
3994
+ children: [jsx(Grid2, Object.assign({
3995
+ size: {
3882
3996
  xs: 12,
3883
3997
  md: 3
3884
- }), jsx(Grid, Object.assign({
3885
- item: true,
3886
- xs: 4,
3887
- md: 3
3998
+ }
3999
+ }, {
4000
+ children: jsx(FormControlLabel, {
4001
+ control: jsx(Checkbox, {
4002
+ checked: levelInfoMode === 'BETW_SFC',
4003
+ onChange: () => {
4004
+ getValues('level.unit') && trigger('level.unit');
4005
+ setValue('levelInfoMode', getValues('levelInfoMode') === 'BETW' ? 'BETW_SFC' : 'BETW', {
4006
+ shouldDirty: true
4007
+ });
4008
+ },
4009
+ name: "checkedF",
4010
+ color: "secondary",
4011
+ disabled: fieldsDisabled
4012
+ }),
4013
+ "data-testid": "levels-SFC",
4014
+ label: "SFC"
4015
+ })
4016
+ })), levelInfoMode !== 'BETW_SFC' && jsxs(Fragment, {
4017
+ children: [jsx(Grid2, Object.assign({
4018
+ size: {
4019
+ xs: 4,
4020
+ md: 3
4021
+ }
3888
4022
  }, {
3889
4023
  children: jsx(ReactHookFormSelect, Object.assign({
3890
- name: "level.unit",
4024
+ name: "lowerLevel.unit",
3891
4025
  label: t('unit-label'),
3892
4026
  rules: {
3893
4027
  validate: {
3894
4028
  isRequired,
3895
4029
  validateLevelUnitCombinations: value =>
3896
4030
  // level step depends on the unit
3897
- validateLevelUnitCombinations(value, levelInfoMode === 'BETW_SFC' ? 'SFC' : getValues('lowerLevel.unit'), t) === true
4031
+ validateLevelUnitCombinations(getValues('level.unit'), value, t)
3898
4032
  }
3899
4033
  },
3900
4034
  size: "small",
3901
4035
  sx: styles$2.unit,
3902
- disabled: fieldsDisabled,
4036
+ disabled: isDisabled,
3903
4037
  isReadOnly: isReadOnly,
3904
- defaultValue: 'FL',
4038
+ defaultValue: getValues('level.unit') || 'FL',
3905
4039
  onChange: () => {
3906
- triggerValidations(['level.value', 'lowerLevel.value', 'lowerLevel.unit'], getValues, trigger);
4040
+ triggerValidations(['lowerLevel.value', 'level.unit'], getValues, trigger);
3907
4041
  _onChange();
3908
4042
  }
3909
4043
  }, {
@@ -3913,245 +4047,144 @@ const Levels = ({
3913
4047
  children: allowedLevelUnitsForFir[key]
3914
4048
  }), key))
3915
4049
  }))
3916
- })), jsx(Grid, Object.assign({
3917
- item: true,
3918
- xs: 8,
3919
- md: 6
4050
+ })), jsx(Grid2, Object.assign({
4051
+ size: {
4052
+ xs: 8,
4053
+ md: 6
4054
+ }
3920
4055
  }, {
3921
4056
  children: jsx(ReactHookFormNumberField, {
3922
- value: level || '',
3923
- name: "level.value",
3924
- label: t('levels-upper-level-label'),
3925
- sx: styles$2.levelField,
3926
- size: "small",
4057
+ name: "lowerLevel.value",
4058
+ label: t('levels-lower-level-label'),
3927
4059
  rules: {
3928
4060
  validate: {
3929
4061
  isRequired,
3930
4062
  isInteger,
3931
4063
  max: value =>
3932
4064
  // The max level depends on the unit
3933
- isValidMax(value, getMaxLevelValue(getValues('level.unit'), getFIRValue(), productConfig)) || t('levels-the-maximum-level', {
3934
- levelUnit: LevelUnits[getValues('level.unit')],
3935
- maxLevelValue: getMaxLevelValue(getValues('level.unit'), getFIRValue(), productConfig)
4065
+ isValidMax(value, getMaxLevelValue(getValues('lowerLevel.unit'), getFIRValue(), productConfig)) || t('levels-the-maximum-level', {
4066
+ levelUnit: LevelUnits[getValues('lowerLevel.unit')],
4067
+ maxLevelValue: getMaxLevelValue(getValues('lowerLevel.unit'), getFIRValue(), productConfig)
3936
4068
  }),
3937
4069
  min: value =>
3938
4070
  // The min level depends on the unit
3939
- isValidMin(value, getMinLevelValue(getValues('level.unit'), getFIRValue(), productConfig)) || t('levels-the-minimum-level', {
3940
- levelUnit: LevelUnits[getValues('level.unit')],
3941
- minLevelValue: getMinLevelValue(getValues('level.unit'), getFIRValue(), productConfig)
4071
+ isValidMin(value, getMinLevelValue(getValues('lowerLevel.unit'), getFIRValue(), productConfig)) || t('levels-the-minimum-level', {
4072
+ levelUnit: LevelUnits[getValues('lowerLevel.unit')],
4073
+ minLevelValue: getMinLevelValue(getValues('lowerLevel.unit'), getFIRValue(), productConfig)
3942
4074
  }),
4075
+ isLevelLower: value =>
4076
+ // The lower level needs to be smaller than upper level
4077
+ isLevelLower(value, getValues('lowerLevel.unit'), getValues('level.value'), getValues('level.unit')),
3943
4078
  validateLevels: value =>
3944
4079
  // level step depends on the unit
3945
- validateLevels(value, getValues('level.unit'), productConfig, getFIRValue())
4080
+ validateLevels(value, getValues('lowerLevel.unit'), productConfig, getFIRValue())
3946
4081
  }
3947
4082
  },
3948
- disabled: fieldsDisabled,
3949
- isReadOnly: isReadOnly,
3950
- onChange: () => {
3951
- triggerValidations(['lowerLevel.value'], getValues, trigger);
3952
- },
3953
- autoFocus: true
4083
+ size: "small",
4084
+ disabled: isDisabled,
4085
+ isReadOnly: isReadOnly
3954
4086
  })
3955
4087
  }))]
3956
- })), jsxs(Grid, Object.assign({
3957
- item: true,
3958
- xs: 12,
3959
- container: true,
3960
- spacing: 2,
3961
- justifyItems: "flex-end",
3962
- alignItems: "flex-end"
3963
- }, {
3964
- children: [jsx(Grid, Object.assign({
3965
- item: true,
3966
- xs: 12,
3967
- md: 3
3968
- }, {
3969
- children: jsx(FormControlLabel, {
3970
- control: jsx(Checkbox, {
3971
- checked: levelInfoMode === 'BETW_SFC',
3972
- onChange: () => {
3973
- getValues('level.unit') && trigger('level.unit');
3974
- setValue('levelInfoMode', getValues('levelInfoMode') === 'BETW' ? 'BETW_SFC' : 'BETW', {
3975
- shouldDirty: true
3976
- });
3977
- },
3978
- name: "checkedF",
3979
- color: "secondary",
3980
- disabled: fieldsDisabled
3981
- }),
3982
- "data-testid": "levels-SFC",
3983
- label: "SFC"
3984
- })
3985
- })), levelInfoMode !== 'BETW_SFC' && jsxs(Fragment, {
3986
- children: [jsx(Grid, Object.assign({
3987
- item: true,
3988
- xs: 4,
3989
- md: 3
3990
- }, {
3991
- children: jsx(ReactHookFormSelect, Object.assign({
3992
- name: "lowerLevel.unit",
3993
- label: t('unit-label'),
3994
- rules: {
3995
- validate: {
3996
- isRequired,
3997
- validateLevelUnitCombinations: value =>
3998
- // level step depends on the unit
3999
- validateLevelUnitCombinations(getValues('level.unit'), value, t)
4000
- }
4001
- },
4002
- size: "small",
4003
- sx: styles$2.unit,
4004
- disabled: isDisabled,
4005
- isReadOnly: isReadOnly,
4006
- defaultValue: getValues('level.unit') || 'FL',
4007
- onChange: () => {
4008
- triggerValidations(['lowerLevel.value', 'level.unit'], getValues, trigger);
4009
- _onChange();
4010
- }
4011
- }, {
4012
- children: Object.keys(allowedLevelUnitsForFir).map(key => jsx(MenuItem, Object.assign({
4013
- value: key
4014
- }, {
4015
- children: allowedLevelUnitsForFir[key]
4016
- }), key))
4017
- }))
4018
- })), jsx(Grid, Object.assign({
4019
- item: true,
4020
- xs: 8,
4021
- md: 6
4022
- }, {
4023
- children: jsx(ReactHookFormNumberField, {
4024
- name: "lowerLevel.value",
4025
- label: t('levels-lower-level-label'),
4026
- rules: {
4027
- validate: {
4028
- isRequired,
4029
- isInteger,
4030
- max: value =>
4031
- // The max level depends on the unit
4032
- isValidMax(value, getMaxLevelValue(getValues('lowerLevel.unit'), getFIRValue(), productConfig)) || t('levels-the-maximum-level', {
4033
- levelUnit: LevelUnits[getValues('lowerLevel.unit')],
4034
- maxLevelValue: getMaxLevelValue(getValues('lowerLevel.unit'), getFIRValue(), productConfig)
4035
- }),
4036
- min: value =>
4037
- // The min level depends on the unit
4038
- isValidMin(value, getMinLevelValue(getValues('lowerLevel.unit'), getFIRValue(), productConfig)) || t('levels-the-minimum-level', {
4039
- levelUnit: LevelUnits[getValues('lowerLevel.unit')],
4040
- minLevelValue: getMinLevelValue(getValues('lowerLevel.unit'), getFIRValue(), productConfig)
4041
- }),
4042
- isLevelLower: value =>
4043
- // The lower level needs to be smaller than upper level
4044
- isLevelLower(value, getValues('lowerLevel.unit'), getValues('level.value'), getValues('level.unit')),
4045
- validateLevels: value =>
4046
- // level step depends on the unit
4047
- validateLevels(value, getValues('lowerLevel.unit'), productConfig, getFIRValue())
4048
- }
4049
- },
4050
- size: "small",
4051
- disabled: isDisabled,
4052
- isReadOnly: isReadOnly
4053
- })
4054
- }))]
4055
- })]
4056
- }))]
4057
- }) : null, jsx(RadioButtonAndLabel, {
4058
- value: "ABV",
4059
- label: t('above'),
4060
- disabled: fieldsDisabled,
4061
- checked: levelInfoMode === 'ABV' || levelInfoMode === 'TOPS_ABV',
4062
- "data-testid": "levels-ABV"
4063
- }), levelInfoMode === 'ABV' || levelInfoMode === 'TOPS_ABV' ? jsxs(Grid, Object.assign({
4064
- item: true,
4065
- xs: 12,
4066
- container: true,
4067
- spacing: 2,
4068
- justifyItems: "flex-end",
4069
- alignItems: "flex-end"
4070
- }, {
4071
- children: [jsx(Grid, Object.assign({
4072
- item: true,
4088
+ })]
4089
+ }))]
4090
+ }) : null, jsx(RadioButtonAndLabel, {
4091
+ value: "ABV",
4092
+ label: t('above'),
4093
+ disabled: fieldsDisabled,
4094
+ checked: levelInfoMode === 'ABV' || levelInfoMode === 'TOPS_ABV',
4095
+ "data-testid": "levels-ABV"
4096
+ }), levelInfoMode === 'ABV' || levelInfoMode === 'TOPS_ABV' ? jsxs(Grid2, Object.assign({
4097
+ container: true,
4098
+ spacing: 2,
4099
+ justifyItems: "flex-end",
4100
+ alignItems: "flex-start"
4101
+ }, {
4102
+ children: [jsx(Grid2, Object.assign({
4103
+ size: {
4073
4104
  xs: 12,
4074
4105
  md: 3
4075
- }, {
4076
- children: jsx(FormControlLabel, {
4077
- control: jsx(Checkbox, {
4078
- checked: levelInfoMode === 'TOPS_ABV',
4079
- onChange: () => {
4080
- setValue('levelInfoMode', getValues('levelInfoMode') === 'ABV' ? 'TOPS_ABV' : 'ABV', {
4081
- shouldDirty: true
4082
- });
4083
- },
4084
- disabled: isDisabled
4085
- }),
4086
- label: t('levels-tops-label'),
4087
- "data-testid": "levels-TOPS_ABV"
4088
- })
4089
- })), jsx(Grid, Object.assign({
4090
- item: true,
4106
+ }
4107
+ }, {
4108
+ children: jsx(FormControlLabel, {
4109
+ control: jsx(Checkbox, {
4110
+ checked: levelInfoMode === 'TOPS_ABV',
4111
+ onChange: () => {
4112
+ setValue('levelInfoMode', getValues('levelInfoMode') === 'ABV' ? 'TOPS_ABV' : 'ABV', {
4113
+ shouldDirty: true
4114
+ });
4115
+ },
4116
+ disabled: isDisabled
4117
+ }),
4118
+ label: t('levels-tops-label'),
4119
+ "data-testid": "levels-TOPS_ABV"
4120
+ })
4121
+ })), jsx(Grid2, Object.assign({
4122
+ size: {
4091
4123
  xs: 4,
4092
4124
  md: 3
4093
- }, {
4094
- children: jsx(ReactHookFormSelect, Object.assign({
4095
- name: "level.unit",
4096
- label: t('unit-label'),
4097
- rules: {
4098
- validate: {
4099
- isRequired
4100
- }
4101
- },
4102
- size: "small",
4103
- sx: styles$2.unit,
4104
- disabled: isDisabled,
4105
- isReadOnly: isReadOnly,
4106
- defaultValue: 'FL',
4107
- onChange: () => {
4108
- triggerValidations(['level.value'], getValues, trigger);
4109
- _onChange();
4125
+ }
4126
+ }, {
4127
+ children: jsx(ReactHookFormSelect, Object.assign({
4128
+ name: "level.unit",
4129
+ label: t('unit-label'),
4130
+ rules: {
4131
+ validate: {
4132
+ isRequired
4110
4133
  }
4111
- }, {
4112
- children: Object.keys(allowedLevelUnitsForFir).map(key => jsx(MenuItem, Object.assign({
4113
- value: key
4114
- }, {
4115
- children: allowedLevelUnitsForFir[key]
4116
- }), key))
4117
- }))
4118
- })), jsx(Grid, Object.assign({
4119
- item: true,
4120
- xs: 8,
4121
- md: 6
4122
- }, {
4123
- children: jsx(ReactHookFormNumberField, {
4124
- name: "level.value",
4125
- label: t('level'),
4126
- rules: {
4127
- validate: {
4128
- isRequired,
4129
- isInteger,
4130
- max: value =>
4131
- // The max level depends on the unit
4132
- isValidMax(value, getMaxLevelValue(getValues('level.unit'), getFIRValue(), productConfig)) || t('levels-the-maximum-level', {
4133
- levelUnit: LevelUnits[getValues('level.unit')],
4134
- maxLevelValue: getMaxLevelValue(getValues('level.unit'), getFIRValue(), productConfig)
4135
- }),
4136
- min: value =>
4137
- // The min level depends on the unit
4138
- isValidMin(value, getMinLevelValue(getValues('level.unit'), getFIRValue(), productConfig)) || t('levels-the-minimum-level', {
4139
- levelUnit: LevelUnits[getValues('level.unit')],
4140
- minLevelValue: getMinLevelValue(getValues('level.unit'), getFIRValue(), productConfig)
4141
- }),
4142
- validateLevels: value =>
4143
- // level step depends on the unit
4144
- validateLevels(value, getValues('level.unit'), productConfig, getFIRValue())
4145
- }
4146
- },
4147
- size: "small",
4148
- disabled: isDisabled,
4149
- isReadOnly: isReadOnly,
4150
- autoFocus: true
4151
- })
4152
- }))]
4153
- })) : null]
4154
- }))
4134
+ },
4135
+ size: "small",
4136
+ sx: styles$2.unit,
4137
+ disabled: isDisabled,
4138
+ isReadOnly: isReadOnly,
4139
+ defaultValue: 'FL',
4140
+ onChange: () => {
4141
+ triggerValidations(['level.value'], getValues, trigger);
4142
+ _onChange();
4143
+ }
4144
+ }, {
4145
+ children: Object.keys(allowedLevelUnitsForFir).map(key => jsx(MenuItem, Object.assign({
4146
+ value: key
4147
+ }, {
4148
+ children: allowedLevelUnitsForFir[key]
4149
+ }), key))
4150
+ }))
4151
+ })), jsx(Grid2, Object.assign({
4152
+ size: {
4153
+ xs: 8,
4154
+ md: 6
4155
+ }
4156
+ }, {
4157
+ children: jsx(ReactHookFormNumberField, {
4158
+ name: "level.value",
4159
+ label: t('level'),
4160
+ rules: {
4161
+ validate: {
4162
+ isRequired,
4163
+ isInteger,
4164
+ max: value =>
4165
+ // The max level depends on the unit
4166
+ isValidMax(value, getMaxLevelValue(getValues('level.unit'), getFIRValue(), productConfig)) || t('levels-the-maximum-level', {
4167
+ levelUnit: LevelUnits[getValues('level.unit')],
4168
+ maxLevelValue: getMaxLevelValue(getValues('level.unit'), getFIRValue(), productConfig)
4169
+ }),
4170
+ min: value =>
4171
+ // The min level depends on the unit
4172
+ isValidMin(value, getMinLevelValue(getValues('level.unit'), getFIRValue(), productConfig)) || t('levels-the-minimum-level', {
4173
+ levelUnit: LevelUnits[getValues('level.unit')],
4174
+ minLevelValue: getMinLevelValue(getValues('level.unit'), getFIRValue(), productConfig)
4175
+ }),
4176
+ validateLevels: value =>
4177
+ // level step depends on the unit
4178
+ validateLevels(value, getValues('level.unit'), productConfig, getFIRValue())
4179
+ }
4180
+ },
4181
+ size: "small",
4182
+ disabled: isDisabled,
4183
+ isReadOnly: isReadOnly,
4184
+ autoFocus: true
4185
+ })
4186
+ }))]
4187
+ })) : null]
4155
4188
  }))
4156
4189
  }));
4157
4190
  };
@@ -4178,10 +4211,14 @@ const ObservationForecast = ({
4178
4211
  const fieldsDisabled = isDisabled || isShortTest();
4179
4212
  return jsx(ProductFormFieldLayout, Object.assign({
4180
4213
  sx: {
4181
- paddingTop: '8px!important',
4214
+ marginTop: -1,
4182
4215
  '.MuiButtonBase-root.MuiRadio-root': {
4183
4216
  padding: '6px',
4184
4217
  marginLeft: '3px'
4218
+ },
4219
+ '.MuiFormHelperText-root.Mui-error': {
4220
+ marginBottom: '-16px',
4221
+ marginTop: '3px'
4185
4222
  }
4186
4223
  }
4187
4224
  }, {
@@ -4294,7 +4331,13 @@ const Phenomenon = ({
4294
4331
  handleSinglePhenomenaSelection();
4295
4332
  }
4296
4333
  return jsx(ProductFormFieldLayout, Object.assign({
4297
- title: t('phenomenon-title')
4334
+ title: t('phenomenon-title'),
4335
+ sx: {
4336
+ '.MuiFormHelperText-root.Mui-error': {
4337
+ marginBottom: '-22px',
4338
+ marginTop: '2px'
4339
+ }
4340
+ }
4298
4341
  }, {
4299
4342
  children: jsx(ReactHookFormSelect, Object.assign({
4300
4343
  name: "phenomenon",
@@ -4423,222 +4466,209 @@ const Progress = ({
4423
4466
  const showMaxFeaturePointsWarning = intersectionPointCount > 7 && hasMaxFeaturePoints(geoJSONIntersection, maxPoints) && !activeTool && !errors.startGeometry && !isFir(geoJSON);
4424
4467
  const showMoreThan6PointsWarning = totalDrawnPoints > 7 && intersectionPointCount < 1 && !activeTool && !errors.startGeometry && !isFir(geoJSON);
4425
4468
  const showIntersectionAbove6PointsWarning = intersectingPolygonPointsTotal > 7 && intersectionPointCount > 1 && maxPoints > 7 && !activeTool && !errors.startGeometry && !isFir(geoJSON);
4426
- return jsx(ProductFormFieldLayout, Object.assign({
4469
+ return jsxs(ProductFormFieldLayout, Object.assign({
4427
4470
  title: t('progress'),
4428
4471
  sx: styles$2.containerItem
4429
4472
  }, {
4430
- children: jsxs(Grid, Object.assign({
4431
- item: true,
4432
- xs: 12
4433
- }, {
4434
- children: [jsxs(ReactHookFormRadioGroup, Object.assign({
4435
- name: "movementType",
4436
- "data-testid": "movementType-group",
4437
- rules: {
4438
- validate: {
4439
- isRequired
4440
- }
4441
- },
4442
- isReadOnly: _isReadOnly,
4443
- onChange: () => {
4444
- const deleteTool = _tools === null || _tools === void 0 ? void 0 : _tools.find(tool => tool.value === 'DELETE');
4445
- if (deleteTool) {
4446
- _onChangeTool(deleteTool);
4447
- }
4473
+ children: [jsxs(ReactHookFormRadioGroup, Object.assign({
4474
+ name: "movementType",
4475
+ "data-testid": "movementType-group",
4476
+ rules: {
4477
+ validate: {
4478
+ isRequired
4448
4479
  }
4449
- }, {
4450
- children: [isVolcanicCloud && jsx(RadioButtonAndLabel, {
4451
- value: "NO_VA_EXP",
4452
- label: t('progress-radio-button-label-no-va-exp'),
4480
+ },
4481
+ isReadOnly: _isReadOnly,
4482
+ onChange: () => {
4483
+ const deleteTool = _tools === null || _tools === void 0 ? void 0 : _tools.find(tool => tool.value === 'DELETE');
4484
+ if (deleteTool) {
4485
+ _onChangeTool(deleteTool);
4486
+ }
4487
+ }
4488
+ }, {
4489
+ children: [isVolcanicCloud && jsx(RadioButtonAndLabel, {
4490
+ value: "NO_VA_EXP",
4491
+ label: t('progress-radio-button-label-no-va-exp'),
4492
+ disabled: fieldsDisabled,
4493
+ "data-testid": "movementType-NO_VA_EXP"
4494
+ }), jsxs(Fragment, {
4495
+ children: [jsx(RadioButtonAndLabel, {
4496
+ value: "STATIONARY",
4497
+ label: t('progress-radio-button-label-stationary'),
4453
4498
  disabled: fieldsDisabled,
4454
- "data-testid": "movementType-NO_VA_EXP"
4455
- }), jsxs(Fragment, {
4456
- children: [jsx(RadioButtonAndLabel, {
4457
- value: "STATIONARY",
4458
- label: t('progress-radio-button-label-stationary'),
4459
- disabled: fieldsDisabled,
4460
- "data-testid": "movementType-STATIONARY"
4461
- }), jsx(RadioButtonAndLabel, {
4462
- value: "MOVEMENT",
4463
- label: t('progress-radio-button-label-movement'),
4464
- disabled: fieldsDisabled,
4465
- "data-testid": "movementType-MOVEMENT"
4466
- }), isSigmet && isShortTestOrRdoact && jsx(RadioButtonAndLabel, {
4467
- value: "FORECAST_POSITION",
4468
- label: t('progress-radio-button-label-end-potision'),
4469
- disabled: fieldsDisabled,
4470
- "data-testid": "movementType-FORECAST_POSITION"
4471
- })]
4472
- }), movementType === 'MOVEMENT' && !isShortTestOrRdoact && jsxs(Fragment, {
4473
- children: [jsx(Grid, Object.assign({
4474
- item: true,
4475
- xs: 12
4499
+ "data-testid": "movementType-STATIONARY"
4500
+ }), jsx(RadioButtonAndLabel, {
4501
+ value: "MOVEMENT",
4502
+ label: t('progress-radio-button-label-movement'),
4503
+ disabled: fieldsDisabled,
4504
+ "data-testid": "movementType-MOVEMENT"
4505
+ }), isSigmet && isShortTestOrRdoact && jsx(RadioButtonAndLabel, {
4506
+ value: "FORECAST_POSITION",
4507
+ label: t('progress-radio-button-label-end-potision'),
4508
+ disabled: fieldsDisabled,
4509
+ "data-testid": "movementType-FORECAST_POSITION"
4510
+ })]
4511
+ }), movementType === 'MOVEMENT' && !isShortTestOrRdoact && jsxs(Fragment, {
4512
+ children: [jsx(Grid2, {
4513
+ children: jsx(ReactHookFormSelect, Object.assign({
4514
+ name: "movementDirection",
4515
+ label: t('progress-movement-direction-label'),
4516
+ rules: {
4517
+ validate: {
4518
+ isRequired
4519
+ }
4520
+ },
4521
+ size: "small",
4522
+ sx: styles$2.movement,
4523
+ disabled: _isDisabled,
4524
+ isReadOnly: _isReadOnly,
4525
+ "data-testid": "movement-movementDirection",
4526
+ onChange: event => {
4527
+ event.stopPropagation();
4528
+ _onChange();
4529
+ },
4530
+ autoFocus: true
4531
+ }, {
4532
+ children: Object.keys(Direction).map(key => jsx(MenuItem, Object.assign({
4533
+ value: key
4534
+ }, {
4535
+ children: Direction[key]
4536
+ }), key))
4537
+ }))
4538
+ }), jsxs(Grid2, Object.assign({
4539
+ container: true
4540
+ }, {
4541
+ children: [jsx(Grid2, Object.assign({
4542
+ size: 5
4476
4543
  }, {
4477
4544
  children: jsx(ReactHookFormSelect, Object.assign({
4478
- name: "movementDirection",
4479
- label: t('progress-movement-direction-label'),
4545
+ name: "movementUnit",
4546
+ label: t('progress-movement-unit-label'),
4480
4547
  rules: {
4481
4548
  validate: {
4482
4549
  isRequired
4483
4550
  }
4484
4551
  },
4485
4552
  size: "small",
4486
- sx: styles$2.movement,
4553
+ sx: styles$2.unit,
4487
4554
  disabled: _isDisabled,
4488
4555
  isReadOnly: _isReadOnly,
4489
- "data-testid": "movement-movementDirection",
4556
+ defaultValue: 'KT',
4557
+ "data-testid": "movement-movementUnit",
4490
4558
  onChange: event => {
4491
4559
  event.stopPropagation();
4560
+ triggerValidations(['movementSpeed'], getValues, trigger);
4492
4561
  _onChange();
4493
- },
4494
- autoFocus: true
4562
+ }
4495
4563
  }, {
4496
- children: Object.keys(Direction).map(key => jsx(MenuItem, Object.assign({
4564
+ children: Object.keys(allowedMovementUnitsForFir).map(key => jsx(MenuItem, Object.assign({
4497
4565
  value: key
4498
4566
  }, {
4499
- children: Direction[key]
4567
+ children: MovementUnit[key]
4500
4568
  }), key))
4501
4569
  }))
4502
- })), jsxs(Grid, Object.assign({
4503
- item: true,
4504
- xs: 12,
4505
- container: true
4570
+ })), jsx(Grid2, Object.assign({
4571
+ size: 7
4506
4572
  }, {
4507
- children: [jsx(Grid, Object.assign({
4508
- item: true,
4509
- xs: 5
4510
- }, {
4511
- children: jsx(ReactHookFormSelect, Object.assign({
4512
- name: "movementUnit",
4513
- label: t('progress-movement-unit-label'),
4514
- rules: {
4515
- validate: {
4516
- isRequired
4517
- }
4518
- },
4519
- size: "small",
4520
- sx: styles$2.unit,
4521
- disabled: _isDisabled,
4522
- isReadOnly: _isReadOnly,
4523
- defaultValue: 'KT',
4524
- "data-testid": "movement-movementUnit",
4525
- onChange: event => {
4526
- event.stopPropagation();
4527
- triggerValidations(['movementSpeed'], getValues, trigger);
4528
- _onChange();
4573
+ children: jsx(ReactHookFormNumberField, {
4574
+ name: "movementSpeed",
4575
+ label: t('progress-movement-speed-label'),
4576
+ rules: {
4577
+ validate: {
4578
+ isRequired,
4579
+ isInteger,
4580
+ min: value =>
4581
+ // The max level depends on the unit
4582
+ isValidMin(value, getMinMovementSpeedValue(getValues('movementUnit'), getFIRValue(), productConfig)) || t('progress-the-minimum-level-in-movement', {
4583
+ movementUnitType: MovementUnit[getValues('movementUnit')],
4584
+ movementUnit: getMinMovementSpeedValue(getValues('movementUnit'), getFIRValue(), productConfig)
4585
+ }),
4586
+ max: value =>
4587
+ // The max level depends on the unit
4588
+ isValidMax(value, getMaxMovementSpeedValue(getValues('movementUnit'), getFIRValue(), productConfig)) || t('progress-the-maxium-level-in-movement', {
4589
+ movementUnitType: MovementUnit[getValues('movementUnit')],
4590
+ movementUnit: getMaxMovementSpeedValue(getValues('movementUnit'), getFIRValue(), productConfig)
4591
+ }),
4592
+ validateMovementSteps: value =>
4593
+ // movement step depends on the unit
4594
+ validateMovementSteps(value, getValues('movementUnit'), productConfig, getFIRValue())
4529
4595
  }
4530
- }, {
4531
- children: Object.keys(allowedMovementUnitsForFir).map(key => jsx(MenuItem, Object.assign({
4532
- value: key
4533
- }, {
4534
- children: MovementUnit[key]
4535
- }), key))
4536
- }))
4537
- })), jsx(Grid, Object.assign({
4538
- item: true,
4539
- xs: 7
4540
- }, {
4541
- children: jsx(ReactHookFormNumberField, {
4542
- name: "movementSpeed",
4543
- label: t('progress-movement-speed-label'),
4544
- rules: {
4545
- validate: {
4546
- isRequired,
4547
- isInteger,
4548
- min: value =>
4549
- // The max level depends on the unit
4550
- isValidMin(value, getMinMovementSpeedValue(getValues('movementUnit'), getFIRValue(), productConfig)) || t('progress-the-minimum-level-in-movement', {
4551
- movementUnitType: MovementUnit[getValues('movementUnit')],
4552
- movementUnit: getMinMovementSpeedValue(getValues('movementUnit'), getFIRValue(), productConfig)
4553
- }),
4554
- max: value =>
4555
- // The max level depends on the unit
4556
- isValidMax(value, getMaxMovementSpeedValue(getValues('movementUnit'), getFIRValue(), productConfig)) || t('progress-the-maxium-level-in-movement', {
4557
- movementUnitType: MovementUnit[getValues('movementUnit')],
4558
- movementUnit: getMaxMovementSpeedValue(getValues('movementUnit'), getFIRValue(), productConfig)
4559
- }),
4560
- validateMovementSteps: value =>
4561
- // movement step depends on the unit
4562
- validateMovementSteps(value, getValues('movementUnit'), productConfig, getFIRValue())
4563
- }
4564
- },
4565
- size: "small",
4566
- disabled: _isDisabled,
4567
- isReadOnly: _isReadOnly,
4568
- "data-testid": "movement-movementSpeed",
4569
- onChange: event => event && event.stopPropagation()
4570
- })
4571
- }))]
4572
- }))]
4573
- }), isSigmet && !isShortTestOrRdoact && jsx(RadioButtonAndLabel, {
4574
- value: "FORECAST_POSITION",
4575
- label: t('progress-radio-button-label-end-potision'),
4576
- disabled: _isDisabled,
4577
- "data-testid": "movementType-FORECAST_POSITION"
4578
- })]
4579
- })), isSigmet && !isShortTestOrRdoact && movementType === 'FORECAST_POSITION' && jsxs(Grid, Object.assign({
4580
- item: true,
4581
- xs: 12,
4582
- "data-testid": "endGeometry",
4583
- sx: styles$2.drawSection
4584
- }, {
4585
- children: [!_isReadOnly && jsxs(Fragment, {
4586
- children: [jsx(DrawTools, {
4587
- "data-testid": "endGeometry-drawTools",
4588
- tools: _tools,
4589
- activeTool: activeTool,
4590
- onChangeTool: _onChangeTool
4591
- }), activeTool && jsx(FormHelperText, Object.assign({
4592
- variant: "filled",
4593
- sx: styles$2.quitDrawModeMessage
4594
- }, {
4595
- children: t('geometry-exit-draw-mode-message')
4596
- })), !!errors.endGeometry && jsx(FormHelperText, Object.assign({
4597
- error: true,
4598
- variant: "filled"
4599
- }, {
4600
- children: errors.endGeometry.message
4601
- })), /* non-blocking warnings */
4602
- showMaxFeaturePointsWarning && jsx(FormHelperText, Object.assign({
4603
- variant: "filled"
4604
- }, {
4605
- children: t('geometry-max-feature-points-message')
4606
- })), /* non-blocking warnings */
4607
- showMoreThan6PointsWarning && jsx(FormHelperText, Object.assign({
4608
- variant: "filled"
4609
- }, {
4610
- children: t('progress-more-than-6-points-message', {
4611
- totalDrawnPoints
4612
- })
4613
- })), /* non-blocking warnings */
4614
- showIntersectionAbove6PointsWarning && jsx(FormHelperText, Object.assign({
4615
- variant: "filled"
4616
- }, {
4617
- children: t('progress-intersection-above-6-points-message', {
4618
- intersectingPolygonPointsTotal
4596
+ },
4597
+ size: "small",
4598
+ disabled: _isDisabled,
4599
+ isReadOnly: _isReadOnly,
4600
+ "data-testid": "movement-movementSpeed",
4601
+ onChange: event => event && event.stopPropagation()
4619
4602
  })
4620
- })), hasMulitpleIntersections(geoJSONIntersection) && !activeTool && !errors.endGeometry && !isFir(geoJSON) && jsx(FormHelperText, Object.assign({
4621
- variant: "filled"
4622
- }, {
4623
- children: t('geometry-multi-intersections-message')
4624
4603
  }))]
4625
- }), jsx(ReactHookFormHiddenInput, {
4626
- name: "endGeometry",
4627
- rules: {
4628
- validate: {
4629
- maximumOneDrawing: value => isMaximumOneDrawing(value) || t('progress-only-one-position-drawing'),
4630
- coordinatesNotEmpty: value => getValues('movementType') === 'FORECAST_POSITION' && !isDraft() ? isValidGeoJsonCoordinates(value) || t('progress-coordinate-empty-message') : true,
4631
- intersectWithFIR: value => hasIntersectionWithFIR(value, getValues('endGeometryIntersect')) || t('progress-no-intersection-message'),
4632
- hasMaxFeaturePoints: value => isFir(value) ? true : !hasMaxFeaturePoints(value, maxPoints) || t('progress-maximumPointsMessage', {
4633
- maxPoints: maxPoints - 1
4634
- })
4635
- }
4604
+ }))]
4605
+ }), isSigmet && !isShortTestOrRdoact && jsx(RadioButtonAndLabel, {
4606
+ value: "FORECAST_POSITION",
4607
+ label: t('progress-radio-button-label-end-potision'),
4608
+ disabled: _isDisabled,
4609
+ "data-testid": "movementType-FORECAST_POSITION"
4610
+ })]
4611
+ })), isSigmet && !isShortTestOrRdoact && movementType === 'FORECAST_POSITION' && jsxs(Grid2, Object.assign({
4612
+ "data-testid": "endGeometry",
4613
+ sx: styles$2.drawSectionProgress,
4614
+ size: 12
4615
+ }, {
4616
+ children: [!_isReadOnly && jsxs(Fragment, {
4617
+ children: [jsx(DrawTools, {
4618
+ "data-testid": "endGeometry-drawTools",
4619
+ tools: _tools,
4620
+ activeTool: activeTool,
4621
+ onChangeTool: _onChangeTool
4622
+ }), activeTool && jsx(FormHelperText, Object.assign({
4623
+ variant: "filled",
4624
+ sx: styles$2.quitDrawModeMessage
4625
+ }, {
4626
+ children: t('geometry-exit-draw-mode-message')
4627
+ })), !!errors.endGeometry && jsx(FormHelperText, Object.assign({
4628
+ error: true,
4629
+ variant: "filled"
4630
+ }, {
4631
+ children: errors.endGeometry.message
4632
+ })), /* non-blocking warnings */
4633
+ showMaxFeaturePointsWarning && jsx(FormHelperText, Object.assign({
4634
+ variant: "filled"
4635
+ }, {
4636
+ children: t('geometry-max-feature-points-message')
4637
+ })), /* non-blocking warnings */
4638
+ showMoreThan6PointsWarning && jsx(FormHelperText, Object.assign({
4639
+ variant: "filled"
4640
+ }, {
4641
+ children: t('progress-more-than-6-points-message', {
4642
+ totalDrawnPoints
4643
+ })
4644
+ })), /* non-blocking warnings */
4645
+ showIntersectionAbove6PointsWarning && jsx(FormHelperText, Object.assign({
4646
+ variant: "filled"
4647
+ }, {
4648
+ children: t('progress-intersection-above-6-points-message', {
4649
+ intersectingPolygonPointsTotal
4650
+ })
4651
+ })), hasMulitpleIntersections(geoJSONIntersection) && !activeTool && !errors.endGeometry && !isFir(geoJSON) && jsx(FormHelperText, Object.assign({
4652
+ variant: "filled"
4653
+ }, {
4654
+ children: t('geometry-multi-intersections-message')
4655
+ }))]
4656
+ }), jsx(ReactHookFormHiddenInput, {
4657
+ name: "endGeometry",
4658
+ rules: {
4659
+ validate: {
4660
+ maximumOneDrawing: value => isMaximumOneDrawing(value) || t('progress-only-one-position-drawing'),
4661
+ coordinatesNotEmpty: value => getValues('movementType') === 'FORECAST_POSITION' && !isDraft() ? isValidGeoJsonCoordinates(value) || t('progress-coordinate-empty-message') : true,
4662
+ intersectWithFIR: value => hasIntersectionWithFIR(value, getValues('endGeometryIntersect')) || t('progress-no-intersection-message'),
4663
+ hasMaxFeaturePoints: value => isFir(value) ? true : !hasMaxFeaturePoints(value, maxPoints) || t('progress-maximumPointsMessage', {
4664
+ maxPoints: maxPoints - 1
4665
+ })
4636
4666
  }
4637
- }), jsx(ReactHookFormHiddenInput, {
4638
- name: "endGeometryIntersect"
4639
- })]
4640
- }))]
4641
- }))
4667
+ }
4668
+ }), jsx(ReactHookFormHiddenInput, {
4669
+ name: "endGeometryIntersect"
4670
+ })]
4671
+ }))]
4642
4672
  }));
4643
4673
  };
4644
4674
 
@@ -4956,7 +4986,11 @@ const ValidFrom = ({
4956
4986
  disabled: isDisabled,
4957
4987
  isReadOnly: isReadOnly,
4958
4988
  "data-testid": "valid-from",
4959
- sx: styles$2.helperText
4989
+ sx: Object.assign(Object.assign({}, styles$2.helperText), {
4990
+ '.MuiFormHelperText-root.Mui-error': {
4991
+ marginBottom: '-16px'
4992
+ }
4993
+ })
4960
4994
  })
4961
4995
  }));
4962
4996
  };
@@ -5036,7 +5070,11 @@ const ValidUntil = ({
5036
5070
  _onChange();
5037
5071
  },
5038
5072
  "data-testid": "valid-until",
5039
- sx: styles$2.helperText
5073
+ sx: Object.assign(Object.assign({}, styles$2.helperText), {
5074
+ '.MuiFormHelperText-root.Mui-error': {
5075
+ marginBottom: '-16px'
5076
+ }
5077
+ })
5040
5078
  }, defaultValidUntilValue)
5041
5079
  }));
5042
5080
  };
@@ -5054,26 +5092,25 @@ const VolcanicFields = ({
5054
5092
  trigger,
5055
5093
  getValues
5056
5094
  } = useFormContext();
5057
- return jsxs(Grid, Object.assign({
5058
- item: true,
5095
+ return jsx(Grid2, Object.assign({
5059
5096
  container: true,
5060
5097
  spacing: 2
5061
5098
  }, {
5062
- children: [jsx(Grid, {
5063
- item: true,
5064
- xs: 4,
5065
- container: true,
5066
- justifyContent: "flex-end"
5067
- }), jsxs(Grid, Object.assign({
5068
- item: true,
5069
- xs: 8,
5099
+ children: jsxs(Grid2, Object.assign({
5070
5100
  container: true,
5071
- justifyContent: "flex-start"
5101
+ justifyContent: "flex-start",
5102
+ offset: 4,
5103
+ size: 8,
5104
+ spacing: 0,
5105
+ sx: {
5106
+ '.MuiFormHelperText-root': {
5107
+ marginTop: '2px'
5108
+ }
5109
+ }
5072
5110
  }, {
5073
- children: [(!isReadOnly || !!watch('vaSigmetVolcanoName')) && jsx(Grid, Object.assign({
5074
- item: true,
5075
- xs: 12,
5076
- sx: styles$2.volcanicField
5111
+ children: [(!isReadOnly || !!watch('vaSigmetVolcanoName')) && jsx(Grid2, Object.assign({
5112
+ sx: styles$2.volcanicField,
5113
+ size: 12
5077
5114
  }, {
5078
5115
  children: jsx(ReactHookFormTextField, {
5079
5116
  name: "vaSigmetVolcanoName",
@@ -5087,9 +5124,8 @@ const VolcanicFields = ({
5087
5124
  isReadOnly: isReadOnly,
5088
5125
  size: "small"
5089
5126
  })
5090
- })), (!isReadOnly || !!watch('vaSigmetVolcanoCoordinates.latitude')) && jsx(Grid, Object.assign({
5091
- item: true,
5092
- xs: 6
5127
+ })), (!isReadOnly || !!watch('vaSigmetVolcanoCoordinates.latitude')) && jsx(Grid2, Object.assign({
5128
+ size: 6
5093
5129
  }, {
5094
5130
  children: jsx(ReactHookFormNumberField, {
5095
5131
  name: "vaSigmetVolcanoCoordinates.latitude",
@@ -5109,9 +5145,8 @@ const VolcanicFields = ({
5109
5145
  onChange: () => trigger('vaSigmetVolcanoCoordinates.longitude'),
5110
5146
  isReadOnly: isReadOnly
5111
5147
  })
5112
- })), (!isReadOnly || !!watch('vaSigmetVolcanoCoordinates.longitude')) && jsx(Grid, Object.assign({
5113
- item: true,
5114
- xs: 6
5148
+ })), (!isReadOnly || !!watch('vaSigmetVolcanoCoordinates.longitude')) && jsx(Grid2, Object.assign({
5149
+ size: 6
5115
5150
  }, {
5116
5151
  children: jsx(ReactHookFormNumberField, {
5117
5152
  name: "vaSigmetVolcanoCoordinates.longitude",
@@ -5132,7 +5167,7 @@ const VolcanicFields = ({
5132
5167
  isReadOnly: isReadOnly
5133
5168
  })
5134
5169
  }))]
5135
- }))]
5170
+ }))
5136
5171
  }));
5137
5172
  };
5138
5173
 
@@ -5179,26 +5214,22 @@ const SurfaceVisibility = ({
5179
5214
  const getFIRValue = () => getValues('locationIndicatorATSR');
5180
5215
  const visibilityLabel = getFieldLabel(t('surface-visibility'), isReadOnly);
5181
5216
  const visibilityCauseLabel = getFieldLabel(t('surface-visibility-cause'), isReadOnly);
5182
- return jsxs(Grid, Object.assign({
5183
- item: true,
5217
+ return jsxs(Grid2, Object.assign({
5184
5218
  container: true,
5185
5219
  spacing: 2
5186
5220
  }, {
5187
- children: [jsx(Grid, {
5188
- item: true,
5189
- xs: 4,
5221
+ children: [jsx(Grid2, {
5190
5222
  container: true,
5191
- justifyContent: "flex-end"
5192
- }), jsxs(Grid, Object.assign({
5193
- item: true,
5194
- xs: 8,
5223
+ justifyContent: "flex-end",
5224
+ size: 4
5225
+ }), jsxs(Grid2, Object.assign({
5195
5226
  container: true,
5196
- justifyContent: "flex-start"
5227
+ justifyContent: "flex-start",
5228
+ size: 8
5197
5229
  }, {
5198
- children: [jsx(Grid, Object.assign({
5199
- item: true,
5200
- xs: 12,
5201
- sx: styles$2.surfaceVisibility
5230
+ children: [jsx(Grid2, Object.assign({
5231
+ sx: styles$2.surfaceVisibility,
5232
+ size: 12
5202
5233
  }, {
5203
5234
  children: jsx(ReactHookFormNumberField, {
5204
5235
  name: "visibilityValue",
@@ -5223,11 +5254,18 @@ const SurfaceVisibility = ({
5223
5254
  },
5224
5255
  size: "small",
5225
5256
  disabled: isDisabled,
5226
- isReadOnly: isReadOnly
5257
+ isReadOnly: isReadOnly,
5258
+ sx: {
5259
+ ' .MuiFormHelperText-root': {
5260
+ lineHeight: '1.33em'
5261
+ }
5262
+ }
5227
5263
  })
5228
- })), jsx(Grid, Object.assign({
5229
- item: true,
5230
- xs: 12
5264
+ })), jsx(Grid2, Object.assign({
5265
+ size: 12,
5266
+ sx: {
5267
+ marginTop: -2
5268
+ }
5231
5269
  }, {
5232
5270
  children: jsx(ReactHookFormSelect, Object.assign({
5233
5271
  name: "visibilityCause",
@@ -5294,26 +5332,22 @@ const SurfaceWind = ({
5294
5332
  const allowedWindUnitsForFir = getAllowedUnits(getFIRValue(), productConfig, 'surfacewind_unit', WindUnit);
5295
5333
  const windLabel = getFieldLabel(t('surface-wind-label'), isReadOnly, t('set'));
5296
5334
  const speedLabel = getFieldLabel(t('surface-wind-speed-label'), isReadOnly, t('set'));
5297
- return jsxs(Grid, Object.assign({
5298
- item: true,
5335
+ return jsxs(Grid2, Object.assign({
5299
5336
  container: true,
5300
5337
  spacing: 2
5301
5338
  }, {
5302
- children: [jsx(Grid, {
5303
- item: true,
5304
- xs: 4,
5339
+ children: [jsx(Grid2, {
5305
5340
  container: true,
5306
- justifyContent: "flex-end"
5307
- }), jsxs(Grid, Object.assign({
5308
- item: true,
5309
- xs: 8,
5341
+ justifyContent: "flex-end",
5342
+ size: 4
5343
+ }), jsxs(Grid2, Object.assign({
5310
5344
  container: true,
5311
- justifyContent: "flex-start"
5345
+ justifyContent: "flex-start",
5346
+ size: 8
5312
5347
  }, {
5313
- children: [jsx(Grid, Object.assign({
5314
- item: true,
5315
- xs: 12,
5316
- sx: styles$2.surfaceWind
5348
+ children: [jsx(Grid2, Object.assign({
5349
+ sx: styles$2.surfaceWind,
5350
+ size: 12
5317
5351
  }, {
5318
5352
  children: jsx(ReactHookFormNumberField, {
5319
5353
  name: "windDirection",
@@ -5338,14 +5372,16 @@ const SurfaceWind = ({
5338
5372
  isReadOnly: isReadOnly,
5339
5373
  "data-testid": "surfaceWind-windDirection"
5340
5374
  })
5341
- })), jsxs(Grid, Object.assign({
5342
- item: true,
5343
- xs: 12,
5344
- container: true
5375
+ })), jsxs(Grid2, Object.assign({
5376
+ container: true,
5377
+ size: 12,
5378
+ sx: {
5379
+ marginTop: -2
5380
+ },
5381
+ spacing: 0
5345
5382
  }, {
5346
- children: [jsx(Grid, Object.assign({
5347
- item: true,
5348
- xs: 5
5383
+ children: [jsx(Grid2, Object.assign({
5384
+ size: 5
5349
5385
  }, {
5350
5386
  children: jsx(ReactHookFormSelect, Object.assign({
5351
5387
  name: "windUnit",
@@ -5372,9 +5408,8 @@ const SurfaceWind = ({
5372
5408
  children: allowedWindUnitsForFir[key]
5373
5409
  }), key))
5374
5410
  }))
5375
- })), jsx(Grid, Object.assign({
5376
- item: true,
5377
- xs: 7
5411
+ })), jsx(Grid2, Object.assign({
5412
+ size: 7
5378
5413
  }, {
5379
5414
  children: jsx(ReactHookFormNumberField, {
5380
5415
  name: "windSpeed",
@@ -5465,17 +5500,15 @@ const CloudLevels = ({
5465
5500
  unregister('cloudLowerLevel');
5466
5501
  }
5467
5502
  }, [cloudLevelInfoMode, unregister]);
5468
- return jsxs(Grid, Object.assign({
5469
- item: true,
5503
+ return jsxs(Grid2, Object.assign({
5470
5504
  container: true,
5471
5505
  spacing: 2,
5472
5506
  sx: styles$2.containerItem
5473
5507
  }, {
5474
- children: [jsx(Grid, Object.assign({
5475
- item: true,
5476
- xs: 4,
5508
+ children: [jsx(Grid2, Object.assign({
5477
5509
  container: true,
5478
- justifyContent: "flex-end"
5510
+ justifyContent: "flex-end",
5511
+ size: 4
5479
5512
  }, {
5480
5513
  children: jsx(Typography, Object.assign({
5481
5514
  variant: "subtitle1",
@@ -5483,27 +5516,23 @@ const CloudLevels = ({
5483
5516
  }, {
5484
5517
  children: t('levels')
5485
5518
  }))
5486
- })), jsx(Grid, Object.assign({
5487
- item: true,
5488
- xs: 8,
5519
+ })), jsx(Grid2, Object.assign({
5489
5520
  container: true,
5490
- justifyContent: "flex-start"
5521
+ justifyContent: "flex-start",
5522
+ size: 8
5491
5523
  }, {
5492
- children: jsxs(Grid, Object.assign({
5493
- item: true,
5494
- xs: 12
5524
+ children: jsxs(Grid2, Object.assign({
5525
+ size: 12
5495
5526
  }, {
5496
5527
  children: [jsx(ReactHookFormHiddenInput, {
5497
5528
  name: "cloudLevelInfoMode",
5498
5529
  defaultValue: "BETW"
5499
- }), jsxs(Grid, Object.assign({
5500
- item: true,
5501
- xs: 12,
5502
- container: true
5530
+ }), jsxs(Grid2, Object.assign({
5531
+ container: true,
5532
+ size: 12
5503
5533
  }, {
5504
- children: [jsx(Grid, Object.assign({
5505
- item: true,
5506
- xs: 4
5534
+ children: [jsx(Grid2, Object.assign({
5535
+ size: 4
5507
5536
  }, {
5508
5537
  children: (!isReadOnly || cloudLevelInfoMode === 'BETW_ABV' || cloudLevelInfoMode === 'BETW_SFC_ABV') && jsx(ReactHookFormFormControl, Object.assign({
5509
5538
  disabled: isDisabled,
@@ -5544,9 +5573,8 @@ const CloudLevels = ({
5544
5573
  label: "Above"
5545
5574
  })
5546
5575
  }))
5547
- })), jsx(Grid, Object.assign({
5548
- item: true,
5549
- xs: 3
5576
+ })), jsx(Grid2, Object.assign({
5577
+ size: 3
5550
5578
  }, {
5551
5579
  children: jsx(ReactHookFormSelect, Object.assign({
5552
5580
  name: "cloudLevel.unit",
@@ -5575,9 +5603,8 @@ const CloudLevels = ({
5575
5603
  children: allowedCloudLevelUnitsForFir[key]
5576
5604
  }), key))
5577
5605
  }))
5578
- })), jsx(Grid, Object.assign({
5579
- item: true,
5580
- xs: 5
5606
+ })), jsx(Grid2, Object.assign({
5607
+ size: 5
5581
5608
  }, {
5582
5609
  children: jsx(ReactHookFormNumberField, {
5583
5610
  name: "cloudLevel.value",
@@ -5605,14 +5632,12 @@ const CloudLevels = ({
5605
5632
  }
5606
5633
  })
5607
5634
  }))]
5608
- })), jsxs(Grid, Object.assign({
5609
- item: true,
5610
- xs: 12,
5611
- container: true
5635
+ })), jsxs(Grid2, Object.assign({
5636
+ container: true,
5637
+ size: 12
5612
5638
  }, {
5613
- children: [jsx(Grid, Object.assign({
5614
- item: true,
5615
- xs: 4
5639
+ children: [jsx(Grid2, Object.assign({
5640
+ size: 4
5616
5641
  }, {
5617
5642
  children: (!isReadOnly || cloudLevelInfoMode === 'BETW_SFC' || cloudLevelInfoMode === 'BETW_SFC_ABV') && jsx(ReactHookFormFormControl, Object.assign({
5618
5643
  disabled: isDisabled,
@@ -5654,9 +5679,8 @@ const CloudLevels = ({
5654
5679
  })
5655
5680
  }))
5656
5681
  })), cloudLevelInfoMode !== 'BETW_SFC' && cloudLevelInfoMode !== 'BETW_SFC_ABV' && jsxs(Fragment, {
5657
- children: [jsx(Grid, Object.assign({
5658
- item: true,
5659
- xs: 3
5682
+ children: [jsx(Grid2, Object.assign({
5683
+ size: 3
5660
5684
  }, {
5661
5685
  children: jsx(ReactHookFormSelect, Object.assign({
5662
5686
  name: "cloudLowerLevel.unit",
@@ -5685,9 +5709,8 @@ const CloudLevels = ({
5685
5709
  children: allowedCloudLevelUnitsForFir[key]
5686
5710
  }), key))
5687
5711
  }))
5688
- })), jsx(Grid, Object.assign({
5689
- item: true,
5690
- xs: 5
5712
+ })), jsx(Grid2, Object.assign({
5713
+ size: 5
5691
5714
  }, {
5692
5715
  children: jsx(ReactHookFormNumberField, {
5693
5716
  name: "cloudLowerLevel.value",
@@ -5870,7 +5893,6 @@ const ProductFormTAC = ({
5870
5893
  variant: "body2",
5871
5894
  component: "div",
5872
5895
  sx: {
5873
- paddingTop: '16px',
5874
5896
  whiteSpace: 'break-spaces'
5875
5897
  },
5876
5898
  "data-testid": "productform-tac-message"
@@ -5882,7 +5904,8 @@ const ProductFormTAC = ({
5882
5904
  fontSize: '1.125rem',
5883
5905
  fontWeight: 'normal',
5884
5906
  lineHeight: 1.56,
5885
- letterSpacing: '0.5px'
5907
+ letterSpacing: '0.5px',
5908
+ marginTop: '2px'
5886
5909
  },
5887
5910
  "data-testid": "productform-tac-message-line"
5888
5911
  }, {
@@ -5904,27 +5927,19 @@ const IssuedAt = ({
5904
5927
  t
5905
5928
  } = useSigmetAirmetTranslation();
5906
5929
  return jsx(ProductFormFieldLayout, Object.assign({
5930
+ title: t('issued-at'),
5907
5931
  sx: {
5908
- paddingTop: 0,
5909
- '+ .MuiGrid-item': {
5910
- paddingTop: 0
5911
- }
5912
- },
5913
- title: t('issued-at')
5932
+ marginTop: -2
5933
+ }
5914
5934
  }, {
5915
- children: jsx(Grid, Object.assign({
5916
- item: true,
5917
- xs: 12
5935
+ children: jsx(Typography, Object.assign({
5936
+ variant: "body2",
5937
+ sx: Object.assign(Object.assign({}, styles$2.body), {
5938
+ fontSize: '1rem',
5939
+ color: isReadOnly ? 'geowebColors.typographyAndIcons.text' : 'geowebColors.buttons.primary.disabled.color'
5940
+ })
5918
5941
  }, {
5919
- children: jsx(Typography, Object.assign({
5920
- variant: "body2",
5921
- sx: Object.assign(Object.assign({}, styles$2.body), {
5922
- fontSize: '1rem',
5923
- color: isReadOnly ? 'geowebColors.typographyAndIcons.text' : 'geowebColors.buttons.primary.disabled.color'
5924
- })
5925
- }, {
5926
- children: date
5927
- }))
5942
+ children: date
5928
5943
  }))
5929
5944
  }));
5930
5945
  };
@@ -5934,21 +5949,19 @@ const Tac = ({
5934
5949
  children,
5935
5950
  product
5936
5951
  }) => {
5937
- return jsx(ProductFormFieldLayout, Object.assign({
5952
+ return jsxs(ProductFormFieldLayout, Object.assign({
5938
5953
  title: "TAC",
5939
5954
  sx: {
5940
- paddingTop: 2
5955
+ marginTop: -3,
5956
+ '.MuiTypography-root.MuiTypography-subtitle1': {
5957
+ marginTop: '2px'
5958
+ }
5941
5959
  }
5942
5960
  }, {
5943
- children: jsxs(Grid, Object.assign({
5944
- item: true,
5945
- xs: 12
5946
- }, {
5947
- children: [jsx(ProductFormTAC, {
5948
- tac: tac,
5949
- product: product
5950
- }), children]
5951
- }))
5961
+ children: [jsx(ProductFormTAC, {
5962
+ tac: tac,
5963
+ product: product
5964
+ }), children]
5952
5965
  }));
5953
5966
  };
5954
5967
 
@@ -6074,7 +6087,7 @@ const ProductFormLayout = ({
6074
6087
  const theme = useTheme();
6075
6088
  const baseLayers = getBaseLayers(productConfig);
6076
6089
  const projection = getProjection(productConfig);
6077
- return jsxs(Grid, Object.assign({
6090
+ return jsxs(Grid2, Object.assign({
6078
6091
  container: true,
6079
6092
  sx: {
6080
6093
  height: '100%',
@@ -6084,11 +6097,7 @@ const ProductFormLayout = ({
6084
6097
  }
6085
6098
  }
6086
6099
  }, {
6087
- children: [jsx(Grid, Object.assign({
6088
- item: true,
6089
- xs: 12,
6090
- sm: 6,
6091
- lg: 8,
6100
+ children: [jsx(Grid2, Object.assign({
6092
6101
  sx: {
6093
6102
  height: 400,
6094
6103
  padding: 2,
@@ -6096,6 +6105,11 @@ const ProductFormLayout = ({
6096
6105
  height: '100%',
6097
6106
  padding: 0
6098
6107
  }
6108
+ },
6109
+ size: {
6110
+ xs: 12,
6111
+ sm: 6,
6112
+ lg: 8
6099
6113
  }
6100
6114
  }, {
6101
6115
  children: jsx(MapViewGeoJson, {
@@ -6103,11 +6117,7 @@ const ProductFormLayout = ({
6103
6117
  projection: projection,
6104
6118
  geoJSONLayers: _geoJSONLayers
6105
6119
  })
6106
- })), jsx(Grid, Object.assign({
6107
- item: true,
6108
- xs: 12,
6109
- sm: 6,
6110
- lg: 4,
6120
+ })), jsx(Grid2, Object.assign({
6111
6121
  sx: {
6112
6122
  paddingTop: 5,
6113
6123
  paddingBottom: 5,
@@ -6116,6 +6126,11 @@ const ProductFormLayout = ({
6116
6126
  overflowY: 'auto',
6117
6127
  height: '100%'
6118
6128
  }
6129
+ },
6130
+ size: {
6131
+ xs: 12,
6132
+ sm: 6,
6133
+ lg: 4
6119
6134
  }
6120
6135
  }, {
6121
6136
  children: children
@@ -10588,26 +10603,11 @@ const SigmetForm = ({
10588
10603
  // update available phenomena for the FIR
10589
10604
  setPhenomenaList(newPhenomenaList);
10590
10605
  };
10591
- const renderForm = () => jsxs(Grid, Object.assign({
10606
+ const renderForm = () => jsxs(Grid2, Object.assign({
10592
10607
  container: true,
10593
10608
  direction: "column",
10594
10609
  spacing: 2,
10595
- sx: {
10596
- '.MuiSelect-select.MuiInputBase-input.MuiFilledInput-input': {
10597
- paddingTop: '17px',
10598
- paddingBottom: '0px'
10599
- },
10600
- '.MuiInputBase-input.MuiFilledInput-input': {
10601
- paddingTop: '15px',
10602
- paddingBottom: '2px'
10603
- },
10604
- '+ .MuiGrid-item': {
10605
- paddingTop: '16px'
10606
- },
10607
- '.MuiFormHelperText-root': {
10608
- lineHeight: '1.33em'
10609
- }
10610
- }
10610
+ sx: formStyles
10611
10611
  }, {
10612
10612
  children: [jsx(Type, {
10613
10613
  productType: "sigmet",
@@ -10677,19 +10677,16 @@ const SigmetForm = ({
10677
10677
  isDisabled: isDisabled,
10678
10678
  isReadOnly: isReadOnly
10679
10679
  }), _isCancelSigmet && watch('vaSigmetMoveToFIR') && jsx(ProductFormFieldLayout, {
10680
- children: jsx(Grid, Object.assign({
10681
- item: true,
10682
- xs: 12
10680
+ children: jsxs(Typography, Object.assign({
10681
+ variant: "body2",
10682
+ sx: Object.assign(Object.assign({}, styles$2.body), {
10683
+ marginBottom: '-4px'
10684
+ }),
10685
+ "data-testid": "vaSigmetMoveToFIR"
10683
10686
  }, {
10684
- children: jsxs(Typography, Object.assign({
10685
- variant: "body2",
10686
- sx: styles$2.body,
10687
- "data-testid": "vaSigmetMoveToFIR"
10688
- }, {
10689
- children: [t('vulcanic-cloud-moving-text'), ":", ' ', jsxs("b", {
10690
- children: [" ", watch('vaSigmetMoveToFIR')]
10691
- })]
10692
- }))
10687
+ children: [t('vulcanic-cloud-moving-text'), ":", ' ', jsxs("b", {
10688
+ children: [" ", watch('vaSigmetMoveToFIR')]
10689
+ })]
10693
10690
  }))
10694
10691
  }), jsx(IssuedAt, {
10695
10692
  date: getProductIssueDate(_initialSigmet, _initialCancelSigmet),
@@ -10880,26 +10877,11 @@ const AirmetForm = ({
10880
10877
  const fieldnames = ['windDirection', 'windSpeed', 'visibilityValue', 'cloudLevel.value', 'cloudLowerLevel.value'];
10881
10878
  triggerValidations(fieldnames, getValues, trigger);
10882
10879
  };
10883
- const renderForm = () => jsxs(Grid, Object.assign({
10880
+ const renderForm = () => jsxs(Grid2, Object.assign({
10884
10881
  container: true,
10885
10882
  direction: "column",
10886
10883
  spacing: 2,
10887
- sx: {
10888
- '.MuiSelect-select.MuiInputBase-input.MuiFilledInput-input': {
10889
- paddingTop: '17px',
10890
- paddingBottom: '0px'
10891
- },
10892
- '.MuiInputBase-input.MuiFilledInput-input': {
10893
- paddingTop: '15px',
10894
- paddingBottom: '2px'
10895
- },
10896
- '+ .MuiGrid-item': {
10897
- paddingTop: '16px'
10898
- },
10899
- '.MuiFormHelperText-root': {
10900
- lineHeight: '1.33em'
10901
- }
10902
- }
10884
+ sx: formStyles
10903
10885
  }, {
10904
10886
  children: [jsx(Type, {
10905
10887
  productType: "airmet",
@@ -11071,13 +11053,13 @@ const ContentDialog = _a => {
11071
11053
  },
11072
11054
  component: "div"
11073
11055
  }, {
11074
- children: jsxs(Grid, Object.assign({
11056
+ children: jsxs(Grid2, Object.assign({
11075
11057
  container: true,
11076
- alignItems: "center"
11058
+ alignItems: "center",
11059
+ size: "grow"
11077
11060
  }, {
11078
- children: [jsx(Grid, Object.assign({
11079
- item: true,
11080
- xs: 4
11061
+ children: [jsx(Grid2, Object.assign({
11062
+ size: 4
11081
11063
  }, {
11082
11064
  children: jsx(Button, Object.assign({
11083
11065
  onClick: handleClose,
@@ -11098,14 +11080,13 @@ const ContentDialog = _a => {
11098
11080
  }, {
11099
11081
  children: t('back')
11100
11082
  }))
11101
- })), jsx(Grid, Object.assign({
11102
- item: true,
11103
- xs: 4,
11083
+ })), jsx(Grid2, Object.assign({
11104
11084
  sx: {
11105
11085
  display: 'flex',
11106
11086
  justifyContent: 'center',
11107
11087
  textAlign: 'center'
11108
- }
11088
+ },
11089
+ size: 4
11109
11090
  }, {
11110
11091
  children: jsx(Typography, Object.assign({
11111
11092
  "data-testid": "dialogTitle",
@@ -11119,9 +11100,8 @@ const ContentDialog = _a => {
11119
11100
  }, {
11120
11101
  children: title
11121
11102
  }))
11122
- })), jsx(Grid, Object.assign({
11123
- item: true,
11124
- xs: 4
11103
+ })), jsx(Grid2, Object.assign({
11104
+ size: 4
11125
11105
  }, {
11126
11106
  children: options
11127
11107
  }))]
@@ -11243,13 +11223,15 @@ const listRowStyles = {
11243
11223
  },
11244
11224
  '.col-3': {
11245
11225
  width: '100%',
11246
- flexBasis: '100%'
11226
+ flexBasis: '100%',
11227
+ paddingTop: 2
11247
11228
  },
11248
11229
  '.col-4': {
11249
11230
  width: '100%',
11250
11231
  flexBasis: '100%',
11251
11232
  justifyContent: 'center',
11252
- alignItems: 'center'
11233
+ alignItems: 'center',
11234
+ paddingTop: 2
11253
11235
  },
11254
11236
  '@container productList (width > 720px)': {
11255
11237
  '.productListContainer': {
@@ -11269,13 +11251,15 @@ const listRowStyles = {
11269
11251
  },
11270
11252
  '.col-3': {
11271
11253
  width: '40%',
11272
- flexBasis: '40%'
11254
+ flexBasis: '40%',
11255
+ paddingTop: 0
11273
11256
  },
11274
11257
  '.col-4': {
11275
11258
  justifyContent: 'right',
11276
11259
  alignItems: 'center',
11277
11260
  width: '25%',
11278
11261
  flexBasis: '25%',
11262
+ paddingTop: 0,
11279
11263
  button: {
11280
11264
  marginRight: 3
11281
11265
  },
@@ -11356,15 +11340,14 @@ const ProductListRow = ({
11356
11340
  children: jsx(Box, Object.assign({
11357
11341
  className: "productListContainer"
11358
11342
  }, {
11359
- children: jsxs(Grid, Object.assign({
11343
+ children: jsxs(Grid2, Object.assign({
11360
11344
  container: true,
11361
11345
  alignItems: "center",
11362
- spacing: 2,
11346
+ spacing: 0,
11363
11347
  className: "rowContainer"
11364
11348
  }, {
11365
- children: [jsxs(Grid, Object.assign({
11366
- className: "col-1",
11367
- item: true
11349
+ children: [jsxs(Grid2, Object.assign({
11350
+ className: "col-1"
11368
11351
  }, {
11369
11352
  children: [phenomenon !== null && jsx(ProductListRowHeader, {
11370
11353
  title: productType.toUpperCase()
@@ -11380,9 +11363,8 @@ const ProductListRow = ({
11380
11363
  children: phenomenon !== null ? getLabel(product) : 'Cancel'
11381
11364
  }))
11382
11365
  }))]
11383
- })), jsxs(Grid, Object.assign({
11384
- className: "col-2",
11385
- item: true
11366
+ })), jsxs(Grid2, Object.assign({
11367
+ className: "col-2"
11386
11368
  }, {
11387
11369
  children: [jsx(ProductListRowHeader, {
11388
11370
  title: t('issue-time')
@@ -11408,7 +11390,7 @@ const ProductListRow = ({
11408
11390
  }))]
11409
11391
  }),
11410
11392
  placement: "bottom-start",
11411
- componentsProps: {
11393
+ slotProps: {
11412
11394
  tooltip: {
11413
11395
  sx: {
11414
11396
  bgcolor: 'geowebColors.background.surface',
@@ -11429,9 +11411,8 @@ const ProductListRow = ({
11429
11411
  children: product.issueDate ? `${dateUtils.dateToString(dateUtils.utc(product.issueDate), dateUtils.DATE_FORMAT_NAME_OF_MONTH)} UTC` : t('not-published')
11430
11412
  }))
11431
11413
  }))]
11432
- })), jsxs(Grid, Object.assign({
11433
- className: "col-3",
11434
- item: true
11414
+ })), jsxs(Grid2, Object.assign({
11415
+ className: "col-3"
11435
11416
  }, {
11436
11417
  children: [jsx(ProductListRowHeader, {
11437
11418
  title: t('valid-time')
@@ -11442,8 +11423,7 @@ const ProductListRow = ({
11442
11423
  }, {
11443
11424
  children: validTime
11444
11425
  }))]
11445
- })), jsxs(Grid, Object.assign({
11446
- item: true,
11426
+ })), jsxs(Grid2, Object.assign({
11447
11427
  className: "col-4",
11448
11428
  container: true
11449
11429
  }, {
@@ -11475,14 +11455,13 @@ const ProductList = ({
11475
11455
  t
11476
11456
  } = useSigmetAirmetTranslation();
11477
11457
  const shouldHideCreateNew = error && (error.name === t('error-auth') || error.name === t('error-config'));
11478
- return jsxs(Grid, Object.assign({
11458
+ return jsxs(Grid2, Object.assign({
11479
11459
  container: true,
11480
11460
  direction: "column",
11481
11461
  alignItems: "stretch"
11482
11462
  }, {
11483
- children: [jsx(Grid, Object.assign({
11463
+ children: [jsx(Grid2, Object.assign({
11484
11464
  container: true,
11485
- item: true,
11486
11465
  justifyContent: "flex-end"
11487
11466
  }, {
11488
11467
  children: !shouldHideCreateNew && jsx(Button, Object.assign({
@@ -11497,8 +11476,7 @@ const ProductList = ({
11497
11476
  product: productType.toUpperCase()
11498
11477
  })
11499
11478
  }))
11500
- })), jsxs(Grid, Object.assign({
11501
- item: true,
11479
+ })), jsxs(Grid2, Object.assign({
11502
11480
  sx: {
11503
11481
  width: '100%',
11504
11482
  minHeight: '600px',
@@ -14659,6 +14637,11 @@ const fakeSigmetList = [{
14659
14637
  sequence: 'A02V',
14660
14638
  issueDate: '2020-09-17T12:00:00Z',
14661
14639
  observationOrForecastTime: null,
14640
+ vaSigmetVolcanoName: 'EYJAFJALLAJOKULL',
14641
+ vaSigmetVolcanoCoordinates: {
14642
+ latitude: 63.62,
14643
+ longitude: -19.61
14644
+ },
14662
14645
  validDateStart: '2020-09-17T13:00:00Z',
14663
14646
  validDateEnd: '2020-09-17T17:00:00Z',
14664
14647
  firName: 'AMSTERDAM FIR',