@opengeoweb/taf 11.0.0 → 11.1.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/README.md +18 -0
- package/index.esm.js +646 -172
- package/package.json +3 -2
- package/src/lib/TafDemo.stories.d.ts +1 -0
- package/src/lib/components/AutoTaf/AutoTaf.d.ts +9 -0
- package/src/lib/components/AutoTaf/AutoTaf.spec.d.ts +1 -0
- package/src/lib/components/AutoTaf/AutoTaf.stories.d.ts +8 -0
- package/src/lib/components/AutoTaf/index.d.ts +1 -0
- package/src/lib/components/ComponentsLookUp/ComponentsLookUp.d.ts +5 -1
- package/src/lib/components/TafForm/TafForm.d.ts +0 -1
- package/src/lib/components/TafLayout/TacOverview/TacContainer.d.ts +4 -0
- package/src/lib/components/TafLayout/TacOverview/TacContainerLayout.d.ts +10 -0
- package/src/lib/components/TafLayout/TacOverview/TacOverviewMobile.d.ts +1 -0
- package/src/lib/components/TafLayout/TacOverview/TacOverviewMobile.stories.d.ts +2 -0
- package/src/lib/components/TafLayout/TafLayout.d.ts +2 -1
- package/src/lib/components/TafLayout/TafLayout.stories.d.ts +2 -0
- package/src/lib/components/TafLayout/TafPanel/TafPanel.d.ts +0 -1
- package/src/lib/components/TafLayout/utils.d.ts +3 -1
- package/src/lib/components/TafModule/TafModule.d.ts +3 -1
- package/src/lib/components/TafModule/TafModule.stories.d.ts +27 -3
- package/src/lib/types.d.ts +3 -1
- package/src/lib/utils/api.d.ts +1 -4
- package/src/lib/utils/fakeApi.d.ts +2 -0
- package/src/lib/utils/taf-api/api.d.ts +3 -0
- package/src/lib/utils/taf-api/fakeApi.d.ts +1 -0
- package/src/lib/utils/taf-api/hooks.d.ts +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/taf",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.1.0",
|
|
4
4
|
"description": "GeoWeb TAF library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
"axios": "^1.7.7",
|
|
25
25
|
"i18next": "^23.11.5",
|
|
26
26
|
"@mui/material": "^6.1.1",
|
|
27
|
-
"react-i18next": "^15.1.1"
|
|
27
|
+
"react-i18next": "^15.1.1",
|
|
28
|
+
"@tanstack/react-query": "^5.62.7"
|
|
28
29
|
},
|
|
29
30
|
"peerDependencies": {
|
|
30
31
|
"react": "18",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { AutoTaf } from './AutoTaf';
|
|
3
|
+
declare const meta: Meta<typeof AutoTaf>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof AutoTaf>;
|
|
6
|
+
export declare const Component: Story;
|
|
7
|
+
export declare const ComponentDark: Story;
|
|
8
|
+
export declare const ComponentActiveTaf: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AutoTaf';
|
|
@@ -17,15 +17,19 @@ export declare const tafScreenPreset: {
|
|
|
17
17
|
mosaicNode: string;
|
|
18
18
|
};
|
|
19
19
|
type TafComponentType = 'TafModule';
|
|
20
|
+
interface InitialProps {
|
|
21
|
+
isAutoTafEnabled?: boolean;
|
|
22
|
+
}
|
|
20
23
|
export interface ComponentsLookUpPayload {
|
|
21
24
|
componentType: TafComponentType;
|
|
22
25
|
id: string;
|
|
23
26
|
title?: string;
|
|
24
|
-
initialProps:
|
|
27
|
+
initialProps: InitialProps;
|
|
25
28
|
}
|
|
26
29
|
export interface ApiModuleProps extends ApiModule {
|
|
27
30
|
config: ApiUrls;
|
|
28
31
|
onPreventCloseView?: (shouldPreventClose: boolean) => void;
|
|
32
|
+
initialProps?: InitialProps;
|
|
29
33
|
}
|
|
30
34
|
export declare const TafApiWrapper: React.FC<ApiModuleProps>;
|
|
31
35
|
export declare const componentsLookUp: (payload: ComponentsLookUpPayload, { config, auth, onSetAuth }: ApiModuleProps, ConnectedModuleWrapper?: any) => React.ReactElement;
|
|
@@ -9,7 +9,6 @@ export interface TafFormProps {
|
|
|
9
9
|
isIssuesPaneOpen?: boolean;
|
|
10
10
|
setIsIssuesPaneOpen?: (isOpen: boolean, position: IssuesPanePosition) => void;
|
|
11
11
|
onSwitchEditor?: (formValues: TafFromFrontEnd) => Promise<boolean>;
|
|
12
|
-
fetchNewTafList?: () => Promise<TafFromBackend[]>;
|
|
13
12
|
previousTaf?: Taf;
|
|
14
13
|
}
|
|
15
14
|
declare const TafForm: React.FC<TafFormProps>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface TacContainerLayoutProps {
|
|
3
|
+
location: string;
|
|
4
|
+
isActive?: boolean;
|
|
5
|
+
exportBtnSlot?: React.ReactNode;
|
|
6
|
+
statusSlot?: React.ReactNode;
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
declare const TacContainerLayout: React.FC<TacContainerLayoutProps>;
|
|
10
|
+
export default TacContainerLayout;
|
|
@@ -5,3 +5,5 @@ export default meta;
|
|
|
5
5
|
type Story = StoryObj<typeof TacOverviewMobile>;
|
|
6
6
|
export declare const TacOverviewMobileLight: Story;
|
|
7
7
|
export declare const TacOverviewMobileDark: Story;
|
|
8
|
+
export declare const TacOverviewMobileAutoTaf: Story;
|
|
9
|
+
export declare const TacOverviewMobileAutoTafDark: Story;
|
|
@@ -9,8 +9,9 @@ export declare const getTafMessageContent: ({ location, validDateStart, messageT
|
|
|
9
9
|
export declare const getSnackbarMessage: (tafFromFrontEnd: TafFromFrontEnd, isAutoSaved: boolean, t: TFunction) => string;
|
|
10
10
|
interface TafLayoutProps {
|
|
11
11
|
tafList: TafFromBackend[];
|
|
12
|
-
onUpdateTaf: () => Promise<
|
|
12
|
+
onUpdateTaf: () => Promise<void>;
|
|
13
13
|
lastUpdateTime?: string;
|
|
14
|
+
isAutoTafEnabled?: boolean;
|
|
14
15
|
}
|
|
15
16
|
declare const TafLayout: React.FC<TafLayoutProps>;
|
|
16
17
|
export default TafLayout;
|
|
@@ -7,3 +7,5 @@ export declare const DemoTafLayoutLightTheme: Story;
|
|
|
7
7
|
export declare const DemoTafLayoutDarkTheme: Story;
|
|
8
8
|
export declare const TafLayoutLight: Story;
|
|
9
9
|
export declare const TafLayoutDark: Story;
|
|
10
|
+
export declare const TafLayoutAutoTaf: Story;
|
|
11
|
+
export declare const TafLayoutAutoTafDark: Story;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Taf, TafConfigLocation, TafConfigLocations, TafFormData, TafFromBackend, TafStatus, TimeSlot } from '../../types';
|
|
1
|
+
import { AutoTAFlocations, Taf, TafConfigLocation, TafConfigLocations, TafFormData, TafFromBackend, TafStatus, TimeSlot } from '../../types';
|
|
2
2
|
export declare const getLocationSetting: (location: string, locationSettings?: TafConfigLocations) => TafConfigLocation;
|
|
3
3
|
export declare const sortTafsOnLocation: (tafList?: TafFromBackend[], locationOrder?: string[]) => TafFromBackend[];
|
|
4
4
|
export declare const sortTafsOnIssueDate: (tafList?: TafFromBackend[]) => TafFromBackend[];
|
|
@@ -20,4 +20,6 @@ export declare const muiTabA11yProps: (index: number) => {
|
|
|
20
20
|
export declare const prepareTafExportValues: (tafToCopy: Taf, currentTaf: TafFormData) => TafFormData;
|
|
21
21
|
export declare const getNewTafLocationIndex: (tafLocations: TafFromBackend[], previousTafLocationUUID: string) => number;
|
|
22
22
|
export declare const getPreviousTaf: (tafList: TafFromBackend[], currentTaf: TafFromBackend) => Taf;
|
|
23
|
+
export declare const getAutoTafLocations: (autoTAFlocations?: AutoTAFlocations | undefined) => AutoTAFlocations | null;
|
|
24
|
+
export declare const scrollToPosition: (scrollRef: React.RefObject<HTMLElement>, activeLocation: string) => void;
|
|
23
25
|
export {};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { TafModuleProviderProps } from './TafModuleProvider';
|
|
3
3
|
export declare const getCurrentDate: () => string;
|
|
4
|
-
declare const Wrapper: React.FC<TafModuleProviderProps
|
|
4
|
+
declare const Wrapper: React.FC<TafModuleProviderProps & {
|
|
5
|
+
isAutoTafEnabled?: boolean;
|
|
6
|
+
}>;
|
|
5
7
|
export default Wrapper;
|
|
@@ -5,9 +5,33 @@ declare const meta: Meta<typeof TafModule>;
|
|
|
5
5
|
export default meta;
|
|
6
6
|
type Story = StoryObj<typeof TafModule>;
|
|
7
7
|
export declare const TafModuleLightThemeWithErrorOnAction: () => React.ReactElement;
|
|
8
|
-
export declare const TafModuleLightThemeWithErrorOnLoadingList:
|
|
9
|
-
|
|
8
|
+
export declare const TafModuleLightThemeWithErrorOnLoadingList: {
|
|
9
|
+
parameters: {
|
|
10
|
+
msw: {
|
|
11
|
+
handlers: {
|
|
12
|
+
taf: import("msw").HttpHandler[];
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export declare const TafModuleWithNewData: {
|
|
18
|
+
parameters: {
|
|
19
|
+
msw: {
|
|
20
|
+
handlers: {
|
|
21
|
+
taf: import("msw").HttpHandler[];
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
};
|
|
10
26
|
export declare const TafModuleLightTheme: Story;
|
|
11
27
|
export declare const TafModuleDarkTheme: Story;
|
|
12
28
|
export declare const TafModuleToolContainerExample: Story;
|
|
13
|
-
export declare const TafModulePublishDraftAmendmentExample:
|
|
29
|
+
export declare const TafModulePublishDraftAmendmentExample: {
|
|
30
|
+
parameters: {
|
|
31
|
+
msw: {
|
|
32
|
+
handlers: {
|
|
33
|
+
taf: import("msw").HttpHandler[];
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
};
|
package/src/lib/types.d.ts
CHANGED
|
@@ -66,7 +66,7 @@ export interface BaseTaf {
|
|
|
66
66
|
uuid: string;
|
|
67
67
|
issueDate?: TafDate;
|
|
68
68
|
}
|
|
69
|
-
export type TafStatus = 'NEW' | 'DRAFT' | 'DRAFT_AMENDED' | 'DRAFT_CORRECTED' | 'PUBLISHED' | 'CORRECTED' | 'AMENDED' | 'CANCELLED' | 'EXPIRED';
|
|
69
|
+
export type TafStatus = 'NEW' | 'DRAFT' | 'DRAFT_AMENDED' | 'DRAFT_CORRECTED' | 'PUBLISHED' | 'CORRECTED' | 'AMENDED' | 'CANCELLED' | 'EXPIRED' | 'AUTO';
|
|
70
70
|
export type TafActions = 'NEW' | 'DRAFT' | 'DRAFT_AMEND' | 'DRAFT_CORRECT' | 'PUBLISH' | 'CANCEL' | 'CORRECT' | 'AMEND' | 'CLOSE' | 'CLEAR';
|
|
71
71
|
export type TafCanbe = 'DRAFTED' | 'DISCARDED' | 'PUBLISHED' | 'CANCELLED' | 'AMENDED' | 'CORRECTED';
|
|
72
72
|
export interface Taf extends BaseTaf {
|
|
@@ -126,10 +126,12 @@ export interface TafConfigLocation {
|
|
|
126
126
|
label: string;
|
|
127
127
|
}
|
|
128
128
|
export type TafConfigLocations = Record<string, TafConfigLocation>;
|
|
129
|
+
export type AutoTAFlocations = string[];
|
|
129
130
|
export interface TafConfig {
|
|
130
131
|
location_indicator_mwo: string;
|
|
131
132
|
locations: TafConfigLocations;
|
|
132
133
|
locationOrder: string[];
|
|
134
|
+
autoTAFlocations?: AutoTAFlocations;
|
|
133
135
|
}
|
|
134
136
|
export type TimeSlot = 'UPCOMING' | 'ACTIVE' | 'EXPIRED';
|
|
135
137
|
export interface AdverseWeatherTAC {
|
package/src/lib/utils/api.d.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { CreateApiProps } from '@opengeoweb/api';
|
|
2
|
-
import { TAC, Taf,
|
|
2
|
+
import { TAC, Taf, TafFromFrontEnd } from '../types';
|
|
3
3
|
export interface TafApi {
|
|
4
|
-
getTafList: () => Promise<{
|
|
5
|
-
data: TafFromBackend[];
|
|
6
|
-
}>;
|
|
7
4
|
postTaf: (formData: TafFromFrontEnd) => Promise<void>;
|
|
8
5
|
getTAC: (tafData: Taf, getJSON?: boolean, signal?: AbortSignal) => Promise<{
|
|
9
6
|
data: TAC;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { TafFromBackend } from '../types';
|
|
1
2
|
import { TafApi } from './api';
|
|
2
3
|
export declare const fakeTafTac = "TAF EHAM 0812/0918 20020G35KT 0500 SN BKN040\nBECMG 0814/0816 0700 BKN001=";
|
|
4
|
+
export declare const getFakeUpdatedList: () => TafFromBackend[];
|
|
3
5
|
export declare const createApi: () => TafApi;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const tafEndPoints: import("msw").HttpHandler[];
|