@opengeoweb/warnings 13.0.0 → 13.2.1

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 CHANGED
@@ -1187,12 +1187,13 @@ var warningsDrawingsReducer = slice$2.reducer,
1187
1187
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
1188
1188
  * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
1189
1189
  * */
1190
+ var EMPTY_DRAW_STATE = {
1191
+ entities: {},
1192
+ ids: []
1193
+ };
1190
1194
  var _drawAdapter$getSelec = drawAdapter.getSelectors(function (state) {
1191
1195
  var _state$drawings;
1192
- return (_state$drawings = state == null ? void 0 : state.drawings) != null ? _state$drawings : {
1193
- entities: {},
1194
- ids: []
1195
- };
1196
+ return (_state$drawings = state == null ? void 0 : state.drawings) != null ? _state$drawings : EMPTY_DRAW_STATE;
1196
1197
  }),
1197
1198
  selectDrawByInstanceId = _drawAdapter$getSelec.selectById;
1198
1199
  var getWarningFormDirty = createSelector(selectDrawByInstanceId, function (drawing) {
@@ -7338,15 +7339,6 @@ var MaritimeWarningsFormConnect = function MaritimeWarningsFormConnect(_ref) {
7338
7339
  dispatch({
7339
7340
  type: 'submitWarnings'
7340
7341
  });
7341
- },
7342
- onError: function onError(error) {
7343
- // the BE_EDITOR_WARNING is handled in shouldGiveEditorWarning
7344
- if (error.message !== BE_EDITOR_WARNING) {
7345
- setError({
7346
- title: error.message,
7347
- severity: 'error'
7348
- });
7349
- }
7350
7342
  }
7351
7343
  });
7352
7344
  case 5:
@@ -7408,7 +7400,13 @@ var MaritimeWarningsFormConnect = function MaritimeWarningsFormConnect(_ref) {
7408
7400
  void updateEditor(false);
7409
7401
  }, [t, domainLabel, mutateEditor, domain, refetchWarnings, confirmDialog, showSnackbar]);
