@opengeoweb/warnings 9.29.1 → 9.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.esm.js CHANGED
@@ -1,25 +1,25 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import { useDispatch, useSelector } from 'react-redux';
3
- import { Polygons, Share, ExitDomain, Edit, Delete, CoastalEvent, TemperatureLow, TemperatureHigh, Rain, Snow, Lightning, Fog, Wind, Thunderstorm, VulcanicEruption, Haze, FreezingPrecipitation, ModerateAircraftIcing, SevereAircraftIcing, ModerateTurbulence, SevereTurbulence, SandStorm, RadioactiveMaterials, DrawPolygon, Visibility, Add, breakpoints, Close, Options, Copy, Success, Expire, Remove } from '@opengeoweb/theme';
3
+ import { Polygons, Share, ExitDomain, Edit, Delete, CoastalEvent, TemperatureLow, TemperatureHigh, Rain, Snow, Lightning, Fog, Wind, Thunderstorm, VulcanicEruption, Haze, FreezingPrecipitation, ModerateAircraftIcing, SevereAircraftIcing, ModerateTurbulence, SevereTurbulence, SandStorm, RadioactiveMaterials, DrawPolygon, Visibility, Add, breakpoints, Close, Options, ChevronDown, ChevronUp, Copy, Success, Expire, Remove } from '@opengeoweb/theme';
4
4
  import { uiTypes, uiActions, getSingularDrawtoolDrawLayerId, drawtoolSelectors, layerSelectors, uiSelectors, mapStoreActions, drawtoolActions, layerActions, useSetupDialog } from '@opengeoweb/store';
5
- import { defaultPolygon, emptyGeoJSON, MapControlButton, getIcon, rewindGeometry, getGeoJSONPropertyValue, currentlySupportedDrawModes, MapView, MapViewLayer, defaultLayers, getFeatureExtent } from '@opengeoweb/webmap-react';
5
+ import { defaultPolygon, emptyGeoJSON, MapControlButton, getIcon, rewindGeometry, getGeoJSONPropertyValue, currentlySupportedDrawModes, defaultLayers, MapView, MapViewLayer, getFeatureExtent } from '@opengeoweb/webmap-react';
6
6
  import { SHARED_NAMESPACE, useConfirmationDialog, ToggleMenu, dateUtils, calculateStartSize, ToolContainerDraggable, AlertBanner, ConfirmationDialog, getAxiosErrorMessage, usePrevious, CustomIconButton, CustomTooltip, Avatar, getInitials, SwitchButton, CustomToggleButton, Filter, getPosition, FilterChip, FilterListItem, FilterLabel, StatusTag, LastUpdateTime, ErrorBoundary, pollingIntervalTimeout, isAxiosError as isAxiosError$1 } from '@opengeoweb/shared';
7
7
  import { createEntityAdapter, createSlice, createSelector, createListenerMiddleware, isAnyOf } from '@reduxjs/toolkit';
8
8
  import i18n from 'i18next';
9
9
  import { useTranslation } from 'react-i18next';
10
10
  import '@opengeoweb/core';
11
11
  import { FORM_FIELDS_NAMESPACE, useDraftFormHelpers, ReactHookFormSelect, ReactHookFormHiddenInput, isValidGeoJsonCoordinates, ReactHookFormTextField, ReactHookFormProvider, defaultFormOptions, errorMessages, ReactHookFormDateTime, isXHoursBefore, isXHoursAfter, isEmpty } from '@opengeoweb/form-fields';
12
- import { generateMapId, LayerType, getWMJSMapById, getGeoCoordFromLatLong, WMBBOX } from '@opengeoweb/webmap';
12
+ import { LayerType, generateMapId, getWMJSMapById, getGeoCoordFromLatLong, WMBBOX } from '@opengeoweb/webmap';
13
13
  import { snackbarActions, snackbarTypes } from '@opengeoweb/snackbar';
14
14
  import * as React from 'react';
15
15
  import React__default, { useState, useEffect, useRef } from 'react';
16
16
  import { styled, Box, Typography, ListItem, Grid2, Paper, ListItemButton, Stack, LinearProgress, Button, MenuItem, FormHelperText, Tabs, Tab, Card, CardContent, CircularProgress, Menu, DialogTitle, DialogContent, Switch, ListItemIcon, Checkbox, ListItemText } from '@mui/material';
