@opengeoweb/warnings 9.19.1 → 9.20.2

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: {
@@ -8086,49 +8082,37 @@ const WarningsMapView = ({
8086
8082
  };
8087
8083
  // Zoom to the geojson when the geojsonFeature is updated in an already mounted map component
8088
8084
  zoomToFeature(mapId, geojsonFeature);
8089
- return /*#__PURE__*/React.createElement("div", {
8085
+ return jsx("div", Object.assign({
8090
8086
  style: {
8091
8087
  height: '200px',
8092
8088
  width: '100%'
8093
8089
  }
8094
- }, /*#__PURE__*/React.createElement(MapView, {
8095
- bbox: _defaultBbox.bbox,
8096
- srs: _defaultBbox.srs,
8097
- mapId: mapId,
8098
- showScaleBar: false,
8099
- onWMJSMount: mapId => {
8100
- const webmapjs = getWMJSMapById(mapId);
8101
- webmapjs.hideMouseCursorProperties();
8102
- if (!geojsonFeature) {
8103
- return;
8104
- }
8105
- // Zoom to the geojson when the map is ready
8106
- zoomToFeature(mapId, geojsonFeature);
8107
- },
8108
- holdShiftToScroll: true
8109
- }, !_isSnapshot && ( /*#__PURE__*/React.createElement(MapViewLayer, Object.assign({}, defaultLayers.baseLayerGrey, {
8110
- id: `${mapId}_baseLayer}`
8111
- }))), warningLayer.geojson && /*#__PURE__*/React.createElement(MapViewLayer, Object.assign({}, warningLayer)), !_isSnapshot && ( /*#__PURE__*/React.createElement(MapViewLayer, Object.assign({}, defaultLayers.overLayer, {
8112
- id: `${mapId}_overlayer}`
8113
- })))));
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
+ }));
8114
8114
  };
8115
8115
 
8116
- /* *
8117
- * Licensed under the Apache License, Version 2.0 (the "License");
8118
- * you may not use this file except in compliance with the License.
8119
- * You may obtain a copy of the License at
8120
- *
8121
- * http://www.apache.org/licenses/LICENSE-2.0
8122
- *
8123
- * Unless required by applicable law or agreed to in writing, software
8124
- * distributed under the License is distributed on an "AS IS" BASIS,
8125
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8126
- * See the License for the specific language governing permissions and
8127
- * limitations under the License.
8128
- *
8129
- * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
8130
- * Copyright 2023 - Finnish Meteorological Institute (FMI)
8131
- * */
8132
8116
  const probablityOptions = [100, 90, 80, 70, 60, 50, 40, 30, 20, 10];
8133
8117
  const defaultProbability = 30;
8134
8118
  const ProbabilityField = ({
@@ -8158,7 +8142,7 @@ const ProbabilityField = ({
8158
8142
  trigger('level');
8159
8143
  }
8160
8144
  };
8161
- return /*#__PURE__*/React.createElement(ReactHookFormSelect, {
8145
+ return jsx(ReactHookFormSelect, Object.assign({
8162
8146
  name: "probability",
8163
8147
  label: t('warning-probability'),
8164
8148
  rules: {
@@ -8171,10 +8155,13 @@ const ProbabilityField = ({
8171
8155
  isReadOnly: isReadOnly,
8172
8156
  defaultValue: defaultProbability,
8173
8157
  onChange: onChangeProbability
8174
- }, probablityOptions.map(probability => ( /*#__PURE__*/React.createElement(MenuItem, {
8175
- value: probability,
8176
- key: probability
8177
- }, probability, " %"))));
8158
+ }, {
8159
+ children: probablityOptions.map(probability => jsxs(MenuItem, Object.assign({
8160
+ value: probability
8161
+ }, {
8162
+ children: [probability, " %"]
8163
+ }), probability))
8164
+ }));
8178
8165
  };
8179
8166
 
8180
8167
  const getEmptyPublicWarning = () => {
@@ -8284,14 +8271,16 @@ const getErrors = errors => errors ? errors === null || errors === void 0 ? void
8284
8271
  const isEven = index % 2 === 0;
8285
8272
  return Object.assign(Object.assign({}, allErrors), {
8286
8273
  errors: allErrors.errors.concat(
8287
- /*#__PURE__*/
8288
8274
  // eslint-disable-next-line react/no-array-index-key
8289
- React.createElement("p", {
8290
- key: `error-${index}`,
8275
+ jsx("p", Object.assign({
8291
8276
  style: {
8292
8277
  fontSize: 14
8293
8278
  }
8294
- }, isEven ? error : /*#__PURE__*/React.createElement("i", null, error)))
8279
+ }, {
8280
+ children: isEven ? error : jsx("i", {
8281
+ children: error
8282
+ })
8283
+ }), `error-${index}`))
8295
8284
  });
8296
8285
  }, {
8297
8286
  title: '',
@@ -8378,165 +8367,223 @@ const Form = ({
8378
8367
  Object.assign(draftFeature.properties, Object.assign(Object.assign({}, defaultProps), draftFeature.properties));
8379
8368
  }
8380
8369
  });
8381
- return /*#__PURE__*/React.createElement(ContainerWrapper, null, /*#__PURE__*/React.createElement(ContainerFormWrapper, {
8382
- isReadOnly: _isReadOnly2
8383
- }, /*#__PURE__*/React.createElement(ContainerGrid, null, errors && ( /*#__PURE__*/React.createElement(Box, {
8384
- sx: {
8385
- marginBottom: 2
8386
- }
8387
- }, /*#__PURE__*/React.createElement(AlertBanner, {
8388
- title: errors.title,
8389
- info: errors.errors,
8390
- shouldClose: true,
8391
- severity: _error === null || _error === void 0 ? void 0 : _error.severity
8392
- }))), /*#__PURE__*/React.createElement(Grid, {
8393
- container: true,
8394
- rowSpacing: 2
8395
- }, /*#__PURE__*/React.createElement(Grid, {
8396
- item: true,
8397
- xs: 12
8398
- }, /*#__PURE__*/React.createElement(Phenomenon, {
8399
- isDisabled: areFieldsDisabled,
8400
- isReadOnly: _isReadOnly2
8401
- })), /*#__PURE__*/React.createElement(Grid, {
8402
- item: true,
8403
- xs: 12
8404
- }, /*#__PURE__*/React.createElement(Grid, {
8405
- item: true,
8406
- xs: 12
8407
- }, /*#__PURE__*/React.createElement(AreaField, {
8408
- isDisabled: true,
8409
- onEditObject: () => {},
8410
- onViewObject: () => {},
8411
- onDeleteObject: () => {},
8412
- onAddObject: () => {}
8413
- }))), /*#__PURE__*/React.createElement(Grid, {
8414
- item: true,
8415
- xs: 12,
8416
- container: true
8417
- }, /*#__PURE__*/React.createElement(Grid, {
8418
- item: true,
8419
- xs: 12
8420
- }, /*#__PURE__*/React.createElement(WarningsMapView, {
8421
- geojsonFeature: warningGeoJSONFeatureWithFillProps,
8422
- defaultBbox: defaultBbox,
8423
- isSnapshot: _isSnapshot
8424
- }))), /*#__PURE__*/React.createElement(Grid, {
8425
- item: true,
8426
- xs: 12,
8427
- container: true,
8428
- spacing: 2
8429
- }, /*#__PURE__*/React.createElement(Grid, {
8430
- item: true,
8431
- xs: 12,
8432
- sm: 6
8433
- }, /*#__PURE__*/React.createElement(ValidFrom, {
8434
- isDisabled: areFieldsDisabled,
8435
- isReadOnly: _isReadOnly2
8436
- })), /*#__PURE__*/React.createElement(Grid, {
8437
- item: true,
8438
- xs: 12,
8439
- sm: 6
8440
- }, /*#__PURE__*/React.createElement(ValidUntil, {
8441
- isDisabled: areFieldsDisabled,
8442
- isReadOnly: _isReadOnly2
8443
- }))), /*#__PURE__*/React.createElement(Grid, {
8444
- item: true,
8445
- xs: 12,
8446
- container: true,
8447
- spacing: 2
8448
- }, /*#__PURE__*/React.createElement(Grid, {
8449
- item: true,
8450
- xs: 12,
8451
- sm: 6
8452
- }, /*#__PURE__*/React.createElement(LevelField, {
8453
- isDisabled: areFieldsDisabled,
8454
- isReadOnly: _isReadOnly2
8455
- })), /*#__PURE__*/React.createElement(Grid, {
8456
- item: true,
8457
- xs: 12,
8458
- sm: 6
8459
- }, /*#__PURE__*/React.createElement(ProbabilityField, {
8460
- isDisabled: areFieldsDisabled,
8461
- isReadOnly: _isReadOnly2
8462
- }))), /*#__PURE__*/React.createElement(Grid, {
8463
- item: true,
8464
- xs: 12,
8465
- container: true,
8466
- spacing: 2
8467
- }, /*#__PURE__*/React.createElement(Grid, {
8468
- item: true,
8469
- xs: 12
8470
- }, /*#__PURE__*/React.createElement(DescriptionField, {
8471
- isDisabled: areFieldsDisabled,
8472
- isReadOnly: _isReadOnly2
8473
- }))))), /*#__PURE__*/React.createElement(DraftFieldHelper, null), /*#__PURE__*/React.createElement(ReactHookFormHiddenInput, {
8474
- name: "id"
8475
- })), !_isReadOnly2 && ( /*#__PURE__*/React.createElement(Box, {
8476
- sx: {
8477
- padding: '24px 10px 14px 10px',
8478
- position: 'absolute',
8479
- bottom: 0,
8480
- width: '100%',
8481
- backgroundColor: 'geowebColors.background.surfaceApp',
8482
- boxShadow: '0 2px 4px 0 rgba(0, 0, 0, 0.5)',
8483
- zIndex: 1
8484
- }
8485
- }, /*#__PURE__*/React.createElement(ContainerGrid, null, /*#__PURE__*/React.createElement(Grid, {
8486
- container: true,
8487
- spacing: 2
8488
- }, /*#__PURE__*/React.createElement(Grid, {
8489
- item: true,
8490
- xs: 12,
8491
- sm: 4
8492
- }, /*#__PURE__*/React.createElement(Button, {
8493
- variant: "tertiary",
8494
- sx: {
8495
- width: '100%',
8496
- marginBottom: 1
8497
- },
8498
- disabled: areFieldsDisabled,
8499
- onClick: onPressClear
8500
- }, t('warning-button-clear'))), /*#__PURE__*/React.createElement(Grid, {
8501
- item: true,
8502
- xs: 12,
8503
- sm: 4
8504
- }, /*#__PURE__*/React.createElement(Button, {
8505
- variant: "tertiary",
8506
- sx: {
8507
- width: '100%',
8508
- marginBottom: 1
8509
- },
8510
- disabled: isPublishing,
8511
- onClick: onPressSave
8512
- }, /*#__PURE__*/React.createElement("span", {
8513
- style: {
8514
- position: 'relative'
8515
- }
8516
- }, isSaving ? t('warning-button-saving') : t('warning-button-save'), isSaving && ( /*#__PURE__*/React.createElement(CircularProgress, {
8517
- "data-testid": "spinner",
8518
- color: "inherit",
8519
- sx: spinnerSx
8520
- }))))), /*#__PURE__*/React.createElement(Grid, {
8521
- item: true,
8522
- xs: 12,
8523
- sm: 4
8524
- }, /*#__PURE__*/React.createElement(Button, {
8525
- variant: "primary",
8526
- sx: {
8527
- width: '100%'
8528
- },
8529
- disabled: isSaving,
8530
- onClick: onPressPublish
8531
- }, /*#__PURE__*/React.createElement("span", {
8532
- style: {
8533
- position: 'relative'
8534
- }
8535
- }, isPublishing ? t('warning-button-publishing') : t('warning-button-publish'), isPublishing && ( /*#__PURE__*/React.createElement(CircularProgress, {
8536
- "data-testid": "spinner",
8537
- color: "inherit",
8538
- sx: spinnerSx
8539
- }))))))))));
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
+ });
8540
8587
  };
8541
8588
  const PublicWarningsForm = props => {
8542
8589
  const {
@@ -8544,12 +8591,14 @@ const PublicWarningsForm = props => {
8544
8591
  publicWarningDetails
8545
8592
  } = props;
8546
8593
  const defaultValues = getFormData(publicWarningDetails, object);
8547
- return /*#__PURE__*/React.createElement(ReactHookFormProvider, {
8594
+ return jsx(ReactHookFormProvider, Object.assign({
8548
8595
  options: Object.assign(Object.assign({}, defaultFormOptions), {
8549
8596
  mode: 'onSubmit',
8550
8597
  defaultValues
8551
8598
  })
8552
- }, /*#__PURE__*/React.createElement(Form, Object.assign({}, props)));
8599
+ }, {
8600
+ children: jsx(Form, Object.assign({}, props))
8601
+ }));
8553
8602
  };
8554
8603
 
8555
8604
  /* *
@@ -8589,22 +8638,6 @@ const getPublicWarningFormError = createSelector(getPublicWarningStore, publicWa
8589
8638
  const getSelectedPublicWarningId = createSelector(getPublicWarningStore, publicWarningStore => (publicWarningStore === null || publicWarningStore === void 0 ? void 0 : publicWarningStore.selectedPublicWarningId) || '');
8590
8639
  const getSelectedPublicIsFormDirty = createSelector(getPublicWarningStore, publicWarningStore => (publicWarningStore === null || publicWarningStore === void 0 ? void 0 : publicWarningStore.isFormDirty) || false);
8591
8640
 
8592
- /* *
8593
- * Licensed under the Apache License, Version 2.0 (the "License");
8594
- * you may not use this file except in compliance with the License.
8595
- * You may obtain a copy of the License at
8596
- *
8597
- * http://www.apache.org/licenses/LICENSE-2.0
8598
- *
8599
- * Unless required by applicable law or agreed to in writing, software
8600
- * distributed under the License is distributed on an "AS IS" BASIS,
8601
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8602
- * See the License for the specific language governing permissions and
8603
- * limitations under the License.
8604
- *
8605
- * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
8606
- * Copyright 2023 - Finnish Meteorological Institute (FMI)
8607
- * */
8608
8641
  const PublicWarningsFormConnect = ({
8609
8642
  defaultBbox
8610
8643
  }) => {
@@ -8652,7 +8685,7 @@ const PublicWarningsFormConnect = ({
8652
8685
  };
8653
8686
  // Readonly also in case you are not creating a new warning and you are not set as the editor
8654
8687
  const isReadOnly = getIsReadOnly();
8655
- return /*#__PURE__*/React.createElement(PublicWarningsForm, {
8688
+ return jsx(PublicWarningsForm, {
8656
8689
  object: publicWarningObject,
8657
8690
  publicWarningDetails: publicWarning === null || publicWarning === void 0 ? void 0 : publicWarning.warningDetail,
8658
8691
  onPublishForm: publishForm,
@@ -8768,7 +8801,7 @@ const PublicWarningsFormDialogConnect = ({
8768
8801
  const isReadOnly = formAction === 'readonly' || !isEditor && publicWarningStatus !== undefined;
8769
8802
  // Only show toggle if in draft status
8770
8803
  const shouldHideFormToggleMode = publicWarningStatus !== 'DRAFT' && publicWarningStatus !== 'DRAFT_PUBLISHED';
8771
- return /*#__PURE__*/React__default.createElement(PublicWarningsFormDialog, {
8804
+ return jsx(PublicWarningsFormDialog, Object.assign({
8772
8805
  isOpen: isDialogOpen,
8773
8806
  onClose: closeDialog,
8774
8807
  order: dialogOrder,
@@ -8781,8 +8814,10 @@ const PublicWarningsFormDialogConnect = ({
8781
8814
  onChangeFormMode: onChangeFormMode,
8782
8815
  shouldHideFormMode: shouldHideFormToggleMode,
8783
8816
  publicWarningEditor: publicWarningEditor
8784
- }, /*#__PURE__*/React__default.createElement(PublicWarningsFormConnect, {
8785
- defaultBbox: defaultBbox
8817
+ }, {
8818
+ children: jsx(PublicWarningsFormConnect, {
8819
+ defaultBbox: defaultBbox
8820
+ })
8786
8821
  }));
8787
8822
  };
8788
8823
 
@@ -8856,7 +8891,7 @@ const getWarningWithoutIdStatusEditor = warning => {
8856
8891
  });
8857
8892
  };
8858
8893
  const getStatusIcon = warning => {
8859
- const getStatusTag = (content, color, icon = null) => ( /*#__PURE__*/React__default.createElement(StatusTag, {
8894
+ const getStatusTag = (content, color, icon = null) => jsx(StatusTag, {
8860
8895
  content: content,
8861
8896
  color: color,
8862
8897
  sx: {
@@ -8865,12 +8900,12 @@ const getStatusIcon = warning => {
8865
8900
  marginRight: 2
8866
8901
  },
8867
8902
  icon: icon
8868
- }));
8903
+ });
8869
8904
  switch (warning.status) {
8870
8905
  case 'TODO':
8871
8906
  return null;
8872
8907
  case 'DRAFT':
8873
- return /*#__PURE__*/React__default.createElement(Box, {
8908
+ return jsx(Box, Object.assign({
8874
8909
  sx: {
8875
8910
  height: '16px',
8876
8911
  padding: '0px',
@@ -8879,9 +8914,11 @@ const getStatusIcon = warning => {
8879
8914
  justifyContent: 'center',
8880
8915
  color: 'geowebColors.iconButtons.flat.default.color'
8881
8916
  }
8882
- }, /*#__PURE__*/React__default.createElement(Edit, null));
8917
+ }, {
8918
+ children: jsx(Edit, {})
8919
+ }));
8883
8920
  case 'DRAFT_PUBLISHED':
8884
- return getStatusTag('Pub', 'green', /*#__PURE__*/React__default.createElement(Edit, {
8921
+ return getStatusTag('Pub', 'green', jsx(Edit, {
8885
8922
  sx: {
8886
8923
  width: 20,
8887
8924
  height: 20,
@@ -8901,23 +8938,27 @@ const WarningListHeaderContent = _a => {
8901
8938
  width = 76
8902
8939
  } = _a,
8903
8940
  props = __rest(_a, ["title", "width"]);
8904
- return /*#__PURE__*/React__default.createElement(Grid, Object.assign({
8941
+ return jsx(Grid, Object.assign({
8905
8942
  item: true
8906
8943
  }, props, {
8907
8944
  sx: Object.assign(Object.assign({}, props.sx), {
8908
8945
  width
8909
8946
  })
8910
- }), /*#__PURE__*/React__default.createElement(Box, {
8911
- sx: {
8912
- overflow: 'hidden',
8913
- fontWeight: 'normal',
8914
- textOverflow: 'ellipsis',
8915
- fontSize: 12,
8916
- lineHeight: 1.33,
8917
- height: 16,
8918
- color: 'geowebColors.captions.captionStatus.rgba'
8919
- }
8920
- }, 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
+ }));
8921
8962
  };
8922
8963
  const WarningListColumnContent = _a => {
8923
8964
  var {
@@ -8927,34 +8968,40 @@ const WarningListColumnContent = _a => {
8927
8968
  width = 76
8928
8969
  } = _a,
8929
8970
  props = __rest(_a, ["title", "status", "children", "width"]);
8930
- return /*#__PURE__*/React__default.createElement(Grid, Object.assign({
8971
+ return jsxs(Grid, Object.assign({
8931
8972
  item: true
8932
8973
  }, props, {
8933
8974
  sx: Object.assign(Object.assign({}, props.sx), {
8934
8975
  width
8935
8976
  })
8936
- }), title && ( /*#__PURE__*/React__default.createElement(Box, {
8937
- sx: {
8938
- overflow: 'hidden',
8939
- fontWeight: 'normal',
8940
- textOverflow: 'ellipsis',
8941
- fontSize: 10,
8942
- lineHeight: 1.6,
8943
- height: 12,
8944
- color: status === 'EXPIRED' ? 'geowebColors.typographyAndIcons.inactiveText' : 'geowebColors.captions.captionStatus.rgba',
8945
- display: 'block',
8946
- [`@container publicWarningList (min-width: ${breakpoints.desktop}px)`]: {
8947
- 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
+ }
8948
8991
  }
8949
- }
8950
- }, title)), /*#__PURE__*/React__default.createElement(Box, {
8951
- sx: {
8952
- overflow: 'visible',
8953
- fontSize: 12,
8954
- lineHeight: 1.2,
8955
- color: status === 'EXPIRED' ? 'geowebColors.typographyAndIcons.inactiveText' : 'geowebColors.typographyAndIcons.text'
8956
- }
8957
- }, 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
+ }));
8958
9005
  };
8959
9006
  const WarningsOnStatus = ({
8960
9007
  warnings,
@@ -8985,23 +9032,23 @@ const WarningsOnStatus = ({
8985
9032
  const duplicate = {
8986
9033
  text: t('warning-list-button-duplicate'),
8987
9034
  action: () => _onEditWarning(getWarningWithoutIdStatusEditor(warning)),
8988
- icon: /*#__PURE__*/React__default.createElement(Copy, null)
9035
+ icon: jsx(Copy, {})
8989
9036
  };
8990
9037
  switch (status) {
8991
9038
  case 'PUBLISHED':
8992
9039
  return [{
8993
9040
  text: t('warning-list-button-update'),
8994
9041
  action: () => _onEditWarning(getWarningWithLinkedToId(warning)),
8995
- icon: /*#__PURE__*/React__default.createElement(Edit, null)
9042
+ icon: jsx(Edit, {})
8996
9043
  }, duplicate, {
8997
9044
  text: t('warning-list-button-expire'),
8998
9045
  action: () => null,
8999
- icon: /*#__PURE__*/React__default.createElement(Expire, null),
9046
+ icon: jsx(Expire, {}),
9000
9047
  isDisabled: true
9001
9048
  }, {
9002
9049
  text: t('warning-list-button-withdraw'),
9003
9050
  action: () => null,
9004
- icon: /*#__PURE__*/React__default.createElement(Remove, null),
9051
+ icon: jsx(Remove, {}),
9005
9052
  isDisabled: true
9006
9053
  }];
9007
9054
  case 'EXPIRED':
@@ -9011,149 +9058,182 @@ const WarningsOnStatus = ({
9011
9058
  return [{
9012
9059
  text: t('object-manager-button-edit'),
9013
9060
  action: () => _onEditWarning(warning),
9014
- icon: /*#__PURE__*/React__default.createElement(Edit, null)
9061
+ icon: jsx(Edit, {})
9015
9062
  }, duplicate, {
9016
9063
  text: t('object-manager-button-delete'),
9017
- action: () => _onDeleteWarning(warning.id),
9018
- icon: /*#__PURE__*/React__default.createElement(Delete, null)
9064
+ action: () => _onDeleteWarning(warning.id, warning.editor),
9065
+ icon: jsx(Delete, {})
9019
9066
  }];
9020
9067
  case 'TODO':
9021
9068
  return [{
9022
9069
  text: t('warning-list-button-use'),
9023
9070
  action: () => _onEditWarning(getWarningWithProposalId(warning)),
9024
- icon: /*#__PURE__*/React__default.createElement(Success, null)
9071
+ icon: jsx(Success, {})
9025
9072
  }, {
9026
9073
  text: t('object-manager-button-delete'),
9027
9074
  action: () => _onDeleteReviewWarning(warning),
9028
- icon: /*#__PURE__*/React__default.createElement(Delete, null)
9075
+ icon: jsx(Delete, {})
9029
9076
  }];
9030
9077
  default:
9031
9078
  return [];
9032
9079
  }
9033
9080
  };
9034
- return /*#__PURE__*/React__default.createElement(Box, {
9081
+ return jsxs(Box, Object.assign({
9035
9082
  sx: {
9036
9083
  paddingBottom: 2
9037
9084
  }
9038
- }, /*#__PURE__*/React__default.createElement(Typography, {
9039
- variant: "caption",
9040
- sx: {
9041
- opacity: 0.67
9042
- }
9043
- }, headerText), warnings.length > 0 && ( /*#__PURE__*/React__default.createElement(List, {
9044
- "aria-label": `warninglist ${status}`
9045
- }, warnings.map(warning => {
9046
- var _a;
9047
- const phenomenonDetails = warningPhenomena(t).find(phenomenon => phenomenon.key === warning.warningDetail.phenomenon);
9048
- const levelDetails = levelOptions(t).find(level => level.key === warning.warningDetail.level);
9049
- return /*#__PURE__*/React__default.createElement(ListItem, {
9050
- key: warning.id,
9051
- sx: {
9052
- marginBottom: 0.25,
9053
- minHeight: '32px',
9054
- padding: '0 0',
9055
- backgroundColor: status === 'EXPIRED' ? 'geowebColors.cards.cardContainerDisabled' : 'geowebColors.cards.cardContainer',
9056
- borderColor: status === 'EXPIRED' ? 'geowebColors.cards.cardContainerDisabledBorder' : 'geowebColors.cards.cardContainerBorder',
9057
- borderRadius: 1,
9058
- borderWidth: activeWarningId === warning.id ? '1px' : '1px',
9059
- borderStyle: 'solid'
9060
- },
9061
- secondaryAction: /*#__PURE__*/React__default.createElement(ToggleMenu, {
9062
- menuTitle: t('warning-list-button-options'),
9063
- tooltipTitle: t('warning-list-button-options'),
9064
- menuPosition: "bottom",
9065
- "aria-label": t('warning-list-button-options'),
9066
- menuItems: getMenuItems(warning),
9067
- buttonIcon: /*#__PURE__*/React__default.createElement(Options, null)
9068
- })
9069
- }, /*#__PURE__*/React__default.createElement(ListItemButton, {
9070
- sx: {
9071
- height: '100%',
9072
- padding: 1,
9073
- '.warning-list': {
9074
- justifyContent: 'left'
9075
- },
9076
- [`@container publicWarningList (min-width: ${breakpoints.desktop}px)`]: {
9077
- '.warning-list': {
9078
- justifyContent: 'space-between'
9079
- }
9080
- }
9081
- },
9082
- onClick: () => _onSelectWarning(warning),
9083
- "aria-label": `warning item for ${warning.id}`,
9084
- selected: activeWarningId === warning.id
9085
- }, /*#__PURE__*/React__default.createElement(Grid, {
9086
- className: "warning-list",
9087
- container: true,
9088
- item: true,
9089
- xs: true,
9090
- rowSpacing: 0,
9091
- columnSpacing: 2,
9092
- alignItems: "center"
9093
- }, /*#__PURE__*/React__default.createElement(WarningListColumnContent, {
9094
- title: t('warning-list-header-incident'),
9095
- status: status,
9096
- width: 142
9097
- }), /*#__PURE__*/React__default.createElement(WarningListColumnContent, {
9098
- title: `${t('warning-list-header-last-update')} UTC`,
9099
- status: status,
9100
- width: 142
9101
- }, warning.lastUpdatedTime && dateUtils.dateToString(dateUtils.utc(warning.lastUpdatedTime), dateUtils.DATE_FORMAT_NAME_OF_DAY_MONTH)), /*#__PURE__*/React__default.createElement(WarningListColumnContent, {
9102
- title: `${t('warning-list-header-start-time')} UTC`,
9103
- status: status,
9104
- width: 142
9105
- }, warning.warningDetail.validFrom && dateUtils.dateToString(dateUtils.utc(warning.warningDetail.validFrom), dateUtils.DATE_FORMAT_NAME_OF_DAY_MONTH)), /*#__PURE__*/React__default.createElement(WarningListColumnContent, {
9106
- title: `${t('warning-list-header-end-time')} UTC`,
9107
- status: status,
9108
- width: 142
9109
- }, warning.warningDetail.validUntil && dateUtils.dateToString(dateUtils.utc(warning.warningDetail.validUntil), dateUtils.DATE_FORMAT_NAME_OF_DAY_MONTH)), /*#__PURE__*/React__default.createElement(WarningListColumnContent, {
9110
- title: t('warning-list-header-domain'),
9111
- status: status
9112
- }, warning.warningDetail.domain), /*#__PURE__*/React__default.createElement(WarningListColumnContent, {
9113
- title: t('warning-list-header-phenomenon'),
9114
- status: status,
9115
- width: 140,
9116
- sx: {
9117
- position: 'relative'
9118
- }
9119
- }, (phenomenonDetails === null || phenomenonDetails === void 0 ? void 0 : phenomenonDetails.title) || '-', /*#__PURE__*/React__default.createElement(Box, {
9120
- sx: {
9121
- position: 'absolute',
9122
- right: 0,
9123
- bottom: -6
9124
- }
9125
- }, phenomenonDetails === null || phenomenonDetails === void 0 ? void 0 : phenomenonDetails.icon)), /*#__PURE__*/React__default.createElement(WarningListColumnContent, {
9126
- title: t('warning-list-header-level'),
9127
- status: status
9128
- }, /*#__PURE__*/React__default.createElement(Box, {
9129
- component: "span",
9130
- sx: {
9131
- color: levelDetails === null || levelDetails === void 0 ? void 0 : levelDetails.textColor,
9132
- backgroundColor: levelDetails === null || levelDetails === void 0 ? void 0 : levelDetails.color,
9133
- paddingLeft: 0.5,
9134
- paddingRight: 0.5,
9135
- paddingBottom: '1px',
9136
- marginLeft: -0.5
9137
- }
9138
- }, ((_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, {
9139
- title: t('warning-list-header-status'),
9140
- status: status,
9141
- width: 96
9142
- }, /*#__PURE__*/React__default.createElement(Box, {
9143
- sx: {
9144
- position: 'relative'
9145
- }
9146
- }, getStatusIcon(warning), warning.editor && ( /*#__PURE__*/React__default.createElement(Box, {
9085
+ }, {
9086
+ children: [jsx(Typography, Object.assign({
9087
+ variant: "caption",
9147
9088
  sx: {
9148
- width: '16px',
9149
- position: 'absolute',
9150
- top: '1px',
9151
- right: '-12px'
9089
+ opacity: 0.67
9152
9090
  }
9153
- }, /*#__PURE__*/React__default.createElement(WarningAvatar, {
9154
- editor: warning.editor
9155
- }))))))));
9156
- }))));
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
+ }));
9157
9237
  };
9158
9238
  const PublicWarningList = ({
9159
9239
  warnings,
@@ -9172,7 +9252,7 @@ const PublicWarningList = ({
9172
9252
  t
9173
9253
  } = useWarningsTranslation();
9174
9254
  const sortedWarnings = warnings ? sortWarningsOnStatus(warnings) : null;
9175
- return /*#__PURE__*/React__default.createElement(Box, {
9255
+ return jsxs(Box, Object.assign({
9176
9256
  sx: {
9177
9257
  padding: 3,
9178
9258
  height: '100%',
@@ -9181,115 +9261,127 @@ const PublicWarningList = ({
9181
9261
  containerType: 'inline-size'
9182
9262
  },
9183
9263
  "data-testid": "publicWarningList"
9184
- }, /*#__PURE__*/React__default.createElement(Grid, {
9185
- container: true,
9186
- justifyContent: "flex-end"
9187
- }, /*#__PURE__*/React__default.createElement(Button, {
9188
- variant: "primary",
9189
- onClick: _onCreateWarning,
9190
- sx: {
9191
- textTransform: 'initial',
9192
- marginBottom: '8px',
9193
- fontSize: '12px',
9194
- height: '32px'
9195
- }
9196
- }, t('warning-list-button_create'))), error && /*#__PURE__*/React__default.createElement(AlertBanner, {
9197
- title: error.message,
9198
- shouldClose: true
9199
- }), _isLoading ? ( /*#__PURE__*/React__default.createElement(LinearProgress, {
9200
- "data-testid": "loading-bar",
9201
- color: "secondary"
9202
- })) : ( /*#__PURE__*/React__default.createElement(Box, {
9203
- sx: {
9204
- height: '4px'
9205
- }
9206
- })), !error && ( /*#__PURE__*/React__default.createElement(Grid, {
9207
- container: true,
9208
- rowSpacing: 0,
9209
- columnSpacing: 2,
9210
- alignItems: "center",
9211
- justifyContent: "space-between",
9212
- sx: {
9213
- maxWidth: '100%',
9214
- display: 'none',
9215
- [`@container publicWarningList (min-width: ${breakpoints.desktop}px)`]: {
9216
- 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'
9217
9290
  }
9218
- }
9219
- }, /*#__PURE__*/React__default.createElement(WarningListHeaderContent, {
9220
- title: t('warning-list-header-incident'),
9221
- width: 142,
9222
- sx: {
9223
- marginLeft: 1
9224
- }
9225
- }), /*#__PURE__*/React__default.createElement(WarningListHeaderContent, {
9226
- title: `${t('warning-list-header-last-update')} UTC`,
9227
- width: 142
9228
- }), /*#__PURE__*/React__default.createElement(WarningListHeaderContent, {
9229
- title: `${t('warning-list-header-start-time')} UTC`,
9230
- width: 142
9231
- }), /*#__PURE__*/React__default.createElement(WarningListHeaderContent, {
9232
- title: `${t('warning-list-header-end-time')} UTC`,
9233
- width: 142
9234
- }), /*#__PURE__*/React__default.createElement(WarningListHeaderContent, {
9235
- title: t('warning-list-header-domain')
9236
- }), /*#__PURE__*/React__default.createElement(WarningListHeaderContent, {
9237
- title: t('warning-list-header-phenomenon'),
9238
- width: 140
9239
- }), /*#__PURE__*/React__default.createElement(WarningListHeaderContent, {
9240
- title: t('warning-list-header-level')
9241
- }), /*#__PURE__*/React__default.createElement(WarningListHeaderContent, {
9242
- title: t('warning-list-header-status'),
9243
- width: 96,
9244
- sx: {
9245
- marginRight: '48px'
9246
- }
9247
- }))), lastUpdatedTime && ( /*#__PURE__*/React__default.createElement(Box, {
9248
- sx: {
9249
- marginBottom: -3.25,
9250
- button: {
9251
- 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
+ }
9252
9303
  }
9253
- }
9254
- }, /*#__PURE__*/React__default.createElement(LastUpdateTime, {
9255
- onPressRefresh: _onRefetchWarnings,
9256
- lastUpdateTime: lastUpdatedTime
9257
- }))), sortedWarnings && !error && ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(WarningsOnStatus, {
9258
- status: "TODO",
9259
- warnings: sortedWarnings.todo,
9260
- onSelectWarning: _onSelectWarning2,
9261
- onEditWarning: _onEditWarning2,
9262
- onDeleteWarning: _onDeleteWarning2,
9263
- onDeleteReviewWarning: _onDeleteReviewWarning2,
9264
- activeWarningId: _selectedPublicWarningId
9265
- }), /*#__PURE__*/React__default.createElement(WarningsOnStatus, {
9266
- status: "DRAFT",
9267
- warnings: sortedWarnings.draft,
9268
- onSelectWarning: _onSelectWarning2,
9269
- onEditWarning: _onEditWarning2,
9270
- onDeleteWarning: _onDeleteWarning2,
9271
- onDeleteReviewWarning: _onDeleteReviewWarning2,
9272
- activeWarningId: _selectedPublicWarningId
9273
- }), /*#__PURE__*/React__default.createElement(WarningsOnStatus, {
9274
- status: "PUBLISHED",
9275
- warnings: sortedWarnings.published,
9276
- onSelectWarning: _onSelectWarning2,
9277
- onEditWarning: _onEditWarning2,
9278
- onDeleteWarning: _onDeleteWarning2,
9279
- onDeleteReviewWarning: _onDeleteReviewWarning2,
9280
- activeWarningId: _selectedPublicWarningId
9281
- }), /*#__PURE__*/React__default.createElement(WarningsOnStatus, {
9282
- status: "EXPIRED",
9283
- warnings: sortedWarnings.expired,
9284
- onSelectWarning: _onSelectWarning2,
9285
- onEditWarning: _onEditWarning2,
9286
- onDeleteWarning: _onDeleteWarning2,
9287
- onDeleteReviewWarning: _onDeleteReviewWarning2,
9288
- activeWarningId: _selectedPublicWarningId
9289
- }))));
9290
- };
9291
-
9292
- 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;
9293
9385
  var defineProperty = objectDefineProperty;
9294
9386
 
9295
9387
  var defineBuiltInAccessor$1 = function (target, name, descriptor) {
@@ -9396,13 +9488,15 @@ const ConfirmDeleteWarningDialog = ({
9396
9488
  description,
9397
9489
  request,
9398
9490
  confirmLabel,
9399
- callback
9491
+ callback,
9492
+ isLocked
9400
9493
  }) => {
9401
9494
  const {
9402
9495
  t
9403
9496
  } = useWarningsTranslation();
9497
+ const defaultError = isLocked ? t('warning-dialog-delete-islocked') : undefined;
9404
9498
  const [isLoading, setIsLoading] = React__default.useState(false);
9405
- const [error, setError] = React__default.useState(undefined);
9499
+ const [error, setError] = React__default.useState(defaultError);
9406
9500
  const onSubmit = () => __awaiter(void 0, void 0, void 0, function* () {
9407
9501
  setIsLoading(true);
9408
9502
  try {
@@ -9414,7 +9508,7 @@ const ConfirmDeleteWarningDialog = ({
9414
9508
  setIsLoading(false);
9415
9509
  }
9416
9510
  });
9417
- return /*#__PURE__*/React__default.createElement(ConfirmationDialog, Object.assign({
9511
+ return jsx(ConfirmationDialog, Object.assign({
9418
9512
  title: title,
9419
9513
  open: true,
9420
9514
  confirmLabel: confirmLabel,
@@ -9427,18 +9521,23 @@ const ConfirmDeleteWarningDialog = ({
9427
9521
  width: 330
9428
9522
  }
9429
9523
  }, error && {
9430
- content: ( /*#__PURE__*/React__default.createElement(Box, {
9524
+ content: jsxs(Box, Object.assign({
9431
9525
  sx: {
9432
9526
  marginBottom: 0
9433
9527
  }
9434
- }, /*#__PURE__*/React__default.createElement(AlertBanner, {
9435
- title: error
9436
- }), /*#__PURE__*/React__default.createElement(Typography, {
9437
- variant: "body1",
9438
- sx: {
9439
- marginTop: 1
9440
- }
9441
- }, 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
+ }))
9442
9541
  }));
9443
9542
  };
9444
9543
 
@@ -9448,6 +9547,9 @@ const PublicWarningListConnect = () => {
9448
9547
  } = useWarningsTranslation();
9449
9548
  const dispatch = useDispatch();
9450
9549
  const confirmDialog = useConfirmationDialog();
9550
+ const {
9551
+ auth
9552
+ } = useAuthenticationContext();
9451
9553
  const [confirmDialogOptions, setConfirmDialogOptions] = React__default.useState(undefined);
9452
9554
  const warnings = useSelector(store => selectAllPublicWarnings(store));
9453
9555
  const selectedPublicWarningId = useSelector(store => getSelectedPublicWarningId(store));
@@ -9483,13 +9585,15 @@ const PublicWarningListConnect = () => {
9483
9585
  }));
9484
9586
  };
9485
9587
  const warningsApi = getWarningsApi();
9486
- const deleteWarning = warningId => {
9588
+ const deleteWarning = (warningId, warningEditor) => {
9589
+ const isLocked = warningEditor && warningEditor !== (auth === null || auth === void 0 ? void 0 : auth.username) || false;
9487
9590
  setConfirmDialogOptions({
9488
9591
  confirmLabel: t('warning-dialog-delete-confirm'),
9489
9592
  title: t('warning-dialog-delete-title'),
9490
9593
  description: t('warning-dialog-delete-description'),
9491
9594
  request: () => warningsApi.deleteWarning(warningId),
9492
- callback: () => onRemoveSuccess(warningId, t('warning-dialog-delete-succes'))
9595
+ callback: () => onRemoveSuccess(warningId, t('warning-dialog-delete-succes')),
9596
+ isLocked
9493
9597
  });
9494
9598
  };
9495
9599
  const deleteReviewWarning = warning => {
@@ -9524,26 +9628,29 @@ const PublicWarningListConnect = () => {
9524
9628
  // fetch warnings on mount
9525
9629
  fetchWarnings();
9526
9630
  }, [fetchWarnings]);
9527
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(PublicWarningList, {
9528
- warnings: warnings,
9529
- isLoading: isLoading,
9530
- error: error,
9531
- onSelectWarning: selectWarning,
9532
- onCreateWarning: createWarning,
9533
- onEditWarning: editWarning,
9534
- onDeleteWarning: deleteWarning,
9535
- onDeleteReviewWarning: deleteReviewWarning,
9536
- selectedPublicWarningId: selectedPublicWarningId,
9537
- lastUpdatedTime: lastUpdatedTime,
9538
- onRefetchWarnings: fetchWarnings
9539
- }), confirmDialogOptions && ( /*#__PURE__*/React__default.createElement(ConfirmDeleteWarningDialog, {
9540
- onClose: () => setConfirmDialogOptions(undefined),
9541
- title: confirmDialogOptions.title,
9542
- description: confirmDialogOptions.description,
9543
- request: confirmDialogOptions.request,
9544
- confirmLabel: confirmDialogOptions.confirmLabel,
9545
- callback: confirmDialogOptions.callback
9546
- })));
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
+ });
9547
9654
  };
9548
9655
 
9549
9656
  const warningListViewPreset = {
@@ -9557,7 +9664,7 @@ const PublicWarningApiWrapper = ({
9557
9664
  auth,
9558
9665
  onSetAuth
9559
9666
  }) => {
9560
- return config ? ( /*#__PURE__*/React.createElement(ApiProvider, {
9667
+ return config ? jsx(ApiProvider, Object.assign({
9561
9668
  config: {
9562
9669
  baseURL: config.baseURL,
9563
9670
  appURL: config.baseURL,
@@ -9567,7 +9674,11 @@ const PublicWarningApiWrapper = ({
9567
9674
  auth: auth,
9568
9675
  onSetAuth: onSetAuth,
9569
9676
  createApi: createApi$1
9570
- }, /*#__PURE__*/React.createElement(ErrorBoundary, null, /*#__PURE__*/React.createElement(PublicWarningListConnect, null)))) : null;
9677
+ }, {
9678
+ children: jsx(ErrorBoundary, {
9679
+ children: jsx(PublicWarningListConnect, {})
9680
+ })
9681
+ })) : null;
9571
9682
  };
9572
9683
  const componentsLookUp = (payload, apiProps) => {
9573
9684
  const {
@@ -9576,11 +9687,11 @@ const componentsLookUp = (payload, apiProps) => {
9576
9687
  switch (componentType) {
9577
9688
  case warningListViewPreset.componentType:
9578
9689
  if (apiProps && apiProps.config) {
9579
- return /*#__PURE__*/React.createElement(PublicWarningApiWrapper, Object.assign({}, apiProps, {
9690
+ return jsx(PublicWarningApiWrapper, Object.assign({}, apiProps, {
9580
9691
  "data-testid": "publicWarningModule"
9581
9692
  }));
9582
9693
  }
9583
- return /*#__PURE__*/React.createElement(PublicWarningListConnect, {
9694
+ return jsx(PublicWarningListConnect, {
9584
9695
  "data-testid": "publicWarningList"
9585
9696
  });
9586
9697
  default:
@@ -9701,13 +9812,27 @@ publicWarningFormListener.startListening({
9701
9812
  });
9702
9813
  const saveOrUpdateWarning = publicWarning => __awaiter(void 0, void 0, void 0, function* () {
9703
9814
  const warningsApi = getWarningsApi();
9704
- if (publicWarning.warningDetail.id) {
9705
- 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);
9706
9821
  return publicWarning;
9707
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
+ }
9708
9833
  const newWarningId = yield warningsApi.saveWarningAs(publicWarning);
9709
9834
  return Object.assign(Object.assign({}, publicWarning), {
9710
- warningDetail: Object.assign(Object.assign({}, publicWarning.warningDetail), {
9835
+ warningDetail: Object.assign(Object.assign({}, warningDetail), {
9711
9836
  id: newWarningId
9712
9837
  })
9713
9838
  });