@opengeoweb/taf 12.0.0 → 12.1.1
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 +1465 -1482
- package/package.json +21 -35
- package/src/index.d.ts +1 -2
- package/src/lib/components/Providers/Providers.d.ts +0 -2
- package/src/lib/components/TafForm/utils.d.ts +2 -3
- package/src/lib/components/TafLayout/TacOverview/TacOverview.stories.d.ts +0 -2
- package/src/lib/components/TafLayout/TafLayout.d.ts +1 -8
- package/src/lib/components/TafLayout/TafPanel/TafPanel.d.ts +2 -14
- package/src/lib/components/TafLayout/TopTabs/TopTabs.d.ts +0 -1
- package/src/lib/components/TafLayout/utils.d.ts +13 -2
- package/src/lib/components/TafModule/TafModule.stories.d.ts +18 -2
- package/src/lib/utils/taf-api/api.d.ts +4 -1
- package/src/lib/utils/taf-api/fakeApi.d.ts +4 -0
- package/src/lib/utils/taf-api/hooks.d.ts +23 -2
- package/src/lib/utils/__mocks__/api.d.ts +0 -15
- package/src/lib/utils/api.d.ts +0 -10
- package/src/lib/utils/api.spec.d.ts +0 -1
- package/src/lib/utils/fakeApi.d.ts +0 -5
- package/src/lib/utils/fakeApi.spec.d.ts +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/taf",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.1.1",
|
|
4
4
|
"description": "GeoWeb TAF library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -8,44 +8,30 @@
|
|
|
8
8
|
"url": "git@gitlab.com:opengeoweb/opengeoweb.git"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@
|
|
12
|
-
"@
|
|
13
|
-
"
|
|
14
|
-
"@
|
|
15
|
-
"@
|
|
11
|
+
"@opengeoweb/api": "12.1.1",
|
|
12
|
+
"@opengeoweb/shared": "12.1.1",
|
|
13
|
+
"react-hook-form": "^7.50.1",
|
|
14
|
+
"@opengeoweb/theme": "12.1.1",
|
|
15
|
+
"@opengeoweb/form-fields": "12.1.1",
|
|
16
|
+
"@opengeoweb/authentication": "12.1.1",
|
|
16
17
|
"@reduxjs/toolkit": "^1.9.7",
|
|
17
|
-
"
|
|
18
|
-
"@
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"@
|
|
22
|
-
"
|
|
23
|
-
"@testing-library/react": "16.0.1",
|
|
24
|
-
"@testing-library/user-event": "14.5.2",
|
|
25
|
-
"@turf/turf": "7.2.0",
|
|
18
|
+
"react-redux": "^8.1.3",
|
|
19
|
+
"@opengeoweb/snackbar": "12.1.1",
|
|
20
|
+
"react-sortablejs": "^6.1.4",
|
|
21
|
+
"sortablejs": "^1.15.1",
|
|
22
|
+
"@emotion/react": "^11.11.1",
|
|
23
|
+
"lodash": "^4.17.21",
|
|
26
24
|
"axios": "^1.7.7",
|
|
27
|
-
"date-fns": "4.1.0",
|
|
28
|
-
"dompurify": "3.2.4",
|
|
29
25
|
"i18next": "^23.11.5",
|
|
30
|
-
"
|
|
31
|
-
"jest-canvas-mock": "2.5.2",
|
|
32
|
-
"jest-date-mock": "1.0.10",
|
|
33
|
-
"lodash": "^4.17.21",
|
|
34
|
-
"msw": "2.7.3",
|
|
35
|
-
"msw-storybook-addon": "2.0.4",
|
|
36
|
-
"ol": "10.4.0",
|
|
37
|
-
"proj4": "2.15.0",
|
|
38
|
-
"re-resizable": "6.11.2",
|
|
39
|
-
"react": "18.3.1",
|
|
40
|
-
"react-dom": "18.3.1",
|
|
41
|
-
"react-draggable": "4.4.6",
|
|
42
|
-
"react-hook-form": "^7.50.1",
|
|
26
|
+
"@mui/material": "^6.1.1",
|
|
43
27
|
"react-i18next": "^15.1.1",
|
|
44
|
-
"react-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
"react
|
|
48
|
-
"
|
|
28
|
+
"@tanstack/react-query": "^5.62.7"
|
|
29
|
+
},
|
|
30
|
+
"peerDependencies": {
|
|
31
|
+
"react": "18",
|
|
32
|
+
"react-dom": "18",
|
|
33
|
+
"@emotion/react": "*",
|
|
34
|
+
"@emotion/styled": "*"
|
|
49
35
|
},
|
|
50
36
|
"module": "./index.esm.js",
|
|
51
37
|
"type": "module",
|
package/src/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import tafTranslations from '../locales/taf.json';
|
|
2
2
|
export * from './lib/components/TafForm';
|
|
3
3
|
export * from './lib/components/TafModule';
|
|
4
|
-
export { createApi } from './lib/utils/api';
|
|
5
|
-
export { createApi as createFakeApi } from './lib/utils/fakeApi';
|
|
6
4
|
export * from './lib/components/ComponentsLookUp';
|
|
5
|
+
export { tafEndPoints } from './lib/utils/taf-api/fakeApi';
|
|
7
6
|
export { TAF_NAMESPACE } from './lib/utils/i18n';
|
|
8
7
|
export { tafTranslations };
|
|
@@ -3,10 +3,8 @@ import { Theme } from '@mui/material';
|
|
|
3
3
|
import { Store } from '@reduxjs/toolkit';
|
|
4
4
|
import { UseFormProps } from 'react-hook-form';
|
|
5
5
|
import { ToolkitStore } from '@reduxjs/toolkit/dist/configureStore';
|
|
6
|
-
import { TafApi } from '../../utils/api';
|
|
7
6
|
export declare const createTestTafStore: () => ToolkitStore;
|
|
8
7
|
export interface TafThemeApiProviderProps {
|
|
9
|
-
createApiFunc?: () => TafApi;
|
|
10
8
|
children: React.ReactNode;
|
|
11
9
|
theme?: Theme;
|
|
12
10
|
store?: Store;
|
|
@@ -28,9 +28,7 @@ export declare const convertTafValuesToObject: (formData: TafFormData) => Taf;
|
|
|
28
28
|
export declare const shouldRetrieveTAC: (product: Taf) => boolean;
|
|
29
29
|
export declare const getFieldNames: (isChangeGroup: boolean, index: number) => FieldNames;
|
|
30
30
|
export declare const tacHasError: (tac: TAC, t: TFunction) => boolean;
|
|
31
|
-
export declare const useTACGenerator: (taf: Taf,
|
|
32
|
-
data: TAC;
|
|
33
|
-
}>, getJSON?: boolean) => [TAC, (tafToPost: Taf) => void, (newTAC: TAC) => void];
|
|
31
|
+
export declare const useTACGenerator: (taf: Taf) => [TAC, (tafToPost: Taf) => void];
|
|
34
32
|
export interface SortableField {
|
|
35
33
|
id: string;
|
|
36
34
|
chosen: boolean;
|
|
@@ -67,6 +65,7 @@ export declare const getMessageType: (taf: Taf, tafAction: TafActions) => string
|
|
|
67
65
|
export declare const getAmendedCorrectedTafTimes: (taf: Taf, tafAction: TafActions) => Taf;
|
|
68
66
|
export declare const createChangeGroup: (changeGroup: ChangeGroupFormData) => ChangeGroupFormData;
|
|
69
67
|
export declare const prepareTafValues: (_taf: Taf, tafAction: TafActions, addEmptyChangeGroups?: boolean) => TafFormData;
|
|
68
|
+
export declare const prepareTafExportValues: (tafToCopy: Taf, currentTaf: TafFormData) => TafFormData;
|
|
70
69
|
export declare const clearTafFormData: (tafFormValues: TafFormData) => TafFormData;
|
|
71
70
|
export declare const getIsFormDefaultDisabled: (status: TafStatus) => boolean;
|
|
72
71
|
export declare const fromStatusToAction: (tafStatus: TafStatus) => TafActions;
|
|
@@ -8,5 +8,3 @@ export declare const TacOverviewWithError: Story;
|
|
|
8
8
|
export declare const TacOverviewWithDifferentTAC: Story;
|
|
9
9
|
export declare const TacOverviewAdverseWeatherLight: Story;
|
|
10
10
|
export declare const TacOverviewAdverseWeatherDark: Story;
|
|
11
|
-
export declare const TacOverviewLightTheme: Story;
|
|
12
|
-
export declare const TacOverviewDarkTheme: Story;
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { TafFromBackend, TafFromFrontEnd, Taf } from '../../types';
|
|
4
|
-
export declare const getTafMessageContent: ({ location, validDateStart, messageType, }: Taf) => {
|
|
5
|
-
location: string;
|
|
6
|
-
formattedDate: string;
|
|
7
|
-
messageType: string;
|
|
8
|
-
};
|
|
9
|
-
export declare const getSnackbarMessage: (tafFromFrontEnd: TafFromFrontEnd, isAutoSaved: boolean, t: TFunction) => string;
|
|
2
|
+
import { TafFromBackend } from '../../types';
|
|
10
3
|
interface TafLayoutProps {
|
|
11
4
|
tafList: TafFromBackend[];
|
|
12
5
|
onUpdateTaf: () => Promise<void>;
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TafFromBackend, Taf, TafActions, TafStatus, TafFromFrontEnd } from '../../../types';
|
|
3
3
|
import { IssuesPanePosition } from '../../IssuesPane/types';
|
|
4
|
+
import { TafError } from '../utils';
|
|
4
5
|
export declare const fromActionToStatus: (tafAction: TafActions) => TafStatus;
|
|
5
|
-
export interface TafError {
|
|
6
|
-
type: 'CANCELLED' | 'SERVER' | 'WARNING';
|
|
7
|
-
title: string;
|
|
8
|
-
message?: string;
|
|
9
|
-
testId?: string;
|
|
10
|
-
}
|
|
11
6
|
interface TafPanelProps {
|
|
12
7
|
tafFromBackend: TafFromBackend;
|
|
13
8
|
activeTafIndex: number;
|
|
@@ -19,16 +14,9 @@ interface TafPanelProps {
|
|
|
19
14
|
setIsIssuesPaneOpen?: (isOpen: boolean, position: IssuesPanePosition) => void;
|
|
20
15
|
isFormDisabled?: boolean;
|
|
21
16
|
setIsFormDisabled?: (isDisabled: boolean) => void;
|
|
22
|
-
error?: TafError;
|
|
17
|
+
error?: TafError | null;
|
|
23
18
|
previousTaf: Taf;
|
|
24
19
|
tafAction: TafActions;
|
|
25
20
|
}
|
|
26
|
-
export declare const isWarning: (error: TafError) => boolean;
|
|
27
|
-
export declare const usePostTafRequest: (request: (params: TafFromFrontEnd) => Promise<void>) => {
|
|
28
|
-
isLoading: boolean;
|
|
29
|
-
error: TafError | undefined;
|
|
30
|
-
setError: (newError: TafError) => void;
|
|
31
|
-
doRequest: (params: TafFromFrontEnd) => Promise<void>;
|
|
32
|
-
};
|
|
33
21
|
declare const TafPanel: React.FC<TafPanelProps>;
|
|
34
22
|
export default TafPanel;
|
|
@@ -5,6 +5,5 @@ interface TopTabsProps {
|
|
|
5
5
|
tafFromBackend: TafFromBackend;
|
|
6
6
|
onChangeTimeSlot?: (timeSlot: TimeSlot, isFormDirty: boolean) => void;
|
|
7
7
|
}
|
|
8
|
-
export declare const formatBaseTime: (time: Date) => string;
|
|
9
8
|
declare const TopTabs: React.FC<TopTabsProps>;
|
|
10
9
|
export default TopTabs;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TFunction } from 'i18next';
|
|
2
|
+
import { AxiosError } from 'axios';
|
|
3
|
+
import { AutoTAFlocations, Taf, TafConfigLocation, TafConfigLocations, TafFromBackend, TafFromFrontEnd, TafStatus, TimeSlot } from '../../types';
|
|
2
4
|
export declare const getLocationSetting: (location: string, locationSettings?: TafConfigLocations) => TafConfigLocation;
|
|
3
5
|
export declare const sortTafsOnLocation: (tafList?: TafFromBackend[], locationOrder?: string[]) => TafFromBackend[];
|
|
4
6
|
export declare const sortTafsOnIssueDate: (tafList?: TafFromBackend[]) => TafFromBackend[];
|
|
@@ -17,9 +19,18 @@ export declare const muiTabA11yProps: (index: number) => {
|
|
|
17
19
|
id: string;
|
|
18
20
|
'aria-controls': string;
|
|
19
21
|
};
|
|
20
|
-
export declare const prepareTafExportValues: (tafToCopy: Taf, currentTaf: TafFormData) => TafFormData;
|
|
21
22
|
export declare const getNewTafLocationIndex: (tafLocations: TafFromBackend[], previousTafLocationUUID: string) => number;
|
|
22
23
|
export declare const getPreviousTaf: (tafList: TafFromBackend[], currentTaf: TafFromBackend) => Taf;
|
|
23
24
|
export declare const getAutoTafLocations: (autoTAFlocations?: AutoTAFlocations | undefined) => AutoTAFlocations | null;
|
|
24
25
|
export declare const scrollToPosition: (scrollRef: React.RefObject<HTMLElement>, activeLocation: string) => void;
|
|
26
|
+
export declare const formatBaseTime: (time: Date) => string;
|
|
27
|
+
export declare const getSnackbarMessage: (tafFromFrontEnd: TafFromFrontEnd, isAutoSaved: boolean, t: TFunction) => string;
|
|
28
|
+
export interface TafError {
|
|
29
|
+
type: 'CANCELLED' | 'SERVER' | 'WARNING';
|
|
30
|
+
title: string;
|
|
31
|
+
message?: string;
|
|
32
|
+
testId?: string;
|
|
33
|
+
}
|
|
34
|
+
export declare const isWarning: (error: TafError) => boolean;
|
|
35
|
+
export declare const parseErrorMessage: (error: AxiosError | Error, params: TafFromFrontEnd, t: TFunction) => TafError;
|
|
25
36
|
export {};
|
|
@@ -1,10 +1,26 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
2
|
import TafModule from './TafModule';
|
|
4
3
|
declare const meta: Meta<typeof TafModule>;
|
|
5
4
|
export default meta;
|
|
6
5
|
type Story = StoryObj<typeof TafModule>;
|
|
7
|
-
export declare const TafModuleLightThemeWithErrorOnAction:
|
|
6
|
+
export declare const TafModuleLightThemeWithErrorOnAction: {
|
|
7
|
+
parameters: {
|
|
8
|
+
msw: {
|
|
9
|
+
handlers: {
|
|
10
|
+
taf: import("msw").HttpHandler[];
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export declare const TafModuleLightThemeWithTakeoverError: {
|
|
16
|
+
parameters: {
|
|
17
|
+
msw: {
|
|
18
|
+
handlers: {
|
|
19
|
+
taf: import("msw").HttpHandler[];
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
};
|
|
8
24
|
export declare const TafModuleLightThemeWithErrorOnLoadingList: {
|
|
9
25
|
parameters: {
|
|
10
26
|
msw: {
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import { Credentials } from '@opengeoweb/authentication';
|
|
2
|
-
import { TafFromBackend } from '../../types';
|
|
2
|
+
import { TAC, Taf, TafFromBackend, TafFromFrontEnd } from '../../types';
|
|
3
3
|
export declare const getTafList: (auth: Credentials) => Promise<TafFromBackend[]>;
|
|
4
|
+
export declare const postTaf: (auth: Credentials, data: TafFromFrontEnd) => Promise<Response>;
|
|
5
|
+
export declare const patchTaf: (auth: Credentials, data: TafFromFrontEnd) => Promise<Response>;
|
|
6
|
+
export declare const getTAC: (auth: Credentials, data: Taf) => Promise<TAC>;
|
|
@@ -1 +1,5 @@
|
|
|
1
|
+
import { AdverseWeatherTAC, TafFromBackend } from '../../types';
|
|
2
|
+
export declare const getFakeUpdatedList: () => TafFromBackend[];
|
|
3
|
+
export declare const fakeTafTac = "TAF EHAM 0812/0918 20020G35KT 0500 SN BKN040 BECMG 0814/0816 0700 BKN001=";
|
|
4
|
+
export declare const fakeTafTacJson: AdverseWeatherTAC;
|
|
1
5
|
export declare const tafEndPoints: import("msw").HttpHandler[];
|
|
@@ -1,3 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { UseMutationResult, UseQueryResult } from '@tanstack/react-query';
|
|
3
|
+
import { TAC, Taf, TafFromBackend, TafFromFrontEnd } from '../../types';
|
|
4
|
+
import { TafError } from '../../components/TafLayout/utils';
|
|
3
5
|
export declare const useTafList: (disabled?: boolean) => UseQueryResult<TafFromBackend[]>;
|
|
6
|
+
type PostReturnType<T> = UseMutationResult<Response | null, Error, T>;
|
|
7
|
+
interface PostTafProps {
|
|
8
|
+
tafData: TafFromFrontEnd;
|
|
9
|
+
isAutoSaved: boolean;
|
|
10
|
+
setError: React.Dispatch<React.SetStateAction<TafError | null>>;
|
|
11
|
+
}
|
|
12
|
+
export declare const usePostTaf: () => PostReturnType<PostTafProps>;
|
|
13
|
+
type PatchReturnType<T> = UseMutationResult<Response | null, Error, T>;
|
|
14
|
+
interface PatchTafProps {
|
|
15
|
+
tafData: TafFromFrontEnd;
|
|
16
|
+
setError: React.Dispatch<React.SetStateAction<TafError | null>>;
|
|
17
|
+
}
|
|
18
|
+
export declare const usePatchTaf: () => PatchReturnType<PatchTafProps>;
|
|
19
|
+
type GetTACReturnType<T> = UseMutationResult<TAC, Error, T>;
|
|
20
|
+
interface GetTACProps {
|
|
21
|
+
tafData: Taf;
|
|
22
|
+
}
|
|
23
|
+
export declare const useGetTAC: () => GetTACReturnType<GetTACProps>;
|
|
24
|
+
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { AdverseWeatherTAC, TAC, Taf, TafFromBackend } from '../../types';
|
|
2
|
-
import { TafApi } from '../api';
|
|
3
|
-
export declare const fakeTestTac = "TAF EHAM 0812/0918 20020G35KT 0500 SN BKN040=";
|
|
4
|
-
export declare const fakeTestTacJson: AdverseWeatherTAC;
|
|
5
|
-
export declare const api: {
|
|
6
|
-
postTaf: () => Promise<void>;
|
|
7
|
-
patchTaf: () => Promise<void>;
|
|
8
|
-
getTafList: () => Promise<{
|
|
9
|
-
data: TafFromBackend[];
|
|
10
|
-
}>;
|
|
11
|
-
getTAC: (taf: Taf, getJSON?: boolean) => Promise<{
|
|
12
|
-
data: TAC;
|
|
13
|
-
}>;
|
|
14
|
-
};
|
|
15
|
-
export declare const createApi: () => TafApi;
|
package/src/lib/utils/api.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { CreateApiProps } from '@opengeoweb/api';
|
|
2
|
-
import { TAC, Taf, TafFromFrontEnd } from '../types';
|
|
3
|
-
export interface TafApi {
|
|
4
|
-
postTaf: (formData: TafFromFrontEnd) => Promise<void>;
|
|
5
|
-
getTAC: (tafData: Taf, getJSON?: boolean, signal?: AbortSignal) => Promise<{
|
|
6
|
-
data: TAC;
|
|
7
|
-
}>;
|
|
8
|
-
patchTaf: (formData: TafFromFrontEnd) => Promise<void>;
|
|
9
|
-
}
|
|
10
|
-
export declare const createApi: (props: CreateApiProps) => TafApi;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { TafFromBackend } from '../types';
|
|
2
|
-
import { TafApi } from './api';
|
|
3
|
-
export declare const fakeTafTac = "TAF EHAM 0812/0918 20020G35KT 0500 SN BKN040\nBECMG 0814/0816 0700 BKN001=";
|
|
4
|
-
export declare const getFakeUpdatedList: () => TafFromBackend[];
|
|
5
|
-
export declare const createApi: () => TafApi;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|