@opengeoweb/warnings 12.10.0 → 12.12.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 +1159 -556
- package/package.json +15 -12
- package/src/lib/api/warning-api/api.d.ts +2 -2
- package/src/lib/api/warning-api/hooks.d.ts +3 -2
- package/src/lib/components/AreaObjectLoader/AreaObjectLoader.stories.d.ts +1 -1
- package/src/lib/components/ComponentsLookUp/ComponentsLookUp.d.ts +1 -1
- package/src/lib/components/DrawingTool/DrawingTool.stories.d.ts +1 -1
- package/src/lib/components/FilterList/ExpandableFilterChip.d.ts +0 -1
- package/src/lib/components/FilterList/filter-utils.d.ts +49 -4
- package/src/lib/components/MaritimeWarningsForm/AreaList/AreaList.d.ts +4 -2
- package/src/lib/components/MaritimeWarningsForm/AssignedAreas/AssignedAreas.d.ts +2 -0
- package/src/lib/components/MaritimeWarningsForm/AssignedAreas/AssignedAreas.spec.d.ts +1 -0
- package/src/lib/components/MaritimeWarningsForm/MaritimeWarningsAvatar.d.ts +8 -0
- package/src/lib/components/MaritimeWarningsForm/MaritimeWarningsForm.d.ts +4 -0
- package/src/lib/components/MaritimeWarningsForm/MaritimeWarningsForm.spec.d.ts +1 -0
- package/src/lib/components/MaritimeWarningsForm/MaritimeWarningsForm.stories.d.ts +8 -4
- package/src/lib/components/MaritimeWarningsForm/MaritimeWarningsFormConnect.d.ts +2 -0
- package/src/lib/components/MaritimeWarningsForm/MaritimeWarningsFormConnect.stories.d.ts +1 -1
- package/src/lib/components/MaritimeWarningsForm/WarningList/WarningList.d.ts +2 -0
- package/src/lib/components/MaritimeWarningsForm/WarningList/WarningListItem.d.ts +3 -1
- package/src/lib/components/MaritimeWarningsForm/WarningList/WarningListSelect.d.ts +2 -2
- package/src/lib/components/MaritimeWarningsForm/WarningList/WindForceSelect.d.ts +4 -2
- package/src/lib/components/MaritimeWarningsForm/{MartitimeWarningsForm.spec.d.ts → testUtils.d.ts} +1 -0
- package/src/lib/components/MaritimeWarningsForm/useConfirmRetractDialog.d.ts +11 -0
- package/src/lib/components/MaritimeWarningsForm/useFilterChipSelect.d.ts +12 -0
- package/src/lib/components/MaritimeWarningsForm/useFilterChipSelect.spec.d.ts +1 -0
- package/src/lib/components/MaritimeWarningsForm/useMaritimeWarningsFormState.d.ts +9 -1
- package/src/lib/components/MaritimeWarningsForm/utils.d.ts +6 -0
- package/src/lib/components/MaritimeWarningsForm/utils.spec.d.ts +1 -0
- package/src/lib/components/ObjectManager/ObjectManager.stories.d.ts +17 -18
- package/src/lib/components/ObjectManager/ObjectManagerConnect.stories.d.ts +1 -1
- package/src/lib/components/PublicWarningList/NewWarningButton/NewWarningButton.stories.d.ts +1 -1
- package/src/lib/components/PublicWarningList/PublicWarningListConnect.stories.d.ts +2 -2
- package/src/lib/components/PublicWarningsForm/AreaField/AreaField.stories.d.ts +2 -3
- package/src/lib/components/PublicWarningsForm/DescriptionField/DescriptionField.stories.d.ts +1 -1
- package/src/lib/components/PublicWarningsForm/PublicWarningsForm.stories.d.ts +1 -1
- package/src/lib/components/PublicWarningsFormDialog/PublicWarningsFormDialog.d.ts +3 -3
- package/src/lib/components/PublicWarningsFormDialog/PublicWarningsFormDialog.stories.d.ts +1 -1
- package/src/lib/store/publicWarningForm/types.d.ts +12 -2
- package/src/lib/utils/sig-airmet-util.d.ts +3 -3
package/index.esm.js
CHANGED
|
@@ -3,7 +3,7 @@ import { useDispatch, useSelector } from 'react-redux';
|
|
|
3
3
|
import { Polygons, ExitDomain, Share, Edit, Delete, CoastalEvent, TemperatureLow, TemperatureHigh, Rain, Snow, Lightning, Fog, Wind, Thunderstorm, VulcanicEruption, Haze, FreezingPrecipitation, ModerateAircraftIcing, SevereAircraftIcing, ModerateTurbulence, SevereTurbulence, SandStorm, RadioactiveMaterials, DrawPolygon, Visibility, Add, ArrowUpCompact, ArrowDownCompact, breakpoints, DragHandle, Options, Close, ChevronDown, ChevronUp, Copy, Update, Cancel, Success, Expire, Remove } from '@opengeoweb/theme';
|
|
4
4
|
import { uiTypes, uiActions, getSingularDrawtoolDrawLayerId, drawingToolSelectors, layerSelectors, uiSelectors, drawingToolActions, layerActions, mapListener, layersListener, drawingToolListener, syncGroupsListener, openlayersListener, syncGroupsReducer, drawingToolReducer, uiReducer, layerReducer, mapReducer, useSetupDialog, genericSelectors, useUpdateSharedData, genericActions, selectorMemoizationOptions } from '@opengeoweb/store';
|
|
5
5
|
import { defaultPolygon, emptyGeoJSON, MapControlButton, getIcon, rewindGeometry, getGeoJSONPropertyValue, currentlySupportedDrawModes, defaultLayers, viewUtils, OpenLayersMapView, MapControls, OpenLayersZoomControl, OpenLayersLayer, OpenLayersFeatureLayer, genericOpenLayersFeatureStyle } from '@opengeoweb/webmap-react';
|
|
6
|
-
import { SHARED_NAMESPACE, useConfirmationDialog, dateUtils, ToggleMenu, calculateStartSize, ToolContainerDraggable, AlertBanner, sessionStorageProvider, ConfirmationDialog, usePrevious, CustomIconButton, CustomTooltip, Avatar, getInitials, SwitchButton, FilterChip, TooltipSelect, CustomToggleButton, Filter, FilterOption, StatusTag, LastUpdateTime, getAxiosErrorMessage, ErrorBoundary } from '@opengeoweb/shared';
|
|
6
|
+
import { SHARED_NAMESPACE, useConfirmationDialog, dateUtils, ToggleMenu, calculateStartSize, ToolContainerDraggable, AlertBanner, sessionStorageProvider, ConfirmationDialog, usePrevious, CustomIconButton, CustomTooltip, Avatar, getInitials, SwitchButton, FilterChip, TooltipSelect, usePreventBrowserClose, CustomToggleButton, Filter, FilterOption, StatusTag, LastUpdateTime, getAxiosErrorMessage, ErrorBoundary } from '@opengeoweb/shared';
|
|
7
7
|
import { createEntityAdapter, createSlice, createSelector, createListenerMiddleware, current, combineReducers, configureStore } from '@reduxjs/toolkit';
|
|
8
8
|
import { defaultBbox } from '@opengeoweb/core';
|
|
9
9
|
import { FORM_FIELDS_NAMESPACE, useDraftFormHelpers, ReactHookFormSelect, ReactHookFormHiddenInput, isValidGeoJsonCoordinates, ReactHookFormTextField, ReactHookFormProvider, defaultFormOptions, errorMessages, isEmpty, ReactHookFormDateTime, isXHoursAfter, isXHoursBefore } from '@opengeoweb/form-fields';
|
|
@@ -14,7 +14,7 @@ import { useTranslation } from 'react-i18next';
|
|
|
14
14
|
import * as React from 'react';
|
|
15
15
|
import React__default, { useState, useEffect, useRef, useMemo, useCallback } from 'react';
|
|
16
16
|
import { useAuthenticationContext as useAuthenticationContext$1 } from '@opengeoweb/authentication';
|
|
17
|
-
import { styled, Box, Typography, ListItem, Paper, ListItemButton, Stack, Grid, LinearProgress, Button, MenuItem, FormHelperText, Card, CardContent, Tabs, Tab, useTheme, FormControl,
|
|
17
|
+
import { styled, Box, Typography, ListItem, Paper, ListItemButton, Stack, Grid, LinearProgress, Button, MenuItem, FormHelperText, Card, CardContent, Tabs, Tab, useTheme, FormControl, CircularProgress, Menu, DialogTitle, DialogContent, Switch, ListItemText } from '@mui/material';
|
|
18
18
|
import { VariableSizeList } from 'react-window';
|
|
19
19
|
import AutoSizer from 'react-virtualized-auto-sizer';
|
|
20
20
|
import { getHeaders, handleResponse, AirmetPhenomena, SigmetPhenomena, useAuthQuery, useAuthenticationContext, optimisticUpdate, ProductStatus } from '@opengeoweb/api';
|
|
@@ -245,7 +245,24 @@ var en = {
|
|
|
245
245
|
"maritime-direction-wnw": "West to Northwest",
|
|
246
246
|
"maritime-direction-nw": "Northwest",
|
|
247
247
|
"maritime-direction-nwn": "Northwest to North",
|
|
248
|
-
"maritime-delete-button": "Delete"
|
|
248
|
+
"maritime-delete-button": "Delete",
|
|
249
|
+
"maritime-retract-warning": "Retract warning",
|
|
250
|
+
"maritime-no-change-of-direction": "(no change of direction)",
|
|
251
|
+
"maritime-retract-dialog-no-change": "(no change in direction)",
|
|
252
|
+
"maritime-retract-dialog-description-suffix": "will be removed",
|
|
253
|
+
"maritime-retract-dialog-empty-warning-description": "The warning will be retracted",
|
|
254
|
+
"maritime-retract-dialog-confirm": "Retract",
|
|
255
|
+
"maritime-retract-success": "Warning retracted successfully",
|
|
256
|
+
"maritime-clear-dialog-title": "Clear all",
|
|
257
|
+
"maritime-clear-dialog-description": "All warnings will be removed from the list",
|
|
258
|
+
"maritime-clear-success": "Warning list cleared successfully",
|
|
259
|
+
"maritime-warning-title-coastal": "Warning Maritime - Coastal Waters",
|
|
260
|
+
"maritime-warning-title-northsea": "Warning Maritime - North Sea Districts",
|
|
261
|
+
"maritime-domain-coastal": "Coastal Waters",
|
|
262
|
+
"maritime-domain-northsea": "North Sea Districts",
|
|
263
|
+
"maritime-editor-on": "You are now the editor of the Maritime Warnings for {{domain}}",
|
|
264
|
+
"maritime-editor-off": "You are now no longer the editor of the Maritime Warnings for {{domain}}",
|
|
265
|
+
"maritime-warning-post-success": "Warning published successfully"
|
|
249
266
|
};
|
|
250
267
|
var nl = {
|
|
251
268
|
"drawing-tool-form-tools": "Gereedschap",
|
|
@@ -279,7 +296,7 @@ var nl = {
|
|
|
279
296
|
"object-manager-object-selected": "object geselecteerd",
|
|
280
297
|
"object-manager-share-menu": "Object delen naar",
|
|
281
298
|
"public-warning-title": "Publieke Waarschuwing",
|
|
282
|
-
"maritime-warning-coastal-title": "
|
|
299
|
+
"maritime-warning-coastal-title": "Kustgebieden",
|
|
283
300
|
"maritime-warning-northsea-title": "Noordzee Districten",
|
|
284
301
|
"close-warning-dialog-title": "Waarschuwing sluiten",
|
|
285
302
|
"warning-edit-mode-title": "Wissel naar bewerken",
|
|
@@ -429,7 +446,19 @@ var nl = {
|
|
|
429
446
|
"maritime-direction-wnw": "West tot noordwest",
|
|
430
447
|
"maritime-direction-nw": "Noordwest",
|
|
431
448
|
"maritime-direction-nwn": "Noordwest tot noord",
|
|
432
|
-
"maritime-delete-button": "Verwijderen"
|
|
449
|
+
"maritime-delete-button": "Verwijderen",
|
|
450
|
+
"maritime-retract-warning": "Waarschuwing intrekken",
|
|
451
|
+
"maritime-retract-dialog-no-change": "(geen wijziging in richting)",
|
|
452
|
+
"maritime-retract-dialog-empty-warning-description": "De waarschuwing wordt verwijderd",
|
|
453
|
+
"maritime-retract-dialog-description-suffix": "wordt verwijderd",
|
|
454
|
+
"maritime-retract-dialog-confirm": "Intrekken",
|
|
455
|
+
"maritime-retract-success": "Waarschuwing succesvol ingetrokken",
|
|
456
|
+
"maritime-clear-dialog-title": "Wissen",
|
|
457
|
+
"maritime-clear-dialog-description": "Alle waarschuwingen worden verwijderd",
|
|
458
|
+
"maritime-clear-success": "Alle waarchuwingen zijn verwijderd",
|
|
459
|
+
"maritime-warning-title-coastal": "Maritieme Waarschuwing - Kustgebieden",
|
|
460
|
+
"maritime-warning-title-northsea": "Maritieme Waarschuwing - Noordzee Districten",
|
|
461
|
+
"maritime-warning-post-success": "Waarschuwing succesvol gepubliceerd"
|
|
433
462
|
};
|
|
434
463
|
var fi = {
|
|
435
464
|
"drawing-tool-form-tools": "Työkalut",
|
|
@@ -581,7 +610,9 @@ var fi = {
|
|
|
581
610
|
"aviation-discard-success": "{{warningType}} er forkastet!",
|
|
582
611
|
"error-auth-login": "Tämän toiminnallisuuden käyttäminen vaatii tunnistautumista. Kirjaudu sisään jatkaaksesi",
|
|
583
612
|
"cancel-warningType": "Peruuta {{warningType}}",
|
|
584
|
-
cancelling: "Peruuttaminen"
|
|
613
|
+
cancelling: "Peruuttaminen",
|
|
614
|
+
"maritime-editor-off": "Et ole enää {{domain}} -merivaroitusten muokkaaja",
|
|
615
|
+
"maritime-warning-post-success": "Varoitus julkaistu onnistuneesti"
|
|
585
616
|
};
|
|
586
617
|
var no = {
|
|
587
618
|
"drawing-tool-form-tools": "Verktøy",
|
|
@@ -742,6 +773,9 @@ var warningsTranslations = {
|
|
|
742
773
|
no: no
|
|
743
774
|
};
|
|
744
775
|
|
|
776
|
+
function _OverloadYield(e, d) {
|
|
777
|
+
this.v = e, this.k = d;
|
|
778
|
+
}
|
|
745
779
|
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
746
780
|
try {
|
|
747
781
|
var i = n[a](c),
|
|
@@ -776,306 +810,248 @@ function _objectWithoutPropertiesLoose(r, e) {
|
|
|
776
810
|
}
|
|
777
811
|
return t;
|
|
778
812
|
}
|
|
779
|
-
function
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
813
|
+
function _regenerator() {
|
|
814
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
815
|
+
var e,
|
|
816
|
+
t,
|
|
817
|
+
r = "function" == typeof Symbol ? Symbol : {},
|
|
818
|
+
n = r.iterator || "@@iterator",
|
|
819
|
+
o = r.toStringTag || "@@toStringTag";
|
|
820
|
+
function i(r, n, o, i) {
|
|
821
|
+
var c = n && n.prototype instanceof Generator ? n : Generator,
|
|
822
|
+
u = Object.create(c.prototype);
|
|
823
|
+
return _regeneratorDefine(u, "_invoke", function (r, n, o) {
|
|
824
|
+
var i,
|
|
825
|
+
c,
|
|
826
|
+
u,
|
|
827
|
+
f = 0,
|
|
828
|
+
p = o || [],
|
|
829
|
+
y = false,
|
|
830
|
+
G = {
|
|
831
|
+
p: 0,
|
|
832
|
+
n: 0,
|
|
833
|
+
v: e,
|
|
834
|
+
a: d,
|
|
835
|
+
f: d.bind(e, 4),
|
|
836
|
+
d: function (t, r) {
|
|
837
|
+
return i = t, c = 0, u = e, G.n = r, a;
|
|
838
|
+
}
|
|
839
|
+
};
|
|
840
|
+
function d(r, n) {
|
|
841
|
+
for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
|
|
842
|
+
var o,
|
|
843
|
+
i = p[t],
|
|
844
|
+
d = G.p,
|
|
845
|
+
l = i[2];
|
|
846
|
+
r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));
|
|
847
|
+
}
|
|
848
|
+
if (o || r > 1) return a;
|
|
849
|
+
throw y = true, n;
|
|
850
|
+
}
|
|
851
|
+
return function (o, p, l) {
|
|
852
|
+
if (f > 1) throw TypeError("Generator is already running");
|
|
853
|
+
for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
|
|
854
|
+
i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
|
|
855
|
+
try {
|
|
856
|
+
if (f = 2, i) {
|
|
857
|
+
if (c || (o = "next"), t = i[o]) {
|
|
858
|
+
if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
|
|
859
|
+
if (!t.done) return t;
|
|
860
|
+
u = t.value, c < 2 && (c = 0);
|
|
861
|
+
} else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
|
|
862
|
+
i = e;
|
|
863
|
+
} else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
|
|
864
|
+
} catch (t) {
|
|
865
|
+
i = e, c = 1, u = t;
|
|
866
|
+
} finally {
|
|
867
|
+
f = 1;
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
return {
|
|
871
|
+
value: t,
|
|
872
|
+
done: y
|
|
873
|
+
};
|
|
827
874
|
};
|
|
828
|
-
}
|
|
875
|
+
}(r, o, i), true), u;
|
|
829
876
|
}
|
|
830
|
-
|
|
831
|
-
var h = "suspendedStart",
|
|
832
|
-
l = "suspendedYield",
|
|
833
|
-
f = "executing",
|
|
834
|
-
s = "completed",
|
|
835
|
-
y = {};
|
|
877
|
+
var a = {};
|
|
836
878
|
function Generator() {}
|
|
837
879
|
function GeneratorFunction() {}
|
|
838
880
|
function GeneratorFunctionPrototype() {}
|
|
839
|
-
|
|
840
|
-
|
|
881
|
+
t = Object.getPrototypeOf;
|
|
882
|
+
var c = [][n] ? t(t([][n]())) : (_regeneratorDefine(t = {}, n, function () {
|
|
883
|
+
return this;
|
|
884
|
+
}), t),
|
|
885
|
+
u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
|
|
886
|
+
function f(e) {
|
|
887
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
|
|
888
|
+
}
|
|
889
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine(u), _regeneratorDefine(u, o, "Generator"), _regeneratorDefine(u, n, function () {
|
|
841
890
|
return this;
|
|
891
|
+
}), _regeneratorDefine(u, "toString", function () {
|
|
892
|
+
return "[object Generator]";
|
|
893
|
+
}), (_regenerator = function () {
|
|
894
|
+
return {
|
|
895
|
+
w: i,
|
|
896
|
+
m: f
|
|
897
|
+
};
|
|
898
|
+
})();
|
|
899
|
+
}
|
|
900
|
+
function _regeneratorAsync(n, e, r, t, o) {
|
|
901
|
+
var a = _regeneratorAsyncGen(n, e, r, t, o);
|
|
902
|
+
return a.next().then(function (n) {
|
|
903
|
+
return n.done ? n.value : a.next();
|
|
842
904
|
});
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
905
|
+
}
|
|
906
|
+
function _regeneratorAsyncGen(r, e, t, o, n) {
|
|
907
|
+
return new _regeneratorAsyncIterator(_regenerator().w(r, e, t, o), n || Promise);
|
|
908
|
+
}
|
|
909
|
+
function _regeneratorAsyncIterator(t, e) {
|
|
910
|
+
function n(r, o, i, f) {
|
|
911
|
+
try {
|
|
912
|
+
var c = t[r](o),
|
|
913
|
+
u = c.value;
|
|
914
|
+
return u instanceof _OverloadYield ? e.resolve(u.v).then(function (t) {
|
|
915
|
+
n("next", t, i, f);
|
|
916
|
+
}, function (t) {
|
|
917
|
+
n("throw", t, i, f);
|
|
918
|
+
}) : e.resolve(u).then(function (t) {
|
|
919
|
+
c.value = t, i(c);
|
|
920
|
+
}, function (t) {
|
|
921
|
+
return n("throw", t, i, f);
|
|
851
922
|
});
|
|
852
|
-
})
|
|
923
|
+
} catch (t) {
|
|
924
|
+
f(t);
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
var r;
|
|
928
|
+
this.next || (_regeneratorDefine(_regeneratorAsyncIterator.prototype), _regeneratorDefine(_regeneratorAsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function () {
|
|
929
|
+
return this;
|
|
930
|
+
})), _regeneratorDefine(this, "_invoke", function (t, o, i) {
|
|
931
|
+
function f() {
|
|
932
|
+
return new e(function (e, r) {
|
|
933
|
+
n(t, i, e, r);
|
|
934
|
+
});
|
|
935
|
+
}
|
|
936
|
+
return r = r ? r.then(f, f) : f();
|
|
937
|
+
}, true);
|
|
938
|
+
}
|
|
939
|
+
function _regeneratorDefine(e, r, n, t) {
|
|
940
|
+
var i = Object.defineProperty;
|
|
941
|
+
try {
|
|
942
|
+
i({}, "", {});
|
|
943
|
+
} catch (e) {
|
|
944
|
+
i = 0;
|
|
853
945
|
}
|
|
854
|
-
function
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
}) : e.resolve(h).then(function (t) {
|
|
865
|
-
u.value = t, i(u);
|
|
866
|
-
}, function (t) {
|
|
867
|
-
return invoke("throw", t, i, a);
|
|
946
|
+
_regeneratorDefine = function (e, r, n, t) {
|
|
947
|
+
if (r) i ? i(e, r, {
|
|
948
|
+
value: n,
|
|
949
|
+
enumerable: !t,
|
|
950
|
+
configurable: !t,
|
|
951
|
+
writable: !t
|
|
952
|
+
}) : e[r] = n;else {
|
|
953
|
+
function o(r, n) {
|
|
954
|
+
_regeneratorDefine(e, r, function (e) {
|
|
955
|
+
return this._invoke(r, n, e);
|
|
868
956
|
});
|
|
869
957
|
}
|
|
870
|
-
|
|
871
|
-
}
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
var
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
958
|
+
o("next", 0), o("throw", 1), o("return", 2);
|
|
959
|
+
}
|
|
960
|
+
}, _regeneratorDefine(e, r, n, t);
|
|
961
|
+
}
|
|
962
|
+
function _regeneratorKeys(e) {
|
|
963
|
+
var n = Object(e),
|
|
964
|
+
r = [];
|
|
965
|
+
for (var t in n) r.unshift(t);
|
|
966
|
+
return function e() {
|
|
967
|
+
for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = false, e;
|
|
968
|
+
return e.done = true, e;
|
|
969
|
+
};
|
|
970
|
+
}
|
|
971
|
+
function _regeneratorValues(e) {
|
|
972
|
+
if (null != e) {
|
|
973
|
+
var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"],
|
|
974
|
+
r = 0;
|
|
975
|
+
if (t) return t.call(e);
|
|
976
|
+
if ("function" == typeof e.next) return e;
|
|
977
|
+
if (!isNaN(e.length)) return {
|
|
978
|
+
next: function () {
|
|
979
|
+
return e && r >= e.length && (e = void 0), {
|
|
980
|
+
value: e && e[r++],
|
|
981
|
+
done: !e
|
|
893
982
|
};
|
|
894
983
|
}
|
|
895
|
-
for (n.method = i, n.arg = a;;) {
|
|
896
|
-
var c = n.delegate;
|
|
897
|
-
if (c) {
|
|
898
|
-
var u = maybeInvokeDelegate(c, n);
|
|
899
|
-
if (u) {
|
|
900
|
-
if (u === y) continue;
|
|
901
|
-
return u;
|
|
902
|
-
}
|
|
903
|
-
}
|
|
904
|
-
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
|
905
|
-
if (o === h) throw o = s, n.arg;
|
|
906
|
-
n.dispatchException(n.arg);
|
|
907
|
-
} else "return" === n.method && n.abrupt("return", n.arg);
|
|
908
|
-
o = f;
|
|
909
|
-
var p = tryCatch(e, r, n);
|
|
910
|
-
if ("normal" === p.type) {
|
|
911
|
-
if (o = n.done ? s : l, p.arg === y) continue;
|
|
912
|
-
return {
|
|
913
|
-
value: p.arg,
|
|
914
|
-
done: n.done
|
|
915
|
-
};
|
|
916
|
-
}
|
|
917
|
-
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
|
|
918
|
-
}
|
|
919
|
-
};
|
|
920
|
-
}
|
|
921
|
-
function maybeInvokeDelegate(e, r) {
|
|
922
|
-
var n = r.method,
|
|
923
|
-
o = e.iterator[n];
|
|
924
|
-
if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
|
|
925
|
-
var i = tryCatch(o, e.iterator, r.arg);
|
|
926
|
-
if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
|
|
927
|
-
var a = i.arg;
|
|
928
|
-
return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
|
|
929
|
-
}
|
|
930
|
-
function pushTryEntry(t) {
|
|
931
|
-
var e = {
|
|
932
|
-
tryLoc: t[0]
|
|
933
984
|
};
|
|
934
|
-
1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
|
|
935
|
-
}
|
|
936
|
-
function resetTryEntry(t) {
|
|
937
|
-
var e = t.completion || {};
|
|
938
|
-
e.type = "normal", delete e.arg, t.completion = e;
|
|
939
985
|
}
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
986
|
+
throw new TypeError(typeof e + " is not iterable");
|
|
987
|
+
}
|
|
988
|
+
function _regeneratorRuntime() {
|
|
989
|
+
|
|
990
|
+
var r = _regenerator(),
|
|
991
|
+
e = r.m(_regeneratorRuntime),
|
|
992
|
+
t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor;
|
|
993
|
+
function n(r) {
|
|
994
|
+
var e = "function" == typeof r && r.constructor;
|
|
995
|
+
return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name));
|
|
944
996
|
}
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
997
|
+
var o = {
|
|
998
|
+
throw: 1,
|
|
999
|
+
return: 2,
|
|
1000
|
+
break: 3,
|
|
1001
|
+
continue: 3
|
|
1002
|
+
};
|
|
1003
|
+
function a(r) {
|
|
1004
|
+
var e, t;
|
|
1005
|
+
return function (n) {
|
|
1006
|
+
e || (e = {
|
|
1007
|
+
stop: function () {
|
|
1008
|
+
return t(n.a, 2);
|
|
1009
|
+
},
|
|
1010
|
+
catch: function () {
|
|
1011
|
+
return n.v;
|
|
1012
|
+
},
|
|
1013
|
+
abrupt: function (r, e) {
|
|
1014
|
+
return t(n.a, o[r], e);
|
|
1015
|
+
},
|
|
1016
|
+
delegateYield: function (r, o, a) {
|
|
1017
|
+
return e.resultName = o, t(n.d, _regeneratorValues(r), a);
|
|
1018
|
+
},
|
|
1019
|
+
finish: function (r) {
|
|
1020
|
+
return t(n.f, r);
|
|
1021
|
+
}
|
|
1022
|
+
}, t = function (r, t, o) {
|
|
1023
|
+
n.p = e.prev, n.n = e.next;
|
|
1024
|
+
try {
|
|
1025
|
+
return r(t, o);
|
|
1026
|
+
} finally {
|
|
1027
|
+
e.next = n.n;
|
|
1028
|
+
}
|
|
1029
|
+
}), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n;
|
|
1030
|
+
try {
|
|
1031
|
+
return r.call(this, e);
|
|
1032
|
+
} finally {
|
|
1033
|
+
n.p = e.prev, n.n = e.next;
|
|
957
1034
|
}
|
|
958
|
-
}
|
|
959
|
-
throw new TypeError(typeof e + " is not iterable");
|
|
1035
|
+
};
|
|
960
1036
|
}
|
|
961
|
-
return
|
|
962
|
-
value: GeneratorFunctionPrototype,
|
|
963
|
-
configurable: true
|
|
964
|
-
}), o(GeneratorFunctionPrototype, "constructor", {
|
|
965
|
-
value: GeneratorFunction,
|
|
966
|
-
configurable: true
|
|
967
|
-
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
|
|
968
|
-
var e = "function" == typeof t && t.constructor;
|
|
969
|
-
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
|
|
970
|
-
}, e.mark = function (t) {
|
|
971
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
|
|
972
|
-
}, e.awrap = function (t) {
|
|
1037
|
+
return (_regeneratorRuntime = function () {
|
|
973
1038
|
return {
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
}), e.keys = function (t) {
|
|
989
|
-
var e = Object(t),
|
|
990
|
-
r = [];
|
|
991
|
-
for (var n in e) r.push(n);
|
|
992
|
-
return r.reverse(), function next() {
|
|
993
|
-
for (; r.length;) {
|
|
994
|
-
var t = r.pop();
|
|
995
|
-
if (t in e) return next.value = t, next.done = false, next;
|
|
996
|
-
}
|
|
997
|
-
return next.done = true, next;
|
|
1039
|
+
wrap: function (e, t, n, o) {
|
|
1040
|
+
return r.w(a(e), t, n, o && o.reverse());
|
|
1041
|
+
},
|
|
1042
|
+
isGeneratorFunction: n,
|
|
1043
|
+
mark: r.m,
|
|
1044
|
+
awrap: function (r, e) {
|
|
1045
|
+
return new _OverloadYield(r, e);
|
|
1046
|
+
},
|
|
1047
|
+
AsyncIterator: _regeneratorAsyncIterator,
|
|
1048
|
+
async: function (r, e, t, o, u) {
|
|
1049
|
+
return (n(e) ? _regeneratorAsyncGen : _regeneratorAsync)(a(r), e, t, o, u);
|
|
1050
|
+
},
|
|
1051
|
+
keys: _regeneratorKeys,
|
|
1052
|
+
values: _regeneratorValues
|
|
998
1053
|
};
|
|
999
|
-
}
|
|
1000
|
-
constructor: Context,
|
|
1001
|
-
reset: function (e) {
|
|
1002
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = false, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
|
|
1003
|
-
},
|
|
1004
|
-
stop: function () {
|
|
1005
|
-
this.done = true;
|
|
1006
|
-
var t = this.tryEntries[0].completion;
|
|
1007
|
-
if ("throw" === t.type) throw t.arg;
|
|
1008
|
-
return this.rval;
|
|
1009
|
-
},
|
|
1010
|
-
dispatchException: function (e) {
|
|
1011
|
-
if (this.done) throw e;
|
|
1012
|
-
var r = this;
|
|
1013
|
-
function handle(n, o) {
|
|
1014
|
-
return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
|
|
1015
|
-
}
|
|
1016
|
-
for (var o = this.tryEntries.length - 1; o >= 0; --o) {
|
|
1017
|
-
var i = this.tryEntries[o],
|
|
1018
|
-
a = i.completion;
|
|
1019
|
-
if ("root" === i.tryLoc) return handle("end");
|
|
1020
|
-
if (i.tryLoc <= this.prev) {
|
|
1021
|
-
var c = n.call(i, "catchLoc"),
|
|
1022
|
-
u = n.call(i, "finallyLoc");
|
|
1023
|
-
if (c && u) {
|
|
1024
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc, true);
|
|
1025
|
-
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
1026
|
-
} else if (c) {
|
|
1027
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc, true);
|
|
1028
|
-
} else {
|
|
1029
|
-
if (!u) throw Error("try statement without catch or finally");
|
|
1030
|
-
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
1031
|
-
}
|
|
1032
|
-
}
|
|
1033
|
-
}
|
|
1034
|
-
},
|
|
1035
|
-
abrupt: function (t, e) {
|
|
1036
|
-
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
1037
|
-
var o = this.tryEntries[r];
|
|
1038
|
-
if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
|
|
1039
|
-
var i = o;
|
|
1040
|
-
break;
|
|
1041
|
-
}
|
|
1042
|
-
}
|
|
1043
|
-
i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
|
|
1044
|
-
var a = i ? i.completion : {};
|
|
1045
|
-
return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
|
|
1046
|
-
},
|
|
1047
|
-
complete: function (t, e) {
|
|
1048
|
-
if ("throw" === t.type) throw t.arg;
|
|
1049
|
-
return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
|
|
1050
|
-
},
|
|
1051
|
-
finish: function (t) {
|
|
1052
|
-
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
1053
|
-
var r = this.tryEntries[e];
|
|
1054
|
-
if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
|
|
1055
|
-
}
|
|
1056
|
-
},
|
|
1057
|
-
catch: function (t) {
|
|
1058
|
-
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
1059
|
-
var r = this.tryEntries[e];
|
|
1060
|
-
if (r.tryLoc === t) {
|
|
1061
|
-
var n = r.completion;
|
|
1062
|
-
if ("throw" === n.type) {
|
|
1063
|
-
var o = n.arg;
|
|
1064
|
-
resetTryEntry(r);
|
|
1065
|
-
}
|
|
1066
|
-
return o;
|
|
1067
|
-
}
|
|
1068
|
-
}
|
|
1069
|
-
throw Error("illegal catch attempt");
|
|
1070
|
-
},
|
|
1071
|
-
delegateYield: function (e, r, n) {
|
|
1072
|
-
return this.delegate = {
|
|
1073
|
-
iterator: values(e),
|
|
1074
|
-
resultName: r,
|
|
1075
|
-
nextLoc: n
|
|
1076
|
-
}, "next" === this.method && (this.arg = t), y;
|
|
1077
|
-
}
|
|
1078
|
-
}, e;
|
|
1054
|
+
})();
|
|
1079
1055
|
}
|
|
1080
1056
|
|
|
1081
1057
|
/* *
|
|
@@ -1272,7 +1248,7 @@ var useCloseDrawDialog = function useCloseDrawDialog(_ref) {
|
|
|
1272
1248
|
});
|
|
1273
1249
|
var confirmDialog = useConfirmationDialog();
|
|
1274
1250
|
var closeDrawDialog = /*#__PURE__*/function () {
|
|
1275
|
-
var _ref2 = _asyncToGenerator(
|
|
1251
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(skipConfirmationDialog) {
|
|
1276
1252
|
var mayProceed;
|
|
1277
1253
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
1278
1254
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -1444,7 +1420,7 @@ var useObjectDrawDialogAction = function useObjectDrawDialogAction(_ref5) {
|
|
|
1444
1420
|
}));
|
|
1445
1421
|
};
|
|
1446
1422
|
var openObjectDialog = /*#__PURE__*/function () {
|
|
1447
|
-
var _ref6 = _asyncToGenerator(
|
|
1423
|
+
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
1448
1424
|
var mayProceed;
|
|
1449
1425
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
1450
1426
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -2051,7 +2027,7 @@ var updatePublicWarning = function updatePublicWarning(warningId, auth, data) {
|
|
|
2051
2027
|
body: JSON.stringify(data)
|
|
2052
2028
|
}).then(handleResponse);
|
|
2053
2029
|
};
|
|
2054
|
-
var
|
|
2030
|
+
var postWarning = function postWarning(auth, data) {
|
|
2055
2031
|
return fetch(publicWarningBaseUrl + "/warnings/", {
|
|
2056
2032
|
headers: getHeaders(auth),
|
|
2057
2033
|
method: 'POST',
|
|
@@ -2096,7 +2072,7 @@ var getAreaKeywords = function getAreaKeywords(auth) {
|
|
|
2096
2072
|
}).then(handleResponse);
|
|
2097
2073
|
};
|
|
2098
2074
|
var saveDrawingAs = /*#__PURE__*/function () {
|
|
2099
|
-
var _ref3 = _asyncToGenerator(
|
|
2075
|
+
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(auth, data) {
|
|
2100
2076
|
var response;
|
|
2101
2077
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2102
2078
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -2329,7 +2305,7 @@ var publicWarningFormListener = createListenerMiddleware();
|
|
|
2329
2305
|
publicWarningFormListener.startListening({
|
|
2330
2306
|
actionCreator: publicWarningFormActions.openPublicWarningFormDialog,
|
|
2331
2307
|
effect: function () {
|
|
2332
|
-
var _effect = _asyncToGenerator(
|
|
2308
|
+
var _effect = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref, listenerApi) {
|
|
2333
2309
|
var payload, panelId;
|
|
2334
2310
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2335
2311
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -2357,7 +2333,7 @@ publicWarningFormListener.startListening({
|
|
|
2357
2333
|
publicWarningFormListener.startListening({
|
|
2358
2334
|
actionCreator: uiActions.setToggleOpenDialog,
|
|
2359
2335
|
effect: function () {
|
|
2360
|
-
var _effect2 = _asyncToGenerator(
|
|
2336
|
+
var _effect2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref2, listenerApi) {
|
|
2361
2337
|
var payload;
|
|
2362
2338
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
2363
2339
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -2416,7 +2392,7 @@ var defaultDomainFilter = {
|
|
|
2416
2392
|
};
|
|
2417
2393
|
var domainLevels = {
|
|
2418
2394
|
aviation: [Level.airmet, Level.sigmet],
|
|
2419
|
-
maritime: [],
|
|
2395
|
+
maritime: [Level.extreme, Level.moderate, Level.severe],
|
|
2420
2396
|
"public": [Level.extreme, Level.moderate, Level.severe]
|
|
2421
2397
|
};
|
|
2422
2398
|
var defaultLevelFilter = (_defaultLevelFilter = {}, _defaultLevelFilter[emptyFilterId] = true, _defaultLevelFilter.extreme = true, _defaultLevelFilter.moderate = true, _defaultLevelFilter.severe = true, _defaultLevelFilter.AIR = true, _defaultLevelFilter.SIG = true, _defaultLevelFilter);
|
|
@@ -2426,9 +2402,9 @@ var makeFilterFromList = function makeFilterFromList(options, value) {
|
|
|
2426
2402
|
if (value === void 0) {
|
|
2427
2403
|
value = true;
|
|
2428
2404
|
}
|
|
2429
|
-
return options.reduce(function (acc,
|
|
2405
|
+
return options.reduce(function (acc, property) {
|
|
2430
2406
|
var _Object$assign;
|
|
2431
|
-
return
|
|
2407
|
+
return property ? Object.assign({}, acc, (_Object$assign = {}, _Object$assign[property] = value, _Object$assign)) : acc;
|
|
2432
2408
|
}, (_options$reduce = {}, _options$reduce[emptyFilterId] = value, _options$reduce));
|
|
2433
2409
|
};
|
|
2434
2410
|
var AllPhenomena = Object.assign({}, AirmetPhenomena, SigmetPhenomena, Phenomenon$1);
|
|
@@ -2437,7 +2413,7 @@ var AllPhenomenaKeys = Object.fromEntries(Object.keys(AllPhenomena).map(function
|
|
|
2437
2413
|
}));
|
|
2438
2414
|
var domainPhenomena = {
|
|
2439
2415
|
aviation: [].concat(Object.keys(SigmetPhenomena), Object.keys(AirmetPhenomena)),
|
|
2440
|
-
maritime: [],
|
|
2416
|
+
maritime: [Phenomenon$1.wind],
|
|
2441
2417
|
"public": [].concat(Object.keys(Phenomenon$1))
|
|
2442
2418
|
};
|
|
2443
2419
|
var defaultPhenomenonFilter = makeFilterFromList(Object.keys(AllPhenomenaKeys));
|
|
@@ -2452,8 +2428,8 @@ var getSelectedOptions = function getSelectedOptions(options) {
|
|
|
2452
2428
|
if (options === void 0) {
|
|
2453
2429
|
options = {};
|
|
2454
2430
|
}
|
|
2455
|
-
var selectedOptions = Object.keys(options).filter(function (
|
|
2456
|
-
return options[
|
|
2431
|
+
var selectedOptions = Object.keys(options).filter(function (key) {
|
|
2432
|
+
return options[key];
|
|
2457
2433
|
});
|
|
2458
2434
|
var allSelected = selectedOptions.length === Object.keys(options).length;
|
|
2459
2435
|
return {
|
|
@@ -2464,26 +2440,26 @@ var getSelectedOptions = function getSelectedOptions(options) {
|
|
|
2464
2440
|
var updateState = function updateState(state, optionKey, value, only) {
|
|
2465
2441
|
var _Object$assign4;
|
|
2466
2442
|
if (only) {
|
|
2467
|
-
return Object.keys(state).reduce(function (acc,
|
|
2443
|
+
return Object.keys(state).reduce(function (acc, key) {
|
|
2468
2444
|
var _Object$assign2;
|
|
2469
|
-
return Object.assign({}, acc, (_Object$assign2 = {}, _Object$assign2[
|
|
2445
|
+
return Object.assign({}, acc, (_Object$assign2 = {}, _Object$assign2[key] = key === optionKey, _Object$assign2));
|
|
2470
2446
|
}, {});
|
|
2471
2447
|
}
|
|
2472
2448
|
if (optionKey === 'ALL') {
|
|
2473
2449
|
if (Object.keys(state).length < 2) {
|
|
2474
2450
|
return state;
|
|
2475
2451
|
}
|
|
2476
|
-
return Object.keys(state).reduce(function (acc,
|
|
2452
|
+
return Object.keys(state).reduce(function (acc, key) {
|
|
2477
2453
|
var _Object$assign3;
|
|
2478
|
-
return Object.assign({}, acc, (_Object$assign3 = {}, _Object$assign3[
|
|
2454
|
+
return Object.assign({}, acc, (_Object$assign3 = {}, _Object$assign3[key] = value, _Object$assign3));
|
|
2479
2455
|
}, {});
|
|
2480
2456
|
}
|
|
2481
2457
|
return Object.assign({}, state, (_Object$assign4 = {}, _Object$assign4[optionKey] = value, _Object$assign4));
|
|
2482
2458
|
};
|
|
2483
2459
|
/** Make sure our value is in the filter */
|
|
2484
2460
|
var getValue = function getValue(values, value) {
|
|
2485
|
-
return Object.values(values).find(function (
|
|
2486
|
-
return
|
|
2461
|
+
return Object.values(values).find(function (existingValue) {
|
|
2462
|
+
return existingValue === value;
|
|
2487
2463
|
}) || emptyFilterId;
|
|
2488
2464
|
};
|
|
2489
2465
|
var getFiltersFromWarnings = function getFiltersFromWarnings(warnings, filterKey) {
|
|
@@ -3037,7 +3013,7 @@ var useMutatePublicWarningEditor = function useMutatePublicWarningEditor() {
|
|
|
3037
3013
|
}
|
|
3038
3014
|
}), {
|
|
3039
3015
|
onSuccess: function () {
|
|
3040
|
-
var _onSuccess = _asyncToGenerator(
|
|
3016
|
+
var _onSuccess = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(data, _ref3) {
|
|
3041
3017
|
var isEditor;
|
|
3042
3018
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
3043
3019
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -3076,7 +3052,7 @@ var useMutateWarning = function useMutateWarning(snackBarMessage) {
|
|
|
3076
3052
|
if (id) {
|
|
3077
3053
|
return updatePublicWarning(id, auth, data);
|
|
3078
3054
|
}
|
|
3079
|
-
return
|
|
3055
|
+
return postWarning(auth, data);
|
|
3080
3056
|
},
|
|
3081
3057
|
onError: function onError(error) {
|
|
3082
3058
|
void queryClient.invalidateQueries({
|
|
@@ -3087,7 +3063,7 @@ var useMutateWarning = function useMutateWarning(snackBarMessage) {
|
|
|
3087
3063
|
}));
|
|
3088
3064
|
},
|
|
3089
3065
|
onSuccess: function () {
|
|
3090
|
-
var _onSuccess2 = _asyncToGenerator(
|
|
3066
|
+
var _onSuccess2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(data, variables) {
|
|
3091
3067
|
var location, warningDetail, newId, newWarning;
|
|
3092
3068
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
3093
3069
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -3153,7 +3129,7 @@ var useMutateDeleteWarning = function useMutateDeleteWarning() {
|
|
|
3153
3129
|
return deleteWarning(id, auth);
|
|
3154
3130
|
},
|
|
3155
3131
|
onSuccess: function () {
|
|
3156
|
-
var _onSuccess3 = _asyncToGenerator(
|
|
3132
|
+
var _onSuccess3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(_, variables) {
|
|
3157
3133
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
3158
3134
|
while (1) switch (_context3.prev = _context3.next) {
|
|
3159
3135
|
case 0:
|
|
@@ -3221,7 +3197,7 @@ var useMutateSaveOrUpdateDrawing = function useMutateSaveOrUpdateDrawing() {
|
|
|
3221
3197
|
var queryClient = useQueryClient();
|
|
3222
3198
|
return useMutation({
|
|
3223
3199
|
mutationFn: function () {
|
|
3224
|
-
var _mutationFn = _asyncToGenerator(
|
|
3200
|
+
var _mutationFn = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(_ref6) {
|
|
3225
3201
|
var data, id, headers, location, newId;
|
|
3226
3202
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
3227
3203
|
while (1) switch (_context4.prev = _context4.next) {
|
|
@@ -3291,7 +3267,7 @@ var useMutateDeleteDrawing = function useMutateDeleteDrawing() {
|
|
|
3291
3267
|
var dispatch = useDispatch();
|
|
3292
3268
|
return useMutation({
|
|
3293
3269
|
mutationFn: function () {
|
|
3294
|
-
var _mutationFn2 = _asyncToGenerator(
|
|
3270
|
+
var _mutationFn2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(_ref8) {
|
|
3295
3271
|
var drawingId;
|
|
3296
3272
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
3297
3273
|
while (1) switch (_context5.prev = _context5.next) {
|
|
@@ -3335,6 +3311,45 @@ var useMutateDeleteDrawing = function useMutateDeleteDrawing() {
|
|
|
3335
3311
|
}
|
|
3336
3312
|
});
|
|
3337
3313
|
};
|
|
3314
|
+
var usePostMaritimeWarning = function usePostMaritimeWarning() {
|
|
3315
|
+
var _useAuthenticationCon6 = useAuthenticationContext(),
|
|
3316
|
+
auth = _useAuthenticationCon6.auth;
|
|
3317
|
+
var queryClient = useQueryClient();
|
|
3318
|
+
var dispatch = useDispatch();
|
|
3319
|
+
return useMutation({
|
|
3320
|
+
mutationFn: function mutationFn(data) {
|
|
3321
|
+
if (!auth) {
|
|
3322
|
+
throw new Error('Authentication context not found');
|
|
3323
|
+
}
|
|
3324
|
+
return postWarning(auth, data);
|
|
3325
|
+
},
|
|
3326
|
+
onSuccess: function () {
|
|
3327
|
+
var _onSuccess4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
3328
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
3329
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
3330
|
+
case 0:
|
|
3331
|
+
_context6.next = 2;
|
|
3332
|
+
return queryClient.invalidateQueries({
|
|
3333
|
+
queryKey: ['public-warning-list']
|
|
3334
|
+
});
|
|
3335
|
+
case 2:
|
|
3336
|
+
dispatch(snackbarActions.openSnackbar({
|
|
3337
|
+
type: snackbarTypes.SnackbarMessageType.TRANSLATABLE_MESSAGE,
|
|
3338
|
+
key: 'maritime-warning-post-success'
|
|
3339
|
+
}));
|
|
3340
|
+
case 3:
|
|
3341
|
+
case "end":
|
|
3342
|
+
return _context6.stop();
|
|
3343
|
+
}
|
|
3344
|
+
}, _callee6);
|
|
3345
|
+
}));
|
|
3346
|
+
function onSuccess() {
|
|
3347
|
+
return _onSuccess4.apply(this, arguments);
|
|
3348
|
+
}
|
|
3349
|
+
return onSuccess;
|
|
3350
|
+
}()
|
|
3351
|
+
});
|
|
3352
|
+
};
|
|
3338
3353
|
|
|
3339
3354
|
var getDeleteDescription = function getDeleteDescription(objectName, t) {
|
|
3340
3355
|
return t('delete-dialog-description') + " \"" + objectName + "\"?";
|
|
@@ -3469,7 +3484,7 @@ var ObjectManagerConnect = function ObjectManagerConnect(_ref) {
|
|
|
3469
3484
|
}
|
|
3470
3485
|
};
|
|
3471
3486
|
var onClickDrawing = /*#__PURE__*/function () {
|
|
3472
|
-
var _ref2 = _asyncToGenerator(
|
|
3487
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(drawing) {
|
|
3473
3488
|
var isActive;
|
|
3474
3489
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
3475
3490
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -4267,10 +4282,21 @@ var DEFAULT_WARNING_DIALOG_MIN_SIZE = {
|
|
|
4267
4282
|
width: 264,
|
|
4268
4283
|
height: 300
|
|
4269
4284
|
};
|
|
4285
|
+
var getTitle = function getTitle(warningType, t) {
|
|
4286
|
+
if (warningType === 'airmet' || warningType === 'sigmet') {
|
|
4287
|
+
return warningType == null ? void 0 : warningType.toUpperCase();
|
|
4288
|
+
}
|
|
4289
|
+
if (warningType === 'maritimeWarningCoastal') {
|
|
4290
|
+
return t('maritime-warning-title-coastal');
|
|
4291
|
+
}
|
|
4292
|
+
if (warningType === 'maritimeWarningNorthSea') {
|
|
4293
|
+
return t('maritime-warning-title-northsea');
|
|
4294
|
+
}
|
|
4295
|
+
return t('public-warning-title');
|
|
4296
|
+
};
|
|
4270
4297
|
var PublicWarningsFormDialog = function PublicWarningsFormDialog(_ref) {
|
|
4271
4298
|
var bounds = _ref.bounds,
|
|
4272
4299
|
onClose = _ref.onClose,
|
|
4273
|
-
title = _ref.title,
|
|
4274
4300
|
isOpen = _ref.isOpen,
|
|
4275
4301
|
_ref$onMouseDown = _ref.onMouseDown,
|
|
4276
4302
|
onMouseDown = _ref$onMouseDown === void 0 ? function () {} : _ref$onMouseDown,
|
|
@@ -4307,7 +4333,7 @@ var PublicWarningsFormDialog = function PublicWarningsFormDialog(_ref) {
|
|
|
4307
4333
|
var _React$useState = React.useState(startSizeCalc),
|
|
4308
4334
|
sizeInState = _React$useState[0],
|
|
4309
4335
|
setSizeInState = _React$useState[1];
|
|
4310
|
-
var fullTitle =
|
|
4336
|
+
var fullTitle = getTitle(warningType, t);
|
|
4311
4337
|
var onChangeMode = function onChangeMode() {
|
|
4312
4338
|
onChangeFormMode(!isReadOnly);
|
|
4313
4339
|
};
|
|
@@ -4431,15 +4457,15 @@ var getSigmetList = function getSigmetList(auth) {
|
|
|
4431
4457
|
var getAirmetConfig = function getAirmetConfig(auth) {
|
|
4432
4458
|
return fetch(airmetBaseUrl + "/airmet-config", {
|
|
4433
4459
|
headers: getHeaders(auth)
|
|
4434
|
-
}).then(function (
|
|
4435
|
-
return
|
|
4460
|
+
}).then(function (result) {
|
|
4461
|
+
return result.json();
|
|
4436
4462
|
});
|
|
4437
4463
|
};
|
|
4438
4464
|
var getSigmetConfig = function getSigmetConfig(auth) {
|
|
4439
4465
|
return fetch(sigmetBaseUrl + "/sigmet-config", {
|
|
4440
4466
|
headers: getHeaders(auth)
|
|
4441
|
-
}).then(function (
|
|
4442
|
-
return
|
|
4467
|
+
}).then(function (result) {
|
|
4468
|
+
return result.json();
|
|
4443
4469
|
});
|
|
4444
4470
|
};
|
|
4445
4471
|
var getAirmetTAC = function getAirmetTAC(auth, product) {
|
|
@@ -4447,25 +4473,25 @@ var getAirmetTAC = function getAirmetTAC(auth, product) {
|
|
|
4447
4473
|
body: JSON.stringify(product),
|
|
4448
4474
|
method: 'POST',
|
|
4449
4475
|
headers: getHeaders(auth)
|
|
4450
|
-
}).then(
|
|
4451
|
-
var _ref = _asyncToGenerator(
|
|
4476
|
+
}).then(/*#__PURE__*/function () {
|
|
4477
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(result) {
|
|
4452
4478
|
var textData;
|
|
4453
4479
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
4454
4480
|
while (1) switch (_context.prev = _context.next) {
|
|
4455
4481
|
case 0:
|
|
4456
|
-
if (!(
|
|
4482
|
+
if (!(result.status === 200)) {
|
|
4457
4483
|
_context.next = 5;
|
|
4458
4484
|
break;
|
|
4459
4485
|
}
|
|
4460
4486
|
_context.next = 3;
|
|
4461
|
-
return
|
|
4487
|
+
return result.text();
|
|
4462
4488
|
case 3:
|
|
4463
4489
|
textData = _context.sent;
|
|
4464
4490
|
return _context.abrupt("return", {
|
|
4465
4491
|
data: textData
|
|
4466
4492
|
});
|
|
4467
4493
|
case 5:
|
|
4468
|
-
throw new Error("Failed to fetch TAC data: " +
|
|
4494
|
+
throw new Error("Failed to fetch TAC data: " + result.statusText);
|
|
4469
4495
|
case 6:
|
|
4470
4496
|
case "end":
|
|
4471
4497
|
return _context.stop();
|
|
@@ -4482,25 +4508,25 @@ var getSigmetTAC = function getSigmetTAC(auth, product) {
|
|
|
4482
4508
|
body: JSON.stringify(product),
|
|
4483
4509
|
method: 'POST',
|
|
4484
4510
|
headers: getHeaders(auth)
|
|
4485
|
-
}).then(
|
|
4486
|
-
var _ref2 = _asyncToGenerator(
|
|
4511
|
+
}).then(/*#__PURE__*/function () {
|
|
4512
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(result) {
|
|
4487
4513
|
var textData;
|
|
4488
4514
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
4489
4515
|
while (1) switch (_context2.prev = _context2.next) {
|
|
4490
4516
|
case 0:
|
|
4491
|
-
if (!(
|
|
4517
|
+
if (!(result.status === 200)) {
|
|
4492
4518
|
_context2.next = 5;
|
|
4493
4519
|
break;
|
|
4494
4520
|
}
|
|
4495
4521
|
_context2.next = 3;
|
|
4496
|
-
return
|
|
4522
|
+
return result.text();
|
|
4497
4523
|
case 3:
|
|
4498
4524
|
textData = _context2.sent;
|
|
4499
4525
|
return _context2.abrupt("return", {
|
|
4500
4526
|
data: textData
|
|
4501
4527
|
});
|
|
4502
4528
|
case 5:
|
|
4503
|
-
throw new Error("Failed to fetch TAC data: " +
|
|
4529
|
+
throw new Error("Failed to fetch TAC data: " + result.statusText);
|
|
4504
4530
|
case 6:
|
|
4505
4531
|
case "end":
|
|
4506
4532
|
return _context2.stop();
|
|
@@ -4624,7 +4650,7 @@ var usePostSigmet = function usePostSigmet() {
|
|
|
4624
4650
|
}));
|
|
4625
4651
|
},
|
|
4626
4652
|
onSuccess: function () {
|
|
4627
|
-
var _onSuccess = _asyncToGenerator(
|
|
4653
|
+
var _onSuccess = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(data, variables) {
|
|
4628
4654
|
var snackbarKey, warningType;
|
|
4629
4655
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
4630
4656
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -4685,7 +4711,7 @@ var usePostAirmet = function usePostAirmet() {
|
|
|
4685
4711
|
}));
|
|
4686
4712
|
},
|
|
4687
4713
|
onSuccess: function () {
|
|
4688
|
-
var _onSuccess2 = _asyncToGenerator(
|
|
4714
|
+
var _onSuccess2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(data, variables) {
|
|
4689
4715
|
var snackbarKey, warningType;
|
|
4690
4716
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
4691
4717
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -4724,12 +4750,12 @@ function isCancelSigmet(warningDetail) {
|
|
|
4724
4750
|
return warningDetail.cancelsSigmetSequenceId !== undefined;
|
|
4725
4751
|
}
|
|
4726
4752
|
var flattenPublicWarning = function flattenPublicWarning(publicWarning) {
|
|
4727
|
-
if (publicWarning.type === '
|
|
4728
|
-
|
|
4753
|
+
if (publicWarning.type === 'airmet' || publicWarning.type === 'sigmet') {
|
|
4754
|
+
var sigmetAirmetDetails = publicWarning.sigmetAirmetDetails,
|
|
4755
|
+
rest = _objectWithoutPropertiesLoose(publicWarning, _excluded$6);
|
|
4756
|
+
return Object.assign({}, rest, sigmetAirmetDetails);
|
|
4729
4757
|
}
|
|
4730
|
-
|
|
4731
|
-
rest = _objectWithoutPropertiesLoose(publicWarning, _excluded$6);
|
|
4732
|
-
return Object.assign({}, rest, sigmetAirmetDetails);
|
|
4758
|
+
return {};
|
|
4733
4759
|
};
|
|
4734
4760
|
var transformAirmetToWarningFormat = function transformAirmetToWarningFormat(apiAirmet, productConfig) {
|
|
4735
4761
|
var airmet = apiAirmet.airmet;
|
|
@@ -5642,15 +5668,80 @@ var ValidUntil = function ValidUntil(_ref) {
|
|
|
5642
5668
|
});
|
|
5643
5669
|
};
|
|
5644
5670
|
|
|
5645
|
-
|
|
5646
|
-
|
|
5647
|
-
|
|
5648
|
-
|
|
5649
|
-
|
|
5671
|
+
/* *
|
|
5672
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5673
|
+
* you may not use this file except in compliance with the License.
|
|
5674
|
+
* You may obtain a copy of the License at
|
|
5675
|
+
*
|
|
5676
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
5677
|
+
*
|
|
5678
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
5679
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
5680
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
5681
|
+
* See the License for the specific language governing permissions and
|
|
5682
|
+
* limitations under the License.
|
|
5683
|
+
*
|
|
5684
|
+
* Copyright 2025 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
5685
|
+
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
5686
|
+
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
5687
|
+
* */
|
|
5688
|
+
function useFilterChipSelect(_ref) {
|
|
5689
|
+
var selectedIds = _ref.selectedIds,
|
|
5690
|
+
assignedIds = _ref.assignedIds,
|
|
5691
|
+
onToggleSelect = _ref.onToggleSelect,
|
|
5692
|
+
onSelectMultiple = _ref.onSelectMultiple;
|
|
5693
|
+
var lastSelectedByClick = React__default.useRef(null);
|
|
5694
|
+
// reset lastSelectedByClick when it disappears from ids list
|
|
5695
|
+
React__default.useEffect(function () {
|
|
5696
|
+
if (lastSelectedByClick.current && (!assignedIds.includes(lastSelectedByClick.current) || !selectedIds.includes(lastSelectedByClick.current))) {
|
|
5697
|
+
lastSelectedByClick.current = null;
|
|
5698
|
+
}
|
|
5699
|
+
}, [assignedIds, selectedIds]);
|
|
5700
|
+
return {
|
|
5701
|
+
handleChipClick: function handleChipClick(id, event) {
|
|
5702
|
+
if (event.shiftKey && lastSelectedByClick.current) {
|
|
5703
|
+
var assignedAreasIdsArray = Array.from(assignedIds);
|
|
5704
|
+
var lastClickedIndex = assignedAreasIdsArray.indexOf(lastSelectedByClick.current);
|
|
5705
|
+
var clickedIndex = assignedAreasIdsArray.indexOf(id);
|
|
5706
|
+
var firstIndex = Math.min(clickedIndex, lastClickedIndex);
|
|
5707
|
+
var secondIndex = Math.max(clickedIndex, lastClickedIndex);
|
|
5708
|
+
onSelectMultiple == null || onSelectMultiple(assignedAreasIdsArray.slice(firstIndex, secondIndex + 1));
|
|
5709
|
+
} else {
|
|
5710
|
+
var idIsSelected = selectedIds.includes(id);
|
|
5711
|
+
if (!idIsSelected) {
|
|
5712
|
+
lastSelectedByClick.current = id;
|
|
5713
|
+
} else {
|
|
5714
|
+
lastSelectedByClick.current = null;
|
|
5715
|
+
}
|
|
5716
|
+
onToggleSelect == null || onToggleSelect(id);
|
|
5717
|
+
}
|
|
5718
|
+
}
|
|
5719
|
+
};
|
|
5720
|
+
}
|
|
5721
|
+
|
|
5722
|
+
var AreaList = /*#__PURE__*/React__default.memo(function (_ref2) {
|
|
5723
|
+
var areas = _ref2.areas,
|
|
5724
|
+
selected = _ref2.selected,
|
|
5725
|
+
disabled = _ref2.disabled,
|
|
5726
|
+
isReadOnly = _ref2.isReadOnly,
|
|
5727
|
+
onToggleSelectArea = _ref2.onToggleSelectArea,
|
|
5728
|
+
onSelectMultipleAreas = _ref2.onSelectMultipleAreas;
|
|
5729
|
+
var _useFilterChipSelect = useFilterChipSelect({
|
|
5730
|
+
selectedIds: selected,
|
|
5731
|
+
assignedIds: areas.map(function (area) {
|
|
5732
|
+
return area.id;
|
|
5733
|
+
}),
|
|
5734
|
+
onSelectMultiple: onSelectMultipleAreas,
|
|
5735
|
+
onToggleSelect: onToggleSelectArea
|
|
5736
|
+
}),
|
|
5737
|
+
handleChipClick = _useFilterChipSelect.handleChipClick;
|
|
5650
5738
|
return jsx(Stack, {
|
|
5651
5739
|
"data-testid": "arealist",
|
|
5652
5740
|
direction: "row",
|
|
5653
5741
|
spacing: 1,
|
|
5742
|
+
style: {
|
|
5743
|
+
pointerEvents: !isReadOnly ? 'auto' : 'none'
|
|
5744
|
+
},
|
|
5654
5745
|
sx: {
|
|
5655
5746
|
display: 'block',
|
|
5656
5747
|
'.MuiChip-root': {
|
|
@@ -5667,8 +5758,10 @@ var AreaList = /*#__PURE__*/React__default.memo(function (_ref) {
|
|
|
5667
5758
|
label: area.label,
|
|
5668
5759
|
isSelected: isSelected,
|
|
5669
5760
|
isDisabled: isDisabled,
|
|
5670
|
-
onClick: function onClick() {
|
|
5671
|
-
|
|
5761
|
+
onClick: function onClick(_ref, event) {
|
|
5762
|
+
if (!isReadOnly) {
|
|
5763
|
+
handleChipClick == null || handleChipClick(area.id, event);
|
|
5764
|
+
}
|
|
5672
5765
|
},
|
|
5673
5766
|
size: "medium"
|
|
5674
5767
|
}, area.id);
|
|
@@ -5730,12 +5823,15 @@ var WarningListHeaderContent = function WarningListHeaderContent(_ref) {
|
|
|
5730
5823
|
};
|
|
5731
5824
|
|
|
5732
5825
|
var AssignedAreas = function AssignedAreas(_ref) {
|
|
5733
|
-
var _sx;
|
|
5826
|
+
var _sx, _sx2;
|
|
5734
5827
|
var assignedAreas = _ref.assignedAreas,
|
|
5735
5828
|
selectedAreaIds = _ref.selectedAreaIds,
|
|
5736
5829
|
onAddClick = _ref.onAddClick,
|
|
5737
5830
|
onDeleteClick = _ref.onDeleteClick,
|
|
5738
5831
|
onToggleSelectArea = _ref.onToggleSelectArea,
|
|
5832
|
+
onSelectMultipleAreas = _ref.onSelectMultipleAreas,
|
|
5833
|
+
_ref$isReadOnly = _ref.isReadOnly,
|
|
5834
|
+
isReadOnly = _ref$isReadOnly === void 0 ? false : _ref$isReadOnly,
|
|
5739
5835
|
_ref$shouldShowDistri = _ref.shouldShowDistricts,
|
|
5740
5836
|
shouldShowDistricts = _ref$shouldShowDistri === void 0 ? false : _ref$shouldShowDistri;
|
|
5741
5837
|
var _useWarningsTranslati = useWarningsTranslation(),
|
|
@@ -5747,21 +5843,32 @@ var AssignedAreas = function AssignedAreas(_ref) {
|
|
|
5747
5843
|
}, [assignedAreas]);
|
|
5748
5844
|
// can add the selected areas when they don't appear in the assigned area list
|
|
5749
5845
|
var canAddSelectedAreas = React__default.useMemo(function () {
|
|
5750
|
-
return selectedAreaIds.length > 0 && selectedAreaIds.
|
|
5846
|
+
return !isReadOnly && selectedAreaIds.length > 0 && selectedAreaIds.some(function (id) {
|
|
5751
5847
|
return !assignedAreaIds.has(id);
|
|
5752
5848
|
});
|
|
5753
|
-
}, [selectedAreaIds, assignedAreaIds]);
|
|
5849
|
+
}, [isReadOnly, selectedAreaIds, assignedAreaIds]);
|
|
5850
|
+
var assignedAreaIdsArray = React__default.useMemo(function () {
|
|
5851
|
+
return Array.from(assignedAreaIds);
|
|
5852
|
+
}, [assignedAreaIds]);
|
|
5853
|
+
var _useFilterChipSelect = useFilterChipSelect({
|
|
5854
|
+
selectedIds: selectedAreaIds,
|
|
5855
|
+
assignedIds: assignedAreaIdsArray,
|
|
5856
|
+
onSelectMultiple: onSelectMultipleAreas,
|
|
5857
|
+
onToggleSelect: onToggleSelectArea
|
|
5858
|
+
}),
|
|
5859
|
+
handleChipClick = _useFilterChipSelect.handleChipClick;
|
|
5754
5860
|
var theme = useTheme();
|
|
5755
5861
|
return jsxs(Box, {
|
|
5756
|
-
sx: {
|
|
5862
|
+
sx: (_sx = {
|
|
5757
5863
|
display: 'flex',
|
|
5758
5864
|
gridArea: 'areas',
|
|
5759
5865
|
gap: 1,
|
|
5760
5866
|
minHeight: 32,
|
|
5761
|
-
marginLeft: 1,
|
|
5762
5867
|
paddingInline: 0.5,
|
|
5763
5868
|
borderRadius: 1
|
|
5764
|
-
},
|
|
5869
|
+
}, _sx["@container maritime (min-width: " + breakpoints.tablet + "px)"] = {
|
|
5870
|
+
marginLeft: 1
|
|
5871
|
+
}, _sx),
|
|
5765
5872
|
style: {
|
|
5766
5873
|
backgroundColor: canAddSelectedAreas ? theme.palette.geowebColors.cards.cardContainerMouseOver : undefined
|
|
5767
5874
|
},
|
|
@@ -5773,17 +5880,20 @@ var AssignedAreas = function AssignedAreas(_ref) {
|
|
|
5773
5880
|
},
|
|
5774
5881
|
children: shouldShowDistricts ? t('maritime-no-district-selected') : t('maritime-no-area-selected')
|
|
5775
5882
|
}), jsx(Box, {
|
|
5776
|
-
sx: (
|
|
5883
|
+
sx: (_sx2 = {
|
|
5777
5884
|
flexGrow: 1,
|
|
5778
5885
|
display: 'flex',
|
|
5779
5886
|
flexDirection: 'column',
|
|
5780
5887
|
gap: 0.5,
|
|
5781
5888
|
paddingBlock: 0.5,
|
|
5782
5889
|
alignItems: 'flex-start'
|
|
5783
|
-
},
|
|
5890
|
+
}, _sx2["@container maritime (min-width: " + breakpoints.tablet + "px)"] = {
|
|
5784
5891
|
flexWrap: 'wrap',
|
|
5785
5892
|
flexDirection: 'row'
|
|
5786
|
-
},
|
|
5893
|
+
}, _sx2),
|
|
5894
|
+
style: {
|
|
5895
|
+
pointerEvents: !isReadOnly ? 'auto' : 'none'
|
|
5896
|
+
},
|
|
5787
5897
|
children: assignedAreas.map(function (area) {
|
|
5788
5898
|
var isSelected = selectedAreaIds.includes(area.id);
|
|
5789
5899
|
return jsx(FilterChip, {
|
|
@@ -5791,15 +5901,17 @@ var AssignedAreas = function AssignedAreas(_ref) {
|
|
|
5791
5901
|
id: area.id,
|
|
5792
5902
|
label: area.label,
|
|
5793
5903
|
isSelected: isSelected,
|
|
5794
|
-
onClick: function onClick() {
|
|
5795
|
-
|
|
5904
|
+
onClick: function onClick(_chipRef, event) {
|
|
5905
|
+
if (!isReadOnly) {
|
|
5906
|
+
handleChipClick(area.id, event);
|
|
5907
|
+
}
|
|
5796
5908
|
},
|
|
5797
|
-
onClickIcon: isSelected ? function () {
|
|
5798
|
-
|
|
5909
|
+
onClickIcon: isSelected && !isReadOnly ? function () {
|
|
5910
|
+
onDeleteClick(area.id);
|
|
5799
5911
|
} : undefined
|
|
5800
5912
|
}, area.id);
|
|
5801
5913
|
})
|
|
5802
|
-
}), jsx(AddButton, {
|
|
5914
|
+
}), !isReadOnly && jsx(AddButton, {
|
|
5803
5915
|
show: canAddSelectedAreas,
|
|
5804
5916
|
onClick: onAddClick
|
|
5805
5917
|
})]
|
|
@@ -5838,8 +5950,8 @@ var WarningListSelect = /*#__PURE__*/React__default.memo(function (_ref) {
|
|
|
5838
5950
|
renderValue = _ref.renderValue,
|
|
5839
5951
|
gridArea = _ref.gridArea,
|
|
5840
5952
|
additionalStyling = _ref.additionalStyling,
|
|
5841
|
-
_ref$
|
|
5842
|
-
|
|
5953
|
+
_ref$isReadOnly = _ref.isReadOnly,
|
|
5954
|
+
isReadOnly = _ref$isReadOnly === void 0 ? false : _ref$isReadOnly;
|
|
5843
5955
|
var currentIndex = options.findIndex(function (option) {
|
|
5844
5956
|
return option.value === value;
|
|
5845
5957
|
});
|
|
@@ -5854,14 +5966,24 @@ var WarningListSelect = /*#__PURE__*/React__default.memo(function (_ref) {
|
|
|
5854
5966
|
style: {
|
|
5855
5967
|
maxWidth: '100%'
|
|
5856
5968
|
},
|
|
5857
|
-
isEnabled: !
|
|
5858
|
-
disabled:
|
|
5969
|
+
isEnabled: !isReadOnly,
|
|
5970
|
+
disabled: isReadOnly,
|
|
5859
5971
|
value: value != null ? value : '',
|
|
5860
5972
|
SelectDisplayProps: {
|
|
5861
5973
|
'aria-label': label
|
|
5862
5974
|
},
|
|
5863
5975
|
list: options,
|
|
5864
|
-
additionalStyling:
|
|
5976
|
+
additionalStyling: Object.assign({
|
|
5977
|
+
'&.Mui-disabled .MuiSvgIcon-root': {
|
|
5978
|
+
display: 'none'
|
|
5979
|
+
},
|
|
5980
|
+
'&.Mui-disabled': {
|
|
5981
|
+
color: 'inherit',
|
|
5982
|
+
'& .MuiInput-input': {
|
|
5983
|
+
WebkitTextFillColor: 'inherit'
|
|
5984
|
+
}
|
|
5985
|
+
}
|
|
5986
|
+
}, additionalStyling),
|
|
5865
5987
|
currentIndex: currentIndex > -1 ? currentIndex : undefined,
|
|
5866
5988
|
renderValue: renderValue,
|
|
5867
5989
|
onChange: function onChange(event) {
|
|
@@ -5920,7 +6042,8 @@ var WindForceSelect = function WindForceSelect(_ref) {
|
|
|
5920
6042
|
var onChange = _ref.onChange,
|
|
5921
6043
|
value = _ref.value,
|
|
5922
6044
|
gridArea = _ref.gridArea,
|
|
5923
|
-
options = _ref.options
|
|
6045
|
+
options = _ref.options,
|
|
6046
|
+
isReadOnly = _ref.isReadOnly;
|
|
5924
6047
|
var warningListOptions = React__default.useMemo(function () {
|
|
5925
6048
|
return options.map(function (option) {
|
|
5926
6049
|
return {
|
|
@@ -5989,9 +6112,13 @@ var WindForceSelect = function WindForceSelect(_ref) {
|
|
|
5989
6112
|
onChange: onChange,
|
|
5990
6113
|
renderOption: renderOption,
|
|
5991
6114
|
renderValue: renderValue,
|
|
6115
|
+
isReadOnly: isReadOnly,
|
|
5992
6116
|
additionalStyling: {
|
|
5993
6117
|
'& .MuiSvgIcon-root': {
|
|
5994
6118
|
fill: arrowColor
|
|
6119
|
+
},
|
|
6120
|
+
'& .MuiSelect-standard': {
|
|
6121
|
+
paddingBlock: 0
|
|
5995
6122
|
}
|
|
5996
6123
|
}
|
|
5997
6124
|
});
|
|
@@ -6141,7 +6268,9 @@ var WarningListItem$1 = /*#__PURE__*/React__default.memo(function (_ref) {
|
|
|
6141
6268
|
onRemove = _ref.onRemove,
|
|
6142
6269
|
onChange = _ref.onChange,
|
|
6143
6270
|
onToggleSelectArea = _ref.onToggleSelectArea,
|
|
6271
|
+
onSelectMultipleAreas = _ref.onSelectMultipleAreas,
|
|
6144
6272
|
onRemoveArea = _ref.onRemoveArea,
|
|
6273
|
+
isReadOnly = _ref.isReadOnly,
|
|
6145
6274
|
_ref$shouldShowDistri = _ref.shouldShowDistricts,
|
|
6146
6275
|
shouldShowDistricts = _ref$shouldShowDistri === void 0 ? false : _ref$shouldShowDistri;
|
|
6147
6276
|
var areasById = React__default.useMemo(function () {
|
|
@@ -6152,6 +6281,8 @@ var WarningListItem$1 = /*#__PURE__*/React__default.memo(function (_ref) {
|
|
|
6152
6281
|
var assignedAreas = React__default.useMemo(function () {
|
|
6153
6282
|
return warning.assignedAreaIds.map(function (areaId) {
|
|
6154
6283
|
return areasById.get(areaId);
|
|
6284
|
+
}).filter(function (area) {
|
|
6285
|
+
return area !== undefined;
|
|
6155
6286
|
});
|
|
6156
6287
|
}, [warning.assignedAreaIds, areasById]);
|
|
6157
6288
|
var _useWarningsTranslati = useWarningsTranslation(),
|
|
@@ -6184,41 +6315,46 @@ var WarningListItem$1 = /*#__PURE__*/React__default.memo(function (_ref) {
|
|
|
6184
6315
|
var handleAddClick = React__default.useCallback(function () {
|
|
6185
6316
|
onAddClick(warning.id);
|
|
6186
6317
|
}, [warning.id, onAddClick]);
|
|
6187
|
-
var shouldDisableDirTo = warning.changeType === 'NO_CHANGE';
|
|
6318
|
+
var shouldDisableDirTo = warning.changeType === 'NO_CHANGE' || isReadOnly;
|
|
6188
6319
|
return jsxs(StyledItem, {
|
|
6189
6320
|
"data-testid": "maritime-warning",
|
|
6190
|
-
children: [jsx(WarningListDragHandle, {}), jsx(WarningListSelect, {
|
|
6321
|
+
children: [!isReadOnly && jsx(WarningListDragHandle, {}), jsx(WarningListSelect, {
|
|
6191
6322
|
gridArea: "dirFrom",
|
|
6192
6323
|
label: t('maritime-header-direction-from'),
|
|
6193
6324
|
options: windDirections,
|
|
6194
6325
|
onChange: handleChangeFromDirection,
|
|
6195
|
-
value: warning.windDirectionFrom
|
|
6326
|
+
value: warning.windDirectionFrom,
|
|
6327
|
+
isReadOnly: isReadOnly
|
|
6196
6328
|
}), jsx(WindForceSelect, {
|
|
6197
6329
|
gridArea: "windForce",
|
|
6198
6330
|
value: warning.windForce,
|
|
6199
6331
|
options: windForce,
|
|
6200
|
-
onChange: handleChangeWindForce
|
|
6332
|
+
onChange: handleChangeWindForce,
|
|
6333
|
+
isReadOnly: isReadOnly
|
|
6201
6334
|
}), jsx(AssignedAreas, {
|
|
6202
6335
|
assignedAreas: assignedAreas,
|
|
6203
6336
|
selectedAreaIds: selectedAreaIds,
|
|
6204
6337
|
onAddClick: handleAddClick,
|
|
6205
6338
|
onToggleSelectArea: onToggleSelectArea,
|
|
6339
|
+
onSelectMultipleAreas: onSelectMultipleAreas,
|
|
6206
6340
|
onDeleteClick: onRemoveArea,
|
|
6207
|
-
shouldShowDistricts: shouldShowDistricts
|
|
6341
|
+
shouldShowDistricts: shouldShowDistricts,
|
|
6342
|
+
isReadOnly: isReadOnly
|
|
6208
6343
|
}), jsx(WarningListSelect, {
|
|
6209
6344
|
gridArea: "changeType",
|
|
6210
6345
|
label: t('maritime-header-change'),
|
|
6211
6346
|
options: change,
|
|
6212
6347
|
onChange: handleChangeWindChangeType,
|
|
6213
|
-
value: warning.changeType
|
|
6348
|
+
value: warning.changeType,
|
|
6349
|
+
isReadOnly: isReadOnly
|
|
6214
6350
|
}), jsx(WarningListSelect, {
|
|
6215
6351
|
gridArea: "dirTo",
|
|
6216
6352
|
label: t('maritime-header-direction-to'),
|
|
6217
6353
|
options: windDirections,
|
|
6218
6354
|
onChange: handleChangeToDirection,
|
|
6219
6355
|
value: warning.windDirectionTo,
|
|
6220
|
-
|
|
6221
|
-
}), jsx(
|
|
6356
|
+
isReadOnly: shouldDisableDirTo
|
|
6357
|
+
}), !isReadOnly && jsx(CustomIconButton, {
|
|
6222
6358
|
sx: {
|
|
6223
6359
|
gridArea: 'delete',
|
|
6224
6360
|
justifySelf: 'end',
|
|
@@ -6230,6 +6366,7 @@ var WarningListItem$1 = /*#__PURE__*/React__default.memo(function (_ref) {
|
|
|
6230
6366
|
return onRemove(warning.id);
|
|
6231
6367
|
},
|
|
6232
6368
|
"aria-label": t('maritime-delete-button'),
|
|
6369
|
+
tooltipTitle: t('maritime-retract-warning'),
|
|
6233
6370
|
children: jsx(Delete, {})
|
|
6234
6371
|
})]
|
|
6235
6372
|
});
|
|
@@ -6250,7 +6387,7 @@ var StyledItem = styled('div')(function (_ref2) {
|
|
|
6250
6387
|
paddingInline: theme.spacing(0.25),
|
|
6251
6388
|
// styling for small windows
|
|
6252
6389
|
gridTemplateAreas: "\n \"drag dirFrom dirFrom windForce delete\"\n \". areas areas areas .\"\n \". changeType dirTo dirTo .\" \n ",
|
|
6253
|
-
gridTemplateColumns: '
|
|
6390
|
+
gridTemplateColumns: '20px minmax(87px, 1fr) 1fr minmax(60px, 1fr) 20px'
|
|
6254
6391
|
}, _ref3["@container maritime (min-width: " + breakpoints.tablet + "px)"] = {
|
|
6255
6392
|
gridTemplateAreas: "\n \"drag dirFrom windForce areas changeType dirTo delete\" \n ",
|
|
6256
6393
|
gridTemplateColumns: 'var(--grid-columns)'
|
|
@@ -6267,7 +6404,9 @@ var WarningList = function WarningList(_ref) {
|
|
|
6267
6404
|
onRemoveArea = _ref.onRemoveArea,
|
|
6268
6405
|
onChangeWarning = _ref.onChangeWarning,
|
|
6269
6406
|
onToggleSelectArea = _ref.onToggleSelectArea,
|
|
6407
|
+
onSelectMultipleAreas = _ref.onSelectMultipleAreas,
|
|
6270
6408
|
onMoveWarning = _ref.onMoveWarning,
|
|
6409
|
+
isReadOnly = _ref.isReadOnly,
|
|
6271
6410
|
_ref$shouldShowDistri = _ref.shouldShowDistricts,
|
|
6272
6411
|
shouldShowDistricts = _ref$shouldShowDistri === void 0 ? false : _ref$shouldShowDistri;
|
|
6273
6412
|
var _useWarningsTranslati = useWarningsTranslation(),
|
|
@@ -6281,7 +6420,8 @@ var WarningList = function WarningList(_ref) {
|
|
|
6281
6420
|
display: 'flex',
|
|
6282
6421
|
flexDirection: 'column',
|
|
6283
6422
|
minHeight: 0,
|
|
6284
|
-
|
|
6423
|
+
marginBottom: 1,
|
|
6424
|
+
'--grid-columns': '30px 150px 60px 2fr 100px 150px 1fr'
|
|
6285
6425
|
},
|
|
6286
6426
|
children: [jsxs(Box, {
|
|
6287
6427
|
sx: (_sx = {
|
|
@@ -6322,7 +6462,9 @@ var WarningList = function WarningList(_ref) {
|
|
|
6322
6462
|
warning: warning,
|
|
6323
6463
|
areas: areas,
|
|
6324
6464
|
selectedAreaIds: selectedAreaIds,
|
|
6465
|
+
isReadOnly: isReadOnly,
|
|
6325
6466
|
onToggleSelectArea: onToggleSelectArea,
|
|
6467
|
+
onSelectMultipleAreas: onSelectMultipleAreas,
|
|
6326
6468
|
onAddClick: onAddSelectedAreas,
|
|
6327
6469
|
onRemove: onRemoveWarning,
|
|
6328
6470
|
onChange: onChangeWarning,
|
|
@@ -6334,97 +6476,6 @@ var WarningList = function WarningList(_ref) {
|
|
|
6334
6476
|
});
|
|
6335
6477
|
};
|
|
6336
6478
|
|
|
6337
|
-
var MaritimeWarningsForm = function MaritimeWarningsForm(_ref) {
|
|
6338
|
-
var _sx, _sx2, _sx3;
|
|
6339
|
-
var areas = _ref.areas,
|
|
6340
|
-
selectedAreaIds = _ref.selectedAreaIds,
|
|
6341
|
-
modified = _ref.modified,
|
|
6342
|
-
warnings = _ref.warnings,
|
|
6343
|
-
onToggleSelectArea = _ref.onToggleSelectArea,
|
|
6344
|
-
onAddSelectedAreas = _ref.onAddSelectedAreas,
|
|
6345
|
-
onRemoveWarning = _ref.onRemoveWarning,
|
|
6346
|
-
onRemoveArea = _ref.onRemoveArea,
|
|
6347
|
-
onAddWarning = _ref.onAddWarning,
|
|
6348
|
-
onChangeWarning = _ref.onChangeWarning,
|
|
6349
|
-
onSubmit = _ref.onSubmit,
|
|
6350
|
-
onClear = _ref.onClear,
|
|
6351
|
-
onMoveWarning = _ref.onMoveWarning,
|
|
6352
|
-
_ref$shouldShowDistri = _ref.shouldShowDistricts,
|
|
6353
|
-
shouldShowDistricts = _ref$shouldShowDistri === void 0 ? false : _ref$shouldShowDistri;
|
|
6354
|
-
var _useWarningsTranslati = useWarningsTranslation(),
|
|
6355
|
-
t = _useWarningsTranslati.t;
|
|
6356
|
-
var disabledAreaIds = warnings.flatMap(function (warning) {
|
|
6357
|
-
return warning.assignedAreaIds;
|
|
6358
|
-
});
|
|
6359
|
-
return jsxs(Stack, {
|
|
6360
|
-
direction: "column",
|
|
6361
|
-
spacing: 3,
|
|
6362
|
-
sx: (_sx = {
|
|
6363
|
-
height: '100%',
|
|
6364
|
-
containerName: 'maritime',
|
|
6365
|
-
containerType: 'inline-size',
|
|
6366
|
-
padding: 2
|
|
6367
|
-
}, _sx["@container maritime (min-width: " + breakpoints.tablet + "px)"] = {
|
|
6368
|
-
padding: 3
|
|
6369
|
-
}, _sx),
|
|
6370
|
-
children: [jsx(AreaList, {
|
|
6371
|
-
areas: areas,
|
|
6372
|
-
selected: selectedAreaIds,
|
|
6373
|
-
disabled: disabledAreaIds,
|
|
6374
|
-
onClickItem: onToggleSelectArea
|
|
6375
|
-
}), jsx(WarningList, {
|
|
6376
|
-
warnings: warnings,
|
|
6377
|
-
areas: areas,
|
|
6378
|
-
selectedAreaIds: selectedAreaIds,
|
|
6379
|
-
onAddSelectedAreas: onAddSelectedAreas,
|
|
6380
|
-
onRemoveWarning: onRemoveWarning,
|
|
6381
|
-
onChangeWarning: onChangeWarning,
|
|
6382
|
-
onToggleSelectArea: onToggleSelectArea,
|
|
6383
|
-
onRemoveArea: onRemoveArea,
|
|
6384
|
-
onMoveWarning: onMoveWarning,
|
|
6385
|
-
shouldShowDistricts: shouldShowDistricts
|
|
6386
|
-
}), jsxs(Button, {
|
|
6387
|
-
onClick: onAddWarning,
|
|
6388
|
-
variant: "tertiary",
|
|
6389
|
-
size: "small",
|
|
6390
|
-
sx: {
|
|
6391
|
-
alignSelf: 'flex-start',
|
|
6392
|
-
paddingInline: 2
|
|
6393
|
-
},
|
|
6394
|
-
children: [jsx(Add, {}), t('maritime-new-warning')]
|
|
6395
|
-
}), jsxs(Stack, {
|
|
6396
|
-
spacing: 2,
|
|
6397
|
-
direction: "row",
|
|
6398
|
-
sx: (_sx2 = {}, _sx2["@container maritime (min-width: " + breakpoints.tablet + "px)"] = {
|
|
6399
|
-
position: 'absolute',
|
|
6400
|
-
bottom: 0,
|
|
6401
|
-
right: 0,
|
|
6402
|
-
padding: 3
|
|
6403
|
-
}, _sx2),
|
|
6404
|
-
children: [jsx(Button, {
|
|
6405
|
-
onClick: onClear,
|
|
6406
|
-
variant: "tertiary",
|
|
6407
|
-
size: "small",
|
|
6408
|
-
sx: {
|
|
6409
|
-
width: '134px'
|
|
6410
|
-
},
|
|
6411
|
-
children: t('warning-button-clear')
|
|
6412
|
-
}), jsx(Button, {
|
|
6413
|
-
variant: "primary",
|
|
6414
|
-
size: "small",
|
|
6415
|
-
sx: (_sx3 = {
|
|
6416
|
-
width: '134px'
|
|
6417
|
-
}, _sx3["@container maritime (min-width: " + breakpoints.tablet + "px)"] = {
|
|
6418
|
-
marginLeft: '24px!important'
|
|
6419
|
-
}, _sx3),
|
|
6420
|
-
disabled: !modified,
|
|
6421
|
-
onClick: onSubmit,
|
|
6422
|
-
children: t('warning-button-publish')
|
|
6423
|
-
})]
|
|
6424
|
-
})]
|
|
6425
|
-
});
|
|
6426
|
-
};
|
|
6427
|
-
|
|
6428
6479
|
/* *
|
|
6429
6480
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6430
6481
|
* you may not use this file except in compliance with the License.
|
|
@@ -6442,14 +6493,17 @@ var MaritimeWarningsForm = function MaritimeWarningsForm(_ref) {
|
|
|
6442
6493
|
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
6443
6494
|
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
6444
6495
|
* */
|
|
6445
|
-
var
|
|
6496
|
+
var unpublishedWarningId = 0;
|
|
6446
6497
|
function createWarning() {
|
|
6447
|
-
|
|
6498
|
+
unpublishedWarningId += 1;
|
|
6448
6499
|
return {
|
|
6449
6500
|
assignedAreaIds: [],
|
|
6450
|
-
id: "
|
|
6501
|
+
id: "unpublished-warning-" + unpublishedWarningId
|
|
6451
6502
|
};
|
|
6452
6503
|
}
|
|
6504
|
+
function isPublishedWarning(warning) {
|
|
6505
|
+
return !warning.id.startsWith('unpublished-warning');
|
|
6506
|
+
}
|
|
6453
6507
|
var initialState = {
|
|
6454
6508
|
selectedAreaIds: [],
|
|
6455
6509
|
warnings: [createWarning()],
|
|
@@ -6482,6 +6536,16 @@ function reducer(state, action) {
|
|
|
6482
6536
|
selectedAreaIds: [].concat(state.selectedAreaIds, [action.id])
|
|
6483
6537
|
});
|
|
6484
6538
|
}
|
|
6539
|
+
case 'selectMultipleAreas':
|
|
6540
|
+
{
|
|
6541
|
+
var newSelectedAreaIds = new Set([].concat(state.selectedAreaIds, action.ids));
|
|
6542
|
+
if (newSelectedAreaIds.size === state.selectedAreaIds.length) {
|
|
6543
|
+
return state;
|
|
6544
|
+
}
|
|
6545
|
+
return Object.assign({}, state, {
|
|
6546
|
+
selectedAreaIds: Array.from(newSelectedAreaIds)
|
|
6547
|
+
});
|
|
6548
|
+
}
|
|
6485
6549
|
case 'removeArea':
|
|
6486
6550
|
{
|
|
6487
6551
|
return Object.assign({}, state, {
|
|
@@ -6567,6 +6631,32 @@ function reducer(state, action) {
|
|
|
6567
6631
|
modified: true
|
|
6568
6632
|
});
|
|
6569
6633
|
}
|
|
6634
|
+
case 'mergeWarnings':
|
|
6635
|
+
{
|
|
6636
|
+
var clonedWarnings = new Set();
|
|
6637
|
+
var mergedWarnings = state.warnings.reduce(function (acc, warning) {
|
|
6638
|
+
var relatedWarningIndex = acc.findLastIndex(function (otherWarning) {
|
|
6639
|
+
return warning.windDirectionFrom === otherWarning.windDirectionFrom && warning.windForce === otherWarning.windForce && warning.changeType === otherWarning.changeType && warning.windDirectionTo === otherWarning.windDirectionTo;
|
|
6640
|
+
});
|
|
6641
|
+
if (relatedWarningIndex > -1) {
|
|
6642
|
+
var relatedWarning = acc[relatedWarningIndex];
|
|
6643
|
+
// clone the warning to make sure React knows that it is a new warning
|
|
6644
|
+
if (!clonedWarnings.has(relatedWarningIndex)) {
|
|
6645
|
+
clonedWarnings.add(relatedWarningIndex);
|
|
6646
|
+
var clonedRelatedWarning = Object.assign({}, relatedWarning, {
|
|
6647
|
+
assignedAreaIds: [].concat(relatedWarning.assignedAreaIds, warning.assignedAreaIds)
|
|
6648
|
+
});
|
|
6649
|
+
return acc["with"](relatedWarningIndex, clonedRelatedWarning);
|
|
6650
|
+
}
|
|
6651
|
+
relatedWarning.assignedAreaIds = [].concat(relatedWarning.assignedAreaIds, warning.assignedAreaIds);
|
|
6652
|
+
return acc;
|
|
6653
|
+
}
|
|
6654
|
+
return [].concat(acc, [warning]);
|
|
6655
|
+
}, []);
|
|
6656
|
+
return Object.assign({}, state, {
|
|
6657
|
+
warnings: mergedWarnings
|
|
6658
|
+
});
|
|
6659
|
+
}
|
|
6570
6660
|
case 'initialize':
|
|
6571
6661
|
{
|
|
6572
6662
|
if (action.warnings.length === 0) {
|
|
@@ -6587,19 +6677,420 @@ function useMaritimeWarningsFormState() {
|
|
|
6587
6677
|
return React__default.useReducer(reducer, initialState);
|
|
6588
6678
|
}
|
|
6589
6679
|
|
|
6680
|
+
function useConfirmRetractDialog(_ref) {
|
|
6681
|
+
var areas = _ref.areas,
|
|
6682
|
+
warnings = _ref.warnings,
|
|
6683
|
+
onRemoveWarning = _ref.onRemoveWarning;
|
|
6684
|
+
var confirmDialog = useConfirmationDialog();
|
|
6685
|
+
var _useWarningsTranslati = useWarningsTranslation(),
|
|
6686
|
+
t = _useWarningsTranslati.t;
|
|
6687
|
+
var getLabelFromOption = React__default.useCallback(function (options, value) {
|
|
6688
|
+
var option = options.find(function (option) {
|
|
6689
|
+
return option.value === value;
|
|
6690
|
+
});
|
|
6691
|
+
if (!option) {
|
|
6692
|
+
return '';
|
|
6693
|
+
}
|
|
6694
|
+
return typeof option.label === 'function' ? option.label(t) : option.label;
|
|
6695
|
+
}, [t]);
|
|
6696
|
+
var getWarningDescription = React__default.useCallback(function (warning) {
|
|
6697
|
+
if (!isPublishedWarning(warning)) {
|
|
6698
|
+
return t('maritime-retract-dialog-empty-warning-description');
|
|
6699
|
+
}
|
|
6700
|
+
var windDirectionFromLabel = getLabelFromOption(windDirections, warning.windDirectionFrom);
|
|
6701
|
+
var areasById = new Map(areas.map(function (area) {
|
|
6702
|
+
return [area.id, area];
|
|
6703
|
+
}));
|
|
6704
|
+
var areaLabels = warning.assignedAreaIds.map(function (areaId) {
|
|
6705
|
+
return areasById.get(areaId).label;
|
|
6706
|
+
});
|
|
6707
|
+
var changeToLabel = warning.changeType === 'NO_CHANGE' ? t('maritime-retract-dialog-no-change') : getLabelFromOption(change, warning.changeType) + " " + getLabelFromOption(windDirections, warning.windDirectionTo);
|
|
6708
|
+
var warningDescription = [windDirectionFromLabel + " " + t('maritime-windforce', {
|
|
6709
|
+
value: warning.windForce
|
|
6710
|
+
})].concat(areaLabels, [changeToLabel]).join(', ');
|
|
6711
|
+
return warningDescription + ". " + t('maritime-retract-dialog-description-suffix');
|
|
6712
|
+
}, [areas, t, getLabelFromOption]);
|
|
6713
|
+
return {
|
|
6714
|
+
onRemoveWarningWithConfirmation: React__default.useCallback(/*#__PURE__*/function () {
|
|
6715
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(id) {
|
|
6716
|
+
var warning;
|
|
6717
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
6718
|
+
while (1) switch (_context.prev = _context.next) {
|
|
6719
|
+
case 0:
|
|
6720
|
+
warning = warnings.find(function (warning) {
|
|
6721
|
+
return warning.id === id;
|
|
6722
|
+
});
|
|
6723
|
+
_context.next = 3;
|
|
6724
|
+
return confirmDialog({
|
|
6725
|
+
title: t('maritime-retract-warning'),
|
|
6726
|
+
description: '',
|
|
6727
|
+
confirmLabel: t('maritime-retract-dialog-confirm'),
|
|
6728
|
+
cancelLabel: t('close-dialog-cancel'),
|
|
6729
|
+
content: getWarningDescription(warning)
|
|
6730
|
+
});
|
|
6731
|
+
case 3:
|
|
6732
|
+
onRemoveWarning(id);
|
|
6733
|
+
case 4:
|
|
6734
|
+
case "end":
|
|
6735
|
+
return _context.stop();
|
|
6736
|
+
}
|
|
6737
|
+
}, _callee);
|
|
6738
|
+
}));
|
|
6739
|
+
return function (_x) {
|
|
6740
|
+
return _ref2.apply(this, arguments);
|
|
6741
|
+
};
|
|
6742
|
+
}(), [warnings, getWarningDescription, t, confirmDialog, onRemoveWarning])
|
|
6743
|
+
};
|
|
6744
|
+
}
|
|
6745
|
+
|
|
6746
|
+
/* *
|
|
6747
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6748
|
+
* you may not use this file except in compliance with the License.
|
|
6749
|
+
* You may obtain a copy of the License at
|
|
6750
|
+
*
|
|
6751
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
6752
|
+
*
|
|
6753
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
6754
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
6755
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6756
|
+
* See the License for the specific language governing permissions and
|
|
6757
|
+
* limitations under the License.
|
|
6758
|
+
*
|
|
6759
|
+
* Copyright 2025 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6760
|
+
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
6761
|
+
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
6762
|
+
* */
|
|
6763
|
+
var isWarningEmpty = function isWarningEmpty(item) {
|
|
6764
|
+
var windDirectionFrom = item.windDirectionFrom,
|
|
6765
|
+
windForce = item.windForce,
|
|
6766
|
+
changeType = item.changeType,
|
|
6767
|
+
windDirectionTo = item.windDirectionTo,
|
|
6768
|
+
assignedAreaIds = item.assignedAreaIds;
|
|
6769
|
+
if (assignedAreaIds.length) {
|
|
6770
|
+
return false;
|
|
6771
|
+
}
|
|
6772
|
+
return [windDirectionFrom, windForce, changeType, windDirectionTo].every(function (value) {
|
|
6773
|
+
return value === undefined || value.trim() === '';
|
|
6774
|
+
});
|
|
6775
|
+
};
|
|
6776
|
+
var isWarningValid = function isWarningValid(item) {
|
|
6777
|
+
var windDirectionFrom = item.windDirectionFrom,
|
|
6778
|
+
windForce = item.windForce,
|
|
6779
|
+
assignedAreaIds = item.assignedAreaIds,
|
|
6780
|
+
changeType = item.changeType,
|
|
6781
|
+
windDirectionTo = item.windDirectionTo;
|
|
6782
|
+
// Direction, windspeed and areas are required.
|
|
6783
|
+
if (!windDirectionFrom || !windForce || !assignedAreaIds.length) {
|
|
6784
|
+
return false;
|
|
6785
|
+
}
|
|
6786
|
+
// If there is a Change selected, Direction to is also required
|
|
6787
|
+
if (changeType && changeType !== 'NO_CHANGE') {
|
|
6788
|
+
return !!windDirectionTo;
|
|
6789
|
+
}
|
|
6790
|
+
return true;
|
|
6791
|
+
};
|
|
6792
|
+
var isWarningsValid = function isWarningsValid(warnings) {
|
|
6793
|
+
// One single empty row is allowed, if not empty it should be valid
|
|
6794
|
+
if (warnings.length === 1) {
|
|
6795
|
+
return isWarningEmpty(warnings[0]) || isWarningValid(warnings[0]);
|
|
6796
|
+
}
|
|
6797
|
+
return warnings.every(function (warning) {
|
|
6798
|
+
return !isWarningEmpty(warning) && isWarningValid(warning);
|
|
6799
|
+
});
|
|
6800
|
+
};
|
|
6801
|
+
// FIXME: should be based on the config from BE
|
|
6802
|
+
var getLevelFromWindForce = function getLevelFromWindForce(windForce) {
|
|
6803
|
+
var force = parseInt(windForce, 10);
|
|
6804
|
+
if (isNaN(force)) {
|
|
6805
|
+
return '';
|
|
6806
|
+
}
|
|
6807
|
+
if (force < 8) {
|
|
6808
|
+
return 'moderate';
|
|
6809
|
+
}
|
|
6810
|
+
if (force < 10) {
|
|
6811
|
+
return 'severe';
|
|
6812
|
+
}
|
|
6813
|
+
return 'extreme';
|
|
6814
|
+
};
|
|
6815
|
+
var getType = function getType(domain) {
|
|
6816
|
+
switch (domain) {
|
|
6817
|
+
case 'coastalWaters':
|
|
6818
|
+
return 'maritimeWarningCoastal';
|
|
6819
|
+
case 'northSeaDistricts':
|
|
6820
|
+
default:
|
|
6821
|
+
return 'maritimeWarningNorthSea';
|
|
6822
|
+
}
|
|
6823
|
+
};
|
|
6824
|
+
var mapItemsToMaritimeWarnings = function mapItemsToMaritimeWarnings(warnings, domain, editor) {
|
|
6825
|
+
var type = getType(domain);
|
|
6826
|
+
return warnings.map(function (warning) {
|
|
6827
|
+
return {
|
|
6828
|
+
type: type,
|
|
6829
|
+
editor: editor,
|
|
6830
|
+
status: PublicWarningStatus.PUBLISHED,
|
|
6831
|
+
warningDetail: {
|
|
6832
|
+
phenomenon: 'wind',
|
|
6833
|
+
validFrom: new Date().toISOString(),
|
|
6834
|
+
validUntil: new Date(Date.now() + 24 * 60 * 60 * 1000).toISOString(),
|
|
6835
|
+
level: getLevelFromWindForce(warning.windForce || ''),
|
|
6836
|
+
probability: 100,
|
|
6837
|
+
areas: warning.assignedAreaIds.map(function (areaId) {
|
|
6838
|
+
return {
|
|
6839
|
+
objectName: areaId,
|
|
6840
|
+
geoJSON: {
|
|
6841
|
+
type: 'FeatureCollection',
|
|
6842
|
+
features: []
|
|
6843
|
+
}
|
|
6844
|
+
};
|
|
6845
|
+
}),
|
|
6846
|
+
windDirectionFrom: warning.windDirectionFrom,
|
|
6847
|
+
windForce: warning.windForce,
|
|
6848
|
+
changeType: warning.changeType,
|
|
6849
|
+
windDirectionTo: warning.windDirectionTo,
|
|
6850
|
+
descriptionOriginal: '',
|
|
6851
|
+
descriptionTranslation: '',
|
|
6852
|
+
domain: type
|
|
6853
|
+
}
|
|
6854
|
+
};
|
|
6855
|
+
});
|
|
6856
|
+
};
|
|
6857
|
+
var mapMaritimeWarningsToItems = function mapMaritimeWarningsToItems(warnings) {
|
|
6858
|
+
return warnings.map(function (warning) {
|
|
6859
|
+
var _warning$warningDetai;
|
|
6860
|
+
return {
|
|
6861
|
+
id: warning.id || '',
|
|
6862
|
+
assignedAreaIds: ((_warning$warningDetai = warning.warningDetail.areas) == null ? void 0 : _warning$warningDetai.map(function (area) {
|
|
6863
|
+
return area.objectName;
|
|
6864
|
+
})) || [],
|
|
6865
|
+
windDirectionFrom: warning.warningDetail.windDirectionFrom,
|
|
6866
|
+
windDirectionTo: warning.warningDetail.windDirectionTo,
|
|
6867
|
+
windForce: warning.warningDetail.windForce,
|
|
6868
|
+
changeType: warning.warningDetail.changeType
|
|
6869
|
+
};
|
|
6870
|
+
});
|
|
6871
|
+
};
|
|
6872
|
+
|
|
6873
|
+
var MaritimeWarningAvatar = function MaritimeWarningAvatar(_ref) {
|
|
6874
|
+
var editor = _ref.editor,
|
|
6875
|
+
_ref$tooltipPlacement = _ref.tooltipPlacement,
|
|
6876
|
+
tooltipPlacement = _ref$tooltipPlacement === void 0 ? 'bottom' : _ref$tooltipPlacement;
|
|
6877
|
+
return jsx(CustomTooltip, {
|
|
6878
|
+
title: "Editor: " + editor,
|
|
6879
|
+
placement: tooltipPlacement,
|
|
6880
|
+
children: jsx("span", {
|
|
6881
|
+
children: jsx(Avatar, {
|
|
6882
|
+
size: "small",
|
|
6883
|
+
children: getInitials(editor)
|
|
6884
|
+
})
|
|
6885
|
+
})
|
|
6886
|
+
});
|
|
6887
|
+
};
|
|
6888
|
+
|
|
6889
|
+
var MaritimeWarningsForm = function MaritimeWarningsForm(_ref) {
|
|
6890
|
+
var _sx, _sx2, _sx3, _sx4;
|
|
6891
|
+
var areas = _ref.areas,
|
|
6892
|
+
selectedAreaIds = _ref.selectedAreaIds,
|
|
6893
|
+
modified = _ref.modified,
|
|
6894
|
+
warnings = _ref.warnings,
|
|
6895
|
+
onToggleSelectArea = _ref.onToggleSelectArea,
|
|
6896
|
+
onSelectMultipleAreas = _ref.onSelectMultipleAreas,
|
|
6897
|
+
onAddSelectedAreas = _ref.onAddSelectedAreas,
|
|
6898
|
+
onRemoveWarning = _ref.onRemoveWarning,
|
|
6899
|
+
onRemoveArea = _ref.onRemoveArea,
|
|
6900
|
+
onAddWarning = _ref.onAddWarning,
|
|
6901
|
+
onChangeWarning = _ref.onChangeWarning,
|
|
6902
|
+
onSubmit = _ref.onSubmit,
|
|
6903
|
+
onClear = _ref.onClear,
|
|
6904
|
+
onMoveWarning = _ref.onMoveWarning,
|
|
6905
|
+
onToggleReadOnly = _ref.onToggleReadOnly,
|
|
6906
|
+
isReadOnly = _ref.isReadOnly,
|
|
6907
|
+
_ref$shouldShowDistri = _ref.shouldShowDistricts,
|
|
6908
|
+
shouldShowDistricts = _ref$shouldShowDistri === void 0 ? false : _ref$shouldShowDistri,
|
|
6909
|
+
editor = _ref.editor;
|
|
6910
|
+
var _useWarningsTranslati = useWarningsTranslation(),
|
|
6911
|
+
t = _useWarningsTranslati.t;
|
|
6912
|
+
var showConfirmDialog = useConfirmationDialog();
|
|
6913
|
+
var disabledAreaIds = warnings.flatMap(function (warning) {
|
|
6914
|
+
return warning.assignedAreaIds;
|
|
6915
|
+
});
|
|
6916
|
+
var _useConfirmRetractDia = useConfirmRetractDialog({
|
|
6917
|
+
areas: areas,
|
|
6918
|
+
warnings: warnings,
|
|
6919
|
+
onRemoveWarning: onRemoveWarning
|
|
6920
|
+
}),
|
|
6921
|
+
onRemoveWarningWithConfirmation = _useConfirmRetractDia.onRemoveWarningWithConfirmation;
|
|
6922
|
+
var onClearWithConfirmation = React__default.useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
6923
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
6924
|
+
while (1) switch (_context.prev = _context.next) {
|
|
6925
|
+
case 0:
|
|
6926
|
+
_context.next = 2;
|
|
6927
|
+
return showConfirmDialog({
|
|
6928
|
+
title: t('maritime-clear-dialog-title'),
|
|
6929
|
+
description: t('maritime-clear-dialog-description'),
|
|
6930
|
+
confirmLabel: t('warning-button-clear'),
|
|
6931
|
+
cancelLabel: t('close-dialog-cancel')
|
|
6932
|
+
});
|
|
6933
|
+
case 2:
|
|
6934
|
+
onClear();
|
|
6935
|
+
case 3:
|
|
6936
|
+
case "end":
|
|
6937
|
+
return _context.stop();
|
|
6938
|
+
}
|
|
6939
|
+
}, _callee);
|
|
6940
|
+
})), [onClear, t, showConfirmDialog]);
|
|
6941
|
+
var isValid = isWarningsValid(warnings);
|
|
6942
|
+
var onSwitchMode = /*#__PURE__*/function () {
|
|
6943
|
+
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(event) {
|
|
6944
|
+
var checked, isReadOnly;
|
|
6945
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
6946
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
6947
|
+
case 0:
|
|
6948
|
+
checked = event.target.checked;
|
|
6949
|
+
isReadOnly = !checked;
|
|
6950
|
+
if (!(modified && isReadOnly)) {
|
|
6951
|
+
_context2.next = 5;
|
|
6952
|
+
break;
|
|
6953
|
+
}
|
|
6954
|
+
_context2.next = 5;
|
|
6955
|
+
return showConfirmDialog({
|
|
6956
|
+
title: t('warning-view-mode-title'),
|
|
6957
|
+
description: t('warning-view-mode-description'),
|
|
6958
|
+
confirmLabel: t('warning-view-mode-confirm'),
|
|
6959
|
+
cancelLabel: t('warning-dialog-cancel')
|
|
6960
|
+
});
|
|
6961
|
+
case 5:
|
|
6962
|
+
onToggleReadOnly(isReadOnly);
|
|
6963
|
+
case 6:
|
|
6964
|
+
case "end":
|
|
6965
|
+
return _context2.stop();
|
|
6966
|
+
}
|
|
6967
|
+
}, _callee2);
|
|
6968
|
+
}));
|
|
6969
|
+
return function onSwitchMode(_x) {
|
|
6970
|
+
return _ref3.apply(this, arguments);
|
|
6971
|
+
};
|
|
6972
|
+
}();
|
|
6973
|
+
return jsxs(Box, {
|
|
6974
|
+
sx: (_sx = {
|
|
6975
|
+
display: 'flex',
|
|
6976
|
+
flexDirection: 'column',
|
|
6977
|
+
gap: 1,
|
|
6978
|
+
height: '100%',
|
|
6979
|
+
containerName: 'maritime',
|
|
6980
|
+
containerType: 'inline-size',
|
|
6981
|
+
padding: 2,
|
|
6982
|
+
// in a dialog there is an additional empty footer that messes up styling. This hack fixes that.
|
|
6983
|
+
'[role="dialog"] &': {
|
|
6984
|
+
paddingBottom: 0
|
|
6985
|
+
}
|
|
6986
|
+
}, _sx["@container maritime (min-width: " + breakpoints.tablet + "px)"] = {
|
|
6987
|
+
padding: 3
|
|
6988
|
+
}, _sx),
|
|
6989
|
+
children: [jsxs(Box, {
|
|
6990
|
+
sx: (_sx2 = {
|
|
6991
|
+
display: 'flex',
|
|
6992
|
+
gap: 1,
|
|
6993
|
+
alignItems: 'center'
|
|
6994
|
+
}, _sx2["@container maritime (min-width: " + breakpoints.tablet + "px)"] = {
|
|
6995
|
+
justifyContent: 'flex-end'
|
|
6996
|
+
}, _sx2),
|
|
6997
|
+
children: [jsx(SwitchButton, {
|
|
6998
|
+
inActiveLabel: t('warning-editor-user-viewer'),
|
|
6999
|
+
activeLabel: t('warning-editor-user-editor'),
|
|
7000
|
+
checked: !isReadOnly,
|
|
7001
|
+
onChange: onSwitchMode
|
|
7002
|
+
}), jsx(Box, {
|
|
7003
|
+
sx: {
|
|
7004
|
+
width: '16px',
|
|
7005
|
+
marginLeft: 1
|
|
7006
|
+
},
|
|
7007
|
+
children: editor && jsx(MaritimeWarningAvatar, {
|
|
7008
|
+
editor: editor
|
|
7009
|
+
})
|
|
7010
|
+
})]
|
|
7011
|
+
}), jsx(AreaList, {
|
|
7012
|
+
areas: areas,
|
|
7013
|
+
selected: selectedAreaIds,
|
|
7014
|
+
disabled: disabledAreaIds,
|
|
7015
|
+
isReadOnly: isReadOnly,
|
|
7016
|
+
onToggleSelectArea: onToggleSelectArea,
|
|
7017
|
+
onSelectMultipleAreas: onSelectMultipleAreas
|
|
7018
|
+
}), jsx(WarningList, {
|
|
7019
|
+
warnings: warnings,
|
|
7020
|
+
areas: areas,
|
|
7021
|
+
selectedAreaIds: selectedAreaIds,
|
|
7022
|
+
onAddSelectedAreas: onAddSelectedAreas,
|
|
7023
|
+
onRemoveWarning: onRemoveWarningWithConfirmation,
|
|
7024
|
+
onChangeWarning: onChangeWarning,
|
|
7025
|
+
onToggleSelectArea: onToggleSelectArea,
|
|
7026
|
+
onSelectMultipleAreas: onSelectMultipleAreas,
|
|
7027
|
+
onRemoveArea: onRemoveArea,
|
|
7028
|
+
onMoveWarning: onMoveWarning,
|
|
7029
|
+
shouldShowDistricts: shouldShowDistricts,
|
|
7030
|
+
isReadOnly: isReadOnly
|
|
7031
|
+
}), !isReadOnly && jsxs(Button, {
|
|
7032
|
+
onClick: onAddWarning,
|
|
7033
|
+
variant: "tertiary",
|
|
7034
|
+
size: "small",
|
|
7035
|
+
sx: {
|
|
7036
|
+
alignSelf: 'flex-start',
|
|
7037
|
+
paddingInline: 2
|
|
7038
|
+
},
|
|
7039
|
+
children: [jsx(Add, {}), t('maritime-new-warning')]
|
|
7040
|
+
}), !isReadOnly && jsxs(Stack, {
|
|
7041
|
+
spacing: 2,
|
|
7042
|
+
direction: "row",
|
|
7043
|
+
sx: (_sx3 = {}, _sx3["@container maritime (min-width: " + breakpoints.tablet + "px)"] = {
|
|
7044
|
+
position: 'absolute',
|
|
7045
|
+
bottom: 0,
|
|
7046
|
+
right: 0,
|
|
7047
|
+
paddingInline: 2,
|
|
7048
|
+
paddingBottom: 2,
|
|
7049
|
+
// in a dialog there is an additional empty footer that messes up styling. This hack fixes that.
|
|
7050
|
+
'[role="dialog"] &': {
|
|
7051
|
+
paddingBottom: 0
|
|
7052
|
+
}
|
|
7053
|
+
}, _sx3),
|
|
7054
|
+
children: [jsx(Button, {
|
|
7055
|
+
onClick: onClearWithConfirmation,
|
|
7056
|
+
variant: "tertiary",
|
|
7057
|
+
size: "small",
|
|
7058
|
+
sx: {
|
|
7059
|
+
width: '134px'
|
|
7060
|
+
},
|
|
7061
|
+
children: t('warning-button-clear')
|
|
7062
|
+
}), jsx(Button, {
|
|
7063
|
+
variant: "primary",
|
|
7064
|
+
size: "small",
|
|
7065
|
+
sx: (_sx4 = {
|
|
7066
|
+
width: '134px'
|
|
7067
|
+
}, _sx4["@container maritime (min-width: " + breakpoints.tablet + "px)"] = {
|
|
7068
|
+
marginLeft: '24px!important'
|
|
7069
|
+
}, _sx4),
|
|
7070
|
+
disabled: !modified || !isValid,
|
|
7071
|
+
onClick: onSubmit,
|
|
7072
|
+
children: t('warning-button-publish')
|
|
7073
|
+
})]
|
|
7074
|
+
})]
|
|
7075
|
+
});
|
|
7076
|
+
};
|
|
7077
|
+
|
|
6590
7078
|
var areasByDomain = {
|
|
6591
7079
|
northSeaDistricts: [{
|
|
6592
|
-
id: 'DOGGER',
|
|
6593
|
-
label: 'Dogger'
|
|
6594
|
-
}, {
|
|
6595
7080
|
id: 'DOVER',
|
|
6596
7081
|
label: 'Dover'
|
|
7082
|
+
}, {
|
|
7083
|
+
id: 'THAMES',
|
|
7084
|
+
label: 'Thames'
|
|
6597
7085
|
}, {
|
|
6598
7086
|
id: 'HUMBER',
|
|
6599
7087
|
label: 'Humber'
|
|
6600
7088
|
}, {
|
|
6601
|
-
id: '
|
|
6602
|
-
label: '
|
|
7089
|
+
id: 'DOGGER',
|
|
7090
|
+
label: 'Dogger'
|
|
7091
|
+
}, {
|
|
7092
|
+
id: 'GERMAN_BIGHT',
|
|
7093
|
+
label: 'German Bight'
|
|
6603
7094
|
}],
|
|
6604
7095
|
coastalWaters: [{
|
|
6605
7096
|
id: 'VLISSINGEN',
|
|
@@ -6612,37 +7103,75 @@ var areasByDomain = {
|
|
|
6612
7103
|
label: 'Hoek van Holland'
|
|
6613
7104
|
}, {
|
|
6614
7105
|
id: 'IJMUIDEN',
|
|
6615
|
-
label: '
|
|
7106
|
+
label: 'IJmuiden'
|
|
6616
7107
|
}, {
|
|
6617
7108
|
id: 'TEXEL',
|
|
6618
7109
|
label: 'Texel'
|
|
7110
|
+
}, {
|
|
7111
|
+
id: 'HARLINGEN',
|
|
7112
|
+
label: 'Harlingen'
|
|
7113
|
+
}, {
|
|
7114
|
+
id: 'ROTTUM',
|
|
7115
|
+
label: 'Rottum'
|
|
7116
|
+
}, {
|
|
7117
|
+
id: 'DELFZIJL',
|
|
7118
|
+
label: 'Delfzijl'
|
|
7119
|
+
}, {
|
|
7120
|
+
id: 'IJSSELMEER',
|
|
7121
|
+
label: 'IJsselmeer'
|
|
7122
|
+
}, {
|
|
7123
|
+
id: 'MARKERMEER',
|
|
7124
|
+
label: 'Markermeer'
|
|
6619
7125
|
}]
|
|
6620
7126
|
};
|
|
6621
7127
|
|
|
6622
7128
|
var MaritimeWarningsFormConnect = function MaritimeWarningsFormConnect(_ref) {
|
|
6623
|
-
var domain = _ref.domain
|
|
7129
|
+
var domain = _ref.domain,
|
|
7130
|
+
onPreventCloseView = _ref.onPreventCloseView,
|
|
7131
|
+
onModifyForm = _ref.onModifyForm;
|
|
6624
7132
|
var areas = areasByDomain[domain];
|
|
6625
7133
|
var shouldShowDistricts = domain === 'northSeaDistricts';
|
|
7134
|
+
var _useWarningsTranslati = useWarningsTranslation(),
|
|
7135
|
+
t = _useWarningsTranslati.t;
|
|
7136
|
+
var _useAuthenticationCon = useAuthenticationContext$1(),
|
|
7137
|
+
auth = _useAuthenticationCon.auth;
|
|
7138
|
+
var maritimeWarningsType = getType(domain);
|
|
7139
|
+
// TODO this should be retrieved (and updated) from the api using a react-query
|
|
7140
|
+
var _React$useState = React__default.useState(auth == null ? void 0 : auth.username),
|
|
7141
|
+
editor = _React$useState[0],
|
|
7142
|
+
setEditor = _React$useState[1];
|
|
7143
|
+
var isReadOnly = editor !== undefined && editor !== (auth == null ? void 0 : auth.username);
|
|
6626
7144
|
var _useMaritimeWarningsF = useMaritimeWarningsFormState(),
|
|
6627
7145
|
state = _useMaritimeWarningsF[0],
|
|
6628
7146
|
dispatch = _useMaritimeWarningsF[1];
|
|
7147
|
+
var _usePublicWarnings = usePublicWarnings(),
|
|
7148
|
+
data = _usePublicWarnings.data;
|
|
7149
|
+
var warningsFromApi = React__default.useMemo(function () {
|
|
7150
|
+
return (data == null ? void 0 : data.filter(function (warning) {
|
|
7151
|
+
return warning.warningDetail.domain === maritimeWarningsType && warning.status === 'PUBLISHED';
|
|
7152
|
+
})) || [];
|
|
7153
|
+
}, [data, maritimeWarningsType]);
|
|
7154
|
+
var warningItemsFromApi = React__default.useMemo(function () {
|
|
7155
|
+
return mapMaritimeWarningsToItems(warningsFromApi || []);
|
|
7156
|
+
}, [warningsFromApi]);
|
|
6629
7157
|
React__default.useEffect(function () {
|
|
6630
|
-
// FIXME: replace this by warnings from api
|
|
6631
7158
|
dispatch({
|
|
6632
7159
|
type: 'initialize',
|
|
6633
|
-
warnings:
|
|
6634
|
-
length: 1
|
|
6635
|
-
}).map(function (_, index) {
|
|
6636
|
-
return {
|
|
6637
|
-
assignedAreaIds: [],
|
|
6638
|
-
id: (index + 1).toString(),
|
|
6639
|
-
windDirectionFrom: '',
|
|
6640
|
-
windDirectionTo: '',
|
|
6641
|
-
changeType: 'NO_CHANGE'
|
|
6642
|
-
};
|
|
6643
|
-
})
|
|
7160
|
+
warnings: warningItemsFromApi
|
|
6644
7161
|
});
|
|
6645
|
-
}, [dispatch]);
|
|
7162
|
+
}, [dispatch, warningItemsFromApi]);
|
|
7163
|
+
React__default.useEffect(function () {
|
|
7164
|
+
onPreventCloseView == null || onPreventCloseView(state.modified);
|
|
7165
|
+
if (onModifyForm) {
|
|
7166
|
+
onModifyForm(state.modified);
|
|
7167
|
+
}
|
|
7168
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
7169
|
+
}, [state.modified]);
|
|
7170
|
+
usePreventBrowserClose(state.modified);
|
|
7171
|
+
var dispatchRedux = useDispatch();
|
|
7172
|
+
var showSnackbar = React__default.useCallback(function (message) {
|
|
7173
|
+
dispatchRedux(snackbarActions.openSnackbar(message));
|
|
7174
|
+
}, [dispatchRedux]);
|
|
6646
7175
|
var onToggleSelectArea = React__default.useCallback(function (id) {
|
|
6647
7176
|
React__default.startTransition(function () {
|
|
6648
7177
|
dispatch({
|
|
@@ -6651,6 +7180,14 @@ var MaritimeWarningsFormConnect = function MaritimeWarningsFormConnect(_ref) {
|
|
|
6651
7180
|
});
|
|
6652
7181
|
});
|
|
6653
7182
|
}, [dispatch]);
|
|
7183
|
+
var onSelectMultipleAreas = React__default.useCallback(function (ids) {
|
|
7184
|
+
React__default.startTransition(function () {
|
|
7185
|
+
dispatch({
|
|
7186
|
+
type: 'selectMultipleAreas',
|
|
7187
|
+
ids: ids
|
|
7188
|
+
});
|
|
7189
|
+
});
|
|
7190
|
+
}, [dispatch]);
|
|
6654
7191
|
var onAddSelectedAreas = React__default.useCallback(function (id) {
|
|
6655
7192
|
React__default.startTransition(function () {
|
|
6656
7193
|
dispatch({
|
|
@@ -6666,7 +7203,11 @@ var MaritimeWarningsFormConnect = function MaritimeWarningsFormConnect(_ref) {
|
|
|
6666
7203
|
id: id
|
|
6667
7204
|
});
|
|
6668
7205
|
});
|
|
6669
|
-
|
|
7206
|
+
showSnackbar({
|
|
7207
|
+
type: snackbarTypes.SnackbarMessageType.TRANSLATABLE_MESSAGE,
|
|
7208
|
+
key: 'maritime-retract-success'
|
|
7209
|
+
});
|
|
7210
|
+
}, [dispatch, showSnackbar]);
|
|
6670
7211
|
var onAddWarning = React__default.useCallback(function () {
|
|
6671
7212
|
React__default.startTransition(function () {
|
|
6672
7213
|
dispatch({
|
|
@@ -6697,7 +7238,11 @@ var MaritimeWarningsFormConnect = function MaritimeWarningsFormConnect(_ref) {
|
|
|
6697
7238
|
type: 'clearWarnings'
|
|
6698
7239
|
});
|
|
6699
7240
|
});
|
|
6700
|
-
|
|
7241
|
+
showSnackbar({
|
|
7242
|
+
type: snackbarTypes.SnackbarMessageType.TRANSLATABLE_MESSAGE,
|
|
7243
|
+
key: 'maritime-clear-success'
|
|
7244
|
+
});
|
|
7245
|
+
}, [dispatch, showSnackbar]);
|
|
6701
7246
|
var onMoveWarning = React__default.useCallback(function (oldIndex, newIndex) {
|
|
6702
7247
|
dispatch({
|
|
6703
7248
|
type: 'moveWarning',
|
|
@@ -6705,26 +7250,57 @@ var MaritimeWarningsFormConnect = function MaritimeWarningsFormConnect(_ref) {
|
|
|
6705
7250
|
newIndex: newIndex
|
|
6706
7251
|
});
|
|
6707
7252
|
}, [dispatch]);
|
|
7253
|
+
var _usePostMaritimeWarni = usePostMaritimeWarning(),
|
|
7254
|
+
postWarning = _usePostMaritimeWarni.mutate;
|
|
6708
7255
|
var onSubmit = React__default.useCallback(function () {
|
|
6709
|
-
|
|
6710
|
-
|
|
6711
|
-
|
|
6712
|
-
|
|
7256
|
+
dispatch({
|
|
7257
|
+
type: 'mergeWarnings'
|
|
7258
|
+
});
|
|
7259
|
+
var nextState = reducer(state, {
|
|
7260
|
+
type: 'mergeWarnings'
|
|
7261
|
+
});
|
|
7262
|
+
var maritimeWarnings = mapItemsToMaritimeWarnings(nextState.warnings, domain, auth == null ? void 0 : auth.username);
|
|
7263
|
+
maritimeWarnings.forEach(function (warning) {
|
|
7264
|
+
postWarning(warning);
|
|
7265
|
+
});
|
|
7266
|
+
}, [dispatch, state, domain, auth == null ? void 0 : auth.username, postWarning]);
|
|
7267
|
+
var onToggleReadOnly = React__default.useCallback(function (isReadOnly) {
|
|
7268
|
+
// FIXME: do a api call here
|
|
7269
|
+
if (isReadOnly) {
|
|
7270
|
+
setEditor('');
|
|
7271
|
+
} else {
|
|
7272
|
+
setEditor(auth == null ? void 0 : auth.username);
|
|
7273
|
+
}
|
|
7274
|
+
// FIXME: reset warnings to latest known api state
|
|
7275
|
+
var domainLabel = domain === 'coastalWaters' ? t('maritime-domain-coastal') : t('maritime-domain-northsea');
|
|
7276
|
+
showSnackbar({
|
|
7277
|
+
type: snackbarTypes.SnackbarMessageType.VERBATIM_MESSAGE,
|
|
7278
|
+
message: isReadOnly ? t('maritime-editor-off', {
|
|
7279
|
+
domain: domainLabel
|
|
7280
|
+
}) : t('maritime-editor-on', {
|
|
7281
|
+
domain: domainLabel
|
|
7282
|
+
})
|
|
7283
|
+
});
|
|
7284
|
+
}, [showSnackbar, t, domain, auth]);
|
|
6713
7285
|
return jsx(MaritimeWarningsForm, {
|
|
6714
7286
|
areas: areas,
|
|
6715
7287
|
selectedAreaIds: state.selectedAreaIds,
|
|
6716
7288
|
warnings: state.warnings,
|
|
6717
7289
|
modified: state.modified,
|
|
7290
|
+
isReadOnly: isReadOnly,
|
|
7291
|
+
shouldShowDistricts: shouldShowDistricts,
|
|
7292
|
+
editor: editor,
|
|
6718
7293
|
onToggleSelectArea: onToggleSelectArea,
|
|
7294
|
+
onSelectMultipleAreas: onSelectMultipleAreas,
|
|
6719
7295
|
onAddSelectedAreas: onAddSelectedAreas,
|
|
6720
7296
|
onRemoveWarning: onRemoveWarning,
|
|
6721
7297
|
onRemoveArea: onRemoveArea,
|
|
6722
7298
|
onAddWarning: onAddWarning,
|
|
6723
7299
|
onChangeWarning: onChangeWarning,
|
|
6724
7300
|
onMoveWarning: onMoveWarning,
|
|
7301
|
+
onToggleReadOnly: onToggleReadOnly,
|
|
6725
7302
|
onClear: onClear,
|
|
6726
|
-
onSubmit: onSubmit
|
|
6727
|
-
shouldShowDistricts: shouldShowDistricts
|
|
7303
|
+
onSubmit: onSubmit
|
|
6728
7304
|
});
|
|
6729
7305
|
};
|
|
6730
7306
|
|
|
@@ -6924,7 +7500,7 @@ var Form = function Form(_ref5) {
|
|
|
6924
7500
|
var _publicWarningDetails, _publicWarningDetails2;
|
|
6925
7501
|
var defaultMapPreset = _ref5.defaultMapPreset,
|
|
6926
7502
|
_ref5$onSaveForm = _ref5.onSaveForm,
|
|
6927
|
-
onSaveForm = _ref5$onSaveForm === void 0 ? /*#__PURE__*/_asyncToGenerator(
|
|
7503
|
+
onSaveForm = _ref5$onSaveForm === void 0 ? /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
6928
7504
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
6929
7505
|
while (1) switch (_context.prev = _context.next) {
|
|
6930
7506
|
case 0:
|
|
@@ -6936,7 +7512,7 @@ var Form = function Form(_ref5) {
|
|
|
6936
7512
|
}, _callee);
|
|
6937
7513
|
})) : _ref5$onSaveForm,
|
|
6938
7514
|
_ref5$onPublishForm = _ref5.onPublishForm,
|
|
6939
|
-
onPublishForm = _ref5$onPublishForm === void 0 ? /*#__PURE__*/_asyncToGenerator(
|
|
7515
|
+
onPublishForm = _ref5$onPublishForm === void 0 ? /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
6940
7516
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
6941
7517
|
while (1) switch (_context2.prev = _context2.next) {
|
|
6942
7518
|
case 0:
|
|
@@ -6952,7 +7528,7 @@ var Form = function Form(_ref5) {
|
|
|
6952
7528
|
_ref5$onCloseForm = _ref5.onCloseForm,
|
|
6953
7529
|
onCloseForm = _ref5$onCloseForm === void 0 ? function () {} : _ref5$onCloseForm,
|
|
6954
7530
|
_ref5$onSaveAviationF = _ref5.onSaveAviationForm,
|
|
6955
|
-
onSaveAviationForm = _ref5$onSaveAviationF === void 0 ? /*#__PURE__*/_asyncToGenerator(
|
|
7531
|
+
onSaveAviationForm = _ref5$onSaveAviationF === void 0 ? /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
6956
7532
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
6957
7533
|
while (1) switch (_context3.prev = _context3.next) {
|
|
6958
7534
|
case 0:
|
|
@@ -7039,8 +7615,8 @@ var Form = function Form(_ref5) {
|
|
|
7039
7615
|
var onPressPublish = function onPressPublish() {
|
|
7040
7616
|
if (!isPublishing) {
|
|
7041
7617
|
toggleIsDraft(false);
|
|
7042
|
-
void handleSubmit(
|
|
7043
|
-
var _ref9 = _asyncToGenerator(
|
|
7618
|
+
void handleSubmit(/*#__PURE__*/function () {
|
|
7619
|
+
var _ref9 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(data) {
|
|
7044
7620
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
7045
7621
|
while (1) switch (_context4.prev = _context4.next) {
|
|
7046
7622
|
case 0:
|
|
@@ -7064,8 +7640,8 @@ var Form = function Form(_ref5) {
|
|
|
7064
7640
|
var onPressSave = function onPressSave() {
|
|
7065
7641
|
if (!isSaving) {
|
|
7066
7642
|
toggleIsDraft(true);
|
|
7067
|
-
void handleSubmit(
|
|
7068
|
-
var
|
|
7643
|
+
void handleSubmit(/*#__PURE__*/function () {
|
|
7644
|
+
var _ref0 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(data) {
|
|
7069
7645
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
7070
7646
|
while (1) switch (_context5.prev = _context5.next) {
|
|
7071
7647
|
case 0:
|
|
@@ -7081,7 +7657,7 @@ var Form = function Form(_ref5) {
|
|
|
7081
7657
|
}, _callee5);
|
|
7082
7658
|
}));
|
|
7083
7659
|
return function (_x2) {
|
|
7084
|
-
return
|
|
7660
|
+
return _ref0.apply(this, arguments);
|
|
7085
7661
|
};
|
|
7086
7662
|
}())();
|
|
7087
7663
|
}
|
|
@@ -7121,29 +7697,29 @@ var Form = function Form(_ref5) {
|
|
|
7121
7697
|
return t('warning-button-publish');
|
|
7122
7698
|
};
|
|
7123
7699
|
var handleSubmitAviationProduct = /*#__PURE__*/function () {
|
|
7124
|
-
var
|
|
7700
|
+
var _ref1 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee0(action, warningType) {
|
|
7125
7701
|
var formValues;
|
|
7126
|
-
return _regeneratorRuntime().wrap(function
|
|
7127
|
-
while (1) switch (
|
|
7702
|
+
return _regeneratorRuntime().wrap(function _callee0$(_context0) {
|
|
7703
|
+
while (1) switch (_context0.prev = _context0.next) {
|
|
7128
7704
|
case 0:
|
|
7129
7705
|
if (!isSaving) {
|
|
7130
|
-
|
|
7706
|
+
_context0.next = 2;
|
|
7131
7707
|
break;
|
|
7132
7708
|
}
|
|
7133
|
-
return
|
|
7709
|
+
return _context0.abrupt("return");
|
|
7134
7710
|
case 2:
|
|
7135
|
-
|
|
7136
|
-
|
|
7711
|
+
_context0.t0 = action;
|
|
7712
|
+
_context0.next = _context0.t0 === ProductAction.SAVE ? 5 : _context0.t0 === ProductAction.PUBLISH ? 14 : _context0.t0 === ProductAction.CANCEL ? 17 : _context0.t0 === ProductAction.AMEND ? 19 : _context0.t0 === ProductAction.RENEW ? 21 : _context0.t0 === ProductAction.DISCARD ? 21 : _context0.t0 === ProductAction.DUPLICATE ? 21 : _context0.t0 === ProductAction.CLOSE ? 21 : 22;
|
|
7137
7713
|
break;
|
|
7138
7714
|
case 5:
|
|
7139
7715
|
toggleIsDraft(true);
|
|
7140
|
-
|
|
7716
|
+
_context0.next = 8;
|
|
7141
7717
|
return trigger();
|
|
7142
7718
|
case 8:
|
|
7143
7719
|
// Run validation and show messages
|
|
7144
7720
|
formValues = getValues();
|
|
7145
7721
|
setIsSaving(true);
|
|
7146
|
-
|
|
7722
|
+
_context0.next = 12;
|
|
7147
7723
|
return onSaveAviationForm(formValues, 'DRAFT', warningType, undefined, function (uuid) {
|
|
7148
7724
|
setValue('uuid', uuid, {
|
|
7149
7725
|
shouldValidate: true,
|
|
@@ -7152,16 +7728,16 @@ var Form = function Form(_ref5) {
|
|
|
7152
7728
|
})["catch"](function () {});
|
|
7153
7729
|
case 12:
|
|
7154
7730
|
setIsSaving(false);
|
|
7155
|
-
return
|
|
7731
|
+
return _context0.abrupt("break", 23);
|
|
7156
7732
|
case 14:
|
|
7157
7733
|
toggleIsDraft(false);
|
|
7158
|
-
void handleSubmit(
|
|
7159
|
-
var
|
|
7734
|
+
void handleSubmit(/*#__PURE__*/function () {
|
|
7735
|
+
var _ref10 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(formValues) {
|
|
7160
7736
|
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
7161
7737
|
while (1) switch (_context7.prev = _context7.next) {
|
|
7162
7738
|
case 0:
|
|
7163
7739
|
_context7.next = 2;
|
|
7164
|
-
return showConfirmDialog(action).then(
|
|
7740
|
+
return showConfirmDialog(action).then(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
7165
7741
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
7166
7742
|
while (1) switch (_context6.prev = _context6.next) {
|
|
7167
7743
|
case 0:
|
|
@@ -7184,10 +7760,10 @@ var Form = function Form(_ref5) {
|
|
|
7184
7760
|
}, _callee7);
|
|
7185
7761
|
}));
|
|
7186
7762
|
return function (_x5) {
|
|
7187
|
-
return
|
|
7763
|
+
return _ref10.apply(this, arguments);
|
|
7188
7764
|
};
|
|
7189
7765
|
}())();
|
|
7190
|
-
return
|
|
7766
|
+
return _context0.abrupt("break", 23);
|
|
7191
7767
|
case 17:
|
|
7192
7768
|
void showConfirmDialog(action).then(function () {
|
|
7193
7769
|
setIsCancelling(true);
|
|
@@ -7196,15 +7772,15 @@ var Form = function Form(_ref5) {
|
|
|
7196
7772
|
onCloseForm();
|
|
7197
7773
|
});
|
|
7198
7774
|
});
|
|
7199
|
-
return
|
|
7775
|
+
return _context0.abrupt("break", 23);
|
|
7200
7776
|
case 19:
|
|
7201
|
-
void handleSubmit(
|
|
7202
|
-
var
|
|
7777
|
+
void handleSubmit(/*#__PURE__*/function () {
|
|
7778
|
+
var _ref12 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(formValues) {
|
|
7203
7779
|
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
7204
7780
|
while (1) switch (_context9.prev = _context9.next) {
|
|
7205
7781
|
case 0:
|
|
7206
7782
|
_context9.next = 2;
|
|
7207
|
-
return showConfirmDialog(action).then(
|
|
7783
|
+
return showConfirmDialog(action).then(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
7208
7784
|
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
7209
7785
|
while (1) switch (_context8.prev = _context8.next) {
|
|
7210
7786
|
case 0:
|
|
@@ -7228,22 +7804,22 @@ var Form = function Form(_ref5) {
|
|
|
7228
7804
|
}, _callee9);
|
|
7229
7805
|
}));
|
|
7230
7806
|
return function (_x6) {
|
|
7231
|
-
return
|
|
7807
|
+
return _ref12.apply(this, arguments);
|
|
7232
7808
|
};
|
|
7233
7809
|
}())();
|
|
7234
|
-
return
|
|
7810
|
+
return _context0.abrupt("break", 23);
|
|
7235
7811
|
case 21:
|
|
7236
|
-
return
|
|
7812
|
+
return _context0.abrupt("break", 23);
|
|
7237
7813
|
case 22:
|
|
7238
7814
|
console.warn("Unhandled product action: " + action);
|
|
7239
7815
|
case 23:
|
|
7240
7816
|
case "end":
|
|
7241
|
-
return
|
|
7817
|
+
return _context0.stop();
|
|
7242
7818
|
}
|
|
7243
|
-
},
|
|
7819
|
+
}, _callee0);
|
|
7244
7820
|
}));
|
|
7245
7821
|
return function handleSubmitAviationProduct(_x3, _x4) {
|
|
7246
|
-
return
|
|
7822
|
+
return _ref1.apply(this, arguments);
|
|
7247
7823
|
};
|
|
7248
7824
|
}();
|
|
7249
7825
|
var onPressClear = function onPressClear() {
|
|
@@ -7381,12 +7957,14 @@ var Form = function Form(_ref5) {
|
|
|
7381
7957
|
}
|
|
7382
7958
|
if (warningType === 'maritimeWarningCoastal') {
|
|
7383
7959
|
return jsx(MaritimeWarningsFormConnect, {
|
|
7384
|
-
domain: "coastalWaters"
|
|
7960
|
+
domain: "coastalWaters",
|
|
7961
|
+
onModifyForm: onFormDirty
|
|
7385
7962
|
});
|
|
7386
7963
|
}
|
|
7387
7964
|
if (warningType === 'maritimeWarningNorthSea') {
|
|
7388
7965
|
return jsx(MaritimeWarningsFormConnect, {
|
|
7389
|
-
domain: "northSeaDistricts"
|
|
7966
|
+
domain: "northSeaDistricts",
|
|
7967
|
+
onModifyForm: onFormDirty
|
|
7390
7968
|
});
|
|
7391
7969
|
}
|
|
7392
7970
|
// Public warnings form
|
|
@@ -7488,12 +8066,14 @@ var Form = function Form(_ref5) {
|
|
|
7488
8066
|
})
|
|
7489
8067
|
});
|
|
7490
8068
|
};
|
|
8069
|
+
if (isMaritimeWarning) {
|
|
8070
|
+
return getFormContent();
|
|
8071
|
+
}
|
|
7491
8072
|
return jsxs(ContainerWrapper, {
|
|
7492
8073
|
children: [jsxs(ContainerFormWrapper, {
|
|
7493
8074
|
isReadOnly: isReadOnly,
|
|
7494
8075
|
ref: ref,
|
|
7495
8076
|
"data-testid": "scroll-container",
|
|
7496
|
-
addPadding: !isMaritimeWarning,
|
|
7497
8077
|
children: [errors && jsx(Box, {
|
|
7498
8078
|
sx: {
|
|
7499
8079
|
marginBottom: 2
|
|
@@ -7507,7 +8087,7 @@ var Form = function Form(_ref5) {
|
|
|
7507
8087
|
}), getFormContent(), jsx(DraftFieldHelper, {}), jsx(ReactHookFormHiddenInput, {
|
|
7508
8088
|
name: "id"
|
|
7509
8089
|
})]
|
|
7510
|
-
}),
|
|
8090
|
+
}), formState !== 'cancel' && !isReadOnly && jsx(Box, {
|
|
7511
8091
|
sx: {
|
|
7512
8092
|
padding: '24px 10px 14px 10px',
|
|
7513
8093
|
position: 'absolute',
|
|
@@ -7592,7 +8172,7 @@ var Form = function Form(_ref5) {
|
|
|
7592
8172
|
})]
|
|
7593
8173
|
})
|
|
7594
8174
|
})
|
|
7595
|
-
}),
|
|
8175
|
+
}), formState === 'cancel' && jsx(Box, {
|
|
7596
8176
|
sx: {
|
|
7597
8177
|
padding: '24px 10px 14px 10px',
|
|
7598
8178
|
position: 'absolute',
|
|
@@ -7744,7 +8324,7 @@ var PublicWarningsFormConnect = function PublicWarningsFormConnect(_ref) {
|
|
|
7744
8324
|
var isEditor = editor === (auth == null ? void 0 : auth.username) || false;
|
|
7745
8325
|
var dispatch = useDispatch();
|
|
7746
8326
|
var publishForm = /*#__PURE__*/function () {
|
|
7747
|
-
var _ref2 = _asyncToGenerator(
|
|
8327
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(newFormValues) {
|
|
7748
8328
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
7749
8329
|
while (1) switch (_context.prev = _context.next) {
|
|
7750
8330
|
case 0:
|
|
@@ -7789,7 +8369,7 @@ var PublicWarningsFormConnect = function PublicWarningsFormConnect(_ref) {
|
|
|
7789
8369
|
return selectedProduct.airmet;
|
|
7790
8370
|
};
|
|
7791
8371
|
var saveAviationForm = /*#__PURE__*/function () {
|
|
7792
|
-
var _ref3 = _asyncToGenerator(
|
|
8372
|
+
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(productToPost, newStatus, warningType, vaSigmetMoveToFIR, setSelectedUUID) {
|
|
7793
8373
|
var _result;
|
|
7794
8374
|
var product, uuid, result, postProductParam, _postProductParam;
|
|
7795
8375
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
@@ -7831,7 +8411,7 @@ var PublicWarningsFormConnect = function PublicWarningsFormConnect(_ref) {
|
|
|
7831
8411
|
};
|
|
7832
8412
|
}();
|
|
7833
8413
|
var saveForm = /*#__PURE__*/function () {
|
|
7834
|
-
var _ref4 = _asyncToGenerator(
|
|
8414
|
+
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(newFormValues) {
|
|
7835
8415
|
var status;
|
|
7836
8416
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
7837
8417
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -8700,8 +9280,8 @@ var PublicWarningsFormDialogConnect = function PublicWarningsFormDialogConnect(_
|
|
|
8700
9280
|
var selectedWarningId = useSelector(getSelectedWarningId);
|
|
8701
9281
|
var selectedWarningObject = useSelector(getPublicWarning);
|
|
8702
9282
|
var warningType = useSelector(getWarningType);
|
|
8703
|
-
var selectedWarning = combinedWarnings == null ? void 0 : combinedWarnings.find(function (
|
|
8704
|
-
return
|
|
9283
|
+
var selectedWarning = combinedWarnings == null ? void 0 : combinedWarnings.find(function (warning) {
|
|
9284
|
+
return warning.id === selectedWarningId;
|
|
8705
9285
|
});
|
|
8706
9286
|
var _useAuthenticationCon = useAuthenticationContext$1(),
|
|
8707
9287
|
auth = _useAuthenticationCon.auth;
|
|
@@ -8752,7 +9332,7 @@ var PublicWarningsFormDialogConnect = function PublicWarningsFormDialogConnect(_
|
|
|
8752
9332
|
}, [selectedWarning == null ? void 0 : selectedWarning.editor]);
|
|
8753
9333
|
var updatePublicWarningEditor = useMutatePublicWarningEditor();
|
|
8754
9334
|
var setIsEditor = /*#__PURE__*/function () {
|
|
8755
|
-
var _ref3 = _asyncToGenerator(
|
|
9335
|
+
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(isReadOnly) {
|
|
8756
9336
|
var username, updateEditor;
|
|
8757
9337
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
8758
9338
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -8779,7 +9359,7 @@ var PublicWarningsFormDialogConnect = function PublicWarningsFormDialogConnect(_
|
|
|
8779
9359
|
}
|
|
8780
9360
|
},
|
|
8781
9361
|
onSuccess: function () {
|
|
8782
|
-
var _onSuccess = _asyncToGenerator(
|
|
9362
|
+
var _onSuccess = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
8783
9363
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
8784
9364
|
while (1) switch (_context.prev = _context.next) {
|
|
8785
9365
|
case 0:
|
|
@@ -8835,7 +9415,7 @@ var PublicWarningsFormDialogConnect = function PublicWarningsFormDialogConnect(_
|
|
|
8835
9415
|
description: t('warning-view-mode-description'),
|
|
8836
9416
|
confirmLabel: t('warning-view-mode-confirm'),
|
|
8837
9417
|
cancelLabel: t('warning-dialog-cancel')
|
|
8838
|
-
}).then(
|
|
9418
|
+
}).then(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
8839
9419
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
8840
9420
|
while (1) switch (_context3.prev = _context3.next) {
|
|
8841
9421
|
case 0:
|
|
@@ -8852,7 +9432,7 @@ var PublicWarningsFormDialogConnect = function PublicWarningsFormDialogConnect(_
|
|
|
8852
9432
|
}
|
|
8853
9433
|
};
|
|
8854
9434
|
var closeDialog = /*#__PURE__*/function () {
|
|
8855
|
-
var _ref5 = _asyncToGenerator(
|
|
9435
|
+
var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
8856
9436
|
var mayProceed;
|
|
8857
9437
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
8858
9438
|
while (1) switch (_context4.prev = _context4.next) {
|
|
@@ -9298,6 +9878,9 @@ var WarningListItemMenu = function WarningListItemMenu(_ref) {
|
|
|
9298
9878
|
_ref$onActionAviation = _ref.onActionAviationWarning,
|
|
9299
9879
|
onActionAviationWarning = _ref$onActionAviation === void 0 ? function () {} : _ref$onActionAviation,
|
|
9300
9880
|
t = _ref.t;
|
|
9881
|
+
if (warning.warningDetail.domain === 'maritimeWarningCoastal' || warning.warningDetail.domain === 'maritimeWarningNorthSea') {
|
|
9882
|
+
return [];
|
|
9883
|
+
}
|
|
9301
9884
|
var duplicate = {
|
|
9302
9885
|
text: t('warning-list-button-duplicate'),
|
|
9303
9886
|
action: function action() {
|
|
@@ -9381,7 +9964,7 @@ var WarningListItemMenu = function WarningListItemMenu(_ref) {
|
|
|
9381
9964
|
case ProductStatus.DRAFT:
|
|
9382
9965
|
return [aviationDuplicate, aviationDelete];
|
|
9383
9966
|
case ProductStatus.PUBLISHED:
|
|
9384
|
-
if (warning.type
|
|
9967
|
+
if ((warning.type === 'airmet' || warning.type === 'sigmet') && (isInstanceOfCancelSigmet(warning.sigmetAirmetDetails) || isInstanceOfCancelAirmet(warning.sigmetAirmetDetails))) {
|
|
9385
9968
|
return [];
|
|
9386
9969
|
}
|
|
9387
9970
|
return [{
|
|
@@ -9411,7 +9994,7 @@ var WarningListItemMenu = function WarningListItemMenu(_ref) {
|
|
|
9411
9994
|
case ProductStatus.CANCELLED:
|
|
9412
9995
|
return [];
|
|
9413
9996
|
case ProductStatus.EXPIRED:
|
|
9414
|
-
if (warning.type
|
|
9997
|
+
if ((warning.type === 'airmet' || warning.type === 'sigmet') && (isInstanceOfCancelSigmet(warning.sigmetAirmetDetails) || isInstanceOfCancelAirmet(warning.sigmetAirmetDetails))) {
|
|
9415
9998
|
return [];
|
|
9416
9999
|
}
|
|
9417
10000
|
return [{
|
|
@@ -9466,10 +10049,10 @@ var renderStatusIcon = function renderStatusIcon(warning, status) {
|
|
|
9466
10049
|
icon: icon
|
|
9467
10050
|
});
|
|
9468
10051
|
};
|
|
9469
|
-
if (warning.productStatus === ProductStatus.PUBLISHED && warning.type
|
|
10052
|
+
if (warning.productStatus === ProductStatus.PUBLISHED && (warning.type === 'airmet' || warning.type === 'sigmet') && (isCancelAirmet(warning.sigmetAirmetDetails) || isCancelSigmet(warning.sigmetAirmetDetails))) {
|
|
9470
10053
|
return getStatusTag("Cnls " + (isCancelAirmet(warning.sigmetAirmetDetails) ? warning.sigmetAirmetDetails.cancelsAirmetSequenceId : warning.sigmetAirmetDetails.cancelsSigmetSequenceId), 'red');
|
|
9471
10054
|
}
|
|
9472
|
-
if (warning.productStatus === ProductStatus.CANCELLED && warning.type
|
|
10055
|
+
if (warning.productStatus === ProductStatus.CANCELLED && (warning.type === 'airmet' || warning.type === 'sigmet')) {
|
|
9473
10056
|
return getStatusTag('Cnld', 'red');
|
|
9474
10057
|
}
|
|
9475
10058
|
switch (status) {
|
|
@@ -9531,7 +10114,7 @@ var WarningListItem = function WarningListItem(_ref) {
|
|
|
9531
10114
|
t = _useWarningsTranslati.t;
|
|
9532
10115
|
var phenomenonDetails = allPhenomenaDict[warning.warningDetail.phenomenon];
|
|
9533
10116
|
var objectNameText = ((_warning$warningDetai = warning.warningDetail.areas) == null || (_warning$warningDetai = _warning$warningDetai[0]) == null ? void 0 : _warning$warningDetai.objectName) || '-';
|
|
9534
|
-
var objectHoverText = warning.type
|
|
10117
|
+
var objectHoverText = warning.type === 'airmet' || warning.type === 'sigmet' ? warning.sigmetAirmetDetails.firName : objectNameText;
|
|
9535
10118
|
var _useOverflowCheck = useOverflowCheck(objectNameText),
|
|
9536
10119
|
objectNameRef = _useOverflowCheck.ref;
|
|
9537
10120
|
var phenomenonText = phenomenonDetails != null && phenomenonDetails.translationKey ? t(phenomenonDetails.translationKey) : '-';
|
|
@@ -9888,9 +10471,9 @@ var NewWarningButton = function NewWarningButton(_ref) {
|
|
|
9888
10471
|
var groupWarningsOnStatus = function groupWarningsOnStatus(warnings, sortState) {
|
|
9889
10472
|
var key = sortState.key,
|
|
9890
10473
|
direction = sortState.direction;
|
|
9891
|
-
var sortedWarnings = warnings.sort(function (
|
|
9892
|
-
var dateStringA = key === 'lastUpdatedTime' ?
|
|
9893
|
-
var dateStringB = key === 'lastUpdatedTime' ?
|
|
10474
|
+
var sortedWarnings = warnings.sort(function (warningA, warningB) {
|
|
10475
|
+
var dateStringA = key === 'lastUpdatedTime' ? warningA[key] : warningA.warningDetail[key];
|
|
10476
|
+
var dateStringB = key === 'lastUpdatedTime' ? warningB[key] : warningB.warningDetail[key];
|
|
9894
10477
|
return (dateStringB == null ? void 0 : dateStringB.localeCompare(dateStringA || '')) || 0;
|
|
9895
10478
|
});
|
|
9896
10479
|
if (direction === 'asc') {
|
|
@@ -10468,9 +11051,15 @@ var useWarningFilters = function useWarningFilters(warnings, onUpdateFilters, sa
|
|
|
10468
11051
|
}
|
|
10469
11052
|
};
|
|
10470
11053
|
var byFilterState = useCallback(function (warning) {
|
|
10471
|
-
var levelDomain =
|
|
10472
|
-
|
|
10473
|
-
|
|
11054
|
+
var levelDomain = function () {
|
|
11055
|
+
if (['SIG', 'AIR'].includes(warning.warningDetail.level)) {
|
|
11056
|
+
return Domain.aviation;
|
|
11057
|
+
}
|
|
11058
|
+
if (warning.warningDetail.domain === 'maritimeWarningCoastal' || warning.warningDetail.domain === 'maritimeWarningNorthSea') {
|
|
11059
|
+
return Domain.maritime;
|
|
11060
|
+
}
|
|
11061
|
+
return Domain["public"];
|
|
11062
|
+
}();
|
|
10474
11063
|
if (!savedDomainFilter[levelDomain]) {
|
|
10475
11064
|
return false;
|
|
10476
11065
|
}
|
|
@@ -10529,7 +11118,7 @@ var ConfirmDeleteWarningDialog = function ConfirmDeleteWarningDialog(_ref) {
|
|
|
10529
11118
|
error = _React$useState2[0],
|
|
10530
11119
|
setError = _React$useState2[1];
|
|
10531
11120
|
var onSubmit = /*#__PURE__*/function () {
|
|
10532
|
-
var _ref2 = _asyncToGenerator(
|
|
11121
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
10533
11122
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
10534
11123
|
while (1) switch (_context.prev = _context.next) {
|
|
10535
11124
|
case 0:
|
|
@@ -10616,7 +11205,7 @@ var PublicWarningListConnect = function PublicWarningListConnect(_ref) {
|
|
|
10616
11205
|
});
|
|
10617
11206
|
var isFormDirty = useSelector(getSelectedPublicIsFormDirty);
|
|
10618
11207
|
var openPublicWarningDialog = /*#__PURE__*/function () {
|
|
10619
|
-
var _ref2 = _asyncToGenerator(
|
|
11208
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(formAction, warning, warningType) {
|
|
10620
11209
|
var mayProceed;
|
|
10621
11210
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
10622
11211
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -10663,7 +11252,7 @@ var PublicWarningListConnect = function PublicWarningListConnect(_ref) {
|
|
|
10663
11252
|
void openPublicWarningDialog('', undefined, warningType);
|
|
10664
11253
|
};
|
|
10665
11254
|
var editWarning = /*#__PURE__*/function () {
|
|
10666
|
-
var _ref3 = _asyncToGenerator(
|
|
11255
|
+
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(publicWarning) {
|
|
10667
11256
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
10668
11257
|
while (1) switch (_context2.prev = _context2.next) {
|
|
10669
11258
|
case 0:
|
|
@@ -10746,7 +11335,7 @@ var PublicWarningListConnect = function PublicWarningListConnect(_ref) {
|
|
|
10746
11335
|
var _usePostAirmet = usePostAirmet(),
|
|
10747
11336
|
postAirmet = _usePostAirmet.mutateAsync;
|
|
10748
11337
|
var deleteAviationProduct = /*#__PURE__*/function () {
|
|
10749
|
-
var _ref4 = _asyncToGenerator(
|
|
11338
|
+
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(productToPost, newStatus, warningType) {
|
|
10750
11339
|
var uuid, _postProductParam, postProductParam, errorMessage;
|
|
10751
11340
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
10752
11341
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -10988,7 +11577,12 @@ var warningListViewPreset = {
|
|
|
10988
11577
|
componentType: 'WarningList'};
|
|
10989
11578
|
var maritimeWarningsViewPreset = {
|
|
10990
11579
|
componentType: 'MaritimeWarnings'};
|
|
10991
|
-
var componentsLookUp = function componentsLookUp(payload
|
|
11580
|
+
var componentsLookUp = function componentsLookUp(payload,
|
|
11581
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11582
|
+
ComponentsLookUpWrapper) {
|
|
11583
|
+
if (ComponentsLookUpWrapper === void 0) {
|
|
11584
|
+
ComponentsLookUpWrapper = null;
|
|
11585
|
+
}
|
|
10992
11586
|
var id = payload.id,
|
|
10993
11587
|
componentType = payload.componentType,
|
|
10994
11588
|
initialProps = payload.initialProps;
|
|
@@ -11002,6 +11596,15 @@ var componentsLookUp = function componentsLookUp(payload) {
|
|
|
11002
11596
|
})
|
|
11003
11597
|
});
|
|
11004
11598
|
case maritimeWarningsViewPreset.componentType:
|
|
11599
|
+
if (ComponentsLookUpWrapper) {
|
|
11600
|
+
return jsx(ErrorBoundary, {
|
|
11601
|
+
children: jsx(ComponentsLookUpWrapper, {
|
|
11602
|
+
component: MaritimeWarningsFormConnect,
|
|
11603
|
+
payload: payload,
|
|
11604
|
+
domain: initialProps.domain || 'northSeaDistricts'
|
|
11605
|
+
})
|
|
11606
|
+
});
|
|
11607
|
+
}
|
|
11005
11608
|
return jsx(ErrorBoundary, {
|
|
11006
11609
|
children: jsx(MaritimeWarningsFormConnect, {
|
|
11007
11610
|
domain: initialProps.domain || 'northSeaDistricts'
|