@opengeoweb/warnings 13.0.0 → 13.1.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
@@ -7338,15 +7338,6 @@ var MaritimeWarningsFormConnect = function MaritimeWarningsFormConnect(_ref) {
7338
7338
  dispatch({
7339
7339
  type: 'submitWarnings'
7340
7340
  });
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
7341
  }
7351
7342
  });
7352
7343
  case 5:
@@ -7408,7 +7399,13 @@ var MaritimeWarningsFormConnect = function MaritimeWarningsFormConnect(_ref) {
7408
7399
  void updateEditor(false);
7409
7400
  }, [t, domainLabel, mutateEditor, domain, refetchWarnings, confirmDialog, showSnackbar]);
7410
7401
  useEffect(function () {
7411
- if (editorError && editorError.cause !== 409) {
7402
+ // the BE_EDITOR_WARNING is handled in shouldGiveEditorWarning
7403
+ if (publishError && publishError.message !== BE_EDITOR_WARNING) {
7404
+ setError({
7405
+ title: publishError.message,
7406
+ severity: 'error'
7407
+ });
7408
+ } else if (editorError && editorError.cause !== 409) {
7412
7409
  setError({
7413
7410
  title: editorError.message,
7414
7411
  severity: 'error'
@@ -7416,7 +7413,7 @@ var MaritimeWarningsFormConnect = function MaritimeWarningsFormConnect(_ref) {
7416
7413
  } else {
7417
7414
  setError(undefined);
7418
7415
  }
7419
- }, [editorError]);
7416
+ }, [editorError, publishError]);
7420
7417
  var shouldGiveEditorWarning = React__default.useCallback(function (newEditor, oldEditor) {
7421
7418
  var oldEditorIsYou = oldEditor && oldEditor === (auth == null ? void 0 : auth.username);
7422
7419
  if (oldEditorIsYou && (newEditor || publishError) && newEditor !== oldEditor) {
@@ -8473,49 +8470,46 @@ var PublicWarningsForm = function PublicWarningsForm(props) {
8473
8470
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
8474
8471
  * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
8475
8472
  * */
8476
- var getPublicWarningStore = function getPublicWarningStore(store) {
8473
+ var selectPublicWarningState = function selectPublicWarningState(store) {
8477
8474
  if (store && store.publicWarningForm) {
8478
8475
  return store.publicWarningForm;
8479
8476
  }
8480
8477
  return {};
8481
8478
  };
8482
- var selectPublicWarningState = createSelector(getPublicWarningStore, function (state) {
8483
- return state;
8484
- });
8485
- createSelector(getPublicWarningStore, function (publicWarningStore) {
8479
+ createSelector(selectPublicWarningState, function (publicWarningStore) {
8486
8480
  return publicWarningStore.object;
8487
8481
  });
8488
- var getPublicWarning = createSelector(getPublicWarningStore, function (publicWarningStore) {
8482
+ var getPublicWarning = createSelector(selectPublicWarningState, function (publicWarningStore) {
8489
8483
  return publicWarningStore == null ? void 0 : publicWarningStore.warning;
8490
8484
  });
8491
- var getPublicWarningStatus = createSelector(getPublicWarningStore, function (publicWarningStore) {
8485
+ var getPublicWarningStatus = createSelector(selectPublicWarningState, function (publicWarningStore) {
8492
8486
  var _publicWarningStore$w;
8493
8487
  return publicWarningStore == null || (_publicWarningStore$w = publicWarningStore.warning) == null ? void 0 : _publicWarningStore$w.status;
8494
8488
  });
8495
- var getPublicWarningId = createSelector(getPublicWarningStore, function (publicWarningStore) {
8489
+ var getPublicWarningId = createSelector(selectPublicWarningState, function (publicWarningStore) {
8496
8490
  var _publicWarningStore$w2;
8497
8491
  return publicWarningStore == null || (_publicWarningStore$w2 = publicWarningStore.warning) == null ? void 0 : _publicWarningStore$w2.warningDetail.id;
8498
8492
  });
8499
- var getPublicWarningAreas = createSelector(getPublicWarningStore, function (publicWarningStore) {
8493
+ var getPublicWarningAreas = createSelector(selectPublicWarningState, function (publicWarningStore) {
8500
8494
  var _publicWarningStore$w3;
8501
8495
  return (publicWarningStore == null || (_publicWarningStore$w3 = publicWarningStore.warning) == null ? void 0 : _publicWarningStore$w3.warningDetail.areas) || [];
8502
8496
  });
8503
- var getPublicWarningFormState = createSelector(getPublicWarningStore, function (publicWarningStore) {
8497
+ var getPublicWarningFormState = createSelector(selectPublicWarningState, function (publicWarningStore) {
8504
8498
  return (publicWarningStore == null ? void 0 : publicWarningStore.formState) || '';
8505
8499
  });
8506
- createSelector(getPublicWarningStore, function (publicWarningStore) {
8500
+ createSelector(selectPublicWarningState, function (publicWarningStore) {
8507
8501
  return publicWarningStore == null ? void 0 : publicWarningStore.error;
8508
8502
  });
8509
- var getSelectedWarningId = createSelector(getPublicWarningStore, function (publicWarningStore) {
8503
+ var getSelectedWarningId = createSelector(selectPublicWarningState, function (publicWarningStore) {
8510
8504
  return (publicWarningStore == null ? void 0 : publicWarningStore.selectedWarningId) || '';
8511
8505
  });
8512
- var getSelectedPublicIsFormDirty = createSelector(getPublicWarningStore, function (publicWarningStore) {
8506
+ var getSelectedPublicIsFormDirty = createSelector(selectPublicWarningState, function (publicWarningStore) {
8513
8507
  return (publicWarningStore == null ? void 0 : publicWarningStore.isFormDirty) || false;
8514
8508
  });
8515
- var getWarningType = createSelector(getPublicWarningStore, function (publicWarningStore) {
8509
+ var getWarningType = createSelector(selectPublicWarningState, function (publicWarningStore) {
8516
8510
  return publicWarningStore == null ? void 0 : publicWarningStore.warningType;
8517
8511
  });
8518
- var getPublicWarningPanelId = createSelector(getPublicWarningStore, function (publicWarningStore) {
8512
+ var getPublicWarningPanelId = createSelector(selectPublicWarningState, function (publicWarningStore) {
8519
8513
  return (publicWarningStore == null ? void 0 : publicWarningStore.panelId) || '';
8520
8514
  });
8521
8515
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/warnings",
3
- "version": "13.0.0",
3
+ "version": "13.1.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.1.1",
12
+ "@opengeoweb/shared": "13.1.1",
13
+ "@opengeoweb/store": "13.1.1",
14
+ "@opengeoweb/webmap-react": "13.1.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.1.1",
18
+ "@opengeoweb/form-fields": "13.1.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.1.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.1.1",
27
+ "@opengeoweb/webmap": "13.1.1",
28
+ "@opengeoweb/authentication": "13.1.1",
29
+ "@opengeoweb/sigmet-airmet": "13.1.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;