@opengeoweb/warnings 8.2.0 → 8.3.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.
Files changed (23) hide show
  1. package/index.esm.js +688 -354
  2. package/package.json +14 -13
  3. package/src/lib/components/DrawingTool/DrawingTool.stories.d.ts +2 -2
  4. package/src/lib/components/DrawingTool/DrawingToolConnect.d.ts +1 -2
  5. package/src/lib/components/DrawingTool/DrawingToolDialog.d.ts +0 -1
  6. package/src/lib/components/ObjectManager/ObjectManager.d.ts +3 -0
  7. package/src/lib/components/ObjectManager/Objects.d.ts +8 -0
  8. package/src/lib/components/PublicWarnings/PublicWarnings.d.ts +1 -0
  9. package/src/lib/components/PublicWarnings/PublicWarningsConnect.d.ts +0 -1
  10. package/src/lib/components/PublicWarningsForm/AreaField.d.ts +5 -0
  11. package/src/lib/components/PublicWarningsForm/PublicWarningsForm.d.ts +13 -2
  12. package/src/lib/components/PublicWarningsForm/PublicWarningsForm.stories.d.ts +8 -0
  13. package/src/lib/components/PublicWarningsForm/PublicWarningsFormConnect.d.ts +2 -0
  14. package/src/lib/components/PublicWarningsForm/index.d.ts +1 -0
  15. package/src/lib/store/config.d.ts +3 -0
  16. package/src/lib/store/drawings/types.d.ts +14 -1
  17. package/src/lib/store/publicWarningForm/reducer.d.ts +12 -0
  18. package/src/lib/store/publicWarningForm/reducer.spec.d.ts +1 -0
  19. package/src/lib/store/publicWarningForm/selectors.d.ts +8 -0
  20. package/src/lib/store/publicWarningForm/selectors.spec.d.ts +1 -0
  21. package/src/lib/store/publicWarningForm/utils.d.ts +2 -0
  22. package/src/lib/utils/constants.d.ts +2 -0
  23. /package/src/lib/components/{DrawingToolForm/DrawingToolFormConnect.spec.d.ts → PublicWarningsForm/PublicWarningsFormConnect.spec.d.ts} +0 -0
package/index.esm.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import * as React from 'react';
2
2
  import React__default, { useContext, useRef, useCallback, useDebugValue, Fragment, useState, useEffect } from 'react';
3
3
  import 'react-dom';
4
- import { Polygons, Edit, Delete, DrawPolygon, Visibility, Add, breakpoints } from '@opengeoweb/theme';
5
- import { uiActions, uiTypes, getSingularDrawtoolDrawLayerId, drawtoolSelectors, layerSelectors, uiSelectors, mapStoreActions, drawtoolActions, layerActions, snackbarActions, getGeoJSONPropertyValue } from '@opengeoweb/store';
6
- import { emptyGeoJSON, MapControlButton, getIcon, currentlySupportedDrawModes } from '@opengeoweb/webmap-react';
4
+ import { Polygons, Share, ExitDomain, Edit, Delete, DrawPolygon, Visibility, Add, breakpoints, CoastalEvent, Fog, TemperatureHigh, TemperatureLow, Rain, Snow, Lightning, Wind } from '@opengeoweb/theme';
5
+ import { uiActions, uiTypes, getSingularDrawtoolDrawLayerId, drawtoolSelectors, layerSelectors, uiSelectors, mapStoreActions, drawtoolActions, layerActions, snackbarActions } from '@opengeoweb/store';
6
+ import { emptyGeoJSON, MapControlButton, getGeoJSONPropertyValue, getIcon, currentlySupportedDrawModes } from '@opengeoweb/webmap-react';
7
7
  import { useSetupDialog } from '@opengeoweb/core';
8
8
  import { dateUtils, ToggleMenu, calculateStartSize, ToolContainerDraggable, AlertBanner, ConfirmationDialog, getAxiosErrorMessage, CustomIconButton, SwitchButton, isAxiosError } from '@opengeoweb/shared';
9
- import { Typography, List, ListItem, Paper, ListItemButton, Box, Stack, LinearProgress, Grid, FormHelperText, MenuItem, Button, Tabs, Tab, FormControl, Card, CardContent, styled, FormControlLabel, Radio } from '@mui/material';
9
+ import { Typography, List, ListItem, Paper, ListItemButton, Stack, LinearProgress, Box, Button, Grid, FormHelperText, MenuItem, Tabs, Tab, FormControl, Card, CardContent, styled, ListItemIcon, FormControlLabel, Radio } from '@mui/material';
10
10
  import { getApi, createApiInstance, createNonAuthApiInstance, createFakeApiInstance, ApiProvider } from '@opengeoweb/api';
11
11
  import { ReactHookFormProvider, defaultFormOptions, ReactHookFormHiddenInput, isValidGeoJsonCoordinates, ReactHookFormSelect, ReactHookFormTextField, ReactHookFormDateTime, ReactHookFormRadioGroup } from '@opengeoweb/form-fields';
12
12
 
