@opengeoweb/warnings 20.2.0 → 21.0.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.
@@ -3,6 +3,7 @@ import type { MaritimeWarningsConfig } from '../../components/MaritimeWarningsFo
3
3
  import type { DrawingFromBE, DrawingFromFE, DrawingListItem, FetchDrawingParams } from '../../store/warningsDrawings/types';
4
4
  import type { MaritimeWarning, MaritimeWarningsType, PublicWarning, WarningEvent, WarningEventsConfig } from '../../store/warningsForm/types';
5
5
  export declare const getPublicWarningList: (auth: Credentials, apiParams?: Record<string, string>) => Promise<PublicWarning[]>;
6
+ export declare const getPublicWarningById: (warningId: string, auth: Credentials) => Promise<PublicWarning>;
6
7
  export declare const updatePublicWarningEditor: (warningId: string, isEditor: boolean, auth: Credentials, force?: boolean) => Promise<Headers | null>;
7
8
  export declare const updatePublicWarning: (warningId: string, auth: Credentials, data: PublicWarning) => Promise<Headers | null>;
8
9
  export declare const postPublicWarning: (auth: Credentials, data: PublicWarning) => Promise<Headers | null>;
@@ -27,6 +27,7 @@ interface UpdateWarningProps {
27
27
  panelId?: string;
28
28
  }
29
29
  export declare const useMutateWarning: (snackBarMessage: string) => MutationReturnType<UpdateWarningProps>;
30
+ export declare const useFetchPublicWarning: () => ((id: string) => Promise<PublicWarning>);
30
31
  export declare const useMutateDeleteWarning: () => MutationReturnType<{
31
32
  id: string;
32
33
  }>;
@@ -6,6 +6,7 @@ export declare enum Domain {
6
6
  public = "public"
7
7
  }
