@opengeoweb/warnings 9.35.0 → 9.35.1-spike-oltanstack.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 +400 -85
- package/package.json +1 -1
- package/src/lib/aviation-api/hooks.d.ts +2 -1
- package/src/lib/components/PublicWarningList/NewWarningButton/NewWarningButton.d.ts +4 -1
- package/src/lib/components/PublicWarningList/PublicWarningList.d.ts +2 -0
- package/src/lib/components/PublicWarningList/PublicWarningList.stories.d.ts +20 -0
- package/src/lib/components/PublicWarningList/PublicWarningListConnect.aviation.integration.spec.d.ts +1 -0
- package/src/lib/components/PublicWarningsForm/PublicWarningsForm.d.ts +3 -3
- package/src/lib/components/PublicWarningsForm/PublicWarningsFormConnect.d.ts +3 -3
- package/src/lib/components/PublicWarningsFormDialog/PublicWarningsFormDialog.d.ts +2 -1
- package/src/lib/store/publicWarningForm/reducer.d.ts +3 -1
- package/src/lib/store/publicWarningForm/selectors.d.ts +5 -0
- package/src/lib/store/publicWarningForm/types.d.ts +1 -0
- package/src/lib/storybookUtils/SimpleLinkMenu.d.ts +6 -0
- package/src/lib/utils/fakeApi/index.d.ts +3 -1
- package/src/lib/utils/sig-airmet-util.d.ts +2 -2
package/index.esm.js
CHANGED
|
@@ -57,7 +57,7 @@ var en = {
|
|
|
57
57
|
"object-manager-object-selected": "object selected",
|
|
58
58
|
"object-manager-share-menu": "Share object to",
|
|
59
59
|
"public-warning-title": "Public Warning",
|
|
60
|
-
"close-warning-dialog-title": "Close
|
|
60
|
+
"close-warning-dialog-title": "Close warning",
|
|
61
61
|
"warning-edit-mode-title": "Switch to edit mode",
|
|
62
62
|
"warning-edit-mode-description": "This warning is already in edit mode by another user and important information could get lost in the switching process.",
|
|
63
63
|
"warning-dialog-cancel": "Go back",
|
|
@@ -234,7 +234,7 @@ var nl = {
|
|
|
234
234
|
"object-manager-object-selected": "object geselecteerd",
|
|
235
235
|
"object-manager-share-menu": "Object delen naar",
|
|
236
236
|
"public-warning-title": "Publieke Waarschuwing",
|
|
237
|
-
"close-warning-dialog-title": "
|
|
237
|
+
"close-warning-dialog-title": "Waarschuwing sluiten",
|
|
238
238
|
"warning-edit-mode-title": "Wissel naar bewerken",
|
|
239
239
|
"warning-edit-mode-description": "Deze waarschuwing wordt al bewerkt door een andere gebruiker en belangrijke informatie kan verloren gaan.",
|
|
240
240
|
"warning-dialog-cancel": "Ga terug",
|
|
@@ -372,7 +372,7 @@ var fi = {
|
|
|
372
372
|
"object-manager-object-selected": "objekti valittuna",
|
|
373
373
|
"object-manager-share-menu": "Jaa objekti",
|
|
374
374
|
"public-warning-title": "Julkiset varoitukset",
|
|
375
|
-
"close-warning-dialog-title": "Sulje
|
|
375
|
+
"close-warning-dialog-title": "Sulje varoitukset",
|
|
376
376
|
"warning-edit-mode-title": "Vaihda editointitilaan",
|
|
377
377
|
"warning-edit-mode-description": "Tämä varoitus on jo editointitilassa toisen käyttäjän toimesta. Tärkeää tietoa saatetaan menettää, jos editointitilaa vaihdetaan.",
|
|
378
378
|
"warning-dialog-cancel": "Palaa takaisin",
|
|
@@ -2393,11 +2393,14 @@ var slice = createSlice({
|
|
|
2393
2393
|
object = _action$payload2.object,
|
|
2394
2394
|
publicWarning = _action$payload2.publicWarning,
|
|
2395
2395
|
_action$payload2$form = _action$payload2.formState,
|
|
2396
|
-
formState = _action$payload2$form === void 0 ? '' : _action$payload2$form
|
|
2396
|
+
formState = _action$payload2$form === void 0 ? '' : _action$payload2$form,
|
|
2397
|
+
_action$payload2$warn = _action$payload2.warningType,
|
|
2398
|
+
warningType = _action$payload2$warn === void 0 ? 'public' : _action$payload2$warn;
|
|
2397
2399
|
draft.object = object;
|
|
2398
2400
|
draft.publicWarning = publicWarning;
|
|
2399
2401
|
draft.selectedPublicWarningId = publicWarning == null ? void 0 : publicWarning.id;
|
|
2400
2402
|
draft.formState = formState;
|
|
2403
|
+
draft.warningType = warningType;
|
|
2401
2404
|
},
|
|
2402
2405
|
toggleEditorWarning: function toggleEditorWarning(draft,
|
|
2403
2406
|
// eslint-disable-next-line no-unused-vars
|
|
@@ -2471,6 +2474,7 @@ var slice = createSlice({
|
|
|
2471
2474
|
delete draft.error;
|
|
2472
2475
|
delete draft.selectedPublicWarningId;
|
|
2473
2476
|
delete draft.isFormDirty;
|
|
2477
|
+
delete draft.warningType;
|
|
2474
2478
|
}
|
|
2475
2479
|
}).addCase(publicWarningActions.fetchWarningsSuccess, function (draft, action) {
|
|
2476
2480
|
var warnings = action.payload.warnings;
|
|
@@ -6950,6 +6954,7 @@ var warningListJSON = [
|
|
|
6950
6954
|
lastUpdatedTime: "2023-12-05T16:47:43Z",
|
|
6951
6955
|
status: "WITHDRAWN",
|
|
6952
6956
|
warningDetail: {
|
|
6957
|
+
id: "3f756602-937d-11ee-a1bf-4k3k3k",
|
|
6953
6958
|
phenomenon: "thunderstorm",
|
|
6954
6959
|
areas: [
|
|
6955
6960
|
{
|
|
@@ -7006,6 +7011,7 @@ var warningListJSON = [
|
|
|
7006
7011
|
lastUpdatedTime: "2023-12-05T14:48:04Z",
|
|
7007
7012
|
status: "EXPIRED",
|
|
7008
7013
|
warningDetail: {
|
|
7014
|
+
id: "4b94edb8-937d-11ee-b619-0ab3cf8a98c1",
|
|
7009
7015
|
phenomenon: "snowIce",
|
|
7010
7016
|
areas: [
|
|
7011
7017
|
{
|
|
@@ -7062,6 +7068,7 @@ var warningListJSON = [
|
|
|
7062
7068
|
lastUpdatedTime: "2023-12-05T14:47:43Z",
|
|
7063
7069
|
status: "EXPIRED",
|
|
7064
7070
|
warningDetail: {
|
|
7071
|
+
id: "3f756602-937d-11ee-a1bf-0ab3cf8a98c1",
|
|
7065
7072
|
phenomenon: "thunderstorm",
|
|
7066
7073
|
areas: [
|
|
7067
7074
|
{
|
|
@@ -7115,6 +7122,204 @@ var warningListJSON = [
|
|
|
7115
7122
|
}
|
|
7116
7123
|
];
|
|
7117
7124
|
|
|
7125
|
+
var sigmetListJSON = [
|
|
7126
|
+
{
|
|
7127
|
+
id: "57eaf6c8-a247-11ef-ac05-12e0cc025418",
|
|
7128
|
+
lastUpdatedTime: "2024-11-14T05:14:37",
|
|
7129
|
+
productStatus: "DRAFT",
|
|
7130
|
+
warningDetail: {
|
|
7131
|
+
areas: [
|
|
7132
|
+
{
|
|
7133
|
+
geoJSON: {
|
|
7134
|
+
features: [
|
|
7135
|
+
{
|
|
7136
|
+
geometry: {
|
|
7137
|
+
type: "Polygon",
|
|
7138
|
+
coordinates: [
|
|
7139
|
+
[
|
|
7140
|
+
[
|
|
7141
|
+
10,
|
|
7142
|
+
20
|
|
7143
|
+
],
|
|
7144
|
+
[
|
|
7145
|
+
15,
|
|
7146
|
+
25
|
|
7147
|
+
],
|
|
7148
|
+
[
|
|
7149
|
+
20,
|
|
7150
|
+
20
|
|
7151
|
+
],
|
|
7152
|
+
[
|
|
7153
|
+
10,
|
|
7154
|
+
20
|
|
7155
|
+
]
|
|
7156
|
+
]
|
|
7157
|
+
]
|
|
7158
|
+
},
|
|
7159
|
+
properties: {
|
|
7160
|
+
selectionType: "fir",
|
|
7161
|
+
stroke: "#0075a9",
|
|
7162
|
+
"stroke-width": 1.5,
|
|
7163
|
+
"stroke-opacity": 1,
|
|
7164
|
+
fill: "#0075a9",
|
|
7165
|
+
"fill-opacity": 0.4
|
|
7166
|
+
},
|
|
7167
|
+
type: "Feature"
|
|
7168
|
+
}
|
|
7169
|
+
],
|
|
7170
|
+
type: "FeatureCollection"
|
|
7171
|
+
},
|
|
7172
|
+
objectName: "ENOB"
|
|
7173
|
+
}
|
|
7174
|
+
],
|
|
7175
|
+
descriptionOriginal: "",
|
|
7176
|
+
descriptionTranslation: "",
|
|
7177
|
+
firName: "BODOE OCEANIC FIR",
|
|
7178
|
+
incident: "-1",
|
|
7179
|
+
level: "SIG",
|
|
7180
|
+
phenomenon: "EMBD_TSGR",
|
|
7181
|
+
probability: "0",
|
|
7182
|
+
validFrom: "2024-11-14T05:30:14Z",
|
|
7183
|
+
validUntil: "2024-11-14T07:30:14Z"
|
|
7184
|
+
}
|
|
7185
|
+
},
|
|
7186
|
+
{
|
|
7187
|
+
id: "fc4c0002-8d32-11ef-888b-ee87a1644661",
|
|
7188
|
+
lastUpdatedTime: "2024-11-14T05:14:06",
|
|
7189
|
+
productStatus: "EXPIRED",
|
|
7190
|
+
warningDetail: {
|
|
7191
|
+
areas: [
|
|
7192
|
+
{
|
|
7193
|
+
geoJSON: null,
|
|
7194
|
+
objectName: "EFIN"
|
|
7195
|
+
}
|
|
7196
|
+
],
|
|
7197
|
+
descriptionOriginal: "",
|
|
7198
|
+
descriptionTranslation: "",
|
|
7199
|
+
firName: "HELSINKI FIR",
|
|
7200
|
+
incident: "T01",
|
|
7201
|
+
level: "SIG",
|
|
7202
|
+
phenomenon: "OBSC_TS",
|
|
7203
|
+
probability: "0",
|
|
7204
|
+
validFrom: "2024-11-13T05:30:14Z",
|
|
7205
|
+
validUntil: "2024-11-13T07:30:14Z"
|
|
7206
|
+
}
|
|
7207
|
+
},
|
|
7208
|
+
{
|
|
7209
|
+
id: "fe4a14bc-8a90-11ef-9090-6c08d8abf452",
|
|
7210
|
+
lastUpdatedTime: "2024-10-08T08:10:30",
|
|
7211
|
+
productStatus: "PUBLISHED",
|
|
7212
|
+
warningDetail: {
|
|
7213
|
+
areas: [
|
|
7214
|
+
{
|
|
7215
|
+
geoJSON: null,
|
|
7216
|
+
objectName: "EHAA"
|
|
7217
|
+
}
|
|
7218
|
+
],
|
|
7219
|
+
descriptionOriginal: "",
|
|
7220
|
+
descriptionTranslation: "",
|
|
7221
|
+
firName: "AMSTERDAM FIR",
|
|
7222
|
+
incident: "Z01",
|
|
7223
|
+
level: "SIG",
|
|
7224
|
+
phenomenon: "SEV_ICE",
|
|
7225
|
+
probability: "0",
|
|
7226
|
+
validFrom: "2024-10-08T05:30:14Z",
|
|
7227
|
+
validUntil: "2024-10-08T09:30:14Z"
|
|
7228
|
+
}
|
|
7229
|
+
}
|
|
7230
|
+
];
|
|
7231
|
+
|
|
7232
|
+
var airmetListJSON = [
|
|
7233
|
+
{
|
|
7234
|
+
id: "02d3727a-b190-11ef-ba31-067f7750936d",
|
|
7235
|
+
lastUpdatedTime: "2024-12-03T16:02:35",
|
|
7236
|
+
productStatus: "DRAFT",
|
|
7237
|
+
warningDetail: {
|
|
7238
|
+
areas: [
|
|
7239
|
+
{
|
|
7240
|
+
geoJSON: null,
|
|
7241
|
+
objectName: "EHAA"
|
|
7242
|
+
}
|
|
7243
|
+
],
|
|
7244
|
+
descriptionOriginal: "",
|
|
7245
|
+
descriptionTranslation: "",
|
|
7246
|
+
firName: "AMSTERDAM FIR",
|
|
7247
|
+
incident: "-1",
|
|
7248
|
+
level: "AIR",
|
|
7249
|
+
phenomenon: "SFC_WIND",
|
|
7250
|
+
probability: "0",
|
|
7251
|
+
validFrom: "2024-12-03T17:00:09Z",
|
|
7252
|
+
validUntil: "2024-12-03T21:00:09Z"
|
|
7253
|
+
}
|
|
7254
|
+
},
|
|
7255
|
+
{
|
|
7256
|
+
id: "1a868884-9076-11ef-8e82-5a063b90cdf6",
|
|
7257
|
+
lastUpdatedTime: "2024-10-22T13:03:56",
|
|
7258
|
+
productStatus: "DRAFT",
|
|
7259
|
+
warningDetail: {
|
|
7260
|
+
areas: [
|
|
7261
|
+
{
|
|
7262
|
+
geoJSON: null,
|
|
7263
|
+
objectName: "EHAA"
|
|
7264
|
+
}
|
|
7265
|
+
],
|
|
7266
|
+
descriptionOriginal: "",
|
|
7267
|
+
descriptionTranslation: "",
|
|
7268
|
+
firName: "AMSTERDAM FIR",
|
|
7269
|
+
incident: "-1",
|
|
7270
|
+
level: "AIR",
|
|
7271
|
+
phenomenon: "MOD_TURB",
|
|
7272
|
+
probability: "0",
|
|
7273
|
+
validFrom: "2024-10-22T15:00:09Z",
|
|
7274
|
+
validUntil: "2024-10-22T18:00:09Z"
|
|
7275
|
+
}
|
|
7276
|
+
},
|
|
7277
|
+
{
|
|
7278
|
+
id: "4ac7fc94-c670-11ee-8ace-92491e683685",
|
|
7279
|
+
lastUpdatedTime: "2024-02-08T12:26:31.803468",
|
|
7280
|
+
productStatus: "EXPIRED",
|
|
7281
|
+
warningDetail: {
|
|
7282
|
+
areas: [
|
|
7283
|
+
{
|
|
7284
|
+
geoJSON: null,
|
|
7285
|
+
objectName: "ENOR"
|
|
7286
|
+
}
|
|
7287
|
+
],
|
|
7288
|
+
descriptionOriginal: "",
|
|
7289
|
+
descriptionTranslation: "",
|
|
7290
|
+
firName: "POLARIS FIR",
|
|
7291
|
+
incident: "T01",
|
|
7292
|
+
level: "AIR",
|
|
7293
|
+
phenomenon: "OBSC_TS",
|
|
7294
|
+
probability: "0",
|
|
7295
|
+
validFrom: "2024-02-08T09:00:09Z",
|
|
7296
|
+
validUntil: "2024-02-08T11:00:09Z"
|
|
7297
|
+
}
|
|
7298
|
+
},
|
|
7299
|
+
{
|
|
7300
|
+
id: "9dbcd4c6-c4c0-11ee-a0e9-9e39e246af14",
|
|
7301
|
+
lastUpdatedTime: "2024-02-06T07:15:18.166785",
|
|
7302
|
+
productStatus: "PUBLISHED",
|
|
7303
|
+
warningDetail: {
|
|
7304
|
+
areas: [
|
|
7305
|
+
{
|
|
7306
|
+
geoJSON: null,
|
|
7307
|
+
objectName: "EHAA"
|
|
7308
|
+
}
|
|
7309
|
+
],
|
|
7310
|
+
descriptionOriginal: "",
|
|
7311
|
+
descriptionTranslation: "",
|
|
7312
|
+
firName: "AMSTERDAM FIR",
|
|
7313
|
+
incident: "Z01",
|
|
7314
|
+
level: "AIR",
|
|
7315
|
+
phenomenon: "SEV_ICE",
|
|
7316
|
+
probability: "0",
|
|
7317
|
+
validFrom: "2024-02-06T08:00:09Z",
|
|
7318
|
+
validUntil: "2024-02-06T12:00:09Z"
|
|
7319
|
+
}
|
|
7320
|
+
}
|
|
7321
|
+
];
|
|
7322
|
+
|
|
7118
7323
|
/* *
|
|
7119
7324
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7120
7325
|
* you may not use this file except in compliance with the License.
|
|
@@ -7135,6 +7340,8 @@ var warningListJSON = [
|
|
|
7135
7340
|
var drawingList = drawingListJSON;
|
|
7136
7341
|
var drawingsListFullContent = drawingsListFullContentJSON;
|
|
7137
7342
|
var warningList = warningListJSON;
|
|
7343
|
+
var sigmetList = sigmetListJSON;
|
|
7344
|
+
var airmetList = airmetListJSON;
|
|
7138
7345
|
var areaKeywordList = ['North Sea districts', 'Coastal Districts', 'KNMI Specific', 'Objects', 'Baltic areas', 'NL', 'FI', 'METNorway Specific', 'Provinces', 'FIR', 'Countries'];
|
|
7139
7346
|
|
|
7140
7347
|
/* *
|
|
@@ -7235,7 +7442,7 @@ var getApiRoutes = function getApiRoutes(axiosInstance) {
|
|
|
7235
7442
|
getWarnings: function getWarnings() {
|
|
7236
7443
|
return axiosInstance.get("/warnings/").then(function () {
|
|
7237
7444
|
return {
|
|
7238
|
-
data: warningList
|
|
7445
|
+
data: warningList.concat(sigmetList, airmetList)
|
|
7239
7446
|
};
|
|
7240
7447
|
});
|
|
7241
7448
|
},
|
|
@@ -7979,7 +8186,8 @@ var PublicWarningsFormDialog = function PublicWarningsFormDialog(_ref) {
|
|
|
7979
8186
|
shouldHideFormMode = _ref$shouldHideFormMo === void 0 ? false : _ref$shouldHideFormMo,
|
|
7980
8187
|
publicWarningEditor = _ref.publicWarningEditor,
|
|
7981
8188
|
selectedAviationProduct = _ref.selectedAviationProduct,
|
|
7982
|
-
warningType = _ref.warningType
|
|
8189
|
+
_ref$warningType = _ref.warningType,
|
|
8190
|
+
warningType = _ref$warningType === void 0 ? 'public' : _ref$warningType;
|
|
7983
8191
|
var _useWarningsTranslati = useWarningsTranslation(),
|
|
7984
8192
|
t = _useWarningsTranslati.t;
|
|
7985
8193
|
var minSize = selectedAviationProduct ? {
|
|
@@ -9234,7 +9442,7 @@ var ContainerFormWrapper = styled('div')(function (_ref) {
|
|
|
9234
9442
|
height: isReadOnly ? '100%' : "calc(100% - 206px)",
|
|
9235
9443
|
overflowY: 'auto'
|
|
9236
9444
|
}, _ref2[containerQueryBreakpoint] = {
|
|
9237
|
-
height: 'calc(100% - 88px)'
|
|
9445
|
+
height: isReadOnly ? '100%' : 'calc(100% - 88px)'
|
|
9238
9446
|
}, _ref2;
|
|
9239
9447
|
});
|
|
9240
9448
|
var sm6Width = 'calc(100% * 6 / var(--Grid-columns) - (var(--Grid-columns) - 6) * (var(--Grid-columnSpacing) / var(--Grid-columns)))';
|
|
@@ -9345,7 +9553,8 @@ var Form = function Form(_ref5) {
|
|
|
9345
9553
|
_ref5$onAddObject = _ref5.onAddObject,
|
|
9346
9554
|
onAddObject = _ref5$onAddObject === void 0 ? function () {} : _ref5$onAddObject,
|
|
9347
9555
|
selectedAviationProduct = _ref5.selectedAviationProduct,
|
|
9348
|
-
|
|
9556
|
+
_ref5$warningType = _ref5.warningType,
|
|
9557
|
+
warningType = _ref5$warningType === void 0 ? 'public' : _ref5$warningType,
|
|
9349
9558
|
mode = _ref5.mode;
|
|
9350
9559
|
var _useTACApi = useTACApi(),
|
|
9351
9560
|
fetchSigmetTAC = _useTACApi.fetchSigmetTAC,
|
|
@@ -9426,42 +9635,63 @@ var Form = function Form(_ref5) {
|
|
|
9426
9635
|
};
|
|
9427
9636
|
var publicWarningId = publicWarningDetails == null ? void 0 : publicWarningDetails.id;
|
|
9428
9637
|
React.useEffect(function () {
|
|
9429
|
-
if (
|
|
9430
|
-
|
|
9431
|
-
reset(getFormData(publicWarningDetails, object));
|
|
9638
|
+
if (selectedAviationProduct) {
|
|
9639
|
+
return;
|
|
9432
9640
|
}
|
|
9641
|
+
// sync redux with react-hook-form
|
|
9642
|
+
reset(getFormData(publicWarningDetails, object));
|
|
9433
9643
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
9434
|
-
}, [publicWarningId
|
|
9644
|
+
}, [publicWarningId]);
|
|
9435
9645
|
var areas = publicWarningDetails == null ? void 0 : publicWarningDetails.areas;
|
|
9436
9646
|
React.useEffect(function () {
|
|
9437
9647
|
if (selectedAviationProduct) {
|
|
9438
9648
|
return;
|
|
9439
9649
|
}
|
|
9440
|
-
// sync redux with react-hook-form
|
|
9441
9650
|
if (areas) {
|
|
9651
|
+
// sync redux with react-hook-form
|
|
9442
9652
|
setValue('areas', areas);
|
|
9443
9653
|
}
|
|
9444
|
-
|
|
9654
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
9655
|
+
}, [areas, setValue]);
|
|
9445
9656
|
React.useEffect(function () {
|
|
9446
9657
|
if (selectedAviationProduct) {
|
|
9447
9658
|
return;
|
|
9448
9659
|
}
|
|
9449
9660
|
// sync drawing on map with selected warning
|
|
9450
9661
|
setWarningGeoJSONFeature(initialPublicWarningArea);
|
|
9451
|
-
|
|
9662
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
9663
|
+
}, [initialPublicWarningArea]);
|
|
9664
|
+
var aviationId = selectedAviationProduct == null ? void 0 : selectedAviationProduct.uuid;
|
|
9665
|
+
React.useEffect(function () {
|
|
9666
|
+
if (!selectedAviationProduct) {
|
|
9667
|
+
return;
|
|
9668
|
+
}
|
|
9669
|
+
// sync redux with react-hook-form
|
|
9670
|
+
reset(selectedAviationProduct);
|
|
9671
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
9672
|
+
}, [aviationId, warningType]);
|
|
9452
9673
|
var errors = getErrors(error.message);
|
|
9453
9674
|
var level = WarningLevel[publicWarningDetails == null ? void 0 : publicWarningDetails.level] || WarningLevel[WarningLevel.moderate];
|
|
9454
9675
|
var geoJSONFeature = getWarningGeoJSONWithColor(level, warningGeoJSONFeature);
|
|
9455
9676
|
var ref = useScrollTopOnError(error);
|
|
9456
|
-
var warningType = isSigmetWarning ? 'sigmet' : 'airmet';
|
|
9457
9677
|
var _useProductConfig = useProductConfig(warningType),
|
|
9458
9678
|
aviationConfig = _useProductConfig.data;
|
|
9459
9679
|
return jsxs(ContainerWrapper, {
|
|
9460
|
-
children: [
|
|
9680
|
+
children: [jsxs(ContainerFormWrapper, {
|
|
9461
9681
|
isReadOnly: isReadOnly,
|
|
9462
9682
|
ref: ref,
|
|
9463
9683
|
"data-testid": "scroll-container",
|
|
9464
|
-
children: jsx(Box, {
|
|
9684
|
+
children: [errors && jsx(Box, {
|
|
9685
|
+
sx: {
|
|
9686
|
+
marginBottom: 2
|
|
9687
|
+
},
|
|
9688
|
+
children: jsx(AlertBanner, {
|
|
9689
|
+
title: errors.title,
|
|
9690
|
+
info: errors.errors,
|
|
9691
|
+
shouldClose: true,
|
|
9692
|
+
severity: error == null ? void 0 : error.severity
|
|
9693
|
+
})
|
|
9694
|
+
}), selectedAviationProduct ? jsx(Box, {
|
|
9465
9695
|
sx: {
|
|
9466
9696
|
maxWidth: {
|
|
9467
9697
|
xs: '550px',
|
|
@@ -9469,11 +9699,11 @@ var Form = function Form(_ref5) {
|
|
|
9469
9699
|
},
|
|
9470
9700
|
marginLeft: '-80px'
|
|
9471
9701
|
},
|
|
9472
|
-
children:
|
|
9702
|
+
children: warningType === 'sigmet' ? jsx(SigmetForm, {
|
|
9473
9703
|
showMap: false,
|
|
9474
9704
|
mode: mode,
|
|
9475
|
-
initialSigmet: selectedAviationProduct !==
|
|
9476
|
-
initialCancelSigmet: selectedAviationProduct !==
|
|
9705
|
+
initialSigmet: selectedAviationProduct !== undefined && !isInstanceOfCancelSigmet(selectedAviationProduct) ? selectedAviationProduct : null,
|
|
9706
|
+
initialCancelSigmet: selectedAviationProduct !== undefined && isInstanceOfCancelSigmet(selectedAviationProduct) ? selectedAviationProduct : null,
|
|
9477
9707
|
productConfig: aviationConfig,
|
|
9478
9708
|
product: selectedAviationProduct,
|
|
9479
9709
|
getTAC: function getTAC(product) {
|
|
@@ -9482,32 +9712,17 @@ var Form = function Form(_ref5) {
|
|
|
9482
9712
|
}) : jsx(AirmetForm, {
|
|
9483
9713
|
showMap: false,
|
|
9484
9714
|
mode: mode,
|
|
9485
|
-
isCancelAirmet: selectedAviationProduct !==
|
|
9486
|
-
initialAirmet: selectedAviationProduct !==
|
|
9487
|
-
initialCancelAirmet: selectedAviationProduct !==
|
|
9715
|
+
isCancelAirmet: selectedAviationProduct !== undefined && isInstanceOfCancelAirmet(selectedAviationProduct),
|
|
9716
|
+
initialAirmet: selectedAviationProduct !== undefined && !isInstanceOfCancelAirmet(selectedAviationProduct) ? selectedAviationProduct : null,
|
|
9717
|
+
initialCancelAirmet: selectedAviationProduct !== undefined && isInstanceOfCancelAirmet(selectedAviationProduct) ? selectedAviationProduct : null,
|
|
9488
9718
|
productConfig: aviationConfig,
|
|
9489
9719
|
product: selectedAviationProduct,
|
|
9490
9720
|
getTAC: function getTAC(product) {
|
|
9491
9721
|
return fetchAirmetTAC(product);
|
|
9492
9722
|
}
|
|
9493
9723
|
})
|
|
9494
|
-
})
|
|
9495
|
-
|
|
9496
|
-
isReadOnly: isReadOnly,
|
|
9497
|
-
ref: ref,
|
|
9498
|
-
"data-testid": "scroll-container",
|
|
9499
|
-
children: [jsxs(ContainerGrid, {
|
|
9500
|
-
children: [errors && jsx(Box, {
|
|
9501
|
-
sx: {
|
|
9502
|
-
marginBottom: 2
|
|
9503
|
-
},
|
|
9504
|
-
children: jsx(AlertBanner, {
|
|
9505
|
-
title: errors.title,
|
|
9506
|
-
info: errors.errors,
|
|
9507
|
-
shouldClose: true,
|
|
9508
|
-
severity: error == null ? void 0 : error.severity
|
|
9509
|
-
})
|
|
9510
|
-
}), jsxs(Grid2, {
|
|
9724
|
+
}) : jsx(ContainerGrid, {
|
|
9725
|
+
children: jsxs(Grid2, {
|
|
9511
9726
|
size: {
|
|
9512
9727
|
xs: 12
|
|
9513
9728
|
},
|
|
@@ -9601,14 +9816,14 @@ var Form = function Form(_ref5) {
|
|
|
9601
9816
|
})
|
|
9602
9817
|
})
|
|
9603
9818
|
})]
|
|
9604
|
-
})
|
|
9819
|
+
})
|
|
9605
9820
|
}), jsx(DraftFieldHelper, {}), jsx(ReactHookFormHiddenInput, {
|
|
9606
9821
|
name: "id"
|
|
9607
9822
|
})]
|
|
9608
9823
|
}), !isReadOnly && jsx(Box, {
|
|
9609
9824
|
sx: {
|
|
9610
9825
|
padding: '24px 10px 14px 10px',
|
|
9611
|
-
position:
|
|
9826
|
+
position: 'absolute',
|
|
9612
9827
|
bottom: 0,
|
|
9613
9828
|
width: '100%',
|
|
9614
9829
|
backgroundColor: 'geowebColors.background.surfaceApp',
|
|
@@ -9697,8 +9912,7 @@ var PublicWarningsForm = function PublicWarningsForm(props) {
|
|
|
9697
9912
|
return jsx(ReactHookFormProvider, {
|
|
9698
9913
|
options: Object.assign({}, defaultFormOptions, {
|
|
9699
9914
|
mode: 'onSubmit',
|
|
9700
|
-
defaultValues: defaultValues
|
|
9701
|
-
values: selectedAviationProduct
|
|
9915
|
+
defaultValues: defaultValues
|
|
9702
9916
|
}),
|
|
9703
9917
|
children: jsx(Form, Object.assign({}, props))
|
|
9704
9918
|
});
|
|
@@ -9761,6 +9975,9 @@ var getSelectedPublicWarningId = createSelector(getPublicWarningStore, function
|
|
|
9761
9975
|
var getSelectedPublicIsFormDirty = createSelector(getPublicWarningStore, function (publicWarningStore) {
|
|
9762
9976
|
return (publicWarningStore == null ? void 0 : publicWarningStore.isFormDirty) || false;
|
|
9763
9977
|
});
|
|
9978
|
+
var getWarningType = createSelector(getPublicWarningStore, function (publicWarningStore) {
|
|
9979
|
+
return publicWarningStore == null ? void 0 : publicWarningStore.warningType;
|
|
9980
|
+
});
|
|
9764
9981
|
|
|
9765
9982
|
/* *
|
|
9766
9983
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -9793,7 +10010,8 @@ var PublicWarningStatus;
|
|
|
9793
10010
|
var PublicWarningsFormConnect = function PublicWarningsFormConnect(_ref) {
|
|
9794
10011
|
var defaultMapPreset = _ref.defaultMapPreset,
|
|
9795
10012
|
selectedAviationProduct = _ref.selectedAviationProduct,
|
|
9796
|
-
|
|
10013
|
+
_ref$warningType = _ref.warningType,
|
|
10014
|
+
warningType = _ref$warningType === void 0 ? 'public' : _ref$warningType,
|
|
9797
10015
|
mode = _ref.mode;
|
|
9798
10016
|
var publicWarning = useSelector(function (store) {
|
|
9799
10017
|
return getPublicWarning(store);
|
|
@@ -9838,15 +10056,26 @@ var PublicWarningsFormConnect = function PublicWarningsFormConnect(_ref) {
|
|
|
9838
10056
|
}));
|
|
9839
10057
|
};
|
|
9840
10058
|
var getIsReadOnly = function getIsReadOnly() {
|
|
9841
|
-
|
|
9842
|
-
|
|
10059
|
+
// public warning related
|
|
10060
|
+
if (warningType === 'public') {
|
|
10061
|
+
if (publicWarningFormAction === 'readonly') {
|
|
10062
|
+
return true;
|
|
10063
|
+
}
|
|
10064
|
+
if ((publicWarning == null ? void 0 : publicWarning.status) === 'TODO') {
|
|
10065
|
+
return false;
|
|
10066
|
+
}
|
|
10067
|
+
// Readonly in case you are not creating a new warning and you are not set as the editor
|
|
10068
|
+
return !isEditor && (publicWarning == null ? void 0 : publicWarning.status) !== undefined;
|
|
10069
|
+
}
|
|
10070
|
+
// aviation related
|
|
10071
|
+
if ((selectedAviationProduct == null ? void 0 : selectedAviationProduct.status) === 'DRAFT') {
|
|
10072
|
+
return false;
|
|
9843
10073
|
}
|
|
9844
|
-
if (
|
|
10074
|
+
if (mode === 'new') {
|
|
9845
10075
|
return false;
|
|
9846
10076
|
}
|
|
9847
|
-
return
|
|
10077
|
+
return true;
|
|
9848
10078
|
};
|
|
9849
|
-
// Readonly also in case you are not creating a new warning and you are not set as the editor
|
|
9850
10079
|
var isReadOnly = getIsReadOnly();
|
|
9851
10080
|
var onAddObject = function onAddObject() {
|
|
9852
10081
|
dispatch(uiActions.setToggleOpenDialog({
|
|
@@ -9866,7 +10095,7 @@ var PublicWarningsFormConnect = function PublicWarningsFormConnect(_ref) {
|
|
|
9866
10095
|
defaultMapPreset: defaultMapPreset,
|
|
9867
10096
|
onAddObject: onAddObject,
|
|
9868
10097
|
selectedAviationProduct: selectedAviationProduct,
|
|
9869
|
-
|
|
10098
|
+
warningType: warningType,
|
|
9870
10099
|
mode: mode
|
|
9871
10100
|
});
|
|
9872
10101
|
};
|
|
@@ -10666,6 +10895,74 @@ var transformAirmetToProductFormat = function transformAirmetToProductFormat(war
|
|
|
10666
10895
|
validDateEndOfAirmetToCancel: cancelAirmet.validDateEndOfAirmetToCancel
|
|
10667
10896
|
});
|
|
10668
10897
|
};
|
|
10898
|
+
// For the Create and Clear buttons
|
|
10899
|
+
// The fields initialised to unknown will be set to their default values by ReactHookForm
|
|
10900
|
+
var getEmptySigmetWarning = function getEmptySigmetWarning() {
|
|
10901
|
+
var currentTime = new Date();
|
|
10902
|
+
var validFromTime = dateUtils.add(currentTime, {
|
|
10903
|
+
minutes: 15
|
|
10904
|
+
});
|
|
10905
|
+
var validUntilTime = dateUtils.add(currentTime, {
|
|
10906
|
+
hours: 4
|
|
10907
|
+
});
|
|
10908
|
+
return {
|
|
10909
|
+
type: undefined,
|
|
10910
|
+
phenomenon: '',
|
|
10911
|
+
status: '',
|
|
10912
|
+
isObservationOrForecast: '',
|
|
10913
|
+
issueDate: undefined,
|
|
10914
|
+
locationIndicatorATSR: undefined,
|
|
10915
|
+
locationIndicatorATSU: undefined,
|
|
10916
|
+
locationIndicatorMWO: undefined,
|
|
10917
|
+
change: '',
|
|
10918
|
+
// Default change
|
|
10919
|
+
sequence: undefined,
|
|
10920
|
+
validDateStart: dateUtils.dateToString(validFromTime),
|
|
10921
|
+
validDateEnd: dateUtils.dateToString(validUntilTime),
|
|
10922
|
+
level: '',
|
|
10923
|
+
levelInfoMode: '',
|
|
10924
|
+
movementType: '',
|
|
10925
|
+
firName: undefined
|
|
10926
|
+
};
|
|
10927
|
+
};
|
|
10928
|
+
// For the Create and Clear buttons
|
|
10929
|
+
// The fields initialised to unknown will be set to their default values by ReactHookForm
|
|
10930
|
+
var getEmptyAirmetWarning = function getEmptyAirmetWarning() {
|
|
10931
|
+
var currentTime = new Date();
|
|
10932
|
+
var validFromTime = dateUtils.add(currentTime, {
|
|
10933
|
+
minutes: 15
|
|
10934
|
+
});
|
|
10935
|
+
var validUntilTime = dateUtils.add(currentTime, {
|
|
10936
|
+
hours: 4
|
|
10937
|
+
});
|
|
10938
|
+
return {
|
|
10939
|
+
type: undefined,
|
|
10940
|
+
phenomenon: '',
|
|
10941
|
+
status: '',
|
|
10942
|
+
isObservationOrForecast: '',
|
|
10943
|
+
issueDate: undefined,
|
|
10944
|
+
locationIndicatorATSR: undefined,
|
|
10945
|
+
locationIndicatorATSU: undefined,
|
|
10946
|
+
locationIndicatorMWO: undefined,
|
|
10947
|
+
change: '',
|
|
10948
|
+
// Default change
|
|
10949
|
+
sequence: undefined,
|
|
10950
|
+
validDateStart: dateUtils.dateToString(validFromTime),
|
|
10951
|
+
validDateEnd: dateUtils.dateToString(validUntilTime),
|
|
10952
|
+
level: '',
|
|
10953
|
+
levelInfoMode: '',
|
|
10954
|
+
movementType: '',
|
|
10955
|
+
firName: undefined,
|
|
10956
|
+
startGeometry: {
|
|
10957
|
+
type: 'FeatureCollection',
|
|
10958
|
+
features: []
|
|
10959
|
+
},
|
|
10960
|
+
startGeometryIntersect: {
|
|
10961
|
+
type: 'FeatureCollection',
|
|
10962
|
+
features: []
|
|
10963
|
+
}
|
|
10964
|
+
};
|
|
10965
|
+
};
|
|
10669
10966
|
|
|
10670
10967
|
var warningFormConfirmationOptions = function warningFormConfirmationOptions(t) {
|
|
10671
10968
|
return {
|
|
@@ -10712,6 +11009,7 @@ var PublicWarningsFormDialogConnect = function PublicWarningsFormDialogConnect(_
|
|
|
10712
11009
|
var publicWarningEditor = useSelector(function (store) {
|
|
10713
11010
|
return getPublicWarningEditor(store);
|
|
10714
11011
|
});
|
|
11012
|
+
var warningType = useSelector(getWarningType);
|
|
10715
11013
|
var _useAuthenticationCon = useAuthenticationContext$1(),
|
|
10716
11014
|
auth = _useAuthenticationCon.auth;
|
|
10717
11015
|
var isEditor = publicWarningEditor === (auth == null ? void 0 : auth.username) || false;
|
|
@@ -10869,15 +11167,14 @@ var PublicWarningsFormDialogConnect = function PublicWarningsFormDialogConnect(_
|
|
|
10869
11167
|
var selectedAirmet = airmetList == null ? void 0 : airmetList.find(function (airmet) {
|
|
10870
11168
|
return airmet.uuid === selectedWarningId;
|
|
10871
11169
|
});
|
|
10872
|
-
var
|
|
10873
|
-
var
|
|
10874
|
-
var _useProductConfig = useProductConfig(warningType, !isDialogOpen),
|
|
11170
|
+
var updatedWarningType = selectedSigmet ? 'sigmet' : selectedAirmet && 'airmet' || warningType;
|
|
11171
|
+
var _useProductConfig = useProductConfig(updatedWarningType, !isDialogOpen),
|
|
10875
11172
|
aviationConfig = _useProductConfig.data;
|
|
10876
|
-
var selectedSigmetProduct = selectedSigmet && aviationConfig ? transformSigmetToProductFormat(selectedSigmet, aviationConfig) :
|
|
10877
|
-
var selectedAirmetProduct = selectedAirmet ? transformAirmetToProductFormat(selectedAirmet, aviationConfig) :
|
|
10878
|
-
var selectedAviationProduct =
|
|
10879
|
-
var productCanBe =
|
|
10880
|
-
var mode = getProductFormMode(productCanBe, selectedAviationProduct);
|
|
11173
|
+
var selectedSigmetProduct = selectedSigmet && aviationConfig ? transformSigmetToProductFormat(selectedSigmet, aviationConfig) : getEmptySigmetWarning();
|
|
11174
|
+
var selectedAirmetProduct = selectedAirmet && aviationConfig ? transformAirmetToProductFormat(selectedAirmet, aviationConfig) : getEmptyAirmetWarning();
|
|
11175
|
+
var selectedAviationProduct = updatedWarningType === 'sigmet' ? selectedSigmetProduct : updatedWarningType === 'airmet' && selectedAirmetProduct || undefined;
|
|
11176
|
+
var productCanBe = updatedWarningType === 'public' ? ['DRAFTED', 'DISCARDED', 'PUBLISHED'] : (selectedSigmet == null ? void 0 : selectedSigmet.canbe) || (selectedAirmet == null ? void 0 : selectedAirmet.canbe);
|
|
11177
|
+
var mode = getProductFormMode(productCanBe, !selectedWarningId ? null : selectedAviationProduct);
|
|
10881
11178
|
// Readonly also in case you are not creating a new warning and you are not set as the editor
|
|
10882
11179
|
var isReadOnly = formAction === 'readonly' || !isEditor && publicWarningStatus !== undefined;
|
|
10883
11180
|
// Only show toggle if in draft status
|
|
@@ -10897,11 +11194,11 @@ var PublicWarningsFormDialogConnect = function PublicWarningsFormDialogConnect(_
|
|
|
10897
11194
|
shouldHideFormMode: shouldHideFormToggleMode,
|
|
10898
11195
|
publicWarningEditor: publicWarningEditor,
|
|
10899
11196
|
selectedAviationProduct: selectedAviationProduct,
|
|
10900
|
-
warningType:
|
|
11197
|
+
warningType: updatedWarningType,
|
|
10901
11198
|
children: jsx(PublicWarningsFormConnect, {
|
|
10902
11199
|
defaultMapPreset: defaultMapPreset,
|
|
10903
11200
|
selectedAviationProduct: selectedAviationProduct,
|
|
10904
|
-
|
|
11201
|
+
warningType: updatedWarningType,
|
|
10905
11202
|
mode: mode
|
|
10906
11203
|
})
|
|
10907
11204
|
}), jsx(AreaObjectLoaderConnect, {})]
|
|
@@ -11561,6 +11858,7 @@ var WarningListItemSeperator = function WarningListItemSeperator(_ref) {
|
|
|
11561
11858
|
padding: 0
|
|
11562
11859
|
},
|
|
11563
11860
|
onClick: onClick,
|
|
11861
|
+
"data-testid": "warninglist-" + status,
|
|
11564
11862
|
children: [isExpanded ? jsx(ChevronDown, {}) : jsx(ChevronUp, {}), jsx(Typography, {
|
|
11565
11863
|
variant: "caption",
|
|
11566
11864
|
sx: {
|
|
@@ -12022,6 +12320,10 @@ var NewWarningButton = function NewWarningButton(_ref) {
|
|
|
12022
12320
|
event.stopPropagation();
|
|
12023
12321
|
setAnchorEl(null);
|
|
12024
12322
|
};
|
|
12323
|
+
var onCreateNewWarning = function onCreateNewWarning(warningType, event) {
|
|
12324
|
+
onCreateWarning(warningType);
|
|
12325
|
+
handleClose(event);
|
|
12326
|
+
};
|
|
12025
12327
|
var buttonId = 'newWarningButton';
|
|
12026
12328
|
React__default.useEffect(function () {
|
|
12027
12329
|
if (isDefaultOpen) {
|
|
@@ -12082,19 +12384,22 @@ var NewWarningButton = function NewWarningButton(_ref) {
|
|
|
12082
12384
|
},
|
|
12083
12385
|
children: [jsx(MenuItem, {
|
|
12084
12386
|
onClick: function onClick(event) {
|
|
12085
|
-
|
|
12086
|
-
handleClose(event);
|
|
12387
|
+
onCreateNewWarning('public', event);
|
|
12087
12388
|
},
|
|
12088
12389
|
children: jsx(ListItemText, {
|
|
12089
12390
|
children: t('public-warning-title').toUpperCase()
|
|
12090
12391
|
})
|
|
12091
12392
|
}, "Public"), jsx(MenuItem, {
|
|
12092
|
-
|
|
12393
|
+
onClick: function onClick(event) {
|
|
12394
|
+
onCreateNewWarning('airmet', event);
|
|
12395
|
+
},
|
|
12093
12396
|
children: jsx(ListItemText, {
|
|
12094
12397
|
children: BUTTON_AIRMET
|
|
12095
12398
|
})
|
|
12096
12399
|
}, "Airmet"), jsx(MenuItem, {
|
|
12097
|
-
|
|
12400
|
+
onClick: function onClick(event) {
|
|
12401
|
+
onCreateNewWarning('sigmet', event);
|
|
12402
|
+
},
|
|
12098
12403
|
children: jsx(ListItemText, {
|
|
12099
12404
|
children: BUTTON_SIGMET
|
|
12100
12405
|
})
|
|
@@ -12222,7 +12527,9 @@ var PublicWarningList = function PublicWarningList(_ref) {
|
|
|
12222
12527
|
_ref$onClickAllChip = _ref.onClickAllChip,
|
|
12223
12528
|
onClickAllChip = _ref$onClickAllChip === void 0 ? function () {} : _ref$onClickAllChip,
|
|
12224
12529
|
_ref$isAllChipSelecte = _ref.isAllChipSelected,
|
|
12225
|
-
isAllChipSelected = _ref$isAllChipSelecte === void 0 ? true : _ref$isAllChipSelecte
|
|
12530
|
+
isAllChipSelected = _ref$isAllChipSelecte === void 0 ? true : _ref$isAllChipSelecte,
|
|
12531
|
+
expandedSections = _ref.expandedSections,
|
|
12532
|
+
setExpandedSections = _ref.setExpandedSections;
|
|
12226
12533
|
var filterState = filterHookState.filterState,
|
|
12227
12534
|
updateFilter = filterHookState.updateFilter,
|
|
12228
12535
|
allSelected = filterHookState.allSelected;
|
|
@@ -12249,14 +12556,6 @@ var PublicWarningList = function PublicWarningList(_ref) {
|
|
|
12249
12556
|
};
|
|
12250
12557
|
});
|
|
12251
12558
|
};
|
|
12252
|
-
var _React$useState2 = React__default.useState({
|
|
12253
|
-
TODO: true,
|
|
12254
|
-
DRAFT: true,
|
|
12255
|
-
PUBLISHED: true,
|
|
12256
|
-
EXPIRED: true
|
|
12257
|
-
}),
|
|
12258
|
-
expandedSections = _React$useState2[0],
|
|
12259
|
-
setExpandedSections = _React$useState2[1];
|
|
12260
12559
|
var toggleExpand = function toggleExpand(shouldToggle, status) {
|
|
12261
12560
|
var _Object$assign;
|
|
12262
12561
|
setExpandedSections(Object.assign({}, expandedSections, (_Object$assign = {}, _Object$assign[status] = shouldToggle, _Object$assign)));
|
|
@@ -12818,7 +13117,7 @@ var PublicWarningListConnect = function PublicWarningListConnect(_ref) {
|
|
|
12818
13117
|
var lastUpdatedTime = useSelector(getPublicWarningsLastUpdatedTime);
|
|
12819
13118
|
var warningsApi = getWarningsApi();
|
|
12820
13119
|
var openPublicWarningDialog = /*#__PURE__*/function () {
|
|
12821
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(formAction, publicWarning) {
|
|
13120
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(formAction, publicWarning, warningType) {
|
|
12822
13121
|
var mayProceed;
|
|
12823
13122
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
12824
13123
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -12844,7 +13143,8 @@ var PublicWarningListConnect = function PublicWarningListConnect(_ref) {
|
|
|
12844
13143
|
dispatch(publicWarningFormActions.openPublicWarningFormDialog(Object.assign({}, publicWarning && {
|
|
12845
13144
|
publicWarning: publicWarning
|
|
12846
13145
|
}, {
|
|
12847
|
-
formState: formAction
|
|
13146
|
+
formState: formAction,
|
|
13147
|
+
warningType: warningType
|
|
12848
13148
|
})));
|
|
12849
13149
|
case 7:
|
|
12850
13150
|
case "end":
|
|
@@ -12852,15 +13152,15 @@ var PublicWarningListConnect = function PublicWarningListConnect(_ref) {
|
|
|
12852
13152
|
}
|
|
12853
13153
|
}, _callee);
|
|
12854
13154
|
}));
|
|
12855
|
-
return function openPublicWarningDialog(_x, _x2) {
|
|
13155
|
+
return function openPublicWarningDialog(_x, _x2, _x3) {
|
|
12856
13156
|
return _ref2.apply(this, arguments);
|
|
12857
13157
|
};
|
|
12858
13158
|
}();
|
|
12859
13159
|
var selectWarning = function selectWarning(publicWarning) {
|
|
12860
13160
|
void openPublicWarningDialog('readonly', publicWarning);
|
|
12861
13161
|
};
|
|
12862
|
-
var createWarning = function createWarning() {
|
|
12863
|
-
void openPublicWarningDialog('');
|
|
13162
|
+
var createWarning = function createWarning(warningType) {
|
|
13163
|
+
void openPublicWarningDialog('', undefined, warningType);
|
|
12864
13164
|
};
|
|
12865
13165
|
var editWarning = /*#__PURE__*/function () {
|
|
12866
13166
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(publicWarning) {
|
|
@@ -12893,7 +13193,7 @@ var PublicWarningListConnect = function PublicWarningListConnect(_ref) {
|
|
|
12893
13193
|
}
|
|
12894
13194
|
}, _callee2);
|
|
12895
13195
|
}));
|
|
12896
|
-
return function editWarning(
|
|
13196
|
+
return function editWarning(_x4) {
|
|
12897
13197
|
return _ref3.apply(this, arguments);
|
|
12898
13198
|
};
|
|
12899
13199
|
}();
|
|
@@ -12923,7 +13223,7 @@ var PublicWarningListConnect = function PublicWarningListConnect(_ref) {
|
|
|
12923
13223
|
}
|
|
12924
13224
|
}, _callee3);
|
|
12925
13225
|
}));
|
|
12926
|
-
return function expireWarning(
|
|
13226
|
+
return function expireWarning(_x5) {
|
|
12927
13227
|
return _ref4.apply(this, arguments);
|
|
12928
13228
|
};
|
|
12929
13229
|
}();
|
|
@@ -12953,7 +13253,7 @@ var PublicWarningListConnect = function PublicWarningListConnect(_ref) {
|
|
|
12953
13253
|
}
|
|
12954
13254
|
}, _callee4);
|
|
12955
13255
|
}));
|
|
12956
|
-
return function withdrawWarning(
|
|
13256
|
+
return function withdrawWarning(_x6) {
|
|
12957
13257
|
return _ref5.apply(this, arguments);
|
|
12958
13258
|
};
|
|
12959
13259
|
}();
|
|
@@ -13038,8 +13338,21 @@ var PublicWarningListConnect = function PublicWarningListConnect(_ref) {
|
|
|
13038
13338
|
var filteredWarnings = React__default.useMemo(function () {
|
|
13039
13339
|
return combinedWarnings.filter(filterHookState.byFilterState);
|
|
13040
13340
|
}, [combinedWarnings, filterHookState.byFilterState]);
|
|
13341
|
+
var _React$useState2 = React__default.useState({
|
|
13342
|
+
TODO: true,
|
|
13343
|
+
DRAFT: true,
|
|
13344
|
+
PUBLISHED: true,
|
|
13345
|
+
EXPIRED: false
|
|
13346
|
+
}),
|
|
13347
|
+
expandedSections = _React$useState2[0],
|
|
13348
|
+
setExpandedSections = _React$useState2[1];
|
|
13349
|
+
var filteredWarningsByExpandedSections = React__default.useMemo(function () {
|
|
13350
|
+
return filteredWarnings.filter(function (warning) {
|
|
13351
|
+
return warning.status && expandedSections[warning.status] || warning.productStatus && expandedSections[warning.productStatus];
|
|
13352
|
+
});
|
|
13353
|
+
}, [filteredWarnings, expandedSections]);
|
|
13041
13354
|
var allFeatures = React__default.useMemo(function () {
|
|
13042
|
-
return
|
|
13355
|
+
return filteredWarningsByExpandedSections.reduce(function (acc, warning) {
|
|
13043
13356
|
var _warning$warningDetai;
|
|
13044
13357
|
var features = warning == null || (_warning$warningDetai = warning.warningDetail.areas) == null ? void 0 : _warning$warningDetai.map(function (a) {
|
|
13045
13358
|
return {
|
|
@@ -13054,13 +13367,15 @@ var PublicWarningListConnect = function PublicWarningListConnect(_ref) {
|
|
|
13054
13367
|
}
|
|
13055
13368
|
return acc;
|
|
13056
13369
|
}, []);
|
|
13057
|
-
}, [
|
|
13370
|
+
}, [filteredWarningsByExpandedSections]);
|
|
13058
13371
|
useUpdateSharedData({
|
|
13059
13372
|
features: allFeatures
|
|
13060
13373
|
}, panelId);
|
|
13061
13374
|
return jsxs(Fragment, {
|
|
13062
13375
|
children: [jsx(PublicWarningList, {
|
|
13063
13376
|
warnings: filteredWarnings,
|
|
13377
|
+
expandedSections: expandedSections,
|
|
13378
|
+
setExpandedSections: setExpandedSections,
|
|
13064
13379
|
isLoading: isLoading,
|
|
13065
13380
|
error: error,
|
|
13066
13381
|
onSelectWarning: selectWarning,
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { UseQueryResult } from '@tanstack/react-query';
|
|
2
2
|
import { AirmetConfig, AirmetFromBackend, SigmetConfig, SigmetFromBackend } from '@opengeoweb/api';
|
|
3
3
|
import { AviationProduct } from '@opengeoweb/sigmet-airmet';
|
|
4
|
+
import { WarningType } from '../store/publicWarningForm/types';
|
|
4
5
|
export declare const useAirmetList: (disabled?: boolean) => UseQueryResult<AirmetFromBackend[]>;
|
|
5
6
|
export declare const useSigmetList: (disabled?: boolean) => UseQueryResult<SigmetFromBackend[]>;
|
|
6
|
-
export declare const useProductConfig: (warningType
|
|
7
|
+
export declare const useProductConfig: (warningType?: WarningType, disabled?: boolean) => UseQueryResult<SigmetConfig | AirmetConfig>;
|
|
7
8
|
type FetchTACData = Promise<{
|
|
8
9
|
data: string;
|
|
9
10
|
}>;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { WarningType } from '../../../store/publicWarningForm/types';
|
|
3
|
+
export declare const BUTTON_AIRMET = "AIRMET";
|
|
4
|
+
export declare const BUTTON_SIGMET = "SIGMET";
|
|
2
5
|
interface NewWarningButtonProps {
|
|
3
|
-
onCreateWarning: () => void;
|
|
6
|
+
onCreateWarning: (warningType?: WarningType) => void;
|
|
4
7
|
isDefaultOpen?: boolean;
|
|
5
8
|
}
|
|
6
9
|
export declare const NewWarningButton: React.FC<NewWarningButtonProps>;
|
|
@@ -16,6 +16,8 @@ export interface PublicWarningListProps extends WarningListItemActions {
|
|
|
16
16
|
filterHookState: FilterHookState;
|
|
17
17
|
onClickAllChip?: (isChecked: boolean) => void;
|
|
18
18
|
isAllChipSelected?: boolean;
|
|
19
|
+
expandedSections: Record<string, boolean>;
|
|
20
|
+
setExpandedSections: (expandedSections: Record<string, boolean>) => void;
|
|
19
21
|
}
|
|
20
22
|
export declare const PublicWarningList: React.FC<PublicWarningListProps>;
|
|
21
23
|
export default PublicWarningList;
|
|
@@ -23,6 +23,26 @@ export declare const PublicWarningListDark: {
|
|
|
23
23
|
}[];
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
|
+
export declare const PublicWarningListAviation: {
|
|
27
|
+
(): React.ReactElement;
|
|
28
|
+
tags: string[];
|
|
29
|
+
parameters: {
|
|
30
|
+
zeplinLink: {
|
|
31
|
+
name: string;
|
|
32
|
+
link: string;
|
|
33
|
+
}[];
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export declare const PublicWarningListPublicAndAviation: {
|
|
37
|
+
(): React.ReactElement;
|
|
38
|
+
tags: string[];
|
|
39
|
+
parameters: {
|
|
40
|
+
zeplinLink: {
|
|
41
|
+
name: string;
|
|
42
|
+
link: string;
|
|
43
|
+
}[];
|
|
44
|
+
};
|
|
45
|
+
};
|
|
26
46
|
export declare const PublicWarningListError: () => React.ReactElement;
|
|
27
47
|
export declare const PublicWarningListLoading: () => React.ReactElement;
|
|
28
48
|
export declare const PublicWarningListSmallLight: {
|
package/src/lib/components/PublicWarningList/PublicWarningListConnect.aviation.integration.spec.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { AviationProduct, FormMode } from '@opengeoweb/sigmet-airmet';
|
|
3
3
|
import { MapPreset } from '@opengeoweb/store';
|
|
4
|
-
import { PublicWarningDetail } from '../../store/publicWarningForm/types';
|
|
4
|
+
import { PublicWarningDetail, WarningType } from '../../store/publicWarningForm/types';
|
|
5
5
|
import { BaseDrawingListItem, DrawingListItem } from '../../store/drawings/types';
|
|
6
6
|
import { FormAction, FormError } from '../../store/publicWarningForm/reducer';
|
|
7
7
|
export declare const useScrollTopOnError: (error: FormError) => React.RefObject<HTMLDivElement>;
|
|
@@ -13,7 +13,7 @@ interface FormData extends PublicWarningDetail {
|
|
|
13
13
|
'translation-select'?: string;
|
|
14
14
|
}
|
|
15
15
|
export declare const prepareFormValues: (data: FormData) => PublicWarningDetail;
|
|
16
|
-
interface FormProps {
|
|
16
|
+
export interface FormProps {
|
|
17
17
|
formAction?: FormAction;
|
|
18
18
|
defaultMapPreset?: MapPreset;
|
|
19
19
|
onSaveForm?: (formValues: PublicWarningDetail) => void;
|
|
@@ -26,7 +26,7 @@ interface FormProps {
|
|
|
26
26
|
isSnapshot?: boolean;
|
|
27
27
|
onAddObject?: () => void;
|
|
28
28
|
selectedAviationProduct?: AviationProduct;
|
|
29
|
-
|
|
29
|
+
warningType?: WarningType;
|
|
30
30
|
mode?: FormMode;
|
|
31
31
|
}
|
|
32
32
|
export declare const PublicWarningsForm: React.FC<FormProps>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { AviationProduct, FormMode } from '@opengeoweb/sigmet-airmet';
|
|
3
3
|
import { MapPreset } from '@opengeoweb/store';
|
|
4
|
-
|
|
4
|
+
import { WarningType } from '../../store/publicWarningForm/types';
|
|
5
|
+
export interface PublicWarningsFormConnectProps {
|
|
5
6
|
selectedAviationProduct?: AviationProduct;
|
|
6
|
-
|
|
7
|
+
warningType?: WarningType;
|
|
7
8
|
mode?: FormMode;
|
|
8
9
|
defaultMapPreset?: MapPreset;
|
|
9
10
|
}
|
|
10
11
|
export declare const PublicWarningsFormConnect: React.FC<PublicWarningsFormConnectProps>;
|
|
11
|
-
export {};
|
|
@@ -2,6 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { Position, DraggableSize, HeaderSize } from '@opengeoweb/shared';
|
|
3
3
|
import { AviationProduct } from '@opengeoweb/sigmet-airmet';
|
|
4
4
|
import { uiTypes } from '@opengeoweb/store';
|
|
5
|
+
import { WarningType } from '../../store/publicWarningForm/types';
|
|
5
6
|
export declare const PublicWarningsFormDialog: React.FC<{
|
|
6
7
|
bounds?: string;
|
|
7
8
|
title?: string;
|
|
@@ -20,5 +21,5 @@ export declare const PublicWarningsFormDialog: React.FC<{
|
|
|
20
21
|
shouldHideFormMode?: boolean;
|
|
21
22
|
publicWarningEditor?: string;
|
|
22
23
|
selectedAviationProduct?: AviationProduct;
|
|
23
|
-
warningType?:
|
|
24
|
+
warningType?: WarningType;
|
|
24
25
|
}>;
|
|
@@ -2,7 +2,7 @@ import { PayloadAction, Draft } from '@reduxjs/toolkit';
|
|
|
2
2
|
import { AlertColor } from '@mui/material';
|
|
3
3
|
import { snackbarTypes } from '@opengeoweb/snackbar';
|
|
4
4
|
import { DrawingListItem } from '../drawings/types';
|
|
5
|
-
import { Area, PublicWarning } from './types';
|
|
5
|
+
import { Area, PublicWarning, WarningType } from './types';
|
|
6
6
|
export type FormAction = '' | 'saving' | 'publishing' | 'readonly';
|
|
7
7
|
export interface FormError {
|
|
8
8
|
severity?: AlertColor;
|
|
@@ -15,6 +15,7 @@ export interface PublicWarningFormState {
|
|
|
15
15
|
error?: FormError;
|
|
16
16
|
selectedPublicWarningId?: string;
|
|
17
17
|
isFormDirty?: boolean;
|
|
18
|
+
warningType?: WarningType;
|
|
18
19
|
}
|
|
19
20
|
export declare const TAKEOVER_MESSAGE = "You are no longer the editor of this warning";
|
|
20
21
|
export declare const initialState: PublicWarningFormState;
|
|
@@ -35,6 +36,7 @@ export declare const publicWarningFormActions: import("@reduxjs/toolkit").CaseRe
|
|
|
35
36
|
object?: DrawingListItem;
|
|
36
37
|
formState?: FormAction;
|
|
37
38
|
publicWarning?: PublicWarning;
|
|
39
|
+
warningType?: WarningType;
|
|
38
40
|
}>) => void;
|
|
39
41
|
toggleEditorWarning: (draft: Draft<PublicWarningFormState>, action: PayloadAction<{
|
|
40
42
|
warningId: string;
|
|
@@ -51,3 +51,8 @@ export declare const getSelectedPublicIsFormDirty: ((state: WarningModuleStore)
|
|
|
51
51
|
}> & {
|
|
52
52
|
clearCache: () => void;
|
|
53
53
|
};
|
|
54
|
+
export declare const getWarningType: ((state: WarningModuleStore) => import("./types").WarningType | undefined) & import("reselect").OutputSelectorFields<(args_0: PublicWarningFormState) => import("./types").WarningType | undefined, {
|
|
55
|
+
clearCache: () => void;
|
|
56
|
+
}> & {
|
|
57
|
+
clearCache: () => void;
|
|
58
|
+
};
|
|
@@ -3,5 +3,7 @@ import type { PublicWarning } from '../../store/publicWarningForm/types';
|
|
|
3
3
|
declare const drawingList: DrawingListItem[];
|
|
4
4
|
declare const drawingsListFullContent: DrawingFromBE[];
|
|
5
5
|
declare const warningList: PublicWarning[];
|
|
6
|
+
declare const sigmetList: PublicWarning[];
|
|
7
|
+
declare const airmetList: PublicWarning[];
|
|
6
8
|
declare const areaKeywordList: string[];
|
|
7
|
-
export { drawingList, drawingsListFullContent, warningList, areaKeywordList };
|
|
9
|
+
export { drawingList, drawingsListFullContent, warningList, sigmetList, airmetList, areaKeywordList, };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AirmetConfig, AirmetFromBackend, ProductStatus, SigmetConfig, SigmetFromBackend } from '@opengeoweb/api';
|
|
2
2
|
import { AviationProduct } from '@opengeoweb/sigmet-airmet';
|
|
3
3
|
import { PublicWarning, PublicWarningStatus } from '../store/publicWarningForm/types';
|
|
4
4
|
export declare const transformAirmetToWarningFormat: (apiAirmet: AirmetFromBackend) => PublicWarning;
|
|
@@ -7,4 +7,4 @@ export declare const mapProductStatusToWarningStatus: (productStatus?: ProductSt
|
|
|
7
7
|
export declare const transformSigmetToProductFormat: (warning: SigmetFromBackend | undefined, config: SigmetConfig) => AviationProduct;
|
|
8
8
|
export declare const transformAirmetToProductFormat: (warning: AirmetFromBackend | undefined, config: AirmetConfig) => AviationProduct;
|
|
9
9
|
export declare const getEmptySigmetWarning: () => AviationProduct;
|
|
10
|
-
export declare const getEmptyAirmetWarning: () =>
|
|
10
|
+
export declare const getEmptyAirmetWarning: () => AviationProduct;
|