@@ -486,12 +486,12 @@ function getContext() {
486
486
 
487
487
  const ReactReduxContext = /*#__PURE__*/getContext();
488
488
 
489
- /**
490
- * Hook factory, which creates a `useReduxContext` hook bound to a given context. This is a low-level
491
- * hook that you should usually not need to call directly.
492
- *
493
- * @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.
494
- * @returns {Function} A `useReduxContext` hook bound to the specified context.
489
+ /**
490
+ * Hook factory, which creates a `useReduxContext` hook bound to a given context. This is a low-level
491
+ * hook that you should usually not need to call directly.
492
+ *
493
+ * @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.
494
+ * @returns {Function} A `useReduxContext` hook bound to the specified context.
495
495
  */
496
496
  function createReduxContextHook(context = ReactReduxContext) {
497
497
  return function useReduxContext() {
@@ -504,21 +504,21 @@ function createReduxContextHook(context = ReactReduxContext) {
504
504
  return contextValue;
505
505
  };
506
506
  }
507
- /**
508
- * A hook to access the value of the `ReactReduxContext`. This is a low-level
509
- * hook that you should usually not need to call directly.
510
- *
511
- * @returns {any} the value of the `ReactReduxContext`
512
- *
513
- * @example
514
- *
515
- * import React from 'react'
516
- * import { useReduxContext } from 'react-redux'
517
- *
518
- * export const CounterComponent = () => {
519
- * const { store } = useReduxContext()
520
- * return <div>{store.getState()}</div>
521
- * }
507
+ /**
508
+ * A hook to access the value of the `ReactReduxContext`. This is a low-level
509
+ * hook that you should usually not need to call directly.
510
+ *
511
+ * @returns {any} the value of the `ReactReduxContext`
512
+ *
513
+ * @example
514
+ *
515
+ * import React from 'react'
516
+ * import { useReduxContext } from 'react-redux'
517
+ *
518
+ * export const CounterComponent = () => {
519
+ * const { store } = useReduxContext()
520
+ * return <div>{store.getState()}</div>
521
+ * }
522
522
  */
523
523
 
524
524
  const useReduxContext = /*#__PURE__*/createReduxContextHook();
@@ -533,11 +533,11 @@ const initializeUseSelector = fn => {
533
533
  };
534
534
 
535
535
  const refEquality = (a, b) => a === b;
536
- /**
537
- * Hook factory, which creates a `useSelector` hook bound to a given context.
538
- *
539
- * @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.
540
- * @returns {Function} A `useSelector` hook bound to the specified context.
536
+ /**
537
+ * Hook factory, which creates a `useSelector` hook bound to a given context.
538
+ *
539
+ * @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.
540
+ * @returns {Function} A `useSelector` hook bound to the specified context.
541
541
  */
542
542
 
543
543
 
@@ -585,10 +585,21 @@ function createSelectorHook(context = ReactReduxContext) {
585
585
  const toCompare = selector(state);
586
586
 
587
587
  if (!equalityFn(selected, toCompare)) {
588
+ let stack = undefined;
589
+
590
+ try {
591
+ throw new Error();
592
+ } catch (e) {
593
+ ({
594
+ stack
595
+ } = e);
596
+ }
597
+
588
598
  console.warn('Selector ' + (selector.name || 'unknown') + ' returned a different result when called with the same parameters. This can lead to unnecessary rerenders.' + '\nSelectors that return a new reference (such as an object or an array) should be memoized: https://redux.js.org/usage/deriving-data-selectors#optimizing-selectors-with-memoization', {
589
599
  state,
590
600
  selected,
591
- selected2: toCompare
601
+ selected2: toCompare,
602
+ stack
592
603
  });
593
604
  }
594
605
  }
@@ -598,7 +609,19 @@ function createSelectorHook(context = ReactReduxContext) {
598
609
  if (finalNoopCheck === 'always' || finalNoopCheck === 'once' && firstRun.current) {
599
610
  // @ts-ignore
600
611
  if (selected === state) {
601
- console.warn('Selector ' + (selector.name || 'unknown') + ' returned the root state when called. This can lead to unnecessary rerenders.' + '\nSelectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.');
612
+ let stack = undefined;
613
+
614
+ try {
615
+ throw new Error();
616
+ } catch (e) {
617
+ ({
618
+ stack
619
+ } = e);
620
+ }
621
+
622
+ console.warn('Selector ' + (selector.name || 'unknown') + ' returned the root state when called. This can lead to unnecessary rerenders.' + '\nSelectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.', {
623
+ stack
624
+ });
602
625
  }
603
626
  }
604
627
 
@@ -614,28 +637,28 @@ function createSelectorHook(context = ReactReduxContext) {
614
637
  return selectedState;
615
638
  };
616
639
  }
617
- /**
618
- * A hook to access the redux store's state. This hook takes a selector function
619
- * as an argument. The selector is called with the store state.
620
- *
621
- * This hook takes an optional equality comparison function as the second parameter
622
- * that allows you to customize the way the selected state is compared to determine
623
- * whether the component needs to be re-rendered.
624
- *
625
- * @param {Function} selector the selector function
626
- * @param {Function=} equalityFn the function that will be used to determine equality
627
- *
628
- * @returns {any} the selected state
629
- *
630
- * @example
631
- *
632
- * import React from 'react'
633
- * import { useSelector } from 'react-redux'
634
- *
635
- * export const CounterComponent = () => {
636
- * const counter = useSelector(state => state.counter)
637
- * return <div>{counter}</div>
638
- * }
640
+ /**
641
+ * A hook to access the redux store's state. This hook takes a selector function
642
+ * as an argument. The selector is called with the store state.
643
+ *
644
+ * This hook takes an optional equality comparison function as the second parameter
645
+ * that allows you to customize the way the selected state is compared to determine
646
+ * whether the component needs to be re-rendered.
647
+ *
648
+ * @param {Function} selector the selector function
649
+ * @param {Function=} equalityFn the function that will be used to determine equality
650
+ *
651
+ * @returns {any} the selected state
652
+ *
653
+ * @example
654
+ *
655
+ * import React from 'react'
656
+ * import { useSelector } from 'react-redux'
657
+ *
658
+ * export const CounterComponent = () => {
659
+ * const counter = useSelector(state => state.counter)
660
+ * return <div>{counter}</div>
661
+ * }
639
662
  */
640
663
 
641
664
  const useSelector = /*#__PURE__*/createSelectorHook();
@@ -1106,11 +1129,11 @@ reactIs_development.typeOf = typeOf;
1106
1129
 
1107
1130
  if (process.env.NODE_ENV === 'production') ;
1108
1131
 
1109
- /**
1110
- * Hook factory, which creates a `useStore` hook bound to a given context.
1111
- *
1112
- * @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.
1113
- * @returns {Function} A `useStore` hook bound to the specified context.
1132
+ /**
1133
+ * Hook factory, which creates a `useStore` hook bound to a given context.
1134
+ *
1135
+ * @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.
1136
+ * @returns {Function} A `useStore` hook bound to the specified context.
1114
1137
  */
1115
1138
 
1116
1139
  function createStoreHook(context = ReactReduxContext) {
@@ -1125,29 +1148,29 @@ function createStoreHook(context = ReactReduxContext) {
1125
1148
  return store;
1126
1149
  };
1127
1150
  }
1128
- /**
1129
- * A hook to access the redux store.
1130
- *
1131
- * @returns {any} the redux store
1132
- *
1133
- * @example
1134
- *
1135
- * import React from 'react'
1136
- * import { useStore } from 'react-redux'
1137
- *
1138
- * export const ExampleComponent = () => {
1139
- * const store = useStore()
1140
- * return <div>{store.getState()}</div>
1141
- * }
1151
+ /**
1152
+ * A hook to access the redux store.
1153
+ *
1154
+ * @returns {any} the redux store
1155
+ *
1156
+ * @example
1157
+ *
1158
+ * import React from 'react'
1159
+ * import { useStore } from 'react-redux'
1160
+ *
1161
+ * export const ExampleComponent = () => {
1162
+ * const store = useStore()
1163
+ * return <div>{store.getState()}</div>
1164
+ * }
1142
1165
  */
1143
1166
 
1144
1167
  const useStore = /*#__PURE__*/createStoreHook();
1145
1168
 
1146
- /**
1147
- * Hook factory, which creates a `useDispatch` hook bound to a given context.
1148
- *
1149
- * @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.
1150
- * @returns {Function} A `useDispatch` hook bound to the specified context.
1169
+ /**
1170
+ * Hook factory, which creates a `useDispatch` hook bound to a given context.
1171
+ *
1172
+ * @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.
1173
+ * @returns {Function} A `useDispatch` hook bound to the specified context.
1151
1174
  */
1152
1175
 
1153
1176
  function createDispatchHook(context = ReactReduxContext) {
@@ -1159,26 +1182,26 @@ function createDispatchHook(context = ReactReduxContext) {
1159
1182
  return store.dispatch;
1160
1183
  };
1161
1184
  }
1162
- /**
1163
- * A hook to access the redux `dispatch` function.
1164
- *
1165
- * @returns {any|function} redux store's `dispatch` function
1166
- *
1167
- * @example
1168
- *
1169
- * import React, { useCallback } from 'react'
1170
- * import { useDispatch } from 'react-redux'
1171
- *
1172
- * export const CounterComponent = ({ value }) => {
1173
- * const dispatch = useDispatch()
1174
- * const increaseCounter = useCallback(() => dispatch({ type: 'increase-counter' }), [])
1175
- * return (
1176
- * <div>
1177
- * <span>{value}</span>
1178
- * <button onClick={increaseCounter}>Increase counter</button>
1179
- * </div>
1180
- * )
1181
- * }
1185
+ /**
1186
+ * A hook to access the redux `dispatch` function.
1187
+ *
1188
+ * @returns {any|function} redux store's `dispatch` function
1189
+ *
1190
+ * @example
1191
+ *
1192
+ * import React, { useCallback } from 'react'
1193
+ * import { useDispatch } from 'react-redux'
1194
+ *
1195
+ * export const CounterComponent = ({ value }) => {
1196
+ * const dispatch = useDispatch()
1197
+ * const increaseCounter = useCallback(() => dispatch({ type: 'increase-counter' }), [])
1198
+ * return (
1199
+ * <div>
1200
+ * <span>{value}</span>
1201
+ * <button onClick={increaseCounter}>Increase counter</button>
1202
+ * </div>
1203
+ * )
1204
+ * }
1182
1205
  */
1183
1206
 
1184
1207
  const useDispatch = /*#__PURE__*/createDispatchHook();
@@ -1555,6 +1578,39 @@ function isPlainObject(value) {
1555
1578
  }
1556
1579
  return proto === baseProto;
1557
1580
  }
1581
+ // src/createAction.ts
1582
+ function createAction(type, prepareAction) {
1583
+ function actionCreator() {
1584
+ var args = [];
1585
+ for (var _i = 0; _i < arguments.length; _i++) {
1586
+ args[_i] = arguments[_i];
1587
+ }
1588
+ if (prepareAction) {
1589
+ var prepared = prepareAction.apply(void 0, args);
1590
+ if (!prepared) {
1591
+ throw new Error("prepareAction did not return an object");
1592
+ }
1593
+ return __spreadValues(__spreadValues({
1594
+ type: type,
1595
+ payload: prepared.payload
1596
+ }, "meta" in prepared && { meta: prepared.meta }), "error" in prepared && { error: prepared.error });
1597
+ }
1598
+ return { type: type, payload: args[0] };
1599
+ }
1600
+ actionCreator.toString = function () { return "" + type; };
1601
+ actionCreator.type = type;
1602
+ actionCreator.match = function (action) { return action.type === type; };
1603
+ return actionCreator;
1604
+ }
1605
+ function isAction(action) {
1606
+ return isPlainObject(action) && "type" in action;
1607
+ }
1608
+ function isFSA(action) {
1609
+ return isAction(action) && typeof action.type === "string" && Object.keys(action).every(isValidKey);
1610
+ }
1611
+ function isValidKey(key) {
1612
+ return ["type", "payload", "error", "meta"].indexOf(key) > -1;
1613
+ }
1558
1614
  /** @class */ ((function (_super) {
1559
1615
  __extends(MiddlewareArray, _super);
1560
1616
  function MiddlewareArray() {
@@ -1637,39 +1693,6 @@ function freezeDraftable(val) {
1637
1693
  process.env.NODE_ENV === "production";
1638
1694
  // src/configureStore.ts
1639
1695
  process.env.NODE_ENV === "production";
1640
- // src/createAction.ts
1641
- function createAction(type, prepareAction) {
1642
- function actionCreator() {
1643
- var args = [];
1644
- for (var _i = 0; _i < arguments.length; _i++) {
1645
- args[_i] = arguments[_i];
1646
- }
1647
- if (prepareAction) {
1648
- var prepared = prepareAction.apply(void 0, args);
1649
- if (!prepared) {
1650
- throw new Error("prepareAction did not return an object");
1651
- }
1652
- return __spreadValues(__spreadValues({
1653
- type: type,
1654
- payload: prepared.payload
1655
- }, "meta" in prepared && { meta: prepared.meta }), "error" in prepared && { error: prepared.error });
1656
- }
1657
- return { type: type, payload: args[0] };
1658
- }
1659
- actionCreator.toString = function () { return "" + type; };
1660
- actionCreator.type = type;
1661
- actionCreator.match = function (action) { return action.type === type; };
1662
- return actionCreator;
1663
- }
1664
- function isAction(action) {
1665
- return isPlainObject(action) && "type" in action;
1666
- }
1667
- function isFSA(action) {
1668
- return isAction(action) && typeof action.type === "string" && Object.keys(action).every(isValidKey);
1669
- }
1670
- function isValidKey(key) {
1671
- return ["type", "payload", "error", "meta"].indexOf(key) > -1;
1672
- }
1673
1696
  // src/mapBuilders.ts
1674
1697
  function executeReducerBuilderCallback(builderCallback) {
1675
1698
  var actionsMap = {};
@@ -1686,8 +1709,11 @@ function executeReducerBuilderCallback(builderCallback) {
1686
1709
  }
1687
1710
  }
1688
1711
  var type = typeof typeOrActionCreator === "string" ? typeOrActionCreator : typeOrActionCreator.type;
1712
+ if (!type) {
1713
+ throw new Error("`builder.addCase` cannot be called with an empty action type");
1714
+ }
1689
1715
  if (type in actionsMap) {
1690
- throw new Error("addCase cannot be called with two reducers for the same action type");
1716
+ throw new Error("`builder.addCase` cannot be called with two reducers for the same action type");
1691
1717
  }
1692
1718
  actionsMap[type] = reducer;
1693
1719
  return builder;
@@ -2439,9 +2465,9 @@ var drawAdapter = createEntityAdapter({
2439
2465
  return draw.drawingInstanceId;
2440
2466
  }
2441
2467
  });
2442
- var initialState = drawAdapter.getInitialState();
2443
- var slice = createSlice({
2444
- initialState: initialState,
2468
+ var initialState$1 = drawAdapter.getInitialState();
2469
+ var slice$1 = createSlice({
2470
+ initialState: initialState$1,
2445
2471
  name: 'draw',
2446
2472
  reducers: {
2447
2473
  setDrawValues: function setDrawValues(draft, action) {
@@ -2474,8 +2500,8 @@ var slice = createSlice({
2474
2500
  });
2475
2501
  }
2476
2502
  });
2477
- var reducer = slice.reducer;
2478
- var drawActions = slice.actions;
2503
+ var reducer$1 = slice$1.reducer;
2504
+ var drawActions = slice$1.actions;
2479
2505
 
2480
2506
  /* *
2481
2507
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -3215,6 +3241,25 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
3215
3241
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
3216
3242
  };
3217
3243
 
3244
+ /* *
3245
+ * Licensed under the Apache License, Version 2.0 (the "License");
3246
+ * you may not use this file except in compliance with the License.
3247
+ * You may obtain a copy of the License at
3248
+ *
3249
+ * http://www.apache.org/licenses/LICENSE-2.0
3250
+ *
3251
+ * Unless required by applicable law or agreed to in writing, software
3252
+ * distributed under the License is distributed on an "AS IS" BASIS,
3253
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3254
+ * See the License for the specific language governing permissions and
3255
+ * limitations under the License.
3256
+ *
3257
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
3258
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
3259
+ * */
3260
+ var DATE_FORMAT = 'dd/MM/yyyy HH:mm';
3261
+ var DATE_FORMAT_UTC = "yyyy-MM-dd'T'HH:mm:ss'Z'";
3262
+
3218
3263
  /* *
3219
3264
  * Licensed under the Apache License, Version 2.0 (the "License");
3220
3265
  * you may not use this file except in compliance with the License.
@@ -3232,11 +3277,19 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
3232
3277
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
3233
3278
  * */
3234
3279
  var NO_OBJECTS_FOUND = 'No objects found';
3280
+ var BUTTON_EDIT$1 = 'Edit';
3281
+ var BUTTON_DELETE$1 = 'Delete';
3282
+ var BUTTON_SHARE = 'Share';
3283
+ var BUTTON_AIRMET = 'AIRMET';
3284
+ var BUTTON_SIGMET = 'SIGMET';
3285
+ var BUTTON_PUBLIC_WARNING = 'PUBLIC WARNING';
3286
+ var MENU_SHARE = 'Share object to';
3235
3287
  var Objects = function Objects(_ref) {
3236
3288
  var objects = _ref.objects,
3237
3289
  onClickObject = _ref.onClickObject,
3238
3290
  onClickEdit = _ref.onClickEdit,
3239
3291
  onClickDelete = _ref.onClickDelete,
3292
+ onClickShare = _ref.onClickShare,
3240
3293
  activeObject = _ref.activeObject,
3241
3294
  _ref$isLoading = _ref.isLoading,
3242
3295
  isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading;
@@ -3250,7 +3303,12 @@ var Objects = function Objects(_ref) {
3250
3303
  variant: "body1"
3251
3304
  }, NO_OBJECTS_FOUND);
3252
3305
  }
3253
- return /*#__PURE__*/React__default.createElement(List, null, objects.map(function (object) {
3306
+ return /*#__PURE__*/React__default.createElement(List, {
3307
+ sx: {
3308
+ height: 'calc( 100% - 80px )',
3309
+ overflow: 'auto'
3310
+ }
3311
+ }, objects.map(function (object) {
3254
3312
  var objectDate = dateUtils.isoStringToDate(object.lastUpdatedTime);
3255
3313
  var header = dateUtils.dateToString(objectDate, 'EEEE, MMMM dd', true);
3256
3314
  var isNewDay = !headerList.find(function (item) {
@@ -3263,56 +3321,88 @@ var Objects = function Objects(_ref) {
3263
3321
  key: object.id
3264
3322
  }, isNewDay && /*#__PURE__*/React__default.createElement(Typography, {
3265
3323
  sx: {
3266
- paddingLeft: '20px'
3324
+ paddingLeft: 2.5,
3325
+ opacity: 0.67
3267
3326
  },
3268
3327
  variant: "caption"
3269
- }, header), /*#__PURE__*/React__default.createElement(ListItem, Object.assign({
3270
- disablePadding: true
3271
- }, object.scope === 'user' && {
3272
- secondaryAction: /*#__PURE__*/React__default.createElement(ToggleMenu, {
3328
+ }, header), /*#__PURE__*/React__default.createElement(ListItem, {
3329
+ disablePadding: true,
3330
+ sx: {
3331
+ '& .MuiListItemSecondaryAction-root': {
3332
+ right: '8px'
3333
+ }
3334
+ },
3335
+ secondaryAction: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(ToggleMenu, {
3336
+ buttonSx: {
3337
+ marginRight: object.scope === 'user' ? 1 : 4
3338
+ },
3339
+ buttonIcon: /*#__PURE__*/React__default.createElement(Share, null),
3340
+ menuTitle: MENU_SHARE,
3341
+ tooltipTitle: BUTTON_SHARE,
3342
+ menuPosition: "bottom",
3343
+ "aria-label": BUTTON_SHARE,
3344
+ menuItems: [{
3345
+ text: BUTTON_AIRMET,
3346
+ action: function action() {},
3347
+ icon: /*#__PURE__*/React__default.createElement(ExitDomain, null),
3348
+ isDisabled: true
3349
+ }, {
3350
+ text: BUTTON_SIGMET,
3351
+ action: function action() {},
3352
+ icon: /*#__PURE__*/React__default.createElement(ExitDomain, null),
3353
+ isDisabled: true
3354
+ }, {
3355
+ text: BUTTON_PUBLIC_WARNING,
3356
+ action: function action() {
3357
+ onClickShare(object);
3358
+ },
3359
+ icon: /*#__PURE__*/React__default.createElement(ExitDomain, null)
3360
+ }]
3361
+ }), object.scope === 'user' && /*#__PURE__*/React__default.createElement(ToggleMenu, {
3273
3362
  menuTitle: "Object options",
3274
3363
  tooltipTitle: "Object options",
3275
3364
  menuPosition: "bottom",
3276
3365
  "aria-label": "Options",
3277
3366
  menuItems: [{
3278
- text: 'Edit',
3367
+ text: BUTTON_EDIT$1,
3279
3368
  action: function action() {
3280
3369
  onClickEdit(object.id);
3281
3370
  },
3282
3371
  icon: /*#__PURE__*/React__default.createElement(Edit, null)
3283
3372
  }, {
3284
- text: 'Delete',
3373
+ text: BUTTON_DELETE$1,
3285
3374
  action: function action() {
3286
3375
  onClickDelete(object.id);
3287
3376
  },
3288
3377
  icon: /*#__PURE__*/React__default.createElement(Delete, null)
3289
3378
  }]
3290
- })
3291
- }), /*#__PURE__*/React__default.createElement(Paper, {
3292
- elevation: 1,
3379
+ }))
3380
+ }, /*#__PURE__*/React__default.createElement(Paper, {
3381
+ elevation: 0,
3293
3382
  sx: {
3294
3383
  width: '100%',
3295
- margin: 0.5,
3296
- backgroundColor: 'geowebColors.background.surface'
3384
+ margin: 0.25,
3385
+ backgroundColor: 'geowebColors.background.surface',
3386
+ border: 'solid 1px',
3387
+ borderColor: 'geowebColors.cards.cardContainerBorder'
3297
3388
  }
3298
3389
  }, /*#__PURE__*/React__default.createElement(ListItemButton, {
3299
3390
  onClick: function onClick() {
3300
3391
  onClickObject(object);
3301
- }
3302
- }, activeObject === object.id && /*#__PURE__*/React__default.createElement(Box, {
3303
- sx: {
3304
- backgroundColor: 'geowebColors.captions.captionInformation.color',
3305
- width: '4px',
3306
- height: '100%',
3307
- position: 'absolute',
3308
- left: 0
3309
3392
  },
3310
- className: "active"
3311
- }), /*#__PURE__*/React__default.createElement(Stack, null, /*#__PURE__*/React__default.createElement(Typography, {
3393
+ selected: activeObject === object.id,
3394
+ sx: {
3395
+ padding: 1,
3396
+ height: '44px'
3397
+ }
3398
+ }, /*#__PURE__*/React__default.createElement(Stack, null, /*#__PURE__*/React__default.createElement(Typography, {
3312
3399
  variant: "caption"
3313
- }, object.scope === 'global' && 'Global: ', dateUtils.dateToString(objectDate, 'dd/MM/yyyy HH:ss', true), ' ', "UTC"), /*#__PURE__*/React__default.createElement(Typography, {
3314
- variant: "body2"
3315
- }, object.objectName))))));
3400
+ }, object.objectName), /*#__PURE__*/React__default.createElement(Typography, {
3401
+ variant: "caption",
3402
+ sx: {
3403
+ opacity: 0.67
3404
+ }
3405
+ }, object.scope === 'global' && 'Global: ', dateUtils.dateToString(objectDate, DATE_FORMAT, true), ' ', "UTC"))))));
3316
3406
  }));
3317
3407
  };
3318
3408
 
@@ -3328,6 +3418,7 @@ var DEFAULT_OBJECT_MANAGER_MIN_SIZE = {
3328
3418
  width: 160,
3329
3419
  height: 300
3330
3420
  };
3421
+ var BUTTON_ADD_OBJECT$1 = 'Add a new object';
3331
3422
  var ObjectManager = function ObjectManager(_ref) {
3332
3423
  var bounds = _ref.bounds,
3333
3424
  onClose = _ref.onClose,
@@ -3355,6 +3446,10 @@ var ObjectManager = function ObjectManager(_ref) {
3355
3446
  onEditDrawing = _ref$onEditDrawing === void 0 ? function () {} : _ref$onEditDrawing,
3356
3447
  _ref$onDeleteDrawing = _ref.onDeleteDrawing,
3357
3448
  onDeleteDrawing = _ref$onDeleteDrawing === void 0 ? function () {} : _ref$onDeleteDrawing,
3449
+ _ref$onShareObject = _ref.onShareObject,
3450
+ onShareObject = _ref$onShareObject === void 0 ? function () {} : _ref$onShareObject,
3451
+ _ref$onCreateNewObjec = _ref.onCreateNewObject,
3452
+ onCreateNewObject = _ref$onCreateNewObjec === void 0 ? function () {} : _ref$onCreateNewObjec,
3358
3453
  _ref$activeDrawingId = _ref.activeDrawingId,
3359
3454
  activeDrawingId = _ref$activeDrawingId === void 0 ? '' : _ref$activeDrawingId,
3360
3455
  error = _ref.error,
@@ -3397,6 +3492,12 @@ var ObjectManager = function ObjectManager(_ref) {
3397
3492
  if (dragSize !== sizeInState) {
3398
3493
  setSizeInState(dragSize);
3399
3494
  }
3495
+ },
3496
+ sx: {
3497
+ footer: {
3498
+ backgroundColor: 'inherit',
3499
+ boxShadow: 'none'
3500
+ }
3400
3501
  }
3401
3502
  }, isLoading && /*#__PURE__*/React.createElement(LinearProgress, {
3402
3503
  "data-testid": "loading-bar",
@@ -3414,9 +3515,28 @@ var ObjectManager = function ObjectManager(_ref) {
3414
3515
  onClickObject: onClickDrawing,
3415
3516
  onClickEdit: onEditDrawing,
3416
3517
  onClickDelete: onDeleteDrawing,
3518
+ onClickShare: onShareObject,
3417
3519
  activeObject: activeDrawingId,
3418
3520
  isLoading: isLoading
3419
- }));
3521
+ }), /*#__PURE__*/React.createElement(Box, {
3522
+ sx: {
3523
+ padding: '24px 8px 16px 8px',
3524
+ position: 'absolute',
3525
+ bottom: 0,
3526
+ width: '100%',
3527
+ backgroundColor: 'geowebColors.background.surfaceApp',
3528
+ boxShadow: '0 2px 4px 0 rgba(0, 0, 0, 0.5)',
3529
+ zIndex: 1
3530
+ }
3531
+ }, /*#__PURE__*/React.createElement(Button, {
3532
+ variant: "tertiary",
3533
+ onClick: onCreateNewObject,
3534
+ sx: {
3535
+ width: '100%',
3536
+ textTransform: 'none',
3537
+ fontSize: '12px'
3538
+ }
3539
+ }, BUTTON_ADD_OBJECT$1)));
3420
3540
  };
3421
3541
 
3422
3542
  /* *
@@ -3573,6 +3693,63 @@ var ConfirmDeleteDialog = function ConfirmDeleteDialog(_ref) {
3573
3693
  }));
3574
3694
  };
3575
3695
 
3696
+ /* *
3697
+ * Licensed under the Apache License, Version 2.0 (the "License");
3698
+ * you may not use this file except in compliance with the License.
3699
+ * You may obtain a copy of the License at
3700
+ *
3701
+ * http://www.apache.org/licenses/LICENSE-2.0
3702
+ *
3703
+ * Unless required by applicable law or agreed to in writing, software
3704
+ * distributed under the License is distributed on an "AS IS" BASIS,
3705
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3706
+ * See the License for the specific language governing permissions and
3707
+ * limitations under the License.
3708
+ *
3709
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
3710
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
3711
+ * */
3712
+ var publicWarningDialogType = uiTypes.DialogTypes.PublicWarnings;
3713
+
3714
+ /* *
3715
+ * Licensed under the Apache License, Version 2.0 (the "License");
3716
+ * you may not use this file except in compliance with the License.
3717
+ * You may obtain a copy of the License at
3718
+ *
3719
+ * http://www.apache.org/licenses/LICENSE-2.0
3720
+ *
3721
+ * Unless required by applicable law or agreed to in writing, software
3722
+ * distributed under the License is distributed on an "AS IS" BASIS,
3723
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3724
+ * See the License for the specific language governing permissions and
3725
+ * limitations under the License.
3726
+ *
3727
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
3728
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
3729
+ * */
3730
+ var initialState = {};
3731
+ var slice = createSlice({
3732
+ initialState: initialState,
3733
+ name: 'publicWarningForm',
3734
+ reducers: {
3735
+ setFormValues: function setFormValues(draft, action) {
3736
+ draft.object = action.payload.object;
3737
+ }
3738
+ },
3739
+ extraReducers: function extraReducers(builder) {
3740
+ builder.addCase(uiActions.setToggleOpenDialog, function (draft, action) {
3741
+ var _action$payload = action.payload,
3742
+ type = _action$payload.type,
3743
+ setOpen = _action$payload.setOpen;
3744
+ if (type === publicWarningDialogType && setOpen === false) {
3745
+ delete draft.object;
3746
+ }
3747
+ });
3748
+ }
3749
+ });
3750
+ var reducer = slice.reducer;
3751
+ var publicWarningActions = slice.actions;
3752
+
3576
3753
  var getDeleteSucces = function getDeleteSucces(objectName) {
3577
3754
  return "".concat(objectName, " has been deleted");
3578
3755
  };
@@ -3758,6 +3935,23 @@ var ObjectManagerConnect = function ObjectManagerConnect(_ref) {
3758
3935
  var onClose = function onClose() {
3759
3936
  closeObjectDialog();
3760
3937
  };
3938
+ var onShareObject = function onShareObject(object) {
3939
+ dispatch(publicWarningActions.setFormValues({
3940
+ object: {
3941
+ id: object.id,
3942
+ lastUpdatedTime: object.lastUpdatedTime,
3943
+ objectName: object.objectName
3944
+ }
3945
+ }));
3946
+ dispatch(uiActions.setToggleOpenDialog({
3947
+ setOpen: true,
3948
+ type: publicWarningDialogType
3949
+ }));
3950
+ };
3951
+ var onCreateNewObject = function onCreateNewObject() {
3952
+ closeObjectDialog();
3953
+ openDrawDialog();
3954
+ };
3761
3955
  var onDeleteSuccess = function onDeleteSuccess(objectId, objectName) {
3762
3956
  // close confirm dialog
3763
3957
  setConfirmDialogOptions(undefined);
@@ -3799,6 +3993,8 @@ var ObjectManagerConnect = function ObjectManagerConnect(_ref) {
3799
3993
  onClickDrawing: onClickDrawing,
3800
3994
  onEditDrawing: onEditDrawing,
3801
3995
  onDeleteDrawing: onDeleteDrawing,
3996
+ onShareObject: onShareObject,
3997
+ onCreateNewObject: onCreateNewObject,
3802
3998
  activeDrawingId: activeDrawingId,
3803
3999
  error: uiError,
3804
4000
  isLoading: loading
@@ -4825,8 +5021,6 @@ var DrawingTool = function DrawingTool(_ref) {
4825
5021
  source = _ref$source === void 0 ? 'app' : _ref$source,
4826
5022
  _ref$isLoading = _ref.isLoading,
4827
5023
  isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
4828
- _ref$isDocked = _ref.isDocked,
4829
- isDocked = _ref$isDocked === void 0 ? false : _ref$isDocked,
4830
5024
  _ref$size = _ref.size,
4831
5025
  size = _ref$size === void 0 ? DERFAULT_DRAW_TOOL_SIZE : _ref$size,
4832
5026
  _ref$startPosition = _ref.startPosition,
@@ -4842,12 +5036,6 @@ var DrawingTool = function DrawingTool(_ref) {
4842
5036
  _React$useState2 = _slicedToArray(_React$useState, 2),
4843
5037
  sizeInState = _React$useState2[0],
4844
5038
  setSizeInState = _React$useState2[1];
4845
- React.useEffect(function () {
4846
- if (size !== sizeInState && isDocked && isOpen) {
4847
- setSizeInState(size);
4848
- }
4849
- // eslint-disable-next-line react-hooks/exhaustive-deps
4850
- }, [size, isOpen]);
4851
5039
  return /*#__PURE__*/React.createElement(ToolContainerDraggable, {
4852
5040
  title: title,
4853
5041
  startSize: sizeInState,
@@ -4874,21 +5062,6 @@ var DrawingTool = function DrawingTool(_ref) {
4874
5062
  boxShadow: 'none'
4875
5063
  }
4876
5064
  },
4877
- // TODO: Re-enable when we put back in the floating version when drawing tools become available: https://gitlab.com/opengeoweb/opengeoweb/-/issues/3872
4878
- // rightHeaderComponent={
4879
- // <CustomIconButton
4880
- // tooltipTitle={isDocked ? 'Undock' : 'Dock'}
4881
- // data-testid="dockedBtn"
4882
- // disableRipple
4883
- // onClick={(): void => onToggleDock()}
4884
- // >
4885
- // {isDocked ? (
4886
- // <CollapseWindow data-testid="dockedDrawingTool-collapse" />
4887
- // ) : (
4888
- // <ExpandWindow data-testid="dockedDrawingTool-uncollapse" />
4889
- // )}
4890
- // </CustomIconButton>
4891
- // }
4892
5065
  onResizeStop: function onResizeStop(_event, _direction, node) {
4893
5066
  var width = node.offsetWidth,
4894
5067
  height = node.offsetHeight;
@@ -22155,7 +22328,7 @@ var lodash = {exports: {}};
22155
22328
 
22156
22329
  var opacityOptions = [100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 0];
22157
22330
  var getObjectName = function getObjectName(objectName) {
22158
- return objectName || "".concat(dateUtils.dateToString(new Date(), 'dd/MM/yyyy HH:mm', true), " UTC");
22331
+ return objectName || "".concat(dateUtils.dateToString(new Date(), DATE_FORMAT, true), " UTC");
22159
22332
  };
22160
22333
  var SAVE_OBJECT_BUTTON = 'Save new object';
22161
22334
  var UPDATE_OBJECT_BUTTON = 'Update object';
@@ -22283,7 +22456,8 @@ var DrawingToolForm = function DrawingToolForm(_ref) {
22283
22456
  },
22284
22457
  "data-testid": mode.drawModeId,
22285
22458
  onKeyDown: onKeyDown,
22286
- disabled: isLoading
22459
+ disabled: isLoading,
22460
+ size: "medium"
22287
22461
  }, getIcon(mode.drawModeId));
22288
22462
  }), isInEditMode && /*#__PURE__*/React.createElement(Typography, {
22289
22463
  component: "span",
@@ -22359,7 +22533,8 @@ var DrawingToolForm = function DrawingToolForm(_ref) {
22359
22533
  onClick: onSubmit,
22360
22534
  sx: {
22361
22535
  width: '100%',
22362
- textTransform: 'none'
22536
+ textTransform: 'none',
22537
+ fontSize: '12px'
22363
22538
  },
22364
22539
  "data-testid": "saveDrawingFormButton",
22365
22540
  disabled: isLoading || hasErrors
@@ -22499,10 +22674,7 @@ var DrawingToolFormConnect = function DrawingToolFormConnect() {
22499
22674
  * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
22500
22675
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
22501
22676
  * */
22502
- var getDialogType = function getDialogType(mapId, isMultiMap, isDocked) {
22503
- if (isDocked) {
22504
- return "".concat(uiTypes.DialogTypes.DockedDrawingTool, "-").concat(mapId);
22505
- }
22677
+ var getDialogType = function getDialogType(mapId, isMultiMap) {
22506
22678
  if (isMultiMap) {
22507
22679
  return "".concat(uiTypes.DialogTypes.DrawingTool, "-").concat(mapId);
22508
22680
  }
@@ -22518,15 +22690,13 @@ var DrawingToolConnect = function DrawingToolConnect(_ref) {
22518
22690
  initialMapId = _ref$mapId === void 0 ? null : _ref$mapId,
22519
22691
  _ref$isMultiMap = _ref.isMultiMap,
22520
22692
  isMultiMap = _ref$isMultiMap === void 0 ? false : _ref$isMultiMap,
22521
- _ref$isDocked = _ref.isDocked,
22522
- isDocked = _ref$isDocked === void 0 ? false : _ref$isDocked,
22523
22693
  _ref$source = _ref.source,
22524
22694
  source = _ref$source === void 0 ? 'app' : _ref$source;
22525
- var dialogType = getDialogType(initialMapId, isMultiMap, isDocked);
22695
+ var dialogType = getDialogType(initialMapId, isMultiMap);
22526
22696
  var activeMapId = useSelector(function (store) {
22527
22697
  return uiSelectors.getDialogMapId(store, dialogType);
22528
22698
  });
22529
- // In case of a docked drawing toolbox or multimap, use the map id that is passed
22699
+ // In case of a multimap, use the map id that is passed
22530
22700
  // For floating drawingtoolbox, use the currently active, selected mapid
22531
22701
  var mapId = initialMapId || activeMapId;
22532
22702
  var _useCloseDrawDialog = useCloseDrawDialog({
@@ -22541,29 +22711,6 @@ var DrawingToolConnect = function DrawingToolConnect(_ref) {
22541
22711
  uiSource = _useSetupDialog.uiSource,
22542
22712
  uiIsLoading = _useSetupDialog.uiIsLoading,
22543
22713
  setFocused = _useSetupDialog.setFocused;
22544
- // TODO: Re-enable when we put back in the floating version when drawing tools become available: https://gitlab.com/opengeoweb/opengeoweb/-/issues/3872
22545
- // const onToggleDock = (): void => {
22546
- // onCloseDialog();
22547
- // if (isDocked) {
22548
- // // Close docked drawingtool and open the floating drawingtool
22549
- // dispatch(
22550
- // uiActions.setActiveMapIdForDialog({
22551
- // type: uiTypes.DialogTypes.DrawingTool,
22552
- // mapId,
22553
- // setOpen: true,
22554
- // source,
22555
- // }),
22556
- // );
22557
- // } else {
22558
- // // Close the floating drawingtool and open docked drawingtool
22559
- // dispatch(
22560
- // uiActions.setToggleOpenDialog({
22561
- // type: `${uiTypes.DialogTypes.DockedDrawingTool}-${mapId}`,
22562
- // setOpen: true,
22563
- // }),
22564
- // );
22565
- // }
22566
- // };
22567
22714
  var shownTitle = showMapIdInTitle ? "".concat(title, " ").concat(mapId) : title;
22568
22715
  var onClose = function onClose() {
22569
22716
  closeDrawDialog();
@@ -22593,10 +22740,8 @@ var DrawingToolConnect = function DrawingToolConnect(_ref) {
22593
22740
  order: dialogOrder,
22594
22741
  source: uiSource,
22595
22742
  isLoading: uiIsLoading,
22596
- // onToggleDock={onToggleDock}
22597
22743
  setFocused: setFocused,
22598
22744
  headerSize: "xs",
22599
- isDocked: isDocked,
22600
22745
  startPosition: {
22601
22746
  top: 134,
22602
22747
  left: 50
@@ -22604,13 +22749,113 @@ var DrawingToolConnect = function DrawingToolConnect(_ref) {
22604
22749
  }, /*#__PURE__*/React.createElement(DrawingToolFormConnect, null));
22605
22750
  };
22606
22751
 
22607
- var LABEL_DESCRIPTION_ORIGINAL = 'Description original';
22608
- var LABEL_DESCRIPTION_TRANSLATION = 'Description translation';
22609
- function a11yProps(index) {
22610
- return {
22611
- id: "tab-".concat(index),
22612
- 'aria-controls': "tabpanel-".concat(index)
22613
- };
22752
+ var DEFAULT_WARNING_DIALOG_SIZE = {
22753
+ width: 320,
22754
+ height: 800
22755
+ };
22756
+ var DEFAULT_WARNING_DIALOG_POSITION = {
22757
+ top: 8,
22758
+ left: 60
22759
+ };
22760
+ var DEFAULT_WARNING_DIALOG_MIN_SIZE = {
22761
+ width: 320,
22762
+ height: 300
22763
+ };
22764
+ var DIALOG_TITLE = 'Public Warning';
22765
+ var PublicWarnings = function PublicWarnings(_ref) {
22766
+ var bounds = _ref.bounds,
22767
+ onClose = _ref.onClose,
22768
+ _ref$title = _ref.title,
22769
+ title = _ref$title === void 0 ? DIALOG_TITLE : _ref$title,
22770
+ isOpen = _ref.isOpen,
22771
+ _ref$onMouseDown = _ref.onMouseDown,
22772
+ onMouseDown = _ref$onMouseDown === void 0 ? function () {} : _ref$onMouseDown,
22773
+ _ref$order = _ref.order,
22774
+ order = _ref$order === void 0 ? 0 : _ref$order,
22775
+ _ref$source = _ref.source,
22776
+ source = _ref$source === void 0 ? 'app' : _ref$source,
22777
+ _ref$size = _ref.size,
22778
+ size = _ref$size === void 0 ? DEFAULT_WARNING_DIALOG_SIZE : _ref$size,
22779
+ _ref$startPosition = _ref.startPosition,
22780
+ startPosition = _ref$startPosition === void 0 ? DEFAULT_WARNING_DIALOG_POSITION : _ref$startPosition,
22781
+ _ref$setFocused = _ref.setFocused,
22782
+ setFocused = _ref$setFocused === void 0 ? function () {} : _ref$setFocused,
22783
+ _ref$headerSize = _ref.headerSize,
22784
+ headerSize = _ref$headerSize === void 0 ? 'xs' : _ref$headerSize,
22785
+ children = _ref.children;
22786
+ var minSize = DEFAULT_WARNING_DIALOG_MIN_SIZE;
22787
+ var startSizeCalc = calculateStartSize(minSize, size, startPosition);
22788
+ var _React$useState = React.useState(startSizeCalc),
22789
+ _React$useState2 = _slicedToArray(_React$useState, 2),
22790
+ sizeInState = _React$useState2[0],
22791
+ setSizeInState = _React$useState2[1];
22792
+ return /*#__PURE__*/React.createElement(ToolContainerDraggable, {
22793
+ title: title,
22794
+ startSize: sizeInState,
22795
+ minWidth: minSize.width,
22796
+ minHeight: minSize.height,
22797
+ startPosition: startPosition,
22798
+ isOpen: isOpen,
22799
+ onClose: onClose,
22800
+ headerSize: headerSize,
22801
+ bounds: bounds,
22802
+ onMouseDown: onMouseDown,
22803
+ onFocus: function onFocus() {
22804
+ return setFocused(true);
22805
+ },
22806
+ onBlur: function onBlur() {
22807
+ return setFocused(false);
22808
+ },
22809
+ order: order,
22810
+ source: source,
22811
+ onResizeStop: function onResizeStop(_event, _direction, node) {
22812
+ var width = node.offsetWidth,
22813
+ height = node.offsetHeight;
22814
+ setSizeInState({
22815
+ width: width,
22816
+ height: height
22817
+ });
22818
+ },
22819
+ onDragEnd: function onDragEnd(_position, dragSize) {
22820
+ if (dragSize !== sizeInState) {
22821
+ setSizeInState(dragSize);
22822
+ }
22823
+ },
22824
+ leftHeaderComponent: /*#__PURE__*/React.createElement("div", null),
22825
+ rightHeaderComponent: /*#__PURE__*/React.createElement(Box, {
22826
+ sx: {
22827
+ flex: 1,
22828
+ overflow: 'hidden',
22829
+ display: 'flex',
22830
+ justifyContent: 'flex-end',
22831
+ position: 'absolute',
22832
+ right: 32,
22833
+ backgroundColor: 'geowebColors.background.surface',
22834
+ height: 24,
22835
+ paddingLeft: 1
22836
+ }
22837
+ }, /*#__PURE__*/React.createElement(Box, {
22838
+ sx: {
22839
+ position: 'relative',
22840
+ top: -7
22841
+ }
22842
+ }, /*#__PURE__*/React.createElement(SwitchButton, null))),
22843
+ sx: {
22844
+ footer: {
22845
+ backgroundColor: 'inherit',
22846
+ boxShadow: 'none'
22847
+ }
22848
+ }
22849
+ }, children);
22850
+ };
22851
+
22852
+ var LABEL_DESCRIPTION_ORIGINAL = 'Description original';
22853
+ var LABEL_DESCRIPTION_TRANSLATION = 'Description translation';
22854
+ function a11yProps(index) {
22855
+ return {
22856
+ id: "tab-".concat(index),
22857
+ 'aria-controls': "tabpanel-".concat(index)
22858
+ };
22614
22859
  }
22615
22860
  var tabStyle = {
22616
22861
  width: '50%',
@@ -22636,7 +22881,8 @@ var CustomTabPanel = function CustomTabPanel(props) {
22636
22881
  sx: {
22637
22882
  position: 'absolute',
22638
22883
  zIndex: 1,
22639
- width: 122,
22884
+ width: '50%',
22885
+ maxWidth: '360px',
22640
22886
  paddingLeft: 1.5,
22641
22887
  '.MuiInputBase-root': {
22642
22888
  marginTop: 0,
@@ -22717,6 +22963,10 @@ var BUTTON_DELETE = 'Delete';
22717
22963
  var BUTTON_VIEW = 'View';
22718
22964
  var BUTTON_EDIT = 'Edit';
22719
22965
  var OBJECTS_MENU = 'Object options';
22966
+ var NO_OBJECT = 'No object selected';
22967
+ var formatDate = function formatDate(lastUpdatedTime) {
22968
+ return dateUtils.dateToString(dateUtils.isoStringToDate(lastUpdatedTime), "".concat(DATE_FORMAT, " 'UTC'"));
22969
+ };
22720
22970
  var AreaField = function AreaField(_ref) {
22721
22971
  var _ref$onEditObject = _ref.onEditObject,
22722
22972
  onEditObject = _ref$onEditObject === void 0 ? function () {} : _ref$onEditObject,
@@ -22727,7 +22977,13 @@ var AreaField = function AreaField(_ref) {
22727
22977
  _ref$onAddObject = _ref.onAddObject,
22728
22978
  onAddObject = _ref$onAddObject === void 0 ? function () {} : _ref$onAddObject,
22729
22979
  _ref$isDisabled = _ref.isDisabled,
22730
- isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled;
22980
+ isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
22981
+ _ref$id = _ref.id,
22982
+ id = _ref$id === void 0 ? '' : _ref$id,
22983
+ _ref$lastUpdatedTime = _ref.lastUpdatedTime,
22984
+ lastUpdatedTime = _ref$lastUpdatedTime === void 0 ? '' : _ref$lastUpdatedTime,
22985
+ _ref$objectName = _ref.objectName,
22986
+ objectName = _ref$objectName === void 0 ? NO_OBJECT : _ref$objectName;
22731
22987
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Typography, {
22732
22988
  variant: "h3",
22733
22989
  color: "text.secondary",
@@ -22754,11 +23010,12 @@ var AreaField = function AreaField(_ref) {
22754
23010
  fontSize: '0.75rem',
22755
23011
  fontWeight: 'normal',
22756
23012
  lineHeight: 1.83
22757
- }
22758
- }, "Object name"), /*#__PURE__*/React__default.createElement(Typography, {
23013
+ },
23014
+ role: "heading"
23015
+ }, objectName), /*#__PURE__*/React__default.createElement(Typography, {
22759
23016
  variant: "body2",
22760
23017
  color: "text.secondary"
22761
- }, "09/01/2023 21:00 UTC"), /*#__PURE__*/React__default.createElement(ToggleMenu, {
23018
+ }, lastUpdatedTime ? formatDate(lastUpdatedTime) : ''), id ? /*#__PURE__*/React__default.createElement(ToggleMenu, {
22762
23019
  menuTitle: OBJECTS_MENU,
22763
23020
  tooltipTitle: OBJECTS_MENU,
22764
23021
  buttonSx: {
@@ -22784,7 +23041,9 @@ var AreaField = function AreaField(_ref) {
22784
23041
  action: onDeleteObject,
22785
23042
  icon: /*#__PURE__*/React__default.createElement(Delete, null)
22786
23043
  }]
22787
- }))), /*#__PURE__*/React__default.createElement(Button, {
23044
+ }) : null)), /*#__PURE__*/React__default.createElement(ReactHookFormHiddenInput, {
23045
+ name: "objectId"
23046
+ }), /*#__PURE__*/React__default.createElement(Button, {
22788
23047
  sx: {
22789
23048
  marginTop: 1
22790
23049
  },
@@ -22796,6 +23055,23 @@ var AreaField = function AreaField(_ref) {
22796
23055
  }, BUTTON_ADD_OBJECT));
22797
23056
  };
22798
23057
 
23058
+ var getEmptyPublicWarning = function getEmptyPublicWarning(object) {
23059
+ var currentTime = new Date();
23060
+ var validToTime = dateUtils.add(currentTime, {
23061
+ hours: 6
23062
+ });
23063
+ return {
23064
+ phenomenon: '',
23065
+ validFrom: dateUtils.dateToString(currentTime, DATE_FORMAT_UTC, true),
23066
+ validUntil: dateUtils.dateToString(validToTime, DATE_FORMAT_UTC, true),
23067
+ leadtime: LABEL_CURRENT,
23068
+ level: '',
23069
+ probability: 30,
23070
+ descriptionOriginal: '',
23071
+ descriptionTranslation: '',
23072
+ objectId: (object === null || object === void 0 ? void 0 : object.id) || ''
23073
+ };
23074
+ };
22799
23075
  // tablet breakpoint - 2 padding * 2 for both sides
22800
23076
  var containerQueryBreakpoint = "@container (min-width: ".concat(breakpoints.tablet - 32, "px)");
22801
23077
  var LABEL_PHENOMENON = 'Phenomenon';
@@ -22805,10 +23081,57 @@ var LABEL_CURRENT = 'Current';
22805
23081
  var LABEL_EARLY = 'Early';
22806
23082
  var LABEL_LEVEL = 'Level';
22807
23083
  var LABEL_PROBABILITY = 'Probability';
22808
- var BUTTON_CANCEL = 'Cancel';
23084
+ var BUTTON_CLEAR = 'Clear';
22809
23085
  var BUTTON_SAVE = 'Save';
22810
23086
  var BUTTON_PUBLISH = 'Publish';
22811
23087
  var dateFormat = 'DD/MM/YYYY HH:mm';
23088
+ var probablityOptions = [100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 0];
23089
+ var levelOptions = [{
23090
+ title: 'Moderate',
23091
+ key: 'moderate',
23092
+ color: '#FAE21E'
23093
+ }, {
23094
+ title: 'Severe',
23095
+ key: 'severe',
23096
+ color: '#E27000'
23097
+ }, {
23098
+ title: 'Extreme',
23099
+ key: 'extreme',
23100
+ color: '#D62A20'
23101
+ }];
23102
+ var warningPhenomena = [{
23103
+ title: 'Coastal event',
23104
+ key: 'coastalEvent',
23105
+ icon: /*#__PURE__*/React.createElement(CoastalEvent, null)
23106
+ }, {
23107
+ title: 'Fog',
23108
+ key: 'fog',
23109
+ icon: /*#__PURE__*/React.createElement(Fog, null)
23110
+ }, {
23111
+ title: 'High temperature',
23112
+ key: 'highTemp',
23113
+ icon: /*#__PURE__*/React.createElement(TemperatureHigh, null)
23114
+ }, {
23115
+ title: 'Low temperature',
23116
+ key: 'lowTemp',
23117
+ icon: /*#__PURE__*/React.createElement(TemperatureLow, null)
23118
+ }, {
23119
+ title: 'Rain',
23120
+ key: 'rain',
23121
+ icon: /*#__PURE__*/React.createElement(Rain, null)
23122
+ }, {
23123
+ title: 'Snow/ice',
23124
+ key: 'snowIce',
23125
+ icon: /*#__PURE__*/React.createElement(Snow, null)
23126
+ }, {
23127
+ title: 'Thunderstorm',
23128
+ key: 'thunderstorm',
23129
+ icon: /*#__PURE__*/React.createElement(Lightning, null)
23130
+ }, {
23131
+ title: 'Wind',
23132
+ key: 'wind',
23133
+ icon: /*#__PURE__*/React.createElement(Wind, null)
23134
+ }];
22812
23135
  var ContainerWrapper = styled('div')(function () {
22813
23136
  return {
22814
23137
  containerType: 'size',
@@ -22846,7 +23169,14 @@ var ContainerGrid = styled('div')(function (_ref3) {
22846
23169
  });
22847
23170
  var Form = function Form(_ref5) {
22848
23171
  var _ref5$isDisabled = _ref5.isDisabled,
22849
- isDisabled = _ref5$isDisabled === void 0 ? false : _ref5$isDisabled;
23172
+ isDisabled = _ref5$isDisabled === void 0 ? false : _ref5$isDisabled,
23173
+ object = _ref5.object;
23174
+ var _useFormContext = useFormContext(),
23175
+ watch = _useFormContext.watch;
23176
+ var selectedLevel = watch('level');
23177
+ var levelDetails = levelOptions.find(function (level) {
23178
+ return level.key === selectedLevel;
23179
+ });
22850
23180
  return /*#__PURE__*/React.createElement(ContainerWrapper, null, /*#__PURE__*/React.createElement(ContainerFormWrapper, null, /*#__PURE__*/React.createElement(ContainerGrid, null, /*#__PURE__*/React.createElement(Grid, {
22851
23181
  container: true,
22852
23182
  rowSpacing: 2
@@ -22857,9 +23187,19 @@ var Form = function Form(_ref5) {
22857
23187
  name: "phenomenon",
22858
23188
  label: LABEL_PHENOMENON,
22859
23189
  rules: {}
22860
- }, /*#__PURE__*/React.createElement(MenuItem, {
22861
- value: "undefined"
22862
- }, "(undefined)"))), /*#__PURE__*/React.createElement(Grid, {
23190
+ }, warningPhenomena.map(function (phenomenon) {
23191
+ return /*#__PURE__*/React.createElement(MenuItem, {
23192
+ key: phenomenon.key,
23193
+ value: phenomenon.key
23194
+ }, /*#__PURE__*/React.createElement(Grid, {
23195
+ container: true,
23196
+ justifyContent: "space-between"
23197
+ }, /*#__PURE__*/React.createElement(Grid, {
23198
+ item: true
23199
+ }, phenomenon.title), /*#__PURE__*/React.createElement(Grid, {
23200
+ item: true
23201
+ }, /*#__PURE__*/React.createElement(ListItemIcon, null, phenomenon.icon))));
23202
+ }))), /*#__PURE__*/React.createElement(Grid, {
22863
23203
  item: true,
22864
23204
  xs: 12
22865
23205
  }, /*#__PURE__*/React.createElement(Grid, {
@@ -22870,7 +23210,10 @@ var Form = function Form(_ref5) {
22870
23210
  onEditObject: function onEditObject() {},
22871
23211
  onViewObject: function onViewObject() {},
22872
23212
  onDeleteObject: function onDeleteObject() {},
22873
- onAddObject: function onAddObject() {}
23213
+ onAddObject: function onAddObject() {},
23214
+ id: object === null || object === void 0 ? void 0 : object.id,
23215
+ objectName: object === null || object === void 0 ? void 0 : object.objectName,
23216
+ lastUpdatedTime: object === null || object === void 0 ? void 0 : object.lastUpdatedTime
22874
23217
  }))), /*#__PURE__*/React.createElement(Grid, {
22875
23218
  item: true,
22876
23219
  xs: 12,
@@ -22947,20 +23290,53 @@ var Form = function Form(_ref5) {
22947
23290
  }, /*#__PURE__*/React.createElement(ReactHookFormSelect, {
22948
23291
  name: "level",
22949
23292
  label: LABEL_LEVEL,
22950
- rules: {}
22951
- }, /*#__PURE__*/React.createElement(MenuItem, {
22952
- value: "undefined"
22953
- }, "(undefined)"))), /*#__PURE__*/React.createElement(Grid, {
23293
+ rules: {},
23294
+ sx: {
23295
+ '& .MuiSelect-select.MuiSelect-filled': {
23296
+ backgroundColor: (levelDetails === null || levelDetails === void 0 ? void 0 : levelDetails.color) || 'none',
23297
+ backgroundClip: 'content-box'
23298
+ }
23299
+ }
23300
+ }, levelOptions.map(function (level) {
23301
+ return /*#__PURE__*/React.createElement(MenuItem, {
23302
+ value: level.key,
23303
+ key: level.key,
23304
+ sx: {
23305
+ '&.MuiMenuItem-root ': {
23306
+ background: level.color,
23307
+ backgroundClip: 'content-box',
23308
+ '&:hover': {
23309
+ backgroundColor: "".concat(level.color),
23310
+ backgroundClip: 'content-box',
23311
+ boxShadow: function boxShadow(theme) {
23312
+ return "inset -16px -6px ".concat(theme.palette.geowebColors.cards.cardContainerMouseOver, ", inset 16px 6px ").concat(theme.palette.geowebColors.cards.cardContainerMouseOver);
23313
+ }
23314
+ },
23315
+ '&.Mui-selected': {
23316
+ backgroundColor: "".concat(level.color),
23317
+ '&:hover': {
23318
+ boxShadow: function boxShadow(theme) {
23319
+ return "inset 4px 0px 0px 0px ".concat(theme.palette.geowebColors.typographyAndIcons.iconLinkActive, ", inset -16px -6px ").concat(theme.palette.geowebColors.cards.cardContainerMouseOver, ", inset 16px 6px ").concat(theme.palette.geowebColors.cards.cardContainerMouseOver);
23320
+ }
23321
+ }
23322
+ }
23323
+ }
23324
+ }
23325
+ }, "\xA0", level.title);
23326
+ }))), /*#__PURE__*/React.createElement(Grid, {
22954
23327
  item: true,
22955
23328
  xs: 12,
22956
23329
  sm: 6
22957
23330
  }, /*#__PURE__*/React.createElement(ReactHookFormSelect, {
22958
- name: "probabilty",
23331
+ name: "probability",
22959
23332
  label: LABEL_PROBABILITY,
22960
23333
  rules: {}
22961
- }, /*#__PURE__*/React.createElement(MenuItem, {
22962
- value: "undefined"
22963
- }, "(undefined)")))), /*#__PURE__*/React.createElement(Grid, {
23334
+ }, probablityOptions.map(function (probability) {
23335
+ return /*#__PURE__*/React.createElement(MenuItem, {
23336
+ value: probability,
23337
+ key: probability
23338
+ }, probability, " %");
23339
+ })))), /*#__PURE__*/React.createElement(Grid, {
22964
23340
  item: true,
22965
23341
  xs: 12,
22966
23342
  container: true,
@@ -22992,7 +23368,7 @@ var Form = function Form(_ref5) {
22992
23368
  marginBottom: 1
22993
23369
  },
22994
23370
  disabled: isDisabled
22995
- }, BUTTON_CANCEL)), /*#__PURE__*/React.createElement(Grid, {
23371
+ }, BUTTON_CLEAR)), /*#__PURE__*/React.createElement(Grid, {
22996
23372
  item: true,
22997
23373
  xs: 12,
22998
23374
  sm: 4
@@ -23016,108 +23392,66 @@ var Form = function Form(_ref5) {
23016
23392
  }, BUTTON_PUBLISH))))));
23017
23393
  };
23018
23394
  var PublicWarningsForm = function PublicWarningsForm(props) {
23019
- return /*#__PURE__*/React.createElement(ReactHookFormProvider, null, /*#__PURE__*/React.createElement(Form, Object.assign({}, props)));
23395
+ var object = props.object,
23396
+ publicWarningDetails = props.publicWarningDetails;
23397
+ var publicWarningFormData = publicWarningDetails || getEmptyPublicWarning(object);
23398
+ return /*#__PURE__*/React.createElement(ReactHookFormProvider, {
23399
+ options: Object.assign(Object.assign({}, defaultFormOptions), {
23400
+ defaultValues: publicWarningFormData
23401
+ })
23402
+ }, /*#__PURE__*/React.createElement(Form, Object.assign({}, props)));
23020
23403
  };
23021
23404
 
23022
- var DEFAULT_WARNING_DIALOG_SIZE = {
23023
- width: 320,
23024
- height: 800
23025
- };
23026
- var DEFAULT_WARNING_DIALOG_POSITION = {
23027
- top: 8,
23028
- left: 60
23029
- };
23030
- var DEFAULT_WARNING_DIALOG_MIN_SIZE = {
23031
- width: 320,
23032
- height: 300
23405
+ /* *
23406
+ * Licensed under the Apache License, Version 2.0 (the "License");
23407
+ * you may not use this file except in compliance with the License.
23408
+ * You may obtain a copy of the License at
23409
+ *
23410
+ * http://www.apache.org/licenses/LICENSE-2.0
23411
+ *
23412
+ * Unless required by applicable law or agreed to in writing, software
23413
+ * distributed under the License is distributed on an "AS IS" BASIS,
23414
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23415
+ * See the License for the specific language governing permissions and
23416
+ * limitations under the License.
23417
+ *
23418
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
23419
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
23420
+ * */
23421
+ var getPublicWarningStore = function getPublicWarningStore(store) {
23422
+ if (store && store.publicWarningForm) {
23423
+ return store.publicWarningForm;
23424
+ }
23425
+ return null;
23033
23426
  };
23034
- var DIALOG_TITLE = 'Public Warning';
23035
- var PublicWarnings = function PublicWarnings(_ref) {
23036
- var bounds = _ref.bounds,
23037
- onClose = _ref.onClose,
23038
- _ref$title = _ref.title,
23039
- title = _ref$title === void 0 ? DIALOG_TITLE : _ref$title,
23040
- isOpen = _ref.isOpen,
23041
- _ref$onMouseDown = _ref.onMouseDown,
23042
- onMouseDown = _ref$onMouseDown === void 0 ? function () {} : _ref$onMouseDown,
23043
- _ref$order = _ref.order,
23044
- order = _ref$order === void 0 ? 0 : _ref$order,
23045
- _ref$source = _ref.source,
23046
- source = _ref$source === void 0 ? 'app' : _ref$source,
23047
- _ref$size = _ref.size,
23048
- size = _ref$size === void 0 ? DEFAULT_WARNING_DIALOG_SIZE : _ref$size,
23049
- _ref$startPosition = _ref.startPosition,
23050
- startPosition = _ref$startPosition === void 0 ? DEFAULT_WARNING_DIALOG_POSITION : _ref$startPosition,
23051
- _ref$setFocused = _ref.setFocused,
23052
- setFocused = _ref$setFocused === void 0 ? function () {} : _ref$setFocused,
23053
- _ref$headerSize = _ref.headerSize,
23054
- headerSize = _ref$headerSize === void 0 ? 'xs' : _ref$headerSize;
23055
- var minSize = DEFAULT_WARNING_DIALOG_MIN_SIZE;
23056
- var startSizeCalc = calculateStartSize(minSize, size, startPosition);
23057
- var _React$useState = React.useState(startSizeCalc),
23058
- _React$useState2 = _slicedToArray(_React$useState, 2),
23059
- sizeInState = _React$useState2[0],
23060
- setSizeInState = _React$useState2[1];
23061
- return /*#__PURE__*/React.createElement(ToolContainerDraggable, {
23062
- title: title,
23063
- startSize: sizeInState,
23064
- minWidth: minSize.width,
23065
- minHeight: minSize.height,
23066
- startPosition: startPosition,
23067
- isOpen: isOpen,
23068
- onClose: onClose,
23069
- headerSize: headerSize,
23070
- bounds: bounds,
23071
- onMouseDown: onMouseDown,
23072
- onFocus: function onFocus() {
23073
- return setFocused(true);
23074
- },
23075
- onBlur: function onBlur() {
23076
- return setFocused(false);
23077
- },
23078
- order: order,
23079
- source: source,
23080
- onResizeStop: function onResizeStop(_event, _direction, node) {
23081
- var width = node.offsetWidth,
23082
- height = node.offsetHeight;
23083
- setSizeInState({
23084
- width: width,
23085
- height: height
23086
- });
23087
- },
23088
- onDragEnd: function onDragEnd(_position, dragSize) {
23089
- if (dragSize !== sizeInState) {
23090
- setSizeInState(dragSize);
23091
- }
23092
- },
23093
- leftHeaderComponent: /*#__PURE__*/React.createElement("div", null),
23094
- rightHeaderComponent: /*#__PURE__*/React.createElement(Box, {
23095
- sx: {
23096
- flex: 1,
23097
- overflow: 'hidden',
23098
- display: 'flex',
23099
- justifyContent: 'flex-end',
23100
- position: 'absolute',
23101
- right: 32,
23102
- backgroundColor: 'geowebColors.background.surface',
23103
- height: 24,
23104
- paddingLeft: 1
23105
- }
23106
- }, /*#__PURE__*/React.createElement(Box, {
23107
- sx: {
23108
- position: 'relative',
23109
- top: -7
23110
- }
23111
- }, /*#__PURE__*/React.createElement(SwitchButton, null))),
23112
- sx: {
23113
- footer: {
23114
- backgroundColor: 'inherit',
23115
- boxShadow: 'none'
23116
- }
23117
- }
23118
- }, /*#__PURE__*/React.createElement(PublicWarningsForm, {
23119
- isDisabled: true
23120
- }));
23427
+ var getPublicWarningObject = createSelector(getPublicWarningStore, function (publicWarningStore) {
23428
+ return publicWarningStore.object;
23429
+ });
23430
+
23431
+ /* *
23432
+ * Licensed under the Apache License, Version 2.0 (the "License");
23433
+ * you may not use this file except in compliance with the License.
23434
+ * You may obtain a copy of the License at
23435
+ *
23436
+ * http://www.apache.org/licenses/LICENSE-2.0
23437
+ *
23438
+ * Unless required by applicable law or agreed to in writing, software
23439
+ * distributed under the License is distributed on an "AS IS" BASIS,
23440
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23441
+ * See the License for the specific language governing permissions and
23442
+ * limitations under the License.
23443
+ *
23444
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
23445
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
23446
+ * */
23447
+ var PublicWarningsFormConnect = function PublicWarningsFormConnect() {
23448
+ var publicWarningObject = useSelector(function (store) {
23449
+ return getPublicWarningObject(store);
23450
+ });
23451
+ return /*#__PURE__*/React.createElement(PublicWarningsForm, {
23452
+ isDisabled: true,
23453
+ object: publicWarningObject
23454
+ });
23121
23455
  };
23122
23456
 
23123
23457
  /* *
@@ -23136,7 +23470,6 @@ var PublicWarnings = function PublicWarnings(_ref) {
23136
23470
  * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
23137
23471
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
23138
23472
  * */
23139
- var publicWarningDialogType = uiTypes.DialogTypes.PublicWarnings;
23140
23473
  var PublicWarningsConnect = function PublicWarningsConnect(_ref) {
23141
23474
  var bounds = _ref.bounds,
23142
23475
  _ref$source = _ref.source,
@@ -23159,7 +23492,7 @@ var PublicWarningsConnect = function PublicWarningsConnect(_ref) {
23159
23492
  source: uiSource,
23160
23493
  bounds: bounds,
23161
23494
  startPosition: startPosition
23162
- });
23495
+ }, /*#__PURE__*/React__default.createElement(PublicWarningsFormConnect, null));
23163
23496
  };
23164
23497
 
23165
23498
  var createSymbol = function createSymbol(name) {
@@ -23729,9 +24062,10 @@ function drawingSaga() {
23729
24062
  var drawingModuleConfig = {
23730
24063
  id: 'drawing-module',
23731
24064
  reducersMap: {
23732
- drawings: reducer
24065
+ drawings: reducer$1,
24066
+ publicWarningForm: reducer
23733
24067
  },
23734
24068
  sagas: [drawingSaga]
23735
24069
  };
23736
24070
 
23737
- export { DIALOG_TITLE, DrawingToolConnect, Wrapper as DrawingToolForm, DrawingToolFormConnect, DrawingToolMapButtonConnect, ObjectManagerConnect, ObjectManagerMapButtonConnect, PublicWarnings, PublicWarningsConnect, WarningsModuleProvider, drawingModuleConfig, publicWarningDialogType, useObjectDrawDialogAction };
24071
+ export { DIALOG_TITLE, DrawingToolConnect, Wrapper as DrawingToolForm, DrawingToolFormConnect, DrawingToolMapButtonConnect, ObjectManagerConnect, ObjectManagerMapButtonConnect, PublicWarnings, PublicWarningsConnect, WarningsModuleProvider, drawingModuleConfig, useObjectDrawDialogAction };