@opengeoweb/warnings 9.29.1 → 9.30.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 +45 -13
- package/package.json +1 -1
- package/src/lib/components/PublicWarningList/PublicWarningList.d.ts +4 -9
- package/src/lib/components/PublicWarningList/PublicWarningListConnect.stories.d.ts +1 -0
- package/src/lib/components/PublicWarningList/WarningListItem.d.ts +4 -10
- package/src/lib/components/PublicWarningList/WarningListItemMenu.d.ts +4 -2
- package/src/lib/components/PublicWarningList/WarningListItemSeperator.d.ts +1 -0
package/index.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { useDispatch, useSelector } from 'react-redux';
|
|
3
|
-
import { Polygons, Share, ExitDomain, Edit, Delete, CoastalEvent, TemperatureLow, TemperatureHigh, Rain, Snow, Lightning, Fog, Wind, Thunderstorm, VulcanicEruption, Haze, FreezingPrecipitation, ModerateAircraftIcing, SevereAircraftIcing, ModerateTurbulence, SevereTurbulence, SandStorm, RadioactiveMaterials, DrawPolygon, Visibility, Add, breakpoints, Close, Options, Copy, Success, Expire, Remove } from '@opengeoweb/theme';
|
|
3
|
+
import { Polygons, Share, ExitDomain, Edit, Delete, CoastalEvent, TemperatureLow, TemperatureHigh, Rain, Snow, Lightning, Fog, Wind, Thunderstorm, VulcanicEruption, Haze, FreezingPrecipitation, ModerateAircraftIcing, SevereAircraftIcing, ModerateTurbulence, SevereTurbulence, SandStorm, RadioactiveMaterials, DrawPolygon, Visibility, Add, breakpoints, Close, Options, ChevronDown, ChevronUp, Copy, Success, Expire, Remove } from '@opengeoweb/theme';
|
|
4
4
|
import { uiTypes, uiActions, getSingularDrawtoolDrawLayerId, drawtoolSelectors, layerSelectors, uiSelectors, mapStoreActions, drawtoolActions, layerActions, useSetupDialog } from '@opengeoweb/store';
|
|
5
5
|
import { defaultPolygon, emptyGeoJSON, MapControlButton, getIcon, rewindGeometry, getGeoJSONPropertyValue, currentlySupportedDrawModes, MapView, MapViewLayer, defaultLayers, getFeatureExtent } from '@opengeoweb/webmap-react';
|
|
6
6
|
import { SHARED_NAMESPACE, useConfirmationDialog, ToggleMenu, dateUtils, calculateStartSize, ToolContainerDraggable, AlertBanner, ConfirmationDialog, getAxiosErrorMessage, usePrevious, CustomIconButton, CustomTooltip, Avatar, getInitials, SwitchButton, CustomToggleButton, Filter, getPosition, FilterChip, FilterListItem, FilterLabel, StatusTag, LastUpdateTime, ErrorBoundary, pollingIntervalTimeout, isAxiosError as isAxiosError$1 } from '@opengeoweb/shared';
|
|
@@ -14338,12 +14338,15 @@ const FilterList = ({
|
|
|
14338
14338
|
}));
|
|
14339
14339
|
};
|
|
14340
14340
|
|
|
14341
|
+
const HEADER_SIZE = 32;
|
|
14341
14342
|
const WarningListItemSeperator = _a => {
|
|
14342
14343
|
var {
|
|
14343
14344
|
totalWarnings,
|
|
14344
|
-
status
|
|
14345
|
+
status,
|
|
14346
|
+
isExpanded,
|
|
14347
|
+
onClick
|
|
14345
14348
|
} = _a,
|
|
14346
|
-
props = __rest(_a, ["totalWarnings", "status"]);
|
|
14349
|
+
props = __rest(_a, ["totalWarnings", "status", "isExpanded", "onClick"]);
|
|
14347
14350
|
const {
|
|
14348
14351
|
t
|
|
14349
14352
|
} = useWarningsTranslation();
|
|
@@ -14361,15 +14364,28 @@ const WarningListItemSeperator = _a => {
|
|
|
14361
14364
|
};
|
|
14362
14365
|
const headerText = `${totalWarnings} ${getStatus(status)}`;
|
|
14363
14366
|
return jsx(ListItem, Object.assign({}, props, {
|
|
14367
|
+
sx: {
|
|
14368
|
+
height: HEADER_SIZE,
|
|
14369
|
+
padding: 0
|
|
14370
|
+
},
|
|
14364
14371
|
"aria-label": `warninglist ${status}`
|
|
14365
14372
|
}, {
|
|
14366
|
-
children:
|
|
14367
|
-
variant: "caption",
|
|
14373
|
+
children: jsxs(ListItemButton, Object.assign({
|
|
14368
14374
|
sx: {
|
|
14369
|
-
|
|
14370
|
-
|
|
14375
|
+
height: HEADER_SIZE,
|
|
14376
|
+
padding: 0
|
|
14377
|
+
},
|
|
14378
|
+
onClick: onClick
|
|
14371
14379
|
}, {
|
|
14372
|
-
children:
|
|
14380
|
+
children: [isExpanded ? jsx(ChevronDown, {}) : jsx(ChevronUp, {}), jsx(Typography, Object.assign({
|
|
14381
|
+
variant: "caption",
|
|
14382
|
+
sx: {
|
|
14383
|
+
opacity: 0.67,
|
|
14384
|
+
marginLeft: 1
|
|
14385
|
+
}
|
|
14386
|
+
}, {
|
|
14387
|
+
children: headerText
|
|
14388
|
+
}))]
|
|
14373
14389
|
}))
|
|
14374
14390
|
}));
|
|
14375
14391
|
};
|
|
@@ -15085,19 +15101,31 @@ const PublicWarningList = ({
|
|
|
15085
15101
|
byFilterState
|
|
15086
15102
|
} = useWarningFilters();
|
|
15087
15103
|
const sortedWarnings = sortWarningsOnStatus(_warnings.filter(byFilterState));
|
|
15104
|
+
const [expandedSections, setExpandedSections] = React__default.useState({
|
|
15105
|
+
TODO: true,
|
|
15106
|
+
DRAFT: true,
|
|
15107
|
+
PUBLISHED: true,
|
|
15108
|
+
EXPIRED: true
|
|
15109
|
+
});
|
|
15110
|
+
const toggleExpand = (shouldToggle, status) => {
|
|
15111
|
+
setExpandedSections(Object.assign(Object.assign({}, expandedSections), {
|
|
15112
|
+
[status]: shouldToggle
|
|
15113
|
+
}));
|
|
15114
|
+
resetListIndex();
|
|
15115
|
+
};
|
|
15088
15116
|
const items = [{
|
|
15089
15117
|
status: PublicWarningStatus.TODO,
|
|
15090
15118
|
totalWarnings: sortedWarnings.todo.length
|
|
15091
|
-
}, ...sortedWarnings.todo, {
|
|
15119
|
+
}, ...(expandedSections.TODO ? sortedWarnings.todo : []), {
|
|
15092
15120
|
status: PublicWarningStatus.DRAFT,
|
|
15093
15121
|
totalWarnings: sortedWarnings.draft.length
|
|
15094
|
-
}, ...sortedWarnings.draft, {
|
|
15122
|
+
}, ...(expandedSections.DRAFT ? sortedWarnings.draft : []), {
|
|
15095
15123
|
status: PublicWarningStatus.PUBLISHED,
|
|
15096
15124
|
totalWarnings: sortedWarnings.published.length
|
|
15097
|
-
}, ...sortedWarnings.published, {
|
|
15125
|
+
}, ...(expandedSections.PUBLISHED ? sortedWarnings.published : []), {
|
|
15098
15126
|
status: PublicWarningStatus.EXPIRED,
|
|
15099
15127
|
totalWarnings: sortedWarnings.expired.length
|
|
15100
|
-
}, ...sortedWarnings.expired];
|
|
15128
|
+
}, ...(expandedSections.EXPIRED ? sortedWarnings.expired : [])];
|
|
15101
15129
|
const getItemSize = (index, width) => {
|
|
15102
15130
|
const item = items[index];
|
|
15103
15131
|
if (item.totalWarnings !== undefined) {
|
|
@@ -15310,7 +15338,11 @@ const PublicWarningList = ({
|
|
|
15310
15338
|
return jsx(WarningListItemSeperator, {
|
|
15311
15339
|
status: header.status,
|
|
15312
15340
|
totalWarnings: header.totalWarnings,
|
|
15313
|
-
style: style
|
|
15341
|
+
style: style,
|
|
15342
|
+
isExpanded: expandedSections[warning.status],
|
|
15343
|
+
onClick: () => {
|
|
15344
|
+
toggleExpand(!expandedSections[header.status], header.status);
|
|
15345
|
+
}
|
|
15314
15346
|
}, key);
|
|
15315
15347
|
}
|
|
15316
15348
|
const publicWarning = warning;
|
package/package.json
CHANGED
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PublicWarning } from '../../store/publicWarningForm/types';
|
|
3
3
|
import { WarningListFilter } from '../../store/publicWarnings/types';
|
|
4
|
-
|
|
4
|
+
import { WarningListItemActions } from './WarningListItemMenu';
|
|
5
|
+
interface PublicWarningListProps extends WarningListItemActions {
|
|
5
6
|
warnings: PublicWarning[];
|
|
6
7
|
onSelectWarning?: (warning: PublicWarning) => void;
|
|
7
|
-
onEditWarning?: (warning: PublicWarning) => void;
|
|
8
|
-
onDeleteWarning?: (warningId: string, warningEditor?: string) => void;
|
|
9
|
-
onDeleteReviewWarning?: (warning: PublicWarning) => void;
|
|
10
|
-
onExpireWarning?: (warning: PublicWarning) => void;
|
|
11
|
-
onWithdrawWarning?: (warning: PublicWarning) => void;
|
|
12
|
-
}
|
|
13
|
-
export declare const PublicWarningList: React.FC<{
|
|
14
8
|
isLoading?: boolean;
|
|
15
9
|
error?: Error;
|
|
16
10
|
selectedPublicWarningId?: string;
|
|
@@ -20,5 +14,6 @@ export declare const PublicWarningList: React.FC<{
|
|
|
20
14
|
filters?: WarningListFilter[];
|
|
21
15
|
onClickAllChip?: (isChecked: boolean) => void;
|
|
22
16
|
isAllChipSelected?: boolean;
|
|
23
|
-
}
|
|
17
|
+
}
|
|
18
|
+
export declare const PublicWarningList: React.FC<PublicWarningListProps>;
|
|
24
19
|
export default PublicWarningList;
|
|
@@ -7,3 +7,4 @@ export declare const PublicWarningListLight: () => React.ReactElement;
|
|
|
7
7
|
export declare const PublicWarningListError: () => React.ReactElement;
|
|
8
8
|
export declare const PublicWarningListErrorDeleteWarning: () => React.ReactElement;
|
|
9
9
|
export declare const PublicWarningListDifferentEditors: () => React.ReactElement;
|
|
10
|
+
export declare const PublicWarningListExtraLongList: () => React.ReactElement;
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ListItemProps } from '@mui/material';
|
|
3
3
|
import { PublicWarning } from '../../store/publicWarningForm/types';
|
|
4
|
-
|
|
4
|
+
import { WarningListItemActions } from './WarningListItemMenu';
|
|
5
|
+
export interface WarningListItemProps extends ListItemProps, WarningListItemActions {
|
|
5
6
|
warning: PublicWarning;
|
|
7
|
+
activeWarningId: string;
|
|
6
8
|
onSelectWarning?: (warning: PublicWarning) => void;
|
|
7
|
-
onEditWarning?: (warning: PublicWarning) => void;
|
|
8
|
-
onDeleteWarning?: (warningId: string, warningEditor?: string) => void;
|
|
9
|
-
onDeleteReviewWarning?: (warning: PublicWarning) => void;
|
|
10
|
-
onExpireWarning?: (warning: PublicWarning) => void;
|
|
11
|
-
onWithdrawWarning?: (warning: PublicWarning) => void;
|
|
12
9
|
}
|
|
13
|
-
declare const WarningListItem: React.FC<
|
|
14
|
-
warning: PublicWarning;
|
|
15
|
-
activeWarningId: string;
|
|
16
|
-
} & WarningStatusProps>;
|
|
10
|
+
declare const WarningListItem: React.FC<WarningListItemProps>;
|
|
17
11
|
export default WarningListItem;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { MenuItemType } from '@opengeoweb/shared';
|
|
2
2
|
import { TFunction } from 'i18next';
|
|
3
3
|
import { PublicWarning } from '../../store/publicWarningForm/types';
|
|
4
|
-
interface
|
|
5
|
-
warning: PublicWarning;
|
|
4
|
+
export interface WarningListItemActions {
|
|
6
5
|
onEditWarning?: (warning: PublicWarning) => void;
|
|
7
6
|
onDeleteWarning?: (warningId: string, warningEditor?: string) => void;
|
|
8
7
|
onDeleteReviewWarning?: (warning: PublicWarning) => void;
|
|
9
8
|
onExpireWarning?: (warning: PublicWarning) => void;
|
|
10
9
|
onWithdrawWarning?: (warning: PublicWarning) => void;
|
|
10
|
+
}
|
|
11
|
+
interface WarningListItemMenuProps extends WarningListItemActions {
|
|
12
|
+
warning: PublicWarning;
|
|
11
13
|
t: TFunction;
|
|
12
14
|
}
|
|
13
15
|
declare const WarningListItemMenu: ({ warning, onEditWarning, onDeleteWarning, onDeleteReviewWarning, onExpireWarning, onWithdrawWarning, t, }: WarningListItemMenuProps) => MenuItemType[];
|