@opengeoweb/warnings 12.11.0 → 12.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.esm.js +534 -114
- package/package.json +12 -12
- package/src/lib/api/warning-api/api.d.ts +2 -2
- package/src/lib/api/warning-api/hooks.d.ts +3 -2
- package/src/lib/components/MaritimeWarningsForm/AreaList/AreaList.d.ts +4 -2
- package/src/lib/components/MaritimeWarningsForm/AssignedAreas/AssignedAreas.d.ts +2 -0
- package/src/lib/components/MaritimeWarningsForm/AssignedAreas/AssignedAreas.spec.d.ts +1 -0
- package/src/lib/components/MaritimeWarningsForm/MaritimeWarningsAvatar.d.ts +8 -0
- package/src/lib/components/MaritimeWarningsForm/MaritimeWarningsForm.d.ts +4 -0
- package/src/lib/components/MaritimeWarningsForm/MaritimeWarningsForm.spec.d.ts +1 -2
- package/src/lib/components/MaritimeWarningsForm/MaritimeWarningsForm.stories.d.ts +7 -3
- package/src/lib/components/MaritimeWarningsForm/WarningList/WarningList.d.ts +2 -0
- package/src/lib/components/MaritimeWarningsForm/WarningList/WarningListItem.d.ts +3 -1
- package/src/lib/components/MaritimeWarningsForm/WarningList/WarningListSelect.d.ts +2 -2
- package/src/lib/components/MaritimeWarningsForm/WarningList/WindForceSelect.d.ts +4 -2
- package/src/lib/components/MaritimeWarningsForm/testUtils.d.ts +3 -0
- package/src/lib/components/MaritimeWarningsForm/useFilterChipSelect.d.ts +12 -0
- package/src/lib/components/MaritimeWarningsForm/useFilterChipSelect.spec.d.ts +1 -0
- package/src/lib/components/MaritimeWarningsForm/useMaritimeWarningsFormState.d.ts +8 -1
- package/src/lib/components/MaritimeWarningsForm/utils.d.ts +5 -1
- package/src/lib/store/publicWarningForm/types.d.ts +12 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/warnings",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.12.0",
|
|
4
4
|
"description": "GeoWeb warinings library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -8,25 +8,25 @@
|
|
|
8
8
|
"url": "git@gitlab.com:opengeoweb/opengeoweb.git"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@opengeoweb/api": "12.
|
|
12
|
-
"@opengeoweb/shared": "12.
|
|
13
|
-
"@opengeoweb/store": "12.
|
|
14
|
-
"@opengeoweb/webmap-react": "12.
|
|
11
|
+
"@opengeoweb/api": "12.12.0",
|
|
12
|
+
"@opengeoweb/shared": "12.12.0",
|
|
13
|
+
"@opengeoweb/store": "12.12.0",
|
|
14
|
+
"@opengeoweb/webmap-react": "12.12.0",
|
|
15
15
|
"@tanstack/react-query": "^5.69.2",
|
|
16
16
|
"react-redux": "^9.2.0",
|
|
17
|
-
"@opengeoweb/theme": "12.
|
|
18
|
-
"@opengeoweb/form-fields": "12.
|
|
17
|
+
"@opengeoweb/theme": "12.12.0",
|
|
18
|
+
"@opengeoweb/form-fields": "12.12.0",
|
|
19
19
|
"react-hook-form": "^7.50.1",
|
|
20
20
|
"lodash": "^4.17.21",
|
|
21
21
|
"@reduxjs/toolkit": "^2.6.1",
|
|
22
|
-
"@opengeoweb/snackbar": "12.
|
|
22
|
+
"@opengeoweb/snackbar": "12.12.0",
|
|
23
23
|
"react-window": "^1.8.10",
|
|
24
24
|
"react-virtualized-auto-sizer": "^1.0.20",
|
|
25
25
|
"axios": "^1.7.7",
|
|
26
|
-
"@opengeoweb/core": "12.
|
|
27
|
-
"@opengeoweb/webmap": "12.
|
|
28
|
-
"@opengeoweb/authentication": "12.
|
|
29
|
-
"@opengeoweb/sigmet-airmet": "12.
|
|
26
|
+
"@opengeoweb/core": "12.12.0",
|
|
27
|
+
"@opengeoweb/webmap": "12.12.0",
|
|
28
|
+
"@opengeoweb/authentication": "12.12.0",
|
|
29
|
+
"@opengeoweb/sigmet-airmet": "12.12.0",
|
|
30
30
|
"react-i18next": "^15.1.1",
|
|
31
31
|
"i18next": "^25.0.1",
|
|
32
32
|
"@mui/material": "^7.0.1",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Credentials } from '@opengeoweb/authentication';
|
|
2
|
-
import { PublicWarning } from '../../store/publicWarningForm/types';
|
|
2
|
+
import { MaritimeWarning, PublicWarning } from '../../store/publicWarningForm/types';
|
|
3
3
|
import { DrawingFromBE, DrawingFromFE, DrawingListItem, FetchDrawingParams } from '../../store/warningsDrawings/types';
|
|
4
4
|
export declare const getPublicWarningList: (auth: Credentials) => Promise<PublicWarning[]>;
|
|
5
5
|
export declare const updatePublicWarningEditor: (warningId: string, isEditor: boolean, auth: Credentials, force?: boolean) => Promise<Headers | null>;
|
|
6
6
|
export declare const updatePublicWarning: (warningId: string, auth: Credentials, data: PublicWarning) => Promise<Headers | null>;
|
|
7
|
-
export declare const
|
|
7
|
+
export declare const postWarning: (auth: Credentials, data: PublicWarning | MaritimeWarning) => Promise<Headers | null>;
|
|
8
8
|
export declare const deleteWarning: (warningId: string, auth: Credentials) => Promise<null>;
|
|
9
9
|
export declare const getDrawings: (auth: Credentials, params?: FetchDrawingParams) => Promise<DrawingListItem[]>;
|
|
10
10
|
export declare const getDrawingDetails: (auth: Credentials, drawingId: string) => Promise<DrawingFromBE>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { UseMutationResult, UseQueryResult } from '@tanstack/react-query';
|
|
2
|
-
import { PublicWarning } from '../../store/publicWarningForm/types';
|
|
2
|
+
import { MaritimeWarning, PublicWarning } from '../../store/publicWarningForm/types';
|
|
3
3
|
import { DrawingFromBE, DrawingFromFE, DrawingListItem, FetchDrawingParams } from '../../store/warningsDrawings/types';
|
|
4
4
|
/**
|
|
5
5
|
* @param disabled - Disables fetching, but still returns cached values.
|
|
6
6
|
* https://tanstack.com/query/v4/docs/framework/react/guides/disabling-queries
|
|
7
7
|
*/
|
|
8
|
-
export declare const usePublicWarnings: (disabled?: boolean) => UseQueryResult<PublicWarning[]>;
|
|
8
|
+
export declare const usePublicWarnings: (disabled?: boolean) => UseQueryResult<(PublicWarning | MaritimeWarning)[]>;
|
|
9
9
|
type MutationReturnType<T> = UseMutationResult<Headers | null, Error, T, {
|
|
10
10
|
oldData: PublicWarning[] | undefined;
|
|
11
11
|
}>;
|
|
@@ -43,4 +43,5 @@ interface DeleteDrawingParams {
|
|
|
43
43
|
export declare const useMutateDeleteDrawing: () => UseMutationResult<{
|
|
44
44
|
id: string;
|
|
45
45
|
}, Error, DeleteDrawingParams>;
|
|
46
|
+
export declare const usePostMaritimeWarning: () => MutationReturnType<MaritimeWarning>;
|
|
46
47
|
export {};
|
|
@@ -4,6 +4,8 @@ export interface AreaListProps {
|
|
|
4
4
|
areas: Area[];
|
|
5
5
|
selected: string[];
|
|
6
6
|
disabled: string[];
|
|
7
|
-
|
|
7
|
+
isReadOnly?: boolean;
|
|
8
|
+
onToggleSelectArea?: (id: string) => void;
|
|
9
|
+
onSelectMultipleAreas: (ids: string[]) => void;
|
|
8
10
|
}
|
|
9
|
-
export declare const AreaList: React.MemoExoticComponent<({ areas, selected, disabled,
|
|
11
|
+
export declare const AreaList: React.MemoExoticComponent<({ areas, selected, disabled, isReadOnly, onToggleSelectArea, onSelectMultipleAreas, }: AreaListProps) => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -6,6 +6,8 @@ export interface AssignedAreasProps {
|
|
|
6
6
|
onAddClick: () => void;
|
|
7
7
|
onDeleteClick: (id: string) => void;
|
|
8
8
|
onToggleSelectArea: (id: string) => void;
|
|
9
|
+
onSelectMultipleAreas: (id: string[]) => void;
|
|
9
10
|
shouldShowDistricts?: boolean;
|
|
11
|
+
isReadOnly?: boolean;
|
|
10
12
|
}
|
|
11
13
|
export declare const AssignedAreas: React.FC<AssignedAreasProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TooltipProps } from '@mui/material';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export interface MaritimeWarningAvatarProps {
|
|
4
|
+
editor: string;
|
|
5
|
+
tooltipPlacement?: TooltipProps['placement'];
|
|
6
|
+
}
|
|
7
|
+
declare const MaritimeWarningAvatar: React.FC<MaritimeWarningAvatarProps>;
|
|
8
|
+
export default MaritimeWarningAvatar;
|
|
@@ -6,6 +6,7 @@ export interface MaritimeWarningsFormProps {
|
|
|
6
6
|
warnings: MaritimeWarningItem[];
|
|
7
7
|
modified: boolean;
|
|
8
8
|
onToggleSelectArea: (id: string) => void;
|
|
9
|
+
onSelectMultipleAreas: (ids: string[]) => void;
|
|
9
10
|
onAddSelectedAreas: (id: string) => void;
|
|
10
11
|
onRemoveWarning: (id: string) => void;
|
|
11
12
|
onRemoveArea: (id: string) => void;
|
|
@@ -14,6 +15,9 @@ export interface MaritimeWarningsFormProps {
|
|
|
14
15
|
onMoveWarning: (oldIndex: number, newIndex: number) => void;
|
|
15
16
|
onSubmit: () => void;
|
|
16
17
|
onClear: () => void;
|
|
18
|
+
onToggleReadOnly: (isReadOnly: boolean) => void;
|
|
19
|
+
isReadOnly: boolean;
|
|
17
20
|
shouldShowDistricts?: boolean;
|
|
21
|
+
editor?: string;
|
|
18
22
|
}
|
|
19
23
|
export declare const MaritimeWarningsForm: React.FC<MaritimeWarningsFormProps>;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function selectOption(container: HTMLElement, comboboxLabel: string, optionLabel: WarningListSelectOption['label']): Promise<void>;
|
|
1
|
+
export {};
|
|
@@ -3,7 +3,11 @@ import { MaritimeWarningsForm } from './MaritimeWarningsForm';
|
|
|
3
3
|
type Story = StoryObj<typeof MaritimeWarningsForm>;
|
|
4
4
|
declare const meta: Meta<typeof MaritimeWarningsForm>;
|
|
5
5
|
export default meta;
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const
|
|
6
|
+
export declare const ViewerLightMode: Story;
|
|
7
|
+
export declare const EditorLightMode: Story;
|
|
8
|
+
export declare const ViewerDarkMode: Story;
|
|
9
|
+
export declare const EditorDarkMode: Story;
|
|
10
|
+
export declare const MaritimeWarningsFormViewerMobileLight: Story;
|
|
11
|
+
export declare const MaritimeWarningsFormEditorMobileLight: Story;
|
|
12
|
+
export declare const MaritimeWarningsFormViewerMobileDark: Story;
|
|
9
13
|
export declare const MaritimeWarningsFormMobileDark: Story;
|
|
@@ -7,9 +7,11 @@ export interface WarningListProps {
|
|
|
7
7
|
onRemoveWarning: (id: string) => void;
|
|
8
8
|
onChangeWarning: (id: string, newValues: Partial<MaritimeWarningItemAttributes>) => void;
|
|
9
9
|
onToggleSelectArea: (areaId: string) => void;
|
|
10
|
+
onSelectMultipleAreas: (areaIds: string[]) => void;
|
|
10
11
|
onMoveWarning: (oldIndex: number, newIndex: number) => void;
|
|
11
12
|
selectedAreaIds: string[];
|
|
12
13
|
areas: Area[];
|
|
14
|
+
isReadOnly: boolean;
|
|
13
15
|
shouldShowDistricts?: boolean;
|
|
14
16
|
}
|
|
15
17
|
export declare const WarningList: React.FC<WarningListProps>;
|
|
@@ -4,11 +4,13 @@ export interface WarningListItemProps {
|
|
|
4
4
|
warning: MaritimeWarningItem;
|
|
5
5
|
areas: Area[];
|
|
6
6
|
selectedAreaIds: string[];
|
|
7
|
+
isReadOnly: boolean;
|
|
7
8
|
onAddClick: (id: string) => void;
|
|
8
9
|
onRemove: (id: string) => void;
|
|
9
10
|
onChange: (id: string, values: MaritimeWarningItemAttributes) => void;
|
|
10
11
|
onToggleSelectArea: (id: string) => void;
|
|
12
|
+
onSelectMultipleAreas: (ids: string[]) => void;
|
|
11
13
|
onRemoveArea: (id: string) => void;
|
|
12
14
|
shouldShowDistricts?: boolean;
|
|
13
15
|
}
|
|
14
|
-
export declare const WarningListItem: React.MemoExoticComponent<({ warning, areas, selectedAreaIds, onAddClick, onRemove, onChange, onToggleSelectArea, onRemoveArea, shouldShowDistricts, }: WarningListItemProps) => import("react/jsx-runtime").JSX.Element>;
|
|
16
|
+
export declare const WarningListItem: React.MemoExoticComponent<({ warning, areas, selectedAreaIds, onAddClick, onRemove, onChange, onToggleSelectArea, onSelectMultipleAreas, onRemoveArea, isReadOnly, shouldShowDistricts, }: WarningListItemProps) => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -14,6 +14,6 @@ export interface WarningListSelectProps {
|
|
|
14
14
|
renderValue?: (option: unknown) => React.ReactNode;
|
|
15
15
|
gridArea: string;
|
|
16
16
|
additionalStyling?: SxProps;
|
|
17
|
-
|
|
17
|
+
isReadOnly?: boolean;
|
|
18
18
|
}
|
|
19
|
-
export declare const WarningListSelect: React.MemoExoticComponent<({ options, value, label, onChange, renderOption, renderValue, gridArea, additionalStyling,
|
|
19
|
+
export declare const WarningListSelect: React.MemoExoticComponent<({ options, value, label, onChange, renderOption, renderValue, gridArea, additionalStyling, isReadOnly, }: WarningListSelectProps) => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -14,9 +14,11 @@ export interface WindForceOption {
|
|
|
14
14
|
level: WindForceLevel;
|
|
15
15
|
value: string;
|
|
16
16
|
}
|
|
17
|
-
export
|
|
17
|
+
export interface WindForceSelectProps {
|
|
18
18
|
value?: string;
|
|
19
19
|
onChange: (value: string) => void;
|
|
20
20
|
gridArea: string;
|
|
21
21
|
options: WindForceOption[];
|
|
22
|
-
|
|
22
|
+
isReadOnly?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare const WindForceSelect: React.FC<WindForceSelectProps>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { WarningListSelectOption } from './WarningList/WarningListSelect';
|
|
2
|
+
export declare function getLabelFromOptionLabel(label: WarningListSelectOption['label']): string;
|
|
3
|
+
export declare function selectOption(container: HTMLElement, comboboxLabel: string, optionLabel: WarningListSelectOption['label']): Promise<void>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface UseFilterChipSelectProps {
|
|
3
|
+
selectedIds: string[];
|
|
4
|
+
assignedIds: string[];
|
|
5
|
+
onToggleSelect?: (id: string) => void;
|
|
6
|
+
onSelectMultiple?: (ids: string[]) => void;
|
|
7
|
+
}
|
|
8
|
+
interface UseFilterChipSelect {
|
|
9
|
+
handleChipClick(id: string, event: React.MouseEvent): void;
|
|
10
|
+
}
|
|
11
|
+
export declare function useFilterChipSelect({ selectedIds, assignedIds, onToggleSelect, onSelectMultiple, }: UseFilterChipSelectProps): UseFilterChipSelect;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -16,6 +16,10 @@ interface ToggleSelectArea {
|
|
|
16
16
|
type: 'toggleSelectArea';
|
|
17
17
|
id: string;
|
|
18
18
|
}
|
|
19
|
+
interface SelectMultipleAreas {
|
|
20
|
+
type: 'selectMultipleAreas';
|
|
21
|
+
ids: string[];
|
|
22
|
+
}
|
|
19
23
|
interface NewWarning {
|
|
20
24
|
type: 'newWarning';
|
|
21
25
|
}
|
|
@@ -44,7 +48,10 @@ interface MoveWarning {
|
|
|
44
48
|
oldIndex: number;
|
|
45
49
|
newIndex: number;
|
|
46
50
|
}
|
|
47
|
-
|
|
51
|
+
interface MergeWarnings {
|
|
52
|
+
type: 'mergeWarnings';
|
|
53
|
+
}
|
|
54
|
+
type Action = ToggleSelectArea | NewWarning | Initialize | AddSelectedAreasToWarning | ChangeWarning | RemoveWarning | RemoveArea | ClearWarnings | MoveWarning | SelectMultipleAreas | MergeWarnings;
|
|
48
55
|
export declare function reducer(state: State, action: Action): State;
|
|
49
56
|
export declare function useMaritimeWarningsFormState(): [
|
|
50
57
|
State,
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MaritimeWarning, MaritimeWarningsType } from '../../store/publicWarningForm/types';
|
|
2
|
+
import { MaritimeWarningItem, MaritimeWarningsDomain } from './types';
|
|
2
3
|
export declare const isWarningsValid: (warnings: MaritimeWarningItem[]) => boolean;
|
|
4
|
+
export declare const getType: (domain: MaritimeWarningsDomain) => MaritimeWarningsType;
|
|
5
|
+
export declare const mapItemsToMaritimeWarnings: (warnings: MaritimeWarningItem[], domain: MaritimeWarningsDomain, editor?: string) => MaritimeWarning[];
|
|
6
|
+
export declare const mapMaritimeWarningsToItems: (warnings: MaritimeWarning[]) => MaritimeWarningItem[];
|
|
@@ -34,7 +34,8 @@ export declare enum PublicWarningStatus {
|
|
|
34
34
|
IGNORED = "IGNORED",
|
|
35
35
|
WITHDRAWN = "WITHDRAWN"
|
|
36
36
|
}
|
|
37
|
-
export type
|
|
37
|
+
export type MaritimeWarningsType = 'maritimeWarningCoastal' | 'maritimeWarningNorthSea';
|
|
38
|
+
export type WarningType = 'public' | 'airmet' | 'sigmet' | MaritimeWarningsType;
|
|
38
39
|
interface BaseWarning {
|
|
39
40
|
status?: PublicWarningStatus;
|
|
40
41
|
productStatus?: ProductStatus;
|
|
@@ -54,5 +55,14 @@ export interface SigmetWarning extends BaseWarning {
|
|
|
54
55
|
type: 'sigmet';
|
|
55
56
|
sigmetAirmetDetails: Sigmet | CancelSigmet;
|
|
56
57
|
}
|
|
57
|
-
export
|
|
58
|
+
export interface MaritimeWarning extends BaseWarning {
|
|
59
|
+
type: MaritimeWarningsType;
|
|
60
|
+
warningDetail: PublicWarningDetail & {
|
|
61
|
+
windDirectionFrom?: string;
|
|
62
|
+
windForce?: string;
|
|
63
|
+
changeType?: string;
|
|
64
|
+
windDirectionTo?: string;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
export type Warning = PublicWarning | AirmetWarning | SigmetWarning | MaritimeWarning;
|
|
58
68
|
export {};
|