@opengeoweb/warnings 9.19.0 → 9.20.1

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,5 +1,4 @@
1
- import * as React from 'react';
2
- import React__default, { useState, useEffect, useRef } from 'react';
1
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
2
  import { useDispatch, useSelector } from 'react-redux';
4
3
  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
4
  import { uiTypes, uiActions, getSingularDrawtoolDrawLayerId, drawtoolSelectors, layerSelectors, uiSelectors, mapStoreActions, drawtoolActions, layerActions, useSetupDialog } from '@opengeoweb/store';
@@ -10,6 +9,8 @@ import i18n from 'i18next';
10
9
  import { useTranslation } from 'react-i18next';
11
10
  import { defaultBbox } from '@opengeoweb/core';
12
11
  import { snackbarActions } from '@opengeoweb/snackbar';
12
+ import * as React from 'react';
13
+ import React__default, { useState, useEffect, useRef } from 'react';
13
14
  import { styled, Box, Typography, ListItem, Grid, Paper, ListItemButton, Stack, LinearProgress, Button, FormHelperText, MenuItem, Tabs, Tab, FormControl, Card, CardContent, ListItemIcon, CircularProgress, List } from '@mui/material';
14
15
  import { VariableSizeList } from 'react-window';
15
16
  import AutoSizer from 'react-virtualized-auto-sizer';
