@opengeoweb/warnings 9.14.0 → 9.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/index.esm.js +1263 -595
  2. package/package.json +5 -2
  3. package/src/lib/components/DrawingTool/useObjectDrawDialogAction.d.ts +3 -7
  4. package/src/lib/components/DrawingToolForm/DrawingToolFormContents.d.ts +0 -6
  5. package/src/lib/components/ObjectManager/ConfirmDeleteDialog.d.ts +3 -5
  6. package/src/lib/components/ObjectManager/ObjectManager.d.ts +0 -1
  7. package/src/lib/components/ObjectManager/ObjectManagerConnect.d.ts +0 -4
  8. package/src/lib/components/ObjectManager/Objects.d.ts +0 -6
  9. package/src/lib/components/Providers/Providers.d.ts +6 -0
  10. package/src/lib/components/PublicWarningList/ConfirmWarningDialog.d.ts +0 -1
  11. package/src/lib/components/PublicWarningList/PublicWarningList.d.ts +0 -6
  12. package/src/lib/components/PublicWarningList/PublicWarningListConnect.d.ts +0 -8
  13. package/src/lib/components/PublicWarningsForm/AreaField/AreaField.d.ts +0 -8
  14. package/src/lib/components/PublicWarningsForm/LevelField/LevelField.d.ts +15 -5
  15. package/src/lib/components/PublicWarningsForm/PhenomenonField/PhenomenonField.d.ts +6 -4
  16. package/src/lib/components/PublicWarningsForm/PublicWarningsForm.d.ts +5 -6
  17. package/src/lib/components/PublicWarningsForm/PublicWarningsFormConnect.d.ts +9 -1
  18. package/src/lib/components/PublicWarningsForm/ValidFromField/ValidFromField.d.ts +4 -5
  19. package/src/lib/components/PublicWarningsForm/ValidUntilField/ValidUntilField.d.ts +6 -7
  20. package/src/lib/components/PublicWarningsFormDialog/PublicWarningsFormDialog.d.ts +0 -1
  21. package/src/lib/components/PublicWarningsFormDialog/PublicWarningsFormDialogConnect.d.ts +8 -8
  22. package/src/lib/components/WarningsMapView/WarningsMapView.d.ts +13 -0
  23. package/src/lib/store/config.d.ts +6 -14
  24. package/src/lib/store/drawings/listener.d.ts +2 -0
  25. package/src/lib/store/drawings/selectors.d.ts +1 -1
  26. package/src/lib/store/drawings/types.d.ts +2 -7
  27. package/src/lib/store/publicWarningForm/sagas.d.ts +0 -2
  28. package/src/lib/store/publicWarningForm/selectors.d.ts +1 -1
  29. package/src/lib/store/publicWarnings/selectors.d.ts +1 -1
  30. package/src/lib/store/types.d.ts +9 -0
  31. package/src/lib/utils/api.d.ts +3 -3
  32. package/src/lib/utils/i18n.d.ts +411 -0
  33. package/src/lib/store/drawings/sagas.d.ts +0 -8
  34. /package/src/lib/{store/drawings/sagas.spec.d.ts → components/WarningsMapView/WarningsMapView.spec.d.ts} +0 -0
package/index.esm.js CHANGED
@@ -1,22 +1,28 @@
1
1
  import * as React from 'react';
2
2
  import React__default, { useState, useEffect } from 'react';
3
3
  import { useDispatch, useSelector } from 'react-redux';
4
- import { Polygons, Share, ExitDomain, Edit, Delete, DrawPolygon, Visibility, Add, Wind, Fog, Lightning, Snow, Rain, TemperatureHigh, TemperatureLow, CoastalEvent, breakpoints, Options, VisibilityOff, Success } from '@opengeoweb/theme';
5
- import { uiTypes, uiActions, getSingularDrawtoolDrawLayerId, drawtoolSelectors, layerSelectors, uiSelectors, drawtoolActions, mapStoreActions, layerActions, useSetupDialog } from '@opengeoweb/store';
6
- import { emptyGeoJSON, MapControlButton, getIcon, rewindGeometry, getGeoJSONPropertyValue, currentlySupportedDrawModes } from '@opengeoweb/webmap-react';
7
- import { useConfirmationDialog, ToggleMenu, dateUtils, calculateStartSize, ToolContainerDraggable, AlertBanner, ConfirmationDialog, getAxiosErrorMessage, usePrevious, CustomIconButton, CustomTooltip, Avatar, getInitials, SwitchButton, LastUpdateTime, StatusTag, ErrorBoundary, isAxiosError, pollingIntervalTimeout } from '@opengeoweb/shared';
8
- import { createEntityAdapter, createSlice, createSelector } from '@reduxjs/toolkit';
4
+ import { Polygons, Share, ExitDomain, Edit, Delete, ThemeWrapper, lightTheme, DrawPolygon, Visibility, Add, Wind, Fog, Lightning, Snow, Rain, TemperatureHigh, TemperatureLow, CoastalEvent, breakpoints, Options, VisibilityOff, Success } from '@opengeoweb/theme';
5
+ import { uiTypes, uiActions, getSingularDrawtoolDrawLayerId, drawtoolSelectors, layerSelectors, uiSelectors, mapStoreActions, drawtoolActions, layerActions, useSetupDialog, coreModuleConfig } from '@opengeoweb/store';
6
+ import { emptyGeoJSON, MapControlButton, getIcon, rewindGeometry, getGeoJSONPropertyValue, currentlySupportedDrawModes, MapView, MapViewLayer, defaultLayers, getFeatureExtent } from '@opengeoweb/webmap-react';
7
+ import { handleOutsideComponentTranslations, useConfirmationDialog, ToggleMenu, dateUtils, calculateStartSize, ToolContainerDraggable, AlertBanner, ConfirmationDialog, getAxiosErrorMessage, pollingIntervalTimeout, isAxiosError as isAxiosError$1, withEggs, usePrevious, CustomIconButton, CustomTooltip, Avatar, getInitials, SwitchButton, LastUpdateTime, StatusTag, ErrorBoundary } from '@opengeoweb/shared';
8
+ import { initReactI18next, useTranslation, I18nextProvider } from 'react-i18next';
9
+ import { createEntityAdapter, createSlice, createSelector, createListenerMiddleware } from '@reduxjs/toolkit';
10
+ import i18n from 'i18next';
9
11
  import { snackbarActions } from '@opengeoweb/snackbar';
10
12
  import { styled, Box, Typography, ListItem, Grid, Paper, ListItemButton, Stack, LinearProgress, Button, FormHelperText, MenuItem, Tabs, Tab, FormControl, Card, CardContent, ListItemIcon, CircularProgress, List } from '@mui/material';
11
13
  import { VariableSizeList } from 'react-window';
12
14
  import AutoSizer from 'react-virtualized-auto-sizer';
13
15
  import { DATE_FORMAT_FNS, ReactHookFormHiddenInput, isValidGeoJsonCoordinates, ReactHookFormSelect, ReactHookFormTextField, ReactHookFormProvider, defaultFormOptions, useDraftFormHelpers, errorMessages, ReactHookFormDateTime, isValidDate, isXHoursBefore, isXHoursAfter, isEmpty } from '@opengeoweb/form-fields';
14
16
  import { getApi, createApiInstance, createNonAuthApiInstance, createFakeApiInstance, ApiProvider } from '@opengeoweb/api';
17
+ import { createStore } from '@redux-eggs/redux-toolkit';
18
+ import { useAuthenticationContext } from '@opengeoweb/authentication';
19
+ import { takeLatest, call as call$c, put, select, delay } from 'redux-saga/effects';
20
+ import { isAxiosError } from 'axios';
15
21
  import { useFormContext } from 'react-hook-form';
16
22
  import { isEqual, cloneDeep, clamp } from 'lodash';
17
- import { useAuthenticationContext } from '@opengeoweb/authentication';
18
- import { takeLatest, put, call as call$c, select, delay } from 'redux-saga/effects';
19
- import { isAxiosError as isAxiosError$1 } from 'axios';
23
+ import { produce } from 'immer';
24
+ import { generateMapId, LayerType, getWMJSMapById, WMBBOX } from '@opengeoweb/webmap';
25
+ import { defaultBbox } from '@opengeoweb/core';
20
26
 
