@opengeoweb/warnings 9.25.3 → 9.27.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,26 +1,26 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import { useDispatch, useSelector } from 'react-redux';
3
- import { Polygons, Share, ExitDomain, Edit, Delete, DrawPolygon, Visibility, Add, Wind, Fog, Lightning, Snow, Rain, TemperatureHigh, TemperatureLow, CoastalEvent, breakpoints, Close, Options, Copy, Success, Expire, Remove } from '@opengeoweb/theme';
3
+ import { Polygons, Share, ExitDomain, Edit, Delete, CoastalEvent, TemperatureLow, TemperatureHigh, Rain, Snow, Lightning, Fog, Wind, Thunderstorm, VulcanicEruption, Haze, FreezingPrecipitation, ModerateAircraftIcing, SevereAircraftIcing, ModerateTurbulence, SevereTurbulence, SandStorm, RadioactiveMaterials, DrawPolygon, Visibility, Add, breakpoints, Close, Options, Copy, Success, Expire, Remove } from '@opengeoweb/theme';
4
4
  import { uiTypes, uiActions, getSingularDrawtoolDrawLayerId, drawtoolSelectors, layerSelectors, uiSelectors, mapStoreActions, drawtoolActions, layerActions, useSetupDialog } from '@opengeoweb/store';
5
5
  import { defaultPolygon, emptyGeoJSON, MapControlButton, getIcon, rewindGeometry, getGeoJSONPropertyValue, currentlySupportedDrawModes, MapView, MapViewLayer, defaultLayers, getFeatureExtent } from '@opengeoweb/webmap-react';
6
- import { SHARED_NAMESPACE, useConfirmationDialog, ToggleMenu, dateUtils, calculateStartSize, ToolContainerDraggable, AlertBanner, ConfirmationDialog, getAxiosErrorMessage, usePrevious, CustomIconButton, CustomTooltip, Avatar, getInitials, SwitchButton, CustomToggleButton, Filter, getPosition, FilterChip, FilterListItem, LastUpdateTime, StatusTag, ErrorBoundary, pollingIntervalTimeout, isAxiosError as isAxiosError$1 } from '@opengeoweb/shared';
6
+ import { SHARED_NAMESPACE, useConfirmationDialog, ToggleMenu, dateUtils, calculateStartSize, ToolContainerDraggable, AlertBanner, ConfirmationDialog, getAxiosErrorMessage, usePrevious, CustomIconButton, CustomTooltip, Avatar, getInitials, SwitchButton, CustomToggleButton, Filter, getPosition, FilterChip, FilterListItem, FilterLabel, StatusTag, LastUpdateTime, ErrorBoundary, pollingIntervalTimeout, isAxiosError as isAxiosError$1 } from '@opengeoweb/shared';
7
7
  import { createEntityAdapter, createSlice, createSelector, createListenerMiddleware, isAnyOf } from '@reduxjs/toolkit';
8
8
  import i18n from 'i18next';
9
9
  import { useTranslation } from 'react-i18next';
10
10
  import '@opengeoweb/core';
11
- import { FORM_FIELDS_NAMESPACE, ReactHookFormHiddenInput, isValidGeoJsonCoordinates, ReactHookFormSelect, ReactHookFormTextField, ReactHookFormProvider, defaultFormOptions, useDraftFormHelpers, errorMessages, ReactHookFormDateTime, isXHoursBefore, isXHoursAfter, isEmpty } from '@opengeoweb/form-fields';
11
+ import { FORM_FIELDS_NAMESPACE, useDraftFormHelpers, ReactHookFormSelect, ReactHookFormHiddenInput, isValidGeoJsonCoordinates, ReactHookFormTextField, ReactHookFormProvider, defaultFormOptions, errorMessages, ReactHookFormDateTime, isXHoursBefore, isXHoursAfter, isEmpty } from '@opengeoweb/form-fields';
12
+ import { generateMapId, LayerType, getWMJSMapById, getGeoCoordFromLatLong, WMBBOX } from '@opengeoweb/webmap';
12
13
  import { snackbarActions } from '@opengeoweb/snackbar';
13
14
  import * as React from 'react';
14
15
  import React__default, { useState, useEffect, useRef } from 'react';
15
- import { styled, Box, Typography, ListItem, Grid, Paper, ListItemButton, Stack, LinearProgress, Button, FormHelperText, MenuItem, Tabs, Tab, Card, CardContent, ListItemIcon, CircularProgress, Menu, DialogTitle, DialogContent, Switch, List } from '@mui/material';
16
+ import { styled, Box, Typography, ListItem, Grid, Paper, ListItemButton, Stack, LinearProgress, Button, MenuItem, ListItemIcon, FormHelperText, Tabs, Tab, Card, CardContent, CircularProgress, Menu, DialogTitle, DialogContent, Switch } from '@mui/material';
16
17
  import { VariableSizeList } from 'react-window';
17
18
  import AutoSizer from 'react-virtualized-auto-sizer';
18
- import { getApi, createApiInstance, createNonAuthApiInstance, createFakeApiInstance, ApiProvider } from '@opengeoweb/api';
19
+ import { getApi, createApiInstance, createNonAuthApiInstance, createFakeApiInstance, ApiProvider, ProductStatus, useAirmetList, useSigmetList } from '@opengeoweb/api';
19
20
  import { useFormContext } from 'react-hook-form';
20
21
  import { isEqual, cloneDeep, clamp } from 'lodash';
21
22
  import { useAuthenticationContext } from '@opengeoweb/authentication';
22
23
  import { produce } from 'immer';
23
- import { generateMapId, LayerType, getWMJSMapById, getGeoCoordFromLatLong, WMBBOX } from '@opengeoweb/webmap';
24
24
  import { isAxiosError } from 'axios';
25
25
 
