@opengeoweb/warnings 19.6.1 → 20.0.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/dist/index.esm.js +2920 -675
- package/dist/src/lib/components/AreaDrawingManager/AreaDrawingManager.d.ts +2 -1
- package/dist/src/lib/components/AreaDrawingManager/Drawings.d.ts +2 -1
- package/dist/src/lib/components/DrawingToolForm/DrawingToolForm.d.ts +7 -0
- package/dist/src/lib/components/DrawingToolForm/DrawingToolFormConnect.d.ts +1 -0
- package/dist/src/lib/components/DrawingToolForm/DrawingToolFormContents.d.ts +7 -0
- package/dist/src/lib/components/DrawingToolForm/DrawingToolFormMasks.d.ts +11 -0
- package/dist/src/lib/components/DrawingToolForm/drawingObjectUtils.d.ts +3 -0
- package/dist/src/lib/components/DrawingToolForm/maskUtils.d.ts +15 -0
- package/dist/src/lib/components/DrawingToolForm/useMaskPreviewLayer.d.ts +7 -0
- package/dist/src/lib/components/FilterList/filter-utils.d.ts +23 -8
- package/dist/src/lib/components/PublicWarningList/warningListFeatureSyncUtils.d.ts +3 -1
- package/dist/src/lib/components/PublicWarningsForm/PhenomenonField/PhenomenonField.d.ts +2 -0
- package/dist/src/lib/components/WarningEvents/WarningEventDialog/WarningEventDialogConnect.d.ts +2 -1
- package/dist/src/lib/components/WarningEvents/WarningEventDialog/WarningEventFormDialog.d.ts +3 -0
- package/dist/src/lib/components/WarningEvents/WarningEventForm/WarningEventFormContent.d.ts +3 -0
- package/dist/src/lib/components/WarningEvents/WarningEventForm/WarningEventItem.d.ts +3 -0
- package/dist/src/lib/components/WarningEvents/WarningEventForm/utils.d.ts +3 -0
- package/dist/src/lib/components/WarningEvents/WarningEventSummaryDialog/WarningEventSummaryForm.d.ts +2 -2
- package/dist/src/lib/components/WarningsMapView/WarningsMapView.d.ts +3 -0
- package/dist/src/lib/components/WarningsTimeline/WarningBlock.d.ts +4 -1
- package/dist/src/lib/components/WarningsTimeline/WarningBlockMenu.d.ts +17 -0
- package/dist/src/lib/components/WarningsTimeline/WarningsTimeline.d.ts +4 -0
- package/dist/src/lib/components/WarningsTimeline/WarningsTimelineLayers.d.ts +5 -1
- package/dist/src/lib/store/warningsDrawings/types.d.ts +5 -0
- package/dist/src/lib/store/warningsDrawings/utils.d.ts +19 -0
- package/dist/src/lib/store/warningsEventForm/reducer.d.ts +5 -0
- package/dist/src/lib/store/warningsEventForm/selectors.d.ts +21 -0
- package/dist/src/lib/store/warningsFilters/reducer.d.ts +9 -1
- package/dist/src/lib/store/warningsFilters/selectors.d.ts +42 -1
- package/dist/src/lib/store/warningsFilters/types.d.ts +26 -0
- package/dist/src/lib/store/warningsForm/types.d.ts +3 -0
- package/dist/src/lib/utils/fakeApi/index.d.ts +2 -1
- package/package.json +63 -64
|
@@ -3,6 +3,7 @@ import type { HeaderSize, Position, DraggableSize } from '@opengeoweb/shared';
|
|
|
3
3
|
import type { uiTypes } from '@opengeoweb/store';
|
|
4
4
|
import type { SelectedAreaFeatureNamesByAreaId } from './Areas';
|
|
5
5
|
import type { AreaListItem, DrawingListItem } from '../../store/warningsDrawings/types';
|
|
6
|
+
import type { WarningType } from '../../store/warningsForm/types';
|
|
6
7
|
export declare const AreaDrawingManager: React.FC<{
|
|
7
8
|
bounds?: string;
|
|
8
9
|
title?: string;
|
|
@@ -26,7 +27,7 @@ export declare const AreaDrawingManager: React.FC<{
|
|
|
26
27
|
onHoverDrawingFeatureEnd?: (drawing: DrawingListItem) => void;
|
|
27
28
|
onEditDrawing?: (drawingId: string) => void;
|
|
28
29
|
onDeleteDrawing?: (drawingId: string) => void;
|
|
29
|
-
onShareDrawing?: (drawing: DrawingListItem) => void;
|
|
30
|
+
onShareDrawing?: (drawing: DrawingListItem, type: WarningType) => void;
|
|
30
31
|
onCreateNewDrawing?: () => void;
|
|
31
32
|
activeDrawingId?: string;
|
|
32
33
|
selectedAreaFeatureNamesByAreaId?: SelectedAreaFeatureNamesByAreaId;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { TFunction } from 'i18next';
|
|
2
2
|
import type { FC } from 'react';
|
|
3
3
|
import type { DrawingListItem } from '../../store/warningsDrawings/types';
|
|
4
|
+
import type { WarningType } from '../../store/warningsForm/types';
|
|
4
5
|
export declare const getFeatureName: (feature: GeoJSON.Feature, index: number, t: TFunction) => string;
|
|
5
6
|
export declare const DEFAULT_ADD_BUTTON_HEIGHT = 80;
|
|
6
7
|
export declare const DEFAULT_AREA_DRAWING_MANAGER_TAB_HEIGHT = 40;
|
|
@@ -23,7 +24,7 @@ export declare const Drawings: FC<{
|
|
|
23
24
|
onClickDrawing: (drawing: DrawingListItem) => void;
|
|
24
25
|
onClickEdit: (drawingId: string) => void;
|
|
25
26
|
onClickDelete: (drawingId: string) => void;
|
|
26
|
-
onClickShare: (drawing: DrawingListItem) => void;
|
|
27
|
+
onClickShare: (drawing: DrawingListItem, type: WarningType) => void;
|
|
27
28
|
onHoverDrawing: (drawing: DrawingListItem) => void;
|
|
28
29
|
onHoverDrawingEnd: () => void;
|
|
29
30
|
onHoverDrawingFeature?: (drawing: DrawingListItem, featureIndex: number) => void;
|
|
@@ -2,6 +2,7 @@ import type { FeatureCollection, GeoJsonProperties, Geometry } from 'geojson';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import type { DrawMode } from '@opengeoweb/webmap-react';
|
|
4
4
|
import type { DrawingToolFormValues } from './DrawingToolFormContents';
|
|
5
|
+
import type { DrawingListItem } from '../../store/warningsDrawings/types';
|
|
5
6
|
export declare const opacityOptions: number[];
|
|
6
7
|
export declare const getDrawingName: (drawingName: string) => string;
|
|
7
8
|
export interface DrawingToolFormComponentProps {
|
|
@@ -23,6 +24,12 @@ export interface DrawingToolFormComponentProps {
|
|
|
23
24
|
onDeleteFeature: (featureId: string) => void;
|
|
24
25
|
onFormDirty?: (isFormDirty: boolean) => void;
|
|
25
26
|
geoJSON: FeatureCollection<Geometry, GeoJsonProperties> | undefined;
|
|
27
|
+
masks?: DrawingListItem[];
|
|
28
|
+
isLoadingMasks?: boolean;
|
|
29
|
+
maskError?: string;
|
|
30
|
+
selectedMaskId?: string;
|
|
31
|
+
onSelectMask?: (maskId?: string) => void;
|
|
32
|
+
onHoverMask?: (maskId?: string) => void;
|
|
26
33
|
}
|
|
27
34
|
declare const Wrapper: React.FC<DrawingToolFormComponentProps>;
|
|
28
35
|
export { Wrapper as DrawingToolForm };
|
|
@@ -3,6 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import type { FieldArrayWithId, FieldErrors, FieldValues } from 'react-hook-form';
|
|
4
4
|
import type { DrawMode } from '@opengeoweb/webmap-react';
|
|
5
5
|
import type { DrawingObject } from './drawingObjectUtils';
|
|
6
|
+
import type { DrawingListItem } from '../../store/warningsDrawings/types';
|
|
6
7
|
export declare const opacityOptions: number[];
|
|
7
8
|
export interface DrawingToolObjectFormValue {
|
|
8
9
|
featureId: string;
|
|
@@ -34,6 +35,12 @@ export interface DrawingToolFormContentsProps {
|
|
|
34
35
|
onDeleteObject: (featureId: string) => void;
|
|
35
36
|
onSubmit: () => void;
|
|
36
37
|
geoJSONProperties?: GeoJSON.GeoJsonProperties;
|
|
38
|
+
masks: DrawingListItem[];
|
|
39
|
+
isLoadingMasks: boolean;
|
|
40
|
+
maskError?: string;
|
|
41
|
+
selectedMaskId?: string;
|
|
42
|
+
onSelectMask: (maskId?: string) => void;
|
|
43
|
+
onHoverMask: (maskId?: string) => void;
|
|
37
44
|
}
|
|
38
45
|
export declare const DrawingToolFormContentsNoMemo: React.FC<DrawingToolFormContentsProps>;
|
|
39
46
|
export declare const DrawingToolFormContents: React.NamedExoticComponent<DrawingToolFormContentsProps>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { DrawingListItem } from '../../store/warningsDrawings/types';
|
|
3
|
+
export interface DrawingToolFormMasksProps {
|
|
4
|
+
masks: DrawingListItem[];
|
|
5
|
+
selectedMaskId?: string;
|
|
6
|
+
onSelectMask: (maskId?: string) => void;
|
|
7
|
+
onHoverMask: (maskId?: string) => void;
|
|
8
|
+
isDisabled?: boolean;
|
|
9
|
+
isLoadingMasks?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const DrawingToolFormMasks: React.FC<DrawingToolFormMasksProps>;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { FieldValues } from 'react-hook-form';
|
|
2
|
+
import type { DrawingToolFormValues } from './DrawingToolFormContents';
|
|
1
3
|
export declare const MAX_OBJECT_NAME_LENGTH = 64;
|
|
2
4
|
export interface DrawingObject {
|
|
3
5
|
featureId: string;
|
|
@@ -38,3 +40,4 @@ export declare const isDuplicateObjectName: (objectName: string, objectNames: st
|
|
|
38
40
|
* @returns geoJSON including the object names
|
|
39
41
|
*/
|
|
40
42
|
export declare const addObjectNamesToGeoJSON: (geoJSON: GeoJSON.FeatureCollection, objectNamesByFeatureId: Record<string, string>) => GeoJSON.FeatureCollection;
|
|
43
|
+
export declare const getDrawingToSubmit: (formValues: FieldValues) => Omit<DrawingToolFormValues, "id" | "features">;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Feature, FeatureCollection, MultiPolygon, Polygon } from 'geojson';
|
|
2
|
+
import type { DrawingListItem, DrawingTransformation } from '../../store/warningsDrawings/types';
|
|
3
|
+
type MaskPolygon = Feature<Polygon | MultiPolygon>;
|
|
4
|
+
export declare const CLIPPED_RESULT_FILL_OPACITY = 0.4;
|
|
5
|
+
export declare const MASKED_FILL_OPACITY_KEY = "maskedFillOpacity";
|
|
6
|
+
export declare const getDrawnFeatureIndexes: (geoJSON: FeatureCollection) => number[];
|
|
7
|
+
export declare const getFeatureIndexesToHideFill: (geoJSON: FeatureCollection) => number[];
|
|
8
|
+
export declare const getFeatureIndexesToRestoreFill: (geoJSON: FeatureCollection) => number[];
|
|
9
|
+
export declare const restoreMaskedFillProperties: (properties: GeoJSON.GeoJsonProperties) => GeoJSON.GeoJsonProperties;
|
|
10
|
+
export declare const restoreMaskedFill: (geoJSON: FeatureCollection) => FeatureCollection;
|
|
11
|
+
export declare const getMaskPolygon: (mask: FeatureCollection) => MaskPolygon | null;
|
|
12
|
+
export declare const clipGeoJSONWithMask: (geoJSON: FeatureCollection, mask: FeatureCollection) => FeatureCollection;
|
|
13
|
+
export declare const findMaskForTransformation: (masks: DrawingListItem[], transformation?: DrawingTransformation) => DrawingListItem | undefined;
|
|
14
|
+
export declare const buildClippedHighlightGeoJSON: (clipped: FeatureCollection) => FeatureCollection;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DrawingListItem } from '../../store/warningsDrawings/types';
|
|
2
|
+
export declare const MASK_PREVIEW_FILL_OPACITY = 0;
|
|
3
|
+
export declare const getMaskPreviewLayerId: (mapId: string) => string;
|
|
4
|
+
export declare const getClippedResultLayerId: (mapId: string) => string;
|
|
5
|
+
export declare const buildMaskPreviewGeoJSON: (mask: DrawingListItem) => GeoJSON.FeatureCollection;
|
|
6
|
+
export declare const useMaskPreviewLayer: (mapId: string, mask?: DrawingListItem) => void;
|
|
7
|
+
export declare const useClippedResultLayer: (mapId: string, clippedGeoJSON?: GeoJSON.FeatureCollection) => void;
|
|
@@ -22,6 +22,18 @@ export declare enum Phenomenon {
|
|
|
22
22
|
lowTemp = "lowTemp",
|
|
23
23
|
coastalEvent = "coastalEvent"
|
|
24
24
|
}
|
|
25
|
+
export declare enum WarningEventPhenomenon {
|
|
26
|
+
fog = "fog",
|
|
27
|
+
freezingRain = "freezingRain",
|
|
28
|
+
highTemp = "highTemp",
|
|
29
|
+
lowTemp = "lowTemp",
|
|
30
|
+
rain = "rain",
|
|
31
|
+
snow = "snow",
|
|
32
|
+
thunderstorm = "thunderstorm",
|
|
33
|
+
waterspouts = "waterspouts",
|
|
34
|
+
wind = "wind",
|
|
35
|
+
coastalEvent = "coastalEvent"
|
|
36
|
+
}
|
|
25
37
|
export declare const emptyFilterId = "unspecified";
|
|
26
38
|
export declare const defaultDomainFilter: Record<Domain, boolean>;
|
|
27
39
|
export declare const domainLevels: Record<Domain, Level[]>;
|
|
@@ -30,14 +42,17 @@ export declare const defaultEmptyFilter: Record<string, boolean>;
|
|
|
30
42
|
export declare const defaultAreaFilter: Record<string, boolean>;
|
|
31
43
|
export declare const makeFilterFromList: <T extends string>(options: T[], value?: boolean) => Record<T | "unspecified", boolean>;
|
|
32
44
|
declare const AllPhenomena: {
|
|
33
|
-
readonly
|
|
34
|
-
readonly
|
|
35
|
-
readonly
|
|
45
|
+
readonly fog: WarningEventPhenomenon.fog;
|
|
46
|
+
readonly freezingRain: WarningEventPhenomenon.freezingRain;
|
|
47
|
+
readonly highTemp: WarningEventPhenomenon.highTemp;
|
|
48
|
+
readonly lowTemp: WarningEventPhenomenon.lowTemp;
|
|
49
|
+
readonly rain: WarningEventPhenomenon.rain;
|
|
50
|
+
readonly snow: WarningEventPhenomenon.snow;
|
|
51
|
+
readonly thunderstorm: WarningEventPhenomenon.thunderstorm;
|
|
52
|
+
readonly waterspouts: WarningEventPhenomenon.waterspouts;
|
|
53
|
+
readonly wind: WarningEventPhenomenon.wind;
|
|
54
|
+
readonly coastalEvent: WarningEventPhenomenon.coastalEvent;
|
|
36
55
|
readonly snowIce: Phenomenon.snowIce;
|
|
37
|
-
readonly rain: Phenomenon.rain;
|
|
38
|
-
readonly highTemp: Phenomenon.highTemp;
|
|
39
|
-
readonly lowTemp: Phenomenon.lowTemp;
|
|
40
|
-
readonly coastalEvent: Phenomenon.coastalEvent;
|
|
41
56
|
readonly EMBD_TS: SigmetPhenomena.EMBD_TS;
|
|
42
57
|
readonly EMBD_TSGR: SigmetPhenomena.EMBD_TSGR;
|
|
43
58
|
readonly FRQ_TS: SigmetPhenomena.FRQ_TS;
|
|
@@ -76,7 +91,7 @@ declare const AllPhenomena: {
|
|
|
76
91
|
export declare const AllPhenomenaKeys: Record<keyof typeof AllPhenomena, keyof typeof AllPhenomena>;
|
|
77
92
|
export declare const domainPhenomena: Record<Domain, Partial<keyof typeof AllPhenomenaKeys>[]>;
|
|
78
93
|
export declare const defaultPhenomenonFilter: Record<string, boolean>;
|
|
79
|
-
type OptionsType = Partial<Record<Domain | Level | Phenomenon, boolean>>;
|
|
94
|
+
type OptionsType = Partial<Record<Domain | Level | Phenomenon | WarningEventPhenomenon, boolean>>;
|
|
80
95
|
interface OptionsMetadata {
|
|
81
96
|
/** The number of selected options */
|
|
82
97
|
noSelectedOptions: number;
|
|
@@ -6,10 +6,12 @@ export interface SyncedWarningFeature {
|
|
|
6
6
|
geoJSON: GeoJSON.FeatureCollection;
|
|
7
7
|
}
|
|
8
8
|
export declare const getSelectedFormAreaIds: (selectedFormWarning?: Warning) => Set<string>;
|
|
9
|
-
export declare const
|
|
9
|
+
export declare const isUnsavedAviationCopy: (warning?: Warning) => boolean;
|
|
10
|
+
export declare const shouldExcludeWarningFromFeatureSync: ({ hiddenWarningIds, hasMatchingAreaId, selectedWarningId, warningIds, selectedFormWarning, }: {
|
|
10
11
|
hiddenWarningIds: Set<string>;
|
|
11
12
|
hasMatchingAreaId: boolean;
|
|
12
13
|
selectedWarningId?: string;
|
|
13
14
|
warningIds: string[];
|
|
15
|
+
selectedFormWarning?: Warning;
|
|
14
16
|
}) => boolean;
|
|
15
17
|
export declare const createWarningFeatureCollection: (allFeatures: SyncedWarningFeature[]) => GeoJSON.FeatureCollection<GeoJSON.Geometry, syncGroupsTypes.PotentialDataProperties | null>;
|
|
@@ -3,9 +3,11 @@ import type { FilterTranslation } from '../../../store/warningsFilters/types';
|
|
|
3
3
|
export declare const getWarningPhenomenaIcon: (key: string) => React.ReactElement | undefined;
|
|
4
4
|
export declare const getAviationPhenomenaIcon: (key: string) => React.ReactElement | undefined;
|
|
5
5
|
export declare const warningPhenomena: FilterTranslation[];
|
|
6
|
+
export declare const warningEventPhenomena: FilterTranslation[];
|
|
6
7
|
export declare const allPhenomenaDict: Record<string, FilterTranslation>;
|
|
7
8
|
export declare const getPhenomenaIcon: (key: string) => React.ReactElement | undefined;
|
|
8
9
|
export declare const Phenomenon: React.FC<{
|
|
9
10
|
isDisabled?: boolean;
|
|
10
11
|
isReadOnly?: boolean;
|
|
12
|
+
isWarningEvent?: boolean;
|
|
11
13
|
}>;
|
package/dist/src/lib/components/WarningEvents/WarningEventDialog/WarningEventDialogConnect.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { DraggableSize, Position } from '@opengeoweb/shared';
|
|
3
|
-
import type { MapPreset
|
|
3
|
+
import type { MapPreset } from '@opengeoweb/store';
|
|
4
|
+
import { uiTypes } from '@opengeoweb/store';
|
|
4
5
|
export interface WarningEventDialogConnectProps {
|
|
5
6
|
defaultMapPreset?: MapPreset;
|
|
6
7
|
bounds?: string;
|
package/dist/src/lib/components/WarningEvents/WarningEventDialog/WarningEventFormDialog.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { TFunction } from 'i18next';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import type { ConfirmationOptions, DraggableSize, Position } from '@opengeoweb/shared';
|
|
4
4
|
import type { MapPreset, uiTypes } from '@opengeoweb/store';
|
|
5
|
+
import type { DrawingListItem } from '../../../store/warningsDrawings/types';
|
|
5
6
|
import type { FormError } from '../../../store/warningsEventForm/reducer';
|
|
6
7
|
import type { WarningEvent } from '../../../store/warningsForm/types';
|
|
7
8
|
export declare const warningFormConfirmationOptions: (t: TFunction) => ConfirmationOptions;
|
|
@@ -19,6 +20,8 @@ export interface WarningEventFormDialogProps {
|
|
|
19
20
|
size?: DraggableSize;
|
|
20
21
|
source?: uiTypes.Source;
|
|
21
22
|
startPosition?: Position;
|
|
23
|
+
selectedDrawing?: DrawingListItem;
|
|
24
|
+
onAddDrawing?: () => void;
|
|
22
25
|
onClose: () => void;
|
|
23
26
|
onChangeFormMode?: (isReadOnly: boolean) => void;
|
|
24
27
|
onMouseDown?: () => void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { FieldErrors } from 'react-hook-form';
|
|
3
3
|
import type { MapPreset } from '@opengeoweb/store';
|
|
4
|
+
import type { DrawingListItem } from '../../../store/warningsDrawings/types';
|
|
4
5
|
import type { FormError } from '../../../store/warningsEventForm/reducer';
|
|
5
6
|
import type { WarningEvent } from '../../../store/warningsForm/types';
|
|
6
7
|
export declare const CROSS_FIELD_VALIDATIONS: Record<string, {
|
|
@@ -13,12 +14,14 @@ export interface WarningEventFormContentProps {
|
|
|
13
14
|
error?: FormError;
|
|
14
15
|
currentEventEditor?: string;
|
|
15
16
|
isSummaryDialogOpen?: boolean;
|
|
17
|
+
selectedDrawing?: DrawingListItem;
|
|
16
18
|
selectedEvent?: WarningEvent;
|
|
17
19
|
shouldHideFormToggleMode?: boolean;
|
|
18
20
|
isReadOnly?: boolean;
|
|
19
21
|
isSnapshot?: boolean;
|
|
20
22
|
isDefaultCollapsed?: boolean;
|
|
21
23
|
onCancel?: () => void;
|
|
24
|
+
onAddDrawing?: () => void;
|
|
22
25
|
onChangeFormMode?: (isReadOnly: boolean) => void;
|
|
23
26
|
onDelete?: () => void;
|
|
24
27
|
onFormDirty?: (isFormDirty: boolean) => void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { MapPreset } from '@opengeoweb/store';
|
|
3
|
+
import type { DrawingListItem } from '../../../store/warningsDrawings/types';
|
|
3
4
|
import { PublicWarningStatus } from '../../../store/warningsForm/types';
|
|
4
5
|
export declare const probablityOptions: {
|
|
5
6
|
name: string;
|
|
@@ -12,8 +13,10 @@ export declare const WarningEventItem: React.FC<{
|
|
|
12
13
|
isSnapshot?: boolean;
|
|
13
14
|
isCompact: boolean;
|
|
14
15
|
isDeleteButtonDisabled: boolean;
|
|
16
|
+
selectedDrawing?: DrawingListItem;
|
|
15
17
|
onExpireWithdraw: (status: PublicWarningStatus, index: number) => void;
|
|
16
18
|
onToggleCompact: () => void;
|
|
19
|
+
onAddDrawing: () => void;
|
|
17
20
|
onDeleteWarning: (index: number) => void;
|
|
18
21
|
}>;
|
|
19
22
|
export default WarningEventItem;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Feature, MultiPolygon, Polygon } from 'geojson';
|
|
1
2
|
import type { FieldValues, FormState } from 'react-hook-form';
|
|
2
3
|
import type { Area, WarningEventBody, WarningEvent } from '../../../store/warningsForm/types';
|
|
3
4
|
import { PublicWarningStatus } from '../../../store/warningsForm/types';
|
|
@@ -17,6 +18,8 @@ export declare const getEventStatusActions: (warnings: WarningEventBody[]) => {
|
|
|
17
18
|
hasPendingWarnings: boolean;
|
|
18
19
|
};
|
|
19
20
|
export declare const getWarningStatusesForEventAction: (warnings: WarningEventBody[], action: PublicWarningStatus.EXPIRED | PublicWarningStatus.WITHDRAWN) => (PublicWarningStatus | undefined)[];
|
|
21
|
+
export declare const isPolygonalFeature: (featureToCheck: GeoJSON.Feature) => featureToCheck is Feature<Polygon | MultiPolygon>;
|
|
22
|
+
export declare const hasAreaData: (areas?: Area[]) => boolean;
|
|
20
23
|
export declare const doAreasOverlap: (areasA?: Area[], areasB?: Area[]) => boolean;
|
|
21
24
|
export declare const doTimeRangesOverlap: (aFrom: string, aUntil: string, bFrom: string, bUntil: string) => boolean;
|
|
22
25
|
export declare const doWarningsOverlap: (warningA: WarningEventBody, warningB: WarningEventBody) => boolean;
|
package/dist/src/lib/components/WarningEvents/WarningEventSummaryDialog/WarningEventSummaryForm.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { TFunction } from 'i18next';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export declare const SUMMARY_HEADLINE_LIMIT = 150;
|
|
4
|
-
export declare const SUMMARY_CONCISE_SUMMARY_LIMIT =
|
|
5
|
-
export declare const SUMMARY_DESCRIPTION_LIMIT =
|
|
4
|
+
export declare const SUMMARY_CONCISE_SUMMARY_LIMIT = 1500;
|
|
5
|
+
export declare const SUMMARY_DESCRIPTION_LIMIT = 2500;
|
|
6
6
|
export declare const RemainingChars: React.FC<{
|
|
7
7
|
name: string;
|
|
8
8
|
limit: number;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { FeatureCollection } from 'geojson';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import type { MapPreset } from '@opengeoweb/store';
|
|
4
|
+
import type { ClickOnFeature, HoverSelect } from '@opengeoweb/webmap-react';
|
|
4
5
|
export declare const EXTENT_PADDING = 50;
|
|
5
6
|
interface WarningsMapViewProps {
|
|
6
7
|
geojsonFeature?: FeatureCollection | undefined;
|
|
@@ -12,6 +13,8 @@ interface WarningsMapViewProps {
|
|
|
12
13
|
};
|
|
13
14
|
showMapMousePosition?: boolean;
|
|
14
15
|
showZoomControls?: boolean;
|
|
16
|
+
clickOnFeature?: ClickOnFeature;
|
|
17
|
+
hoverSelect?: HoverSelect;
|
|
15
18
|
}
|
|
16
19
|
export declare const WarningsMapView: React.FC<WarningsMapViewProps>;
|
|
17
20
|
export {};
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Warning } from '../../store/warningsForm/types';
|
|
3
|
+
import type { WarningListItemActions } from '../PublicWarningList/WarningListItemMenu';
|
|
3
4
|
interface WarningBlockProps {
|
|
4
5
|
warning: Warning;
|
|
5
6
|
highlighted?: boolean;
|
|
6
7
|
left: number;
|
|
7
8
|
onHoverWarning?: (warningId?: string) => void;
|
|
9
|
+
onSelectWarning?: (warning: Warning) => void;
|
|
10
|
+
warningListItemActions?: WarningListItemActions;
|
|
8
11
|
top: number;
|
|
9
12
|
width: number;
|
|
10
13
|
}
|
|
11
|
-
export declare const WarningBlock: React.MemoExoticComponent<({ warning, highlighted, left, onHoverWarning, top, width, }: WarningBlockProps) => React.JSX.Element>;
|
|
14
|
+
export declare const WarningBlock: React.MemoExoticComponent<({ warning, highlighted, left, onHoverWarning, onSelectWarning, top, warningListItemActions, width, }: WarningBlockProps) => React.JSX.Element>;
|
|
12
15
|
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PublicWarningStatus } from '../../store/warningsForm/types';
|
|
3
|
+
import type { Warning } from '../../store/warningsForm/types';
|
|
4
|
+
import type { WarningListItemActions } from '../PublicWarningList/WarningListItemMenu';
|
|
5
|
+
import { WarningLevel } from '../PublicWarningsForm/LevelField';
|
|
6
|
+
interface WarningBlockMenuProps {
|
|
7
|
+
effectiveStatus: PublicWarningStatus;
|
|
8
|
+
hasWarningContent: boolean;
|
|
9
|
+
isAviation: boolean;
|
|
10
|
+
level: WarningLevel | null;
|
|
11
|
+
onMenuInteraction?: () => void;
|
|
12
|
+
onMenuLeave?: () => void;
|
|
13
|
+
warning: Warning;
|
|
14
|
+
warningListItemActions?: WarningListItemActions;
|
|
15
|
+
}
|
|
16
|
+
export declare const WarningBlockMenu: React.FC<WarningBlockMenuProps>;
|
|
17
|
+
export {};
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Warning } from '../../store/warningsForm/types';
|
|
3
|
+
import type { WarningListItemActions } from '../PublicWarningList/WarningListItemMenu';
|
|
3
4
|
export interface WarningsTimelineProps {
|
|
4
5
|
warnings?: Warning[];
|
|
5
6
|
hoveredWarningId?: string;
|
|
6
7
|
onHoverWarning?: (warningId?: string) => void;
|
|
8
|
+
onSelectWarning?: (warning: Warning) => void;
|
|
9
|
+
selectedWarningId?: string;
|
|
10
|
+
warningListItemActions?: WarningListItemActions;
|
|
7
11
|
}
|
|
8
12
|
export declare const WarningsTimeline: React.FC<WarningsTimelineProps>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { TickType } from './warningsTimelineUtils';
|
|
3
3
|
import type { Warning } from '../../store/warningsForm/types';
|
|
4
|
+
import type { WarningListItemActions } from '../PublicWarningList/WarningListItemMenu';
|
|
4
5
|
export interface PositionedTick {
|
|
5
6
|
time: Date;
|
|
6
7
|
type: TickType;
|
|
@@ -25,9 +26,12 @@ interface TimelineTimeBarProps extends TimelineBackgroundProps {
|
|
|
25
26
|
interface WarningBlocksLayerProps {
|
|
26
27
|
hoveredWarningId?: string;
|
|
27
28
|
onHoverWarning?: (warningId?: string) => void;
|
|
29
|
+
onSelectWarning?: (warning: Warning) => void;
|
|
30
|
+
selectedWarningId?: string;
|
|
31
|
+
warningListItemActions?: WarningListItemActions;
|
|
28
32
|
warningBlocks: WarningLayout[];
|
|
29
33
|
}
|
|
30
34
|
export declare const TimelineBackground: React.FC<TimelineBackgroundProps>;
|
|
31
|
-
export declare const WarningBlocksLayer: React.MemoExoticComponent<({ warningBlocks, hoveredWarningId, onHoverWarning, }: WarningBlocksLayerProps) => React.JSX.Element>;
|
|
35
|
+
export declare const WarningBlocksLayer: React.MemoExoticComponent<({ warningBlocks, hoveredWarningId, onHoverWarning, onSelectWarning, selectedWarningId, warningListItemActions, }: WarningBlocksLayerProps) => React.JSX.Element>;
|
|
32
36
|
export declare const TimelineTimeBar: React.FC<TimelineTimeBarProps>;
|
|
33
37
|
export {};
|
|
@@ -12,10 +12,15 @@ export interface BaseDrawingListItem {
|
|
|
12
12
|
objectName: string;
|
|
13
13
|
lastUpdatedTime: string;
|
|
14
14
|
}
|
|
15
|
+
export interface DrawingTransformation {
|
|
16
|
+
mask: GeoJSON.FeatureCollection;
|
|
17
|
+
original: GeoJSON.FeatureCollection;
|
|
18
|
+
}
|
|
15
19
|
export interface DrawingListItem extends BaseDrawingListItem {
|
|
16
20
|
scope: DrawingScope;
|
|
17
21
|
geoJSON: GeoJSON.FeatureCollection;
|
|
18
22
|
keywords?: string;
|
|
23
|
+
transformation?: DrawingTransformation;
|
|
19
24
|
}
|
|
20
25
|
export interface AreaListItem extends BaseDrawingListItem {
|
|
21
26
|
scope: DrawingScope;
|
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
import { uiTypes } from '@opengeoweb/store';
|
|
2
|
+
import type { AreaListItem, DrawingListItem } from './types';
|
|
2
3
|
export declare const areaDrawingDialogType = uiTypes.DialogTypes.AreaDrawingManager;
|
|
3
4
|
export declare const drawingDialogType = uiTypes.DialogTypes.DrawingTool;
|
|
4
5
|
export declare const areaDrawingLoaderType = uiTypes.DialogTypes.AreaDrawingLoader;
|
|
6
|
+
/**
|
|
7
|
+
* Returns the id to identify a single feature of a drawing by. Drawings saved
|
|
8
|
+
* with the drawing tool have a stable id on every feature (see
|
|
9
|
+
* `ensureFeatureIds` in the layer reducer), but drawings saved before that was
|
|
10
|
+
* introduced do not, so fall back to the position within the drawing.
|
|
11
|
+
* @param drawing The drawing the feature belongs to
|
|
12
|
+
* @param feature The feature to get the id for
|
|
13
|
+
* @param index The index of the feature within the drawing
|
|
14
|
+
* @returns id of the feature
|
|
15
|
+
*/
|
|
16
|
+
export declare const getDrawingFeatureId: (drawingId: string, feature: GeoJSON.Feature, index: number) => string;
|
|
17
|
+
/**
|
|
18
|
+
* Makes sure every feature of a drawing has an id, so single features can be
|
|
19
|
+
* identified, selected and assigned.
|
|
20
|
+
* @param drawing The drawing to add feature ids to
|
|
21
|
+
* @returns the drawing, with an id on every feature
|
|
22
|
+
*/
|
|
23
|
+
export declare const withDrawingFeatureIds: <T extends DrawingListItem | AreaListItem>(drawing: T) => T;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AlertColor } from '@mui/material';
|
|
2
2
|
import type { Draft, PayloadAction } from '@reduxjs/toolkit';
|
|
3
|
+
import type { DrawingListItem } from '../warningsDrawings/types';
|
|
3
4
|
import type { WarningEvent } from '../warningsForm/types';
|
|
4
5
|
export type FormAction = '' | 'saving' | 'publishing' | 'readonly' | 'edit' | 'amending' | 'cancel';
|
|
5
6
|
export interface FormError {
|
|
@@ -14,6 +15,7 @@ export interface WarningsEventFormState {
|
|
|
14
15
|
isFormDirty?: boolean;
|
|
15
16
|
warningType?: 'warningsEvent';
|
|
16
17
|
panelId?: string;
|
|
18
|
+
selectedDrawing?: DrawingListItem;
|
|
17
19
|
}
|
|
18
20
|
export declare const TAKEOVER_MESSAGE = "You are no longer the editor of this warning";
|
|
19
21
|
export declare const initialState: WarningsEventFormState;
|
|
@@ -34,4 +36,7 @@ export declare const warningsEventFormReducer: import("redux").Reducer<WarningsE
|
|
|
34
36
|
isFormDirty: boolean;
|
|
35
37
|
}>) => void;
|
|
36
38
|
setSelectedEventId: (draft: Draft<WarningsEventFormState>, action: PayloadAction<string>) => void;
|
|
39
|
+
setSelectedDrawing: (draft: Draft<WarningsEventFormState>, action: PayloadAction<{
|
|
40
|
+
drawing?: DrawingListItem;
|
|
41
|
+
}>) => void;
|
|
37
42
|
}, "warningsEventForm">;
|
|
@@ -64,3 +64,24 @@ export declare const getWarningsEventIsFormDirty: ((state: WarningModuleStore) =
|
|
|
64
64
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
65
65
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
66
66
|
};
|
|
67
|
+
export declare const getWarningsEventSelectedDrawing: ((state: WarningModuleStore) => import("../warningsDrawings/types").DrawingListItem | undefined) & {
|
|
68
|
+
clearCache: () => void;
|
|
69
|
+
resultsCount: () => number;
|
|
70
|
+
resetResultsCount: () => void;
|
|
71
|
+
} & {
|
|
72
|
+
resultFunc: (resultFuncArgs_0: WarningsEventFormState) => import("../warningsDrawings/types").DrawingListItem | undefined;
|
|
73
|
+
memoizedResultFunc: ((resultFuncArgs_0: WarningsEventFormState) => import("../warningsDrawings/types").DrawingListItem | undefined) & {
|
|
74
|
+
clearCache: () => void;
|
|
75
|
+
resultsCount: () => number;
|
|
76
|
+
resetResultsCount: () => void;
|
|
77
|
+
};
|
|
78
|
+
lastResult: () => import("../warningsDrawings/types").DrawingListItem | undefined;
|
|
79
|
+
dependencies: [(store: WarningModuleStore) => WarningsEventFormState];
|
|
80
|
+
recomputations: () => number;
|
|
81
|
+
resetRecomputations: () => void;
|
|
82
|
+
dependencyRecomputations: () => number;
|
|
83
|
+
resetDependencyRecomputations: () => void;
|
|
84
|
+
} & {
|
|
85
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
86
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
87
|
+
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { Draft, PayloadAction } from '@reduxjs/toolkit';
|
|
2
|
-
import type { ExpandedWarningSections, WarningsFiltersState } from './types';
|
|
2
|
+
import type { ExpandedWarningSections, WarningListActionRequest, WarningsFiltersState } from './types';
|
|
3
3
|
import type { FilterState } from '../../components/FilterList/filter-hooks';
|
|
4
4
|
export declare const defaultExpandedWarningSections: ExpandedWarningSections;
|
|
5
5
|
export declare const initialWarningFilterPanelState: {
|
|
6
6
|
expandedSections: ExpandedWarningSections;
|
|
7
7
|
hoveredWarningIds: never[];
|
|
8
8
|
hiddenWarningIds: never[];
|
|
9
|
+
warningListActionRequest: undefined;
|
|
9
10
|
source: Record<string, boolean>;
|
|
10
11
|
domain: Record<import("../../components/FilterList/filter-utils").Domain, boolean>;
|
|
11
12
|
phenomenon: Record<string, boolean>;
|
|
@@ -33,4 +34,11 @@ export declare const warningsFiltersReducer: import("redux").Reducer<WarningsFil
|
|
|
33
34
|
panelId: string;
|
|
34
35
|
warningIds?: string[];
|
|
35
36
|
}>) => void;
|
|
37
|
+
requestWarningListAction: (draft: Draft<WarningsFiltersState>, action: PayloadAction<{
|
|
38
|
+
panelId: string;
|
|
39
|
+
request: WarningListActionRequest;
|
|
40
|
+
}>) => void;
|
|
41
|
+
clearWarningListActionRequest: (draft: Draft<WarningsFiltersState>, action: PayloadAction<{
|
|
42
|
+
panelId: string;
|
|
43
|
+
}>) => void;
|
|
36
44
|
}, "warningsFilters">;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { FilterState } from '../../components/FilterList/filter-hooks';
|
|
2
2
|
import type { WarningModuleStore } from '../types';
|
|
3
|
-
import type { ExpandedWarningSections, WarningsFilterPanelState, WarningsFiltersState } from './types';
|
|
3
|
+
import type { ExpandedWarningSections, WarningListActionRequest, WarningsFilterPanelState, WarningsFiltersState } from './types';
|
|
4
4
|
export declare const getWarningsFilters: (store: WarningModuleStore) => WarningsFiltersState;
|
|
5
5
|
export declare const getWarningsFilterById: ((state: WarningModuleStore, panelId?: string | undefined) => FilterState) & {
|
|
6
6
|
clearCache: () => void;
|
|
@@ -166,6 +166,47 @@ export declare const getHiddenWarningIdsByPanelId: ((state: WarningModuleStore,
|
|
|
166
166
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
167
167
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
168
168
|
};
|
|
169
|
+
export declare const getWarningListActionRequestByPanelId: ((state: WarningModuleStore, panelId?: string | undefined) => WarningListActionRequest | undefined) & {
|
|
170
|
+
clearCache: () => void;
|
|
171
|
+
resultsCount: () => number;
|
|
172
|
+
resetResultsCount: () => void;
|
|
173
|
+
} & {
|
|
174
|
+
resultFunc: (resultFuncArgs_0: WarningsFilterPanelState | undefined) => WarningListActionRequest | undefined;
|
|
175
|
+
memoizedResultFunc: ((resultFuncArgs_0: WarningsFilterPanelState | undefined) => WarningListActionRequest | undefined) & {
|
|
176
|
+
clearCache: () => void;
|
|
177
|
+
resultsCount: () => number;
|
|
178
|
+
resetResultsCount: () => void;
|
|
179
|
+
};
|
|
180
|
+
lastResult: () => WarningListActionRequest | undefined;
|
|
181
|
+
dependencies: [((state: WarningModuleStore, panelId?: string | undefined) => WarningsFilterPanelState | undefined) & {
|
|
182
|
+
clearCache: () => void;
|
|
183
|
+
resultsCount: () => number;
|
|
184
|
+
resetResultsCount: () => void;
|
|
185
|
+
} & {
|
|
186
|
+
resultFunc: (resultFuncArgs_0: WarningsFiltersState, resultFuncArgs_1: string | undefined) => WarningsFilterPanelState | undefined;
|
|
187
|
+
memoizedResultFunc: ((resultFuncArgs_0: WarningsFiltersState, resultFuncArgs_1: string | undefined) => WarningsFilterPanelState | undefined) & {
|
|
188
|
+
clearCache: () => void;
|
|
189
|
+
resultsCount: () => number;
|
|
190
|
+
resetResultsCount: () => void;
|
|
191
|
+
};
|
|
192
|
+
lastResult: () => WarningsFilterPanelState | undefined;
|
|
193
|
+
dependencies: [(store: WarningModuleStore) => WarningsFiltersState, (_store: WarningModuleStore, panelId?: string) => string | undefined];
|
|
194
|
+
recomputations: () => number;
|
|
195
|
+
resetRecomputations: () => void;
|
|
196
|
+
dependencyRecomputations: () => number;
|
|
197
|
+
resetDependencyRecomputations: () => void;
|
|
198
|
+
} & {
|
|
199
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
200
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
201
|
+
}];
|
|
202
|
+
recomputations: () => number;
|
|
203
|
+
resetRecomputations: () => void;
|
|
204
|
+
dependencyRecomputations: () => number;
|
|
205
|
+
resetDependencyRecomputations: () => void;
|
|
206
|
+
} & {
|
|
207
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
208
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
209
|
+
};
|
|
169
210
|
export declare const getWarningsPresetById: ((state: WarningModuleStore, panelId?: string | undefined) => {
|
|
170
211
|
filterState: null;
|
|
171
212
|
expandedSections: null;
|
|
@@ -1,4 +1,29 @@
|
|
|
1
1
|
import type { FilterState } from '../../components/FilterList/filter-hooks';
|
|
2
|
+
import type { Warning } from '../warningsForm/types';
|
|
3
|
+
export type WarningListActionRequest = {
|
|
4
|
+
type: 'edit';
|
|
5
|
+
warning: Warning;
|
|
6
|
+
} | {
|
|
7
|
+
type: 'delete';
|
|
8
|
+
warning: Warning;
|
|
9
|
+
} | {
|
|
10
|
+
type: 'deleteReview';
|
|
11
|
+
warning: Warning;
|
|
12
|
+
} | {
|
|
13
|
+
type: 'expire';
|
|
14
|
+
warning: Warning;
|
|
15
|
+
} | {
|
|
16
|
+
type: 'withdraw';
|
|
17
|
+
warning: Warning;
|
|
18
|
+
} | {
|
|
19
|
+
type: 'aviation';
|
|
20
|
+
warning: Warning;
|
|
21
|
+
actionType?: string;
|
|
22
|
+
} | {
|
|
23
|
+
type: 'maritime';
|
|
24
|
+
warning: Warning;
|
|
25
|
+
actionType?: string;
|
|
26
|
+
};
|
|
2
27
|
export interface FilterTranslation {
|
|
3
28
|
translationKey: string;
|
|
4
29
|
key: string;
|
|
@@ -14,5 +39,6 @@ export interface WarningsFilterPanelState extends FilterState {
|
|
|
14
39
|
expandedSections: ExpandedWarningSections;
|
|
15
40
|
hoveredWarningIds: string[];
|
|
16
41
|
hiddenWarningIds: string[];
|
|
42
|
+
warningListActionRequest?: WarningListActionRequest;
|
|
17
43
|
}
|
|
18
44
|
export type WarningsFiltersState = Record<string, WarningsFilterPanelState>;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { Airmet, CancelAirmet, CancelSigmet, ProductStatus, Sigmet } from '@opengeoweb/api';
|
|
2
|
+
import type { DrawingListItem } from '../warningsDrawings/types';
|
|
2
3
|
export interface Area {
|
|
3
4
|
objectName: string;
|
|
4
5
|
geoJSON: GeoJSON.FeatureCollection;
|
|
5
6
|
areaId?: string;
|
|
6
7
|
published_warning_uuid?: string;
|
|
8
|
+
id?: string;
|
|
7
9
|
}
|
|
8
10
|
export interface WarningBodyBase {
|
|
9
11
|
id?: string;
|
|
@@ -114,6 +116,7 @@ export interface WarningEvent {
|
|
|
114
116
|
texts: WarningEventTexts;
|
|
115
117
|
linked_to_id?: string;
|
|
116
118
|
mode: WarningEventMode;
|
|
119
|
+
selectedDrawing?: DrawingListItem;
|
|
117
120
|
}
|
|
118
121
|
export type Warning = PublicWarning | AirmetWarning | SigmetWarning | MaritimeWarning | EventWarningForWarningList;
|
|
119
122
|
export {};
|