@opengeoweb/warnings 9.1.0 → 9.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/index.esm.js +4687 -2251
  2. package/package.json +1 -1
  3. package/src/index.d.ts +1 -0
  4. package/src/lib/components/ComponentsLookUp/ComponentsLookUp.d.ts +15 -0
  5. package/src/lib/components/ComponentsLookUp/index.d.ts +1 -0
  6. package/src/lib/components/DrawingTool/useObjectDrawDialogAction.d.ts +8 -1
  7. package/src/lib/components/DrawingToolForm/DrawingToolForm.d.ts +1 -0
  8. package/src/lib/components/PublicWarningList/PublicWarningList.d.ts +22 -0
  9. package/src/lib/components/PublicWarningList/PublicWarningList.spec.d.ts +1 -0
  10. package/src/lib/components/PublicWarningList/PublicWarningList.stories.d.ts +27 -0
  11. package/src/lib/components/PublicWarningList/PublicWarningListConnect.d.ts +3 -0
  12. package/src/lib/components/PublicWarningList/PublicWarningListConnect.integration.spec.d.ts +1 -0
  13. package/src/lib/components/PublicWarningList/PublicWarningListConnect.stories.d.ts +8 -0
  14. package/src/lib/components/PublicWarningList/index.d.ts +2 -0
  15. package/src/lib/components/PublicWarningsForm/{AreaField.d.ts → AreaField/AreaField.d.ts} +1 -0
  16. package/src/lib/components/PublicWarningsForm/AreaField/AreaField.spec.d.ts +1 -0
  17. package/src/lib/components/PublicWarningsForm/AreaField/index.d.ts +1 -0
  18. package/src/lib/components/PublicWarningsForm/DescriptionField/DescriptionField.d.ts +4 -0
  19. package/src/lib/components/PublicWarningsForm/DescriptionField/DescriptionField.spec.d.ts +1 -0
  20. package/src/lib/components/PublicWarningsForm/{DescriptionField.stories.d.ts → DescriptionField/DescriptionField.stories.d.ts} +8 -0
  21. package/src/lib/components/PublicWarningsForm/DescriptionField/index.d.ts +1 -0
  22. package/src/lib/components/PublicWarningsForm/{LevelField.d.ts → LevelField/LevelField.d.ts} +3 -1
  23. package/src/lib/components/PublicWarningsForm/LevelField/LevelField.spec.d.ts +1 -0
  24. package/src/lib/components/PublicWarningsForm/LevelField/index.d.ts +1 -0
  25. package/src/lib/components/PublicWarningsForm/{Phenomenon.d.ts → PhenomenonField/PhenomenonField.d.ts} +3 -1
  26. package/src/lib/components/PublicWarningsForm/PhenomenonField/index.d.ts +1 -0
  27. package/src/lib/components/PublicWarningsForm/PublicWarningsForm.d.ts +14 -9
  28. package/src/lib/components/PublicWarningsForm/PublicWarningsForm.stories.d.ts +6 -0
  29. package/src/lib/components/PublicWarningsForm/PublicWarningsFormConnect.stories.d.ts +7 -0
  30. package/src/lib/components/PublicWarningsForm/PublicWarningsFormConnectErrors.stories.d.ts +7 -0
  31. package/src/lib/components/PublicWarningsForm/ValidFromField/ValidFromField.d.ts +9 -0
  32. package/src/lib/components/PublicWarningsForm/ValidFromField/ValidFromField.spec.d.ts +1 -0
  33. package/src/lib/components/PublicWarningsForm/ValidFromField/index.d.ts +1 -0
  34. package/src/lib/components/PublicWarningsForm/ValidUntilField/ValidUntilField.d.ts +11 -0
  35. package/src/lib/components/PublicWarningsForm/ValidUntilField/ValidUntilField.spec.d.ts +1 -0
  36. package/src/lib/components/PublicWarningsForm/ValidUntilField/index.d.ts +1 -0
  37. package/src/lib/components/PublicWarningsFormDialog/PublicWarningsFormDialog.d.ts +4 -0
  38. package/src/lib/components/PublicWarningsFormDialog/PublicWarningsFormDialog.stories.d.ts +16 -0
  39. package/src/lib/components/PublicWarningsFormDialog/PublicWarningsFormDialogConnect.stories.d.ts +2 -1
  40. package/src/lib/store/config.d.ts +3 -0
  41. package/src/lib/store/drawings/reducer.d.ts +5 -1
  42. package/src/lib/store/drawings/selectors.d.ts +5 -0
  43. package/src/lib/store/drawings/types.d.ts +1 -0
  44. package/src/lib/store/publicWarningForm/reducer.d.ts +34 -4
  45. package/src/lib/store/publicWarningForm/sagas.d.ts +14 -0
  46. package/src/lib/store/publicWarningForm/sagas.spec.d.ts +1 -0
  47. package/src/lib/store/publicWarningForm/selectors.d.ts +25 -0
  48. package/src/lib/store/publicWarningForm/types.d.ts +9 -2
  49. package/src/lib/store/publicWarnings/reducer.d.ts +18 -0
  50. package/src/lib/store/publicWarnings/reducer.spec.d.ts +1 -0
  51. package/src/lib/store/publicWarnings/sagas.d.ts +5 -0
  52. package/src/lib/store/publicWarnings/sagas.spec.d.ts +1 -0
  53. package/src/lib/store/publicWarnings/selectors.d.ts +14 -0
  54. package/src/lib/store/publicWarnings/selectors.spec.d.ts +1 -0
  55. package/src/lib/store/publicWarnings/types.d.ts +11 -0
  56. package/src/lib/storybookUtils/storyComponents.d.ts +1 -3
  57. package/src/lib/storybookUtils/testUtils.d.ts +2 -0
  58. package/src/lib/utils/api.d.ts +6 -0
  59. package/src/lib/utils/constants.d.ts +1 -0
  60. package/src/lib/utils/fakeApi/index.d.ts +6 -0
  61. package/src/lib/components/PublicWarningsForm/DescriptionField.d.ts +0 -2
  62. /package/src/lib/components/{PublicWarningsForm/AreaField.spec.d.ts → ComponentsLookUp/ComponentsLookUp.spec.d.ts} +0 -0
  63. /package/src/lib/components/{PublicWarningsForm/DescriptionField.spec.d.ts → DrawingToolForm/DrawingToolFormConnect.integration.spec.d.ts} +0 -0
  64. /package/src/lib/{WarningsErrors.stories.d.ts → components/ObjectManager/ObjectManagerConnectErrors.stories.d.ts} +0 -0
  65. /package/src/lib/components/PublicWarningsForm/{AreaField.stories.d.ts → AreaField/AreaField.stories.d.ts} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/warnings",
