@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.
Files changed (32) hide show
  1. package/index.esm.js +1126 -676
  2. package/package.json +1 -1
  3. package/src/lib/api/api-utils.d.ts +10 -0
  4. package/src/lib/{aviation-api → api/aviation-api}/hooks.d.ts +1 -1
  5. package/src/lib/api/warning-api/api.d.ts +4 -0
  6. package/src/lib/api/warning-api/hooks.d.ts +15 -0
  7. package/src/lib/components/DrawingToolForm/DrawingToolFormContents.d.ts +1 -1
  8. package/src/lib/components/FilterList/filter-hooks.d.ts +4 -3
  9. package/src/lib/components/FilterList/filter-utils.d.ts +6 -3
  10. package/src/lib/components/Providers/Providers.d.ts +3 -0
  11. package/src/lib/components/PublicWarningList/PublicWarningList.d.ts +6 -6
  12. package/src/lib/components/PublicWarningList/PublicWarningListConnect.stories.d.ts +37 -4
  13. package/src/lib/components/PublicWarningList/WarningListItem.d.ts +3 -3
  14. package/src/lib/components/PublicWarningList/WarningListItemMenu.d.ts +8 -7
  15. package/src/lib/components/PublicWarningsForm/PublicWarningsForm.d.ts +1 -0
  16. package/src/lib/components/PublicWarningsForm/PublicWarningsFormConnect.d.ts +2 -0
  17. package/src/lib/store/config.d.ts +1 -2
  18. package/src/lib/store/publicWarningForm/reducer.d.ts +30 -33
  19. package/src/lib/store/publicWarningForm/selectors.d.ts +12 -17
  20. package/src/lib/store/publicWarningForm/types.d.ts +5 -4
  21. package/src/lib/store/publicWarnings/reducer.d.ts +3 -14
  22. package/src/lib/store/publicWarnings/selectors.d.ts +2 -14
  23. package/src/lib/store/publicWarnings/types.d.ts +2 -2
  24. package/src/lib/store/types.d.ts +2 -2
  25. package/src/lib/utils/api.d.ts +3 -7
  26. package/src/lib/utils/fakeApi/index.d.ts +8 -5
  27. package/src/lib/utils/sig-airmet-util.d.ts +11 -7
  28. package/src/lib/utils/sig-airmet-util.spec.d.ts +1 -0
  29. package/src/lib/utils/warningUtils.d.ts +4 -4
  30. /package/src/lib/{aviation-api → api/aviation-api}/api.d.ts +0 -0
  31. /package/src/lib/{aviation-api → api/aviation-api}/fakeApi.d.ts +0 -0
  32. /package/src/lib/{store/publicWarnings/reducer.spec.d.ts → components/PublicWarningList/WarningListItemMenu.spec.d.ts} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/warnings",
3
- "version": "10.0.0",
3
+ "version": "10.2.0",
4
4
  "description": "GeoWeb warinings library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -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 '../store/publicWarningForm/types';
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 { PublicWarning } from '../../store/publicWarningForm/types';
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: PublicWarning) => boolean;
24
+ byFilterState: (warning: Warning) => boolean;
25
+ filterState: PickedFilterState;
25
26
  }
26
- export declare const useWarningFilters: (warnings: PublicWarning[], onUpdateFilters: (filterState: PickedFilterState, origin: UpdateFiltersOrigin) => void, savedFilterState: PickedFilterState, presetFilterState?: PickedFilterState, isLoading?: boolean) => FilterHookState;
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 { PublicWarning } from '../../store/publicWarningForm/types';
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 defaultPhenomenonFilter: Record<Phenomenon | 'unspecified', boolean>;
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: PublicWarning[], filterKey: string) => string[];
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 { PublicWarning } from '../../store/publicWarningForm/types';
3
- import { FilterHookState, PickedFilterState } from '../FilterList/filter-hooks';
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: PublicWarning[];
7
- onSelectWarning?: (warning: PublicWarning) => void;
6
+ warnings: Warning[];
7
+ onSelectWarning?: (warning: Warning) => void;
8
8
  isLoading?: boolean;
