@opengeoweb/warnings 9.23.1 → 9.25.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 +7941 -6391
- package/package.json +2 -2
- package/src/lib/components/AreaObjectLoader/AreaObjectFilter.d.ts +9 -0
- package/src/lib/components/AreaObjectLoader/AreaObjectFilter.spec.d.ts +1 -0
- package/src/lib/components/AreaObjectLoader/AreaObjectLoader.d.ts +10 -2
- package/src/lib/components/AreaObjectLoader/AreaObjectLoaderConnect.stories.d.ts +7 -0
- package/src/lib/components/AreaObjectLoader/AreasObjects.d.ts +7 -1
- package/src/lib/components/DrawingTool/DrawingToolConnect.d.ts +3 -0
- package/src/lib/components/FilterList/FilterChipWithOptions.d.ts +7 -0
- package/src/lib/components/FilterList/FilterChipWithOptions.spec.d.ts +1 -0
- package/src/lib/components/FilterList/FilterChipWithOptions.stories.d.ts +19 -0
- package/src/lib/components/PublicWarningsForm/PublicWarningsForm.d.ts +1 -0
- package/src/lib/components/PublicWarningsFormDialog/PublicWarningsFormDialogConnect.stories.d.ts +1 -0
- package/src/lib/store/drawings/types.d.ts +4 -0
- package/src/lib/store/publicWarningForm/reducer.d.ts +7 -1
- package/src/lib/store/publicWarningForm/selectors.d.ts +10 -0
- package/src/lib/store/publicWarningForm/types.d.ts +5 -1
- package/src/lib/utils/api.d.ts +5 -2
- package/src/lib/utils/fakeApi/index.d.ts +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/warnings",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.25.0",
|
|
4
4
|
"description": "GeoWeb warinings library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
"@opengeoweb/store": "*",
|
|
14
14
|
"@opengeoweb/webmap-react": "*",
|
|
15
15
|
"react-redux": "^8.1.3",
|
|
16
|
-
"@mui/material": "^5.16.0",
|
|
17
16
|
"@opengeoweb/theme": "*",
|
|
18
17
|
"@opengeoweb/form-fields": "*",
|
|
19
18
|
"react-hook-form": "^7.50.1",
|
|
@@ -28,6 +27,7 @@
|
|
|
28
27
|
"@opengeoweb/authentication": "*",
|
|
29
28
|
"react-i18next": "^14.1.2",
|
|
30
29
|
"i18next": "^23.11.5",
|
|
30
|
+
"@mui/material": "^5.16.0",
|
|
31
31
|
"immer": "^10.0.3"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ListFilter } from '@opengeoweb/shared';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface AreaObjectFilterProps {
|
|
4
|
+
filters: ListFilter[];
|
|
5
|
+
onClickFilterChip?: (id: string, selected: boolean) => void;
|
|
6
|
+
searchQuery: string;
|
|
7
|
+
onSearch?: (searchQuery: string) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const AreaObjectFilter: React.ForwardRefExoticComponent<AreaObjectFilterProps & React.RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -2,6 +2,9 @@ import * as React from 'react';
|
|
|
2
2
|
import { HeaderSize, Position, DraggableSize } from '@opengeoweb/shared';
|
|
3
3
|
import { uiTypes } from '@opengeoweb/store';
|
|
4
4
|
import { DrawingListItem } from '../../store/drawings/types';
|
|
5
|
+
import { AreaObjectFilterProps } from './AreaObjectFilter';
|
|
6
|
+
import { Area } from '../../store/publicWarningForm/types';
|
|
7
|
+
export declare const areaErrorType = "area";
|
|
5
8
|
export declare const AreaObjectLoader: React.FC<{
|
|
6
9
|
bounds?: string;
|
|
7
10
|
title?: string;
|
|
@@ -14,6 +17,11 @@ export declare const AreaObjectLoader: React.FC<{
|
|
|
14
17
|
startPosition?: Position;
|
|
15
18
|
headerSize?: HeaderSize;
|
|
16
19
|
drawingListItems: DrawingListItem[];
|
|
17
|
-
error?:
|
|
20
|
+
error?: uiTypes.UISetErrorPayload;
|
|
18
21
|
isLoading?: boolean;
|
|
19
|
-
|
|
22
|
+
onAddArea?: (drawingListItem: DrawingListItem) => void;
|
|
23
|
+
onRemoveArea?: (drawingListItem: DrawingListItem) => void;
|
|
24
|
+
selectedAreas?: Area[];
|
|
25
|
+
isChangeAreaDisabled?: boolean;
|
|
26
|
+
onRetryRequest?: (errorType: string) => void;
|
|
27
|
+
} & AreaObjectFilterProps>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
2
|
import { TFunction } from 'i18next';
|
|
3
3
|
import { DrawingListItem } from '../../store/drawings/types';
|
|
4
|
+
import { Area } from '../../store/publicWarningForm/types';
|
|
4
5
|
interface ObjectAreaList {
|
|
5
6
|
title: string;
|
|
6
7
|
items: DrawingListItem[];
|
|
@@ -14,5 +15,10 @@ export declare const AreasObjects: FC<{
|
|
|
14
15
|
drawingListItems: DrawingListItem[];
|
|
15
16
|
isLoading?: boolean;
|
|
16
17
|
hasError?: boolean;
|
|
18
|
+
filterRef?: React.MutableRefObject<HTMLElement>;
|
|
19
|
+
onAddArea?: (drawingListItem: DrawingListItem) => void;
|
|
20
|
+
onRemoveArea?: (drawingListItem: DrawingListItem) => void;
|
|
21
|
+
selectedAreas?: Area[];
|
|
22
|
+
isChangeAreaDisabled?: boolean;
|
|
17
23
|
}>;
|
|
18
24
|
export {};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { uiTypes } from '@opengeoweb/store';
|
|
3
|
+
import { DrawMode } from '@opengeoweb/webmap-react';
|
|
4
|
+
import { TFunction } from 'i18next';
|
|
3
5
|
export declare const getDialogType: (mapId: string, isMultiMap: boolean) => string;
|
|
6
|
+
export declare const translateDrawModes: (drawModes: DrawMode[], translateFn: TFunction) => DrawMode[];
|
|
4
7
|
interface DrawingToolConnectProps {
|
|
5
8
|
mapId?: string;
|
|
6
9
|
bounds?: string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { FilterListItemProps, FilterChipProps } from '@opengeoweb/shared';
|
|
3
|
+
export interface FilterChipWithOptionsProps extends FilterChipProps {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
filterList?: FilterListItemProps[];
|
|
6
|
+
}
|
|
7
|
+
export declare const FilterChipWithOptions: React.FC<FilterChipWithOptionsProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
};
|
|
5
|
+
export default _default;
|
|
6
|
+
export declare const FilterChipWithOptionsLight: {
|
|
7
|
+
(): React.ReactElement;
|
|
8
|
+
parameters: {
|
|
9
|
+
zeplinLink: {
|
|
10
|
+
name: string;
|
|
11
|
+
link: string;
|
|
12
|
+
}[];
|
|
13
|
+
};
|
|
14
|
+
tags: string[];
|
|
15
|
+
};
|
|
16
|
+
export declare const FilterChipWithOptionsDark: {
|
|
17
|
+
(): React.ReactElement;
|
|
18
|
+
tags: string[];
|
|
19
|
+
};
|
|
@@ -3,6 +3,7 @@ import { Bbox } from '@opengeoweb/webmap';
|
|
|
3
3
|
import { PublicWarningDetail } from '../../store/publicWarningForm/types';
|
|
4
4
|
import { BaseDrawingListItem, DrawingListItem } from '../../store/drawings/types';
|
|
5
5
|
import { FormAction, FormError } from '../../store/publicWarningForm/reducer';
|
|
6
|
+
export declare const useScrollTopOnError: (error: FormError) => React.RefObject<HTMLDivElement>;
|
|
6
7
|
export declare const getEmptyPublicWarning: () => PublicWarningDetail;
|
|
7
8
|
export declare const getFormData: (publicWarningsDetails: PublicWarningDetail | undefined, object?: DrawingListItem) => FormData;
|
|
8
9
|
interface FormData extends PublicWarningDetail {
|
package/src/lib/components/PublicWarningsFormDialog/PublicWarningsFormDialogConnect.stories.d.ts
CHANGED
|
@@ -5,3 +5,4 @@ declare const _default: {
|
|
|
5
5
|
export default _default;
|
|
6
6
|
export declare const PublicWarningsFormDialogConnectMap: () => React.ReactElement;
|
|
7
7
|
export declare const PublicWarningsFormDialogConnectWithoutMap: () => React.ReactElement;
|
|
8
|
+
export declare const PublicWarningsFormDialogConnectWithoutMapWithValues: () => React.ReactElement;
|
|
@@ -25,5 +25,9 @@ export interface DrawingDetails extends Omit<DrawingFromBE, 'id' | 'lastUpdatedT
|
|
|
25
25
|
lastUpdatedTime?: string;
|
|
26
26
|
}
|
|
27
27
|
export type DrawingFromFE = Omit<DrawingDetails, 'username'>;
|
|
28
|
+
export interface FetchDrawingParams {
|
|
29
|
+
keywords?: string;
|
|
30
|
+
search?: string;
|
|
31
|
+
}
|
|
28
32
|
export type SetDrawValuesPayload = DrawItem;
|
|
29
33
|
export type SubmitDrawValuesPayload = DrawingFromFE;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PayloadAction, Draft } from '@reduxjs/toolkit';
|
|
2
2
|
import { AlertColor } from '@mui/material';
|
|
3
3
|
import { DrawingListItem } from '../drawings/types';
|
|
4
|
-
import { PublicWarning } from './types';
|
|
4
|
+
import { Area, PublicWarning } from './types';
|
|
5
5
|
export type FormAction = '' | 'saving' | 'publishing' | 'readonly';
|
|
6
6
|
export interface FormError {
|
|
7
7
|
severity?: AlertColor;
|
|
@@ -24,6 +24,12 @@ export declare const publicWarningFormActions: import("@reduxjs/toolkit").CaseRe
|
|
|
24
24
|
publicWarning?: PublicWarning;
|
|
25
25
|
formState?: FormAction;
|
|
26
26
|
}>) => void;
|
|
27
|
+
addArea: (draft: Draft<PublicWarningFormState>, action: PayloadAction<{
|
|
28
|
+
area: Area;
|
|
29
|
+
}>) => void;
|
|
30
|
+
removeArea: (draft: Draft<PublicWarningFormState>, action: PayloadAction<{
|
|
31
|
+
area: Area;
|
|
32
|
+
}>) => void;
|
|
27
33
|
openPublicWarningFormDialog: (draft: Draft<PublicWarningFormState>, action: PayloadAction<{
|
|
28
34
|
object?: DrawingListItem;
|
|
29
35
|
formState?: FormAction;
|
|
@@ -21,6 +21,16 @@ export declare const getPublicWarningEditor: ((state: WarningModuleStore) => str
|
|
|
21
21
|
}> & {
|
|
22
22
|
clearCache: () => void;
|
|
23
23
|
};
|
|
24
|
+
export declare const getPublicWarningId: ((state: WarningModuleStore) => string | undefined) & import("reselect").OutputSelectorFields<(args_0: PublicWarningFormState) => string | undefined, {
|
|
25
|
+
clearCache: () => void;
|
|
26
|
+
}> & {
|
|
27
|
+
clearCache: () => void;
|
|
28
|
+
};
|
|
29
|
+
export declare const getPublicWarningAreas: ((state: WarningModuleStore) => import("./types").Area[]) & import("reselect").OutputSelectorFields<(args_0: PublicWarningFormState) => import("./types").Area[], {
|
|
30
|
+
clearCache: () => void;
|
|
31
|
+
}> & {
|
|
32
|
+
clearCache: () => void;
|
|
33
|
+
};
|
|
24
34
|
export declare const getPublicWarningFormState: ((state: WarningModuleStore) => "" | "saving" | "publishing" | "readonly") & import("reselect").OutputSelectorFields<(args_0: PublicWarningFormState) => "" | "saving" | "publishing" | "readonly", {
|
|
25
35
|
clearCache: () => void;
|
|
26
36
|
}> & {
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
export interface Area {
|
|
2
|
+
objectName: string;
|
|
3
|
+
geoJSON: GeoJSON.FeatureCollection;
|
|
4
|
+
}
|
|
1
5
|
export interface PublicWarningDetail {
|
|
2
6
|
id?: string;
|
|
3
7
|
phenomenon: string;
|
|
4
|
-
|
|
8
|
+
areas: Area[];
|
|
5
9
|
validFrom: string;
|
|
6
10
|
validUntil: string;
|
|
7
11
|
level: string;
|
package/src/lib/utils/api.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { CreateApiProps } from '@opengeoweb/api';
|
|
2
2
|
import { AxiosInstance } from 'axios';
|
|
3
|
-
import { DrawingFromBE, DrawingFromFE, DrawingListItem } from '../store/drawings/types';
|
|
3
|
+
import { DrawingFromBE, DrawingFromFE, DrawingListItem, FetchDrawingParams } from '../store/drawings/types';
|
|
4
4
|
import { PublicWarning } from '../store/publicWarningForm/types';
|
|
5
5
|
export declare const API_NAME = "warnings";
|
|
6
6
|
export declare const getIdFromUrl: (url: string) => string;
|
|
7
7
|
export interface WarningsApi {
|
|
8
|
-
getDrawings: () => Promise<{
|
|
8
|
+
getDrawings: (params?: FetchDrawingParams) => Promise<{
|
|
9
9
|
data: DrawingListItem[];
|
|
10
10
|
}>;
|
|
11
11
|
getDrawingDetails: (drawingId: string) => Promise<{
|
|
@@ -14,6 +14,9 @@ export interface WarningsApi {
|
|
|
14
14
|
updateDrawing: (drawingId: string, data: DrawingFromFE) => Promise<void>;
|
|
15
15
|
saveDrawingAs: (data: DrawingFromFE) => Promise<string>;
|
|
16
16
|
deleteDrawing: (drawingId: string) => Promise<void>;
|
|
17
|
+
getAreaKeywords: () => Promise<{
|
|
18
|
+
data: string[];
|
|
19
|
+
}>;
|
|
17
20
|
getWarnings: () => Promise<{
|
|
18
21
|
data: PublicWarning[];
|
|
19
22
|
}>;
|
|
@@ -3,4 +3,5 @@ import type { PublicWarning } from '../../store/publicWarningForm/types';
|
|
|
3
3
|
declare const drawingList: DrawingListItem[];
|
|
4
4
|
declare const drawingsListFullContent: DrawingFromBE[];
|
|
5
5
|
declare const warningList: PublicWarning[];
|
|
6
|
-
|
|
6
|
+
declare const areaKeywordList: string[];
|
|
7
|
+
export { drawingList, drawingsListFullContent, warningList, areaKeywordList };
|