@opengeoweb/taf 1.2.3 → 2.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/lib/TafDemo.stories.d.ts +1 -0
- package/lib/components/IssuesPane/IssuesPane.stories.d.ts +0 -4
- package/lib/components/Providers/Providers.d.ts +11 -0
- package/lib/components/TafForm/TafForm.d.ts +20 -3
- package/lib/components/TafForm/TafFormRow/validField.d.ts +7 -2
- package/lib/components/TafForm/TafFormRow/weather.d.ts +4 -0
- package/lib/components/TafForm/TafFormWrapper.d.ts +1 -1
- package/lib/components/TafForm/TafFormWrapper.stories.d.ts +1 -0
- package/lib/components/TafForm/utils.d.ts +6 -6
- package/lib/components/TafList/TafList.stories.d.ts +1 -0
- package/lib/utils/api.d.ts +1 -1
- package/lib/utils/mockdata/fakeTafList.d.ts +1 -0
- package/lib/utils/testUtils.d.ts +0 -2
- package/package.json +6 -6
- package/taf.esm.js +967 -712
- package/taf.umd.js +420 -311
package/lib/TafDemo.stories.d.ts
CHANGED
|
@@ -4,9 +4,5 @@ declare const _default: {
|
|
|
4
4
|
};
|
|
5
5
|
export default _default;
|
|
6
6
|
export declare const NoIssues: () => React.ReactElement;
|
|
7
|
-
export declare const NoIssuesLight: () => React.ReactElement;
|
|
8
|
-
export declare const NoIssuesDark: () => React.ReactElement;
|
|
9
7
|
export declare const OneIssue: () => React.ReactElement;
|
|
10
8
|
export declare const MultipleIssues: () => React.ReactElement;
|
|
11
|
-
export declare const MultipleIssuesLight: () => React.ReactElement;
|
|
12
|
-
export declare const MultipleIssuesDark: () => React.ReactElement;
|
|
@@ -0,0 +1,11 @@
|
|
|
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 {};
|
|
@@ -1,8 +1,25 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { BaseTaf,
|
|
2
|
+
import { BaseTaf, TafActions } from '../../types';
|
|
3
|
+
export declare const emptyChangegroup: {
|
|
4
|
+
valid: string;
|
|
5
|
+
wind: string;
|
|
6
|
+
visibility: string;
|
|
7
|
+
weather: {
|
|
8
|
+
weather1: any;
|
|
9
|
+
weather2: any;
|
|
10
|
+
weather3: any;
|
|
11
|
+
};
|
|
12
|
+
cloud: {
|
|
13
|
+
cloud1: any;
|
|
14
|
+
cloud2: any;
|
|
15
|
+
cloud3: any;
|
|
16
|
+
cloud4: any;
|
|
17
|
+
};
|
|
18
|
+
change: any;
|
|
19
|
+
probability: any;
|
|
20
|
+
};
|
|
3
21
|
export interface TafFormProps {
|
|
4
|
-
|
|
5
|
-
changeGroups?: ChangeGroupFormData[];
|
|
22
|
+
isDisabled: boolean;
|
|
6
23
|
tafAction?: TafActions;
|
|
7
24
|
staticTAC?: string;
|
|
8
25
|
onFormAction?: (action: TafActions, formValues?: BaseTaf) => void;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { Valid } from '../../../types';
|
|
1
|
+
import { ChangeGroupFormData, Valid } from '../../../types';
|
|
2
|
+
export declare const FORMAT_DAYS_HOURS = "DDHH";
|
|
3
|
+
export declare const FORMAT_DAYS_HOURS_MINUTS = "DDHHmm";
|
|
2
4
|
export declare const formatValidToString: (valid: Valid) => string;
|
|
3
5
|
export declare const parseValidToObject: (value: string, tafStart: string, tafEnd: string) => Valid;
|
|
4
6
|
export declare const invalidValidityDaysHoursStartMessage = "Invalid validity start period, expected a date value between 00 and 31 and an hour value between 00 and 23";
|
|
@@ -7,8 +9,11 @@ export declare const invalidValidityMinutesMessage = "Invalid validity period, s
|
|
|
7
9
|
export declare const invalidValidityStartTimeMessage = "Invalid validity start time, change group validity must lie within the TAF validity period";
|
|
8
10
|
export declare const invalidValidityPeriodMessage = "Invalid validity period, validity end time has to be after validity start time";
|
|
9
11
|
export declare const invalidValidityEndTimeMessage = "Invalid validity end time, change group validity must lie within the TAF validity period";
|
|
10
|
-
export declare const invalidValidityLengthMessage = "Invalid validity period, expected either DDHH/DDHH or DDHHmm";
|
|
11
12
|
export declare const invalidChangeValidInterFieldMessage = "Invalid validity period, expected DDHH/DDHH for BECMG and TEMPO or DDHHmm for FM";
|
|
12
13
|
export declare const invalidBECMGDurationValidInterFieldMessage = "Invalid validity period, for BECMG only validity periods with a duration of 1, 2, 3 or 4 hours are allowed";
|
|
13
14
|
export declare const validateValidField: (value: string, tafStart: string, tafEnd: string) => boolean | string;
|
|
14
15
|
export declare const validateValidChangeGroupInterField: (value: string, valueChange: string, tafStart: string, tafEnd: string) => boolean | string;
|
|
16
|
+
export declare const invalidPreviousChangeGroupIsBeforeMessage = "Valid time should be after previous valid time";
|
|
17
|
+
export declare const invalidPreviousChangeGroupOrderMessage: string;
|
|
18
|
+
export declare const invalidPreviousChangeGroupHasSameValue = "When valid times are equal, probability/change can't have the same value as previous row value";
|
|
19
|
+
export declare const validatePreviousChangeGroup: (currentChangeGroup: ChangeGroupFormData, nextChangeGroup: ChangeGroupFormData, tafStart: string, tafEnd: string) => boolean | string;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { Weather } from '../../../types';
|
|
2
2
|
export declare const invalidWeatherMessage = "Invalid weather input, expected NSW or a valid weather code";
|
|
3
|
+
export declare const invalidWeatherCodeMessage = "Invalid weather input, invalid weather code";
|
|
3
4
|
export declare const invalidWeatherNSWMessage = "Invalid weather input, NSW is not allowed in the baseforecast and can only be used in the first weather group";
|
|
4
5
|
export declare const invalidWeatherWithPreviousEmptyWeather = "Invalid weather input, value is not allowed when previous weather group(s) are empty";
|
|
5
6
|
export declare const invalidWeatherNonUniqueValue = "Invalid weather input, weather groups must be unique";
|
|
6
7
|
export declare const invalidWeatherNonEmptyNSWGroups = "Invalid weather input, when NSW is used, other weather groups must be empty";
|
|
7
8
|
export declare const invalidWeatherCAVOKMessage = "Invalid weather input, when CAVOK is used, weather groups must be empty";
|
|
9
|
+
export declare const invalidWeatherVisibilityBelow5000 = "Invalid weather input, weather codes FU, DU, HZ, DRDU and BLDU need to be combined with a visibility of 5000m or less";
|
|
10
|
+
export declare const invalidWeatherBRVisibility = "Invalid weather input, weather code BR needs to be combined with a visibility between 1000 and 5000m";
|
|
11
|
+
export declare const invalidWeatherFGVisibility = "Invalid weather input, weather code FG needs to be combined with a visibility below 1000m";
|
|
8
12
|
export declare const validateWeatherField: (value: string, visibilityValue: string, NSWAllowed?: boolean) => boolean | string;
|
|
9
13
|
export declare const validateSecondWeatherField: (weather1Value: string, weather2Value: string, visibilityValue: string) => boolean | string;
|
|
10
14
|
export declare const validateThirdWeatherField: (weather1Value: string, weather2Value: string, weather3Value: string, visibilityValue: string) => boolean | string;
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { Taf, TafActions, TafFormData, TafFromBackend } from '../../types';
|
|
3
3
|
export declare const getMessageType: (taf: Taf, tafAction: TafActions) => string;
|
|
4
4
|
export declare const getAmendedCorrectedTafTimes: (taf: Taf, tafAction: TafActions) => Taf;
|
|
5
|
-
export declare const prepareTafValues: (_taf: Taf, tafAction: TafActions) => TafFormData;
|
|
5
|
+
export declare const prepareTafValues: (_taf: Taf, tafAction: TafActions, addEmptyChangeGroup?: boolean) => TafFormData;
|
|
6
6
|
export interface TafFormWrapperProps {
|
|
7
7
|
mode: string;
|
|
8
8
|
tafFromBackend: TafFromBackend;
|
|
@@ -6,3 +6,4 @@ export default _default;
|
|
|
6
6
|
export declare const NewTafForm: () => React.ReactElement;
|
|
7
7
|
export declare const EditTafForm: () => React.ReactElement;
|
|
8
8
|
export declare const ViewTafForm: () => React.ReactElement;
|
|
9
|
+
export declare const EditTafFormWithMultipleSameStartDates: () => React.ReactElement;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import Sortable from 'sortablejs';
|
|
2
|
-
import { ArrayField } from 'react-hook-form';
|
|
3
2
|
import { BaseForecast, BaseForecastFormData, ChangeGroup, ChangeGroupFormData, Taf, TafActions, TafFormData } from '../../types';
|
|
4
3
|
import { FieldNames } from './TafFormRow/types';
|
|
5
4
|
export declare const formatIssueTime: (issueDate: string) => string;
|
|
@@ -8,21 +7,22 @@ export declare function formatFormValues<T extends BaseForecast | ChangeGroup>(r
|
|
|
8
7
|
declare type BaseForecastOrChangeGroup<T extends BaseForecastFormData | ChangeGroupFormData> = T extends ChangeGroupFormData ? ChangeGroup : BaseForecast;
|
|
9
8
|
export declare function parseFormValues<T extends ChangeGroupFormData | BaseForecastFormData>(row: T, tafStart: string, tafEnd: string): BaseForecastOrChangeGroup<T>;
|
|
10
9
|
export declare const convertTafValuesToObject: (formData: TafFormData) => Taf;
|
|
11
|
-
export declare const noTAC = "Missing data: no TAC can be generated";
|
|
12
10
|
export declare const shouldRetrieveTAC: (product: Taf) => boolean;
|
|
13
11
|
export declare const getFieldNames: (isChangeGroup: boolean, index: number) => FieldNames;
|
|
12
|
+
export declare const TAC_MISSING_DATA = "Missing data: no TAC can be generated";
|
|
13
|
+
export declare const TAC_NOT_AVAILABLE = "No TAC available";
|
|
14
|
+
export declare const TAC_RETRIEVING_DATA = "Retrieving TAC";
|
|
14
15
|
export declare const useTACGenerator: (taf: Taf, requestTAC: (postTaf: unknown) => Promise<{
|
|
15
16
|
data: string;
|
|
16
17
|
}>, standardTAC?: string) => [string, (tafToPost: any) => void];
|
|
17
|
-
export declare const getRange: (min: number, max: number) => number[];
|
|
18
18
|
export declare type SortableField = {
|
|
19
19
|
id: string;
|
|
20
20
|
chosen: boolean;
|
|
21
21
|
};
|
|
22
|
-
export declare const useDragOrder: (trigger: (name?: string | string[]) => Promise<boolean>, move: (oldIndex: number, newIndex: number) => void,
|
|
22
|
+
export declare const useDragOrder: (trigger: (name?: string | string[]) => Promise<boolean>, move: (oldIndex: number, newIndex: number) => void, onFormBlur: () => void) => {
|
|
23
23
|
onChangeOrder: (event: Sortable.SortableEvent) => void;
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
onStartDrag: (event: Sortable.SortableEvent) => void;
|
|
25
|
+
activeDraggingIndex: number;
|
|
26
26
|
};
|
|
27
27
|
export declare const getConfirmationDialogTitle: (action: TafActions) => string;
|
|
28
28
|
export declare const getConfirmationDialogContent: (action: TafActions) => string;
|
package/lib/utils/api.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Credentials } from '@opengeoweb/api';
|
|
2
|
-
export declare const createApi: (url: string, appUrl: string, auth: Credentials, setAuth: (cred: Credentials) => void, authTokenUrl: string) => any;
|
|
2
|
+
export declare const createApi: (url: string, appUrl: string, auth: Credentials, setAuth: (cred: Credentials) => void, authTokenUrl: string, authClientId: string) => any;
|
|
@@ -7,3 +7,4 @@ export declare const fakePublishedTaf: TafFromBackend;
|
|
|
7
7
|
export declare const fakeDraftTaf: TafFromBackend;
|
|
8
8
|
export declare const fakeDraftAmendmentTaf: TafFromBackend;
|
|
9
9
|
export declare const fakeAmendmentTaf: TafFromBackend;
|
|
10
|
+
export declare const fakePublishedTafWithSameDates: TafFromBackend;
|
package/lib/utils/testUtils.d.ts
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { Theme as MUITheme } from '@material-ui/core';
|
|
3
2
|
export declare const getActiveStartEndValidSlot: () => {
|
|
4
3
|
start: string;
|
|
5
4
|
end: string;
|
|
6
5
|
};
|
|
7
6
|
interface WrapperProps {
|
|
8
7
|
children: React.ReactNode;
|
|
9
|
-
theme?: MUITheme;
|
|
10
8
|
}
|
|
11
9
|
interface TestWrapperProps extends WrapperProps {
|
|
12
10
|
createApiFunc?: () => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/taf",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "2.1.1",
|
|
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": "16.14.0",
|
|
16
16
|
"@material-ui/core": "^4.11.0",
|
|
17
|
-
"@opengeoweb/theme": "1.
|
|
17
|
+
"@opengeoweb/theme": "2.1.1",
|
|
18
18
|
"@material-ui/lab": "^4.0.0-alpha.56",
|
|
19
19
|
"@material-ui/icons": "^4.9.1",
|
|
20
20
|
"react-hook-form": "^6.12.1",
|
|
21
|
-
"@opengeoweb/shared": "1.
|
|
21
|
+
"@opengeoweb/shared": "2.1.1",
|
|
22
22
|
"react-draggable": "^4.4.3",
|
|
23
23
|
"re-resizable": "^6.9.0",
|
|
24
24
|
"lodash": "^4.17.20",
|
|
25
|
-
"@opengeoweb/form-fields": "1.
|
|
25
|
+
"@opengeoweb/form-fields": "2.1.1",
|
|
26
26
|
"@material-ui/pickers": "^3.2.10",
|
|
27
27
|
"@date-io/moment": "^1.3.13",
|
|
28
28
|
"moment": "^2.29.0",
|
|
29
29
|
"moment-timezone": "^0.5.31",
|
|
30
|
-
"axios": "^0.21.
|
|
30
|
+
"axios": "^0.21.4",
|
|
31
31
|
"react-sortablejs": "^6.0.0",
|
|
32
|
-
"@opengeoweb/api": "1.
|
|
32
|
+
"@opengeoweb/api": "2.1.1",
|
|
33
33
|
"sortablejs": "^1.14.0"
|
|
34
34
|
}
|
|
35
35
|
}
|