@opengeoweb/warnings 9.18.0 → 9.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default, { useState, useEffect, useRef } from 'react';
|
|
3
3
|
import { useDispatch, useSelector } from 'react-redux';
|
|
4
|
-
import { Polygons, Share, ExitDomain, Edit, Delete, DrawPolygon, Visibility, Add, Wind, Fog, Lightning, Snow, Rain, TemperatureHigh, TemperatureLow, CoastalEvent, breakpoints, Options,
|
|
4
|
+
import { Polygons, Share, ExitDomain, Edit, Delete, DrawPolygon, Visibility, Add, Wind, Fog, Lightning, Snow, Rain, TemperatureHigh, TemperatureLow, CoastalEvent, breakpoints, Options, Copy, Success, Expire, Remove } from '@opengeoweb/theme';
|
|
5
5
|
import { uiTypes, uiActions, getSingularDrawtoolDrawLayerId, drawtoolSelectors, layerSelectors, uiSelectors, mapStoreActions, drawtoolActions, layerActions, useSetupDialog } from '@opengeoweb/store';
|
|
6
6
|
import { defaultPolygon, emptyGeoJSON, MapControlButton, getIcon, rewindGeometry, getGeoJSONPropertyValue, currentlySupportedDrawModes, MapView, MapViewLayer, defaultLayers, getFeatureExtent } from '@opengeoweb/webmap-react';
|
|
7
7
|
import { useConfirmationDialog, ToggleMenu, dateUtils, calculateStartSize, ToolContainerDraggable, AlertBanner, ConfirmationDialog, getAxiosErrorMessage, usePrevious, CustomIconButton, CustomTooltip, Avatar, getInitials, SwitchButton, LastUpdateTime, StatusTag, ErrorBoundary, pollingIntervalTimeout, isAxiosError as isAxiosError$1 } from '@opengeoweb/shared';
|
|
@@ -99,10 +99,6 @@ var en = {
|
|
|
99
99
|
"warning-dialog-delete-title": "Delete warning",
|
|
100
100
|
"warning-dialog-delete-confirm": "Delete",
|
|
101
101
|
"warning-dialog-delete-description": "Are you sure you want to delete this warning?",
|
|
102
|
-
"warning-dialog-ignore-succes": "Warning has been ignored",
|
|
103
|
-
"warning-dialog-ignore-title": "Ignore warning",
|
|
104
|
-
"warning-dialog-ignore-confirm": "Ignore",
|
|
105
|
-
"warning-dialog-ignore-description": "Are you sure you want to ignore this warning?",
|
|
106
102
|
"warning-save-succes": "Public warning has succesfully been saved!",
|
|
107
103
|
"warning-publish-succes": "Public warning has succesfully been published!",
|
|
108
104
|
"warning-editor-user-viewer": "Viewer",
|
|
@@ -111,8 +107,11 @@ var en = {
|
|
|
111
107
|
"warning-editor-remove-editor": "You are now no longer the editor for this warning",
|
|
112
108
|
"warning-list-button_create": "Create a warning",
|
|
113
109
|
"warning-list-button-use": "Use",
|
|
114
|
-
"warning-list-button-ignore": "Ignore",
|
|
115
110
|
"warning-list-button-options": "Options",
|
|
111
|
+
"warning-list-button-duplicate": "Duplicate",
|
|
112
|
+
"warning-list-button-update": "Update",
|
|
113
|
+
"warning-list-button-expire": "Expire",
|
|
114
|
+
"warning-list-button-withdraw": "Withdraw",
|
|
116
115
|
"warning-list-status-draft": "Drafts",
|
|
117
116
|
"warning-list-status-published": "Published",
|
|
118
117
|
"warning-list-status-todo": "Reviews",
|
|
@@ -204,10 +203,6 @@ var nl = {
|
|
|
204
203
|
"warning-dialog-delete-title": "Waarschuwing verwijderen",
|
|
205
204
|
"warning-dialog-delete-confirm": "Verwijderen",
|
|
206
205
|
"warning-dialog-delete-description": "Weet je zeker dat je deze waarschuwing wilt verwijderen?",
|
|
207
|
-
"warning-dialog-ignore-succes": "Waarschuwing is genegeerd",
|
|
208
|
-
"warning-dialog-ignore-title": "Waarschuwing negeren",
|
|
209
|
-
"warning-dialog-ignore-confirm": "Negeren",
|
|
210
|
-
"warning-dialog-ignore-description": "Weet je zeker dat je deze waarschuwing wilt negeren?",
|
|
211
206
|
"warning-save-succes": "Publieke waarschuwing is succesvol opgeslagen!",
|
|
212
207
|
"warning-publish-succes": "Publieke waarschuwing is succesvol gepubliceerd!",
|
|
213
208
|
"warning-editor-add-editor": "Je bent nu de editor van deze waarschuwing",
|
|
@@ -216,8 +211,11 @@ var nl = {
|
|
|
216
211
|
"warning-editor-user-editor": "Editor",
|
|
217
212
|
"warning-list-button_create": "Maak waarschuwing",
|
|
218
213
|
"warning-list-button-use": "Gebruik",
|
|
219
|
-
"warning-list-button-ignore": "Negeer",
|
|
220
214
|
"warning-list-button-options": "Opties",
|
|
215
|
+
"warning-list-button-duplicate": "Dupliceren",
|
|
216
|
+
"warning-list-button-update": "Bijwerken",
|
|
217
|
+
"warning-list-button-expire": "Verlopen",
|
|
218
|
+
"warning-list-button-withdraw": "Intrekken",
|
|
221
219
|
"warning-list-status-draft": "Concepten",
|
|
222
220
|
"warning-list-status-published": "Gepubliceerd",
|
|
223
221
|
"warning-list-status-todo": "Te doen",
|
|
@@ -309,10 +307,6 @@ var fi = {
|
|
|
309
307
|
"warning-dialog-delete-title": "ei käännetty",
|
|
310
308
|
"warning-dialog-delete-confirm": "ei käännetty",
|
|
311
309
|
"warning-dialog-delete-description": "ei käännetty",
|
|
312
|
-
"warning-dialog-ignore-succes": "ei käännetty",
|
|
313
|
-
"warning-dialog-ignore-title": "ei käännetty",
|
|
314
|
-
"warning-dialog-ignore-confirm": "ei käännetty",
|
|
315
|
-
"warning-dialog-ignore-description": "ei käännetty",
|
|
316
310
|
"warning-save-succes": "ei käännetty",
|
|
317
311
|
"warning-publish-succes": "ei käännetty",
|
|
318
312
|
"warning-editor-user-viewer": "ei käännetty",
|
|
@@ -321,8 +315,11 @@ var fi = {
|
|
|
321
315
|
"warning-editor-remove-editor": "ei käännetty",
|
|
322
316
|
"warning-list-button_create": "ei käännetty",
|
|
323
317
|
"warning-list-button-use": "ei käännetty",
|
|
324
|
-
"warning-list-button-ignore": "ei käännetty",
|
|
325
318
|
"warning-list-button-options": "ei käännetty",
|
|
319
|
+
"warning-list-button-duplicate": "ei käännetty",
|
|
320
|
+
"warning-list-button-update": "ei käännetty",
|
|
321
|
+
"warning-list-button-expire": "ei käännetty",
|
|
322
|
+
"warning-list-button-withdraw": "ei käännetty",
|
|
326
323
|
"warning-list-status-draft": "ei käännetty",
|
|
327
324
|
"warning-list-status-published": "ei käännetty",
|
|
328
325
|
"warning-list-status-todo": "ei käännetty",
|
|
@@ -414,10 +411,6 @@ var no = {
|
|
|
414
411
|
"warning-dialog-delete-title": "Slett varsel",
|
|
415
412
|
"warning-dialog-delete-confirm": "Slett",
|
|
416
413
|
"warning-dialog-delete-description": "Er du sikker på at du vil slette varselet?",
|
|
417
|
-
"warning-dialog-ignore-succes": "Varselet er blitt ignorert",
|
|
418
|
-
"warning-dialog-ignore-title": "Ignorer varselet",
|
|
419
|
-
"warning-dialog-ignore-confirm": "Ignorer",
|
|
420
|
-
"warning-dialog-ignore-description": "Er du sikker på at du vil ignorere dette varselet?",
|
|
421
414
|
"warning-save-succes": "Farevarselet er lagret!",
|
|
422
415
|
"warning-publish-succes": "Farevarselet er publisert!",
|
|
423
416
|
"warning-editor-user-viewer": "Visningsmodus",
|
|
@@ -426,8 +419,11 @@ var no = {
|
|
|
426
419
|
"warning-editor-remove-editor": "Du editerer ikke lenger dette varselet",
|
|
427
420
|
"warning-list-button_create": "Lag et farevarsel",
|
|
428
421
|
"warning-list-button-use": "Bruk",
|
|
429
|
-
"warning-list-button-ignore": "Ignorer",
|
|
430
422
|
"warning-list-button-options": "Valg",
|
|
423
|
+
"warning-list-button-duplicate": "Dupliser",
|
|
424
|
+
"warning-list-button-update": "ikke oversatt",
|
|
425
|
+
"warning-list-button-expire": "ikke oversatt",
|
|
426
|
+
"warning-list-button-withdraw": "ikke oversatt",
|
|
431
427
|
"warning-list-status-draft": "Utkast",
|
|
432
428
|
"warning-list-status-published": "Publisert",
|
|
433
429
|
"warning-list-status-todo": "Til sjekk",
|
|
@@ -945,10 +941,10 @@ var SHARED = '__core-js_shared__';
|
|
|
945
941
|
var store$3 = sharedStore.exports = globalThis$1[SHARED] || defineGlobalProperty$2(SHARED, {});
|
|
946
942
|
|
|
947
943
|
(store$3.versions || (store$3.versions = [])).push({
|
|
948
|
-
version: '3.
|
|
944
|
+
version: '3.37.1',
|
|
949
945
|
mode: 'global',
|
|
950
946
|
copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)',
|
|
951
|
-
license: 'https://github.com/zloirock/core-js/blob/v3.
|
|
947
|
+
license: 'https://github.com/zloirock/core-js/blob/v3.37.1/LICENSE',
|
|
952
948
|
source: 'https://github.com/zloirock/core-js'
|
|
953
949
|
});
|
|
954
950
|
|
|
@@ -3376,8 +3372,8 @@ const slice = createSlice({
|
|
|
3376
3372
|
} = action.payload;
|
|
3377
3373
|
if (draft.selectedPublicWarningId) {
|
|
3378
3374
|
const currentWarning = warnings.find(warning => warning.id === draft.selectedPublicWarningId);
|
|
3379
|
-
if (((_a = draft.publicWarning) === null || _a === void 0 ? void 0 : _a.editor) !==
|
|
3380
|
-
draft.publicWarning.editor = currentWarning
|
|
3375
|
+
if (currentWarning && ((_a = draft.publicWarning) === null || _a === void 0 ? void 0 : _a.editor) !== currentWarning.editor) {
|
|
3376
|
+
draft.publicWarning.editor = currentWarning.editor;
|
|
3381
3377
|
// if form is in edit mode show warning
|
|
3382
3378
|
if (draft.formState === '') {
|
|
3383
3379
|
draft.error = {
|
|
@@ -3562,9 +3558,6 @@ const ObjectManagerConnect = ({
|
|
|
3562
3558
|
objectName
|
|
3563
3559
|
});
|
|
3564
3560
|
};
|
|
3565
|
-
if (!isDialogOpen) {
|
|
3566
|
-
return null;
|
|
3567
|
-
}
|
|
3568
3561
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(ObjectManager, {
|
|
3569
3562
|
title: `${t('object-manager-title')} ${mapId}`,
|
|
3570
3563
|
bounds: bounds,
|
|
@@ -4796,7 +4789,8 @@ var warningListJSON = [
|
|
|
4796
4789
|
domain: "public",
|
|
4797
4790
|
warningProposalSource: "PASCAL-ECMWF-EPS",
|
|
4798
4791
|
authority: "KNMI",
|
|
4799
|
-
type: 1
|
|
4792
|
+
type: 1,
|
|
4793
|
+
probability: 30
|
|
4800
4794
|
}
|
|
4801
4795
|
},
|
|
4802
4796
|
{
|
|
@@ -5315,6 +5309,128 @@ var warningListJSON = [
|
|
|
5315
5309
|
type: 1
|
|
5316
5310
|
}
|
|
5317
5311
|
},
|
|
5312
|
+
{
|
|
5313
|
+
id: "f1e8981e-937c-11ee-a1bf-003kmdidki9",
|
|
5314
|
+
lastUpdatedTime: "2024-05-28T09:45:33Z",
|
|
5315
|
+
status: "DRAFT_PUBLISHED",
|
|
5316
|
+
warningDetail: {
|
|
5317
|
+
id: "f1e8981e-937c-11ee-a1bf-003kmdidki9",
|
|
5318
|
+
phenomenon: "wind",
|
|
5319
|
+
geoJSON: {
|
|
5320
|
+
type: "FeatureCollection",
|
|
5321
|
+
features: [
|
|
5322
|
+
{
|
|
5323
|
+
type: "Feature",
|
|
5324
|
+
geometry: {
|
|
5325
|
+
type: "Polygon",
|
|
5326
|
+
coordinates: [
|
|
5327
|
+
[
|
|
5328
|
+
[
|
|
5329
|
+
5.5,
|
|
5330
|
+
52.9
|
|
5331
|
+
],
|
|
5332
|
+
[
|
|
5333
|
+
5.5,
|
|
5334
|
+
53
|
|
5335
|
+
],
|
|
5336
|
+
[
|
|
5337
|
+
5.4,
|
|
5338
|
+
53.1
|
|
5339
|
+
],
|
|
5340
|
+
[
|
|
5341
|
+
5.3,
|
|
5342
|
+
53
|
|
5343
|
+
],
|
|
5344
|
+
[
|
|
5345
|
+
5.3,
|
|
5346
|
+
52.9
|
|
5347
|
+
],
|
|
5348
|
+
[
|
|
5349
|
+
5.4,
|
|
5350
|
+
52.8
|
|
5351
|
+
],
|
|
5352
|
+
[
|
|
5353
|
+
5.5,
|
|
5354
|
+
52.9
|
|
5355
|
+
]
|
|
5356
|
+
]
|
|
5357
|
+
]
|
|
5358
|
+
},
|
|
5359
|
+
properties: {
|
|
5360
|
+
fill: "#fae21e",
|
|
5361
|
+
stroke: "#fae21e",
|
|
5362
|
+
"fill-opacity": 0.2,
|
|
5363
|
+
"stroke-width": 2,
|
|
5364
|
+
selectionType: "poly",
|
|
5365
|
+
warning_level: "1",
|
|
5366
|
+
"stroke-opacity": 1
|
|
5367
|
+
}
|
|
5368
|
+
}
|
|
5369
|
+
]
|
|
5370
|
+
},
|
|
5371
|
+
validFrom: "2024-05-28T09:45:28Z",
|
|
5372
|
+
probability: 30,
|
|
5373
|
+
linked_to_id: "14f7903a-937d-11ee-b619-0ab3cf8a98c1",
|
|
5374
|
+
warning_handle_uuid: "exampleid"
|
|
5375
|
+
}
|
|
5376
|
+
},
|
|
5377
|
+
{
|
|
5378
|
+
id: "550c2b5e-937d-11ee-a1bf-dki2883ke",
|
|
5379
|
+
lastUpdatedTime: "2024-05-27T14:48:20Z",
|
|
5380
|
+
status: "DRAFT_PUBLISHED",
|
|
5381
|
+
editor: "user.name",
|
|
5382
|
+
warningDetail: {
|
|
5383
|
+
id: "550c2b5e-937d-11ee-a1bf-dki2883ke",
|
|
5384
|
+
phenomenon: "lowTemp",
|
|
5385
|
+
geoJSON: {
|
|
5386
|
+
type: "FeatureCollection",
|
|
5387
|
+
features: [
|
|
5388
|
+
{
|
|
5389
|
+
type: "Feature",
|
|
5390
|
+
geometry: {
|
|
5391
|
+
type: "Polygon",
|
|
5392
|
+
coordinates: [
|
|
5393
|
+
[
|
|
5394
|
+
[
|
|
5395
|
+
5.0950448864466225,
|
|
5396
|
+
53.492000941975654
|
|
5397
|
+
],
|
|
5398
|
+
[
|
|
5399
|
+
4.280148780801422,
|
|
5400
|
+
52.46455621916433
|
|
5401
|
+
],
|
|
5402
|
+
[
|
|
5403
|
+
6.878229305858475,
|
|
5404
|
+
52.98133263853793
|
|
5405
|
+
],
|
|
5406
|
+
[
|
|
5407
|
+
5.0950448864466225,
|
|
5408
|
+
53.492000941975654
|
|
5409
|
+
]
|
|
5410
|
+
]
|
|
5411
|
+
]
|
|
5412
|
+
},
|
|
5413
|
+
properties: {
|
|
5414
|
+
fill: "#ff7800",
|
|
5415
|
+
stroke: "#ff7800",
|
|
5416
|
+
"fill-opacity": 0.2,
|
|
5417
|
+
"stroke-width": 2,
|
|
5418
|
+
selectionType: "poly",
|
|
5419
|
+
"stroke-opacity": 1
|
|
5420
|
+
}
|
|
5421
|
+
}
|
|
5422
|
+
]
|
|
5423
|
+
},
|
|
5424
|
+
validFrom: "2024-05-28T14:48:09Z",
|
|
5425
|
+
validUntil: "2024-05-28T18:48:09Z",
|
|
5426
|
+
level: "moderate",
|
|
5427
|
+
probability: 30,
|
|
5428
|
+
descriptionOriginal: "This is the original description",
|
|
5429
|
+
descriptionTranslation: "This is the translation",
|
|
5430
|
+
linked_to_id: "20f54a8a-937d-11ee-b619-0ab3cf8a98c1",
|
|
5431
|
+
warning_handle_uuid: "exampleid"
|
|
5432
|
+
}
|
|
5433
|
+
},
|
|
5318
5434
|
{
|
|
5319
5435
|
id: "550c2b5e-937d-11ee-a1bf-0ab3cf8a98c1",
|
|
5320
5436
|
lastUpdatedTime: "2023-12-05T14:48:20Z",
|
|
@@ -5489,6 +5605,8 @@ var warningListJSON = [
|
|
|
5489
5605
|
lastUpdatedTime: "2023-12-05T14:47:19Z",
|
|
5490
5606
|
status: "PUBLISHED",
|
|
5491
5607
|
warningDetail: {
|
|
5608
|
+
id: "30fe2e4c-937d-11ee-b3d1-0ab3cf8a98c1",
|
|
5609
|
+
warning_handle_uuid: "exampleid",
|
|
5492
5610
|
phenomenon: "snowIce",
|
|
5493
5611
|
geoJSON: {
|
|
5494
5612
|
type: "FeatureCollection",
|
|
@@ -5532,14 +5650,19 @@ var warningListJSON = [
|
|
|
5532
5650
|
validFrom: "2023-12-05T14:47:03Z",
|
|
5533
5651
|
validUntil: "2023-12-18T16:47:03Z",
|
|
5534
5652
|
level: "severe",
|
|
5535
|
-
probability: 70
|
|
5653
|
+
probability: 70,
|
|
5654
|
+
descriptionOriginal: "storm",
|
|
5655
|
+
descriptionTranslation: "storm"
|
|
5536
5656
|
}
|
|
5537
5657
|
},
|
|
5538
5658
|
{
|
|
5539
5659
|
id: "20f54a8a-937d-11ee-b619-0ab3cf8a98c1",
|
|
5540
5660
|
lastUpdatedTime: "2023-12-05T14:46:52Z",
|
|
5541
5661
|
status: "PUBLISHED",
|
|
5662
|
+
editor: "other.user",
|
|
5542
5663
|
warningDetail: {
|
|
5664
|
+
id: "20f54a8a-937d-11ee-b619-0ab3cf8a98c1",
|
|
5665
|
+
warning_handle_uuid: "exampleid",
|
|
5543
5666
|
phenomenon: "lowTemp",
|
|
5544
5667
|
geoJSON: {
|
|
5545
5668
|
type: "FeatureCollection",
|
|
@@ -5583,7 +5706,9 @@ var warningListJSON = [
|
|
|
5583
5706
|
validFrom: "2023-12-05T14:46:39Z",
|
|
5584
5707
|
validUntil: "2023-12-07T20:48:39Z",
|
|
5585
5708
|
level: "moderate",
|
|
5586
|
-
probability: 80
|
|
5709
|
+
probability: 80,
|
|
5710
|
+
descriptionOriginal: "cold",
|
|
5711
|
+
descriptionTranslation: "cold"
|
|
5587
5712
|
}
|
|
5588
5713
|
},
|
|
5589
5714
|
{
|
|
@@ -5591,6 +5716,8 @@ var warningListJSON = [
|
|
|
5591
5716
|
lastUpdatedTime: "2023-12-05T14:46:32Z",
|
|
5592
5717
|
status: "PUBLISHED",
|
|
5593
5718
|
warningDetail: {
|
|
5719
|
+
id: "14f7903a-937d-11ee-b619-0ab3cf8a98c1",
|
|
5720
|
+
warning_handle_uuid: "exampleid",
|
|
5594
5721
|
phenomenon: "wind",
|
|
5595
5722
|
geoJSON: {
|
|
5596
5723
|
type: "FeatureCollection",
|
|
@@ -5634,7 +5761,9 @@ var warningListJSON = [
|
|
|
5634
5761
|
validFrom: "2023-12-06T14:46:19Z",
|
|
5635
5762
|
validUntil: "2023-12-06T20:46:19Z",
|
|
5636
5763
|
level: "severe",
|
|
5637
|
-
probability: 30
|
|
5764
|
+
probability: 30,
|
|
5765
|
+
descriptionOriginal: "windy",
|
|
5766
|
+
descriptionTranslation: "windy"
|
|
5638
5767
|
}
|
|
5639
5768
|
},
|
|
5640
5769
|
{
|
|
@@ -6560,9 +6689,6 @@ const DrawingToolConnect = ({
|
|
|
6560
6689
|
};
|
|
6561
6690
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
6562
6691
|
}, []);
|
|
6563
|
-
if (!isDialogOpen) {
|
|
6564
|
-
return null;
|
|
6565
|
-
}
|
|
6566
6692
|
return /*#__PURE__*/React.createElement(DrawingTool, {
|
|
6567
6693
|
bounds: bounds,
|
|
6568
6694
|
isOpen: isDialogOpen,
|
|
@@ -8498,10 +8624,11 @@ const PublicWarningsFormConnect = ({
|
|
|
8498
8624
|
}));
|
|
8499
8625
|
};
|
|
8500
8626
|
const saveForm = newFormValues => {
|
|
8627
|
+
const status = newFormValues.linked_to_id ? 'DRAFT_PUBLISHED' : 'DRAFT';
|
|
8501
8628
|
dispatch(publicWarningFormActions.saveWarning({
|
|
8502
8629
|
publicWarning: {
|
|
8503
8630
|
warningDetail: newFormValues,
|
|
8504
|
-
status
|
|
8631
|
+
status,
|
|
8505
8632
|
editor: auth === null || auth === void 0 ? void 0 : auth.username
|
|
8506
8633
|
}
|
|
8507
8634
|
}));
|
|
@@ -8634,13 +8761,10 @@ const PublicWarningsFormDialogConnect = ({
|
|
|
8634
8761
|
}
|
|
8635
8762
|
onCloseDialog();
|
|
8636
8763
|
});
|
|
8637
|
-
if (!isDialogOpen) {
|
|
8638
|
-
return null;
|
|
8639
|
-
}
|
|
8640
8764
|
// Readonly also in case you are not creating a new warning and you are not set as the editor
|
|
8641
8765
|
const isReadOnly = formAction === 'readonly' || !isEditor && publicWarningStatus !== undefined;
|
|
8642
8766
|
// Only show toggle if in draft status
|
|
8643
|
-
const shouldHideFormToggleMode = publicWarningStatus !== 'DRAFT';
|
|
8767
|
+
const shouldHideFormToggleMode = publicWarningStatus !== 'DRAFT' && publicWarningStatus !== 'DRAFT_PUBLISHED';
|
|
8644
8768
|
return /*#__PURE__*/React__default.createElement(PublicWarningsFormDialog, {
|
|
8645
8769
|
isOpen: isDialogOpen,
|
|
8646
8770
|
onClose: closeDialog,
|
|
@@ -8661,7 +8785,7 @@ const PublicWarningsFormDialogConnect = ({
|
|
|
8661
8785
|
|
|
8662
8786
|
const sortWarningsOnStatus = warnings => {
|
|
8663
8787
|
return warnings.reduce((allWarnings, warning) => {
|
|
8664
|
-
if (warning.status === 'DRAFT') {
|
|
8788
|
+
if (warning.status === 'DRAFT' || warning.status === 'DRAFT_PUBLISHED') {
|
|
8665
8789
|
return Object.assign(Object.assign({}, allWarnings), {
|
|
8666
8790
|
draft: allWarnings === null || allWarnings === void 0 ? void 0 : allWarnings.draft.concat(warning)
|
|
8667
8791
|
});
|
|
@@ -8689,17 +8813,85 @@ const sortWarningsOnStatus = warnings => {
|
|
|
8689
8813
|
expired: []
|
|
8690
8814
|
});
|
|
8691
8815
|
};
|
|
8692
|
-
const
|
|
8816
|
+
const getWarningWithLinkedToId = warning => {
|
|
8817
|
+
const {
|
|
8818
|
+
id,
|
|
8819
|
+
warningDetail
|
|
8820
|
+
} = warning;
|
|
8821
|
+
const cleanWarningDetail = __rest(warningDetail, ["id"]);
|
|
8822
|
+
return Object.assign(Object.assign({}, warning), {
|
|
8823
|
+
warningDetail: Object.assign(Object.assign({}, cleanWarningDetail), {
|
|
8824
|
+
linked_to_id: id
|
|
8825
|
+
}),
|
|
8826
|
+
status: 'DRAFT_PUBLISHED'
|
|
8827
|
+
});
|
|
8828
|
+
};
|
|
8829
|
+
const getWarningWithProposalId = warning => {
|
|
8693
8830
|
const {
|
|
8694
8831
|
id,
|
|
8695
8832
|
warningDetail
|
|
8696
8833
|
} = warning,
|
|
8697
8834
|
fullWarning = __rest(warning, ["id", "warningDetail"]);
|
|
8698
8835
|
const cleanWarningDetail = __rest(warningDetail, ["id"]);
|
|
8836
|
+
return Object.assign(Object.assign({}, fullWarning), {
|
|
8837
|
+
warningDetail: Object.assign(Object.assign({}, cleanWarningDetail), {
|
|
8838
|
+
proposal_id: id
|
|
8839
|
+
})
|
|
8840
|
+
});
|
|
8841
|
+
};
|
|
8842
|
+
const getWarningWithoutIdStatusEditor = warning => {
|
|
8843
|
+
const {
|
|
8844
|
+
id,
|
|
8845
|
+
warningDetail,
|
|
8846
|
+
status,
|
|
8847
|
+
editor
|
|
8848
|
+
} = warning,
|
|
8849
|
+
fullWarning = __rest(warning, ["id", "warningDetail", "status", "editor"]);
|
|
8850
|
+
const cleanWarningDetail = __rest(warningDetail, ["id", "linked_to_id", "proposal_id", "warning_handle_uuid"]);
|
|
8699
8851
|
return Object.assign(Object.assign({}, fullWarning), {
|
|
8700
8852
|
warningDetail: cleanWarningDetail
|
|
8701
8853
|
});
|
|
8702
8854
|
};
|
|
8855
|
+
const getStatusIcon = warning => {
|
|
8856
|
+
const getStatusTag = (content, color, icon = null) => ( /*#__PURE__*/React__default.createElement(StatusTag, {
|
|
8857
|
+
content: content,
|
|
8858
|
+
color: color,
|
|
8859
|
+
sx: {
|
|
8860
|
+
width: 'inherit',
|
|
8861
|
+
height: '16px',
|
|
8862
|
+
marginRight: 2
|
|
8863
|
+
},
|
|
8864
|
+
icon: icon
|
|
8865
|
+
}));
|
|
8866
|
+
switch (warning.status) {
|
|
8867
|
+
case 'TODO':
|
|
8868
|
+
return null;
|
|
8869
|
+
case 'DRAFT':
|
|
8870
|
+
return /*#__PURE__*/React__default.createElement(Box, {
|
|
8871
|
+
sx: {
|
|
8872
|
+
height: '16px',
|
|
8873
|
+
padding: '0px',
|
|
8874
|
+
display: 'flex',
|
|
8875
|
+
alignItems: 'center',
|
|
8876
|
+
justifyContent: 'center',
|
|
8877
|
+
color: 'geowebColors.iconButtons.flat.default.color'
|
|
8878
|
+
}
|
|
8879
|
+
}, /*#__PURE__*/React__default.createElement(Edit, null));
|
|
8880
|
+
case 'DRAFT_PUBLISHED':
|
|
8881
|
+
return getStatusTag('Pub', 'green', /*#__PURE__*/React__default.createElement(Edit, {
|
|
8882
|
+
sx: {
|
|
8883
|
+
width: 20,
|
|
8884
|
+
height: 20,
|
|
8885
|
+
marginTop: '3px'
|
|
8886
|
+
}
|
|
8887
|
+
}));
|
|
8888
|
+
case 'PUBLISHED':
|
|
8889
|
+
return getStatusTag('Pub', 'green');
|
|
8890
|
+
case 'EXPIRED':
|
|
8891
|
+
default:
|
|
8892
|
+
return getStatusTag('Exp', 'grey');
|
|
8893
|
+
}
|
|
8894
|
+
};
|
|
8703
8895
|
const WarningListHeaderContent = _a => {
|
|
8704
8896
|
var {
|
|
8705
8897
|
title,
|
|
@@ -8768,7 +8960,7 @@ const WarningsOnStatus = ({
|
|
|
8768
8960
|
onSelectWarning: _onSelectWarning = () => {},
|
|
8769
8961
|
onEditWarning: _onEditWarning = () => {},
|
|
8770
8962
|
onDeleteWarning: _onDeleteWarning = () => {},
|
|
8771
|
-
|
|
8963
|
+
onDeleteReviewWarning: _onDeleteReviewWarning = () => {}
|
|
8772
8964
|
}) => {
|
|
8773
8965
|
const {
|
|
8774
8966
|
t
|
|
@@ -8786,37 +8978,55 @@ const WarningsOnStatus = ({
|
|
|
8786
8978
|
}
|
|
8787
8979
|
};
|
|
8788
8980
|
const headerText = `${warnings.length} ${getStatus(status)}`;
|
|
8789
|
-
const onClickWarning = warning => () => _onSelectWarning(warning);
|
|
8790
|
-
const onClickEditWarning = warning => () => _onEditWarning(warning);
|
|
8791
|
-
const onClickDeleteWarning = warningId => () => _onDeleteWarning(warningId);
|
|
8792
|
-
const onClickUseWarning = warning => () => {
|
|
8793
|
-
_onEditWarning(getWarningWithoutId(warning));
|
|
8794
|
-
};
|
|
8795
|
-
const onClickIgnoreWarning = warning => () => _onIgnoreWarning(warning);
|
|
8796
8981
|
const getMenuItems = warning => {
|
|
8797
|
-
|
|
8798
|
-
|
|
8799
|
-
|
|
8800
|
-
|
|
8801
|
-
|
|
8802
|
-
|
|
8803
|
-
|
|
8804
|
-
|
|
8805
|
-
|
|
8806
|
-
|
|
8807
|
-
|
|
8808
|
-
|
|
8809
|
-
|
|
8810
|
-
|
|
8811
|
-
|
|
8812
|
-
|
|
8813
|
-
|
|
8814
|
-
|
|
8815
|
-
|
|
8816
|
-
|
|
8817
|
-
|
|
8818
|
-
|
|
8819
|
-
|
|
8982
|
+
const duplicate = {
|
|
8983
|
+
text: t('warning-list-button-duplicate'),
|
|
8984
|
+
action: () => _onEditWarning(getWarningWithoutIdStatusEditor(warning)),
|
|
8985
|
+
icon: /*#__PURE__*/React__default.createElement(Copy, null)
|
|
8986
|
+
};
|
|
8987
|
+
switch (status) {
|
|
8988
|
+
case 'PUBLISHED':
|
|
8989
|
+
return [{
|
|
8990
|
+
text: t('warning-list-button-update'),
|
|
8991
|
+
action: () => _onEditWarning(getWarningWithLinkedToId(warning)),
|
|
8992
|
+
icon: /*#__PURE__*/React__default.createElement(Edit, null)
|
|
8993
|
+
}, duplicate, {
|
|
8994
|
+
text: t('warning-list-button-expire'),
|
|
8995
|
+
action: () => null,
|
|
8996
|
+
icon: /*#__PURE__*/React__default.createElement(Expire, null),
|
|
8997
|
+
isDisabled: true
|
|
8998
|
+
}, {
|
|
8999
|
+
text: t('warning-list-button-withdraw'),
|
|
9000
|
+
action: () => null,
|
|
9001
|
+
icon: /*#__PURE__*/React__default.createElement(Remove, null),
|
|
9002
|
+
isDisabled: true
|
|
9003
|
+
}];
|
|
9004
|
+
case 'EXPIRED':
|
|
9005
|
+
return [duplicate];
|
|
9006
|
+
case 'DRAFT':
|
|
9007
|
+
case 'DRAFT_PUBLISHED':
|
|
9008
|
+
return [{
|
|
9009
|
+
text: t('object-manager-button-edit'),
|
|
9010
|
+
action: () => _onEditWarning(warning),
|
|
9011
|
+
icon: /*#__PURE__*/React__default.createElement(Edit, null)
|
|
9012
|
+
}, duplicate, {
|
|
9013
|
+
text: t('object-manager-button-delete'),
|
|
9014
|
+
action: () => _onDeleteWarning(warning.id),
|
|
9015
|
+
icon: /*#__PURE__*/React__default.createElement(Delete, null)
|
|
9016
|
+
}];
|
|
9017
|
+
case 'TODO':
|
|
9018
|
+
return [{
|
|
9019
|
+
text: t('warning-list-button-use'),
|
|
9020
|
+
action: () => _onEditWarning(getWarningWithProposalId(warning)),
|
|
9021
|
+
icon: /*#__PURE__*/React__default.createElement(Success, null)
|
|
9022
|
+
}, {
|
|
9023
|
+
text: t('object-manager-button-delete'),
|
|
9024
|
+
action: () => _onDeleteReviewWarning(warning),
|
|
9025
|
+
icon: /*#__PURE__*/React__default.createElement(Delete, null)
|
|
9026
|
+
}];
|
|
9027
|
+
default:
|
|
9028
|
+
return [];
|
|
9029
|
+
}
|
|
8820
9030
|
};
|
|
8821
9031
|
return /*#__PURE__*/React__default.createElement(Box, {
|
|
8822
9032
|
sx: {
|
|
@@ -8845,18 +9055,14 @@ const WarningsOnStatus = ({
|
|
|
8845
9055
|
borderWidth: activeWarningId === warning.id ? '1px' : '1px',
|
|
8846
9056
|
borderStyle: 'solid'
|
|
8847
9057
|
},
|
|
8848
|
-
secondaryAction:
|
|
9058
|
+
secondaryAction: /*#__PURE__*/React__default.createElement(ToggleMenu, {
|
|
8849
9059
|
menuTitle: t('warning-list-button-options'),
|
|
8850
9060
|
tooltipTitle: t('warning-list-button-options'),
|
|
8851
9061
|
menuPosition: "bottom",
|
|
8852
9062
|
"aria-label": t('warning-list-button-options'),
|
|
8853
9063
|
menuItems: getMenuItems(warning),
|
|
8854
9064
|
buttonIcon: /*#__PURE__*/React__default.createElement(Options, null)
|
|
8855
|
-
})
|
|
8856
|
-
sx: {
|
|
8857
|
-
width: 24
|
|
8858
|
-
}
|
|
8859
|
-
}))
|
|
9065
|
+
})
|
|
8860
9066
|
}, /*#__PURE__*/React__default.createElement(ListItemButton, {
|
|
8861
9067
|
sx: {
|
|
8862
9068
|
height: '100%',
|
|
@@ -8870,7 +9076,7 @@ const WarningsOnStatus = ({
|
|
|
8870
9076
|
}
|
|
8871
9077
|
}
|
|
8872
9078
|
},
|
|
8873
|
-
onClick:
|
|
9079
|
+
onClick: () => _onSelectWarning(warning),
|
|
8874
9080
|
"aria-label": `warning item for ${warning.id}`,
|
|
8875
9081
|
selected: activeWarningId === warning.id
|
|
8876
9082
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
@@ -8930,38 +9136,20 @@ const WarningsOnStatus = ({
|
|
|
8930
9136
|
title: t('warning-list-header-status'),
|
|
8931
9137
|
status: status,
|
|
8932
9138
|
width: 96
|
|
8933
|
-
},
|
|
9139
|
+
}, /*#__PURE__*/React__default.createElement(Box, {
|
|
8934
9140
|
sx: {
|
|
8935
|
-
position: 'relative'
|
|
8936
|
-
right: 12
|
|
9141
|
+
position: 'relative'
|
|
8937
9142
|
}
|
|
8938
|
-
}, warning.editor && ( /*#__PURE__*/React__default.createElement(Box, {
|
|
9143
|
+
}, getStatusIcon(warning), warning.editor && ( /*#__PURE__*/React__default.createElement(Box, {
|
|
8939
9144
|
sx: {
|
|
8940
9145
|
width: '16px',
|
|
8941
9146
|
position: 'absolute',
|
|
8942
9147
|
top: '1px',
|
|
8943
|
-
right: '-
|
|
9148
|
+
right: '-12px'
|
|
8944
9149
|
}
|
|
8945
9150
|
}, /*#__PURE__*/React__default.createElement(WarningAvatar, {
|
|
8946
9151
|
editor: warning.editor
|
|
8947
|
-
})))
|
|
8948
|
-
sx: {
|
|
8949
|
-
height: '16px',
|
|
8950
|
-
padding: '0px',
|
|
8951
|
-
'& .MuiSvgIcon-root': {
|
|
8952
|
-
marginRight: '-2px'
|
|
8953
|
-
}
|
|
8954
|
-
},
|
|
8955
|
-
variant: "flat",
|
|
8956
|
-
startIcon: /*#__PURE__*/React__default.createElement(Edit, null)
|
|
8957
|
-
}, t('warning-list-header-draft')))) : ( /*#__PURE__*/React__default.createElement(StatusTag, {
|
|
8958
|
-
content: status.toLowerCase(),
|
|
8959
|
-
color: status === 'EXPIRED' ? 'grey' : 'green',
|
|
8960
|
-
sx: {
|
|
8961
|
-
width: 66,
|
|
8962
|
-
height: '16px'
|
|
8963
|
-
}
|
|
8964
|
-
}))))));
|
|
9152
|
+
}))))))));
|
|
8965
9153
|
}))));
|
|
8966
9154
|
};
|
|
8967
9155
|
const PublicWarningList = ({
|
|
@@ -8975,7 +9163,7 @@ const PublicWarningList = ({
|
|
|
8975
9163
|
onCreateWarning: _onCreateWarning = () => {},
|
|
8976
9164
|
onDeleteWarning: _onDeleteWarning2 = () => {},
|
|
8977
9165
|
onRefetchWarnings: _onRefetchWarnings = () => {},
|
|
8978
|
-
|
|
9166
|
+
onDeleteReviewWarning: _onDeleteReviewWarning2 = () => {}
|
|
8979
9167
|
}) => {
|
|
8980
9168
|
const {
|
|
8981
9169
|
t
|
|
@@ -9069,7 +9257,7 @@ const PublicWarningList = ({
|
|
|
9069
9257
|
onSelectWarning: _onSelectWarning2,
|
|
9070
9258
|
onEditWarning: _onEditWarning2,
|
|
9071
9259
|
onDeleteWarning: _onDeleteWarning2,
|
|
9072
|
-
|
|
9260
|
+
onDeleteReviewWarning: _onDeleteReviewWarning2,
|
|
9073
9261
|
activeWarningId: _selectedPublicWarningId
|
|
9074
9262
|
}), /*#__PURE__*/React__default.createElement(WarningsOnStatus, {
|
|
9075
9263
|
status: "DRAFT",
|
|
@@ -9077,7 +9265,7 @@ const PublicWarningList = ({
|
|
|
9077
9265
|
onSelectWarning: _onSelectWarning2,
|
|
9078
9266
|
onEditWarning: _onEditWarning2,
|
|
9079
9267
|
onDeleteWarning: _onDeleteWarning2,
|
|
9080
|
-
|
|
9268
|
+
onDeleteReviewWarning: _onDeleteReviewWarning2,
|
|
9081
9269
|
activeWarningId: _selectedPublicWarningId
|
|
9082
9270
|
}), /*#__PURE__*/React__default.createElement(WarningsOnStatus, {
|
|
9083
9271
|
status: "PUBLISHED",
|
|
@@ -9085,7 +9273,7 @@ const PublicWarningList = ({
|
|
|
9085
9273
|
onSelectWarning: _onSelectWarning2,
|
|
9086
9274
|
onEditWarning: _onEditWarning2,
|
|
9087
9275
|
onDeleteWarning: _onDeleteWarning2,
|
|
9088
|
-
|
|
9276
|
+
onDeleteReviewWarning: _onDeleteReviewWarning2,
|
|
9089
9277
|
activeWarningId: _selectedPublicWarningId
|
|
9090
9278
|
}), /*#__PURE__*/React__default.createElement(WarningsOnStatus, {
|
|
9091
9279
|
status: "EXPIRED",
|
|
@@ -9093,7 +9281,7 @@ const PublicWarningList = ({
|
|
|
9093
9281
|
onSelectWarning: _onSelectWarning2,
|
|
9094
9282
|
onEditWarning: _onEditWarning2,
|
|
9095
9283
|
onDeleteWarning: _onDeleteWarning2,
|
|
9096
|
-
|
|
9284
|
+
onDeleteReviewWarning: _onDeleteReviewWarning2,
|
|
9097
9285
|
activeWarningId: _selectedPublicWarningId
|
|
9098
9286
|
}))));
|
|
9099
9287
|
};
|
|
@@ -9301,16 +9489,16 @@ const PublicWarningListConnect = () => {
|
|
|
9301
9489
|
callback: () => onRemoveSuccess(warningId, t('warning-dialog-delete-succes'))
|
|
9302
9490
|
});
|
|
9303
9491
|
};
|
|
9304
|
-
const
|
|
9492
|
+
const deleteReviewWarning = warning => {
|
|
9305
9493
|
const ignoredWarning = Object.assign(Object.assign({}, warning), {
|
|
9306
9494
|
status: 'IGNORED'
|
|
9307
9495
|
});
|
|
9308
9496
|
setConfirmDialogOptions({
|
|
9309
|
-
confirmLabel: t('warning-dialog-
|
|
9310
|
-
title: t('warning-dialog-
|
|
9311
|
-
description: t('warning-dialog-
|
|
9497
|
+
confirmLabel: t('warning-dialog-delete-confirm'),
|
|
9498
|
+
title: t('warning-dialog-delete-title'),
|
|
9499
|
+
description: t('warning-dialog-delete-description'),
|
|
9312
9500
|
request: () => warningsApi.updateWarning(ignoredWarning.id, ignoredWarning),
|
|
9313
|
-
callback: () => onRemoveSuccess(ignoredWarning.id, t('warning-dialog-
|
|
9501
|
+
callback: () => onRemoveSuccess(ignoredWarning.id, t('warning-dialog-delete-succes'))
|
|
9314
9502
|
});
|
|
9315
9503
|
};
|
|
9316
9504
|
const onRemoveSuccess = (warningId, snackbarMessage) => {
|
|
@@ -9341,7 +9529,7 @@ const PublicWarningListConnect = () => {
|
|
|
9341
9529
|
onCreateWarning: createWarning,
|
|
9342
9530
|
onEditWarning: editWarning,
|
|
9343
9531
|
onDeleteWarning: deleteWarning,
|
|
9344
|
-
|
|
9532
|
+
onDeleteReviewWarning: deleteReviewWarning,
|
|
9345
9533
|
selectedPublicWarningId: selectedPublicWarningId,
|
|
9346
9534
|
lastUpdatedTime: lastUpdatedTime,
|
|
9347
9535
|
onRefetchWarnings: fetchWarnings
|
package/package.json
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { GridProps } from '@mui/material';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { PublicWarning, PublicWarningStatus } from '../../store/publicWarningForm/types';
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const getWarningWithLinkedToId: (warning: PublicWarning) => PublicWarning;
|
|
5
|
+
export declare const getWarningWithProposalId: (warning: PublicWarning) => PublicWarning;
|
|
6
|
+
export declare const getWarningWithoutIdStatusEditor: (warning: PublicWarning) => PublicWarning;
|
|
5
7
|
export declare const WarningListColumnContent: React.FC<GridProps & {
|
|
6
8
|
title?: string;
|
|
7
9
|
status: PublicWarningStatus;
|
|
@@ -13,7 +15,7 @@ interface WarningStatusProps {
|
|
|
13
15
|
onSelectWarning?: (warning: PublicWarning) => void;
|
|
14
16
|
onEditWarning?: (warning: PublicWarning) => void;
|
|
15
17
|
onDeleteWarning?: (warningId: string) => void;
|
|
16
|
-
|
|
18
|
+
onDeleteReviewWarning?: (warning: PublicWarning) => void;
|
|
17
19
|
}
|
|
18
20
|
export declare const PublicWarningList: React.FC<{
|
|
19
21
|
isLoading?: boolean;
|
|
@@ -12,8 +12,11 @@ export interface PublicWarningDetail {
|
|
|
12
12
|
warningProposalSource?: string;
|
|
13
13
|
authority?: string;
|
|
14
14
|
type?: number;
|
|
15
|
+
warning_handle_uuid?: string;
|
|
16
|
+
proposal_id?: string;
|
|
17
|
+
linked_to_id?: string;
|
|
15
18
|
}
|
|
16
|
-
export type PublicWarningStatus = 'DRAFT' | 'PUBLISHED' | 'TODO' | 'EXPIRED' | 'IGNORED';
|
|
19
|
+
export type PublicWarningStatus = 'DRAFT' | 'DRAFT_PUBLISHED' | 'PUBLISHED' | 'TODO' | 'EXPIRED' | 'IGNORED';
|
|
17
20
|
export interface PublicWarning {
|
|
18
21
|
status?: PublicWarningStatus;
|
|
19
22
|
editor?: string;
|