@opengeoweb/warnings 9.24.0 → 9.25.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/warnings",
3
- "version": "9.24.0",
3
+ "version": "9.25.2",
4
4
  "description": "GeoWeb warinings library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -13,7 +13,6 @@
13
13
  "@opengeoweb/store": "*",
14
14
  "@opengeoweb/webmap-react": "*",
15
15
  "react-redux": "^8.1.3",
16
- "@mui/material": "^5.16.0",
17
16
  "@opengeoweb/theme": "*",
18
17
  "@opengeoweb/form-fields": "*",
19
18
  "react-hook-form": "^7.50.1",
@@ -28,6 +27,7 @@
28
27
  "@opengeoweb/authentication": "*",
29
28
  "react-i18next": "^14.1.2",
30
29
  "i18next": "^23.11.5",
30
+ "@mui/material": "^5.16.0",
31
31
  "immer": "^10.0.3"
32
32
  },
33
33
  "peerDependencies": {
@@ -3,6 +3,8 @@ import { HeaderSize, Position, DraggableSize } from '@opengeoweb/shared';
3
3
  import { uiTypes } from '@opengeoweb/store';
4
4
  import { DrawingListItem } from '../../store/drawings/types';
5
5
  import { AreaObjectFilterProps } from './AreaObjectFilter';
6
+ import { Area } from '../../store/publicWarningForm/types';
7
+ export declare const areaErrorType = "area";
6
8
  export declare const AreaObjectLoader: React.FC<{
7
9
  bounds?: string;
8
10
  title?: string;
@@ -15,6 +17,11 @@ export declare const AreaObjectLoader: React.FC<{
15
17
  startPosition?: Position;
16
18
  headerSize?: HeaderSize;
17
19
  drawingListItems: DrawingListItem[];
18
- error?: string;
20
+ error?: uiTypes.UISetErrorPayload;
19
21
  isLoading?: boolean;
22
+ onAddArea?: (drawingListItem: DrawingListItem) => void;
23
+ onRemoveArea?: (drawingListItem: DrawingListItem) => void;
24
+ selectedAreas?: Area[];
25
+ isChangeAreaDisabled?: boolean;
26
+ onRetryRequest?: (errorType: string) => void;
20
27
  } & AreaObjectFilterProps>;
@@ -4,3 +4,4 @@ declare const _default: {
4
4
  };
5
5
  export default _default;
6
6
  export declare const AreaObjectLoaderDemo: () => React.ReactElement;
7
+ export declare const AreaObjectLoaderDemoWithError: () => React.ReactElement;
@@ -1,6 +1,7 @@
1
1
  import React, { FC } from 'react';
2
2
  import { TFunction } from 'i18next';
3
3
  import { DrawingListItem } from '../../store/drawings/types';
4
+ import { Area } from '../../store/publicWarningForm/types';
4
5
  interface ObjectAreaList {
5
6
  title: string;
6
7
  items: DrawingListItem[];
@@ -15,5 +16,9 @@ export declare const AreasObjects: FC<{
15
16
  isLoading?: boolean;
16
17
  hasError?: boolean;
17
18
  filterRef?: React.MutableRefObject<HTMLElement>;
19
+ onAddArea?: (drawingListItem: DrawingListItem) => void;
20
+ onRemoveArea?: (drawingListItem: DrawingListItem) => void;
21
+ selectedAreas?: Area[];
22
+ isChangeAreaDisabled?: boolean;
18
23
  }>;
19
24
  export {};
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { FilterListItemProps, FilterChipProps } from '@opengeoweb/shared';
3
- export interface FilterChipWithOptionsProps extends FilterChipProps {
4
- children?: React.ReactNode;
3
+ export interface FilterChipWithOptionsProps extends Omit<FilterChipProps, 'isSelected' | 'isDisabled' | 'size' | ' onAction' | 'actionIcon' | 'label'> {
4
+ translationKey: string;
5
5
  filterList?: FilterListItemProps[];
6
6
  }
7
7
  export declare const FilterChipWithOptions: React.FC<FilterChipWithOptionsProps>;
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ import { WarningListFilter } from '../../store/publicWarnings/types';
3
+ interface FilterChipWithOptionsConnectProps {
4
+ filter: WarningListFilter;
5
+ }
6
+ export declare const FilterChipWithOptionsConnect: React.FC<FilterChipWithOptionsConnectProps>;
7
+ export {};
@@ -0,0 +1,9 @@
1
+ import { FC } from 'react';
2
+ import { WarningListFilter } from '../../store/publicWarnings/types';
3
+ interface FilterListProps {
4
+ filters?: WarningListFilter[];
5
+ onClickAll?: (isChecked: boolean) => void;
6
+ isAllSelected?: boolean;
7
+ }
8
+ declare const FilterList: FC<FilterListProps>;
9
+ export default FilterList;
@@ -1,6 +1,7 @@
1
1
  import { GridProps } from '@mui/material';
2
2
  import React from 'react';
3
3
  import { PublicWarning, PublicWarningStatus } from '../../store/publicWarningForm/types';
4
+ import { WarningListFilter } from '../../store/publicWarnings/types';
4
5
  export declare const getWarningWithLinkedToId: (warning: PublicWarning) => PublicWarning;
5
6
  export declare const getWarningWithProposalId: (warning: PublicWarning) => PublicWarning;
6
7
  export declare const getWarningWithoutIdStatusEditor: (warning: PublicWarning) => PublicWarning;
@@ -24,5 +25,8 @@ export declare const PublicWarningList: React.FC<{
24
25
  lastUpdatedTime?: string;
25
26
  onCreateWarning?: () => void;
26
27
  onRefetchWarnings?: () => void;
28
+ filters?: WarningListFilter[];
29
+ onClickAllChip?: (isChecked: boolean) => void;
30
+ isAllChipSelected?: boolean;
27
31
  } & WarningStatusProps>;
28
32
  export default PublicWarningList;
@@ -5,3 +5,4 @@ declare const _default: {
5
5
  export default _default;
6
6
  export declare const PublicWarningsFormDialogConnectMap: () => React.ReactElement;
7
7
  export declare const PublicWarningsFormDialogConnectWithoutMap: () => React.ReactElement;
8
+ export declare const PublicWarningsFormDialogConnectWithoutMapWithValues: () => React.ReactElement;
@@ -1,7 +1,7 @@
1
1
  import { PayloadAction, Draft } from '@reduxjs/toolkit';
2
2
  import { AlertColor } from '@mui/material';
3
3
  import { DrawingListItem } from '../drawings/types';
4
- import { PublicWarning } from './types';
4
+ import { Area, PublicWarning } from './types';
5
5
  export type FormAction = '' | 'saving' | 'publishing' | 'readonly';
6
6
  export interface FormError {
7
7
  severity?: AlertColor;
@@ -24,6 +24,12 @@ export declare const publicWarningFormActions: import("@reduxjs/toolkit").CaseRe
24
24
  publicWarning?: PublicWarning;
25
25
  formState?: FormAction;
26
26
  }>) => void;
27
+ addArea: (draft: Draft<PublicWarningFormState>, action: PayloadAction<{
28
+ area: Area;
29
+ }>) => void;
30
+ removeArea: (draft: Draft<PublicWarningFormState>, action: PayloadAction<{
31
+ area: Area;
32
+ }>) => void;
27
33
  openPublicWarningFormDialog: (draft: Draft<PublicWarningFormState>, action: PayloadAction<{
28
34
  object?: DrawingListItem;
29
35
  formState?: FormAction;
@@ -21,6 +21,16 @@ export declare const getPublicWarningEditor: ((state: WarningModuleStore) => str
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, {
25
+ clearCache: () => void;
26
+ }> & {
27
+ clearCache: () => void;
28
+ };
29
+ export declare const getPublicWarningAreas: ((state: WarningModuleStore) => import("./types").Area[]) & import("reselect").OutputSelectorFields<(args_0: PublicWarningFormState) => import("./types").Area[], {
30
+ clearCache: () => void;
31
+ }> & {
32
+ clearCache: () => void;
33
+ };
24
34
  export declare const getPublicWarningFormState: ((state: WarningModuleStore) => "" | "saving" | "publishing" | "readonly") & import("reselect").OutputSelectorFields<(args_0: PublicWarningFormState) => "" | "saving" | "publishing" | "readonly", {
25
35
  clearCache: () => void;
26
36
  }> & {
@@ -1,4 +1,4 @@
1
- interface Area {
1
+ export interface Area {
2
2
  objectName: string;
3
3
  geoJSON: GeoJSON.FeatureCollection;
4
4
  }
@@ -28,4 +28,3 @@ export interface PublicWarning {
28
28
  id?: string;
29
29
  lastUpdatedTime?: string;
30
30
  }
31
- export {};
@@ -1,7 +1,8 @@
1
1
  import { PayloadAction, Draft } from '@reduxjs/toolkit';
2
- import { PublicWarningsState } from './types';
2
+ import { WarningListFilter, PublicWarningsState, ToggleFilterPayload, ToggleFilterOptionPayload, ToggleAllFiltersPayload } from './types';
3
3
  import { PublicWarning } from '../publicWarningForm/types';
4
4
  export declare const publicWarningsAdapter: import("@reduxjs/toolkit").EntityAdapter<PublicWarning>;
5
+ export declare const warningListFilterAdapter: import("@reduxjs/toolkit").EntityAdapter<WarningListFilter>;
5
6
  export declare const initialState: PublicWarningsState;
6
7
  export declare const reducer: import("redux").Reducer<PublicWarningsState, import("redux").AnyAction>;
7
8
  export declare const publicWarningActions: import("@reduxjs/toolkit").CaseReducerActions<{
@@ -16,4 +17,11 @@ export declare const publicWarningActions: import("@reduxjs/toolkit").CaseReduce
16
17
  message: string;
17
18
  };
18
19
  }>) => void;
20
+ setWarningListFilters: (draft: Draft<PublicWarningsState>, action: PayloadAction<{
21
+ warnings: PublicWarning[];
22
+ }>) => void;
23
+ toggleFilter: (draft: Draft<PublicWarningsState>, action: PayloadAction<ToggleFilterPayload>) => void;
24
+ toggleOption: (draft: Draft<PublicWarningsState>, action: PayloadAction<ToggleFilterOptionPayload>) => void;
25
+ enableOnlyOneFilterOption: (draft: Draft<PublicWarningsState>, action: PayloadAction<ToggleFilterOptionPayload>) => void;
26
+ toggleAllFilters: (draft: Draft<PublicWarningsState>, action: PayloadAction<ToggleAllFiltersPayload>) => void;
19
27
  }, "publicWarnings">;
@@ -1,7 +1,8 @@
1
- import { PublicWarningsState } from './types';
1
+ import { OptionListItem, PublicWarningsState, WarningListFilter } from './types';
2
2
  import { WarningModuleStore } from '../types';
3
+ import { PublicWarning } from '../publicWarningForm/types';
3
4
  export declare const getPublicWarningsStore: (store: WarningModuleStore) => PublicWarningsState;
4
- export declare const selectAllPublicWarnings: (state: WarningModuleStore) => import("../publicWarningForm/types").PublicWarning[];
5
+ export declare const selectAllPublicWarnings: (state: WarningModuleStore) => PublicWarning[];
5
6
  export declare const isPublicWarningsLoading: ((state: WarningModuleStore) => boolean) & import("reselect").OutputSelectorFields<(args_0: PublicWarningsState) => boolean, {
6
7
  clearCache: () => void;
7
8
  }> & {
@@ -17,3 +18,19 @@ export declare const getPublicWarningsLastUpdatedTime: ((state: WarningModuleSto
17
18
  }> & {
18
19
  clearCache: () => void;
19
20
  };
21
+ export declare const selectAllFilters: (state: WarningModuleStore) => WarningListFilter[], selectAllFilterIds: (state: WarningModuleStore) => import("@reduxjs/toolkit").EntityId[];
22
+ export declare const getIsAllSelected: ((state: WarningModuleStore) => boolean) & import("reselect").OutputSelectorFields<(args_0: WarningListFilter[]) => boolean, {
23
+ clearCache: () => void;
24
+ }> & {
25
+ clearCache: () => void;
26
+ };
27
+ export declare const getSelectedFilterOptions: ((state: WarningModuleStore) => OptionListItem[]) & import("reselect").OutputSelectorFields<(args_0: WarningListFilter[]) => OptionListItem[], {
28
+ clearCache: () => void;
29
+ }> & {
30
+ clearCache: () => void;
31
+ };
32
+ export declare const getFilteredWarnings: ((state: WarningModuleStore) => PublicWarning[]) & import("reselect").OutputSelectorFields<(args_0: PublicWarning[], args_1: boolean, args_2: OptionListItem[], args_3: import("@reduxjs/toolkit").EntityId[]) => PublicWarning[], {
33
+ clearCache: () => void;
34
+ }> & {
35
+ clearCache: () => void;
36
+ };
@@ -1,5 +1,11 @@
1
1
  import { EntityState } from '@reduxjs/toolkit';
2
+ import { FilterListItemProps } from '@opengeoweb/shared';
2
3
  import { PublicWarning } from '../publicWarningForm/types';
4
+ export interface WarningListFilter {
5
+ translationKey: string;
6
+ id: string;
7
+ filterList: FilterListItemProps[];
8
+ }
3
9
  export interface PublicWarningError {
4
10
  name: string;
5
11
  message: string;
@@ -9,4 +15,20 @@ export interface PublicWarningsState {
9
15
  isLoading: boolean;
10
16
  lastUpdatedTime: string;
11
17
  error?: PublicWarningError;
18
+ filters: EntityState<WarningListFilter>;
19
+ }
20
+ export interface ToggleFilterPayload {
21
+ filterId: string;
22
+ isChecked: boolean;
23
+ }
24
+ export interface ToggleFilterOptionPayload {
25
+ filterId: string;
26
+ optionId: string;
27
+ }
28
+ export interface ToggleAllFiltersPayload {
29
+ isChecked: boolean;
30
+ }
31
+ export interface OptionListItem {
32
+ filterId: string;
33
+ optionId: string;
12
34
  }
@@ -0,0 +1,20 @@
1
+ import { FilterListItemProps } from '@opengeoweb/shared';
2
+ import { EntityId, EntityState } from '@reduxjs/toolkit';
3
+ import { PublicWarning } from '../publicWarningForm/types';
4
+ import { OptionListItem, WarningListFilter } from './types';
5
+ export declare const emptyFilter: {
6
+ id: string;
7
+ name: string;
8
+ checked: boolean;
9
+ };
10
+ export declare const defaultFilters: {
11
+ key: string;
12
+ translationKey: string;
13
+ }[];
14
+ export declare const getFiltersFromWarnings: (warnings: PublicWarning[]) => WarningListFilter[];
15
+ export declare const isWarningMatchingFilter: (filters: OptionListItem[], filterId: EntityId, warningDetailValue: string) => boolean;
16
+ export declare const getUpdatedFilters: (filters: EntityState<WarningListFilter>, newFilters: WarningListFilter[]) => {
17
+ id: EntityId;
18
+ changes: WarningListFilter;
19
+ }[];
20
+ export declare const getUpdatedFilterList: (oldList: FilterListItemProps[], newList: FilterListItemProps[]) => FilterListItemProps[];
@@ -0,0 +1 @@
1
+ export {};