@opengeoweb/warnings 19.3.0 → 19.5.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 +6518 -2642
- package/dist/src/index.d.ts +1 -1
- package/dist/src/lib/api/warning-api/hooks.d.ts +24 -3
- package/dist/src/lib/components/{AreaObjectLoader/AreaObjectFilter.d.ts → AreaDrawingLoader/AreaDrawingFilter.d.ts} +2 -2
- package/dist/src/lib/components/{AreaObjectLoader/AreaObjectLoader.d.ts → AreaDrawingLoader/AreaDrawingLoader.d.ts} +3 -3
- package/dist/src/lib/components/{ObjectManager/ObjectManagerConnect.d.ts → AreaDrawingLoader/AreaDrawingLoaderConnect.d.ts} +1 -1
- package/dist/src/lib/components/{AreaObjectLoader/AreasObjects.d.ts → AreaDrawingLoader/AreasDrawings.d.ts} +4 -4
- package/dist/src/lib/components/{ObjectManager/ObjectManager.d.ts → AreaDrawingManager/AreaDrawingManager.d.ts} +3 -3
- package/dist/src/lib/components/{AreaObjectLoader/AreaObjectLoaderConnect.d.ts → AreaDrawingManager/AreaDrawingManagerConnect.d.ts} +1 -1
- package/dist/src/lib/components/{ObjectManager/ObjectManagerMapButtonConnect.d.ts → AreaDrawingManager/AreaDrawingManagerMapButtonConnect.d.ts} +1 -1
- package/dist/src/lib/components/AreaDrawingManager/ConfirmDeleteDialog.d.ts +10 -0
- package/dist/src/lib/components/{ObjectManager/Objects.d.ts → AreaDrawingManager/Drawings.d.ts} +10 -10
- package/dist/src/lib/components/AreaDrawingManager/index.d.ts +2 -0
- package/dist/src/lib/components/DrawingTool/index.d.ts +1 -1
- package/dist/src/lib/components/DrawingTool/{useObjectDrawDialogAction.d.ts → useDrawingDialogAction.d.ts} +5 -5
- package/dist/src/lib/components/DrawingToolForm/DrawingToolForm.d.ts +2 -2
- package/dist/src/lib/components/PublicWarningList/PublicWarningList.d.ts +1 -0
- package/dist/src/lib/components/PublicWarningList/WarningListItem.d.ts +1 -0
- package/dist/src/lib/components/PublicWarningList/WarningListItemMenu.d.ts +1 -1
- package/dist/src/lib/components/PublicWarningsForm/AreaField/AreaField.d.ts +4 -4
- package/dist/src/lib/components/PublicWarningsForm/PublicWarningsForm.d.ts +1 -2
- package/dist/src/lib/components/PublicWarningsFormDialog/PublicWarningsFormDialogConnect.d.ts +0 -1
- package/dist/src/lib/components/WarningEvents/WarningEventDialog/WarningEventDialogConnect.d.ts +6 -4
- package/dist/src/lib/components/WarningEvents/WarningEventDialog/WarningEventFormDialog.d.ts +38 -0
- package/dist/src/lib/components/WarningEvents/WarningEventDialog/index.d.ts +3 -0
- package/dist/src/lib/components/WarningEvents/WarningEventDialog/utils.d.ts +16 -0
- package/dist/src/lib/components/WarningEvents/WarningEventForm/CollapseToggleButton.d.ts +9 -0
- package/dist/src/lib/components/WarningEvents/WarningEventForm/WarningEventFormContent.d.ts +20 -2
- package/dist/src/lib/components/WarningEvents/WarningEventForm/WarningEventItem.d.ts +12 -2
- package/dist/src/lib/components/WarningEvents/WarningEventForm/WarningEventTimeline/WarningEventTimeline.d.ts +6 -1
- package/dist/src/lib/components/WarningEvents/WarningEventForm/WarningEventTimeline/WarningEventTimelineBlock.d.ts +9 -0
- package/dist/src/lib/components/WarningEvents/WarningEventForm/WarningEventTimeline/WarningEventTimelineBlockControls.d.ts +15 -0
- package/dist/src/lib/components/WarningEvents/WarningEventForm/WarningEventTimeline/timelineTestUtils.d.ts +4 -0
- package/dist/src/lib/components/WarningEvents/WarningEventForm/WarningEventTimeline/useBlockDrag.d.ts +26 -0
- package/dist/src/lib/components/WarningEvents/WarningEventForm/WarningEventTimeline/useModifierKeyHeld.d.ts +1 -0
- package/dist/src/lib/components/WarningEvents/WarningEventForm/WarningEventTimeline/warningEventTimelineDragUtils.d.ts +37 -0
- package/dist/src/lib/components/WarningEvents/WarningEventForm/types.d.ts +13 -2
- package/dist/src/lib/components/WarningEvents/WarningEventForm/utils.d.ts +13 -0
- package/dist/src/lib/components/WarningEvents/WarningEventForm/warningEventStoryData.d.ts +13 -1
- package/dist/src/lib/components/WarningEvents/WarningEventSummaryDialog/WarningEventSummaryDialog.d.ts +2 -0
- package/dist/src/lib/components/WarningEvents/WarningEventSummaryDialog/WarningEventSummaryForm.d.ts +5 -1
- package/dist/src/lib/components/WarningsMapView/WarningsMapView.d.ts +6 -0
- package/dist/src/lib/store/types.d.ts +2 -0
- package/dist/src/lib/store/warningsDrawings/utils.d.ts +2 -2
- package/dist/src/lib/store/warningsEventForm/index.d.ts +2 -0
- package/dist/src/lib/store/warningsEventForm/listener.d.ts +2 -0
- package/dist/src/lib/store/warningsEventForm/reducer.d.ts +37 -0
- package/dist/src/lib/store/warningsEventForm/selectors.d.ts +66 -0
- package/dist/src/lib/store/warningsFilters/reducer.d.ts +5 -0
- package/dist/src/lib/store/warningsFilters/selectors.d.ts +41 -0
- package/dist/src/lib/store/warningsFilters/types.d.ts +1 -0
- package/dist/src/lib/store/warningsForm/types.d.ts +27 -8
- package/dist/src/lib/store/warningsForm/utils.d.ts +1 -0
- package/dist/src/lib/storybookUtils/testUtils.d.ts +1 -0
- package/dist/src/lib/utils/fakeApi/index.d.ts +3 -2
- package/dist/src/lib/utils/warningUtils.d.ts +10 -1
- package/package.json +2 -1
- package/dist/src/lib/components/ObjectManager/ConfirmDeleteDialog.d.ts +0 -10
- package/dist/src/lib/components/ObjectManager/index.d.ts +0 -2
- /package/dist/src/lib/components/{ObjectManager → AreaDrawingManager}/Areas.d.ts +0 -0
|
@@ -1,11 +1,22 @@
|
|
|
1
|
-
import type { WarningEvent } from '../../../store/warningsForm/types';
|
|
2
|
-
import { WarningEventType } from '../../../store/warningsForm/types';
|
|
1
|
+
import type { WarningEvent, WarningEventBody } from '../../../store/warningsForm/types';
|
|
2
|
+
import { WarningEventMode, WarningEventType } from '../../../store/warningsForm/types';
|
|
3
3
|
export declare const warningEventTypes: {
|
|
4
4
|
translationKey: string;
|
|
5
5
|
key: WarningEventType;
|
|
6
6
|
defaultDayRange: [number, number];
|
|
7
7
|
minSelectableDay: number;
|
|
8
8
|
}[];
|
|
9
|
+
export declare const warningEventModes: {
|
|
10
|
+
translationKey: string;
|
|
11
|
+
key: WarningEventMode;
|
|
12
|
+
}[];
|
|
9
13
|
export declare const getDefaultDayRangeForType: (type: WarningEventType) => [number, number];
|
|
10
14
|
export declare const getMinSelectableDayForType: (type: WarningEventType) => number;
|
|
15
|
+
export declare const getDefaultWarningTimes: (type: WarningEventType, now?: Date) => {
|
|
16
|
+
validFrom: string;
|
|
17
|
+
validUntil: string;
|
|
18
|
+
};
|
|
11
19
|
export declare const defaultValues: WarningEvent;
|
|
20
|
+
export declare const warningEventItemDefaultValues: WarningEventBody;
|
|
21
|
+
export declare const buildDefaultWarningItem: (event: Pick<WarningEvent, "warningEventType" | "incident" | "phenomenon">) => WarningEventBody;
|
|
22
|
+
export declare const getDefaultValues: (initialValues?: Partial<WarningEvent>) => WarningEvent;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Area, WarningEventBody, WarningEvent } from '../../../store/warningsForm/types';
|
|
2
|
+
import { PublicWarningStatus } from '../../../store/warningsForm/types';
|
|
3
|
+
interface FormData extends WarningEvent {
|
|
4
|
+
IS_DRAFT?: boolean | string;
|
|
5
|
+
}
|
|
6
|
+
export declare const buildSubmitValues: (values: FormData) => WarningEvent;
|
|
7
|
+
export declare const getFormData: (warningsEvent: WarningEvent | undefined) => FormData;
|
|
8
|
+
export declare const constructWarningWithNewStatus: (warningsEvent: WarningEvent, status: PublicWarningStatus) => WarningEventBody[];
|
|
9
|
+
export declare const doAreasOverlap: (areasA?: Area[], areasB?: Area[]) => boolean;
|
|
10
|
+
export declare const doTimeRangesOverlap: (aFrom: string, aUntil: string, bFrom: string, bUntil: string) => boolean;
|
|
11
|
+
export declare const doWarningsOverlap: (warningA: WarningEventBody, warningB: WarningEventBody) => boolean;
|
|
12
|
+
export declare const getOverlappingWarnings: (warnings: WarningEventBody[], index: number) => number[];
|
|
13
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { WarningEvent } from '../../../store/warningsForm/types';
|
|
1
|
+
import type { Area, WarningEvent } from '../../../store/warningsForm/types';
|
|
2
2
|
export declare const emptyWarning: {
|
|
3
3
|
incident: string;
|
|
4
4
|
validFrom: string;
|
|
@@ -11,4 +11,16 @@ export declare const emptyWarning: {
|
|
|
11
11
|
type: number;
|
|
12
12
|
warning_handle_uuid: string;
|
|
13
13
|
};
|
|
14
|
+
export declare const eventTexts: {
|
|
15
|
+
headlineOriginal: string;
|
|
16
|
+
headlineTranslation: string;
|
|
17
|
+
conciseSummaryOriginal: string;
|
|
18
|
+
conciseSummaryTranslation: string;
|
|
19
|
+
descriptionOriginal: string;
|
|
20
|
+
descriptionTranslation: string;
|
|
21
|
+
};
|
|
22
|
+
export declare const warningAreas1: Area[];
|
|
23
|
+
export declare const warningAreas2: Area[];
|
|
24
|
+
export declare const warningAreas3: Area[];
|
|
25
|
+
export declare const buildEarlyWarningInitialValues: () => Partial<WarningEvent>;
|
|
14
26
|
export declare const buildLiveInitialValues: () => Partial<WarningEvent>;
|
|
@@ -7,9 +7,11 @@ export declare const WarningEventSummaryDialog: React.FC<{
|
|
|
7
7
|
onClose: () => void;
|
|
8
8
|
onMouseDown?: () => void;
|
|
9
9
|
isOpen: boolean;
|
|
10
|
+
isReadOnly: boolean;
|
|
10
11
|
order?: number;
|
|
11
12
|
source?: uiTypes.Source;
|
|
12
13
|
size?: DraggableSize;
|
|
13
14
|
startPosition?: Position;
|
|
14
15
|
headerSize?: HeaderSize;
|
|
16
|
+
onClickAdd?: () => void;
|
|
15
17
|
}>;
|
package/dist/src/lib/components/WarningEvents/WarningEventSummaryDialog/WarningEventSummaryForm.d.ts
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import type { TFunction } from 'i18next';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
export declare const SUMMARY_HEADLINE_LIMIT = 150;
|
|
4
|
+
export declare const SUMMARY_CONCISE_SUMMARY_LIMIT = 500;
|
|
5
|
+
export declare const SUMMARY_DESCRIPTION_LIMIT = 1500;
|
|
3
6
|
export declare const RemainingChars: React.FC<{
|
|
4
|
-
|
|
7
|
+
name: string;
|
|
5
8
|
limit: number;
|
|
6
9
|
t: TFunction<'warn'>;
|
|
7
10
|
}>;
|
|
8
11
|
interface FormProps {
|
|
9
12
|
isReadOnly?: boolean;
|
|
13
|
+
onClickAdd?: () => void;
|
|
10
14
|
}
|
|
11
15
|
export declare const WarningEventSummaryForm: React.FC<FormProps>;
|
|
12
16
|
export {};
|
|
@@ -6,6 +6,12 @@ interface WarningsMapViewProps {
|
|
|
6
6
|
geojsonFeature?: FeatureCollection | undefined;
|
|
7
7
|
defaultMapPreset?: MapPreset;
|
|
8
8
|
isSnapshot?: boolean;
|
|
9
|
+
size?: {
|
|
10
|
+
height: string;
|
|
11
|
+
width: string;
|
|
12
|
+
};
|
|
13
|
+
showMapMousePosition?: boolean;
|
|
14
|
+
showZoomControls?: boolean;
|
|
9
15
|
}
|
|
10
16
|
export declare const WarningsMapView: React.FC<WarningsMapViewProps>;
|
|
11
17
|
export {};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { CoreAppStore } from '@opengeoweb/store';
|
|
2
2
|
import type { DrawState } from './warningsDrawings/types';
|
|
3
|
+
import type { WarningsEventFormState } from './warningsEventForm/reducer';
|
|
3
4
|
import type { WarningsFiltersState } from './warningsFilters/types';
|
|
4
5
|
import type { WarningFormState } from './warningsForm/reducer';
|
|
5
6
|
export interface WarningModuleStore extends CoreAppStore {
|
|
6
7
|
drawings?: DrawState;
|
|
8
|
+
warningsEventForm?: WarningsEventFormState;
|
|
7
9
|
warningsForm?: WarningFormState;
|
|
8
10
|
warningsFilters?: WarningsFiltersState;
|
|
9
11
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { uiTypes } from '@opengeoweb/store';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const areaDrawingDialogType = uiTypes.DialogTypes.AreaDrawingManager;
|
|
3
3
|
export declare const drawingDialogType = uiTypes.DialogTypes.DrawingTool;
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const areaDrawingLoaderType = uiTypes.DialogTypes.AreaDrawingLoader;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import type { WarningModuleStore } from '../types';
|
|
2
|
+
export declare const warningsEventFormListener: import("@reduxjs/toolkit").ListenerMiddlewareInstance<WarningModuleStore, import("redux-thunk").ThunkDispatch<WarningModuleStore, unknown, import("redux").UnknownAction>, unknown>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { AlertColor } from '@mui/material';
|
|
2
|
+
import type { Draft, PayloadAction } from '@reduxjs/toolkit';
|
|
3
|
+
import type { WarningEvent } from '../warningsForm/types';
|
|
4
|
+
export type FormAction = '' | 'saving' | 'publishing' | 'readonly' | 'edit' | 'amending' | 'cancel';
|
|
5
|
+
export interface FormError {
|
|
6
|
+
severity?: AlertColor;
|
|
7
|
+
message: string;
|
|
8
|
+
}
|
|
9
|
+
export interface WarningsEventFormState {
|
|
10
|
+
event?: WarningEvent;
|
|
11
|
+
formState?: FormAction;
|
|
12
|
+
error?: FormError;
|
|
13
|
+
selectedEventId?: string;
|
|
14
|
+
isFormDirty?: boolean;
|
|
15
|
+
warningType?: 'warningsEvent';
|
|
16
|
+
panelId?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare const TAKEOVER_MESSAGE = "You are no longer the editor of this warning";
|
|
19
|
+
export declare const initialState: WarningsEventFormState;
|
|
20
|
+
export declare const warningsEventFormReducer: import("redux").Reducer<WarningsEventFormState>, warningsEventFormActions: import("@reduxjs/toolkit").CaseReducerActions<{
|
|
21
|
+
setFormValues: (draft: Draft<WarningsEventFormState>, action: PayloadAction<{
|
|
22
|
+
event?: WarningEvent;
|
|
23
|
+
formState?: FormAction;
|
|
24
|
+
}>) => void;
|
|
25
|
+
openWarningsEventFormDialog: (draft: Draft<WarningsEventFormState>, action: PayloadAction<{
|
|
26
|
+
formState?: FormAction;
|
|
27
|
+
event?: WarningEvent;
|
|
28
|
+
panelId?: string;
|
|
29
|
+
selectedEventId?: string;
|
|
30
|
+
}>) => void;
|
|
31
|
+
setFormError: (draft: Draft<WarningsEventFormState>, action: PayloadAction<FormError>) => void;
|
|
32
|
+
removeFormError: (draft: Draft<WarningsEventFormState>) => void;
|
|
33
|
+
setFormDirty: (draft: Draft<WarningsEventFormState>, action: PayloadAction<{
|
|
34
|
+
isFormDirty: boolean;
|
|
35
|
+
}>) => void;
|
|
36
|
+
setSelectedEventId: (draft: Draft<WarningsEventFormState>, action: PayloadAction<string>) => void;
|
|
37
|
+
}, "warningsEventForm">;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { WarningModuleStore } from '../types';
|
|
2
|
+
import type { WarningsEventFormState } from './reducer';
|
|
3
|
+
export declare const selectWarningsEventFormState: (store: WarningModuleStore) => WarningsEventFormState;
|
|
4
|
+
export declare const getWarningEvent: ((state: WarningModuleStore) => import("../warningsForm/types").WarningEvent | undefined) & {
|
|
5
|
+
clearCache: () => void;
|
|
6
|
+
resultsCount: () => number;
|
|
7
|
+
resetResultsCount: () => void;
|
|
8
|
+
} & {
|
|
9
|
+
resultFunc: (resultFuncArgs_0: WarningsEventFormState) => import("../warningsForm/types").WarningEvent | undefined;
|
|
10
|
+
memoizedResultFunc: ((resultFuncArgs_0: WarningsEventFormState) => import("../warningsForm/types").WarningEvent | undefined) & {
|
|
11
|
+
clearCache: () => void;
|
|
12
|
+
resultsCount: () => number;
|
|
13
|
+
resetResultsCount: () => void;
|
|
14
|
+
};
|
|
15
|
+
lastResult: () => import("../warningsForm/types").WarningEvent | undefined;
|
|
16
|
+
dependencies: [(store: WarningModuleStore) => WarningsEventFormState];
|
|
17
|
+
recomputations: () => number;
|
|
18
|
+
resetRecomputations: () => void;
|
|
19
|
+
dependencyRecomputations: () => number;
|
|
20
|
+
resetDependencyRecomputations: () => void;
|
|
21
|
+
} & {
|
|
22
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
23
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
24
|
+
};
|
|
25
|
+
export declare const getSelectedEventId: ((state: WarningModuleStore) => string) & {
|
|
26
|
+
clearCache: () => void;
|
|
27
|
+
resultsCount: () => number;
|
|
28
|
+
resetResultsCount: () => void;
|
|
29
|
+
} & {
|
|
30
|
+
resultFunc: (resultFuncArgs_0: WarningsEventFormState) => string;
|
|
31
|
+
memoizedResultFunc: ((resultFuncArgs_0: WarningsEventFormState) => string) & {
|
|
32
|
+
clearCache: () => void;
|
|
33
|
+
resultsCount: () => number;
|
|
34
|
+
resetResultsCount: () => void;
|
|
35
|
+
};
|
|
36
|
+
lastResult: () => string;
|
|
37
|
+
dependencies: [(store: WarningModuleStore) => WarningsEventFormState];
|
|
38
|
+
recomputations: () => number;
|
|
39
|
+
resetRecomputations: () => void;
|
|
40
|
+
dependencyRecomputations: () => number;
|
|
41
|
+
resetDependencyRecomputations: () => void;
|
|
42
|
+
} & {
|
|
43
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
44
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
45
|
+
};
|
|
46
|
+
export declare const getWarningsEventIsFormDirty: ((state: WarningModuleStore) => boolean) & {
|
|
47
|
+
clearCache: () => void;
|
|
48
|
+
resultsCount: () => number;
|
|
49
|
+
resetResultsCount: () => void;
|
|
50
|
+
} & {
|
|
51
|
+
resultFunc: (resultFuncArgs_0: WarningsEventFormState) => boolean;
|
|
52
|
+
memoizedResultFunc: ((resultFuncArgs_0: WarningsEventFormState) => boolean) & {
|
|
53
|
+
clearCache: () => void;
|
|
54
|
+
resultsCount: () => number;
|
|
55
|
+
resetResultsCount: () => void;
|
|
56
|
+
};
|
|
57
|
+
lastResult: () => boolean;
|
|
58
|
+
dependencies: [(store: WarningModuleStore) => WarningsEventFormState];
|
|
59
|
+
recomputations: () => number;
|
|
60
|
+
resetRecomputations: () => void;
|
|
61
|
+
dependencyRecomputations: () => number;
|
|
62
|
+
resetDependencyRecomputations: () => void;
|
|
63
|
+
} & {
|
|
64
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
65
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
66
|
+
};
|
|
@@ -5,6 +5,7 @@ export declare const defaultExpandedWarningSections: ExpandedWarningSections;
|
|
|
5
5
|
export declare const initialWarningFilterPanelState: {
|
|
6
6
|
expandedSections: ExpandedWarningSections;
|
|
7
7
|
hoveredWarningIds: never[];
|
|
8
|
+
hiddenWarningIds: never[];
|
|
8
9
|
source: Record<string, boolean>;
|
|
9
10
|
domain: Record<import("../../components/FilterList/filter-utils").Domain, boolean>;
|
|
10
11
|
phenomenon: Record<string, boolean>;
|
|
@@ -27,4 +28,8 @@ export declare const warningsFiltersReducer: import("redux").Reducer<WarningsFil
|
|
|
27
28
|
panelId: string;
|
|
28
29
|
warningIds?: string[];
|
|
29
30
|
}>) => void;
|
|
31
|
+
setHiddenWarningIdsForPanel: (draft: Draft<WarningsFiltersState>, action: PayloadAction<{
|
|
32
|
+
panelId: string;
|
|
33
|
+
warningIds?: string[];
|
|
34
|
+
}>) => void;
|
|
30
35
|
}, "warningsFilters">;
|
|
@@ -125,6 +125,47 @@ export declare const getHoveredWarningIdsByPanelId: ((state: WarningModuleStore,
|
|
|
125
125
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
126
126
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
127
127
|
};
|
|
128
|
+
export declare const getHiddenWarningIdsByPanelId: ((state: WarningModuleStore, panelId?: string | undefined) => string[]) & {
|
|
129
|
+
clearCache: () => void;
|
|
130
|
+
resultsCount: () => number;
|
|
131
|
+
resetResultsCount: () => void;
|
|
132
|
+
} & {
|
|
133
|
+
resultFunc: (resultFuncArgs_0: WarningsFilterPanelState | undefined) => string[];
|
|
134
|
+
memoizedResultFunc: ((resultFuncArgs_0: WarningsFilterPanelState | undefined) => string[]) & {
|
|
135
|
+
clearCache: () => void;
|
|
136
|
+
resultsCount: () => number;
|
|
137
|
+
resetResultsCount: () => void;
|
|
138
|
+
};
|
|
139
|
+
lastResult: () => string[];
|
|
140
|
+
dependencies: [((state: WarningModuleStore, panelId?: string | undefined) => WarningsFilterPanelState | undefined) & {
|
|
141
|
+
clearCache: () => void;
|
|
142
|
+
resultsCount: () => number;
|
|
143
|
+
resetResultsCount: () => void;
|
|
144
|
+
} & {
|
|
145
|
+
resultFunc: (resultFuncArgs_0: WarningsFiltersState, resultFuncArgs_1: string | undefined) => WarningsFilterPanelState | undefined;
|
|
146
|
+
memoizedResultFunc: ((resultFuncArgs_0: WarningsFiltersState, resultFuncArgs_1: string | undefined) => WarningsFilterPanelState | undefined) & {
|
|
147
|
+
clearCache: () => void;
|
|
148
|
+
resultsCount: () => number;
|
|
149
|
+
resetResultsCount: () => void;
|
|
150
|
+
};
|
|
151
|
+
lastResult: () => WarningsFilterPanelState | undefined;
|
|
152
|
+
dependencies: [(store: WarningModuleStore) => WarningsFiltersState, (_store: WarningModuleStore, panelId?: string) => string | undefined];
|
|
153
|
+
recomputations: () => number;
|
|
154
|
+
resetRecomputations: () => void;
|
|
155
|
+
dependencyRecomputations: () => number;
|
|
156
|
+
resetDependencyRecomputations: () => void;
|
|
157
|
+
} & {
|
|
158
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
159
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
160
|
+
}];
|
|
161
|
+
recomputations: () => number;
|
|
162
|
+
resetRecomputations: () => void;
|
|
163
|
+
dependencyRecomputations: () => number;
|
|
164
|
+
resetDependencyRecomputations: () => void;
|
|
165
|
+
} & {
|
|
166
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
167
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
168
|
+
};
|
|
128
169
|
export declare const getWarningsPresetById: ((state: WarningModuleStore, panelId?: string | undefined) => {
|
|
129
170
|
filterState: null;
|
|
130
171
|
expandedSections: null;
|
|
@@ -13,5 +13,6 @@ export interface ExpandedWarningSections extends Record<string, boolean> {
|
|
|
13
13
|
export interface WarningsFilterPanelState extends FilterState {
|
|
14
14
|
expandedSections: ExpandedWarningSections;
|
|
15
15
|
hoveredWarningIds: string[];
|
|
16
|
+
hiddenWarningIds: string[];
|
|
16
17
|
}
|
|
17
18
|
export type WarningsFiltersState = Record<string, WarningsFilterPanelState>;
|
|
@@ -5,7 +5,7 @@ export interface Area {
|
|
|
5
5
|
areaId?: string;
|
|
6
6
|
published_warning_uuid?: string;
|
|
7
7
|
}
|
|
8
|
-
export interface
|
|
8
|
+
export interface WarningBodyBase {
|
|
9
9
|
id?: string;
|
|
10
10
|
phenomenon: string;
|
|
11
11
|
areas?: Area[];
|
|
@@ -13,8 +13,6 @@ export interface PublicWarningDetail {
|
|
|
13
13
|
validUntil: string;
|
|
14
14
|
level: string;
|
|
15
15
|
probability: number;
|
|
16
|
-
descriptionOriginal: string;
|
|
17
|
-
descriptionTranslation: string;
|
|
18
16
|
domain?: string;
|
|
19
17
|
warningProposalSource?: string;
|
|
20
18
|
authority?: string;
|
|
@@ -22,6 +20,10 @@ export interface PublicWarningDetail {
|
|
|
22
20
|
warning_handle_uuid?: string;
|
|
23
21
|
proposal_id?: string;
|
|
24
22
|
linked_to_id?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface PublicWarningDetail extends WarningBodyBase {
|
|
25
|
+
descriptionOriginal: string;
|
|
26
|
+
descriptionTranslation: string;
|
|
25
27
|
incident?: string;
|
|
26
28
|
}
|
|
27
29
|
export type AviationWarningDetails = Airmet | CancelAirmet | Sigmet | CancelSigmet;
|
|
@@ -40,7 +42,7 @@ export declare enum MaritimeWarningAction {
|
|
|
40
42
|
EXTEND = "EXTEND"
|
|
41
43
|
}
|
|
42
44
|
export type MaritimeWarningsType = 'maritimeWarningCoastal' | 'maritimeWarningNorthSea';
|
|
43
|
-
export type WarningType = 'public' | 'airmet' | 'sigmet' | MaritimeWarningsType | '
|
|
45
|
+
export type WarningType = 'public' | 'airmet' | 'sigmet' | MaritimeWarningsType | 'warningsEvent';
|
|
44
46
|
interface BaseWarning {
|
|
45
47
|
status?: PublicWarningStatus;
|
|
46
48
|
productStatus?: ProductStatus;
|
|
@@ -69,7 +71,18 @@ export interface MaritimeWarning extends BaseWarning {
|
|
|
69
71
|
windDirectionTo?: string;
|
|
70
72
|
};
|
|
71
73
|
}
|
|
72
|
-
export
|
|
74
|
+
export interface EventWarningForWarningList extends BaseWarning {
|
|
75
|
+
type: 'warningsEvent';
|
|
76
|
+
eventId?: string;
|
|
77
|
+
warningDetail: PublicWarningDetail & {
|
|
78
|
+
eventId?: string;
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
export interface WarningEventBody extends WarningBodyBase {
|
|
82
|
+
incident: string;
|
|
83
|
+
eventId?: string;
|
|
84
|
+
status?: PublicWarningStatus;
|
|
85
|
+
}
|
|
73
86
|
export interface WarningEventTexts {
|
|
74
87
|
headlineOriginal: string;
|
|
75
88
|
headlineTranslation: string;
|
|
@@ -82,6 +95,10 @@ export declare enum WarningEventType {
|
|
|
82
95
|
WARNING = "WARNING",
|
|
83
96
|
EARLY_WARNING = "EARLY_WARNING"
|
|
84
97
|
}
|
|
98
|
+
export declare enum WarningEventMode {
|
|
99
|
+
ACTUAL = "ACTUAL",
|
|
100
|
+
TEST = "TEST"
|
|
101
|
+
}
|
|
85
102
|
export interface WarningEvent {
|
|
86
103
|
eventId?: string;
|
|
87
104
|
status?: PublicWarningStatus;
|
|
@@ -90,11 +107,13 @@ export interface WarningEvent {
|
|
|
90
107
|
phenomenon: string;
|
|
91
108
|
validFrom: string;
|
|
92
109
|
validUntil: string;
|
|
93
|
-
incident
|
|
94
|
-
type?: '
|
|
110
|
+
incident: string;
|
|
111
|
+
type?: 'warningsEvent';
|
|
95
112
|
warningEventType: WarningEventType;
|
|
96
113
|
warnings: WarningEventBody[];
|
|
97
114
|
texts: WarningEventTexts;
|
|
115
|
+
linked_to_id?: string;
|
|
116
|
+
mode: WarningEventMode;
|
|
98
117
|
}
|
|
99
|
-
export type Warning = PublicWarning | AirmetWarning | SigmetWarning | MaritimeWarning;
|
|
118
|
+
export type Warning = PublicWarning | AirmetWarning | SigmetWarning | MaritimeWarning | EventWarningForWarningList;
|
|
100
119
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { uiTypes } from '@opengeoweb/store';
|
|
2
2
|
export declare const publicWarningDialogType = uiTypes.DialogTypes.PublicWarnings;
|
|
3
3
|
export declare const warningEventDialogType = uiTypes.DialogTypes.WarningsEvent;
|
|
4
|
+
export declare const warningEventsSummaryDialogType = uiTypes.DialogTypes.WarningsEventSummary;
|
|
@@ -3,6 +3,7 @@ import type { PublicWarning } from '../store/warningsForm/types';
|
|
|
3
3
|
export declare const testGeoJSON: GeoJSON.FeatureCollection;
|
|
4
4
|
export declare function fakeErrorRequest<ReturnType>(error: string): Promise<ReturnType>;
|
|
5
5
|
export declare const fakePostError = "2 validation errors for Request\nbody -> warningDetail -> phenomenon\n value is not a valid enumeration member; permitted: 'wind', 'fog', 'thunderstorm', 'snowIce', 'rain', 'highTemp', 'funnelCloud', 'lowTemp', 'coastalEvent' (type=type_error.enum; enum_values=[<PhenomenonEnum.WIND: 'wind'>, <PhenomenonEnum.FOG: 'fog'>, <PhenomenonEnum.THUNDERSTORM: 'thunderstorm'>, <PhenomenonEnum.SNOW_ICE: 'snowIce'>, <PhenomenonEnum.RAIN: 'rain'>, <PhenomenonEnum.HIGH_TEMP: 'highTemp'>, <PhenomenonEnum.FUNNEL_CLD: 'funnelCloud'>, <PhenomenonEnum.LOW_TEMP: 'lowTemp'>, <PhenomenonEnum.COASTAL_EVENT: 'coastalEvent'>])\nbody -> warningDetail -> level\n value is not a valid enumeration member; permitted: 'moderate', 'severe', 'extreme' (type=type_error.enum; enum_values=[<LevelEnum.MODERATE: 'moderate'>, <LevelEnum.SEVERE: 'severe'>, <LevelEnum.EXTREME: 'extreme'>])";
|
|
6
|
+
export declare const fakePostWarningEventError = "2 validation errors for Request\nbody -> warningDetail -> phenomenon\n value is not a valid enumeration member; permitted: 'wind', 'fog', 'thunderstorm', 'snowIce', 'rain', 'highTemp', 'funnelCloud', 'lowTemp', 'coastalEvent' (type=type_error.enum; enum_values=[<PhenomenonEnum.WIND: 'wind'>, <PhenomenonEnum.FOG: 'fog'>, <PhenomenonEnum.THUNDERSTORM: 'thunderstorm'>, <PhenomenonEnum.SNOW_ICE: 'snowIce'>, <PhenomenonEnum.RAIN: 'rain'>, <PhenomenonEnum.HIGH_TEMP: 'highTemp'>, <PhenomenonEnum.FUNNEL_CLD: 'funnelCloud'>, <PhenomenonEnum.LOW_TEMP: 'lowTemp'>, <PhenomenonEnum.COASTAL_EVENT: 'coastalEvent'>])\nbody -> warningDetail -> level\n value is not a valid enumeration member; permitted: 'moderate', 'severe', 'extreme' (type=type_error.enum; enum_values=[<LevelEnum.MODERATE: 'moderate'>, <LevelEnum.SEVERE: 'severe'>, <LevelEnum.EXTREME: 'extreme'>])";
|
|
6
7
|
export declare const testPublicWarning: PublicWarning;
|
|
7
8
|
export declare const testDraftAirmet: Airmet | CancelAirmet;
|
|
8
9
|
export declare const testPublishedAirmet: Airmet | CancelAirmet;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { RequestHandler } from 'msw';
|
|
2
2
|
import type { SigmetFromBackend } from '@opengeoweb/api';
|
|
3
3
|
import type { DrawingFromBE, DrawingListItem } from '../../store/warningsDrawings/types';
|
|
4
|
-
import type { AirmetWarning, MaritimeWarning, PublicWarning, SigmetWarning, Warning } from '../../store/warningsForm/types';
|
|
4
|
+
import type { AirmetWarning, MaritimeWarning, PublicWarning, SigmetWarning, Warning, WarningEvent } from '../../store/warningsForm/types';
|
|
5
5
|
export declare const newSigmet: SigmetFromBackend;
|
|
6
6
|
declare const drawingList: DrawingListItem[];
|
|
7
7
|
declare const drawingsListFullContent: DrawingFromBE[];
|
|
@@ -11,6 +11,7 @@ declare const lengthWarningListWithoutExpiredWithdrawn: number;
|
|
|
11
11
|
declare const sigmetList: SigmetWarning[];
|
|
12
12
|
declare const airmetList: AirmetWarning[];
|
|
13
13
|
declare const maritimeList: MaritimeWarning[];
|
|
14
|
+
declare const warningEventsList: WarningEvent[];
|
|
14
15
|
declare const combinedWarnings: Warning[];
|
|
15
16
|
declare const areaKeywordList: string[];
|
|
16
17
|
export declare const publicWarningEndpoints: import("msw").HttpHandler[];
|
|
@@ -19,4 +20,4 @@ export declare const drawingEndpoints: import("msw").HttpHandler[];
|
|
|
19
20
|
export declare const warningEventsEndpoints: import("msw").HttpHandler[];
|
|
20
21
|
export declare const makeWarningsHandler: (result: Warning[]) => RequestHandler;
|
|
21
22
|
declare const requestHandlers: import("msw").HttpHandler[];
|
|
22
|
-
export { drawingList, predefinedAreaList, drawingsListFullContent, warningList, lengthWarningListWithoutExpiredWithdrawn, sigmetList, airmetList, combinedWarnings, areaKeywordList, requestHandlers, maritimeList, };
|
|
23
|
+
export { drawingList, predefinedAreaList, drawingsListFullContent, warningList, lengthWarningListWithoutExpiredWithdrawn, sigmetList, airmetList, combinedWarnings, areaKeywordList, requestHandlers, maritimeList, warningEventsList, };
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { RefObject } from 'react';
|
|
2
|
+
import React from 'react';
|
|
2
3
|
import type { PickedFilterState, OptionKey } from '../components/FilterList/filter-hooks';
|
|
4
|
+
import type { FormError } from '../store/warningsEventForm/reducer';
|
|
3
5
|
import { PublicWarningStatus } from '../store/warningsForm/types';
|
|
4
|
-
import type { Warning } from '../store/warningsForm/types';
|
|
6
|
+
import type { Warning, WarningEvent, EventWarningForWarningList } from '../store/warningsForm/types';
|
|
5
7
|
export declare const ERROR_NOT_FOUND = "Request failed with status code 400";
|
|
6
8
|
export declare const MOCK_USERNAME = "user.name";
|
|
7
9
|
interface OverflowCheckResult {
|
|
@@ -15,4 +17,11 @@ export declare const getWarningWithProposalId: (warning: Warning) => Warning;
|
|
|
15
17
|
export default function useOverflowCheck(text: string): OverflowCheckResult;
|
|
16
18
|
export declare const getTranslationKey: (optionId: OptionKey<keyof PickedFilterState>, id: string) => string;
|
|
17
19
|
export declare const getIdFromUrl: (url: string) => string;
|
|
20
|
+
export declare const transformWarningEventsToWarningFormat: (warningEventFromBE: WarningEvent) => EventWarningForWarningList[];
|
|
21
|
+
export declare const useScrollTopOnError: (error: FormError) => React.RefObject<HTMLDivElement | null>;
|
|
22
|
+
interface FormErrors {
|
|
23
|
+
title: string;
|
|
24
|
+
errors: React.ReactElement[];
|
|
25
|
+
}
|
|
26
|
+
export declare const getErrors: (errors: string) => null | FormErrors;
|
|
18
27
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/warnings",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.5.0",
|
|
4
4
|
"description": "GeoWeb warinings library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"ol": "^10.4.0",
|
|
45
45
|
"msw": "^2.7.3",
|
|
46
46
|
"@types/geojson": "^7946.0.14",
|
|
47
|
+
"@turf/turf": "^7.2.0",
|
|
47
48
|
"react-sortablejs": "^6.1.4",
|
|
48
49
|
"@mui/x-date-pickers": "^9.3.0"
|
|
49
50
|
},
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { TFunction } from 'i18next';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
export declare const getDeleteDescription: (objectName: string, t: TFunction) => string;
|
|
4
|
-
export declare const getDeleteSucces: (objectName: string, t: TFunction) => string;
|
|
5
|
-
export declare const ConfirmDeleteDialog: React.FC<{
|
|
6
|
-
objectId: string;
|
|
7
|
-
objectName: string;
|
|
8
|
-
onDeleteSucces: (objectId: string) => void;
|
|
9
|
-
onClose: () => void;
|
|
10
|
-
}>;
|
|
File without changes
|