7410
7402
  useEffect(function () {
7411
- if (editorError && editorError.cause !== 409) {
7403
+ // the BE_EDITOR_WARNING is handled in shouldGiveEditorWarning
7404
+ if (publishError && publishError.message !== BE_EDITOR_WARNING) {
7405
+ setError({
7406
+ title: publishError.message,
7407
+ severity: 'error'
7408
+ });
7409
+ } else if (editorError && editorError.cause !== 409) {
7412
7410
  setError({
7413
7411
  title: editorError.message,
7414
7412
  severity: 'error'
@@ -7416,7 +7414,7 @@ var MaritimeWarningsFormConnect = function MaritimeWarningsFormConnect(_ref) {
7416
7414
  } else {
7417
7415
  setError(undefined);
7418
7416
  }
7419
- }, [editorError]);
7417
+ }, [editorError, publishError]);
7420
7418
  var shouldGiveEditorWarning = React__default.useCallback(function (newEditor, oldEditor) {
7421
7419
  var oldEditorIsYou = oldEditor && oldEditor === (auth == null ? void 0 : auth.username);
7422
7420
  if (oldEditorIsYou && (newEditor || publishError) && newEditor !== oldEditor) {
@@ -8473,49 +8471,47 @@ var PublicWarningsForm = function PublicWarningsForm(props) {
8473
8471
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
8474
8472
  * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
8475
8473
  * */
8476
- var getPublicWarningStore = function getPublicWarningStore(store) {
8474
+ var EMPTY_WARNING_FORM_STATE = {};
8475
+ var selectPublicWarningState = function selectPublicWarningState(store) {
8477
8476
  if (store && store.publicWarningForm) {
8478
8477
  return store.publicWarningForm;
8479
8478
  }
8480
- return {};
8479
+ return EMPTY_WARNING_FORM_STATE;
8481
8480
  };
8482
- var selectPublicWarningState = createSelector(getPublicWarningStore, function (state) {
8483
- return state;
8484
- });
8485
- createSelector(getPublicWarningStore, function (publicWarningStore) {
8481
+ createSelector(selectPublicWarningState, function (publicWarningStore) {
8486
8482
  return publicWarningStore.object;
8487
8483
  });
8488
- var getPublicWarning = createSelector(getPublicWarningStore, function (publicWarningStore) {
8484
+ var getPublicWarning = createSelector(selectPublicWarningState, function (publicWarningStore) {
8489
8485
  return publicWarningStore == null ? void 0 : publicWarningStore.warning;
8490
8486
  });
8491
- var getPublicWarningStatus = createSelector(getPublicWarningStore, function (publicWarningStore) {
8487
+ var getPublicWarningStatus = createSelector(selectPublicWarningState, function (publicWarningStore) {
8492
8488
  var _publicWarningStore$w;
8493
8489
  return publicWarningStore == null || (_publicWarningStore$w = publicWarningStore.warning) == null ? void 0 : _publicWarningStore$w.status;
8494
8490
  });
8495
- var getPublicWarningId = createSelector(getPublicWarningStore, function (publicWarningStore) {
8491
+ var getPublicWarningId = createSelector(selectPublicWarningState, function (publicWarningStore) {
8496
8492
  var _publicWarningStore$w2;
8497
8493
  return publicWarningStore == null || (_publicWarningStore$w2 = publicWarningStore.warning) == null ? void 0 : _publicWarningStore$w2.warningDetail.id;
8498
8494
  });
8499
- var getPublicWarningAreas = createSelector(getPublicWarningStore, function (publicWarningStore) {
8495
+ var getPublicWarningAreas = createSelector(selectPublicWarningState, function (publicWarningStore) {
8500
8496
  var _publicWarningStore$w3;
8501
8497
  return (publicWarningStore == null || (_publicWarningStore$w3 = publicWarningStore.warning) == null ? void 0 : _publicWarningStore$w3.warningDetail.areas) || [];
8502
8498
  });
8503
- var getPublicWarningFormState = createSelector(getPublicWarningStore, function (publicWarningStore) {
8499
+ var getPublicWarningFormState = createSelector(selectPublicWarningState, function (publicWarningStore) {
8504
8500
  return (publicWarningStore == null ? void 0 : publicWarningStore.formState) || '';
8505
8501
  });
8506
- createSelector(getPublicWarningStore, function (publicWarningStore) {
8502
+ createSelector(selectPublicWarningState, function (publicWarningStore) {
8507
8503
  return publicWarningStore == null ? void 0 : publicWarningStore.error;
8508
8504
  });
8509
- var getSelectedWarningId = createSelector(getPublicWarningStore, function (publicWarningStore) {
8505
+ var getSelectedWarningId = createSelector(selectPublicWarningState, function (publicWarningStore) {
8510
8506
  return (publicWarningStore == null ? void 0 : publicWarningStore.selectedWarningId) || '';
8511
8507
  });
8512
- var getSelectedPublicIsFormDirty = createSelector(getPublicWarningStore, function (publicWarningStore) {
8508
+ var getSelectedPublicIsFormDirty = createSelector(selectPublicWarningState, function (publicWarningStore) {
8513
8509
  return (publicWarningStore == null ? void 0 : publicWarningStore.isFormDirty) || false;
8514
8510
  });
8515
- var getWarningType = createSelector(getPublicWarningStore, function (publicWarningStore) {
8511
+ var getWarningType = createSelector(selectPublicWarningState, function (publicWarningStore) {
8516
8512
  return publicWarningStore == null ? void 0 : publicWarningStore.warningType;
8517
8513
  });
8518
- var getPublicWarningPanelId = createSelector(getPublicWarningStore, function (publicWarningStore) {
8514
+ var getPublicWarningPanelId = createSelector(selectPublicWarningState, function (publicWarningStore) {
8519
8515
  return (publicWarningStore == null ? void 0 : publicWarningStore.panelId) || '';
8520
8516
  });
8521
8517
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/warnings",
3
- "version": "13.0.0",
3
+ "version": "13.2.1",
4
4
  "description": "GeoWeb warinings library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -8,25 +8,25 @@
8
8
  "url": "git@gitlab.com:opengeoweb/opengeoweb.git"
9
9
  },
10
10
  "dependencies": {
11
- "@opengeoweb/api": "13.0.0",
12
- "@opengeoweb/shared": "13.0.0",
13
- "@opengeoweb/store": "13.0.0",
14
- "@opengeoweb/webmap-react": "13.0.0",
11
+ "@opengeoweb/api": "13.2.1",
12
+ "@opengeoweb/shared": "13.2.1",
13
+ "@opengeoweb/store": "13.2.1",
14
+ "@opengeoweb/webmap-react": "13.2.1",
15
15
  "@tanstack/react-query": "^5.85.5",
16
16
  "react-redux": "^9.2.0",
17
- "@opengeoweb/theme": "13.0.0",
18
- "@opengeoweb/form-fields": "13.0.0",
17
+ "@opengeoweb/theme": "13.2.1",
18
+ "@opengeoweb/form-fields": "13.2.1",
19
19
  "react-hook-form": "^7.50.1",
20
20
  "lodash": "^4.17.21",
21
21
  "@reduxjs/toolkit": "^2.6.1",
22
- "@opengeoweb/snackbar": "13.0.0",
22
+ "@opengeoweb/snackbar": "13.2.1",
23
23
  "react-window": "^1.8.10",
24
24
  "react-virtualized-auto-sizer": "^1.0.20",
25
25
  "axios": "^1.7.7",
26
- "@opengeoweb/core": "13.0.0",
27
- "@opengeoweb/webmap": "13.0.0",
28
- "@opengeoweb/authentication": "13.0.0",
29
- "@opengeoweb/sigmet-airmet": "13.0.0",
26
+ "@opengeoweb/core": "13.2.1",
27
+ "@opengeoweb/webmap": "13.2.1",
28
+ "@opengeoweb/authentication": "13.2.1",
29
+ "@opengeoweb/sigmet-airmet": "13.2.1",
30
30
  "react-i18next": "^15.1.1",
31
31
  "i18next": "^25.0.1",
32
32
  "@mui/material": "^7.0.1",
@@ -1,27 +1,6 @@
1
1
  import { WarningModuleStore } from '../types';
2
2
  import { WarningFormState } from './reducer';
3
- export declare const getPublicWarningStore: (store: WarningModuleStore) => WarningFormState;
4
- export declare const selectPublicWarningState: ((state: WarningModuleStore) => WarningFormState) & {
5
- clearCache: () => void;
6
- resultsCount: () => number;
7
- resetResultsCount: () => void;
8
- } & {
9
- resultFunc: (resultFuncArgs_0: WarningFormState) => WarningFormState;
10
- memoizedResultFunc: ((resultFuncArgs_0: WarningFormState) => WarningFormState) & {
11
- clearCache: () => void;
12
- resultsCount: () => number;
13
- resetResultsCount: () => void;
14
- };
15
- lastResult: () => WarningFormState;
16
- dependencies: [(store: WarningModuleStore) => WarningFormState];
17
- recomputations: () => number;
18
- resetRecomputations: () => void;
19
- dependencyRecomputations: () => number;
20
- resetDependencyRecomputations: () => void;
21
- } & {
22
- argsMemoize: typeof import("reselect").weakMapMemoize;
23
- memoize: typeof import("reselect").weakMapMemoize;
24
- };
3
+ export declare const selectPublicWarningState: (store: WarningModuleStore) => WarningFormState;
25
4
  export declare const getPublicWarningObject: ((state: WarningModuleStore) => import("../warningsDrawings/types").DrawingListItem | undefined) & {
26
5
  clearCache: () => void;
27
6
  resultsCount: () => number;