@opengeoweb/warnings 9.30.0 → 9.32.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 +11770 -11846
- package/package.json +6 -4
- package/src/lib/aviation-api/api.d.ts +7 -0
- package/src/lib/aviation-api/hooks.d.ts +5 -0
- package/src/lib/components/DrawingTool/useObjectDrawDialogAction.d.ts +3 -3
- package/src/lib/components/FilterList/ExpandableFilterChip.d.ts +1 -1
- package/src/lib/components/FilterList/FilterList.d.ts +1 -1
- package/src/lib/components/{PublicWarningList/hooks.d.ts → FilterList/filter-hooks.d.ts} +17 -0
- package/src/lib/components/FilterList/filter-styles.d.ts +2 -0
- package/src/lib/components/PublicWarningsForm/LevelField/LevelField.d.ts +4 -4
- package/src/lib/components/PublicWarningsForm/PublicWarningsForm.d.ts +6 -5
- package/src/lib/components/PublicWarningsForm/PublicWarningsForm.stories.d.ts +8 -0
- package/src/lib/components/PublicWarningsForm/PublicWarningsFormConnect.d.ts +6 -5
- package/src/lib/components/PublicWarningsFormDialog/PublicWarningsFormDialog.d.ts +2 -0
- package/src/lib/components/PublicWarningsFormDialog/PublicWarningsFormDialogConnect.d.ts +2 -6
- package/src/lib/components/WarningsMapView/WarningsMapView.d.ts +2 -5
- package/src/lib/store/publicWarningForm/types.d.ts +1 -0
- package/src/lib/store/publicWarnings/reducer.d.ts +1 -1
- package/src/lib/store/publicWarnings/utils.d.ts +2 -1
- package/src/lib/utils/fakeSigmetAirmet.d.ts +3 -0
- package/src/lib/utils/sig-airmet-util.d.ts +6 -1
- package/src/lib/utils/testUtils.d.ts +4 -0
- package/src/lib/components/FilterList/FilterOption.d.ts +0 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/warnings",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.32.0",
|
|
4
4
|
"description": "GeoWeb warinings library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -22,11 +22,12 @@
|
|
|
22
22
|
"@opengeoweb/snackbar": "*",
|
|
23
23
|
"react-window": "^1.8.10",
|
|
24
24
|
"react-virtualized-auto-sizer": "^1.0.20",
|
|
25
|
-
"axios": "1.
|
|
25
|
+
"axios": "^1.7.7",
|
|
26
26
|
"@opengeoweb/core": "*",
|
|
27
27
|
"@opengeoweb/webmap": "*",
|
|
28
28
|
"@opengeoweb/authentication": "*",
|
|
29
|
-
"
|
|
29
|
+
"@opengeoweb/sigmet-airmet": "*",
|
|
30
|
+
"react-i18next": "^15.1.1",
|
|
30
31
|
"i18next": "^23.11.5",
|
|
31
32
|
"@mui/material": "^6.1.1",
|
|
32
33
|
"immer": "^10.0.3"
|
|
@@ -38,5 +39,6 @@
|
|
|
38
39
|
},
|
|
39
40
|
"module": "./index.esm.js",
|
|
40
41
|
"type": "module",
|
|
41
|
-
"main": "./index.esm.js"
|
|
42
|
+
"main": "./index.esm.js",
|
|
43
|
+
"types": "./index.esm.d.ts"
|
|
42
44
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Credentials } from '@opengeoweb/authentication';
|
|
2
|
+
import { AirmetConfig, AirmetFromBackend, SigmetConfig, SigmetFromBackend } from '@opengeoweb/api';
|
|
3
|
+
export declare const getAirmetList: (auth: Credentials) => Promise<AirmetFromBackend[]>;
|
|
4
|
+
export declare const getSigmetList: (auth: Credentials) => Promise<SigmetFromBackend[]>;
|
|
5
|
+
export declare const getlocalProductConfig: <T extends SigmetConfig | AirmetConfig>(configUrl: string) => Promise<T>;
|
|
6
|
+
export declare const getAirmetConfig: (auth: Credentials) => Promise<AirmetConfig>;
|
|
7
|
+
export declare const getSigmetConfig: (auth: Credentials) => Promise<SigmetConfig>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { UseQueryResult } from '@tanstack/react-query';
|
|
2
|
+
import { AirmetConfig, AirmetFromBackend, SigmetConfig, SigmetFromBackend } from '@opengeoweb/api';
|
|
3
|
+
export declare const useAirmetList: () => UseQueryResult<AirmetFromBackend[]>;
|
|
4
|
+
export declare const useSigmetList: () => UseQueryResult<SigmetFromBackend[]>;
|
|
5
|
+
export declare const useProductConfig: (warningType: 'airmet' | 'sigmet') => UseQueryResult<SigmetConfig | AirmetConfig>;
|
|
@@ -4,19 +4,19 @@ import { TFunction } from 'i18next';
|
|
|
4
4
|
export declare const confirmationDialogOptions: (t: TFunction) => ConfirmationOptions;
|
|
5
5
|
export declare const useCloseDrawDialog: ({ mapId, source, }: {
|
|
6
6
|
mapId: string;
|
|
7
|
-
source?: uiTypes.Source
|
|
7
|
+
source?: uiTypes.Source;
|
|
8
8
|
}) => {
|
|
9
9
|
closeDrawDialog: (skipConfirmationDialog?: boolean) => void;
|
|
10
10
|
};
|
|
11
11
|
export declare const useCloseObjectDialog: ({ mapId, source, }: {
|
|
12
12
|
mapId: string;
|
|
13
|
-
source?: uiTypes.Source
|
|
13
|
+
source?: uiTypes.Source;
|
|
14
14
|
}) => {
|
|
15
15
|
closeObjectDialog: (shouldReset?: boolean) => void;
|
|
16
16
|
};
|
|
17
17
|
export declare const useObjectDrawDialogAction: ({ mapId, source, }: {
|
|
18
18
|
mapId: string;
|
|
19
|
-
source?: uiTypes.Source
|
|
19
|
+
source?: uiTypes.Source;
|
|
20
20
|
}) => {
|
|
21
21
|
openDrawDialog: (geoJSON?: GeoJSON.FeatureCollection) => void;
|
|
22
22
|
closeDrawDialog: () => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { WarningListFilter } from '../../store/publicWarnings/types';
|
|
3
|
-
import { FilterState, UpdateFilter } from '
|
|
3
|
+
import { FilterState, UpdateFilter } from './filter-hooks';
|
|
4
4
|
interface FilterListProps {
|
|
5
5
|
filters?: WarningListFilter[];
|
|
6
6
|
onClickAll?: (isChecked: boolean) => void;
|
|
@@ -4,16 +4,33 @@ declare enum Domain {
|
|
|
4
4
|
maritime = "maritime",
|
|
5
5
|
public = "public"
|
|
6
6
|
}
|
|
7
|
+
declare enum Level {
|
|
8
|
+
unspecified = "unspecified",
|
|
9
|
+
extreme = "extreme",
|
|
10
|
+
moderate = "moderate",
|
|
11
|
+
severe = "severe"
|
|
12
|
+
}
|
|
7
13
|
declare const defaultDomainFilter: Record<Domain, boolean>;
|
|
14
|
+
declare const defaultLevelFilter: Record<Level, boolean>;
|
|
15
|
+
type OptionsType = typeof defaultDomainFilter | typeof defaultLevelFilter;
|
|
8
16
|
export interface FilterState {
|
|
9
17
|
domain: typeof defaultDomainFilter;
|
|
18
|
+
level: typeof defaultLevelFilter;
|
|
10
19
|
}
|
|
11
20
|
export type FilterKeyType = keyof FilterState;
|
|
12
21
|
export type OptionKey<T extends FilterKeyType> = keyof FilterState[T];
|
|
13
22
|
export type UpdateFilter = <T extends FilterKeyType>(filterKey: T | 'ALL', optionKey: OptionKey<T> | 'ALL', value: boolean, only?: boolean) => void;
|
|
14
23
|
export declare const useWarningFilters: () => {
|
|
15
24
|
filterState: FilterState;
|
|
25
|
+
allSelected: boolean;
|
|
16
26
|
updateFilter: UpdateFilter;
|
|
17
27
|
byFilterState: (warning: PublicWarning) => boolean;
|
|
18
28
|
};
|
|
29
|
+
interface OptionsMetadata {
|
|
30
|
+
/** The number of selected options */
|
|
31
|
+
noSelectedOptions: number;
|
|
32
|
+
/** Whether or not all options are selected */
|
|
33
|
+
allSelected: boolean;
|
|
34
|
+
}
|
|
35
|
+
export declare const useSelectedOptions: (options: OptionsType) => OptionsMetadata;
|
|
19
36
|
export {};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { FilterTranslation } from '../../../store/publicWarnings/types';
|
|
3
|
-
export interface
|
|
3
|
+
export interface ColorDefinition {
|
|
4
4
|
color: string;
|
|
5
5
|
textColor: string;
|
|
6
6
|
borderColor: string;
|
|
7
7
|
}
|
|
8
|
-
export interface LevelDetails extends FilterTranslation,
|
|
8
|
+
export interface LevelDetails extends FilterTranslation, ColorDefinition {
|
|
9
9
|
}
|
|
10
10
|
export declare enum WarningLevel {
|
|
11
11
|
moderate = "moderate",
|
|
12
12
|
severe = "severe",
|
|
13
13
|
extreme = "extreme"
|
|
14
14
|
}
|
|
15
|
-
export declare const LevelColors: Record<WarningLevel,
|
|
16
|
-
export declare const getLevelStyle: (levelColor?:
|
|
15
|
+
export declare const LevelColors: Record<WarningLevel, ColorDefinition>;
|
|
16
|
+
export declare const getLevelStyle: (levelColor?: ColorDefinition) => React.CSSProperties;
|
|
17
17
|
export declare const levelOptions: LevelDetails[];
|
|
18
18
|
export declare const levelOptionsDict: Record<string, LevelDetails>;
|
|
19
19
|
export declare const LevelField: React.FC<{
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { AviationProduct, FormMode } from '@opengeoweb/sigmet-airmet';
|
|
3
|
+
import { MapPreset } from '@opengeoweb/store';
|
|
3
4
|
import { PublicWarningDetail } from '../../store/publicWarningForm/types';
|
|
4
5
|
import { BaseDrawingListItem, DrawingListItem } from '../../store/drawings/types';
|
|
5
6
|
import { FormAction, FormError } from '../../store/publicWarningForm/reducer';
|
|
@@ -14,10 +15,7 @@ interface FormData extends PublicWarningDetail {
|
|
|
14
15
|
export declare const prepareFormValues: (data: FormData) => PublicWarningDetail;
|
|
15
16
|
interface FormProps {
|
|
16
17
|
formAction?: FormAction;
|
|
17
|
-
|
|
18
|
-
srs: string;
|
|
19
|
-
bbox: Bbox;
|
|
20
|
-
};
|
|
18
|
+
defaultMapPreset?: MapPreset;
|
|
21
19
|
onSaveForm?: (formValues: PublicWarningDetail) => void;
|
|
22
20
|
onPublishForm?: (formValues: PublicWarningDetail) => void;
|
|
23
21
|
object?: DrawingListItem;
|
|
@@ -27,6 +25,9 @@ interface FormProps {
|
|
|
27
25
|
onFormDirty?: (isFormDirty: boolean) => void;
|
|
28
26
|
isSnapshot?: boolean;
|
|
29
27
|
onAddObject?: () => void;
|
|
28
|
+
selectedAviationProduct?: AviationProduct;
|
|
29
|
+
isSigmetWarning?: boolean;
|
|
30
|
+
mode?: FormMode;
|
|
30
31
|
}
|
|
31
32
|
export declare const PublicWarningsForm: React.FC<FormProps>;
|
|
32
33
|
export {};
|
|
@@ -27,3 +27,11 @@ export declare const PublicWarningsReadOnlyFormDemo: () => React.ReactElement;
|
|
|
27
27
|
export declare const PublicWarningsReadOnlyFormDemoDark: () => React.ReactElement;
|
|
28
28
|
export declare const PublicWarningsDisabledFormDemo: () => React.ReactElement;
|
|
29
29
|
export declare const PublicWarningsDisabledFormDemoDark: () => React.ReactElement;
|
|
30
|
+
export declare const PublicWarningsAviationFormLight: {
|
|
31
|
+
(): React.ReactElement;
|
|
32
|
+
storyName: string;
|
|
33
|
+
};
|
|
34
|
+
export declare const PublicWarningsAviationFormDark: {
|
|
35
|
+
(): React.ReactElement;
|
|
36
|
+
storyName: string;
|
|
37
|
+
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { AviationProduct, FormMode } from '@opengeoweb/sigmet-airmet';
|
|
3
|
+
import { MapPreset } from '@opengeoweb/store';
|
|
3
4
|
interface PublicWarningsFormConnectProps {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
selectedAviationProduct?: AviationProduct;
|
|
6
|
+
isSigmetWarning?: boolean;
|
|
7
|
+
mode?: FormMode;
|
|
8
|
+
defaultMapPreset?: MapPreset;
|
|
8
9
|
}
|
|
9
10
|
export declare const PublicWarningsFormConnect: React.FC<PublicWarningsFormConnectProps>;
|
|
10
11
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Position, DraggableSize, HeaderSize } from '@opengeoweb/shared';
|
|
3
|
+
import { AviationProduct } from '@opengeoweb/sigmet-airmet';
|
|
3
4
|
import { uiTypes } from '@opengeoweb/store';
|
|
4
5
|
export declare const PublicWarningsFormDialog: React.FC<{
|
|
5
6
|
bounds?: string;
|
|
@@ -18,4 +19,5 @@ export declare const PublicWarningsFormDialog: React.FC<{
|
|
|
18
19
|
onChangeFormMode?: (isReadOnly: boolean) => void;
|
|
19
20
|
shouldHideFormMode?: boolean;
|
|
20
21
|
publicWarningEditor?: string;
|
|
22
|
+
selectedAviationProduct?: AviationProduct;
|
|
21
23
|
}>;
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { uiTypes } from '@opengeoweb/store';
|
|
2
|
+
import { uiTypes, MapPreset } from '@opengeoweb/store';
|
|
3
3
|
import { ConfirmationOptions, Position } from '@opengeoweb/shared';
|
|
4
4
|
import { TFunction } from 'i18next';
|
|
5
|
-
import { Bbox } from '@opengeoweb/webmap';
|
|
6
5
|
export declare const warningFormConfirmationOptions: (t: TFunction) => ConfirmationOptions;
|
|
7
6
|
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;
|
|
11
10
|
startPosition?: Position;
|
|
12
|
-
|
|
13
|
-
srs: string;
|
|
14
|
-
bbox: Bbox;
|
|
15
|
-
};
|
|
11
|
+
defaultMapPreset?: MapPreset;
|
|
16
12
|
}>;
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { Bbox } from '@opengeoweb/webmap';
|
|
3
2
|
import { FeatureCollection } from 'geojson';
|
|
3
|
+
import { MapPreset } from '@opengeoweb/store';
|
|
4
4
|
export declare const zoomToFeature: (mapId: string, geojsonFeature: FeatureCollection | undefined) => void;
|
|
5
5
|
interface WarningsMapViewProps {
|
|
6
6
|
geojsonFeature: FeatureCollection | undefined;
|
|
7
|
-
|
|
8
|
-
srs: string;
|
|
9
|
-
bbox: Bbox;
|
|
10
|
-
};
|
|
7
|
+
defaultMapPreset?: MapPreset;
|
|
11
8
|
isSnapshot?: boolean;
|
|
12
9
|
}
|
|
13
10
|
export declare const WarningsMapView: React.FC<WarningsMapViewProps>;
|
|
@@ -18,7 +18,7 @@ export declare const publicWarningActions: import("@reduxjs/toolkit").CaseReduce
|
|
|
18
18
|
};
|
|
19
19
|
}>) => void;
|
|
20
20
|
setWarningListFilters: (draft: Draft<PublicWarningsState>, action: PayloadAction<{
|
|
21
|
-
|
|
21
|
+
newFilters: WarningListFilter[];
|
|
22
22
|
}>) => void;
|
|
23
23
|
toggleFilter: (draft: Draft<PublicWarningsState>, action: PayloadAction<ToggleFilterPayload>) => void;
|
|
24
24
|
toggleOption: (draft: Draft<PublicWarningsState>, action: PayloadAction<ToggleFilterOptionPayload>) => void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FilterListItemProps } from '@opengeoweb/shared';
|
|
2
2
|
import { EntityId, EntityState } from '@reduxjs/toolkit';
|
|
3
|
+
import { TFunction } from 'i18next';
|
|
3
4
|
import { PublicWarning } from '../publicWarningForm/types';
|
|
4
5
|
import { OptionListItem, WarningListFilter } from './types';
|
|
5
6
|
export declare const emptyFilter: {
|
|
@@ -13,7 +14,7 @@ export declare const defaultFilters: {
|
|
|
13
14
|
translationKey: string;
|
|
14
15
|
translations?: TranslateListDict;
|
|
15
16
|
}[];
|
|
16
|
-
export declare const getFiltersFromWarnings: (warnings: PublicWarning[]) => WarningListFilter[];
|
|
17
|
+
export declare const getFiltersFromWarnings: (t: TFunction, warnings: PublicWarning[]) => WarningListFilter[];
|
|
17
18
|
export declare const isWarningMatchingFilter: (filters: OptionListItem[], filterId: EntityId, warningDetailValue: string) => boolean;
|
|
18
19
|
export declare const getUpdatedFilters: (filters: EntityState<WarningListFilter>, newFilters: WarningListFilter[]) => {
|
|
19
20
|
id: EntityId;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import { AirmetFromBackend, ProductStatus, SigmetFromBackend } from '@opengeoweb/api';
|
|
1
|
+
import { Airmet, AirmetConfig, AirmetFromBackend, ProductStatus, SigmetConfig, SigmetFromBackend } from '@opengeoweb/api';
|
|
2
|
+
import { AviationProduct } from '@opengeoweb/sigmet-airmet';
|
|
2
3
|
import { PublicWarning, PublicWarningStatus } from '../store/publicWarningForm/types';
|
|
3
4
|
export declare const transformAirmetToWarningFormat: (apiAirmet: AirmetFromBackend) => PublicWarning;
|
|
4
5
|
export declare const transformSigmetToWarningFormat: (apiSigmet: SigmetFromBackend) => PublicWarning;
|
|
5
6
|
export declare const mapProductStatusToWarningStatus: (productStatus?: ProductStatus) => PublicWarningStatus;
|
|
7
|
+
export declare const transformSigmetToProductFormat: (warning: SigmetFromBackend | undefined, config: SigmetConfig) => AviationProduct;
|
|
8
|
+
export declare const transformAirmetToProductFormat: (warning: AirmetFromBackend | undefined, config: AirmetConfig) => AviationProduct;
|
|
9
|
+
export declare const getEmptySigmetWarning: () => AviationProduct;
|
|
10
|
+
export declare const getEmptyAirmetWarning: () => Airmet;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Store } from '@reduxjs/toolkit';
|
|
2
|
+
import { uiTypes, WebMapStateModuleState } from '@opengeoweb/store';
|
|
3
|
+
import { WarningModuleStore } from '../store/types';
|
|
4
|
+
export declare const createMockStore: (mockState: WarningModuleStore & uiTypes.UIModuleState & WebMapStateModuleState) => Store;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
2
|
-
import { FilterState, OptionKey } from '../PublicWarningList/hooks';
|
|
3
|
-
type FilterType = keyof FilterState;
|
|
4
|
-
interface Props {
|
|
5
|
-
filterId: FilterType;
|
|
6
|
-
optionId: OptionKey<FilterType>;
|
|
7
|
-
checked: boolean;
|
|
8
|
-
onClick: (checked: boolean, only?: boolean) => void;
|
|
9
|
-
label?: ReactNode;
|
|
10
|
-
}
|
|
11
|
-
declare const FilterOption: React.FC<Props>;
|
|
12
|
-
export default FilterOption;
|