@opengeoweb/taf 4.0.0 → 4.2.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.
@@ -1,11 +1,13 @@
1
1
  import * as React from 'react';
2
2
  import { UseFormOptions } from 'react-hook-form';
3
3
  import { Theme } from '@mui/material';
4
- export declare const MOCK_USERNAME = "user.name";
4
+ import { Store } from '@reduxjs/toolkit';
5
+ import { TafApi } from '../../utils/api';
5
6
  export interface TafThemeApiProviderProps {
6
- createApiFunc?: any;
7
+ createApiFunc?: () => TafApi;
7
8
  children: React.ReactNode;
8
9
  theme?: Theme;
10
+ store?: Store;
9
11
  }
10
12
  export declare const TafThemeApiProvider: React.FC<TafThemeApiProviderProps>;
11
13
  interface TafThemeFormProviderProps {
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { BaseTaf, TafActions, TafFromBackend, TafFromFrontEnd } from '../../types';
3
3
  import { IssuesPanePosition } from '../IssuesPane/types';
4
+ export declare const getSnackbarMessage: (isChecked: boolean, location: string) => string;
4
5
  export interface TafFormProps {
5
6
  isDisabled?: boolean;
6
7
  setIsDisabled?: (isDisabled: boolean) => void;
@@ -1,5 +1,5 @@
1
1
  import Sortable from 'sortablejs';
2
- import { BaseForecast, BaseForecastFormData, ChangeGroup, ChangeGroupFormData, Taf, TafActions, TafFormData, TafStatus } from '../../types';
2
+ import { BaseForecast, BaseForecastFormData, ChangeGroup, ChangeGroupFormData, TAC, Taf, TafActions, TafFormData, TafStatus } from '../../types';
3
3
  import { FieldNames } from './TafFormRow/types';
4
4
  export declare const emptyBaseForecast: {
5
5
  wind: string;
@@ -28,10 +28,10 @@ export declare const TAC_MISSING_DATA = "Missing data: no TAC can be generated";
28
28
  export declare const TAC_NOT_AVAILABLE = "No TAC available";
29
29
  export declare const TAC_RETRIEVING_DATA = "Retrieving TAC";
30
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<{
33
- data: string;
34
- }>) => [string, (tafToPost: any) => void, (newTAC: string) => void];
31
+ export declare const tacHasError: (tac: TAC) => boolean;
32
+ export declare const useTACGenerator: (taf: Taf, requestTAC: (postTaf: Taf, getJSON?: boolean, abortSignal?: AbortSignal) => Promise<{
33
+ data: TAC;
34
+ }>, getJSON?: boolean) => [TAC, (tafToPost: Taf) => void, (newTAC: TAC) => void];
35
35
  export declare type SortableField = {
36
36
  id: string;
37
37
  chosen: boolean;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { AdverseWeatherTAC } from '../../../types';
3
+ interface AdverseWeatherTACProps {
4
+ TAC: AdverseWeatherTAC;
5
+ isActive: boolean;
6
+ }
7
+ export declare const AdverseWeatherTACMessage: React.FC<AdverseWeatherTACProps>;
8
+ export {};
@@ -0,0 +1,25 @@
1
+ import * as React from 'react';
2
+ declare const _default: {
3
+ title: string;
4
+ };
5
+ export default _default;
6
+ export declare const TacContainerLight: {
7
+ (): React.ReactElement;
8
+ storyName: string;
9
+ parameters: {
10
+ zeplinLink: {
11
+ name: string;
12
+ link: string;
13
+ }[];
14
+ };
15
+ };
16
+ export declare const TacContainerDark: {
17
+ (): React.ReactElement;
18
+ storyName: string;
19
+ parameters: {
20
+ zeplinLink: {
21
+ name: string;
22
+ link: string;
23
+ }[];
24
+ };
25
+ };
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { Taf } from '../../../types';
3
+ export declare const getSnackbarMessage: (location: string, locationLabel: string) => string;
3
4
  interface TacContainerProps {
4
5
  taf: Taf;
5
6
  isActive?: boolean;
@@ -5,6 +5,14 @@ declare const _default: {
5
5
  export default _default;
6
6
  export declare const TacOverviewWithError: () => React.ReactElement;
7
7
  export declare const TacOverviewWithDifferentTAC: () => React.ReactElement;
8
+ export declare const TacOverviewAdverseWeatherLight: {
9
+ (): React.ReactElement;
10
+ storyName: string;
11
+ };
12
+ export declare const TacOverviewAdverseWeatherDark: {
13
+ (): React.ReactElement;
14
+ storyName: string;
15
+ };
8
16
  export declare const TacOverviewLightTheme: {
9
17
  (): React.ReactElement;
10
18
  storyName: string;
@@ -1,10 +1,12 @@
1
1
  import React from 'react';
2
- import { TafFromBackend } from '../../types';
2
+ import { TafFromBackend, TafFromFrontEnd, Taf } from '../../types';
3
3
  export declare const CONFIRM_DIALOG_OPTIONS: {
4
4
  title: string;
5
5
  description: string;
6
6
  confirmLabel: string;
7
7
  };
8
+ export declare const getTafMessagePrefix: ({ location, validDateStart, messageType }: Taf, newStatus: string) => string;
9
+ export declare const getSnackbarMessage: (tafFromFrontEnd: TafFromFrontEnd, isAutoSaved?: boolean) => string;
8
10
  interface TafLayoutProps {
9
11
  tafList: TafFromBackend[];
10
12
  onUpdateTaf: () => void;
@@ -1,3 +1,4 @@
1
+ import { Moment } from 'moment';
1
2
  import React from 'react';
2
3
  import { TafFromBackend, TimeSlot } from '../../../types';
3
4
  interface TopTabsProps {
@@ -5,5 +6,6 @@ interface TopTabsProps {
5
6
  tafFromBackend: TafFromBackend;
6
7
  onChangeTimeSlot?: (timeSlot: TimeSlot) => void;
7
8
  }
9
+ export declare const formatBaseTime: (time: Moment) => string;
8
10
  declare const TopTabs: React.FC<TopTabsProps>;
9
11
  export default TopTabs;
@@ -1,7 +1,8 @@
1
1
  import { Moment } from 'moment';
2
2
  import { Taf, TafConfigLocation, TafConfigLocations, TafFormData, TafFromBackend, TafStatus, TimeSlot } from '../../types';
3
3
  export declare const getLocationSetting: (location: string, locationSettings?: TafConfigLocations) => TafConfigLocation;
4
- export declare const sortTafsOnLocation: (tafList: TafFromBackend[], locationOrder?: string[]) => TafFromBackend[];
4
+ export declare const sortTafsOnLocation: (tafList?: TafFromBackend[], locationOrder?: string[]) => TafFromBackend[];
5
+ export declare const sortTafsOnIssueDate: (tafList?: TafFromBackend[]) => TafFromBackend[];
5
6
  export declare const getBaseTime: (baseTime: string, location: string) => {
6
7
  currentBaseTime: Moment;
7
8
  nextBaseTime: Moment;
@@ -17,3 +18,4 @@ export declare const muiTabA11yProps: (index: number) => {
17
18
  'aria-controls': string;
18
19
  };
19
20
  export declare const prepareTafExportValues: (tafToCopy: Taf, currentTaf: TafFormData) => TafFormData;
21
+ export declare const getNewTafLocationIndex: (tafLocations: TafFromBackend[], previousTafLocationUUID: string) => number;
@@ -6,6 +6,23 @@ export default _default;
6
6
  export declare const TafModuleLightThemeWithErrorOnAction: () => React.ReactElement;
7
7
  export declare const TafModuleLightThemeWithErrorOnLoadingList: () => React.ReactElement;
8
8
  export declare const TafModuleWithNewData: () => React.ReactElement;
9
- export declare const TafModuleLightTheme: () => React.ReactElement;
10
- export declare const TafModuleDarkTheme: () => React.ReactElement;
9
+ export declare const TafModuleLightTheme: {
10
+ (): React.ReactElement;
11
+ parameters: {
12
+ zeplinLink: {
13
+ name: string;
14
+ link: string;
15
+ }[];
16
+ };
17
+ };
18
+ export declare const TafModuleDarkTheme: {
19
+ (): React.ReactElement;
20
+ parameters: {
21
+ zeplinLink: {
22
+ name: string;
23
+ link: string;
24
+ }[];
25
+ };
26
+ };
11
27
  export declare const TafModuleToolContainerExample: () => React.ReactElement;
28
+ export declare const TafModulePublishDraftAmendmentExample: () => React.ReactElement;
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { BaseTaf, Taf, TafActions } from '../../types';
2
+ import { BaseTaf, TAC, Taf, TafActions } from '../../types';
3
3
  declare type ValidateFormPromise = () => Promise<void | BaseTaf>;
4
4
  interface TafModuleMethods {
5
5
  onPreventCloseView?: (shouldPreventClose: boolean) => void;
@@ -9,9 +9,9 @@ interface TafModuleContextState {
9
9
  registerValidateForm: (promiseToRegister: ValidateFormPromise) => void;
10
10
  tafAction: TafActions;
11
11
  setTafAction: (action: TafActions) => void;
12
- TAC: string;
12
+ TAC: TAC;
13
13
  updateTAC: (taf: Taf) => void;
14
- setTAC: (tac: string) => void;
14
+ setTAC: (tac: TAC) => void;
15
15
  isFormDirty: boolean;
16
16
  setIsFormDirty: (isDirty: boolean) => void;
17
17
  }
package/lib/types.d.ts CHANGED
@@ -144,3 +144,11 @@ export interface TafConfig {
144
144
  locationOrder: string[];
145
145
  }
146
146
  export declare type TimeSlot = 'UPCOMING' | 'ACTIVE' | 'EXPIRED';
147
+ export declare type DefaultTAC = string;
148
+ export declare type AdverseWeatherTAC = {
149
+ tac: {
150
+ text: string;
151
+ type?: string;
152
+ }[][];
153
+ };
154
+ export declare type TAC = DefaultTAC | AdverseWeatherTAC;
@@ -1,13 +1,15 @@
1
- import { TafFromBackend } from '../../types';
1
+ import { AdverseWeatherTAC, TAC, Taf, TafFromBackend } from '../../types';
2
+ import { TafApi } from '../api';
2
3
  export declare const fakeTestTac = "TAF EHAM 0812/0918 20020G35KT 0500 SN BKN040=";
4
+ export declare const fakeTestTacJson: AdverseWeatherTAC;
3
5
  export declare const api: {
4
6
  postTaf: () => Promise<void>;
5
7
  patchTaf: () => Promise<void>;
6
8
  getTafList: () => Promise<{
7
9
  data: TafFromBackend[];
8
10
  }>;
9
- getTAC: () => Promise<{
10
- data: string;
11
+ getTAC: (taf: Taf, getJSON: boolean) => Promise<{
12
+ data: TAC;
11
13
  }>;
12
14
  };
13
- export declare const createApi: () => object;
15
+ export declare const createApi: () => TafApi;
@@ -1,13 +1,13 @@
1
- import { Credentials } from '@opengeoweb/api';
2
- import { Taf, TafFromBackend, TafFromFrontEnd } from '../types';
1
+ import { CreateApiProps } from '@opengeoweb/api';
2
+ import { TAC, Taf, TafFromBackend, TafFromFrontEnd } from '../types';
3
3
  export declare type TafApi = {
4
4
  getTafList: () => Promise<{
5
5
  data: TafFromBackend[];
6
6
  }>;
7
7
  postTaf: (formData: TafFromFrontEnd) => Promise<void>;
8
- getTAC: (tafData: Taf, signal?: AbortSignal) => Promise<{
9
- data: string;
8
+ getTAC: (tafData: Taf, getJSON?: boolean, signal?: AbortSignal) => Promise<{
9
+ data: TAC;
10
10
  }>;
11
11
  patchTaf: (formData: TafFromFrontEnd) => Promise<void>;
12
12
  };
13
- export declare const createApi: (url: string, appUrl: string, auth: Credentials, setAuth: (cred: Credentials) => void, authTokenUrl: string, authClientId: string) => TafApi;
13
+ export declare const createApi: (props: CreateApiProps) => TafApi;
@@ -1,6 +1,3 @@
1
- import { TafFromBackend } from '../types';
2
1
  import { TafApi } from './api';
3
2
  export declare const fakeTafTac = "TAF EHAM 0812/0918 20020G35KT 0500 SN BKN040\nBECMG 0814/0816 0700 BKN001=";
4
- export declare const setFakeUpdatedList: (newList: TafFromBackend[]) => void;
5
- export declare const getFakeUpdatedList: () => TafFromBackend[];
6
3
  export declare const createApi: () => TafApi;
@@ -1,4 +1,5 @@
1
1
  import { TafFromBackend } from '../../types';
2
+ export declare const MOCK_USERNAME = "user.name";
2
3
  export declare const dateFormatUTC = "YYYY-MM-DDTHH:mmZ";
3
4
  export declare const fakeTafList: TafFromBackend[];
4
5
  export declare const fakeNewTaf: TafFromBackend;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/taf",
3
- "version": "4.0.0",
3
+ "version": "4.2.0",
4
4
  "description": "GeoWeb TAF library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -12,25 +12,39 @@
12
12
  "typings": "./index.d.ts",
13
13
  "dependencies": {},
14
14
  "peerDependencies": {
15
+ "@opengeoweb/core": "4.2.0",
15
16
  "react": "^17.0.2",
16
- "@opengeoweb/api": "4.0.0",
17
- "axios": "^0.25.0",
18
- "@opengeoweb/shared": "4.0.0",
17
+ "@opengeoweb/theme": "4.2.0",
19
18
  "@mui/material": "^5.2.8",
20
- "@opengeoweb/theme": "4.0.0",
19
+ "moment": "^2.29.0",
20
+ "react-redux": "^8.0.2",
21
+ "react-intl": "^5.17.5",
22
+ "lodash": "^4.17.20",
23
+ "@opengeoweb/shared": "4.2.0",
21
24
  "react-draggable": "^4.4.3",
22
25
  "re-resizable": "^6.9.0",
23
- "lodash": "^4.17.20",
24
- "@opengeoweb/form-fields": "4.0.0",
26
+ "@opengeoweb/form-fields": "4.2.0",
25
27
  "react-hook-form": "^6.12.1",
26
- "moment": "^2.29.0",
27
28
  "moment-timezone": "^0.5.31",
28
29
  "@mui/lab": "^5.0.0-alpha.64",
30
+ "axios": "^0.25.0",
31
+ "@opengeoweb/webmap": "4.2.0",
32
+ "throttle-debounce": "^3.0.1",
33
+ "proj4": "^2.6.2",
34
+ "react-sortablejs": "^6.0.0",
35
+ "react-window": "^1.8.7",
36
+ "redux-dynamic-modules": "^5.2.0",
37
+ "immer": "^9.0.15",
38
+ "@reduxjs/toolkit": "^1.8.3",
39
+ "lodash.clonedeep": "^4.5.0",
40
+ "@turf/turf": "^5.1.6",
41
+ "redux-dynamic-modules-saga": "^5.2.0",
42
+ "redux-saga": "^1.1.3",
43
+ "@opengeoweb/api": "4.2.0",
29
44
  "react-dom": "^17.0.2",
30
- "@opengeoweb/authentication": "4.0.0",
45
+ "@opengeoweb/authentication": "4.2.0",
31
46
  "react-router-dom": "^5.2.0",
32
47
  "query-string": "^6.13.7",
33
- "react-sortablejs": "^6.0.0",
34
48
  "sortablejs": "^1.14.0"
35
49
  }
36
50
  }