@@ -99,6 +100,7 @@ var en = {
99
100
  "warning-dialog-delete-title": "Delete warning",
100
101
  "warning-dialog-delete-confirm": "Delete",
101
102
  "warning-dialog-delete-description": "Are you sure you want to delete this warning?",
103
+ "warning-dialog-delete-islocked": "This warning is in edit mode by another user.",
102
104
  "warning-save-succes": "Public warning has succesfully been saved!",
103
105
  "warning-publish-succes": "Public warning has succesfully been published!",
104
106
  "warning-editor-user-viewer": "Viewer",
@@ -203,6 +205,7 @@ var nl = {
203
205
  "warning-dialog-delete-title": "Waarschuwing verwijderen",
204
206
  "warning-dialog-delete-confirm": "Verwijderen",
205
207
  "warning-dialog-delete-description": "Weet je zeker dat je deze waarschuwing wilt verwijderen?",
208
+ "warning-dialog-delete-islocked": "Deze waarschwing wordt bewerkt door een andere gebruiker.",
206
209
  "warning-save-succes": "Publieke waarschuwing is succesvol opgeslagen!",
207
210
  "warning-publish-succes": "Publieke waarschuwing is succesvol gepubliceerd!",
208
211
  "warning-editor-add-editor": "Je bent nu de editor van deze waarschuwing",
@@ -307,6 +310,7 @@ var fi = {
307
310
  "warning-dialog-delete-title": "ei käännetty",
308
311
  "warning-dialog-delete-confirm": "ei käännetty",
309
312
  "warning-dialog-delete-description": "ei käännetty",
313
+ "warning-dialog-delete-islocked": "ei käännetty",
310
314
  "warning-save-succes": "ei käännetty",
311
315
  "warning-publish-succes": "ei käännetty",
312
316
  "warning-editor-user-viewer": "ei käännetty",
@@ -411,6 +415,7 @@ var no = {
411
415
  "warning-dialog-delete-title": "Slett varsel",
412
416
  "warning-dialog-delete-confirm": "Slett",
413
417
  "warning-dialog-delete-description": "Er du sikker på at du vil slette varselet?",
418
+ "warning-dialog-delete-islocked": "Ikke oversatt",
414
419
  "warning-save-succes": "Farevarselet er lagret!",
415
420
  "warning-publish-succes": "Farevarselet er publisert!",
416
421
  "warning-editor-user-viewer": "Visningsmodus",
@@ -445,190 +450,6 @@ var warningsTranslations = {
445
450
  no: no
446
451
  };
447
452
 
448
- /******************************************************************************
449
- Copyright (c) Microsoft Corporation.
450
-
451
- Permission to use, copy, modify, and/or distribute this software for any
452
- purpose with or without fee is hereby granted.
453
-
454
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
455
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
456
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
457
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
458
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
459
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
460
- PERFORMANCE OF THIS SOFTWARE.
461
- ***************************************************************************** */
462
-
463
- function __rest(s, e) {
464
- var t = {};
465
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
466
- t[p] = s[p];
467
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
468
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
469
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
470
- t[p[i]] = s[p[i]];
471
- }
472
- return t;
473
- }
474
-
475
- function __awaiter(thisArg, _arguments, P, generator) {
476
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
477
- return new (P || (P = Promise))(function (resolve, reject) {
478
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
479
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
480
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
481
- step((generator = generator.apply(thisArg, _arguments || [])).next());
482
- });
483
- }
484
-
485
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
486
- var e = new Error(message);
487
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
488
- };
489
-
490
- /* *
491
- * Licensed under the Apache License, Version 2.0 (the "License");
492
- * you may not use this file except in compliance with the License.
493
- * You may obtain a copy of the License at
494
- *
495
- * http://www.apache.org/licenses/LICENSE-2.0
496
- *
497
- * Unless required by applicable law or agreed to in writing, software
498
- * distributed under the License is distributed on an "AS IS" BASIS,
499
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
500
- * See the License for the specific language governing permissions and
501
- * limitations under the License.
502
- *
503
- * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
504
- * Copyright 2023 - Finnish Meteorological Institute (FMI)
505
- * */
506
- const objectDialogType = uiTypes.DialogTypes.ObjectManager;
507
- const drawingDialogType = uiTypes.DialogTypes.DrawingTool;
508
-
509
- /* *
510
- * Licensed under the Apache License, Version 2.0 (the "License");
511
- * you may not use this file except in compliance with the License.
512
- * You may obtain a copy of the License at
513
- *
514
- * http://www.apache.org/licenses/LICENSE-2.0
515
- *
516
- * Unless required by applicable law or agreed to in writing, software
517
- * distributed under the License is distributed on an "AS IS" BASIS,
518
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
519
- * See the License for the specific language governing permissions and
520
- * limitations under the License.
521
- *
522
- * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
523
- * Copyright 2023 - Finnish Meteorological Institute (FMI)
524
- * */
525
- const drawAdapter = createEntityAdapter({
526
- selectId: draw => draw.drawingInstanceId
527
- });
528
- const initialState$2 = drawAdapter.getInitialState();
529
- const slice$2 = createSlice({
530
- initialState: initialState$2,
531
- name: 'drawingForm',
532
- reducers: {
533
- setDrawValues: (draft, action) => {
534
- if (draft.entities[action.payload.drawingInstanceId]) {
535
- drawAdapter.setOne(draft, action.payload);
536
- }
537
- },
538
- // action caught in drawings/listener
539
- submitDrawValues: (
540
- // eslint-disable-next-line no-unused-vars
541
- draft,
542
- // eslint-disable-next-line no-unused-vars
543
- action) => {},
544
- setFormDirty: (draft, action) => {
545
- const {
546
- drawingInstanceId,
547
- isFormDirty
548
- } = action.payload;
549
- if (draft.entities[drawingInstanceId]) {
550
- drawAdapter.updateOne(draft, {
551
- id: drawingInstanceId,
552
- changes: {
553
- isFormDirty
554
- }
555
- });
556
- }
557
- }
558
- },
559
- extraReducers: builder => {
560
- builder
561
- // register draw dialog
562
- .addCase(uiActions.registerDialog, (draft, action) => {
563
- const {
564
- type
565
- } = action.payload;
566
- if (type === drawingDialogType) {
567
- drawAdapter.addOne(draft, {
568
- drawingInstanceId: type,
569
- objectName: '',
570
- id: ''
571
- });
572
- }
573
- })
574
- // unregister draw dialog
575
- .addCase(uiActions.unregisterDialog, (draft, action) => {
576
- const {
577
- type
578
- } = action.payload;
579
- if (type === drawingDialogType) {
580
- drawAdapter.removeOne(draft, type);
581
- }
582
- })
583
- // reset draw dialog formDirty when dialog closes
584
- .addCase(uiActions.setActiveMapIdForDialog, (draft, action) => {
585
- const {
586
- type,
587
- setOpen
588
- } = action.payload;
589
- if (type === drawingDialogType && !setOpen) {
590
- drawAdapter.updateOne(draft, {
591
- id: type,
592
- changes: {
593
- isFormDirty: false
594
- }
595
- });
596
- }
597
- });
598
- }
599
- });
600
- const {
601
- reducer: reducer$2
602
- } = slice$2;
603
- const drawActions = slice$2.actions;
604
-
605
- /* *
606
- * Licensed under the Apache License, Version 2.0 (the "License");
607
- * you may not use this file except in compliance with the License.
608
- * You may obtain a copy of the License at
609
- *
610
- * http://www.apache.org/licenses/LICENSE-2.0
611
- *
612
- * Unless required by applicable law or agreed to in writing, software
613
- * distributed under the License is distributed on an "AS IS" BASIS,
614
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
615
- * See the License for the specific language governing permissions and
616
- * limitations under the License.
617
- *
618
- * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
619
- * Copyright 2023 - Finnish Meteorological Institute (FMI)
620
- * */
621
- const {
622
- selectById: selectDrawByInstanceId
623
- } = drawAdapter.getSelectors(state => {
624
- var _a;
625
- return (_a = state === null || state === void 0 ? void 0 : state.drawings) !== null && _a !== void 0 ? _a : {
626
- entities: {},
627
- ids: []
628
- };
629
- });
630
- const getWarningFormDirty = createSelector(selectDrawByInstanceId, drawing => (drawing === null || drawing === void 0 ? void 0 : drawing.isFormDirty) || false);
631
-
632
453
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
633
454
 
634
455
  var check = function (it) {
@@ -948,7 +769,9 @@ var store$3 = sharedStore.exports = globalThis$1[SHARED] || defineGlobalProperty
948
769
  source: 'https://github.com/zloirock/core-js'
949
770
  });
950
771
 
951
- var store$2 = sharedStore.exports;
772
+ var sharedStoreExports = sharedStore.exports;
773
+
774
+ var store$2 = sharedStoreExports;
952
775
 
953
776
  var shared$4 = function (key, value) {
954
777
  return store$2[key] || (store$2[key] = value || {});
@@ -1190,7 +1013,7 @@ var functionName = {
1190
1013
 
1191
1014
  var uncurryThis$d = functionUncurryThis;
1192
1015
  var isCallable$c = isCallable$i;
1193
- var store$1 = sharedStore.exports;
1016
+ var store$1 = sharedStoreExports;
1194
1017
 
1195
1018
  var functionToString = uncurryThis$d(Function.toString);
1196
1019
 
@@ -1226,7 +1049,7 @@ var global$a = global$i;
1226
1049
  var isObject$5 = isObject$a;
1227
1050
  var createNonEnumerableProperty$7 = createNonEnumerableProperty$8;
1228
1051
  var hasOwn$7 = hasOwnProperty_1;
1229
- var shared$1 = sharedStore.exports;
1052
+ var shared$1 = sharedStoreExports;
1230
1053
  var sharedKey$2 = sharedKey$3;
1231
1054
  var hiddenKeys$3 = hiddenKeys$4;
1232
1055
 
@@ -1347,9 +1170,11 @@ Function.prototype.toString = makeBuiltIn$2(function toString() {
1347
1170
  return isCallable$a(this) && getInternalState$2(this).source || inspectSource$1(this);
1348
1171
  }, 'toString');
1349
1172
 
1173
+ var makeBuiltInExports = makeBuiltIn$3.exports;
1174
+
1350
1175
  var isCallable$9 = isCallable$i;
1351
1176
  var definePropertyModule$2 = objectDefineProperty;
1352
- var makeBuiltIn$1 = makeBuiltIn$3.exports;
1177
+ var makeBuiltIn$1 = makeBuiltInExports;
1353
1178
  var defineGlobalProperty$1 = defineGlobalProperty$3;
1354
1179
 
1355
1180
  var defineBuiltIn$4 = function (O, key, value, options) {
@@ -1700,11 +1525,49 @@ $$7({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }
1700
1525
  assign: assign
1701
1526
  });
1702
1527
 
1703
- const WARN_NAMESPACE = 'warn';
1704
- const translateKeyOutsideComponents = (key, params = undefined) => i18n.t(key, Object.assign({
1705
- ns: [WARN_NAMESPACE]
1706
- }, params));
1707
- const useWarningsTranslation = () => useTranslation(WARN_NAMESPACE);
1528
+ /******************************************************************************
1529
+ Copyright (c) Microsoft Corporation.
1530
+
1531
+ Permission to use, copy, modify, and/or distribute this software for any
1532
+ purpose with or without fee is hereby granted.
1533
+
1534
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
1535
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
1536
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
1537
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
1538
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1539
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1540
+ PERFORMANCE OF THIS SOFTWARE.
1541
+ ***************************************************************************** */
1542
+ /* global Reflect, Promise, SuppressedError, Symbol */
1543
+
1544
+
1545
+ function __rest(s, e) {
1546
+ var t = {};
1547
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
1548
+ t[p] = s[p];
1549
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
1550
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1551
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
1552
+ t[p[i]] = s[p[i]];
1553
+ }
1554
+ return t;
1555
+ }
1556
+
1557
+ function __awaiter(thisArg, _arguments, P, generator) {
1558
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1559
+ return new (P || (P = Promise))(function (resolve, reject) {
1560
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
1561
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
1562
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
1563
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
1564
+ });
1565
+ }
1566
+
1567
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
1568
+ var e = new Error(message);
1569
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
1570
+ };
1708
1571
 
1709
1572
  /* *
1710
1573
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1722,25 +1585,173 @@ const useWarningsTranslation = () => useTranslation(WARN_NAMESPACE);
1722
1585
  * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1723
1586
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
1724
1587
  * */
1725
- const confirmationDialogOptions = t => {
1726
- return {
1727
- cancelLabel: t('close-dialog-cancel'),
1728
- title: t('close-draw-dialog-title'),
1729
- description: t('close-dialog-description'),
1730
- confirmLabel: t('close-dialog-confirm'),
1731
- catchOnCancel: true
1732
- };
1733
- };
1734
- const useCloseDrawDialog = ({
1735
- mapId,
1736
- source
1737
- }) => {
1738
- const {
1739
- t
1740
- } = useWarningsTranslation();
1741
- const dispatch = useDispatch();
1742
- const drawLayerId = getSingularDrawtoolDrawLayerId(mapId);
1743
- const drawDialogActiveDrawModeId = useSelector(store => drawtoolSelectors.getActiveDrawModeId(store, drawingDialogType));
1588
+ const objectDialogType = uiTypes.DialogTypes.ObjectManager;
1589
+ const drawingDialogType = uiTypes.DialogTypes.DrawingTool;
1590
+
1591
+ /* *
1592
+ * Licensed under the Apache License, Version 2.0 (the "License");
1593
+ * you may not use this file except in compliance with the License.
1594
+ * You may obtain a copy of the License at
1595
+ *
1596
+ * http://www.apache.org/licenses/LICENSE-2.0
1597
+ *
1598
+ * Unless required by applicable law or agreed to in writing, software
1599
+ * distributed under the License is distributed on an "AS IS" BASIS,
1600
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1601
+ * See the License for the specific language governing permissions and
1602
+ * limitations under the License.
1603
+ *
1604
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1605
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
1606
+ * */
1607
+ const drawAdapter = createEntityAdapter({
1608
+ selectId: draw => draw.drawingInstanceId
1609
+ });
1610
+ const initialState$2 = drawAdapter.getInitialState();
1611
+ const slice$2 = createSlice({
1612
+ initialState: initialState$2,
1613
+ name: 'drawingForm',
1614
+ reducers: {
1615
+ setDrawValues: (draft, action) => {
1616
+ if (draft.entities[action.payload.drawingInstanceId]) {
1617
+ drawAdapter.setOne(draft, action.payload);
1618
+ }
1619
+ },
1620
+ // action caught in drawings/listener
1621
+ submitDrawValues: (
1622
+ // eslint-disable-next-line no-unused-vars
1623
+ draft,
1624
+ // eslint-disable-next-line no-unused-vars
1625
+ action) => {},
1626
+ setFormDirty: (draft, action) => {
1627
+ const {
1628
+ drawingInstanceId,
1629
+ isFormDirty
1630
+ } = action.payload;
1631
+ if (draft.entities[drawingInstanceId]) {
1632
+ drawAdapter.updateOne(draft, {
1633
+ id: drawingInstanceId,
1634
+ changes: {
1635
+ isFormDirty
1636
+ }
1637
+ });
1638
+ }
1639
+ }
1640
+ },
1641
+ extraReducers: builder => {
1642
+ builder
1643
+ // register draw dialog
1644
+ .addCase(uiActions.registerDialog, (draft, action) => {
1645
+ const {
1646
+ type
1647
+ } = action.payload;
1648
+ if (type === drawingDialogType) {
1649
+ drawAdapter.addOne(draft, {
1650
+ drawingInstanceId: type,
1651
+ objectName: '',
1652
+ id: ''
1653
+ });
1654
+ }
1655
+ })
1656
+ // unregister draw dialog
1657
+ .addCase(uiActions.unregisterDialog, (draft, action) => {
1658
+ const {
1659
+ type
1660
+ } = action.payload;
1661
+ if (type === drawingDialogType) {
1662
+ drawAdapter.removeOne(draft, type);
1663
+ }
1664
+ })
1665
+ // reset draw dialog formDirty when dialog closes
1666
+ .addCase(uiActions.setActiveMapIdForDialog, (draft, action) => {
1667
+ const {
1668
+ type,
1669
+ setOpen
1670
+ } = action.payload;
1671
+ if (type === drawingDialogType && !setOpen) {
1672
+ drawAdapter.updateOne(draft, {
1673
+ id: type,
1674
+ changes: {
1675
+ isFormDirty: false
1676
+ }
1677
+ });
1678
+ }
1679
+ });
1680
+ }
1681
+ });
1682
+ const {
1683
+ reducer: reducer$2
1684
+ } = slice$2;
1685
+ const drawActions = slice$2.actions;
1686
+
1687
+ /* *
1688
+ * Licensed under the Apache License, Version 2.0 (the "License");
1689
+ * you may not use this file except in compliance with the License.
1690
+ * You may obtain a copy of the License at
1691
+ *
1692
+ * http://www.apache.org/licenses/LICENSE-2.0
1693
+ *
1694
+ * Unless required by applicable law or agreed to in writing, software
1695
+ * distributed under the License is distributed on an "AS IS" BASIS,
1696
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1697
+ * See the License for the specific language governing permissions and
1698
+ * limitations under the License.
1699
+ *
1700
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1701
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
1702
+ * */
1703
+ const {
1704
+ selectById: selectDrawByInstanceId
1705
+ } = drawAdapter.getSelectors(state => {
1706
+ var _a;
1707
+ return (_a = state === null || state === void 0 ? void 0 : state.drawings) !== null && _a !== void 0 ? _a : {
1708
+ entities: {},
1709
+ ids: []
1710
+ };
1711
+ });
1712
+ const getWarningFormDirty = createSelector(selectDrawByInstanceId, drawing => (drawing === null || drawing === void 0 ? void 0 : drawing.isFormDirty) || false);
1713
+
1714
+ const WARN_NAMESPACE = 'warn';
1715
+ const translateKeyOutsideComponents = (key, params = undefined) => i18n.t(key, Object.assign({
1716
+ ns: [WARN_NAMESPACE]
1717
+ }, params));
1718
+ const useWarningsTranslation = () => useTranslation(WARN_NAMESPACE);
1719
+
1720
+ /* *
1721
+ * Licensed under the Apache License, Version 2.0 (the "License");
1722
+ * you may not use this file except in compliance with the License.
1723
+ * You may obtain a copy of the License at
1724
+ *
1725
+ * http://www.apache.org/licenses/LICENSE-2.0
1726
+ *
1727
+ * Unless required by applicable law or agreed to in writing, software
1728
+ * distributed under the License is distributed on an "AS IS" BASIS,
1729
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1730
+ * See the License for the specific language governing permissions and
1731
+ * limitations under the License.
1732
+ *
1733
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1734
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
1735
+ * */
1736
+ const confirmationDialogOptions = t => {
1737
+ return {
1738
+ cancelLabel: t('close-dialog-cancel'),
1739
+ title: t('close-draw-dialog-title'),
1740
+ description: t('close-dialog-description'),
1741
+ confirmLabel: t('close-dialog-confirm'),
1742
+ catchOnCancel: true
1743
+ };
1744
+ };
1745
+ const useCloseDrawDialog = ({
1746
+ mapId,
1747
+ source
1748
+ }) => {
1749
+ const {
1750
+ t
1751
+ } = useWarningsTranslation();
1752
+ const dispatch = useDispatch();
1753
+ const drawLayerId = getSingularDrawtoolDrawLayerId(mapId);
1754
+ const drawDialogActiveDrawModeId = useSelector(store => drawtoolSelectors.getActiveDrawModeId(store, drawingDialogType));
1744
1755
  const featureLayerContainsGeoJSON = useSelector(store => layerSelectors.getHasFeatureLayerGeoJSON(store, drawLayerId));
1745
1756
  const dialogError = useSelector(store => uiSelectors.getDialogError(store, drawingDialogType));
1746
1757
  const isFormDirty = useSelector(store => getWarningFormDirty(store, drawingDialogType));
@@ -1988,22 +1999,6 @@ const useObjectDrawDialogAction = ({
1988
1999
  };
1989
2000
  };
1990
2001
 
1991
- /* *
1992
- * Licensed under the Apache License, Version 2.0 (the "License");
1993
- * you may not use this file except in compliance with the License.
1994
- * You may obtain a copy of the License at
1995
- *
1996
- * http://www.apache.org/licenses/LICENSE-2.0
1997
- *
1998
- * Unless required by applicable law or agreed to in writing, software
1999
- * distributed under the License is distributed on an "AS IS" BASIS,
2000
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2001
- * See the License for the specific language governing permissions and
2002
- * limitations under the License.
2003
- *
2004
- * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2005
- * Copyright 2023 - Finnish Meteorological Institute (FMI)
2006
- * */
2007
2002
  const ObjectManagerMapButtonConnect = ({
2008
2003
  mapId,
2009
2004
  source: _source = 'app'
@@ -2022,12 +2017,14 @@ const ObjectManagerMapButtonConnect = ({
2022
2017
  shouldOpen ? openObjectDialog() : closeObjectDialog();
2023
2018
  };
2024
2019
  const isOpen = objectDialogMapId === mapId && isObjectDialogOpen;
2025
- return /*#__PURE__*/React__default.createElement(MapControlButton, {
2020
+ return jsx(MapControlButton, Object.assign({
2026
2021
  "aria-label": `Object Manager Button for ${mapId}`,
2027
2022
  title: "Object Manager",
2028
2023
  onClick: onClick,
2029
2024
  isActive: isOpen
2030
- }, /*#__PURE__*/React__default.createElement(Polygons, null));
2025
+ }, {
2026
+ children: jsx(Polygons, {})
2027
+ }));
2031
2028
  };
2032
2029
 
2033
2030
  var objectDefineProperties = {};
@@ -2771,157 +2768,185 @@ const Objects = ({
2771
2768
  listRef.current.resetAfterIndex(0, true);
2772
2769
  }
2773
2770
  }, [objects]);
2774
- return /*#__PURE__*/React__default.createElement(AutoSizer, {
2771
+ return jsx(AutoSizer, Object.assign({
2775
2772
  onResize: () => {
2776
2773
  if (listRef.current !== null) {
2777
2774
  listRef.current.resetAfterIndex(0, true);
2778
2775
  }
2779
2776
  }
2780
- }, ({
2781
- height: _height = 0,
2782
- width: _width = 0
2783
- }) => ( /*#__PURE__*/React__default.createElement(Box, {
2784
- sx: {
2785
- width: _width
2786
- }
2787
- }, !_isLoading && objects.length === 0 ? ( /*#__PURE__*/React__default.createElement(Typography, {
2788
- sx: {
2789
- paddingLeft: '16px',
2790
- paddingTop: '8px'
2791
- },
2792
- variant: "body1"
2793
- }, t('object-manager-no-objects'))) : ( /*#__PURE__*/React__default.createElement(VariableSizeList, {
2794
- height: _height - DEFAULT_ADD_BUTTON_HEIGHT,
2795
- width: _width,
2796
- itemCount: listInclHeaders.length,
2797
- itemSize: index => getItemSize(_width, index),
2798
- style: {
2799
- containerType: 'inline-size',
2800
- containerName: 'objectList'
2801
- },
2802
- ref: listRef
2803
- }, ({
2804
- index,
2805
- style
2806
- }) => {
2807
- const listItem = listInclHeaders[index];
2808
- if (!listItem.isObject) {
2809
- const header = headerList[listItem.index];
2810
- return /*#__PURE__*/React__default.createElement(Typography, {
2811
- style: style,
2812
- key: listItem.index,
2777
+ }, {
2778
+ children: ({
2779
+ height: _height = 0,
2780
+ width: _width = 0
2781
+ }) => jsx(Box, Object.assign({
2782
+ sx: {
2783
+ width: _width
2784
+ }
2785
+ }, {
2786
+ children: !_isLoading && objects.length === 0 ? jsx(Typography, Object.assign({
2813
2787
  sx: {
2814
- paddingLeft: 2.5,
2815
- paddingBottom: 0.5,
2816
- paddingTop: 1,
2817
- opacity: 0.67,
2818
- lineHeight: '16px',
2819
- overflow: 'hidden',
2820
- whiteSpace: 'nowrap',
2821
- textOverflow: 'ellipsis'
2788
+ paddingLeft: '16px',
2789
+ paddingTop: '8px'
2822
2790
  },
2823
- variant: "caption"
2824
- }, header);
2825
- }
2826
- const object = objects[listItem.index];
2827
- return /*#__PURE__*/React__default.createElement(ContainerDiv, null, /*#__PURE__*/React__default.createElement(ListItem, {
2828
- style: style,
2829
- disablePadding: true,
2830
- key: object.id,
2831
- secondaryAction: /*#__PURE__*/React__default.createElement(Grid, {
2832
- container: true,
2833
- rowSpacing: 1
2834
- }, /*#__PURE__*/React__default.createElement(Grid, {
2835
- item: true,
2836
- className: "objectActions"
2837
- }, /*#__PURE__*/React__default.createElement(ToggleMenu, {
2838
- buttonSx: {
2839
- // position the share button for scope global
2840
- marginBottom: object.scope === 'user' ? 0 : 4,
2841
- [`@container objectList (min-width: ${BREAKPOINT}px)`]: {
2842
- marginBottom: 0,
2843
- marginRight: object.scope === 'user' ? 1 : 4
2844
- }
2791
+ variant: "body1"
2792
+ }, {
2793
+ children: t('object-manager-no-objects')
2794
+ })) : jsx(VariableSizeList, Object.assign({
2795
+ height: _height - DEFAULT_ADD_BUTTON_HEIGHT,
2796
+ width: _width,
2797
+ itemCount: listInclHeaders.length,
2798
+ itemSize: index => getItemSize(_width, index),
2799
+ style: {
2800
+ containerType: 'inline-size',
2801
+ containerName: 'objectList'
2845
2802
  },
2846
- buttonIcon: /*#__PURE__*/React__default.createElement(Share, null),
2847
- menuTitle: t('object-manager-share-menu'),
2848
- tooltipTitle: t('object-manager-button-share'),
2849
- menuPosition: "bottom",
2850
- "aria-label": t('object-manager-button-share'),
2851
- menuItems: [{
2852
- text: BUTTON_AIRMET,
2853
- action: () => {},
2854
- icon: /*#__PURE__*/React__default.createElement(ExitDomain, null),
2855
- isDisabled: true
2856
- }, {
2857
- text: BUTTON_SIGMET,
2858
- action: () => {},
2859
- icon: /*#__PURE__*/React__default.createElement(ExitDomain, null),
2860
- isDisabled: true
2861
- }, {
2862
- text: t('public-warning-title').toUpperCase(),
2863
- action: () => {
2864
- onClickShare(object);
2865
- },
2866
- icon: /*#__PURE__*/React__default.createElement(ExitDomain, null)
2867
- }]
2868
- })), object.scope === 'user' && ( /*#__PURE__*/React__default.createElement(Grid, {
2869
- item: true,
2870
- className: "objectActions"
2871
- }, /*#__PURE__*/React__default.createElement(ToggleMenu, {
2872
- menuTitle: t('object-manager-options-menu'),
2873
- tooltipTitle: t('object-manager-options-menu'),
2874
- menuPosition: "bottom",
2875
- "aria-label": "Options",
2876
- menuItems: [{
2877
- text: t('object-manager-button-edit'),
2878
- action: () => {
2879
- onClickEdit(object.id);
2880
- },
2881
- icon: /*#__PURE__*/React__default.createElement(Edit, null)
2882
- }, {
2883
- text: t('object-manager-button-delete'),
2884
- action: () => {
2885
- onClickDelete(object.id);
2886
- },
2887
- icon: /*#__PURE__*/React__default.createElement(Delete, null)
2888
- }]
2889
- }))))
2890
- }, /*#__PURE__*/React__default.createElement(Paper, {
2891
- elevation: 0,
2892
- sx: {
2893
- width: '100%',
2894
- margin: 0.25,
2895
- backgroundColor: 'geowebColors.background.surface',
2896
- border: 'solid 1px',
2897
- borderColor: 'geowebColors.cards.cardContainerBorder'
2898
- }
2899
- }, /*#__PURE__*/React__default.createElement(ListItemButton, {
2900
- onClick: () => {
2901
- onClickObject(object);
2902
- },
2903
- selected: activeObject === object.id,
2904
- sx: {
2905
- padding: 1,
2906
- height: '44px'
2907
- }
2908
- }, /*#__PURE__*/React__default.createElement(Stack, null, /*#__PURE__*/React__default.createElement(Typography, {
2909
- variant: "caption",
2910
- sx: {
2911
- lineHeight: '16px',
2912
- maxHeight: '32px',
2913
- overflow: 'hidden'
2914
- }
2915
- }, object.objectName), /*#__PURE__*/React__default.createElement(Typography, {
2916
- variant: "caption",
2917
- sx: {
2918
- opacity: 0.67,
2919
- lineHeight: '16px',
2920
- maxHeight: '32px',
2921
- overflow: 'hidden'
2922
- }
2923
- }, object.scope === 'global' && 'Global: ', `${dateUtils.dateToString(dateUtils.utc(object.lastUpdatedTime), dateUtils.DATE_FORMAT_DATEPICKER)} UTC`))))));
2924
- })))));
2803
+ ref: listRef
2804
+ }, {
2805
+ children: ({
2806
+ index,
2807
+ style
2808
+ }) => {
2809
+ const listItem = listInclHeaders[index];
2810
+ if (!listItem.isObject) {
2811
+ const header = headerList[listItem.index];
2812
+ return jsx(Typography, Object.assign({
2813
+ style: style,
2814
+ sx: {
2815
+ paddingLeft: 2.5,
2816
+ paddingBottom: 0.5,
2817
+ paddingTop: 1,
2818
+ opacity: 0.67,
2819
+ lineHeight: '16px',
2820
+ overflow: 'hidden',
2821
+ whiteSpace: 'nowrap',
2822
+ textOverflow: 'ellipsis'
2823
+ },
2824
+ variant: "caption"
2825
+ }, {
2826
+ children: header
2827
+ }), listItem.index);
2828
+ }
2829
+ const object = objects[listItem.index];
2830
+ return jsx(ContainerDiv, {
2831
+ children: jsx(ListItem, Object.assign({
2832
+ style: style,
2833
+ disablePadding: true,
2834
+ secondaryAction: jsxs(Grid, Object.assign({
2835
+ container: true,
2836
+ rowSpacing: 1
2837
+ }, {
2838
+ children: [jsx(Grid, Object.assign({
2839
+ item: true,
2840
+ className: "objectActions"
2841
+ }, {
2842
+ children: jsx(ToggleMenu, {
2843
+ buttonSx: {
2844
+ // position the share button for scope global
2845
+ marginBottom: object.scope === 'user' ? 0 : 4,
2846
+ [`@container objectList (min-width: ${BREAKPOINT}px)`]: {
2847
+ marginBottom: 0,
2848
+ marginRight: object.scope === 'user' ? 1 : 4
2849
+ }
2850
+ },
2851
+ buttonIcon: jsx(Share, {}),
2852
+ menuTitle: t('object-manager-share-menu'),
2853
+ tooltipTitle: t('object-manager-button-share'),
2854
+ menuPosition: "bottom",
2855
+ "aria-label": t('object-manager-button-share'),
2856
+ menuItems: [{
2857
+ text: BUTTON_AIRMET,
2858
+ action: () => {},
2859
+ icon: jsx(ExitDomain, {}),
2860
+ isDisabled: true
2861
+ }, {
2862
+ text: BUTTON_SIGMET,
2863
+ action: () => {},
2864
+ icon: jsx(ExitDomain, {}),
2865
+ isDisabled: true
2866
+ }, {
2867
+ text: t('public-warning-title').toUpperCase(),
2868
+ action: () => {
2869
+ onClickShare(object);
2870
+ },
2871
+ icon: jsx(ExitDomain, {})
2872
+ }]
2873
+ })
2874
+ })), object.scope === 'user' && jsx(Grid, Object.assign({
2875
+ item: true,
2876
+ className: "objectActions"
2877
+ }, {
2878
+ children: jsx(ToggleMenu, {
2879
+ menuTitle: t('object-manager-options-menu'),
2880
+ tooltipTitle: t('object-manager-options-menu'),
2881
+ menuPosition: "bottom",
2882
+ "aria-label": "Options",
2883
+ menuItems: [{
2884
+ text: t('object-manager-button-edit'),
2885
+ action: () => {
2886
+ onClickEdit(object.id);
2887
+ },
2888
+ icon: jsx(Edit, {})
2889
+ }, {
2890
+ text: t('object-manager-button-delete'),
2891
+ action: () => {
2892
+ onClickDelete(object.id);
2893
+ },
2894
+ icon: jsx(Delete, {})
2895
+ }]
2896
+ })
2897
+ }))]
2898
+ }))
2899
+ }, {
2900
+ children: jsx(Paper, Object.assign({
2901
+ elevation: 0,
2902
+ sx: {
2903
+ width: '100%',
2904
+ margin: 0.25,
2905
+ backgroundColor: 'geowebColors.background.surface',
2906
+ border: 'solid 1px',
2907
+ borderColor: 'geowebColors.cards.cardContainerBorder'
2908
+ }
2909
+ }, {
2910
+ children: jsx(ListItemButton, Object.assign({
2911
+ onClick: () => {
2912
+ onClickObject(object);
2913
+ },
2914
+ selected: activeObject === object.id,
2915
+ sx: {
2916
+ padding: 1,
2917
+ height: '44px'
2918
+ }
2919
+ }, {
2920
+ children: jsxs(Stack, {
2921
+ children: [jsx(Typography, Object.assign({
2922
+ variant: "caption",
2923
+ sx: {
2924
+ lineHeight: '16px',
2925
+ maxHeight: '32px',
2926
+ overflow: 'hidden'
2927
+ }
2928
+ }, {
2929
+ children: object.objectName
2930
+ })), jsxs(Typography, Object.assign({
2931
+ variant: "caption",
2932
+ sx: {
2933
+ opacity: 0.67,
2934
+ lineHeight: '16px',
2935
+ maxHeight: '32px',
2936
+ overflow: 'hidden'
2937
+ }
2938
+ }, {
2939
+ children: [object.scope === 'global' && 'Global: ', `${dateUtils.dateToString(dateUtils.utc(object.lastUpdatedTime), dateUtils.DATE_FORMAT_DATEPICKER)} UTC`]
2940
+ }))]
2941
+ })
2942
+ }))
2943
+ }))
2944
+ }), object.id)
2945
+ });
2946
+ }
2947
+ }))
2948
+ }))
2949
+ }));
2925
2950
  };
2926
2951
 
2927
2952
  const DEFAULT_OBJECT_MANAGER_SIZE = {
@@ -2946,7 +2971,6 @@ const ObjectManager = ({
2946
2971
  source: _source = 'app',
2947
2972
  size: _size = DEFAULT_OBJECT_MANAGER_SIZE,
2948
2973
  startPosition: _startPosition = DEFAULT_OBJECT_MANAGER_POSITION,
2949
- setFocused: _setFocused = () => {},
2950
2974
  headerSize: _headerSize = 'xs',
2951
2975
  drawingListItems,
2952
2976
  onClickDrawing: _onClickDrawing = () => {},
@@ -2964,7 +2988,7 @@ const ObjectManager = ({
2964
2988
  const minSize = DEFAULT_OBJECT_MANAGER_MIN_SIZE;
2965
2989
  const startSizeCalc = calculateStartSize(minSize, _size, _startPosition);
2966
2990
  const [sizeInState, setSizeInState] = React.useState(startSizeCalc);
2967
- return /*#__PURE__*/React.createElement(ToolContainerDraggable, {
2991
+ return jsxs(ToolContainerDraggable, Object.assign({
2968
2992
  title: _title,
2969
2993
  startSize: sizeInState,
2970
2994
  minWidth: minSize.width,
@@ -2975,8 +2999,6 @@ const ObjectManager = ({
2975
2999
  headerSize: _headerSize,
2976
3000
  bounds: bounds,
2977
3001
  onMouseDown: _onMouseDown,
2978
- onFocus: () => _setFocused(true),
2979
- onBlur: () => _setFocused(false),
2980
3002
  order: _order,
2981
3003
  source: _source,
2982
3004
  onResizeStop: (_event, _direction, node) => {
@@ -3000,44 +3022,52 @@ const ObjectManager = ({
3000
3022
  boxShadow: 'none'
3001
3023
  }
3002
3024
  }
3003
- }, _isLoading && ( /*#__PURE__*/React.createElement(LinearProgress, {
3004
- "data-testid": "loading-bar",
3005
- color: "secondary",
3006
- sx: {
3007
- position: 'absolute',
3008
- width: '100%',
3009
- top: 0
3010
- }
3011
- })), error && ( /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(AlertBanner, {
3012
- title: error,
3013
- shouldClose: true
3014
- }))), /*#__PURE__*/React.createElement(Objects, {
3015
- objects: drawingListItems,
3016
- onClickObject: _onClickDrawing,
3017
- onClickEdit: _onEditDrawing,
3018
- onClickDelete: _onDeleteDrawing,
3019
- onClickShare: _onShareObject,
3020
- activeObject: _activeDrawingId,
3021
- isLoading: _isLoading
3022
- }), /*#__PURE__*/React.createElement(Box, {
3023
- sx: {
3024
- padding: '24px 8px 16px 8px',
3025
- position: 'absolute',
3026
- bottom: 0,
3027
- width: '100%',
3028
- backgroundColor: 'geowebColors.background.surfaceApp',
3029
- boxShadow: '0 2px 4px 0 rgba(0, 0, 0, 0.5)',
3030
- zIndex: 1
3031
- }
3032
- }, /*#__PURE__*/React.createElement(Button, {
3033
- variant: "tertiary",
3034
- onClick: _onCreateNewObject,
3035
- sx: {
3036
- width: '100%',
3037
- textTransform: 'none',
3038
- fontSize: '12px'
3039
- }
3040
- }, t('object-manager-add'))));
3025
+ }, {
3026
+ children: [_isLoading && jsx(LinearProgress, {
3027
+ "data-testid": "loading-bar",
3028
+ color: "secondary",
3029
+ sx: {
3030
+ position: 'absolute',
3031
+ width: '100%',
3032
+ top: 0
3033
+ }
3034
+ }), error && jsx(Box, {
3035
+ children: jsx(AlertBanner, {
3036
+ title: error,
3037
+ shouldClose: true
3038
+ })
3039
+ }), jsx(Objects, {
3040
+ objects: drawingListItems,
3041
+ onClickObject: _onClickDrawing,
3042
+ onClickEdit: _onEditDrawing,
3043
+ onClickDelete: _onDeleteDrawing,
3044
+ onClickShare: _onShareObject,
3045
+ activeObject: _activeDrawingId,
3046
+ isLoading: _isLoading
3047
+ }), jsx(Box, Object.assign({
3048
+ sx: {
3049
+ padding: '24px 8px 16px 8px',
3050
+ position: 'absolute',
3051
+ bottom: 0,
3052
+ width: '100%',
3053
+ backgroundColor: 'geowebColors.background.surfaceApp',
3054
+ boxShadow: '0 2px 4px 0 rgba(0, 0, 0, 0.5)',
3055
+ zIndex: 1
3056
+ }
3057
+ }, {
3058
+ children: jsx(Button, Object.assign({
3059
+ variant: "tertiary",
3060
+ onClick: _onCreateNewObject,
3061
+ sx: {
3062
+ width: '100%',
3063
+ textTransform: 'none',
3064
+ fontSize: '12px'
3065
+ }
3066
+ }, {
3067
+ children: t('object-manager-add')
3068
+ }))
3069
+ }))]
3070
+ }));
3041
3071
  };
3042
3072
 
3043
3073
  /* *
@@ -3134,7 +3164,7 @@ const ConfirmDeleteDialog = ({
3134
3164
  }
3135
3165
  });
3136
3166
  const description = getDeleteDescription(objectName, t);
3137
- return /*#__PURE__*/React__default.createElement(ConfirmationDialog, Object.assign({
3167
+ return jsx(ConfirmationDialog, Object.assign({
3138
3168
  title: t('delete-dialog-title'),
3139
3169
  open: true,
3140
3170
  confirmLabel: t('delete-dialog-confirm'),
@@ -3147,18 +3177,22 @@ const ConfirmDeleteDialog = ({
3147
3177
  width: 330
3148
3178
  }
3149
3179
  }, error && {
3150
- content: ( /*#__PURE__*/React__default.createElement(Box, {
3180
+ content: jsxs(Box, Object.assign({
3151
3181
  sx: {
3152
3182
  marginBottom: 0
3153
3183
  }
3154
- }, /*#__PURE__*/React__default.createElement(AlertBanner, {
3155
- title: error
3156
- }), /*#__PURE__*/React__default.createElement(Typography, {
3157
- variant: "body1",
3158
- sx: {
3159
- marginTop: 1
3160
- }
3161
- }, description)))
3184
+ }, {
3185
+ children: [jsx(AlertBanner, {
3186
+ title: error
3187
+ }), jsx(Typography, Object.assign({
3188
+ variant: "body1",
3189
+ sx: {
3190
+ marginTop: 1
3191
+ }
3192
+ }, {
3193
+ children: description
3194
+ }))]
3195
+ }))
3162
3196
  }));
3163
3197
  };
3164
3198
 
@@ -3403,7 +3437,6 @@ const ObjectManagerConnect = ({
3403
3437
  setDialogOrder,
3404
3438
  isDialogOpen,
3405
3439
  uiSource,
3406
- setFocused,
3407
3440
  uiError
3408
3441
  } = useSetupDialog(objectDialogType, _source);
3409
3442
  const warningsApi = getWarningsApi();
@@ -3558,33 +3591,34 @@ const ObjectManagerConnect = ({
3558
3591
  objectName
3559
3592
  });
3560
3593
  };
3561
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(ObjectManager, {
3562
- title: `${t('object-manager-title')} ${mapId}`,
3563
- bounds: bounds,
3564
- isOpen: isDialogOpen,
3565
- onClose: onClose,
3566
- onMouseDown: setDialogOrder,
3567
- order: dialogOrder,
3568
- source: uiSource,
3569
- setFocused: setFocused,
3570
- headerSize: "xs",
3571
- startPosition: {
3572
- top: 104,
3573
- left: 50
3574
- },
3575
- drawingListItems: drawings,
3576
- onClickDrawing: onClickDrawing,
3577
- onEditDrawing: onEditDrawing,
3578
- onDeleteDrawing: onDeleteDrawing,
3579
- onShareObject: onShareObject,
3580
- onCreateNewObject: onCreateNewObject,
3581
- activeDrawingId: activeDrawingId,
3582
- error: uiError,
3583
- isLoading: loading
3584
- }), confirmDialogOptions && ( /*#__PURE__*/React__default.createElement(ConfirmDeleteDialog, Object.assign({}, confirmDialogOptions, {
3585
- onDeleteSucces: onDeleteSuccess,
3586
- onClose: () => setConfirmDialogOptions(undefined)
3587
- }))));
3594
+ return jsxs(Fragment, {
3595
+ children: [jsx(ObjectManager, {
3596
+ title: `${t('object-manager-title')} ${mapId}`,
3597
+ bounds: bounds,
3598
+ isOpen: isDialogOpen,
3599
+ onClose: onClose,
3600
+ onMouseDown: setDialogOrder,
3601
+ order: dialogOrder,
3602
+ source: uiSource,
3603
+ headerSize: "xs",
3604
+ startPosition: {
3605
+ top: 104,
3606
+ left: 50
3607
+ },
3608
+ drawingListItems: drawings,
3609
+ onClickDrawing: onClickDrawing,
3610
+ onEditDrawing: onEditDrawing,
3611
+ onDeleteDrawing: onDeleteDrawing,
3612
+ onShareObject: onShareObject,
3613
+ onCreateNewObject: onCreateNewObject,
3614
+ activeDrawingId: activeDrawingId,
3615
+ error: uiError,
3616
+ isLoading: loading
3617
+ }), confirmDialogOptions && jsx(ConfirmDeleteDialog, Object.assign({}, confirmDialogOptions, {
3618
+ onDeleteSucces: onDeleteSuccess,
3619
+ onClose: () => setConfirmDialogOptions(undefined)
3620
+ }))]
3621
+ });
3588
3622
  };
3589
3623
 
3590
3624
  var NATIVE_BIND = functionBindNative;
@@ -5968,53 +6002,23 @@ const createApi = () => {
5968
6002
  return getApiRoutes(instance);
5969
6003
  };
5970
6004
 
5971
- /* *
5972
- * Licensed under the Apache License, Version 2.0 (the "License");
5973
- * you may not use this file except in compliance with the License.
5974
- * You may obtain a copy of the License at
5975
- *
5976
- * http://www.apache.org/licenses/LICENSE-2.0
5977
- *
5978
- * Unless required by applicable law or agreed to in writing, software
5979
- * distributed under the License is distributed on an "AS IS" BASIS,
5980
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5981
- * See the License for the specific language governing permissions and
5982
- * limitations under the License.
5983
- *
5984
- * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
5985
- * Copyright 2023 - Finnish Meteorological Institute (FMI)
5986
- * */
5987
6005
  const WarningsModuleProvider = ({
5988
6006
  config,
5989
6007
  auth,
5990
6008
  onSetAuth,
5991
6009
  children
5992
6010
  }) => {
5993
- return /*#__PURE__*/React.createElement(ApiProvider, {
6011
+ return jsx(ApiProvider, Object.assign({
5994
6012
  config: config,
5995
6013
  auth: auth,
5996
6014
  onSetAuth: onSetAuth,
5997
6015
  createApi: config !== undefined ? createApi$1 : createApi,
5998
6016
  name: API_NAME
5999
- }, children);
6017
+ }, {
6018
+ children: children
6019
+ }));
6000
6020
  };
6001
6021
 
6002
- /* *
6003
- * Licensed under the Apache License, Version 2.0 (the "License");
6004
- * you may not use this file except in compliance with the License.
6005
- * You may obtain a copy of the License at
6006
- *
6007
- * http://www.apache.org/licenses/LICENSE-2.0
6008
- *
6009
- * Unless required by applicable law or agreed to in writing, software
6010
- * distributed under the License is distributed on an "AS IS" BASIS,
6011
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6012
- * See the License for the specific language governing permissions and
6013
- * limitations under the License.
6014
- *
6015
- * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
6016
- * Copyright 2023 - Finnish Meteorological Institute (FMI)
6017
- * */
6018
6022
  const DrawingToolMapButtonConnect = ({
6019
6023
  mapId,
6020
6024
  source: _source = 'app'
@@ -6039,12 +6043,14 @@ const DrawingToolMapButtonConnect = ({
6039
6043
  shouldOpen ? openDrawDialog() : closeDrawDialog();
6040
6044
  };
6041
6045
  const isOpen = drawDialogMapId === mapId && isDrawDialogOpen;
6042
- return /*#__PURE__*/React.createElement(MapControlButton, {
6046
+ return jsx(MapControlButton, Object.assign({
6043
6047
  title: t('drawing-tool-title'),
6044
6048
  "data-testid": "drawingToolButton",
6045
6049
  onClick: onClick,
6046
6050
  isActive: isOpen
6047
- }, /*#__PURE__*/React.createElement(DrawPolygon, null));
6051
+ }, {
6052
+ children: jsx(DrawPolygon, {})
6053
+ }));
6048
6054
  };
6049
6055
 
6050
6056
  const DERFAULT_DRAW_TOOL_SIZE = {
@@ -6070,7 +6076,6 @@ const DrawingTool = ({
6070
6076
  isLoading: _isLoading = false,
6071
6077
  size: _size = DERFAULT_DRAW_TOOL_SIZE,
6072
6078
  startPosition: _startPosition = DEFAULT_DRAW_TOOL_POSITION,
6073
- setFocused: _setFocused = () => {},
6074
6079
  headerSize: _headerSize = 'xs',
6075
6080
  children
6076
6081
  }) => {
@@ -6080,7 +6085,7 @@ const DrawingTool = ({
6080
6085
  const minSize = DEFAULT_DRAW_TOOL_MIN_SIZE;
6081
6086
  const startSizeCalc = calculateStartSize(minSize, _size, _startPosition);
6082
6087
  const [sizeInState, setSizeInState] = React.useState(startSizeCalc);
6083
- return /*#__PURE__*/React.createElement(ToolContainerDraggable, {
6088
+ return jsx(ToolContainerDraggable, Object.assign({
6084
6089
  title: title || t('drawing-tool-title'),
6085
6090
  startSize: sizeInState,
6086
6091
  minWidth: minSize.width,
@@ -6092,8 +6097,6 @@ const DrawingTool = ({
6092
6097
  bounds: bounds,
6093
6098
  "data-testid": "drawingToolWindow",
6094
6099
  onMouseDown: _onMouseDown,
6095
- onFocus: () => _setFocused(true),
6096
- onBlur: () => _setFocused(false),
6097
6100
  order: _order,
6098
6101
  source: _source,
6099
6102
  sx: {
@@ -6117,21 +6120,22 @@ const DrawingTool = ({
6117
6120
  setSizeInState(dragSize);
6118
6121
  }
6119
6122
  }
6120
- }, /*#__PURE__*/React.createElement(Box, {
6121
- onKeyDown: event => {
6122
- event.stopPropagation();
6123
- },
6124
- sx: {
6125
- height: '100%'
6126
- }
6127
- }, _isLoading && ( /*#__PURE__*/React.createElement(LinearProgress, {
6128
- "data-testid": "loading-bar-drawingTool",
6129
- color: "secondary",
6130
- sx: {
6131
- position: 'absolute',
6132
- width: '100%'
6133
- }
6134
- })), children));
6123
+ }, {
6124
+ children: jsxs(Box, Object.assign({
6125
+ sx: {
6126
+ height: '100%'
6127
+ }
6128
+ }, {
6129
+ children: [_isLoading && jsx(LinearProgress, {
6130
+ "data-testid": "loading-bar-drawingTool",
6131
+ color: "secondary",
6132
+ sx: {
6133
+ position: 'absolute',
6134
+ width: '100%'
6135
+ }
6136
+ }), children]
6137
+ }))
6138
+ }));
6135
6139
  };
6136
6140
 
6137
6141
  // a string of all valid unicode whitespaces
@@ -6242,22 +6246,6 @@ const useFormDirty = ({
6242
6246
  }, [isLoading, error, previousIsLoading, onSuccess]);
6243
6247
  };
6244
6248
 
6245
- /* *
6246
- * Licensed under the Apache License, Version 2.0 (the "License");
6247
- * you may not use this file except in compliance with the License.
6248
- * You may obtain a copy of the License at
6249
- *
6250
- * http://www.apache.org/licenses/LICENSE-2.0
6251
- *
6252
- * Unless required by applicable law or agreed to in writing, software
6253
- * distributed under the License is distributed on an "AS IS" BASIS,
6254
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6255
- * See the License for the specific language governing permissions and
6256
- * limitations under the License.
6257
- *
6258
- * Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
6259
- * Copyright 2024 - Finnish Meteorological Institute (FMI)
6260
- * */
6261
6249
  const opacityOptions = [100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 0];
6262
6250
  const DrawingToolFormContentsNoMemo = ({
6263
6251
  isLoading,
@@ -6266,7 +6254,6 @@ const DrawingToolFormContentsNoMemo = ({
6266
6254
  drawModes,
6267
6255
  onChangeDrawMode,
6268
6256
  activeDrawModeId,
6269
- onKeyDown,
6270
6257
  isInEditMode,
6271
6258
  isDirty,
6272
6259
  errors,
@@ -6279,123 +6266,157 @@ const DrawingToolFormContentsNoMemo = ({
6279
6266
  t
6280
6267
  } = useWarningsTranslation();
6281
6268
  const hasErrors = Object.keys(errors).length > 0;
6282
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Box, {
6283
- sx: {
6284
- height: 'calc( 100% - 72px )',
6285
- overflow: 'auto'
6286
- }
6287
- }, dialogError && ( /*#__PURE__*/React__default.createElement(Box, {
6288
- sx: {
6289
- width: '100%'
6290
- }
6291
- }, /*#__PURE__*/React__default.createElement(AlertBanner, {
6292
- title: dialogError,
6293
- shouldClose: true
6294
- }))), /*#__PURE__*/React__default.createElement(Grid, {
6295
- "data-testid": "drawingToolForm",
6296
- container: true,
6297
- direction: "column",
6298
- spacing: 1,
6299
- padding: 2
6300
- }, /*#__PURE__*/React__default.createElement(Grid, {
6301
- item: true
6302
- }, /*#__PURE__*/React__default.createElement(Typography, {
6303
- variant: "body2"
6304
- }, t('drawing-tool-form-tools'))), /*#__PURE__*/React__default.createElement(Grid, {
6305
- item: true,
6306
- container: true
6307
- }, /*#__PURE__*/React__default.createElement(Grid, {
6308
- item: true
6309
- }, drawModes.map(mode => ( /*#__PURE__*/React__default.createElement(CustomIconButton, {
6310
- key: mode.drawModeId,
6311
- variant: "tool",
6312
- tooltipTitle: mode.title,
6313
- isSelected: mode.isSelectable && activeDrawModeId === mode.drawModeId,
6314
- onClick: () => onChangeDrawMode(mode),
6315
- sx: {
6316
- marginRight: 1,
6317
- marginBottom: 1
6318
- },
6319
- "data-testid": mode.drawModeId,
6320
- onKeyDown: onKeyDown,
6321
- disabled: isLoading,
6322
- size: "medium"
6323
- }, getIcon(mode.selectionType)))), isInEditMode && ( /*#__PURE__*/React__default.createElement(Typography, {
6324
- component: "span",
6325
- sx: {
6326
- display: 'inline-block',
6327
- marginLeft: 2,
6328
- top: -1,
6329
- position: 'relative',
6330
- fontSize: 14
6331
- }
6332
- }, t('drawing-tool-form-exit-draw-mode'))), !!errors.geoJSON && isDirty && ( /*#__PURE__*/React__default.createElement(FormHelperText, {
6333
- error: true,
6334
- variant: "filled",
6335
- sx: {
6336
- marginLeft: 0
6337
- }
6338
- }, errors.geoJSON.message)), /*#__PURE__*/React__default.createElement(ReactHookFormHiddenInput, {
6339
- name: "geoJSON",
6340
- rules: {
6341
- validate: {
6342
- coordinatesNotEmpty: value => isValidGeoJsonCoordinates(value) || t('drawing-tool-form-drawing-required')
6269
+ return jsxs(Fragment, {
6270
+ children: [jsxs(Box, Object.assign({
6271
+ sx: {
6272
+ height: 'calc( 100% - 72px )',
6273
+ overflow: 'auto'
6343
6274
  }
6344
- }
6345
- }))), /*#__PURE__*/React__default.createElement(Grid, {
6346
- item: true,
6347
- container: true
6348
- }, /*#__PURE__*/React__default.createElement(Grid, {
6349
- item: true,
6350
- xs: 12,
6351
- sm: 6
6352
- }, /*#__PURE__*/React__default.createElement(ReactHookFormSelect, {
6353
- name: "opacity",
6354
- label: t('drawing-tool-form-opacity'),
6355
- rules: {},
6356
- disabled: isLoading,
6357
- isReadOnly: false,
6358
- "data-testid": "drawingToolForm-opacity",
6359
- onChange: onChangeOpacity,
6360
- autoFocus: true,
6361
- value: opacity * 100
6362
- }, opacityOptions.map(opacity => ( /*#__PURE__*/React__default.createElement(MenuItem, {
6363
- value: opacity,
6364
- key: opacity
6365
- }, opacity, " %")))))), /*#__PURE__*/React__default.createElement(Grid, {
6366
- item: true
6367
- }, /*#__PURE__*/React__default.createElement(ReactHookFormTextField, {
6368
- name: "objectName",
6369
- label: t('drawing-tool-form-object-name'),
6370
- rules: {
6371
- required: true
6372
- },
6373
- disabled: isLoading,
6374
- isReadOnly: false,
6375
- onBlur: onBlurName
6376
- }), /*#__PURE__*/React__default.createElement(ReactHookFormHiddenInput, {
6377
- name: "id"
6378
- })))), /*#__PURE__*/React__default.createElement(Box, {
6379
- sx: {
6380
- padding: '24px 10px 14px 10px',
6381
- position: 'absolute',
6382
- bottom: 0,
6383
- width: '100%',
6384
- backgroundColor: 'geowebColors.background.surfaceApp',
6385
- boxShadow: '0 2px 4px 0 rgba(0, 0, 0, 0.5)',
6386
- zIndex: 1
6387
- }
6388
- }, /*#__PURE__*/React__default.createElement(Button, {
6389
- variant: "primary",
6390
- onClick: onSubmit,
6391
- sx: {
6392
- width: '100%',
6393
- textTransform: 'none',
6394
- fontSize: '12px'
6395
- },
6396
- "data-testid": "saveDrawingFormButton",
6397
- disabled: isLoading || hasErrors
6398
- }, id !== '' ? t('drawing-tool-form-update') : t('drawing-tool-form-save'))));
6275
+ }, {
6276
+ children: [dialogError && jsx(Box, Object.assign({
6277
+ sx: {
6278
+ width: '100%'
6279
+ }
6280
+ }, {
6281
+ children: jsx(AlertBanner, {
6282
+ title: dialogError,
6283
+ shouldClose: true
6284
+ })
6285
+ })), jsxs(Grid, Object.assign({
6286
+ "data-testid": "drawingToolForm",
6287
+ container: true,
6288
+ direction: "column",
6289
+ spacing: 1,
6290
+ padding: 2
6291
+ }, {
6292
+ children: [jsx(Grid, Object.assign({
6293
+ item: true
6294
+ }, {
6295
+ children: jsx(Typography, Object.assign({
6296
+ variant: "body2"
6297
+ }, {
6298
+ children: t('drawing-tool-form-tools')
6299
+ }))
6300
+ })), jsx(Grid, Object.assign({
6301
+ item: true,
6302
+ container: true
6303
+ }, {
6304
+ children: jsxs(Grid, Object.assign({
6305
+ item: true
6306
+ }, {
6307
+ children: [drawModes.map(mode => jsx(CustomIconButton, Object.assign({
6308
+ variant: "tool",
6309
+ tooltipTitle: mode.title,
6310
+ isSelected: mode.isSelectable && activeDrawModeId === mode.drawModeId,
6311
+ onClick: () => onChangeDrawMode(mode),
6312
+ sx: {
6313
+ marginRight: 1,
6314
+ marginBottom: 1
6315
+ },
6316
+ "data-testid": mode.drawModeId,
6317
+ disabled: isLoading,
6318
+ size: "medium"
6319
+ }, {
6320
+ children: getIcon(mode.selectionType)
6321
+ }), mode.drawModeId)), isInEditMode && jsx(Typography, Object.assign({
6322
+ component: "span",
6323
+ sx: {
6324
+ display: 'inline-block',
6325
+ marginLeft: 2,
6326
+ top: -1,
6327
+ position: 'relative',
6328
+ fontSize: 14
6329
+ }
6330
+ }, {
6331
+ children: t('drawing-tool-form-exit-draw-mode')
6332
+ })), !!errors.geoJSON && isDirty && jsx(FormHelperText, Object.assign({
6333
+ error: true,
6334
+ variant: "filled",
6335
+ sx: {
6336
+ marginLeft: 0
6337
+ }
6338
+ }, {
6339
+ children: errors.geoJSON.message
6340
+ })), jsx(ReactHookFormHiddenInput, {
6341
+ name: "geoJSON",
6342
+ rules: {
6343
+ validate: {
6344
+ coordinatesNotEmpty: value => isValidGeoJsonCoordinates(value) || t('drawing-tool-form-drawing-required')
6345
+ }
6346
+ }
6347
+ })]
6348
+ }))
6349
+ })), jsx(Grid, Object.assign({
6350
+ item: true,
6351
+ container: true
6352
+ }, {
6353
+ children: jsx(Grid, Object.assign({
6354
+ item: true,
6355
+ xs: 12,
6356
+ sm: 6
6357
+ }, {
6358
+ children: jsx(ReactHookFormSelect, Object.assign({
6359
+ name: "opacity",
6360
+ label: t('drawing-tool-form-opacity'),
6361
+ rules: {},
6362
+ disabled: isLoading,
6363
+ isReadOnly: false,
6364
+ "data-testid": "drawingToolForm-opacity",
6365
+ onChange: onChangeOpacity,
6366
+ autoFocus: true,
6367
+ value: opacity * 100
6368
+ }, {
6369
+ children: opacityOptions.map(opacity => jsxs(MenuItem, Object.assign({
6370
+ value: opacity
6371
+ }, {
6372
+ children: [opacity, " %"]
6373
+ }), opacity))
6374
+ }))
6375
+ }))
6376
+ })), jsxs(Grid, Object.assign({
6377
+ item: true
6378
+ }, {
6379
+ children: [jsx(ReactHookFormTextField, {
6380
+ name: "objectName",
6381
+ label: t('drawing-tool-form-object-name'),
6382
+ rules: {
6383
+ required: true
6384
+ },
6385
+ disabled: isLoading,
6386
+ isReadOnly: false,
6387
+ onBlur: onBlurName,
6388
+ onKeyDown: event => event.stopPropagation()
6389
+ }), jsx(ReactHookFormHiddenInput, {
6390
+ name: "id"
6391
+ })]
6392
+ }))]
6393
+ }))]
6394
+ })), jsx(Box, Object.assign({
6395
+ sx: {
6396
+ padding: '24px 10px 14px 10px',
6397
+ position: 'absolute',
6398
+ bottom: 0,
6399
+ width: '100%',
6400
+ backgroundColor: 'geowebColors.background.surfaceApp',
6401
+ boxShadow: '0 2px 4px 0 rgba(0, 0, 0, 0.5)',
6402
+ zIndex: 1
6403
+ }
6404
+ }, {
6405
+ children: jsx(Button, Object.assign({
6406
+ variant: "primary",
6407
+ onClick: onSubmit,
6408
+ sx: {
6409
+ width: '100%',
6410
+ textTransform: 'none',
6411
+ fontSize: '12px'
6412
+ },
6413
+ "data-testid": "saveDrawingFormButton",
6414
+ disabled: isLoading || hasErrors
6415
+ }, {
6416
+ children: id !== '' ? t('drawing-tool-form-update') : t('drawing-tool-form-save')
6417
+ }))
6418
+ }))]
6419
+ });
6399
6420
  };
6400
6421
  const DrawingToolFormContents = /*#__PURE__*/React__default.memo(DrawingToolFormContentsNoMemo, isEqual);
6401
6422
 
@@ -6482,22 +6503,16 @@ const DrawingToolForm = ({
6482
6503
  'stroke-opacity': clamp(newOpacity + additionalStrokeOpacity, 0.01, 1)
6483
6504
  });
6484
6505
  }, [_onChangeProperties]);
6485
- const onKeyDown = React.useCallback(event => {
6486
- if (event.key === 'Escape') {
6487
- _onDeactivateTool();
6488
- }
6489
- }, [_onDeactivateTool]);
6490
6506
  const onBlurName = React.useCallback(event => {
6491
6507
  _onChangeName(event.target.value);
6492
6508
  }, [_onChangeName]);
6493
- return /*#__PURE__*/React.createElement(DrawingToolFormContents, {
6509
+ return jsx(DrawingToolFormContents, {
6494
6510
  isLoading: _isLoading,
6495
6511
  dialogError: dialogError,
6496
6512
  id: _id,
6497
6513
  drawModes: _drawModes,
6498
6514
  activeDrawModeId: _activeDrawModeId,
6499
6515
  onChangeDrawMode: _onChangeDrawMode,
6500
- onKeyDown: onKeyDown,
6501
6516
  isInEditMode: _isInEditMode,
6502
6517
  isDirty: isDirty,
6503
6518
  errors: currentErrors,
@@ -6513,7 +6528,7 @@ const Wrapper = props => {
6513
6528
  objectName = '',
6514
6529
  geoJSON = undefined
6515
6530
  } = props;
6516
- return /*#__PURE__*/React.createElement(ReactHookFormProvider, {
6531
+ return jsx(ReactHookFormProvider, Object.assign({
6517
6532
  options: Object.assign(Object.assign({}, defaultFormOptions), {
6518
6533
  defaultValues: {
6519
6534
  id,
@@ -6522,25 +6537,11 @@ const Wrapper = props => {
6522
6537
  opacity: 20
6523
6538
  }
6524
6539
  })
6525
- }, /*#__PURE__*/React.createElement(DrawingToolForm, Object.assign({}, props)));
6540
+ }, {
6541
+ children: jsx(DrawingToolForm, Object.assign({}, props))
6542
+ }));
6526
6543
  };
6527
6544
 
6528
- /* *
6529
- * Licensed under the Apache License, Version 2.0 (the "License");
6530
- * you may not use this file except in compliance with the License.
6531
- * You may obtain a copy of the License at
6532
- *
6533
- * http://www.apache.org/licenses/LICENSE-2.0
6534
- *
6535
- * Unless required by applicable law or agreed to in writing, software
6536
- * distributed under the License is distributed on an "AS IS" BASIS,
6537
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6538
- * See the License for the specific language governing permissions and
6539
- * limitations under the License.
6540
- *
6541
- * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
6542
- * Copyright 2023 - Finnish Meteorological Institute (FMI)
6543
- * */
6544
6545
  const DrawingToolFormConnect = () => {
6545
6546
  const dispatch = useDispatch();
6546
6547
  const drawing = useSelector(store => selectDrawByInstanceId(store, drawingDialogType));
@@ -6599,7 +6600,7 @@ const DrawingToolFormConnect = () => {
6599
6600
  isFormDirty
6600
6601
  }));
6601
6602
  }, [dispatch]);
6602
- return /*#__PURE__*/React.createElement(Wrapper, {
6603
+ return jsx(Wrapper, {
6603
6604
  id: drawing === null || drawing === void 0 ? void 0 : drawing.id,
6604
6605
  onSubmitForm: onSubmitForm,
6605
6606
  objectName: drawing === null || drawing === void 0 ? void 0 : drawing.objectName,
@@ -6619,22 +6620,6 @@ const DrawingToolFormConnect = () => {
6619
6620
  });
6620
6621
  };
6621
6622
 
6622
- /* *
6623
- * Licensed under the Apache License, Version 2.0 (the "License");
6624
- * you may not use this file except in compliance with the License.
6625
- * You may obtain a copy of the License at
6626
- *
6627
- * http://www.apache.org/licenses/LICENSE-2.0
6628
- *
6629
- * Unless required by applicable law or agreed to in writing, software
6630
- * distributed under the License is distributed on an "AS IS" BASIS,
6631
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6632
- * See the License for the specific language governing permissions and
6633
- * limitations under the License.
6634
- *
6635
- * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
6636
- * Copyright 2023 - Finnish Meteorological Institute (FMI)
6637
- * */
6638
6623
  const getDialogType = (mapId, isMultiMap) => {
6639
6624
  if (isMultiMap) {
6640
6625
  return `${uiTypes.DialogTypes.DrawingTool}-${mapId}`;
@@ -6668,8 +6653,7 @@ const DrawingToolConnect = ({
6668
6653
  setDialogOrder,
6669
6654
  isDialogOpen,
6670
6655
  uiSource,
6671
- uiIsLoading,
6672
- setFocused
6656
+ uiIsLoading
6673
6657
  } = useSetupDialog(dialogType, _source);
6674
6658
  const defaultTitle = title || t('drawing-tool-title');
6675
6659
  const shownTitle = _showMapIdInTitle ? `${defaultTitle} ${mapId}` : defaultTitle;
@@ -6689,7 +6673,7 @@ const DrawingToolConnect = ({
6689
6673
  };
6690
6674
  // eslint-disable-next-line react-hooks/exhaustive-deps
6691
6675
  }, []);
6692
- return /*#__PURE__*/React.createElement(DrawingTool, {
6676
+ return jsx(DrawingTool, Object.assign({
6693
6677
  bounds: bounds,
6694
6678
  isOpen: isDialogOpen,
6695
6679
  onClose: onClose,
@@ -6698,25 +6682,32 @@ const DrawingToolConnect = ({
6698
6682
  order: dialogOrder,
6699
6683
  source: uiSource,
6700
6684
  isLoading: uiIsLoading,
6701
- setFocused: setFocused,
6702
6685
  headerSize: "xs",
6703
6686
  startPosition: {
6704
6687
  top: 134,
6705
6688
  left: 50
6706
6689
  }
6707
- }, /*#__PURE__*/React.createElement(DrawingToolFormConnect, null));
6690
+ }, {
6691
+ children: jsx(DrawingToolFormConnect, {})
6692
+ }));
6708
6693
  };
6709
6694
 
6710
6695
  const WarningAvatar = ({
6711
6696
  editor,
6712
6697
  tooltipPlacement: _tooltipPlacement = 'bottom'
6713
6698
  }) => {
6714
- return /*#__PURE__*/React.createElement(CustomTooltip, {
6699
+ return jsx(CustomTooltip, Object.assign({
6715
6700
  title: `Editor: ${editor}`,
6716
6701
  placement: _tooltipPlacement
6717
- }, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Avatar, {
6718
- size: "small"
6719
- }, getInitials(editor))));
6702
+ }, {
6703
+ children: jsx("span", {
6704
+ children: jsx(Avatar, Object.assign({
6705
+ size: "small"
6706
+ }, {
6707
+ children: getInitials(editor)
6708
+ }))
6709
+ })
6710
+ }));
6720
6711
  };
6721
6712
 
6722
6713
  const DEFAULT_WARNING_DIALOG_SIZE = {
@@ -6741,7 +6732,6 @@ const PublicWarningsFormDialog = ({
6741
6732
  source: _source = 'app',
6742
6733
  size: _size = DEFAULT_WARNING_DIALOG_SIZE,
6743
6734
  startPosition: _startPosition = DEFAULT_WARNING_DIALOG_POSITION,
6744
- setFocused: _setFocused = () => {},
6745
6735
  headerSize: _headerSize = 'xs',
6746
6736
  children,
6747
6737
  isLoading: _isLoading = false,
@@ -6760,23 +6750,27 @@ const PublicWarningsFormDialog = ({
6760
6750
  _onChangeFormMode(!_isReadOnly);
6761
6751
  };
6762
6752
  const fullTitle = title || t('public-warning-title');
6763
- return /*#__PURE__*/React.createElement(ToolContainerDraggable, Object.assign({
6753
+ return jsxs(ToolContainerDraggable, Object.assign({
6764
6754
  title: _shouldHideFormMode ? fullTitle : undefined
6765
6755
  }, !_shouldHideFormMode && {
6766
- leftHeaderComponent: ( /*#__PURE__*/React.createElement(Box, {
6756
+ leftHeaderComponent: jsx(Box, Object.assign({
6767
6757
  className: "header-title"
6768
- }, /*#__PURE__*/React.createElement(Typography, {
6769
- variant: "h2",
6770
- noWrap: true,
6771
- sx: {
6772
- fontSize: 12,
6773
- fontWeight: 500,
6774
- lineHeight: '22px',
6775
- marginTop: '-1px',
6776
- paddingLeft: 1
6777
- },
6778
- role: "heading"
6779
- }, fullTitle)))
6758
+ }, {
6759
+ children: jsx(Typography, Object.assign({
6760
+ variant: "h2",
6761
+ noWrap: true,
6762
+ sx: {
6763
+ fontSize: 12,
6764
+ fontWeight: 500,
6765
+ lineHeight: '22px',
6766
+ marginTop: '-1px',
6767
+ paddingLeft: 1
6768
+ },
6769
+ role: "heading"
6770
+ }, {
6771
+ children: fullTitle
6772
+ }))
6773
+ }))
6780
6774
  }, {
6781
6775
  startSize: sizeInState,
6782
6776
  minWidth: minSize.width,
@@ -6787,8 +6781,6 @@ const PublicWarningsFormDialog = ({
6787
6781
  headerSize: _headerSize,
6788
6782
  bounds: bounds,
6789
6783
  onMouseDown: _onMouseDown,
6790
- onFocus: () => _setFocused(true),
6791
- onBlur: () => _setFocused(false),
6792
6784
  order: _order,
6793
6785
  source: _source,
6794
6786
  onResizeStop: (_event, _direction, node) => {
@@ -6808,7 +6800,7 @@ const PublicWarningsFormDialog = ({
6808
6800
  },
6809
6801
  dragHandleIcon: null
6810
6802
  }, !_shouldHideFormMode && {
6811
- rightHeaderComponent: ( /*#__PURE__*/React.createElement(Box, {
6803
+ rightHeaderComponent: jsxs(Box, Object.assign({
6812
6804
  sx: {
6813
6805
  flex: 1,
6814
6806
  overflow: 'hidden',
@@ -6821,26 +6813,32 @@ const PublicWarningsFormDialog = ({
6821
6813
  paddingLeft: 1,
6822
6814
  paddingRight: 0.5
6823
6815
  }
6824
- }, /*#__PURE__*/React.createElement(Box, {
6825
- sx: {
6826
- position: 'relative',
6827
- top: -7
6828
- }
6829
- }, /*#__PURE__*/React.createElement(SwitchButton, {
6830
- checked: !_isReadOnly,
6831
- onChange: onChangeMode,
6832
- activeLabel: t('warning-editor-user-editor'),
6833
- inActiveLabel: t('warning-editor-user-viewer')
6834
- })), /*#__PURE__*/React.createElement(Box, {
6835
- sx: {
6836
- position: 'relative',
6837
- top: 3,
6838
- right: '-2px',
6839
- width: '16px'
6840
- }
6841
- }, publicWarningEditor && ( /*#__PURE__*/React.createElement(WarningAvatar, {
6842
- editor: publicWarningEditor
6843
- })))))
6816
+ }, {
6817
+ children: [jsx(Box, Object.assign({
6818
+ sx: {
6819
+ position: 'relative',
6820
+ top: -7
6821
+ }
6822
+ }, {
6823
+ children: jsx(SwitchButton, {
6824
+ checked: !_isReadOnly,
6825
+ onChange: onChangeMode,
6826
+ activeLabel: t('warning-editor-user-editor'),
6827
+ inActiveLabel: t('warning-editor-user-viewer')
6828
+ })
6829
+ })), jsx(Box, Object.assign({
6830
+ sx: {
6831
+ position: 'relative',
6832
+ top: 3,
6833
+ right: '-2px',
6834
+ width: '16px'
6835
+ }
6836
+ }, {
6837
+ children: publicWarningEditor && jsx(WarningAvatar, {
6838
+ editor: publicWarningEditor
6839
+ })
6840
+ }))]
6841
+ }))
6844
6842
  }, {
6845
6843
  sx: {
6846
6844
  footer: {
@@ -6848,16 +6846,18 @@ const PublicWarningsFormDialog = ({
6848
6846
  boxShadow: 'none'
6849
6847
  }
6850
6848
  }
6851
- }), _isLoading && ( /*#__PURE__*/React.createElement(LinearProgress, {
6852
- "data-testid": "loading-bar",
6853
- color: "secondary",
6854
- sx: {
6855
- position: 'absolute',
6856
- width: '100%',
6857
- top: 0,
6858
- zIndex: 1
6859
- }
6860
- })), children);
6849
+ }, {
6850
+ children: [_isLoading && jsx(LinearProgress, {
6851
+ "data-testid": "loading-bar",
6852
+ color: "secondary",
6853
+ sx: {
6854
+ position: 'absolute',
6855
+ width: '100%',
6856
+ top: 0,
6857
+ zIndex: 1
6858
+ }
6859
+ }), children]
6860
+ }));
6861
6861
  };
6862
6862
 
6863
6863
  var aCallable = aCallable$3;
@@ -7498,41 +7498,49 @@ const CustomTabPanel = props => {
7498
7498
  isReadOnly = false
7499
7499
  } = props,
7500
7500
  other = __rest(props, ["children", "value", "index", "isDisabled", "isReadOnly"]);
7501
- return /*#__PURE__*/React__default.createElement("div", Object.assign({
7501
+ return jsxs("div", Object.assign({
7502
7502
  role: "tabpanel",
7503
7503
  hidden: value !== index,
7504
7504
  "aria-labelledby": `tab-${index}`,
7505
7505
  style: {
7506
7506
  position: 'relative'
7507
7507
  }
7508
- }, other), !isReadOnly && ( /*#__PURE__*/React__default.createElement(FormControl, {
7509
- variant: "standard",
7510
- sx: {
7511
- position: 'absolute',
7512
- zIndex: 1,
7513
- width: '50%',
7514
- maxWidth: '360px',
7515
- paddingLeft: 1.5,
7516
- '.MuiInputBase-root': {
7517
- marginTop: 0,
7518
- fontSize: '0.75rem'
7519
- },
7520
- '.MuiInputBase-formControl:before': {
7521
- borderBottom: 'none!important'
7508
+ }, other, {
7509
+ children: [!isReadOnly && jsx(FormControl, Object.assign({
7510
+ variant: "standard",
7511
+ sx: {
7512
+ position: 'absolute',
7513
+ zIndex: 1,
7514
+ width: '50%',
7515
+ maxWidth: '360px',
7516
+ paddingLeft: 1.5,
7517
+ '.MuiInputBase-root': {
7518
+ marginTop: 0,
7519
+ fontSize: '0.75rem'
7520
+ },
7521
+ '.MuiInputBase-formControl:before': {
7522
+ borderBottom: 'none!important'
7523
+ }
7522
7524
  }
7523
- }
7524
- }, /*#__PURE__*/React__default.createElement(ReactHookFormSelect, {
7525
- variant: "standard",
7526
- name: "translation-select",
7527
- value: "NL",
7528
- rules: {},
7529
- sx: {
7530
- color: 'geowebColors.textInputField.label.rgba'
7531
- },
7532
- disabled: isDisabled
7533
- }, /*#__PURE__*/React__default.createElement(MenuItem, {
7534
- value: "NL"
7535
- }, t('warning-description-NL'))))), children);
7525
+ }, {
7526
+ children: jsx(ReactHookFormSelect, Object.assign({
7527
+ variant: "standard",
7528
+ name: "translation-select",
7529
+ value: "NL",
7530
+ rules: {},
7531
+ sx: {
7532
+ color: 'geowebColors.textInputField.label.rgba'
7533
+ },
7534
+ disabled: isDisabled
7535
+ }, {
7536
+ children: jsx(MenuItem, Object.assign({
7537
+ value: "NL"
7538
+ }, {
7539
+ children: t('warning-description-NL')
7540
+ }))
7541
+ }))
7542
+ })), children]
7543
+ }));
7536
7544
  };
7537
7545
  const DescriptionField = ({
7538
7546
  isDisabled: _isDisabled = false,
@@ -7564,60 +7572,68 @@ const DescriptionField = ({
7564
7572
  setActiveTab(1);
7565
7573
  }
7566
7574
  }, [formState.errors, formState.submitCount]);
7567
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Tabs, Object.assign({
7568
- value: activeTab,
7569
- onChange: handleChange,
7570
- "aria-label": "description tabs"
7571
- }, _isDisabled && {
7572
- TabIndicatorProps: {
7573
- style: {
7574
- display: 'none'
7575
- },
7576
- 'aria-disabled': true
7577
- }
7578
- }), /*#__PURE__*/React__default.createElement(Tab, Object.assign({
7579
- sx: tabStyle,
7580
- label: t('warning-description-original'),
7581
- disabled: _isDisabled
7582
- }, a11yProps(0))), /*#__PURE__*/React__default.createElement(Tab, Object.assign({
7583
- sx: tabStyle,
7584
- label: t('warning-description-translation'),
7585
- disabled: _isDisabled
7586
- }, a11yProps(1)))), /*#__PURE__*/React__default.createElement(CustomTabPanel, {
7587
- value: activeTab,
7588
- index: 0,
7589
- isDisabled: _isDisabled,
7590
- isReadOnly: _isReadOnly
7591
- }, /*#__PURE__*/React__default.createElement(ReactHookFormTextField, {
7592
- rules: {
7593
- validate: {
7594
- isRequired
7595
- }
7596
- },
7597
- minRows: 4,
7598
- name: "descriptionOriginal",
7599
- multiline: true,
7600
- disabled: _isDisabled,
7601
- isReadOnly: _isReadOnly,
7602
- onKeyDown: event => event.stopPropagation()
7603
- })), /*#__PURE__*/React__default.createElement(CustomTabPanel, {
7604
- value: activeTab,
7605
- index: 1,
7606
- isDisabled: _isDisabled,
7607
- isReadOnly: _isReadOnly
7608
- }, /*#__PURE__*/React__default.createElement(ReactHookFormTextField, {
7609
- rules: {
7610
- validate: {
7611
- isRequired
7575
+ return jsxs(Fragment, {
7576
+ children: [jsxs(Tabs, Object.assign({
7577
+ value: activeTab,
7578
+ onChange: handleChange,
7579
+ "aria-label": "description tabs"
7580
+ }, _isDisabled && {
7581
+ TabIndicatorProps: {
7582
+ style: {
7583
+ display: 'none'
7584
+ },
7585
+ 'aria-disabled': true
7612
7586
  }
7613
- },
7614
- minRows: 4,
7615
- name: "descriptionTranslation",
7616
- multiline: true,
7617
- disabled: _isDisabled,
7618
- isReadOnly: _isReadOnly,
7619
- onKeyDown: event => event.stopPropagation()
7620
- })));
7587
+ }, {
7588
+ children: [jsx(Tab, Object.assign({
7589
+ sx: tabStyle,
7590
+ label: t('warning-description-original'),
7591
+ disabled: _isDisabled
7592
+ }, a11yProps(0))), jsx(Tab, Object.assign({
7593
+ sx: tabStyle,
7594
+ label: t('warning-description-translation'),
7595
+ disabled: _isDisabled
7596
+ }, a11yProps(1)))]
7597
+ })), jsx(CustomTabPanel, Object.assign({
7598
+ value: activeTab,
7599
+ index: 0,
7600
+ isDisabled: _isDisabled,
7601
+ isReadOnly: _isReadOnly
7602
+ }, {
7603
+ children: jsx(ReactHookFormTextField, {
7604
+ rules: {
7605
+ validate: {
7606
+ isRequired
7607
+ }
7608
+ },
7609
+ minRows: 4,
7610
+ name: "descriptionOriginal",
7611
+ multiline: true,
7612
+ disabled: _isDisabled,
7613
+ isReadOnly: _isReadOnly,
7614
+ onKeyDown: event => event.stopPropagation()
7615
+ })
7616
+ })), jsx(CustomTabPanel, Object.assign({
7617
+ value: activeTab,
7618
+ index: 1,
7619
+ isDisabled: _isDisabled,
7620
+ isReadOnly: _isReadOnly
7621
+ }, {
7622
+ children: jsx(ReactHookFormTextField, {
7623
+ rules: {
7624
+ validate: {
7625
+ isRequired
7626
+ }
7627
+ },
7628
+ minRows: 4,
7629
+ name: "descriptionTranslation",
7630
+ multiline: true,
7631
+ disabled: _isDisabled,
7632
+ isReadOnly: _isReadOnly,
7633
+ onKeyDown: event => event.stopPropagation()
7634
+ })
7635
+ }))]
7636
+ });
7621
7637
  };
7622
7638
 
7623
7639
  const formatDate = lastUpdatedTime => dateUtils.dateToString(dateUtils.isoStringToDate(lastUpdatedTime, false), `${dateUtils.DATE_FORMAT_DATEPICKER} 'UTC'`);
@@ -7650,129 +7666,127 @@ const AreaField = ({
7650
7666
  const geoJSON = getValues('geoJSON');
7651
7667
  const objectName = getObjectName(geoJSON, getValues('object.objectName'), t);
7652
7668
  const hasErrors = (errors === null || errors === void 0 ? void 0 : errors.geoJSON) !== undefined;
7653
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Typography, Object.assign({
7654
- variant: "h3",
7655
- color: "text.secondary",
7656
- sx: Object.assign({
7657
- fontSize: '0.75rem',
7658
- fontWeight: 'normal',
7659
- lineHeight: 1.83,
7660
- paddingLeft: 1.5
7669
+ return jsxs(Fragment, {
7670
+ children: [jsx(Typography, Object.assign({
7671
+ variant: "h3",
7672
+ color: "text.secondary",
7673
+ sx: Object.assign({
7674
+ fontSize: '0.75rem',
7675
+ fontWeight: 'normal',
7676
+ lineHeight: 1.83,
7677
+ paddingLeft: 1.5
7678
+ }, hasErrors && {
7679
+ color: 'geowebColors.captions.captionError.color'
7680
+ })
7661
7681
  }, hasErrors && {
7662
- color: 'geowebColors.captions.captionError.color'
7663
- })
7664
- }, hasErrors && {
7665
- 'aria-errormessage': errorMessages.required
7666
- }), t('warning-area')), /*#__PURE__*/React__default.createElement(Card, {
7667
- elevation: 0,
7668
- sx: Object.assign({}, !geoJSON && {
7669
- background: 'none'
7670
- })
7671
- }, /*#__PURE__*/React__default.createElement(CardContent, {
7672
- sx: {
7673
- position: 'relative',
7674
- padding: 1,
7675
- '&:last-child': {
7676
- paddingBottom: 1
7677
- }
7678
- }
7679
- }, /*#__PURE__*/React__default.createElement(Typography, {
7680
- variant: "h4",
7681
- color: "text.primary",
7682
- sx: {
7683
- fontSize: '0.75rem',
7684
- fontWeight: 'normal',
7685
- lineHeight: 1.83
7686
- },
7687
- role: "heading"
7688
- }, objectName), /*#__PURE__*/React__default.createElement(Typography, {
7689
- variant: "body2",
7690
- color: "text.secondary"
7691
- }, lastUpdatedTime ? formatDate(lastUpdatedTime) : ''), geoJSON ? ( /*#__PURE__*/React__default.createElement(ToggleMenu, {
7692
- menuTitle: t('object-manager-options-menu'),
7693
- tooltipTitle: t('object-manager-options-menu'),
7694
- buttonSx: {
7695
- position: 'absolute',
7696
- right: 0,
7697
- margin: 'auto',
7698
- top: 0,
7699
- bottom: 0,
7700
- marginRight: '8px'
7701
- },
7702
- menuPosition: "bottom",
7703
- isDisabled: _isDisabled,
7704
- menuItems: [{
7705
- text: t('object-manager-button-edit'),
7706
- action: _onEditObject,
7707
- icon: /*#__PURE__*/React__default.createElement(Edit, null)
7682
+ 'aria-errormessage': errorMessages.required
7708
7683
  }, {
7709
- text: t('object-manager-button-view'),
7710
- action: _onViewObject,
7711
- icon: /*#__PURE__*/React__default.createElement(Visibility, null)
7684
+ children: t('warning-area')
7685
+ })), jsx(Card, Object.assign({
7686
+ elevation: 0,
7687
+ sx: Object.assign({}, !geoJSON && {
7688
+ background: 'none'
7689
+ })
7712
7690
  }, {
7713
- text: t('object-manager-button-delete'),
7714
- action: _onDeleteObject,
7715
- icon: /*#__PURE__*/React__default.createElement(Delete, null)
7716
- }]
7717
- })) : null)), /*#__PURE__*/React__default.createElement(ReactHookFormHiddenInput, {
7718
- rules: {
7719
- validate: {
7720
- isRequired
7721
- }
7722
- },
7723
- name: "geoJSON"
7724
- }), /*#__PURE__*/React__default.createElement(Button, {
7725
- sx: {
7726
- marginTop: 1
7727
- },
7728
- variant: "tertiary",
7729
- startIcon: /*#__PURE__*/React__default.createElement(Add, null),
7730
- size: "small",
7731
- onClick: _onAddObject,
7732
- disabled: _isDisabled
7733
- }, t('warning-button-add-object')));
7691
+ children: jsxs(CardContent, Object.assign({
7692
+ sx: {
7693
+ position: 'relative',
7694
+ padding: 1,
7695
+ '&:last-child': {
7696
+ paddingBottom: 1
7697
+ }
7698
+ }
7699
+ }, {
7700
+ children: [jsx(Typography, Object.assign({
7701
+ variant: "h4",
7702
+ color: "text.primary",
7703
+ sx: {
7704
+ fontSize: '0.75rem',
7705
+ fontWeight: 'normal',
7706
+ lineHeight: 1.83
7707
+ },
7708
+ role: "heading"
7709
+ }, {
7710
+ children: objectName
7711
+ })), jsx(Typography, Object.assign({
7712
+ variant: "body2",
7713
+ color: "text.secondary"
7714
+ }, {
7715
+ children: lastUpdatedTime ? formatDate(lastUpdatedTime) : ''
7716
+ })), geoJSON ? jsx(ToggleMenu, {
7717
+ menuTitle: t('object-manager-options-menu'),
7718
+ tooltipTitle: t('object-manager-options-menu'),
7719
+ buttonSx: {
7720
+ position: 'absolute',
7721
+ right: 0,
7722
+ margin: 'auto',
7723
+ top: 0,
7724
+ bottom: 0,
7725
+ marginRight: '8px'
7726
+ },
7727
+ menuPosition: "bottom",
7728
+ isDisabled: _isDisabled,
7729
+ menuItems: [{
7730
+ text: t('object-manager-button-edit'),
7731
+ action: _onEditObject,
7732
+ icon: jsx(Edit, {})
7733
+ }, {
7734
+ text: t('object-manager-button-view'),
7735
+ action: _onViewObject,
7736
+ icon: jsx(Visibility, {})
7737
+ }, {
7738
+ text: t('object-manager-button-delete'),
7739
+ action: _onDeleteObject,
7740
+ icon: jsx(Delete, {})
7741
+ }]
7742
+ }) : null]
7743
+ }))
7744
+ })), jsx(ReactHookFormHiddenInput, {
7745
+ rules: {
7746
+ validate: {
7747
+ isRequired
7748
+ }
7749
+ },
7750
+ name: "geoJSON"
7751
+ }), jsx(Button, Object.assign({
7752
+ sx: {
7753
+ marginTop: 1
7754
+ },
7755
+ variant: "tertiary",
7756
+ startIcon: jsx(Add, {}),
7757
+ size: "small",
7758
+ onClick: _onAddObject,
7759
+ disabled: _isDisabled
7760
+ }, {
7761
+ children: t('warning-button-add-object')
7762
+ }))]
7763
+ });
7734
7764
  };
7735
7765
 
7736
- /* *
7737
- * Licensed under the Apache License, Version 2.0 (the "License");
7738
- * you may not use this file except in compliance with the License.
7739
- * You may obtain a copy of the License at
7740
- *
7741
- * http://www.apache.org/licenses/LICENSE-2.0
7742
- *
7743
- * Unless required by applicable law or agreed to in writing, software
7744
- * distributed under the License is distributed on an "AS IS" BASIS,
7745
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7746
- * See the License for the specific language governing permissions and
7747
- * limitations under the License.
7748
- *
7749
- * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
7750
- * Copyright 2023 - Finnish Meteorological Institute (FMI)
7751
- * */
7752
7766
  const warningPhenomena = t => [{
7753
7767
  title: t('warning-phenomenon-wind'),
7754
7768
  key: 'wind',
7755
- icon: /*#__PURE__*/React.createElement(Wind, null)
7769
+ icon: jsx(Wind, {})
7756
7770
  }, {
7757
7771
  title: t('warning-phenomenon-fog'),
7758
7772
  key: 'fog',
7759
- icon: /*#__PURE__*/React.createElement(Fog, null)
7773
+ icon: jsx(Fog, {})
7760
7774
  }, {
7761
7775
  title: t('warning-phenomenon-thunderstorm'),
7762
7776
  key: 'thunderstorm',
7763
- icon: /*#__PURE__*/React.createElement(Lightning, null)
7777
+ icon: jsx(Lightning, {})
7764
7778
  }, {
7765
7779
  title: t('warning-phenomenon-snow-ice'),
7766
7780
  key: 'snowIce',
7767
- icon: /*#__PURE__*/React.createElement(Snow, null)
7781
+ icon: jsx(Snow, {})
7768
7782
  }, {
7769
7783
  title: t('warning-phenomenon-rain'),
7770
7784
  key: 'rain',
7771
- icon: /*#__PURE__*/React.createElement(Rain, null)
7785
+ icon: jsx(Rain, {})
7772
7786
  }, {
7773
7787
  title: t('warning-phenomenon-high-temp'),
7774
7788
  key: 'highTemp',
7775
- icon: /*#__PURE__*/React.createElement(TemperatureHigh, null)
7789
+ icon: jsx(TemperatureHigh, {})
7776
7790
  },
7777
7791
  // {
7778
7792
  // title: t('warning-phenomenon-funnel-cloud'),
@@ -7782,11 +7796,11 @@ const warningPhenomena = t => [{
7782
7796
  {
7783
7797
  title: t('warning-phenomenon-low-temp'),
7784
7798
  key: 'lowTemp',
7785
- icon: /*#__PURE__*/React.createElement(TemperatureLow, null)
7799
+ icon: jsx(TemperatureLow, {})
7786
7800
  }, {
7787
7801
  title: t('warning-phenomenon-coastal-event'),
7788
7802
  key: 'coastalEvent',
7789
- icon: /*#__PURE__*/React.createElement(CoastalEvent, null)
7803
+ icon: jsx(CoastalEvent, {})
7790
7804
  }];
7791
7805
  const Phenomenon = ({
7792
7806
  isDisabled,
@@ -7798,7 +7812,7 @@ const Phenomenon = ({
7798
7812
  const {
7799
7813
  isRequired
7800
7814
  } = useDraftFormHelpers();
7801
- return /*#__PURE__*/React.createElement(ReactHookFormSelect, {
7815
+ return jsx(ReactHookFormSelect, Object.assign({
7802
7816
  name: "phenomenon",
7803
7817
  label: t('warning-phenomenon'),
7804
7818
  rules: {
@@ -7808,18 +7822,29 @@ const Phenomenon = ({
7808
7822
  },
7809
7823
  disabled: isDisabled || isReadOnly,
7810
7824
  isReadOnly: isReadOnly
7811
- }, warningPhenomena(t).map(phenomenon => {
7812
- return /*#__PURE__*/React.createElement(MenuItem, {
7813
- key: phenomenon.key,
7814
- value: phenomenon.key
7815
- }, /*#__PURE__*/React.createElement(Grid, {
7816
- container: true,
7817
- justifyContent: "space-between"
7818
- }, /*#__PURE__*/React.createElement(Grid, {
7819
- item: true
7820
- }, phenomenon.title), /*#__PURE__*/React.createElement(Grid, {
7821
- item: true
7822
- }, /*#__PURE__*/React.createElement(ListItemIcon, null, phenomenon.icon))));
7825
+ }, {
7826
+ children: warningPhenomena(t).map(phenomenon => {
7827
+ return jsx(MenuItem, Object.assign({
7828
+ value: phenomenon.key
7829
+ }, {
7830
+ children: jsxs(Grid, Object.assign({
7831
+ container: true,
7832
+ justifyContent: "space-between"
7833
+ }, {
7834
+ children: [jsx(Grid, Object.assign({
7835
+ item: true
7836
+ }, {
7837
+ children: phenomenon.title
7838
+ })), jsx(Grid, Object.assign({
7839
+ item: true
7840
+ }, {
7841
+ children: jsx(ListItemIcon, {
7842
+ children: phenomenon.icon
7843
+ })
7844
+ }))]
7845
+ }))
7846
+ }), phenomenon.key);
7847
+ })
7823
7848
  }));
7824
7849
  };
7825
7850
 
@@ -7872,7 +7897,7 @@ const LevelField = ({
7872
7897
  const onChangeLevel = () => {
7873
7898
  trigger(['level', 'probability']);
7874
7899
  };
7875
- return /*#__PURE__*/React.createElement(ReactHookFormSelect, {
7900
+ return jsx(ReactHookFormSelect, Object.assign({
7876
7901
  name: "level",
7877
7902
  label: t('warning-level'),
7878
7903
  rules: {
@@ -7890,47 +7915,34 @@ const LevelField = ({
7890
7915
  disabled: _isDisabled || _isReadOnly,
7891
7916
  isReadOnly: _isReadOnly,
7892
7917
  onChange: onChangeLevel
7893
- }, levelOptions(t).map(level => ( /*#__PURE__*/React.createElement(MenuItem, {
7894
- value: level.key,
7895
- key: level.key,
7896
- sx: {
7897
- '&.MuiMenuItem-root ': {
7898
- color: level.textColor,
7899
- background: level.color,
7900
- backgroundClip: 'content-box',
7901
- padding: '12px 8px',
7902
- '&:hover': {
7903
- backgroundColor: `${level.color}`,
7918
+ }, {
7919
+ children: levelOptions(t).map(level => jsxs(MenuItem, Object.assign({
7920
+ value: level.key,
7921
+ sx: {
7922
+ '&.MuiMenuItem-root ': {
7923
+ color: level.textColor,
7924
+ background: level.color,
7904
7925
  backgroundClip: 'content-box',
7905
- boxShadow: theme => `inset -8px -12px ${theme.palette.geowebColors.cards.cardContainerMouseOver}, inset 8px 12px ${theme.palette.geowebColors.cards.cardContainerMouseOver}`
7906
- },
7907
- '&.Mui-selected': {
7908
- backgroundColor: `${level.color}`,
7926
+ padding: '12px 8px',
7909
7927
  '&:hover': {
7910
- boxShadow: theme => `inset 4px 0px 0px 0px ${theme.palette.geowebColors.typographyAndIcons.iconLinkActive}, inset -8px -12px ${theme.palette.geowebColors.cards.cardContainerMouseOver}, inset 8px 12px ${theme.palette.geowebColors.cards.cardContainerMouseOver}`
7928
+ backgroundColor: `${level.color}`,
7929
+ backgroundClip: 'content-box',
7930
+ boxShadow: theme => `inset -8px -12px ${theme.palette.geowebColors.cards.cardContainerMouseOver}, inset 8px 12px ${theme.palette.geowebColors.cards.cardContainerMouseOver}`
7931
+ },
7932
+ '&.Mui-selected': {
7933
+ backgroundColor: `${level.color}`,
7934
+ '&:hover': {
7935
+ boxShadow: theme => `inset 4px 0px 0px 0px ${theme.palette.geowebColors.typographyAndIcons.iconLinkActive}, inset -8px -12px ${theme.palette.geowebColors.cards.cardContainerMouseOver}, inset 8px 12px ${theme.palette.geowebColors.cards.cardContainerMouseOver}`
7936
+ }
7911
7937
  }
7912
7938
  }
7913
7939
  }
7914
- }
7915
- }, "\u00A0", level.title))));
7940
+ }, {
7941
+ children: ["\u00A0", level.title]
7942
+ }), level.key))
7943
+ }));
7916
7944
  };
7917
7945
 
7918
- /* *
7919
- * Licensed under the Apache License, Version 2.0 (the "License");
7920
- * you may not use this file except in compliance with the License.
7921
- * You may obtain a copy of the License at
7922
- *
7923
- * http://www.apache.org/licenses/LICENSE-2.0
7924
- *
7925
- * Unless required by applicable law or agreed to in writing, software
7926
- * distributed under the License is distributed on an "AS IS" BASIS,
7927
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7928
- * See the License for the specific language governing permissions and
7929
- * limitations under the License.
7930
- *
7931
- * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
7932
- * Copyright 2023 - Finnish Meteorological Institute (FMI)
7933
- * */
7934
7946
  const VALID_FROM_MAX_HOURS_AFTER_CURRENT = 168;
7935
7947
  const isValueBeforeCurrentTime$1 = (value, t) => {
7936
7948
  return isXHoursBefore(value, dateUtils.getCurrentTimeAsString(), 0) || t('warning-valid-from-error-before-current');
@@ -7955,7 +7967,7 @@ const ValidFrom = ({
7955
7967
  const onChangeValidFrom = () => {
7956
7968
  trigger(['validFrom', 'validUntil']);
7957
7969
  };
7958
- return /*#__PURE__*/React.createElement(ReactHookFormDateTime, {
7970
+ return jsx(ReactHookFormDateTime, {
7959
7971
  name: "validFrom",
7960
7972
  rules: {
7961
7973
  validate: {
@@ -7975,22 +7987,6 @@ const ValidFrom = ({
7975
7987
  });
7976
7988
  };
7977
7989
 
7978
- /* *
7979
- * Licensed under the Apache License, Version 2.0 (the "License");
7980
- * you may not use this file except in compliance with the License.
7981
- * You may obtain a copy of the License at
7982
- *
7983
- * http://www.apache.org/licenses/LICENSE-2.0
7984
- *
7985
- * Unless required by applicable law or agreed to in writing, software
7986
- * distributed under the License is distributed on an "AS IS" BASIS,
7987
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7988
- * See the License for the specific language governing permissions and
7989
- * limitations under the License.
7990
- *
7991
- * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
7992
- * Copyright 2023 - Finnish Meteorological Institute (FMI)
7993
- * */
7994
7990
  const VALID_UNTIL_MAX_HOURS_AFTER_CURRENT = 180;
7995
7991
  const VALID_UNTIL_MIN_HOURS_AFTER_VALID_FROM = 1;
7996
7992
  const isValueBeforeCurrentTime = (value, t) => isXHoursBefore(value, dateUtils.getCurrentTimeAsString(), 0) || t('warning-valid-until-error-before-current');
@@ -8025,7 +8021,7 @@ const ValidUntil = ({
8025
8021
  const onChangeValidUntil = () => {
8026
8022
  trigger(['validFrom', 'validUntil']);
8027
8023
  };
8028
- return /*#__PURE__*/React.createElement(ReactHookFormDateTime, {
8024
+ return jsx(ReactHookFormDateTime, {
8029
8025
  name: "validUntil",
8030
8026
  rules: {
8031
8027
  validate: {
@@ -8075,7 +8071,8 @@ const zoomToFeature = (mapId, geojsonFeature) => {
8075
8071
  };
8076
8072
  const WarningsMapView = ({
8077
8073
  geojsonFeature,
8078
- defaultBbox: _defaultBbox = defaultBbox
8074
+ defaultBbox: _defaultBbox = defaultBbox,
8075
+ isSnapshot: _isSnapshot = false
8079
8076
  }) => {
8080
8077
  const mapId = React.useRef(`WarningsMapView_${generateMapId()}`).current;
8081
8078
  const warningLayer = {
@@ -8085,49 +8082,37 @@ const WarningsMapView = ({
8085
8082
  };
8086
8083
  // Zoom to the geojson when the geojsonFeature is updated in an already mounted map component
8087
8084
  zoomToFeature(mapId, geojsonFeature);
8088
- return /*#__PURE__*/React.createElement("div", {
8085
+ return jsx("div", Object.assign({
8089
8086
  style: {
8090
8087
  height: '200px',
8091
8088
  width: '100%'
8092
8089
  }
8093
- }, /*#__PURE__*/React.createElement(MapView, {
8094
- bbox: _defaultBbox.bbox,
8095
- srs: _defaultBbox.srs,
8096
- mapId: mapId,
8097
- showScaleBar: false,
8098
- onWMJSMount: mapId => {
8099
- const webmapjs = getWMJSMapById(mapId);
8100
- webmapjs.hideMouseCursorProperties();
8101
- if (!geojsonFeature) {
8102
- return;
8103
- }
8104
- // Zoom to the geojson when the map is ready
8105
- zoomToFeature(mapId, geojsonFeature);
8106
- },
8107
- holdShiftToScroll: true
8108
- }, /*#__PURE__*/React.createElement(MapViewLayer, Object.assign({}, defaultLayers.baseLayerGrey, {
8109
- id: `${mapId}_baseLayer}`
8110
- })), warningLayer.geojson && /*#__PURE__*/React.createElement(MapViewLayer, Object.assign({}, warningLayer)), /*#__PURE__*/React.createElement(MapViewLayer, Object.assign({}, defaultLayers.overLayer, {
8111
- id: `${mapId}_overlayer}`
8112
- }))));
8090
+ }, {
8091
+ children: jsxs(MapView, Object.assign({
8092
+ bbox: _defaultBbox.bbox,
8093
+ srs: _defaultBbox.srs,
8094
+ mapId: mapId,
8095
+ showScaleBar: false,
8096
+ onWMJSMount: mapId => {
8097
+ const webmapjs = getWMJSMapById(mapId);
8098
+ webmapjs.hideMouseCursorProperties();
8099
+ if (!geojsonFeature) {
8100
+ return;
8101
+ }
8102
+ // Zoom to the geojson when the map is ready
8103
+ zoomToFeature(mapId, geojsonFeature);
8104
+ },
8105
+ holdShiftToScroll: true
8106
+ }, {
8107
+ children: [!_isSnapshot && jsx(MapViewLayer, Object.assign({}, defaultLayers.baseLayerGrey, {
8108
+ id: `${mapId}_baseLayer}`
8109
+ })), warningLayer.geojson && jsx(MapViewLayer, Object.assign({}, warningLayer)), !_isSnapshot && jsx(MapViewLayer, Object.assign({}, defaultLayers.overLayer, {
8110
+ id: `${mapId}_overlayer}`
8111
+ }))]
8112
+ }))
8113
+ }));
8113
8114
  };
8114
8115
 
8115
- /* *
8116
- * Licensed under the Apache License, Version 2.0 (the "License");
8117
- * you may not use this file except in compliance with the License.
8118
- * You may obtain a copy of the License at
8119
- *
8120
- * http://www.apache.org/licenses/LICENSE-2.0
8121
- *
8122
- * Unless required by applicable law or agreed to in writing, software
8123
- * distributed under the License is distributed on an "AS IS" BASIS,
8124
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8125
- * See the License for the specific language governing permissions and
8126
- * limitations under the License.
8127
- *
8128
- * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
8129
- * Copyright 2023 - Finnish Meteorological Institute (FMI)
8130
- * */
8131
8116
  const probablityOptions = [100, 90, 80, 70, 60, 50, 40, 30, 20, 10];
8132
8117
  const defaultProbability = 30;
8133
8118
  const ProbabilityField = ({
@@ -8157,7 +8142,7 @@ const ProbabilityField = ({
8157
8142
  trigger('level');
8158
8143
  }
8159
8144
  };
8160
- return /*#__PURE__*/React.createElement(ReactHookFormSelect, {
8145
+ return jsx(ReactHookFormSelect, Object.assign({
8161
8146
  name: "probability",
8162
8147
  label: t('warning-probability'),
8163
8148
  rules: {
@@ -8170,10 +8155,13 @@ const ProbabilityField = ({
8170
8155
  isReadOnly: isReadOnly,
8171
8156
  defaultValue: defaultProbability,
8172
8157
  onChange: onChangeProbability
8173
- }, probablityOptions.map(probability => ( /*#__PURE__*/React.createElement(MenuItem, {
8174
- value: probability,
8175
- key: probability
8176
- }, probability, " %"))));
8158
+ }, {
8159
+ children: probablityOptions.map(probability => jsxs(MenuItem, Object.assign({
8160
+ value: probability
8161
+ }, {
8162
+ children: [probability, " %"]
8163
+ }), probability))
8164
+ }));
8177
8165
  };
8178
8166
 
8179
8167
  const getEmptyPublicWarning = () => {
@@ -8283,14 +8271,16 @@ const getErrors = errors => errors ? errors === null || errors === void 0 ? void
8283
8271
  const isEven = index % 2 === 0;
8284
8272
  return Object.assign(Object.assign({}, allErrors), {
8285
8273
  errors: allErrors.errors.concat(
8286
- /*#__PURE__*/
8287
8274
  // eslint-disable-next-line react/no-array-index-key
8288
- React.createElement("p", {
8289
- key: `error-${index}`,
8275
+ jsx("p", Object.assign({
8290
8276
  style: {
8291
8277
  fontSize: 14
8292
8278
  }
8293
- }, isEven ? error : /*#__PURE__*/React.createElement("i", null, error)))
8279
+ }, {
8280
+ children: isEven ? error : jsx("i", {
8281
+ children: error
8282
+ })
8283
+ }), `error-${index}`))
8294
8284
  });
8295
8285
  }, {
8296
8286
  title: '',
@@ -8308,7 +8298,8 @@ const Form = ({
8308
8298
  message: ''
8309
8299
  },
8310
8300
  isReadOnly: _isReadOnly2 = false,
8311
- onFormDirty: _onFormDirty = () => {}
8301
+ onFormDirty: _onFormDirty = () => {},
8302
+ isSnapshot: _isSnapshot = false
8312
8303
  }) => {
8313
8304
  const {
8314
8305
  t
@@ -8376,164 +8367,223 @@ const Form = ({
8376
8367
  Object.assign(draftFeature.properties, Object.assign(Object.assign({}, defaultProps), draftFeature.properties));
8377
8368
  }
8378
8369
  });
8379
- return /*#__PURE__*/React.createElement(ContainerWrapper, null, /*#__PURE__*/React.createElement(ContainerFormWrapper, {
8380
- isReadOnly: _isReadOnly2
8381
- }, /*#__PURE__*/React.createElement(ContainerGrid, null, errors && ( /*#__PURE__*/React.createElement(Box, {
8382
- sx: {
8383
- marginBottom: 2
8384
- }
8385
- }, /*#__PURE__*/React.createElement(AlertBanner, {
8386
- title: errors.title,
8387
- info: errors.errors,
8388
- shouldClose: true,
8389
- severity: _error === null || _error === void 0 ? void 0 : _error.severity
8390
- }))), /*#__PURE__*/React.createElement(Grid, {
8391
- container: true,
8392
- rowSpacing: 2
8393
- }, /*#__PURE__*/React.createElement(Grid, {
8394
- item: true,
8395
- xs: 12
8396
- }, /*#__PURE__*/React.createElement(Phenomenon, {
8397
- isDisabled: areFieldsDisabled,
8398
- isReadOnly: _isReadOnly2
8399
- })), /*#__PURE__*/React.createElement(Grid, {
8400
- item: true,
8401
- xs: 12
8402
- }, /*#__PURE__*/React.createElement(Grid, {
8403
- item: true,
8404
- xs: 12
8405
- }, /*#__PURE__*/React.createElement(AreaField, {
8406
- isDisabled: true,
8407
- onEditObject: () => {},
8408
- onViewObject: () => {},
8409
- onDeleteObject: () => {},
8410
- onAddObject: () => {}
8411
- }))), /*#__PURE__*/React.createElement(Grid, {
8412
- item: true,
8413
- xs: 12,
8414
- container: true
8415
- }, /*#__PURE__*/React.createElement(Grid, {
8416
- item: true,
8417
- xs: 12
8418
- }, /*#__PURE__*/React.createElement(WarningsMapView, {
8419
- geojsonFeature: warningGeoJSONFeatureWithFillProps,
8420
- defaultBbox: defaultBbox
8421
- }))), /*#__PURE__*/React.createElement(Grid, {
8422
- item: true,
8423
- xs: 12,
8424
- container: true,
8425
- spacing: 2
8426
- }, /*#__PURE__*/React.createElement(Grid, {
8427
- item: true,
8428
- xs: 12,
8429
- sm: 6
8430
- }, /*#__PURE__*/React.createElement(ValidFrom, {
8431
- isDisabled: areFieldsDisabled,
8432
- isReadOnly: _isReadOnly2
8433
- })), /*#__PURE__*/React.createElement(Grid, {
8434
- item: true,
8435
- xs: 12,
8436
- sm: 6
8437
- }, /*#__PURE__*/React.createElement(ValidUntil, {
8438
- isDisabled: areFieldsDisabled,
8439
- isReadOnly: _isReadOnly2
8440
- }))), /*#__PURE__*/React.createElement(Grid, {
8441
- item: true,
8442
- xs: 12,
8443
- container: true,
8444
- spacing: 2
8445
- }, /*#__PURE__*/React.createElement(Grid, {
8446
- item: true,
8447
- xs: 12,
8448
- sm: 6
8449
- }, /*#__PURE__*/React.createElement(LevelField, {
8450
- isDisabled: areFieldsDisabled,
8451
- isReadOnly: _isReadOnly2
8452
- })), /*#__PURE__*/React.createElement(Grid, {
8453
- item: true,
8454
- xs: 12,
8455
- sm: 6
8456
- }, /*#__PURE__*/React.createElement(ProbabilityField, {
8457
- isDisabled: areFieldsDisabled,
8458
- isReadOnly: _isReadOnly2
8459
- }))), /*#__PURE__*/React.createElement(Grid, {
8460
- item: true,
8461
- xs: 12,
8462
- container: true,
8463
- spacing: 2
8464
- }, /*#__PURE__*/React.createElement(Grid, {
8465
- item: true,
8466
- xs: 12
8467
- }, /*#__PURE__*/React.createElement(DescriptionField, {
8468
- isDisabled: areFieldsDisabled,
8469
- isReadOnly: _isReadOnly2
8470
- }))))), /*#__PURE__*/React.createElement(DraftFieldHelper, null), /*#__PURE__*/React.createElement(ReactHookFormHiddenInput, {
8471
- name: "id"
8472
- })), !_isReadOnly2 && ( /*#__PURE__*/React.createElement(Box, {
8473
- sx: {
8474
- padding: '24px 10px 14px 10px',
8475
- position: 'absolute',
8476
- bottom: 0,
8477
- width: '100%',
8478
- backgroundColor: 'geowebColors.background.surfaceApp',
8479
- boxShadow: '0 2px 4px 0 rgba(0, 0, 0, 0.5)',
8480
- zIndex: 1
8481
- }
8482
- }, /*#__PURE__*/React.createElement(ContainerGrid, null, /*#__PURE__*/React.createElement(Grid, {
8483
- container: true,
8484
- spacing: 2
8485
- }, /*#__PURE__*/React.createElement(Grid, {
8486
- item: true,
8487
- xs: 12,
8488
- sm: 4
8489
- }, /*#__PURE__*/React.createElement(Button, {
8490
- variant: "tertiary",
8491
- sx: {
8492
- width: '100%',
8493
- marginBottom: 1
8494
- },
8495
- disabled: areFieldsDisabled,
8496
- onClick: onPressClear
8497
- }, t('warning-button-clear'))), /*#__PURE__*/React.createElement(Grid, {
8498
- item: true,
8499
- xs: 12,
8500
- sm: 4
8501
- }, /*#__PURE__*/React.createElement(Button, {
8502
- variant: "tertiary",
8503
- sx: {
8504
- width: '100%',
8505
- marginBottom: 1
8506
- },
8507
- disabled: isPublishing,
8508
- onClick: onPressSave
8509
- }, /*#__PURE__*/React.createElement("span", {
8510
- style: {
8511
- position: 'relative'
8512
- }
8513
- }, isSaving ? t('warning-button-saving') : t('warning-button-save'), isSaving && ( /*#__PURE__*/React.createElement(CircularProgress, {
8514
- "data-testid": "spinner",
8515
- color: "inherit",
8516
- sx: spinnerSx
8517
- }))))), /*#__PURE__*/React.createElement(Grid, {
8518
- item: true,
8519
- xs: 12,
8520
- sm: 4
8521
- }, /*#__PURE__*/React.createElement(Button, {
8522
- variant: "primary",
8523
- sx: {
8524
- width: '100%'
8525
- },
8526
- disabled: isSaving,
8527
- onClick: onPressPublish
8528
- }, /*#__PURE__*/React.createElement("span", {
8529
- style: {
8530
- position: 'relative'
8531
- }
8532
- }, isPublishing ? t('warning-button-publishing') : t('warning-button-publish'), isPublishing && ( /*#__PURE__*/React.createElement(CircularProgress, {
8533
- "data-testid": "spinner",
8534
- color: "inherit",
8535
- sx: spinnerSx
8536
- }))))))))));
8370
+ return jsxs(ContainerWrapper, {
8371
+ children: [jsxs(ContainerFormWrapper, Object.assign({
8372
+ isReadOnly: _isReadOnly2
8373
+ }, {
8374
+ children: [jsxs(ContainerGrid, {
8375
+ children: [errors && jsx(Box, Object.assign({
8376
+ sx: {
8377
+ marginBottom: 2
8378
+ }
8379
+ }, {
8380
+ children: jsx(AlertBanner, {
8381
+ title: errors.title,
8382
+ info: errors.errors,
8383
+ shouldClose: true,
8384
+ severity: _error === null || _error === void 0 ? void 0 : _error.severity
8385
+ })
8386
+ })), jsxs(Grid, Object.assign({
8387
+ container: true,
8388
+ rowSpacing: 2
8389
+ }, {
8390
+ children: [jsx(Grid, Object.assign({
8391
+ item: true,
8392
+ xs: 12
8393
+ }, {
8394
+ children: jsx(Phenomenon, {
8395
+ isDisabled: areFieldsDisabled,
8396
+ isReadOnly: _isReadOnly2
8397
+ })
8398
+ })), jsx(Grid, Object.assign({
8399
+ item: true,
8400
+ xs: 12
8401
+ }, {
8402
+ children: jsx(Grid, Object.assign({
8403
+ item: true,
8404
+ xs: 12
8405
+ }, {
8406
+ children: jsx(AreaField, {
8407
+ isDisabled: true,
8408
+ onEditObject: () => {},
8409
+ onViewObject: () => {},
8410
+ onDeleteObject: () => {},
8411
+ onAddObject: () => {}
8412
+ })
8413
+ }))
8414
+ })), jsx(Grid, Object.assign({
8415
+ item: true,
8416
+ xs: 12,
8417
+ container: true
8418
+ }, {
8419
+ children: jsx(Grid, Object.assign({
8420
+ item: true,
8421
+ xs: 12
8422
+ }, {
8423
+ children: jsx(WarningsMapView, {
8424
+ geojsonFeature: warningGeoJSONFeatureWithFillProps,
8425
+ defaultBbox: defaultBbox,
8426
+ isSnapshot: _isSnapshot
8427
+ })
8428
+ }))
8429
+ })), jsxs(Grid, Object.assign({
8430
+ item: true,
8431
+ xs: 12,
8432
+ container: true,
8433
+ spacing: 2
8434
+ }, {
8435
+ children: [jsx(Grid, Object.assign({
8436
+ item: true,
8437
+ xs: 12,
8438
+ sm: 6
8439
+ }, {
8440
+ children: jsx(ValidFrom, {
8441
+ isDisabled: areFieldsDisabled,
8442
+ isReadOnly: _isReadOnly2
8443
+ })
8444
+ })), jsx(Grid, Object.assign({
8445
+ item: true,
8446
+ xs: 12,
8447
+ sm: 6
8448
+ }, {
8449
+ children: jsx(ValidUntil, {
8450
+ isDisabled: areFieldsDisabled,
8451
+ isReadOnly: _isReadOnly2
8452
+ })
8453
+ }))]
8454
+ })), jsxs(Grid, Object.assign({
8455
+ item: true,
8456
+ xs: 12,
8457
+ container: true,
8458
+ spacing: 2
8459
+ }, {
8460
+ children: [jsx(Grid, Object.assign({
8461
+ item: true,
8462
+ xs: 12,
8463
+ sm: 6
8464
+ }, {
8465
+ children: jsx(LevelField, {
8466
+ isDisabled: areFieldsDisabled,
8467
+ isReadOnly: _isReadOnly2
8468
+ })
8469
+ })), jsx(Grid, Object.assign({
8470
+ item: true,
8471
+ xs: 12,
8472
+ sm: 6
8473
+ }, {
8474
+ children: jsx(ProbabilityField, {
8475
+ isDisabled: areFieldsDisabled,
8476
+ isReadOnly: _isReadOnly2
8477
+ })
8478
+ }))]
8479
+ })), jsx(Grid, Object.assign({
8480
+ item: true,
8481
+ xs: 12,
8482
+ container: true,
8483
+ spacing: 2
8484
+ }, {
8485
+ children: jsx(Grid, Object.assign({
8486
+ item: true,
8487
+ xs: 12
8488
+ }, {
8489
+ children: jsx(DescriptionField, {
8490
+ isDisabled: areFieldsDisabled,
8491
+ isReadOnly: _isReadOnly2
8492
+ })
8493
+ }))
8494
+ }))]
8495
+ }))]
8496
+ }), jsx(DraftFieldHelper, {}), jsx(ReactHookFormHiddenInput, {
8497
+ name: "id"
8498
+ })]
8499
+ })), !_isReadOnly2 && jsx(Box, Object.assign({
8500
+ sx: {
8501
+ padding: '24px 10px 14px 10px',
8502
+ position: 'absolute',
8503
+ bottom: 0,
8504
+ width: '100%',
8505
+ backgroundColor: 'geowebColors.background.surfaceApp',
8506
+ boxShadow: '0 2px 4px 0 rgba(0, 0, 0, 0.5)',
8507
+ zIndex: 1
8508
+ }
8509
+ }, {
8510
+ children: jsx(ContainerGrid, {
8511
+ children: jsxs(Grid, Object.assign({
8512
+ container: true,
8513
+ spacing: 2
8514
+ }, {
8515
+ children: [jsx(Grid, Object.assign({
8516
+ item: true,
8517
+ xs: 12,
8518
+ sm: 4
8519
+ }, {
8520
+ children: jsx(Button, Object.assign({
8521
+ variant: "tertiary",
8522
+ sx: {
8523
+ width: '100%',
8524
+ marginBottom: 1
8525
+ },
8526
+ disabled: areFieldsDisabled,
8527
+ onClick: onPressClear
8528
+ }, {
8529
+ children: t('warning-button-clear')
8530
+ }))
8531
+ })), jsx(Grid, Object.assign({
8532
+ item: true,
8533
+ xs: 12,
8534
+ sm: 4
8535
+ }, {
8536
+ children: jsx(Button, Object.assign({
8537
+ variant: "tertiary",
8538
+ sx: {
8539
+ width: '100%',
8540
+ marginBottom: 1
8541
+ },
8542
+ disabled: isPublishing,
8543
+ onClick: onPressSave
8544
+ }, {
8545
+ children: jsxs("span", Object.assign({
8546
+ style: {
8547
+ position: 'relative'
8548
+ }
8549
+ }, {
8550
+ children: [isSaving ? t('warning-button-saving') : t('warning-button-save'), isSaving && jsx(CircularProgress, {
8551
+ "data-testid": "spinner",
8552
+ color: "inherit",
8553
+ sx: spinnerSx
8554
+ })]
8555
+ }))
8556
+ }))
8557
+ })), jsx(Grid, Object.assign({
8558
+ item: true,
8559
+ xs: 12,
8560
+ sm: 4
8561
+ }, {
8562
+ children: jsx(Button, Object.assign({
8563
+ variant: "primary",
8564
+ sx: {
8565
+ width: '100%'
8566
+ },
8567
+ disabled: isSaving,
8568
+ onClick: onPressPublish
8569
+ }, {
8570
+ children: jsxs("span", Object.assign({
8571
+ style: {
8572
+ position: 'relative'
8573
+ }
8574
+ }, {
8575
+ children: [isPublishing ? t('warning-button-publishing') : t('warning-button-publish'), isPublishing && jsx(CircularProgress, {
8576
+ "data-testid": "spinner",
8577
+ color: "inherit",
8578
+ sx: spinnerSx
8579
+ })]
8580
+ }))
8581
+ }))
8582
+ }))]
8583
+ }))
8584
+ })
8585
+ }))]
8586
+ });
8537
8587
  };
8538
8588
  const PublicWarningsForm = props => {
8539
8589
  const {
@@ -8541,12 +8591,14 @@ const PublicWarningsForm = props => {
8541
8591
  publicWarningDetails
8542
8592
  } = props;
8543
8593
  const defaultValues = getFormData(publicWarningDetails, object);
8544
- return /*#__PURE__*/React.createElement(ReactHookFormProvider, {
8594
+ return jsx(ReactHookFormProvider, Object.assign({
8545
8595
  options: Object.assign(Object.assign({}, defaultFormOptions), {
8546
8596
  mode: 'onSubmit',
8547
8597
  defaultValues
8548
8598
  })
8549
- }, /*#__PURE__*/React.createElement(Form, Object.assign({}, props)));
8599
+ }, {
8600
+ children: jsx(Form, Object.assign({}, props))
8601
+ }));
8550
8602
  };
8551
8603
 
8552
8604
  /* *
@@ -8586,22 +8638,6 @@ const getPublicWarningFormError = createSelector(getPublicWarningStore, publicWa
8586
8638
  const getSelectedPublicWarningId = createSelector(getPublicWarningStore, publicWarningStore => (publicWarningStore === null || publicWarningStore === void 0 ? void 0 : publicWarningStore.selectedPublicWarningId) || '');
8587
8639
  const getSelectedPublicIsFormDirty = createSelector(getPublicWarningStore, publicWarningStore => (publicWarningStore === null || publicWarningStore === void 0 ? void 0 : publicWarningStore.isFormDirty) || false);
8588
8640
 
8589
- /* *
8590
- * Licensed under the Apache License, Version 2.0 (the "License");
8591
- * you may not use this file except in compliance with the License.
8592
- * You may obtain a copy of the License at
8593
- *
8594
- * http://www.apache.org/licenses/LICENSE-2.0
8595
- *
8596
- * Unless required by applicable law or agreed to in writing, software
8597
- * distributed under the License is distributed on an "AS IS" BASIS,
8598
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8599
- * See the License for the specific language governing permissions and
8600
- * limitations under the License.
8601
- *
8602
- * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
8603
- * Copyright 2023 - Finnish Meteorological Institute (FMI)
8604
- * */
8605
8641
  const PublicWarningsFormConnect = ({
8606
8642
  defaultBbox
8607
8643
  }) => {
@@ -8649,7 +8685,7 @@ const PublicWarningsFormConnect = ({
8649
8685
  };
8650
8686
  // Readonly also in case you are not creating a new warning and you are not set as the editor
8651
8687
  const isReadOnly = getIsReadOnly();
8652
- return /*#__PURE__*/React.createElement(PublicWarningsForm, {
8688
+ return jsx(PublicWarningsForm, {
8653
8689
  object: publicWarningObject,
8654
8690
  publicWarningDetails: publicWarning === null || publicWarning === void 0 ? void 0 : publicWarning.warningDetail,
8655
8691
  onPublishForm: publishForm,
@@ -8765,7 +8801,7 @@ const PublicWarningsFormDialogConnect = ({
8765
8801
  const isReadOnly = formAction === 'readonly' || !isEditor && publicWarningStatus !== undefined;
8766
8802
  // Only show toggle if in draft status
8767
8803
  const shouldHideFormToggleMode = publicWarningStatus !== 'DRAFT' && publicWarningStatus !== 'DRAFT_PUBLISHED';
8768
- return /*#__PURE__*/React__default.createElement(PublicWarningsFormDialog, {
8804
+ return jsx(PublicWarningsFormDialog, Object.assign({
8769
8805
  isOpen: isDialogOpen,
8770
8806
  onClose: closeDialog,
8771
8807
  order: dialogOrder,
@@ -8778,8 +8814,10 @@ const PublicWarningsFormDialogConnect = ({
8778
8814
  onChangeFormMode: onChangeFormMode,
8779
8815
  shouldHideFormMode: shouldHideFormToggleMode,
8780
8816
  publicWarningEditor: publicWarningEditor
8781
- }, /*#__PURE__*/React__default.createElement(PublicWarningsFormConnect, {
8782
- defaultBbox: defaultBbox
8817
+ }, {
8818
+ children: jsx(PublicWarningsFormConnect, {
8819
+ defaultBbox: defaultBbox
8820
+ })
8783
8821
  }));
8784
8822
  };
8785
8823
 
@@ -8853,7 +8891,7 @@ const getWarningWithoutIdStatusEditor = warning => {
8853
8891
  });
8854
8892
  };
8855
8893
  const getStatusIcon = warning => {
8856
- const getStatusTag = (content, color, icon = null) => ( /*#__PURE__*/React__default.createElement(StatusTag, {
8894
+ const getStatusTag = (content, color, icon = null) => jsx(StatusTag, {
8857
8895
  content: content,
8858
8896
  color: color,
8859
8897
  sx: {
@@ -8862,12 +8900,12 @@ const getStatusIcon = warning => {
8862
8900
  marginRight: 2
8863
8901
  },
8864
8902
  icon: icon
8865
- }));
8903
+ });
8866
8904
  switch (warning.status) {
8867
8905
  case 'TODO':
8868
8906
  return null;
8869
8907
  case 'DRAFT':
8870
- return /*#__PURE__*/React__default.createElement(Box, {
8908
+ return jsx(Box, Object.assign({
8871
8909
  sx: {
8872
8910
  height: '16px',
8873
8911
  padding: '0px',
@@ -8876,9 +8914,11 @@ const getStatusIcon = warning => {
8876
8914
  justifyContent: 'center',
8877
8915
  color: 'geowebColors.iconButtons.flat.default.color'
8878
8916
  }
8879
- }, /*#__PURE__*/React__default.createElement(Edit, null));
8917
+ }, {
8918
+ children: jsx(Edit, {})
8919
+ }));
8880
8920
  case 'DRAFT_PUBLISHED':
8881
- return getStatusTag('Pub', 'green', /*#__PURE__*/React__default.createElement(Edit, {
8921
+ return getStatusTag('Pub', 'green', jsx(Edit, {
8882
8922
  sx: {
8883
8923
  width: 20,
8884
8924
  height: 20,
@@ -8898,23 +8938,27 @@ const WarningListHeaderContent = _a => {
8898
8938
  width = 76
8899
8939
  } = _a,
8900
8940
  props = __rest(_a, ["title", "width"]);
8901
- return /*#__PURE__*/React__default.createElement(Grid, Object.assign({
8941
+ return jsx(Grid, Object.assign({
8902
8942
  item: true
8903
8943
  }, props, {
8904
8944
  sx: Object.assign(Object.assign({}, props.sx), {
8905
8945
  width
8906
8946
  })
8907
- }), /*#__PURE__*/React__default.createElement(Box, {
8908
- sx: {
8909
- overflow: 'hidden',
8910
- fontWeight: 'normal',
8911
- textOverflow: 'ellipsis',
8912
- fontSize: 12,
8913
- lineHeight: 1.33,
8914
- height: 16,
8915
- color: 'geowebColors.captions.captionStatus.rgba'
8916
- }
8917
- }, title));
8947
+ }, {
8948
+ children: jsx(Box, Object.assign({
8949
+ sx: {
8950
+ overflow: 'hidden',
8951
+ fontWeight: 'normal',
8952
+ textOverflow: 'ellipsis',
8953
+ fontSize: 12,
8954
+ lineHeight: 1.33,
8955
+ height: 16,
8956
+ color: 'geowebColors.captions.captionStatus.rgba'
8957
+ }
8958
+ }, {
8959
+ children: title
8960
+ }))
8961
+ }));
8918
8962
  };
8919
8963
  const WarningListColumnContent = _a => {
8920
8964
  var {
@@ -8924,34 +8968,40 @@ const WarningListColumnContent = _a => {
8924
8968
  width = 76
8925
8969
  } = _a,
8926
8970
  props = __rest(_a, ["title", "status", "children", "width"]);
8927
- return /*#__PURE__*/React__default.createElement(Grid, Object.assign({
8971
+ return jsxs(Grid, Object.assign({
8928
8972
  item: true
8929
8973
  }, props, {
8930
8974
  sx: Object.assign(Object.assign({}, props.sx), {
8931
8975
  width
8932
8976
  })
8933
- }), title && ( /*#__PURE__*/React__default.createElement(Box, {
8934
- sx: {
8935
- overflow: 'hidden',
8936
- fontWeight: 'normal',
8937
- textOverflow: 'ellipsis',
8938
- fontSize: 10,
8939
- lineHeight: 1.6,
8940
- height: 12,
8941
- color: status === 'EXPIRED' ? 'geowebColors.typographyAndIcons.inactiveText' : 'geowebColors.captions.captionStatus.rgba',
8942
- display: 'block',
8943
- [`@container publicWarningList (min-width: ${breakpoints.desktop}px)`]: {
8944
- display: 'none'
8977
+ }, {
8978
+ children: [title && jsx(Box, Object.assign({
8979
+ sx: {
8980
+ overflow: 'hidden',
8981
+ fontWeight: 'normal',
8982
+ textOverflow: 'ellipsis',
8983
+ fontSize: 10,
8984
+ lineHeight: 1.6,
8985
+ height: 12,
8986
+ color: status === 'EXPIRED' ? 'geowebColors.typographyAndIcons.inactiveText' : 'geowebColors.captions.captionStatus.rgba',
8987
+ display: 'block',
8988
+ [`@container publicWarningList (min-width: ${breakpoints.desktop}px)`]: {
8989
+ display: 'none'
8990
+ }
8945
8991
  }
8946
- }
8947
- }, title)), /*#__PURE__*/React__default.createElement(Box, {
8948
- sx: {
8949
- overflow: 'visible',
8950
- fontSize: 12,
8951
- lineHeight: 1.2,
8952
- color: status === 'EXPIRED' ? 'geowebColors.typographyAndIcons.inactiveText' : 'geowebColors.typographyAndIcons.text'
8953
- }
8954
- }, children || '-'));
8992
+ }, {
8993
+ children: title
8994
+ })), jsx(Box, Object.assign({
8995
+ sx: {
8996
+ overflow: 'visible',
8997
+ fontSize: 12,
8998
+ lineHeight: 1.2,
8999
+ color: status === 'EXPIRED' ? 'geowebColors.typographyAndIcons.inactiveText' : 'geowebColors.typographyAndIcons.text'
9000
+ }
9001
+ }, {
9002
+ children: children || '-'
9003
+ }))]
9004
+ }));
8955
9005
  };
8956
9006
  const WarningsOnStatus = ({
8957
9007
  warnings,
@@ -8982,23 +9032,23 @@ const WarningsOnStatus = ({
8982
9032
  const duplicate = {
8983
9033
  text: t('warning-list-button-duplicate'),
8984
9034
  action: () => _onEditWarning(getWarningWithoutIdStatusEditor(warning)),
8985
- icon: /*#__PURE__*/React__default.createElement(Copy, null)
9035
+ icon: jsx(Copy, {})
8986
9036
  };
8987
9037
  switch (status) {
8988
9038
  case 'PUBLISHED':
8989
9039
  return [{
8990
9040
  text: t('warning-list-button-update'),
8991
9041
  action: () => _onEditWarning(getWarningWithLinkedToId(warning)),
8992
- icon: /*#__PURE__*/React__default.createElement(Edit, null)
9042
+ icon: jsx(Edit, {})
8993
9043
  }, duplicate, {
8994
9044
  text: t('warning-list-button-expire'),
8995
9045
  action: () => null,
8996
- icon: /*#__PURE__*/React__default.createElement(Expire, null),
9046
+ icon: jsx(Expire, {}),
8997
9047
  isDisabled: true
8998
9048
  }, {
8999
9049
  text: t('warning-list-button-withdraw'),
9000
9050
  action: () => null,
9001
- icon: /*#__PURE__*/React__default.createElement(Remove, null),
9051
+ icon: jsx(Remove, {}),
9002
9052
  isDisabled: true
9003
9053
  }];
9004
9054
  case 'EXPIRED':
@@ -9008,149 +9058,182 @@ const WarningsOnStatus = ({
9008
9058
  return [{
9009
9059
  text: t('object-manager-button-edit'),
9010
9060
  action: () => _onEditWarning(warning),
9011
- icon: /*#__PURE__*/React__default.createElement(Edit, null)
9061
+ icon: jsx(Edit, {})
9012
9062
  }, duplicate, {
9013
9063
  text: t('object-manager-button-delete'),
9014
- action: () => _onDeleteWarning(warning.id),
9015
- icon: /*#__PURE__*/React__default.createElement(Delete, null)
9064
+ action: () => _onDeleteWarning(warning.id, warning.editor),
9065
+ icon: jsx(Delete, {})
9016
9066
  }];
9017
9067
  case 'TODO':
9018
9068
  return [{
9019
9069
  text: t('warning-list-button-use'),
9020
9070
  action: () => _onEditWarning(getWarningWithProposalId(warning)),
9021
- icon: /*#__PURE__*/React__default.createElement(Success, null)
9071
+ icon: jsx(Success, {})
9022
9072
  }, {
9023
9073
  text: t('object-manager-button-delete'),
9024
9074
  action: () => _onDeleteReviewWarning(warning),
9025
- icon: /*#__PURE__*/React__default.createElement(Delete, null)
9075
+ icon: jsx(Delete, {})
9026
9076
  }];
9027
9077
  default:
9028
9078
  return [];
9029
9079
  }
9030
9080
  };
9031
- return /*#__PURE__*/React__default.createElement(Box, {
9081
+ return jsxs(Box, Object.assign({
9032
9082
  sx: {
9033
9083
  paddingBottom: 2
9034
9084
  }
9035
- }, /*#__PURE__*/React__default.createElement(Typography, {
9036
- variant: "caption",
9037
- sx: {
9038
- opacity: 0.67
9039
- }
9040
- }, headerText), warnings.length > 0 && ( /*#__PURE__*/React__default.createElement(List, {
9041
- "aria-label": `warninglist ${status}`
9042
- }, warnings.map(warning => {
9043
- var _a;
9044
- const phenomenonDetails = warningPhenomena(t).find(phenomenon => phenomenon.key === warning.warningDetail.phenomenon);
9045
- const levelDetails = levelOptions(t).find(level => level.key === warning.warningDetail.level);
9046
- return /*#__PURE__*/React__default.createElement(ListItem, {
9047
- key: warning.id,
9048
- sx: {
9049
- marginBottom: 0.25,
9050
- minHeight: '32px',
9051
- padding: '0 0',
9052
- backgroundColor: status === 'EXPIRED' ? 'geowebColors.cards.cardContainerDisabled' : 'geowebColors.cards.cardContainer',
9053
- borderColor: status === 'EXPIRED' ? 'geowebColors.cards.cardContainerDisabledBorder' : 'geowebColors.cards.cardContainerBorder',
9054
- borderRadius: 1,
9055
- borderWidth: activeWarningId === warning.id ? '1px' : '1px',
9056
- borderStyle: 'solid'
9057
- },
9058
- secondaryAction: /*#__PURE__*/React__default.createElement(ToggleMenu, {
9059
- menuTitle: t('warning-list-button-options'),
9060
- tooltipTitle: t('warning-list-button-options'),
9061
- menuPosition: "bottom",
9062
- "aria-label": t('warning-list-button-options'),
9063
- menuItems: getMenuItems(warning),
9064
- buttonIcon: /*#__PURE__*/React__default.createElement(Options, null)
9065
- })
9066
- }, /*#__PURE__*/React__default.createElement(ListItemButton, {
9067
- sx: {
9068
- height: '100%',
9069
- padding: 1,
9070
- '.warning-list': {
9071
- justifyContent: 'left'
9072
- },
9073
- [`@container publicWarningList (min-width: ${breakpoints.desktop}px)`]: {
9074
- '.warning-list': {
9075
- justifyContent: 'space-between'
9076
- }
9077
- }
9078
- },
9079
- onClick: () => _onSelectWarning(warning),
9080
- "aria-label": `warning item for ${warning.id}`,
9081
- selected: activeWarningId === warning.id
9082
- }, /*#__PURE__*/React__default.createElement(Grid, {
9083
- className: "warning-list",
9084
- container: true,
9085
- item: true,
9086
- xs: true,
9087
- rowSpacing: 0,
9088
- columnSpacing: 2,
9089
- alignItems: "center"
9090
- }, /*#__PURE__*/React__default.createElement(WarningListColumnContent, {
9091
- title: t('warning-list-header-incident'),
9092
- status: status,
9093
- width: 142
9094
- }), /*#__PURE__*/React__default.createElement(WarningListColumnContent, {
9095
- title: `${t('warning-list-header-last-update')} UTC`,
9096
- status: status,
9097
- width: 142
9098
- }, warning.lastUpdatedTime && dateUtils.dateToString(dateUtils.utc(warning.lastUpdatedTime), dateUtils.DATE_FORMAT_NAME_OF_DAY_MONTH)), /*#__PURE__*/React__default.createElement(WarningListColumnContent, {
9099
- title: `${t('warning-list-header-start-time')} UTC`,
9100
- status: status,
9101
- width: 142
9102
- }, warning.warningDetail.validFrom && dateUtils.dateToString(dateUtils.utc(warning.warningDetail.validFrom), dateUtils.DATE_FORMAT_NAME_OF_DAY_MONTH)), /*#__PURE__*/React__default.createElement(WarningListColumnContent, {
9103
- title: `${t('warning-list-header-end-time')} UTC`,
9104
- status: status,
9105
- width: 142
9106
- }, warning.warningDetail.validUntil && dateUtils.dateToString(dateUtils.utc(warning.warningDetail.validUntil), dateUtils.DATE_FORMAT_NAME_OF_DAY_MONTH)), /*#__PURE__*/React__default.createElement(WarningListColumnContent, {
9107
- title: t('warning-list-header-domain'),
9108
- status: status
9109
- }, warning.warningDetail.domain), /*#__PURE__*/React__default.createElement(WarningListColumnContent, {
9110
- title: t('warning-list-header-phenomenon'),
9111
- status: status,
9112
- width: 140,
9113
- sx: {
9114
- position: 'relative'
9115
- }
9116
- }, (phenomenonDetails === null || phenomenonDetails === void 0 ? void 0 : phenomenonDetails.title) || '-', /*#__PURE__*/React__default.createElement(Box, {
9117
- sx: {
9118
- position: 'absolute',
9119
- right: 0,
9120
- bottom: -6
9121
- }
9122
- }, phenomenonDetails === null || phenomenonDetails === void 0 ? void 0 : phenomenonDetails.icon)), /*#__PURE__*/React__default.createElement(WarningListColumnContent, {
9123
- title: t('warning-list-header-level'),
9124
- status: status
9125
- }, /*#__PURE__*/React__default.createElement(Box, {
9126
- component: "span",
9127
- sx: {
9128
- color: levelDetails === null || levelDetails === void 0 ? void 0 : levelDetails.textColor,
9129
- backgroundColor: levelDetails === null || levelDetails === void 0 ? void 0 : levelDetails.color,
9130
- paddingLeft: 0.5,
9131
- paddingRight: 0.5,
9132
- paddingBottom: '1px',
9133
- marginLeft: -0.5
9134
- }
9135
- }, ((_a = warning.warningDetail) === null || _a === void 0 ? void 0 : _a.level) && (levelDetails === null || levelDetails === void 0 ? void 0 : levelDetails.title) || '-')), /*#__PURE__*/React__default.createElement(WarningListColumnContent, {
9136
- title: t('warning-list-header-status'),
9137
- status: status,
9138
- width: 96
9139
- }, /*#__PURE__*/React__default.createElement(Box, {
9140
- sx: {
9141
- position: 'relative'
9142
- }
9143
- }, getStatusIcon(warning), warning.editor && ( /*#__PURE__*/React__default.createElement(Box, {
9085
+ }, {
9086
+ children: [jsx(Typography, Object.assign({
9087
+ variant: "caption",
9144
9088
  sx: {
9145
- width: '16px',
9146
- position: 'absolute',
9147
- top: '1px',
9148
- right: '-12px'
9089
+ opacity: 0.67
9149
9090
  }
9150
- }, /*#__PURE__*/React__default.createElement(WarningAvatar, {
9151
- editor: warning.editor
9152
- }))))))));
9153
- }))));
9091
+ }, {
9092
+ children: headerText
9093
+ })), warnings.length > 0 && jsx(List, Object.assign({
9094
+ "aria-label": `warninglist ${status}`
9095
+ }, {
9096
+ children: warnings.map(warning => {
9097
+ var _a;
9098
+ const phenomenonDetails = warningPhenomena(t).find(phenomenon => phenomenon.key === warning.warningDetail.phenomenon);
9099
+ const levelDetails = levelOptions(t).find(level => level.key === warning.warningDetail.level);
9100
+ return jsx(ListItem, Object.assign({
9101
+ sx: {
9102
+ marginBottom: 0.25,
9103
+ minHeight: '32px',
9104
+ padding: '0 0',
9105
+ backgroundColor: status === 'EXPIRED' ? 'geowebColors.cards.cardContainerDisabled' : 'geowebColors.cards.cardContainer',
9106
+ borderColor: status === 'EXPIRED' ? 'geowebColors.cards.cardContainerDisabledBorder' : 'geowebColors.cards.cardContainerBorder',
9107
+ borderRadius: 1,
9108
+ borderWidth: activeWarningId === warning.id ? '1px' : '1px',
9109
+ borderStyle: 'solid'
9110
+ },
9111
+ secondaryAction: jsx(ToggleMenu, {
9112
+ menuTitle: t('warning-list-button-options'),
9113
+ tooltipTitle: t('warning-list-button-options'),
9114
+ menuPosition: "bottom",
9115
+ "aria-label": t('warning-list-button-options'),
9116
+ menuItems: getMenuItems(warning),
9117
+ buttonIcon: jsx(Options, {})
9118
+ })
9119
+ }, {
9120
+ children: jsx(ListItemButton, Object.assign({
9121
+ sx: {
9122
+ height: '100%',
9123
+ padding: 1,
9124
+ '.warning-list': {
9125
+ justifyContent: 'left'
9126
+ },
9127
+ [`@container publicWarningList (min-width: ${breakpoints.desktop}px)`]: {
9128
+ '.warning-list': {
9129
+ justifyContent: 'space-between'
9130
+ }
9131
+ }
9132
+ },
9133
+ onClick: () => _onSelectWarning(warning),
9134
+ "aria-label": `warning item for ${warning.id}`,
9135
+ selected: activeWarningId === warning.id
9136
+ }, {
9137
+ children: jsxs(Grid, Object.assign({
9138
+ className: "warning-list",
9139
+ container: true,
9140
+ item: true,
9141
+ xs: true,
9142
+ rowSpacing: 0,
9143
+ columnSpacing: 2,
9144
+ alignItems: "center"
9145
+ }, {
9146
+ children: [jsx(WarningListColumnContent, {
9147
+ title: t('warning-list-header-incident'),
9148
+ status: status,
9149
+ width: 142
9150
+ }), jsx(WarningListColumnContent, Object.assign({
9151
+ title: `${t('warning-list-header-last-update')} UTC`,
9152
+ status: status,
9153
+ width: 142
9154
+ }, {
9155
+ children: warning.lastUpdatedTime && dateUtils.dateToString(dateUtils.utc(warning.lastUpdatedTime), dateUtils.DATE_FORMAT_NAME_OF_DAY_MONTH)
9156
+ })), jsx(WarningListColumnContent, Object.assign({
9157
+ title: `${t('warning-list-header-start-time')} UTC`,
9158
+ status: status,
9159
+ width: 142
9160
+ }, {
9161
+ children: warning.warningDetail.validFrom && dateUtils.dateToString(dateUtils.utc(warning.warningDetail.validFrom), dateUtils.DATE_FORMAT_NAME_OF_DAY_MONTH)
9162
+ })), jsx(WarningListColumnContent, Object.assign({
9163
+ title: `${t('warning-list-header-end-time')} UTC`,
9164
+ status: status,
9165
+ width: 142
9166
+ }, {
9167
+ children: warning.warningDetail.validUntil && dateUtils.dateToString(dateUtils.utc(warning.warningDetail.validUntil), dateUtils.DATE_FORMAT_NAME_OF_DAY_MONTH)
9168
+ })), jsx(WarningListColumnContent, Object.assign({
9169
+ title: t('warning-list-header-domain'),
9170
+ status: status
9171
+ }, {
9172
+ children: warning.warningDetail.domain
9173
+ })), jsxs(WarningListColumnContent, Object.assign({
9174
+ title: t('warning-list-header-phenomenon'),
9175
+ status: status,
9176
+ width: 140,
9177
+ sx: {
9178
+ position: 'relative'
9179
+ }
9180
+ }, {
9181
+ children: [(phenomenonDetails === null || phenomenonDetails === void 0 ? void 0 : phenomenonDetails.title) || '-', jsx(Box, Object.assign({
9182
+ sx: {
9183
+ position: 'absolute',
9184
+ right: 0,
9185
+ bottom: -6
9186
+ }
9187
+ }, {
9188
+ children: phenomenonDetails === null || phenomenonDetails === void 0 ? void 0 : phenomenonDetails.icon
9189
+ }))]
9190
+ })), jsx(WarningListColumnContent, Object.assign({
9191
+ title: t('warning-list-header-level'),
9192
+ status: status
9193
+ }, {
9194
+ children: jsx(Box, Object.assign({
9195
+ component: "span",
9196
+ sx: {
9197
+ color: levelDetails === null || levelDetails === void 0 ? void 0 : levelDetails.textColor,
9198
+ backgroundColor: levelDetails === null || levelDetails === void 0 ? void 0 : levelDetails.color,
9199
+ paddingLeft: 0.5,
9200
+ paddingRight: 0.5,
9201
+ paddingBottom: '1px',
9202
+ marginLeft: -0.5
9203
+ }
9204
+ }, {
9205
+ children: ((_a = warning.warningDetail) === null || _a === void 0 ? void 0 : _a.level) && (levelDetails === null || levelDetails === void 0 ? void 0 : levelDetails.title) || '-'
9206
+ }))
9207
+ })), jsx(WarningListColumnContent, Object.assign({
9208
+ title: t('warning-list-header-status'),
9209
+ status: status,
9210
+ width: 96
9211
+ }, {
9212
+ children: jsxs(Box, Object.assign({
9213
+ sx: {
9214
+ position: 'relative'
9215
+ }
9216
+ }, {
9217
+ children: [getStatusIcon(warning), warning.editor && jsx(Box, Object.assign({
9218
+ sx: {
9219
+ width: '16px',
9220
+ position: 'absolute',
9221
+ top: '1px',
9222
+ right: '-12px'
9223
+ }
9224
+ }, {
9225
+ children: jsx(WarningAvatar, {
9226
+ editor: warning.editor
9227
+ })
9228
+ }))]
9229
+ }))
9230
+ }))]
9231
+ }))
9232
+ }))
9233
+ }), warning.id);
9234
+ })
9235
+ }))]
9236
+ }));
9154
9237
  };
9155
9238
  const PublicWarningList = ({
9156
9239
  warnings,
@@ -9169,7 +9252,7 @@ const PublicWarningList = ({
9169
9252
  t
9170
9253
  } = useWarningsTranslation();
9171
9254
  const sortedWarnings = warnings ? sortWarningsOnStatus(warnings) : null;
9172
- return /*#__PURE__*/React__default.createElement(Box, {
9255
+ return jsxs(Box, Object.assign({
9173
9256
  sx: {
9174
9257
  padding: 3,
9175
9258
  height: '100%',
@@ -9178,115 +9261,127 @@ const PublicWarningList = ({
9178
9261
  containerType: 'inline-size'
9179
9262
  },
9180
9263
  "data-testid": "publicWarningList"
9181
- }, /*#__PURE__*/React__default.createElement(Grid, {
9182
- container: true,
9183
- justifyContent: "flex-end"
9184
- }, /*#__PURE__*/React__default.createElement(Button, {
9185
- variant: "primary",
9186
- onClick: _onCreateWarning,
9187
- sx: {
9188
- textTransform: 'initial',
9189
- marginBottom: '8px',
9190
- fontSize: '12px',
9191
- height: '32px'
9192
- }
9193
- }, t('warning-list-button_create'))), error && /*#__PURE__*/React__default.createElement(AlertBanner, {
9194
- title: error.message,
9195
- shouldClose: true
9196
- }), _isLoading ? ( /*#__PURE__*/React__default.createElement(LinearProgress, {
9197
- "data-testid": "loading-bar",
9198
- color: "secondary"
9199
- })) : ( /*#__PURE__*/React__default.createElement(Box, {
9200
- sx: {
9201
- height: '4px'
9202
- }
9203
- })), !error && ( /*#__PURE__*/React__default.createElement(Grid, {
9204
- container: true,
9205
- rowSpacing: 0,
9206
- columnSpacing: 2,
9207
- alignItems: "center",
9208
- justifyContent: "space-between",
9209
- sx: {
9210
- maxWidth: '100%',
9211
- display: 'none',
9212
- [`@container publicWarningList (min-width: ${breakpoints.desktop}px)`]: {
9213
- display: 'flex'
9264
+ }, {
9265
+ children: [jsx(Grid, Object.assign({
9266
+ container: true,
9267
+ justifyContent: "flex-end"
9268
+ }, {
9269
+ children: jsx(Button, Object.assign({
9270
+ variant: "primary",
9271
+ onClick: _onCreateWarning,
9272
+ sx: {
9273
+ textTransform: 'initial',
9274
+ marginBottom: '8px',
9275
+ fontSize: '12px',
9276
+ height: '32px'
9277
+ }
9278
+ }, {
9279
+ children: t('warning-list-button_create')
9280
+ }))
9281
+ })), error && jsx(AlertBanner, {
9282
+ title: error.message,
9283
+ shouldClose: true
9284
+ }), _isLoading ? jsx(LinearProgress, {
9285
+ "data-testid": "loading-bar",
9286
+ color: "secondary"
9287
+ }) : jsx(Box, {
9288
+ sx: {
9289
+ height: '4px'
9214
9290
  }
9215
- }
9216
- }, /*#__PURE__*/React__default.createElement(WarningListHeaderContent, {
9217
- title: t('warning-list-header-incident'),
9218
- width: 142,
9219
- sx: {
9220
- marginLeft: 1
9221
- }
9222
- }), /*#__PURE__*/React__default.createElement(WarningListHeaderContent, {
9223
- title: `${t('warning-list-header-last-update')} UTC`,
9224
- width: 142
9225
- }), /*#__PURE__*/React__default.createElement(WarningListHeaderContent, {
9226
- title: `${t('warning-list-header-start-time')} UTC`,
9227
- width: 142
9228
- }), /*#__PURE__*/React__default.createElement(WarningListHeaderContent, {
9229
- title: `${t('warning-list-header-end-time')} UTC`,
9230
- width: 142
9231
- }), /*#__PURE__*/React__default.createElement(WarningListHeaderContent, {
9232
- title: t('warning-list-header-domain')
9233
- }), /*#__PURE__*/React__default.createElement(WarningListHeaderContent, {
9234
- title: t('warning-list-header-phenomenon'),
9235
- width: 140
9236
- }), /*#__PURE__*/React__default.createElement(WarningListHeaderContent, {
9237
- title: t('warning-list-header-level')
9238
- }), /*#__PURE__*/React__default.createElement(WarningListHeaderContent, {
9239
- title: t('warning-list-header-status'),
9240
- width: 96,
9241
- sx: {
9242
- marginRight: '48px'
9243
- }
9244
- }))), lastUpdatedTime && ( /*#__PURE__*/React__default.createElement(Box, {
9245
- sx: {
9246
- marginBottom: -3.25,
9247
- button: {
9248
- marginRight: 0
9291
+ }), !error && jsxs(Grid, Object.assign({
9292
+ container: true,
9293
+ rowSpacing: 0,
9294
+ columnSpacing: 2,
9295
+ alignItems: "center",
9296
+ justifyContent: "space-between",
9297
+ sx: {
9298
+ maxWidth: '100%',
9299
+ display: 'none',
9300
+ [`@container publicWarningList (min-width: ${breakpoints.desktop}px)`]: {
9301
+ display: 'flex'
9302
+ }
9249
9303
  }
9250
- }
9251
- }, /*#__PURE__*/React__default.createElement(LastUpdateTime, {
9252
- onPressRefresh: _onRefetchWarnings,
9253
- lastUpdateTime: lastUpdatedTime
9254
- }))), sortedWarnings && !error && ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(WarningsOnStatus, {
9255
- status: "TODO",
9256
- warnings: sortedWarnings.todo,
9257
- onSelectWarning: _onSelectWarning2,
9258
- onEditWarning: _onEditWarning2,
9259
- onDeleteWarning: _onDeleteWarning2,
9260
- onDeleteReviewWarning: _onDeleteReviewWarning2,
9261
- activeWarningId: _selectedPublicWarningId
9262
- }), /*#__PURE__*/React__default.createElement(WarningsOnStatus, {
9263
- status: "DRAFT",
9264
- warnings: sortedWarnings.draft,
9265
- onSelectWarning: _onSelectWarning2,
9266
- onEditWarning: _onEditWarning2,
9267
- onDeleteWarning: _onDeleteWarning2,
9268
- onDeleteReviewWarning: _onDeleteReviewWarning2,
9269
- activeWarningId: _selectedPublicWarningId
9270
- }), /*#__PURE__*/React__default.createElement(WarningsOnStatus, {
9271
- status: "PUBLISHED",
9272
- warnings: sortedWarnings.published,
9273
- onSelectWarning: _onSelectWarning2,
9274
- onEditWarning: _onEditWarning2,
9275
- onDeleteWarning: _onDeleteWarning2,
9276
- onDeleteReviewWarning: _onDeleteReviewWarning2,
9277
- activeWarningId: _selectedPublicWarningId
9278
- }), /*#__PURE__*/React__default.createElement(WarningsOnStatus, {
9279
- status: "EXPIRED",
9280
- warnings: sortedWarnings.expired,
9281
- onSelectWarning: _onSelectWarning2,
9282
- onEditWarning: _onEditWarning2,
9283
- onDeleteWarning: _onDeleteWarning2,
9284
- onDeleteReviewWarning: _onDeleteReviewWarning2,
9285
- activeWarningId: _selectedPublicWarningId
9286
- }))));
9287
- };
9288
-
9289
- var makeBuiltIn = makeBuiltIn$3.exports;
9304
+ }, {
9305
+ children: [jsx(WarningListHeaderContent, {
9306
+ title: t('warning-list-header-incident'),
9307
+ width: 142,
9308
+ sx: {
9309
+ marginLeft: 1
9310
+ }
9311
+ }), jsx(WarningListHeaderContent, {
9312
+ title: `${t('warning-list-header-last-update')} UTC`,
9313
+ width: 142
9314
+ }), jsx(WarningListHeaderContent, {
9315
+ title: `${t('warning-list-header-start-time')} UTC`,
9316
+ width: 142
9317
+ }), jsx(WarningListHeaderContent, {
9318
+ title: `${t('warning-list-header-end-time')} UTC`,
9319
+ width: 142
9320
+ }), jsx(WarningListHeaderContent, {
9321
+ title: t('warning-list-header-domain')
9322
+ }), jsx(WarningListHeaderContent, {
9323
+ title: t('warning-list-header-phenomenon'),
9324
+ width: 140
9325
+ }), jsx(WarningListHeaderContent, {
9326
+ title: t('warning-list-header-level')
9327
+ }), jsx(WarningListHeaderContent, {
9328
+ title: t('warning-list-header-status'),
9329
+ width: 96,
9330
+ sx: {
9331
+ marginRight: '48px'
9332
+ }
9333
+ })]
9334
+ })), lastUpdatedTime && jsx(Box, Object.assign({
9335
+ sx: {
9336
+ marginBottom: -3.25,
9337
+ button: {
9338
+ marginRight: 0
9339
+ }
9340
+ }
9341
+ }, {
9342
+ children: jsx(LastUpdateTime, {
9343
+ onPressRefresh: _onRefetchWarnings,
9344
+ lastUpdateTime: lastUpdatedTime
9345
+ })
9346
+ })), sortedWarnings && !error && jsxs(Fragment, {
9347
+ children: [jsx(WarningsOnStatus, {
9348
+ status: "TODO",
9349
+ warnings: sortedWarnings.todo,
9350
+ onSelectWarning: _onSelectWarning2,
9351
+ onEditWarning: _onEditWarning2,
9352
+ onDeleteWarning: _onDeleteWarning2,
9353
+ onDeleteReviewWarning: _onDeleteReviewWarning2,
9354
+ activeWarningId: _selectedPublicWarningId
9355
+ }), jsx(WarningsOnStatus, {
9356
+ status: "DRAFT",
9357
+ warnings: sortedWarnings.draft,
9358
+ onSelectWarning: _onSelectWarning2,
9359
+ onEditWarning: _onEditWarning2,
9360
+ onDeleteWarning: _onDeleteWarning2,
9361
+ onDeleteReviewWarning: _onDeleteReviewWarning2,
9362
+ activeWarningId: _selectedPublicWarningId
9363
+ }), jsx(WarningsOnStatus, {
9364
+ status: "PUBLISHED",
9365
+ warnings: sortedWarnings.published,
9366
+ onSelectWarning: _onSelectWarning2,
9367
+ onEditWarning: _onEditWarning2,
9368
+ onDeleteWarning: _onDeleteWarning2,
9369
+ onDeleteReviewWarning: _onDeleteReviewWarning2,
9370
+ activeWarningId: _selectedPublicWarningId
9371
+ }), jsx(WarningsOnStatus, {
9372
+ status: "EXPIRED",
9373
+ warnings: sortedWarnings.expired,
9374
+ onSelectWarning: _onSelectWarning2,
9375
+ onEditWarning: _onEditWarning2,
9376
+ onDeleteWarning: _onDeleteWarning2,
9377
+ onDeleteReviewWarning: _onDeleteReviewWarning2,
9378
+ activeWarningId: _selectedPublicWarningId
9379
+ })]
9380
+ })]
9381
+ }));
9382
+ };
9383
+
9384
+ var makeBuiltIn = makeBuiltInExports;
9290
9385
  var defineProperty = objectDefineProperty;
9291
9386
 
9292
9387
  var defineBuiltInAccessor$1 = function (target, name, descriptor) {
@@ -9393,13 +9488,15 @@ const ConfirmDeleteWarningDialog = ({
9393
9488
  description,
9394
9489
  request,
9395
9490
  confirmLabel,
9396
- callback
9491
+ callback,
9492
+ isLocked
9397
9493
  }) => {
9398
9494
  const {
9399
9495
  t
9400
9496
  } = useWarningsTranslation();
9497
+ const defaultError = isLocked ? t('warning-dialog-delete-islocked') : undefined;
9401
9498
  const [isLoading, setIsLoading] = React__default.useState(false);
9402
- const [error, setError] = React__default.useState(undefined);
9499
+ const [error, setError] = React__default.useState(defaultError);
9403
9500
  const onSubmit = () => __awaiter(void 0, void 0, void 0, function* () {
9404
9501
  setIsLoading(true);
9405
9502
  try {
@@ -9411,7 +9508,7 @@ const ConfirmDeleteWarningDialog = ({
9411
9508
  setIsLoading(false);
9412
9509
  }
9413
9510
  });
9414
- return /*#__PURE__*/React__default.createElement(ConfirmationDialog, Object.assign({
9511
+ return jsx(ConfirmationDialog, Object.assign({
9415
9512
  title: title,
9416
9513
  open: true,
9417
9514
  confirmLabel: confirmLabel,
@@ -9424,18 +9521,23 @@ const ConfirmDeleteWarningDialog = ({
9424
9521
  width: 330
9425
9522
  }
9426
9523
  }, error && {
9427
- content: ( /*#__PURE__*/React__default.createElement(Box, {
9524
+ content: jsxs(Box, Object.assign({
9428
9525
  sx: {
9429
9526
  marginBottom: 0
9430
9527
  }
9431
- }, /*#__PURE__*/React__default.createElement(AlertBanner, {
9432
- title: error
9433
- }), /*#__PURE__*/React__default.createElement(Typography, {
9434
- variant: "body1",
9435
- sx: {
9436
- marginTop: 1
9437
- }
9438
- }, description)))
9528
+ }, {
9529
+ children: [jsx(AlertBanner, {
9530
+ title: error,
9531
+ severity: isLocked ? 'warning' : 'error'
9532
+ }), jsx(Typography, Object.assign({
9533
+ variant: "body1",
9534
+ sx: {
9535
+ marginTop: 1
9536
+ }
9537
+ }, {
9538
+ children: description
9539
+ }))]
9540
+ }))
9439
9541
  }));
9440
9542
  };
9441
9543
 
@@ -9445,6 +9547,9 @@ const PublicWarningListConnect = () => {
9445
9547
  } = useWarningsTranslation();
9446
9548
  const dispatch = useDispatch();
9447
9549
  const confirmDialog = useConfirmationDialog();
9550
+ const {
9551
+ auth
9552
+ } = useAuthenticationContext();
9448
9553
  const [confirmDialogOptions, setConfirmDialogOptions] = React__default.useState(undefined);
9449
9554
  const warnings = useSelector(store => selectAllPublicWarnings(store));
9450
9555
  const selectedPublicWarningId = useSelector(store => getSelectedPublicWarningId(store));
@@ -9480,13 +9585,15 @@ const PublicWarningListConnect = () => {
9480
9585
  }));
9481
9586
  };
9482
9587
  const warningsApi = getWarningsApi();
9483
- const deleteWarning = warningId => {
9588
+ const deleteWarning = (warningId, warningEditor) => {
9589
+ const isLocked = warningEditor && warningEditor !== (auth === null || auth === void 0 ? void 0 : auth.username) || false;
9484
9590
  setConfirmDialogOptions({
9485
9591
  confirmLabel: t('warning-dialog-delete-confirm'),
9486
9592
  title: t('warning-dialog-delete-title'),
9487
9593
  description: t('warning-dialog-delete-description'),
9488
9594
  request: () => warningsApi.deleteWarning(warningId),
9489
- callback: () => onRemoveSuccess(warningId, t('warning-dialog-delete-succes'))
9595
+ callback: () => onRemoveSuccess(warningId, t('warning-dialog-delete-succes')),
9596
+ isLocked
9490
9597
  });
9491
9598
  };
9492
9599
  const deleteReviewWarning = warning => {
@@ -9521,26 +9628,29 @@ const PublicWarningListConnect = () => {
9521
9628
  // fetch warnings on mount
9522
9629
  fetchWarnings();
9523
9630
  }, [fetchWarnings]);
9524
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(PublicWarningList, {
9525
- warnings: warnings,
9526
- isLoading: isLoading,
9527
- error: error,
9528
- onSelectWarning: selectWarning,
9529
- onCreateWarning: createWarning,
9530
- onEditWarning: editWarning,
9531
- onDeleteWarning: deleteWarning,
9532
- onDeleteReviewWarning: deleteReviewWarning,
9533
- selectedPublicWarningId: selectedPublicWarningId,
9534
- lastUpdatedTime: lastUpdatedTime,
9535
- onRefetchWarnings: fetchWarnings
9536
- }), confirmDialogOptions && ( /*#__PURE__*/React__default.createElement(ConfirmDeleteWarningDialog, {
9537
- onClose: () => setConfirmDialogOptions(undefined),
9538
- title: confirmDialogOptions.title,
9539
- description: confirmDialogOptions.description,
9540
- request: confirmDialogOptions.request,
9541
- confirmLabel: confirmDialogOptions.confirmLabel,
9542
- callback: confirmDialogOptions.callback
9543
- })));
9631
+ return jsxs(Fragment, {
9632
+ children: [jsx(PublicWarningList, {
9633
+ warnings: warnings,
9634
+ isLoading: isLoading,
9635
+ error: error,
9636
+ onSelectWarning: selectWarning,
9637
+ onCreateWarning: createWarning,
9638
+ onEditWarning: editWarning,
9639
+ onDeleteWarning: deleteWarning,
9640
+ onDeleteReviewWarning: deleteReviewWarning,
9641
+ selectedPublicWarningId: selectedPublicWarningId,
9642
+ lastUpdatedTime: lastUpdatedTime,
9643
+ onRefetchWarnings: fetchWarnings
9644
+ }), confirmDialogOptions && jsx(ConfirmDeleteWarningDialog, {
9645
+ onClose: () => setConfirmDialogOptions(undefined),
9646
+ title: confirmDialogOptions.title,
9647
+ description: confirmDialogOptions.description,
9648
+ request: confirmDialogOptions.request,
9649
+ confirmLabel: confirmDialogOptions.confirmLabel,
9650
+ callback: confirmDialogOptions.callback,
9651
+ isLocked: confirmDialogOptions.isLocked
9652
+ })]
9653
+ });
9544
9654
  };
9545
9655
 
9546
9656
  const warningListViewPreset = {
@@ -9554,7 +9664,7 @@ const PublicWarningApiWrapper = ({
9554
9664
  auth,
9555
9665
  onSetAuth
9556
9666
  }) => {
9557
- return config ? ( /*#__PURE__*/React.createElement(ApiProvider, {
9667
+ return config ? jsx(ApiProvider, Object.assign({
9558
9668
  config: {
9559
9669
  baseURL: config.baseURL,
9560
9670
  appURL: config.baseURL,
@@ -9564,7 +9674,11 @@ const PublicWarningApiWrapper = ({
9564
9674
  auth: auth,
9565
9675
  onSetAuth: onSetAuth,
9566
9676
  createApi: createApi$1
9567
- }, /*#__PURE__*/React.createElement(ErrorBoundary, null, /*#__PURE__*/React.createElement(PublicWarningListConnect, null)))) : null;
9677
+ }, {
9678
+ children: jsx(ErrorBoundary, {
9679
+ children: jsx(PublicWarningListConnect, {})
9680
+ })
9681
+ })) : null;
9568
9682
  };
9569
9683
  const componentsLookUp = (payload, apiProps) => {
9570
9684
  const {
@@ -9573,11 +9687,11 @@ const componentsLookUp = (payload, apiProps) => {
9573
9687
  switch (componentType) {
9574
9688
  case warningListViewPreset.componentType:
9575
9689
  if (apiProps && apiProps.config) {
9576
- return /*#__PURE__*/React.createElement(PublicWarningApiWrapper, Object.assign({}, apiProps, {
9690
+ return jsx(PublicWarningApiWrapper, Object.assign({}, apiProps, {
9577
9691
  "data-testid": "publicWarningModule"
9578
9692
  }));
9579
9693
  }
9580
- return /*#__PURE__*/React.createElement(PublicWarningListConnect, {
9694
+ return jsx(PublicWarningListConnect, {
9581
9695
  "data-testid": "publicWarningList"
9582
9696
  });
9583
9697
  default:
@@ -9698,13 +9812,27 @@ publicWarningFormListener.startListening({
9698
9812
  });
9699
9813
  const saveOrUpdateWarning = publicWarning => __awaiter(void 0, void 0, void 0, function* () {
9700
9814
  const warningsApi = getWarningsApi();
9701
- if (publicWarning.warningDetail.id) {
9702
- yield warningsApi.updateWarning(publicWarning.warningDetail.id, publicWarning);
9815
+ const {
9816
+ warningDetail,
9817
+ status
9818
+ } = publicWarning;
9819
+ if (warningDetail.id) {
9820
+ yield warningsApi.updateWarning(warningDetail.id, publicWarning);
9703
9821
  return publicWarning;
9704
9822
  }
9823
+ // In case of directly publishing an update of a published warning
9824
+ if (status === 'PUBLISHED' && warningDetail.linked_to_id) {
9825
+ const warning = Object.assign(Object.assign({}, publicWarning), {
9826
+ warningDetail: Object.assign(Object.assign({}, warningDetail), {
9827
+ id: warningDetail.linked_to_id
9828
+ })
9829
+ });
9830
+ yield warningsApi.updateWarning(warningDetail.linked_to_id, warning);
9831
+ return warning;
9832
+ }
9705
9833
  const newWarningId = yield warningsApi.saveWarningAs(publicWarning);
9706
9834
  return Object.assign(Object.assign({}, publicWarning), {
9707
- warningDetail: Object.assign(Object.assign({}, publicWarning.warningDetail), {
9835
+ warningDetail: Object.assign(Object.assign({}, warningDetail), {
9708
9836
  id: newWarningId
9709
9837
  })
9710
9838
  });