@opengeoweb/warnings 14.0.1 → 14.2.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/index.esm.js +2321 -1315
- package/package.json +14 -13
- package/src/lib/api/api-utils.d.ts +2 -1
- package/src/lib/api/aviation-api/api.d.ts +6 -6
- package/src/lib/api/aviation-api/errorHandling.d.ts +1 -0
- package/src/lib/api/aviation-api/fakeApi.d.ts +3 -3
- package/src/lib/api/aviation-api/hooks.d.ts +24 -15
- package/src/lib/api/aviation-api/queryOptions.d.ts +68 -0
- package/src/lib/components/FilterList/ExpandableFilterChip.d.ts +2 -2
- package/src/lib/components/FilterList/FilterList.d.ts +5 -2
- package/src/lib/components/FilterList/TimeFilterChip.d.ts +7 -0
- package/src/lib/components/FilterList/filter-hooks.d.ts +7 -2
- package/src/lib/components/FilterList/filter-utils.d.ts +22 -7
- package/src/lib/components/MaritimeWarningsForm/MaritimeWarningsForm.stories.d.ts +1 -1
- package/src/lib/components/MaritimeWarningsForm/WarningList/WarningListItem.d.ts +1 -1
- package/src/lib/components/MaritimeWarningsForm/WarningList/WarningListSelect.d.ts +2 -1
- package/src/lib/components/MaritimeWarningsForm/types.d.ts +11 -0
- package/src/lib/components/MaritimeWarningsForm/utils.d.ts +2 -1
- package/src/lib/components/Providers/Providers.d.ts +2 -0
- package/src/lib/components/PublicWarningList/PublicWarningList.d.ts +3 -3
- package/src/lib/components/PublicWarningList/PublicWarningListConnect.d.ts +1 -1
- package/src/lib/components/PublicWarningList/WarningListItemSeperator.d.ts +2 -0
- package/src/lib/components/PublicWarningsForm/PublicWarningsForm.stories.d.ts +1 -2
- package/src/lib/components/PublicWarningsFormDialog/AviationWarningCancelDialogContent.d.ts +4 -3
- package/src/lib/components/PublicWarningsFormDialog/CancelAviationConfirmDialog.d.ts +18 -0
- package/src/lib/utils/i18n.d.ts +1 -1
- package/src/lib/components/PublicWarningList/PublicWarningListConnect.aviation.createAndEdit.integration.spec.d.ts +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/warnings",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.2.1",
|
|
4
4
|
"description": "GeoWeb warinings library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -8,32 +8,33 @@
|
|
|
8
8
|
"url": "git@gitlab.com:opengeoweb/opengeoweb.git"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@opengeoweb/api": "14.
|
|
12
|
-
"@opengeoweb/shared": "14.
|
|
13
|
-
"@opengeoweb/store": "14.
|
|
14
|
-
"@opengeoweb/webmap-react": "14.
|
|
11
|
+
"@opengeoweb/api": "14.2.1",
|
|
12
|
+
"@opengeoweb/shared": "14.2.1",
|
|
13
|
+
"@opengeoweb/store": "14.2.1",
|
|
14
|
+
"@opengeoweb/webmap-react": "14.2.1",
|
|
15
15
|
"@tanstack/react-query": "^5.85.5",
|
|
16
16
|
"react-redux": "^9.2.0",
|
|
17
|
-
"@opengeoweb/theme": "14.
|
|
18
|
-
"@opengeoweb/form-fields": "14.
|
|
17
|
+
"@opengeoweb/theme": "14.2.1",
|
|
18
|
+
"@opengeoweb/form-fields": "14.2.1",
|
|
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.
|
|
22
|
+
"@opengeoweb/snackbar": "14.2.1",
|
|
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.
|
|
27
|
-
"@opengeoweb/webmap": "14.
|
|
28
|
-
"@opengeoweb/authentication": "14.
|
|
29
|
-
"@opengeoweb/sigmet-airmet": "14.
|
|
26
|
+
"@opengeoweb/core": "14.2.1",
|
|
27
|
+
"@opengeoweb/webmap": "14.2.1",
|
|
28
|
+
"@opengeoweb/authentication": "14.2.1",
|
|
29
|
+
"@opengeoweb/sigmet-airmet": "14.2.1",
|
|
30
30
|
"react-i18next": "^15.1.1",
|
|
31
31
|
"i18next": "^25.0.1",
|
|
32
32
|
"@mui/material": "^7.0.1",
|
|
33
33
|
"ol": "^10.4.0",
|
|
34
34
|
"msw": "^2.7.3",
|
|
35
35
|
"@types/geojson": "^7946.0.14",
|
|
36
|
-
"react-sortablejs": "^6.1.4"
|
|
36
|
+
"react-sortablejs": "^6.1.4",
|
|
37
|
+
"@mui/x-date-pickers": "^8.15.0"
|
|
37
38
|
},
|
|
38
39
|
"peerDependencies": {
|
|
39
40
|
"react": "18",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Warning } from '../store/publicWarningForm/types';
|
|
2
|
+
import type { TimeFilter } from '../components/FilterList/filter-utils';
|
|
2
3
|
interface WarningsResponse {
|
|
3
4
|
combinedWarnings: Warning[];
|
|
4
5
|
refetchWarnings: () => void;
|
|
@@ -6,6 +7,6 @@ interface WarningsResponse {
|
|
|
6
7
|
error?: Error;
|
|
7
8
|
dataUpdatedAt: number;
|
|
8
9
|
}
|
|
9
|
-
export declare const useWarnings: (disabled?: boolean) => WarningsResponse;
|
|
10
|
+
export declare const useWarnings: (disabled?: boolean, timeFilter?: TimeFilter) => WarningsResponse;
|
|
10
11
|
export declare function useAutoRefetchOnExpiry(combinedWarnings: Warning[], refetchWarnings: () => void): void;
|
|
11
12
|
export {};
|
|
@@ -3,20 +3,20 @@ import { Credentials } from '@opengeoweb/authentication';
|
|
|
3
3
|
import { AirmetFromFrontend, AviationProduct, SigmetFromFrontend } from '@opengeoweb/sigmet-airmet';
|
|
4
4
|
export declare const airmetBaseUrl: string;
|
|
5
5
|
export declare const sigmetBaseUrl: string;
|
|
6
|
-
export declare const getAirmetList: (auth: Credentials) => Promise<AirmetFromBackend[]>;
|
|
7
|
-
export declare const getSigmetList: (auth: Credentials) => Promise<SigmetFromBackend[]>;
|
|
6
|
+
export declare const getAirmetList: (auth: Credentials, params?: Record<string, string>) => Promise<AirmetFromBackend[]>;
|
|
7
|
+
export declare const getSigmetList: (auth: Credentials, params?: Record<string, string>) => 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: (
|
|
10
|
+
export declare const getAirmetTAC: (product: AviationProduct, auth?: Credentials) => Promise<{
|
|
11
11
|
data: string;
|
|
12
12
|
}>;
|
|
13
|
-
export declare const getSigmetTAC: (
|
|
13
|
+
export declare const getSigmetTAC: (product: AviationProduct, auth?: Credentials) => Promise<{
|
|
14
14
|
data: string;
|
|
15
15
|
}>;
|
|
16
|
-
export declare const getAirmetCancelTAC: (
|
|
16
|
+
export declare const getAirmetCancelTAC: (product: AviationProduct, auth?: Credentials) => Promise<{
|
|
17
17
|
data: string;
|
|
18
18
|
}>;
|
|
19
|
-
export declare const getSigmetCancelTAC: (
|
|
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
|
|
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
|
|
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,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
type
|
|
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 { TimeFilter } from '../../components/FilterList/filter-utils';
|
|
5
|
+
import type { WarningType } from '../../store/publicWarningForm/types';
|
|
6
|
+
interface TACData {
|
|
7
|
+
data: string;
|
|
8
|
+
}
|
|
9
|
+
type TACResult = UseQueryResult<{
|
|
10
10
|
data: string;
|
|
11
11
|
}>;
|
|
12
|
-
export declare const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
export declare const useAirmetList: (disabled?: boolean, timeFilter?: TimeFilter) => UseQueryResult<AirmetFromBackend[]>;
|
|
13
|
+
export declare const useSigmetList: (disabled?: boolean, timeFilter?: TimeFilter) => UseQueryResult<SigmetFromBackend[]>;
|
|
14
|
+
export declare const useAviationWarnings: () => (SigmetFromBackend | AirmetFromBackend)[];
|
|
15
|
+
export declare const useProductConfig: (warningType?: WarningType, disabled?: boolean) => UseQueryResult<SigmetConfig | AirmetConfig>;
|
|
16
|
+
export declare const useFetchSigmetTAC: (product: AviationProduct, enabled?: boolean) => TACResult;
|
|
17
|
+
export declare const useFetchAirmetTAC: (product: AviationProduct, enabled?: boolean) => TACResult;
|
|
18
|
+
export declare const useFetchSigmetCancelTAC: (product: AviationProduct, enabled?: boolean) => TACResult;
|
|
19
|
+
export declare const useFetchAirmetCancelTAC: (product: AviationProduct, enabled?: boolean) => TACResult;
|
|
20
|
+
interface UseTACApi {
|
|
21
|
+
fetchSigmetTAC: (product: AviationProduct) => Promise<TACData>;
|
|
22
|
+
fetchAirmetTAC: (product: AviationProduct) => Promise<TACData>;
|
|
23
|
+
fetchSigmetCancelTAC: (product: AviationProduct) => Promise<TACData>;
|
|
24
|
+
fetchAirmetCancelTAC: (product: AviationProduct) => Promise<TACData>;
|
|
25
|
+
}
|
|
26
|
+
export declare const useTACApi: () => UseTACApi;
|
|
18
27
|
/**
|
|
19
28
|
* Hook for posting a SIGMET, with feedback.
|
|
20
29
|
*
|
|
@@ -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
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PickedFilterState, UpdateFilter } from './filter-hooks';
|
|
2
|
-
type IdType = keyof PickedFilterState
|
|
1
|
+
import type { PickedFilterState, UpdateFilter } from './filter-hooks';
|
|
2
|
+
type IdType = Exclude<keyof PickedFilterState, 'time'>;
|
|
3
3
|
export interface ExpandableFilterChipProps {
|
|
4
4
|
id: IdType;
|
|
5
5
|
options: PickedFilterState[IdType];
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { PickedFilterState, UpdateFilter } from './filter-hooks';
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import type { PickedFilterState, UpdateFilter } from './filter-hooks';
|
|
3
|
+
import type { TimeFilter } from './filter-utils';
|
|
3
4
|
interface FilterListProps {
|
|
4
5
|
onClickAll?: (isChecked: boolean) => void;
|
|
5
6
|
isAllSelected?: boolean;
|
|
6
7
|
filterState: PickedFilterState;
|
|
7
8
|
updateFilter: UpdateFilter;
|
|
9
|
+
timeFilter: TimeFilter;
|
|
10
|
+
onUpdateTimeFilter: (timeFilter: TimeFilter) => void;
|
|
8
11
|
}
|
|
9
12
|
declare const FilterList: FC<FilterListProps>;
|
|
10
13
|
export default FilterList;
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AllPhenomenaKeys,
|
|
1
|
+
import type { defaultDomainFilter, defaultPhenomenonFilter, TimeFilter } from './filter-utils';
|
|
2
|
+
import { AllPhenomenaKeys, defaultEmptyFilter, defaultLevelFilter, Domain } from './filter-utils';
|
|
3
|
+
import type { Warning } from '../../store/publicWarningForm/types';
|
|
3
4
|
export interface PickedFilterState {
|
|
4
5
|
source: Partial<typeof defaultEmptyFilter>;
|
|
5
6
|
domain: Partial<typeof defaultDomainFilter>;
|
|
6
7
|
phenomenon: Partial<typeof defaultPhenomenonFilter>;
|
|
7
8
|
level: Partial<typeof defaultLevelFilter>;
|
|
9
|
+
time: TimeFilter;
|
|
8
10
|
}
|
|
9
11
|
export interface FilterState extends PickedFilterState {
|
|
10
12
|
source: typeof defaultEmptyFilter;
|
|
11
13
|
domain: typeof defaultDomainFilter;
|
|
12
14
|
phenomenon: typeof defaultPhenomenonFilter;
|
|
13
15
|
level: typeof defaultLevelFilter;
|
|
16
|
+
time: TimeFilter;
|
|
14
17
|
}
|
|
15
18
|
export type FilterKeyType = keyof FilterState;
|
|
16
19
|
export type OptionKey<T extends FilterKeyType> = keyof FilterState[T];
|
|
@@ -18,8 +21,10 @@ export type UpdateFilter = <T extends FilterKeyType>(filterKey: T | 'ALL', optio
|
|
|
18
21
|
export interface FilterHookState {
|
|
19
22
|
allSelected: boolean;
|
|
20
23
|
updateFilter: UpdateFilter;
|
|
24
|
+
updateTimeFilter: (timeFilter: TimeFilter) => void;
|
|
21
25
|
byFilterState: (warning: Warning) => boolean;
|
|
22
26
|
filterState: PickedFilterState;
|
|
27
|
+
timeFilter: TimeFilter;
|
|
23
28
|
}
|
|
24
29
|
export declare const getPhenomenaForDomainFilter: (domainFilter: Record<Domain, boolean>) => (keyof typeof AllPhenomenaKeys)[];
|
|
25
30
|
export declare const useWarningFilters: (warnings: Warning[], onUpdateFilters: (filterState: Partial<FilterState>, systemUpdate?: boolean) => void, savedFilterState: FilterState, presetFilterState?: PickedFilterState) => FilterHookState;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AirmetPhenomena, SigmetPhenomena } from '@opengeoweb/api';
|
|
2
|
-
import { Warning } from '../../store/publicWarningForm/types';
|
|
2
|
+
import type { Warning } from '../../store/publicWarningForm/types';
|
|
3
3
|
export declare enum Domain {
|
|
4
4
|
aviation = "aviation",
|
|
5
5
|
maritime = "maritime",
|
|
@@ -75,12 +75,6 @@ declare const AllPhenomena: {
|
|
|
75
75
|
export declare const AllPhenomenaKeys: Record<keyof typeof AllPhenomena, keyof typeof AllPhenomena>;
|
|
76
76
|
export declare const domainPhenomena: Record<Domain, Partial<keyof typeof AllPhenomenaKeys>[]>;
|
|
77
77
|
export declare const defaultPhenomenonFilter: Record<string, boolean>;
|
|
78
|
-
export declare const initialFilters: {
|
|
79
|
-
source: Record<string, boolean>;
|
|
80
|
-
domain: Record<Domain, boolean>;
|
|
81
|
-
phenomenon: Record<string, boolean>;
|
|
82
|
-
level: Record<"unspecified" | Level, boolean>;
|
|
83
|
-
};
|
|
84
78
|
type OptionsType = Partial<Record<Domain | Level | Phenomenon, boolean>>;
|
|
85
79
|
interface OptionsMetadata {
|
|
86
80
|
/** The number of selected options */
|
|
@@ -93,4 +87,25 @@ export declare const updateState: <T extends string>(state: Record<T, boolean>,
|
|
|
93
87
|
/** Make sure our value is in the filter */
|
|
94
88
|
export declare const getValue: <T>(values: Record<string, T>, value: string) => T | "unspecified";
|
|
95
89
|
export declare const getFiltersFromWarnings: (warnings: Warning[], filterKey: string) => string[];
|
|
90
|
+
export declare enum TimeFilterMode {
|
|
91
|
+
all = "all",
|
|
92
|
+
today = "today",
|
|
93
|
+
tomorrow = "tomorrow",
|
|
94
|
+
custom = "custom"
|
|
95
|
+
}
|
|
96
|
+
export interface TimeFilter {
|
|
97
|
+
mode: TimeFilterMode;
|
|
98
|
+
customStart?: string;
|
|
99
|
+
customEnd?: string;
|
|
100
|
+
}
|
|
101
|
+
export declare const defaultTimeFilter: TimeFilter;
|
|
102
|
+
export declare const isWarningWithinInterval: (warning: Warning, timeFilter: TimeFilter) => boolean;
|
|
103
|
+
export declare const getApiParams: (timeFilter: TimeFilter) => Record<string, string>;
|
|
104
|
+
export declare const initialFilters: {
|
|
105
|
+
source: Record<string, boolean>;
|
|
106
|
+
domain: Record<Domain, boolean>;
|
|
107
|
+
phenomenon: Record<string, boolean>;
|
|
108
|
+
level: Record<"unspecified" | Level, boolean>;
|
|
109
|
+
time: TimeFilter;
|
|
110
|
+
};
|
|
96
111
|
export {};
|
|
@@ -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
|
|
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";
|
|
@@ -13,11 +13,13 @@ export declare const WarningsThemeProvider: React.FC<WarningsThemeProviderProps>
|
|
|
13
13
|
interface WarningStoreProviderProps {
|
|
14
14
|
store?: Store;
|
|
15
15
|
optionalQueryClient?: QueryClient;
|
|
16
|
+
isLoggedIn?: boolean;
|
|
16
17
|
}
|
|
17
18
|
export declare const WarningsStoreProvider: React.FC<WarningStoreProviderProps & WarningsClientProviderProps>;
|
|
18
19
|
export interface WarningsThemeStoreProviderProps extends WarningsThemeProviderProps {
|
|
19
20
|
store?: Store;
|
|
20
21
|
optionalQueryClient?: QueryClient;
|
|
22
|
+
isLoggedIn?: boolean;
|
|
21
23
|
}
|
|
22
24
|
export declare const WarningsThemeStoreProvider: React.FC<WarningsThemeStoreProviderProps>;
|
|
23
25
|
interface WarningsTranslationsWrapperProps {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import type { WarningListItemActions } from './WarningListItemMenu';
|
|
3
|
+
import type { Warning } from '../../store/publicWarningForm/types';
|
|
4
|
+
import type { FilterHookState } from '../FilterList/filter-hooks';
|
|
5
5
|
export interface PublicWarningListProps extends WarningListItemActions {
|
|
6
6
|
warnings: Warning[];
|
|
7
7
|
onSelectWarning?: (warning: Warning) => void;
|
|
@@ -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,9 +1,11 @@
|
|
|
1
1
|
import { ListItemProps } from '@mui/material';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { PublicWarningStatus } from '../../store/publicWarningForm/types';
|
|
4
|
+
import type { TimeFilter } from '../FilterList/filter-utils';
|
|
4
5
|
declare const WarningListItemSeperator: React.FC<{
|
|
5
6
|
totalWarnings: number;
|
|
6
7
|
status: PublicWarningStatus;
|
|
7
8
|
isExpanded: boolean;
|
|
9
|
+
timeFilter: TimeFilter;
|
|
8
10
|
} & ListItemProps>;
|
|
9
11
|
export default WarningListItemSeperator;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
-
import
|
|
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 {
|
|
4
|
-
|
|
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 {};
|
package/src/lib/utils/i18n.d.ts
CHANGED
|
@@ -2,6 +2,6 @@ import i18n from 'i18next';
|
|
|
2
2
|
import { UseTranslationResponse } from 'react-i18next';
|
|
3
3
|
export declare const WARN_NAMESPACE = "warn";
|
|
4
4
|
export declare const initWarnI18n: () => void;
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const translateInTestsAndStories: (key: string, params?: Record<string, string | number> | undefined) => string;
|
|
6
6
|
export declare const useWarningsTranslation: () => UseTranslationResponse<typeof WARN_NAMESPACE, typeof i18n>;
|
|
7
7
|
export { i18n };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|