3
- "version": "9.1.0",
3
+ "version": "9.3.0",
4
4
  "description": "GeoWeb warinings library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
package/src/index.d.ts CHANGED
@@ -3,4 +3,5 @@ export * from './lib/components/WarningsModuleProvider';
3
3
  export * from './lib/components/DrawingTool';
4
4
  export * from './lib/components/DrawingToolForm';
5
5
  export * from './lib/components/PublicWarningsFormDialog';
6
+ export * from './lib/components/ComponentsLookUp';
6
7
  export * from './lib/store/config';
@@ -0,0 +1,15 @@
1
+ import * as React from 'react';
2
+ import { ApiModule, ApiUrls } from '@opengeoweb/api';
3
+ type WarningListComponentType = 'WarningList';
4
+ export interface ComponentsLookUpPayload {
5
+ componentType: WarningListComponentType;
6
+ id: string;
7
+ title?: string;
8
+ initialProps: Record<string, never>;
9
+ }
10
+ export interface ApiModuleProps extends ApiModule {
11
+ config: ApiUrls;
12
+ }
13
+ export declare const PublicWarningApiWrapper: React.FC<ApiModuleProps>;
14
+ export declare const componentsLookUp: (payload: ComponentsLookUpPayload, apiProps?: ApiModuleProps) => React.ReactElement;
15
+ export {};
@@ -0,0 +1 @@
1
+ export * from './ComponentsLookUp';
@@ -1,9 +1,16 @@
1
1
  import { uiTypes } from '@opengeoweb/store';
2
+ export declare const confirmationDialogOptions: {
3
+ cancelLabel: string;
4
+ title: string;
5
+ description: string;
6
+ confirmLabel: string;
7
+ catchOnCancel: boolean;
8
+ };
2
9
  export declare const useCloseDrawDialog: ({ mapId, source, }: {
3
10
  mapId: string;
4
11
  source?: uiTypes.Source | undefined;
5
12
  }) => {
6
- closeDrawDialog: () => void;
13
+ closeDrawDialog: (skipConfirmationDialog?: boolean) => void;
7
14
  };