21
27
  /******************************************************************************
22
28
  Copyright (c) Microsoft Corporation.
@@ -108,7 +114,7 @@ const slice$2 = createSlice({
108
114
  drawAdapter.setOne(draft, action.payload);
109
115
  }
110
116
  },
111
- // action caught in drawings/saga
117
+ // action caught in drawings/listener
112
118
  submitDrawValues: (
113
119
  // eslint-disable-next-line no-unused-vars
114
120
  draft,
@@ -202,6 +208,468 @@ const {
202
208
  });
203
209
  const getWarningFormDirty = createSelector(selectDrawByInstanceId, drawing => (drawing === null || drawing === void 0 ? void 0 : drawing.isFormDirty) || false);
204
210
 
211
+ var en = {
212
+ "drawing-tool-form-tools": "Tools",
213
+ "drawing-tool-form-opacity": "Opacity",
214
+ "drawing-tool-form-object-name": "Object name",
215
+ "drawing-tool-form-save": "Save new object",
216
+ "drawing-tool-form-update": "Update object",
217
+ "drawing-tool-form-exit-draw-mode": "press ESC to exit draw mode",
218
+ "drawing-tool-form-drawing-required": "An object drawing is required",
219
+ "close-dialog-cancel": "Cancel",
220
+ "close-dialog-confirm": "Close",
221
+ "close-draw-dialog-title": "Close Drawing toolbox",
222
+ "close-dialog-description": "There are changes in the form, are you sure you want to close?",
223
+ "drawing-tool-title": "Drawing Toolbox",
224
+ "object-manager-title": "Object Manager for",
225
+ "object-manager-add": "Add a new object",
226
+ "delete-dialog-cancel": "Cancel",
227
+ "delete-dialog-confirm": "Delete",
228
+ "delete-dialog-title": "Delete object",
229
+ "delete-dialog-description": "Are you sure you want to delete",
230
+ "delete-succes": "has been deleted",
231
+ "update-succes": "has been updated",
232
+ "save-succes": "has been saved",
233
+ "object-manager-no-objects": "No objects found",
234
+ "object-manager-options-menu": "Object options",
235
+ "object-manager-button-edit": "Edit",
236
+ "object-manager-button-share": "Share",
237
+ "object-manager-button-delete": "Delete",
238
+ "object-manager-button-view": "View",
239
+ "object-manager-no-object-selected": "(no object selected)",
240
+ "object-manager-object-selected": "object selected",
241
+ "object-manager-share-menu": "Share object to",
242
+ "public-warning-title": "Public Warning",
243
+ "close-warning-dialog-title": "Close Public warning",
244
+ "warning-edit-mode-title": "Switch to edit mode",
245
+ "warning-edit-mode-description": "This warning is already in edit mode by another user and important information could get lost in the switching process.",
246
+ "warning-dialog-cancel": "Go back",
247
+ "warning-edit-mode-confirm": "Edit mode",
248
+ "warning-view-mode-title": "Whoops",
249
+ "warning-view-mode-description": "Are you sure you want to switch to view mode? Your unsaved changes will be lost.",
250
+ "warning-view-mode-confirm": "Switch mode",
251
+ "warning-probability": "Probability",
252
+ "warning-button-clear": "Clear",
253
+ "warning-button-save": "Save",
254
+ "warning-button-saving": "Saving",
255
+ "warning-button-publish": "Publish",
256
+ "warning-button-publishing": "Publishing",
257
+ "warning-area": "Area",
258
+ "warning-button-add-object": "Add object",
259
+ "warning-description-original": "Description original",
260
+ "warning-description-translation": "Description translation",
261
+ "warning-description-NL": "Dutch (selected)",
262
+ "warning-level": "Level",
263
+ "warning-level-moderate": "Moderate",
264
+ "warning-level-severe": "Severe",
265
+ "warning-level-extreme": "Extreme",
266
+ "warning-phenomenon": "Phenomenon",
267
+ "warning-phenomenon-wind": "Wind",
268
+ "warning-phenomenon-fog": "Fog",
269
+ "warning-phenomenon-thunderstorm": "Thunderstorm",
270
+ "warning-phenomenon-snow-ice": "Snow/ice",
271
+ "warning-phenomenon-rain": "Rain",
272
+ "warning-phenomenon-high-temp": "High temperature",
273
+ "warning-phenomenon-low-temp": "Low temperature",
274
+ "warning-phenomenon-funnel-cloud": "Funnel cloud",
275
+ "warning-phenomenon-coastal-event": "Coastal event",
276
+ "warning-valid-from": "Valid from",
277
+ "warning-valid-until": "Valid until",
278
+ "warning-valid-from-error-before-current": "Valid from time cannot be before current time",
279
+ "warning-valid-from-error-max-hours": "Valid from time can be no more than {{MAX_HOURS}} hours after current time",
280
+ "warning-valid-until-error-before-current": "Valid until time cannot be before current time",
281
+ "warning-valid-until-error-max-hours": "Valid until time can be no more than {{MAX_HOURS}} hours after current time",
282
+ "warning-valid-until-error-min-hours": "Valid until time has to be at least {{MIN_HOURS}} hour after Valid from time",
283
+ "warning-dialog-delete-succes": "Warning has been deleted",
284
+ "warning-dialog-delete-title": "Delete warning",
285
+ "warning-dialog-delete-confirm": "Delete",
286
+ "warning-dialog-delete-description": "Are you sure you want to delete this warning?",
287
+ "warning-dialog-ignore-succes": "Warning has been ignored",
288
+ "warning-dialog-ignore-title": "Ignore warning",
289
+ "warning-dialog-ignore-confirm": "Ignore",
290
+ "warning-dialog-ignore-description": "Are you sure you want to ignore this warning?",
291
+ "warning-save-succes": "Public warning has succesfully been saved!",
292
+ "warning-publish-succes": "Public warning has succesfully been published!",
293
+ "warning-editor-user-viewer": "Viewer",
294
+ "warning-editor-user-editor": "Editor",
295
+ "warning-editor-add-editor": "You are now the editor for this warning",
296
+ "warning-editor-remove-editor": "You are now no longer the editor for this warning",
297
+ "warning-list-button_create": "Create a warning",
298
+ "warning-list-button-use": "Use",
299
+ "warning-list-button-ignore": "Ignore",
300
+ "warning-list-button-options": "Options",
301
+ "warning-list-status-draft": "Drafts",
302
+ "warning-list-status-published": "Published",
303
+ "warning-list-status-todo": "Reviews",
304
+ "warning-list-status-expired": "Expired (last 24 hours)",
305
+ "warning-list-header-incident": "Incident",
306
+ "warning-list-header-last-update": "Last update",
307
+ "warning-list-header-start-time": "Start time",
308
+ "warning-list-header-end-time": "End time",
309
+ "warning-list-header-domain": "Domain",
310
+ "warning-list-header-phenomenon": "Phenomenon",
311
+ "warning-list-header-level": "Level",
312
+ "warning-list-header-draft": "DRAFT"
313
+ };
314
+ var nl = {
315
+ "drawing-tool-form-tools": "Gereedschap",
316
+ "drawing-tool-form-opacity": "Dekking",
317
+ "drawing-tool-form-object-name": "Object naam",
318
+ "drawing-tool-form-save": "Nieuw object opslaan",
319
+ "drawing-tool-form-update": "Object bijwerken",
320
+ "drawing-tool-form-exit-draw-mode": "druk op ESC om tekenmodus te verlaten",
321
+ "drawing-tool-form-drawing-required": "Een object tekening is verplicht",
322
+ "close-dialog-cancel": "Annuleren",
323
+ "close-dialog-confirm": "Sluiten",
324
+ "close-draw-dialog-title": "Tekenen sluiten",
325
+ "close-dialog-description": "Er zijn wijzigingen in het formulier, weet je zeker dat je wilt afsluiten?",
326
+ "drawing-tool-title": "Tekenen",
327
+ "object-manager-title": "Object Manager voor",
328
+ "object-manager-add": "Nieuw object toevoegen",
329
+ "delete-dialog-cancel": "Annuleren",
330
+ "delete-dialog-confirm": "Verwijderen",
331
+ "delete-dialog-title": "Object verwijderen",
332
+ "delete-dialog-description": "Weet je zeker dat je dit object wilt verwijderen:",
333
+ "delete-succes": "is verwijderd",
334
+ "update-succes": "is bijgewerkt",
335
+ "save-succes": "is opgeslagen",
336
+ "object-manager-no-objects": "Geen objecten gevonden",
337
+ "object-manager-options-menu": "Object acties",
338
+ "object-manager-button-edit": "Bewerken",
339
+ "object-manager-button-share": "Delen",
340
+ "object-manager-button-delete": "Verwijderen",
341
+ "object-manager-button-view": "Bekijken",
342
+ "object-manager-no-object-selected": "(geen object geselecteerd)",
343
+ "object-manager-object-selected": "object geselecteerd",
344
+ "object-manager-share-menu": "Object delen naar",
345
+ "public-warning-title": "Publieke Waarschuwing",
346
+ "close-warning-dialog-title": "Publieke waarschuwing sluiten",
347
+ "warning-edit-mode-title": "Wissel naar bewerken",
348
+ "warning-edit-mode-description": "Deze waarschuwing wordt al bewerkt door een andere gebruiker en belangrijke informatie kan verloren gaan.",
349
+ "warning-dialog-cancel": "Ga terug",
350
+ "warning-edit-mode-confirm": "Bewerken",
351
+ "warning-view-mode-title": "Oeps",
352
+ "warning-view-mode-description": "Weet je zeker dat je wilt wisselen naar weergavemodus? Niet-opgeslagen wijzigingen gaan verloren.",
353
+ "warning-view-mode-confirm": "Wisselen",
354
+ "warning-probability": "Waarschijnlijkheid",
355
+ "warning-button-clear": "Wissen",
356
+ "warning-button-save": "Opslaan",
357
+ "warning-button-saving": "Opslaan",
358
+ "warning-button-publish": "Publiceren",
359
+ "warning-button-publishing": "Publiceren",
360
+ "warning-area": "Gebied",
361
+ "warning-button-add-object": "Object toevoegen",
362
+ "warning-description-original": "Beschrijving origineel",
363
+ "warning-description-translation": "Beschrijving vertaling",
364
+ "warning-description-NL": "Nederlands (geselecteerd)",
365
+ "warning-level": "Niveau",
366
+ "warning-level-moderate": "Gematigd",
367
+ "warning-level-severe": "Ernstig",
368
+ "warning-level-extreme": "Extreem",
369
+ "warning-phenomenon": "Fenomeen",
370
+ "warning-phenomenon-wind": "Windstoten",
371
+ "warning-phenomenon-fog": "Dichte mist",
372
+ "warning-phenomenon-thunderstorm": "Onweersbuien",
373
+ "warning-phenomenon-snow-ice": "Sneeuw/gladheid",
374
+ "warning-phenomenon-rain": "Zware regen",
375
+ "warning-phenomenon-high-temp": "Hitte",
376
+ "warning-phenomenon-low-temp": "Koude",
377
+ "warning-phenomenon-funnel-cloud": "Hozen",
378
+ "warning-phenomenon-coastal-event": "Kust incident",
379
+ "warning-valid-from": "Geldig vanaf",
380
+ "warning-valid-until": "Geldig tot",
381
+ "warning-valid-from-error-before-current": "Starttijd mag niet eerder zijn dan huidige tijd",
382
+ "warning-valid-from-error-max-hours": "Starttijd mag niet meer dan {{MAX_HOURS}} uur na huidige tijd zijn",
383
+ "warning-valid-until-error-before-current": "Eindtijd mag niet eerder zijn dan huidige tijd",
384
+ "warning-valid-until-error-max-hours": "Eindtijd mag niet meer dan {{MAX_HOURS}} uur na huidige tijd zijn",
385
+ "warning-valid-until-error-min-hours": "Eindtijd moet minstens {{MIN_HOURS}} uur later zijn dan starttijd",
386
+ "warning-dialog-delete-succes": "Waarschuwing is verwijderd",
387
+ "warning-dialog-delete-title": "Waarschuwing verwijderen",
388
+ "warning-dialog-delete-confirm": "Verwijderen",
389
+ "warning-dialog-delete-description": "Weet je zeker dat je deze waarschuwing wilt verwijderen?",
390
+ "warning-dialog-ignore-succes": "Waarschuwing is genegeerd",
391
+ "warning-dialog-ignore-title": "Waarschuwing negeren",
392
+ "warning-dialog-ignore-confirm": "Negeren",
393
+ "warning-dialog-ignore-description": "Weet je zeker dat je deze waarschuwing wilt negeren?",
394
+ "warning-save-succes": "Publieke waarschuwing is succesvol opgeslagen!",
395
+ "warning-publish-succes": "Publieke waarschuwing is succesvol gepubliceerd!",
396
+ "warning-editor-add-editor": "Je bent nu de editor van deze waarschuwing",
397
+ "warning-editor-remove-editor": "Je bent nu niet langer de editor van deze waarschuwing",
398
+ "warning-editor-user-viewer": "Kijker",
399
+ "warning-editor-user-editor": "Editor",
400
+ "warning-list-button_create": "Maak waarschuwing",
401
+ "warning-list-button-use": "Gebruik",
402
+ "warning-list-button-ignore": "Negeer",
403
+ "warning-list-button-options": "Opties",
404
+ "warning-list-status-draft": "Concepten",
405
+ "warning-list-status-published": "Gepubliceerd",
406
+ "warning-list-status-todo": "Te doen",
407
+ "warning-list-status-expired": "Verlopen (laatste 24 uur)",
408
+ "warning-list-header-incident": "Incident",
409
+ "warning-list-header-last-update": "Laatste update",
410
+ "warning-list-header-start-time": "Starttijd",
411
+ "warning-list-header-end-time": "Eindtijd",
412
+ "warning-list-header-domain": "Domein",
413
+ "warning-list-header-phenomenon": "Fenomeen",
414
+ "warning-list-header-level": "Hoogte",
415
+ "warning-list-header-draft": "CONCEPT"
416
+ };
417
+ var fi = {
418
+ "drawing-tool-form-tools": "ei käännetty",
419
+ "drawing-tool-form-opacity": "ei käännetty",
420
+ "drawing-tool-form-object-name": "ei käännetty",
421
+ "drawing-tool-form-save": "ei käännetty",
422
+ "drawing-tool-form-update": "ei käännetty",
423
+ "drawing-tool-form-exit-draw-mode": "ei käännetty",
424
+ "drawing-tool-form-drawing-required": "ei käännetty",
425
+ "close-dialog-cancel": "ei käännetty",
426
+ "close-dialog-confirm": "ei käännetty",
427
+ "close-draw-dialog-title": "ei käännetty",
428
+ "close-dialog-description": "ei käännetty",
429
+ "drawing-tool-title": "ei käännetty",
430
+ "object-manager-title": "ei käännetty",
431
+ "object-manager-add": "ei käännetty",
432
+ "delete-dialog-cancel": "ei käännetty",
433
+ "delete-dialog-confirm": "ei käännetty",
434
+ "delete-dialog-title": "ei käännetty",
435
+ "delete-dialog-description": "ei käännetty",
436
+ "delete-succes": "ei käännetty",
437
+ "update-succes": "ei käännetty",
438
+ "save-succes": "ei käännetty",
439
+ "object-manager-no-objects": "ei käännetty",
440
+ "object-manager-options-menu": "ei käännetty",
441
+ "object-manager-button-edit": "ei käännetty",
442
+ "object-manager-button-share": "ei käännetty",
443
+ "object-manager-button-delete": "ei käännetty",
444
+ "object-manager-button-view": "ei käännetty",
445
+ "object-manager-no-object-selected": "ei käännetty",
446
+ "object-manager-object-selected": "ei käännetty",
447
+ "object-manager-share-menu": "ei käännetty",
448
+ "public-warning-title": "ei käännetty",
449
+ "close-warning-dialog-title": "ei käännetty",
450
+ "warning-edit-mode-title": "ei käännetty",
451
+ "warning-edit-mode-description": "ei käännetty",
452
+ "warning-dialog-cancel": "ei käännetty",
453
+ "warning-edit-mode-confirm": "ei käännetty",
454
+ "warning-view-mode-title": "ei käännetty",
455
+ "warning-view-mode-description": "ei käännetty",
456
+ "warning-view-mode-confirm": "ei käännetty",
457
+ "warning-probability": "ei käännetty",
458
+ "warning-button-clear": "ei käännetty",
459
+ "warning-button-save": "ei käännetty",
460
+ "warning-button-saving": "ei käännetty",
461
+ "warning-button-publish": "ei käännetty",
462
+ "warning-button-publishing": "ei käännetty",
463
+ "warning-area": "ei käännetty",
464
+ "warning-button-add-object": "ei käännetty",
465
+ "warning-description-original": "ei käännetty",
466
+ "warning-description-translation": "ei käännetty",
467
+ "warning-description-NL": "ei käännetty",
468
+ "warning-level": "ei käännetty",
469
+ "warning-level-moderate": "ei käännetty",
470
+ "warning-level-severe": "ei käännetty",
471
+ "warning-level-extreme": "ei käännetty",
472
+ "warning-phenomenon": "ei käännetty",
473
+ "warning-phenomenon-wind": "ei käännetty",
474
+ "warning-phenomenon-fog": "ei käännetty",
475
+ "warning-phenomenon-thunderstorm": "ei käännetty",
476
+ "warning-phenomenon-snow-ice": "ei käännetty",
477
+ "warning-phenomenon-rain": "ei käännetty",
478
+ "warning-phenomenon-high-temp": "ei käännetty",
479
+ "warning-phenomenon-low-temp": "ei käännetty",
480
+ "warning-phenomenon-funnel-cloud": "ei käännetty",
481
+ "warning-phenomenon-coastal-event": "ei käännetty",
482
+ "warning-valid-from": "ei käännetty",
483
+ "warning-valid-until": "ei käännetty",
484
+ "warning-valid-from-error-before-current": "ei käännetty",
485
+ "warning-valid-from-error-max-hours": "ei käännetty",
486
+ "warning-valid-until-error-before-current": "ei käännetty",
487
+ "warning-valid-until-error-max-hours": "ei käännetty",
488
+ "warning-valid-until-error-min-hours": "ei käännetty",
489
+ "warning-dialog-delete-succes": "ei käännetty",
490
+ "warning-dialog-delete-title": "ei käännetty",
491
+ "warning-dialog-delete-confirm": "ei käännetty",
492
+ "warning-dialog-delete-description": "ei käännetty",
493
+ "warning-dialog-ignore-succes": "ei käännetty",
494
+ "warning-dialog-ignore-title": "ei käännetty",
495
+ "warning-dialog-ignore-confirm": "ei käännetty",
496
+ "warning-dialog-ignore-description": "ei käännetty",
497
+ "warning-save-succes": "ei käännetty",
498
+ "warning-publish-succes": "ei käännetty",
499
+ "warning-editor-user-viewer": "ei käännetty",
500
+ "warning-editor-user-editor": "ei käännetty",
501
+ "warning-editor-add-editor": "ei käännetty",
502
+ "warning-editor-remove-editor": "ei käännetty",
503
+ "warning-list-button_create": "ei käännetty",
504
+ "warning-list-button-use": "ei käännetty",
505
+ "warning-list-button-ignore": "ei käännetty",
506
+ "warning-list-button-options": "ei käännetty",
507
+ "warning-list-status-draft": "ei käännetty",
508
+ "warning-list-status-published": "ei käännetty",
509
+ "warning-list-status-todo": "ei käännetty",
510
+ "warning-list-status-expired": "ei käännetty",
511
+ "warning-list-header-incident": "ei käännetty",
512
+ "warning-list-header-last-update": "ei käännetty",
513
+ "warning-list-header-start-time": "ei käännetty",
514
+ "warning-list-header-end-time": "ei käännetty",
515
+ "warning-list-header-domain": "ei käännetty",
516
+ "warning-list-header-phenomenon": "ei käännetty",
517
+ "warning-list-header-level": "ei käännetty",
518
+ "warning-list-header-draft": "ei käännetty"
519
+ };
520
+ var no = {
521
+ "drawing-tool-form-tools": "ikke oversatt",
522
+ "drawing-tool-form-opacity": "ikke oversatt",
523
+ "drawing-tool-form-object-name": "ikke oversatt",
524
+ "drawing-tool-form-save": "ikke oversatt",
525
+ "drawing-tool-form-update": "ikke oversatt",
526
+ "drawing-tool-form-exit-draw-mode": "ikke oversatt",
527
+ "drawing-tool-form-drawing-required": "ikke oversatt",
528
+ "close-dialog-cancel": "ikke oversatt",
529
+ "close-dialog-confirm": "ikke oversatt",
530
+ "close-draw-dialog-title": "ikke oversatt",
531
+ "close-dialog-description": "ikke oversatt",
532
+ "drawing-tool-title": "ikke oversatt",
533
+ "object-manager-title": "ikke oversatt",
534
+ "object-manager-add": "ikke oversatt",
535
+ "delete-dialog-cancel": "ikke oversatt",
536
+ "delete-dialog-confirm": "ikke oversatt",
537
+ "delete-dialog-title": "ikke oversatt",
538
+ "delete-dialog-description": "ikke oversatt",
539
+ "delete-succes": "ikke oversatt",
540
+ "update-succes": "ikke oversatt",
541
+ "save-succes": "ikke oversatt",
542
+ "object-manager-no-objects": "ikke oversatt",
543
+ "object-manager-options-menu": "ikke oversatt",
544
+ "object-manager-button-edit": "ikke oversatt",
545
+ "object-manager-button-share": "ikke oversatt",
546
+ "object-manager-button-delete": "ikke oversatt",
547
+ "object-manager-button-view": "ikke oversatt",
548
+ "object-manager-no-object-selected": "ikke oversatt",
549
+ "object-manager-object-selected": "ikke oversatt",
550
+ "object-manager-share-menu": "ikke oversatt",
551
+ "public-warning-title": "ikke oversatt",
552
+ "close-warning-dialog-title": "ikke oversatt",
553
+ "warning-edit-mode-title": "ikke oversatt",
554
+ "warning-edit-mode-description": "ikke oversatt",
555
+ "warning-dialog-cancel": "ikke oversatt",
556
+ "warning-edit-mode-confirm": "ikke oversatt",
557
+ "warning-view-mode-title": "ikke oversatt",
558
+ "warning-view-mode-description": "ikke oversatt",
559
+ "warning-view-mode-confirm": "ikke oversatt",
560
+ "warning-probability": "ikke oversatt",
561
+ "warning-button-clear": "ikke oversatt",
562
+ "warning-button-save": "ikke oversatt",
563
+ "warning-button-saving": "ikke oversatt",
564
+ "warning-button-publish": "ikke oversatt",
565
+ "warning-button-publishing": "ikke oversatt",
566
+ "warning-area": "ikke oversatt",
567
+ "warning-button-add-object": "ikke oversatt",
568
+ "warning-description-original": "ikke oversatt",
569
+ "warning-description-translation": "ikke oversatt",
570
+ "warning-description-NL": "ikke oversatt",
571
+ "warning-level": "ikke oversatt",
572
+ "warning-level-moderate": "ikke oversatt",
573
+ "warning-level-severe": "ikke oversatt",
574
+ "warning-level-extreme": "ikke oversatt",
575
+ "warning-phenomenon": "ikke oversatt",
576
+ "warning-phenomenon-wind": "ikke oversatt",
577
+ "warning-phenomenon-fog": "ikke oversatt",
578
+ "warning-phenomenon-thunderstorm": "ikke oversatt",
579
+ "warning-phenomenon-snow-ice": "ikke oversatt",
580
+ "warning-phenomenon-rain": "ikke oversatt",
581
+ "warning-phenomenon-high-temp": "ikke oversatt",
582
+ "warning-phenomenon-low-temp": "ikke oversatt",
583
+ "warning-phenomenon-funnel-cloud": "ikke oversatt",
584
+ "warning-phenomenon-coastal-event": "ikke oversatt",
585
+ "warning-valid-from": "ikke oversatt",
586
+ "warning-valid-until": "ikke oversatt",
587
+ "warning-valid-from-error-before-current": "ikke oversatt",
588
+ "warning-valid-from-error-max-hours": "ikke oversatt",
589
+ "warning-valid-until-error-before-current": "ikke oversatt",
590
+ "warning-valid-until-error-max-hours": "ikke oversatt",
591
+ "warning-valid-until-error-min-hours": "ikke oversatt",
592
+ "warning-dialog-delete-succes": "ikke oversatt",
593
+ "warning-dialog-delete-title": "ikke oversatt",
594
+ "warning-dialog-delete-confirm": "ikke oversatt",
595
+ "warning-dialog-delete-description": "ikke oversatt",
596
+ "warning-dialog-ignore-succes": "ikke oversatt",
597
+ "warning-dialog-ignore-title": "ikke oversatt",
598
+ "warning-dialog-ignore-confirm": "ikke oversatt",
599
+ "warning-dialog-ignore-description": "ikke oversatt",
600
+ "warning-save-succes": "ikke oversatt",
601
+ "warning-publish-succes": "ikke oversatt",
602
+ "warning-editor-user-viewer": "ikke oversatt",
603
+ "warning-editor-user-editor": "ikke oversatt",
604
+ "warning-editor-add-editor": "ikke oversatt",
605
+ "warning-editor-remove-editor": "ikke oversatt",
606
+ "warning-list-button_create": "ikke oversatt",
607
+ "warning-list-button-use": "ikke oversatt",
608
+ "warning-list-button-ignore": "ikke oversatt",
609
+ "warning-list-button-options": "ikke oversatt",
610
+ "warning-list-status-draft": "ikke oversatt",
611
+ "warning-list-status-published": "ikke oversatt",
612
+ "warning-list-status-todo": "ikke oversatt",
613
+ "warning-list-status-expired": "ikke oversatt",
614
+ "warning-list-header-incident": "ikke oversatt",
615
+ "warning-list-header-last-update": "ikke oversatt",
616
+ "warning-list-header-start-time": "ikke oversatt",
617
+ "warning-list-header-end-time": "ikke oversatt",
618
+ "warning-list-header-domain": "ikke oversatt",
619
+ "warning-list-header-phenomenon": "ikke oversatt",
620
+ "warning-list-header-level": "ikke oversatt",
621
+ "warning-list-header-draft": "ikke oversatt"
622
+ };
623
+ var warningsTranslations = {
624
+ en: en,
625
+ nl: nl,
626
+ fi: fi,
627
+ no: no
628
+ };
629
+
630
+ /* *
631
+ * Licensed under the Apache License, Version 2.0 (the "License");
632
+ * you may not use this file except in compliance with the License.
633
+ * You may obtain a copy of the License at
634
+ *
635
+ * http://www.apache.org/licenses/LICENSE-2.0
636
+ *
637
+ * Unless required by applicable law or agreed to in writing, software
638
+ * distributed under the License is distributed on an "AS IS" BASIS,
639
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
640
+ * See the License for the specific language governing permissions and
641
+ * limitations under the License.
642
+ *
643
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
644
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
645
+ * */
646
+ const WARN_NAMESPACE = 'warn';
647
+ const defaultLanguage = 'en';
648
+ const initWarnI18n = () => {
649
+ i18n.use(initReactI18next).init({
650
+ lng: defaultLanguage,
651
+ ns: WARN_NAMESPACE,
652
+ interpolation: {
653
+ escapeValue: false
654
+ },
655
+ resources: {
656
+ en: {
657
+ [`${WARN_NAMESPACE}`]: warningsTranslations.en
658
+ },
659
+ nl: {
660
+ [`${WARN_NAMESPACE}`]: warningsTranslations.nl
661
+ },
662
+ fi: {
663
+ [`${WARN_NAMESPACE}`]: warningsTranslations.fi
664
+ },
665
+ no: {
666
+ [`${WARN_NAMESPACE}`]: warningsTranslations.no
667
+ }
668
+ }
669
+ });
670
+ };
671
+ const outsideComponentTranslations = handleOutsideComponentTranslations(warningsTranslations, WARN_NAMESPACE);
672
+
205
673
  /* *
206
674
  * Licensed under the Apache License, Version 2.0 (the "License");
207
675
  * you may not use this file except in compliance with the License.
@@ -218,17 +686,22 @@ const getWarningFormDirty = createSelector(selectDrawByInstanceId, drawing => (d
218
686
  * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
219
687
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
220
688
  * */
