@opengeoweb/warnings 14.0.1 → 14.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/warnings",
3
- "version": "14.0.1",
3
+ "version": "14.1.0",
4
4
  "description": "GeoWeb warinings library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -8,25 +8,25 @@
8
8
  "url": "git@gitlab.com:opengeoweb/opengeoweb.git"
9
9
  },
10
10
  "dependencies": {
11
- "@opengeoweb/api": "14.0.1",
12
- "@opengeoweb/shared": "14.0.1",
13
- "@opengeoweb/store": "14.0.1",
14
- "@opengeoweb/webmap-react": "14.0.1",
11
+ "@opengeoweb/api": "14.1.0",
12
+ "@opengeoweb/shared": "14.1.0",
13
+ "@opengeoweb/store": "14.1.0",
14
+ "@opengeoweb/webmap-react": "14.1.0",
15
15
  "@tanstack/react-query": "^5.85.5",
16
16
  "react-redux": "^9.2.0",
17
- "@opengeoweb/theme": "14.0.1",
18
- "@opengeoweb/form-fields": "14.0.1",
17
+ "@opengeoweb/theme": "14.1.0",
18
+ "@opengeoweb/form-fields": "14.1.0",
19
19
  "react-hook-form": "^7.50.1",
20
20
  "lodash": "^4.17.21",
21
21
  "@reduxjs/toolkit": "^2.6.1",
22
- "@opengeoweb/snackbar": "14.0.1",
22
+ "@opengeoweb/snackbar": "14.1.0",
23
23
  "react-window": "^1.8.10",
24
24
  "react-virtualized-auto-sizer": "^1.0.20",
25
25
  "axios": "^1.7.7",
26
- "@opengeoweb/core": "14.0.1",
27
- "@opengeoweb/webmap": "14.0.1",
28
- "@opengeoweb/authentication": "14.0.1",
29
- "@opengeoweb/sigmet-airmet": "14.0.1",
26
+ "@opengeoweb/core": "14.1.0",
27
+ "@opengeoweb/webmap": "14.1.0",
28
+ "@opengeoweb/authentication": "14.1.0",
29
+ "@opengeoweb/sigmet-airmet": "14.1.0",
30
30
  "react-i18next": "^15.1.1",
31
31
  "i18next": "^25.0.1",
32
32
  "@mui/material": "^7.0.1",
@@ -7,16 +7,16 @@ export declare const getAirmetList: (auth: Credentials) => Promise<AirmetFromBac
7
7
  export declare const getSigmetList: (auth: Credentials) => Promise<SigmetFromBackend[]>;
8
8
  export declare const getAirmetConfig: (auth: Credentials) => Promise<AirmetConfig>;
9
9
  export declare const getSigmetConfig: (auth: Credentials) => Promise<SigmetConfig>;
10
- export declare const getAirmetTAC: (auth: Credentials, product: AviationProduct) => Promise<{
10
+ export declare const getAirmetTAC: (product: AviationProduct, auth?: Credentials) => Promise<{
11
11
  data: string;
12
12
  }>;
13
- export declare const getSigmetTAC: (auth: Credentials, product: AviationProduct) => Promise<{
13
+ export declare const getSigmetTAC: (product: AviationProduct, auth?: Credentials) => Promise<{
14
14
  data: string;
15
15
  }>;
16
- export declare const getAirmetCancelTAC: (auth: Credentials, product: AviationProduct) => Promise<{
16
+ export declare const getAirmetCancelTAC: (product: AviationProduct, auth?: Credentials) => Promise<{
17
17
  data: string;
18
18
  }>;
19
- export declare const getSigmetCancelTAC: (auth: Credentials, product: AviationProduct) => Promise<{
19
+ export declare const getSigmetCancelTAC: (product: AviationProduct, auth?: Credentials) => Promise<{
20
20
  data: string;
21
21
  }>;
22
22
  export declare const postSigmet: (auth: Credentials, data: SigmetFromFrontend) => Promise<SigmetFromBackend>;
@@ -0,0 +1 @@
1
+ export declare function humanizeApiErrorMessage(err: unknown): string;
@@ -1,8 +1,8 @@
1
- import { AirmetFromBackend, SigmetFromBackend } from '@opengeoweb/api';
1
+ import type { AirmetFromBackend, SigmetFromBackend } from '@opengeoweb/api';
2
2
  export declare const airmetList: AirmetFromBackend[];
3
3
  export declare const sigmetList: SigmetFromBackend[];
4
- export declare const fakeSigmetTAC = "EHAA SIGMET 1 VALID 121249/121449 EHDB- EHAA AMSTERDAM FIR FRQ TS OBS ENTIRE FIR FL010 STNR WKN";
4
+ export declare const fakeSigmetTAC = "EHAA SIGMET T01 VALID 121249/121449 EHDB- EHAA AMSTERDAM FIR FRQ TS OBS ENTIRE FIR FL010 STNR WKN";
5
5
  export declare const fakeAirmetTAC = "EHAA AIRMET -1 VALID 310700/311100 EHDB- EHAA AMSTERDAM FIR ISOL CB OBS ENTIRE FIR FL020 STNR NC";
6
- export declare const fakeDraftCancelSigmetTAC = "EHAA SIGMET 2 121249/121449 EHDB- EHAA AMSTERDAM FIR";
6
+ export declare const fakeDraftCancelSigmetTAC = "EHAA SIGMET T02 121249/121449 EHDB- EHAA AMSTERDAM FIR";
7
7
  export declare const fakeDraftCancelAirmetTAC = "EHAA AIRMET 2 310700/311100 EHDB- EHAA AMSTERDAM FIR ";
8
8
  export declare const aviationEndpoints: import("msw").HttpHandler[];
@@ -1,20 +1,28 @@
1
- import { AirmetConfig, AirmetFromBackend, SigmetConfig, SigmetFromBackend } from '@opengeoweb/api';
2
- import { AirmetFromFrontend, AviationProduct, SigmetFromFrontend } from '@opengeoweb/sigmet-airmet';
3
- import { UseMutationResult, UseQueryResult } from '@tanstack/react-query';
4
- import { WarningType } from '../../store/publicWarningForm/types';
1
+ import type { UseMutationResult, UseQueryResult } from '@tanstack/react-query';
2
+ import type { AirmetConfig, AirmetFromBackend, SigmetConfig, SigmetFromBackend } from '@opengeoweb/api';
3
+ import type { AirmetFromFrontend, AviationProduct, SigmetFromFrontend } from '@opengeoweb/sigmet-airmet';
4
+ import type { WarningType } from '../../store/publicWarningForm/types';
5
+ interface TACData {
6
+ data: string;
7
+ }
8
+ type TACResult = UseQueryResult<{
9
+ data: string;
10
+ }>;
5
11
  export declare const useAirmetList: (disabled?: boolean) => UseQueryResult<AirmetFromBackend[]>;
6
12
  export declare const useSigmetList: (disabled?: boolean) => UseQueryResult<SigmetFromBackend[]>;
7
13
  export declare const useAviationWarnings: () => (SigmetFromBackend | AirmetFromBackend)[];
8
14
  export declare const useProductConfig: (warningType?: WarningType, disabled?: boolean) => UseQueryResult<SigmetConfig | AirmetConfig>;
9
- type FetchTACData = Promise<{
10
- data: string;
11
- }>;
12
- export declare const useTACApi: () => {
13
- fetchSigmetTAC: (product: AviationProduct) => FetchTACData;
14
- fetchAirmetTAC: (product: AviationProduct) => FetchTACData;
15
- fetchSigmetCancelTAC: (product: AviationProduct) => FetchTACData;
16
- fetchAirmetCancelTAC: (product: AviationProduct) => FetchTACData;
17
- };
15
+ export declare const useFetchSigmetTAC: (product: AviationProduct, enabled?: boolean) => TACResult;
16
+ export declare const useFetchAirmetTAC: (product: AviationProduct, enabled?: boolean) => TACResult;
17
+ export declare const useFetchSigmetCancelTAC: (product: AviationProduct, enabled?: boolean) => TACResult;
18
+ export declare const useFetchAirmetCancelTAC: (product: AviationProduct, enabled?: boolean) => TACResult;
19
+ interface UseTACApi {
20
+ fetchSigmetTAC: (product: AviationProduct) => Promise<TACData>;
21
+ fetchAirmetTAC: (product: AviationProduct) => Promise<TACData>;
22
+ fetchSigmetCancelTAC: (product: AviationProduct) => Promise<TACData>;
23
+ fetchAirmetCancelTAC: (product: AviationProduct) => Promise<TACData>;
24
+ }
25
+ export declare const useTACApi: () => UseTACApi;
18
26
  /**
19
27
  * Hook for posting a SIGMET, with feedback.
20
28
  *
@@ -0,0 +1,68 @@
1
+ import { Credentials } from '@opengeoweb/authentication';
2
+ import { AviationProduct } from '@opengeoweb/sigmet-airmet';
3
+ export declare const aviationQueryOptions: {
4
+ readonly getSigmetTAC: (product: AviationProduct, credentials?: Credentials) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
5
+ data: string;
6
+ }, Error, {
7
+ data: string;
8
+ }, string[]>, "queryFn"> & {
9
+ queryFn?: import("@tanstack/react-query").QueryFunction<{
10
+ data: string;
11
+ }, string[], never> | undefined;
12
+ } & {
13
+ queryKey: string[] & {
14
+ [dataTagSymbol]: {
15
+ data: string;
16
+ };
17
+ [dataTagErrorSymbol]: Error;
18
+ };
19
+ };
20
+ readonly getAirmetTAC: (product: AviationProduct, credentials?: Credentials) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
21
+ data: string;
22
+ }, Error, {
23
+ data: string;
24
+ }, string[]>, "queryFn"> & {
25
+ queryFn?: import("@tanstack/react-query").QueryFunction<{
26
+ data: string;
27
+ }, string[], never> | undefined;
28
+ } & {
29
+ queryKey: string[] & {
30
+ [dataTagSymbol]: {
31
+ data: string;
32
+ };
33
+ [dataTagErrorSymbol]: Error;
34
+ };
35
+ };
36
+ readonly getSigmetCancelTAC: (product: AviationProduct, credentials?: Credentials) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
37
+ data: string;
38
+ }, Error, {
39
+ data: string;
40
+ }, string[]>, "queryFn"> & {
41
+ queryFn?: import("@tanstack/react-query").QueryFunction<{
42
+ data: string;
43
+ }, string[], never> | undefined;
44
+ } & {
45
+ queryKey: string[] & {
46
+ [dataTagSymbol]: {
47
+ data: string;
48
+ };
49
+ [dataTagErrorSymbol]: Error;
50
+ };
51
+ };
52
+ readonly getAirmetCancelTAC: (product: AviationProduct, credentials?: Credentials) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
53
+ data: string;
54
+ }, Error, {
55
+ data: string;
56
+ }, string[]>, "queryFn"> & {
57
+ queryFn?: import("@tanstack/react-query").QueryFunction<{
58
+ data: string;
59
+ }, string[], never> | undefined;
60
+ } & {
61
+ queryKey: string[] & {
62
+ [dataTagSymbol]: {
63
+ data: string;
64
+ };
65
+ [dataTagErrorSymbol]: Error;
66
+ };
67
+ };
68
+ };
@@ -10,6 +10,6 @@ export declare const EditorDarkMode: Story;
10
10
  export declare const MaritimeWarningsFormViewerMobileLight: Story;
11
11
  export declare const MaritimeWarningsFormEditorMobileLight: Story;
12
12
  export declare const MaritimeWarningsFormViewerMobileDark: Story;
13
- export declare const MaritimeWarningsFormMobileDark: Story;
13
+ export declare const MaritimeWarningsFormEditorMobileDark: Story;
14
14
  export declare const ErrorExample: Story;
15
15
  export declare const WarningExample: Story;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { DistrictsType, MaritimeWarningItem, MaritimeWarningItemAttributes, MaritimeWarningsConfig } from '../types';
2
+ import type { DistrictsType, MaritimeWarningItem, MaritimeWarningItemAttributes, MaritimeWarningsConfig } from '../types';
3
3
  export interface WarningListItemProps {
4
4
  warning: MaritimeWarningItem;
5
5
  areas: DistrictsType[];
@@ -16,5 +16,6 @@ export interface WarningListSelectProps {
16
16
  additionalStyling?: SxProps;
17
17
  isReadOnly?: boolean;
18
18
  displayEmpty?: boolean;
19
+ validationResult?: true | 'error' | 'warning';
19
20
  }
20
- export declare const WarningListSelect: React.MemoExoticComponent<({ options, value, label, onChange, renderOption, renderValue, gridArea, additionalStyling, isReadOnly, displayEmpty, }: WarningListSelectProps) => import("react/jsx-runtime").JSX.Element>;
21
+ export declare const WarningListSelect: React.MemoExoticComponent<({ options, value, label, onChange, renderOption, renderValue, gridArea, additionalStyling, isReadOnly, displayEmpty, validationResult, }: WarningListSelectProps) => import("react/jsx-runtime").JSX.Element>;
@@ -18,6 +18,7 @@ export type MaritimeWarningsDomain = 'northSeaDistricts' | 'coastalWaters';
18
18
  export interface WindDirectionType {
19
19
  value: string;
20
20
  label: string;
21
+ degrees: number;
21
22
  }
22
23
  export interface DistrictsType {
23
24
  geoJSON: GeoJSON.FeatureCollection;
@@ -32,9 +33,19 @@ export interface ChangeType {
32
33
  key: string;
33
34
  }
34
35
  export type MaritimeLevelTiming = 'maritimeLevelsSummer' | 'maritimeLevelsWinter';
36
+ export interface ValidationItem {
37
+ level: 'error' | 'warning';
38
+ value: number;
39
+ }
35
40
  export interface MaritimeWarningsConfig {
36
41
  districtList: Record<MaritimeWarningsDomain, DistrictsType[]>;
37
42
  maritimeLevelDefinition: Record<MaritimeLevelTiming, LevelDefinitionType[]>;
38
43
  windDirectionDefinition: WindDirectionType[];
39
44
  changeType: ChangeType[];
45
+ validation: {
46
+ dirTo: {
47
+ min_wind_change: ValidationItem;
48
+ max_wind_change: ValidationItem;
49
+ };
50
+ };
40
51
  }
@@ -1,6 +1,7 @@
1
1
  import { MaritimeWarning, MaritimeWarningsType } from '../../store/publicWarningForm/types';
2
2
  import { MaritimeWarningItem, MaritimeWarningsConfig, MaritimeWarningsDomain } from './types';
3
- export declare const isWarningsValid: (warnings: MaritimeWarningItem[]) => boolean;
3
+ export declare const isWarningsValid: (warnings: MaritimeWarningItem[], config: MaritimeWarningsConfig) => boolean;
4
4
  export declare const getType: (domain: MaritimeWarningsDomain) => MaritimeWarningsType;
5
5
  export declare const mapItemsToMaritimeWarnings: (warnings: MaritimeWarningItem[], domain: MaritimeWarningsDomain, maritimeConfig: MaritimeWarningsConfig, editor?: string) => MaritimeWarning[];
6
6
  export declare const mapMaritimeWarningsToItems: (warnings: MaritimeWarning[]) => MaritimeWarningItem[];
7
+ export declare const validateWindDirectionChange: (directionFrom: string | undefined, directionTo: string | undefined, changeType: string | undefined, config?: MaritimeWarningsConfig) => true | "warning" | "error";
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { PickedFilterState } from '../FilterList/filter-hooks';
2
+ import type { PickedFilterState } from '../FilterList/filter-hooks';
3
3
  export interface PublicWarningListConnectProps {
4
4
  panelId: string;
5
5
  presetFilterState?: PickedFilterState;
@@ -1,6 +1,5 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react-webpack5';
2
- import * as React from 'react';
3
- import { FormProps } from './PublicWarningsForm';
2
+ import type { FormProps } from './PublicWarningsForm';
4
3
  interface DemoProps {
5
4
  formProps: FormProps;
6
5
  darkMode: boolean;
@@ -1,7 +1,8 @@
1
- import { AviationProduct } from '@opengeoweb/sigmet-airmet';
2
1
  import React from 'react';
3
- import { WarningType } from '../../store/publicWarningForm/types';
4
- export declare const CancelAviationDialogContent: ({ product, warningType, }: {
2
+ import type { AviationProduct } from '@opengeoweb/sigmet-airmet';
3
+ import type { WarningType } from '../../store/publicWarningForm/types';
4
+ export declare const CancelAviationDialogContent: ({ product, warningType, errorMessage, }: {
5
5
  product: AviationProduct;
6
6
  warningType: WarningType;
7
+ errorMessage?: string;
7
8
  }) => React.ReactElement;
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import type { AviationProduct, Sigmet, SigmetConfig } from '@opengeoweb/sigmet-airmet';
3
+ type CancelType = 'sigmet' | 'airmet';
4
+ export interface CancelAviationConfirmDialogProps {
5
+ open: boolean;
6
+ type: CancelType;
7
+ product: AviationProduct;
8
+ showVA: boolean;
9
+ aviationConfig?: SigmetConfig;
10
+ sigmet?: Sigmet;
11
+ confirmLabel: string;
12
+ title: string;
13
+ onClose: () => void;
14
+ cancelAviationProduct: (p: AviationProduct, t: CancelType) => Promise<unknown>;
15
+ onSuccess?: () => void;
16
+ }
17
+ export declare const CancelAviationConfirmDialog: React.FC<CancelAviationConfirmDialogProps>;
18
+ export {};