@opengeoweb/warnings 12.4.2 → 12.5.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 +4305 -9451
- package/package.json +12 -12
- package/src/index.d.ts +0 -1
- package/src/lib/api/warning-api/api.d.ts +8 -1
- package/src/lib/api/warning-api/hooks.d.ts +19 -0
- package/src/lib/components/AreaObjectLoader/AreaObjectLoaderConnect.stories.d.ts +8 -1
- package/src/lib/components/ComponentsLookUp/ComponentsLookUp.d.ts +1 -6
- package/src/lib/components/ObjectManager/ConfirmDeleteDialog.d.ts +1 -2
- package/src/lib/components/ObjectManager/ObjectManagerConnectErrors.stories.d.ts +32 -4
- package/src/lib/components/Providers/Providers.d.ts +0 -3
- package/src/lib/components/PublicWarningsForm/PublicWarningsFormConnectErrors.stories.d.ts +10 -2
- package/src/lib/store/warningsDrawings/index.d.ts +0 -1
- package/src/lib/utils/fakeApi/index.d.ts +1 -0
- package/src/lib/utils/warningUtils.d.ts +3 -0
- package/src/lib/components/WarningsModuleProvider/WarningsModuleProvider.d.ts +0 -7
- package/src/lib/components/WarningsModuleProvider/WarningsModuleProvider.spec.d.ts +0 -1
- package/src/lib/components/WarningsModuleProvider/index.d.ts +0 -1
- package/src/lib/store/warningsDrawings/listener.d.ts +0 -2
- package/src/lib/utils/api.d.ts +0 -25
- package/src/lib/utils/api.spec.d.ts +0 -1
- package/src/lib/utils/fakeApi.d.ts +0 -6
- package/src/lib/utils/fakeApi.spec.d.ts +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/warnings",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.5.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.5.0",
|
|
12
|
+
"@opengeoweb/shared": "12.5.0",
|
|
13
|
+
"@opengeoweb/store": "12.5.0",
|
|
14
|
+
"@opengeoweb/webmap-react": "12.5.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.5.0",
|
|
18
|
+
"@opengeoweb/form-fields": "12.5.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.5.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.5.0",
|
|
27
|
+
"@opengeoweb/webmap": "12.5.0",
|
|
28
|
+
"@opengeoweb/authentication": "12.5.0",
|
|
29
|
+
"@opengeoweb/sigmet-airmet": "12.5.0",
|
|
30
30
|
"react-i18next": "^15.1.1",
|
|
31
31
|
"i18next": "^25.0.1",
|
|
32
32
|
"@mui/material": "^7.0.1",
|
package/src/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import warningsTranslations from '../locales/warnings.json';
|
|
2
2
|
export * from './lib/components/ObjectManager';
|
|
3
|
-
export * from './lib/components/WarningsModuleProvider';
|
|
4
3
|
export * from './lib/components/DrawingTool';
|
|
5
4
|
export * from './lib/components/DrawingToolForm';
|
|
6
5
|
export * from './lib/components/PublicWarningsFormDialog';
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { Credentials } from '@opengeoweb/authentication';
|
|
2
2
|
import { PublicWarning } from '../../store/publicWarningForm/types';
|
|
3
|
+
import { DrawingFromBE, DrawingFromFE, DrawingListItem, FetchDrawingParams } from '../../store/warningsDrawings/types';
|
|
3
4
|
export declare const getPublicWarningList: (auth: Credentials) => Promise<PublicWarning[]>;
|
|
4
|
-
export declare const updatePublicWarningEditor: (warningId: string, isEditor: boolean, auth: Credentials) => Promise<Headers | null>;
|
|
5
|
+
export declare const updatePublicWarningEditor: (warningId: string, isEditor: boolean, auth: Credentials, force?: boolean) => Promise<Headers | null>;
|
|
5
6
|
export declare const updatePublicWarning: (warningId: string, auth: Credentials, data: PublicWarning) => Promise<Headers | null>;
|
|
6
7
|
export declare const postPublicWarning: (auth: Credentials, data: PublicWarning) => Promise<Headers | null>;
|
|
7
8
|
export declare const deleteWarning: (warningId: string, auth: Credentials) => Promise<null>;
|
|
9
|
+
export declare const getDrawings: (auth: Credentials, params?: FetchDrawingParams) => Promise<DrawingListItem[]>;
|
|
10
|
+
export declare const getDrawingDetails: (auth: Credentials, drawingId: string) => Promise<DrawingFromBE>;
|
|
11
|
+
export declare const getAreaKeywords: (auth: Credentials) => Promise<string[]>;
|
|
12
|
+
export declare const saveDrawingAs: (auth: Credentials, data: DrawingFromFE) => Promise<Headers>;
|
|
13
|
+
export declare const updateDrawing: (auth: Credentials, drawingId: string, data: DrawingFromFE) => Promise<void>;
|
|
14
|
+
export declare const deleteDrawing: (auth: Credentials, drawingId: string) => Promise<void>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { UseMutationResult, UseQueryResult } from '@tanstack/react-query';
|
|
2
2
|
import { PublicWarning } from '../../store/publicWarningForm/types';
|
|
3
|
+
import { DrawingFromBE, DrawingFromFE, DrawingListItem, FetchDrawingParams } from '../../store/warningsDrawings/types';
|
|
3
4
|
/**
|
|
4
5
|
* @param disabled - Disables fetching, but still returns cached values.
|
|
5
6
|
* https://tanstack.com/query/v4/docs/framework/react/guides/disabling-queries
|
|
@@ -8,9 +9,13 @@ export declare const usePublicWarnings: (disabled?: boolean) => UseQueryResult<P
|
|
|
8
9
|
type MutationReturnType<T> = UseMutationResult<Headers | null, Error, T, {
|
|
9
10
|
oldData: PublicWarning[] | undefined;
|
|
10
11
|
}>;
|
|
12
|
+
type DrawingMutationReturnType<T> = UseMutationResult<{
|
|
13
|
+
id: string;
|
|
14
|
+
}, Error, T, void>;
|
|
11
15
|
interface MutateEditorProps {
|
|
12
16
|
id: string;
|
|
13
17
|
isEditor: boolean;
|
|
18
|
+
force?: boolean;
|
|
14
19
|
}
|
|
15
20
|
export declare const useMutatePublicWarningEditor: () => MutationReturnType<MutateEditorProps>;
|
|
16
21
|
interface UpdateWarningProps {
|
|
@@ -24,4 +29,18 @@ export declare const useMutateDeleteWarning: () => MutationReturnType<{
|
|
|
24
29
|
}>;
|
|
25
30
|
export declare const usePublishWarning: () => MutationReturnType<UpdateWarningProps>;
|
|
26
31
|
export declare const useSaveWarning: () => MutationReturnType<UpdateWarningProps>;
|
|
32
|
+
export declare const useDrawings: (params?: FetchDrawingParams, enabled?: boolean) => UseQueryResult<DrawingListItem[]>;
|
|
33
|
+
export declare const useDrawingDetails: (drawingId: string, enabled?: boolean) => UseQueryResult<DrawingFromBE>;
|
|
34
|
+
export declare const useAreaKeywords: (enabled?: boolean) => UseQueryResult<string[]>;
|
|
35
|
+
export declare const useMutateSaveOrUpdateDrawing: () => DrawingMutationReturnType<{
|
|
36
|
+
data: DrawingFromFE;
|
|
37
|
+
id?: string;
|
|
38
|
+
}>;
|
|
39
|
+
interface DeleteDrawingParams {
|
|
40
|
+
drawingId: string;
|
|
41
|
+
objectName: string;
|
|
42
|
+
}
|
|
43
|
+
export declare const useMutateDeleteDrawing: () => UseMutationResult<{
|
|
44
|
+
id: string;
|
|
45
|
+
}, Error, DeleteDrawingParams>;
|
|
27
46
|
export {};
|
|
@@ -5,4 +5,11 @@ declare const _default: {
|
|
|
5
5
|
};
|
|
6
6
|
export default _default;
|
|
7
7
|
export declare const AreaObjectLoaderDemo: () => React.ReactElement;
|
|
8
|
-
export declare const AreaObjectLoaderDemoWithError:
|
|
8
|
+
export declare const AreaObjectLoaderDemoWithError: {
|
|
9
|
+
(): React.ReactElement;
|
|
10
|
+
parameters: {
|
|
11
|
+
msw: {
|
|
12
|
+
handlers: import("msw").HttpHandler[];
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ApiModule, ApiUrls } from '@opengeoweb/api';
|
|
3
|
-
import { PublicWarningListConnectProps } from '../PublicWarningList';
|
|
4
3
|
export type WarningListComponentType = 'WarningList';
|
|
5
4
|
export interface ComponentsLookUpPayload {
|
|
6
5
|
componentType: WarningListComponentType;
|
|
@@ -11,8 +10,4 @@ export interface ComponentsLookUpPayload {
|
|
|
11
10
|
export interface ApiModuleProps extends ApiModule {
|
|
12
11
|
config: ApiUrls;
|
|
13
12
|
}
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
export declare const PublicWarningApiWrapper: React.FC<Props>;
|
|
17
|
-
export declare const componentsLookUp: (payload: ComponentsLookUpPayload, apiProps?: ApiModuleProps) => React.ReactElement;
|
|
18
|
-
export {};
|
|
13
|
+
export declare const componentsLookUp: (payload: ComponentsLookUpPayload) => React.ReactElement;
|
|
@@ -5,7 +5,6 @@ export declare const getDeleteSucces: (objectName: string, t: TFunction) => stri
|
|
|
5
5
|
export declare const ConfirmDeleteDialog: React.FC<{
|
|
6
6
|
objectId: string;
|
|
7
7
|
objectName: string;
|
|
8
|
-
onDeleteSucces: (objectId: string
|
|
8
|
+
onDeleteSucces: (objectId: string) => void;
|
|
9
9
|
onClose: () => void;
|
|
10
10
|
}>;
|
|
11
|
-
export default ConfirmDeleteDialog;
|
|
@@ -4,7 +4,35 @@ declare const _default: {
|
|
|
4
4
|
tags: string[];
|
|
5
5
|
};
|
|
6
6
|
export default _default;
|
|
7
|
-
export declare const ErrorSaveDrawing:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
export declare const ErrorSaveDrawing: {
|
|
8
|
+
(): React.ReactElement;
|
|
9
|
+
parameters: {
|
|
10
|
+
msw: {
|
|
11
|
+
handlers: import("msw").HttpHandler[];
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export declare const ErrorGetList: {
|
|
16
|
+
(): React.ReactElement;
|
|
17
|
+
parameters: {
|
|
18
|
+
msw: {
|
|
19
|
+
handlers: import("msw").HttpHandler[];
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export declare const ErrorEditDrawing: {
|
|
24
|
+
(): React.ReactElement;
|
|
25
|
+
parameters: {
|
|
26
|
+
msw: {
|
|
27
|
+
handlers: import("msw").HttpHandler[];
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export declare const ErrorDeleteDrawing: {
|
|
32
|
+
(): React.ReactElement;
|
|
33
|
+
parameters: {
|
|
34
|
+
msw: {
|
|
35
|
+
handlers: import("msw").HttpHandler[];
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
@@ -2,7 +2,6 @@ import * as React from 'react';
|
|
|
2
2
|
import { Theme } from '@mui/material';
|
|
3
3
|
import { Store } from '@reduxjs/toolkit';
|
|
4
4
|
import { QueryClient } from '@tanstack/react-query';
|
|
5
|
-
import { WarningsApi } from '../../utils/api';
|
|
6
5
|
interface WarningsClientProviderProps {
|
|
7
6
|
children: React.ReactNode;
|
|
8
7
|
optionalQueryClient?: QueryClient;
|
|
@@ -13,13 +12,11 @@ export interface WarningsThemeProviderProps extends WarningsClientProviderProps
|
|
|
13
12
|
export declare const WarningsThemeProvider: React.FC<WarningsThemeProviderProps>;
|
|
14
13
|
interface WarningStoreProviderProps {
|
|
15
14
|
store?: Store;
|
|
16
|
-
createApi?: () => WarningsApi;
|
|
17
15
|
optionalQueryClient?: QueryClient;
|
|
18
16
|
}
|
|
19
17
|
export declare const WarningsStoreProvider: React.FC<WarningStoreProviderProps & WarningsClientProviderProps>;
|
|
20
18
|
export interface WarningsThemeStoreProviderProps extends WarningsThemeProviderProps {
|
|
21
19
|
store?: Store;
|
|
22
|
-
createApi?: () => WarningsApi;
|
|
23
20
|
optionalQueryClient?: QueryClient;
|
|
24
21
|
}
|
|
25
22
|
export declare const WarningsThemeStoreProvider: React.FC<WarningsThemeStoreProviderProps>;
|
|
@@ -4,5 +4,13 @@ declare const _default: {
|
|
|
4
4
|
tags: string[];
|
|
5
5
|
};
|
|
6
6
|
export default _default;
|
|
7
|
-
export declare const
|
|
8
|
-
|
|
7
|
+
export declare const SaveAndPublishError: {
|
|
8
|
+
(): React.ReactElement;
|
|
9
|
+
parameters: {
|
|
10
|
+
msw: {
|
|
11
|
+
handlers: {
|
|
12
|
+
warnings: import("msw").HttpHandler[];
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -10,6 +10,7 @@ declare const airmetList: AirmetWarning[];
|
|
|
10
10
|
declare const combinedWarnings: Warning[];
|
|
11
11
|
declare const areaKeywordList: string[];
|
|
12
12
|
export declare const publicWarningEndpoints: import("msw").HttpHandler[];
|
|
13
|
+
export declare const drawingEndpoints: import("msw").HttpHandler[];
|
|
13
14
|
export declare const makeWarningsHandler: (result: Warning[]) => RequestHandler;
|
|
14
15
|
declare const requestHandlers: import("msw").HttpHandler[];
|
|
15
16
|
export { drawingList, drawingsListFullContent, warningList, lengthWarningListWithoutExpiredWithdrawn, sigmetList, airmetList, combinedWarnings, areaKeywordList, requestHandlers, };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { RefObject } from 'react';
|
|
2
2
|
import { Warning, PublicWarningStatus } from '../store/publicWarningForm/types';
|
|
3
3
|
import { PickedFilterState, OptionKey } from '../components/FilterList/filter-hooks';
|
|
4
|
+
export declare const ERROR_NOT_FOUND = "Request failed with status code 400";
|
|
5
|
+
export declare const MOCK_USERNAME = "user.name";
|
|
4
6
|
interface OverflowCheckResult {
|
|
5
7
|
ref: RefObject<HTMLDivElement>;
|
|
6
8
|
isOverflowing: boolean;
|
|
@@ -11,4 +13,5 @@ export declare const getWarningWithLinkedToId: (warning: Warning) => Warning;
|
|
|
11
13
|
export declare const getWarningWithProposalId: (warning: Warning) => Warning;
|
|
12
14
|
export default function useOverflowCheck(text: string): OverflowCheckResult;
|
|
13
15
|
export declare const getTranslationKey: (optionId: OptionKey<keyof PickedFilterState>, id: string) => string;
|
|
16
|
+
export declare const getIdFromUrl: (url: string) => string;
|
|
14
17
|
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { ApiModule } from '@opengeoweb/api';
|
|
3
|
-
interface WarningsModuleProviderProps extends ApiModule {
|
|
4
|
-
children: React.ReactNode;
|
|
5
|
-
}
|
|
6
|
-
export declare const WarningsModuleProvider: React.FC<WarningsModuleProviderProps>;
|
|
7
|
-
export default WarningsModuleProvider;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { WarningsModuleProvider } from './WarningsModuleProvider';
|
package/src/lib/utils/api.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { CreateApiProps } from '@opengeoweb/api';
|
|
2
|
-
import { AxiosInstance } from 'axios';
|
|
3
|
-
import { DrawingFromBE, DrawingFromFE, DrawingListItem, FetchDrawingParams } from '../store/warningsDrawings/types';
|
|
4
|
-
import { Warning } from '../store/publicWarningForm/types';
|
|
5
|
-
export declare const API_NAME = "warnings";
|
|
6
|
-
export declare const getIdFromUrl: (url: string) => string;
|
|
7
|
-
export interface WarningsApi {
|
|
8
|
-
getDrawings: (params?: FetchDrawingParams) => Promise<{
|
|
9
|
-
data: DrawingListItem[];
|
|
10
|
-
}>;
|
|
11
|
-
getDrawingDetails: (drawingId: string) => Promise<{
|
|
12
|
-
data: DrawingFromBE;
|
|
13
|
-
}>;
|
|
14
|
-
updateDrawing: (drawingId: string, data: DrawingFromFE) => Promise<void>;
|
|
15
|
-
saveDrawingAs: (data: DrawingFromFE) => Promise<string>;
|
|
16
|
-
deleteDrawing: (drawingId: string) => Promise<void>;
|
|
17
|
-
getAreaKeywords: () => Promise<{
|
|
18
|
-
data: string[];
|
|
19
|
-
}>;
|
|
20
|
-
saveWarningAs: (data: Warning) => Promise<string>;
|
|
21
|
-
updateWarning: (warningId: string, data: Warning) => Promise<void>;
|
|
22
|
-
}
|
|
23
|
-
export declare const getApiRoutes: (axiosInstance: AxiosInstance) => WarningsApi;
|
|
24
|
-
export declare const getWarningsApi: () => WarningsApi;
|
|
25
|
-
export declare const createApi: (props: CreateApiProps) => WarningsApi;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { WarningsApi } from './api';
|
|
2
|
-
import { DrawingFromBE } from '../store/warningsDrawings/types';
|
|
3
|
-
export declare const ERROR_NOT_FOUND = "Request failed with status code 400";
|
|
4
|
-
export declare const MOCK_USERNAME = "user.name";
|
|
5
|
-
export declare const extractDrawingDetailsFromJSON: (drawingId: string) => DrawingFromBE;
|
|
6
|
-
export declare const createApi: () => WarningsApi;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|