26
26
  var en = {
@@ -143,7 +143,44 @@ var en = {
143
143
  "filter-phenomenon": "Phenomena",
144
144
  "filter-level": "Levels",
145
145
  "filter-source": "Sources",
146
- "error-title-retry": "Try again"
146
+ "filter-hide": "Hide {{subject}}",
147
+ "filter-show": "Show {{subject}}",
148
+ airmet: "Airmet",
149
+ sigmet: "Sigmet",
150
+ "error-title-retry": "Try again",
151
+ "aviation-phenomenon-radioactive-cloud": "Radioactive cloud",
152
+ "aviation-phenomenon-heavy-sandstorm": "Heavy sandstorm",
153
+ "aviation-phenomenon-severe-turbulence": "Severe turbulence",
154
+ "aviation-phenomenon-moderate-turbulence": "Moderate turbulence",
155
+ "aviation-phenomenon-severe-ice": "Severe icing",
156
+ "aviation-phenomenon-moderate-ice": "Moderate icing",
157
+ "aviation-phenomenon-severe-ice-freezing-rain": "Severe icing due to freezing rain",
158
+ "aviation-phenomenon-heavy-dust-storm": "Heavy duststorm",
159
+ "aviation-phenomenon-volcanic-cloud": "Volcanic ash cloud",
160
+ "aviation-phenomenon-embedded-thunderstorm": "Embedded thunderstorm(s)",
161
+ "aviation-phenomenon-embedded-thunderstorm-with-hail": "Emb. thunderstorm(s) with hail",
162
+ "aviation-phenomenon-frequent-thunderstorm": "Frequent thunderstorm(s)",
163
+ "aviation-phenomenon-frequent-thunderstorm-with-hail": "Freq. thunderstorm(s) with hail",
164
+ "aviation-phenomenon-obscured-thunderstorm": "Obscured thunderstorm(s)",
165
+ "aviation-phenomenon-obscured-thunderstorm-with-hail": "Obsc. thunderstorm(s) with hail",
166
+ "aviation-phenomenon-squall-thunderstorm-with-hail": "Squall thunderstorm(s) with hail",
167
+ "aviation-phenomenon-isolated-thunderstorm": "Isolated thunderstorm(s)",
168
+ "aviation-phenomenon-isolated-thunderstorm-with-hail": "Isol. thunderstorm(s) with hail",
169
+ "aviation-phenomenon-occasional-thunderstorm": "Occasional thunderstorm(s)",
170
+ "aviation-phenomenon-occasional-thunderstorm-with-hail": "Ocn. thunderstorm(s) with hail",
171
+ "aviation-phenomenon-severe-mountain-waves": "Severe mountain waves",
172
+ "aviation-phenomenon-surface-visibility": "Surface visibility",
173
+ "aviation-phenomenon-surface-wind": "Surface wind",
174
+ "aviation-phenomenon-overcast-cloud": "Overcast cloud",
175
+ "aviation-phenomenon-broken-cloud": "Broken cloud",
176
+ "aviation-phenomenon-isolated-cumulonimbus-cloud": "Isolated cumulonimbus cloud",
177
+ "aviation-phenomenon-occasional-cumulonimbus-cloud": "Occasional cumulonimbus cloud",
178
+ "aviation-phenomenon-frequent-cumulonimbus-cloud": "Frequent cumulonimbus cloud",
179
+ "aviation-phenomenon-isolated-towering-cumulus-cloud": "Isolated towering cumulus cloud",
180
+ "aviation-phenomenon-occasional-towering-cumulus-cloud": "Occasional towering cumulus cloud",
181
+ "aviation-phenomenon-frequent-towering-cumulus-cloud": "Frequent towering cumulus cloud",
182
+ "aviation-phenomenon-moderate-mountain-wave": "Moderate mountain wave",
183
+ "aviation-phenomenon-mountains-obscured": "Mountains obscured"
147
184
  };
148
185
  var nl = {
149
186
  "drawing-tool-form-tools": "Gereedschap",
@@ -501,14 +538,14 @@ var no = {
501
538
  "filter-select-all": "Velg alle",
502
539
  "filter-no-results": "Ingen resultat",
503
540
  "filter-all": "Alle",
504
- "filter-options": "ikke oversatt",
505
- "filter-show-all": "ikke oversatt",
506
- "filter-hide-all": "ikke oversatt",
507
- "filter-incident": "ikke oversatt",
508
- "filter-domain": "ikke oversatt",
509
- "filter-phenomenon": "ikke oversatt",
510
- "filter-level": "ikke oversatt",
511
- "filter-source": "ikke oversatt",
541
+ "filter-options": "Filtervalg",
542
+ "filter-show-all": "Vis alle",
543
+ "filter-hide-all": "Skjel alle",
544
+ "filter-incident": "Hendelse",
545
+ "filter-domain": "Domene",
546
+ "filter-phenomenon": "Fenomen",
547
+ "filter-level": "Grad",
548
+ "filter-source": "Kilder",
512
549
  "error-title-retry": "Prøv igjen"
513
550
  };
514
551
  var warningsTranslations = {
@@ -3683,28 +3720,399 @@ $$c({ target: 'Array', proto: true, forced: FORCED$2 }, {
3683
3720
  }
3684
3721
  });
3685
3722
 
3686
- /* *
3687
- * Licensed under the Apache License, Version 2.0 (the "License");
3688
- * you may not use this file except in compliance with the License.
3689
- * You may obtain a copy of the License at
3690
- *
3691
- * http://www.apache.org/licenses/LICENSE-2.0
3692
- *
3693
- * Unless required by applicable law or agreed to in writing, software
3694
- * distributed under the License is distributed on an "AS IS" BASIS,
3695
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3696
- * See the License for the specific language governing permissions and
3697
- * limitations under the License.
3698
- *
3699
- * Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
3700
- * Copyright 2024 - Finnish Meteorological Institute (FMI)
3701
- * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
3702
- * */
3723
+ const getWarningPhenomenaIcon = key => {
3724
+ switch (key) {
3725
+ case 'wind':
3726
+ return jsx(Wind, {});
3727
+ case 'fog':
3728
+ return jsx(Fog, {});
3729
+ case 'thunderstorm':
3730
+ return jsx(Lightning, {});
3731
+ case 'snowIce':
3732
+ return jsx(Snow, {});
3733
+ case 'rain':
3734
+ return jsx(Rain, {});
3735
+ case 'highTemp':
3736
+ return jsx(TemperatureHigh, {});
3737
+ case 'lowTemp':
3738
+ return jsx(TemperatureLow, {});
3739
+ case 'coastalEvent':
3740
+ return jsx(CoastalEvent, {});
3741
+ default:
3742
+ return undefined;
3743
+ }
3744
+ };
3745
+ const getAviationPhenomenaIcon = key => {
3746
+ switch (key) {
3747
+ case 'RDOACT_CLD':
3748
+ return jsx(RadioactiveMaterials, {});
3749
+ case 'HVY_SS':
3750
+ return jsx(SandStorm, {});
3751
+ case 'SEV_TURB':
3752
+ return jsx(SevereTurbulence, {});
3753
+ case 'MOD_TURB':
3754
+ return jsx(ModerateTurbulence, {});
3755
+ case 'SEV_ICE':
3756
+ return jsx(SevereAircraftIcing, {});
3757
+ case 'MOD_ICE':
3758
+ return jsx(ModerateAircraftIcing, {});
3759
+ case 'SEV_ICE_FRZ_RN':
3760
+ return jsx(FreezingPrecipitation, {});
3761
+ case 'HVY_DS':
3762
+ return jsx(Haze, {});
3763
+ case 'VA_CLD':
3764
+ return jsx(VulcanicEruption, {});
3765
+ case 'EMBD_TS':
3766
+ case 'EMBD_TSGR':
3767
+ case 'FRQ_TS':
3768
+ case 'FRQ_TSGR':
3769
+ case 'OBSC_TS':
3770
+ case 'OBSC_TSGR':
3771
+ case 'SQL_TSGR':
3772
+ case 'ISOL_TS':
3773
+ case 'ISOL_TSGR':
3774
+ case 'OCNL_TS':
3775
+ case 'OCNL_TSGR':
3776
+ return jsx(Thunderstorm, {});
3777
+ default:
3778
+ return undefined;
3779
+ }
3780
+ };
3781
+ const warningPhenomena = [{
3782
+ translationKey: 'warning-phenomenon-wind',
3783
+ key: 'wind',
3784
+ isAviation: false
3785
+ }, {
3786
+ translationKey: 'warning-phenomenon-fog',
3787
+ key: 'fog',
3788
+ isAviation: false
3789
+ }, {
3790
+ translationKey: 'warning-phenomenon-thunderstorm',
3791
+ key: 'thunderstorm',
3792
+ isAviation: false
3793
+ }, {
3794
+ translationKey: 'warning-phenomenon-snow-ice',
3795
+ key: 'snowIce',
3796
+ isAviation: false
3797
+ }, {
3798
+ translationKey: 'warning-phenomenon-rain',
3799
+ key: 'rain',
3800
+ isAviation: false
3801
+ }, {
3802
+ translationKey: 'warning-phenomenon-high-temp',
3803
+ key: 'highTemp',
3804
+ isAviation: false
3805
+ },
3806
+ // {
3807
+ // title: 'warning-phenomenon-funnel-cloud',
3808
+ // key: 'funnelCloud',
3809
+ // },
3810
+ {
3811
+ translationKey: 'warning-phenomenon-low-temp',
3812
+ key: 'lowTemp',
3813
+ isAviation: false
3814
+ }, {
3815
+ translationKey: 'warning-phenomenon-coastal-event',
3816
+ key: 'coastalEvent',
3817
+ isAviation: false
3818
+ }, {
3819
+ translationKey: 'aviation-phenomenon-radioactive-cloud',
3820
+ key: 'RDOACT_CLD',
3821
+ isAviation: true
3822
+ }, {
3823
+ translationKey: 'aviation-phenomenon-heavy-sandstorm',
3824
+ key: 'HVY_SS',
3825
+ isAviation: true
3826
+ }, {
3827
+ translationKey: 'aviation-phenomenon-severe-turbulence',
3828
+ key: 'SEV_TURB',
3829
+ isAviation: true
3830
+ }, {
3831
+ translationKey: 'aviation-phenomenon-moderate-turbulence',
3832
+ key: 'MOD_TURB',
3833
+ isAviation: true
3834
+ }, {
3835
+ translationKey: 'aviation-phenomenon-severe-ice',
3836
+ key: 'SEV_ICE',
3837
+ isAviation: true
3838
+ }, {
3839
+ translationKey: 'aviation-phenomenon-moderate-ice',
3840
+ key: 'MOD_ICE',
3841
+ isAviation: true
3842
+ }, {
3843
+ translationKey: 'aviation-phenomenon-severe-ice-freezing-rain',
3844
+ key: 'SEV_ICE_FRZ_RN',
3845
+ isAviation: true
3846
+ }, {
3847
+ translationKey: 'aviation-phenomenon-heavy-dust-storm',
3848
+ key: 'HVY_DS',
3849
+ isAviation: true
3850
+ }, {
3851
+ translationKey: 'aviation-phenomenon-volcanic-cloud',
3852
+ key: 'VA_CLD',
3853
+ isAviation: true
3854
+ }, {
3855
+ translationKey: 'aviation-phenomenon-embedded-thunderstorm',
3856
+ key: 'EMBD_TS',
3857
+ isAviation: true
3858
+ }, {
3859
+ translationKey: 'aviation-phenomenon-embedded-thunderstorm-with-hail',
3860
+ key: 'EMBD_TSGR',
3861
+ isAviation: true
3862
+ }, {
3863
+ translationKey: 'aviation-phenomenon-obscured-thunderstorm-with-hail',
3864
+ key: 'OBSC_TSGR',
3865
+ isAviation: true
3866
+ }, {
3867
+ translationKey: 'aviation-phenomenon-squall-thunderstorm-with-hail',
3868
+ key: 'SQL_TSGR',
3869
+ isAviation: true
3870
+ }, {
3871
+ translationKey: 'aviation-phenomenon-isolated-thunderstorm',
3872
+ key: 'ISOL_TS',
3873
+ isAviation: true
3874
+ }, {
3875
+ translationKey: 'aviation-phenomenon-isolated-thunderstorm-with-hail',
3876
+ key: 'ISOL_TSGR',
3877
+ isAviation: true
3878
+ }, {
3879
+ translationKey: 'aviation-phenomenon-occasional-thunderstorm',
3880
+ key: 'OCNL_TS',
3881
+ isAviation: true
3882
+ }, {
3883
+ translationKey: 'aviation-phenomenon-occasional-thunderstorm-with-hail',
3884
+ key: 'OCNL_TSGR',
3885
+ isAviation: true
3886
+ }, {
3887
+ translationKey: 'aviation-phenomenon-frequent-thunderstorm',
3888
+ key: 'FRQ_TS',
3889
+ isAviation: true
3890
+ }, {
3891
+ translationKey: 'aviation-phenomenon-frequent-thunderstorm-with-hail',
3892
+ key: 'FRQ_TSGR',
3893
+ isAviation: true
3894
+ }, {
3895
+ translationKey: 'aviation-phenomenon-severe-mountain-waves',
3896
+ key: 'SEV_MTW',
3897
+ isAviation: true
3898
+ }, {
3899
+ translationKey: 'aviation-phenomenon-surface-visibility',
3900
+ key: 'SFC_VIS',
3901
+ isAviation: true
3902
+ }, {
3903
+ translationKey: 'aviation-phenomenon-surface-wind',
3904
+ key: 'SFC_WIND',
3905
+ isAviation: true
3906
+ }, {
3907
+ translationKey: 'aviation-phenomenon-overcast-cloud',
3908
+ key: 'OVC_CLD',
3909
+ isAviation: true
3910
+ }, {
3911
+ translationKey: 'aviation-phenomenon-broken-cloud',
3912
+ key: 'BKN_CLD',
3913
+ isAviation: true
3914
+ }, {
3915
+ translationKey: 'aviation-phenomenon-isolated-cumulonimbus-cloud',
3916
+ key: 'ISOL_CB',
3917
+ isAviation: true
3918
+ }, {
3919
+ translationKey: 'aviation-phenomenon-occasional-cumulonimbus-cloud',
3920
+ key: 'OCNL_CB',
3921
+ isAviation: true
3922
+ }, {
3923
+ translationKey: 'aviation-phenomenon-frequent-cumulonimbus-cloud',
3924
+ key: 'FRQ_CB',
3925
+ isAviation: true
3926
+ }, {
3927
+ translationKey: 'aviation-phenomenon-isolated-towering-cumulus-cloud',
3928
+ key: 'ISOL_TCU',
3929
+ isAviation: true
3930
+ }, {
3931
+ translationKey: 'aviation-phenomenon-occasional-towering-cumulus-cloud',
3932
+ key: 'OCNL_TCU',
3933
+ isAviation: true
3934
+ }, {
3935
+ translationKey: 'aviation-phenomenon-frequent-towering-cumulus-cloud',
3936
+ key: 'FRQ_TCU',
3937
+ isAviation: true
3938
+ }, {
3939
+ translationKey: 'aviation-phenomenon-moderate-mountain-wave',
3940
+ key: 'MOD_MTW',
3941
+ isAviation: true
3942
+ }, {
3943
+ translationKey: 'aviation-phenomenon-mountains-obscured',
3944
+ key: 'MT_OBSC',
3945
+ isAviation: true
3946
+ }];
3947
+ const allPhenomenaDict = warningPhenomena.reduce((list, item) => Object.assign(Object.assign({}, list), {
3948
+ [item.key]: item
3949
+ }), {});
3950
+ const getPhenomenaIcon = key => {
3951
+ return getWarningPhenomenaIcon(key) || getAviationPhenomenaIcon(key);
3952
+ };
3953
+ const Phenomenon = ({
3954
+ isDisabled,
3955
+ isReadOnly
3956
+ }) => {
3957
+ const {
3958
+ t
3959
+ } = useWarningsTranslation();
3960
+ const {
3961
+ isRequired
3962
+ } = useDraftFormHelpers();
3963
+ // These phenomena are sent to Public Warning Form
3964
+ const warningFormPhenomena = warningPhenomena.filter(phenomenon => !phenomenon.isAviation);
3965
+ return jsx(ReactHookFormSelect, Object.assign({
3966
+ name: "phenomenon",
3967
+ label: t('warning-phenomenon'),
3968
+ rules: {
3969
+ validate: {
3970
+ isRequired
3971
+ }
3972
+ },
3973
+ disabled: isDisabled || isReadOnly,
3974
+ isReadOnly: isReadOnly
3975
+ }, {
3976
+ children: warningFormPhenomena.map(phenomenon => jsx(MenuItem, Object.assign({
3977
+ value: phenomenon.key
3978
+ }, {
3979
+ children: jsxs(Grid, Object.assign({
3980
+ container: true,
3981
+ justifyContent: "space-between"
3982
+ }, {
3983
+ children: [jsx(Grid, Object.assign({
3984
+ item: true
3985
+ }, {
3986
+ children: t(phenomenon.translationKey)
3987
+ })), jsx(Grid, Object.assign({
3988
+ item: true
3989
+ }, {
3990
+ children: jsx(ListItemIcon, {
3991
+ children: getPhenomenaIcon(phenomenon.key)
3992
+ })
3993
+ }))]
3994
+ }))
3995
+ }), phenomenon.key))
3996
+ }));
3997
+ };
3998
+
3999
+ var WarningLevel;
4000
+ (function (WarningLevel) {
4001
+ WarningLevel["moderate"] = "moderate";
4002
+ WarningLevel["severe"] = "severe";
4003
+ WarningLevel["extreme"] = "extreme";
4004
+ })(WarningLevel || (WarningLevel = {}));
4005
+ const LevelColors = {
4006
+ moderate: {
4007
+ color: '#FAE21E',
4008
+ textColor: '#051039'
4009
+ },
4010
+ severe: {
4011
+ color: '#E27000',
4012
+ textColor: '#051039'
4013
+ },
4014
+ extreme: {
4015
+ color: '#D62A20',
4016
+ textColor: '#ffffff'
4017
+ }
4018
+ };
4019
+ const getLevelStyle = levelColor => ({
4020
+ color: levelColor && levelColor.textColor,
4021
+ backgroundColor: levelColor && levelColor.color,
4022
+ paddingLeft: 0.5,
4023
+ paddingRight: 0.5,
4024
+ paddingBottom: '1px',
4025
+ marginLeft: -0.5
4026
+ });
4027
+ const levelOptions = [Object.assign({
4028
+ translationKey: 'warning-level-moderate',
4029
+ key: WarningLevel.moderate
4030
+ }, LevelColors[WarningLevel.moderate]), Object.assign({
4031
+ translationKey: 'warning-level-severe',
4032
+ key: WarningLevel.severe
4033
+ }, LevelColors[WarningLevel.severe]), Object.assign({
4034
+ translationKey: 'warning-level-extreme',
4035
+ key: WarningLevel.extreme
4036
+ }, LevelColors[WarningLevel.extreme])];
4037
+ const levelOptionsDict = levelOptions.reduce((list, item) => Object.assign(Object.assign({}, list), {
4038
+ [item.key]: item
4039
+ }), {});
4040
+ const LevelField = ({
4041
+ isDisabled: _isDisabled = false,
4042
+ isReadOnly: _isReadOnly = false
4043
+ }) => {
4044
+ const {
4045
+ t
4046
+ } = useWarningsTranslation();
4047
+ const {
4048
+ isRequired
4049
+ } = useDraftFormHelpers();
4050
+ const {
4051
+ watch,
4052
+ trigger
4053
+ } = useFormContext();
4054
+ const selectedLevel = watch('level');
4055
+ const levelDetails = levelOptions.find(level => level.key === selectedLevel);
4056
+ const onChangeLevel = () => {
4057
+ trigger(['level', 'probability']);
4058
+ };
4059
+ return jsx(ReactHookFormSelect, Object.assign({
4060
+ name: "level",
4061
+ label: t('warning-level'),
4062
+ rules: {
4063
+ validate: {
4064
+ isRequired
4065
+ }
4066
+ },
4067
+ sx: {
4068
+ '& .MuiSelect-select.MuiSelect-filled': {
4069
+ color: (levelDetails === null || levelDetails === void 0 ? void 0 : levelDetails.textColor) || 'none',
4070
+ backgroundColor: (levelDetails === null || levelDetails === void 0 ? void 0 : levelDetails.color) || 'none',
4071
+ backgroundClip: 'content-box'
4072
+ }
4073
+ },
4074
+ disabled: _isDisabled || _isReadOnly,
4075
+ isReadOnly: _isReadOnly,
4076
+ onChange: onChangeLevel
4077
+ }, {
4078
+ children: levelOptions.map(level => jsxs(MenuItem, Object.assign({
4079
+ value: level.key,
4080
+ sx: {
4081
+ '&.MuiMenuItem-root ': {
4082
+ color: level.textColor,
4083
+ background: level.color,
4084
+ backgroundClip: 'content-box',
4085
+ padding: '12px 8px',
4086
+ '&:hover': {
4087
+ backgroundColor: `${level.color}`,
4088
+ backgroundClip: 'content-box',
4089
+ boxShadow: theme => `inset -8px -12px ${theme.palette.geowebColors.cards.cardContainerMouseOver}, inset 8px 12px ${theme.palette.geowebColors.cards.cardContainerMouseOver}`
4090
+ },
4091
+ '&.Mui-selected': {
4092
+ backgroundColor: `${level.color}`,
4093
+ '&:hover': {
4094
+ boxShadow: theme => `inset 4px 0px 0px 0px ${theme.palette.geowebColors.typographyAndIcons.iconLinkActive}, inset -8px -12px ${theme.palette.geowebColors.cards.cardContainerMouseOver}, inset 8px 12px ${theme.palette.geowebColors.cards.cardContainerMouseOver}`
4095
+ }
4096
+ }
4097
+ }
4098
+ }
4099
+ }, {
4100
+ children: ["\u00A0", t(level.translationKey)]
4101
+ }), level.key))
4102
+ }));
4103
+ };
4104
+
3703
4105
  const emptyFilter = {
3704
4106
  id: 'empty',
3705
4107
  name: '(not specified)',
3706
4108
  checked: true
3707
4109
  };
4110
+ const getFilterlistWithTranslationKeys = filterList => filterList.reduce((fiterList, {
4111
+ key,
4112
+ translationKey
4113
+ }) => Object.assign(Object.assign({}, fiterList), {
4114
+ [key]: translationKey
4115
+ }), {});
3708
4116
  const defaultFilters = [{
3709
4117
  key: 'incident',
3710
4118
  translationKey: 'filter-incident'
@@ -3713,10 +4121,12 @@ const defaultFilters = [{
3713
4121
  translationKey: 'filter-domain'
3714
4122
  }, {
3715
4123
  key: 'phenomenon',
3716
- translationKey: 'filter-phenomenon'
4124
+ translationKey: 'filter-phenomenon',
4125
+ translations: getFilterlistWithTranslationKeys(warningPhenomena)
3717
4126
  }, {
3718
4127
  key: 'level',
3719
- translationKey: 'filter-level'
4128
+ translationKey: 'filter-level',
4129
+ translations: getFilterlistWithTranslationKeys(levelOptions)
3720
4130
  }, {
3721
4131
  key: 'warningProposalSource',
3722
4132
  translationKey: 'filter-source'
@@ -3737,15 +4147,18 @@ const getFiltersFromWarnings = warnings => {
3737
4147
  }
3738
4148
  const filledFilters = defaultFilters.map(({
3739
4149
  key,
3740
- translationKey
4150
+ translationKey,
4151
+ translations
3741
4152
  }) => {
3742
4153
  const filterOptions = [];
3743
4154
  warnings.forEach(warning => {
3744
- const name = warning.warningDetail[key];
3745
- if (name && filterOptions.findIndex(option => option.filter.name === name) === -1) {
4155
+ const id = warning.warningDetail[key];
4156
+ if (id && filterOptions.findIndex(option => option.filter.id === id) === -1) {
4157
+ const translationKey = translations && translations[id];
4158
+ const label = translationKey ? translateKeyOutsideComponents(translationKey) : id;
3746
4159
  const filter = {
3747
- id: name,
3748
- name,
4160
+ id,
4161
+ name: label,
3749
4162
  checked: true
3750
4163
  };
3751
4164
  filterOptions.push({
@@ -10485,6 +10898,28 @@ const DescriptionField = ({
10485
10898
  setActiveTab(1);
10486
10899
  }
10487
10900
  }, [formState.errors, formState.submitCount]);
10901
+ const focusForwards = fieldName => {
10902
+ if (fieldName === 'descriptionOriginal') {
10903
+ setActiveTab(1);
10904
+ }
10905
+ };
10906
+ const focusBackwards = fieldName => {
10907
+ if (fieldName === 'descriptionTranslation') {
10908
+ setActiveTab(0);
10909
+ }
10910
+ };
10911
+ const onKeyDown = event => {
10912
+ const target = event.target;
10913
+ const {
10914
+ name
10915
+ } = target;
10916
+ event.stopPropagation();
10917
+ if (event.code === 'Tab' && event.shiftKey) {
10918
+ focusBackwards(name);
10919
+ } else if (event.code === 'Tab') {
10920
+ focusForwards(name);
10921
+ }
10922
+ };
10488
10923
  return jsxs(Fragment, {
10489
10924
  children: [jsxs(Tabs, Object.assign({
10490
10925
  value: activeTab,
@@ -10501,11 +10936,13 @@ const DescriptionField = ({
10501
10936
  children: [jsx(Tab, Object.assign({
10502
10937
  sx: tabStyle,
10503
10938
  label: t('warning-description-original'),
10504
- disabled: _isDisabled
10939
+ disabled: _isDisabled,
10940
+ tabIndex: -1
10505
10941
  }, a11yProps(0))), jsx(Tab, Object.assign({
10506
10942
  sx: tabStyle,
10507
10943
  label: t('warning-description-translation'),
10508
- disabled: _isDisabled
10944
+ disabled: _isDisabled,
10945
+ tabIndex: -1
10509
10946
  }, a11yProps(1)))]
10510
10947
  })), jsx(CustomTabPanel, Object.assign({
10511
10948
  value: activeTab,
@@ -10522,7 +10959,7 @@ const DescriptionField = ({
10522
10959
  multiline: true,
10523
10960
  disabled: _isDisabled,
10524
10961
  isReadOnly: _isReadOnly,
10525
- onKeyDown: event => event.stopPropagation()
10962
+ onKeyDown: onKeyDown
10526
10963
  })
10527
10964
  })), jsx(CustomTabPanel, Object.assign({
10528
10965
  value: activeTab,
@@ -10539,7 +10976,7 @@ const DescriptionField = ({
10539
10976
  multiline: true,
10540
10977
  disabled: _isDisabled,
10541
10978
  isReadOnly: _isReadOnly,
10542
- onKeyDown: event => event.stopPropagation()
10979
+ onKeyDown: onKeyDown
10543
10980
  })
10544
10981
  }))]
10545
10982
  });
@@ -10672,46 +11109,15 @@ const AreaField = ({
10672
11109
  });
10673
11110
  };
10674
11111
 
10675
- const warningPhenomena = t => [{
10676
- title: t('warning-phenomenon-wind'),
10677
- key: 'wind',
10678
- icon: jsx(Wind, {})
10679
- }, {
10680
- title: t('warning-phenomenon-fog'),
10681
- key: 'fog',
10682
- icon: jsx(Fog, {})
10683
- }, {
10684
- title: t('warning-phenomenon-thunderstorm'),
10685
- key: 'thunderstorm',
10686
- icon: jsx(Lightning, {})
10687
- }, {
10688
- title: t('warning-phenomenon-snow-ice'),
10689
- key: 'snowIce',
10690
- icon: jsx(Snow, {})
10691
- }, {
10692
- title: t('warning-phenomenon-rain'),
10693
- key: 'rain',
10694
- icon: jsx(Rain, {})
10695
- }, {
10696
- title: t('warning-phenomenon-high-temp'),
10697
- key: 'highTemp',
10698
- icon: jsx(TemperatureHigh, {})
10699
- },
10700
- // {
10701
- // title: t('warning-phenomenon-funnel-cloud'),
10702
- // key: 'funnelCloud',
10703
- // icon: <FunnelCloud />,
10704
- // },
10705
- {
10706
- title: t('warning-phenomenon-low-temp'),
10707
- key: 'lowTemp',
10708
- icon: jsx(TemperatureLow, {})
10709
- }, {
10710
- title: t('warning-phenomenon-coastal-event'),
10711
- key: 'coastalEvent',
10712
- icon: jsx(CoastalEvent, {})
10713
- }];
10714
- const Phenomenon = ({
11112
+ const VALID_FROM_MAX_HOURS_AFTER_CURRENT = 168;
11113
+ const isValueBeforeCurrentTime$1 = (value, t) => {
11114
+ return isXHoursBefore(value, dateUtils.getCurrentTimeAsString(), 0) || t('warning-valid-from-error-before-current');
11115
+ };
11116
+ const isMaxHoursAfterCurrentTime$1 = (value, t) => isXHoursAfter(value, dateUtils.getCurrentTimeAsString(), VALID_FROM_MAX_HOURS_AFTER_CURRENT) || t('warning-valid-from-error-max-hours', {
11117
+ ns: WARN_NAMESPACE,
11118
+ MAX_HOURS: VALID_FROM_MAX_HOURS_AFTER_CURRENT
11119
+ });
11120
+ const ValidFrom = ({
10715
11121
  isDisabled,
10716
11122
  isReadOnly
10717
11123
  }) => {
@@ -10721,163 +11127,14 @@ const Phenomenon = ({
10721
11127
  const {
10722
11128
  isRequired
10723
11129
  } = useDraftFormHelpers();
10724
- return jsx(ReactHookFormSelect, Object.assign({
10725
- name: "phenomenon",
10726
- label: t('warning-phenomenon'),
10727
- rules: {
10728
- validate: {
10729
- isRequired
10730
- }
10731
- },
10732
- disabled: isDisabled || isReadOnly,
10733
- isReadOnly: isReadOnly
10734
- }, {
10735
- children: warningPhenomena(t).map(phenomenon => {
10736
- return jsx(MenuItem, Object.assign({
10737
- value: phenomenon.key
10738
- }, {
10739
- children: jsxs(Grid, Object.assign({
10740
- container: true,
10741
- justifyContent: "space-between"
10742
- }, {
10743
- children: [jsx(Grid, Object.assign({
10744
- item: true
10745
- }, {
10746
- children: phenomenon.title
10747
- })), jsx(Grid, Object.assign({
10748
- item: true
10749
- }, {
10750
- children: jsx(ListItemIcon, {
10751
- children: phenomenon.icon
10752
- })
10753
- }))]
10754
- }))
10755
- }), phenomenon.key);
10756
- })
10757
- }));
10758
- };
10759
-
10760
- var WarningLevel;
10761
- (function (WarningLevel) {
10762
- WarningLevel["moderate"] = "moderate";
10763
- WarningLevel["severe"] = "severe";
10764
- WarningLevel["extreme"] = "extreme";
10765
- })(WarningLevel || (WarningLevel = {}));
10766
- const LevelColors = {
10767
- moderate: {
10768
- color: '#FAE21E',
10769
- textColor: '#051039'
10770
- },
10771
- severe: {
10772
- color: '#E27000',
10773
- textColor: '#051039'
10774
- },
10775
- extreme: {
10776
- color: '#D62A20',
10777
- textColor: '#ffffff'
10778
- }
10779
- };
10780
- const levelOptions = t => [Object.assign({
10781
- title: t('warning-level-moderate'),
10782
- key: WarningLevel.moderate
10783
- }, LevelColors[WarningLevel.moderate]), Object.assign({
10784
- title: t('warning-level-severe'),
10785
- key: WarningLevel.severe
10786
- }, LevelColors[WarningLevel.severe]), Object.assign({
10787
- title: t('warning-level-extreme'),
10788
- key: WarningLevel.extreme
10789
- }, LevelColors[WarningLevel.extreme])];
10790
- const LevelField = ({
10791
- isDisabled: _isDisabled = false,
10792
- isReadOnly: _isReadOnly = false
10793
- }) => {
10794
- const {
10795
- t
10796
- } = useWarningsTranslation();
10797
- const {
10798
- isRequired
10799
- } = useDraftFormHelpers();
10800
- const {
10801
- watch,
10802
- trigger
10803
- } = useFormContext();
10804
- const selectedLevel = watch('level');
10805
- const levelDetails = levelOptions(t).find(level => level.key === selectedLevel);
10806
- const onChangeLevel = () => {
10807
- trigger(['level', 'probability']);
10808
- };
10809
- return jsx(ReactHookFormSelect, Object.assign({
10810
- name: "level",
10811
- label: t('warning-level'),
10812
- rules: {
10813
- validate: {
10814
- isRequired
10815
- }
10816
- },
10817
- sx: {
10818
- '& .MuiSelect-select.MuiSelect-filled': {
10819
- color: (levelDetails === null || levelDetails === void 0 ? void 0 : levelDetails.textColor) || 'none',
10820
- backgroundColor: (levelDetails === null || levelDetails === void 0 ? void 0 : levelDetails.color) || 'none',
10821
- backgroundClip: 'content-box'
10822
- }
10823
- },
10824
- disabled: _isDisabled || _isReadOnly,
10825
- isReadOnly: _isReadOnly,
10826
- onChange: onChangeLevel
10827
- }, {
10828
- children: levelOptions(t).map(level => jsxs(MenuItem, Object.assign({
10829
- value: level.key,
10830
- sx: {
10831
- '&.MuiMenuItem-root ': {
10832
- color: level.textColor,
10833
- background: level.color,
10834
- backgroundClip: 'content-box',
10835
- padding: '12px 8px',
10836
- '&:hover': {
10837
- backgroundColor: `${level.color}`,
10838
- backgroundClip: 'content-box',
10839
- boxShadow: theme => `inset -8px -12px ${theme.palette.geowebColors.cards.cardContainerMouseOver}, inset 8px 12px ${theme.palette.geowebColors.cards.cardContainerMouseOver}`
10840
- },
10841
- '&.Mui-selected': {
10842
- backgroundColor: `${level.color}`,
10843
- '&:hover': {
10844
- boxShadow: theme => `inset 4px 0px 0px 0px ${theme.palette.geowebColors.typographyAndIcons.iconLinkActive}, inset -8px -12px ${theme.palette.geowebColors.cards.cardContainerMouseOver}, inset 8px 12px ${theme.palette.geowebColors.cards.cardContainerMouseOver}`
10845
- }
10846
- }
10847
- }
10848
- }
10849
- }, {
10850
- children: ["\u00A0", level.title]
10851
- }), level.key))
10852
- }));
10853
- };
10854
-
10855
- const VALID_FROM_MAX_HOURS_AFTER_CURRENT = 168;
10856
- const isValueBeforeCurrentTime$1 = (value, t) => {
10857
- return isXHoursBefore(value, dateUtils.getCurrentTimeAsString(), 0) || t('warning-valid-from-error-before-current');
10858
- };
10859
- const isMaxHoursAfterCurrentTime$1 = (value, t) => isXHoursAfter(value, dateUtils.getCurrentTimeAsString(), VALID_FROM_MAX_HOURS_AFTER_CURRENT) || t('warning-valid-from-error-max-hours', {
10860
- ns: WARN_NAMESPACE,
10861
- MAX_HOURS: VALID_FROM_MAX_HOURS_AFTER_CURRENT
10862
- });
10863
- const ValidFrom = ({
10864
- isDisabled,
10865
- isReadOnly
10866
- }) => {
10867
- const {
10868
- t
10869
- } = useWarningsTranslation();
10870
- const {
10871
- isRequired
10872
- } = useDraftFormHelpers();
10873
- const {
10874
- trigger
10875
- } = useFormContext();
10876
- const onChangeValidFrom = () => {
10877
- trigger(['validFrom', 'validUntil']);
10878
- };
10879
- return jsx(ReactHookFormDateTime, {
10880
- name: "validFrom",
11130
+ const {
11131
+ trigger
11132
+ } = useFormContext();
11133
+ const onChangeValidFrom = () => {
11134
+ trigger(['validFrom', 'validUntil']);
11135
+ };
11136
+ return jsx(ReactHookFormDateTime, {
11137
+ name: "validFrom",
10881
11138
  rules: {
10882
11139
  validate: {
10883
11140
  isRequired,
@@ -11599,6 +11856,33 @@ const getPublicWarningFormError = createSelector(getPublicWarningStore, publicWa
11599
11856
  const getSelectedPublicWarningId = createSelector(getPublicWarningStore, publicWarningStore => (publicWarningStore === null || publicWarningStore === void 0 ? void 0 : publicWarningStore.selectedPublicWarningId) || '');
11600
11857
  const getSelectedPublicIsFormDirty = createSelector(getPublicWarningStore, publicWarningStore => (publicWarningStore === null || publicWarningStore === void 0 ? void 0 : publicWarningStore.isFormDirty) || false);
11601
11858
 
11859
+ /* *
11860
+ * Licensed under the Apache License, Version 2.0 (the "License");
11861
+ * you may not use this file except in compliance with the License.
11862
+ * You may obtain a copy of the License at
11863
+ *
11864
+ * http://www.apache.org/licenses/LICENSE-2.0
11865
+ *
11866
+ * Unless required by applicable law or agreed to in writing, software
11867
+ * distributed under the License is distributed on an "AS IS" BASIS,
11868
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11869
+ * See the License for the specific language governing permissions and
11870
+ * limitations under the License.
11871
+ *
11872
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
11873
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
11874
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
11875
+ * */
11876
+ var PublicWarningStatus;
11877
+ (function (PublicWarningStatus) {
11878
+ PublicWarningStatus["DRAFT"] = "DRAFT";
11879
+ PublicWarningStatus["DRAFT_PUBLISHED"] = "DRAFT_PUBLISHED";
11880
+ PublicWarningStatus["PUBLISHED"] = "PUBLISHED";
11881
+ PublicWarningStatus["TODO"] = "TODO";
11882
+ PublicWarningStatus["EXPIRED"] = "EXPIRED";
11883
+ PublicWarningStatus["IGNORED"] = "IGNORED";
11884
+ })(PublicWarningStatus || (PublicWarningStatus = {}));
11885
+
11602
11886
  const PublicWarningsFormConnect = ({
11603
11887
  defaultBbox
11604
11888
  }) => {
@@ -11616,12 +11900,12 @@ const PublicWarningsFormConnect = ({
11616
11900
  dispatch(publicWarningFormActions.publishWarning({
11617
11901
  publicWarning: {
11618
11902
  warningDetail: newFormValues,
11619
- status: 'PUBLISHED'
11903
+ status: PublicWarningStatus.PUBLISHED
11620
11904
  }
11621
11905
  }));
11622
11906
  };
11623
11907
  const saveForm = newFormValues => {
11624
- const status = newFormValues.linked_to_id ? 'DRAFT_PUBLISHED' : 'DRAFT';
11908
+ const status = newFormValues.linked_to_id ? PublicWarningStatus.DRAFT_PUBLISHED : PublicWarningStatus.DRAFT;
11625
11909
  dispatch(publicWarningFormActions.saveWarning({
11626
11910
  publicWarning: {
11627
11911
  warningDetail: newFormValues,
@@ -13603,7 +13887,47 @@ const FilterChipWithOptions = ({
13603
13887
  marginLeft: '-12px'
13604
13888
  }
13605
13889
  }, {
13606
- children: _filterList.map(filterItem => jsx(FilterListItem, Object.assign({}, filterItem), filterItem.filter.id))
13890
+ children: _filterList.map(filterItem => {
13891
+ switch (id) {
13892
+ case 'level':
13893
+ {
13894
+ const warningColor = LevelColors[filterItem.filter.id];
13895
+ return jsx(FilterListItem, Object.assign({}, filterItem, {
13896
+ children: warningColor ? jsx(Box, Object.assign({
13897
+ component: "span",
13898
+ sx: Object.assign(Object.assign({}, getLevelStyle(warningColor)), {
13899
+ fontSize: '16px'
13900
+ }),
13901
+ "data-testid": `icon-${filterItem.filter.id}`
13902
+ }, {
13903
+ children: filterItem.filter.name
13904
+ })) : jsx(FilterLabel, {
13905
+ name: filterItem.filter.name
13906
+ })
13907
+ }), filterItem.filter.id);
13908
+ }
13909
+ case 'phenomenon':
13910
+ {
13911
+ const icon = getWarningPhenomenaIcon(filterItem.filter.id);
13912
+ return jsxs(FilterListItem, Object.assign({}, filterItem, {
13913
+ children: [icon && jsx(Box, Object.assign({
13914
+ "data-testid": `icon-${filterItem.filter.id}`,
13915
+ sx: {
13916
+ marginRight: 1
13917
+ }
13918
+ }, {
13919
+ children: icon
13920
+ })), jsx(FilterLabel, {
13921
+ name: filterItem.filter.name
13922
+ })]
13923
+ }), filterItem.filter.id);
13924
+ }
13925
+ default:
13926
+ {
13927
+ return jsx(FilterListItem, Object.assign({}, filterItem), filterItem.filter.id);
13928
+ }
13929
+ }
13930
+ })
13607
13931
  }))]
13608
13932
  }))]
13609
13933
  }))]
@@ -13647,7 +13971,11 @@ const FilterChipWithOptionsConnect = ({
13647
13971
  const FilterList = ({
13648
13972
  filters: _filters = [],
13649
13973
  onClickAll: _onClickAll = () => {},
13650
- isAllSelected: _isAllSelected = true
13974
+ isAllSelected: _isAllSelected = true,
13975
+ showSigmet: _showSigmet = false,
13976
+ showAirmet: _showAirmet = false,
13977
+ setShowSigmet,
13978
+ setShowAirmet
13651
13979
  }) => {
13652
13980
  const {
13653
13981
  t
@@ -13685,65 +14013,174 @@ const FilterList = ({
13685
14013
  return jsx(FilterChipWithOptionsConnect, {
13686
14014
  filter: filter
13687
14015
  }, filter.id);
13688
- })]
14016
+ }), setShowSigmet && jsx(CustomTooltip, Object.assign({
14017
+ title: _showSigmet ? t('filter-hide', {
14018
+ subject: t('sigmet')
14019
+ }) : t('filter-show', {
14020
+ subject: t('sigmet')
14021
+ }),
14022
+ placement: "bottom"
14023
+ }, {
14024
+ children: jsx("span", Object.assign({
14025
+ style: {
14026
+ margin: 0
14027
+ }
14028
+ }, {
14029
+ children: jsx(FilterChip, {
14030
+ id: "sigmet",
14031
+ label: t('sigmet'),
14032
+ isSelected: _showSigmet,
14033
+ handleClick: () => setShowSigmet(!_showSigmet),
14034
+ size: "medium"
14035
+ })
14036
+ }))
14037
+ })), setShowAirmet && jsx(CustomTooltip, Object.assign({
14038
+ title: _showAirmet ? t('filter-hide', {
14039
+ subject: t('airmet')
14040
+ }) : t('filter-show', {
14041
+ subject: t('airmet')
14042
+ }),
14043
+ placement: "bottom"
14044
+ }, {
14045
+ children: jsx("span", Object.assign({
14046
+ style: {
14047
+ margin: 0
14048
+ }
14049
+ }, {
14050
+ children: jsx(FilterChip, {
14051
+ id: "airmet",
14052
+ label: t('airmet'),
14053
+ isSelected: _showAirmet,
14054
+ handleClick: () => setShowAirmet(!_showAirmet),
14055
+ size: "medium"
14056
+ })
14057
+ }))
14058
+ }))]
13689
14059
  }));
13690
14060
  };
13691
14061
 
13692
- const sortWarningsOnStatus = warnings => {
13693
- return warnings.reduce((allWarnings, warning) => {
13694
- if (warning.status === 'DRAFT' || warning.status === 'DRAFT_PUBLISHED') {
13695
- return Object.assign(Object.assign({}, allWarnings), {
13696
- draft: allWarnings === null || allWarnings === void 0 ? void 0 : allWarnings.draft.concat(warning)
13697
- });
13698
- }
13699
- if (warning.status === 'PUBLISHED') {
13700
- return Object.assign(Object.assign({}, allWarnings), {
13701
- published: allWarnings === null || allWarnings === void 0 ? void 0 : allWarnings.published.concat(warning)
13702
- });
13703
- }
13704
- if (warning.status === 'TODO') {
13705
- return Object.assign(Object.assign({}, allWarnings), {
13706
- todo: allWarnings === null || allWarnings === void 0 ? void 0 : allWarnings.todo.concat(warning)
13707
- });
13708
- }
13709
- if (warning.status === 'EXPIRED') {
13710
- return Object.assign(Object.assign({}, allWarnings), {
13711
- expired: allWarnings === null || allWarnings === void 0 ? void 0 : allWarnings.expired.concat(warning)
13712
- });
14062
+ const WarningListItemSeperator = _a => {
14063
+ var {
14064
+ totalWarnings,
14065
+ status
14066
+ } = _a,
14067
+ props = __rest(_a, ["totalWarnings", "status"]);
14068
+ const {
14069
+ t
14070
+ } = useWarningsTranslation();
14071
+ const getStatus = status => {
14072
+ switch (status) {
14073
+ case 'DRAFT':
14074
+ return t('warning-list-status-draft');
14075
+ case 'PUBLISHED':
14076
+ return t('warning-list-status-published');
14077
+ case 'TODO':
14078
+ return t('warning-list-status-todo');
14079
+ default:
14080
+ return t('warning-list-status-expired');
13713
14081
  }
13714
- return allWarnings;
14082
+ };
14083
+ const headerText = `${totalWarnings} ${getStatus(status)}`;
14084
+ return jsx(ListItem, Object.assign({}, props, {
14085
+ "aria-label": `warninglist ${status}`
13715
14086
  }, {
13716
- todo: [],
13717
- draft: [],
13718
- published: [],
13719
- expired: []
13720
- });
13721
- };
13722
- const getWarningWithLinkedToId = warning => {
13723
- const {
13724
- id,
13725
- warningDetail
13726
- } = warning;
13727
- const cleanWarningDetail = __rest(warningDetail, ["id"]);
13728
- return Object.assign(Object.assign({}, warning), {
13729
- warningDetail: Object.assign(Object.assign({}, cleanWarningDetail), {
13730
- linked_to_id: id
13731
- }),
13732
- status: 'DRAFT_PUBLISHED'
13733
- });
14087
+ children: jsx(Typography, Object.assign({
14088
+ variant: "caption",
14089
+ sx: {
14090
+ opacity: 0.67
14091
+ }
14092
+ }, {
14093
+ children: headerText
14094
+ }))
14095
+ }));
13734
14096
  };
13735
- const getWarningWithProposalId = warning => {
13736
- const {
13737
- id,
13738
- warningDetail
13739
- } = warning,
13740
- fullWarning = __rest(warning, ["id", "warningDetail"]);
13741
- const cleanWarningDetail = __rest(warningDetail, ["id"]);
13742
- return Object.assign(Object.assign({}, fullWarning), {
13743
- warningDetail: Object.assign(Object.assign({}, cleanWarningDetail), {
13744
- proposal_id: id
13745
- })
13746
- });
14097
+
14098
+ /* *
14099
+ * Licensed under the Apache License, Version 2.0 (the "License");
14100
+ * you may not use this file except in compliance with the License.
14101
+ * You may obtain a copy of the License at
14102
+ *
14103
+ * http://www.apache.org/licenses/LICENSE-2.0
14104
+ *
14105
+ * Unless required by applicable law or agreed to in writing, software
14106
+ * distributed under the License is distributed on an "AS IS" BASIS,
14107
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14108
+ * See the License for the specific language governing permissions and
14109
+ * limitations under the License.
14110
+ *
14111
+ * Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
14112
+ * Copyright 2024 - Finnish Meteorological Institute (FMI)
14113
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
14114
+ * */
14115
+ const transformAirmetToWarningFormat = apiAirmet => {
14116
+ const airmet = apiAirmet.airmet;
14117
+ return {
14118
+ id: apiAirmet.uuid,
14119
+ lastUpdatedTime: apiAirmet.lastUpdateDate,
14120
+ productStatus: airmet.status,
14121
+ warningDetail: {
14122
+ descriptionOriginal: '',
14123
+ descriptionTranslation: '',
14124
+ areas: [{
14125
+ geoJSON: airmet.startGeometry,
14126
+ objectName: ''
14127
+ }],
14128
+ phenomenon: airmet.phenomenon,
14129
+ validFrom: airmet.validDateStart,
14130
+ validUntil: airmet.validDateEnd,
14131
+ level: 'AIR',
14132
+ probability: 0,
14133
+ incident: airmet.sequence
14134
+ }
14135
+ };
14136
+ };
14137
+ const transformSigmetToWarningFormat = apiSigmet => {
14138
+ const sigmet = apiSigmet.sigmet;
14139
+ return {
14140
+ id: apiSigmet.uuid,
14141
+ lastUpdatedTime: apiSigmet.lastUpdateDate,
14142
+ productStatus: sigmet.status,
14143
+ warningDetail: {
14144
+ descriptionOriginal: '',
14145
+ descriptionTranslation: '',
14146
+ areas: [{
14147
+ geoJSON: sigmet.startGeometry,
14148
+ objectName: ''
14149
+ }],
14150
+ phenomenon: sigmet.phenomenon,
14151
+ validFrom: sigmet.validDateStart,
14152
+ validUntil: sigmet.validDateEnd,
14153
+ level: 'SIG',
14154
+ probability: 0,
14155
+ incident: sigmet.sequence
14156
+ }
14157
+ };
14158
+ };
14159
+ const mapProductStatusToWarningStatus = productStatus => {
14160
+ switch (productStatus) {
14161
+ case ProductStatus.PUBLISHED:
14162
+ return PublicWarningStatus.PUBLISHED;
14163
+ case ProductStatus.DRAFT:
14164
+ return PublicWarningStatus.DRAFT;
14165
+ case ProductStatus.CANCELLED:
14166
+ case ProductStatus.EXPIRED:
14167
+ case ProductStatus.DISCARDED:
14168
+ default:
14169
+ return PublicWarningStatus.EXPIRED;
14170
+ }
14171
+ };
14172
+
14173
+ const getSortedStatus = status => {
14174
+ switch (status) {
14175
+ case 'DRAFT_PUBLISHED':
14176
+ {
14177
+ return PublicWarningStatus.DRAFT;
14178
+ }
14179
+ default:
14180
+ {
14181
+ return status;
14182
+ }
14183
+ }
13747
14184
  };
13748
14185
  const getWarningWithoutIdStatusEditor = warning => {
13749
14186
  const {
@@ -13758,6 +14195,32 @@ const getWarningWithoutIdStatusEditor = warning => {
13758
14195
  warningDetail: cleanWarningDetail
13759
14196
  });
13760
14197
  };
14198
+ const getWarningWithLinkedToId = warning => {
14199
+ const {
14200
+ id,
14201
+ warningDetail
14202
+ } = warning;
14203
+ const cleanWarningDetail = __rest(warningDetail, ["id"]);
14204
+ return Object.assign(Object.assign({}, warning), {
14205
+ warningDetail: Object.assign(Object.assign({}, cleanWarningDetail), {
14206
+ linked_to_id: id
14207
+ }),
14208
+ status: PublicWarningStatus.DRAFT_PUBLISHED
14209
+ });
14210
+ };
14211
+ const getWarningWithProposalId = warning => {
14212
+ const {
14213
+ id,
14214
+ warningDetail
14215
+ } = warning,
14216
+ fullWarning = __rest(warning, ["id", "warningDetail"]);
14217
+ const cleanWarningDetail = __rest(warningDetail, ["id"]);
14218
+ return Object.assign(Object.assign({}, fullWarning), {
14219
+ warningDetail: Object.assign(Object.assign({}, cleanWarningDetail), {
14220
+ proposal_id: id
14221
+ })
14222
+ });
14223
+ };
13761
14224
  const getStatusIcon = warning => {
13762
14225
  const getStatusTag = (content, color, icon = null) => jsx(StatusTag, {
13763
14226
  content: content,
@@ -13769,7 +14232,8 @@ const getStatusIcon = warning => {
13769
14232
  },
13770
14233
  icon: icon
13771
14234
  });
13772
- switch (warning.status) {
14235
+ const status = warning.status || mapProductStatusToWarningStatus(warning.productStatus);
14236
+ switch (status) {
13773
14237
  case 'TODO':
13774
14238
  return null;
13775
14239
  case 'DRAFT':
@@ -13800,34 +14264,6 @@ const getStatusIcon = warning => {
13800
14264
  return getStatusTag('Exp', 'grey');
13801
14265
  }
13802
14266
  };
13803
- const WarningListHeaderContent = _a => {
13804
- var {
13805
- title,
13806
- width = 76
13807
- } = _a,
13808
- props = __rest(_a, ["title", "width"]);
13809
- return jsx(Grid, Object.assign({
13810
- item: true
13811
- }, props, {
13812
- sx: Object.assign(Object.assign({}, props.sx), {
13813
- width
13814
- })
13815
- }, {
13816
- children: jsx(Box, Object.assign({
13817
- sx: {
13818
- overflow: 'hidden',
13819
- fontWeight: 'normal',
13820
- textOverflow: 'ellipsis',
13821
- fontSize: 12,
13822
- lineHeight: 1.33,
13823
- height: 16,
13824
- color: 'geowebColors.captions.captionStatus.rgba'
13825
- }
13826
- }, {
13827
- children: title
13828
- }))
13829
- }));
13830
- };
13831
14267
  const WarningListColumnContent = _a => {
13832
14268
  var {
13833
14269
  title,
@@ -13871,286 +14307,513 @@ const WarningListColumnContent = _a => {
13871
14307
  }))]
13872
14308
  }));
13873
14309
  };
13874
- const WarningsOnStatus = ({
13875
- warnings,
13876
- status,
13877
- activeWarningId,
13878
- onSelectWarning: _onSelectWarning = () => {},
14310
+ const getMenuItems = ({
14311
+ warning,
13879
14312
  onEditWarning: _onEditWarning = () => {},
13880
14313
  onDeleteWarning: _onDeleteWarning = () => {},
13881
- onDeleteReviewWarning: _onDeleteReviewWarning = () => {}
14314
+ onDeleteReviewWarning: _onDeleteReviewWarning = () => {},
14315
+ t
13882
14316
  }) => {
14317
+ const duplicate = {
14318
+ text: t('warning-list-button-duplicate'),
14319
+ action: () => _onEditWarning(getWarningWithoutIdStatusEditor(warning)),
14320
+ icon: jsx(Copy, {})
14321
+ };
14322
+ switch (warning.status) {
14323
+ case 'PUBLISHED':
14324
+ return [{
14325
+ text: t('warning-list-button-update'),
14326
+ action: () => _onEditWarning(getWarningWithLinkedToId(warning)),
14327
+ icon: jsx(Edit, {})
14328
+ }, duplicate, {
14329
+ text: t('warning-list-button-expire'),
14330
+ action: () => null,
14331
+ icon: jsx(Expire, {}),
14332
+ isDisabled: true
14333
+ }, {
14334
+ text: t('warning-list-button-withdraw'),
14335
+ action: () => null,
14336
+ icon: jsx(Remove, {}),
14337
+ isDisabled: true
14338
+ }];
14339
+ case 'EXPIRED':
14340
+ return [duplicate];
14341
+ case 'DRAFT':
14342
+ case 'DRAFT_PUBLISHED':
14343
+ return [{
14344
+ text: t('object-manager-button-edit'),
14345
+ action: () => _onEditWarning(warning),
14346
+ icon: jsx(Edit, {})
14347
+ }, duplicate, {
14348
+ text: t('object-manager-button-delete'),
14349
+ action: () => _onDeleteWarning(warning.id, warning.editor),
14350
+ icon: jsx(Delete, {})
14351
+ }];
14352
+ case 'TODO':
14353
+ return [{
14354
+ text: t('warning-list-button-use'),
14355
+ action: () => _onEditWarning(getWarningWithProposalId(warning)),
14356
+ icon: jsx(Success, {})
14357
+ }, {
14358
+ text: t('object-manager-button-delete'),
14359
+ action: () => _onDeleteReviewWarning(warning),
14360
+ icon: jsx(Delete, {})
14361
+ }];
14362
+ default:
14363
+ return [];
14364
+ }
14365
+ };
14366
+ const WarningListItem = _a => {
14367
+ var {
14368
+ warning,
14369
+ status,
14370
+ activeWarningId,
14371
+ onSelectWarning = () => {},
14372
+ onEditWarning = () => {},
14373
+ onDeleteWarning = () => {},
14374
+ onDeleteReviewWarning = () => {}
14375
+ } = _a,
14376
+ props = __rest(_a, ["warning", "status", "activeWarningId", "onSelectWarning", "onEditWarning", "onDeleteWarning", "onDeleteReviewWarning"]);
13883
14377
  const {
13884
14378
  t
13885
14379
  } = useWarningsTranslation();
13886
- const getStatus = status => {
13887
- switch (status) {
13888
- case 'DRAFT':
13889
- return t('warning-list-status-draft');
13890
- case 'PUBLISHED':
13891
- return t('warning-list-status-published');
13892
- case 'TODO':
13893
- return t('warning-list-status-todo');
13894
- default:
13895
- return t('warning-list-status-expired');
13896
- }
13897
- };
13898
- const headerText = `${warnings.length} ${getStatus(status)}`;
13899
- const getMenuItems = warning => {
13900
- const duplicate = {
13901
- text: t('warning-list-button-duplicate'),
13902
- action: () => _onEditWarning(getWarningWithoutIdStatusEditor(warning)),
13903
- icon: jsx(Copy, {})
14380
+ const phenomenonDetails = allPhenomenaDict[warning.warningDetail.phenomenon];
14381
+ const levelDetails = levelOptionsDict[warning.warningDetail.level];
14382
+ // State and effect to track if the phenomena text is overflowing
14383
+ const textRef = useRef(null);
14384
+ const [isOverflowing, setIsOverflowing] = useState(false);
14385
+ useEffect(() => {
14386
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
14387
+ const checkOverflow = () => {
14388
+ if (textRef.current) {
14389
+ setIsOverflowing(textRef.current.scrollWidth > textRef.current.clientWidth);
14390
+ }
13904
14391
  };
13905
- switch (status) {
13906
- case 'PUBLISHED':
13907
- return [{
13908
- text: t('warning-list-button-update'),
13909
- action: () => _onEditWarning(getWarningWithLinkedToId(warning)),
13910
- icon: jsx(Edit, {})
13911
- }, duplicate, {
13912
- text: t('warning-list-button-expire'),
13913
- action: () => null,
13914
- icon: jsx(Expire, {}),
13915
- isDisabled: true
13916
- }, {
13917
- text: t('warning-list-button-withdraw'),
13918
- action: () => null,
13919
- icon: jsx(Remove, {}),
13920
- isDisabled: true
13921
- }];
13922
- case 'EXPIRED':
13923
- return [duplicate];
13924
- case 'DRAFT':
13925
- case 'DRAFT_PUBLISHED':
13926
- return [{
13927
- text: t('object-manager-button-edit'),
13928
- action: () => _onEditWarning(warning),
13929
- icon: jsx(Edit, {})
13930
- }, duplicate, {
13931
- text: t('object-manager-button-delete'),
13932
- action: () => _onDeleteWarning(warning.id, warning.editor),
13933
- icon: jsx(Delete, {})
13934
- }];
13935
- case 'TODO':
13936
- return [{
13937
- text: t('warning-list-button-use'),
13938
- action: () => _onEditWarning(getWarningWithProposalId(warning)),
13939
- icon: jsx(Success, {})
13940
- }, {
13941
- text: t('object-manager-button-delete'),
13942
- action: () => _onDeleteReviewWarning(warning),
13943
- icon: jsx(Delete, {})
13944
- }];
13945
- default:
13946
- return [];
13947
- }
13948
- };
13949
- return jsxs(Box, Object.assign({
14392
+ checkOverflow();
14393
+ }, [phenomenonDetails]);
14394
+ return jsx(ListItem, Object.assign({
13950
14395
  sx: {
13951
- paddingBottom: 2
13952
- }
13953
- }, {
13954
- children: [jsx(Typography, Object.assign({
13955
- variant: "caption",
14396
+ marginBottom: 0.25,
14397
+ minHeight: '32px',
14398
+ padding: '0 0',
14399
+ backgroundColor: status === 'EXPIRED' ? 'geowebColors.cards.cardContainerDisabled' : 'geowebColors.cards.cardContainer',
14400
+ borderColor: status === 'EXPIRED' ? 'geowebColors.cards.cardContainerDisabledBorder' : 'geowebColors.cards.cardContainerBorder',
14401
+ borderRadius: 1,
14402
+ borderWidth: activeWarningId === warning.id ? '1px' : '1px',
14403
+ borderStyle: 'solid'
14404
+ },
14405
+ secondaryAction: jsx(ToggleMenu, {
14406
+ menuTitle: t('warning-list-button-options'),
14407
+ tooltipTitle: t('warning-list-button-options'),
14408
+ menuPosition: "bottom",
14409
+ "aria-label": t('warning-list-button-options'),
14410
+ menuItems: getMenuItems({
14411
+ warning,
14412
+ t,
14413
+ onEditWarning,
14414
+ onDeleteReviewWarning,
14415
+ onDeleteWarning
14416
+ }),
14417
+ buttonIcon: jsx(Options, {})
14418
+ }),
14419
+ "data-testid": `warning-${getSortedStatus(status)}`
14420
+ }, props, {
14421
+ children: jsx(ListItemButton, Object.assign({
13956
14422
  sx: {
13957
- opacity: 0.67
13958
- }
13959
- }, {
13960
- children: headerText
13961
- })), warnings.length > 0 && jsx(List, Object.assign({
13962
- "aria-label": `warninglist ${status}`
14423
+ height: '100%',
14424
+ padding: 1,
14425
+ '.warning-list': {
14426
+ justifyContent: 'left'
14427
+ },
14428
+ [`@container publicWarningList (min-width: ${breakpoints.desktop}px)`]: {
14429
+ '.warning-list': {
14430
+ justifyContent: 'space-between'
14431
+ }
14432
+ }
14433
+ },
14434
+ onClick: () => onSelectWarning(warning),
14435
+ "aria-label": `warning item for ${warning.id}`,
14436
+ selected: activeWarningId === warning.id
13963
14437
  }, {
13964
- children: warnings.map(warning => {
13965
- var _a;
13966
- const phenomenonDetails = warningPhenomena(t).find(phenomenon => phenomenon.key === warning.warningDetail.phenomenon);
13967
- const levelDetails = levelOptions(t).find(level => level.key === warning.warningDetail.level);
13968
- return jsx(ListItem, Object.assign({
14438
+ children: jsxs(Grid, Object.assign({
14439
+ className: "warning-list",
14440
+ container: true,
14441
+ item: true,
14442
+ xs: true,
14443
+ rowSpacing: 0,
14444
+ columnSpacing: 2,
14445
+ alignItems: "center"
14446
+ }, {
14447
+ children: [jsx(WarningListColumnContent, Object.assign({
14448
+ title: t('warning-list-header-incident'),
14449
+ status: status,
14450
+ width: 142
14451
+ }, {
14452
+ children: warning.productStatus !== 'DRAFT' ? warning.warningDetail.incident : ''
14453
+ })), jsx(WarningListColumnContent, Object.assign({
14454
+ title: `${t('warning-list-header-last-update')} UTC`,
14455
+ status: status,
14456
+ width: 142
14457
+ }, {
14458
+ children: warning.lastUpdatedTime && dateUtils.dateToString(dateUtils.utc(warning.lastUpdatedTime), dateUtils.DATE_FORMAT_NAME_OF_DAY_MONTH)
14459
+ })), jsx(WarningListColumnContent, Object.assign({
14460
+ title: `${t('warning-list-header-start-time')} UTC`,
14461
+ status: status,
14462
+ width: 142
14463
+ }, {
14464
+ children: warning.warningDetail.validFrom && dateUtils.dateToString(dateUtils.utc(warning.warningDetail.validFrom), dateUtils.DATE_FORMAT_NAME_OF_DAY_MONTH)
14465
+ })), jsx(WarningListColumnContent, Object.assign({
14466
+ title: `${t('warning-list-header-end-time')} UTC`,
14467
+ status: status,
14468
+ width: 142
14469
+ }, {
14470
+ children: warning.warningDetail.validUntil && dateUtils.dateToString(dateUtils.utc(warning.warningDetail.validUntil), dateUtils.DATE_FORMAT_NAME_OF_DAY_MONTH)
14471
+ })), jsx(WarningListColumnContent, Object.assign({
14472
+ title: t('warning-list-header-domain'),
14473
+ status: status
14474
+ }, {
14475
+ children: warning.warningDetail.domain
14476
+ })), jsx(WarningListColumnContent, Object.assign({
14477
+ title: t('warning-list-header-phenomenon'),
14478
+ status: status,
14479
+ width: 140,
13969
14480
  sx: {
13970
- marginBottom: 0.25,
13971
- minHeight: '32px',
13972
- padding: '0 0',
13973
- backgroundColor: status === 'EXPIRED' ? 'geowebColors.cards.cardContainerDisabled' : 'geowebColors.cards.cardContainer',
13974
- borderColor: status === 'EXPIRED' ? 'geowebColors.cards.cardContainerDisabledBorder' : 'geowebColors.cards.cardContainerBorder',
13975
- borderRadius: 1,
13976
- borderWidth: activeWarningId === warning.id ? '1px' : '1px',
13977
- borderStyle: 'solid'
13978
- },
13979
- secondaryAction: jsx(ToggleMenu, {
13980
- menuTitle: t('warning-list-button-options'),
13981
- tooltipTitle: t('warning-list-button-options'),
13982
- menuPosition: "bottom",
13983
- "aria-label": t('warning-list-button-options'),
13984
- menuItems: getMenuItems(warning),
13985
- buttonIcon: jsx(Options, {})
13986
- })
14481
+ position: 'relative'
14482
+ }
13987
14483
  }, {
13988
- children: jsx(ListItemButton, Object.assign({
14484
+ children: jsxs(Box, Object.assign({
14485
+ display: "flex",
14486
+ justifyContent: "space-between",
13989
14487
  sx: {
13990
- height: '100%',
13991
- padding: 1,
13992
- '.warning-list': {
13993
- justifyContent: 'left'
13994
- },
13995
- [`@container publicWarningList (min-width: ${breakpoints.desktop}px)`]: {
13996
- '.warning-list': {
13997
- justifyContent: 'space-between'
13998
- }
13999
- }
14000
- },
14001
- onClick: () => _onSelectWarning(warning),
14002
- "aria-label": `warning item for ${warning.id}`,
14003
- selected: activeWarningId === warning.id
14488
+ flexGrow: 1
14489
+ }
14004
14490
  }, {
14005
- children: jsxs(Grid, Object.assign({
14006
- className: "warning-list",
14007
- container: true,
14008
- item: true,
14009
- xs: true,
14010
- rowSpacing: 0,
14011
- columnSpacing: 2,
14012
- alignItems: "center"
14491
+ children: [jsx(Box, Object.assign({
14492
+ display: "inline-block",
14493
+ component: "div",
14494
+ ref: textRef,
14495
+ sx: {
14496
+ textOverflow: 'ellipsis',
14497
+ overflow: 'hidden',
14498
+ width: 90,
14499
+ whiteSpace: 'nowrap'
14500
+ }
14013
14501
  }, {
14014
- children: [jsx(WarningListColumnContent, {
14015
- title: t('warning-list-header-incident'),
14016
- status: status,
14017
- width: 142
14018
- }), jsx(WarningListColumnContent, Object.assign({
14019
- title: `${t('warning-list-header-last-update')} UTC`,
14020
- status: status,
14021
- width: 142
14022
- }, {
14023
- children: warning.lastUpdatedTime && dateUtils.dateToString(dateUtils.utc(warning.lastUpdatedTime), dateUtils.DATE_FORMAT_NAME_OF_DAY_MONTH)
14024
- })), jsx(WarningListColumnContent, Object.assign({
14025
- title: `${t('warning-list-header-start-time')} UTC`,
14026
- status: status,
14027
- width: 142
14028
- }, {
14029
- children: warning.warningDetail.validFrom && dateUtils.dateToString(dateUtils.utc(warning.warningDetail.validFrom), dateUtils.DATE_FORMAT_NAME_OF_DAY_MONTH)
14030
- })), jsx(WarningListColumnContent, Object.assign({
14031
- title: `${t('warning-list-header-end-time')} UTC`,
14032
- status: status,
14033
- width: 142
14034
- }, {
14035
- children: warning.warningDetail.validUntil && dateUtils.dateToString(dateUtils.utc(warning.warningDetail.validUntil), dateUtils.DATE_FORMAT_NAME_OF_DAY_MONTH)
14036
- })), jsx(WarningListColumnContent, Object.assign({
14037
- title: t('warning-list-header-domain'),
14038
- status: status
14039
- }, {
14040
- children: warning.warningDetail.domain
14041
- })), jsxs(WarningListColumnContent, Object.assign({
14042
- title: t('warning-list-header-phenomenon'),
14043
- status: status,
14044
- width: 140,
14045
- sx: {
14046
- position: 'relative'
14047
- }
14048
- }, {
14049
- children: [(phenomenonDetails === null || phenomenonDetails === void 0 ? void 0 : phenomenonDetails.title) || '-', jsx(Box, Object.assign({
14050
- sx: {
14051
- position: 'absolute',
14052
- right: 0,
14053
- bottom: -6
14054
- }
14055
- }, {
14056
- children: phenomenonDetails === null || phenomenonDetails === void 0 ? void 0 : phenomenonDetails.icon
14057
- }))]
14058
- })), jsx(WarningListColumnContent, Object.assign({
14059
- title: t('warning-list-header-level'),
14060
- status: status
14061
- }, {
14062
- children: jsx(Box, Object.assign({
14063
- component: "span",
14064
- sx: {
14065
- color: levelDetails === null || levelDetails === void 0 ? void 0 : levelDetails.textColor,
14066
- backgroundColor: levelDetails === null || levelDetails === void 0 ? void 0 : levelDetails.color,
14067
- paddingLeft: 0.5,
14068
- paddingRight: 0.5,
14069
- paddingBottom: '1px',
14070
- marginLeft: -0.5
14071
- }
14072
- }, {
14073
- children: ((_a = warning.warningDetail) === null || _a === void 0 ? void 0 : _a.level) && (levelDetails === null || levelDetails === void 0 ? void 0 : levelDetails.title) || '-'
14074
- }))
14075
- })), jsx(WarningListColumnContent, Object.assign({
14076
- title: t('warning-list-header-status'),
14077
- status: status,
14078
- width: 96
14079
- }, {
14080
- children: jsxs(Box, Object.assign({
14081
- sx: {
14082
- position: 'relative'
14083
- }
14084
- }, {
14085
- children: [getStatusIcon(warning), warning.editor && jsx(Box, Object.assign({
14502
+ children: (() => {
14503
+ if (isOverflowing) {
14504
+ return jsx(CustomTooltip, Object.assign({
14505
+ title: (phenomenonDetails === null || phenomenonDetails === void 0 ? void 0 : phenomenonDetails.translationKey) ? t(phenomenonDetails.translationKey) : '-',
14506
+ placement: "top",
14086
14507
  sx: {
14087
- width: '16px',
14088
- position: 'absolute',
14089
- top: '1px',
14090
- right: '-12px'
14508
+ zIndex: 1000
14091
14509
  }
14092
14510
  }, {
14093
- children: jsx(WarningAvatar, {
14094
- editor: warning.editor
14511
+ children: jsx("span", {
14512
+ children: (phenomenonDetails === null || phenomenonDetails === void 0 ? void 0 : phenomenonDetails.translationKey) ? t(phenomenonDetails.translationKey) : '-'
14095
14513
  })
14096
- }))]
14097
- }))
14098
- }))]
14099
- }))
14514
+ }));
14515
+ }
14516
+ return (phenomenonDetails === null || phenomenonDetails === void 0 ? void 0 : phenomenonDetails.translationKey) ? t(phenomenonDetails.translationKey) : '-';
14517
+ })()
14518
+ })), jsx(Box, Object.assign({
14519
+ sx: {
14520
+ position: 'absolute',
14521
+ right: 0,
14522
+ bottom: -6
14523
+ }
14524
+ }, {
14525
+ children: getPhenomenaIcon(phenomenonDetails === null || phenomenonDetails === void 0 ? void 0 : phenomenonDetails.key)
14526
+ }))]
14100
14527
  }))
14101
- }), warning.id);
14102
- })
14103
- }))]
14528
+ })), jsx(WarningListColumnContent, Object.assign({
14529
+ title: t('warning-list-header-level'),
14530
+ status: status
14531
+ }, {
14532
+ children: jsx(Box, Object.assign({
14533
+ component: "span",
14534
+ sx: getLevelStyle(levelDetails)
14535
+ }, {
14536
+ children: (() => {
14537
+ var _a, _b;
14538
+ if ((_a = warning.warningDetail) === null || _a === void 0 ? void 0 : _a.level) {
14539
+ if (levelDetails === null || levelDetails === void 0 ? void 0 : levelDetails.translationKey) {
14540
+ // Public warning level
14541
+ return t(levelDetails.translationKey);
14542
+ }
14543
+ if ((_b = warning.warningDetail) === null || _b === void 0 ? void 0 : _b.level) {
14544
+ // Aviation level
14545
+ return jsx("span", Object.assign({
14546
+ style: {
14547
+ fontWeight: 'bold'
14548
+ }
14549
+ }, {
14550
+ children: warning.warningDetail.level
14551
+ }));
14552
+ }
14553
+ }
14554
+ return '-';
14555
+ })()
14556
+ }))
14557
+ })), jsx(WarningListColumnContent, Object.assign({
14558
+ title: t('warning-list-header-status'),
14559
+ status: status,
14560
+ width: 96
14561
+ }, {
14562
+ children: jsxs(Box, Object.assign({
14563
+ sx: {
14564
+ position: 'relative'
14565
+ }
14566
+ }, {
14567
+ children: [getStatusIcon(warning), warning.editor && jsx(Box, Object.assign({
14568
+ sx: {
14569
+ width: '16px',
14570
+ position: 'absolute',
14571
+ top: '1px',
14572
+ right: '-12px'
14573
+ }
14574
+ }, {
14575
+ children: jsx(WarningAvatar, {
14576
+ editor: warning.editor
14577
+ })
14578
+ }))]
14579
+ }))
14580
+ }))]
14581
+ }))
14582
+ }))
14583
+ }), warning.id);
14584
+ };
14585
+
14586
+ const useHasScrollbar = (containerRef, scrollRef) => {
14587
+ const [hasScrollbar, setHasScrollbar] = React__default.useState(false);
14588
+ React__default.useEffect(() => {
14589
+ let resizeObserver;
14590
+ if (containerRef && containerRef.current && scrollRef) {
14591
+ resizeObserver = new ResizeObserver(entry => {
14592
+ var _a;
14593
+ const containerHeight = entry[0].target.clientHeight;
14594
+ const scrollHeight = (_a = scrollRef.current) === null || _a === void 0 ? void 0 : _a.scrollHeight;
14595
+ if (scrollHeight !== undefined) {
14596
+ setHasScrollbar(scrollHeight > containerHeight);
14597
+ }
14598
+ });
14599
+ resizeObserver.observe(containerRef.current);
14600
+ }
14601
+ return () => {
14602
+ if (resizeObserver) {
14603
+ resizeObserver.disconnect();
14604
+ }
14605
+ };
14606
+ }, [containerRef, scrollRef]);
14607
+ return hasScrollbar;
14608
+ };
14609
+ const sortWarningsOnStatus = warnings => {
14610
+ return warnings.reduce((allWarnings, warning) => {
14611
+ const status = warning.status || mapProductStatusToWarningStatus(warning.productStatus);
14612
+ if (status === PublicWarningStatus.DRAFT || status === PublicWarningStatus.DRAFT_PUBLISHED) {
14613
+ return Object.assign(Object.assign({}, allWarnings), {
14614
+ draft: allWarnings === null || allWarnings === void 0 ? void 0 : allWarnings.draft.concat(warning)
14615
+ });
14616
+ }
14617
+ if (status === PublicWarningStatus.PUBLISHED) {
14618
+ return Object.assign(Object.assign({}, allWarnings), {
14619
+ published: allWarnings === null || allWarnings === void 0 ? void 0 : allWarnings.published.concat(warning)
14620
+ });
14621
+ }
14622
+ if (status === PublicWarningStatus.TODO) {
14623
+ return Object.assign(Object.assign({}, allWarnings), {
14624
+ todo: allWarnings === null || allWarnings === void 0 ? void 0 : allWarnings.todo.concat(warning)
14625
+ });
14626
+ }
14627
+ if (status === PublicWarningStatus.EXPIRED) {
14628
+ return Object.assign(Object.assign({}, allWarnings), {
14629
+ expired: allWarnings === null || allWarnings === void 0 ? void 0 : allWarnings.expired.concat(warning)
14630
+ });
14631
+ }
14632
+ return allWarnings;
14633
+ }, {
14634
+ todo: [],
14635
+ draft: [],
14636
+ published: [],
14637
+ expired: []
14638
+ });
14639
+ };
14640
+ const WarningListHeaderContent = _a => {
14641
+ var {
14642
+ title,
14643
+ width = 76
14644
+ } = _a,
14645
+ props = __rest(_a, ["title", "width"]);
14646
+ return jsx(Grid, Object.assign({
14647
+ item: true
14648
+ }, props, {
14649
+ sx: Object.assign(Object.assign({}, props.sx), {
14650
+ width
14651
+ })
14652
+ }, {
14653
+ children: jsx(Box, Object.assign({
14654
+ sx: {
14655
+ overflow: 'hidden',
14656
+ fontWeight: 'normal',
14657
+ textOverflow: 'ellipsis',
14658
+ fontSize: 12,
14659
+ lineHeight: 1.33,
14660
+ height: 16,
14661
+ color: 'geowebColors.captions.captionStatus.rgba'
14662
+ }
14663
+ }, {
14664
+ children: title
14665
+ }))
14104
14666
  }));
14105
14667
  };
14106
14668
  const PublicWarningList = ({
14107
- warnings,
14669
+ warnings: _warnings = [],
14108
14670
  filters,
14109
14671
  isLoading: _isLoading = false,
14110
14672
  error,
14111
14673
  selectedPublicWarningId: _selectedPublicWarningId = '',
14112
14674
  lastUpdatedTime,
14113
- onSelectWarning: _onSelectWarning2 = () => {},
14114
- onEditWarning: _onEditWarning2 = () => {},
14675
+ showSigmet,
14676
+ showAirmet,
14677
+ setShowSigmet,
14678
+ setShowAirmet,
14679
+ onSelectWarning: _onSelectWarning = () => {},
14680
+ onEditWarning: _onEditWarning = () => {},
14115
14681
  onCreateWarning: _onCreateWarning = () => {},
14116
- onDeleteWarning: _onDeleteWarning2 = () => {},
14682
+ onDeleteWarning: _onDeleteWarning = () => {},
14117
14683
  onRefetchWarnings: _onRefetchWarnings = () => {},
14118
- onDeleteReviewWarning: _onDeleteReviewWarning2 = () => {},
14684
+ onDeleteReviewWarning: _onDeleteReviewWarning = () => {},
14119
14685
  onClickAllChip: _onClickAllChip = () => {},
14120
14686
  isAllChipSelected: _isAllChipSelected = true
14121
14687
  }) => {
14122
14688
  const {
14123
14689
  t
14124
14690
  } = useWarningsTranslation();
14125
- const sortedWarnings = warnings ? sortWarningsOnStatus(warnings) : null;
14691
+ const sortedWarnings = sortWarningsOnStatus(_warnings);
14692
+ const items = [{
14693
+ status: PublicWarningStatus.TODO,
14694
+ totalWarnings: sortedWarnings.todo.length
14695
+ }, ...sortedWarnings.todo, {
14696
+ status: PublicWarningStatus.DRAFT,
14697
+ totalWarnings: sortedWarnings.draft.length
14698
+ }, ...sortedWarnings.draft, {
14699
+ status: PublicWarningStatus.PUBLISHED,
14700
+ totalWarnings: sortedWarnings.published.length
14701
+ }, ...sortedWarnings.published, {
14702
+ status: PublicWarningStatus.EXPIRED,
14703
+ totalWarnings: sortedWarnings.expired.length
14704
+ }, ...sortedWarnings.expired];
14705
+ const getItemSize = (index, width) => {
14706
+ const item = items[index];
14707
+ if (item.totalWarnings !== undefined) {
14708
+ return 36;
14709
+ }
14710
+ if (width <= 400) {
14711
+ return 201;
14712
+ }
14713
+ if (width <= 500) {
14714
+ return 101;
14715
+ }
14716
+ if (width <= breakpoints.tablet) {
14717
+ return 81;
14718
+ }
14719
+ if (width <= breakpoints.desktop) {
14720
+ return 71;
14721
+ }
14722
+ return 34;
14723
+ };
14724
+ const filterRef = React__default.useRef(null);
14725
+ const scrollContainerRef = React__default.useRef(null);
14726
+ const listRef = React__default.useRef(null);
14727
+ const listInnerRef = React__default.useRef(null);
14728
+ const resetListIndex = () => {
14729
+ if (listRef.current) {
14730
+ listRef.current.resetAfterIndex(0, true);
14731
+ }
14732
+ };
14733
+ React__default.useEffect(() => {
14734
+ if (listRef.current) {
14735
+ resetListIndex();
14736
+ }
14737
+ }, [_warnings]);
14738
+ const filterHeight = useGetFilterHeight(filterRef);
14739
+ const hasScrollbar = useHasScrollbar(scrollContainerRef, listInnerRef);
14126
14740
  return jsxs(Box, Object.assign({
14127
14741
  sx: {
14128
14742
  padding: 3,
14129
14743
  height: '100%',
14130
- overflowY: 'auto',
14744
+ overflowY: 'hidden',
14131
14745
  containerName: 'publicWarningList',
14132
14746
  containerType: 'inline-size'
14133
14747
  },
14134
14748
  "data-testid": "publicWarningList"
14135
14749
  }, {
14136
14750
  children: [jsxs(Grid, Object.assign({
14137
- container: true
14751
+ container: true,
14752
+ justifyItems: "flex-end",
14753
+ ref: filterRef,
14754
+ sx: {
14755
+ [`@container publicWarningList (max-width: ${breakpoints.tablet}px)`]: {
14756
+ ' .MuiGrid-grid-sm-12': {
14757
+ maxWidth: '100%',
14758
+ flexBasis: '100%'
14759
+ },
14760
+ ' .warning-filter': {
14761
+ order: 2
14762
+ },
14763
+ ' .create-warning': {
14764
+ order: 1
14765
+ }
14766
+ }
14767
+ }
14138
14768
  }, {
14139
14769
  children: [jsx(Grid, Object.assign({
14770
+ className: "warning-filter",
14140
14771
  item: true,
14141
14772
  xs: 12,
14142
- sm: true
14773
+ sm: 12,
14774
+ md: 8,
14775
+ order: {
14776
+ xs: 2,
14777
+ md: 1
14778
+ }
14143
14779
  }, {
14144
14780
  children: jsx(FilterList, {
14145
14781
  filters: filters,
14146
14782
  isAllSelected: _isAllChipSelected,
14147
- onClickAll: _onClickAllChip
14783
+ onClickAll: _onClickAllChip,
14784
+ showSigmet: showSigmet,
14785
+ showAirmet: showAirmet,
14786
+ setShowSigmet: setShowSigmet,
14787
+ setShowAirmet: setShowAirmet
14148
14788
  })
14149
- })), jsx(Grid, Object.assign({
14789
+ })), jsxs(Grid, Object.assign({
14790
+ className: "create-warning",
14150
14791
  item: true,
14151
- xs: "auto"
14792
+ xs: 12,
14793
+ sm: 12,
14794
+ md: 4,
14795
+ order: {
14796
+ xs: 1,
14797
+ md: 2
14798
+ },
14799
+ sx: {
14800
+ display: 'flex'
14801
+ },
14802
+ justifyContent: "flex-end",
14803
+ alignItems: "self-start"
14152
14804
  }, {
14153
- children: jsx(Button, Object.assign({
14805
+ children: [lastUpdatedTime && jsx(Box, Object.assign({
14806
+ sx: {
14807
+ float: 'left',
14808
+ minWidth: 140,
14809
+ paddingTop: 0.5
14810
+ }
14811
+ }, {
14812
+ children: jsx(LastUpdateTime, {
14813
+ onPressRefresh: _onRefetchWarnings,
14814
+ lastUpdateTime: lastUpdatedTime
14815
+ })
14816
+ })), jsx(Button, Object.assign({
14154
14817
  variant: "primary",
14155
14818
  onClick: _onCreateWarning,
14156
14819
  sx: {
@@ -14158,22 +14821,19 @@ const PublicWarningList = ({
14158
14821
  marginBottom: '8px',
14159
14822
  fontSize: '12px',
14160
14823
  height: '32px',
14161
- whiteSpace: 'nowrap'
14824
+ whiteSpace: 'nowrap',
14825
+ minWidth: 'auto'
14162
14826
  }
14163
14827
  }, {
14164
14828
  children: t('warning-list-button_create')
14165
- }))
14829
+ }))]
14166
14830
  }))]
14167
14831
  })), error && jsx(AlertBanner, {
14168
14832
  title: error.message,
14169
14833
  shouldClose: true
14170
- }), _isLoading ? jsx(LinearProgress, {
14834
+ }), _isLoading && jsx(LinearProgress, {
14171
14835
  "data-testid": "loading-bar",
14172
14836
  color: "secondary"
14173
- }) : jsx(Box, {
14174
- sx: {
14175
- height: '4px'
14176
- }
14177
14837
  }), !error && jsxs(Grid, Object.assign({
14178
14838
  container: true,
14179
14839
  rowSpacing: 0,
@@ -14183,9 +14843,12 @@ const PublicWarningList = ({
14183
14843
  sx: {
14184
14844
  maxWidth: '100%',
14185
14845
  display: 'none',
14186
- [`@container publicWarningList (min-width: ${breakpoints.desktop}px)`]: {
14846
+ marginTop: '4px',
14847
+ [`@container publicWarningList (min-width: ${breakpoints.desktop}px)`]: Object.assign({
14187
14848
  display: 'flex'
14188
- }
14849
+ }, hasScrollbar && {
14850
+ paddingRight: 2
14851
+ })
14189
14852
  }
14190
14853
  }, {
14191
14854
  children: [jsx(WarningListHeaderContent, {
@@ -14217,53 +14880,57 @@ const PublicWarningList = ({
14217
14880
  marginRight: '48px'
14218
14881
  }
14219
14882
  })]
14220
- })), lastUpdatedTime && jsx(Box, Object.assign({
14883
+ })), sortedWarnings && !error && jsx(Box, Object.assign({
14884
+ "data-testid": "warnings-list",
14221
14885
  sx: {
14222
- marginBottom: -3.25,
14223
- button: {
14224
- marginRight: 0
14225
- }
14226
- }
14886
+ height: `calc(100% - ${filterHeight}px)`,
14887
+ minHeight: '206px'
14888
+ },
14889
+ ref: scrollContainerRef
14227
14890
  }, {
14228
- children: jsx(LastUpdateTime, {
14229
- onPressRefresh: _onRefetchWarnings,
14230
- lastUpdateTime: lastUpdatedTime
14231
- })
14232
- })), sortedWarnings && !error && jsxs(Fragment, {
14233
- children: [jsx(WarningsOnStatus, {
14234
- status: "TODO",
14235
- warnings: sortedWarnings.todo,
14236
- onSelectWarning: _onSelectWarning2,
14237
- onEditWarning: _onEditWarning2,
14238
- onDeleteWarning: _onDeleteWarning2,
14239
- onDeleteReviewWarning: _onDeleteReviewWarning2,
14240
- activeWarningId: _selectedPublicWarningId
14241
- }), jsx(WarningsOnStatus, {
14242
- status: "DRAFT",
14243
- warnings: sortedWarnings.draft,
14244
- onSelectWarning: _onSelectWarning2,
14245
- onEditWarning: _onEditWarning2,
14246
- onDeleteWarning: _onDeleteWarning2,
14247
- onDeleteReviewWarning: _onDeleteReviewWarning2,
14248
- activeWarningId: _selectedPublicWarningId
14249
- }), jsx(WarningsOnStatus, {
14250
- status: "PUBLISHED",
14251
- warnings: sortedWarnings.published,
14252
- onSelectWarning: _onSelectWarning2,
14253
- onEditWarning: _onEditWarning2,
14254
- onDeleteWarning: _onDeleteWarning2,
14255
- onDeleteReviewWarning: _onDeleteReviewWarning2,
14256
- activeWarningId: _selectedPublicWarningId
14257
- }), jsx(WarningsOnStatus, {
14258
- status: "EXPIRED",
14259
- warnings: sortedWarnings.expired,
14260
- onSelectWarning: _onSelectWarning2,
14261
- onEditWarning: _onEditWarning2,
14262
- onDeleteWarning: _onDeleteWarning2,
14263
- onDeleteReviewWarning: _onDeleteReviewWarning2,
14264
- activeWarningId: _selectedPublicWarningId
14265
- })]
14266
- })]
14891
+ children: jsx(AutoSizer, Object.assign({
14892
+ onResize: resetListIndex
14893
+ }, {
14894
+ children: ({
14895
+ height: _height = 0,
14896
+ width: _width = 0
14897
+ }) => jsx(VariableSizeList, Object.assign({
14898
+ height: _height,
14899
+ width: _width,
14900
+ itemCount: items.length,
14901
+ itemSize: index => getItemSize(index, _width),
14902
+ ref: listRef,
14903
+ innerRef: listInnerRef
14904
+ }, {
14905
+ children: ({
14906
+ index,
14907
+ style
14908
+ }) => {
14909
+ const warning = items[index];
14910
+ const key = `warning-${warning.status}-${index}`;
14911
+ if (warning.totalWarnings !== undefined) {
14912
+ const header = warning;
14913
+ return jsx(WarningListItemSeperator, {
14914
+ status: header.status,
14915
+ totalWarnings: header.totalWarnings,
14916
+ style: style
14917
+ }, key);
14918
+ }
14919
+ const publicWarning = warning;
14920
+ return jsx(WarningListItem, {
14921
+ style: style,
14922
+ status: publicWarning.status,
14923
+ warning: publicWarning,
14924
+ onSelectWarning: _onSelectWarning,
14925
+ onEditWarning: _onEditWarning,
14926
+ onDeleteWarning: _onDeleteWarning,
14927
+ onDeleteReviewWarning: _onDeleteReviewWarning,
14928
+ activeWarningId: _selectedPublicWarningId
14929
+ }, key);
14930
+ }
14931
+ }))
14932
+ }))
14933
+ }))]
14267
14934
  }));
14268
14935
  };
14269
14936
 
@@ -14448,13 +15115,25 @@ const PublicWarningListConnect = () => {
14448
15115
  const {
14449
15116
  auth
14450
15117
  } = useAuthenticationContext();
15118
+ const {
15119
+ data: airmetList,
15120
+ refetch: refetchAirmetList,
15121
+ isFetching: isFetchingAirmet
15122
+ } = useAirmetList();
15123
+ const {
15124
+ data: sigmetList,
15125
+ refetch: refetchSigmetList,
15126
+ isFetching: isFetchingSigmet
15127
+ } = useSigmetList();
15128
+ const [showAirmet, setShowAirmet] = React__default.useState(false);
15129
+ const [showSigmet, setShowSigmet] = React__default.useState(false);
14451
15130
  const [confirmDialogOptions, setConfirmDialogOptions] = React__default.useState(undefined);
14452
15131
  const filters = useSelector(selectAllFilters);
14453
15132
  const isAllChipSelected = useSelector(getIsAllSelected);
14454
15133
  const filteredWarnings = useSelector(getFilteredWarnings);
14455
15134
  const warnings = useSelector(selectAllPublicWarnings);
14456
15135
  const selectedPublicWarningId = useSelector(getSelectedPublicWarningId);
14457
- const isLoading = useSelector(isPublicWarningsLoading);
15136
+ const isLoading = useSelector(isPublicWarningsLoading || isFetchingAirmet || isFetchingSigmet);
14458
15137
  const error = useSelector(getPublicWarningsError);
14459
15138
  const isFormDirty = useSelector(getSelectedPublicIsFormDirty);
14460
15139
  const lastUpdatedTime = useSelector(getPublicWarningsLastUpdatedTime);
@@ -14510,7 +15189,7 @@ const PublicWarningListConnect = () => {
14510
15189
  };
14511
15190
  const deleteReviewWarning = warning => {
14512
15191
  const ignoredWarning = Object.assign(Object.assign({}, warning), {
14513
- status: 'IGNORED'
15192
+ status: PublicWarningStatus.IGNORED
14514
15193
  });
14515
15194
  setConfirmDialogOptions({
14516
15195
  confirmLabel: t('warning-dialog-delete-confirm'),
@@ -14534,8 +15213,10 @@ const PublicWarningListConnect = () => {
14534
15213
  fetchWarnings();
14535
15214
  };
14536
15215
  const fetchWarnings = React__default.useCallback(() => {
15216
+ refetchAirmetList();
15217
+ refetchSigmetList();
14537
15218
  dispatch(publicWarningActions.fetchWarnings());
14538
- }, [dispatch]);
15219
+ }, [dispatch, refetchAirmetList, refetchSigmetList]);
14539
15220
  const onClickAllChip = React__default.useCallback(isChecked => {
14540
15221
  dispatch(publicWarningActions.toggleAllFilters({
14541
15222
  isChecked
@@ -14551,9 +15232,15 @@ const PublicWarningListConnect = () => {
14551
15232
  warnings
14552
15233
  }));
14553
15234
  }, [dispatch, warnings]);
15235
+ const transformedSigmets = (sigmetList === null || sigmetList === void 0 ? void 0 : sigmetList.map(transformSigmetToWarningFormat)) || [];
15236
+ const transformedAirmets = (airmetList === null || airmetList === void 0 ? void 0 : airmetList.map(transformAirmetToWarningFormat)) || [];
15237
+ const combinedWarnings = filteredWarnings.concat(showSigmet ? transformedSigmets : []).concat(showAirmet ? transformedAirmets : []).sort((w1, w2) => {
15238
+ var _a;
15239
+ return ((_a = w2.lastUpdatedTime) === null || _a === void 0 ? void 0 : _a.localeCompare(w1.lastUpdatedTime || '')) || 0;
15240
+ });
14554
15241
  return jsxs(Fragment, {
14555
15242
  children: [jsx(PublicWarningList, {
14556
- warnings: filteredWarnings,
15243
+ warnings: combinedWarnings,
14557
15244
  isLoading: isLoading,
14558
15245
  error: error,
14559
15246
  onSelectWarning: selectWarning,
@@ -14566,7 +15253,11 @@ const PublicWarningListConnect = () => {
14566
15253
  onRefetchWarnings: fetchWarnings,
14567
15254
  filters: filters,
14568
15255
  isAllChipSelected: isAllChipSelected,
14569
- onClickAllChip: onClickAllChip
15256
+ onClickAllChip: onClickAllChip,
15257
+ showSigmet: showSigmet,
15258
+ showAirmet: showAirmet,
15259
+ setShowSigmet: setShowSigmet,
15260
+ setShowAirmet: setShowAirmet
14570
15261
  }), confirmDialogOptions && jsx(ConfirmDeleteWarningDialog, {
14571
15262
  onClose: () => setConfirmDialogOptions(undefined),
14572
15263
  title: confirmDialogOptions.title,