8
15
  export declare const useCloseObjectDialog: ({ mapId, source, }: {
9
16
  mapId: string;
@@ -28,6 +28,7 @@ export interface DrawingToolFormComponentProps {
28
28
  geoJSONProperties: GeoJSON.GeoJsonProperties;
29
29
  onChangeProperties: (properties: GeoJSON.GeoJsonProperties) => void;
30
30
  onChangeName: (name: string) => void;
31
+ onFormDirty?: (isFormDirty: boolean) => void;
31
32
  geoJSON: FeatureCollection<Geometry, GeoJsonProperties> | undefined;
32
33
  }
33
34
  declare const Wrapper: React.FC<DrawingToolFormComponentProps>;
@@ -0,0 +1,22 @@
1
+ import { GridProps } from '@mui/material';
2
+ import React from 'react';
3
+ import { PublicWarning, PublicWarningStatus } from '../../store/publicWarningForm/types';
4
+ export declare const CREATE_WARNING = "Create a warning";
5
+ export declare const BUTTON_EDIT = "Edit";
6
+ export declare const BUTTON_OPTIONS = "Options";
7
+ export declare const WarningListColumnContent: React.FC<GridProps & {
8
+ title?: string;
9
+ status: PublicWarningStatus;
10
+ children?: React.ReactNode;
11
+ width?: number;
12
+ }>;
13
+ export declare const PublicWarningList: React.FC<{
14
+ warnings: PublicWarning[];
15
+ isLoading?: boolean;
16
+ error?: Error;
17
+ onSelectWarning?: (warning: PublicWarning) => void;
18
+ onEditWarning?: (warning: PublicWarning) => void;
19
+ onCreateWarning?: () => void;
20
+ selectedPublicWarningId?: string;
21
+ }>;
22
+ export default PublicWarningList;
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ declare const _default: {
3
+ title: string;
4
+ };
5
+ export default _default;
6
+ export declare const PublicWarningListLight: {
7
+ (): React.ReactElement;
8
+ storyName: string;
9
+ parameters: {
10
+ zeplinLink: {
11
+ name: string;
12
+ link: string;
13
+ }[];
14
+ };
15
+ };
16
+ export declare const PublicWarningListDark: {
17
+ (): React.ReactElement;
18
+ storyName: string;
19
+ parameters: {
20
+ zeplinLink: {
21
+ name: string;
22
+ link: string;
23
+ }[];
24
+ };
25
+ };
26
+ export declare const PublicWarningListError: () => React.ReactElement;
27
+ export declare const PublicWarningListLoading: () => React.ReactElement;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare const PublicWarningListConnect: React.FC;
3
+ export default PublicWarningListConnect;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ declare const _default: {
3
+ title: string;
4
+ };
5
+ export default _default;
6
+ export declare const PublicWarningListLight: () => React.ReactElement;
7
+ export declare const PublicWarningListDark: () => React.ReactElement;
8
+ export declare const PublicWarningListError: () => React.ReactElement;
@@ -0,0 +1,2 @@
1
+ export * from './PublicWarningList';
2
+ export * from './PublicWarningListConnect';
@@ -6,6 +6,7 @@ export declare const BUTTON_VIEW = "View";
6
6
  export declare const BUTTON_EDIT = "Edit";
7
7
  export declare const OBJECTS_MENU = "Object options";
8
8
  export declare const NO_OBJECT = "(no object selected)";
9
+ export declare const OBJECT_SELECTED = "object selected";
9
10
  export declare const formatDate: (lastUpdatedTime: string) => string;
10
11
  export declare const AreaField: React.FC<{
11
12
  onEditObject: () => void;
@@ -0,0 +1 @@
1
+ export * from './AreaField';
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ export declare const DescriptionField: React.FC<{
3
+ isDisabled?: boolean;
4
+ }>;
@@ -11,3 +11,11 @@ export declare const DescriptionFieldDark: {
11
11
  (): React.ReactElement;
12
12
  storyName: string;
13
13
  };
14
+ export declare const DescriptionFieldDisabledLight: {
15
+ (): React.ReactElement;
16
+ storyName: string;
17
+ };
18
+ export declare const DescriptionFieldDisabledDark: {
19
+ (): React.ReactElement;
20
+ storyName: string;
21
+ };
@@ -0,0 +1 @@
1
+ export * from './DescriptionField';
@@ -6,4 +6,6 @@ export declare const levelOptions: {
6
6
  color: string;
7
7
  textColor: string;
8
8
  }[];
9
- export declare const LevelField: React.FC;
9
+ export declare const LevelField: React.FC<{
10
+ isDisabled?: boolean;
11
+ }>;
@@ -0,0 +1 @@
1
+ export * from './LevelField';
@@ -5,4 +5,6 @@ export declare const warningPhenomena: {
5
5
  key: string;
6
6
  icon: React.JSX.Element;
7
7
  }[];
8
- export declare const Phenomenon: React.FC;
8
+ export declare const Phenomenon: React.FC<{
9
+ isDisabled?: boolean;
10
+ }>;
@@ -0,0 +1 @@
1
+ export * from './PhenomenonField';
@@ -1,23 +1,28 @@
1
1
  import * as React from 'react';
2
2
  import { PublicWarningDetail } from '../../store/publicWarningForm/types';
3
- import { DrawingListItem } from '../../store/drawings/types';
3
+ import { BaseDrawingListItem, DrawingListItem } from '../../store/drawings/types';
4
+ import { FormAction } from '../../store/publicWarningForm/reducer';
4
5
  export declare const getEmptyPublicWarning: () => PublicWarningDetail;
5
6
  export declare const getFormData: (publicWarningsDetails: PublicWarningDetail | undefined, object?: DrawingListItem) => PublicWarningDetail;
6
- export declare const LABEL_VALID_FROM = "Valid from";
7
- export declare const LABEL_VALID_UNTIL = "Valid until";
8
7
  export declare const LABEL_PROBABILITY = "Probability";
9
8
  export declare const BUTTON_CLEAR = "Clear";
10
9
  export declare const BUTTON_SAVE = "Save";
10
+ export declare const BUTTON_SAVING = "Saving";
11
11
  export declare const BUTTON_PUBLISH = "Publish";
12
- export declare const dateFormat = "DD/MM/YYYY HH:mm";
12
+ export declare const BUTTON_PUBLISHING = "Publishing";
13
+ interface FormData extends PublicWarningDetail {
14
+ IS_DRAFT?: boolean;
15
+ object?: BaseDrawingListItem;
16
+ 'translation-select'?: string;
17
+ }
18
+ export declare const prepareFormValues: (data: FormData) => PublicWarningDetail;
13
19
  interface FormProps {
14
- isDisabled?: boolean;
20
+ formAction?: FormAction;
15
21
  onSaveForm?: (formValues: PublicWarningDetail) => void;
16
22
  onPublishForm?: (formValues: PublicWarningDetail) => void;
17
- }
18
- interface PublicWarningsFormProps extends FormProps {
19
- publicWarningDetails?: PublicWarningDetail;
20
23
  object?: DrawingListItem;
24
+ publicWarningDetails?: PublicWarningDetail;
25
+ error?: string;
21
26
  }
22
- export declare const PublicWarningsForm: React.FC<PublicWarningsFormProps>;
27
+ export declare const PublicWarningsForm: React.FC<FormProps>;
23
28
  export {};
@@ -19,3 +19,9 @@ export declare const PublicWarningsEmptyFormDemoDark: {
19
19
  (): React.ReactElement;
20
20
  storyName: string;
21
21
  };
22
+ export declare const PublicWarningsSavingFormDemo: () => React.ReactElement;
23
+ export declare const PublicWarningsSavingFormDemoDark: () => React.ReactElement;
24
+ export declare const PublicWarningsErrorFormDemo: () => React.ReactElement;
25
+ export declare const PublicWarningsErrorFormDemoDark: () => React.ReactElement;
26
+ export declare const PublicWarningsReadOnlyFormDemo: () => React.ReactElement;
27
+ export declare const PublicWarningsReadOnlyFormDemoDark: () => React.ReactElement;
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ declare const _default: {
3
+ title: string;
4
+ };
5
+ export default _default;
6
+ export declare const PublicWarningsFormConnectDemo: () => React.ReactElement;
7
+ export declare const PublicWarningsFormConnectDemoWithValues: () => React.ReactElement;
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ declare const _default: {
3
+ title: string;
4
+ };
5
+ export default _default;
6
+ export declare const SaveError: () => React.ReactElement;
7
+ export declare const PublishError: () => React.ReactElement;
@@ -0,0 +1,9 @@
1
+ import * as React from 'react';
2
+ export declare const LABEL_VALID_FROM = "Valid from";
3
+ export declare const VALID_FROM_ERROR_BEFORE_CURRENT = "Valid from time cannot be before current time";
4
+ export declare const VALID_FROM_ERROR_AFTER_CURRENT: string;
5
+ export declare const isValueBeforeCurrentTime: (value: string) => boolean | string;
6
+ export declare const isMaxHoursAfterCurrentTime: (value: string) => boolean | string;
7
+ export declare const ValidFrom: React.FC<{
8
+ isDisabled?: boolean;
9
+ }>;
@@ -0,0 +1 @@
1
+ export * from './ValidFromField';
@@ -0,0 +1,11 @@
1
+ import * as React from 'react';
2
+ export declare const LABEL_VALID_UNTIL = "Valid until";
3
+ export declare const VALID_UNTIL_ERROR_BEFORE_CURRENT = "Valid until time cannot be before current time";
4
+ export declare const VALID_UNTIL_ERROR_AFTER_CURRENT: string;
5
+ export declare const VALID_UNTIL_ERROR_AFTER_VALID_FROM: string;
6
+ export declare const isValueBeforeCurrentTime: (value: string) => boolean | string;
7
+ export declare const isMaxHoursAfterCurrentTime: (value: string) => boolean | string;
8
+ export declare const isMinHoursAfterValidFrom: (value: string, validFromValue: string) => boolean | string;
9
+ export declare const ValidUntil: React.FC<{
10
+ isDisabled?: boolean;
11
+ }>;
@@ -0,0 +1 @@
1
+ export * from './ValidUntilField';
@@ -15,4 +15,8 @@ export declare const PublicWarningsFormDialog: React.FC<{
15
15
  setFocused?: (focused: boolean) => void;
16
16
  headerSize?: HeaderSize;
17
17
  children: React.ReactNode;
18
+ isLoading?: boolean;
19
+ isReadOnly?: boolean;
20
+ onChangeFormMode?: (isReadOnly: boolean) => void;
21
+ shouldHideFormMode?: boolean;
18
22
  }>;
@@ -31,3 +31,19 @@ export declare const PublicWarningsDarkBig: {
31
31
  (): React.ReactElement;
32
32
  storyName: string;
33
33
  };
34
+ export declare const PublicWarningsFormDialogLightBigError: {
35
+ (): React.ReactElement;
36
+ storyName: string;
37
+ };
38
+ export declare const PublicWarningsFormDialogDarkBigError: {
39
+ (): React.ReactElement;
40
+ storyName: string;
41
+ };
42
+ export declare const PublicWarningsFormDialogLightReadOnly: {
43
+ (): React.ReactElement;
44
+ storyName: string;
45
+ };
46
+ export declare const PublicWarningsFormDialogDarkReadOnly: {
47
+ (): React.ReactElement;
48
+ storyName: string;
49
+ };
@@ -3,4 +3,5 @@ declare const _default: {
3
3
  title: string;
4
4
  };
5
5
  export default _default;
6
- export declare const PublicWarningsMap: () => React.ReactElement;
6
+ export declare const PublicWarningsFormDialogConnectMap: () => React.ReactElement;
7
+ export declare const PublicWarningsFormDialogConnectWithoutMap: () => React.ReactElement;
@@ -2,15 +2,18 @@ import { CoreAppStore } from '@opengeoweb/store';
2
2
  import drawingSagas from './drawings/sagas';
3
3
  import { DrawState } from './drawings/types';
4
4
  import { PublicWarningFormState } from './publicWarningForm/reducer';
5
+ import { PublicWarningsState } from './publicWarnings/types';
5
6
  export interface WarningModuleStore extends CoreAppStore {
6
7
  drawings?: DrawState;
7
8
  publicWarningForm?: PublicWarningFormState;
9
+ publicWarnings?: PublicWarningsState;
8
10
  }
9
11
  export declare const drawingModuleConfig: {
10
12
  id: string;
11
13
  reducersMap: {
12
14
  drawings: import("redux").Reducer<DrawState, import("redux").AnyAction>;
13
15
  publicWarningForm: import("redux").Reducer<PublicWarningFormState, import("redux").AnyAction>;
16
+ publicWarnings: import("redux").Reducer<PublicWarningsState, import("redux").AnyAction>;
14
17
  };
15
18
  sagas: (typeof drawingSagas)[];
16
19
  };
@@ -6,4 +6,8 @@ export declare const reducer: import("redux").Reducer<DrawState, import("redux")
6
6
  export declare const drawActions: import("@reduxjs/toolkit").CaseReducerActions<{
7
7
  setDrawValues: (draft: Draft<DrawState>, action: PayloadAction<SetDrawValuesPayload>) => void;
8
8
  submitDrawValues: (draft: Draft<DrawState>, action: PayloadAction<SubmitDrawValuesPayload>) => void;
9
- }, "draw">;
9
+ setFormDirty: (draft: Draft<DrawState>, action: PayloadAction<{
10
+ drawingInstanceId: string;
11
+ isFormDirty: boolean;
12
+ }>) => void;
13
+ }, "drawingForm">;
@@ -2,3 +2,8 @@ import { DrawState } from './types';
2
2
  import { WarningModuleStore } from '../config';
3
3
  export declare const getDrawStore: (store: WarningModuleStore) => DrawState;
4
4
  export declare const selectDrawByInstanceId: (state: WarningModuleStore, id: import("@reduxjs/toolkit").EntityId) => import("./types").DrawItem | undefined;
5
+ export declare const getWarningFormDirty: ((state: WarningModuleStore, id: import("@reduxjs/toolkit").EntityId) => boolean) & import("reselect").OutputSelectorFields<(args_0: import("./types").DrawItem | undefined) => boolean, {
6
+ clearCache: () => void;
7
+ }> & {
8
+ clearCache: () => void;
9
+ };
@@ -3,6 +3,7 @@ export interface DrawItem {
3
3
  id: string;
4
4
  objectName: string;
5
5
  drawingInstanceId: string;
6
+ isFormDirty?: boolean;
6
7
  }
7
8
  export type DrawState = EntityState<DrawItem>;
8
9
  export type DrawingScope = 'user' | 'global';
@@ -1,14 +1,44 @@
1
1
  import { PayloadAction, Draft } from '@reduxjs/toolkit';
2
2
  import { DrawingListItem } from '../drawings/types';
3
- import { PublicWarning } from './types';
3
+ import { PublicWarning, PublicWarningDetail, PublicWarningStatus } from './types';
4
+ export type FormAction = '' | 'saving' | 'publishing' | 'readonly';
4
5
  export interface PublicWarningFormState {
5
6
  object?: DrawingListItem;
6
- publicWarning?: PublicWarning;
7
+ publicWarningDetail?: PublicWarningDetail;
8
+ status?: PublicWarningStatus;
9
+ formState?: FormAction;
10
+ error?: string;
11
+ selectedPublicWarningId?: string;
7
12
  }
8
13
  export declare const initialState: PublicWarningFormState;
9
14
  export declare const reducer: import("redux").Reducer<PublicWarningFormState, import("redux").AnyAction>;
10
- export declare const publicWarningActions: import("@reduxjs/toolkit").CaseReducerActions<{
15
+ export declare const publicWarningFormActions: import("@reduxjs/toolkit").CaseReducerActions<{
11
16
  setFormValues: (draft: Draft<PublicWarningFormState>, action: PayloadAction<{
12
- object: DrawingListItem;
17
+ object?: DrawingListItem;
18
+ publicWarningDetail?: PublicWarningDetail;
19
+ formState?: FormAction;
20
+ }>) => void;
21
+ openPublicWarningFormDialog: (draft: Draft<PublicWarningFormState>, action: PayloadAction<{
22
+ object?: DrawingListItem;
23
+ publicWarningDetail?: PublicWarningDetail;
24
+ formState?: FormAction;
25
+ status?: PublicWarningStatus;
26
+ }>) => void;
27
+ publishWarning: (draft: Draft<PublicWarningFormState>, action: PayloadAction<{
28
+ publicWarning: PublicWarning;
29
+ }>) => void;
30
+ publishWarningSuccess: (draft: Draft<PublicWarningFormState>, action: PayloadAction<{
31
+ publicWarning: PublicWarning;
32
+ message: string;
33
+ }>) => void;
34
+ saveWarning: (draft: Draft<PublicWarningFormState>, action: PayloadAction<{
35
+ publicWarning: PublicWarning;
36
+ }>) => void;
37
+ saveWarningSuccess: (draft: Draft<PublicWarningFormState>, action: PayloadAction<{
38
+ publicWarning: PublicWarning;
39
+ message: string;
40
+ }>) => void;
41
+ setFormError: (draft: Draft<PublicWarningFormState>, action: PayloadAction<{
42
+ error: string;
13
43
  }>) => void;
14
44
  }, "publicWarningForm">;
@@ -0,0 +1,14 @@
1
+ import { SagaIterator } from 'redux-saga';
2
+ import { publicWarningFormActions } from './reducer';
3
+ import { PublicWarning } from './types';
4
+ export declare const PUBLISH_SUCCES = "Public warning has succesfully been published!";
5
+ export declare const SAVE_SUCCES = "Public warning has succesfully been saved!";
6
+ export declare function saveOrUpdateWarning(publicWarning: PublicWarning): SagaIterator<PublicWarning>;
7
+ export declare function publishWarningSaga({ payload, }: ReturnType<typeof publicWarningFormActions.publishWarning>): SagaIterator;
8
+ export declare function saveWarningSaga({ payload, }: ReturnType<typeof publicWarningFormActions.saveWarning>): SagaIterator;
9
+ export declare function successSaga({ payload, }: ReturnType<typeof publicWarningFormActions.publishWarningSuccess | typeof publicWarningFormActions.saveWarningSuccess>): SagaIterator;
10
+ export declare function errorSaga(message: string): SagaIterator;
11
+ export declare function toggleDialogLoadingSaga(isLoading: boolean): SagaIterator;
12
+ export declare function openDialogSaga(): SagaIterator;
13
+ declare function publicWarningRootSaga(): SagaIterator;
14
+ export default publicWarningRootSaga;
@@ -0,0 +1 @@
1
+ export {};
@@ -6,3 +6,28 @@ export declare const getPublicWarningObject: ((state: WarningModuleStore) => imp
6
6
  }> & {
7
7
  clearCache: () => void;
8
8
  };
9
+ export declare const getPublicWarning: ((state: WarningModuleStore) => import("./types").PublicWarningDetail | undefined) & import("reselect").OutputSelectorFields<(args_0: PublicWarningFormState) => import("./types").PublicWarningDetail | undefined, {
10
+ clearCache: () => void;
11
+ }> & {
12
+ clearCache: () => void;
13
+ };
14
+ export declare const getPublicWarningStatus: ((state: WarningModuleStore) => import("./types").PublicWarningStatus | undefined) & import("reselect").OutputSelectorFields<(args_0: PublicWarningFormState) => import("./types").PublicWarningStatus | undefined, {
15
+ clearCache: () => void;
16
+ }> & {
17
+ clearCache: () => void;
18
+ };
19
+ export declare const getPublicWarningFormState: ((state: WarningModuleStore) => "" | "saving" | "publishing" | "readonly") & import("reselect").OutputSelectorFields<(args_0: PublicWarningFormState) => "" | "saving" | "publishing" | "readonly", {
20
+ clearCache: () => void;
21
+ }> & {
22
+ clearCache: () => void;
23
+ };
24
+ export declare const getPublicWarningFormError: ((state: WarningModuleStore) => string) & import("reselect").OutputSelectorFields<(args_0: PublicWarningFormState) => string, {
25
+ clearCache: () => void;
26
+ }> & {
27
+ clearCache: () => void;
28
+ };
29
+ export declare const getSelectedPublicWarningId: ((state: WarningModuleStore) => string) & import("reselect").OutputSelectorFields<(args_0: PublicWarningFormState) => string, {
30
+ clearCache: () => void;
31
+ }> & {
32
+ clearCache: () => void;
33
+ };
@@ -1,15 +1,22 @@
1
1
  export type PublicWarningDetail = {
2
2
  id: string;
3
3
  phenomenon: string;
4
- geoJSON?: GeoJSON.FeatureCollection;
4
+ geoJSON: GeoJSON.FeatureCollection;
5
5
  validFrom: string;
6
6
  validUntil: string;
7
7
  level: string;
8
8
  probability: number;
9
9
  descriptionOriginal: string;
10
10
  descriptionTranslation: string;
11
+ domain?: string;
12
+ warningProposalSource?: string;
13
+ authority?: string;
14
+ type?: number;
11
15
  };
16
+ export type PublicWarningStatus = 'DRAFT' | 'PUBLISHED' | 'TODO' | 'EXPIRED';
12
17
  export type PublicWarning = {
13
- status: 'DRAFT' | 'PUBLISH';
18
+ status: PublicWarningStatus;
14
19
  warningDetail: PublicWarningDetail;
20
+ id?: string;
21
+ lastUpdatedTime?: string;
15
22
  };
@@ -0,0 +1,18 @@
1
+ import { PayloadAction, Draft } from '@reduxjs/toolkit';
2
+ import { PublicWarningsState } from './types';
3
+ import { PublicWarning } from '../publicWarningForm/types';
4
+ export declare const publicWarningsAdapter: import("@reduxjs/toolkit").EntityAdapter<PublicWarning>;
5
+ export declare const initialState: PublicWarningsState;
6
+ export declare const reducer: import("redux").Reducer<PublicWarningsState, import("redux").AnyAction>;
7
+ export declare const publicWarningActions: import("@reduxjs/toolkit").CaseReducerActions<{
8
+ fetchWarnings: (draft: Draft<PublicWarningsState>) => void;
9
+ fetchWarningsSuccess: (draft: Draft<PublicWarningsState>, action: PayloadAction<{
10
+ warnings: PublicWarning[];
11
+ }>) => void;
12
+ fetchWarningsError: (draft: Draft<PublicWarningsState>, action: PayloadAction<{
13
+ error: {
14
+ name: string;
15
+ message: string;
16
+ };
17
+ }>) => void;
18
+ }, "publicWarnings">;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ import { SagaIterator } from 'redux-saga';
2
+ export declare function fetchWarningsSaga(): SagaIterator;
3
+ export declare function refetchWarnings(): SagaIterator;
4
+ declare function publicWarnings(): SagaIterator;
5
+ export default publicWarnings;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,14 @@
1
+ import { PublicWarningsState } from './types';
2
+ import { WarningModuleStore } from '../config';
3
+ export declare const getPublicWarningsStore: (store: WarningModuleStore) => PublicWarningsState;
4
+ export declare const selectAllPublicWarnings: (state: WarningModuleStore) => import("../publicWarningForm/types").PublicWarning[];
5
+ export declare const isPublicWarningsLoading: ((state: WarningModuleStore) => boolean) & import("reselect").OutputSelectorFields<(args_0: PublicWarningsState) => boolean, {
6
+ clearCache: () => void;
7
+ }> & {
8
+ clearCache: () => void;
9
+ };
10
+ export declare const getPublicWarningsError: ((state: WarningModuleStore) => import("./types").PublicWarningError | undefined) & import("reselect").OutputSelectorFields<(args_0: PublicWarningsState) => import("./types").PublicWarningError | undefined, {
11
+ clearCache: () => void;
12
+ }> & {
13
+ clearCache: () => void;
14
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ import { EntityState } from '@reduxjs/toolkit';
2
+ import { PublicWarning } from '../publicWarningForm/types';
3
+ export type PublicWarningError = {
4
+ name: string;
5
+ message: string;
6
+ };
7
+ export type PublicWarningsState = {
8
+ warnings: EntityState<PublicWarning>;
9
+ isLoading: boolean;
10
+ error?: PublicWarningError;
11
+ };
@@ -1,8 +1,6 @@
1
1
  import React from 'react';
2
2
  import { uiTypes } from '@opengeoweb/store';
3
- export declare const AppHamburgerMenu: React.FC<{
4
- mapId: string;
5
- }>;
3
+ export declare const AppHamburgerMenu: React.FC;
6
4
  export declare const MapWithWarnings: React.FC<{
7
5
  mapId: string;
8
6
  dialogType?: uiTypes.DialogType;
@@ -1 +1,3 @@
1
1
  export declare const testGeoJSON: GeoJSON.FeatureCollection;
2
+ export declare function fakeErrorRequest<ReturnType>(error: string): Promise<ReturnType>;
3
+ export declare const fakePostError = "2 validation errors for Request\nbody -> warningDetail -> phenomenon\n value is not a valid enumeration member; permitted: 'wind', 'fog', 'thunderstorm', 'snowIce', 'rain', 'highTemp', 'funnelCloud', 'lowTemp', 'coastalEvent' (type=type_error.enum; enum_values=[<PhenomenonEnum.WIND: 'wind'>, <PhenomenonEnum.FOG: 'fog'>, <PhenomenonEnum.THUNDERSTORM: 'thunderstorm'>, <PhenomenonEnum.SNOW_ICE: 'snowIce'>, <PhenomenonEnum.RAIN: 'rain'>, <PhenomenonEnum.HIGH_TEMP: 'highTemp'>, <PhenomenonEnum.FUNNEL_CLD: 'funnelCloud'>, <PhenomenonEnum.LOW_TEMP: 'lowTemp'>, <PhenomenonEnum.COASTAL_EVENT: 'coastalEvent'>])\nbody -> warningDetail -> level\n value is not a valid enumeration member; permitted: 'moderate', 'severe', 'extreme' (type=type_error.enum; enum_values=[<LevelEnum.MODERATE: 'moderate'>, <LevelEnum.SEVERE: 'severe'>, <LevelEnum.EXTREME: 'extreme'>])";