17
17
  import { VariableSizeList } from 'react-window';
18
18
  import AutoSizer from 'react-virtualized-auto-sizer';
19
- import { getApi, createApiInstance, createNonAuthApiInstance, createFakeApiInstance, ApiProvider, ProductStatus, useAirmetList, useSigmetList } from '@opengeoweb/api';
19
+ import { getApi, createApiInstance, createNonAuthApiInstance, createFakeApiInstance, ApiProvider, ProductStatus, getHeaders, useAuthQuery } from '@opengeoweb/api';
20
20
  import { useFormContext } from 'react-hook-form';
21
21
  import { isEqual, cloneDeep, clamp, debounce } from 'lodash';
22
- import { useAuthenticationContext } from '@opengeoweb/authentication';
22
+ import { useAuthenticationContext, getConfig } from '@opengeoweb/authentication';
23
23
  import { produce } from 'immer';
24
24
  import { isAxiosError } from 'axios';
25
25
 
@@ -11349,9 +11349,13 @@ const zoomToFeature = (mapId, geojsonFeature) => {
11349
11349
  };
11350
11350
  const WarningsMapView = ({
11351
11351
  geojsonFeature,
11352
- defaultBbox,
11352
+ defaultMapPreset,
11353
11353
  isSnapshot: _isSnapshot = false
11354
11354
  }) => {
11355
+ var _a, _b;
11356
+ const defaultBbox = defaultMapPreset === null || defaultMapPreset === void 0 ? void 0 : defaultMapPreset.proj;
11357
+ const defaultBaseLayer = ((_a = defaultMapPreset === null || defaultMapPreset === void 0 ? void 0 : defaultMapPreset.layers) === null || _a === void 0 ? void 0 : _a.find(layer => layer.layerType === LayerType.baseLayer)) || defaultLayers.baseLayerGrey;
11358
+ const defaultOverLayer = ((_b = defaultMapPreset === null || defaultMapPreset === void 0 ? void 0 : defaultMapPreset.layers) === null || _b === void 0 ? void 0 : _b.find(layer => layer.layerType === LayerType.overLayer)) || defaultLayers.overLayer;
11355
11359
  const mapId = React.useRef(`WarningsMapView_${generateMapId()}`).current;
11356
11360
  const warningLayer = {
11357
11361
  id: `${mapId}geojsonfeature`,
@@ -11386,9 +11390,9 @@ const WarningsMapView = ({
11386
11390
  },
11387
11391
  holdShiftToScroll: true
11388
11392
  }, {
11389
- children: [!_isSnapshot && jsx(MapViewLayer, Object.assign({}, defaultLayers.baseLayerGrey, {
11393
+ children: [!_isSnapshot && jsx(MapViewLayer, Object.assign({}, defaultBaseLayer, {
11390
11394
  id: `${mapId}_baseLayer`
11391
- })), warningLayer.geojson && jsx(MapViewLayer, Object.assign({}, warningLayer)), !_isSnapshot && jsx(MapViewLayer, Object.assign({}, defaultLayers.overLayer, {
11395
+ })), warningLayer.geojson && jsx(MapViewLayer, Object.assign({}, warningLayer)), !_isSnapshot && jsx(MapViewLayer, Object.assign({}, defaultOverLayer, {
11392
11396
  id: `${mapId}_overlayer`
11393
11397
  }))]
11394
11398
  }))
@@ -11600,7 +11604,7 @@ const getWarningGeoJSONWithColor = (level, geoJSON) => {
11600
11604
  });
11601
11605
  };
11602
11606
  const Form = ({
11603
- defaultBbox,
11607
+ defaultMapPreset,
11604
11608
  onSaveForm: _onSaveForm = () => {},
11605
11609
  onPublishForm: _onPublishForm = () => {},
11606
11610
  object,
@@ -11742,7 +11746,7 @@ const Form = ({
11742
11746
  }, {
11743
11747
  children: jsx(WarningsMapView, {
11744
11748
  geojsonFeature: geoJSONFeature,
11745
- defaultBbox: defaultBbox,
11749
+ defaultMapPreset: defaultMapPreset,
11746
11750
  isSnapshot: _isSnapshot
11747
11751
  })
11748
11752
  })), jsx(Grid2, Object.assign({
@@ -11998,7 +12002,7 @@ var PublicWarningStatus;
11998
12002
  })(PublicWarningStatus || (PublicWarningStatus = {}));
11999
12003
 
12000
12004
  const PublicWarningsFormConnect = ({
12001
- defaultBbox
12005
+ defaultMapPreset
12002
12006
  }) => {
12003
12007
  const publicWarning = useSelector(store => getPublicWarning(store));
12004
12008
  const publicWarningObject = useSelector(store => getPublicWarningObject(store));
@@ -12059,7 +12063,7 @@ const PublicWarningsFormConnect = ({
12059
12063
  isReadOnly: isReadOnly,
12060
12064
  error: publicWarningFormError,
12061
12065
  onFormDirty: onFormDirty,
12062
- defaultBbox: defaultBbox,
12066
+ defaultMapPreset: defaultMapPreset,
12063
12067
  onAddObject: onAddObject
12064
12068
  });
12065
12069
  };
@@ -13723,7 +13727,7 @@ const PublicWarningsFormDialogConnect = ({
13723
13727
  bounds,
13724
13728
  source: _source = 'app',
13725
13729
  startPosition,
13726
- defaultBbox
13730
+ defaultMapPreset
13727
13731
  }) => {
13728
13732
  const warningsApi = getWarningsApi();
13729
13733
  const {
@@ -13826,7 +13830,7 @@ const PublicWarningsFormDialogConnect = ({
13826
13830
  publicWarningEditor: publicWarningEditor
13827
13831
  }, {
13828
13832
  children: jsx(PublicWarningsFormConnect, {
13829
- defaultBbox: defaultBbox
13833
+ defaultMapPreset: defaultMapPreset
13830
13834
  })
13831
13835
  })), jsx(AreaObjectLoaderConnect, {})]
13832
13836
  });
@@ -14338,12 +14342,15 @@ const FilterList = ({
14338
14342
  }));
14339
14343
  };