221
- const confirmationDialogOptions = {
222
- cancelLabel: 'Cancel',
223
- title: 'Close Drawing toolbox',
224
- description: 'There are changes in the form, are you sure you want to close?',
225
- confirmLabel: 'Close',
226
- catchOnCancel: true
689
+ const confirmationDialogOptions = t => {
690
+ return {
691
+ cancelLabel: t('close-dialog-cancel'),
692
+ title: t('close-draw-dialog-title'),
693
+ description: t('close-dialog-description'),
694
+ confirmLabel: t('close-dialog-confirm'),
695
+ catchOnCancel: true
696
+ };
227
697
  };
228
698
  const useCloseDrawDialog = ({
229
699
  mapId,
230
700
  source
231
701
  }) => {
702
+ const {
703
+ t
704
+ } = useTranslation(WARN_NAMESPACE);
232
705
  const dispatch = useDispatch();
233
706
  const drawLayerId = getSingularDrawtoolDrawLayerId(mapId);
234
707
  const drawDialogActiveDrawModeId = useSelector(store => drawtoolSelectors.getActiveDrawModeId(store, drawingDialogType));
@@ -238,7 +711,7 @@ const useCloseDrawDialog = ({
238
711
  const confirmDialog = useConfirmationDialog();
239
712
  const closeDrawDialog = (skipConfirmationDialog = false) => __awaiter(void 0, void 0, void 0, function* () {
240
713
  if (isFormDirty && !skipConfirmationDialog) {
241
- const mayProceed = yield confirmDialog(confirmationDialogOptions).then(() => true).catch(() => false);
714
+ const mayProceed = yield confirmDialog(confirmationDialogOptions(t)).then(() => true).catch(() => false);
242
715
  if (!mayProceed) {
243
716
  return;
244
717
  }
@@ -340,6 +813,9 @@ const useObjectDrawDialogAction = ({
340
813
  mapId,
341
814
  source
342
815
  }) => {
816
+ const {
817
+ t
818
+ } = useTranslation(WARN_NAMESPACE);
343
819
  const dispatch = useDispatch();
344
820
  const confirmDialog = useConfirmationDialog();
345
821
  const currentDrawLayerId = getSingularDrawtoolDrawLayerId(mapId);
@@ -370,7 +846,7 @@ const useObjectDrawDialogAction = ({
370
846
  const openObjectDialog = () => __awaiter(void 0, void 0, void 0, function* () {
371
847
  if (isDrawDialogOpen) {
372
848
  if (isFormDirty) {
373
- const mayProceed = yield confirmDialog(confirmationDialogOptions).then(() => true).catch(() => false);
849
+ const mayProceed = yield confirmDialog(confirmationDialogOptions(t)).then(() => true).catch(() => false);
374
850
  if (!mayProceed) {
375
851
  return;
376
852
  }
@@ -579,17 +1055,17 @@ var $TypeError$b = TypeError;
579
1055
 
580
1056
  // `RequireObjectCoercible` abstract operation
581
1057
  // https://tc39.es/ecma262/#sec-requireobjectcoercible
582
- var requireObjectCoercible$5 = function (it) {
1058
+ var requireObjectCoercible$6 = function (it) {
583
1059
  if (isNullOrUndefined$3(it)) throw new $TypeError$b("Can't call method on " + it);
584
1060
  return it;
585
1061
  };
586
1062
 
587
1063
  // toObject with fallback for non-array-like ES3 strings
588
1064
  var IndexedObject$2 = indexedObject;
589
- var requireObjectCoercible$4 = requireObjectCoercible$5;
1065
+ var requireObjectCoercible$5 = requireObjectCoercible$6;
590
1066
 
591
1067
  var toIndexedObject$5 = function (it) {
592
- return IndexedObject$2(requireObjectCoercible$4(it));
1068
+ return IndexedObject$2(requireObjectCoercible$5(it));
593
1069
  };
594
1070
 
595
1071
  var check = function (it) {
@@ -597,7 +1073,7 @@ var check = function (it) {
597
1073
  };
598
1074
 
599
1075
  // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
600
- var global$j =
1076
+ var global$i =
601
1077
  // eslint-disable-next-line es/no-global-this -- safe
602
1078
  check(typeof globalThis == 'object' && globalThis) ||
603
1079
  check(typeof window == 'object' && window) ||
@@ -608,49 +1084,49 @@ var global$j =
608
1084
  // eslint-disable-next-line no-new-func -- fallback
609
1085
  (function () { return this; })() || Function('return this')();
610
1086
 
611
- var shared$4 = {exports: {}};
1087
+ var sharedStore = {exports: {}};
612
1088
 
613
- var global$i = global$j;
1089
+ var global$h = global$i;
614
1090
 
615
1091
  // eslint-disable-next-line es/no-object-defineproperty -- safe
616
1092
  var defineProperty$7 = Object.defineProperty;
617
1093
 
618
1094
  var defineGlobalProperty$3 = function (key, value) {
619
1095
  try {
620
- defineProperty$7(global$i, key, { value: value, configurable: true, writable: true });
1096
+ defineProperty$7(global$h, key, { value: value, configurable: true, writable: true });
621
1097
  } catch (error) {
622
- global$i[key] = value;
1098
+ global$h[key] = value;
623
1099
  } return value;
624
1100
  };
625
1101
 
626
- var global$h = global$j;
1102
+ var globalThis$1 = global$i;
627
1103
  var defineGlobalProperty$2 = defineGlobalProperty$3;
628
1104
 
629
1105
  var SHARED = '__core-js_shared__';
630
- var store$3 = global$h[SHARED] || defineGlobalProperty$2(SHARED, {});
631
-
632
- var sharedStore = store$3;
1106
+ var store$3 = sharedStore.exports = globalThis$1[SHARED] || defineGlobalProperty$2(SHARED, {});
633
1107
 
634
- var store$2 = sharedStore;
635
-
636
- (shared$4.exports = function (key, value) {
637
- return store$2[key] || (store$2[key] = value !== undefined ? value : {});
638
- })('versions', []).push({
639
- version: '3.35.1',
1108
+ (store$3.versions || (store$3.versions = [])).push({
1109
+ version: '3.36.1',
640
1110
  mode: 'global',
641
1111
  copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)',
642
- license: 'https://github.com/zloirock/core-js/blob/v3.35.1/LICENSE',
1112
+ license: 'https://github.com/zloirock/core-js/blob/v3.36.1/LICENSE',
643
1113
  source: 'https://github.com/zloirock/core-js'
644
1114
  });
645
1115
 
646
- var requireObjectCoercible$3 = requireObjectCoercible$5;
1116
+ var store$2 = sharedStore.exports;
1117
+
1118
+ var shared$4 = function (key, value) {
1119
+ return store$2[key] || (store$2[key] = value || {});
1120
+ };
1121
+
1122
+ var requireObjectCoercible$4 = requireObjectCoercible$6;
647
1123
 
648
1124
  var $Object$3 = Object;
649
1125
 
650
1126
  // `ToObject` abstract operation
651
1127
  // https://tc39.es/ecma262/#sec-toobject
652
1128
  var toObject$5 = function (argument) {
653
- return $Object$3(requireObjectCoercible$3(argument));
1129
+ return $Object$3(requireObjectCoercible$4(argument));
654
1130
  };
655
1131
 
656
1132
  var uncurryThis$g = functionUncurryThis;
@@ -677,7 +1153,7 @@ var uid$2 = function (key) {
677
1153
 
678
1154
  var engineUserAgent = typeof navigator != 'undefined' && String(navigator.userAgent) || '';
679
1155
 
680
- var global$g = global$j;
1156
+ var global$g = global$i;
681
1157
  var userAgent = engineUserAgent;
682
1158
 
683
1159
  var process = global$g.process;
@@ -708,7 +1184,7 @@ var engineV8Version = version;
708
1184
  /* eslint-disable es/no-symbol -- required for testing */
709
1185
  var V8_VERSION = engineV8Version;
710
1186
  var fails$i = fails$l;
711
- var global$f = global$j;
1187
+ var global$f = global$i;
712
1188
 
713
1189
  var $String$5 = global$f.String;
714
1190
 
@@ -731,8 +1207,8 @@ var useSymbolAsUid = NATIVE_SYMBOL$2
731
1207
  && !Symbol.sham
732
1208
  && typeof Symbol.iterator == 'symbol';
733
1209
 
734
- var global$e = global$j;
735
- var shared$3 = shared$4.exports;
1210
+ var global$e = global$i;
1211
+ var shared$3 = shared$4;
736
1212
  var hasOwn$a = hasOwnProperty_1;
737
1213
  var uid$1 = uid$2;
738
1214
  var NATIVE_SYMBOL$1 = symbolConstructorDetection;
@@ -764,18 +1240,18 @@ var isCallable$i = typeof documentAll == 'undefined' && documentAll !== undefine
764
1240
 
765
1241
  var isCallable$h = isCallable$i;
766
1242
 
767
- var isObject$9 = function (it) {
1243
+ var isObject$a = function (it) {
768
1244
  return typeof it == 'object' ? it !== null : isCallable$h(it);
769
1245
  };
770
1246
 
771
- var isObject$8 = isObject$9;
1247
+ var isObject$9 = isObject$a;
772
1248
 
773
1249
  var $String$4 = String;
774
1250
  var $TypeError$a = TypeError;
775
1251
 
776
1252
  // `Assert: Type(argument) is Object`
777
- var anObject$9 = function (argument) {
778
- if (isObject$8(argument)) return argument;
1253
+ var anObject$8 = function (argument) {
1254
+ if (isObject$9(argument)) return argument;
779
1255
  throw new $TypeError$a($String$4(argument) + ' is not an object');
780
1256
  };
781
1257
 
@@ -804,12 +1280,12 @@ var v8PrototypeDefineBug = DESCRIPTORS$c && fails$g(function () {
804
1280
 
805
1281
  var objectDefineProperty = {};
806
1282
 
807
- var global$d = global$j;
808
- var isObject$7 = isObject$9;
1283
+ var global$d = global$i;
1284
+ var isObject$8 = isObject$a;
809
1285
 
810
1286
  var document$1 = global$d.document;
811
1287
  // typeof document.createElement is 'object' in old IE
812
- var EXISTS$1 = isObject$7(document$1) && isObject$7(document$1.createElement);
1288
+ var EXISTS$1 = isObject$8(document$1) && isObject$8(document$1.createElement);
813
1289
 
814
1290
  var documentCreateElement$2 = function (it) {
815
1291
  return EXISTS$1 ? document$1.createElement(it) : {};
@@ -835,7 +1311,7 @@ var functionCall = NATIVE_BIND$1 ? call$a.bind(call$a) : function () {
835
1311
  return call$a.apply(call$a, arguments);
836
1312
  };
837
1313
 
838
- var global$c = global$j;
1314
+ var global$c = global$i;
839
1315
  var isCallable$g = isCallable$i;
840
1316
 
841
1317
  var aFunction = function (argument) {
@@ -897,7 +1373,7 @@ var getMethod$2 = function (V, P) {
897
1373
 
898
1374
  var call$9 = functionCall;
899
1375
  var isCallable$d = isCallable$i;
900
- var isObject$6 = isObject$9;
1376
+ var isObject$7 = isObject$a;
901
1377
 
902
1378
  var $TypeError$8 = TypeError;
903
1379
 
@@ -905,14 +1381,14 @@ var $TypeError$8 = TypeError;
905
1381
  // https://tc39.es/ecma262/#sec-ordinarytoprimitive
906
1382
  var ordinaryToPrimitive$1 = function (input, pref) {
907
1383
  var fn, val;
908
- if (pref === 'string' && isCallable$d(fn = input.toString) && !isObject$6(val = call$9(fn, input))) return val;
909
- if (isCallable$d(fn = input.valueOf) && !isObject$6(val = call$9(fn, input))) return val;
910
- if (pref !== 'string' && isCallable$d(fn = input.toString) && !isObject$6(val = call$9(fn, input))) return val;
1384
+ if (pref === 'string' && isCallable$d(fn = input.toString) && !isObject$7(val = call$9(fn, input))) return val;
1385
+ if (isCallable$d(fn = input.valueOf) && !isObject$7(val = call$9(fn, input))) return val;
1386
+ if (pref !== 'string' && isCallable$d(fn = input.toString) && !isObject$7(val = call$9(fn, input))) return val;
911
1387
  throw new $TypeError$8("Can't convert object to primitive value");
912
1388
  };
913
1389
 
914
1390
  var call$8 = functionCall;
915
- var isObject$5 = isObject$9;
1391
+ var isObject$6 = isObject$a;
916
1392
  var isSymbol$1 = isSymbol$2;
917
1393
  var getMethod$1 = getMethod$2;
918
1394
  var ordinaryToPrimitive = ordinaryToPrimitive$1;
@@ -924,13 +1400,13 @@ var TO_PRIMITIVE = wellKnownSymbol$9('toPrimitive');
924
1400
  // `ToPrimitive` abstract operation
925
1401
  // https://tc39.es/ecma262/#sec-toprimitive
926
1402
  var toPrimitive$1 = function (input, pref) {
927
- if (!isObject$5(input) || isSymbol$1(input)) return input;
1403
+ if (!isObject$6(input) || isSymbol$1(input)) return input;
928
1404
  var exoticToPrim = getMethod$1(input, TO_PRIMITIVE);
929
1405
  var result;
930
1406
  if (exoticToPrim) {
931
1407
  if (pref === undefined) pref = 'default';
932
1408
  result = call$8(exoticToPrim, input, pref);
933
- if (!isObject$5(result) || isSymbol$1(result)) return result;
1409
+ if (!isObject$6(result) || isSymbol$1(result)) return result;
934
1410
  throw new $TypeError$7("Can't convert object to primitive value");
935
1411
  }
936
1412
  if (pref === undefined) pref = 'number';
@@ -950,7 +1426,7 @@ var toPropertyKey$2 = function (argument) {
950
1426
  var DESCRIPTORS$a = descriptors;
951
1427
  var IE8_DOM_DEFINE$1 = ie8DomDefine;
952
1428
  var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
953
- var anObject$8 = anObject$9;
1429
+ var anObject$7 = anObject$8;
954
1430
  var toPropertyKey$1 = toPropertyKey$2;
955
1431
 
956
1432
  var $TypeError$6 = TypeError;
@@ -965,9 +1441,9 @@ var WRITABLE = 'writable';
965
1441
  // `Object.defineProperty` method
966
1442
  // https://tc39.es/ecma262/#sec-object.defineproperty
967
1443
  objectDefineProperty.f = DESCRIPTORS$a ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
968
- anObject$8(O);
1444
+ anObject$7(O);
969
1445
  P = toPropertyKey$1(P);
970
- anObject$8(Attributes);
1446
+ anObject$7(Attributes);
971
1447
  if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
972
1448
  var current = $getOwnPropertyDescriptor$1(O, P);
973
1449
  if (current && current[WRITABLE]) {
@@ -980,9 +1456,9 @@ objectDefineProperty.f = DESCRIPTORS$a ? V8_PROTOTYPE_DEFINE_BUG$1 ? function de
980
1456
  }
981
1457
  } return $defineProperty(O, P, Attributes);
982
1458
  } : $defineProperty : function defineProperty(O, P, Attributes) {
983
- anObject$8(O);
1459
+ anObject$7(O);
984
1460
  P = toPropertyKey$1(P);
985
- anObject$8(Attributes);
1461
+ anObject$7(Attributes);
986
1462
  if (IE8_DOM_DEFINE$1) try {
987
1463
  return $defineProperty(O, P, Attributes);
988
1464
  } catch (error) { /* empty */ }
@@ -1053,6 +1529,7 @@ var createMethod$3 = function (IS_INCLUDES) {
1053
1529
  return function ($this, el, fromIndex) {
1054
1530
  var O = toIndexedObject$4($this);
1055
1531
  var length = lengthOfArrayLike$2(O);
1532
+ if (length === 0) return !IS_INCLUDES && -1;
1056
1533
  var index = toAbsoluteIndex(fromIndex, length);
1057
1534
  var value;
1058
1535
  // Array#includes uses SameValueZero equality algorithm
@@ -1124,7 +1601,7 @@ var objectKeys$2 = Object.keys || function keys(O) {
1124
1601
  var DESCRIPTORS$9 = descriptors;
1125
1602
  var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
1126
1603
  var definePropertyModule$3 = objectDefineProperty;
1127
- var anObject$7 = anObject$9;
1604
+ var anObject$6 = anObject$8;
1128
1605
  var toIndexedObject$2 = toIndexedObject$5;
1129
1606
  var objectKeys$1 = objectKeys$2;
1130
1607
 
@@ -1132,7 +1609,7 @@ var objectKeys$1 = objectKeys$2;
1132
1609
  // https://tc39.es/ecma262/#sec-object.defineproperties
1133
1610
  // eslint-disable-next-line es/no-object-defineproperties -- safe
1134
1611
  objectDefineProperties.f = DESCRIPTORS$9 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
1135
- anObject$7(O);
1612
+ anObject$6(O);
1136
1613
  var props = toIndexedObject$2(Properties);
1137
1614
  var keys = objectKeys$1(Properties);
1138
1615
  var length = keys.length;
@@ -1146,7 +1623,7 @@ var getBuiltIn$3 = getBuiltIn$5;
1146
1623
 
1147
1624
  var html$1 = getBuiltIn$3('document', 'documentElement');
1148
1625
 
1149
- var shared$2 = shared$4.exports;
1626
+ var shared$2 = shared$4;
1150
1627
  var uid = uid$2;
1151
1628
 
1152
1629
  var keys = shared$2('keys');
@@ -1156,7 +1633,7 @@ var sharedKey$3 = function (key) {
1156
1633
  };
1157
1634
 
1158
1635
  /* global ActiveXObject -- old IE, WSH */
1159
- var anObject$6 = anObject$9;
1636
+ var anObject$5 = anObject$8;
1160
1637
  var definePropertiesModule = objectDefineProperties;
1161
1638
  var enumBugKeys$1 = enumBugKeys$3;
1162
1639
  var hiddenKeys$2 = hiddenKeys$4;
@@ -1230,7 +1707,7 @@ hiddenKeys$2[IE_PROTO$1] = true;
1230
1707
  var objectCreate = Object.create || function create(O, Properties) {
1231
1708
  var result;
1232
1709
  if (O !== null) {
1233
- EmptyConstructor[PROTOTYPE] = anObject$6(O);
1710
+ EmptyConstructor[PROTOTYPE] = anObject$5(O);
1234
1711
  result = new EmptyConstructor();
1235
1712
  EmptyConstructor[PROTOTYPE] = null;
1236
1713
  // add "__proto__" for Object.getPrototypeOf polyfill
@@ -1262,7 +1739,7 @@ var addToUnscopables$1 = function (key) {
1262
1739
 
1263
1740
  var iterators = {};
1264
1741
 
1265
- var global$b = global$j;
1742
+ var global$b = global$i;
1266
1743
  var isCallable$c = isCallable$i;
1267
1744
 
1268
1745
  var WeakMap$1 = global$b.WeakMap;
@@ -1290,11 +1767,11 @@ var createNonEnumerableProperty$8 = DESCRIPTORS$8 ? function (object, key, value
1290
1767
  };
1291
1768
 
1292
1769
  var NATIVE_WEAK_MAP = weakMapBasicDetection;
1293
- var global$a = global$j;
1294
- var isObject$4 = isObject$9;
1770
+ var global$a = global$i;
1771
+ var isObject$5 = isObject$a;
1295
1772
  var createNonEnumerableProperty$7 = createNonEnumerableProperty$8;
1296
1773
  var hasOwn$8 = hasOwnProperty_1;
1297
- var shared$1 = sharedStore;
1774
+ var shared$1 = sharedStore.exports;
1298
1775
  var sharedKey$1 = sharedKey$3;
1299
1776
  var hiddenKeys$1 = hiddenKeys$4;
1300
1777
 
@@ -1310,7 +1787,7 @@ var enforce = function (it) {
1310
1787
  var getterFor = function (TYPE) {
1311
1788
  return function (it) {
1312
1789
  var state;
1313
- if (!isObject$4(it) || (state = get(it)).type !== TYPE) {
1790
+ if (!isObject$5(it) || (state = get(it)).type !== TYPE) {
1314
1791
  throw new TypeError$1('Incompatible receiver, ' + TYPE + ' required');
1315
1792
  } return state;
1316
1793
  };
@@ -1423,7 +1900,7 @@ var functionName = {
1423
1900
 
1424
1901
  var uncurryThis$c = functionUncurryThis;
1425
1902
  var isCallable$b = isCallable$i;
1426
- var store = sharedStore;
1903
+ var store = sharedStore.exports;
1427
1904
 
1428
1905
  var functionToString = uncurryThis$c(Function.toString);
1429
1906
 
@@ -1542,13 +2019,13 @@ var getBuiltIn$2 = getBuiltIn$5;
1542
2019
  var uncurryThis$a = functionUncurryThis;
1543
2020
  var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
1544
2021
  var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
1545
- var anObject$5 = anObject$9;
2022
+ var anObject$4 = anObject$8;
1546
2023
 
1547
2024
  var concat$1 = uncurryThis$a([].concat);
1548
2025
 
1549
2026
  // all object keys, includes non-enumerable and symbols
1550
2027
  var ownKeys$1 = getBuiltIn$2('Reflect', 'ownKeys') || function ownKeys(it) {
1551
- var keys = getOwnPropertyNamesModule.f(anObject$5(it));
2028
+ var keys = getOwnPropertyNamesModule.f(anObject$4(it));
1552
2029
  var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
1553
2030
  return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
1554
2031
  };
@@ -1593,7 +2070,7 @@ var POLYFILL = isForced$1.POLYFILL = 'P';
1593
2070
 
1594
2071
  var isForced_1 = isForced$1;
1595
2072
 
1596
- var global$9 = global$j;
2073
+ var global$9 = global$i;
1597
2074
  var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
1598
2075
  var createNonEnumerableProperty$6 = createNonEnumerableProperty$8;
1599
2076
  var defineBuiltIn$3 = defineBuiltIn$4;
@@ -1681,7 +2158,7 @@ var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object$1.getPrototypeOf :
1681
2158
 
1682
2159
  var fails$b = fails$l;
1683
2160
  var isCallable$6 = isCallable$i;
1684
- var isObject$3 = isObject$9;
2161
+ var isObject$4 = isObject$a;
1685
2162
  var getPrototypeOf$1 = objectGetPrototypeOf;
1686
2163
  var defineBuiltIn$2 = defineBuiltIn$4;
1687
2164
  var wellKnownSymbol$7 = wellKnownSymbol$a;
@@ -1704,7 +2181,7 @@ if ([].keys) {
1704
2181
  }
1705
2182
  }
1706
2183
 
1707
- var NEW_ITERATOR_PROTOTYPE = !isObject$3(IteratorPrototype$2) || fails$b(function () {
2184
+ var NEW_ITERATOR_PROTOTYPE = !isObject$4(IteratorPrototype$2) || fails$b(function () {
1708
2185
  var test = {};
1709
2186
  // FF44- legacy iterators case
1710
2187
  return IteratorPrototype$2[ITERATOR$3].call(test) !== test;
@@ -1764,10 +2241,10 @@ var functionUncurryThisAccessor = function (object, key, method) {
1764
2241
  } catch (error) { /* empty */ }
1765
2242
  };
1766
2243
 
1767
- var isObject$2 = isObject$9;
2244
+ var isObject$3 = isObject$a;
1768
2245
 
1769
2246
  var isPossiblePrototype$1 = function (argument) {
1770
- return isObject$2(argument) || argument === null;
2247
+ return isObject$3(argument) || argument === null;
1771
2248
  };
1772
2249
 
1773
2250
  var isPossiblePrototype = isPossiblePrototype$1;
@@ -1782,7 +2259,8 @@ var aPossiblePrototype$1 = function (argument) {
1782
2259
 
1783
2260
  /* eslint-disable no-proto -- safe */
1784
2261
  var uncurryThisAccessor = functionUncurryThisAccessor;
1785
- var anObject$4 = anObject$9;
2262
+ var isObject$2 = isObject$a;
2263
+ var requireObjectCoercible$3 = requireObjectCoercible$6;
1786
2264
  var aPossiblePrototype = aPossiblePrototype$1;
1787
2265
 
1788
2266
  // `Object.setPrototypeOf` method
@@ -1799,8 +2277,9 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
1799
2277
  CORRECT_SETTER = test instanceof Array;
1800
2278
  } catch (error) { /* empty */ }
1801
2279
  return function setPrototypeOf(O, proto) {
1802
- anObject$4(O);
2280
+ requireObjectCoercible$3(O);
1803
2281
  aPossiblePrototype(proto);
2282
+ if (!isObject$2(O)) return O;
1804
2283
  if (CORRECT_SETTER) setter(O, proto);
1805
2284
  else O.__proto__ = proto;
1806
2285
  return O;
@@ -2085,7 +2564,7 @@ var DOMTokenListPrototype$1 = classList && classList.constructor && classList.co
2085
2564
 
2086
2565
  var domTokenListPrototype = DOMTokenListPrototype$1 === Object.prototype ? undefined : DOMTokenListPrototype$1;
2087
2566
 
2088
- var global$8 = global$j;
2567
+ var global$8 = global$i;
2089
2568
  var DOMIterables = domIterables;
2090
2569
  var DOMTokenListPrototype = domTokenListPrototype;
2091
2570
  var ArrayIteratorMethods = es_array_iterator;
@@ -2232,14 +2711,8 @@ const OBJECT_ITEM_SIZE = 50;
2232
2711
  const OBJECT_ITEM_SIZE_SMALL_WIDTH = 72;
2233
2712
  const HEADER_ITEM_SIZE = 28;
2234
2713
  const BREAKPOINT = 320;
2235
- const NO_OBJECTS_FOUND = 'No objects found';
2236
- const BUTTON_EDIT$2 = 'Edit';
2237
- const BUTTON_DELETE$2 = 'Delete';
2238
- const BUTTON_SHARE = 'Share';
2239
2714
  const BUTTON_AIRMET = 'AIRMET';
2240
2715
  const BUTTON_SIGMET = 'SIGMET';
2241
- const BUTTON_PUBLIC_WARNING = 'PUBLIC WARNING';
2242
- const MENU_SHARE = 'Share object to';
2243
2716
  const getListInclHeaders = objects => {
2244
2717
  const listInclHeaders = [];
2245
2718
  const headerList = [];
@@ -2307,6 +2780,9 @@ const Objects = ({
2307
2780
  activeObject,
2308
2781
  isLoading: _isLoading = false
2309
2782
  }) => {
2783
+ const {
2784
+ t
2785
+ } = useTranslation(WARN_NAMESPACE);
2310
2786
  const listRef = React__default.useRef(null);
2311
2787
  const {
2312
2788
  listInclHeaders,
@@ -2343,7 +2819,7 @@ const Objects = ({
2343
2819
  paddingTop: '8px'
2344
2820
  },
2345
2821
  variant: "body1"
2346
- }, NO_OBJECTS_FOUND)) : ( /*#__PURE__*/React__default.createElement(VariableSizeList, {
2822
+ }, t('object-manager-no-objects'))) : ( /*#__PURE__*/React__default.createElement(VariableSizeList, {
2347
2823
  height: _height - DEFAULT_ADD_BUTTON_HEIGHT,
2348
2824
  width: _width,
2349
2825
  itemCount: listInclHeaders.length,
@@ -2397,10 +2873,10 @@ const Objects = ({
2397
2873
  }
2398
2874
  },
2399
2875
  buttonIcon: /*#__PURE__*/React__default.createElement(Share, null),
2400
- menuTitle: MENU_SHARE,
2401
- tooltipTitle: BUTTON_SHARE,
2876
+ menuTitle: t('object-manager-share-menu'),
2877
+ tooltipTitle: t('object-manager-button-share'),
2402
2878
  menuPosition: "bottom",
2403
- "aria-label": BUTTON_SHARE,
2879
+ "aria-label": t('object-manager-button-share'),
2404
2880
  menuItems: [{
2405
2881
  text: BUTTON_AIRMET,
2406
2882
  action: () => {},
@@ -2412,7 +2888,7 @@ const Objects = ({
2412
2888
  icon: /*#__PURE__*/React__default.createElement(ExitDomain, null),
2413
2889
  isDisabled: true
2414
2890
  }, {
2415
- text: BUTTON_PUBLIC_WARNING,
2891
+ text: t('public-warning-title').toUpperCase(),
2416
2892
  action: () => {
2417
2893
  onClickShare(object);
2418
2894
  },
@@ -2422,18 +2898,18 @@ const Objects = ({
2422
2898
  item: true,
2423
2899
  className: "objectActions"
2424
2900
  }, /*#__PURE__*/React__default.createElement(ToggleMenu, {
2425
- menuTitle: "Object options",
2426
- tooltipTitle: "Object options",
2901
+ menuTitle: t('object-manager-options-menu'),
2902
+ tooltipTitle: t('object-manager-options-menu'),
2427
2903
  menuPosition: "bottom",
2428
2904
  "aria-label": "Options",
2429
2905
  menuItems: [{
2430
- text: BUTTON_EDIT$2,
2906
+ text: t('object-manager-button-edit'),
2431
2907
  action: () => {
2432
2908
  onClickEdit(object.id);
2433
2909
  },
2434
2910
  icon: /*#__PURE__*/React__default.createElement(Edit, null)
2435
2911
  }, {
2436
- text: BUTTON_DELETE$2,
2912
+ text: t('object-manager-button-delete'),
2437
2913
  action: () => {
2438
2914
  onClickDelete(object.id);
2439
2915
  },
@@ -2489,7 +2965,6 @@ const DEFAULT_OBJECT_MANAGER_MIN_SIZE = {
2489
2965
  width: 160,
2490
2966
  height: 300
2491
2967
  };
2492
- const BUTTON_ADD_OBJECT$1 = 'Add a new object';
2493
2968
  const ObjectManager = ({
2494
2969
  bounds,
2495
2970
  onClose,
@@ -2512,6 +2987,9 @@ const ObjectManager = ({
2512
2987
  error,
2513
2988
  isLoading: _isLoading = false
2514
2989
  }) => {
2990
+ const {
2991
+ t
2992
+ } = useTranslation(WARN_NAMESPACE);
2515
2993
  const minSize = DEFAULT_OBJECT_MANAGER_MIN_SIZE;
2516
2994
  const startSizeCalc = calculateStartSize(minSize, _size, _startPosition);
2517
2995
  const [sizeInState, setSizeInState] = React.useState(startSizeCalc);
@@ -2588,7 +3066,7 @@ const ObjectManager = ({
2588
3066
  textTransform: 'none',
2589
3067
  fontSize: '12px'
2590
3068
  }
2591
- }, BUTTON_ADD_OBJECT$1)));
3069
+ }, t('object-manager-add'))));
2592
3070
  };
2593
3071
 
2594
3072
  /* *
@@ -2659,16 +3137,17 @@ const createApi$1 = props => {
2659
3137
  return getApiRoutes$1(props.auth ? authInstance : nonAuthInstance);
2660
3138
  };
2661
3139
 
2662
- const DELETE_TITLE$1 = 'Delete object';
2663
- const DELETE_CONFIRM$1 = 'Delete';
2664
- const CANCEL$1 = 'Cancel';
2665
- const getDeleteDescription = objectName => `Are you sure you want to delete "${objectName}"?`;
3140
+ const getDeleteDescription = (objectName, t) => `${t('delete-dialog-description')} "${objectName}"?`;
3141
+ const getDeleteSucces = (objectName, t) => `Object "${objectName}" ${t('delete-succes')}`;
2666
3142
  const ConfirmDeleteDialog = ({
2667
3143
  objectId,
2668
3144
  objectName,
2669
3145
  onDeleteSucces: _onDeleteSucces = () => {},
2670
3146
  onClose: _onClose = () => {}
2671
3147
  }) => {
3148
+ const {
3149
+ t
3150
+ } = useTranslation(WARN_NAMESPACE);
2672
3151
  const warningsApi = getWarningsApi();
2673
3152
  const [isLoading, setIsLoading] = React__default.useState(false);
2674
3153
  const [error, setError] = React__default.useState(undefined);
@@ -2683,12 +3162,12 @@ const ConfirmDeleteDialog = ({
2683
3162
  setIsLoading(false);
2684
3163
  }
2685
3164
  });
2686
- const description = getDeleteDescription(objectName);
3165
+ const description = getDeleteDescription(objectName, t);
2687
3166
  return /*#__PURE__*/React__default.createElement(ConfirmationDialog, Object.assign({
2688
- title: DELETE_TITLE$1,
3167
+ title: t('delete-dialog-title'),
2689
3168
  open: true,
2690
- confirmLabel: DELETE_CONFIRM$1,
2691
- cancelLabel: CANCEL$1,
3169
+ confirmLabel: t('delete-dialog-confirm'),
3170
+ cancelLabel: t('delete-dialog-cancel'),
2692
3171
  description: !error ? description : '',
2693
3172
  onClose: _onClose,
2694
3173
  onSubmit: onSubmit,
@@ -2941,11 +3420,13 @@ const {
2941
3420
  } = slice;
2942
3421
  const publicWarningFormActions = slice.actions;
2943
3422
 
2944
- const getDeleteSucces = objectName => `${objectName} has been deleted`;
2945
3423
  const ObjectManagerConnect = ({
2946
3424
  bounds,
2947
3425
  source: _source = 'app'
2948
3426
  }) => {
3427
+ const {
3428
+ t
3429
+ } = useTranslation(WARN_NAMESPACE);
2949
3430
  const {
2950
3431
  dialogOrder,
2951
3432
  setDialogOrder,
@@ -3095,7 +3576,7 @@ const ObjectManagerConnect = ({
3095
3576
  if (activeDrawingId && activeDrawingId === objectId) {
3096
3577
  deleteGeoJSONLayer();
3097
3578
  }
3098
- openSnackbar(getDeleteSucces(objectName));
3579
+ openSnackbar(getDeleteSucces(objectName, t));
3099
3580
  fetchDrawings();
3100
3581
  };
3101
3582
  const onDeleteDrawing = objectId => {
@@ -3110,7 +3591,7 @@ const ObjectManagerConnect = ({
3110
3591
  return null;
3111
3592
  }
3112
3593
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(ObjectManager, {
3113
- title: `Object Manager for ${mapId}`,
3594
+ title: `${t('object-manager-title')} ${mapId}`,
3114
3595
  bounds: bounds,
3115
3596
  isOpen: isDialogOpen,
3116
3597
  onClose: onClose,
@@ -3160,7 +3641,7 @@ var proxyAccessor$1 = function (Target, Source, key) {
3160
3641
  };
3161
3642
 
3162
3643
  var isCallable$4 = isCallable$i;
3163
- var isObject$1 = isObject$9;
3644
+ var isObject$1 = isObject$a;
3164
3645
  var setPrototypeOf$1 = objectSetPrototypeOf;
3165
3646
 
3166
3647
  // makes subclassing work correct for wrapped built-ins
@@ -3232,7 +3713,7 @@ var normalizeStringArgument$1 = function (argument, $default) {
3232
3713
  return argument === undefined ? arguments.length < 2 ? '' : $default : toString$6(argument);
3233
3714
  };
3234
3715
 
3235
- var isObject = isObject$9;
3716
+ var isObject = isObject$a;
3236
3717
  var createNonEnumerableProperty$3 = createNonEnumerableProperty$8;
3237
3718
 
3238
3719
  // `InstallErrorCause` abstract operation
@@ -3350,7 +3831,7 @@ var wrapErrorConstructorWithCause$1 = function (FULL_NAME, wrapper, FORCED, IS_A
3350
3831
 
3351
3832
  /* eslint-disable no-unused-vars -- required for functions `.length` */
3352
3833
  var $$4 = _export;
3353
- var global$7 = global$j;
3834
+ var global$7 = global$i;
3354
3835
  var apply = functionApply;
3355
3836
  var wrapErrorConstructorWithCause = wrapErrorConstructorWithCause$1;
3356
3837
 
@@ -5380,6 +5861,122 @@ const createApi = () => {
5380
5861
  return getApiRoutes(instance);
5381
5862
  };
5382
5863
 
5864
+ const getErrorMessage = error => isAxiosError(error) ? getAxiosErrorMessage(error) : error.message;
5865
+ function* saveOrUpdateWarning(publicWarning) {
5866
+ const warningsApi = yield call$c(getWarningsApi);
5867
+ if (publicWarning.warningDetail.id) {
5868
+ yield call$c(warningsApi.updateWarning, publicWarning.warningDetail.id, publicWarning);
5869
+ return publicWarning;
5870
+ }
5871
+ const newWarningId = yield call$c(warningsApi.saveWarningAs, publicWarning);
5872
+ return Object.assign(Object.assign({}, publicWarning), {
5873
+ warningDetail: Object.assign(Object.assign({}, publicWarning.warningDetail), {
5874
+ id: newWarningId
5875
+ })
5876
+ });
5877
+ }
5878
+ const getToggleEditorSuccessMessage = isEditor => outsideComponentTranslations[isEditor ? 'warning-editor-add-editor' : 'warning-editor-remove-editor'];
5879
+ function* toggleEditorWarningSaga({
5880
+ payload
5881
+ }) {
5882
+ try {
5883
+ const {
5884
+ warningId,
5885
+ isEditor,
5886
+ username
5887
+ } = payload;
5888
+ const warningsApi = yield call$c(getWarningsApi);
5889
+ yield call$c(warningsApi.toggleEditorWarning, warningId, isEditor);
5890
+ // update list to show correct avatar
5891
+ yield put(publicWarningActions.fetchWarnings());
5892
+ yield put(publicWarningFormActions.toggleEditorWarningSuccess({
5893
+ isEditor,
5894
+ username,
5895
+ message: getToggleEditorSuccessMessage(isEditor)
5896
+ }));
5897
+ } catch (error) {
5898
+ yield call$c(errorSaga, getErrorMessage(error));
5899
+ }
5900
+ }
5901
+ function* publishWarningSaga({
5902
+ payload
5903
+ }) {
5904
+ try {
5905
+ const {
5906
+ publicWarning
5907
+ } = payload;
5908
+ const publishedWarning = yield call$c(saveOrUpdateWarning, publicWarning);
5909
+ yield put(publicWarningFormActions.publishWarningSuccess({
5910
+ publicWarning: publishedWarning,
5911
+ message: outsideComponentTranslations['warning-publish-succes']
5912
+ }));
5913
+ yield put(uiActions.setToggleOpenDialog({
5914
+ type: publicWarningDialogType,
5915
+ setOpen: false
5916
+ }));
5917
+ } catch (error) {
5918
+ yield call$c(errorSaga, getErrorMessage(error));
5919
+ }
5920
+ }
5921
+ function* saveWarningSaga({
5922
+ payload
5923
+ }) {
5924
+ try {
5925
+ const {
5926
+ publicWarning
5927
+ } = payload;
5928
+ const savedWarning = yield call$c(saveOrUpdateWarning, publicWarning);
5929
+ yield put(publicWarningFormActions.saveWarningSuccess({
5930
+ publicWarning: savedWarning,
5931
+ message: outsideComponentTranslations['warning-save-succes']
5932
+ }));
5933
+ } catch (error) {
5934
+ yield call$c(errorSaga, getErrorMessage(error));
5935
+ }
5936
+ }
5937
+ function* successSaga({
5938
+ payload
5939
+ }) {
5940
+ const {
5941
+ message
5942
+ } = payload;
5943
+ yield put(snackbarActions.openSnackbar({
5944
+ message
5945
+ }));
5946
+ yield call$c(toggleDialogLoadingSaga, false);
5947
+ }
5948
+ function* errorSaga(message) {
5949
+ yield put(publicWarningFormActions.setFormError({
5950
+ message
5951
+ }));
5952
+ yield call$c(toggleDialogLoadingSaga, false);
5953
+ }
5954
+ function* toggleDialogLoadingSaga(isLoading) {
5955
+ const isDialogOpen = yield select(uiSelectors.getDialogDetailsByType, publicWarningDialogType);
5956
+ if (isDialogOpen) {
5957
+ yield put(uiActions.toggleIsLoadingDialog({
5958
+ isLoading,
5959
+ type: publicWarningDialogType
5960
+ }));
5961
+ }
5962
+ }
5963
+ function* openDialogSaga() {
5964
+ yield put(uiActions.setToggleOpenDialog({
5965
+ setOpen: true,
5966
+ type: publicWarningDialogType
5967
+ }));
5968
+ }
5969
+ function* publicWarningRootSaga() {
5970
+ // requests
5971
+ yield takeLatest(publicWarningFormActions.toggleEditorWarning, toggleEditorWarningSaga);
5972
+ yield takeLatest(publicWarningFormActions.publishWarning, publishWarningSaga);
5973
+ yield takeLatest(publicWarningFormActions.saveWarning, saveWarningSaga);
5974
+ // side effects ui/snackbar
5975
+ yield takeLatest([publicWarningFormActions.publishWarningSuccess, publicWarningFormActions.saveWarningSuccess, publicWarningFormActions.toggleEditorWarningSuccess], successSaga);
5976
+ yield takeLatest([publicWarningFormActions.publishWarning, publicWarningFormActions.saveWarning], toggleDialogLoadingSaga, true);
5977
+ yield takeLatest(publicWarningFormActions.openPublicWarningFormDialog, openDialogSaga);
5978
+ }
5979
+
5383
5980
  /* *
5384
5981
  * Licensed under the Apache License, Version 2.0 (the "License");
5385
5982
  * you may not use this file except in compliance with the License.
@@ -5396,20 +5993,105 @@ const createApi = () => {
5396
5993
  * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
5397
5994
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
5398
5995
  * */
5399
- const WarningsModuleProvider = ({
5400
- config,
5401
- auth,
5402
- onSetAuth,
5403
- children
5404
- }) => {
5405
- return /*#__PURE__*/React.createElement(ApiProvider, {
5406
- config: config,
5407
- auth: auth,
5408
- onSetAuth: onSetAuth,
5409
- createApi: config !== undefined ? createApi$1 : createApi,
5410
- name: API_NAME
5411
- }, children);
5412
- };
5996
+ const getLastUpdatedTimeFormatted = () => dateUtils.dateToString(dateUtils.utc(), DATE_FORMAT_LASTUPDATEDTIME);
5997
+ function* fetchWarningsSaga() {
5998
+ try {
5999
+ const warningsApi = yield call$c(getWarningsApi);
6000
+ const {
6001
+ data: warnings
6002
+ } = yield call$c(warningsApi.getWarnings);
6003
+ const lastUpdatedTime = getLastUpdatedTimeFormatted();
6004
+ yield put(publicWarningActions.fetchWarningsSuccess({
6005
+ warnings,
6006
+ lastUpdatedTime
6007
+ }));
6008
+ yield delay(pollingIntervalTimeout);
6009
+ yield put(publicWarningActions.fetchWarnings());
6010
+ } catch (error) {
6011
+ yield put(publicWarningActions.fetchWarningsError({
6012
+ error: {
6013
+ name: error.name,
6014
+ message: error.message
6015
+ }
6016
+ }));
6017
+ }
6018
+ }
6019
+ function* refetchWarnings() {
6020
+ yield put(publicWarningActions.fetchWarnings());
6021
+ }
6022
+ function* publicWarnings() {
6023
+ yield takeLatest(publicWarningActions.fetchWarnings, fetchWarningsSaga);
6024
+ yield takeLatest([publicWarningFormActions.publishWarningSuccess, publicWarningFormActions.saveWarningSuccess], refetchWarnings);
6025
+ }
6026
+
6027
+ /* *
6028
+ * Licensed under the Apache License, Version 2.0 (the "License");
6029
+ * you may not use this file except in compliance with the License.
6030
+ * You may obtain a copy of the License at
6031
+ *
6032
+ * http://www.apache.org/licenses/LICENSE-2.0
6033
+ *
6034
+ * Unless required by applicable law or agreed to in writing, software
6035
+ * distributed under the License is distributed on an "AS IS" BASIS,
6036
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6037
+ * See the License for the specific language governing permissions and
6038
+ * limitations under the License.
6039
+ *
6040
+ * Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
6041
+ * Copyright 2024 - Finnish Meteorological Institute (FMI)
6042
+ * */
6043
+ const getSnackbarMessage = (objectName, id) => id ? `Object "${objectName}" ${outsideComponentTranslations['update-succes']}!` : `Object "${objectName}" ${outsideComponentTranslations['save-succes']}!`;
6044
+ const drawingsListener = createListenerMiddleware();
6045
+ drawingsListener.startListening({
6046
+ actionCreator: drawActions.submitDrawValues,
6047
+ effect: ({
6048
+ payload
6049
+ }, listenerApi) => __awaiter(void 0, void 0, void 0, function* () {
6050
+ listenerApi.cancelActiveListeners();
6051
+ const {
6052
+ id
6053
+ } = payload,
6054
+ formValues = __rest(payload, ["id"]);
6055
+ try {
6056
+ listenerApi.dispatch(uiActions.toggleIsLoadingDialog({
6057
+ isLoading: true,
6058
+ type: drawingDialogType
6059
+ }));
6060
+ const warningsApi = getWarningsApi();
6061
+ if (!id) {
6062
+ const newID = yield warningsApi.saveDrawingAs(formValues);
6063
+ listenerApi.dispatch(drawActions.setDrawValues({
6064
+ drawingInstanceId: drawingDialogType,
6065
+ id: newID,
6066
+ objectName: formValues.objectName
6067
+ }));
6068
+ } else {
6069
+ yield warningsApi.updateDrawing(id, formValues);
6070
+ }
6071
+ listenerApi.dispatch(uiActions.setErrorDialog({
6072
+ type: drawingDialogType,
6073
+ error: ''
6074
+ }));
6075
+ listenerApi.dispatch(snackbarActions.openSnackbar({
6076
+ message: getSnackbarMessage(formValues.objectName, id)
6077
+ }));
6078
+ listenerApi.dispatch(uiActions.toggleIsLoadingDialog({
6079
+ isLoading: false,
6080
+ type: drawingDialogType
6081
+ }));
6082
+ } catch (error) {
6083
+ listenerApi.dispatch(uiActions.toggleIsLoadingDialog({
6084
+ isLoading: false,
6085
+ type: drawingDialogType
6086
+ }));
6087
+ const errorMessage = isAxiosError$1(error) ? getAxiosErrorMessage(error) : error.message;
6088
+ listenerApi.dispatch(uiActions.setErrorDialog({
6089
+ type: drawingDialogType,
6090
+ error: errorMessage
6091
+ }));
6092
+ }
6093
+ })
6094
+ });
5413
6095
 
5414
6096
  /* *
5415
6097
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -5427,20 +6109,118 @@ const WarningsModuleProvider = ({
5427
6109
  * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
5428
6110
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
5429
6111
  * */
5430
- const DrawingToolMapButtonConnect = ({
5431
- mapId,
5432
- source: _source = 'app'
6112
+ const drawingModuleConfig = {
6113
+ id: 'drawing-module',
6114
+ reducersMap: {
6115
+ drawings: reducer$2,
6116
+ publicWarningForm: reducer,
6117
+ publicWarnings: reducer$1
6118
+ },
6119
+ sagas: [publicWarningRootSaga, publicWarnings],
6120
+ middlewares: [drawingsListener.middleware]
6121
+ };
6122
+
6123
+ createStore();
6124
+ const WarningsThemeProvider = ({
6125
+ children,
6126
+ theme: _theme = lightTheme
5433
6127
  }) => {
5434
- // const drawingDialogType = isMultiMap
5435
- // ? `${uiTypes.DialogTypes.DrawingTool}-${mapId}`
5436
- // : uiTypes.DialogTypes.DrawingTool;
5437
- const drawDialogMapId = useSelector(store => uiSelectors.getDialogMapId(store, drawingDialogType));
5438
- const isDrawDialogOpen = useSelector(store => uiSelectors.getisDialogOpen(store, drawingDialogType));
5439
- const {
5440
- openDrawDialog,
5441
- closeDrawDialog
5442
- } = useObjectDrawDialogAction({
5443
- mapId,
6128
+ return /*#__PURE__*/React.createElement(WarningsI18nProvider, null, /*#__PURE__*/React.createElement(ThemeWrapper, {
6129
+ theme: _theme
6130
+ }, children));
6131
+ };
6132
+ withEggs([...coreModuleConfig, drawingModuleConfig])(_a => {
6133
+ var {
6134
+ children
6135
+ } = _a,
6136
+ props = __rest(_a, ["children"]);
6137
+ return /*#__PURE__*/React.createElement(WarningsThemeProvider, Object.assign({}, props), children);
6138
+ });
6139
+ const WarningsTranslationsWrapper = ({
6140
+ children
6141
+ }) => {
6142
+ const {
6143
+ i18n
6144
+ } = useTranslation();
6145
+ React.useEffect(() => {
6146
+ i18n.addResourceBundle('en', WARN_NAMESPACE, warningsTranslations.en);
6147
+ i18n.addResourceBundle('nl', WARN_NAMESPACE, warningsTranslations.nl);
6148
+ }, [i18n]);
6149
+ return children;
6150
+ };
6151
+ const WarningsI18nProvider = ({
6152
+ children
6153
+ }) => {
6154
+ initWarnI18n();
6155
+ return /*#__PURE__*/React.createElement(I18nextProvider, {
6156
+ i18n: i18n
6157
+ }, children);
6158
+ };
6159
+
6160
+ /* *
6161
+ * Licensed under the Apache License, Version 2.0 (the "License");
6162
+ * you may not use this file except in compliance with the License.
6163
+ * You may obtain a copy of the License at
6164
+ *
6165
+ * http://www.apache.org/licenses/LICENSE-2.0
6166
+ *
6167
+ * Unless required by applicable law or agreed to in writing, software
6168
+ * distributed under the License is distributed on an "AS IS" BASIS,
6169
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6170
+ * See the License for the specific language governing permissions and
6171
+ * limitations under the License.
6172
+ *
6173
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
6174
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
6175
+ * */
6176
+ const WarningsModuleProvider = ({
6177
+ config,
6178
+ auth,
6179
+ onSetAuth,
6180
+ children
6181
+ }) => {
6182
+ return /*#__PURE__*/React.createElement(WarningsTranslationsWrapper, null, /*#__PURE__*/React.createElement(ApiProvider, {
6183
+ config: config,
6184
+ auth: auth,
6185
+ onSetAuth: onSetAuth,
6186
+ createApi: config !== undefined ? createApi$1 : createApi,
6187
+ name: API_NAME
6188
+ }, children));
6189
+ };
6190
+
6191
+ /* *
6192
+ * Licensed under the Apache License, Version 2.0 (the "License");
6193
+ * you may not use this file except in compliance with the License.
6194
+ * You may obtain a copy of the License at
6195
+ *
6196
+ * http://www.apache.org/licenses/LICENSE-2.0
6197
+ *
6198
+ * Unless required by applicable law or agreed to in writing, software
6199
+ * distributed under the License is distributed on an "AS IS" BASIS,
6200
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6201
+ * See the License for the specific language governing permissions and
6202
+ * limitations under the License.
6203
+ *
6204
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
6205
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
6206
+ * */
6207
+ const DrawingToolMapButtonConnect = ({
6208
+ mapId,
6209
+ source: _source = 'app'
6210
+ }) => {
6211
+ const {
6212
+ t
6213
+ } = useTranslation(WARN_NAMESPACE);
6214
+ // const drawingDialogType = isMultiMap
6215
+ // ? `${uiTypes.DialogTypes.DrawingTool}-${mapId}`
6216
+ // : uiTypes.DialogTypes.DrawingTool;
6217
+ const drawDialogMapId = useSelector(store => uiSelectors.getDialogMapId(store, drawingDialogType));
6218
+ const isDrawDialogOpen = useSelector(store => uiSelectors.getisDialogOpen(store, drawingDialogType));
6219
+ const {
6220
+ openDrawDialog,
6221
+ closeDrawDialog
6222
+ } = useObjectDrawDialogAction({
6223
+ mapId,
5444
6224
  source: _source
5445
6225
  });
5446
6226
  const onClick = () => {
@@ -5449,7 +6229,7 @@ const DrawingToolMapButtonConnect = ({
5449
6229
  };
5450
6230
  const isOpen = drawDialogMapId === mapId && isDrawDialogOpen;
5451
6231
  return /*#__PURE__*/React.createElement(MapControlButton, {
5452
- title: "Drawing Toolbox",
6232
+ title: t('drawing-tool-title'),
5453
6233
  "data-testid": "drawingToolButton",
5454
6234
  onClick: onClick,
5455
6235
  isActive: isOpen
@@ -5471,7 +6251,7 @@ const DEFAULT_DRAW_TOOL_MIN_SIZE = {
5471
6251
  const DrawingTool = ({
5472
6252
  bounds,
5473
6253
  onClose,
5474
- title: _title = 'Drawing Toolbox',
6254
+ title,
5475
6255
  isOpen,
5476
6256
  onMouseDown: _onMouseDown = () => {},
5477
6257
  order: _order = 0,
@@ -5483,11 +6263,14 @@ const DrawingTool = ({
5483
6263
  headerSize: _headerSize = 'xs',
5484
6264
  children
5485
6265
  }) => {
6266
+ const {
6267
+ t
6268
+ } = useTranslation(WARN_NAMESPACE);
5486
6269
  const minSize = DEFAULT_DRAW_TOOL_MIN_SIZE;
5487
6270
  const startSizeCalc = calculateStartSize(minSize, _size, _startPosition);
5488
6271
  const [sizeInState, setSizeInState] = React.useState(startSizeCalc);
5489
6272
  return /*#__PURE__*/React.createElement(ToolContainerDraggable, {
5490
- title: _title,
6273
+ title: title || t('drawing-tool-title'),
5491
6274
  startSize: sizeInState,
5492
6275
  minWidth: minSize.width,
5493
6276
  minHeight: minSize.height,
@@ -5545,7 +6328,7 @@ var whitespaces$2 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u200
5545
6328
  '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
5546
6329
 
5547
6330
  var uncurryThis$6 = functionUncurryThis;
5548
- var requireObjectCoercible$2 = requireObjectCoercible$5;
6331
+ var requireObjectCoercible$2 = requireObjectCoercible$6;
5549
6332
  var toString$5 = toString$7;
5550
6333
  var whitespaces$1 = whitespaces$2;
5551
6334
 
@@ -5575,7 +6358,7 @@ var stringTrim = {
5575
6358
  trim: createMethod$2(3)
5576
6359
  };
5577
6360
 
5578
- var global$6 = global$j;
6361
+ var global$6 = global$i;
5579
6362
  var fails$7 = fails$l;
5580
6363
  var uncurryThis$5 = functionUncurryThis;
5581
6364
  var toString$4 = toString$7;
@@ -5665,12 +6448,6 @@ const useFormDirty = ({
5665
6448
  * Copyright 2024 - Finnish Meteorological Institute (FMI)
5666
6449
  * */
5667
6450
  const opacityOptions = [100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 0];
5668
- const SAVE_OBJECT_BUTTON = 'Save new object';
5669
- const UPDATE_OBJECT_BUTTON = 'Update object';
5670
- const INPUT_OBJECT = 'Object name';
5671
- const INPUT_OPACITY = 'Opacity';
5672
- const DRAW_EXIT_MODE_MESSAGE = 'press ESC to exit draw mode';
5673
- const coordinatesEmptyMessage = 'An object drawing is required';
5674
6451
  const DrawingToolFormContentsNoMemo = ({
5675
6452
  isLoading,
5676
6453
  dialogError,
@@ -5687,6 +6464,9 @@ const DrawingToolFormContentsNoMemo = ({
5687
6464
  opacity,
5688
6465
  onSubmit
5689
6466
  }) => {
6467
+ const {
6468
+ t
6469
+ } = useTranslation(WARN_NAMESPACE);
5690
6470
  const hasErrors = Object.keys(errors).length > 0;
5691
6471
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Box, {
5692
6472
  sx: {
@@ -5710,7 +6490,7 @@ const DrawingToolFormContentsNoMemo = ({
5710
6490
  item: true
5711
6491
  }, /*#__PURE__*/React__default.createElement(Typography, {
5712
6492
  variant: "body2"
5713
- }, "Tools")), /*#__PURE__*/React__default.createElement(Grid, {
6493
+ }, t('drawing-tool-form-tools'))), /*#__PURE__*/React__default.createElement(Grid, {
5714
6494
  item: true,
5715
6495
  container: true
5716
6496
  }, /*#__PURE__*/React__default.createElement(Grid, {
@@ -5738,7 +6518,7 @@ const DrawingToolFormContentsNoMemo = ({
5738
6518
  position: 'relative',
5739
6519
  fontSize: 14
5740
6520
  }
5741
- }, DRAW_EXIT_MODE_MESSAGE)), !!errors.geoJSON && isDirty && ( /*#__PURE__*/React__default.createElement(FormHelperText, {
6521
+ }, t('drawing-tool-form-exit-draw-mode'))), !!errors.geoJSON && isDirty && ( /*#__PURE__*/React__default.createElement(FormHelperText, {
5742
6522
  error: true,
5743
6523
  variant: "filled",
5744
6524
  sx: {
@@ -5748,7 +6528,7 @@ const DrawingToolFormContentsNoMemo = ({
5748
6528
  name: "geoJSON",
5749
6529
  rules: {
5750
6530
  validate: {
5751
- coordinatesNotEmpty: value => isValidGeoJsonCoordinates(value) || coordinatesEmptyMessage
6531
+ coordinatesNotEmpty: value => isValidGeoJsonCoordinates(value) || t('drawing-tool-form-drawing-required')
5752
6532
  }
5753
6533
  }
5754
6534
  }))), /*#__PURE__*/React__default.createElement(Grid, {
@@ -5760,7 +6540,7 @@ const DrawingToolFormContentsNoMemo = ({
5760
6540
  sm: 6
5761
6541
  }, /*#__PURE__*/React__default.createElement(ReactHookFormSelect, {
5762
6542
  name: "opacity",
5763
- label: INPUT_OPACITY,
6543
+ label: t('drawing-tool-form-opacity'),
5764
6544
  rules: {},
5765
6545
  disabled: isLoading,
5766
6546
  isReadOnly: false,
@@ -5775,7 +6555,7 @@ const DrawingToolFormContentsNoMemo = ({
5775
6555
  item: true
5776
6556
  }, /*#__PURE__*/React__default.createElement(ReactHookFormTextField, {
5777
6557
  name: "objectName",
5778
- label: INPUT_OBJECT,
6558
+ label: t('drawing-tool-form-object-name'),
5779
6559
  rules: {
5780
6560
  required: true
5781
6561
  },
@@ -5804,7 +6584,7 @@ const DrawingToolFormContentsNoMemo = ({
5804
6584
  },
5805
6585
  "data-testid": "saveDrawingFormButton",
5806
6586
  disabled: isLoading || hasErrors
5807
- }, id !== '' ? UPDATE_OBJECT_BUTTON : SAVE_OBJECT_BUTTON)));
6587
+ }, id !== '' ? t('drawing-tool-form-update') : t('drawing-tool-form-save'))));
5808
6588
  };
5809
6589
  const DrawingToolFormContents = /*#__PURE__*/React__default.memo(DrawingToolFormContentsNoMemo, isEqual);
5810
6590
 
@@ -6052,12 +6832,15 @@ const getDialogType = (mapId, isMultiMap) => {
6052
6832
  };
6053
6833
  const DrawingToolConnect = ({
6054
6834
  bounds,
6055
- title: _title = 'Drawing Toolbox',
6835
+ title,
6056
6836
  showMapIdInTitle: _showMapIdInTitle = false,
6057
6837
  mapId: initialMapId = null,
6058
6838
  isMultiMap: _isMultiMap = false,
6059
6839
  source: _source = 'app'
6060
6840
  }) => {
6841
+ const {
6842
+ t
6843
+ } = useTranslation(WARN_NAMESPACE);
6061
6844
  const dialogType = getDialogType(initialMapId, _isMultiMap);
6062
6845
  const activeMapId = useSelector(store => uiSelectors.getDialogMapId(store, dialogType));
6063
6846
  // In case of a multimap, use the map id that is passed
@@ -6077,7 +6860,8 @@ const DrawingToolConnect = ({
6077
6860
  uiIsLoading,
6078
6861
  setFocused
6079
6862
  } = useSetupDialog(dialogType, _source);
6080
- const shownTitle = _showMapIdInTitle ? `${_title} ${mapId}` : _title;
6863
+ const defaultTitle = title || t('drawing-tool-title');
6864
+ const shownTitle = _showMapIdInTitle ? `${defaultTitle} ${mapId}` : defaultTitle;
6081
6865
  const onClose = () => {
6082
6866
  closeDrawDialog();
6083
6867
  };
@@ -6139,11 +6923,10 @@ const DEFAULT_WARNING_DIALOG_MIN_SIZE = {
6139
6923
  width: 320,
6140
6924
  height: 300
6141
6925
  };
6142
- const DIALOG_TITLE = 'Public Warning';
6143
6926
  const PublicWarningsFormDialog = ({
6144
6927
  bounds,
6145
6928
  onClose,
6146
- title: _title = DIALOG_TITLE,
6929
+ title,
6147
6930
  isOpen,
6148
6931
  onMouseDown: _onMouseDown = () => {},
6149
6932
  order: _order = 0,
@@ -6159,6 +6942,9 @@ const PublicWarningsFormDialog = ({
6159
6942
  shouldHideFormMode: _shouldHideFormMode = false,
6160
6943
  publicWarningEditor
6161
6944
  }) => {
6945
+ const {
6946
+ t
6947
+ } = useTranslation(WARN_NAMESPACE);
6162
6948
  const minSize = DEFAULT_WARNING_DIALOG_MIN_SIZE;
6163
6949
  const startSizeCalc = calculateStartSize(minSize, _size, _startPosition);
6164
6950
  const [sizeInState, setSizeInState] = React.useState(startSizeCalc);
@@ -6166,7 +6952,7 @@ const PublicWarningsFormDialog = ({
6166
6952
  _onChangeFormMode(!_isReadOnly);
6167
6953
  };
6168
6954
  return /*#__PURE__*/React.createElement(ToolContainerDraggable, Object.assign({
6169
- title: _title,
6955
+ title: title || t('public-warning-title'),
6170
6956
  startSize: sizeInState,
6171
6957
  minWidth: minSize.width,
6172
6958
  minHeight: minSize.height,
@@ -6195,7 +6981,7 @@ const PublicWarningsFormDialog = ({
6195
6981
  setSizeInState(dragSize);
6196
6982
  }
6197
6983
  },
6198
- leftHeaderComponent: /*#__PURE__*/React.createElement("div", null)
6984
+ dragHandleIcon: null
6199
6985
  }, !_shouldHideFormMode && {
6200
6986
  rightHeaderComponent: ( /*#__PURE__*/React.createElement(Box, {
6201
6987
  sx: {
@@ -6217,7 +7003,9 @@ const PublicWarningsFormDialog = ({
6217
7003
  }
6218
7004
  }, /*#__PURE__*/React.createElement(SwitchButton, {
6219
7005
  checked: !_isReadOnly,
6220
- onChange: onChangeMode
7006
+ onChange: onChangeMode,
7007
+ activeLabel: t('warning-editor-user-editor'),
7008
+ inActiveLabel: t('warning-editor-user-viewer')
6221
7009
  })), /*#__PURE__*/React.createElement(Box, {
6222
7010
  sx: {
6223
7011
  position: 'relative',
@@ -6254,6 +7042,8 @@ var lengthOfArrayLike = lengthOfArrayLike$3;
6254
7042
 
6255
7043
  var $TypeError$2 = TypeError;
6256
7044
 
7045
+ var REDUCE_EMPTY = 'Reduce of empty array with no initial value';
7046
+
6257
7047
  // `Array.prototype.{ reduce, reduceRight }` methods implementation
6258
7048
  var createMethod$1 = function (IS_RIGHT) {
6259
7049
  return function (that, callbackfn, argumentsLength, memo) {
@@ -6261,6 +7051,7 @@ var createMethod$1 = function (IS_RIGHT) {
6261
7051
  var self = IndexedObject(O);
6262
7052
  var length = lengthOfArrayLike(O);
6263
7053
  aCallable(callbackfn);
7054
+ if (length === 0 && argumentsLength < 2) throw new $TypeError$2(REDUCE_EMPTY);
6264
7055
  var index = IS_RIGHT ? length - 1 : 0;
6265
7056
  var i = IS_RIGHT ? -1 : 1;
6266
7057
  if (argumentsLength < 2) while (true) {
@@ -6271,7 +7062,7 @@ var createMethod$1 = function (IS_RIGHT) {
6271
7062
  }
6272
7063
  index += i;
6273
7064
  if (IS_RIGHT ? index < 0 : length <= index) {
6274
- throw new $TypeError$2('Reduce of empty array with no initial value');
7065
+ throw new $TypeError$2(REDUCE_EMPTY);
6275
7066
  }
6276
7067
  }
6277
7068
  for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
@@ -6300,7 +7091,7 @@ var arrayMethodIsStrict$1 = function (METHOD_NAME, argument) {
6300
7091
  });
6301
7092
  };
6302
7093
 
6303
- var global$5 = global$j;
7094
+ var global$5 = global$i;
6304
7095
  var classof$2 = classofRaw$1;
6305
7096
 
6306
7097
  var engineIsNode = classof$2(global$5.process) === 'process';
@@ -6325,7 +7116,7 @@ $$2({ target: 'Array', proto: true, forced: FORCED }, {
6325
7116
  }
6326
7117
  });
6327
7118
 
6328
- var anObject$3 = anObject$9;
7119
+ var anObject$3 = anObject$8;
6329
7120
 
6330
7121
  // `RegExp.prototype.flags` getter implementation
6331
7122
  // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
@@ -6344,7 +7135,7 @@ var regexpFlags$1 = function () {
6344
7135
  };
6345
7136
 
6346
7137
  var fails$5 = fails$l;
6347
- var global$4 = global$j;
7138
+ var global$4 = global$i;
6348
7139
 
6349
7140
  // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
6350
7141
  var $RegExp$2 = global$4.RegExp;
@@ -6375,7 +7166,7 @@ var regexpStickyHelpers = {
6375
7166
  };
6376
7167
 
6377
7168
  var fails$4 = fails$l;
6378
- var global$3 = global$j;
7169
+ var global$3 = global$i;
6379
7170
 
6380
7171
  // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
6381
7172
  var $RegExp$1 = global$3.RegExp;
@@ -6386,7 +7177,7 @@ var regexpUnsupportedDotAll = fails$4(function () {
6386
7177
  });
6387
7178
 
6388
7179
  var fails$3 = fails$l;
6389
- var global$2 = global$j;
7180
+ var global$2 = global$i;
6390
7181
 
6391
7182
  // babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
6392
7183
  var $RegExp = global$2.RegExp;
@@ -6404,7 +7195,7 @@ var uncurryThis$4 = functionUncurryThis;
6404
7195
  var toString$3 = toString$7;
6405
7196
  var regexpFlags = regexpFlags$1;
6406
7197
  var stickyHelpers$1 = regexpStickyHelpers;
6407
- var shared = shared$4.exports;
7198
+ var shared = shared$4;
6408
7199
  var create = objectCreate;
6409
7200
  var getInternalState = internalState.get;
6410
7201
  var UNSUPPORTED_DOT_ALL = regexpUnsupportedDotAll;
@@ -6662,7 +7453,7 @@ var aConstructor$1 = function (argument) {
6662
7453
  throw new $TypeError$1(tryToString(argument) + ' is not a constructor');
6663
7454
  };
6664
7455
 
6665
- var anObject$2 = anObject$9;
7456
+ var anObject$2 = anObject$8;
6666
7457
  var aConstructor = aConstructor$1;
6667
7458
  var isNullOrUndefined$1 = isNullOrUndefined$4;
6668
7459
  var wellKnownSymbol = wellKnownSymbol$a;
@@ -6680,7 +7471,7 @@ var speciesConstructor$1 = function (O, defaultConstructor) {
6680
7471
  var uncurryThis$2 = functionUncurryThis;
6681
7472
  var toIntegerOrInfinity = toIntegerOrInfinity$3;
6682
7473
  var toString$2 = toString$7;
6683
- var requireObjectCoercible$1 = requireObjectCoercible$5;
7474
+ var requireObjectCoercible$1 = requireObjectCoercible$6;
6684
7475
 
6685
7476
  var charAt$1 = uncurryThis$2(''.charAt);
6686
7477
  var charCodeAt = uncurryThis$2(''.charCodeAt);
@@ -6723,7 +7514,7 @@ var advanceStringIndex$1 = function (S, index, unicode) {
6723
7514
  };
6724
7515
 
6725
7516
  var call$1 = functionCall;
6726
- var anObject$1 = anObject$9;
7517
+ var anObject$1 = anObject$8;
6727
7518
  var isCallable$1 = isCallable$i;
6728
7519
  var classof = classofRaw$1;
6729
7520
  var regexpExec = regexpExec$2;
@@ -6746,9 +7537,9 @@ var regexpExecAbstract = function (R, S) {
6746
7537
  var call = functionCall;
6747
7538
  var uncurryThis$1 = functionUncurryThis;
6748
7539
  var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
6749
- var anObject = anObject$9;
7540
+ var anObject = anObject$8;
6750
7541
  var isNullOrUndefined = isNullOrUndefined$4;
6751
- var requireObjectCoercible = requireObjectCoercible$5;
7542
+ var requireObjectCoercible = requireObjectCoercible$6;
6752
7543
  var speciesConstructor = speciesConstructor$1;
6753
7544
  var advanceStringIndex = advanceStringIndex$1;
6754
7545
  var toLength = toLength$2;
@@ -6854,8 +7645,6 @@ fixRegExpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNa
6854
7645
  ];
6855
7646
  }, BUGGY || !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y);
6856
7647
 
6857
- const LABEL_DESCRIPTION_ORIGINAL = 'Description original';
6858
- const LABEL_DESCRIPTION_TRANSLATION = 'Description translation';
6859
7648
  function a11yProps(index) {
6860
7649
  return {
6861
7650
  id: `tab-${index}`,
@@ -6873,6 +7662,9 @@ const tabStyle = {
6873
7662
  }
6874
7663
  };
6875
7664
  const CustomTabPanel = props => {
7665
+ const {
7666
+ t
7667
+ } = useTranslation(WARN_NAMESPACE);
6876
7668
  const {
6877
7669
  children,
6878
7670
  value,
@@ -6915,12 +7707,15 @@ const CustomTabPanel = props => {
6915
7707
  disabled: isDisabled
6916
7708
  }, /*#__PURE__*/React__default.createElement(MenuItem, {
6917
7709
  value: "NL"
6918
- }, "Dutch (selected)")))), value === index ? children : null);
7710
+ }, t('warning-description-NL'))))), value === index ? children : null);
6919
7711
  };
6920
7712
  const DescriptionField = ({
6921
7713
  isDisabled: _isDisabled = false,
6922
7714
  isReadOnly: _isReadOnly = false
6923
7715
  }) => {
7716
+ const {
7717
+ t
7718
+ } = useTranslation(WARN_NAMESPACE);
6924
7719
  const [value, setValue] = React__default.useState(0);
6925
7720
  const handleChange = (event, newValue) => {
6926
7721
  setValue(newValue);
@@ -6938,11 +7733,11 @@ const DescriptionField = ({
6938
7733
  }
6939
7734
  }), /*#__PURE__*/React__default.createElement(Tab, Object.assign({
6940
7735
  sx: tabStyle,
6941
- label: LABEL_DESCRIPTION_ORIGINAL,
7736
+ label: t('warning-description-original'),
6942
7737
  disabled: _isDisabled
6943
7738
  }, a11yProps(0))), /*#__PURE__*/React__default.createElement(Tab, Object.assign({
6944
7739
  sx: tabStyle,
6945
- label: LABEL_DESCRIPTION_TRANSLATION,
7740
+ label: t('warning-description-translation'),
6946
7741
  disabled: _isDisabled
6947
7742
  }, a11yProps(1)))), /*#__PURE__*/React__default.createElement(CustomTabPanel, {
6948
7743
  value: value,
@@ -6971,20 +7766,12 @@ const DescriptionField = ({
6971
7766
  })));
6972
7767
  };
6973
7768
 
6974
- const LABEL_AREA = 'Area';
6975
- const BUTTON_ADD_OBJECT = 'Add object';
6976
- const BUTTON_DELETE$1 = 'Delete';
6977
- const BUTTON_VIEW = 'View';
6978
- const BUTTON_EDIT$1 = 'Edit';
6979
- const OBJECTS_MENU = 'Object options';
6980
- const NO_OBJECT = '(no object selected)';
6981
- const OBJECT_SELECTED = 'object selected';
6982
7769
  const formatDate = lastUpdatedTime => dateUtils.dateToString(dateUtils.isoStringToDate(lastUpdatedTime), `${DATE_FORMAT_FNS} 'UTC'`);
6983
- const getObjectName = (geoJSON, objectName) => {
7770
+ const getObjectName = (geoJSON, objectName, t) => {
6984
7771
  if (geoJSON) {
6985
- return objectName || OBJECT_SELECTED;
7772
+ return objectName || t('object-manager-object-selected');
6986
7773
  }
6987
- return NO_OBJECT;
7774
+ return t('object-manager-no-object-selected');
6988
7775
  };
6989
7776
  const AreaField = ({
6990
7777
  onEditObject: _onEditObject = () => {},
@@ -6993,6 +7780,9 @@ const AreaField = ({
6993
7780
  onAddObject: _onAddObject = () => {},
6994
7781
  isDisabled: _isDisabled = false
6995
7782
  }) => {
7783
+ const {
7784
+ t
7785
+ } = useTranslation(WARN_NAMESPACE);
6996
7786
  const {
6997
7787
  getValues,
6998
7788
  formState: {
@@ -7004,7 +7794,7 @@ const AreaField = ({
7004
7794
  } = useDraftFormHelpers();
7005
7795
  const lastUpdatedTime = getValues('object.lastUpdatedTime');
7006
7796
  const geoJSON = getValues('geoJSON');
7007
- const objectName = getObjectName(geoJSON, getValues('object.objectName'));
7797
+ const objectName = getObjectName(geoJSON, getValues('object.objectName'), t);
7008
7798
  const hasErrors = (errors === null || errors === void 0 ? void 0 : errors.geoJSON) !== undefined;
7009
7799
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Typography, Object.assign({
7010
7800
  variant: "h3",
@@ -7019,7 +7809,7 @@ const AreaField = ({
7019
7809
  })
7020
7810
  }, hasErrors && {
7021
7811
  'aria-errormessage': errorMessages.required
7022
- }), LABEL_AREA), /*#__PURE__*/React__default.createElement(Card, {
7812
+ }), t('warning-area')), /*#__PURE__*/React__default.createElement(Card, {
7023
7813
  elevation: 0,
7024
7814
  sx: Object.assign({}, !geoJSON && {
7025
7815
  background: 'none'
@@ -7045,8 +7835,8 @@ const AreaField = ({
7045
7835
  variant: "body2",
7046
7836
  color: "text.secondary"
7047
7837
  }, lastUpdatedTime ? formatDate(lastUpdatedTime) : ''), geoJSON ? ( /*#__PURE__*/React__default.createElement(ToggleMenu, {
7048
- menuTitle: OBJECTS_MENU,
7049
- tooltipTitle: OBJECTS_MENU,
7838
+ menuTitle: t('object-manager-options-menu'),
7839
+ tooltipTitle: t('object-manager-options-menu'),
7050
7840
  buttonSx: {
7051
7841
  position: 'absolute',
7052
7842
  right: 0,
@@ -7058,15 +7848,15 @@ const AreaField = ({
7058
7848
  menuPosition: "bottom",
7059
7849
  isDisabled: _isDisabled,
7060
7850
  menuItems: [{
7061
- text: BUTTON_EDIT$1,
7851
+ text: t('object-manager-button-edit'),
7062
7852
  action: _onEditObject,
7063
7853
  icon: /*#__PURE__*/React__default.createElement(Edit, null)
7064
7854
  }, {
7065
- text: BUTTON_VIEW,
7855
+ text: t('object-manager-button-view'),
7066
7856
  action: _onViewObject,
7067
7857
  icon: /*#__PURE__*/React__default.createElement(Visibility, null)
7068
7858
  }, {
7069
- text: BUTTON_DELETE$1,
7859
+ text: t('object-manager-button-delete'),
7070
7860
  action: _onDeleteObject,
7071
7861
  icon: /*#__PURE__*/React__default.createElement(Delete, null)
7072
7862
  }]
@@ -7086,7 +7876,7 @@ const AreaField = ({
7086
7876
  size: "small",
7087
7877
  onClick: _onAddObject,
7088
7878
  disabled: _isDisabled
7089
- }, BUTTON_ADD_OBJECT));
7879
+ }, t('warning-button-add-object')));
7090
7880
  };
7091
7881
 
7092
7882
  /* *
@@ -7105,39 +7895,42 @@ const AreaField = ({
7105
7895
  * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
7106
7896
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
7107
7897
  * */
7108
- const LABEL_PHENOMENON = 'Phenomenon';
7109
- const warningPhenomena = [{
7110
- title: 'Wind',
7898
+ const warningPhenomena = t => [{
7899
+ title: t('warning-phenomenon-wind'),
7111
7900
  key: 'wind',
7112
7901
  icon: /*#__PURE__*/React.createElement(Wind, null)
7113
7902
  }, {
7114
- title: 'Fog',
7903
+ title: t('warning-phenomenon-fog'),
7115
7904
  key: 'fog',
7116
7905
  icon: /*#__PURE__*/React.createElement(Fog, null)
7117
7906
  }, {
7118
- title: 'Thunderstorm',
7907
+ title: t('warning-phenomenon-thunderstorm'),
7119
7908
  key: 'thunderstorm',
7120
7909
  icon: /*#__PURE__*/React.createElement(Lightning, null)
7121
7910
  }, {
7122
- title: 'Snow/ice',
7911
+ title: t('warning-phenomenon-snow-ice'),
7123
7912
  key: 'snowIce',
7124
7913
  icon: /*#__PURE__*/React.createElement(Snow, null)
7125
7914
  }, {
7126
- title: 'Rain',
7915
+ title: t('warning-phenomenon-rain'),
7127
7916
  key: 'rain',
7128
7917
  icon: /*#__PURE__*/React.createElement(Rain, null)
7129
7918
  }, {
7130
- title: 'High temperature',
7919
+ title: t('warning-phenomenon-high-temp'),
7131
7920
  key: 'highTemp',
7132
7921
  icon: /*#__PURE__*/React.createElement(TemperatureHigh, null)
7133
7922
  },
7134
- // { title: 'Funnel cloud', key: 'funnelCloud', icon: <FunnelCloud /> },
7923
+ // {
7924
+ // title: t('warning-phenomenon-funnel-cloud'),
7925
+ // key: 'funnelCloud',
7926
+ // icon: <FunnelCloud />,
7927
+ // },
7135
7928
  {
7136
- title: 'Low temperature',
7929
+ title: t('warning-phenomenon-low-temp'),
7137
7930
  key: 'lowTemp',
7138
7931
  icon: /*#__PURE__*/React.createElement(TemperatureLow, null)
7139
7932
  }, {
7140
- title: 'Coastal event',
7933
+ title: t('warning-phenomenon-coastal-event'),
7141
7934
  key: 'coastalEvent',
7142
7935
  icon: /*#__PURE__*/React.createElement(CoastalEvent, null)
7143
7936
  }];
@@ -7145,12 +7938,15 @@ const Phenomenon = ({
7145
7938
  isDisabled,
7146
7939
  isReadOnly
7147
7940
  }) => {
7941
+ const {
7942
+ t
7943
+ } = useTranslation(WARN_NAMESPACE);
7148
7944
  const {
7149
7945
  isRequired
7150
7946
  } = useDraftFormHelpers();
7151
7947
  return /*#__PURE__*/React.createElement(ReactHookFormSelect, {
7152
7948
  name: "phenomenon",
7153
- label: LABEL_PHENOMENON,
7949
+ label: t('warning-phenomenon'),
7154
7950
  rules: {
7155
7951
  validate: {
7156
7952
  isRequired
@@ -7158,7 +7954,7 @@ const Phenomenon = ({
7158
7954
  },
7159
7955
  disabled: isDisabled || isReadOnly,
7160
7956
  isReadOnly: isReadOnly
7161
- }, warningPhenomena.map(phenomenon => {
7957
+ }, warningPhenomena(t).map(phenomenon => {
7162
7958
  return /*#__PURE__*/React.createElement(MenuItem, {
7163
7959
  key: phenomenon.key,
7164
7960
  value: phenomenon.key
@@ -7173,43 +7969,43 @@ const Phenomenon = ({
7173
7969
  }));
7174
7970
  };
7175
7971
 
7176
- /* *
7177
- * Licensed under the Apache License, Version 2.0 (the "License");
7178
- * you may not use this file except in compliance with the License.
7179
- * You may obtain a copy of the License at
7180
- *
7181
- * http://www.apache.org/licenses/LICENSE-2.0
7182
- *
7183
- * Unless required by applicable law or agreed to in writing, software
7184
- * distributed under the License is distributed on an "AS IS" BASIS,
7185
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7186
- * See the License for the specific language governing permissions and
7187
- * limitations under the License.
7188
- *
7189
- * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
7190
- * Copyright 2023 - Finnish Meteorological Institute (FMI)
7191
- * */
7192
- const LABEL_LEVEL = 'Level';
7193
- const levelOptions = [{
7194
- title: 'Moderate',
7195
- key: 'moderate',
7196
- color: '#FAE21E',
7197
- textColor: '#051039'
7198
- }, {
7199
- title: 'Severe',
7200
- key: 'severe',
7201
- color: '#E27000',
7202
- textColor: '#051039'
7203
- }, {
7204
- title: 'Extreme',
7205
- key: 'extreme',
7206
- color: '#D62A20',
7207
- textColor: '#ffffff'
7208
- }];
7972
+ var WarningLevel;
7973
+ (function (WarningLevel) {
7974
+ WarningLevel["moderate"] = "moderate";
7975
+ WarningLevel["severe"] = "severe";
7976
+ WarningLevel["extreme"] = "extreme";
7977
+ })(WarningLevel || (WarningLevel = {}));
7978
+ const LevelColors = {
7979
+ moderate: {
7980
+ color: '#FAE21E',
7981
+ textColor: '#051039'
7982
+ },
7983
+ severe: {
7984
+ color: '#E27000',
7985
+ textColor: '#051039'
7986
+ },
7987
+ extreme: {
7988
+ color: '#D62A20',
7989
+ textColor: '#ffffff'
7990
+ }
7991
+ };
7992
+ const levelOptions = t => [Object.assign({
7993
+ title: t('warning-level-moderate'),
7994
+ key: WarningLevel.moderate
7995
+ }, LevelColors[WarningLevel.moderate]), Object.assign({
7996
+ title: t('warning-level-severe'),
7997
+ key: WarningLevel.severe
7998
+ }, LevelColors[WarningLevel.severe]), Object.assign({
7999
+ title: t('warning-level-extreme'),
8000
+ key: WarningLevel.extreme
8001
+ }, LevelColors['extreme'])];
7209
8002
  const LevelField = ({
7210
8003
  isDisabled: _isDisabled = false,
7211
8004
  isReadOnly: _isReadOnly = false
7212
8005
  }) => {
8006
+ const {
8007
+ t
8008
+ } = useTranslation(WARN_NAMESPACE);
7213
8009
  const {
7214
8010
  isRequired
7215
8011
  } = useDraftFormHelpers();
@@ -7217,10 +8013,10 @@ const LevelField = ({
7217
8013
  watch
7218
8014
  } = useFormContext();
7219
8015
  const selectedLevel = watch('level');
7220
- const levelDetails = levelOptions.find(level => level.key === selectedLevel);
8016
+ const levelDetails = levelOptions(t).find(level => level.key === selectedLevel);
7221
8017
  return /*#__PURE__*/React.createElement(ReactHookFormSelect, {
7222
8018
  name: "level",
7223
- label: LABEL_LEVEL,
8019
+ label: t('warning-level'),
7224
8020
  rules: {
7225
8021
  validate: {
7226
8022
  isRequired
@@ -7235,7 +8031,7 @@ const LevelField = ({
7235
8031
  },
7236
8032
  disabled: _isDisabled || _isReadOnly,
7237
8033
  isReadOnly: _isReadOnly
7238
- }, levelOptions.map(level => ( /*#__PURE__*/React.createElement(MenuItem, {
8034
+ }, levelOptions(t).map(level => ( /*#__PURE__*/React.createElement(MenuItem, {
7239
8035
  value: level.key,
7240
8036
  key: level.key,
7241
8037
  sx: {
@@ -7276,16 +8072,19 @@ const LevelField = ({
7276
8072
  * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
7277
8073
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
7278
8074
  * */
7279
- const LABEL_VALID_FROM = 'Valid from';
7280
- const MAX_HOURS_AFTER_CURRENT$1 = 168;
7281
- const VALID_FROM_ERROR_BEFORE_CURRENT = 'Valid from time cannot be before current time';
7282
- const VALID_FROM_ERROR_AFTER_CURRENT = `Valid from time can be no more than ${MAX_HOURS_AFTER_CURRENT$1} hours after current time`;
7283
- const isValueBeforeCurrentTime$1 = value => isXHoursBefore(value, dateUtils.getCurrentTimeAsString(), 0) || VALID_FROM_ERROR_BEFORE_CURRENT;
7284
- const isMaxHoursAfterCurrentTime$1 = value => isXHoursAfter(value, dateUtils.getCurrentTimeAsString(), MAX_HOURS_AFTER_CURRENT$1) || VALID_FROM_ERROR_AFTER_CURRENT;
8075
+ const VALID_FROM_MAX_HOURS_AFTER_CURRENT = 168;
8076
+ const isValueBeforeCurrentTime$1 = (value, t) => isXHoursBefore(value, dateUtils.getCurrentTimeAsString(), 0) || t('warning-valid-from-error-before-current');
8077
+ const isMaxHoursAfterCurrentTime$1 = (value, t) => isXHoursAfter(value, dateUtils.getCurrentTimeAsString(), VALID_FROM_MAX_HOURS_AFTER_CURRENT) || t('warning-valid-from-error-max-hours', {
8078
+ ns: WARN_NAMESPACE,
8079
+ MAX_HOURS: VALID_FROM_MAX_HOURS_AFTER_CURRENT
8080
+ });
7285
8081
  const ValidFrom = ({
7286
8082
  isDisabled,
7287
8083
  isReadOnly
7288
8084
  }) => {
8085
+ const {
8086
+ t
8087
+ } = useTranslation(WARN_NAMESPACE);
7289
8088
  const {
7290
8089
  isRequired
7291
8090
  } = useDraftFormHelpers();
@@ -7300,12 +8099,12 @@ const ValidFrom = ({
7300
8099
  isRequired,
7301
8100
  isValidDate,
7302
8101
  // The valid from time cannot be before the current time
7303
- isValueBeforeCurrentTime: isValueBeforeCurrentTime$1,
8102
+ isValueBeforeCurrentTime: value => isValueBeforeCurrentTime$1(value, t),
7304
8103
  // Valid from can be no more than X hours after current time
7305
- isMaxHoursAfterCurrentTime: isMaxHoursAfterCurrentTime$1
8104
+ isMaxHoursAfterCurrentTime: value => isMaxHoursAfterCurrentTime$1(value, t)
7306
8105
  }
7307
8106
  },
7308
- label: LABEL_VALID_FROM,
8107
+ label: t('warning-valid-from'),
7309
8108
  disablePast: true,
7310
8109
  disabled: isDisabled || isReadOnly,
7311
8110
  isReadOnly: isReadOnly,
@@ -7329,25 +8128,30 @@ const ValidFrom = ({
7329
8128
  * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
7330
8129
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
7331
8130
  * */
7332
- const LABEL_VALID_UNTIL = 'Valid until';
7333
- const MAX_HOURS_AFTER_CURRENT = 180;
7334
- const MIN_HOURS_AFTER_VALID_FROM = 1;
7335
- const VALID_UNTIL_ERROR_BEFORE_CURRENT = 'Valid until time cannot be before current time';
7336
- const VALID_UNTIL_ERROR_AFTER_CURRENT = `Valid until time can be no more than ${MAX_HOURS_AFTER_CURRENT} hours after current time`;
7337
- const VALID_UNTIL_ERROR_AFTER_VALID_FROM = `Valid until time has to be at least ${MIN_HOURS_AFTER_VALID_FROM} hour after Valid from time`;
7338
- const isValueBeforeCurrentTime = value => isXHoursBefore(value, dateUtils.getCurrentTimeAsString(), 0) || VALID_UNTIL_ERROR_BEFORE_CURRENT;
7339
- const isMaxHoursAfterCurrentTime = value => isXHoursAfter(value, dateUtils.getCurrentTimeAsString(), MAX_HOURS_AFTER_CURRENT) || VALID_UNTIL_ERROR_AFTER_CURRENT;
7340
- const isMinHoursAfterValidFrom = (value, validFromValue) => {
8131
+ const VALID_UNTIL_MAX_HOURS_AFTER_CURRENT = 180;
8132
+ const VALID_UNTIL_MIN_HOURS_AFTER_VALID_FROM = 1;
8133
+ const isValueBeforeCurrentTime = (value, t) => isXHoursBefore(value, dateUtils.getCurrentTimeAsString(), 0) || t('warning-valid-until-error-before-current');
8134
+ const isMaxHoursAfterCurrentTime = (value, t) => isXHoursAfter(value, dateUtils.getCurrentTimeAsString(), VALID_UNTIL_MAX_HOURS_AFTER_CURRENT) || t('warning-valid-until-error-max-hours', {
8135
+ ns: WARN_NAMESPACE,
8136
+ MAX_HOURS: VALID_UNTIL_MAX_HOURS_AFTER_CURRENT
8137
+ });
8138
+ const isMinHoursAfterValidFrom = (value, validFromValue, t) => {
7341
8139
  if (isEmpty(value) || isEmpty(validFromValue) || !isValidDate(validFromValue)) {
7342
8140
  return true;
7343
8141
  }
7344
8142
  const duration = dateUtils.differenceInHours(new Date(value), new Date(validFromValue));
7345
- return duration >= MIN_HOURS_AFTER_VALID_FROM || VALID_UNTIL_ERROR_AFTER_VALID_FROM;
8143
+ return duration >= VALID_UNTIL_MIN_HOURS_AFTER_VALID_FROM || t('warning-valid-until-error-min-hours', {
8144
+ ns: WARN_NAMESPACE,
8145
+ MIN_HOURS: VALID_UNTIL_MIN_HOURS_AFTER_VALID_FROM
8146
+ });
7346
8147
  };
7347
8148
  const ValidUntil = ({
7348
8149
  isDisabled,
7349
8150
  isReadOnly
7350
8151
  }) => {
8152
+ const {
8153
+ t
8154
+ } = useTranslation(WARN_NAMESPACE);
7351
8155
  const {
7352
8156
  isRequired
7353
8157
  } = useDraftFormHelpers();
@@ -7361,20 +8165,85 @@ const ValidUntil = ({
7361
8165
  isRequired,
7362
8166
  isValidDate,
7363
8167
  // The valid until time cannot be before the current time
7364
- isValueBeforeCurrentTime,
8168
+ isValueBeforeCurrentTime: value => isValueBeforeCurrentTime(value, t),
7365
8169
  // Valid until time can be no more than X hours after current time
7366
- isMaxHoursAfterCurrentTime,
8170
+ isMaxHoursAfterCurrentTime: value => isMaxHoursAfterCurrentTime(value, t),
7367
8171
  // Valid until time has to be at least X hours after valid from time
7368
- isMinHoursAfterValidFrom: value => isMinHoursAfterValidFrom(value, getValues('validFrom'))
8172
+ isMinHoursAfterValidFrom: value => isMinHoursAfterValidFrom(value, getValues('validFrom'), t)
7369
8173
  }
7370
8174
  },
7371
- label: LABEL_VALID_UNTIL,
8175
+ label: t('warning-valid-until'),
7372
8176
  disablePast: true,
7373
8177
  disabled: isDisabled || isReadOnly,
7374
8178
  isReadOnly: isReadOnly
7375
8179
  });
7376
8180
  };
7377
8181
 
8182
+ const zoomToFeature = (mapId, geojsonFeature) => {
8183
+ const webmapjs = getWMJSMapById(mapId);
8184
+ if (!webmapjs || !geojsonFeature) {
8185
+ return;
8186
+ }
8187
+ const bboxGeoJSON = getFeatureExtent(geojsonFeature);
8188
+ const projectedCoordinateBoxBottomLeft = webmapjs.getGeoCoordFromLatLong({
8189
+ x: bboxGeoJSON.left,
8190
+ y: bboxGeoJSON.bottom
8191
+ });
8192
+ const projectedCoordinateBoxTopRight = webmapjs.getGeoCoordFromLatLong({
8193
+ x: bboxGeoJSON.right,
8194
+ y: bboxGeoJSON.top
8195
+ });
8196
+ if (projectedCoordinateBoxBottomLeft && projectedCoordinateBoxTopRight) {
8197
+ const transformedExtent = new WMBBOX({
8198
+ left: projectedCoordinateBoxBottomLeft.x,
8199
+ bottom: projectedCoordinateBoxBottomLeft.y,
8200
+ right: projectedCoordinateBoxTopRight.x,
8201
+ top: projectedCoordinateBoxTopRight.y
8202
+ });
8203
+ webmapjs.zoomTo(transformedExtent);
8204
+ webmapjs.zoomOut(1 / 2);
8205
+ webmapjs.draw();
8206
+ }
8207
+ };
8208
+ const WarningsMapView = ({
8209
+ geojsonFeature,
8210
+ defaultBbox: _defaultBbox = defaultBbox
8211
+ }) => {
8212
+ const mapId = React.useRef(`WarningsMapView_${generateMapId()}`).current;
8213
+ const warningLayer = {
8214
+ id: `${mapId}geojsonfeature`,
8215
+ geojson: geojsonFeature,
8216
+ layerType: LayerType.featureLayer
8217
+ };
8218
+ // Zoom to the geojson when the geojsonFeature is updated in an already mounted map component
8219
+ zoomToFeature(mapId, geojsonFeature);
8220
+ return /*#__PURE__*/React.createElement("div", {
8221
+ style: {
8222
+ height: '200px',
8223
+ width: '100%'
8224
+ }
8225
+ }, /*#__PURE__*/React.createElement(MapView, {
8226
+ bbox: _defaultBbox.bbox,
8227
+ srs: _defaultBbox.srs,
8228
+ mapId: mapId,
8229
+ showScaleBar: false,
8230
+ onWMJSMount: mapId => {
8231
+ const webmapjs = getWMJSMapById(mapId);
8232
+ webmapjs.hideMouseCursorProperties();
8233
+ if (!geojsonFeature) {
8234
+ return;
8235
+ }
8236
+ // Zoom to the geojson when the map is ready
8237
+ zoomToFeature(mapId, geojsonFeature);
8238
+ },
8239
+ holdShiftToScroll: true
8240
+ }, /*#__PURE__*/React.createElement(MapViewLayer, Object.assign({}, defaultLayers.baseLayerGrey, {
8241
+ id: `${mapId}_baseLayer}`
8242
+ })), warningLayer.geojson && /*#__PURE__*/React.createElement(MapViewLayer, Object.assign({}, warningLayer)), /*#__PURE__*/React.createElement(MapViewLayer, Object.assign({}, defaultLayers.overLayer, {
8243
+ id: `${mapId}_overlayer}`
8244
+ }))));
8245
+ };
8246
+
7378
8247
  const getEmptyPublicWarning = () => {
7379
8248
  const currentTime = new Date();
7380
8249
  const validFromTime = dateUtils.add(currentTime, {
@@ -7396,6 +8265,15 @@ const getEmptyPublicWarning = () => {
7396
8265
  geoJSON: null
7397
8266
  };
7398
8267
  };
8268
+ const getDefaultFeatureProperties = level => {
8269
+ return {
8270
+ fill: LevelColors[level].color,
8271
+ stroke: LevelColors[level].color,
8272
+ 'fill-opacity': 0.2,
8273
+ 'stroke-width': 2,
8274
+ 'stroke-opacity': 1
8275
+ };
8276
+ };
7399
8277
  const getFormData = (publicWarningsDetails, object) => {
7400
8278
  const data = Object.assign(Object.assign({
7401
8279
  IS_DRAFT: '',
@@ -7416,12 +8294,6 @@ const spinnerSx = {
7416
8294
  margin: 'auto',
7417
8295
  marginLeft: 1
7418
8296
  };
7419
- const LABEL_PROBABILITY = 'Probability';
7420
- const BUTTON_CLEAR = 'Clear';
7421
- const BUTTON_SAVE = 'Save';
7422
- const BUTTON_SAVING = 'Saving';
7423
- const BUTTON_PUBLISH = 'Publish';
7424
- const BUTTON_PUBLISHING = 'Publishing';
7425
8297
  const probablityOptions = [100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 0];
7426
8298
  const ContainerWrapper = styled('div')(() => ({
7427
8299
  containerType: 'size',
@@ -7494,6 +8366,7 @@ const getErrors = errors => errors ? errors === null || errors === void 0 ? void
7494
8366
  errors: []
7495
8367
  }) : null;
7496
8368
  const Form = ({
8369
+ defaultBbox,
7497
8370
  onSaveForm: _onSaveForm = () => {},
7498
8371
  onPublishForm: _onPublishForm = () => {},
7499
8372
  object,
@@ -7506,6 +8379,9 @@ const Form = ({
7506
8379
  isReadOnly: _isReadOnly2 = false,
7507
8380
  onFormDirty: _onFormDirty = () => {}
7508
8381
  }) => {
8382
+ const {
8383
+ t
8384
+ } = useTranslation(WARN_NAMESPACE);
7509
8385
  const {
7510
8386
  handleSubmit,
7511
8387
  reset,
@@ -7555,6 +8431,20 @@ const Form = ({
7555
8431
  reset(getFormData(publicWarningDetails, object));
7556
8432
  }, [object, reset, publicWarningDetails]);
7557
8433
  const errors = getErrors(_error.message);
8434
+ // object is used making drawing, publicWarningDetails is used when showing the dialog from the warninglist.
8435
+ const warningGeoJSONFeature = (object === null || object === void 0 ? void 0 : object.geoJSON) || (publicWarningDetails === null || publicWarningDetails === void 0 ? void 0 : publicWarningDetails.geoJSON);
8436
+ // Add colors, if not defined
8437
+ const warningGeoJSONFeatureWithFillProps = produce(warningGeoJSONFeature, draft => {
8438
+ const draftFeature = draft === null || draft === void 0 ? void 0 : draft.features[0];
8439
+ if (draftFeature) {
8440
+ const level = WarningLevel[publicWarningDetails === null || publicWarningDetails === void 0 ? void 0 : publicWarningDetails.level] || WarningLevel[WarningLevel.moderate];
8441
+ const defaultProps = getDefaultFeatureProperties(level);
8442
+ if (!draftFeature.properties) {
8443
+ draftFeature.properties = Object.assign({}, defaultProps);
8444
+ }
8445
+ Object.assign(draftFeature.properties, Object.assign(Object.assign({}, defaultProps), draftFeature.properties));
8446
+ }
8447
+ });
7558
8448
  return /*#__PURE__*/React.createElement(ContainerWrapper, null, /*#__PURE__*/React.createElement(ContainerFormWrapper, {
7559
8449
  isReadOnly: _isReadOnly2
7560
8450
  }, /*#__PURE__*/React.createElement(ContainerGrid, null, errors && ( /*#__PURE__*/React.createElement(Box, {
@@ -7587,6 +8477,16 @@ const Form = ({
7587
8477
  onViewObject: () => {},
7588
8478
  onDeleteObject: () => {},
7589
8479
  onAddObject: () => {}
8480
+ }))), /*#__PURE__*/React.createElement(Grid, {
8481
+ item: true,
8482
+ xs: 12,
8483
+ container: true
8484
+ }, /*#__PURE__*/React.createElement(Grid, {
8485
+ item: true,
8486
+ xs: 12
8487
+ }, /*#__PURE__*/React.createElement(WarningsMapView, {
8488
+ geojsonFeature: warningGeoJSONFeatureWithFillProps,
8489
+ defaultBbox: defaultBbox
7590
8490
  }))), /*#__PURE__*/React.createElement(Grid, {
7591
8491
  item: true,
7592
8492
  xs: 12,
@@ -7624,7 +8524,7 @@ const Form = ({
7624
8524
  sm: 6
7625
8525
  }, /*#__PURE__*/React.createElement(ReactHookFormSelect, {
7626
8526
  name: "probability",
7627
- label: LABEL_PROBABILITY,
8527
+ label: t('warning-probability'),
7628
8528
  rules: {},
7629
8529
  disabled: areFieldsDisabled || _isReadOnly2,
7630
8530
  isReadOnly: _isReadOnly2
@@ -7669,7 +8569,7 @@ const Form = ({
7669
8569
  },
7670
8570
  disabled: areFieldsDisabled,
7671
8571
  onClick: onPressClear
7672
- }, BUTTON_CLEAR)), /*#__PURE__*/React.createElement(Grid, {
8572
+ }, t('warning-button-clear'))), /*#__PURE__*/React.createElement(Grid, {
7673
8573
  item: true,
7674
8574
  xs: 12,
7675
8575
  sm: 4
@@ -7685,7 +8585,7 @@ const Form = ({
7685
8585
  style: {
7686
8586
  position: 'relative'
7687
8587
  }
7688
- }, isSaving ? BUTTON_SAVING : BUTTON_SAVE, isSaving && ( /*#__PURE__*/React.createElement(CircularProgress, {
8588
+ }, isSaving ? t('warning-button-saving') : t('warning-button-save'), isSaving && ( /*#__PURE__*/React.createElement(CircularProgress, {
7689
8589
  "data-testid": "spinner",
7690
8590
  color: "inherit",
7691
8591
  sx: spinnerSx
@@ -7704,7 +8604,7 @@ const Form = ({
7704
8604
  style: {
7705
8605
  position: 'relative'
7706
8606
  }
7707
- }, isPublishing ? BUTTON_PUBLISHING : BUTTON_PUBLISH, isPublishing && ( /*#__PURE__*/React.createElement(CircularProgress, {
8607
+ }, isPublishing ? t('warning-button-publishing') : t('warning-button-publish'), isPublishing && ( /*#__PURE__*/React.createElement(CircularProgress, {
7708
8608
  "data-testid": "spinner",
7709
8609
  color: "inherit",
7710
8610
  sx: spinnerSx
@@ -7776,7 +8676,9 @@ const getSelectedPublicIsFormDirty = createSelector(getPublicWarningStore, publi
7776
8676
  * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
7777
8677
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
7778
8678
  * */
7779
- const PublicWarningsFormConnect = () => {
8679
+ const PublicWarningsFormConnect = ({
8680
+ defaultBbox
8681
+ }) => {
7780
8682
  const publicWarning = useSelector(store => getPublicWarning(store));
7781
8683
  const publicWarningObject = useSelector(store => getPublicWarningObject(store));
7782
8684
  const publicWarningFormAction = useSelector(store => getPublicWarningFormState(store));
@@ -7828,16 +8730,19 @@ const PublicWarningsFormConnect = () => {
7828
8730
  formAction: publicWarningFormAction,
7829
8731
  isReadOnly: isReadOnly,
7830
8732
  error: publicWarningFormError,
7831
- onFormDirty: onFormDirty
8733
+ onFormDirty: onFormDirty,
8734
+ defaultBbox: defaultBbox
7832
8735
  });
7833
8736
  };
7834
8737
 
7835
- const warningFormConfirmationOptions = {
7836
- cancelLabel: 'Cancel',
7837
- title: 'Close public warning',
7838
- description: 'There are changes in the form, are you sure you want to close?',
7839
- confirmLabel: 'Close',
7840
- catchOnCancel: true
8738
+ const warningFormConfirmationOptions = t => {
8739
+ return {
8740
+ cancelLabel: t('close-dialog-cancel'),
8741
+ title: t('close-warning-dialog-title'),
8742
+ description: t('close-dialog-description'),
8743
+ confirmLabel: t('close-dialog-confirm'),
8744
+ catchOnCancel: true
8745
+ };
7841
8746
  };
7842
8747
  const isAlreadyEdited = (publicWarningEditor, username) => {
7843
8748
  return publicWarningEditor !== undefined && publicWarningEditor !== '' && publicWarningEditor !== null && publicWarningEditor !== username;
@@ -7845,7 +8750,8 @@ const isAlreadyEdited = (publicWarningEditor, username) => {
7845
8750
  const PublicWarningsFormDialogConnect = ({
7846
8751
  bounds,
7847
8752
  source: _source = 'app',
7848
- startPosition
8753
+ startPosition,
8754
+ defaultBbox
7849
8755
  }) => {
7850
8756
  const warningsApi = getWarningsApi();
7851
8757
  const {
@@ -7856,6 +8762,9 @@ const PublicWarningsFormDialogConnect = ({
7856
8762
  onCloseDialog,
7857
8763
  uiIsLoading
7858
8764
  } = useSetupDialog(publicWarningDialogType, _source);
8765
+ const {
8766
+ t
8767
+ } = useTranslation(WARN_NAMESPACE);
7859
8768
  const dispatch = useDispatch();
7860
8769
  const confirmDialog = useConfirmationDialog();
7861
8770
  const formAction = useSelector(store => getPublicWarningFormState(store));
@@ -7889,9 +8798,10 @@ const PublicWarningsFormDialogConnect = ({
7889
8798
  // We are taking over from another user, first confirm this is what they want
7890
8799
  if (!isReadOnly && isAlreadyEdited(latestEditor, username)) {
7891
8800
  yield confirmDialog({
7892
- title: 'Switch to edit mode',
7893
- description: 'This warning is already in edit mode by another user and important information could get lost in the switching process.',
7894
- confirmLabel: 'Edit mode'
8801
+ title: t('warning-edit-mode-title'),
8802
+ description: t('warning-edit-mode-description'),
8803
+ confirmLabel: t('warning-edit-mode-confirm'),
8804
+ cancelLabel: t('warning-dialog-cancel')
7895
8805
  });
7896
8806
  }
7897
8807
  dispatch(publicWarningFormActions.toggleEditorWarning({
@@ -7904,9 +8814,10 @@ const PublicWarningsFormDialogConnect = ({
7904
8814
  const onChangeFormMode = isReadOnly => {
7905
8815
  if (isReadOnly && isFormDirty) {
7906
8816
  confirmDialog({
7907
- title: 'Whoops',
7908
- description: 'Are you sure you want to switch to view mode? Your unsaved changes will be lost.',
7909
- confirmLabel: 'Switch mode'
8817
+ title: t('warning-view-mode-title'),
8818
+ description: t('warning-view-mode-description'),
8819
+ confirmLabel: t('warning-view-mode-confirm'),
8820
+ cancelLabel: t('warning-dialog-cancel')
7910
8821
  }).then(() => __awaiter(void 0, void 0, void 0, function* () {
7911
8822
  yield setIsEditor(isReadOnly);
7912
8823
  }));
@@ -7916,7 +8827,7 @@ const PublicWarningsFormDialogConnect = ({
7916
8827
  };
7917
8828
  const closeDialog = () => __awaiter(void 0, void 0, void 0, function* () {
7918
8829
  if (isFormDirty) {
7919
- const mayProceed = yield confirmDialog(warningFormConfirmationOptions).then(() => true).catch(() => false);
8830
+ const mayProceed = yield confirmDialog(warningFormConfirmationOptions(t)).then(() => true).catch(() => false);
7920
8831
  if (!mayProceed) {
7921
8832
  return;
7922
8833
  }
@@ -7943,27 +8854,23 @@ const PublicWarningsFormDialogConnect = ({
7943
8854
  onChangeFormMode: onChangeFormMode,
7944
8855
  shouldHideFormMode: shouldHideFormToggleMode,
7945
8856
  publicWarningEditor: publicWarningEditor
7946
- }, /*#__PURE__*/React__default.createElement(PublicWarningsFormConnect, null));
8857
+ }, /*#__PURE__*/React__default.createElement(PublicWarningsFormConnect, {
8858
+ defaultBbox: defaultBbox
8859
+ }));
7947
8860
  };
7948
8861
 
7949
8862
  const getStatus = status => {
7950
8863
  switch (status) {
7951
8864
  case 'DRAFT':
7952
- return 'Drafts';
8865
+ return outsideComponentTranslations['warning-list-status-draft'];
7953
8866
  case 'PUBLISHED':
7954
- return 'Published';
8867
+ return outsideComponentTranslations['warning-list-status-published'];
7955
8868
  case 'TODO':
7956
- return 'Reviews';
8869
+ return outsideComponentTranslations['warning-list-status-todo'];
7957
8870
  default:
7958
- return 'Expired (last 24 hours)';
8871
+ return outsideComponentTranslations['warning-list-status-expired'];
7959
8872
  }
7960
8873
  };
7961
- const CREATE_WARNING = 'Create a warning';
7962
- const BUTTON_EDIT = 'Edit';
7963
- const BUTTON_DELETE = 'Delete';
7964
- const BUTTON_USE = 'Use';
7965
- const BUTTON_IGNORE = 'Ignore';
7966
- const BUTTON_OPTIONS = 'Options';
7967
8874
  const sortWarningsOnStatus = warnings => {
7968
8875
  return warnings.reduce((allWarnings, warning) => {
7969
8876
  if (warning.status === 'DRAFT') {
@@ -8047,6 +8954,9 @@ const WarningsOnStatus = ({
8047
8954
  onDeleteWarning: _onDeleteWarning = () => {},
8048
8955
  onIgnoreWarning: _onIgnoreWarning = () => {}
8049
8956
  }) => {
8957
+ const {
8958
+ t
8959
+ } = useTranslation(WARN_NAMESPACE);
8050
8960
  const headerText = `${warnings.length} ${getStatus(status)}`;
8051
8961
  const onClickWarning = warning => () => _onSelectWarning(warning);
8052
8962
  const onClickEditWarning = warning => () => _onEditWarning(warning);
@@ -8058,22 +8968,22 @@ const WarningsOnStatus = ({
8058
8968
  const getMenuItems = warning => {
8059
8969
  if (status === 'DRAFT') {
8060
8970
  return [{
8061
- text: BUTTON_EDIT,
8971
+ text: t('object-manager-button-edit'),
8062
8972
  action: onClickEditWarning(warning),
8063
8973
  icon: /*#__PURE__*/React__default.createElement(Edit, null)
8064
8974
  }, {
8065
- text: BUTTON_DELETE,
8975
+ text: t('object-manager-button-delete'),
8066
8976
  action: onClickDeleteWarning(warning.id),
8067
8977
  icon: /*#__PURE__*/React__default.createElement(Delete, null)
8068
8978
  }];
8069
8979
  }
8070
8980
  if (status === 'TODO') {
8071
8981
  return [{
8072
- text: BUTTON_IGNORE,
8982
+ text: t('warning-list-button-ignore'),
8073
8983
  action: onClickIgnoreWarning(warning),
8074
8984
  icon: /*#__PURE__*/React__default.createElement(VisibilityOff, null)
8075
8985
  }, {
8076
- text: BUTTON_USE,
8986
+ text: t('warning-list-button-use'),
8077
8987
  action: onClickUseWarning(warning),
8078
8988
  icon: /*#__PURE__*/React__default.createElement(Success, null)
8079
8989
  }];
@@ -8093,8 +9003,8 @@ const WarningsOnStatus = ({
8093
9003
  "aria-label": `warninglist ${status}`
8094
9004
  }, warnings.map(warning => {
8095
9005
  var _a;
8096
- const phenomenonDetails = warningPhenomena.find(phenomenon => phenomenon.key === warning.warningDetail.phenomenon);
8097
- const levelDetails = levelOptions.find(level => level.key === warning.warningDetail.level);
9006
+ const phenomenonDetails = warningPhenomena(t).find(phenomenon => phenomenon.key === warning.warningDetail.phenomenon);
9007
+ const levelDetails = levelOptions(t).find(level => level.key === warning.warningDetail.level);
8098
9008
  return /*#__PURE__*/React__default.createElement(ListItem, {
8099
9009
  key: warning.id,
8100
9010
  sx: {
@@ -8109,10 +9019,10 @@ const WarningsOnStatus = ({
8109
9019
  containerType: 'inline-size'
8110
9020
  },
8111
9021
  secondaryAction: status !== 'EXPIRED' ? ( /*#__PURE__*/React__default.createElement(ToggleMenu, {
8112
- menuTitle: BUTTON_OPTIONS,
8113
- tooltipTitle: BUTTON_OPTIONS,
9022
+ menuTitle: t('warning-list-button-options'),
9023
+ tooltipTitle: t('warning-list-button-options'),
8114
9024
  menuPosition: "bottom",
8115
- "aria-label": BUTTON_OPTIONS,
9025
+ "aria-label": t('warning-list-button-options'),
8116
9026
  menuItems: getMenuItems(warning),
8117
9027
  buttonIcon: /*#__PURE__*/React__default.createElement(Options, null)
8118
9028
  })) : ( /*#__PURE__*/React__default.createElement(Box, {
@@ -8146,26 +9056,26 @@ const WarningsOnStatus = ({
8146
9056
  columnSpacing: 2,
8147
9057
  alignItems: "center"
8148
9058
  }, /*#__PURE__*/React__default.createElement(WarningListColumnContent, {
8149
- title: "Incident",
9059
+ title: t('warning-list-header-incident'),
8150
9060
  status: status,
8151
9061
  width: 142
8152
9062
  }), /*#__PURE__*/React__default.createElement(WarningListColumnContent, {
8153
- title: "Last update",
9063
+ title: t('warning-list-header-last-update'),
8154
9064
  status: status,
8155
9065
  width: 142
8156
9066
  }, warning.lastUpdatedTime && `${dateUtils.dateToString(dateUtils.utc(warning.lastUpdatedTime), DATE_FORMAT_FNS)} UTC`), /*#__PURE__*/React__default.createElement(WarningListColumnContent, {
8157
- title: "Start time",
9067
+ title: t('warning-list-header-start-time'),
8158
9068
  status: status,
8159
9069
  width: 142
8160
9070
  }, warning.warningDetail.validFrom && `${dateUtils.dateToString(dateUtils.utc(warning.warningDetail.validFrom), DATE_FORMAT_FNS)} UTC`), /*#__PURE__*/React__default.createElement(WarningListColumnContent, {
8161
- title: "End time",
9071
+ title: t('warning-list-header-end-time'),
8162
9072
  status: status,
8163
9073
  width: 142
8164
9074
  }, warning.warningDetail.validUntil && `${dateUtils.dateToString(dateUtils.utc(warning.warningDetail.validUntil), DATE_FORMAT_FNS)} UTC`), /*#__PURE__*/React__default.createElement(WarningListColumnContent, {
8165
- title: "Domain",
9075
+ title: t('warning-list-header-domain'),
8166
9076
  status: status
8167
9077
  }, warning.warningDetail.domain), /*#__PURE__*/React__default.createElement(WarningListColumnContent, {
8168
- title: "Phenomenon",
9078
+ title: t('warning-list-header-phenomenon'),
8169
9079
  status: status,
8170
9080
  width: 140,
8171
9081
  sx: {
@@ -8178,7 +9088,7 @@ const WarningsOnStatus = ({
8178
9088
  bottom: -6
8179
9089
  }
8180
9090
  }, phenomenonDetails === null || phenomenonDetails === void 0 ? void 0 : phenomenonDetails.icon)), /*#__PURE__*/React__default.createElement(WarningListColumnContent, {
8181
- title: "Level",
9091
+ title: t('warning-list-header-level'),
8182
9092
  status: status
8183
9093
  }, /*#__PURE__*/React__default.createElement(Box, {
8184
9094
  component: "span",
@@ -8216,7 +9126,7 @@ const WarningsOnStatus = ({
8216
9126
  },
8217
9127
  variant: "flat",
8218
9128
  startIcon: /*#__PURE__*/React__default.createElement(Edit, null)
8219
- }, "DRAFT"))) : ( /*#__PURE__*/React__default.createElement(StatusTag, {
9129
+ }, t('warning-list-header-draft')))) : ( /*#__PURE__*/React__default.createElement(StatusTag, {
8220
9130
  content: status.toLowerCase(),
8221
9131
  color: status === 'EXPIRED' ? 'grey' : 'green',
8222
9132
  sx: {
@@ -8238,6 +9148,9 @@ const PublicWarningList = ({
8238
9148
  onRefetchWarnings: _onRefetchWarnings = () => {},
8239
9149
  onIgnoreWarning: _onIgnoreWarning2 = () => {}
8240
9150
  }) => {
9151
+ const {
9152
+ t
9153
+ } = useTranslation(WARN_NAMESPACE);
8241
9154
  const sortedWarnings = warnings ? sortWarningsOnStatus(warnings) : null;
8242
9155
  return /*#__PURE__*/React__default.createElement(Box, {
8243
9156
  sx: {
@@ -8258,7 +9171,7 @@ const PublicWarningList = ({
8258
9171
  fontSize: '12px',
8259
9172
  height: '32px'
8260
9173
  }
8261
- }, CREATE_WARNING)), error && /*#__PURE__*/React__default.createElement(AlertBanner, {
9174
+ }, t('warning-list-button_create'))), error && /*#__PURE__*/React__default.createElement(AlertBanner, {
8262
9175
  title: error.message,
8263
9176
  shouldClose: true
8264
9177
  }), _isLoading && ( /*#__PURE__*/React__default.createElement(LinearProgress, {
@@ -8320,7 +9233,7 @@ var defineBuiltInAccessor$1 = function (target, name, descriptor) {
8320
9233
 
8321
9234
  var $ = _export;
8322
9235
  var DESCRIPTORS = descriptors;
8323
- var global$1 = global$j;
9236
+ var global$1 = global$i;
8324
9237
  var uncurryThis = functionUncurryThis;
8325
9238
  var hasOwn = hasOwnProperty_1;
8326
9239
  var isCallable = isCallable$i;
@@ -8410,7 +9323,6 @@ const isPublicWarningsLoading = createSelector(getPublicWarningsStore, store =>
8410
9323
  const getPublicWarningsError = createSelector(getPublicWarningsStore, store => store === null || store === void 0 ? void 0 : store.error);
8411
9324
  const getPublicWarningsLastUpdatedTime = createSelector(getPublicWarningsStore, store => store === null || store === void 0 ? void 0 : store.lastUpdatedTime);
8412
9325
 
8413
- const CANCEL = 'Go back';
8414
9326
  const ConfirmDeleteWarningDialog = ({
8415
9327
  onClose: _onClose = () => {},
8416
9328
  title,
@@ -8419,6 +9331,9 @@ const ConfirmDeleteWarningDialog = ({
8419
9331
  confirmLabel,
8420
9332
  callback
8421
9333
  }) => {
9334
+ const {
9335
+ t
9336
+ } = useTranslation(WARN_NAMESPACE);
8422
9337
  const [isLoading, setIsLoading] = React__default.useState(false);
8423
9338
  const [error, setError] = React__default.useState(undefined);
8424
9339
  const onSubmit = () => __awaiter(void 0, void 0, void 0, function* () {
@@ -8436,7 +9351,7 @@ const ConfirmDeleteWarningDialog = ({
8436
9351
  title: title,
8437
9352
  open: true,
8438
9353
  confirmLabel: confirmLabel,
8439
- cancelLabel: CANCEL,
9354
+ cancelLabel: t('warning-dialog-cancel'),
8440
9355
  description: !error ? description : '',
8441
9356
  onClose: _onClose,
8442
9357
  onSubmit: onSubmit,
@@ -8460,15 +9375,10 @@ const ConfirmDeleteWarningDialog = ({
8460
9375
  }));
8461
9376
  };
8462
9377
 
8463
- const DELETE_WARNING_SUCCESS_MESSAGE = `Warning has been deleted`;
8464
- const DELETE_TITLE = 'Delete warning';
8465
- const DELETE_CONFIRM = 'Delete';
8466
- const DELETE_DESCRIPTION = 'Are you sure you want to delete this warning?';
8467
- const IGNORE_WARNING_SUCCESS_MESSAGE = `Warning has been ignored`;
8468
- const IGNORE_TITLE = 'Ignore warning';
8469
- const IGNORE_CONFIRM = 'Ignore';
8470
- const IGNORE_DESCRIPTION = 'Are you sure you want to ignore this warning?';
8471
9378
  const PublicWarningListConnect = () => {
9379
+ const {
9380
+ t
9381
+ } = useTranslation(WARN_NAMESPACE);
8472
9382
  const dispatch = useDispatch();
8473
9383
  const confirmDialog = useConfirmationDialog();
8474
9384
  const [confirmDialogOptions, setConfirmDialogOptions] = React__default.useState(undefined);
@@ -8480,7 +9390,7 @@ const PublicWarningListConnect = () => {
8480
9390
  const lastUpdatedTime = useSelector(store => getPublicWarningsLastUpdatedTime(store));
8481
9391
  const openPublicWarningDialog = (formAction, publicWarning) => __awaiter(void 0, void 0, void 0, function* () {
8482
9392
  if (isFormDirty) {
8483
- const mayProceed = yield confirmDialog(warningFormConfirmationOptions).then(() => true).catch(() => false);
9393
+ const mayProceed = yield confirmDialog(warningFormConfirmationOptions(t)).then(() => true).catch(() => false);
8484
9394
  if (!mayProceed) {
8485
9395
  return;
8486
9396
  }
@@ -8508,11 +9418,11 @@ const PublicWarningListConnect = () => {
8508
9418
  const warningsApi = getWarningsApi();
8509
9419
  const deleteWarning = warningId => {
8510
9420
  setConfirmDialogOptions({
8511
- confirmLabel: DELETE_CONFIRM,
8512
- title: DELETE_TITLE,
8513
- description: DELETE_DESCRIPTION,
9421
+ confirmLabel: t('warning-dialog-delete-confirm'),
9422
+ title: t('warning-dialog-delete-title'),
9423
+ description: t('warning-dialog-delete-description'),
8514
9424
  request: () => warningsApi.deleteWarning(warningId),
8515
- callback: () => onRemoveSuccess(warningId, DELETE_WARNING_SUCCESS_MESSAGE)
9425
+ callback: () => onRemoveSuccess(warningId, t('warning-dialog-delete-succes'))
8516
9426
  });
8517
9427
  };
8518
9428
  const ignoreWarning = warning => {
@@ -8520,11 +9430,11 @@ const PublicWarningListConnect = () => {
8520
9430
  status: 'IGNORED'
8521
9431
  });
8522
9432
  setConfirmDialogOptions({
8523
- confirmLabel: IGNORE_CONFIRM,
8524
- title: IGNORE_TITLE,
8525
- description: IGNORE_DESCRIPTION,
9433
+ confirmLabel: t('warning-dialog-ignore-confirm'),
9434
+ title: t('warning-dialog-ignore-title'),
9435
+ description: t('warning-dialog-ignore-description'),
8526
9436
  request: () => warningsApi.updateWarning(ignoredWarning.id, ignoredWarning),
8527
- callback: () => onRemoveSuccess(ignoredWarning.id, IGNORE_WARNING_SUCCESS_MESSAGE)
9437
+ callback: () => onRemoveSuccess(ignoredWarning.id, t('warning-dialog-ignore-succes'))
8528
9438
  });
8529
9439
  };
8530
9440
  const onRemoveSuccess = (warningId, snackbarMessage) => {
@@ -8599,258 +9509,16 @@ const componentsLookUp = (payload, apiProps) => {
8599
9509
  switch (componentType) {
8600
9510
  case warningListViewPreset.componentType:
8601
9511
  if (apiProps && apiProps.config) {
8602
- return /*#__PURE__*/React.createElement(PublicWarningApiWrapper, Object.assign({}, apiProps, {
9512
+ return /*#__PURE__*/React.createElement(WarningsTranslationsWrapper, null, /*#__PURE__*/React.createElement(PublicWarningApiWrapper, Object.assign({}, apiProps, {
8603
9513
  "data-testid": "publicWarningModule"
8604
- }));
9514
+ })));
8605
9515
  }
8606
- return /*#__PURE__*/React.createElement(PublicWarningListConnect, {
9516
+ return /*#__PURE__*/React.createElement(WarningsTranslationsWrapper, null, /*#__PURE__*/React.createElement(PublicWarningListConnect, {
8607
9517
  "data-testid": "publicWarningList"
8608
- });
9518
+ }));
8609
9519
  default:
8610
9520
  return null;
8611
9521
  }
8612
9522
  };
8613
9523
 
8614
- const getSnackbarMessage = (objectName, id) => `Object ${objectName} has been ${id ? 'updated' : 'saved'}!`;
8615
- function* submitDrawValuesSaga({
8616
- payload
8617
- }) {
8618
- const {
8619
- id
8620
- } = payload,
8621
- formValues = __rest(payload, ["id"]);
8622
- try {
8623
- yield put(uiActions.toggleIsLoadingDialog({
8624
- isLoading: true,
8625
- type: drawingDialogType
8626
- }));
8627
- const warningsApi = yield call$c(getWarningsApi);
8628
- if (!id) {
8629
- const newID = yield call$c(warningsApi.saveDrawingAs, formValues);
8630
- yield put(drawActions.setDrawValues({
8631
- drawingInstanceId: drawingDialogType,
8632
- id: newID,
8633
- objectName: formValues.objectName
8634
- }));
8635
- } else {
8636
- yield call$c(warningsApi.updateDrawing, id, formValues);
8637
- }
8638
- yield put(uiActions.setErrorDialog({
8639
- type: drawingDialogType,
8640
- error: ''
8641
- }));
8642
- yield put(snackbarActions.openSnackbar({
8643
- message: getSnackbarMessage(formValues.objectName, id)
8644
- }));
8645
- yield put(uiActions.toggleIsLoadingDialog({
8646
- isLoading: false,
8647
- type: drawingDialogType
8648
- }));
8649
- } catch (error) {
8650
- yield put(uiActions.toggleIsLoadingDialog({
8651
- isLoading: false,
8652
- type: drawingDialogType
8653
- }));
8654
- const errorMessage = isAxiosError(error) ? getAxiosErrorMessage(error) : error.message;
8655
- yield put(uiActions.setErrorDialog({
8656
- type: drawingDialogType,
8657
- error: errorMessage
8658
- }));
8659
- }
8660
- }
8661
- function* drawingSaga() {
8662
- yield takeLatest(drawActions.submitDrawValues, submitDrawValuesSaga);
8663
- }
8664
-
8665
- const PUBLISH_SUCCES = 'Public warning has succesfully been published!';
8666
- const SAVE_SUCCES = 'Public warning has succesfully been saved!';
8667
- const getErrorMessage = error => isAxiosError$1(error) ? getAxiosErrorMessage(error) : error.message;
8668
- function* saveOrUpdateWarning(publicWarning) {
8669
- const warningsApi = yield call$c(getWarningsApi);
8670
- if (publicWarning.warningDetail.id) {
8671
- yield call$c(warningsApi.updateWarning, publicWarning.warningDetail.id, publicWarning);
8672
- return publicWarning;
8673
- }
8674
- const newWarningId = yield call$c(warningsApi.saveWarningAs, publicWarning);
8675
- return Object.assign(Object.assign({}, publicWarning), {
8676
- warningDetail: Object.assign(Object.assign({}, publicWarning.warningDetail), {
8677
- id: newWarningId
8678
- })
8679
- });
8680
- }
8681
- const getToggleEditorSuccessMessage = isEditor => `You are now ${isEditor ? '' : 'no longer '}the editor for this warning`;
8682
- function* toggleEditorWarningSaga({
8683
- payload
8684
- }) {
8685
- try {
8686
- const {
8687
- warningId,
8688
- isEditor,
8689
- username
8690
- } = payload;
8691
- const warningsApi = yield call$c(getWarningsApi);
8692
- yield call$c(warningsApi.toggleEditorWarning, warningId, isEditor);
8693
- // update list to show correct avatar
8694
- yield put(publicWarningActions.fetchWarnings());
8695
- yield put(publicWarningFormActions.toggleEditorWarningSuccess({
8696
- isEditor,
8697
- username,
8698
- message: getToggleEditorSuccessMessage(isEditor)
8699
- }));
8700
- } catch (error) {
8701
- yield call$c(errorSaga, getErrorMessage(error));
8702
- }
8703
- }
8704
- function* publishWarningSaga({
8705
- payload
8706
- }) {
8707
- try {
8708
- const {
8709
- publicWarning
8710
- } = payload;
8711
- const publishedWarning = yield call$c(saveOrUpdateWarning, publicWarning);
8712
- yield put(publicWarningFormActions.publishWarningSuccess({
8713
- publicWarning: publishedWarning,
8714
- message: PUBLISH_SUCCES
8715
- }));
8716
- yield put(uiActions.setToggleOpenDialog({
8717
- type: publicWarningDialogType,
8718
- setOpen: false
8719
- }));
8720
- } catch (error) {
8721
- yield call$c(errorSaga, getErrorMessage(error));
8722
- }
8723
- }
8724
- function* saveWarningSaga({
8725
- payload
8726
- }) {
8727
- try {
8728
- const {
8729
- publicWarning
8730
- } = payload;
8731
- const savedWarning = yield call$c(saveOrUpdateWarning, publicWarning);
8732
- yield put(publicWarningFormActions.saveWarningSuccess({
8733
- publicWarning: savedWarning,
8734
- message: SAVE_SUCCES
8735
- }));
8736
- } catch (error) {
8737
- yield call$c(errorSaga, getErrorMessage(error));
8738
- }
8739
- }
8740
- function* successSaga({
8741
- payload
8742
- }) {
8743
- const {
8744
- message
8745
- } = payload;
8746
- yield put(snackbarActions.openSnackbar({
8747
- message
8748
- }));
8749
- yield call$c(toggleDialogLoadingSaga, false);
8750
- }
8751
- function* errorSaga(message) {
8752
- yield put(publicWarningFormActions.setFormError({
8753
- message
8754
- }));
8755
- yield call$c(toggleDialogLoadingSaga, false);
8756
- }
8757
- function* toggleDialogLoadingSaga(isLoading) {
8758
- const isDialogOpen = yield select(uiSelectors.getDialogDetailsByType, publicWarningDialogType);
8759
- if (isDialogOpen) {
8760
- yield put(uiActions.toggleIsLoadingDialog({
8761
- isLoading,
8762
- type: publicWarningDialogType
8763
- }));
8764
- }
8765
- }
8766
- function* openDialogSaga() {
8767
- yield put(uiActions.setToggleOpenDialog({
8768
- setOpen: true,
8769
- type: publicWarningDialogType
8770
- }));
8771
- }
8772
- function* publicWarningRootSaga() {
8773
- // requests
8774
- yield takeLatest(publicWarningFormActions.toggleEditorWarning, toggleEditorWarningSaga);
8775
- yield takeLatest(publicWarningFormActions.publishWarning, publishWarningSaga);
8776
- yield takeLatest(publicWarningFormActions.saveWarning, saveWarningSaga);
8777
- // side effects ui/snackbar
8778
- yield takeLatest([publicWarningFormActions.publishWarningSuccess, publicWarningFormActions.saveWarningSuccess, publicWarningFormActions.toggleEditorWarningSuccess], successSaga);
8779
- yield takeLatest([publicWarningFormActions.publishWarning, publicWarningFormActions.saveWarning], toggleDialogLoadingSaga, true);
8780
- yield takeLatest(publicWarningFormActions.openPublicWarningFormDialog, openDialogSaga);
8781
- }
8782
-
8783
- /* *
8784
- * Licensed under the Apache License, Version 2.0 (the "License");
8785
- * you may not use this file except in compliance with the License.
8786
- * You may obtain a copy of the License at
8787
- *
8788
- * http://www.apache.org/licenses/LICENSE-2.0
8789
- *
8790
- * Unless required by applicable law or agreed to in writing, software
8791
- * distributed under the License is distributed on an "AS IS" BASIS,
8792
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8793
- * See the License for the specific language governing permissions and
8794
- * limitations under the License.
8795
- *
8796
- * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
8797
- * Copyright 2023 - Finnish Meteorological Institute (FMI)
8798
- * */
8799
- const getLastUpdatedTimeFormatted = () => dateUtils.dateToString(dateUtils.utc(), DATE_FORMAT_LASTUPDATEDTIME);
8800
- function* fetchWarningsSaga() {
8801
- try {
8802
- const warningsApi = yield call$c(getWarningsApi);
8803
- const {
8804
- data: warnings
8805
- } = yield call$c(warningsApi.getWarnings);
8806
- const lastUpdatedTime = getLastUpdatedTimeFormatted();
8807
- yield put(publicWarningActions.fetchWarningsSuccess({
8808
- warnings,
8809
- lastUpdatedTime
8810
- }));
8811
- yield delay(pollingIntervalTimeout);
8812
- yield put(publicWarningActions.fetchWarnings());
8813
- } catch (error) {
8814
- yield put(publicWarningActions.fetchWarningsError({
8815
- error: {
8816
- name: error.name,
8817
- message: error.message
8818
- }
8819
- }));
8820
- }
8821
- }
8822
- function* refetchWarnings() {
8823
- yield put(publicWarningActions.fetchWarnings());
8824
- }
8825
- function* publicWarnings() {
8826
- yield takeLatest(publicWarningActions.fetchWarnings, fetchWarningsSaga);
8827
- yield takeLatest([publicWarningFormActions.publishWarningSuccess, publicWarningFormActions.saveWarningSuccess], refetchWarnings);
8828
- }
8829
-
8830
- /* *
8831
- * Licensed under the Apache License, Version 2.0 (the "License");
8832
- * you may not use this file except in compliance with the License.
8833
- * You may obtain a copy of the License at
8834
- *
8835
- * http://www.apache.org/licenses/LICENSE-2.0
8836
- *
8837
- * Unless required by applicable law or agreed to in writing, software
8838
- * distributed under the License is distributed on an "AS IS" BASIS,
8839
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8840
- * See the License for the specific language governing permissions and
8841
- * limitations under the License.
8842
- *
8843
- * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
8844
- * Copyright 2023 - Finnish Meteorological Institute (FMI)
8845
- * */
8846
- const drawingModuleConfig = {
8847
- id: 'drawing-module',
8848
- reducersMap: {
8849
- drawings: reducer$2,
8850
- publicWarningForm: reducer,
8851
- publicWarnings: reducer$1
8852
- },
8853
- sagas: [drawingSaga, publicWarningRootSaga, publicWarnings]
8854
- };
8855
-
8856
- export { DIALOG_TITLE, DrawingToolConnect, Wrapper as DrawingToolForm, DrawingToolFormConnect, DrawingToolMapButtonConnect, ObjectManagerConnect, ObjectManagerMapButtonConnect, PublicWarningApiWrapper, PublicWarningsFormDialog, PublicWarningsFormDialogConnect, WarningsModuleProvider, componentsLookUp, drawingModuleConfig, isAlreadyEdited, useObjectDrawDialogAction, warningFormConfirmationOptions };
9524
+ export { DrawingToolConnect, Wrapper as DrawingToolForm, DrawingToolFormConnect, DrawingToolMapButtonConnect, ObjectManagerConnect, ObjectManagerMapButtonConnect, PublicWarningApiWrapper, PublicWarningsFormDialog, PublicWarningsFormDialogConnect, WarningsModuleProvider, componentsLookUp, drawingModuleConfig, isAlreadyEdited, useObjectDrawDialogAction, warningFormConfirmationOptions };