@opengeoweb/warnings 10.0.0 → 10.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.
- package/index.esm.js +1126 -676
- package/package.json +1 -1
- package/src/lib/api/api-utils.d.ts +10 -0
- package/src/lib/{aviation-api → api/aviation-api}/hooks.d.ts +1 -1
- package/src/lib/api/warning-api/api.d.ts +4 -0
- package/src/lib/api/warning-api/hooks.d.ts +15 -0
- package/src/lib/components/DrawingToolForm/DrawingToolFormContents.d.ts +1 -1
- package/src/lib/components/FilterList/filter-hooks.d.ts +4 -3
- package/src/lib/components/FilterList/filter-utils.d.ts +6 -3
- package/src/lib/components/Providers/Providers.d.ts +3 -0
- package/src/lib/components/PublicWarningList/PublicWarningList.d.ts +6 -6
- package/src/lib/components/PublicWarningList/PublicWarningListConnect.stories.d.ts +37 -4
- package/src/lib/components/PublicWarningList/WarningListItem.d.ts +3 -3
- package/src/lib/components/PublicWarningList/WarningListItemMenu.d.ts +8 -7
- package/src/lib/components/PublicWarningsForm/PublicWarningsForm.d.ts +1 -0
- package/src/lib/components/PublicWarningsForm/PublicWarningsFormConnect.d.ts +2 -0
- package/src/lib/store/config.d.ts +1 -2
- package/src/lib/store/publicWarningForm/reducer.d.ts +30 -33
- package/src/lib/store/publicWarningForm/selectors.d.ts +12 -17
- package/src/lib/store/publicWarningForm/types.d.ts +5 -4
- package/src/lib/store/publicWarnings/reducer.d.ts +3 -14
- package/src/lib/store/publicWarnings/selectors.d.ts +2 -14
- package/src/lib/store/publicWarnings/types.d.ts +2 -2
- package/src/lib/store/types.d.ts +2 -2
- package/src/lib/utils/api.d.ts +3 -7
- package/src/lib/utils/fakeApi/index.d.ts +8 -5
- package/src/lib/utils/sig-airmet-util.d.ts +11 -7
- package/src/lib/utils/sig-airmet-util.spec.d.ts +1 -0
- package/src/lib/utils/warningUtils.d.ts +4 -4
- /package/src/lib/{aviation-api → api/aviation-api}/api.d.ts +0 -0
- /package/src/lib/{aviation-api → api/aviation-api}/fakeApi.d.ts +0 -0
- /package/src/lib/{store/publicWarnings/reducer.spec.d.ts → components/PublicWarningList/WarningListItemMenu.spec.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Warning } from '../store/publicWarningForm/types';
|
|
2
|
+
interface WarningsResponse {
|
|
3
|
+
combinedWarnings: Warning[];
|
|
4
|
+
refetchWarnings: () => void;
|
|
5
|
+
isFetching: boolean;
|
|
6
|
+
error?: Error;
|
|
7
|
+
dataUpdatedAt: number;
|
|
8
|
+
}
|
|
9
|
+
export declare const useWarnings: (disabled?: boolean) => WarningsResponse;
|
|
10
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UseQueryResult } from '@tanstack/react-query';
|
|
2
2
|
import { AirmetConfig, AirmetFromBackend, SigmetConfig, SigmetFromBackend } from '@opengeoweb/api';
|
|
3
3
|
import { AviationProduct } from '@opengeoweb/sigmet-airmet';
|
|
4
|
-
import { WarningType } from '
|
|
4
|
+
import { WarningType } from '../../store/publicWarningForm/types';
|
|
5
5
|
export declare const useAirmetList: (disabled?: boolean) => UseQueryResult<AirmetFromBackend[]>;
|
|
6
6
|
export declare const useSigmetList: (disabled?: boolean) => UseQueryResult<SigmetFromBackend[]>;
|
|
7
7
|
export declare const useProductConfig: (warningType?: WarningType, disabled?: boolean) => UseQueryResult<SigmetConfig | AirmetConfig>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Credentials } from '@opengeoweb/authentication';
|
|
2
|
+
import { Warning } from '../../store/publicWarningForm/types';
|
|
3
|
+
export declare const getPublicWarningList: (auth: Credentials) => Promise<Warning[]>;
|
|
4
|
+
export declare const updatePublicWarningEditor: (warningId: string, isEditor: boolean, auth: Credentials) => Promise<object>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { UseMutationResult, UseQueryResult } from '@tanstack/react-query';
|
|
2
|
+
import { Warning } from '../../store/publicWarningForm/types';
|
|
3
|
+
/**
|
|
4
|
+
* @param disabled - Disables fetching, but still returns cached values.
|
|
5
|
+
* https://tanstack.com/query/v4/docs/framework/react/guides/disabling-queries
|
|
6
|
+
*/
|
|
7
|
+
export declare const usePublicWarnings: (disabled?: boolean) => UseQueryResult<Warning[]>;
|
|
8
|
+
interface MutateProps {
|
|
9
|
+
id: string;
|
|
10
|
+
isEditor: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const useMutatePublicWarningEditor: () => UseMutationResult<object, Error, MutateProps, {
|
|
13
|
+
oldData: Warning[] | undefined;
|
|
14
|
+
}>;
|
|
15
|
+
export {};
|
|
@@ -19,7 +19,7 @@ export interface DrawingToolFormContentsProps {
|
|
|
19
19
|
isDirty: boolean;
|
|
20
20
|
errors: FieldErrors<FieldValues>;
|
|
21
21
|
onChangeDrawMode: (newMode: DrawMode) => void;
|
|
22
|
-
onChangeOpacity: (event: SelectChangeEvent) => void;
|
|
22
|
+
onChangeOpacity: (event: SelectChangeEvent<unknown>) => void;
|
|
23
23
|
onBlurName: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
24
24
|
onSubmit: () => void;
|
|
25
25
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Warning } from '../../store/publicWarningForm/types';
|
|
2
2
|
import { defaultDomainFilter, defaultEmptyFilter, defaultLevelFilter, defaultPhenomenonFilter } from './filter-utils';
|
|
3
3
|
export type UpdateFiltersOrigin = 'user' | 'system';
|
|
4
4
|
export interface PickedFilterState {
|
|
@@ -21,7 +21,8 @@ export type UpdateFilter = <T extends FilterKeyType>(filterKey: T | 'ALL', optio
|
|
|
21
21
|
export interface FilterHookState {
|
|
22
22
|
allSelected: boolean;
|
|
23
23
|
updateFilter: UpdateFilter;
|
|
24
|
-
byFilterState: (warning:
|
|
24
|
+
byFilterState: (warning: Warning) => boolean;
|
|
25
|
+
filterState: PickedFilterState;
|
|
25
26
|
}
|
|
26
|
-
export declare const useWarningFilters: (warnings:
|
|
27
|
+
export declare const useWarningFilters: (warnings: Warning[], onUpdateFilters: (filterState: PickedFilterState, origin: UpdateFiltersOrigin) => void, savedFilterState: PickedFilterState, presetFilterState?: PickedFilterState) => FilterHookState;
|
|
27
28
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Warning } from '../../store/publicWarningForm/types';
|
|
2
2
|
export declare enum Domain {
|
|
3
3
|
aviation = "aviation",
|
|
4
4
|
maritime = "maritime",
|
|
@@ -26,7 +26,10 @@ export declare const defaultDomainFilter: Record<Domain, boolean>;
|
|
|
26
26
|
export declare const domainLevels: Record<Domain, Level[]>;
|
|
27
27
|
export declare const defaultLevelFilter: Record<Level | 'unspecified', boolean>;
|
|
28
28
|
export declare const defaultEmptyFilter: Record<string, boolean>;
|
|
29
|
-
export declare const
|
|
29
|
+
export declare const makeFilterFromList: <T extends string>(options: T[]) => Record<T | 'unspecified', boolean>;
|
|
30
|
+
export declare const AllPhenomenaKeys: Record<"wind" | "fog" | "thunderstorm" | "snowIce" | "rain" | "highTemp" | "lowTemp" | "coastalEvent" | "EMBD_TS" | "EMBD_TSGR" | "FRQ_TS" | "FRQ_TSGR" | "HVY_DS" | "HVY_SS" | "OBSC_TS" | "OBSC_TSGR" | "RDOACT_CLD" | "SEV_ICE" | "SEV_ICE_FRZ_RN" | "SEV_MTW" | "SEV_TURB" | "SQL_TS" | "SQL_TSGR" | "VA_CLD" | "SFC_VIS" | "SFC_WIND" | "OVC_CLD" | "BKN_CLD" | "ISOL_CB" | "OCNL_CB" | "FRQ_CB" | "ISOL_TS" | "OCNL_TS" | "ISOL_TSGR" | "OCNL_TSGR" | "ISOL_TCU" | "OCNL_TCU" | "FRQ_TCU" | "MOD_ICE" | "MOD_MTW" | "MOD_TURB" | "MT_OBSC", "wind" | "fog" | "thunderstorm" | "snowIce" | "rain" | "highTemp" | "lowTemp" | "coastalEvent" | "EMBD_TS" | "EMBD_TSGR" | "FRQ_TS" | "FRQ_TSGR" | "HVY_DS" | "HVY_SS" | "OBSC_TS" | "OBSC_TSGR" | "RDOACT_CLD" | "SEV_ICE" | "SEV_ICE_FRZ_RN" | "SEV_MTW" | "SEV_TURB" | "SQL_TS" | "SQL_TSGR" | "VA_CLD" | "SFC_VIS" | "SFC_WIND" | "OVC_CLD" | "BKN_CLD" | "ISOL_CB" | "OCNL_CB" | "FRQ_CB" | "ISOL_TS" | "OCNL_TS" | "ISOL_TSGR" | "OCNL_TSGR" | "ISOL_TCU" | "OCNL_TCU" | "FRQ_TCU" | "MOD_ICE" | "MOD_MTW" | "MOD_TURB" | "MT_OBSC">;
|
|
31
|
+
export declare const domainPhenomena: Record<Domain, Partial<keyof typeof AllPhenomenaKeys>[]>;
|
|
32
|
+
export declare const defaultPhenomenonFilter: Record<string, boolean>;
|
|
30
33
|
export declare const initialFilters: {
|
|
31
34
|
incident: Record<string, boolean>;
|
|
32
35
|
source: Record<string, boolean>;
|
|
@@ -45,5 +48,5 @@ export declare const getSelectedOptions: (options: OptionsType) => OptionsMetada
|
|
|
45
48
|
export declare const updateState: <T extends string>(state: Partial<Record<T, boolean>>, optionKey: T | 'ALL', value: boolean, only?: boolean) => Record<T, boolean>;
|
|
46
49
|
/** Make sure our value is in the filter */
|
|
47
50
|
export declare const getValue: <T>(values: Record<string, T>, value: string) => T | 'unspecified';
|
|
48
|
-
export declare const getFiltersFromWarnings: (warnings:
|
|
51
|
+
export declare const getFiltersFromWarnings: (warnings: Warning[], filterKey: string) => string[];
|
|
49
52
|
export {};
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Theme } from '@mui/material';
|
|
3
3
|
import { Store } from '@reduxjs/toolkit';
|
|
4
|
+
import { QueryClient } from '@tanstack/react-query';
|
|
4
5
|
import { WarningsApi } from '../../utils/api';
|
|
5
6
|
export interface WarningsThemeProviderProps {
|
|
6
7
|
children: React.ReactNode;
|
|
7
8
|
theme?: Theme;
|
|
9
|
+
optionalQueryClient?: QueryClient;
|
|
8
10
|
}
|
|
9
11
|
export declare const WarningsThemeProvider: React.FC<WarningsThemeProviderProps>;
|
|
10
12
|
export interface WarningsThemeStoreProviderProps extends WarningsThemeProviderProps {
|
|
11
13
|
store?: Store;
|
|
12
14
|
createApi?: () => WarningsApi;
|
|
15
|
+
optionalQueryClient?: QueryClient;
|
|
13
16
|
}
|
|
14
17
|
export declare const WarningsThemeStoreProvider: React.FC<WarningsThemeStoreProviderProps>;
|
|
15
18
|
interface WarningsTranslationsWrapperProps {
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { FilterHookState
|
|
2
|
+
import { Warning } from '../../store/publicWarningForm/types';
|
|
3
|
+
import { FilterHookState } from '../FilterList/filter-hooks';
|
|
4
4
|
import { WarningListItemActions } from './WarningListItemMenu';
|
|
5
5
|
export interface PublicWarningListProps extends WarningListItemActions {
|
|
6
|
-
warnings:
|
|
7
|
-
onSelectWarning?: (warning:
|
|
6
|
+
warnings: Warning[];
|
|
7
|
+
onSelectWarning?: (warning: Warning) => void;
|
|
8
8
|
isLoading?: boolean;
|
|
9
9
|
error?: Error;
|
|
10
|
-
|
|
10
|
+
selectedWarningId?: string;
|
|
11
11
|
lastUpdatedTime?: string;
|
|
12
12
|
onCreateWarning?: () => void;
|
|
13
13
|
onRefetchWarnings?: () => void;
|
|
14
14
|
filterHookState: FilterHookState;
|
|
15
|
-
filterState: PickedFilterState;
|
|
16
15
|
hoveredFeatureId?: string;
|
|
17
16
|
expandedSections: Record<string, boolean>;
|
|
18
17
|
setExpandedSections: (expandedSections: Record<string, boolean>) => void;
|
|
18
|
+
onRenewWarning?: () => void;
|
|
19
19
|
}
|
|
20
20
|
export declare const PublicWarningList: React.FC<PublicWarningListProps>;
|
|
21
21
|
export default PublicWarningList;
|
|
@@ -1,10 +1,43 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
declare const _default: {
|
|
3
3
|
title: string;
|
|
4
|
+
component: ({ description, }: {
|
|
5
|
+
description?: string | undefined;
|
|
6
|
+
}) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
4
7
|
};
|
|
5
8
|
export default _default;
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
9
|
+
export declare const LightMode: {};
|
|
10
|
+
export declare const ListError: {
|
|
11
|
+
parameters: {
|
|
12
|
+
msw: {
|
|
13
|
+
handlers: {
|
|
14
|
+
warnings: import("msw").RestHandler<import("msw").MockedRequest<import("msw").DefaultBodyType>>;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export declare const EditorChanged: {
|
|
20
|
+
args: {
|
|
21
|
+
description: string;
|
|
22
|
+
};
|
|
23
|
+
parameters: {
|
|
24
|
+
msw: {
|
|
25
|
+
handlers: {
|
|
26
|
+
warnings: import("msw").RestHandler<import("msw").MockedRequest<import("msw").DefaultBodyType>>[];
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
8
31
|
export declare const PublicWarningListErrorDeleteWarning: () => React.ReactElement;
|
|
9
|
-
export declare const
|
|
10
|
-
|
|
32
|
+
export declare const ExtraLongList: {
|
|
33
|
+
args: {
|
|
34
|
+
description: string;
|
|
35
|
+
};
|
|
36
|
+
parameters: {
|
|
37
|
+
msw: {
|
|
38
|
+
handlers: {
|
|
39
|
+
warnings: import("msw").RestHandler<import("msw").MockedRequest<import("msw").DefaultBodyType>>;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ListItemProps } from '@mui/material';
|
|
3
|
-
import {
|
|
3
|
+
import { Warning } from '../../store/publicWarningForm/types';
|
|
4
4
|
import { WarningListItemActions } from './WarningListItemMenu';
|
|
5
5
|
export interface WarningListItemProps extends ListItemProps, WarningListItemActions {
|
|
6
|
-
warning:
|
|
6
|
+
warning: Warning;
|
|
7
7
|
highlightedItem?: boolean;
|
|
8
8
|
activeWarningId: string;
|
|
9
|
-
onSelectWarning?: (warning:
|
|
9
|
+
onSelectWarning?: (warning: Warning) => void;
|
|
10
10
|
}
|
|
11
11
|
declare const WarningListItem: React.FC<WarningListItemProps>;
|
|
12
12
|
export default WarningListItem;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { MenuItemType } from '@opengeoweb/shared';
|
|
2
2
|
import { TFunction } from 'i18next';
|
|
3
|
-
import {
|
|
3
|
+
import { Warning, WarningType } from '../../store/publicWarningForm/types';
|
|
4
4
|
export interface WarningListItemActions {
|
|
5
|
-
onEditWarning?: (warning:
|
|
5
|
+
onEditWarning?: (warning: Warning) => void;
|
|
6
6
|
onDeleteWarning?: (warningId: string, warningEditor?: string) => void;
|
|
7
|
-
onDeleteReviewWarning?: (warning:
|
|
8
|
-
onExpireWarning?: (warning:
|
|
9
|
-
onWithdrawWarning?: (warning:
|
|
7
|
+
onDeleteReviewWarning?: (warning: Warning) => void;
|
|
8
|
+
onExpireWarning?: (warning: Warning) => void;
|
|
9
|
+
onWithdrawWarning?: (warning: Warning) => void;
|
|
10
|
+
onRenewWarning?: (warning: Warning, warningType?: WarningType) => void;
|
|
10
11
|
}
|
|
11
12
|
interface WarningListItemMenuProps extends WarningListItemActions {
|
|
12
|
-
warning:
|
|
13
|
+
warning: Warning;
|
|
13
14
|
t: TFunction;
|
|
14
15
|
}
|
|
15
|
-
declare const WarningListItemMenu: ({ warning, onEditWarning, onDeleteWarning, onDeleteReviewWarning, onExpireWarning, onWithdrawWarning, t, }: WarningListItemMenuProps) => MenuItemType[];
|
|
16
|
+
declare const WarningListItemMenu: ({ warning, onEditWarning, onDeleteWarning, onDeleteReviewWarning, onExpireWarning, onWithdrawWarning, onRenewWarning, t, }: WarningListItemMenuProps) => MenuItemType[];
|
|
16
17
|
export default WarningListItemMenu;
|
|
@@ -20,6 +20,7 @@ export interface FormProps {
|
|
|
20
20
|
defaultMapPreset?: MapPreset;
|
|
21
21
|
onSaveForm?: (formValues: PublicWarningDetail) => void;
|
|
22
22
|
onPublishForm?: (formValues: PublicWarningDetail) => void;
|
|
23
|
+
onClearForm?: () => void;
|
|
23
24
|
object?: DrawingListItem;
|
|
24
25
|
publicWarningDetails?: PublicWarningDetail;
|
|
25
26
|
error?: FormError;
|
|
@@ -3,9 +3,11 @@ import { AviationProduct, FormMode } from '@opengeoweb/sigmet-airmet';
|
|
|
3
3
|
import { MapPreset } from '@opengeoweb/store';
|
|
4
4
|
import { WarningType } from '../../store/publicWarningForm/types';
|
|
5
5
|
export interface PublicWarningsFormConnectProps {
|
|
6
|
+
editor?: string;
|
|
6
7
|
selectedAviationProduct?: AviationProduct;
|
|
7
8
|
warningType?: WarningType;
|
|
8
9
|
mode?: FormMode;
|
|
9
10
|
defaultMapPreset?: MapPreset;
|
|
11
|
+
onFormSubmit?: () => void;
|
|
10
12
|
}
|
|
11
13
|
export declare const PublicWarningsFormConnect: React.FC<PublicWarningsFormConnectProps>;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
export declare const drawingModuleConfig: {
|
|
2
|
-
id: string;
|
|
3
2
|
reducersMap: {
|
|
4
3
|
drawings: import("redux").Reducer<import("./drawings/types").DrawState>;
|
|
5
|
-
publicWarningForm: import("redux").Reducer<import("./publicWarningForm/reducer").
|
|
4
|
+
publicWarningForm: import("redux").Reducer<import("./publicWarningForm/reducer").WarningFormState>;
|
|
6
5
|
publicWarnings: import("redux").Reducer<import("./publicWarnings/types").PublicWarningsState>;
|
|
7
6
|
};
|
|
8
7
|
middlewares: import("@reduxjs/toolkit").ListenerMiddleware<import("./types").WarningModuleStore, import("redux-thunk").ThunkDispatch<import("./types").WarningModuleStore, unknown, import("redux").AnyAction>, unknown>[];
|
|
@@ -2,70 +2,67 @@ import { PayloadAction, Draft } from '@reduxjs/toolkit';
|
|
|
2
2
|
import { AlertColor } from '@mui/material';
|
|
3
3
|
import { snackbarTypes } from '@opengeoweb/snackbar';
|
|
4
4
|
import { DrawingListItem } from '../drawings/types';
|
|
5
|
-
import { Area,
|
|
6
|
-
export type FormAction = '' | 'saving' | 'publishing' | 'readonly';
|
|
5
|
+
import { Area, Warning, WarningType } from './types';
|
|
6
|
+
export type FormAction = '' | 'saving' | 'publishing' | 'readonly' | 'edit';
|
|
7
7
|
export interface FormError {
|
|
8
8
|
severity?: AlertColor;
|
|
9
9
|
message: string;
|
|
10
10
|
}
|
|
11
|
-
export interface
|
|
11
|
+
export interface WarningFormState {
|
|
12
12
|
object?: DrawingListItem;
|
|
13
|
-
|
|
13
|
+
warning?: Warning;
|
|
14
14
|
formState?: FormAction;
|
|
15
15
|
error?: FormError;
|
|
16
|
-
|
|
16
|
+
selectedWarningId?: string;
|
|
17
17
|
isFormDirty?: boolean;
|
|
18
18
|
warningType?: WarningType;
|
|
19
19
|
panelId?: string;
|
|
20
20
|
}
|
|
21
21
|
export declare const TAKEOVER_MESSAGE = "You are no longer the editor of this warning";
|
|
22
|
-
export declare const initialState:
|
|
23
|
-
export declare const reducer: import("redux").Reducer<
|
|
22
|
+
export declare const initialState: WarningFormState;
|
|
23
|
+
export declare const reducer: import("redux").Reducer<WarningFormState>;
|
|
24
24
|
export declare const publicWarningFormActions: import("@reduxjs/toolkit").CaseReducerActions<{
|
|
25
|
-
setFormValues: (draft: Draft<
|
|
25
|
+
setFormValues: (draft: Draft<WarningFormState>, action: PayloadAction<{
|
|
26
26
|
object?: DrawingListItem;
|
|
27
|
-
|
|
27
|
+
warning?: Warning;
|
|
28
28
|
formState?: FormAction;
|
|
29
29
|
}>) => void;
|
|
30
|
-
addArea: (draft: Draft<
|
|
30
|
+
addArea: (draft: Draft<WarningFormState>, action: PayloadAction<{
|
|
31
31
|
area: Area;
|
|
32
32
|
}>) => void;
|
|
33
|
-
removeArea: (draft: Draft<
|
|
33
|
+
removeArea: (draft: Draft<WarningFormState>, action: PayloadAction<{
|
|
34
34
|
area: Area;
|
|
35
35
|
}>) => void;
|
|
36
|
-
|
|
36
|
+
removeAllAreas: (draft: Draft<WarningFormState>) => void;
|
|
37
|
+
openPublicWarningFormDialog: (draft: Draft<WarningFormState>, action: PayloadAction<{
|
|
37
38
|
object?: DrawingListItem;
|
|
38
39
|
formState?: FormAction;
|
|
39
|
-
|
|
40
|
+
warning?: Warning;
|
|
40
41
|
warningType?: WarningType;
|
|
41
42
|
panelId?: string;
|
|
42
43
|
}>) => void;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
username: string;
|
|
47
|
-
}>) => void;
|
|
48
|
-
toggleEditorWarningSuccess: (draft: Draft<PublicWarningFormState>, action: PayloadAction<{
|
|
49
|
-
isEditor: boolean;
|
|
50
|
-
username: string;
|
|
51
|
-
message: snackbarTypes.SnackbarMessage;
|
|
44
|
+
publishWarning: (draft: Draft<WarningFormState>, action: PayloadAction<{
|
|
45
|
+
publicWarning: Warning;
|
|
46
|
+
refetchWarnings?: () => void;
|
|
52
47
|
}>) => void;
|
|
53
|
-
|
|
54
|
-
publicWarning:
|
|
55
|
-
}>) => void;
|
|
56
|
-
publishWarningSuccess: (draft: Draft<PublicWarningFormState>, action: PayloadAction<{
|
|
57
|
-
publicWarning: PublicWarning;
|
|
48
|
+
publishWarningSuccess: (draft: Draft<WarningFormState>, action: PayloadAction<{
|
|
49
|
+
publicWarning: Warning;
|
|
58
50
|
message: snackbarTypes.SnackbarMessage;
|
|
59
51
|
}>) => void;
|
|
60
|
-
saveWarning: (draft: Draft<
|
|
61
|
-
publicWarning:
|
|
52
|
+
saveWarning: (draft: Draft<WarningFormState>, action: PayloadAction<{
|
|
53
|
+
publicWarning: Warning;
|
|
54
|
+
refetchWarnings?: () => void;
|
|
62
55
|
}>) => void;
|
|
63
|
-
saveWarningSuccess: (draft: Draft<
|
|
64
|
-
publicWarning:
|
|
56
|
+
saveWarningSuccess: (draft: Draft<WarningFormState>, action: PayloadAction<{
|
|
57
|
+
publicWarning: Warning;
|
|
65
58
|
message: snackbarTypes.SnackbarMessage;
|
|
66
59
|
}>) => void;
|
|
67
|
-
setFormError: (draft: Draft<
|
|
68
|
-
|
|
60
|
+
setFormError: (draft: Draft<WarningFormState>, action: PayloadAction<FormError>) => void;
|
|
61
|
+
removeFormError: (draft: Draft<WarningFormState>) => void;
|
|
62
|
+
setFormDirty: (draft: Draft<WarningFormState>, action: PayloadAction<{
|
|
69
63
|
isFormDirty: boolean;
|
|
70
64
|
}>) => void;
|
|
65
|
+
setEditMode: (draft: Draft<WarningFormState>, action: PayloadAction<{
|
|
66
|
+
warningId: string;
|
|
67
|
+
}>) => void;
|
|
71
68
|
}, "publicWarningForm">;
|
|
@@ -1,57 +1,52 @@
|
|
|
1
1
|
import { WarningModuleStore } from '../types';
|
|
2
|
-
import {
|
|
3
|
-
export declare const getPublicWarningStore: (store: WarningModuleStore) =>
|
|
4
|
-
export declare const getPublicWarningObject: ((state: WarningModuleStore) => import("../drawings/types").DrawingListItem | undefined) & import("reselect").OutputSelectorFields<(args_0:
|
|
2
|
+
import { WarningFormState } from './reducer';
|
|
3
|
+
export declare const getPublicWarningStore: (store: WarningModuleStore) => WarningFormState;
|
|
4
|
+
export declare const getPublicWarningObject: ((state: WarningModuleStore) => import("../drawings/types").DrawingListItem | undefined) & import("reselect").OutputSelectorFields<(args_0: WarningFormState) => import("../drawings/types").DrawingListItem | undefined, {
|
|
5
5
|
clearCache: () => void;
|
|
6
6
|
}> & {
|
|
7
7
|
clearCache: () => void;
|
|
8
8
|
};
|
|
9
|
-
export declare const getPublicWarning: ((state: WarningModuleStore) => import("./types").
|
|
9
|
+
export declare const getPublicWarning: ((state: WarningModuleStore) => import("./types").Warning | undefined) & import("reselect").OutputSelectorFields<(args_0: WarningFormState) => import("./types").Warning | undefined, {
|
|
10
10
|
clearCache: () => void;
|
|
11
11
|
}> & {
|
|
12
12
|
clearCache: () => void;
|
|
13
13
|
};
|
|
14
|
-
export declare const getPublicWarningStatus: ((state: WarningModuleStore) => import("./types").PublicWarningStatus | undefined) & import("reselect").OutputSelectorFields<(args_0:
|
|
14
|
+
export declare const getPublicWarningStatus: ((state: WarningModuleStore) => import("./types").PublicWarningStatus | undefined) & import("reselect").OutputSelectorFields<(args_0: WarningFormState) => import("./types").PublicWarningStatus | undefined, {
|
|
15
15
|
clearCache: () => void;
|
|
16
16
|
}> & {
|
|
17
17
|
clearCache: () => void;
|
|
18
18
|
};
|
|
19
|
-
export declare const
|
|
19
|
+
export declare const getPublicWarningId: ((state: WarningModuleStore) => string | undefined) & import("reselect").OutputSelectorFields<(args_0: WarningFormState) => string | undefined, {
|
|
20
20
|
clearCache: () => void;
|
|
21
21
|
}> & {
|
|
22
22
|
clearCache: () => void;
|
|
23
23
|
};
|
|
24
|
-
export declare const
|
|
24
|
+
export declare const getPublicWarningAreas: ((state: WarningModuleStore) => import("./types").Area[]) & import("reselect").OutputSelectorFields<(args_0: WarningFormState) => import("./types").Area[], {
|
|
25
25
|
clearCache: () => void;
|
|
26
26
|
}> & {
|
|
27
27
|
clearCache: () => void;
|
|
28
28
|
};
|
|
29
|
-
export declare const
|
|
29
|
+
export declare const getPublicWarningFormState: ((state: WarningModuleStore) => "" | "saving" | "publishing" | "readonly" | "edit") & import("reselect").OutputSelectorFields<(args_0: WarningFormState) => "" | "saving" | "publishing" | "readonly" | "edit", {
|
|
30
30
|
clearCache: () => void;
|
|
31
31
|
}> & {
|
|
32
32
|
clearCache: () => void;
|
|
33
33
|
};
|
|
34
|
-
export declare const
|
|
34
|
+
export declare const getPublicWarningFormError: ((state: WarningModuleStore) => import("./reducer").FormError | undefined) & import("reselect").OutputSelectorFields<(args_0: WarningFormState) => import("./reducer").FormError | undefined, {
|
|
35
35
|
clearCache: () => void;
|
|
36
36
|
}> & {
|
|
37
37
|
clearCache: () => void;
|
|
38
38
|
};
|
|
39
|
-
export declare const
|
|
39
|
+
export declare const getSelectedWarningId: ((state: WarningModuleStore) => string) & import("reselect").OutputSelectorFields<(args_0: WarningFormState) => string, {
|
|
40
40
|
clearCache: () => void;
|
|
41
41
|
}> & {
|
|
42
42
|
clearCache: () => void;
|
|
43
43
|
};
|
|
44
|
-
export declare const
|
|
44
|
+
export declare const getSelectedPublicIsFormDirty: ((state: WarningModuleStore) => boolean) & import("reselect").OutputSelectorFields<(args_0: WarningFormState) => boolean, {
|
|
45
45
|
clearCache: () => void;
|
|
46
46
|
}> & {
|
|
47
47
|
clearCache: () => void;
|
|
48
48
|
};
|
|
49
|
-
export declare const
|
|
50
|
-
clearCache: () => void;
|
|
51
|
-
}> & {
|
|
52
|
-
clearCache: () => void;
|
|
53
|
-
};
|
|
54
|
-
export declare const getWarningType: ((state: WarningModuleStore) => import("./types").WarningType | undefined) & import("reselect").OutputSelectorFields<(args_0: PublicWarningFormState) => import("./types").WarningType | undefined, {
|
|
49
|
+
export declare const getWarningType: ((state: WarningModuleStore) => import("./types").WarningType | undefined) & import("reselect").OutputSelectorFields<(args_0: WarningFormState) => import("./types").WarningType | undefined, {
|
|
55
50
|
clearCache: () => void;
|
|
56
51
|
}> & {
|
|
57
52
|
clearCache: () => void;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { ProductStatus } from '@opengeoweb/api';
|
|
1
|
+
import { Airmet, CancelAirmet, CancelSigmet, ProductStatus, Sigmet } from '@opengeoweb/api';
|
|
2
2
|
export interface Area {
|
|
3
3
|
objectName: string;
|
|
4
4
|
geoJSON: GeoJSON.FeatureCollection;
|
|
5
5
|
areaId?: string;
|
|
6
|
+
published_warning_uuid?: string;
|
|
6
7
|
}
|
|
7
8
|
export interface PublicWarningDetail {
|
|
8
9
|
id?: string;
|
|
@@ -22,9 +23,8 @@ export interface PublicWarningDetail {
|
|
|
22
23
|
proposal_id?: string;
|
|
23
24
|
linked_to_id?: string;
|
|
24
25
|
incident?: string;
|
|
25
|
-
firName?: string;
|
|
26
|
-
cancelId?: string;
|
|
27
26
|
}
|
|
27
|
+
export type AviationWarningDetails = Airmet | CancelAirmet | Sigmet | CancelSigmet;
|
|
28
28
|
export declare enum PublicWarningStatus {
|
|
29
29
|
DRAFT = "DRAFT",
|
|
30
30
|
DRAFT_PUBLISHED = "DRAFT_PUBLISHED",
|
|
@@ -34,11 +34,12 @@ export declare enum PublicWarningStatus {
|
|
|
34
34
|
IGNORED = "IGNORED",
|
|
35
35
|
WITHDRAWN = "WITHDRAWN"
|
|
36
36
|
}
|
|
37
|
-
export interface
|
|
37
|
+
export interface Warning {
|
|
38
38
|
status?: PublicWarningStatus;
|
|
39
39
|
productStatus?: ProductStatus;
|
|
40
40
|
editor?: string;
|
|
41
41
|
warningDetail: PublicWarningDetail;
|
|
42
|
+
sigmetAirmetDetail?: AviationWarningDetails;
|
|
42
43
|
id?: string;
|
|
43
44
|
lastUpdatedTime?: string;
|
|
44
45
|
}
|
|
@@ -1,22 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Draft, PayloadAction } from '@reduxjs/toolkit';
|
|
2
2
|
import { PublicWarningsState } from './types';
|
|
3
|
-
import {
|
|
3
|
+
import { Warning } from '../publicWarningForm/types';
|
|
4
4
|
import { PickedFilterState, UpdateFiltersOrigin } from '../../components/FilterList/filter-hooks';
|
|
5
|
-
export declare const publicWarningsAdapter: import("@reduxjs/toolkit").EntityAdapter<
|
|
5
|
+
export declare const publicWarningsAdapter: import("@reduxjs/toolkit").EntityAdapter<Warning>;
|
|
6
6
|
export declare const initialState: PublicWarningsState;
|
|
7
7
|
export declare const reducer: import("redux").Reducer<PublicWarningsState>;
|
|
8
8
|
export declare const publicWarningActions: import("@reduxjs/toolkit").CaseReducerActions<{
|
|
9
|
-
fetchWarnings: (draft: Draft<PublicWarningsState>) => void;
|
|
10
|
-
fetchWarningsSuccess: (draft: Draft<PublicWarningsState>, action: PayloadAction<{
|
|
11
|
-
warnings: PublicWarning[];
|
|
12
|
-
lastUpdatedTime: string;
|
|
13
|
-
}>) => void;
|
|
14
|
-
fetchWarningsError: (draft: Draft<PublicWarningsState>, action: PayloadAction<{
|
|
15
|
-
error: {
|
|
16
|
-
name: string;
|
|
17
|
-
message: string;
|
|
18
|
-
};
|
|
19
|
-
}>) => void;
|
|
20
9
|
setWarningFilters: (draft: Draft<PublicWarningsState>, action: PayloadAction<{
|
|
21
10
|
filterState: PickedFilterState;
|
|
22
11
|
panelId?: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PublicWarningsState } from './types';
|
|
2
2
|
import { WarningModuleStore } from '../types';
|
|
3
3
|
export declare const getPublicWarningsStore: (store: WarningModuleStore) => PublicWarningsState;
|
|
4
|
-
export declare const selectAllPublicWarnings: (state: WarningModuleStore) => import("../publicWarningForm/types").
|
|
4
|
+
export declare const selectAllPublicWarnings: (state: WarningModuleStore) => import("../publicWarningForm/types").Warning[];
|
|
5
5
|
export declare const isPublicWarningsLoading: ((state: WarningModuleStore) => boolean) & import("reselect").OutputSelectorFields<(args_0: PublicWarningsState) => boolean, {
|
|
6
6
|
clearCache: () => void;
|
|
7
7
|
}> & {
|
|
@@ -17,19 +17,7 @@ export declare const getPublicWarningsLastUpdatedTime: ((state: WarningModuleSto
|
|
|
17
17
|
}> & {
|
|
18
18
|
clearCache: () => void;
|
|
19
19
|
};
|
|
20
|
-
export declare const getWarningsFilterById: ((state: WarningModuleStore, panelId?: string | undefined) => import("../../components/FilterList/filter-hooks").PickedFilterState | {
|
|
21
|
-
incident: Record<string, boolean>;
|
|
22
|
-
source: Record<string, boolean>;
|
|
23
|
-
domain: Record<import("../../components/FilterList/filter-utils").Domain, boolean>;
|
|
24
|
-
phenomenon: Record<string, boolean>;
|
|
25
|
-
level: Record<import("../../components/FilterList/filter-utils").Level | "unspecified", boolean>;
|
|
26
|
-
}) & import("reselect").OutputSelectorFields<(args_0: Record<string, import("../../components/FilterList/filter-hooks").PickedFilterState>, args_1: string | undefined) => import("../../components/FilterList/filter-hooks").PickedFilterState | {
|
|
27
|
-
incident: Record<string, boolean>;
|
|
28
|
-
source: Record<string, boolean>;
|
|
29
|
-
domain: Record<import("../../components/FilterList/filter-utils").Domain, boolean>;
|
|
30
|
-
phenomenon: Record<string, boolean>;
|
|
31
|
-
level: Record<import("../../components/FilterList/filter-utils").Level | "unspecified", boolean>;
|
|
32
|
-
}, {
|
|
20
|
+
export declare const getWarningsFilterById: ((state: WarningModuleStore, panelId?: string | undefined) => import("../../components/FilterList/filter-hooks").PickedFilterState) & import("reselect").OutputSelectorFields<(args_0: Record<string, import("../../components/FilterList/filter-hooks").PickedFilterState>, args_1: string | undefined) => import("../../components/FilterList/filter-hooks").PickedFilterState, {
|
|
33
21
|
clearCache: () => void;
|
|
34
22
|
}> & {
|
|
35
23
|
clearCache: () => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EntityState } from '@reduxjs/toolkit';
|
|
2
|
-
import {
|
|
2
|
+
import { Warning } from '../publicWarningForm/types';
|
|
3
3
|
import { PickedFilterState } from '../../components/FilterList/filter-hooks';
|
|
4
4
|
export interface FilterTranslation {
|
|
5
5
|
translationKey: string;
|
|
@@ -11,7 +11,7 @@ export interface PublicWarningError {
|
|
|
11
11
|
message: string;
|
|
12
12
|
}
|
|
13
13
|
export interface PublicWarningsState {
|
|
14
|
-
warnings: EntityState<
|
|
14
|
+
warnings: EntityState<Warning>;
|
|
15
15
|
isLoading: boolean;
|
|
16
16
|
lastUpdatedTime: string;
|
|
17
17
|
error?: PublicWarningError;
|
package/src/lib/store/types.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { CoreAppStore } from '@opengeoweb/store';
|
|
2
2
|
import { DrawState } from './drawings/types';
|
|
3
|
-
import {
|
|
3
|
+
import { WarningFormState } from './publicWarningForm/reducer';
|
|
4
4
|
import { PublicWarningsState } from './publicWarnings/types';
|
|
5
5
|
export interface WarningModuleStore extends CoreAppStore {
|
|
6
6
|
drawings?: DrawState;
|
|
7
|
-
publicWarningForm?:
|
|
7
|
+
publicWarningForm?: WarningFormState;
|
|
8
8
|
publicWarnings?: PublicWarningsState;
|
|
9
9
|
}
|
package/src/lib/utils/api.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CreateApiProps } from '@opengeoweb/api';
|
|
2
2
|
import { AxiosInstance } from 'axios';
|
|
3
3
|
import { DrawingFromBE, DrawingFromFE, DrawingListItem, FetchDrawingParams } from '../store/drawings/types';
|
|
4
|
-
import {
|
|
4
|
+
import { Warning } from '../store/publicWarningForm/types';
|
|
5
5
|
export declare const API_NAME = "warnings";
|
|
6
6
|
export declare const getIdFromUrl: (url: string) => string;
|
|
7
7
|
export interface WarningsApi {
|
|
@@ -17,13 +17,9 @@ export interface WarningsApi {
|
|
|
17
17
|
getAreaKeywords: () => Promise<{
|
|
18
18
|
data: string[];
|
|
19
19
|
}>;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}>;
|
|
23
|
-
saveWarningAs: (data: PublicWarning) => Promise<string>;
|
|
24
|
-
updateWarning: (warningId: string, data: PublicWarning) => Promise<void>;
|
|
20
|
+
saveWarningAs: (data: Warning) => Promise<string>;
|
|
21
|
+
updateWarning: (warningId: string, data: Warning) => Promise<void>;
|
|
25
22
|
deleteWarning: (warningId: string) => Promise<void>;
|
|
26
|
-
toggleEditorWarning: (warningId: string, isEditor: boolean) => Promise<void>;
|
|
27
23
|
}
|
|
28
24
|
export declare const getApiRoutes: (axiosInstance: AxiosInstance) => WarningsApi;
|
|
29
25
|
export declare const getWarningsApi: () => WarningsApi;
|