14340
14344
 
14345
+ const HEADER_SIZE = 32;
14341
14346
  const WarningListItemSeperator = _a => {
14342
14347
  var {
14343
14348
  totalWarnings,
14344
- status
14349
+ status,
14350
+ isExpanded,
14351
+ onClick
14345
14352
  } = _a,
14346
- props = __rest(_a, ["totalWarnings", "status"]);
14353
+ props = __rest(_a, ["totalWarnings", "status", "isExpanded", "onClick"]);
14347
14354
  const {
14348
14355
  t
14349
14356
  } = useWarningsTranslation();
@@ -14361,15 +14368,28 @@ const WarningListItemSeperator = _a => {
14361
14368
  };
14362
14369
  const headerText = `${totalWarnings} ${getStatus(status)}`;
14363
14370
  return jsx(ListItem, Object.assign({}, props, {
14371
+ sx: {
14372
+ height: HEADER_SIZE,
14373
+ padding: 0
14374
+ },
14364
14375
  "aria-label": `warninglist ${status}`
14365
14376
  }, {
14366
- children: jsx(Typography, Object.assign({
14367
- variant: "caption",
14377
+ children: jsxs(ListItemButton, Object.assign({
14368
14378
  sx: {
14369
- opacity: 0.67
14370
- }
14379
+ height: HEADER_SIZE,
14380
+ padding: 0
14381
+ },
14382
+ onClick: onClick
14371
14383
  }, {
14372
- children: headerText
14384
+ children: [isExpanded ? jsx(ChevronDown, {}) : jsx(ChevronUp, {}), jsx(Typography, Object.assign({
14385
+ variant: "caption",
14386
+ sx: {
14387
+ opacity: 0.67,
14388
+ marginLeft: 1
14389
+ }
14390
+ }, {
14391
+ children: headerText
14392
+ }))]
14373
14393
  }))
14374
14394
  }));
14375
14395
  };
@@ -14581,7 +14601,8 @@ const transformAirmetToWarningFormat = apiAirmet => {
14581
14601
  validUntil: airmet.validDateEnd,
14582
14602
  level: 'AIR',
14583
14603
  probability: 0,
14584
- incident: airmet.sequence
14604
+ incident: airmet.sequence,
14605
+ firName: airmet.firName
14585
14606
  }
14586
14607
  };
14587
14608
  };
