@opengeoweb/taf 15.1.0 → 15.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/taf",
3
- "version": "15.1.0",
3
+ "version": "15.3.0",
4
4
  "description": "GeoWeb TAF library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -8,15 +8,15 @@
8
8
  "url": "git@gitlab.com:opengeoweb/opengeoweb.git"
9
9
  },
10
10
  "dependencies": {
11
- "@opengeoweb/api": "15.1.0",
12
- "@opengeoweb/shared": "15.1.0",
11
+ "@opengeoweb/api": "15.3.0",
12
+ "@opengeoweb/shared": "15.3.0",
13
13
  "react-hook-form": "^7.50.1",
14
- "@opengeoweb/theme": "15.1.0",
15
- "@opengeoweb/form-fields": "15.1.0",
16
- "@opengeoweb/authentication": "15.1.0",
14
+ "@opengeoweb/theme": "15.3.0",
15
+ "@opengeoweb/form-fields": "15.3.0",
16
+ "@opengeoweb/authentication": "15.3.0",
17
17
  "@reduxjs/toolkit": "^2.6.1",
18
18
  "react-redux": "^9.2.0",
19
- "@opengeoweb/snackbar": "15.1.0",
19
+ "@opengeoweb/snackbar": "15.3.0",
20
20
  "react-sortablejs": "^6.1.4",
21
21
  "sortablejs": "^1.15.1",
22
22
  "@emotion/react": "^11.11.1",
@@ -0,0 +1,7 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-webpack5';
2
+ import { TafModule } from './components/TafModule';
3
+ type Story = StoryObj<typeof TafModule>;
4
+ declare const meta: Meta<typeof TafModule>;
5
+ export default meta;
6
+ export declare const NafModuleLightTheme: Story;
7
+ export declare const NafModuleDarkTheme: Story;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { ApiModule, ApiUrls } from '@opengeoweb/api';
3
+ import type { TafType } from '../../types';
3
4
  export declare const tafScreenPreset: {
4
5
  id: string;
5
6
  title: string;
@@ -19,6 +20,7 @@ export declare const tafScreenPreset: {
19
20
  type TafComponentType = 'TafModule';
20
21
  interface InitialProps {
21
22
  isAutoTafEnabled?: boolean;
23
+ type?: TafType;
22
24
  }
23
25
  export interface ComponentsLookUpPayload {
24
26
  componentType: TafComponentType;
@@ -10,6 +10,7 @@ export interface TafFormProps {
10
10
  setIsIssuesPaneOpen?: (isOpen: boolean, position: IssuesPanePosition) => void;
11
11
  onSwitchEditor?: (formValues: TafFromFrontEnd) => Promise<boolean>;
12
12
  previousTaf?: Taf;
13
+ shouldEnableRemark?: boolean;
13
14
  }
14
15
  declare const TafForm: React.FC<TafFormProps>;
15
16
  export default TafForm;
@@ -4,6 +4,7 @@ import type { TafFromBackend } from '../../types';
4
4
  interface WrapperProps {
5
5
  tafFromBackend: TafFromBackend;
6
6
  isDisabled?: boolean;
7
+ shouldEnableRemark?: boolean;
7
8
  }
8
9
  declare const Wrapper: React.FC<WrapperProps>;
9
10
  declare const _default: {
@@ -23,3 +24,4 @@ export declare const EditTafFormWithMultipleSameStartDatesLight: Story;
23
24
  export declare const EditTafFormWithMultipleSameStartDatesDark: Story;
24
25
  export declare const EditTafFormWithFMOverlapLight: Story;
25
26
  export declare const EditTafFormWithFMOverlapDark: Story;
27
+ export declare const EditTafFormWithRemark: Story;
@@ -1,9 +1,13 @@
1
1
  import type { TextFieldProps } from '@mui/material';
2
2
  import React from 'react';
3
3
  import type { RegisterOptions } from 'react-hook-form';
4
+ export declare const TEXTFIELD_WIDTH_PERCENTAGE: number;
5
+ export declare const TEXTFIELD_MIN_WIDTH = "60px";
6
+ type TextAlign = 'left' | 'center';
4
7
  export declare const getDisplayValue: (value: string, disabled: boolean) => string;
5
8
  type BaseTextFieldProps = TextFieldProps & {
6
9
  shouldPreventUppercase?: boolean;
10
+ textAlign?: TextAlign;
7
11
  };
8
12
  export declare const BaseTextField: React.FC<BaseTextFieldProps>;
9
13
  interface TafFormTextFieldProps {
@@ -64,8 +64,8 @@ export declare const getTafStatusLabel: (t: TFunction, status: TafStatus, action
64
64
  export declare const getMessageType: (taf: Taf, tafAction: TafActions) => string;
65
65
  export declare const getAmendedCorrectedTafTimes: (taf: Taf, tafAction: TafActions) => Taf;
66
66
  export declare const createChangeGroup: (changeGroup: ChangeGroupFormData) => ChangeGroupFormData;
67
- export declare const prepareTafValues: (_taf: Taf, tafAction: TafActions, addEmptyChangeGroups?: boolean) => TafFormData;
68
- export declare const prepareTafExportValues: (tafToCopy: Taf, currentTaf: TafFormData) => TafFormData;
67
+ export declare const prepareTafValues: (_taf: Taf, tafAction: TafActions, addEmptyChangeGroups?: boolean, shouldEnableRemark?: boolean) => TafFormData;
68
+ export declare const prepareTafExportValues: (tafToCopy: Taf, currentTaf: TafFormData, shouldEnableRemark?: boolean) => TafFormData;
69
69
  export declare const clearTafFormData: (tafFormValues: TafFormData) => TafFormData;
70
70
  export declare const getIsFormDefaultDisabled: (status: TafStatus) => boolean;
71
71
  export declare const fromStatusToAction: (tafStatus: TafStatus) => TafActions;
@@ -7,5 +7,7 @@ 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 NafLayoutLight: Story;
11
+ export declare const NafLayoutDark: Story;
10
12
  export declare const TafLayoutAutoTaf: Story;
11
13
  export declare const TafLayoutAutoTafDark: Story;
@@ -17,6 +17,7 @@ interface TafPanelProps {
17
17
  error?: TafError | null;
18
18
  previousTaf: Taf;
19
19
  tafAction: TafActions;
20
+ shouldEnableRemark?: boolean;
20
21
  }
21
22
  declare const TafPanel: React.FC<TafPanelProps>;
22
23
  export default TafPanel;
@@ -1,6 +1,8 @@
1
1
  import type { AxiosError } from 'axios';
2
2
  import type { TFunction } from 'i18next';
3
- import type { AutoTAFlocations, Taf, TafConfig, TafConfigLocation, TafConfigLocations, TafFromBackend, TafFromFrontEnd, TafStatus, TimeSlot } from '../../types';
3
+ import type { AutoTAFlocations, Taf, TafConfig, TafConfigLocation, TafConfigLocations, TafConfigLocationFixedPeriod, TafConfigLocationDynamicPeriod, TafFromBackend, TafFromFrontEnd, TafStatus, TimeSlot } from '../../types';
4
+ export declare const isTafConfigLocationFixedPeriod: (location: TafConfigLocation) => location is TafConfigLocationFixedPeriod;
5
+ export declare const isTafConfigLocationDynamicPeriod: (location: TafConfigLocation) => location is TafConfigLocationDynamicPeriod;
4
6
  export declare const getLocationSetting: (location: string, locationSettings: TafConfigLocations) => TafConfigLocation;
5
7
  export declare const sortTafsOnLocation: (tafList?: TafFromBackend[], locationOrder?: string[]) => TafFromBackend[];
6
8
  export declare const sortTafsOnIssueDate: (tafList?: TafFromBackend[]) => TafFromBackend[];
@@ -1,7 +1,9 @@
1
1
  import type { FC } from 'react';
2
2
  import type { TafModuleProviderProps } from './TafModuleProvider';
3
+ import type { TafType } from '../../types';
3
4
  export declare const getCurrentDate: () => string;
4
5
  declare const Wrapper: FC<TafModuleProviderProps & {
5
6
  isAutoTafEnabled?: boolean;
7
+ type?: TafType;
6
8
  }>;
7
9
  export default Wrapper;
@@ -0,0 +1,7 @@
1
+ import type { FC } from 'react';
2
+ export interface TafRemarkFieldProps {
3
+ disabled?: boolean;
4
+ isEditor?: boolean;
5
+ }
6
+ declare const TafRemarkField: FC<TafRemarkFieldProps>;
7
+ export default TafRemarkField;
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';
@@ -0,0 +1 @@
1
+ export { default as TafRemarkField } from './TafRemarkField';
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import type { TafConfig } from '../../types';
2
+ import type { TafConfig, TafType } from '../../types';
3
3
  interface TafConfigWrapperContext {
4
4
  tafConfig?: TafConfig;
5
5
  }
@@ -7,6 +7,7 @@ export declare const TafConfigContext: React.Context<TafConfigWrapperContext>;
7
7
  export declare const useTafConfigContext: () => Partial<TafConfigWrapperContext>;
8
8
  interface TafConfigWrapperProps {
9
9
  children?: React.ReactNode;
10
+ type?: TafType;
10
11
  }
11
12
  declare const TafConfigWrapper: React.FC<TafConfigWrapperProps>;
12
13
  export default TafConfigWrapper;
@@ -51,7 +51,9 @@ export interface ChangeGroup extends BaseForecast {
51
51
  probability?: 'PROB30' | 'PROB40';
52
52
  }
53
53
  export type MessageType = 'ORG' | 'AMD' | 'COR' | 'CNL';
54
- export type Location = 'EHAM' | 'EHRD' | 'EHGG' | 'EHBK' | 'EHLE' | 'TNCB';
54
+ export type NafLocation = 'EHAK' | 'EHFD' | 'EHDV' | 'EHHW' | 'EHKV' | 'EHMG' | 'EHMA' | 'EHQN' | 'EHPG';
55
+ export type Location = 'EHAM' | 'EHRD' | 'EHGG' | 'EHBK' | 'EHLE' | 'TNCB' | NafLocation;
56
+ export type TafType = 'TAF' | 'NAF';
55
57
  export interface BaseTaf {
56
58
  validDateStart: TafDate;
57
59
  validDateEnd: TafDate;
@@ -63,8 +65,10 @@ export interface BaseTaf {
63
65
  baseForecast: BaseForecast;
64
66
  changeGroups?: ChangeGroup[];
65
67
  messageType: MessageType;
68
+ remark?: string;
66
69
  uuid: string;
67
70
  issueDate?: TafDate;
71
+ type?: TafType;
68
72
  }
69
73
  export type TafStatus = 'NEW' | 'DRAFT' | 'DRAFT_AMENDED' | 'DRAFT_CORRECTED' | 'PUBLISHED' | 'CORRECTED' | 'AMENDED' | 'CANCELLED' | 'EXPIRED' | 'AUTO';
70
74
  export type TafActions = 'NEW' | 'DRAFT' | 'DRAFT_AMEND' | 'DRAFT_CORRECT' | 'PUBLISH' | 'CANCEL' | 'CORRECT' | 'AMEND' | 'CLOSE' | 'CLEAR';
@@ -99,6 +103,7 @@ export interface TafFormData {
99
103
  uuid: string;
100
104
  issueDate?: string;
101
105
  status: TafStatus;
106
+ remark?: string;
102
107
  }
103
108
  /**
104
109
  * Type with TAF info from the backend
@@ -120,11 +125,17 @@ export interface TafFromFrontEnd {
120
125
  /**
121
126
  * TAF (json) settings (libs/taf/src/lib/utils/tafConfig.json)
122
127
  */
123
- export interface TafConfigLocation {
128
+ export type TafConfigLocation = TafConfigLocationFixedPeriod | TafConfigLocationDynamicPeriod;
129
+ export interface TafConfigLocationFixedPeriod {
124
130
  validity_duration: number;
125
131
  activity_period: number;
126
132
  label: string;
127
133
  }
134
+ export interface TafConfigLocationDynamicPeriod {
135
+ valid_durations: number[];
136
+ valid_start_times: number[];
137
+ label: string;
138
+ }
128
139
  export type TafConfigLocations = Record<string, TafConfigLocation>;
129
140
  export type AutoTAFlocations = string[];
130
141
  export interface TafConfig {
@@ -132,6 +143,8 @@ export interface TafConfig {
132
143
  locations: TafConfigLocations;
133
144
  locationOrder: string[];
134
145
  autoTAFlocations?: AutoTAFlocations;
146
+ shouldEnableRemark?: boolean;
147
+ type: TafType;
135
148
  }
136
149
  export type TimeSlot = 'UPCOMING' | 'ACTIVE' | 'EXPIRED';
137
150
  export interface AdverseWeatherTAC {
@@ -0,0 +1,2 @@
1
+ import type { TafConfig } from '../../types';
2
+ export declare const fakeTafConfig: TafConfig;
@@ -23,3 +23,4 @@ export declare const fakePublishedTafWithChangeGroups: TafFromBackend;
23
23
  export declare const fakeDraftTafWithSameDates: TafFromBackend;
24
24
  export declare const fakeDraftTafWithSameDatesFixed: TafFromBackend;
25
25
  export declare const fakeDraftTafWithFM: TafFromBackend;
26
+ export declare const fakeCurrentTaf: TafFromBackend;
@@ -0,0 +1,2 @@
1
+ import type { TafConfig } from '../../../types';
2
+ export declare const fakeNafConfig: TafConfig;
@@ -0,0 +1,12 @@
1
+ import type { TafFromBackend } from '../../../types';
2
+ export declare const MOCK_USERNAME = "user.name";
3
+ export declare const fakeNafList: TafFromBackend[];
4
+ export declare const fakeFixedNaf: TafFromBackend;
5
+ export declare const fakeLastInDayNaf: TafFromBackend;
6
+ export declare const fakeNewFixedNaf: TafFromBackend;
7
+ export declare const fakeDraftFixedNaf: TafFromBackend;
8
+ export declare const fakePublishedFixedNaf: TafFromBackend;
9
+ export declare const fakeDraftAmendmentFixedNaf: TafFromBackend;
10
+ export declare const fakeAmendmentFixedNaf: TafFromBackend;
11
+ export declare const fakeCancelledFixedNaf: TafFromBackend;
12
+ export declare const fakeFixedNafList: TafFromBackend[];
@@ -1,7 +1,7 @@
1
1
  import type { Credentials } from '@opengeoweb/authentication';
2
- import type { TAC, Taf, TafConfig, TafFromBackend, TafFromFrontEnd } from '../../types';
3
- export declare const getTafList: (auth: Credentials) => Promise<TafFromBackend[]>;
2
+ import type { TAC, Taf, TafConfig, TafFromBackend, TafFromFrontEnd, TafType } from '../../types';
3
+ export declare const getTafList: (auth: Credentials, type?: TafType) => Promise<TafFromBackend[]>;
4
4
  export declare const postTaf: (auth: Credentials, data: TafFromFrontEnd) => Promise<Response>;
5
5
  export declare const patchTaf: (auth: Credentials, data: TafFromFrontEnd, force?: boolean) => Promise<Response>;
6
6
  export declare const getTAC: (auth: Credentials, data: Taf) => Promise<TAC>;
7
- export declare const getTafConfig: (auth: Credentials) => Promise<TafConfig>;
7
+ export declare const getTafConfig: (auth: Credentials, type?: TafType) => Promise<TafConfig>;
@@ -1,6 +1,4 @@
1
- import type { AdverseWeatherTAC, TafFromBackend, TafConfig } from '../../types';
2
- export declare const getFakeUpdatedList: () => TafFromBackend[];
1
+ import type { AdverseWeatherTAC } from '../../types';
3
2
  export declare const fakeTafTac = "TAF EHAM 0812/0918 20020G35KT 0500 SN BKN040 BECMG 0814/0816 0700 BKN001=";
4
3
  export declare const fakeTafTacJson: AdverseWeatherTAC;
5
- export declare const fakeTafConfig: TafConfig;
6
4
  export declare const tafEndPoints: import("msw").HttpHandler[];
@@ -1,8 +1,8 @@
1
1
  import type { UseMutationResult, UseQueryResult } from '@tanstack/react-query';
2
2
  import type { TafError } from '../../components/TafLayout/utils';
3
- import type { TAC, Taf, TafFromBackend, TafFromFrontEnd, TafConfig } from '../../types';
4
- export declare const useTafList: (disabled?: boolean) => UseQueryResult<TafFromBackend[]>;
5
- export declare const useTafConfig: (disabled?: boolean) => UseQueryResult<TafConfig>;
3
+ import type { TAC, Taf, TafFromBackend, TafFromFrontEnd, TafConfig, TafType } from '../../types';
4
+ export declare const useTafList: (type?: TafType, disabled?: boolean) => UseQueryResult<TafFromBackend[]>;
5
+ export declare const useTafConfig: (type?: TafType, disabled?: boolean) => UseQueryResult<TafConfig>;
6
6
  type PostReturnType<T> = UseMutationResult<Response | null, Error, T>;
7
7
  interface PostTafProps {
8
8
  tafData: TafFromFrontEnd;