@opengeoweb/warnings 9.0.0 → 9.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 +5212 -2522
- package/package.json +1 -1
- package/src/index.d.ts +2 -1
- package/src/lib/components/ComponentsLookUp/ComponentsLookUp.d.ts +15 -0
- package/src/lib/components/ComponentsLookUp/index.d.ts +1 -0
- package/src/lib/components/DrawingTool/useObjectDrawDialogAction.d.ts +8 -1
- package/src/lib/components/DrawingToolForm/DrawingToolForm.d.ts +1 -0
- package/src/lib/components/ObjectManager/ObjectManager.stories.d.ts +4 -0
- package/src/lib/components/PublicWarningList/PublicWarningList.d.ts +21 -0
- package/src/lib/components/PublicWarningList/PublicWarningList.stories.d.ts +27 -0
- package/src/lib/components/PublicWarningList/PublicWarningListConnect.d.ts +3 -0
- package/src/lib/components/PublicWarningList/PublicWarningListConnect.spec.d.ts +1 -0
- package/src/lib/components/PublicWarningList/PublicWarningListConnect.stories.d.ts +8 -0
- package/src/lib/components/PublicWarningList/index.d.ts +2 -0
- package/src/lib/components/PublicWarningsForm/{AreaField.d.ts → AreaField/AreaField.d.ts} +2 -4
- package/src/lib/components/PublicWarningsForm/AreaField/AreaField.spec.d.ts +1 -0
- package/src/lib/components/PublicWarningsForm/AreaField/index.d.ts +1 -0
- package/src/lib/components/PublicWarningsForm/DescriptionField/DescriptionField.d.ts +4 -0
- package/src/lib/components/PublicWarningsForm/DescriptionField/DescriptionField.spec.d.ts +1 -0
- package/src/lib/components/PublicWarningsForm/{DescriptionField.stories.d.ts → DescriptionField/DescriptionField.stories.d.ts} +8 -0
- package/src/lib/components/PublicWarningsForm/DescriptionField/index.d.ts +1 -0
- package/src/lib/components/PublicWarningsForm/LevelField/LevelField.d.ts +9 -0
- package/src/lib/components/PublicWarningsForm/LevelField/index.d.ts +1 -0
- package/src/lib/components/PublicWarningsForm/PhenomenonField/PhenomenonField.d.ts +10 -0
- package/src/lib/components/PublicWarningsForm/PhenomenonField/index.d.ts +1 -0
- package/src/lib/components/PublicWarningsForm/PublicWarningsForm.d.ts +19 -18
- package/src/lib/components/PublicWarningsForm/PublicWarningsForm.stories.d.ts +4 -0
- package/src/lib/components/PublicWarningsForm/PublicWarningsFormConnect.stories.d.ts +7 -0
- package/src/lib/components/PublicWarningsForm/PublicWarningsFormConnectErrors.stories.d.ts +7 -0
- package/src/lib/components/PublicWarningsForm/ValidFromField/ValidFromField.d.ts +9 -0
- package/src/lib/components/PublicWarningsForm/ValidFromField/ValidFromField.spec.d.ts +1 -0
- package/src/lib/components/PublicWarningsForm/ValidFromField/index.d.ts +1 -0
- package/src/lib/components/PublicWarningsForm/ValidUntilField/ValidUntilField.d.ts +11 -0
- package/src/lib/components/PublicWarningsForm/ValidUntilField/ValidUntilField.spec.d.ts +1 -0
- package/src/lib/components/PublicWarningsForm/ValidUntilField/index.d.ts +1 -0
- package/src/lib/components/{PublicWarnings/PublicWarnings.d.ts → PublicWarningsFormDialog/PublicWarningsFormDialog.d.ts} +2 -1
- package/src/lib/components/PublicWarningsFormDialog/PublicWarningsFormDialog.spec.d.ts +1 -0
- package/src/lib/components/{PublicWarnings/PublicWarnings.stories.d.ts → PublicWarningsFormDialog/PublicWarningsFormDialog.stories.d.ts} +11 -3
- package/src/lib/components/{PublicWarnings/PublicWarningsConnect.d.ts → PublicWarningsFormDialog/PublicWarningsFormDialogConnect.d.ts} +1 -1
- package/src/lib/components/PublicWarningsFormDialog/PublicWarningsFormDialogConnect.spec.d.ts +1 -0
- package/src/lib/components/PublicWarningsFormDialog/PublicWarningsFormDialogConnect.stories.d.ts +7 -0
- package/src/lib/components/PublicWarningsFormDialog/index.d.ts +2 -0
- package/src/lib/store/drawings/reducer.d.ts +5 -1
- package/src/lib/store/drawings/selectors.d.ts +5 -0
- package/src/lib/store/drawings/types.d.ts +1 -11
- package/src/lib/store/publicWarningForm/reducer.d.ts +32 -4
- package/src/lib/store/publicWarningForm/sagas.d.ts +14 -0
- package/src/lib/store/publicWarningForm/sagas.spec.d.ts +1 -0
- package/src/lib/store/publicWarningForm/selectors.d.ts +21 -1
- package/src/lib/store/publicWarningForm/types.d.ts +22 -0
- package/src/lib/storybookUtils/storyComponents.d.ts +1 -3
- package/src/lib/storybookUtils/testUtils.d.ts +2 -0
- package/src/lib/utils/api.d.ts +6 -0
- package/src/lib/utils/constants.d.ts +1 -0
- package/src/lib/utils/fakeApi/index.d.ts +6 -0
- package/src/lib/components/PublicWarnings/PublicWarningsConnect.stories.d.ts +0 -6
- package/src/lib/components/PublicWarnings/index.d.ts +0 -2
- package/src/lib/components/PublicWarningsForm/DescriptionField.d.ts +0 -2
- /package/src/lib/components/{PublicWarnings/PublicWarnings.spec.d.ts → ComponentsLookUp/ComponentsLookUp.spec.d.ts} +0 -0
- /package/src/lib/components/{PublicWarnings/PublicWarningsConnect.spec.d.ts → DrawingToolForm/DrawingToolFormConnect.integration.spec.d.ts} +0 -0
- /package/src/lib/{WarningsErrors.stories.d.ts → components/ObjectManager/ObjectManagerConnectErrors.stories.d.ts} +0 -0
- /package/src/lib/components/{PublicWarningsForm/AreaField.spec.d.ts → PublicWarningList/PublicWarningList.spec.d.ts} +0 -0
- /package/src/lib/components/{PublicWarningsForm/DescriptionField.spec.d.ts → PublicWarningList/PublicWarningListConnect.integration.spec.d.ts} +0 -0
- /package/src/lib/components/PublicWarningsForm/{AreaField.stories.d.ts → AreaField/AreaField.stories.d.ts} +0 -0
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -2,5 +2,6 @@ export * from './lib/components/ObjectManager';
|
|
|
2
2
|
export * from './lib/components/WarningsModuleProvider';
|
|
3
3
|
export * from './lib/components/DrawingTool';
|
|
4
4
|
export * from './lib/components/DrawingToolForm';
|
|
5
|
-
export * from './lib/components/
|
|
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,21 @@
|
|
|
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
|
+
onCreateWarning?: () => void;
|
|
19
|
+
selectedPublicWarningId?: string;
|
|
20
|
+
}>;
|
|
21
|
+
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 @@
|
|
|
1
|
+
export {};
|
|
@@ -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;
|
|
@@ -5,7 +5,8 @@ export declare const BUTTON_DELETE = "Delete";
|
|
|
5
5
|
export declare const BUTTON_VIEW = "View";
|
|
6
6
|
export declare const BUTTON_EDIT = "Edit";
|
|
7
7
|
export declare const OBJECTS_MENU = "Object options";
|
|
8
|
-
export declare const NO_OBJECT = "
|
|
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;
|
|
@@ -13,7 +14,4 @@ export declare const AreaField: React.FC<{
|
|
|
13
14
|
onDeleteObject: () => void;
|
|
14
15
|
onAddObject: () => void;
|
|
15
16
|
isDisabled?: boolean;
|
|
16
|
-
id?: string;
|
|
17
|
-
lastUpdatedTime?: string;
|
|
18
|
-
objectName?: string;
|
|
19
17
|
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AreaField';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './LevelField';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare const LABEL_PHENOMENON = "Phenomenon";
|
|
3
|
+
export declare const warningPhenomena: {
|
|
4
|
+
title: string;
|
|
5
|
+
key: string;
|
|
6
|
+
icon: React.JSX.Element;
|
|
7
|
+
}[];
|
|
8
|
+
export declare const Phenomenon: React.FC<{
|
|
9
|
+
isDisabled?: boolean;
|
|
10
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './PhenomenonField';
|
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const LABEL_VALID_UNTIL = "Valid until";
|
|
7
|
-
export declare const LABEL_CURRENT = "Current";
|
|
8
|
-
export declare const LABEL_EARLY = "Early";
|
|
9
|
-
export declare const LABEL_LEVEL = "Level";
|
|
2
|
+
import { PublicWarningDetail } from '../../store/publicWarningForm/types';
|
|
3
|
+
import { BaseDrawingListItem, DrawingListItem } from '../../store/drawings/types';
|
|
4
|
+
export declare const getEmptyPublicWarning: () => PublicWarningDetail;
|
|
5
|
+
export declare const getFormData: (publicWarningsDetails: PublicWarningDetail | undefined, object?: DrawingListItem) => PublicWarningDetail;
|
|
10
6
|
export declare const LABEL_PROBABILITY = "Probability";
|
|
11
7
|
export declare const BUTTON_CLEAR = "Clear";
|
|
12
8
|
export declare const BUTTON_SAVE = "Save";
|
|
9
|
+
export declare const BUTTON_SAVING = "Saving";
|
|
13
10
|
export declare const BUTTON_PUBLISH = "Publish";
|
|
14
|
-
export declare const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
icon: React.JSX.Element;
|
|
18
|
-
}[];
|
|
19
|
-
interface FormProps {
|
|
20
|
-
isDisabled?: boolean;
|
|
11
|
+
export declare const BUTTON_PUBLISHING = "Publishing";
|
|
12
|
+
interface FormData extends PublicWarningDetail {
|
|
13
|
+
IS_DRAFT?: boolean;
|
|
21
14
|
object?: BaseDrawingListItem;
|
|
15
|
+
'translation-select'?: string;
|
|
22
16
|
}
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
export declare const prepareFormValues: (data: FormData) => PublicWarningDetail;
|
|
18
|
+
export type FormAction = '' | 'saving' | 'publishing';
|
|
19
|
+
interface FormProps {
|
|
20
|
+
formAction?: FormAction;
|
|
21
|
+
onSaveForm?: (formValues: PublicWarningDetail) => void;
|
|
22
|
+
onPublishForm?: (formValues: PublicWarningDetail) => void;
|
|
23
|
+
object?: DrawingListItem;
|
|
24
|
+
publicWarningDetails?: PublicWarningDetail;
|
|
25
|
+
error?: string;
|
|
25
26
|
}
|
|
26
|
-
export declare const PublicWarningsForm: React.FC<
|
|
27
|
+
export declare const PublicWarningsForm: React.FC<FormProps>;
|
|
27
28
|
export {};
|
|
@@ -19,3 +19,7 @@ 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;
|
|
@@ -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,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 {};
|
|
@@ -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 {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ValidUntilField';
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { Position, DraggableSize, HeaderSize } from '@opengeoweb/shared';
|
|
3
3
|
import { uiTypes } from '@opengeoweb/store';
|
|
4
4
|
export declare const DIALOG_TITLE = "Public Warning";
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const PublicWarningsFormDialog: React.FC<{
|
|
6
6
|
bounds?: string;
|
|
7
7
|
title?: string;
|
|
8
8
|
onClose: () => void;
|
|
@@ -15,4 +15,5 @@ export declare const PublicWarnings: React.FC<{
|
|
|
15
15
|
setFocused?: (focused: boolean) => void;
|
|
16
16
|
headerSize?: HeaderSize;
|
|
17
17
|
children: React.ReactNode;
|
|
18
|
+
isLoading?: boolean;
|
|
18
19
|
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -3,7 +3,7 @@ declare const _default: {
|
|
|
3
3
|
title: string;
|
|
4
4
|
};
|
|
5
5
|
export default _default;
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const PublicWarningsFormDialogLight: {
|
|
7
7
|
(): React.ReactElement;
|
|
8
8
|
parameters: {
|
|
9
9
|
zeplinLink: {
|
|
@@ -13,7 +13,7 @@ export declare const PublicWarningsLight: {
|
|
|
13
13
|
};
|
|
14
14
|
storyName: string;
|
|
15
15
|
};
|
|
16
|
-
export declare const
|
|
16
|
+
export declare const PublicWarningsFormDialogDark: {
|
|
17
17
|
(): React.ReactElement;
|
|
18
18
|
parameters: {
|
|
19
19
|
zeplinLink: {
|
|
@@ -23,7 +23,7 @@ export declare const PublicWarningsDark: {
|
|
|
23
23
|
};
|
|
24
24
|
storyName: string;
|
|
25
25
|
};
|
|
26
|
-
export declare const
|
|
26
|
+
export declare const PublicWarningsFormDialogLightBig: {
|
|
27
27
|
(): React.ReactElement;
|
|
28
28
|
storyName: string;
|
|
29
29
|
};
|
|
@@ -31,3 +31,11 @@ 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
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { uiTypes } from '@opengeoweb/store';
|
|
3
3
|
import { Position } from '@opengeoweb/shared';
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const PublicWarningsFormDialogConnect: React.FC<{
|
|
5
5
|
bounds?: string;
|
|
6
6
|
source?: uiTypes.Source;
|
|
7
7
|
startPosition?: Position;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/src/lib/components/PublicWarningsFormDialog/PublicWarningsFormDialogConnect.stories.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
};
|
|
5
|
+
export default _default;
|
|
6
|
+
export declare const PublicWarningsFormDialogConnectMap: () => React.ReactElement;
|
|
7
|
+
export declare const PublicWarningsFormDialogConnectWithoutMap: () => React.ReactElement;
|
|
@@ -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
|
-
|
|
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';
|
|
@@ -30,14 +31,3 @@ export type SubmitDrawValuesPayload = {
|
|
|
30
31
|
lastUpdatedTime?: string;
|
|
31
32
|
scope: DrawingScope;
|
|
32
33
|
};
|
|
33
|
-
export type PublicWarningsFormDataType = {
|
|
34
|
-
phenomenon: string;
|
|
35
|
-
validFrom: string;
|
|
36
|
-
validUntil: string;
|
|
37
|
-
leadtime: string;
|
|
38
|
-
level: string;
|
|
39
|
-
probability: number;
|
|
40
|
-
descriptionOriginal: string;
|
|
41
|
-
descriptionTranslation: string;
|
|
42
|
-
objectId: string;
|
|
43
|
-
};
|
|
@@ -1,12 +1,40 @@
|
|
|
1
1
|
import { PayloadAction, Draft } from '@reduxjs/toolkit';
|
|
2
|
-
import {
|
|
2
|
+
import { DrawingListItem } from '../drawings/types';
|
|
3
|
+
import { PublicWarning, PublicWarningDetail } from './types';
|
|
4
|
+
export type FormAction = '' | 'saving' | 'publishing';
|
|
3
5
|
export interface PublicWarningFormState {
|
|
4
|
-
object?:
|
|
6
|
+
object?: DrawingListItem;
|
|
7
|
+
publicWarningDetail?: PublicWarningDetail;
|
|
8
|
+
formAction?: FormAction;
|
|
9
|
+
error?: string;
|
|
10
|
+
selectedPublicWarningId?: string;
|
|
5
11
|
}
|
|
6
12
|
export declare const initialState: PublicWarningFormState;
|
|
7
13
|
export declare const reducer: import("redux").Reducer<PublicWarningFormState, import("redux").AnyAction>;
|
|
8
|
-
export declare const
|
|
14
|
+
export declare const publicWarningFormActions: import("@reduxjs/toolkit").CaseReducerActions<{
|
|
9
15
|
setFormValues: (draft: Draft<PublicWarningFormState>, action: PayloadAction<{
|
|
10
|
-
object
|
|
16
|
+
object?: DrawingListItem;
|
|
17
|
+
publicWarningDetail?: PublicWarningDetail;
|
|
18
|
+
}>) => void;
|
|
19
|
+
openPublicWarningFormDialog: (draft: Draft<PublicWarningFormState>, action: PayloadAction<{
|
|
20
|
+
object?: DrawingListItem;
|
|
21
|
+
publicWarningDetail?: PublicWarningDetail;
|
|
22
|
+
}>) => void;
|
|
23
|
+
publishWarning: (draft: Draft<PublicWarningFormState>, action: PayloadAction<{
|
|
24
|
+
publicWarning: PublicWarning;
|
|
25
|
+
}>) => void;
|
|
26
|
+
publishWarningSuccess: (draft: Draft<PublicWarningFormState>, action: PayloadAction<{
|
|
27
|
+
publicWarning: PublicWarning;
|
|
28
|
+
message: string;
|
|
29
|
+
}>) => void;
|
|
30
|
+
saveWarning: (draft: Draft<PublicWarningFormState>, action: PayloadAction<{
|
|
31
|
+
publicWarning: PublicWarning;
|
|
32
|
+
}>) => void;
|
|
33
|
+
saveWarningSuccess: (draft: Draft<PublicWarningFormState>, action: PayloadAction<{
|
|
34
|
+
publicWarning: PublicWarning;
|
|
35
|
+
message: string;
|
|
36
|
+
}>) => void;
|
|
37
|
+
setFormError: (draft: Draft<PublicWarningFormState>, action: PayloadAction<{
|
|
38
|
+
error: string;
|
|
11
39
|
}>) => void;
|
|
12
40
|
}, "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 {};
|
|
@@ -1,7 +1,27 @@
|
|
|
1
1
|
import { WarningModuleStore } from '../config';
|
|
2
2
|
import { PublicWarningFormState } from './reducer';
|
|
3
3
|
export declare const getPublicWarningStore: (store: WarningModuleStore) => PublicWarningFormState;
|
|
4
|
-
export declare const getPublicWarningObject: ((state: WarningModuleStore) => import("../drawings/types").
|
|
4
|
+
export declare const getPublicWarningObject: ((state: WarningModuleStore) => import("../drawings/types").DrawingListItem | undefined) & import("reselect").OutputSelectorFields<(args_0: PublicWarningFormState) => import("../drawings/types").DrawingListItem | undefined, {
|
|
5
|
+
clearCache: () => void;
|
|
6
|
+
}> & {
|
|
7
|
+
clearCache: () => void;
|
|
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 getPublicWarningFormAction: ((state: WarningModuleStore) => "" | "saving" | "publishing") & import("reselect").OutputSelectorFields<(args_0: PublicWarningFormState) => "" | "saving" | "publishing", {
|
|
15
|
+
clearCache: () => void;
|
|
16
|
+
}> & {
|
|
17
|
+
clearCache: () => void;
|
|
18
|
+
};
|
|
19
|
+
export declare const getPublicWarningFormError: ((state: WarningModuleStore) => string) & import("reselect").OutputSelectorFields<(args_0: PublicWarningFormState) => string, {
|
|
20
|
+
clearCache: () => void;
|
|
21
|
+
}> & {
|
|
22
|
+
clearCache: () => void;
|
|
23
|
+
};
|
|
24
|
+
export declare const getSelectedPublicWarningId: ((state: WarningModuleStore) => string) & import("reselect").OutputSelectorFields<(args_0: PublicWarningFormState) => string, {
|
|
5
25
|
clearCache: () => void;
|
|
6
26
|
}> & {
|
|
7
27
|
clearCache: () => void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type PublicWarningDetail = {
|
|
2
|
+
id: string;
|
|
3
|
+
phenomenon: string;
|
|
4
|
+
geoJSON: GeoJSON.FeatureCollection;
|
|
5
|
+
validFrom: string;
|
|
6
|
+
validUntil: string;
|
|
7
|
+
level: string;
|
|
8
|
+
probability: number;
|
|
9
|
+
descriptionOriginal: string;
|
|
10
|
+
descriptionTranslation: string;
|
|
11
|
+
domain?: string;
|
|
12
|
+
warningProposalSource?: string;
|
|
13
|
+
authority?: string;
|
|
14
|
+
type?: number;
|
|
15
|
+
};
|
|
16
|
+
export type PublicWarningStatus = 'DRAFT' | 'PUBLISHED' | 'TODO' | 'EXPIRED';
|
|
17
|
+
export type PublicWarning = {
|
|
18
|
+
status: PublicWarningStatus;
|
|
19
|
+
warningDetail: PublicWarningDetail;
|
|
20
|
+
id?: string;
|
|
21
|
+
lastUpdatedTime?: string;
|
|
22
|
+
};
|
|
@@ -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'>])";
|
package/src/lib/utils/api.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CreateApiProps } from '@opengeoweb/api';
|
|
2
2
|
import { AxiosInstance } from 'axios';
|
|
3
3
|
import { DrawingDetails, DrawingFromBE, DrawingListItem } from '../store/drawings/types';
|
|
4
|
+
import { PublicWarning } from '../store/publicWarningForm/types';
|
|
4
5
|
export declare const API_NAME = "warnings";
|
|
5
6
|
export declare const getIdFromUrl: (url: string) => string;
|
|
6
7
|
export type WarningsApi = {
|
|
@@ -13,6 +14,11 @@ export type WarningsApi = {
|
|
|
13
14
|
updateDrawing: (drawingId: string, data: DrawingFromBE) => Promise<void>;
|
|
14
15
|
saveDrawingAs: (data: DrawingDetails) => Promise<string>;
|
|
15
16
|
deleteDrawing: (drawingId: string) => Promise<void>;
|
|
17
|
+
getWarnings: () => Promise<{
|
|
18
|
+
data: PublicWarning[];
|
|
19
|
+
}>;
|
|
20
|
+
saveWarningAs: (data: PublicWarning) => Promise<string>;
|
|
21
|
+
updateWarning: (warningId: string, data: PublicWarning) => Promise<void>;
|
|
16
22
|
};
|
|
17
23
|
export declare const getApiRoutes: (axiosInstance: AxiosInstance) => WarningsApi;
|
|
18
24
|
export declare const getWarningsApi: () => WarningsApi;
|