@opengeoweb/warnings 9.25.2 → 9.25.3

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.
Files changed (2) hide show
  1. package/index.esm.js +29 -4
  2. package/package.json +1 -1
package/index.esm.js CHANGED
@@ -1652,6 +1652,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
1652
1652
  *
1653
1653
  * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1654
1654
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
1655
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
1655
1656
  * */
1656
1657
  const objectDialogType = uiTypes.DialogTypes.ObjectManager;
1657
1658
  const drawingDialogType = uiTypes.DialogTypes.DrawingTool;
@@ -1672,6 +1673,7 @@ const areaObjectLoaderType = uiTypes.DialogTypes.AreaObjectLoader;
1672
1673
  *
1673
1674
  * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1674
1675
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
1676
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
1675
1677
  * */
1676
1678
  const drawAdapter = createEntityAdapter({
1677
1679
  selectId: draw => draw.drawingInstanceId
@@ -1768,6 +1770,7 @@ const drawActions = slice$2.actions;
1768
1770
  *
1769
1771
  * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1770
1772
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
1773
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
1771
1774
  * */
1772
1775
  const {
1773
1776
  selectById: selectDrawByInstanceId
@@ -1802,6 +1805,7 @@ const useWarningsTranslation = () => useTranslation(ns);
1802
1805
  *
1803
1806
  * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1804
1807
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
1808
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
1805
1809
  * */
1806
1810
  const confirmationDialogOptions = t => {
1807
1811
  return {
@@ -2741,6 +2745,7 @@ $$g({ target: 'Array', proto: true, arity: 1, forced: FORCED$4 }, {
2741
2745
  *
2742
2746
  * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2743
2747
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
2748
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
2744
2749
  * */
2745
2750
  const DATE_FORMAT_HEADER = 'EEEE, MMMM dd';
2746
2751
 
@@ -3155,6 +3160,7 @@ const ObjectManager = ({
3155
3160
  *
3156
3161
  * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
3157
3162
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
3163
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
3158
3164
  * */
3159
3165
  const API_NAME = 'warnings';
3160
3166
  const getIdFromUrl = url => {
@@ -3286,6 +3292,7 @@ const ConfirmDeleteDialog = ({
3286
3292
  *
3287
3293
  * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
3288
3294
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
3295
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
3289
3296
  * */
3290
3297
  const publicWarningDialogType = uiTypes.DialogTypes.PublicWarnings;
3291
3298
 
@@ -3691,6 +3698,7 @@ $$c({ target: 'Array', proto: true, forced: FORCED$2 }, {
3691
3698
  *
3692
3699
  * Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
3693
3700
  * Copyright 2024 - Finnish Meteorological Institute (FMI)
3701
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
3694
3702
  * */
3695
3703
  const emptyFilter = {
3696
3704
  id: 'empty',
@@ -3916,6 +3924,7 @@ const publicWarningActions = slice$1.actions;
3916
3924
  *
3917
3925
  * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
3918
3926
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
3927
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
3919
3928
  * */
3920
3929
  const TAKEOVER_MESSAGE = 'You are no longer the editor of this warning';
3921
3930
  const initialState = {};
@@ -8217,7 +8226,7 @@ var warningListJSON = [
8217
8226
  phenomenon: "wind",
8218
8227
  areas: [
8219
8228
  {
8220
- objectName: "test name",
8229
+ objectName: "wind test name",
8221
8230
  geoJSON: {
8222
8231
  type: "FeatureCollection",
8223
8232
  features: [
@@ -8321,7 +8330,7 @@ var warningListJSON = [
8321
8330
  phenomenon: "highTemp",
8322
8331
  areas: [
8323
8332
  {
8324
- objectName: "test name",
8333
+ objectName: "high temp test name",
8325
8334
  geoJSON: {
8326
8335
  type: "FeatureCollection",
8327
8336
  features: [
@@ -9471,6 +9480,7 @@ var warningListJSON = [
9471
9480
  *
9472
9481
  * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9473
9482
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
9483
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
9474
9484
  * */
9475
9485
  const drawingList = drawingListJSON;
9476
9486
  const drawingsListFullContent = drawingsListFullContentJSON;
@@ -9766,6 +9776,7 @@ $$8({ global: true, forced: parseInt !== $parseInt }, {
9766
9776
  *
9767
9777
  * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9768
9778
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
9779
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
9769
9780
  * */
9770
9781
  const useFormDirty = ({
9771
9782
  isDirty,
@@ -11245,7 +11256,8 @@ const Form = ({
11245
11256
  formState: {
11246
11257
  dirtyFields
11247
11258
  },
11248
- getValues
11259
+ getValues,
11260
+ setValue
11249
11261
  } = useFormContext();
11250
11262
  const {
11251
11263
  toggleIsDraft,
@@ -11284,10 +11296,19 @@ const Form = ({
11284
11296
  reset(getEmptyPublicWarning());
11285
11297
  setWarningGeoJSONFeature(undefined);
11286
11298
  };
11299
+ const publicWarningId = publicWarningDetails === null || publicWarningDetails === void 0 ? void 0 : publicWarningDetails.id;
11287
11300
  React.useEffect(() => {
11288
11301
  // sync redux with react-hook-form
11289
11302
  reset(getFormData(publicWarningDetails, object));
11290
- }, [object, reset, publicWarningDetails]);
11303
+ // eslint-disable-next-line react-hooks/exhaustive-deps
11304
+ }, [publicWarningId]);
11305
+ const areas = publicWarningDetails === null || publicWarningDetails === void 0 ? void 0 : publicWarningDetails.areas;
11306
+ React.useEffect(() => {
11307
+ // sync redux with react-hook-form
11308
+ if (areas) {
11309
+ setValue('areas', areas);
11310
+ }
11311
+ }, [areas, setValue]);
11291
11312
  React.useEffect(() => {
11292
11313
  // sync drawing on map with selected warning
11293
11314
  setWarningGeoJSONFeature(initialPublicWarningArea);
@@ -11547,6 +11568,7 @@ const PublicWarningsForm = props => {
11547
11568
  *
11548
11569
  * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
11549
11570
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
11571
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
11550
11572
  * */
11551
11573
  const getPublicWarningStore = store => {
11552
11574
  if (store && store.publicWarningForm) {
@@ -14784,6 +14806,7 @@ publicWarningFormListener.startListening({
14784
14806
  *
14785
14807
  * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
14786
14808
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
14809
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
14787
14810
  * */
14788
14811
  const getLastUpdatedTimeFormatted = () => dateUtils.dateToString(dateUtils.utc(), dateUtils.DATE_FORMAT_HOURS);
14789
14812
  const publicWarningsListener = createListenerMiddleware();
@@ -14839,6 +14862,7 @@ publicWarningsListener.startListening({
14839
14862
  *
14840
14863
  * Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
14841
14864
  * Copyright 2024 - Finnish Meteorological Institute (FMI)
14865
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
14842
14866
  * */
14843
14867
  const getSnackbarMessage = (objectName, id) => id ? `Object "${objectName}" ${translateKeyOutsideComponents('update-succes')}!` : `Object "${objectName}" ${translateKeyOutsideComponents('save-succes')}!`;
14844
14868
  const drawingsListener = createListenerMiddleware();
@@ -14911,6 +14935,7 @@ drawingsListener.startListening({
14911
14935
  *
14912
14936
  * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
14913
14937
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
14938
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
14914
14939
  * */
14915
14940
  const drawingModuleConfig = {
14916
14941
  id: 'drawing-module',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/warnings",
3
- "version": "9.25.2",
3
+ "version": "9.25.3",
4
4
  "description": "GeoWeb warinings library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {