@opengeoweb/warnings 8.4.1 → 9.1.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 (20) hide show
  1. package/index.esm.js +875 -381
  2. package/package.json +3 -24
  3. package/src/index.d.ts +1 -1
  4. package/src/lib/components/ObjectManager/ObjectManager.stories.d.ts +4 -0
  5. package/src/lib/components/PublicWarningsForm/AreaField.d.ts +1 -4
  6. package/src/lib/components/PublicWarningsForm/LevelField.d.ts +9 -0
  7. package/src/lib/components/PublicWarningsForm/Phenomenon.d.ts +8 -0
  8. package/src/lib/components/PublicWarningsForm/PublicWarningsForm.d.ts +9 -13
  9. package/src/lib/components/{PublicWarnings/PublicWarnings.d.ts → PublicWarningsFormDialog/PublicWarningsFormDialog.d.ts} +1 -1
  10. package/src/lib/components/{PublicWarnings/PublicWarnings.stories.d.ts → PublicWarningsFormDialog/PublicWarningsFormDialog.stories.d.ts} +3 -3
  11. package/src/lib/components/{PublicWarnings/PublicWarningsConnect.d.ts → PublicWarningsFormDialog/PublicWarningsFormDialogConnect.d.ts} +1 -1
  12. package/src/lib/components/PublicWarningsFormDialog/index.d.ts +2 -0
  13. package/src/lib/store/drawings/types.d.ts +0 -11
  14. package/src/lib/store/publicWarningForm/reducer.d.ts +5 -3
  15. package/src/lib/store/publicWarningForm/selectors.d.ts +1 -1
  16. package/src/lib/store/publicWarningForm/types.d.ts +15 -0
  17. package/src/lib/components/PublicWarnings/index.d.ts +0 -2
  18. /package/src/lib/components/{PublicWarnings/PublicWarnings.spec.d.ts → PublicWarningsFormDialog/PublicWarningsFormDialog.spec.d.ts} +0 -0
  19. /package/src/lib/components/{PublicWarnings/PublicWarningsConnect.spec.d.ts → PublicWarningsFormDialog/PublicWarningsFormDialogConnect.spec.d.ts} +0 -0
  20. /package/src/lib/components/{PublicWarnings/PublicWarningsConnect.stories.d.ts → PublicWarningsFormDialog/PublicWarningsFormDialogConnect.stories.d.ts} +0 -0
package/package.json CHANGED
@@ -1,35 +1,14 @@
1
1
  {
2
2
  "name": "@opengeoweb/warnings",
3
- "version": "8.4.1",
3
+ "version": "9.1.0",
4
4
  "description": "GeoWeb warinings library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "git@gitlab.com:opengeoweb/opengeoweb.git"
9
9
  },
10
- "dependencies": {
11
- "@mui/material": "5.12.0",
12
- "@opengeoweb/api": "8.4.1",
13
- "@opengeoweb/core": "8.4.1",
14
- "@opengeoweb/form-fields": "8.4.1",
15
- "@opengeoweb/shared": "8.4.1",
16
- "@opengeoweb/store": "8.4.1",
17
- "@opengeoweb/theme": "8.4.1",
18
- "@opengeoweb/webmap": "8.4.1",
19
- "@opengeoweb/webmap-react": "8.4.1",
20
- "@redux-eggs/redux-toolkit": "2.2.0",
21
- "@redux-eggs/saga-extension": "2.2.0",
22
- "@reduxjs/toolkit": "1.9.7",
23
- "axios": "1.5.0",
24
- "lodash": "4.17.21",
25
- "react": "18.2.0",
26
- "react-hook-form": "7.47.0",
27
- "react-redux": "8.1.3",
28
- "react-window": "1.8.9",
29
- "redux-saga": "1.2.3"
30
- },
10
+ "dependencies": {},
31
11
  "module": "./index.esm.js",
32
12
  "type": "module",
33
- "main": "./index.esm.js",
34
- "peerDependencies": {}
13
+ "main": "./index.esm.js"
35
14
  }
package/src/index.d.ts CHANGED
@@ -2,5 +2,5 @@ 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/PublicWarnings';
5
+ export * from './lib/components/PublicWarningsFormDialog';
6
6
  export * from './lib/store/config';
@@ -3,6 +3,10 @@ declare const _default: {
3
3
  title: string;
4
4
  };
5
5
  export default _default;
6
+ export declare const ObjectManagerSmall: {
7
+ (): React.ReactElement;
8
+ storyName: string;
9
+ };
6
10
  export declare const ObjectManagerLight: {
7
11
  (): React.ReactElement;
8
12
  parameters: {
@@ -5,7 +5,7 @@ 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 = "No object selected";
8
+ export declare const NO_OBJECT = "(no object selected)";
9
9
  export declare const formatDate: (lastUpdatedTime: string) => string;
10
10
  export declare const AreaField: React.FC<{
11
11
  onEditObject: () => void;
@@ -13,7 +13,4 @@ export declare const AreaField: React.FC<{
13
13
  onDeleteObject: () => void;
14
14
  onAddObject: () => void;
15
15
  isDisabled?: boolean;
16
- id?: string;
17
- lastUpdatedTime?: string;
18
- objectName?: string;
19
16
  }>;
@@ -0,0 +1,9 @@
1
+ import * as React from 'react';
2
+ export declare const LABEL_LEVEL = "Level";
3
+ export declare const levelOptions: {
4
+ title: string;
5
+ key: string;
6
+ color: string;
7
+ textColor: string;
8
+ }[];
9
+ export declare const LevelField: React.FC;
@@ -0,0 +1,8 @@
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;
@@ -1,27 +1,23 @@
1
1
  import * as React from 'react';
2
- import { BaseDrawingListItem, PublicWarningsFormDataType } from '../../store/drawings/types';
3
- export declare const getEmptyPublicWarning: (object?: BaseDrawingListItem) => PublicWarningsFormDataType;
4
- export declare const LABEL_PHENOMENON = "Phenomenon";
2
+ import { PublicWarningDetail } from '../../store/publicWarningForm/types';
3
+ import { DrawingListItem } from '../../store/drawings/types';
4
+ export declare const getEmptyPublicWarning: () => PublicWarningDetail;
5
+ export declare const getFormData: (publicWarningsDetails: PublicWarningDetail | undefined, object?: DrawingListItem) => PublicWarningDetail;
5
6
  export declare const LABEL_VALID_FROM = "Valid from";
6
7
  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";
10
8
  export declare const LABEL_PROBABILITY = "Probability";
11
9
  export declare const BUTTON_CLEAR = "Clear";
12
10
  export declare const BUTTON_SAVE = "Save";
13
11
  export declare const BUTTON_PUBLISH = "Publish";
14
- export declare const warningPhenomena: {
15
- title: string;
16
- key: string;
17
- icon: React.JSX.Element;
18
- }[];
12
+ export declare const dateFormat = "DD/MM/YYYY HH:mm";
19
13
  interface FormProps {
20
14
  isDisabled?: boolean;
21
- object?: BaseDrawingListItem;
15
+ onSaveForm?: (formValues: PublicWarningDetail) => void;
16
+ onPublishForm?: (formValues: PublicWarningDetail) => void;
22
17
  }
23
18
  interface PublicWarningsFormProps extends FormProps {
24
- publicWarningDetails?: PublicWarningsFormDataType;
19
+ publicWarningDetails?: PublicWarningDetail;
20
+ object?: DrawingListItem;
25
21
  }
26
22
  export declare const PublicWarningsForm: React.FC<PublicWarningsFormProps>;
27
23
  export {};
@@ -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 PublicWarnings: React.FC<{
5
+ export declare const PublicWarningsFormDialog: React.FC<{
6
6
  bounds?: string;
7
7
  title?: string;
8
8
  onClose: () => void;
@@ -3,7 +3,7 @@ declare const _default: {
3
3
  title: string;
4
4
  };
5
5
  export default _default;
6
- export declare const PublicWarningsLight: {
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 PublicWarningsDark: {
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 PublicWarningsLightBig: {
26
+ export declare const PublicWarningsFormDialogLightBig: {
27
27
  (): React.ReactElement;
28
28
  storyName: string;
29
29
  };
@@ -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 PublicWarningsConnect: React.FC<{
4
+ export declare const PublicWarningsFormDialogConnect: React.FC<{
5
5
  bounds?: string;
6
6
  source?: uiTypes.Source;
7
7
  startPosition?: Position;
@@ -0,0 +1,2 @@
1
+ export * from './PublicWarningsFormDialog';
2
+ export * from './PublicWarningsFormDialogConnect';
@@ -30,14 +30,3 @@ export type SubmitDrawValuesPayload = {
30
30
  lastUpdatedTime?: string;
31
31
  scope: DrawingScope;
32
32
  };
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,14 @@
1
1
  import { PayloadAction, Draft } from '@reduxjs/toolkit';
2
- import { BaseDrawingListItem } from '../drawings/types';
2
+ import { DrawingListItem } from '../drawings/types';
3
+ import { PublicWarning } from './types';
3
4
  export interface PublicWarningFormState {
4
- object?: BaseDrawingListItem;
5
+ object?: DrawingListItem;
6
+ publicWarning?: PublicWarning;
5
7
  }
6
8
  export declare const initialState: PublicWarningFormState;
7
9
  export declare const reducer: import("redux").Reducer<PublicWarningFormState, import("redux").AnyAction>;
8
10
  export declare const publicWarningActions: import("@reduxjs/toolkit").CaseReducerActions<{
9
11
  setFormValues: (draft: Draft<PublicWarningFormState>, action: PayloadAction<{
10
- object: BaseDrawingListItem;
12
+ object: DrawingListItem;
11
13
  }>) => void;
12
14
  }, "publicWarningForm">;
@@ -1,7 +1,7 @@
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").BaseDrawingListItem | undefined) & import("reselect").OutputSelectorFields<(args_0: PublicWarningFormState) => import("../drawings/types").BaseDrawingListItem | undefined, {
4
+ export declare const getPublicWarningObject: ((state: WarningModuleStore) => import("../drawings/types").DrawingListItem | undefined) & import("reselect").OutputSelectorFields<(args_0: PublicWarningFormState) => import("../drawings/types").DrawingListItem | undefined, {
5
5
  clearCache: () => void;
6
6
  }> & {
7
7
  clearCache: () => void;
@@ -0,0 +1,15 @@
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
+ };
12
+ export type PublicWarning = {
13
+ status: 'DRAFT' | 'PUBLISH';
14
+ warningDetail: PublicWarningDetail;
15
+ };
@@ -1,2 +0,0 @@
1
- export * from './PublicWarnings';
2
- export * from './PublicWarningsConnect';