9
9
  error?: Error;
10
- selectedPublicWarningId?: string;
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 PublicWarningListLight: () => React.ReactElement;
7
- export declare const PublicWarningListError: () => React.ReactElement;
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 PublicWarningListDifferentEditors: () => React.ReactElement;
10
- export declare const PublicWarningListExtraLongList: () => React.ReactElement;
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 { PublicWarning } from '../../store/publicWarningForm/types';
3
+ import { Warning } from '../../store/publicWarningForm/types';
4
4
  import { WarningListItemActions } from './WarningListItemMenu';
5
5
  export interface WarningListItemProps extends ListItemProps, WarningListItemActions {
6
- warning: PublicWarning;
6
+ warning: Warning;
7
7
  highlightedItem?: boolean;
8
8
  activeWarningId: string;
9
- onSelectWarning?: (warning: PublicWarning) => void;
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 { PublicWarning } from '../../store/publicWarningForm/types';
3
+ import { Warning, WarningType } from '../../store/publicWarningForm/types';
4
4
  export interface WarningListItemActions {
5
- onEditWarning?: (warning: PublicWarning) => void;
5
+ onEditWarning?: (warning: Warning) => void;
6
6
  onDeleteWarning?: (warningId: string, warningEditor?: string) => void;
7
- onDeleteReviewWarning?: (warning: PublicWarning) => void;
8
- onExpireWarning?: (warning: PublicWarning) => void;
9
- onWithdrawWarning?: (warning: PublicWarning) => void;
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: PublicWarning;
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").PublicWarningFormState>;
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, PublicWarning, WarningType } from './types';
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 PublicWarningFormState {
11
+ export interface WarningFormState {
12
12
  object?: DrawingListItem;
13
- publicWarning?: PublicWarning;
13
+ warning?: Warning;
14
14
  formState?: FormAction;
15
15
  error?: FormError;
16
- selectedPublicWarningId?: string;
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: PublicWarningFormState;
23
- export declare const reducer: import("redux").Reducer<PublicWarningFormState>;
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<PublicWarningFormState>, action: PayloadAction<{
25
+ setFormValues: (draft: Draft<WarningFormState>, action: PayloadAction<{
26
26
  object?: DrawingListItem;
27
- publicWarning?: PublicWarning;
27
+ warning?: Warning;
28
28
  formState?: FormAction;
29
29
  }>) => void;
30
- addArea: (draft: Draft<PublicWarningFormState>, action: PayloadAction<{
30
+ addArea: (draft: Draft<WarningFormState>, action: PayloadAction<{
31
31
  area: Area;
32
32
  }>) => void;
33
- removeArea: (draft: Draft<PublicWarningFormState>, action: PayloadAction<{
33
+ removeArea: (draft: Draft<WarningFormState>, action: PayloadAction<{
34
34
  area: Area;
35
35
  }>) => void;
36
- openPublicWarningFormDialog: (draft: Draft<PublicWarningFormState>, action: PayloadAction<{
36
+ removeAllAreas: (draft: Draft<WarningFormState>) => void;
37
+ openPublicWarningFormDialog: (draft: Draft<WarningFormState>, action: PayloadAction<{
37
38
  object?: DrawingListItem;
38
39
  formState?: FormAction;
39
- publicWarning?: PublicWarning;
40
+ warning?: Warning;
40
41
  warningType?: WarningType;
41
42
  panelId?: string;
42
43
  }>) => void;
43
- toggleEditorWarning: (draft: Draft<PublicWarningFormState>, action: PayloadAction<{
44
- warningId: string;
45
- isEditor: boolean;
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
- publishWarning: (draft: Draft<PublicWarningFormState>, action: PayloadAction<{
54
- publicWarning: 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<PublicWarningFormState>, action: PayloadAction<{
61
- publicWarning: PublicWarning;
52
+ saveWarning: (draft: Draft<WarningFormState>, action: PayloadAction<{
53
+ publicWarning: Warning;
54
+ refetchWarnings?: () => void;
62
55
  }>) => void;
63
- saveWarningSuccess: (draft: Draft<PublicWarningFormState>, action: PayloadAction<{
64
- publicWarning: PublicWarning;
56
+ saveWarningSuccess: (draft: Draft<WarningFormState>, action: PayloadAction<{
57
+ publicWarning: Warning;
65
58
  message: snackbarTypes.SnackbarMessage;
66
59
  }>) => void;
67
- setFormError: (draft: Draft<PublicWarningFormState>, action: PayloadAction<FormError>) => void;
68
- setFormDirty: (draft: Draft<PublicWarningFormState>, action: PayloadAction<{
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 { PublicWarningFormState } from './reducer';
3
- export declare const getPublicWarningStore: (store: WarningModuleStore) => PublicWarningFormState;
4
- export declare const getPublicWarningObject: ((state: WarningModuleStore) => import("../drawings/types").DrawingListItem | undefined) & import("reselect").OutputSelectorFields<(args_0: PublicWarningFormState) => import("../drawings/types").DrawingListItem | undefined, {
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").PublicWarning | undefined) & import("reselect").OutputSelectorFields<(args_0: PublicWarningFormState) => import("./types").PublicWarning | undefined, {
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: PublicWarningFormState) => import("./types").PublicWarningStatus | undefined, {
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 getPublicWarningEditor: ((state: WarningModuleStore) => string | undefined) & import("reselect").OutputSelectorFields<(args_0: PublicWarningFormState) => string | undefined, {
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 getPublicWarningId: ((state: WarningModuleStore) => string | undefined) & import("reselect").OutputSelectorFields<(args_0: PublicWarningFormState) => string | undefined, {
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 getPublicWarningAreas: ((state: WarningModuleStore) => import("./types").Area[]) & import("reselect").OutputSelectorFields<(args_0: PublicWarningFormState) => import("./types").Area[], {
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 getPublicWarningFormState: ((state: WarningModuleStore) => "" | "saving" | "publishing" | "readonly") & import("reselect").OutputSelectorFields<(args_0: PublicWarningFormState) => "" | "saving" | "publishing" | "readonly", {
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 getPublicWarningFormError: ((state: WarningModuleStore) => import("./reducer").FormError | undefined) & import("reselect").OutputSelectorFields<(args_0: PublicWarningFormState) => import("./reducer").FormError | undefined, {
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 getSelectedPublicWarningId: ((state: WarningModuleStore) => string) & import("reselect").OutputSelectorFields<(args_0: PublicWarningFormState) => string, {
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 getSelectedPublicIsFormDirty: ((state: WarningModuleStore) => boolean) & import("reselect").OutputSelectorFields<(args_0: PublicWarningFormState) => boolean, {
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 PublicWarning {
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 { PayloadAction, Draft } from '@reduxjs/toolkit';
1
+ import { Draft, PayloadAction } from '@reduxjs/toolkit';
2
2
  import { PublicWarningsState } from './types';
3
- import { PublicWarning } from '../publicWarningForm/types';
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<PublicWarning>;
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").PublicWarning[];
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 { PublicWarning } from '../publicWarningForm/types';
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<PublicWarning>;
14
+ warnings: EntityState<Warning>;
15
15
  isLoading: boolean;
16
16
  lastUpdatedTime: string;
17
17
  error?: PublicWarningError;
@@ -1,9 +1,9 @@
1
1
  import { CoreAppStore } from '@opengeoweb/store';
2
2
  import { DrawState } from './drawings/types';
3
- import { PublicWarningFormState } from './publicWarningForm/reducer';
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?: PublicWarningFormState;
7
+ publicWarningForm?: WarningFormState;
8
8
  publicWarnings?: PublicWarningsState;
9
9
  }
@@ -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 { PublicWarning } from '../store/publicWarningForm/types';
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
- getWarnings: () => Promise<{
21
- data: PublicWarning[];
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;