@opengeoweb/taf 1.2.5 → 2.1.2

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.
@@ -1,8 +1,6 @@
1
1
  import React from 'react';
2
- import { Theme } from '@material-ui/core';
3
2
  interface TAFThemeProviderProps {
4
3
  children?: React.ReactNode;
5
- theme?: Theme;
6
4
  }
7
5
  /**
8
6
  * A Provider component which provides the GeoWeb theme
@@ -1,8 +1,25 @@
1
1
  import React from 'react';
2
- import { BaseTaf, ChangeGroupFormData, TafActions } from '../../types';
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
- mode: string;
5
- changeGroups?: ChangeGroupFormData[];
22
+ isDisabled: boolean;
6
23
  tafAction?: TafActions;
7
24
  staticTAC?: string;
8
25
  onFormAction?: (action: TafActions, formValues?: BaseTaf) => void;
@@ -1 +1 @@
1
- export declare const useStyles: (props?: any) => import("@material-ui/styles").ClassNameMap<"textFieldGridItem" | "textFieldInput" | "textFieldLabel" | "textFieldLabelShrink" | "formRow" | "tacTitle" | "tacText" | "tacLine" | "addButton" | "lifecycleButtons" | "actionButton" | "lastButton" | "backdrop">;
1
+ export declare const useStyles: (props?: any) => import("@material-ui/styles").ClassNameMap<"textFieldGridItem" | "textFieldInput" | "textFieldLabel" | "textFieldLabelShrink" | "formRow" | "tacTitle" | "tacText" | "tacLine" | "addButton" | "lifecycleButtons" | "actionButton" | "lastButton" | "backdrop" | "emptyButtonContainer">;
@@ -7,6 +7,7 @@ export interface TafFormRowProps extends GridProps {
7
7
  index?: number;
8
8
  lastRow?: boolean;
9
9
  onRemoveChangeGroup?: (index: number) => void;
10
+ onAddChangeGroup?: (index: number) => void;
10
11
  field?: Partial<ArrayField>;
11
12
  dragHandle?: React.ReactElement;
12
13
  }
@@ -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";
@@ -11,3 +13,7 @@ export declare const invalidChangeValidInterFieldMessage = "Invalid validity per
11
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";
12
14
  export declare const validateValidField: (value: string, tafStart: string, tafEnd: string) => boolean | string;
13
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;
@@ -8,6 +8,9 @@ export declare const invalidWindDirectionMinMaxMessage = "Invalid wind direction
8
8
  export declare const invalidWindDirectionStepMessage = "Invalid wind direction, the direction must be rounded to the nearest step of 10 degrees";
9
9
  export declare const invalidWindSpeedMessage = "Invalid wind speed, expected a speed equal to 2 digits or P99";
10
10
  export declare const invalidWindGustsMessage = "Invalid wind gusts, expected gusts equal to 2 digits or P99";
11
- export declare const invalidWindGustSpeedCombinationMessage = "Invalid wind, wind gusts must at least be 10 knots greater than the wind speed";
11
+ export declare const invalidWindGustSpeedCombinationMessage = "Invalid wind gusts, gusts must at least be 10 knots greater than the wind speed";
12
+ export declare const invalidWindGustSpeedBelow15Message = "Invalid wind gusts, gusts are only allowed for a minimum wind speed of 15 knots";
12
13
  export declare const invalidGustForWindP99Message = "Invalid wind speed and gust combination, if wind is P99, gusts can only be empty or P99";
14
+ export declare const invalidWindSpeedForDirectionZeroMessage = "Invalid wind speed, if direction is 000, speed can only be 00";
15
+ export declare const invalidWindSpeedForDirectionNonZeroMessage = "Invalid wind speed, if direction is not 000, speed can not be 00";
13
16
  export declare const validateWindField: (value: 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;
@@ -3,6 +3,19 @@ declare const _default: {
3
3
  title: string;
4
4
  };
5
5
  export default _default;
6
- export declare const NewTafForm: () => React.ReactElement;
7
- export declare const EditTafForm: () => React.ReactElement;
8
- export declare const ViewTafForm: () => React.ReactElement;
6
+ export declare const NewTafForm: {
7
+ (): React.ReactElement;
8
+ storyName: string;
9
+ };
10
+ export declare const EditTafForm: {
11
+ (): React.ReactElement;
12
+ storyName: string;
13
+ };
14
+ export declare const ViewTafForm: {
15
+ (): React.ReactElement;
16
+ storyName: string;
17
+ };
18
+ export declare const EditTafFormWithMultipleSameStartDates: {
19
+ (): React.ReactElement;
20
+ storyName: string;
21
+ };
@@ -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,23 +7,24 @@ 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, fields: Partial<ArrayField<Record<string, unknown>, 'id'>>[], onFormBlur: () => 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
- sortedFields: SortableField[];
25
- setSortedFields: (fields: SortableField[]) => void;
24
+ onStartDrag: (event: Sortable.SortableEvent) => void;
25
+ activeDraggingIndex: number;
26
26
  };
27
27
  export declare const getConfirmationDialogTitle: (action: TafActions) => string;
28
- export declare const getConfirmationDialogContent: (action: TafActions) => string;
28
+ export declare const getConfirmationDialogContent: (action: TafActions, isFormDirty?: boolean) => string;
29
29
  export declare const getConfirmationDialogButtonLabel: (action: TafActions) => string;
30
30
  export {};
@@ -4,3 +4,15 @@ declare const _default: {
4
4
  };
5
5
  export default _default;
6
6
  export declare const TafListRefreshDemo: React.FC;
7
+ export declare const ListUpcoming: {
8
+ (): React.ReactElement;
9
+ storyName: string;
10
+ };
11
+ export declare const ListCurrent: {
12
+ (): React.ReactElement;
13
+ storyName: string;
14
+ };
15
+ export declare const ListExpired: {
16
+ (): React.ReactElement;
17
+ storyName: string;
18
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -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;
@@ -2,8 +2,16 @@ import { TafFromBackend } from '../../types';
2
2
  export declare const dateFormatUTC = "YYYY-MM-DDTHH:mmZ";
3
3
  export declare const fakeTafList: TafFromBackend[];
4
4
  export declare const fakeNewTaf: TafFromBackend;
5
+ export declare const fakeNewFixedTaf: TafFromBackend;
5
6
  export declare const fakeExpiredTaf: TafFromBackend;
6
7
  export declare const fakePublishedTaf: TafFromBackend;
8
+ export declare const fakePublishedFixedTaf: TafFromBackend;
7
9
  export declare const fakeDraftTaf: TafFromBackend;
10
+ export declare const fakeDraftFixedTaf: TafFromBackend;
8
11
  export declare const fakeDraftAmendmentTaf: TafFromBackend;
12
+ export declare const fakeDraftAmendmentFixedTaf: TafFromBackend;
9
13
  export declare const fakeAmendmentTaf: TafFromBackend;
14
+ export declare const fakeAmendmentFixedTaf: TafFromBackend;
15
+ export declare const fakePublishedTafWithChangeGroups: TafFromBackend;
16
+ export declare const fakePublishedTafWithSameDates: TafFromBackend;
17
+ export declare const fakePublishedTafWithSameDatesFixed: TafFromBackend;
@@ -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.2.5",
3
+ "version": "2.1.2",
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.2.5",
17
+ "@opengeoweb/theme": "2.1.2",
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.2.5",
21
+ "@opengeoweb/shared": "2.1.2",
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.2.5",
26
- "@material-ui/pickers": "^3.2.10",
27
- "@date-io/moment": "^1.3.13",
25
+ "@opengeoweb/form-fields": "2.1.2",
28
26
  "moment": "^2.29.0",
27
+ "@material-ui/pickers": "^3.2.10",
29
28
  "moment-timezone": "^0.5.31",
29
+ "@date-io/moment": "^1.3.13",
30
30
  "axios": "^0.21.4",
31
31
  "react-sortablejs": "^6.0.0",
32
- "@opengeoweb/api": "1.2.5",
32
+ "@opengeoweb/api": "2.1.2",
33
33
  "sortablejs": "^1.14.0"
34
34
  }
35
35
  }