@opengeoweb/warnings 19.3.0 → 19.4.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 +4572 -1240
- package/dist/src/lib/api/warning-api/hooks.d.ts +24 -3
- 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/PublicWarningsForm.d.ts +0 -1
- package/dist/src/lib/components/PublicWarningsFormDialog/PublicWarningsFormDialogConnect.d.ts +0 -1
- package/dist/src/lib/components/WarningEvents/WarningEventDialog/WarningEventDialogConnect.d.ts +4 -3
- package/dist/src/lib/components/WarningEvents/WarningEventDialog/WarningEventFormDialog.d.ts +36 -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 +11 -2
- package/dist/src/lib/components/WarningEvents/WarningEventForm/WarningEventItem.d.ts +3 -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 +8 -0
- package/dist/src/lib/components/WarningEvents/WarningEventForm/warningEventStoryData.d.ts +1 -0
- package/dist/src/lib/components/WarningEvents/WarningEventSummaryDialog/WarningEventSummaryDialog.d.ts +1 -0
- package/dist/src/lib/components/WarningEvents/WarningEventSummaryDialog/WarningEventSummaryForm.d.ts +5 -1
- package/dist/src/lib/store/types.d.ts +2 -0
- 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/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 +1 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type { UseMutationResult, UseQueryResult } from '@tanstack/react-query';
|
|
1
|
+
import type { QueryKey, UseMutationResult, UseQueryResult } from '@tanstack/react-query';
|
|
2
2
|
import type { TimeFilter } from '../../components/FilterList/filter-utils';
|
|
3
3
|
import type { MaritimeWarningsConfig } from '../../components/MaritimeWarningsForm/types';
|
|
4
4
|
import type { DrawingFromBE, DrawingFromFE, DrawingListItem, FetchDrawingParams } from '../../store/warningsDrawings/types';
|
|
5
|
-
import type { MaritimeWarning, MaritimeWarningsType, PublicWarning } from '../../store/warningsForm/types';
|
|
5
|
+
import type { MaritimeWarning, MaritimeWarningsType, PublicWarning, WarningEvent } from '../../store/warningsForm/types';
|
|
6
6
|
/**
|
|
7
7
|
* @param disabled - Disables fetching, but still returns cached values.
|
|
8
8
|
* https://tanstack.com/query/v4/docs/framework/react/guides/disabling-queries
|
|
9
9
|
*/
|
|
10
10
|
export declare const usePublicWarnings: (disabled?: boolean, timeFilter?: TimeFilter) => UseQueryResult<(PublicWarning | MaritimeWarning)[]>;
|
|
11
11
|
type MutationReturnType<T> = UseMutationResult<Headers | null, Error, T, {
|
|
12
|
-
|
|
12
|
+
previousData: [QueryKey, PublicWarning[] | undefined][];
|
|
13
13
|
}>;
|
|
14
14
|
type DrawingMutationReturnType<T> = UseMutationResult<{
|
|
15
15
|
id: string;
|
|
@@ -55,4 +55,25 @@ interface MutateMaritimeEditorParams {
|
|
|
55
55
|
}
|
|
56
56
|
export declare const useMutateMaritimeWarningsEditor: () => MutationReturnType<MutateMaritimeEditorParams>;
|
|
57
57
|
export declare const useMaritimeWarningsConfig: (disabled?: boolean) => UseQueryResult<MaritimeWarningsConfig>;
|
|
58
|
+
export declare const useWarningEventsList: (disabled?: boolean, timeFilter?: TimeFilter) => UseQueryResult<WarningEvent[]>;
|
|
59
|
+
type EventMutationReturnType<T> = UseMutationResult<Headers | null, Error, T, {
|
|
60
|
+
previousData: [QueryKey, WarningEvent[] | undefined][];
|
|
61
|
+
}>;
|
|
62
|
+
interface UpdateWarningEventProps {
|
|
63
|
+
eventId?: string;
|
|
64
|
+
data: WarningEvent;
|
|
65
|
+
panelId?: string;
|
|
66
|
+
}
|
|
67
|
+
export declare const usePublishWarningEvent: () => EventMutationReturnType<UpdateWarningEventProps>;
|
|
68
|
+
export declare const useSaveWarningEvent: () => EventMutationReturnType<UpdateWarningEventProps>;
|
|
69
|
+
export declare const useMutateWarningEvent: (snackBarMessage: string) => EventMutationReturnType<UpdateWarningEventProps>;
|
|
70
|
+
export declare const useMutateDeleteWarningEvent: () => EventMutationReturnType<{
|
|
71
|
+
eventId: string;
|
|
72
|
+
}>;
|
|
73
|
+
interface MutateEventEditorProps {
|
|
74
|
+
eventId: string;
|
|
75
|
+
isEditor: boolean;
|
|
76
|
+
force?: boolean;
|
|
77
|
+
}
|
|
78
|
+
export declare const useMutateEventEditor: () => EventMutationReturnType<MutateEventEditorProps>;
|
|
58
79
|
export {};
|
|
@@ -8,6 +8,7 @@ export interface PublicWarningListProps extends WarningListItemActions {
|
|
|
8
8
|
isLoading?: boolean;
|
|
9
9
|
error?: Error;
|
|
10
10
|
selectedWarningId?: string;
|
|
11
|
+
selectedEventId?: string;
|
|
11
12
|
lastUpdatedTime?: string;
|
|
12
13
|
onCreateWarning?: () => void;
|
|
13
14
|
onRefetchWarnings?: () => void;
|
|
@@ -6,6 +6,7 @@ export interface WarningListItemProps extends ListItemProps, WarningListItemActi
|
|
|
6
6
|
warning: Warning;
|
|
7
7
|
highlightedItem?: boolean;
|
|
8
8
|
activeWarningId: string;
|
|
9
|
+
activeEventId: string;
|
|
9
10
|
onHoverWarning?: (warningId?: string) => void;
|
|
10
11
|
onSelectWarning?: (warning: Warning) => void;
|
|
11
12
|
shouldDisableAviationAmendOption?: boolean;
|
|
@@ -5,7 +5,7 @@ import type { MaritimeWarning, Warning } from '../../store/warningsForm/types';
|
|
|
5
5
|
import { MaritimeWarningAction } from '../../store/warningsForm/types';
|
|
6
6
|
export interface WarningListItemActions {
|
|
7
7
|
onEditWarning?: (warning: Warning) => void;
|
|
8
|
-
onDeleteWarning?: (
|
|
8
|
+
onDeleteWarning?: (warning: Warning) => void;
|
|
9
9
|
onDeleteReviewWarning?: (warning: Warning) => void;
|
|
10
10
|
onExpireWarning?: (warning: Warning) => void;
|
|
11
11
|
onWithdrawWarning?: (warning: Warning) => void;
|
|
@@ -8,7 +8,6 @@ import type { BaseDrawingListItem, DrawingListItem } from '../../store/warningsD
|
|
|
8
8
|
import type { FormError } from '../../store/warningsForm/reducer';
|
|
9
9
|
import type { Area, PublicWarningDetail, WarningType } from '../../store/warningsForm/types';
|
|
10
10
|
import { PublicWarningStatus } from '../../store/warningsForm/types';
|
|
11
|
-
export declare const useScrollTopOnError: (error: FormError) => React.RefObject<HTMLDivElement | null>;
|
|
12
11
|
export declare const getEmptyPublicWarning: () => PublicWarningDetail;
|
|
13
12
|
export declare const getFormData: (publicWarningsDetails: PublicWarningDetail | undefined, object?: DrawingListItem) => FormData;
|
|
14
13
|
interface FormData extends PublicWarningDetail {
|
package/dist/src/lib/components/PublicWarningsFormDialog/PublicWarningsFormDialogConnect.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ import type { ConfirmationOptions, Position } from '@opengeoweb/shared';
|
|
|
4
4
|
import { uiTypes } from '@opengeoweb/store';
|
|
5
5
|
import type { MapPreset } from '@opengeoweb/store';
|
|
6
6
|
export declare const warningFormConfirmationOptions: (t: TFunction) => ConfirmationOptions;
|
|
7
|
-
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;
|
package/dist/src/lib/components/WarningEvents/WarningEventDialog/WarningEventDialogConnect.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { Position } from '@opengeoweb/shared';
|
|
2
|
+
import type { DraggableSize, Position } from '@opengeoweb/shared';
|
|
3
3
|
import type { uiTypes } from '@opengeoweb/store';
|
|
4
|
-
import type { WarningEvent } from '../../../store/warningsForm/types';
|
|
5
4
|
export interface WarningEventDialogConnectProps {
|
|
6
5
|
bounds?: string;
|
|
7
6
|
source?: uiTypes.Source;
|
|
7
|
+
size?: DraggableSize;
|
|
8
8
|
startPosition?: Position;
|
|
9
|
-
|
|
9
|
+
startPositionSummary?: Position;
|
|
10
|
+
isDefaultCollapsed?: boolean;
|
|
10
11
|
}
|
|
11
12
|
export declare const WarningEventDialogConnect: React.FC<WarningEventDialogConnectProps>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { TFunction } from 'i18next';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { ConfirmationOptions, DraggableSize, Position } from '@opengeoweb/shared';
|
|
4
|
+
import type { uiTypes } from '@opengeoweb/store';
|
|
5
|
+
import type { FormError } from '../../../store/warningsEventForm/reducer';
|
|
6
|
+
import type { WarningEvent } from '../../../store/warningsForm/types';
|
|
7
|
+
export declare const warningFormConfirmationOptions: (t: TFunction) => ConfirmationOptions;
|
|
8
|
+
export interface WarningEventFormDialogProps {
|
|
9
|
+
bounds?: string;
|
|
10
|
+
currentEventEditor?: string;
|
|
11
|
+
shouldHideFormToggleMode?: boolean;
|
|
12
|
+
selectedEvent?: WarningEvent;
|
|
13
|
+
error?: FormError;
|
|
14
|
+
isOpen: boolean;
|
|
15
|
+
isReadOnly?: boolean;
|
|
16
|
+
order?: number;
|
|
17
|
+
size?: DraggableSize;
|
|
18
|
+
source?: uiTypes.Source;
|
|
19
|
+
startPosition?: Position;
|
|
20
|
+
onClose: () => void;
|
|
21
|
+
onChangeFormMode?: (isReadOnly: boolean) => void;
|
|
22
|
+
onMouseDown?: () => void;
|
|
23
|
+
onDelete?: () => void;
|
|
24
|
+
onFormDirty?: (isFormDirty: boolean) => void;
|
|
25
|
+
onSaveDraft?: (formValues: WarningEvent) => Promise<Headers | null>;
|
|
26
|
+
onPublish?: (formValues: WarningEvent) => Promise<Headers | null>;
|
|
27
|
+
isSummaryOpen: boolean;
|
|
28
|
+
summaryOrder?: number;
|
|
29
|
+
summarySource?: uiTypes.Source;
|
|
30
|
+
startPositionSummary?: Position;
|
|
31
|
+
onOpenSummary: () => void;
|
|
32
|
+
onCloseSummary: () => void;
|
|
33
|
+
onAddSummary: () => void;
|
|
34
|
+
onMouseDownSummary?: () => void;
|
|
35
|
+
}
|
|
36
|
+
export declare const WarningEventFormDialog: React.FC<WarningEventFormDialogProps>;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export { WarningEventDialog } from './WarningEventDialog';
|
|
2
|
+
export type { WarningEventFormDialogProps } from './WarningEventFormDialog';
|
|
3
|
+
export { WarningEventFormDialog } from './WarningEventFormDialog';
|
|
2
4
|
export type { WarningEventDialogProps } from './WarningEventDialog';
|
|
3
5
|
export { WarningEventDialogConnect } from './WarningEventDialogConnect';
|
|
4
6
|
export type { WarningEventDialogConnectProps } from './WarningEventDialogConnect';
|
|
7
|
+
export { useWarningEventActions } from './utils';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { TFunction } from 'i18next';
|
|
2
|
+
import type { ConfirmationOptions } from '@opengeoweb/shared';
|
|
3
|
+
import type { FormAction } from '../../../store/warningsEventForm/reducer';
|
|
4
|
+
import type { EventWarningForWarningList, WarningEvent } from '../../../store/warningsForm/types';
|
|
5
|
+
import type { TimeFilter } from '../../FilterList/filter-utils';
|
|
6
|
+
import type { ConfirmDialogProps } from '../../PublicWarningList/ConfirmWarningDialog';
|
|
7
|
+
export declare const getNewEventWithLinkedToId: (event: WarningEvent) => WarningEvent;
|
|
8
|
+
export declare const warningFormConfirmationOptions: (t: TFunction) => ConfirmationOptions;
|
|
9
|
+
interface WarningEventsActions {
|
|
10
|
+
selectedEventId: string;
|
|
11
|
+
openWarningsEventDialog: (formAction?: FormAction, warning?: EventWarningForWarningList) => Promise<void>;
|
|
12
|
+
deleteWarningsEvent: (warningEventId: string, currentUser: string, setConfirmDialogOptions: React.Dispatch<React.SetStateAction<ConfirmDialogProps | undefined>>) => Promise<void>;
|
|
13
|
+
updateWarningsEvent: (warningEventId: string, currentUser: string) => Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
export declare const useWarningEventActions: (panelId: string, timeFilter?: TimeFilter) => WarningEventsActions;
|
|
16
|
+
export {};
|
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { FormError } from '../../../store/warningsEventForm/reducer';
|
|
2
3
|
import type { WarningEvent } from '../../../store/warningsForm/types';
|
|
3
4
|
export interface WarningEventFormContentProps {
|
|
5
|
+
error?: FormError;
|
|
6
|
+
currentEventEditor?: string;
|
|
7
|
+
isSummaryDialogOpen?: boolean;
|
|
8
|
+
selectedEvent?: WarningEvent;
|
|
9
|
+
shouldHideFormToggleMode?: boolean;
|
|
4
10
|
isReadOnly?: boolean;
|
|
11
|
+
isDefaultCollapsed?: boolean;
|
|
5
12
|
onCancel?: () => void;
|
|
13
|
+
onChangeFormMode?: (isReadOnly: boolean) => void;
|
|
6
14
|
onDelete?: () => void;
|
|
15
|
+
onFormDirty?: (isFormDirty: boolean) => void;
|
|
7
16
|
onOpenWarningSummary?: () => void;
|
|
8
|
-
|
|
9
|
-
onPublish?: (formValues: WarningEvent) =>
|
|
17
|
+
onSaveDraft?: (formValues: WarningEvent) => Promise<Headers | null>;
|
|
18
|
+
onPublish?: (formValues: WarningEvent) => Promise<Headers | null>;
|
|
10
19
|
}
|
|
11
20
|
export declare const WarningEventFormContent: React.FC<WarningEventFormContentProps>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { WarningEventBody } from '../../../store/warningsForm/types';
|
|
3
|
-
export declare const warningEventItemDefaultValues: WarningEventBody;
|
|
4
2
|
export declare const WarningEventItem: React.FC<{
|
|
5
3
|
index: number;
|
|
6
4
|
isReadOnly: boolean;
|
|
5
|
+
isCompact: boolean;
|
|
6
|
+
isDeleteButtonDisabled: boolean;
|
|
7
|
+
onToggleCompact: () => void;
|
|
7
8
|
onDeleteWarning: (index: number) => void;
|
|
8
9
|
}>;
|
|
9
10
|
export default WarningEventItem;
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { TimelineEditing } from './WarningEventTimelineBlock';
|
|
3
|
+
import type { PublicWarningStatus } from '../../../../store/warningsForm/types';
|
|
4
|
+
export type { TimelineEditing };
|
|
2
5
|
export interface WarningEventTimelineProps {
|
|
3
6
|
start: Date;
|
|
4
7
|
end: Date;
|
|
5
8
|
validFrom: string;
|
|
6
9
|
validUntil: string;
|
|
7
10
|
level: string;
|
|
11
|
+
status?: PublicWarningStatus;
|
|
8
12
|
now?: Date;
|
|
13
|
+
isCompact?: boolean;
|
|
14
|
+
editing?: TimelineEditing;
|
|
9
15
|
}
|
|
10
16
|
interface AxisIntervals {
|
|
11
17
|
tickHours: number;
|
|
@@ -13,4 +19,3 @@ interface AxisIntervals {
|
|
|
13
19
|
}
|
|
14
20
|
export declare const getAxisIntervals: (rangeDays: number) => AxisIntervals;
|
|
15
21
|
export declare const WarningEventTimeline: React.FC<WarningEventTimelineProps>;
|
|
16
|
-
export {};
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { PublicWarningStatus } from '../../../../store/warningsForm/types';
|
|
3
|
+
import { WarningLevel } from '../../../PublicWarningsForm/LevelField';
|
|
4
|
+
export interface TimelineEditing {
|
|
5
|
+
onTimesChange: (validFrom: string, validUntil: string) => void;
|
|
6
|
+
onLevelChange?: (level: WarningLevel) => void;
|
|
7
|
+
}
|
|
2
8
|
interface WarningEventTimelineBlockProps {
|
|
3
9
|
start: Date;
|
|
4
10
|
end: Date;
|
|
@@ -7,6 +13,9 @@ interface WarningEventTimelineBlockProps {
|
|
|
7
13
|
validFrom: string;
|
|
8
14
|
validUntil: string;
|
|
9
15
|
level: string;
|
|
16
|
+
status?: PublicWarningStatus;
|
|
17
|
+
isCompact?: boolean;
|
|
18
|
+
editing?: TimelineEditing;
|
|
10
19
|
}
|
|
11
20
|
export declare const WarningEventTimelineBlock: React.FC<WarningEventTimelineBlockProps>;
|
|
12
21
|
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TimelineEditing } from './WarningEventTimelineBlock';
|
|
3
|
+
interface WarningEventTimelineBlockControlsProps {
|
|
4
|
+
left: number;
|
|
5
|
+
width: number;
|
|
6
|
+
containerWidth: number;
|
|
7
|
+
from: Date;
|
|
8
|
+
until: Date;
|
|
9
|
+
now: Date;
|
|
10
|
+
maxPickerDate: Date;
|
|
11
|
+
editing: TimelineEditing;
|
|
12
|
+
showEditAffordances: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare const WarningEventTimelineBlockControls: React.FC<WarningEventTimelineBlockControlsProps>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { DragMode } from './warningEventTimelineDragUtils';
|
|
3
|
+
interface DragPreview {
|
|
4
|
+
from: Date;
|
|
5
|
+
until: Date;
|
|
6
|
+
}
|
|
7
|
+
export interface UseBlockDragParams {
|
|
8
|
+
from: Date | null;
|
|
9
|
+
until: Date | null;
|
|
10
|
+
rangeStart: Date;
|
|
11
|
+
rangeEnd: Date;
|
|
12
|
+
now: Date;
|
|
13
|
+
maxUntil: Date;
|
|
14
|
+
drawableWidth: number;
|
|
15
|
+
onTimesChange?: (validFrom: string, validUntil: string) => void;
|
|
16
|
+
}
|
|
17
|
+
export interface UseBlockDragResult {
|
|
18
|
+
dragPreview: DragPreview | null;
|
|
19
|
+
dragMode: DragMode | null;
|
|
20
|
+
beginDrag: (mode: DragMode, event: React.PointerEvent) => void;
|
|
21
|
+
onPointerMove: (event: React.PointerEvent) => void;
|
|
22
|
+
onPointerUp: (event: React.PointerEvent) => void;
|
|
23
|
+
onPointerCancel: (event: React.PointerEvent) => void;
|
|
24
|
+
}
|
|
25
|
+
export declare const useBlockDrag: ({ from, until, rangeStart, rangeEnd, now, maxUntil, drawableWidth, onTimesChange, }: UseBlockDragParams) => UseBlockDragResult;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useModifierKeyHeld: (isEnabled?: boolean) => boolean;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export declare const SNAP_MINUTES = 30;
|
|
2
|
+
export declare const MIN_DURATION_MINUTES = 30;
|
|
3
|
+
export declare const MIN_VISIBLE_MINUTES = 30;
|
|
4
|
+
export declare const ABSOLUTE_MAX_DAY = 7;
|
|
5
|
+
export declare const EDGE_HIT_ZONE_PX = 8;
|
|
6
|
+
export declare const EXPANDED_BLOCK_TOP = 58;
|
|
7
|
+
export declare const EXPANDED_BLOCK_HEIGHT = 56;
|
|
8
|
+
export declare const TIME_FIELD_WIDTH = 200;
|
|
9
|
+
export declare const TIME_FIELD_GAP = 8;
|
|
10
|
+
export type DragMode = 'start' | 'end' | 'move';
|
|
11
|
+
export declare const snapToInterval: (timeMs: number, intervalMs?: number) => number;
|
|
12
|
+
export declare const formatOverflowHours: (overflowMs: number) => string;
|
|
13
|
+
export declare const getEndTimeForMovedStart: (fromMs: number, untilMs: number, newFromMs: number, maxUntilMs: number) => number;
|
|
14
|
+
export interface TimeFieldPositions {
|
|
15
|
+
startLeft: number;
|
|
16
|
+
endLeft: number;
|
|
17
|
+
isStacked: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare const getTimeFieldPositions: ({ left, width, containerWidth, }: {
|
|
20
|
+
left: number;
|
|
21
|
+
width: number;
|
|
22
|
+
containerWidth: number;
|
|
23
|
+
}) => TimeFieldPositions;
|
|
24
|
+
export interface ComputeDraggedTimesParams {
|
|
25
|
+
mode: DragMode;
|
|
26
|
+
deltaMs: number;
|
|
27
|
+
fromMs: number;
|
|
28
|
+
untilMs: number;
|
|
29
|
+
rangeStartMs: number;
|
|
30
|
+
rangeEndMs: number;
|
|
31
|
+
nowMs: number;
|
|
32
|
+
maxUntilMs: number;
|
|
33
|
+
}
|
|
34
|
+
export declare const computeDraggedTimes: ({ mode, deltaMs, fromMs, untilMs, rangeStartMs, rangeEndMs, nowMs, maxUntilMs, }: ComputeDraggedTimesParams) => {
|
|
35
|
+
fromMs: number;
|
|
36
|
+
untilMs: number;
|
|
37
|
+
};
|
|
@@ -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,8 @@
|
|
|
1
|
+
import type { WarningEventBody, WarningEvent, PublicWarningStatus } from '../../../store/warningsForm/types';
|
|
2
|
+
interface FormData extends WarningEvent {
|
|
3
|
+
IS_DRAFT?: boolean | string;
|
|
4
|
+
}
|
|
5
|
+
export declare const buildSubmitValues: (values: FormData) => WarningEvent;
|
|
6
|
+
export declare const getFormData: (warningsEvent: WarningEvent | undefined) => FormData;
|
|
7
|
+
export declare const constructWarningWithNewStatus: (warningsEvent: WarningEvent, status: PublicWarningStatus) => WarningEventBody[];
|
|
8
|
+
export {};
|
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 = 80;
|
|
4
|
+
export declare const SUMMARY_CONCISE_SUMMARY_LIMIT = 300;
|
|
5
|
+
export declare const SUMMARY_DESCRIPTION_LIMIT = 500;
|
|
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 {};
|
|
@@ -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
|
}
|
|
@@ -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,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;
|