@opengeoweb/taf 2.4.1 → 2.7.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.d.ts +1 -0
- package/index.esm.js +706 -319
- package/index.umd.js +757 -365
- package/lib/components/ComponentsLookUp/ComponentsLookUp.d.ts +34 -0
- package/lib/components/ComponentsLookUp/ComponentsLookUp.spec.d.ts +1 -0
- package/lib/components/ComponentsLookUp/index.d.ts +1 -0
- package/lib/components/TafForm/TafForm.d.ts +1 -1
- package/lib/components/TafForm/TafForm.statusChanges.spec.d.ts +1 -0
- package/lib/components/TafForm/TafFormButtons/TafFormButtons.d.ts +1 -0
- package/lib/components/TafForm/utils.d.ts +21 -2
- package/lib/components/TafLayout/TacOverview/ExportButton.d.ts +7 -0
- package/lib/components/TafLayout/TacOverview/ExportButton.spec.d.ts +1 -0
- package/lib/components/TafLayout/TacOverview/TacContainer.d.ts +1 -0
- package/lib/components/TafLayout/TacOverview/TacOverview.d.ts +1 -0
- package/lib/components/TafLayout/TafLayout.d.ts +5 -0
- package/lib/components/TafLayout/TafPanel/TafPanel.d.ts +20 -3
- package/lib/components/TafLayout/utils.d.ts +2 -1
- package/lib/components/TafModule/TafModule.d.ts +2 -1
- package/lib/components/TafModule/TafModule.stories.d.ts +1 -0
- package/lib/components/TafModule/TafModuleProvider.d.ts +32 -0
- package/lib/components/TafWrapper/TafWrapper.d.ts +2 -4
- package/lib/types.d.ts +0 -1
- package/lib/utils/fakeApi.d.ts +1 -1
- package/lib/utils/mockdata/fakeTafList.d.ts +6 -3
- package/lib/utils/testUtils.d.ts +6 -0
- package/package.json +7 -7
- package/lib/components/Providers/Providers.d.ts +0 -11
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ApiUrls, Credentials } from '@opengeoweb/api';
|
|
3
|
+
export declare const tafScreenPreset: {
|
|
4
|
+
id: string;
|
|
5
|
+
title: string;
|
|
6
|
+
views: {
|
|
7
|
+
byId: {
|
|
8
|
+
taf: {
|
|
9
|
+
title: string;
|
|
10
|
+
componentType: string;
|
|
11
|
+
initialProps: {};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
allIds: string[];
|
|
15
|
+
};
|
|
16
|
+
syncGroups: any[];
|
|
17
|
+
mosaicNode: string;
|
|
18
|
+
};
|
|
19
|
+
declare type TafComponentType = 'TafModule';
|
|
20
|
+
export interface ComponentsLookUpPayload {
|
|
21
|
+
componentType: TafComponentType;
|
|
22
|
+
id: string;
|
|
23
|
+
title?: string;
|
|
24
|
+
initialProps: Record<string, never>;
|
|
25
|
+
}
|
|
26
|
+
declare type ApiModuleProps = {
|
|
27
|
+
config: ApiUrls;
|
|
28
|
+
auth: Credentials;
|
|
29
|
+
onSetAuth: (credentias: Credentials) => void;
|
|
30
|
+
onPreventCloseView?: (shouldPreventClose: boolean) => void;
|
|
31
|
+
};
|
|
32
|
+
export declare const TafApiWrapper: React.FC<ApiModuleProps>;
|
|
33
|
+
export declare const componentsLookUp: (payload: ComponentsLookUpPayload, { config, auth, onSetAuth }: ApiModuleProps, ConnectedModuleWrapper?: any) => React.ReactElement;
|
|
34
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ComponentsLookUp';
|
|
@@ -3,9 +3,9 @@ import { BaseTaf, TafActions, TafFromBackend } from '../../types';
|
|
|
3
3
|
import { IssuesPanePosition } from '../IssuesPane/types';
|
|
4
4
|
export interface TafFormProps {
|
|
5
5
|
isDisabled?: boolean;
|
|
6
|
+
setIsDisabled?: (isDisabled: boolean) => void;
|
|
6
7
|
tafFromBackend: TafFromBackend;
|
|
7
8
|
onFormAction?: (action: TafActions, formValues?: BaseTaf) => Promise<boolean>;
|
|
8
|
-
onFormDirty?: (isFormDirty: boolean) => void;
|
|
9
9
|
isIssuesPaneOpen?: boolean;
|
|
10
10
|
setIsIssuesPaneOpen?: (isOpen: boolean, position?: IssuesPanePosition) => void;
|
|
11
11
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
import Sortable from 'sortablejs';
|
|
2
2
|
import { BaseForecast, BaseForecastFormData, ChangeGroup, ChangeGroupFormData, Taf, TafActions, TafFormData, TafStatus } from '../../types';
|
|
3
3
|
import { FieldNames } from './TafFormRow/types';
|
|
4
|
+
export declare const emptyBaseForecast: {
|
|
5
|
+
wind: string;
|
|
6
|
+
visibility: string;
|
|
7
|
+
weather: {
|
|
8
|
+
weather1: string;
|
|
9
|
+
weather2: string;
|
|
10
|
+
weather3: string;
|
|
11
|
+
};
|
|
12
|
+
cloud: {
|
|
13
|
+
cloud1: string;
|
|
14
|
+
cloud2: string;
|
|
15
|
+
cloud3: string;
|
|
16
|
+
cloud4: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
4
19
|
export declare const formatIssueTime: (issueDate: string) => string;
|
|
5
20
|
declare type BaseForecastOrChangeGroupFormData<T extends BaseForecast | ChangeGroup> = T extends ChangeGroup ? ChangeGroupFormData : BaseForecastFormData;
|
|
6
21
|
export declare function formatFormValues<T extends BaseForecast | ChangeGroup>(row: T): BaseForecastOrChangeGroupFormData<T>;
|
|
@@ -12,9 +27,11 @@ export declare const getFieldNames: (isChangeGroup: boolean, index: number) => F
|
|
|
12
27
|
export declare const TAC_MISSING_DATA = "Missing data: no TAC can be generated";
|
|
13
28
|
export declare const TAC_NOT_AVAILABLE = "No TAC available";
|
|
14
29
|
export declare const TAC_RETRIEVING_DATA = "Retrieving TAC";
|
|
15
|
-
export declare const
|
|
30
|
+
export declare const TAC_FAILED = "Failed to retrieve TAC";
|
|
31
|
+
export declare const tacHasError: (tac: string) => boolean;
|
|
32
|
+
export declare const useTACGenerator: (taf: Taf, requestTAC: (postTaf: unknown, abortSignal?: AbortSignal) => Promise<{
|
|
16
33
|
data: string;
|
|
17
|
-
}
|
|
34
|
+
}>) => [string, (tafToPost: any) => void, (newTAC: string) => void];
|
|
18
35
|
export declare type SortableField = {
|
|
19
36
|
id: string;
|
|
20
37
|
chosen: boolean;
|
|
@@ -50,4 +67,6 @@ export declare const getTafStatusLabel: (status: TafStatus) => string;
|
|
|
50
67
|
export declare const getMessageType: (taf: Taf, tafAction: TafActions) => string;
|
|
51
68
|
export declare const getAmendedCorrectedTafTimes: (taf: Taf, tafAction: TafActions) => Taf;
|
|
52
69
|
export declare const prepareTafValues: (_taf: Taf, tafAction: TafActions, addEmptyChangeGroup?: boolean) => TafFormData;
|
|
70
|
+
export declare const getIsFormDefaultDisabled: (status: TafStatus) => boolean;
|
|
71
|
+
export declare const fromStatusToAction: (tafStatus: TafStatus) => TafActions;
|
|
53
72
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TafFromBackend } from '../../types';
|
|
3
|
+
export declare const CONFIRM_DIALOG_OPTIONS: {
|
|
4
|
+
title: string;
|
|
5
|
+
description: string;
|
|
6
|
+
confirmLabel: string;
|
|
7
|
+
};
|
|
3
8
|
interface TafLayoutProps {
|
|
4
9
|
tafList: TafFromBackend[];
|
|
5
10
|
onPostTaf: () => void;
|
|
@@ -1,14 +1,31 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { AxiosError } from 'axios';
|
|
3
|
+
import { TafFromBackend, TafActions, TafStatus, TafFromFrontEnd } from '../../../types';
|
|
3
4
|
import { IssuesPanePosition } from '../../IssuesPane/types';
|
|
5
|
+
export declare const fromActionToStatus: (tafAction: TafActions) => TafStatus;
|
|
6
|
+
declare type TafError = {
|
|
7
|
+
type: 'CANCELLED' | 'SERVER';
|
|
8
|
+
title: string;
|
|
9
|
+
message?: string;
|
|
10
|
+
testId?: string;
|
|
11
|
+
};
|
|
4
12
|
interface TafPanelProps {
|
|
5
13
|
tafFromBackend: TafFromBackend;
|
|
6
14
|
activeTafIndex: number;
|
|
7
15
|
index: number;
|
|
8
|
-
|
|
9
|
-
|
|
16
|
+
isLoading?: boolean;
|
|
17
|
+
postTaf?: (taf: TafFromFrontEnd) => Promise<void>;
|
|
10
18
|
isIssuesPaneOpen?: boolean;
|
|
11
19
|
setIsIssuesPaneOpen?: (isOpen: boolean, position?: IssuesPanePosition) => void;
|
|
20
|
+
isFormDisabled?: boolean;
|
|
21
|
+
setIsFormDisabled?: (isDisabled: boolean) => void;
|
|
22
|
+
error?: TafError;
|
|
12
23
|
}
|
|
24
|
+
export declare const usePostTafRequest: (request: (params?: unknown) => Promise<void>, errorParser?: (error: AxiosError | Error, params: TafFromFrontEnd) => TafError) => {
|
|
25
|
+
isLoading: boolean;
|
|
26
|
+
error: TafError;
|
|
27
|
+
setError: (newError: AxiosError) => void;
|
|
28
|
+
doRequest: (params?: unknown) => Promise<void>;
|
|
29
|
+
};
|
|
13
30
|
declare const TafPanel: React.FC<TafPanelProps>;
|
|
14
31
|
export default TafPanel;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Moment } from 'moment';
|
|
2
|
-
import { TafConfigLocation, TafConfigLocations, TafFromBackend, TafStatus, TimeSlot } from '../../types';
|
|
2
|
+
import { Taf, TafConfigLocation, TafConfigLocations, TafFormData, TafFromBackend, TafStatus, TimeSlot } from '../../types';
|
|
3
3
|
export declare const getLocationSetting: (location: string, locationSettings?: TafConfigLocations) => TafConfigLocation;
|
|
4
4
|
export declare const sortTafsOnLocation: (tafList: TafFromBackend[], locationOrder?: string[]) => TafFromBackend[];
|
|
5
5
|
export declare const getBaseTime: (baseTime: string, location: string) => {
|
|
@@ -16,3 +16,4 @@ export declare const muiTabA11yProps: (index: number) => {
|
|
|
16
16
|
id: string;
|
|
17
17
|
'aria-controls': string;
|
|
18
18
|
};
|
|
19
|
+
export declare const prepareTafExportValues: (tafToCopy: Taf, currentTaf: TafFormData) => TafFormData;
|
|
@@ -7,3 +7,4 @@ export declare const TafModuleLightThemeWithErrorOnAction: () => React.ReactElem
|
|
|
7
7
|
export declare const TafModuleLightThemeWithErrorOnLoadingList: () => React.ReactElement;
|
|
8
8
|
export declare const TafModuleLightTheme: () => React.ReactElement;
|
|
9
9
|
export declare const TafModuleDarkTheme: () => React.ReactElement;
|
|
10
|
+
export declare const TafModuleToolContainerExample: () => React.ReactElement;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { BaseTaf, Taf, TafActions } from '../../types';
|
|
3
|
+
declare type ValidateFormPromise = () => Promise<void | BaseTaf>;
|
|
4
|
+
interface TafModuleMethods {
|
|
5
|
+
onPreventCloseView?: (shouldPreventClose: boolean) => void;
|
|
6
|
+
}
|
|
7
|
+
interface TafModuleContextState {
|
|
8
|
+
onValidateForm: ValidateFormPromise;
|
|
9
|
+
registerValidateForm: (promiseToRegister: ValidateFormPromise) => void;
|
|
10
|
+
tafAction: TafActions;
|
|
11
|
+
setTafAction: (action: TafActions) => void;
|
|
12
|
+
TAC: string;
|
|
13
|
+
updateTAC: (taf: Taf) => void;
|
|
14
|
+
setTAC: (tac: string) => void;
|
|
15
|
+
isFormDirty: boolean;
|
|
16
|
+
setIsFormDirty: (isDirty: boolean) => void;
|
|
17
|
+
}
|
|
18
|
+
declare const TafModuleContext: React.Context<{
|
|
19
|
+
onValidateForm: any;
|
|
20
|
+
registerValidateForm: any;
|
|
21
|
+
tafAction: any;
|
|
22
|
+
setTafAction: any;
|
|
23
|
+
isFormDirty: any;
|
|
24
|
+
setIsFormDirty: any;
|
|
25
|
+
}>;
|
|
26
|
+
export declare const useTafModuleContext: () => Partial<TafModuleContextState>;
|
|
27
|
+
export declare const useTafModuleState: ({ onPreventCloseView, }: TafModuleMethods) => TafModuleContextState;
|
|
28
|
+
export interface TafModuleProviderProps extends TafModuleMethods {
|
|
29
|
+
children?: React.ReactNode;
|
|
30
|
+
}
|
|
31
|
+
export declare const TafModuleProvider: React.FC<TafModuleProviderProps>;
|
|
32
|
+
export default TafModuleContext;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
declare const TafWrapper: React.FC<TafWrapperProps>;
|
|
2
|
+
import { TafModuleProviderProps } from '../TafModule/TafModuleProvider';
|
|
3
|
+
declare const TafWrapper: React.FC<TafModuleProviderProps>;
|
|
6
4
|
export default TafWrapper;
|
package/lib/types.d.ts
CHANGED
package/lib/utils/fakeApi.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const fakeTafTac = "TAF EHAM 0812/0918 20020G35KT 0500 SN BKN040\nBECMG 0814/0816 0700 BKN001=";
|
|
2
2
|
export declare const fakeAxiosInstance: {
|
|
3
3
|
get: (_url: any, _params?: any) => Promise<void>;
|
|
4
|
-
post: (_url: any, _params?: any) => Promise<void>;
|
|
4
|
+
post: (_url: any, _params?: any, _signal?: any) => Promise<void>;
|
|
5
5
|
};
|
|
6
6
|
export declare const createApi: () => any;
|
|
@@ -6,16 +6,19 @@ export declare const fakeNewFixedTaf: TafFromBackend;
|
|
|
6
6
|
export declare const fakeExpiredTaf: TafFromBackend;
|
|
7
7
|
export declare const fakePublishedTaf: TafFromBackend;
|
|
8
8
|
export declare const fakePublishedFixedTaf: TafFromBackend;
|
|
9
|
+
export declare const fakePublishedTafWithoutChangeGroups: TafFromBackend;
|
|
10
|
+
export declare const fakeCancelledTaf: TafFromBackend;
|
|
9
11
|
export declare const fakeDraftTaf: TafFromBackend;
|
|
10
12
|
export declare const fakeDraftFixedTaf: TafFromBackend;
|
|
11
13
|
export declare const fakeDraftAmendmentTaf: TafFromBackend;
|
|
12
14
|
export declare const fakeDraftCorrectedTaf: TafFromBackend;
|
|
13
15
|
export declare const fakeDraftAmendmentFixedTaf: TafFromBackend;
|
|
14
16
|
export declare const fakeAmendmentTaf: TafFromBackend;
|
|
17
|
+
export declare const fakeCorrectedTaf: TafFromBackend;
|
|
15
18
|
export declare const fakeAmendmentFixedTaf: TafFromBackend;
|
|
16
19
|
export declare const fakeCancelledFixedTaf: TafFromBackend;
|
|
17
20
|
export declare const fakeFixedTafList: TafFromBackend[];
|
|
18
21
|
export declare const fakePublishedTafWithChangeGroups: TafFromBackend;
|
|
19
|
-
export declare const
|
|
20
|
-
export declare const
|
|
21
|
-
export declare const
|
|
22
|
+
export declare const fakeDraftTafWithSameDates: TafFromBackend;
|
|
23
|
+
export declare const fakeDraftTafWithSameDatesFixed: TafFromBackend;
|
|
24
|
+
export declare const fakeDraftTafWithFM: TafFromBackend;
|
package/lib/utils/testUtils.d.ts
CHANGED
|
@@ -9,6 +9,12 @@ export interface TestWrapperProps extends WrapperProps {
|
|
|
9
9
|
createApiFunc?: () => void;
|
|
10
10
|
}
|
|
11
11
|
export declare const TestWrapper: React.FC<TestWrapperProps>;
|
|
12
|
+
interface ApiTestWrapperProps extends WrapperProps {
|
|
13
|
+
postTaf?: unknown;
|
|
14
|
+
getTafList?: unknown;
|
|
15
|
+
getTAC?: unknown;
|
|
16
|
+
}
|
|
17
|
+
export declare const ApiTestWrapper: React.FC<ApiTestWrapperProps>;
|
|
12
18
|
interface TestFormWrapperProps {
|
|
13
19
|
children: React.ReactNode;
|
|
14
20
|
options?: UseFormOptions;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/taf",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"description": "GeoWeb TAF library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -14,22 +14,22 @@
|
|
|
14
14
|
"peerDependencies": {
|
|
15
15
|
"react": "^17.0.2",
|
|
16
16
|
"@mui/material": "^5.2.8",
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"@opengeoweb/
|
|
17
|
+
"@opengeoweb/api": "2.7.0",
|
|
18
|
+
"axios": "^0.25.0",
|
|
19
|
+
"@opengeoweb/shared": "2.7.0",
|
|
20
|
+
"@opengeoweb/theme": "2.7.0",
|
|
20
21
|
"@mui/styles": "^5.2.3",
|
|
21
22
|
"@mui/icons-material": "^5.2.5",
|
|
22
23
|
"react-draggable": "^4.4.3",
|
|
23
24
|
"re-resizable": "^6.9.0",
|
|
24
25
|
"lodash": "^4.17.20",
|
|
25
|
-
"@opengeoweb/form-fields": "2.
|
|
26
|
+
"@opengeoweb/form-fields": "2.7.0",
|
|
27
|
+
"react-hook-form": "^6.12.1",
|
|
26
28
|
"moment": "^2.29.0",
|
|
27
29
|
"moment-timezone": "^0.5.31",
|
|
28
30
|
"@mui/lab": "^5.0.0-alpha.64",
|
|
29
|
-
"axios": "^0.25.0",
|
|
30
31
|
"react-dom": "^17.0.2",
|
|
31
32
|
"react-sortablejs": "^6.0.0",
|
|
32
|
-
"@opengeoweb/api": "2.4.1",
|
|
33
33
|
"sortablejs": "^1.14.0"
|
|
34
34
|
}
|
|
35
35
|
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface TAFThemeProviderProps {
|
|
3
|
-
children?: React.ReactNode;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* A Provider component which provides the GeoWeb theme
|
|
7
|
-
* @param children
|
|
8
|
-
* @returns
|
|
9
|
-
*/
|
|
10
|
-
export declare const TAFThemeProvider: React.FC<TAFThemeProviderProps>;
|
|
11
|
-
export {};
|