@opengeoweb/warnings 12.10.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 +1159 -556
- package/package.json +15 -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/AreaObjectLoader/AreaObjectLoader.stories.d.ts +1 -1
- package/src/lib/components/ComponentsLookUp/ComponentsLookUp.d.ts +1 -1
- package/src/lib/components/DrawingTool/DrawingTool.stories.d.ts +1 -1
- package/src/lib/components/FilterList/ExpandableFilterChip.d.ts +0 -1
- package/src/lib/components/FilterList/filter-utils.d.ts +49 -4
- 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 -0
- package/src/lib/components/MaritimeWarningsForm/MaritimeWarningsForm.stories.d.ts +8 -4
- package/src/lib/components/MaritimeWarningsForm/MaritimeWarningsFormConnect.d.ts +2 -0
- package/src/lib/components/MaritimeWarningsForm/MaritimeWarningsFormConnect.stories.d.ts +1 -1
- 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/{MartitimeWarningsForm.spec.d.ts → testUtils.d.ts} +1 -0
- package/src/lib/components/MaritimeWarningsForm/useConfirmRetractDialog.d.ts +11 -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 +9 -1
- package/src/lib/components/MaritimeWarningsForm/utils.d.ts +6 -0
- package/src/lib/components/MaritimeWarningsForm/utils.spec.d.ts +1 -0
- package/src/lib/components/ObjectManager/ObjectManager.stories.d.ts +17 -18
- package/src/lib/components/ObjectManager/ObjectManagerConnect.stories.d.ts +1 -1
- package/src/lib/components/PublicWarningList/NewWarningButton/NewWarningButton.stories.d.ts +1 -1
- package/src/lib/components/PublicWarningList/PublicWarningListConnect.stories.d.ts +2 -2
- package/src/lib/components/PublicWarningsForm/AreaField/AreaField.stories.d.ts +2 -3
- package/src/lib/components/PublicWarningsForm/DescriptionField/DescriptionField.stories.d.ts +1 -1
- package/src/lib/components/PublicWarningsForm/PublicWarningsForm.stories.d.ts +1 -1
- package/src/lib/components/PublicWarningsFormDialog/PublicWarningsFormDialog.d.ts +3 -3
- package/src/lib/components/PublicWarningsFormDialog/PublicWarningsFormDialog.stories.d.ts +1 -1
- package/src/lib/store/publicWarningForm/types.d.ts +12 -2
- package/src/lib/utils/sig-airmet-util.d.ts +3 -3
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",
|
|
@@ -40,6 +40,9 @@
|
|
|
40
40
|
"@emotion/react": "*",
|
|
41
41
|
"@emotion/styled": "*"
|
|
42
42
|
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"eslint-plugin-storybook": "9.0.17"
|
|
45
|
+
},
|
|
43
46
|
"module": "./index.esm.js",
|
|
44
47
|
"type": "module",
|
|
45
48
|
"main": "./index.esm.js",
|
|
@@ -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 {};
|
|
@@ -16,5 +16,5 @@ export interface ComponentsLookUpPayload {
|
|
|
16
16
|
export interface ApiModuleProps extends ApiModule {
|
|
17
17
|
config: ApiUrls;
|
|
18
18
|
}
|
|
19
|
-
export declare const componentsLookUp: (payload: ComponentsLookUpPayload) => React.ReactElement;
|
|
19
|
+
export declare const componentsLookUp: (payload: ComponentsLookUpPayload, ComponentsLookUpWrapper?: any) => React.ReactElement;
|
|
20
20
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AirmetPhenomena, SigmetPhenomena } from '@opengeoweb/api';
|
|
1
2
|
import { Warning } from '../../store/publicWarningForm/types';
|
|
2
3
|
export declare enum Domain {
|
|
3
4
|
aviation = "aviation",
|
|
@@ -26,8 +27,52 @@ export declare const defaultDomainFilter: Record<Domain, boolean>;
|
|
|
26
27
|
export declare const domainLevels: Record<Domain, Level[]>;
|
|
27
28
|
export declare const defaultLevelFilter: Record<Level | 'unspecified', boolean>;
|
|
28
29
|
export declare const defaultEmptyFilter: Record<string, boolean>;
|
|
29
|
-
export declare const makeFilterFromList: <T extends string>(options: T[], value?: boolean) => Record<T |
|
|
30
|
-
|
|
30
|
+
export declare const makeFilterFromList: <T extends string>(options: T[], value?: boolean) => Record<T | "unspecified", boolean>;
|
|
31
|
+
declare const AllPhenomena: {
|
|
32
|
+
readonly wind: Phenomenon.wind;
|
|
33
|
+
readonly fog: Phenomenon.fog;
|
|
34
|
+
readonly thunderstorm: Phenomenon.thunderstorm;
|
|
35
|
+
readonly snowIce: Phenomenon.snowIce;
|
|
36
|
+
readonly rain: Phenomenon.rain;
|
|
37
|
+
readonly highTemp: Phenomenon.highTemp;
|
|
38
|
+
readonly lowTemp: Phenomenon.lowTemp;
|
|
39
|
+
readonly coastalEvent: Phenomenon.coastalEvent;
|
|
40
|
+
readonly EMBD_TS: SigmetPhenomena.EMBD_TS;
|
|
41
|
+
readonly EMBD_TSGR: SigmetPhenomena.EMBD_TSGR;
|
|
42
|
+
readonly FRQ_TS: SigmetPhenomena.FRQ_TS;
|
|
43
|
+
readonly FRQ_TSGR: SigmetPhenomena.FRQ_TSGR;
|
|
44
|
+
readonly HVY_DS: SigmetPhenomena.HVY_DS;
|
|
45
|
+
readonly HVY_SS: SigmetPhenomena.HVY_SS;
|
|
46
|
+
readonly OBSC_TS: SigmetPhenomena.OBSC_TS;
|
|
47
|
+
readonly OBSC_TSGR: SigmetPhenomena.OBSC_TSGR;
|
|
48
|
+
readonly RDOACT_CLD: SigmetPhenomena.RDOACT_CLD;
|
|
49
|
+
readonly SEV_ICE: SigmetPhenomena.SEV_ICE;
|
|
50
|
+
readonly SEV_ICE_FRZ_RN: SigmetPhenomena.SEV_ICE_FRZ_RN;
|
|
51
|
+
readonly SEV_MTW: SigmetPhenomena.SEV_MTW;
|
|
52
|
+
readonly SEV_TURB: SigmetPhenomena.SEV_TURB;
|
|
53
|
+
readonly SQL_TS: SigmetPhenomena.SQL_TS;
|
|
54
|
+
readonly SQL_TSGR: SigmetPhenomena.SQL_TSGR;
|
|
55
|
+
readonly VA_CLD: SigmetPhenomena.VA_CLD;
|
|
56
|
+
readonly SFC_VIS: AirmetPhenomena.SFC_VIS;
|
|
57
|
+
readonly SFC_WIND: AirmetPhenomena.SFC_WIND;
|
|
58
|
+
readonly OVC_CLD: AirmetPhenomena.OVC_CLD;
|
|
59
|
+
readonly BKN_CLD: AirmetPhenomena.BKN_CLD;
|
|
60
|
+
readonly ISOL_CB: AirmetPhenomena.ISOL_CB;
|
|
61
|
+
readonly OCNL_CB: AirmetPhenomena.OCNL_CB;
|
|
62
|
+
readonly FRQ_CB: AirmetPhenomena.FRQ_CB;
|
|
63
|
+
readonly ISOL_TS: AirmetPhenomena.ISOL_TS;
|
|
64
|
+
readonly OCNL_TS: AirmetPhenomena.OCNL_TS;
|
|
65
|
+
readonly ISOL_TSGR: AirmetPhenomena.ISOL_TSGR;
|
|
66
|
+
readonly OCNL_TSGR: AirmetPhenomena.OCNL_TSGR;
|
|
67
|
+
readonly ISOL_TCU: AirmetPhenomena.ISOL_TCU;
|
|
68
|
+
readonly OCNL_TCU: AirmetPhenomena.OCNL_TCU;
|
|
69
|
+
readonly FRQ_TCU: AirmetPhenomena.FRQ_TCU;
|
|
70
|
+
readonly MOD_ICE: AirmetPhenomena.MOD_ICE;
|
|
71
|
+
readonly MOD_MTW: AirmetPhenomena.MOD_MTW;
|
|
72
|
+
readonly MOD_TURB: AirmetPhenomena.MOD_TURB;
|
|
73
|
+
readonly MT_OBSC: AirmetPhenomena.MT_OBSC;
|
|
74
|
+
};
|
|
75
|
+
export declare const AllPhenomenaKeys: Record<keyof typeof AllPhenomena, keyof typeof AllPhenomena>;
|
|
31
76
|
export declare const domainPhenomena: Record<Domain, Partial<keyof typeof AllPhenomenaKeys>[]>;
|
|
32
77
|
export declare const defaultPhenomenonFilter: Record<string, boolean>;
|
|
33
78
|
export declare const initialFilters: {
|
|
@@ -45,8 +90,8 @@ interface OptionsMetadata {
|
|
|
45
90
|
allSelected: boolean;
|
|
46
91
|
}
|
|
47
92
|
export declare const getSelectedOptions: (options?: OptionsType) => OptionsMetadata;
|
|
48
|
-
export declare const updateState: <T extends string>(state: Record<T, boolean>, optionKey: T |
|
|
93
|
+
export declare const updateState: <T extends string>(state: Record<T, boolean>, optionKey: T | "ALL", value: boolean, only?: boolean) => Record<T, boolean>;
|
|
49
94
|
/** Make sure our value is in the filter */
|
|
50
|
-
export declare const getValue: <T>(values: Record<string, T>, value: string) => T |
|
|
95
|
+
export declare const getValue: <T>(values: Record<string, T>, value: string) => T | "unspecified";
|
|
51
96
|
export declare const getFiltersFromWarnings: (warnings: Warning[], filterKey: string) => string[];
|
|
52
97
|
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>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { StoryObj, Meta } from '@storybook/react';
|
|
1
|
+
import { StoryObj, Meta } from '@storybook/react-webpack5';
|
|
2
2
|
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;
|
|
@@ -2,5 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { MaritimeWarningsDomain } from './types';
|
|
3
3
|
export interface MaritimeWarningsFormConnectProps {
|
|
4
4
|
domain: MaritimeWarningsDomain;
|
|
5
|
+
onPreventCloseView?: (on: boolean) => void;
|
|
6
|
+
onModifyForm?: (isFormDirty: boolean) => void;
|
|
5
7
|
}
|
|
6
8
|
export declare const MaritimeWarningsFormConnect: React.FC<MaritimeWarningsFormConnectProps>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StoryObj, Meta } from '@storybook/react';
|
|
1
|
+
import { StoryObj, Meta } from '@storybook/react-webpack5';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { MaritimeWarningsFormConnectProps } from './MaritimeWarningsFormConnect';
|
|
4
4
|
declare const MaritimeWarningsFormConnectDemo: React.FC<MaritimeWarningsFormConnectProps>;
|
|
@@ -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>;
|
package/src/lib/components/MaritimeWarningsForm/{MartitimeWarningsForm.spec.d.ts → testUtils.d.ts}
RENAMED
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { WarningListSelectOption } from './WarningList/WarningListSelect';
|
|
2
|
+
export declare function getLabelFromOptionLabel(label: WarningListSelectOption['label']): string;
|
|
2
3
|
export declare function selectOption(container: HTMLElement, comboboxLabel: string, optionLabel: WarningListSelectOption['label']): Promise<void>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Area, MaritimeWarningItem } from './types';
|
|
2
|
+
interface UseConfirmRetractDialogProps {
|
|
3
|
+
areas: Area[];
|
|
4
|
+
warnings: MaritimeWarningItem[];
|
|
5
|
+
onRemoveWarning: (id: string) => void;
|
|
6
|
+
}
|
|
7
|
+
interface UseConfirmRetractDialog {
|
|
8
|
+
onRemoveWarningWithConfirmation(id: string): Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
export declare function useConfirmRetractDialog({ areas, warnings, onRemoveWarning, }: UseConfirmRetractDialogProps): UseConfirmRetractDialog;
|
|
11
|
+
export {};
|
|
@@ -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 {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { MaritimeWarningItem, MaritimeWarningItemAttributes } from './types';
|
|
3
3
|
export declare function createWarning(): MaritimeWarningItem;
|
|
4
|
+
export declare function isPublishedWarning(warning: MaritimeWarningItem): boolean;
|
|
4
5
|
interface State {
|
|
5
6
|
selectedAreaIds: string[];
|
|
6
7
|
warnings: MaritimeWarningItem[];
|
|
@@ -15,6 +16,10 @@ interface ToggleSelectArea {
|
|
|
15
16
|
type: 'toggleSelectArea';
|
|
16
17
|
id: string;
|
|
17
18
|
}
|
|
19
|
+
interface SelectMultipleAreas {
|
|
20
|
+
type: 'selectMultipleAreas';
|
|
21
|
+
ids: string[];
|
|
22
|
+
}
|
|
18
23
|
interface NewWarning {
|
|
19
24
|
type: 'newWarning';
|
|
20
25
|
}
|
|
@@ -43,7 +48,10 @@ interface MoveWarning {
|
|
|
43
48
|
oldIndex: number;
|
|
44
49
|
newIndex: number;
|
|
45
50
|
}
|
|
46
|
-
|
|
51
|
+
interface MergeWarnings {
|
|
52
|
+
type: 'mergeWarnings';
|
|
53
|
+
}
|
|
54
|
+
type Action = ToggleSelectArea | NewWarning | Initialize | AddSelectedAreasToWarning | ChangeWarning | RemoveWarning | RemoveArea | ClearWarnings | MoveWarning | SelectMultipleAreas | MergeWarnings;
|
|
47
55
|
export declare function reducer(state: State, action: Action): State;
|
|
48
56
|
export declare function useMaritimeWarningsFormState(): [
|
|
49
57
|
State,
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { MaritimeWarning, MaritimeWarningsType } from '../../store/publicWarningForm/types';
|
|
2
|
+
import { MaritimeWarningItem, MaritimeWarningsDomain } from './types';
|
|
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[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,29 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
import type { StoryObj } from '@storybook/react';
|
|
1
|
+
import type { StoryObj } from '@storybook/react-webpack5';
|
|
3
2
|
import { ObjectManager } from './ObjectManager';
|
|
4
3
|
import { DrawingListItem } from '../../store/warningsDrawings/types';
|
|
5
4
|
declare const _default: {
|
|
6
5
|
title: string;
|
|
7
6
|
component: import("react").FC<{
|
|
8
|
-
bounds?: string
|
|
9
|
-
title?: string
|
|
7
|
+
bounds?: string;
|
|
8
|
+
title?: string;
|
|
10
9
|
onClose: () => void;
|
|
11
|
-
onMouseDown?: (
|
|
10
|
+
onMouseDown?: () => void;
|
|
12
11
|
isOpen: boolean;
|
|
13
|
-
order?: number
|
|
14
|
-
source?: import("@opengeoweb/shared").Source
|
|
15
|
-
size?: import("@opengeoweb/shared").DraggableSize
|
|
16
|
-
startPosition?: import("@opengeoweb/shared").Position
|
|
17
|
-
headerSize?: import("@opengeoweb/shared").HeaderSize
|
|
12
|
+
order?: number;
|
|
13
|
+
source?: import("@opengeoweb/shared").Source;
|
|
14
|
+
size?: import("@opengeoweb/shared").DraggableSize;
|
|
15
|
+
startPosition?: import("@opengeoweb/shared").Position;
|
|
16
|
+
headerSize?: import("@opengeoweb/shared").HeaderSize;
|
|
18
17
|
drawingListItems: DrawingListItem[];
|
|
19
|
-
onClickDrawing?: (
|
|
20
|
-
onEditDrawing?: (
|
|
21
|
-
onDeleteDrawing?: (
|
|
22
|
-
onShareObject?: (
|
|
23
|
-
onCreateNewObject?: (
|
|
24
|
-
activeDrawingId?: string
|
|
25
|
-
error?: string
|
|
26
|
-
isLoading?: boolean
|
|
18
|
+
onClickDrawing?: (drawing: DrawingListItem) => void;
|
|
19
|
+
onEditDrawing?: (drawingId: string) => void;
|
|
20
|
+
onDeleteDrawing?: (drawingId: string) => void;
|
|
21
|
+
onShareObject?: (object: DrawingListItem) => void;
|
|
22
|
+
onCreateNewObject?: () => void;
|
|
23
|
+
activeDrawingId?: string;
|
|
24
|
+
error?: string;
|
|
25
|
+
isLoading?: boolean;
|
|
27
26
|
}>;
|
|
28
27
|
tags: string[];
|
|
29
28
|
};
|
|
@@ -2,8 +2,8 @@ import React from 'react';
|
|
|
2
2
|
declare const _default: {
|
|
3
3
|
title: string;
|
|
4
4
|
component: ({ description, }: {
|
|
5
|
-
description?: string
|
|
6
|
-
}) => React.ReactElement
|
|
5
|
+
description?: string;
|
|
6
|
+
}) => React.ReactElement;
|
|
7
7
|
tags: string[];
|
|
8
8
|
};
|
|
9
9
|
export default _default;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import type { StoryObj } from '@storybook/react';
|
|
1
|
+
import type { StoryObj } from '@storybook/react-webpack5';
|
|
3
2
|
import { AreaField } from './AreaField';
|
|
4
3
|
declare const _default: {
|
|
5
4
|
title: string;
|
|
@@ -8,7 +7,7 @@ declare const _default: {
|
|
|
8
7
|
onViewObject: () => void;
|
|
9
8
|
onDeleteObject: () => void;
|
|
10
9
|
onAddObject: () => void;
|
|
11
|
-
isDisabled?: boolean
|
|
10
|
+
isDisabled?: boolean;
|
|
12
11
|
}>;
|
|
13
12
|
parameters: {
|
|
14
13
|
docs: {
|
|
@@ -3,9 +3,8 @@ import { Position, DraggableSize, HeaderSize } from '@opengeoweb/shared';
|
|
|
3
3
|
import { AviationProduct } from '@opengeoweb/sigmet-airmet';
|
|
4
4
|
import { uiTypes } from '@opengeoweb/store';
|
|
5
5
|
import { WarningType } from '../../store/publicWarningForm/types';
|
|
6
|
-
export
|
|
6
|
+
export interface PublicWarningsFormDialogProps {
|
|
7
7
|
bounds?: string;
|
|
8
|
-
title?: string;
|
|
9
8
|
onClose: () => void;
|
|
10
9
|
onMouseDown?: () => void;
|
|
11
10
|
isOpen: boolean;
|
|
@@ -22,4 +21,5 @@ export declare const PublicWarningsFormDialog: React.FC<{
|
|
|
22
21
|
publicWarningEditor?: string;
|
|
23
22
|
selectedAviationProduct?: AviationProduct;
|
|
24
23
|
warningType?: WarningType;
|
|
25
|
-
}
|
|
24
|
+
}
|
|
25
|
+
export declare const PublicWarningsFormDialog: React.FC<PublicWarningsFormDialogProps>;
|
|
@@ -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 {};
|
|
@@ -13,6 +13,6 @@ export declare const transformSigmetFromBackendToProductFormat: (warning: Sigmet
|
|
|
13
13
|
export declare const transformAirmetFromBackendToProductFormat: (warning: AirmetFromBackend) => AviationProduct;
|
|
14
14
|
export declare const getEmptySigmetWarning: (productConfig: ProductConfig) => AviationProduct;
|
|
15
15
|
export declare const getEmptyAirmetWarning: (productConfig: ProductConfig) => AviationProduct;
|
|
16
|
-
export declare const renewAviationProduct: <T extends
|
|
17
|
-
export declare const amendAviationProduct: <T extends
|
|
18
|
-
export declare const duplicateAviationProduct: <T extends
|
|
16
|
+
export declare const renewAviationProduct: <T extends SigmetWarning | AirmetWarning>(aviationWarning: T, productConfig: ProductConfig) => T;
|
|
17
|
+
export declare const amendAviationProduct: <T extends SigmetWarning | AirmetWarning>(aviationWarning: T, productConfig: ProductConfig) => T;
|
|
18
|
+
export declare const duplicateAviationProduct: <T extends SigmetWarning | AirmetWarning>(aviationWarning: T) => T;
|