@opengeoweb/warnings 9.16.0 → 9.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.esm.js +247 -159
- package/package.json +1 -1
- package/src/lib/components/DrawingTool/DrawingTool.stories.d.ts +2 -2
- package/src/lib/components/ObjectManager/ObjectManager.stories.d.ts +7 -7
- package/src/lib/components/PublicWarningList/PublicWarningList.stories.d.ts +10 -2
- package/src/lib/components/PublicWarningsFormDialog/PublicWarningsFormDialog.stories.d.ts +18 -18
- package/src/lib/utils/constants.d.ts +0 -1
- package/src/lib/utils/i18n.d.ts +7 -0
- package/src/lib/storyshots/Storyshots.spec.d.ts +0 -1
package/index.esm.js
CHANGED
|
@@ -3,23 +3,23 @@ import React__default, { useState, useEffect, useRef } from 'react';
|
|
|
3
3
|
import { useDispatch, useSelector } from 'react-redux';
|
|
4
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
5
|
import { uiTypes, uiActions, getSingularDrawtoolDrawLayerId, drawtoolSelectors, layerSelectors, uiSelectors, mapStoreActions, drawtoolActions, layerActions, useSetupDialog } from '@opengeoweb/store';
|
|
6
|
-
import { emptyGeoJSON, MapControlButton, getIcon, rewindGeometry, getGeoJSONPropertyValue, currentlySupportedDrawModes, MapView, MapViewLayer, defaultLayers, getFeatureExtent } from '@opengeoweb/webmap-react';
|
|
6
|
+
import { defaultPolygon, emptyGeoJSON, MapControlButton, getIcon, rewindGeometry, getGeoJSONPropertyValue, currentlySupportedDrawModes, MapView, MapViewLayer, defaultLayers, getFeatureExtent } from '@opengeoweb/webmap-react';
|
|
7
7
|
import { handleOutsideComponentTranslations, useConfirmationDialog, ToggleMenu, dateUtils, calculateStartSize, ToolContainerDraggable, AlertBanner, ConfirmationDialog, getAxiosErrorMessage, usePrevious, CustomIconButton, CustomTooltip, Avatar, getInitials, SwitchButton, LastUpdateTime, StatusTag, ErrorBoundary, pollingIntervalTimeout, isAxiosError as isAxiosError$1 } from '@opengeoweb/shared';
|
|
8
|
-
import { useTranslation } from 'react-i18next';
|
|
9
8
|
import { createEntityAdapter, createSlice, createSelector, createListenerMiddleware, isAnyOf } from '@reduxjs/toolkit';
|
|
10
9
|
import 'i18next';
|
|
10
|
+
import { useTranslation } from 'react-i18next';
|
|
11
|
+
import { defaultBbox } from '@opengeoweb/core';
|
|
11
12
|
import { snackbarActions } from '@opengeoweb/snackbar';
|
|
12
13
|
import { styled, Box, Typography, ListItem, Grid, Paper, ListItemButton, Stack, LinearProgress, Button, FormHelperText, MenuItem, Tabs, Tab, FormControl, Card, CardContent, ListItemIcon, CircularProgress, List } from '@mui/material';
|
|
13
14
|
import { VariableSizeList } from 'react-window';
|
|
14
15
|
import AutoSizer from 'react-virtualized-auto-sizer';
|
|
15
|
-
import { DATE_FORMAT_FNS, ReactHookFormHiddenInput, isValidGeoJsonCoordinates, ReactHookFormSelect, ReactHookFormTextField, ReactHookFormProvider, defaultFormOptions, useDraftFormHelpers, errorMessages, ReactHookFormDateTime, isValidDate, isXHoursBefore, isXHoursAfter, isEmpty } from '@opengeoweb/form-fields';
|
|
16
16
|
import { getApi, createApiInstance, createNonAuthApiInstance, createFakeApiInstance, ApiProvider } from '@opengeoweb/api';
|
|
17
|
+
import { ReactHookFormHiddenInput, isValidGeoJsonCoordinates, ReactHookFormSelect, ReactHookFormTextField, ReactHookFormProvider, defaultFormOptions, useDraftFormHelpers, errorMessages, ReactHookFormDateTime, isXHoursBefore, isXHoursAfter, isEmpty } from '@opengeoweb/form-fields';
|
|
17
18
|
import { useFormContext } from 'react-hook-form';
|
|
18
19
|
import { isEqual, cloneDeep, clamp } from 'lodash';
|
|
19
20
|
import { useAuthenticationContext } from '@opengeoweb/authentication';
|
|
20
21
|
import { produce } from 'immer';
|
|
21
22
|
import { generateMapId, LayerType, getWMJSMapById, WMBBOX } from '@opengeoweb/webmap';
|
|
22
|
-
import { defaultBbox } from '@opengeoweb/core';
|
|
23
23
|
import { isAxiosError } from 'axios';
|
|
24
24
|
|
|
25
25
|
var en = {
|
|
@@ -124,6 +124,7 @@ var en = {
|
|
|
124
124
|
"warning-list-header-domain": "Domain",
|
|
125
125
|
"warning-list-header-phenomenon": "Phenomenon",
|
|
126
126
|
"warning-list-header-level": "Level",
|
|
127
|
+
"warning-list-header-status": "Status",
|
|
127
128
|
"warning-list-header-draft": "DRAFT"
|
|
128
129
|
};
|
|
129
130
|
var nl = {
|
|
@@ -228,6 +229,7 @@ var nl = {
|
|
|
228
229
|
"warning-list-header-domain": "Domein",
|
|
229
230
|
"warning-list-header-phenomenon": "Fenomeen",
|
|
230
231
|
"warning-list-header-level": "Hoogte",
|
|
232
|
+
"warning-list-header-status": "Status",
|
|
231
233
|
"warning-list-header-draft": "CONCEPT"
|
|
232
234
|
};
|
|
233
235
|
var fi = {
|
|
@@ -332,111 +334,113 @@ var fi = {
|
|
|
332
334
|
"warning-list-header-domain": "ei käännetty",
|
|
333
335
|
"warning-list-header-phenomenon": "ei käännetty",
|
|
334
336
|
"warning-list-header-level": "ei käännetty",
|
|
337
|
+
"warning-list-header-status": "ei käännetty",
|
|
335
338
|
"warning-list-header-draft": "ei käännetty"
|
|
336
339
|
};
|
|
337
340
|
var no = {
|
|
338
|
-
"drawing-tool-form-tools": "
|
|
339
|
-
"drawing-tool-form-opacity": "
|
|
340
|
-
"drawing-tool-form-object-name": "
|
|
341
|
-
"drawing-tool-form-save": "
|
|
342
|
-
"drawing-tool-form-update": "
|
|
343
|
-
"drawing-tool-form-exit-draw-mode": "
|
|
344
|
-
"drawing-tool-form-drawing-required": "
|
|
345
|
-
"close-dialog-cancel": "
|
|
346
|
-
"close-dialog-confirm": "
|
|
347
|
-
"close-draw-dialog-title": "
|
|
348
|
-
"close-dialog-description": "
|
|
349
|
-
"drawing-tool-title": "
|
|
350
|
-
"object-manager-title": "
|
|
351
|
-
"object-manager-add": "
|
|
352
|
-
"delete-dialog-cancel": "
|
|
353
|
-
"delete-dialog-confirm": "
|
|
354
|
-
"delete-dialog-title": "
|
|
355
|
-
"delete-dialog-description": "
|
|
356
|
-
"delete-succes": "
|
|
357
|
-
"update-succes": "
|
|
358
|
-
"save-succes": "
|
|
359
|
-
"object-manager-no-objects": "
|
|
360
|
-
"object-manager-options-menu": "
|
|
361
|
-
"object-manager-button-edit": "
|
|
362
|
-
"object-manager-button-share": "
|
|
363
|
-
"object-manager-button-delete": "
|
|
364
|
-
"object-manager-button-view": "
|
|
365
|
-
"object-manager-no-object-selected": "
|
|
366
|
-
"object-manager-object-selected": "
|
|
367
|
-
"object-manager-share-menu": "
|
|
368
|
-
"public-warning-title": "
|
|
369
|
-
"close-warning-dialog-title": "
|
|
370
|
-
"warning-edit-mode-title": "
|
|
371
|
-
"warning-edit-mode-description": "
|
|
372
|
-
"warning-dialog-cancel": "
|
|
373
|
-
"warning-edit-mode-confirm": "
|
|
374
|
-
"warning-view-mode-title": "
|
|
375
|
-
"warning-view-mode-description": "
|
|
376
|
-
"warning-view-mode-confirm": "
|
|
377
|
-
"warning-probability": "
|
|
378
|
-
"warning-button-clear": "
|
|
379
|
-
"warning-button-save": "
|
|
380
|
-
"warning-button-saving": "
|
|
381
|
-
"warning-button-publish": "
|
|
382
|
-
"warning-button-publishing": "
|
|
383
|
-
"warning-area": "
|
|
384
|
-
"warning-button-add-object": "
|
|
385
|
-
"warning-description-original": "
|
|
386
|
-
"warning-description-translation": "
|
|
387
|
-
"warning-description-NL": "
|
|
388
|
-
"warning-level": "
|
|
389
|
-
"warning-level-moderate": "
|
|
390
|
-
"warning-level-severe": "
|
|
391
|
-
"warning-level-extreme": "
|
|
392
|
-
"warning-phenomenon": "
|
|
393
|
-
"warning-phenomenon-wind": "
|
|
394
|
-
"warning-phenomenon-fog": "
|
|
395
|
-
"warning-phenomenon-thunderstorm": "
|
|
396
|
-
"warning-phenomenon-snow-ice": "
|
|
397
|
-
"warning-phenomenon-rain": "
|
|
398
|
-
"warning-phenomenon-high-temp": "
|
|
399
|
-
"warning-phenomenon-low-temp": "
|
|
400
|
-
"warning-phenomenon-funnel-cloud": "
|
|
401
|
-
"warning-phenomenon-coastal-event": "
|
|
402
|
-
"warning-probability-moderate-level-invalid": "
|
|
403
|
-
"warning-valid-from": "
|
|
404
|
-
"warning-valid-until": "
|
|
405
|
-
"warning-valid-from-error-before-current": "ikke
|
|
406
|
-
"warning-valid-from-error-max-hours": "ikke
|
|
407
|
-
"warning-valid-until-error-before-current": "ikke
|
|
408
|
-
"warning-valid-until-error-max-hours": "ikke
|
|
409
|
-
"warning-valid-until-error-min-hours": "
|
|
410
|
-
"warning-dialog-delete-succes": "
|
|
411
|
-
"warning-dialog-delete-title": "
|
|
412
|
-
"warning-dialog-delete-confirm": "
|
|
413
|
-
"warning-dialog-delete-description": "
|
|
414
|
-
"warning-dialog-ignore-succes": "
|
|
415
|
-
"warning-dialog-ignore-title": "
|
|
416
|
-
"warning-dialog-ignore-confirm": "
|
|
417
|
-
"warning-dialog-ignore-description": "
|
|
418
|
-
"warning-save-succes": "
|
|
419
|
-
"warning-publish-succes": "
|
|
420
|
-
"warning-editor-user-viewer": "
|
|
421
|
-
"warning-editor-user-editor": "
|
|
422
|
-
"warning-editor-add-editor": "
|
|
423
|
-
"warning-editor-remove-editor": "ikke
|
|
424
|
-
"warning-list-button_create": "
|
|
425
|
-
"warning-list-button-use": "
|
|
426
|
-
"warning-list-button-ignore": "
|
|
427
|
-
"warning-list-button-options": "
|
|
428
|
-
"warning-list-status-draft": "
|
|
429
|
-
"warning-list-status-published": "
|
|
430
|
-
"warning-list-status-todo": "
|
|
431
|
-
"warning-list-status-expired": "
|
|
432
|
-
"warning-list-header-incident": "
|
|
433
|
-
"warning-list-header-last-update": "
|
|
434
|
-
"warning-list-header-start-time": "
|
|
435
|
-
"warning-list-header-end-time": "
|
|
436
|
-
"warning-list-header-domain": "
|
|
437
|
-
"warning-list-header-phenomenon": "
|
|
438
|
-
"warning-list-header-level": "
|
|
439
|
-
"warning-list-header-
|
|
341
|
+
"drawing-tool-form-tools": "Verktøy",
|
|
342
|
+
"drawing-tool-form-opacity": "Gjennomsiktighet",
|
|
343
|
+
"drawing-tool-form-object-name": "Objektnavn",
|
|
344
|
+
"drawing-tool-form-save": "Lagre nytt objekt",
|
|
345
|
+
"drawing-tool-form-update": "Oppdater objekt",
|
|
346
|
+
"drawing-tool-form-exit-draw-mode": "Trykk ESC for å avslutte tegnemodus",
|
|
347
|
+
"drawing-tool-form-drawing-required": "Objekttegning kreves",
|
|
348
|
+
"close-dialog-cancel": "Avbryt",
|
|
349
|
+
"close-dialog-confirm": "Lukk",
|
|
350
|
+
"close-draw-dialog-title": "Lukk tegneverktøy",
|
|
351
|
+
"close-dialog-description": "Du har gjort endringer, er du sikker på at du vil lukke?",
|
|
352
|
+
"drawing-tool-title": "Tegneverktøy",
|
|
353
|
+
"object-manager-title": "Objektmanager for",
|
|
354
|
+
"object-manager-add": "Legg til nytt objekt",
|
|
355
|
+
"delete-dialog-cancel": "Avbryt",
|
|
356
|
+
"delete-dialog-confirm": "Slett",
|
|
357
|
+
"delete-dialog-title": "Slett objekt",
|
|
358
|
+
"delete-dialog-description": "Er du sikker på at du vil slette?",
|
|
359
|
+
"delete-succes": "er slettet",
|
|
360
|
+
"update-succes": "er oppdatert",
|
|
361
|
+
"save-succes": "er lagret",
|
|
362
|
+
"object-manager-no-objects": "Fant ingen objekter",
|
|
363
|
+
"object-manager-options-menu": "Objektvalg",
|
|
364
|
+
"object-manager-button-edit": "Endre",
|
|
365
|
+
"object-manager-button-share": "Del",
|
|
366
|
+
"object-manager-button-delete": "Slett",
|
|
367
|
+
"object-manager-button-view": "Vis",
|
|
368
|
+
"object-manager-no-object-selected": "(ingen objekt er valgt)",
|
|
369
|
+
"object-manager-object-selected": "objekt er valgt",
|
|
370
|
+
"object-manager-share-menu": "Del objekt med",
|
|
371
|
+
"public-warning-title": "Farevarsel",
|
|
372
|
+
"close-warning-dialog-title": "Lukk farevarsel",
|
|
373
|
+
"warning-edit-mode-title": "Bytt til editeringsmodus",
|
|
374
|
+
"warning-edit-mode-description": "Dette varselet er allerede under endring av en annen bruker. Viktig informasjon kan gå tapt ved å bytte",
|
|
375
|
+
"warning-dialog-cancel": "Gå tilbake",
|
|
376
|
+
"warning-edit-mode-confirm": "Editeringsmodus",
|
|
377
|
+
"warning-view-mode-title": "Whoops",
|
|
378
|
+
"warning-view-mode-description": "Er du sikker på at du vil endre til visningsmodus? Ulagret endringer vil gå tapt.",
|
|
379
|
+
"warning-view-mode-confirm": "Bytt modus",
|
|
380
|
+
"warning-probability": "Sannsynlighet",
|
|
381
|
+
"warning-button-clear": "Slett",
|
|
382
|
+
"warning-button-save": "Lagre",
|
|
383
|
+
"warning-button-saving": "Lagrer",
|
|
384
|
+
"warning-button-publish": "Publiser",
|
|
385
|
+
"warning-button-publishing": "Publiserer",
|
|
386
|
+
"warning-area": "Område",
|
|
387
|
+
"warning-button-add-object": "Legg til objekt",
|
|
388
|
+
"warning-description-original": "Original beskrivelse",
|
|
389
|
+
"warning-description-translation": "Oversatt beskrivelse",
|
|
390
|
+
"warning-description-NL": "Nederlandsk (valgt)",
|
|
391
|
+
"warning-level": "Grad",
|
|
392
|
+
"warning-level-moderate": "Moderat",
|
|
393
|
+
"warning-level-severe": "Stor",
|
|
394
|
+
"warning-level-extreme": "Ekstrem",
|
|
395
|
+
"warning-phenomenon": "Fenomen",
|
|
396
|
+
"warning-phenomenon-wind": "Vind",
|
|
397
|
+
"warning-phenomenon-fog": "Tåke",
|
|
398
|
+
"warning-phenomenon-thunderstorm": "Tordenvær",
|
|
399
|
+
"warning-phenomenon-snow-ice": "Snø/is",
|
|
400
|
+
"warning-phenomenon-rain": "Regn",
|
|
401
|
+
"warning-phenomenon-high-temp": "Høy temperatur",
|
|
402
|
+
"warning-phenomenon-low-temp": "Lav temperatur",
|
|
403
|
+
"warning-phenomenon-funnel-cloud": "Tornado",
|
|
404
|
+
"warning-phenomenon-coastal-event": "Kysthendelse",
|
|
405
|
+
"warning-probability-moderate-level-invalid": "Sannsynlighet bør være minst 30% når level er moderat",
|
|
406
|
+
"warning-valid-from": "Gyldig fra",
|
|
407
|
+
"warning-valid-until": "Gyldig til",
|
|
408
|
+
"warning-valid-from-error-before-current": "Gyldig fra kan ikke være før nåtid",
|
|
409
|
+
"warning-valid-from-error-max-hours": "Gyldig fra kan ikke være mer enn {{MAX_HOURS}} timer etter nåtid",
|
|
410
|
+
"warning-valid-until-error-before-current": "Gyldig til kan ikke være før nåtid",
|
|
411
|
+
"warning-valid-until-error-max-hours": "Gyldig til kan ikke være mer enn {{MAX_HOURS}} timer etter nåtid",
|
|
412
|
+
"warning-valid-until-error-min-hours": "Gyldig til må være minst {{MIN_HOURS}} timer etter Gyldig fra",
|
|
413
|
+
"warning-dialog-delete-succes": "Varselet er slettet",
|
|
414
|
+
"warning-dialog-delete-title": "Slett varsel",
|
|
415
|
+
"warning-dialog-delete-confirm": "Slett",
|
|
416
|
+
"warning-dialog-delete-description": "Er du sikker på at du vil slette varselet?",
|
|
417
|
+
"warning-dialog-ignore-succes": "Varselet er blitt ignorert",
|
|
418
|
+
"warning-dialog-ignore-title": "Ignorer varselet",
|
|
419
|
+
"warning-dialog-ignore-confirm": "Ignorer",
|
|
420
|
+
"warning-dialog-ignore-description": "Er du sikker på at du vil ignorere dette varselet?",
|
|
421
|
+
"warning-save-succes": "Farevarselet er lagret!",
|
|
422
|
+
"warning-publish-succes": "Farevarselet er publisert!",
|
|
423
|
+
"warning-editor-user-viewer": "Visningsmodus",
|
|
424
|
+
"warning-editor-user-editor": "Editeringsmodus",
|
|
425
|
+
"warning-editor-add-editor": "Du editerer nå dette varselet",
|
|
426
|
+
"warning-editor-remove-editor": "Du editerer ikke lenger dette varselet",
|
|
427
|
+
"warning-list-button_create": "Lag et farevarsel",
|
|
428
|
+
"warning-list-button-use": "Bruk",
|
|
429
|
+
"warning-list-button-ignore": "Ignorer",
|
|
430
|
+
"warning-list-button-options": "Valg",
|
|
431
|
+
"warning-list-status-draft": "Utkast",
|
|
432
|
+
"warning-list-status-published": "Publisert",
|
|
433
|
+
"warning-list-status-todo": "Til sjekk",
|
|
434
|
+
"warning-list-status-expired": "Utgått (siste 24 timer)",
|
|
435
|
+
"warning-list-header-incident": "Hendelse",
|
|
436
|
+
"warning-list-header-last-update": "Sist oppdatert",
|
|
437
|
+
"warning-list-header-start-time": "Starttid",
|
|
438
|
+
"warning-list-header-end-time": "Sluttid",
|
|
439
|
+
"warning-list-header-domain": "Domene",
|
|
440
|
+
"warning-list-header-phenomenon": "Fenomen",
|
|
441
|
+
"warning-list-header-level": "Level",
|
|
442
|
+
"warning-list-header-status": "Status",
|
|
443
|
+
"warning-list-header-draft": "UTKAST"
|
|
440
444
|
};
|
|
441
445
|
var warningsTranslations = {
|
|
442
446
|
en: en,
|
|
@@ -647,6 +651,7 @@ const getWarningFormDirty = createSelector(selectDrawByInstanceId, drawing => (d
|
|
|
647
651
|
* */
|
|
648
652
|
const WARN_NAMESPACE = 'warn';
|
|
649
653
|
const outsideComponentTranslations = handleOutsideComponentTranslations(warningsTranslations, WARN_NAMESPACE);
|
|
654
|
+
const useWarningsTranslation = () => useTranslation(WARN_NAMESPACE);
|
|
650
655
|
|
|
651
656
|
/* *
|
|
652
657
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -679,7 +684,7 @@ const useCloseDrawDialog = ({
|
|
|
679
684
|
}) => {
|
|
680
685
|
const {
|
|
681
686
|
t
|
|
682
|
-
} =
|
|
687
|
+
} = useWarningsTranslation();
|
|
683
688
|
const dispatch = useDispatch();
|
|
684
689
|
const drawLayerId = getSingularDrawtoolDrawLayerId(mapId);
|
|
685
690
|
const drawDialogActiveDrawModeId = useSelector(store => drawtoolSelectors.getActiveDrawModeId(store, drawingDialogType));
|
|
@@ -793,7 +798,7 @@ const useObjectDrawDialogAction = ({
|
|
|
793
798
|
}) => {
|
|
794
799
|
const {
|
|
795
800
|
t
|
|
796
|
-
} =
|
|
801
|
+
} = useWarningsTranslation();
|
|
797
802
|
const dispatch = useDispatch();
|
|
798
803
|
const confirmDialog = useConfirmationDialog();
|
|
799
804
|
const currentDrawLayerId = getSingularDrawtoolDrawLayerId(mapId);
|
|
@@ -872,6 +877,13 @@ const useObjectDrawDialogAction = ({
|
|
|
872
877
|
drawToolId: drawingDialogType,
|
|
873
878
|
geoJSONLayerId: currentDrawLayerId
|
|
874
879
|
}));
|
|
880
|
+
// activate default draw mode
|
|
881
|
+
if (!drawDialogActiveDrawModeId && !isDrawDialogOpen) {
|
|
882
|
+
dispatch(drawtoolActions.changeDrawToolMode({
|
|
883
|
+
drawToolId: drawingDialogType,
|
|
884
|
+
drawModeId: defaultPolygon.drawModeId
|
|
885
|
+
}));
|
|
886
|
+
}
|
|
875
887
|
// move shape to screen
|
|
876
888
|
if (isDrawDialogOpen && drawDialogLayerHasGeoJSON) {
|
|
877
889
|
// update new shape
|
|
@@ -2682,7 +2694,6 @@ $$5({ target: 'Array', proto: true, arity: 1, forced: FORCED$3 }, {
|
|
|
2682
2694
|
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
2683
2695
|
* */
|
|
2684
2696
|
const DATE_FORMAT_HEADER = 'EEEE, MMMM dd';
|
|
2685
|
-
const DATE_FORMAT_LASTUPDATEDTIME = 'HH:mm';
|
|
2686
2697
|
|
|
2687
2698
|
const DEFAULT_ADD_BUTTON_HEIGHT = 80;
|
|
2688
2699
|
const OBJECT_ITEM_SIZE = 50;
|
|
@@ -2760,7 +2771,7 @@ const Objects = ({
|
|
|
2760
2771
|
}) => {
|
|
2761
2772
|
const {
|
|
2762
2773
|
t
|
|
2763
|
-
} =
|
|
2774
|
+
} = useWarningsTranslation();
|
|
2764
2775
|
const listRef = React__default.useRef(null);
|
|
2765
2776
|
const {
|
|
2766
2777
|
listInclHeaders,
|
|
@@ -2927,7 +2938,7 @@ const Objects = ({
|
|
|
2927
2938
|
maxHeight: '32px',
|
|
2928
2939
|
overflow: 'hidden'
|
|
2929
2940
|
}
|
|
2930
|
-
}, object.scope === 'global' && 'Global: ', `${dateUtils.dateToString(dateUtils.utc(object.lastUpdatedTime),
|
|
2941
|
+
}, object.scope === 'global' && 'Global: ', `${dateUtils.dateToString(dateUtils.utc(object.lastUpdatedTime), dateUtils.DATE_FORMAT_DATEPICKER)} UTC`))))));
|
|
2931
2942
|
})))));
|
|
2932
2943
|
};
|
|
2933
2944
|
|
|
@@ -2967,7 +2978,7 @@ const ObjectManager = ({
|
|
|
2967
2978
|
}) => {
|
|
2968
2979
|
const {
|
|
2969
2980
|
t
|
|
2970
|
-
} =
|
|
2981
|
+
} = useWarningsTranslation();
|
|
2971
2982
|
const minSize = DEFAULT_OBJECT_MANAGER_MIN_SIZE;
|
|
2972
2983
|
const startSizeCalc = calculateStartSize(minSize, _size, _startPosition);
|
|
2973
2984
|
const [sizeInState, setSizeInState] = React.useState(startSizeCalc);
|
|
@@ -3125,7 +3136,7 @@ const ConfirmDeleteDialog = ({
|
|
|
3125
3136
|
}) => {
|
|
3126
3137
|
const {
|
|
3127
3138
|
t
|
|
3128
|
-
} =
|
|
3139
|
+
} = useWarningsTranslation();
|
|
3129
3140
|
const warningsApi = getWarningsApi();
|
|
3130
3141
|
const [isLoading, setIsLoading] = React__default.useState(false);
|
|
3131
3142
|
const [error, setError] = React__default.useState(undefined);
|
|
@@ -3404,7 +3415,7 @@ const ObjectManagerConnect = ({
|
|
|
3404
3415
|
}) => {
|
|
3405
3416
|
const {
|
|
3406
3417
|
t
|
|
3407
|
-
} =
|
|
3418
|
+
} = useWarningsTranslation();
|
|
3408
3419
|
const {
|
|
3409
3420
|
dialogOrder,
|
|
3410
3421
|
setDialogOrder,
|
|
@@ -5895,7 +5906,7 @@ const DrawingToolMapButtonConnect = ({
|
|
|
5895
5906
|
}) => {
|
|
5896
5907
|
const {
|
|
5897
5908
|
t
|
|
5898
|
-
} =
|
|
5909
|
+
} = useWarningsTranslation();
|
|
5899
5910
|
// const drawingDialogType = isMultiMap
|
|
5900
5911
|
// ? `${uiTypes.DialogTypes.DrawingTool}-${mapId}`
|
|
5901
5912
|
// : uiTypes.DialogTypes.DrawingTool;
|
|
@@ -5950,7 +5961,7 @@ const DrawingTool = ({
|
|
|
5950
5961
|
}) => {
|
|
5951
5962
|
const {
|
|
5952
5963
|
t
|
|
5953
|
-
} =
|
|
5964
|
+
} = useWarningsTranslation();
|
|
5954
5965
|
const minSize = DEFAULT_DRAW_TOOL_MIN_SIZE;
|
|
5955
5966
|
const startSizeCalc = calculateStartSize(minSize, _size, _startPosition);
|
|
5956
5967
|
const [sizeInState, setSizeInState] = React.useState(startSizeCalc);
|
|
@@ -6151,7 +6162,7 @@ const DrawingToolFormContentsNoMemo = ({
|
|
|
6151
6162
|
}) => {
|
|
6152
6163
|
const {
|
|
6153
6164
|
t
|
|
6154
|
-
} =
|
|
6165
|
+
} = useWarningsTranslation();
|
|
6155
6166
|
const hasErrors = Object.keys(errors).length > 0;
|
|
6156
6167
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Box, {
|
|
6157
6168
|
sx: {
|
|
@@ -6273,7 +6284,7 @@ const DrawingToolFormContentsNoMemo = ({
|
|
|
6273
6284
|
};
|
|
6274
6285
|
const DrawingToolFormContents = /*#__PURE__*/React__default.memo(DrawingToolFormContentsNoMemo, isEqual);
|
|
6275
6286
|
|
|
6276
|
-
const getObjectName$1 = objectName => objectName || `${dateUtils.dateToString(new Date(),
|
|
6287
|
+
const getObjectName$1 = objectName => objectName || `${dateUtils.dateToString(new Date(), dateUtils.DATE_FORMAT_DATEPICKER, true)} UTC`;
|
|
6277
6288
|
const DrawingToolForm = ({
|
|
6278
6289
|
onSubmitForm,
|
|
6279
6290
|
isLoading: _isLoading = false,
|
|
@@ -6313,7 +6324,7 @@ const DrawingToolForm = ({
|
|
|
6313
6324
|
}
|
|
6314
6325
|
});
|
|
6315
6326
|
React.useEffect(() => {
|
|
6316
|
-
if (_activeDrawModeId) {
|
|
6327
|
+
if (_activeDrawModeId || _activeDrawModeId === '') {
|
|
6317
6328
|
setValue('geoJSON', geoJSON, {
|
|
6318
6329
|
shouldDirty: true
|
|
6319
6330
|
});
|
|
@@ -6525,7 +6536,7 @@ const DrawingToolConnect = ({
|
|
|
6525
6536
|
}) => {
|
|
6526
6537
|
const {
|
|
6527
6538
|
t
|
|
6528
|
-
} =
|
|
6539
|
+
} = useWarningsTranslation();
|
|
6529
6540
|
const dialogType = getDialogType(initialMapId, _isMultiMap);
|
|
6530
6541
|
const activeMapId = useSelector(store => uiSelectors.getDialogMapId(store, dialogType));
|
|
6531
6542
|
// In case of a multimap, use the map id that is passed
|
|
@@ -6629,7 +6640,7 @@ const PublicWarningsFormDialog = ({
|
|
|
6629
6640
|
}) => {
|
|
6630
6641
|
const {
|
|
6631
6642
|
t
|
|
6632
|
-
} =
|
|
6643
|
+
} = useWarningsTranslation();
|
|
6633
6644
|
const minSize = DEFAULT_WARNING_DIALOG_MIN_SIZE;
|
|
6634
6645
|
const startSizeCalc = calculateStartSize(minSize, _size, _startPosition);
|
|
6635
6646
|
const [sizeInState, setSizeInState] = React.useState(startSizeCalc);
|
|
@@ -7366,7 +7377,7 @@ const tabStyle = {
|
|
|
7366
7377
|
const CustomTabPanel = props => {
|
|
7367
7378
|
const {
|
|
7368
7379
|
t
|
|
7369
|
-
} =
|
|
7380
|
+
} = useWarningsTranslation();
|
|
7370
7381
|
const {
|
|
7371
7382
|
children,
|
|
7372
7383
|
value,
|
|
@@ -7417,7 +7428,7 @@ const DescriptionField = ({
|
|
|
7417
7428
|
}) => {
|
|
7418
7429
|
const {
|
|
7419
7430
|
t
|
|
7420
|
-
} =
|
|
7431
|
+
} = useWarningsTranslation();
|
|
7421
7432
|
const {
|
|
7422
7433
|
isRequired
|
|
7423
7434
|
} = useDraftFormHelpers();
|
|
@@ -7497,7 +7508,7 @@ const DescriptionField = ({
|
|
|
7497
7508
|
})));
|
|
7498
7509
|
};
|
|
7499
7510
|
|
|
7500
|
-
const formatDate = lastUpdatedTime => dateUtils.dateToString(dateUtils.isoStringToDate(lastUpdatedTime), `${
|
|
7511
|
+
const formatDate = lastUpdatedTime => dateUtils.dateToString(dateUtils.isoStringToDate(lastUpdatedTime, false), `${dateUtils.DATE_FORMAT_DATEPICKER} 'UTC'`);
|
|
7501
7512
|
const getObjectName = (geoJSON, objectName, t) => {
|
|
7502
7513
|
if (geoJSON) {
|
|
7503
7514
|
return objectName || t('object-manager-object-selected');
|
|
@@ -7513,7 +7524,7 @@ const AreaField = ({
|
|
|
7513
7524
|
}) => {
|
|
7514
7525
|
const {
|
|
7515
7526
|
t
|
|
7516
|
-
} =
|
|
7527
|
+
} = useWarningsTranslation();
|
|
7517
7528
|
const {
|
|
7518
7529
|
getValues,
|
|
7519
7530
|
formState: {
|
|
@@ -7671,7 +7682,7 @@ const Phenomenon = ({
|
|
|
7671
7682
|
}) => {
|
|
7672
7683
|
const {
|
|
7673
7684
|
t
|
|
7674
|
-
} =
|
|
7685
|
+
} = useWarningsTranslation();
|
|
7675
7686
|
const {
|
|
7676
7687
|
isRequired
|
|
7677
7688
|
} = useDraftFormHelpers();
|
|
@@ -7736,7 +7747,7 @@ const LevelField = ({
|
|
|
7736
7747
|
}) => {
|
|
7737
7748
|
const {
|
|
7738
7749
|
t
|
|
7739
|
-
} =
|
|
7750
|
+
} = useWarningsTranslation();
|
|
7740
7751
|
const {
|
|
7741
7752
|
isRequired
|
|
7742
7753
|
} = useDraftFormHelpers();
|
|
@@ -7809,7 +7820,9 @@ const LevelField = ({
|
|
|
7809
7820
|
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
7810
7821
|
* */
|
|
7811
7822
|
const VALID_FROM_MAX_HOURS_AFTER_CURRENT = 168;
|
|
7812
|
-
const isValueBeforeCurrentTime$1 = (value, t) =>
|
|
7823
|
+
const isValueBeforeCurrentTime$1 = (value, t) => {
|
|
7824
|
+
return isXHoursBefore(value, dateUtils.getCurrentTimeAsString(), 0) || t('warning-valid-from-error-before-current');
|
|
7825
|
+
};
|
|
7813
7826
|
const isMaxHoursAfterCurrentTime$1 = (value, t) => isXHoursAfter(value, dateUtils.getCurrentTimeAsString(), VALID_FROM_MAX_HOURS_AFTER_CURRENT) || t('warning-valid-from-error-max-hours', {
|
|
7814
7827
|
ns: WARN_NAMESPACE,
|
|
7815
7828
|
MAX_HOURS: VALID_FROM_MAX_HOURS_AFTER_CURRENT
|
|
@@ -7820,7 +7833,7 @@ const ValidFrom = ({
|
|
|
7820
7833
|
}) => {
|
|
7821
7834
|
const {
|
|
7822
7835
|
t
|
|
7823
|
-
} =
|
|
7836
|
+
} = useWarningsTranslation();
|
|
7824
7837
|
const {
|
|
7825
7838
|
isRequired
|
|
7826
7839
|
} = useDraftFormHelpers();
|
|
@@ -7835,7 +7848,7 @@ const ValidFrom = ({
|
|
|
7835
7848
|
rules: {
|
|
7836
7849
|
validate: {
|
|
7837
7850
|
isRequired,
|
|
7838
|
-
isValidDate,
|
|
7851
|
+
isValidDate: dateUtils.isValidIsoDateString,
|
|
7839
7852
|
// The valid from time cannot be before the current time
|
|
7840
7853
|
isValueBeforeCurrentTime: value => isValueBeforeCurrentTime$1(value, t),
|
|
7841
7854
|
// Valid from can be no more than X hours after current time
|
|
@@ -7874,7 +7887,7 @@ const isMaxHoursAfterCurrentTime = (value, t) => isXHoursAfter(value, dateUtils.
|
|
|
7874
7887
|
MAX_HOURS: VALID_UNTIL_MAX_HOURS_AFTER_CURRENT
|
|
7875
7888
|
});
|
|
7876
7889
|
const isMinHoursAfterValidFrom = (value, validFromValue, t) => {
|
|
7877
|
-
if (isEmpty(value) || isEmpty(validFromValue) || !
|
|
7890
|
+
if (isEmpty(value) || isEmpty(validFromValue) || !dateUtils.isValidIsoDateString(validFromValue)) {
|
|
7878
7891
|
return true;
|
|
7879
7892
|
}
|
|
7880
7893
|
const duration = dateUtils.differenceInHours(new Date(value), new Date(validFromValue));
|
|
@@ -7889,7 +7902,7 @@ const ValidUntil = ({
|
|
|
7889
7902
|
}) => {
|
|
7890
7903
|
const {
|
|
7891
7904
|
t
|
|
7892
|
-
} =
|
|
7905
|
+
} = useWarningsTranslation();
|
|
7893
7906
|
const {
|
|
7894
7907
|
isRequired
|
|
7895
7908
|
} = useDraftFormHelpers();
|
|
@@ -7905,7 +7918,7 @@ const ValidUntil = ({
|
|
|
7905
7918
|
rules: {
|
|
7906
7919
|
validate: {
|
|
7907
7920
|
isRequired,
|
|
7908
|
-
isValidDate,
|
|
7921
|
+
isValidDate: dateUtils.isValidIsoDateString,
|
|
7909
7922
|
// The valid until time cannot be before the current time
|
|
7910
7923
|
isValueBeforeCurrentTime: value => isValueBeforeCurrentTime(value, t),
|
|
7911
7924
|
// Valid until time can be no more than X hours after current time
|
|
@@ -8011,7 +8024,7 @@ const ProbabilityField = ({
|
|
|
8011
8024
|
}) => {
|
|
8012
8025
|
const {
|
|
8013
8026
|
t
|
|
8014
|
-
} =
|
|
8027
|
+
} = useWarningsTranslation();
|
|
8015
8028
|
const {
|
|
8016
8029
|
trigger,
|
|
8017
8030
|
getValues
|
|
@@ -8187,7 +8200,7 @@ const Form = ({
|
|
|
8187
8200
|
}) => {
|
|
8188
8201
|
const {
|
|
8189
8202
|
t
|
|
8190
|
-
} =
|
|
8203
|
+
} = useWarningsTranslation();
|
|
8191
8204
|
const {
|
|
8192
8205
|
handleSubmit,
|
|
8193
8206
|
reset,
|
|
@@ -8565,7 +8578,7 @@ const PublicWarningsFormDialogConnect = ({
|
|
|
8565
8578
|
} = useSetupDialog(publicWarningDialogType, _source);
|
|
8566
8579
|
const {
|
|
8567
8580
|
t
|
|
8568
|
-
} =
|
|
8581
|
+
} = useWarningsTranslation();
|
|
8569
8582
|
const dispatch = useDispatch();
|
|
8570
8583
|
const confirmDialog = useConfirmationDialog();
|
|
8571
8584
|
const formAction = useSelector(store => getPublicWarningFormState(store));
|
|
@@ -8713,6 +8726,30 @@ const getWarningWithoutId = warning => {
|
|
|
8713
8726
|
warningDetail: cleanWarningDetail
|
|
8714
8727
|
});
|
|
8715
8728
|
};
|
|
8729
|
+
const WarningListHeaderContent = _a => {
|
|
8730
|
+
var {
|
|
8731
|
+
title,
|
|
8732
|
+
width = 76
|
|
8733
|
+
} = _a,
|
|
8734
|
+
props = __rest(_a, ["title", "width"]);
|
|
8735
|
+
return /*#__PURE__*/React__default.createElement(Grid, Object.assign({
|
|
8736
|
+
item: true
|
|
8737
|
+
}, props, {
|
|
8738
|
+
sx: Object.assign(Object.assign({}, props.sx), {
|
|
8739
|
+
width
|
|
8740
|
+
})
|
|
8741
|
+
}), /*#__PURE__*/React__default.createElement(Box, {
|
|
8742
|
+
sx: {
|
|
8743
|
+
overflow: 'hidden',
|
|
8744
|
+
fontWeight: 'normal',
|
|
8745
|
+
textOverflow: 'ellipsis',
|
|
8746
|
+
fontSize: 12,
|
|
8747
|
+
lineHeight: 1.33,
|
|
8748
|
+
height: 16,
|
|
8749
|
+
color: 'geowebColors.captions.captionStatus.rgba'
|
|
8750
|
+
}
|
|
8751
|
+
}, title));
|
|
8752
|
+
};
|
|
8716
8753
|
const WarningListColumnContent = _a => {
|
|
8717
8754
|
var {
|
|
8718
8755
|
title,
|
|
@@ -8735,7 +8772,11 @@ const WarningListColumnContent = _a => {
|
|
|
8735
8772
|
fontSize: 10,
|
|
8736
8773
|
lineHeight: 1.6,
|
|
8737
8774
|
height: 12,
|
|
8738
|
-
color: status === 'EXPIRED' ? 'geowebColors.typographyAndIcons.inactiveText' : 'geowebColors.captions.captionStatus.rgba'
|
|
8775
|
+
color: status === 'EXPIRED' ? 'geowebColors.typographyAndIcons.inactiveText' : 'geowebColors.captions.captionStatus.rgba',
|
|
8776
|
+
display: 'block',
|
|
8777
|
+
[`@container publicWarningList (min-width: ${breakpoints.desktop}px)`]: {
|
|
8778
|
+
display: 'none'
|
|
8779
|
+
}
|
|
8739
8780
|
}
|
|
8740
8781
|
}, title)), /*#__PURE__*/React__default.createElement(Box, {
|
|
8741
8782
|
sx: {
|
|
@@ -8757,7 +8798,7 @@ const WarningsOnStatus = ({
|
|
|
8757
8798
|
}) => {
|
|
8758
8799
|
const {
|
|
8759
8800
|
t
|
|
8760
|
-
} =
|
|
8801
|
+
} = useWarningsTranslation();
|
|
8761
8802
|
const headerText = `${warnings.length} ${getStatus(status)}`;
|
|
8762
8803
|
const onClickWarning = warning => () => _onSelectWarning(warning);
|
|
8763
8804
|
const onClickEditWarning = warning => () => _onEditWarning(warning);
|
|
@@ -8809,15 +8850,14 @@ const WarningsOnStatus = ({
|
|
|
8809
8850
|
return /*#__PURE__*/React__default.createElement(ListItem, {
|
|
8810
8851
|
key: warning.id,
|
|
8811
8852
|
sx: {
|
|
8812
|
-
marginBottom: 0.
|
|
8853
|
+
marginBottom: 0.25,
|
|
8854
|
+
minHeight: '32px',
|
|
8813
8855
|
padding: '0 0',
|
|
8814
|
-
minHeight: '48px',
|
|
8815
8856
|
backgroundColor: status === 'EXPIRED' ? 'geowebColors.cards.cardContainerDisabled' : 'geowebColors.cards.cardContainer',
|
|
8816
8857
|
borderColor: status === 'EXPIRED' ? 'geowebColors.cards.cardContainerDisabledBorder' : 'geowebColors.cards.cardContainerBorder',
|
|
8817
8858
|
borderRadius: 1,
|
|
8818
8859
|
borderWidth: activeWarningId === warning.id ? '1px' : '1px',
|
|
8819
|
-
borderStyle: 'solid'
|
|
8820
|
-
containerType: 'inline-size'
|
|
8860
|
+
borderStyle: 'solid'
|
|
8821
8861
|
},
|
|
8822
8862
|
secondaryAction: status !== 'EXPIRED' ? ( /*#__PURE__*/React__default.createElement(ToggleMenu, {
|
|
8823
8863
|
menuTitle: t('warning-list-button-options'),
|
|
@@ -8834,12 +8874,11 @@ const WarningsOnStatus = ({
|
|
|
8834
8874
|
}, /*#__PURE__*/React__default.createElement(ListItemButton, {
|
|
8835
8875
|
sx: {
|
|
8836
8876
|
height: '100%',
|
|
8837
|
-
minHeight: '48px',
|
|
8838
8877
|
padding: 1,
|
|
8839
8878
|
'.warning-list': {
|
|
8840
8879
|
justifyContent: 'left'
|
|
8841
8880
|
},
|
|
8842
|
-
[`@container (min-width: ${breakpoints.desktop}px)`]: {
|
|
8881
|
+
[`@container publicWarningList (min-width: ${breakpoints.desktop}px)`]: {
|
|
8843
8882
|
'.warning-list': {
|
|
8844
8883
|
justifyContent: 'space-between'
|
|
8845
8884
|
}
|
|
@@ -8861,18 +8900,18 @@ const WarningsOnStatus = ({
|
|
|
8861
8900
|
status: status,
|
|
8862
8901
|
width: 142
|
|
8863
8902
|
}), /*#__PURE__*/React__default.createElement(WarningListColumnContent, {
|
|
8864
|
-
title: t('warning-list-header-last-update')
|
|
8903
|
+
title: `${t('warning-list-header-last-update')} UTC`,
|
|
8865
8904
|
status: status,
|
|
8866
8905
|
width: 142
|
|
8867
|
-
}, warning.lastUpdatedTime &&
|
|
8868
|
-
title: t('warning-list-header-start-time')
|
|
8906
|
+
}, warning.lastUpdatedTime && dateUtils.dateToString(dateUtils.utc(warning.lastUpdatedTime), dateUtils.DATE_FORMAT_NAME_OF_DAY_MONTH)), /*#__PURE__*/React__default.createElement(WarningListColumnContent, {
|
|
8907
|
+
title: `${t('warning-list-header-start-time')} UTC`,
|
|
8869
8908
|
status: status,
|
|
8870
8909
|
width: 142
|
|
8871
|
-
}, warning.warningDetail.validFrom &&
|
|
8872
|
-
title: t('warning-list-header-end-time')
|
|
8910
|
+
}, warning.warningDetail.validFrom && dateUtils.dateToString(dateUtils.utc(warning.warningDetail.validFrom), dateUtils.DATE_FORMAT_NAME_OF_DAY_MONTH)), /*#__PURE__*/React__default.createElement(WarningListColumnContent, {
|
|
8911
|
+
title: `${t('warning-list-header-end-time')} UTC`,
|
|
8873
8912
|
status: status,
|
|
8874
8913
|
width: 142
|
|
8875
|
-
}, warning.warningDetail.validUntil &&
|
|
8914
|
+
}, warning.warningDetail.validUntil && dateUtils.dateToString(dateUtils.utc(warning.warningDetail.validUntil), dateUtils.DATE_FORMAT_NAME_OF_DAY_MONTH)), /*#__PURE__*/React__default.createElement(WarningListColumnContent, {
|
|
8876
8915
|
title: t('warning-list-header-domain'),
|
|
8877
8916
|
status: status
|
|
8878
8917
|
}, warning.warningDetail.domain), /*#__PURE__*/React__default.createElement(WarningListColumnContent, {
|
|
@@ -8902,6 +8941,7 @@ const WarningsOnStatus = ({
|
|
|
8902
8941
|
marginLeft: -0.5
|
|
8903
8942
|
}
|
|
8904
8943
|
}, ((_a = warning.warningDetail) === null || _a === void 0 ? void 0 : _a.level) && (levelDetails === null || levelDetails === void 0 ? void 0 : levelDetails.title) || '-')), /*#__PURE__*/React__default.createElement(WarningListColumnContent, {
|
|
8944
|
+
title: t('warning-list-header-status'),
|
|
8905
8945
|
status: status,
|
|
8906
8946
|
width: 96
|
|
8907
8947
|
}, status === 'DRAFT' ? ( /*#__PURE__*/React__default.createElement(Box, {
|
|
@@ -8920,7 +8960,7 @@ const WarningsOnStatus = ({
|
|
|
8920
8960
|
editor: warning.editor
|
|
8921
8961
|
}))), /*#__PURE__*/React__default.createElement(Button, {
|
|
8922
8962
|
sx: {
|
|
8923
|
-
height: '
|
|
8963
|
+
height: '16px',
|
|
8924
8964
|
padding: '0px',
|
|
8925
8965
|
'& .MuiSvgIcon-root': {
|
|
8926
8966
|
marginRight: '-2px'
|
|
@@ -8932,7 +8972,8 @@ const WarningsOnStatus = ({
|
|
|
8932
8972
|
content: status.toLowerCase(),
|
|
8933
8973
|
color: status === 'EXPIRED' ? 'grey' : 'green',
|
|
8934
8974
|
sx: {
|
|
8935
|
-
width: 66
|
|
8975
|
+
width: 66,
|
|
8976
|
+
height: '16px'
|
|
8936
8977
|
}
|
|
8937
8978
|
}))))));
|
|
8938
8979
|
}))));
|
|
@@ -8952,13 +8993,15 @@ const PublicWarningList = ({
|
|
|
8952
8993
|
}) => {
|
|
8953
8994
|
const {
|
|
8954
8995
|
t
|
|
8955
|
-
} =
|
|
8996
|
+
} = useWarningsTranslation();
|
|
8956
8997
|
const sortedWarnings = warnings ? sortWarningsOnStatus(warnings) : null;
|
|
8957
8998
|
return /*#__PURE__*/React__default.createElement(Box, {
|
|
8958
8999
|
sx: {
|
|
8959
9000
|
padding: 3,
|
|
8960
9001
|
height: '100%',
|
|
8961
|
-
overflowY: 'auto'
|
|
9002
|
+
overflowY: 'auto',
|
|
9003
|
+
containerName: 'publicWarningList',
|
|
9004
|
+
containerType: 'inline-size'
|
|
8962
9005
|
},
|
|
8963
9006
|
"data-testid": "publicWarningList"
|
|
8964
9007
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
@@ -8976,10 +9019,55 @@ const PublicWarningList = ({
|
|
|
8976
9019
|
}, t('warning-list-button_create'))), error && /*#__PURE__*/React__default.createElement(AlertBanner, {
|
|
8977
9020
|
title: error.message,
|
|
8978
9021
|
shouldClose: true
|
|
8979
|
-
}), _isLoading
|
|
9022
|
+
}), _isLoading ? ( /*#__PURE__*/React__default.createElement(LinearProgress, {
|
|
8980
9023
|
"data-testid": "loading-bar",
|
|
8981
9024
|
color: "secondary"
|
|
8982
|
-
}))
|
|
9025
|
+
})) : ( /*#__PURE__*/React__default.createElement(Box, {
|
|
9026
|
+
sx: {
|
|
9027
|
+
height: '4px'
|
|
9028
|
+
}
|
|
9029
|
+
})), !error && ( /*#__PURE__*/React__default.createElement(Grid, {
|
|
9030
|
+
container: true,
|
|
9031
|
+
rowSpacing: 0,
|
|
9032
|
+
columnSpacing: 2,
|
|
9033
|
+
alignItems: "center",
|
|
9034
|
+
justifyContent: "space-between",
|
|
9035
|
+
sx: {
|
|
9036
|
+
maxWidth: '100%',
|
|
9037
|
+
display: 'none',
|
|
9038
|
+
[`@container publicWarningList (min-width: ${breakpoints.desktop}px)`]: {
|
|
9039
|
+
display: 'flex'
|
|
9040
|
+
}
|
|
9041
|
+
}
|
|
9042
|
+
}, /*#__PURE__*/React__default.createElement(WarningListHeaderContent, {
|
|
9043
|
+
title: t('warning-list-header-incident'),
|
|
9044
|
+
width: 142,
|
|
9045
|
+
sx: {
|
|
9046
|
+
marginLeft: 1
|
|
9047
|
+
}
|
|
9048
|
+
}), /*#__PURE__*/React__default.createElement(WarningListHeaderContent, {
|
|
9049
|
+
title: `${t('warning-list-header-last-update')} UTC`,
|
|
9050
|
+
width: 142
|
|
9051
|
+
}), /*#__PURE__*/React__default.createElement(WarningListHeaderContent, {
|
|
9052
|
+
title: `${t('warning-list-header-start-time')} UTC`,
|
|
9053
|
+
width: 142
|
|
9054
|
+
}), /*#__PURE__*/React__default.createElement(WarningListHeaderContent, {
|
|
9055
|
+
title: `${t('warning-list-header-end-time')} UTC`,
|
|
9056
|
+
width: 142
|
|
9057
|
+
}), /*#__PURE__*/React__default.createElement(WarningListHeaderContent, {
|
|
9058
|
+
title: t('warning-list-header-domain')
|
|
9059
|
+
}), /*#__PURE__*/React__default.createElement(WarningListHeaderContent, {
|
|
9060
|
+
title: t('warning-list-header-phenomenon'),
|
|
9061
|
+
width: 140
|
|
9062
|
+
}), /*#__PURE__*/React__default.createElement(WarningListHeaderContent, {
|
|
9063
|
+
title: t('warning-list-header-level')
|
|
9064
|
+
}), /*#__PURE__*/React__default.createElement(WarningListHeaderContent, {
|
|
9065
|
+
title: t('warning-list-header-status'),
|
|
9066
|
+
width: 96,
|
|
9067
|
+
sx: {
|
|
9068
|
+
marginRight: '48px'
|
|
9069
|
+
}
|
|
9070
|
+
}))), lastUpdatedTime && ( /*#__PURE__*/React__default.createElement(Box, {
|
|
8983
9071
|
sx: {
|
|
8984
9072
|
marginBottom: -3.25,
|
|
8985
9073
|
button: {
|
|
@@ -9135,7 +9223,7 @@ const ConfirmDeleteWarningDialog = ({
|
|
|
9135
9223
|
}) => {
|
|
9136
9224
|
const {
|
|
9137
9225
|
t
|
|
9138
|
-
} =
|
|
9226
|
+
} = useWarningsTranslation();
|
|
9139
9227
|
const [isLoading, setIsLoading] = React__default.useState(false);
|
|
9140
9228
|
const [error, setError] = React__default.useState(undefined);
|
|
9141
9229
|
const onSubmit = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -9180,7 +9268,7 @@ const ConfirmDeleteWarningDialog = ({
|
|
|
9180
9268
|
const PublicWarningListConnect = () => {
|
|
9181
9269
|
const {
|
|
9182
9270
|
t
|
|
9183
|
-
} =
|
|
9271
|
+
} = useWarningsTranslation();
|
|
9184
9272
|
const dispatch = useDispatch();
|
|
9185
9273
|
const confirmDialog = useConfirmationDialog();
|
|
9186
9274
|
const [confirmDialogOptions, setConfirmDialogOptions] = React__default.useState(undefined);
|
|
@@ -9478,7 +9566,7 @@ const errorEffect = (dispatch, message, isDialogOpen) => {
|
|
|
9478
9566
|
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9479
9567
|
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
9480
9568
|
* */
|
|
9481
|
-
const getLastUpdatedTimeFormatted = () => dateUtils.dateToString(dateUtils.utc(),
|
|
9569
|
+
const getLastUpdatedTimeFormatted = () => dateUtils.dateToString(dateUtils.utc(), dateUtils.DATE_FORMAT_HOURS);
|
|
9482
9570
|
const publicWarningsListener = createListenerMiddleware();
|
|
9483
9571
|
publicWarningsListener.startListening({
|
|
9484
9572
|
actionCreator: publicWarningActions.fetchWarnings,
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@ export declare const DrawingToolLight: {
|
|
|
11
11
|
link: string;
|
|
12
12
|
}[];
|
|
13
13
|
};
|
|
14
|
-
|
|
14
|
+
tags: string[];
|
|
15
15
|
};
|
|
16
16
|
export declare const DrawingToolDark: {
|
|
17
17
|
(): React.ReactElement;
|
|
@@ -21,7 +21,7 @@ export declare const DrawingToolDark: {
|
|
|
21
21
|
link: string;
|
|
22
22
|
}[];
|
|
23
23
|
};
|
|
24
|
-
|
|
24
|
+
tags: string[];
|
|
25
25
|
};
|
|
26
26
|
export declare const DrawingToolErrorLight: {
|
|
27
27
|
(): React.ReactElement;
|
|
@@ -5,7 +5,7 @@ declare const _default: {
|
|
|
5
5
|
export default _default;
|
|
6
6
|
export declare const ObjectManagerSmall: {
|
|
7
7
|
(): React.ReactElement;
|
|
8
|
-
|
|
8
|
+
tags: string[];
|
|
9
9
|
};
|
|
10
10
|
export declare const ObjectManagerLight: {
|
|
11
11
|
(): React.ReactElement;
|
|
@@ -15,7 +15,7 @@ export declare const ObjectManagerLight: {
|
|
|
15
15
|
link: string;
|
|
16
16
|
}[];
|
|
17
17
|
};
|
|
18
|
-
|
|
18
|
+
tags: string[];
|
|
19
19
|
};
|
|
20
20
|
export declare const ObjectManagerDark: {
|
|
21
21
|
(): React.ReactElement;
|
|
@@ -25,22 +25,22 @@ export declare const ObjectManagerDark: {
|
|
|
25
25
|
link: string;
|
|
26
26
|
}[];
|
|
27
27
|
};
|
|
28
|
-
|
|
28
|
+
tags: string[];
|
|
29
29
|
};
|
|
30
30
|
export declare const ObjectManagerLightNoResults: {
|
|
31
31
|
(): React.ReactElement;
|
|
32
|
-
|
|
32
|
+
tags: string[];
|
|
33
33
|
};
|
|
34
34
|
export declare const ObjectManagerDarkNoResults: {
|
|
35
35
|
(): React.ReactElement;
|
|
36
|
-
|
|
36
|
+
tags: string[];
|
|
37
37
|
};
|
|
38
38
|
export declare const ObjectManagerLoading: () => React.ReactElement;
|
|
39
39
|
export declare const ObjectManagerErrorLight: {
|
|
40
40
|
(): React.ReactElement;
|
|
41
|
-
|
|
41
|
+
tags: string[];
|
|
42
42
|
};
|
|
43
43
|
export declare const ObjectManagerErrorDark: {
|
|
44
44
|
(): React.ReactElement;
|
|
45
|
-
|
|
45
|
+
tags: string[];
|
|
46
46
|
};
|
|
@@ -5,7 +5,7 @@ declare const _default: {
|
|
|
5
5
|
export default _default;
|
|
6
6
|
export declare const PublicWarningListLight: {
|
|
7
7
|
(): React.ReactElement;
|
|
8
|
-
|
|
8
|
+
tags: string[];
|
|
9
9
|
parameters: {
|
|
10
10
|
zeplinLink: {
|
|
11
11
|
name: string;
|
|
@@ -15,7 +15,7 @@ export declare const PublicWarningListLight: {
|
|
|
15
15
|
};
|
|
16
16
|
export declare const PublicWarningListDark: {
|
|
17
17
|
(): React.ReactElement;
|
|
18
|
-
|
|
18
|
+
tags: string[];
|
|
19
19
|
parameters: {
|
|
20
20
|
zeplinLink: {
|
|
21
21
|
name: string;
|
|
@@ -25,3 +25,11 @@ export declare const PublicWarningListDark: {
|
|
|
25
25
|
};
|
|
26
26
|
export declare const PublicWarningListError: () => React.ReactElement;
|
|
27
27
|
export declare const PublicWarningListLoading: () => React.ReactElement;
|
|
28
|
+
export declare const PublicWarningListSmallLight: {
|
|
29
|
+
(): React.ReactElement;
|
|
30
|
+
tags: string[];
|
|
31
|
+
};
|
|
32
|
+
export declare const PublicWarningListSmallDark: {
|
|
33
|
+
(): React.ReactElement;
|
|
34
|
+
tags: string[];
|
|
35
|
+
};
|
|
@@ -11,7 +11,7 @@ export declare const PublicWarningsFormDialogLight: {
|
|
|
11
11
|
link: string;
|
|
12
12
|
}[];
|
|
13
13
|
};
|
|
14
|
-
|
|
14
|
+
tags: string[];
|
|
15
15
|
};
|
|
16
16
|
export declare const PublicWarningsFormDialogDark: {
|
|
17
17
|
(): React.ReactElement;
|
|
@@ -21,37 +21,37 @@ export declare const PublicWarningsFormDialogDark: {
|
|
|
21
21
|
link: string;
|
|
22
22
|
}[];
|
|
23
23
|
};
|
|
24
|
-
|
|
24
|
+
tags: string[];
|
|
25
25
|
};
|
|
26
|
-
export declare const
|
|
26
|
+
export declare const PublicWarningsFormDialogBigLight: {
|
|
27
27
|
(): React.ReactElement;
|
|
28
|
-
|
|
28
|
+
tags: string[];
|
|
29
29
|
};
|
|
30
|
-
export declare const
|
|
30
|
+
export declare const PublicWarningsFormDialogBigDark: {
|
|
31
31
|
(): React.ReactElement;
|
|
32
|
-
|
|
32
|
+
tags: string[];
|
|
33
33
|
};
|
|
34
|
-
export declare const
|
|
34
|
+
export declare const PublicWarningsFormDialogBigErrorLight: {
|
|
35
35
|
(): React.ReactElement;
|
|
36
|
-
|
|
36
|
+
tags: string[];
|
|
37
37
|
};
|
|
38
|
-
export declare const
|
|
38
|
+
export declare const PublicWarningsFormDialogBigErrorDark: {
|
|
39
39
|
(): React.ReactElement;
|
|
40
|
-
|
|
40
|
+
tags: string[];
|
|
41
41
|
};
|
|
42
|
-
export declare const
|
|
42
|
+
export declare const PublicWarningsFormDialogReadOnlyLight: {
|
|
43
43
|
(): React.ReactElement;
|
|
44
|
-
|
|
44
|
+
tags: string[];
|
|
45
45
|
};
|
|
46
|
-
export declare const
|
|
46
|
+
export declare const PublicWarningsFormDialogReadOnlyDark: {
|
|
47
47
|
(): React.ReactElement;
|
|
48
|
-
|
|
48
|
+
tags: string[];
|
|
49
49
|
};
|
|
50
|
-
export declare const
|
|
50
|
+
export declare const PublicWarningsFormDialogTakeoverWarningLight: {
|
|
51
51
|
(): React.ReactElement;
|
|
52
|
-
|
|
52
|
+
tags: string[];
|
|
53
53
|
};
|
|
54
|
-
export declare const
|
|
54
|
+
export declare const PublicWarningsFormDialogTakeoverWarningDark: {
|
|
55
55
|
(): React.ReactElement;
|
|
56
|
-
|
|
56
|
+
tags: string[];
|
|
57
57
|
};
|
package/src/lib/utils/i18n.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import i18n from 'i18next';
|
|
2
|
+
import { UseTranslationResponse } from 'react-i18next';
|
|
1
3
|
export declare const WARN_NAMESPACE = "warn";
|
|
2
4
|
export declare const initWarnI18n: () => void;
|
|
3
5
|
export declare const outsideComponentTranslations: {
|
|
@@ -102,6 +104,7 @@ export declare const outsideComponentTranslations: {
|
|
|
102
104
|
"warning-list-header-domain": string;
|
|
103
105
|
"warning-list-header-phenomenon": string;
|
|
104
106
|
"warning-list-header-level": string;
|
|
107
|
+
"warning-list-header-status": string;
|
|
105
108
|
"warning-list-header-draft": string;
|
|
106
109
|
} | {
|
|
107
110
|
"drawing-tool-form-tools": string;
|
|
@@ -205,6 +208,7 @@ export declare const outsideComponentTranslations: {
|
|
|
205
208
|
"warning-list-header-domain": string;
|
|
206
209
|
"warning-list-header-phenomenon": string;
|
|
207
210
|
"warning-list-header-level": string;
|
|
211
|
+
"warning-list-header-status": string;
|
|
208
212
|
"warning-list-header-draft": string;
|
|
209
213
|
} | {
|
|
210
214
|
"drawing-tool-form-tools": string;
|
|
@@ -308,6 +312,7 @@ export declare const outsideComponentTranslations: {
|
|
|
308
312
|
"warning-list-header-domain": string;
|
|
309
313
|
"warning-list-header-phenomenon": string;
|
|
310
314
|
"warning-list-header-level": string;
|
|
315
|
+
"warning-list-header-status": string;
|
|
311
316
|
"warning-list-header-draft": string;
|
|
312
317
|
} | {
|
|
313
318
|
"drawing-tool-form-tools": string;
|
|
@@ -411,5 +416,7 @@ export declare const outsideComponentTranslations: {
|
|
|
411
416
|
"warning-list-header-domain": string;
|
|
412
417
|
"warning-list-header-phenomenon": string;
|
|
413
418
|
"warning-list-header-level": string;
|
|
419
|
+
"warning-list-header-status": string;
|
|
414
420
|
"warning-list-header-draft": string;
|
|
415
421
|
};
|
|
422
|
+
export declare const useWarningsTranslation: () => UseTranslationResponse<typeof WARN_NAMESPACE, typeof i18n>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|