@@ -14603,7 +14624,8 @@ const transformSigmetToWarningFormat = apiSigmet => {
14603
14624
  validUntil: sigmet.validDateEnd,
14604
14625
  level: 'SIG',
14605
14626
  probability: 0,
14606
- incident: sigmet.sequence
14627
+ incident: sigmet.sequence,
14628
+ firName: sigmet.firName
14607
14629
  }
14608
14630
  };
14609
14631
  };
@@ -14706,9 +14728,9 @@ const WarningListItem = _a => {
14706
14728
  } = useWarningsTranslation();
14707
14729
  const phenomenonDetails = allPhenomenaDict[warning.warningDetail.phenomenon];
14708
14730
  const objectNameText = ((_c = (_b = warning.warningDetail.areas) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.objectName) || '-';
14731
+ const objectHoverText = warning.warningDetail.firName ? warning.warningDetail.firName : objectNameText;
14709
14732
  const {
14710
- ref: objectNameRef,
14711
- isOverflowing: isObjectNameOverflowing
14733
+ ref: objectNameRef
14712
14734
  } = useOverflowCheck(objectNameText);
14713
14735
  const phenomenonText = (phenomenonDetails === null || phenomenonDetails === void 0 ? void 0 : phenomenonDetails.translationKey) ? t(phenomenonDetails.translationKey) : '-';
14714
14736
  const {
@@ -14907,8 +14929,8 @@ const WarningListItem = _a => {
14907
14929
  whiteSpace: 'nowrap'
14908
14930
  }
14909
14931
  }, {
14910
- children: isObjectNameOverflowing ? jsx(CustomTooltip, Object.assign({
14911
- title: objectNameText,
14932
+ children: jsx(CustomTooltip, Object.assign({
14933
+ title: objectHoverText,
14912
14934
  placement: "top",
14913
14935
  sx: {
14914
14936
  zIndex: 1000
@@ -14917,9 +14939,7 @@ const WarningListItem = _a => {
14917
14939
  children: jsx("span", {
14918
14940
  children: objectNameText
14919
14941
  })
14920
- })) : jsx("span", {
14921
- children: objectNameText
14922
- })
14942
+ }))
14923
14943
  }))
14924
14944
  })), jsx(WarningListColumnContent, Object.assign({
14925
14945
  title: t('warning-list-header-status'),
@@ -15085,19 +15105,31 @@ const PublicWarningList = ({
15085
15105
  byFilterState
15086
15106
  } = useWarningFilters();
15087
15107
  const sortedWarnings = sortWarningsOnStatus(_warnings.filter(byFilterState));
15108
+ const [expandedSections, setExpandedSections] = React__default.useState({
15109
+ TODO: true,
15110
+ DRAFT: true,
15111
+ PUBLISHED: true,
15112
+ EXPIRED: true
15113
+ });
15114
+ const toggleExpand = (shouldToggle, status) => {
15115
+ setExpandedSections(Object.assign(Object.assign({}, expandedSections), {
15116
+ [status]: shouldToggle
15117
+ }));
15118
+ resetListIndex();
15119
+ };
15088
15120
  const items = [{
15089
15121
  status: PublicWarningStatus.TODO,
15090
15122
  totalWarnings: sortedWarnings.todo.length
15091
- }, ...sortedWarnings.todo, {
15123
+ }, ...(expandedSections.TODO ? sortedWarnings.todo : []), {
15092
15124
  status: PublicWarningStatus.DRAFT,
15093
15125
  totalWarnings: sortedWarnings.draft.length
15094
- }, ...sortedWarnings.draft, {
15126
+ }, ...(expandedSections.DRAFT ? sortedWarnings.draft : []), {
15095
15127
  status: PublicWarningStatus.PUBLISHED,
15096
15128
  totalWarnings: sortedWarnings.published.length
15097
- }, ...sortedWarnings.published, {
15129
+ }, ...(expandedSections.PUBLISHED ? sortedWarnings.published : []), {
15098
15130
  status: PublicWarningStatus.EXPIRED,
15099
15131
  totalWarnings: sortedWarnings.expired.length
15100
- }, ...sortedWarnings.expired];
15132
+ }, ...(expandedSections.EXPIRED ? sortedWarnings.expired : [])];
15101
15133
  const getItemSize = (index, width) => {
15102
15134
  const item = items[index];
15103
15135
  if (item.totalWarnings !== undefined) {
@@ -15310,7 +15342,11 @@ const PublicWarningList = ({
15310
15342
  return jsx(WarningListItemSeperator, {
15311
15343
  status: header.status,
15312
15344
  totalWarnings: header.totalWarnings,
15313
- style: style
15345
+ style: style,
15346
+ isExpanded: expandedSections[warning.status],
15347
+ onClick: () => {
15348
+ toggleExpand(!expandedSections[header.status], header.status);
15349
+ }
15314
15350
  }, key);
15315
15351
  }
15316
15352
  const publicWarning = warning;
@@ -15504,6 +15540,37 @@ const ConfirmDeleteWarningDialog = ({
15504
15540
  }));
15505
15541
  };
15506
15542
 
15543
+ const config = getConfig();
15544
+ const airmetBaseUrl = config.GW_AIRMET_BASE_URL;
15545
+ const sigmetBaseUrl = config.GW_SIGMET_BASE_URL;
15546
+ // API
15547
+ const getAirmetList = auth => fetch(`${airmetBaseUrl}/airmetlist`, {
15548
+ headers: getHeaders(auth)
15549
+ }).then(r => r.json());
15550
+ const getSigmetList = auth => fetch(`${sigmetBaseUrl}/sigmetlist`, {
15551
+ headers: getHeaders(auth)
15552
+ }).then(r => r.json());
15553
+
15554
+ /* *
15555
+ * Licensed under the Apache License, Version 2.0 (the "License");
15556
+ * you may not use this file except in compliance with the License.
15557
+ * You may obtain a copy of the License at
15558
+ *
15559
+ * http://www.apache.org/licenses/LICENSE-2.0
15560
+ *
15561
+ * Unless required by applicable law or agreed to in writing, software
15562
+ * distributed under the License is distributed on an "AS IS" BASIS,
15563
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15564
+ * See the License for the specific language governing permissions and
15565
+ * limitations under the License.
15566
+ *
15567
+ * Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
15568
+ * Copyright 2024 - Finnish Meteorological Institute (FMI)
15569
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
15570
+ * */
15571
+ const useAirmetList = () => useAuthQuery(['airmet-list'], getAirmetList);
15572
+ const useSigmetList = () => useAuthQuery(['sigmet-list'], getSigmetList);
15573
+
15507
15574
  const PublicWarningListConnect = () => {
15508
15575
  const {
15509
15576
  t
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/warnings",
3
- "version": "9.29.1",
3
+ "version": "9.31.0",
4
4
  "description": "GeoWeb warinings library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -22,7 +22,7 @@
22
22
  "@opengeoweb/snackbar": "*",
23
23
  "react-window": "^1.8.10",
24
24
  "react-virtualized-auto-sizer": "^1.0.20",
25
- "axios": "1.5.0",
25
+ "axios": "^1.7.7",
26
26
  "@opengeoweb/core": "*",
27
27
  "@opengeoweb/webmap": "*",
28
28
  "@opengeoweb/authentication": "*",
@@ -0,0 +1,7 @@
1
+ import { Credentials } from '@opengeoweb/authentication';
2
+ import { AirmetConfig, AirmetFromBackend, SigmetConfig, SigmetFromBackend } from '@opengeoweb/api';
3
+ export declare const getAirmetList: (auth: Credentials) => Promise<AirmetFromBackend[]>;
4
+ export declare const getSigmetList: (auth: Credentials) => Promise<SigmetFromBackend[]>;
5
+ export declare const getlocalProductConfig: <T extends SigmetConfig | AirmetConfig>(configUrl: string) => Promise<T>;
6
+ export declare const getAirmetConfig: (auth: Credentials) => Promise<AirmetConfig>;
7
+ export declare const getSigmetConfig: (auth: Credentials) => Promise<SigmetConfig>;
@@ -0,0 +1,4 @@
1
+ import { UseQueryResult } from '@tanstack/react-query';
2
+ import { AirmetFromBackend, SigmetFromBackend } from '@opengeoweb/api';
3
+ export declare const useAirmetList: () => UseQueryResult<AirmetFromBackend[]>;
4
+ export declare const useSigmetList: () => UseQueryResult<SigmetFromBackend[]>;
@@ -1,16 +1,10 @@
1
1
  import React from 'react';
2
2
  import { PublicWarning } from '../../store/publicWarningForm/types';
3
3
  import { WarningListFilter } from '../../store/publicWarnings/types';
4
- interface WarningStatusProps {
4
+ import { WarningListItemActions } from './WarningListItemMenu';
5
+ interface PublicWarningListProps extends WarningListItemActions {
5
6
  warnings: PublicWarning[];
6
7
  onSelectWarning?: (warning: PublicWarning) => void;
7
- onEditWarning?: (warning: PublicWarning) => void;
8
- onDeleteWarning?: (warningId: string, warningEditor?: string) => void;
9
- onDeleteReviewWarning?: (warning: PublicWarning) => void;
10
- onExpireWarning?: (warning: PublicWarning) => void;
11
- onWithdrawWarning?: (warning: PublicWarning) => void;
12
- }
13
- export declare const PublicWarningList: React.FC<{
14
8
  isLoading?: boolean;
15
9
  error?: Error;
16
10
  selectedPublicWarningId?: string;
@@ -20,5 +14,6 @@ export declare const PublicWarningList: React.FC<{
20
14
  filters?: WarningListFilter[];
21
15
  onClickAllChip?: (isChecked: boolean) => void;
22
16
  isAllChipSelected?: boolean;
23
- } & WarningStatusProps>;
17
+ }
18
+ export declare const PublicWarningList: React.FC<PublicWarningListProps>;
24
19
  export default PublicWarningList;
@@ -7,3 +7,4 @@ export declare const PublicWarningListLight: () => React.ReactElement;
7
7
  export declare const PublicWarningListError: () => React.ReactElement;
8
8
  export declare const PublicWarningListErrorDeleteWarning: () => React.ReactElement;
9
9
  export declare const PublicWarningListDifferentEditors: () => React.ReactElement;
10
+ export declare const PublicWarningListExtraLongList: () => React.ReactElement;
@@ -1,17 +1,11 @@
1
1
  import React from 'react';
2
2
  import { ListItemProps } from '@mui/material';
3
3
  import { PublicWarning } from '../../store/publicWarningForm/types';
4
- interface WarningStatusProps extends ListItemProps {
4
+ import { WarningListItemActions } from './WarningListItemMenu';
5
+ export interface WarningListItemProps extends ListItemProps, WarningListItemActions {
5
6
  warning: PublicWarning;
7
+ activeWarningId: string;
6
8
  onSelectWarning?: (warning: PublicWarning) => void;
7
- onEditWarning?: (warning: PublicWarning) => void;
8
- onDeleteWarning?: (warningId: string, warningEditor?: string) => void;
9
- onDeleteReviewWarning?: (warning: PublicWarning) => void;
10
- onExpireWarning?: (warning: PublicWarning) => void;
11
- onWithdrawWarning?: (warning: PublicWarning) => void;
12
9
  }
13
- declare const WarningListItem: React.FC<{
14
- warning: PublicWarning;
15
- activeWarningId: string;
16
- } & WarningStatusProps>;
10
+ declare const WarningListItem: React.FC<WarningListItemProps>;
17
11
  export default WarningListItem;
@@ -1,13 +1,15 @@
1
1
  import { MenuItemType } from '@opengeoweb/shared';
2
2
  import { TFunction } from 'i18next';
3
3
  import { PublicWarning } from '../../store/publicWarningForm/types';
4
- interface WarningListItemMenuProps {
5
- warning: PublicWarning;
4
+ export interface WarningListItemActions {
6
5
  onEditWarning?: (warning: PublicWarning) => void;
7
6
  onDeleteWarning?: (warningId: string, warningEditor?: string) => void;
8
7
  onDeleteReviewWarning?: (warning: PublicWarning) => void;
9
8
  onExpireWarning?: (warning: PublicWarning) => void;
10
9
  onWithdrawWarning?: (warning: PublicWarning) => void;
10
+ }
11
+ interface WarningListItemMenuProps extends WarningListItemActions {
12
+ warning: PublicWarning;
11
13
  t: TFunction;
12
14
  }
13
15
  declare const WarningListItemMenu: ({ warning, onEditWarning, onDeleteWarning, onDeleteReviewWarning, onExpireWarning, onWithdrawWarning, t, }: WarningListItemMenuProps) => MenuItemType[];
@@ -4,5 +4,6 @@ import { PublicWarningStatus } from '../../store/publicWarningForm/types';
4
4
  declare const WarningListItemSeperator: React.FC<{
5
5
  totalWarnings: number;
6
6
  status: PublicWarningStatus;
7
+ isExpanded: boolean;
7
8
  } & ListItemProps>;
8
9
  export default WarningListItemSeperator;
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { Bbox } from '@opengeoweb/webmap';
2
+ import { MapPreset } from '@opengeoweb/store';
3
3
  import { PublicWarningDetail } from '../../store/publicWarningForm/types';
4
4
  import { BaseDrawingListItem, DrawingListItem } from '../../store/drawings/types';
5
5
  import { FormAction, FormError } from '../../store/publicWarningForm/reducer';
@@ -14,10 +14,7 @@ interface FormData extends PublicWarningDetail {
14
14
  export declare const prepareFormValues: (data: FormData) => PublicWarningDetail;
15
15
  interface FormProps {
16
16
  formAction?: FormAction;
17
- defaultBbox?: {
18
- srs: string;
19
- bbox: Bbox;
20
- };
17
+ defaultMapPreset?: MapPreset;
21
18
  onSaveForm?: (formValues: PublicWarningDetail) => void;
22
19
  onPublishForm?: (formValues: PublicWarningDetail) => void;
23
20
  object?: DrawingListItem;
@@ -1,10 +1,7 @@
1
1
  import * as React from 'react';
2
- import { Bbox } from '@opengeoweb/webmap';
2
+ import { MapPreset } from '@opengeoweb/store';
3
3
  interface PublicWarningsFormConnectProps {
4
- defaultBbox?: {
5
- srs: string;
6
- bbox: Bbox;
7
- };
4
+ defaultMapPreset?: MapPreset;
8
5
  }
9
6
  export declare const PublicWarningsFormConnect: React.FC<PublicWarningsFormConnectProps>;
10
7
  export {};
@@ -1,16 +1,12 @@
1
1
  import React from 'react';
2
- import { uiTypes } from '@opengeoweb/store';
2
+ import { uiTypes, MapPreset } from '@opengeoweb/store';
3
3
  import { ConfirmationOptions, Position } from '@opengeoweb/shared';
4
4
  import { TFunction } from 'i18next';
5
- import { Bbox } from '@opengeoweb/webmap';
6
5
  export declare const warningFormConfirmationOptions: (t: TFunction) => ConfirmationOptions;
7
6
  export declare const isAlreadyEdited: (publicWarningEditor: string | undefined, username: string | undefined) => boolean;
8
7
  export declare const PublicWarningsFormDialogConnect: React.FC<{
9
8
  bounds?: string;
10
9
  source?: uiTypes.Source;
11
10
  startPosition?: Position;
12
- defaultBbox?: {
13
- srs: string;
14
- bbox: Bbox;
15
- };
11
+ defaultMapPreset?: MapPreset;
16
12
  }>;
@@ -1,13 +1,10 @@
1
1
  import * as React from 'react';
2
- import { Bbox } from '@opengeoweb/webmap';
3
2
  import { FeatureCollection } from 'geojson';
3
+ import { MapPreset } from '@opengeoweb/store';
4
4
  export declare const zoomToFeature: (mapId: string, geojsonFeature: FeatureCollection | undefined) => void;
5
5
  interface WarningsMapViewProps {
6
6
  geojsonFeature: FeatureCollection | undefined;
7
- defaultBbox?: {
8
- srs: string;
9
- bbox: Bbox;
10
- };
7
+ defaultMapPreset?: MapPreset;
11
8
  isSnapshot?: boolean;
12
9
  }
13
10
  export declare const WarningsMapView: React.FC<WarningsMapViewProps>;
@@ -21,6 +21,7 @@ export interface PublicWarningDetail {
21
21
  proposal_id?: string;
22
22
  linked_to_id?: string;
23
23
  incident?: string;
24
+ firName?: string;
24
25
  }
25
26
  export declare enum PublicWarningStatus {
26
27
  DRAFT = "DRAFT",
@@ -0,0 +1,4 @@
1
+ import { Store } from '@reduxjs/toolkit';
2
+ import { uiTypes, WebMapStateModuleState } from '@opengeoweb/store';
3
+ import { WarningModuleStore } from '../store/types';
4
+ export declare const createMockStore: (mockState: WarningModuleStore & uiTypes.UIModuleState & WebMapStateModuleState) => Store;