8
8
  export declare enum Level {
9
+ minor = "minor",
9
10
  extreme = "extreme",
10
11
  moderate = "moderate",
11
12
  severe = "severe",
@@ -1,6 +1,6 @@
1
1
  import type { GridProps } from '@mui/material';
2
2
  import React from 'react';
3
- import { PublicWarningStatus } from '../../store/warningsForm/types';
3
+ import type { PublicWarningStatus } from '../../store/warningsForm/types';
4
4
  export declare const WarningListColumnContent: React.FC<GridProps & {
5
5
  title?: string;
6
6
  status: PublicWarningStatus;
@@ -7,6 +7,7 @@ export interface ColorDefinition {
7
7
  }
8
8
  export interface LevelDetails extends FilterTranslation, ColorDefinition {
9
9
  }
10
+ export declare const MinorLevelColors: ColorDefinition;
10
11
  export declare enum WarningLevel {
11
12
  moderate = "moderate",
12
13
  severe = "severe",
@@ -0,0 +1,6 @@
1
+ import type { SxProps, Theme } from '@mui/material';
2
+ import type { ReactElement, ReactNode } from 'react';
3
+ export declare const MinorLevelChip: ({ children, sx, }: {
4
+ children?: ReactNode;
5
+ sx?: SxProps<Theme>;
6
+ }) => ReactElement;
@@ -1 +1,2 @@
1
1
  export * from './LevelField';
2
+ export * from './MinorLevelChip';
@@ -20,13 +20,13 @@ export interface FormProps {
20
20
  defaultMapPreset?: MapPreset;
21
21
  onSaveForm?: (formValues: PublicWarningDetail) => Promise<Headers | null>;
22
22
  onPublishForm?: (formValues: PublicWarningDetail) => Promise<Headers | null>;
23
- onClearForm?: () => void;
24
23
  onCloseForm?: () => void;
25
24
  onSaveAviationForm?: (productToPost: AviationProduct, newStatus: ProductStatus, warningType: 'sigmet' | 'airmet', vaSigmetMoveToFIR?: string, setSelectedUUID?: (uuid: string) => void) => Promise<SigmetFromBackend | AirmetFromBackend | undefined>;
26
25
  object?: DrawingListItem;
27
26
  publicWarningDetails?: PublicWarningDetail;
28
27
  error?: FormError;
29
28
  isReadOnly?: boolean;
29
+ isExpiryMessage?: boolean;
30
30
  onFormDirty?: (isFormDirty: boolean) => void;
31
31
  isSnapshot?: boolean;
32
32
  onAddDrawing?: () => void;
@@ -44,8 +44,10 @@ export interface FormProps {
44
44
  isDrawPolygonActive?: boolean;
45
45
  isDrawingModeActive?: boolean;
46
46
  publicWarningStatus?: PublicWarningStatus;
47
+ isPublicUpdateDraft?: boolean;
47
48
  }
48
49
  export declare function warningLevelFeatureColors(level: WarningLevel | undefined, geoJSON: FeatureCollection<Geometry, GeoJsonProperties> | undefined, // Allow undefined
49
- isAviationWarning?: boolean): FeatureCollection<Geometry, GeoJsonProperties>;
50
+ isAviationWarning?: boolean, // Determines if it's an aviation warning
51
+ isExpiryMessage?: boolean): FeatureCollection<Geometry, GeoJsonProperties>;
50
52
  export declare const PublicWarningsForm: React.FC<FormProps>;
51
53
  export {};
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import type { TickType } from './warningsTimelineUtils';
2
+ import type { TickType, TimelineLayout } from './warningsTimelineUtils';
3
3
  import type { Warning } from '../../store/warningsForm/types';
4
4
  import type { WarningListItemActions } from '../PublicWarningList/WarningListItemMenu';
5
5
  export interface PositionedTick {
@@ -16,6 +16,8 @@ export interface WarningLayout {
16
16
  }
17
17
  interface TimelineBackgroundProps {
18
18
  contentWidth: number;
19
+ layout: TimelineLayout;
20
+ visibleHours: number;
19
21
  scrollContainer: HTMLDivElement | null;
20
22
  timelineEnd: Date;
21
23
  timelineStart: Date;
@@ -13,4 +13,4 @@ export interface BlockStyle {
13
13
  iconColor: string;
14
14
  letterColor: string;
15
15
  }
16
- export declare const getBlockStyle: (level: WarningLevel | null, status: PublicWarningStatus | undefined, isAviation: boolean) => BlockStyle;
16
+ export declare const getBlockStyle: (level: WarningLevel | null, status: PublicWarningStatus | undefined, isAviation: boolean, isExpiryMessage?: boolean) => BlockStyle;
@@ -1,7 +1,16 @@
1
1
  import type { Warning } from '../../store/warningsForm/types';
2
2
  import { PublicWarningStatus } from '../../store/warningsForm/types';
3
+ export interface TimelineLayout {
4
+ fontSize: number;
5
+ headerHeight: number;
6
+ weekday: 'long' | 'short' | undefined;
7
+ stackWeekLabels: boolean;
8
+ axisLabelSpacing: number;
9
+ }
10
+ export declare const getTimelineLayout: (viewportWidth: number, visibleHours: number) => TimelineLayout;
3
11
  export declare const EDGE_PADDING = 24;
4
12
  export declare const getEffectiveStatus: (warning: Warning) => PublicWarningStatus;
13
+ export declare const getWarningSectionStatus: (warning: Warning) => PublicWarningStatus;
5
14
  export declare const compareWarningsByStatus: (warningA: Warning, warningB: Warning) => number;
6
15
  export type TickType = 'day' | 'major' | 'dashed';
7
16
  export interface Tick {
@@ -9,11 +18,8 @@ export interface Tick {
9
18
  type: TickType;
10
19
  }
11
20
  export type BlockSize = 'xxs' | 'xs' | 's' | 'l';
12
- export declare const getTimelineX: (targetTime: Date, timelineStart: Date, timelineEnd: Date, drawableWidth: number) => number;
13
- export declare const getTimeFromX: (x: number, timelineStart: Date, timelineEnd: Date, drawableWidth: number) => Date;
14
- export declare const generateTicks: (timelineStart: Date, timelineEnd: Date) => Tick[];
15
- export declare const getTickLineStyle: (tickType: TickType) => {
16
- width: string;
17
- borderLeft: string;
18
- };
21
+ export declare const getTimelineX: (targetTime: Date, timelineStart: Date, timelineEnd: Date, drawableWidth: number, edgePadding?: number) => number;
22
+ export declare const getTimeFromX: (x: number, timelineStart: Date, timelineEnd: Date, drawableWidth: number, edgePadding?: number) => Date;
23
+ export declare const generateTicks: (timelineStart: Date, timelineEnd: Date, intervalHours?: number) => Tick[];
19
24
  export declare const getBlockSize: (width: number) => BlockSize;
25
+ export declare const getTimelineTickHours: (pixelsPerHour: number) => number;
@@ -33,11 +33,18 @@ export declare enum PublicWarningStatus {
33
33
  DRAFT = "DRAFT",
34
34
  DRAFT_PUBLISHED = "DRAFT_PUBLISHED",
35
35
  PUBLISHED = "PUBLISHED",
36
+ UPDATED = "UPDATED",
36
37
  TODO = "TODO",
37
38
  EXPIRED = "EXPIRED",
38
39
  IGNORED = "IGNORED",
39
40
  WITHDRAWN = "WITHDRAWN"
40
41
  }
42
+ export declare enum PublicWarningGwType {
43
+ ORIGINAL = "ORIGINAL",
44
+ UPDATE = "UPDATE",
45
+ EXPIRE = "EXPIRE",
46
+ WITHDRAW = "WITHDRAW"
47
+ }
41
48
  export declare enum MaritimeWarningAction {
42
49
  SELECT = "SELECT",
43
50
  UPDATE = "UPDATE",
@@ -55,6 +62,9 @@ interface BaseWarning {
55
62
  }
56
63
  export interface PublicWarning extends BaseWarning {
57
64
  type: 'public';
65
+ gw_type?: PublicWarningGwType | null;
66
+ previous_id?: string | null;
67
+ next_id?: string | null;
58
68
  }
59
69
  export interface AirmetWarning extends BaseWarning {
60
70
  type: 'airmet';
@@ -1,4 +1,6 @@
1
1
  import { uiTypes } from '@opengeoweb/store';
2
+ import { PublicWarningStatus } from './types';
2
3
  export declare const publicWarningDialogType = uiTypes.DialogTypes.PublicWarnings;
4
+ export declare const isEndedStatus: (status?: PublicWarningStatus) => boolean;
3
5
  export declare const warningEventDialogType = uiTypes.DialogTypes.WarningsEvent;
4
6
  export declare const warningEventsSummaryDialogType = uiTypes.DialogTypes.WarningsEventSummary;
@@ -13,6 +13,9 @@ interface OverflowCheckResult {
13
13
  isOverflowing: boolean;
14
14
  }
15
15
  export declare const getSortedStatus: (status: PublicWarningStatus) => PublicWarningStatus;
16
+ export declare const isExpireMessage: (warning?: Warning) => boolean;
17
+ export declare const isExpireOrWithdrawMessage: (warning: Warning) => boolean;
18
+ export declare const isPublicUpdateDraft: (warning?: Warning) => boolean;
16
19
  export declare const getWarningWithoutIdStatusEditor: (warning: Warning) => Warning;
17
20
  export declare const getWarningWithLinkedToId: (warning: Warning) => Warning;
18
21
  export declare const getWarningWithProposalId: (warning: Warning) => Warning;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/warnings",
3
- "version": "20.2.0",
3
+ "version": "21.0.0",
4
4
  "description": "GeoWeb warinings library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -20,24 +20,24 @@
20
20
  }
21
21
  },
22
22
  "dependencies": {
23
- "@opengeoweb/api": "20.2.0",
24
- "@opengeoweb/shared": "20.2.0",
25
- "@opengeoweb/store": "20.2.0",
26
- "@opengeoweb/webmap-react": "20.2.0",
23
+ "@opengeoweb/api": "21.0.0",
24
+ "@opengeoweb/shared": "21.0.0",
25
+ "@opengeoweb/store": "21.0.0",
26
+ "@opengeoweb/webmap-react": "21.0.0",
27
27
  "@tanstack/react-query": "^5.85.5",
28
28
  "react-redux": "^9.2.0",
29
- "@opengeoweb/theme": "20.2.0",
30
- "@opengeoweb/form-fields": "20.2.0",
29
+ "@opengeoweb/theme": "21.0.0",
30
+ "@opengeoweb/form-fields": "21.0.0",
31
31
  "react-hook-form": "^7.50.1",
32
32
  "lodash": "^4.18.1",
33
33
  "@reduxjs/toolkit": "^2.6.1",
34
- "@opengeoweb/snackbar": "20.2.0",
34
+ "@opengeoweb/snackbar": "21.0.0",
35
35
  "react-window": "^2.2.6",
36
36
  "axios": "^1.20.0",
37
- "@opengeoweb/core": "20.2.0",
38
- "@opengeoweb/webmap": "20.2.0",
39
- "@opengeoweb/authentication": "20.2.0",
40
- "@opengeoweb/sigmet-airmet": "20.2.0",
37
+ "@opengeoweb/core": "21.0.0",
38
+ "@opengeoweb/webmap": "21.0.0",
39
+ "@opengeoweb/authentication": "21.0.0",
40
+ "@opengeoweb/sigmet-airmet": "21.0.0",
41
41
  "react-i18next": "^15.1.1",
42
42
  "i18next": "^25.0.1",
43
43
  "@mui/material": "^9.0.1",