@opengeoweb/sigmet-airmet 4.2.0 → 4.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/index.esm.js +1244 -1191
  2. package/index.umd.js +1186 -1152
  3. package/lib/AirmetDemo.stories.d.ts +1 -0
  4. package/lib/SigmetDemo.stories.d.ts +1 -0
  5. package/lib/components/ContentDialog/ContentDialog.stories.d.ts +80 -1
  6. package/lib/components/ProductForms/AirmetForm/AirmetForm.stories.d.ts +79 -4
  7. package/lib/components/ProductForms/ProductForm.styles.d.ts +22 -9
  8. package/lib/components/ProductForms/ProductFormDialog.Sigmet.stories.d.ts +1 -0
  9. package/lib/components/ProductForms/ProductFormFields/Change.d.ts +2 -5
  10. package/lib/components/ProductForms/ProductFormFields/CloudLevels.d.ts +2 -6
  11. package/lib/components/ProductForms/ProductFormFields/IssuedAt.d.ts +7 -0
  12. package/lib/components/ProductForms/ProductFormFields/IssuedAt.spec.d.ts +1 -0
  13. package/lib/components/ProductForms/ProductFormFields/Levels.d.ts +2 -8
  14. package/lib/components/ProductForms/ProductFormFields/ObservationForecast.d.ts +2 -5
  15. package/lib/components/ProductForms/ProductFormFields/ObservationForecastTime.d.ts +2 -4
  16. package/lib/components/ProductForms/ProductFormFields/Phenomenon.d.ts +2 -7
  17. package/lib/components/ProductForms/ProductFormFields/ProductFormFieldLayout.d.ts +8 -0
  18. package/lib/components/ProductForms/ProductFormFields/ProductFormFieldLayout.spec.d.ts +1 -0
  19. package/lib/components/ProductForms/ProductFormFields/Progress.d.ts +2 -6
  20. package/lib/components/ProductForms/ProductFormFields/SelectFIR.d.ts +2 -6
  21. package/lib/components/ProductForms/ProductFormFields/SurfaceVisibility.d.ts +2 -5
  22. package/lib/components/ProductForms/ProductFormFields/SurfaceWind.d.ts +2 -5
  23. package/lib/components/ProductForms/ProductFormFields/Tac.d.ts +7 -0
  24. package/lib/components/ProductForms/ProductFormFields/Tac.spec.d.ts +1 -0
  25. package/lib/components/ProductForms/ProductFormFields/Type.d.ts +2 -5
  26. package/lib/components/ProductForms/ProductFormFields/ValidFrom.d.ts +4 -7
  27. package/lib/components/ProductForms/ProductFormFields/ValidUntil.d.ts +2 -7
  28. package/lib/components/ProductForms/ProductFormFields/VolcanicFields.d.ts +2 -3
  29. package/lib/components/ProductForms/ProductFormLayout.d.ts +7 -0
  30. package/lib/components/ProductForms/SigmetForm/SigmetForm.stories.d.ts +88 -4
  31. package/lib/components/ProductForms/utils.d.ts +1 -0
  32. package/lib/components/ProductList/ProductList.stories.d.ts +32 -0
  33. package/lib/types.d.ts +6 -0
  34. package/lib/utils/store.d.ts +1 -1
  35. package/lib/utils/testUtils.d.ts +2 -1
  36. package/package.json +19 -16
package/index.esm.js CHANGED
@@ -1,18 +1,18 @@
1
1
  import * as React from 'react';
2
2
  import React__default from 'react';
3
- import { FormControlLabel, Radio, Grid, Typography, Tooltip, Button, Checkbox, MenuItem, FormHelperText, Box, Dialog, DialogTitle, DialogContent, Card, CardContent, List, ListItem, Skeleton, Backdrop, CircularProgress } from '@mui/material';
3
+ import { FormControlLabel, Radio, Grid, Typography, Tooltip, Box, Button, Checkbox, MenuItem, FormHelperText, useTheme, Dialog, DialogTitle, DialogContent, Card, List, ListItem, Skeleton, Backdrop, CircularProgress } from '@mui/material';
4
4
  import { useFormContext } from 'react-hook-form';
5
- import { ReactHookFormRadioGroup, ReactHookFormSelect, ReactHookFormNumberField, isInteger, isValidMax, isValidMin, isEmpty, ReactHookFormDateTime, isValidDate, isBefore, isBetween, hasMaxFeaturePoints, hasMulitpleIntersections, ReactHookFormHiddenInput, isMaximumOneDrawing, hasIntersectionWithFIR, isValidGeoJsonCoordinates, isXHoursBefore, isAfter, isXHoursAfter, ReactHookFormTextField, containsNoCommas, isLatitude, isNonOrBothCoordinates, isLongitude, errorMessages, isGeometryDirty, ReactHookFormProvider, defaultFormOptions } from '@opengeoweb/form-fields';
5
+ import { ReactHookFormRadioGroup, ReactHookFormSelect, ReactHookFormNumberField, isInteger, isValidMax, isValidMin, isEmpty, ReactHookFormDateTime, isValidDate, isBefore, isBetween, hasMaxFeaturePoints, hasMulitpleIntersections, ReactHookFormHiddenInput, isMaximumOneDrawing, hasIntersectionWithFIR, isValidGeoJsonCoordinates, isXHoursBefore, isAfter, isXHoursAfter, ReactHookFormTextField, containsNoCommas, isLatitude, isNonOrBothCoordinates, isLongitude, errorMessages, ReactHookFormFormControl, isGeometryDirty, ReactHookFormProvider, defaultFormOptions } from '@opengeoweb/form-fields';
6
6
  import { useApiContext, useApi, createApiInstance } from '@opengeoweb/api';
7
7
  import produce, { produce as produce$1 } from 'immer';
8
- import { useDispatch, useSelector, shallowEqual } from 'react-redux';
9
- import { mapTypes, mapSelectors, generateMapId, generateTimesliderId, SyncGroups, generateLayerId, mapActions, publicLayers, MapControls, LayerManagerMapButtonConnect, LegendMapButtonConnect, MultiDimensionSelectMapButtonsConnect, MapViewConnect, MapViewLayer, TimeSliderConnect, LegendConnect } from '@opengeoweb/core';
10
8
  import * as turf from '@turf/turf';
11
9
  import { polygonToLineString, booleanClockwise, rewind } from '@turf/turf';
12
- import { useDraftFormHelpers, useIsMounted, StatusTag, AlertBanner, usePreventBrowserClose, useConfirmationDialog, isAxiosError, getAxiosErrorMessage, ConfirmationServiceProvider, usePoller } from '@opengeoweb/shared';
13
- import { Location, DrawRegion, DrawPolygon, DrawFIRLand, Delete, ChevronLeft, Info, Edit, Success, Clock } from '@opengeoweb/theme';
10
+ import { useDraftFormHelpers, ToggleMenu, useIsMounted, StatusTag, AlertBanner, usePreventBrowserClose, useConfirmationDialog, isAxiosError, getAxiosErrorMessage, ConfirmationServiceProvider, usePoller } from '@opengeoweb/shared';
11
+ import { Location, DrawRegion, DrawPolygon, DrawFIRLand, Delete, ChevronLeft, Edit, Success, Clock } from '@opengeoweb/theme';
14
12
  import moment from 'moment';
15
13
  import { debounce } from 'lodash';
14
+ import { useDispatch, useSelector, shallowEqual } from 'react-redux';
15
+ import { mapTypes, mapSelectors, generateMapId, generateTimesliderId, SyncGroups, generateLayerId, mapActions, publicLayers, MapControls, LayerManagerMapButtonConnect, LegendMapButtonConnect, MultiDimensionSelectMapButtonsConnect, MapViewConnect, MapViewLayer, TimeSliderConnect, LegendConnect } from '@opengeoweb/core';
16
16
 
17
17
  function _typeof(obj) {
18
18
  "@babel/helpers - typeof";
@@ -117,6 +117,188 @@ function _nonIterableRest() {
117
117
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
118
118
  }
119
119
 
120
+ var type = "FeatureCollection";
121
+ var features = [
122
+ {
123
+ type: "Feature",
124
+ geometry: {
125
+ type: "Polygon",
126
+ coordinates: [
127
+ [
128
+ [
129
+ 5,
130
+ 55
131
+ ],
132
+ [
133
+ 4.331914,
134
+ 55.332644
135
+ ],
136
+ [
137
+ 3.368817,
138
+ 55.764314
139
+ ],
140
+ [
141
+ 2.761908,
142
+ 54.379261
143
+ ],
144
+ [
145
+ 3.15576,
146
+ 52.913554
147
+ ],
148
+ [
149
+ 2.000002,
150
+ 51.500002
151
+ ],
152
+ [
153
+ 3.370001,
154
+ 51.369722
155
+ ],
156
+ [
157
+ 3.370527,
158
+ 51.36867
159
+ ],
160
+ [
161
+ 3.362223,
162
+ 51.320002
163
+ ],
164
+ [
165
+ 3.36389,
166
+ 51.313608
167
+ ],
168
+ [
169
+ 3.373613,
170
+ 51.309999
171
+ ],
172
+ [
173
+ 3.952501,
174
+ 51.214441
175
+ ],
176
+ [
177
+ 4.397501,
178
+ 51.452776
179
+ ],
180
+ [
181
+ 5.078611,
182
+ 51.391665
183
+ ],
184
+ [
185
+ 5.848333,
186
+ 51.139444
187
+ ],
188
+ [
189
+ 5.651667,
190
+ 50.824717
191
+ ],
192
+ [
193
+ 6.011797,
194
+ 50.757273
195
+ ],
196
+ [
197
+ 5.934168,
198
+ 51.036386
199
+ ],
200
+ [
201
+ 6.222223,
202
+ 51.361666
203
+ ],
204
+ [
205
+ 5.94639,
206
+ 51.811663
207
+ ],
208
+ [
209
+ 6.405001,
210
+ 51.830828
211
+ ],
212
+ [
213
+ 7.053095,
214
+ 52.237764
215
+ ],
216
+ [
217
+ 7.031389,
218
+ 52.268885
219
+ ],
220
+ [
221
+ 7.063612,
222
+ 52.346109
223
+ ],
224
+ [
225
+ 7.065557,
226
+ 52.385828
227
+ ],
228
+ [
229
+ 7.133055,
230
+ 52.888887
231
+ ],
232
+ [
233
+ 7.14218,
234
+ 52.898244
235
+ ],
236
+ [
237
+ 7.191667,
238
+ 53.3
239
+ ],
240
+ [
241
+ 6.5,
242
+ 53.666667
243
+ ],
244
+ [
245
+ 6.500002,
246
+ 55.000002
247
+ ],
248
+ [
249
+ 5,
250
+ 55
251
+ ]
252
+ ]
253
+ ]
254
+ },
255
+ properties: {
256
+ centlong: 4.98042633,
257
+ REGION: "EUR",
258
+ StateName: "Netherlands",
259
+ FIRname: "AMSTERDAM FIR",
260
+ StateCode: "NLD",
261
+ centlat: 52.8618788,
262
+ ICAOCODE: "EHAA"
263
+ }
264
+ }
265
+ ];
266
+ var firArea = {
267
+ type: type,
268
+ features: features
269
+ };
270
+
271
+ /* *
272
+ * Licensed under the Apache License, Version 2.0 (the "License");
273
+ * you may not use this file except in compliance with the License.
274
+ * You may obtain a copy of the License at
275
+ *
276
+ * http://www.apache.org/licenses/LICENSE-2.0
277
+ *
278
+ * Unless required by applicable law or agreed to in writing, software
279
+ * distributed under the License is distributed on an "AS IS" BASIS,
280
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
281
+ * See the License for the specific language governing permissions and
282
+ * limitations under the License.
283
+ *
284
+ * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
285
+ * Copyright 2021 - Finnish Meteorological Institute (FMI)
286
+ * */
287
+ /**
288
+ * Function to translate the geojson data to a GeoJSON.FeatureCollection
289
+ */
290
+
291
+ var getFir = function getFir() {
292
+ return firArea;
293
+ };
294
+ /**
295
+ * Function to check if the given geojson object has 'fir' selectionType property
296
+ */
297
+
298
+ var isFir = function isFir(geojson) {
299
+ return geojson && geojson.features && geojson.features[0].properties['selectionType'] === 'fir';
300
+ };
301
+
120
302
  var srsAndBboxDefault = {
121
303
  bbox: {
122
304
  left: -1205884.85699446,
@@ -432,443 +614,18 @@ var StartOrEndDrawing;
432
614
  StartOrEndDrawing["end"] = "end";
433
615
  })(StartOrEndDrawing || (StartOrEndDrawing = {}));
434
616
 
435
- /* *
436
- * Licensed under the Apache License, Version 2.0 (the "License");
437
- * you may not use this file except in compliance with the License.
438
- * You may obtain a copy of the License at
439
- *
440
- * http://www.apache.org/licenses/LICENSE-2.0
441
- *
442
- * Unless required by applicable law or agreed to in writing, software
443
- * distributed under the License is distributed on an "AS IS" BASIS,
444
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
445
- * See the License for the specific language governing permissions and
446
- * limitations under the License.
447
- *
448
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
449
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
450
- * */
451
- var adagucBaseUrl = 'https://adaguc-server-geoweb.geoweb.knmi.cloud/adagucserver';
452
- var KNMIGeoWebOverlays = {
453
- name: 'KNMIGeoWebOverlays',
454
- url: "".concat(adagucBaseUrl, "?dataset=OVL"),
455
- id: 'knmigeoweboverlays'
456
- };
457
- var northSeaPlatforms = {
458
- service: KNMIGeoWebOverlays.url,
459
- name: 'northseastations',
460
- format: 'image/png',
461
- layerType: mapTypes.LayerType.overLayer,
462
- enabled: true
463
- };
464
- var majorAirportsEHAA = {
465
- service: KNMIGeoWebOverlays.url,
466
- name: 'airports',
467
- format: 'image/png',
468
- layerType: mapTypes.LayerType.overLayer,
469
- enabled: true
470
- };
617
+ var getDrawModeFromSelectionType = function getDrawModeFromSelectionType(selectionType) {
618
+ switch (selectionType) {
619
+ case 'point':
620
+ return MapDrawMode.POINT;
471
621
 
472
- /* *
473
- * Licensed under the Apache License, Version 2.0 (the "License");
474
- * you may not use this file except in compliance with the License.
475
- * You may obtain a copy of the License at
476
- *
477
- * http://www.apache.org/licenses/LICENSE-2.0
478
- *
479
- * Unless required by applicable law or agreed to in writing, software
480
- * distributed under the License is distributed on an "AS IS" BASIS,
481
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
482
- * See the License for the specific language governing permissions and
483
- * limitations under the License.
484
- *
485
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
486
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
487
- * */
488
- var allowOneGeoJSONFeature = function allowOneGeoJSONFeature(mode, geojson) {
489
- switch (mode) {
490
- case MapDrawMode.BOX:
491
- case MapDrawMode.POLYGON:
492
- return geojson.features[0].geometry.coordinates.length > 1 ? produce(geojson, function (draft) {
493
- draft.features[0].geometry.coordinates = [draft.features[0].geometry.coordinates[1]];
494
- }) : geojson;
622
+ case 'box':
623
+ return MapDrawMode.BOX;
624
+
625
+ case 'fir':
626
+ return MapDrawMode.FIR;
495
627
 
496
- default:
497
- return geojson;
498
- }
499
- };
500
-
501
- var MapViewGeoJson = function MapViewGeoJson(_ref) {
502
- var geoJSONs = _ref.geoJSONs,
503
- _ref$setLayerGeoJSONs = _ref.setLayerGeoJSONs,
504
- setLayerGeoJSONs = _ref$setLayerGeoJSONs === void 0 ? function () {} : _ref$setLayerGeoJSONs,
505
- _ref$layerDrawModes = _ref.layerDrawModes,
506
- layerDrawModes = _ref$layerDrawModes === void 0 ? {
507
- start: null,
508
- end: null
509
- } : _ref$layerDrawModes,
510
- _ref$drawMode = _ref.drawMode,
511
- drawMode = _ref$drawMode === void 0 ? {
512
- start: null,
513
- end: null
514
- } : _ref$drawMode,
515
- _ref$setDrawMode = _ref.setDrawMode,
516
- setDrawMode = _ref$setDrawMode === void 0 ? function () {} : _ref$setDrawMode,
517
- _ref$exitDrawModeCall = _ref.exitDrawModeCallbackStart,
518
- exitDrawModeCallbackStart = _ref$exitDrawModeCall === void 0 ? function () {} : _ref$exitDrawModeCall,
519
- _ref$exitDrawModeCall2 = _ref.exitDrawModeCallbackEnd,
520
- exitDrawModeCallbackEnd = _ref$exitDrawModeCall2 === void 0 ? function () {} : _ref$exitDrawModeCall2;
521
- var dispatch = useDispatch();
522
- var firstMap = useSelector(function (store) {
523
- return mapSelectors.getFirstMap(store);
524
- }, shallowEqual);
525
- var firstMapId = firstMap && firstMap.id ? firstMap.id : null;
526
- var mapLayers = useSelector(function (store) {
527
- return mapSelectors.getMapLayers(store, firstMapId);
528
- }, shallowEqual);
529
- var mapDimensions = useSelector(function (store) {
530
- return mapSelectors.getMapDimensions(store, firstMapId);
531
- }, shallowEqual);
532
- var mapId = React.useRef("sigmet-".concat(generateMapId())).current;
533
- var timesliderId = React.useRef("sigmet-".concat(generateTimesliderId())).current;
534
- var syncGroupAddGroup = React.useCallback(function (payload) {
535
- dispatch(SyncGroups.actions.syncGroupAddGroup(payload));
536
- }, [dispatch]);
537
- var syncGroupAddTarget = React.useCallback(function (payload) {
538
- dispatch(SyncGroups.actions.syncGroupAddTarget(payload));
539
- }, [dispatch]);
540
- React.useEffect(function () {
541
- if (mapLayers && mapLayers.length) {
542
- // use maplayers, but change layerId and current mapId
543
- var layers = mapLayers.map(function (layer) {
544
- return Object.assign(Object.assign({}, layer), {
545
- id: generateLayerId(),
546
- mapId: mapId
547
- });
548
- });
549
- dispatch(mapActions.setLayers({
550
- mapId: mapId,
551
- layers: layers
552
- }));
553
- }
554
-
555
- if (mapDimensions && mapDimensions.length) {
556
- dispatch(mapActions.mapChangeDimension({
557
- mapId: mapId,
558
- dimension: mapDimensions[0],
559
- origin: 'MapViewGeoJson'
560
- }));
561
- }
562
-
563
- dispatch(mapActions.setBaseLayers({
564
- mapId: mapId,
565
- layers: [Object.assign(Object.assign({}, publicLayers.baseLayerGrey), {
566
- id: "baselayer-".concat(mapId)
567
- }), Object.assign(Object.assign({}, publicLayers.overLayer), {
568
- id: "countryborders-".concat(mapId)
569
- }), Object.assign(Object.assign({}, northSeaPlatforms), {
570
- id: "northseaplatforms-".concat(mapId)
571
- }), Object.assign(Object.assign({}, majorAirportsEHAA), {
572
- id: "majorairportsehaa-".concat(mapId)
573
- })]
574
- }));
575
- dispatch(mapActions.setBbox({
576
- mapId: mapId,
577
- bbox: srsAndBboxDefault.bbox,
578
- srs: srsAndBboxDefault.srs
579
- }));
580
- syncGroupAddGroup({
581
- groupId: 'Time_SigmetAirmet',
582
- title: 'Group 1 for sigmet/airmet map',
583
- type: SyncGroups.constants.SYNCGROUPS_TYPE_SETTIME
584
- });
585
- syncGroupAddTarget({
586
- groupId: 'Time_SigmetAirmet',
587
- targetId: mapId
588
- });
589
- syncGroupAddTarget({
590
- groupId: 'Time_SigmetAirmet',
591
- targetId: timesliderId
592
- }); // eslint-disable-next-line react-hooks/exhaustive-deps
593
- }, []);
594
- return /*#__PURE__*/React.createElement("div", {
595
- style: {
596
- position: 'relative',
597
- height: '99%'
598
- },
599
- "data-testid": "MapView"
600
- }, /*#__PURE__*/React.createElement(MapControls, null, /*#__PURE__*/React.createElement(LayerManagerMapButtonConnect, {
601
- source: "module",
602
- mapId: mapId
603
- }), /*#__PURE__*/React.createElement(LegendMapButtonConnect, {
604
- source: "module",
605
- mapId: mapId
606
- }), /*#__PURE__*/React.createElement(MultiDimensionSelectMapButtonsConnect, {
607
- source: "module",
608
- mapId: mapId
609
- })), /*#__PURE__*/React.createElement(MapViewConnect, {
610
- mapId: mapId
611
- }, /*#__PURE__*/React.createElement(MapViewLayer, {
612
- id: "geojsonlayer-fir-".concat(mapId),
613
- isInEditMode: false,
614
- geojson: geoJSONs.fir
615
- }), /*#__PURE__*/React.createElement(MapViewLayer, {
616
- id: "geojsonlayer-end-".concat(mapId),
617
- isInEditMode: drawMode.end !== null && layerDrawModes.end !== null,
618
- geojson: geoJSONs.end,
619
- drawMode: layerDrawModes.end,
620
- updateGeojson: function updateGeojson(geojson) {
621
- var end = allowOneGeoJSONFeature(layerDrawModes.end, geojson);
622
- setLayerGeoJSONs(Object.assign(Object.assign({}, geoJSONs), {
623
- end: end
624
- }));
625
- },
626
- exitDrawModeCallback: function exitDrawModeCallback() {
627
- setDrawMode({
628
- start: null,
629
- end: null
630
- });
631
- exitDrawModeCallbackEnd();
632
- },
633
- featureNrToEdit: 0
634
- }), /*#__PURE__*/React.createElement(MapViewLayer, {
635
- id: "geojsonlayer-start-".concat(mapId),
636
- isInEditMode: drawMode.start !== null && layerDrawModes.start !== null,
637
- geojson: geoJSONs.start,
638
- drawMode: layerDrawModes.start,
639
- updateGeojson: function updateGeojson(geojson) {
640
- var start = allowOneGeoJSONFeature(layerDrawModes.start, geojson);
641
- setLayerGeoJSONs(Object.assign(Object.assign({}, geoJSONs), {
642
- start: start
643
- }));
644
- },
645
- exitDrawModeCallback: function exitDrawModeCallback() {
646
- setDrawMode({
647
- start: null,
648
- end: null
649
- });
650
- exitDrawModeCallbackStart();
651
- },
652
- featureNrToEdit: 0
653
- }), /*#__PURE__*/React.createElement(MapViewLayer, {
654
- id: "geojsonlayer-intersection-end-".concat(mapId),
655
- isInEditMode: false,
656
- geojson: geoJSONs.intersectionEnd
657
- }), /*#__PURE__*/React.createElement(MapViewLayer, {
658
- id: "geojsonlayer-intersection-start-".concat(mapId),
659
- isInEditMode: false,
660
- geojson: geoJSONs.intersectionStart
661
- })), /*#__PURE__*/React.createElement("div", {
662
- style: {
663
- position: 'absolute',
664
- left: '0',
665
- bottom: '0',
666
- zIndex: 1000,
667
- width: '100%'
668
- }
669
- }, /*#__PURE__*/React.createElement(TimeSliderConnect, {
670
- sourceId: timesliderId,
671
- mapId: mapId
672
- })), /*#__PURE__*/React.createElement(LegendConnect, {
673
- showMapId: true,
674
- mapId: mapId
675
- }));
676
- };
677
-
678
- var type = "FeatureCollection";
679
- var features = [
680
- {
681
- type: "Feature",
682
- geometry: {
683
- type: "Polygon",
684
- coordinates: [
685
- [
686
- [
687
- 5,
688
- 55
689
- ],
690
- [
691
- 4.331914,
692
- 55.332644
693
- ],
694
- [
695
- 3.368817,
696
- 55.764314
697
- ],
698
- [
699
- 2.761908,
700
- 54.379261
701
- ],
702
- [
703
- 3.15576,
704
- 52.913554
705
- ],
706
- [
707
- 2.000002,
708
- 51.500002
709
- ],
710
- [
711
- 3.370001,
712
- 51.369722
713
- ],
714
- [
715
- 3.370527,
716
- 51.36867
717
- ],
718
- [
719
- 3.362223,
720
- 51.320002
721
- ],
722
- [
723
- 3.36389,
724
- 51.313608
725
- ],
726
- [
727
- 3.373613,
728
- 51.309999
729
- ],
730
- [
731
- 3.952501,
732
- 51.214441
733
- ],
734
- [
735
- 4.397501,
736
- 51.452776
737
- ],
738
- [
739
- 5.078611,
740
- 51.391665
741
- ],
742
- [
743
- 5.848333,
744
- 51.139444
745
- ],
746
- [
747
- 5.651667,
748
- 50.824717
749
- ],
750
- [
751
- 6.011797,
752
- 50.757273
753
- ],
754
- [
755
- 5.934168,
756
- 51.036386
757
- ],
758
- [
759
- 6.222223,
760
- 51.361666
761
- ],
762
- [
763
- 5.94639,
764
- 51.811663
765
- ],
766
- [
767
- 6.405001,
768
- 51.830828
769
- ],
770
- [
771
- 7.053095,
772
- 52.237764
773
- ],
774
- [
775
- 7.031389,
776
- 52.268885
777
- ],
778
- [
779
- 7.063612,
780
- 52.346109
781
- ],
782
- [
783
- 7.065557,
784
- 52.385828
785
- ],
786
- [
787
- 7.133055,
788
- 52.888887
789
- ],
790
- [
791
- 7.14218,
792
- 52.898244
793
- ],
794
- [
795
- 7.191667,
796
- 53.3
797
- ],
798
- [
799
- 6.5,
800
- 53.666667
801
- ],
802
- [
803
- 6.500002,
804
- 55.000002
805
- ],
806
- [
807
- 5,
808
- 55
809
- ]
810
- ]
811
- ]
812
- },
813
- properties: {
814
- centlong: 4.98042633,
815
- REGION: "EUR",
816
- StateName: "Netherlands",
817
- FIRname: "AMSTERDAM FIR",
818
- StateCode: "NLD",
819
- centlat: 52.8618788,
820
- ICAOCODE: "EHAA"
821
- }
822
- }
823
- ];
824
- var firArea = {
825
- type: type,
826
- features: features
827
- };
828
-
829
- /* *
830
- * Licensed under the Apache License, Version 2.0 (the "License");
831
- * you may not use this file except in compliance with the License.
832
- * You may obtain a copy of the License at
833
- *
834
- * http://www.apache.org/licenses/LICENSE-2.0
835
- *
836
- * Unless required by applicable law or agreed to in writing, software
837
- * distributed under the License is distributed on an "AS IS" BASIS,
838
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
839
- * See the License for the specific language governing permissions and
840
- * limitations under the License.
841
- *
842
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
843
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
844
- * */
845
- /**
846
- * Function to translate the geojson data to a GeoJSON.FeatureCollection
847
- */
848
-
849
- var getFir = function getFir() {
850
- return firArea;
851
- };
852
- /**
853
- * Function to check if the given geojson object has 'fir' selectionType property
854
- */
855
-
856
- var isFir = function isFir(geojson) {
857
- return geojson && geojson.features && geojson.features[0].properties['selectionType'] === 'fir';
858
- };
859
-
860
- var getDrawModeFromSelectionType = function getDrawModeFromSelectionType(selectionType) {
861
- switch (selectionType) {
862
- case 'point':
863
- return MapDrawMode.POINT;
864
-
865
- case 'box':
866
- return MapDrawMode.BOX;
867
-
868
- case 'fir':
869
- return MapDrawMode.FIR;
870
-
871
- case 'poly':
628
+ case 'poly':
872
629
  default:
873
630
  return MapDrawMode.POLYGON;
874
631
  }
@@ -1117,21 +874,19 @@ var createInterSections = function createInterSections(geoJSONs) {
1117
874
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1118
875
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
1119
876
  * */
1120
- var styles$4 = {
1121
- productForm: {
1122
- overflowY: 'scroll',
1123
- overflowX: 'hidden',
1124
- height: '100%',
1125
- width: '100%'
1126
- },
877
+ var styles$2 = {
1127
878
  label: {
1128
- paddingTop: '15px'
879
+ fontSize: '0.875rem',
880
+ marginTop: 2,
881
+ textAlign: 'right'
1129
882
  },
1130
883
  body: {
1131
884
  paddingTop: '17px'
1132
885
  },
1133
886
  containerItem: {
1134
- paddingTop: '8px'
887
+ ' .MuiTypography-subtitle1': {
888
+ marginTop: 1
889
+ }
1135
890
  },
1136
891
  volcanicField: {
1137
892
  marginBottom: 2
@@ -1159,7 +914,22 @@ var styles$4 = {
1159
914
  opacity: '1'
1160
915
  },
1161
916
  drawSection: {
1162
- padding: '10px 0px'
917
+ '+ .MuiGrid-item': {
918
+ paddingTop: 5
919
+ },
920
+ ' .MuiTypography-subtitle1': {
921
+ marginTop: 1
922
+ }
923
+ },
924
+ helperText: {
925
+ ' .MuiFormHelperText-root': {
926
+ position: 'absolute',
927
+ top: 56,
928
+ '&.Mui-error': {
929
+ top: 'auto',
930
+ position: 'relative'
931
+ }
932
+ }
1163
933
  }
1164
934
  };
1165
935
 
@@ -1222,6 +992,31 @@ var RadioButtonAndLabel = function RadioButtonAndLabel(props) {
1222
992
  }, restProps));
1223
993
  };
1224
994
 
995
+ var ProductFormFieldLayout = function ProductFormFieldLayout(_a) {
996
+ var title = _a.title,
997
+ children = _a.children,
998
+ props = __rest(_a, ["title", "children"]);
999
+
1000
+ return /*#__PURE__*/React__default.createElement(Grid, Object.assign({
1001
+ item: true,
1002
+ container: true,
1003
+ spacing: 3
1004
+ }, props), /*#__PURE__*/React__default.createElement(Grid, {
1005
+ item: true,
1006
+ xs: 4,
1007
+ container: true,
1008
+ justifyContent: "flex-end"
1009
+ }, title && /*#__PURE__*/React__default.createElement(Typography, {
1010
+ variant: "subtitle1",
1011
+ sx: styles$2.label
1012
+ }, title)), /*#__PURE__*/React__default.createElement(Grid, {
1013
+ item: true,
1014
+ xs: 8,
1015
+ container: true,
1016
+ justifyContent: "flex-start"
1017
+ }, children));
1018
+ };
1019
+
1225
1020
  /* *
1226
1021
  * Licensed under the Apache License, Version 2.0 (the "License");
1227
1022
  * you may not use this file except in compliance with the License.
@@ -1235,38 +1030,20 @@ var RadioButtonAndLabel = function RadioButtonAndLabel(props) {
1235
1030
  * See the License for the specific language governing permissions and
1236
1031
  * limitations under the License.
1237
1032
  *
1238
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1239
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
1033
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1034
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
1240
1035
  * */
1241
1036
 
1242
1037
  var Change = function Change(_ref) {
1243
1038
  var isDisabled = _ref.isDisabled,
1244
1039
  isReadOnly = _ref.isReadOnly;
1245
1040
 
1246
- var _useFormContext = useFormContext(),
1247
- watch = _useFormContext.watch;
1248
-
1249
1041
  var _useDraftFormHelpers = useDraftFormHelpers(),
1250
1042
  isRequired = _useDraftFormHelpers.isRequired;
1251
1043
 
1252
- return /*#__PURE__*/React__default.createElement(Grid, {
1253
- item: true,
1254
- container: true,
1255
- spacing: 2,
1256
- sx: styles$4.containerItem
1257
- }, /*#__PURE__*/React__default.createElement(Grid, {
1258
- item: true,
1259
- xs: 4,
1260
- container: true,
1261
- justifyContent: "flex-end"
1262
- }, /*#__PURE__*/React__default.createElement(Typography, {
1263
- variant: "subtitle1",
1264
- sx: styles$4.label
1265
- }, "Change")), /*#__PURE__*/React__default.createElement(Grid, {
1266
- item: true,
1267
- xs: 8,
1268
- container: true,
1269
- justifyContent: "flex-start"
1044
+ return /*#__PURE__*/React__default.createElement(ProductFormFieldLayout, {
1045
+ title: "Change",
1046
+ sx: styles$2.containerItem
1270
1047
  }, /*#__PURE__*/React__default.createElement(Grid, {
1271
1048
  item: true,
1272
1049
  xs: 12
@@ -1277,23 +1054,24 @@ var Change = function Change(_ref) {
1277
1054
  isRequired: isRequired
1278
1055
  }
1279
1056
  },
1280
- disabled: isDisabled
1281
- }, (!isReadOnly || watch('change') === 'WKN') && /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
1057
+ disabled: isDisabled,
1058
+ isReadOnly: isReadOnly
1059
+ }, /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
1282
1060
  value: "WKN",
1283
1061
  label: "Weakening",
1284
1062
  disabled: isDisabled,
1285
1063
  "data-testid": "change-WKN"
1286
- }), (!isReadOnly || watch('change') === 'NC') && /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
1064
+ }), /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
1287
1065
  value: "NC",
1288
1066
  label: "No change",
1289
1067
  disabled: isDisabled,
1290
1068
  "data-testid": "change-NC"
1291
- }), (!isReadOnly || watch('change') === 'INTSF') && /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
1069
+ }), /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
1292
1070
  value: "INTSF",
1293
1071
  label: "Intensifying",
1294
1072
  disabled: isDisabled,
1295
1073
  "data-testid": "change-INTSF"
1296
- })))));
1074
+ }))));
1297
1075
  };
1298
1076
 
1299
1077
  /* *
@@ -1309,22 +1087,19 @@ var Change = function Change(_ref) {
1309
1087
  * See the License for the specific language governing permissions and
1310
1088
  * limitations under the License.
1311
1089
  *
1312
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1313
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
1090
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1091
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
1314
1092
  * */
1315
- var styles$3 = {
1316
- drawButtons: {
1317
- color: '#0075a9',
1318
- borderRadius: '5px',
1319
- border: 'solid 1px #0075a9',
1320
- padding: '2px'
1321
- },
1322
- drawButtonsSelected: {
1323
- color: 'white',
1324
- backgroundColor: '#0075a9',
1093
+ var styles$1 = {
1094
+ radioInput: {
1095
+ padding: 1,
1325
1096
  borderRadius: '5px',
1326
- border: 'solid 1px #0075a9',
1327
- padding: '2px'
1097
+ backgroundColor: 'geowebColors.buttons.tool.default.fill',
1098
+ color: 'geowebColors.buttons.tool.default.color',
1099
+ '&.Mui-checked': {
1100
+ backgroundColor: 'geowebColors.buttons.primary.default.fill',
1101
+ color: 'geowebColors.buttons.primary.default.color'
1102
+ }
1328
1103
  }
1329
1104
  };
1330
1105
 
@@ -1338,88 +1113,74 @@ var DrawTools = function DrawTools(_ref) {
1338
1113
  xs: 12,
1339
1114
  container: true,
1340
1115
  justifyContent: "space-between",
1341
- "data-testid": "drawtools"
1116
+ "data-testid": "drawtools",
1117
+ spacing: 1
1342
1118
  }, /*#__PURE__*/React__default.createElement(Grid, {
1343
1119
  item: true
1344
1120
  }, /*#__PURE__*/React__default.createElement(Tooltip, {
1345
1121
  title: "Drop a point as ".concat(type, " position")
1346
1122
  }, /*#__PURE__*/React__default.createElement(Radio, {
1347
- icon: /*#__PURE__*/React__default.createElement(Location, {
1348
- sx: styles$3.drawButtons
1349
- }),
1123
+ icon: /*#__PURE__*/React__default.createElement(Location, null),
1350
1124
  value: true,
1351
- checkedIcon: /*#__PURE__*/React__default.createElement(Location, {
1352
- sx: styles$3.drawButtonsSelected
1353
- }),
1125
+ checkedIcon: /*#__PURE__*/React__default.createElement(Location, null),
1354
1126
  checked: drawMode === MapDrawMode.POINT,
1355
1127
  onChange: function onChange() {
1356
1128
  setDrawMode(MapDrawMode.POINT);
1357
1129
  },
1358
- "data-testid": "drawtools-point"
1130
+ "data-testid": "drawtools-point",
1131
+ sx: styles$1.radioInput
1359
1132
  }))), /*#__PURE__*/React__default.createElement(Grid, {
1360
1133
  item: true
1361
1134
  }, /*#__PURE__*/React__default.createElement(Tooltip, {
1362
1135
  title: "Draw a box as ".concat(type, " position")
1363
1136
  }, /*#__PURE__*/React__default.createElement(Radio, {
1364
- icon: /*#__PURE__*/React__default.createElement(DrawRegion, {
1365
- sx: styles$3.drawButtons
1366
- }),
1367
- checkedIcon: /*#__PURE__*/React__default.createElement(DrawRegion, {
1368
- sx: styles$3.drawButtonsSelected
1369
- }),
1137
+ icon: /*#__PURE__*/React__default.createElement(DrawRegion, null),
1138
+ checkedIcon: /*#__PURE__*/React__default.createElement(DrawRegion, null),
1370
1139
  checked: drawMode === MapDrawMode.BOX,
1371
1140
  onChange: function onChange() {
1372
1141
  setDrawMode(MapDrawMode.BOX);
1373
1142
  },
1374
- "data-testid": "drawtools-box"
1143
+ "data-testid": "drawtools-box",
1144
+ sx: styles$1.radioInput
1375
1145
  }))), /*#__PURE__*/React__default.createElement(Grid, {
1376
1146
  item: true
1377
1147
  }, /*#__PURE__*/React__default.createElement(Tooltip, {
1378
1148
  title: "Draw a shape as ".concat(type, " position")
1379
1149
  }, /*#__PURE__*/React__default.createElement(Radio, {
1380
- icon: /*#__PURE__*/React__default.createElement(DrawPolygon, {
1381
- sx: styles$3.drawButtons
1382
- }),
1383
- checkedIcon: /*#__PURE__*/React__default.createElement(DrawPolygon, {
1384
- sx: styles$3.drawButtonsSelected
1385
- }),
1150
+ icon: /*#__PURE__*/React__default.createElement(DrawPolygon, null),
1151
+ checkedIcon: /*#__PURE__*/React__default.createElement(DrawPolygon, null),
1386
1152
  checked: drawMode === MapDrawMode.POLYGON,
1387
1153
  onChange: function onChange() {
1388
1154
  setDrawMode(MapDrawMode.POLYGON);
1389
1155
  },
1390
- "data-testid": "drawtools-polygon"
1156
+ "data-testid": "drawtools-polygon",
1157
+ sx: styles$1.radioInput
1391
1158
  }))), /*#__PURE__*/React__default.createElement(Grid, {
1392
1159
  item: true
1393
1160
  }, /*#__PURE__*/React__default.createElement(Tooltip, {
1394
1161
  title: "Set FIR as ".concat(type, " position")
1395
1162
  }, /*#__PURE__*/React__default.createElement(Radio, {
1396
- icon: /*#__PURE__*/React__default.createElement(DrawFIRLand, {
1397
- sx: styles$3.drawButtons
1398
- }),
1399
- checkedIcon: /*#__PURE__*/React__default.createElement(DrawFIRLand, {
1400
- sx: styles$3.drawButtonsSelected
1401
- }),
1163
+ icon: /*#__PURE__*/React__default.createElement(DrawFIRLand, null),
1164
+ checkedIcon: /*#__PURE__*/React__default.createElement(DrawFIRLand, null),
1402
1165
  checked: drawMode === MapDrawMode.FIR,
1403
1166
  onChange: function onChange() {
1404
1167
  setDrawMode(MapDrawMode.FIR);
1405
1168
  },
1406
- "data-testid": "drawtools-fir"
1169
+ "data-testid": "drawtools-fir",
1170
+ sx: styles$1.radioInput
1407
1171
  }))), /*#__PURE__*/React__default.createElement(Grid, {
1408
1172
  item: true
1409
1173
  }, /*#__PURE__*/React__default.createElement(Tooltip, {
1410
1174
  title: "Remove geometry"
1411
1175
  }, /*#__PURE__*/React__default.createElement(Radio, {
1412
- icon: /*#__PURE__*/React__default.createElement(Delete, {
1413
- sx: styles$3.drawButtons
1414
- }),
1415
- checkedIcon: /*#__PURE__*/React__default.createElement(Delete, {
1416
- sx: styles$3.drawButtonsSelected
1417
- }),
1176
+ icon: /*#__PURE__*/React__default.createElement(Delete, null),
1177
+ checkedIcon: /*#__PURE__*/React__default.createElement(Delete, null),
1418
1178
  checked: drawMode === MapDrawMode.DELETE,
1419
1179
  onChange: function onChange() {
1420
1180
  setDrawMode(MapDrawMode.DELETE);
1421
1181
  },
1422
- "data-testid": "drawtools-delete"
1182
+ "data-testid": "drawtools-delete",
1183
+ sx: styles$1.radioInput
1423
1184
  }))));
1424
1185
  };
1425
1186
 
@@ -1628,47 +1389,86 @@ var getProductFormMode = function getProductFormMode(canBeOptions, productListIt
1628
1389
  if (productListItem === null) return 'new';
1629
1390
  return canBeOptions.includes('PUBLISHED') ? 'edit' : 'view';
1630
1391
  };
1392
+ var buttonStyle = {
1393
+ minWidth: 96
1394
+ };
1631
1395
  var getProductFormLifecycleButtons = function getProductFormLifecycleButtons(canBe, onButtonPress) {
1632
- return /*#__PURE__*/React.createElement(Grid, {
1633
- container: true,
1634
- spacing: 1,
1635
- justifyContent: "flex-end"
1636
- }, canBe.includes('DISCARDED') && /*#__PURE__*/React.createElement(Grid, {
1637
- item: true
1638
- }, /*#__PURE__*/React.createElement(Button, {
1639
- color: "secondary",
1640
- onClick: function onClick() {
1641
- onButtonPress('DISCARDED');
1642
- },
1396
+ var hasDiscardButton = canBe.includes('DISCARDED');
1397
+
1398
+ var onDiscard = function onDiscard() {
1399
+ return onButtonPress('DISCARDED');
1400
+ };
1401
+
1402
+ var hasSaveButton = canBe.includes('DRAFTED');
1403
+
1404
+ var onSave = function onSave() {
1405
+ return onButtonPress('DRAFT');
1406
+ };
1407
+
1408
+ var hasCancelButton = canBe.includes('CANCELLED');
1409
+
1410
+ var onCancel = function onCancel() {
1411
+ return onButtonPress('CANCELLED');
1412
+ };
1413
+
1414
+ var hasPublishButton = canBe.includes('PUBLISHED');
1415
+
1416
+ var onPublish = function onPublish() {
1417
+ return onButtonPress('PUBLISHED');
1418
+ };
1419
+
1420
+ return /*#__PURE__*/React.createElement(Box, {
1421
+ sx: {
1422
+ display: 'flex',
1423
+ justifyContent: 'flex-end',
1424
+ 'button:not(:first-of-type)': {
1425
+ marginLeft: 1
1426
+ }
1427
+ }
1428
+ }, /*#__PURE__*/React.createElement(Box, {
1429
+ display: {
1430
+ xs: 'none',
1431
+ lg: 'block'
1432
+ }
1433
+ }, hasDiscardButton && /*#__PURE__*/React.createElement(Button, {
1434
+ variant: "flat",
1435
+ onClick: onDiscard,
1436
+ sx: buttonStyle,
1643
1437
  "data-testid": "productform-dialog-discard"
1644
- }, "Discard")), canBe.includes('DRAFTED') && /*#__PURE__*/React.createElement(Grid, {
1645
- item: true
1646
- }, /*#__PURE__*/React.createElement(Button, {
1647
- color: "secondary",
1648
- variant: "outlined",
1649
- onClick: function onClick() {
1650
- onButtonPress('DRAFT');
1651
- },
1438
+ }, "DISCARD"), hasSaveButton && /*#__PURE__*/React.createElement(Button, {
1439
+ variant: "tertiary",
1440
+ onClick: onSave,
1441
+ sx: buttonStyle,
1652
1442
  "data-testid": "productform-dialog-draft"
1653
- }, "Save")), canBe.includes('CANCELLED') && /*#__PURE__*/React.createElement(Grid, {
1654
- item: true
1655
- }, /*#__PURE__*/React.createElement(Button, {
1656
- color: "secondary",
1657
- variant: "contained",
1658
- onClick: function onClick() {
1659
- onButtonPress('CANCELLED');
1660
- },
1443
+ }, "Save"), hasCancelButton && /*#__PURE__*/React.createElement(Button, {
1444
+ variant: "tertiary",
1445
+ onClick: onCancel,
1446
+ sx: buttonStyle,
1661
1447
  "data-testid": "productform-dialog-cancel"
1662
- }, "Cancel")), canBe.includes('PUBLISHED') && /*#__PURE__*/React.createElement(Grid, {
1663
- item: true
1664
- }, /*#__PURE__*/React.createElement(Button, {
1665
- color: "secondary",
1666
- variant: "contained",
1667
- onClick: function onClick() {
1668
- onButtonPress('PUBLISHED');
1669
- },
1448
+ }, "Cancel"), hasPublishButton && /*#__PURE__*/React.createElement(Button, {
1449
+ variant: "primary",
1450
+ onClick: onPublish,
1451
+ sx: buttonStyle,
1670
1452
  "data-testid": "productform-dialog-publish"
1671
- }, "Publish")));
1453
+ }, "Publish")), /*#__PURE__*/React.createElement(Box, {
1454
+ display: {
1455
+ lg: 'none'
1456
+ }
1457
+ }, /*#__PURE__*/React.createElement(ToggleMenu, {
1458
+ menuItems: [].concat(_toConsumableArray(hasDiscardButton ? [{
1459
+ text: 'Discard',
1460
+ action: onDiscard
1461
+ }] : []), _toConsumableArray(hasSaveButton ? [{
1462
+ text: 'Save',
1463
+ action: onSave
1464
+ }] : []), _toConsumableArray(hasCancelButton ? [{
1465
+ text: 'Cancel',
1466
+ action: onCancel
1467
+ }] : []), _toConsumableArray(hasPublishButton ? [{
1468
+ text: 'Publish',
1469
+ action: onPublish
1470
+ }] : []))
1471
+ })));
1672
1472
  };
1673
1473
  var hasValue = function hasValue(value) {
1674
1474
  return value !== null && value.toString() !== 'NaN';
@@ -1798,6 +1598,10 @@ var rewindGeometry = function rewindGeometry(geoJSON) {
1798
1598
  }
1799
1599
  });
1800
1600
  };
1601
+ var getFieldLabel = function getFieldLabel(title, isDisabled) {
1602
+ var action = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'Select';
1603
+ return isDisabled ? title : "".concat(action, " ").concat(title.toLowerCase());
1604
+ };
1801
1605
 
1802
1606
  var location_indicator_mwo$1 = "EHDB";
1803
1607
  var firareas$1 = {
@@ -1953,24 +1757,9 @@ var Levels = function Levels(_ref) {
1953
1757
  var selectedFIR = watch('locationIndicatorATSR'); // Get allowed level units based on selected FIR - if no FIR selected, allow all default units
1954
1758
 
1955
1759
  var allowedLevelUnitsForFir = getAllowedUnits(selectedFIR, allowedUnits, 'level_unit', LevelUnits);
1956
- return /*#__PURE__*/React__default.createElement(Grid, {
1957
- item: true,
1958
- container: true,
1959
- spacing: 2,
1960
- sx: styles$4.containerItem
1961
- }, /*#__PURE__*/React__default.createElement(Grid, {
1962
- item: true,
1963
- xs: 4,
1964
- container: true,
1965
- justifyContent: "flex-end"
1966
- }, /*#__PURE__*/React__default.createElement(Typography, {
1967
- variant: "subtitle1",
1968
- sx: styles$4.label
1969
- }, "Levels")), /*#__PURE__*/React__default.createElement(Grid, {
1970
- item: true,
1971
- xs: 8,
1972
- container: true,
1973
- justifyContent: "flex-start"
1760
+ return /*#__PURE__*/React__default.createElement(ProductFormFieldLayout, {
1761
+ title: "Levels",
1762
+ sx: styles$2.containerItem
1974
1763
  }, /*#__PURE__*/React__default.createElement(Grid, {
1975
1764
  item: true,
1976
1765
  xs: 12
@@ -1982,6 +1771,7 @@ var Levels = function Levels(_ref) {
1982
1771
  }
1983
1772
  },
1984
1773
  disabled: isDisabled,
1774
+ isReadOnly: isReadOnly,
1985
1775
  onChange: function onChange() {
1986
1776
  // Reset default value for the level value to '' so when it rerenders it uses this empty default value
1987
1777
  var currentValues = getValues();
@@ -2001,7 +1791,7 @@ var Levels = function Levels(_ref) {
2001
1791
 
2002
1792
  clearErrors(['level', 'lowerLevel']);
2003
1793
  }
2004
- }, (!isReadOnly || watch('levelInfoMode') === 'AT' || watch('levelInfoMode') === 'TOPS') && /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
1794
+ }, /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
2005
1795
  value: "AT",
2006
1796
  label: "At",
2007
1797
  checked: watch('levelInfoMode') === 'AT' || watch('levelInfoMode') === 'TOPS',
@@ -2010,11 +1800,15 @@ var Levels = function Levels(_ref) {
2010
1800
  }), watch('levelInfoMode') === 'AT' || watch('levelInfoMode') === 'TOPS' ? /*#__PURE__*/React__default.createElement(Grid, {
2011
1801
  item: true,
2012
1802
  xs: 12,
2013
- container: true
1803
+ container: true,
1804
+ spacing: 2,
1805
+ justifyItems: "flex-end",
1806
+ alignItems: "flex-end"
2014
1807
  }, /*#__PURE__*/React__default.createElement(Grid, {
2015
1808
  item: true,
2016
- xs: 3
2017
- }, (!isReadOnly || watch('levelInfoMode') === 'TOPS') && /*#__PURE__*/React__default.createElement(FormControlLabel, {
1809
+ xs: 12,
1810
+ md: 3
1811
+ }, /*#__PURE__*/React__default.createElement(FormControlLabel, {
2018
1812
  control: /*#__PURE__*/React__default.createElement(Checkbox, {
2019
1813
  checked: watch('levelInfoMode') === 'TOPS',
2020
1814
  onChange: function onChange() {
@@ -2029,7 +1823,8 @@ var Levels = function Levels(_ref) {
2029
1823
  label: "Tops"
2030
1824
  })), /*#__PURE__*/React__default.createElement(Grid, {
2031
1825
  item: true,
2032
- xs: 3
1826
+ xs: 4,
1827
+ md: 3
2033
1828
  }, /*#__PURE__*/React__default.createElement(ReactHookFormSelect, {
2034
1829
  name: "level.unit",
2035
1830
  label: "Unit",
@@ -2038,8 +1833,9 @@ var Levels = function Levels(_ref) {
2038
1833
  isRequired: isRequired
2039
1834
  }
2040
1835
  },
2041
- sx: styles$4.unit,
1836
+ sx: styles$2.unit,
2042
1837
  disabled: isDisabled,
1838
+ isReadOnly: isReadOnly,
2043
1839
  defaultValue: 'FL',
2044
1840
  onChange: function onChange() {
2045
1841
  if (getValues('level.value') || getValues('level.value') === 0) {
@@ -2055,7 +1851,8 @@ var Levels = function Levels(_ref) {
2055
1851
  }, allowedLevelUnitsForFir[key]);
2056
1852
  }))), /*#__PURE__*/React__default.createElement(Grid, {
2057
1853
  item: true,
2058
- xs: 6
1854
+ xs: 8,
1855
+ md: 6
2059
1856
  }, /*#__PURE__*/React__default.createElement(ReactHookFormNumberField, {
2060
1857
  name: "level.value",
2061
1858
  "data-testid": "level.value",
@@ -2082,8 +1879,9 @@ var Levels = function Levels(_ref) {
2082
1879
  }
2083
1880
  },
2084
1881
  disabled: isDisabled,
1882
+ isReadOnly: isReadOnly,
2085
1883
  autoFocus: true
2086
- }))) : null, (!isReadOnly || watch('levelInfoMode') === 'BETW' || watch('levelInfoMode') === 'BETW_SFC') && /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
1884
+ }))) : null, /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
2087
1885
  value: "BETW",
2088
1886
  label: "Between",
2089
1887
  checked: watch('levelInfoMode') === 'BETW' || watch('levelInfoMode') === 'BETW_SFC',
@@ -2092,13 +1890,16 @@ var Levels = function Levels(_ref) {
2092
1890
  }), watch('levelInfoMode') === 'BETW' || watch('levelInfoMode') === 'BETW_SFC' ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Grid, {
2093
1891
  item: true,
2094
1892
  xs: 12,
2095
- container: true
1893
+ container: true,
1894
+ spacing: 2
2096
1895
  }, /*#__PURE__*/React__default.createElement(Grid, {
2097
1896
  item: true,
2098
- xs: 3
1897
+ xs: 12,
1898
+ md: 3
2099
1899
  }), /*#__PURE__*/React__default.createElement(Grid, {
2100
1900
  item: true,
2101
- xs: 3
1901
+ xs: 4,
1902
+ md: 3
2102
1903
  }, /*#__PURE__*/React__default.createElement(ReactHookFormSelect, {
2103
1904
  name: "level.unit",
2104
1905
  label: "Unit",
@@ -2112,8 +1913,9 @@ var Levels = function Levels(_ref) {
2112
1913
  }
2113
1914
  }
2114
1915
  },
2115
- sx: styles$4.unit,
1916
+ sx: styles$2.unit,
2116
1917
  disabled: isDisabled,
1918
+ isReadOnly: isReadOnly,
2117
1919
  defaultValue: 'FL',
2118
1920
  onChange: function onChange() {
2119
1921
  trigger([].concat(_toConsumableArray(getValues('level.value') || getValues('level.value') === 0 ? ['level.value'] : []), _toConsumableArray(getValues('lowerLevel.value') || getValues('lowerLevel.value') === 0 ? ['lowerLevel.value'] : []), ['lowerLevel.unit']));
@@ -2127,11 +1929,12 @@ var Levels = function Levels(_ref) {
2127
1929
  }, allowedLevelUnitsForFir[key]);
2128
1930
  }))), /*#__PURE__*/React__default.createElement(Grid, {
2129
1931
  item: true,
2130
- xs: 6
1932
+ xs: 8,
1933
+ md: 6
2131
1934
  }, /*#__PURE__*/React__default.createElement(ReactHookFormNumberField, {
2132
1935
  name: "level.value",
2133
1936
  label: "Upper level",
2134
- sx: styles$4.levelField,
1937
+ sx: styles$2.levelField,
2135
1938
  rules: {
2136
1939
  validate: {
2137
1940
  isRequired: isRequired,
@@ -2154,6 +1957,7 @@ var Levels = function Levels(_ref) {
2154
1957
  }
2155
1958
  },
2156
1959
  disabled: isDisabled,
1960
+ isReadOnly: isReadOnly,
2157
1961
  onChange: function onChange() {
2158
1962
  return (getValues('lowerLevel.value') || getValues('lowerLevel.value') === 0) && trigger('lowerLevel.value');
2159
1963
  },
@@ -2161,11 +1965,15 @@ var Levels = function Levels(_ref) {
2161
1965
  }))), /*#__PURE__*/React__default.createElement(Grid, {
2162
1966
  item: true,
2163
1967
  xs: 12,
2164
- container: true
1968
+ container: true,
1969
+ spacing: 2,
1970
+ justifyItems: "flex-end",
1971
+ alignItems: "flex-end"
2165
1972
  }, /*#__PURE__*/React__default.createElement(Grid, {
2166
1973
  item: true,
2167
- xs: 3
2168
- }, (!isReadOnly || watch('levelInfoMode') === 'BETW_SFC') && /*#__PURE__*/React__default.createElement(FormControlLabel, {
1974
+ xs: 12,
1975
+ md: 3
1976
+ }, /*#__PURE__*/React__default.createElement(FormControlLabel, {
2169
1977
  control: /*#__PURE__*/React__default.createElement(Checkbox, {
2170
1978
  checked: watch('levelInfoMode') === 'BETW_SFC',
2171
1979
  onChange: function onChange() {
@@ -2182,7 +1990,8 @@ var Levels = function Levels(_ref) {
2182
1990
  label: "SFC"
2183
1991
  })), watch('levelInfoMode') !== 'BETW_SFC' && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Grid, {
2184
1992
  item: true,
2185
- xs: 3
1993
+ xs: 4,
1994
+ md: 3
2186
1995
  }, /*#__PURE__*/React__default.createElement(ReactHookFormSelect, {
2187
1996
  name: "lowerLevel.unit",
2188
1997
  label: "Unit",
@@ -2196,8 +2005,9 @@ var Levels = function Levels(_ref) {
2196
2005
  }
2197
2006
  }
2198
2007
  },
2199
- sx: styles$4.unit,
2008
+ sx: styles$2.unit,
2200
2009
  disabled: isDisabled,
2010
+ isReadOnly: isReadOnly,
2201
2011
  defaultValue: getValues('level.unit') || 'FL',
2202
2012
  onChange: function onChange() {
2203
2013
  if (getValues('lowerLevel.value') || getValues('lowerLevel.value') === 0) {
@@ -2215,7 +2025,8 @@ var Levels = function Levels(_ref) {
2215
2025
  }, allowedLevelUnitsForFir[key]);
2216
2026
  }))), /*#__PURE__*/React__default.createElement(Grid, {
2217
2027
  item: true,
2218
- xs: 6
2028
+ xs: 8,
2029
+ md: 6
2219
2030
  }, /*#__PURE__*/React__default.createElement(ReactHookFormNumberField, {
2220
2031
  name: "lowerLevel.value",
2221
2032
  label: "Lower level",
@@ -2245,8 +2056,9 @@ var Levels = function Levels(_ref) {
2245
2056
  }
2246
2057
  }
2247
2058
  },
2248
- disabled: isDisabled
2249
- }))))) : null, (!isReadOnly || watch('levelInfoMode') === 'ABV' || watch('levelInfoMode') === 'TOPS_ABV') && /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
2059
+ disabled: isDisabled,
2060
+ isReadOnly: isReadOnly
2061
+ }))))) : null, /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
2250
2062
  value: "ABV",
2251
2063
  label: "Above",
2252
2064
  disabled: isDisabled,
@@ -2255,11 +2067,15 @@ var Levels = function Levels(_ref) {
2255
2067
  }), watch('levelInfoMode') === 'ABV' || watch('levelInfoMode') === 'TOPS_ABV' ? /*#__PURE__*/React__default.createElement(Grid, {
2256
2068
  item: true,
2257
2069
  xs: 12,
2258
- container: true
2070
+ container: true,
2071
+ spacing: 2,
2072
+ justifyItems: "flex-end",
2073
+ alignItems: "flex-end"
2259
2074
  }, /*#__PURE__*/React__default.createElement(Grid, {
2260
2075
  item: true,
2261
- xs: 3
2262
- }, (!isReadOnly || watch('levelInfoMode') === 'TOPS_ABV') && /*#__PURE__*/React__default.createElement(FormControlLabel, {
2076
+ xs: 12,
2077
+ md: 3
2078
+ }, /*#__PURE__*/React__default.createElement(FormControlLabel, {
2263
2079
  control: /*#__PURE__*/React__default.createElement(Checkbox, {
2264
2080
  checked: watch('levelInfoMode') === 'TOPS_ABV',
2265
2081
  onChange: function onChange() {
@@ -2273,7 +2089,8 @@ var Levels = function Levels(_ref) {
2273
2089
  "data-testid": "levels-TOPS_ABV"
2274
2090
  })), /*#__PURE__*/React__default.createElement(Grid, {
2275
2091
  item: true,
2276
- xs: 3
2092
+ xs: 4,
2093
+ md: 3
2277
2094
  }, /*#__PURE__*/React__default.createElement(ReactHookFormSelect, {
2278
2095
  name: "level.unit",
2279
2096
  label: "Unit",
@@ -2282,8 +2099,9 @@ var Levels = function Levels(_ref) {
2282
2099
  isRequired: isRequired
2283
2100
  }
2284
2101
  },
2285
- sx: styles$4.unit,
2102
+ sx: styles$2.unit,
2286
2103
  disabled: isDisabled,
2104
+ isReadOnly: isReadOnly,
2287
2105
  defaultValue: 'FL',
2288
2106
  onChange: function onChange() {
2289
2107
  if (getValues('level.value') || getValues('level.value') === 0) {
@@ -2299,7 +2117,8 @@ var Levels = function Levels(_ref) {
2299
2117
  }, allowedLevelUnitsForFir[key]);
2300
2118
  }))), /*#__PURE__*/React__default.createElement(Grid, {
2301
2119
  item: true,
2302
- xs: 6
2120
+ xs: 8,
2121
+ md: 6
2303
2122
  }, /*#__PURE__*/React__default.createElement(ReactHookFormNumberField, {
2304
2123
  name: "level.value",
2305
2124
  label: "Level",
@@ -2325,8 +2144,9 @@ var Levels = function Levels(_ref) {
2325
2144
  }
2326
2145
  },
2327
2146
  disabled: isDisabled,
2147
+ isReadOnly: isReadOnly,
2328
2148
  autoFocus: true
2329
- }))) : null))));
2149
+ }))) : null)));
2330
2150
  };
2331
2151
 
2332
2152
  /* *
@@ -2342,8 +2162,8 @@ var Levels = function Levels(_ref) {
2342
2162
  * See the License for the specific language governing permissions and
2343
2163
  * limitations under the License.
2344
2164
  *
2345
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2346
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
2165
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2166
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
2347
2167
  * */
2348
2168
 
2349
2169
  var ObservationForecast = function ObservationForecast(_ref) {
@@ -2358,20 +2178,13 @@ var ObservationForecast = function ObservationForecast(_ref) {
2358
2178
  var _useDraftFormHelpers = useDraftFormHelpers(),
2359
2179
  isRequired = _useDraftFormHelpers.isRequired;
2360
2180
 
2361
- return /*#__PURE__*/React__default.createElement(Grid, {
2362
- item: true,
2363
- container: true,
2364
- spacing: 2
2365
- }, /*#__PURE__*/React__default.createElement(Grid, {
2366
- item: true,
2367
- xs: 4,
2368
- container: true,
2369
- justifyContent: "flex-end"
2370
- }), /*#__PURE__*/React__default.createElement(Grid, {
2371
- item: true,
2372
- xs: 8,
2373
- container: true,
2374
- justifyContent: "flex-start"
2181
+ return /*#__PURE__*/React__default.createElement(ProductFormFieldLayout, {
2182
+ sx: {
2183
+ paddingTop: '8px!important',
2184
+ '+ .MuiGrid-item': {
2185
+ paddingTop: 5
2186
+ }
2187
+ }
2375
2188
  }, /*#__PURE__*/React__default.createElement(ReactHookFormRadioGroup, {
2376
2189
  name: "isObservationOrForecast",
2377
2190
  disabled: isDisabled,
@@ -2384,7 +2197,8 @@ var ObservationForecast = function ObservationForecast(_ref) {
2384
2197
  if (getValues('observationOrForecastTime')) {
2385
2198
  trigger('observationOrForecastTime');
2386
2199
  }
2387
- }
2200
+ },
2201
+ isReadOnly: isReadOnly
2388
2202
  }, (!isReadOnly || watch('isObservationOrForecast') === 'OBS') && /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
2389
2203
  value: "OBS",
2390
2204
  label: "Observed",
@@ -2395,7 +2209,7 @@ var ObservationForecast = function ObservationForecast(_ref) {
2395
2209
  label: "Forecast",
2396
2210
  disabled: isDisabled,
2397
2211
  "data-testid": "isObservationOrForecast-FCST"
2398
- }))));
2212
+ })));
2399
2213
  };
2400
2214
 
2401
2215
  /* *
@@ -2411,8 +2225,8 @@ var ObservationForecast = function ObservationForecast(_ref) {
2411
2225
  * See the License for the specific language governing permissions and
2412
2226
  * limitations under the License.
2413
2227
  *
2414
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2415
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
2228
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2229
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
2416
2230
  * */
2417
2231
  var ForecastTimeValidation = 'Forecast time should lie between the valid start and valid end time';
2418
2232
 
@@ -2428,27 +2242,14 @@ var ObservationForecastTime = function ObservationForecastTime(_ref) {
2428
2242
  var _useFormContext = useFormContext(),
2429
2243
  watch = _useFormContext.watch;
2430
2244
 
2431
- return (!isReadOnly || watch('observationOrForecastTime') !== null) && /*#__PURE__*/React__default.createElement(Grid, {
2432
- item: true,
2433
- container: true,
2434
- spacing: 2
2435
- }, /*#__PURE__*/React__default.createElement(Grid, {
2436
- item: true,
2437
- xs: 4,
2438
- container: true,
2439
- justifyContent: "flex-end"
2440
- }, /*#__PURE__*/React__default.createElement(Typography, {
2441
- variant: "subtitle1",
2442
- sx: styles$4.label
2443
- }, "At")), /*#__PURE__*/React__default.createElement(Grid, {
2444
- item: true,
2445
- xs: 8,
2446
- container: true,
2447
- justifyContent: "flex-start"
2245
+ var label = getFieldLabel('Date and time', isReadOnly);
2246
+ return (!isReadOnly || watch('observationOrForecastTime') !== null) && /*#__PURE__*/React__default.createElement(ProductFormFieldLayout, {
2247
+ title: "At"
2448
2248
  }, /*#__PURE__*/React__default.createElement(ReactHookFormDateTime, {
2449
2249
  disablePast: watch('isObservationOrForecast') === 'FCST',
2450
2250
  disableFuture: watch('isObservationOrForecast') === 'OBS',
2451
2251
  name: "observationOrForecastTime",
2252
+ label: label,
2452
2253
  rules: {
2453
2254
  validate: {
2454
2255
  isValidDate: isValidDate,
@@ -2461,14 +2262,17 @@ var ObservationForecastTime = function ObservationForecastTime(_ref) {
2461
2262
  }
2462
2263
  },
2463
2264
  disabled: isDisabled,
2265
+ isReadOnly: isReadOnly,
2464
2266
  helperText: helperText,
2465
- onChange: onChange
2466
- })));
2267
+ onChange: onChange,
2268
+ sx: styles$2.helperText
2269
+ }));
2467
2270
  };
2468
2271
 
2469
2272
  var Phenomenon = function Phenomenon(_ref) {
2470
2273
  var productType = _ref.productType,
2471
2274
  isDisabled = _ref.isDisabled,
2275
+ isReadOnly = _ref.isReadOnly,
2472
2276
  _ref$onChange = _ref.onChange,
2473
2277
  _onChange = _ref$onChange === void 0 ? function () {
2474
2278
  return null;
@@ -2480,30 +2284,17 @@ var Phenomenon = function Phenomenon(_ref) {
2480
2284
  trigger = _useFormContext.trigger;
2481
2285
 
2482
2286
  var phenomenaList = productType === 'sigmet' ? SigmetPhenomena : AirmetPhenomena;
2483
- return /*#__PURE__*/React__default.createElement(Grid, {
2484
- item: true,
2485
- container: true,
2486
- spacing: 2
2487
- }, /*#__PURE__*/React__default.createElement(Grid, {
2488
- item: true,
2489
- xs: 4,
2490
- container: true,
2491
- justifyContent: "flex-end"
2492
- }, /*#__PURE__*/React__default.createElement(Typography, {
2493
- variant: "subtitle1",
2494
- sx: styles$4.label
2495
- }, "What")), /*#__PURE__*/React__default.createElement(Grid, {
2496
- item: true,
2497
- xs: 8,
2498
- container: true,
2499
- justifyContent: "flex-start"
2287
+ var label = getFieldLabel('Phenomenon', isReadOnly);
2288
+ return /*#__PURE__*/React__default.createElement(ProductFormFieldLayout, {
2289
+ title: "What"
2500
2290
  }, /*#__PURE__*/React__default.createElement(ReactHookFormSelect, {
2501
2291
  name: "phenomenon",
2502
- label: "Select phenomenon",
2292
+ label: label,
2503
2293
  rules: {
2504
2294
  required: true
2505
2295
  },
2506
2296
  disabled: isDisabled,
2297
+ isReadOnly: isReadOnly,
2507
2298
  "data-testid": "phenomenon",
2508
2299
  onChange: function onChange() {
2509
2300
  if (getValues('movementType') === 'NO_VA_EXP') {
@@ -2531,7 +2322,7 @@ var Phenomenon = function Phenomenon(_ref) {
2531
2322
  value: key,
2532
2323
  key: key
2533
2324
  }, phenomenaList[key]);
2534
- }))));
2325
+ })));
2535
2326
  };
2536
2327
 
2537
2328
  /* *
@@ -2547,8 +2338,8 @@ var Phenomenon = function Phenomenon(_ref) {
2547
2338
  * See the License for the specific language governing permissions and
2548
2339
  * limitations under the License.
2549
2340
  *
2550
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2551
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
2341
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2342
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
2552
2343
  * */
2553
2344
  var noIntersectionMessage$1 = 'The start position needs to be (partly) inside the FIR';
2554
2345
  var maximum6PointsMessage$1 = 'The start position drawing allows a maximum of 6 individual points';
@@ -2559,33 +2350,20 @@ var multiIntersectionsMessage = 'The drawn polygon has multiple intersections wi
2559
2350
  var StartGeometry = function StartGeometry(_ref) {
2560
2351
  var _ref$isReadOnly = _ref.isReadOnly,
2561
2352
  isReadOnly = _ref$isReadOnly === void 0 ? false : _ref$isReadOnly,
2562
- drawMode = _ref.drawMode,
2563
- geoJSONs = _ref.geoJSONs,
2564
- setDrawModeType = _ref.setDrawModeType;
2565
-
2566
- var _useFormContext = useFormContext(),
2567
- errors = _useFormContext.errors,
2568
- watch = _useFormContext.watch;
2569
-
2570
- var _useDraftFormHelpers = useDraftFormHelpers(),
2571
- isDraft = _useDraftFormHelpers.isDraft;
2572
-
2573
- return !isReadOnly && /*#__PURE__*/React__default.createElement(Grid, {
2574
- item: true,
2575
- container: true,
2576
- spacing: 2,
2577
- sx: styles$4.drawSection
2578
- }, /*#__PURE__*/React__default.createElement(Grid, {
2579
- item: true,
2580
- xs: 4,
2581
- container: true,
2582
- justifyContent: "flex-end"
2583
- }, /*#__PURE__*/React__default.createElement(Typography, {
2584
- variant: "subtitle1",
2585
- sx: styles$4.label
2586
- }, "Start position")), /*#__PURE__*/React__default.createElement(Grid, {
2587
- item: true,
2588
- xs: 8,
2353
+ drawMode = _ref.drawMode,
2354
+ geoJSONs = _ref.geoJSONs,
2355
+ setDrawModeType = _ref.setDrawModeType;
2356
+
2357
+ var _useFormContext = useFormContext(),
2358
+ errors = _useFormContext.errors,
2359
+ watch = _useFormContext.watch;
2360
+
2361
+ var _useDraftFormHelpers = useDraftFormHelpers(),
2362
+ isDraft = _useDraftFormHelpers.isDraft;
2363
+
2364
+ return !isReadOnly && /*#__PURE__*/React__default.createElement(ProductFormFieldLayout, {
2365
+ title: "Start position",
2366
+ sx: styles$2.drawSection,
2589
2367
  "data-testid": "startGeometry"
2590
2368
  }, /*#__PURE__*/React__default.createElement(DrawTools, {
2591
2369
  type: StartOrEndDrawing.start,
@@ -2595,7 +2373,7 @@ var StartGeometry = function StartGeometry(_ref) {
2595
2373
  }
2596
2374
  }), drawMode[StartOrEndDrawing.start] && /*#__PURE__*/React__default.createElement(FormHelperText, {
2597
2375
  variant: "filled",
2598
- sx: styles$4.quitDrawModeMessage
2376
+ sx: styles$2.quitDrawModeMessage
2599
2377
  }, exitDrawModeMessage), !!errors.startGeometry && /*#__PURE__*/React__default.createElement(FormHelperText, {
2600
2378
  error: true,
2601
2379
  variant: "filled"
@@ -2625,7 +2403,7 @@ var StartGeometry = function StartGeometry(_ref) {
2625
2403
  }
2626
2404
  }), /*#__PURE__*/React__default.createElement(ReactHookFormHiddenInput, {
2627
2405
  name: "startGeometryIntersect"
2628
- })));
2406
+ }));
2629
2407
  };
2630
2408
 
2631
2409
  /* *
@@ -2641,8 +2419,8 @@ var StartGeometry = function StartGeometry(_ref) {
2641
2419
  * See the License for the specific language governing permissions and
2642
2420
  * limitations under the License.
2643
2421
  *
2644
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2645
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
2422
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2423
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
2646
2424
  * */
2647
2425
  var movementStepValMessageKT = 'Speed should be rounded to the nearest 5kt';
2648
2426
  var movementStepValMessageKMH = 'Speed should be rounded to the nearest 10kmh';
@@ -2722,24 +2500,9 @@ var Progress = function Progress(_ref) {
2722
2500
  var selectedFIR = watch('locationIndicatorATSR'); // Get allowed movement units based on selected FIR - if no FIR selected, allow all units
2723
2501
 
2724
2502
  var allowedMovementUnitsForFir = getAllowedUnits(selectedFIR, allowedUnits, 'movement_unit', MovementUnit);
2725
- return /*#__PURE__*/React__default.createElement(Grid, {
2726
- item: true,
2727
- container: true,
2728
- spacing: 2,
2729
- sx: styles$4.containerItem
2730
- }, /*#__PURE__*/React__default.createElement(Grid, {
2731
- item: true,
2732
- xs: 4,
2733
- container: true,
2734
- justifyContent: "flex-end"
2735
- }, /*#__PURE__*/React__default.createElement(Typography, {
2736
- variant: "subtitle1",
2737
- sx: styles$4.label
2738
- }, "Progress")), /*#__PURE__*/React__default.createElement(Grid, {
2739
- item: true,
2740
- xs: 8,
2741
- container: true,
2742
- justifyContent: "flex-start"
2503
+ return /*#__PURE__*/React__default.createElement(ProductFormFieldLayout, {
2504
+ title: "Progress",
2505
+ sx: styles$2.containerItem
2743
2506
  }, /*#__PURE__*/React__default.createElement(Grid, {
2744
2507
  item: true,
2745
2508
  xs: 12
@@ -2753,18 +2516,19 @@ var Progress = function Progress(_ref) {
2753
2516
  },
2754
2517
  onChange: function onChange() {
2755
2518
  return setDrawModeType ? setDrawModeType(MapDrawMode.DELETE, StartOrEndDrawing.end) : null;
2756
- }
2757
- }, watch('phenomenon') === 'VA_CLD' && (!isReadOnly || movementType === 'NO_VA_EXP') && /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
2519
+ },
2520
+ isReadOnly: isReadOnly
2521
+ }, watch('phenomenon') === 'VA_CLD' && /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
2758
2522
  value: "NO_VA_EXP",
2759
2523
  label: "No volcanic ash expected",
2760
2524
  disabled: isDisabled,
2761
2525
  "data-testid": "movementType-NO_VA_EXP"
2762
- }), (!isReadOnly || movementType === 'STATIONARY') && /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
2526
+ }), /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
2763
2527
  value: "STATIONARY",
2764
2528
  label: "Stationary",
2765
2529
  disabled: isDisabled,
2766
2530
  "data-testid": "movementType-STATIONARY"
2767
- }), (!isReadOnly || movementType === 'MOVEMENT') && /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
2531
+ }), /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
2768
2532
  value: "MOVEMENT",
2769
2533
  label: "Movement",
2770
2534
  disabled: isDisabled,
@@ -2778,8 +2542,9 @@ var Progress = function Progress(_ref) {
2778
2542
  rules: {
2779
2543
  validate: isRequired
2780
2544
  },
2781
- sx: styles$4.movement,
2545
+ sx: styles$2.movement,
2782
2546
  disabled: isDisabled,
2547
+ isReadOnly: isReadOnly,
2783
2548
  "data-testid": "movement-movementDirection",
2784
2549
  onChange: function onChange(event) {
2785
2550
  event.stopPropagation();
@@ -2805,8 +2570,9 @@ var Progress = function Progress(_ref) {
2805
2570
  rules: {
2806
2571
  validate: isRequired
2807
2572
  },
2808
- sx: styles$4.unit,
2573
+ sx: styles$2.unit,
2809
2574
  disabled: isDisabled,
2575
+ isReadOnly: isReadOnly,
2810
2576
  defaultValue: 'KT',
2811
2577
  "data-testid": "movement-movementUnit",
2812
2578
  onChange: function onChange(event) {
@@ -2851,11 +2617,12 @@ var Progress = function Progress(_ref) {
2851
2617
  }
2852
2618
  },
2853
2619
  disabled: isDisabled,
2620
+ isReadOnly: isReadOnly,
2854
2621
  "data-testid": "movement-movementSpeed",
2855
2622
  onChange: function onChange(event) {
2856
2623
  return event && event.stopPropagation();
2857
2624
  }
2858
- })))), productType === 'sigmet' && (!isReadOnly || movementType === 'FORECAST_POSITION') && /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
2625
+ })))), productType === 'sigmet' && /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
2859
2626
  value: "FORECAST_POSITION",
2860
2627
  label: "End position",
2861
2628
  disabled: isDisabled,
@@ -2864,7 +2631,7 @@ var Progress = function Progress(_ref) {
2864
2631
  item: true,
2865
2632
  xs: 12,
2866
2633
  "data-testid": "endGeometry",
2867
- sx: styles$4.drawSection
2634
+ sx: styles$2.drawSection
2868
2635
  }, !isReadOnly && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(DrawTools, {
2869
2636
  "data-testid": "endGeometry-drawTools",
2870
2637
  type: StartOrEndDrawing.end,
@@ -2874,7 +2641,7 @@ var Progress = function Progress(_ref) {
2874
2641
  }
2875
2642
  }), drawMode[StartOrEndDrawing.end] && /*#__PURE__*/React__default.createElement(FormHelperText, {
2876
2643
  variant: "filled",
2877
- sx: styles$4.quitDrawModeMessage
2644
+ sx: styles$2.quitDrawModeMessage
2878
2645
  }, exitDrawModeMessage), !!errors.endGeometry && /*#__PURE__*/React__default.createElement(FormHelperText, {
2879
2646
  error: true,
2880
2647
  variant: "filled"
@@ -2904,7 +2671,7 @@ var Progress = function Progress(_ref) {
2904
2671
  }
2905
2672
  }), /*#__PURE__*/React__default.createElement(ReactHookFormHiddenInput, {
2906
2673
  name: "endGeometryIntersect"
2907
- })))));
2674
+ }))));
2908
2675
  };
2909
2676
 
2910
2677
  /* *
@@ -2920,13 +2687,14 @@ var Progress = function Progress(_ref) {
2920
2687
  * See the License for the specific language governing permissions and
2921
2688
  * limitations under the License.
2922
2689
  *
2923
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2924
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
2690
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2691
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
2925
2692
  * */
2926
2693
 
2927
2694
  var SelectFIR = function SelectFIR(_ref) {
2928
2695
  var productType = _ref.productType,
2929
- isDisabled = _ref.isDisabled;
2696
+ isDisabled = _ref.isDisabled,
2697
+ isReadOnly = _ref.isReadOnly;
2930
2698
 
2931
2699
  var _useFormContext = useFormContext(),
2932
2700
  setValue = _useFormContext.setValue;
@@ -2941,33 +2709,19 @@ var SelectFIR = function SelectFIR(_ref) {
2941
2709
  optionsFIR = _useProductSettings.optionsFIR,
2942
2710
  allFIRS = _useProductSettings.allFIRS;
2943
2711
 
2944
- return /*#__PURE__*/React__default.createElement(Grid, {
2945
- item: true,
2946
- container: true,
2947
- spacing: 2,
2948
- sx: styles$4.containerItem
2949
- }, /*#__PURE__*/React__default.createElement(Grid, {
2950
- item: true,
2951
- xs: 4,
2952
- container: true,
2953
- justifyContent: "flex-end"
2954
- }, /*#__PURE__*/React__default.createElement(Typography, {
2955
- variant: "subtitle1",
2956
- sx: styles$4.label
2957
- }, "Where")), /*#__PURE__*/React__default.createElement(Grid, {
2958
- item: true,
2959
- xs: 8,
2960
- container: true,
2961
- justifyContent: "flex-start"
2712
+ return /*#__PURE__*/React__default.createElement(ProductFormFieldLayout, {
2713
+ title: "Where",
2714
+ sx: styles$2.containerItem
2962
2715
  }, /*#__PURE__*/React__default.createElement(ReactHookFormSelect, {
2963
2716
  name: "locationIndicatorATSR",
2964
- label: "Select FIR",
2717
+ label: isReadOnly ? 'FIR' : 'Select FIR',
2965
2718
  rules: {
2966
2719
  validate: {
2967
2720
  isRequired: isRequired
2968
2721
  }
2969
2722
  },
2970
2723
  disabled: isDisabled,
2724
+ isReadOnly: isReadOnly,
2971
2725
  defaultValue: defaultATSR,
2972
2726
  onChange: function onChange(changeEvent) {
2973
2727
  setValue('locationIndicatorATSU', allFIRS[changeEvent.target.value].location_indicator_atsu);
@@ -2990,7 +2744,7 @@ var SelectFIR = function SelectFIR(_ref) {
2990
2744
  }), /*#__PURE__*/React__default.createElement(ReactHookFormHiddenInput, {
2991
2745
  name: "firGeometry",
2992
2746
  defaultValue: getFir()
2993
- })));
2747
+ }));
2994
2748
  };
2995
2749
 
2996
2750
  /* *
@@ -3006,38 +2760,20 @@ var SelectFIR = function SelectFIR(_ref) {
3006
2760
  * See the License for the specific language governing permissions and
3007
2761
  * limitations under the License.
3008
2762
  *
3009
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
3010
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
2763
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2764
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
3011
2765
  * */
3012
2766
 
3013
2767
  var Type = function Type(_ref) {
3014
2768
  var isReadOnly = _ref.isReadOnly,
3015
2769
  isDisabled = _ref.isDisabled;
3016
2770
 
3017
- var _useFormContext = useFormContext(),
3018
- watch = _useFormContext.watch;
3019
-
3020
2771
  var _useDraftFormHelpers = useDraftFormHelpers(),
3021
2772
  isRequired = _useDraftFormHelpers.isRequired;
3022
2773
 
3023
- return /*#__PURE__*/React__default.createElement(Grid, {
3024
- item: true,
3025
- container: true,
3026
- spacing: 2,
3027
- sx: styles$4.containerItem
3028
- }, /*#__PURE__*/React__default.createElement(Grid, {
3029
- item: true,
3030
- xs: 4,
3031
- container: true,
3032
- justifyContent: "flex-end"
3033
- }, /*#__PURE__*/React__default.createElement(Typography, {
3034
- variant: "subtitle1",
3035
- sx: styles$4.label
3036
- }, "Type")), /*#__PURE__*/React__default.createElement(Grid, {
3037
- item: true,
3038
- xs: 8,
3039
- container: true,
3040
- justifyContent: "flex-start"
2774
+ return /*#__PURE__*/React__default.createElement(ProductFormFieldLayout, {
2775
+ title: "Type",
2776
+ sx: styles$2.containerItem
3041
2777
  }, /*#__PURE__*/React__default.createElement(Grid, {
3042
2778
  item: true,
3043
2779
  xs: 12
@@ -3049,23 +2785,24 @@ var Type = function Type(_ref) {
3049
2785
  }
3050
2786
  },
3051
2787
  disabled: isDisabled,
2788
+ isReadOnly: isReadOnly,
3052
2789
  defaultValue: "NORMAL"
3053
- }, (!isReadOnly || watch('type') === 'NORMAL') && /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
2790
+ }, /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
3054
2791
  value: "NORMAL",
3055
2792
  label: "Normal",
3056
2793
  disabled: isDisabled,
3057
2794
  "data-testid": "type-NORMAL"
3058
- }), (!isReadOnly || watch('type') === 'TEST') && /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
2795
+ }), /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
3059
2796
  value: "TEST",
3060
2797
  label: "Test",
3061
2798
  disabled: isDisabled,
3062
2799
  "data-testid": "type-TEST"
3063
- }), (!isReadOnly || watch('type') === 'EXERCISE') && /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
2800
+ }), /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
3064
2801
  value: "EXERCISE",
3065
2802
  label: "Exercise",
3066
2803
  disabled: isDisabled,
3067
2804
  "data-testid": "type-EXERCISE"
3068
- })))));
2805
+ }))));
3069
2806
  };
3070
2807
 
3071
2808
  /* *
@@ -3081,14 +2818,19 @@ var Type = function Type(_ref) {
3081
2818
  * See the License for the specific language governing permissions and
3082
2819
  * limitations under the License.
3083
2820
  *
3084
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
3085
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
2821
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2822
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
3086
2823
  * */
3087
2824
  var VALID_FROM_TIME_DELAY_IN_MINUTES = 30;
2825
+ var VALID_FROM_ERROR_BEFORE_CURRENT = 'Valid from time cannot be before current time';
2826
+ var getValidFromXHoursBeforeMessage = function getValidFromXHoursBeforeMessage(hours) {
2827
+ return "Valid from time can be no more than ".concat(hours, " hours after current time");
2828
+ };
3088
2829
 
3089
2830
  var ValidFrom = function ValidFrom(_ref) {
3090
2831
  var productType = _ref.productType,
3091
2832
  isDisabled = _ref.isDisabled,
2833
+ isReadOnly = _ref.isReadOnly,
3092
2834
  _ref$onChange = _ref.onChange,
3093
2835
  _onChange = _ref$onChange === void 0 ? function () {
3094
2836
  return null;
@@ -3102,26 +2844,13 @@ var ValidFrom = function ValidFrom(_ref) {
3102
2844
  isRequired = _useDraftFormHelpers.isRequired;
3103
2845
 
3104
2846
  var config = productType === 'sigmet' ? sigmetConfig : airmetConfig;
3105
- return /*#__PURE__*/React__default.createElement(Grid, {
3106
- item: true,
3107
- container: true,
3108
- spacing: 2
3109
- }, /*#__PURE__*/React__default.createElement(Grid, {
3110
- item: true,
3111
- xs: 4,
3112
- container: true,
3113
- justifyContent: "flex-end"
3114
- }, /*#__PURE__*/React__default.createElement(Typography, {
3115
- variant: "subtitle1",
3116
- sx: styles$4.label
3117
- }, "Valid from")), /*#__PURE__*/React__default.createElement(Grid, {
3118
- item: true,
3119
- xs: 8,
3120
- container: true,
3121
- justifyContent: "flex-start"
2847
+ var label = getFieldLabel('Date and time', isReadOnly);
2848
+ return /*#__PURE__*/React__default.createElement(ProductFormFieldLayout, {
2849
+ title: "Valid from"
3122
2850
  }, /*#__PURE__*/React__default.createElement(ReactHookFormDateTime, {
3123
2851
  disablePast: true,
3124
2852
  name: "validDateStart",
2853
+ label: label,
3125
2854
  defaultNullValue: moment.utc().add(VALID_FROM_TIME_DELAY_IN_MINUTES, 'minutes').format('YYYY-MM-DDTHH:mm:ss[Z]'),
3126
2855
  rules: {
3127
2856
  validate: {
@@ -3129,11 +2858,11 @@ var ValidFrom = function ValidFrom(_ref) {
3129
2858
  isValidDate: isValidDate,
3130
2859
  // The validity start can not be before the current time
3131
2860
  isValueBeforeCurrentTime: function isValueBeforeCurrentTime(value) {
3132
- return isXHoursBefore(value, moment.utc().format(), 0) || 'Valid from time cannot be before current time';
2861
+ return isXHoursBefore(value, moment.utc().format(), 0) || VALID_FROM_ERROR_BEFORE_CURRENT;
3133
2862
  },
3134
2863
  // The current time can be no more than 4 hours before the validity start (12 for VA/TC SIGMET)
3135
2864
  isCurrentTimeXHoursBeforeValue: function isCurrentTimeXHoursBeforeValue(value) {
3136
- return isXHoursBefore(moment.utc().format(), value, getHoursBeforeValidity(getValues('phenomenon'), getValues('locationIndicatorATSR'), config)) || "Valid from time can be no more than ".concat(getHoursBeforeValidity(getValues('phenomenon'), getValues('locationIndicatorATSR'), config), " hours after current time");
2865
+ return isXHoursBefore(moment.utc().format(), value, getHoursBeforeValidity(getValues('phenomenon'), getValues('locationIndicatorATSR'), config)) || getValidFromXHoursBeforeMessage(getHoursBeforeValidity(getValues('phenomenon'), getValues('locationIndicatorATSR'), config));
3137
2866
  }
3138
2867
  }
3139
2868
  },
@@ -3149,10 +2878,8 @@ var ValidFrom = function ValidFrom(_ref) {
3149
2878
  _onChange();
3150
2879
  },
3151
2880
  disabled: isDisabled,
2881
+ isReadOnly: isReadOnly,
3152
2882
  "data-testid": "valid-from"
3153
- })), /*#__PURE__*/React__default.createElement(Grid, {
3154
- item: true,
3155
- xs: 6
3156
2883
  }));
3157
2884
  };
3158
2885
 
@@ -3169,8 +2896,8 @@ var ValidFrom = function ValidFrom(_ref) {
3169
2896
  * See the License for the specific language governing permissions and
3170
2897
  * limitations under the License.
3171
2898
  *
3172
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
3173
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
2899
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2900
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
3174
2901
  * */
3175
2902
  var DEFAULT_VALID_TIME_SIGMET = 3;
3176
2903
  var DEFAULT_VALID_TIME_AIRMET = 1;
@@ -3181,6 +2908,7 @@ var getDefaultHoursValid = function getDefaultHoursValid(productType) {
3181
2908
  var ValidUntil = function ValidUntil(_ref) {
3182
2909
  var productType = _ref.productType,
3183
2910
  isDisabled = _ref.isDisabled,
2911
+ isReadOnly = _ref.isReadOnly,
3184
2912
  _ref$onChange = _ref.onChange,
3185
2913
  _onChange = _ref$onChange === void 0 ? function () {
3186
2914
  return null;
@@ -3193,28 +2921,15 @@ var ValidUntil = function ValidUntil(_ref) {
3193
2921
  var _useDraftFormHelpers = useDraftFormHelpers(),
3194
2922
  isRequired = _useDraftFormHelpers.isRequired;
3195
2923
 
2924
+ var label = getFieldLabel('Date and time', isReadOnly);
3196
2925
  var config = productType === 'sigmet' ? sigmetConfig : airmetConfig;
3197
2926
  var defaultHoursValid = getDefaultHoursValid(productType);
3198
- return /*#__PURE__*/React__default.createElement(Grid, {
3199
- item: true,
3200
- container: true,
3201
- spacing: 2
3202
- }, /*#__PURE__*/React__default.createElement(Grid, {
3203
- item: true,
3204
- xs: 4,
3205
- container: true,
3206
- justifyContent: "flex-end"
3207
- }, /*#__PURE__*/React__default.createElement(Typography, {
3208
- variant: "subtitle1",
3209
- sx: styles$4.label
3210
- }, "Valid until")), /*#__PURE__*/React__default.createElement(Grid, {
3211
- item: true,
3212
- xs: 8,
3213
- container: true,
3214
- justifyContent: "flex-start"
2927
+ return /*#__PURE__*/React__default.createElement(ProductFormFieldLayout, {
2928
+ title: "Valid until"
3215
2929
  }, /*#__PURE__*/React__default.createElement(ReactHookFormDateTime, {
3216
2930
  disablePast: true,
3217
2931
  name: "validDateEnd",
2932
+ label: label,
3218
2933
  defaultNullValue: moment.utc().add(defaultHoursValid, 'hour').add(VALID_FROM_TIME_DELAY_IN_MINUTES, 'minutes').format('YYYY-MM-DDTHH:mm:ss[Z]'),
3219
2934
  rules: {
3220
2935
  validate: {
@@ -3231,6 +2946,7 @@ var ValidUntil = function ValidUntil(_ref) {
3231
2946
  }
3232
2947
  },
3233
2948
  disabled: isDisabled,
2949
+ isReadOnly: isReadOnly,
3234
2950
  onChange: function onChange() {
3235
2951
  if (getValues('validDateStart')) {
3236
2952
  trigger('validDateStart');
@@ -3242,9 +2958,6 @@ var ValidUntil = function ValidUntil(_ref) {
3242
2958
 
3243
2959
  _onChange();
3244
2960
  }
3245
- })), /*#__PURE__*/React__default.createElement(Grid, {
3246
- item: true,
3247
- xs: 6
3248
2961
  }));
3249
2962
  };
3250
2963
 
@@ -3292,7 +3005,7 @@ var VolcanicFields = function VolcanicFields(_ref) {
3292
3005
  }, (!isReadOnly || !!watch('vaSigmetVolcanoName')) && /*#__PURE__*/React__default.createElement(Grid, {
3293
3006
  item: true,
3294
3007
  xs: 12,
3295
- sx: styles$4.volcanicField
3008
+ sx: styles$2.volcanicField
3296
3009
  }, /*#__PURE__*/React__default.createElement(ReactHookFormTextField, {
3297
3010
  name: "vaSigmetVolcanoName",
3298
3011
  label: "Volcano name",
@@ -3301,7 +3014,8 @@ var VolcanicFields = function VolcanicFields(_ref) {
3301
3014
  },
3302
3015
  disabled: isDisabled,
3303
3016
  helperText: helperText,
3304
- upperCase: true
3017
+ upperCase: true,
3018
+ isReadOnly: isReadOnly
3305
3019
  })), (!isReadOnly || !!watch('vaSigmetVolcanoCoordinates.latitude')) && /*#__PURE__*/React__default.createElement(Grid, {
3306
3020
  item: true,
3307
3021
  xs: 6
@@ -3320,12 +3034,13 @@ var VolcanicFields = function VolcanicFields(_ref) {
3320
3034
  }
3321
3035
  }
3322
3036
  },
3323
- sx: styles$4.latitude,
3037
+ sx: Object.assign(Object.assign({}, styles$2.latitude), styles$2.helperText),
3324
3038
  disabled: isDisabled,
3325
3039
  helperText: helperText,
3326
3040
  onChange: function onChange() {
3327
3041
  return trigger('vaSigmetVolcanoCoordinates.longitude');
3328
- }
3042
+ },
3043
+ isReadOnly: isReadOnly
3329
3044
  })), (!isReadOnly || !!watch('vaSigmetVolcanoCoordinates.longitude')) && /*#__PURE__*/React__default.createElement(Grid, {
3330
3045
  item: true,
3331
3046
  xs: 6
@@ -3348,7 +3063,9 @@ var VolcanicFields = function VolcanicFields(_ref) {
3348
3063
  helperText: helperText,
3349
3064
  onChange: function onChange() {
3350
3065
  return trigger('vaSigmetVolcanoCoordinates.latitude');
3351
- }
3066
+ },
3067
+ sx: styles$2.helperText,
3068
+ isReadOnly: isReadOnly
3352
3069
  }))));
3353
3070
  };
3354
3071
 
@@ -3384,6 +3101,7 @@ var validateSurfaceVisibility = function validateSurfaceVisibility(value) {
3384
3101
 
3385
3102
  var SurfaceVisibility = function SurfaceVisibility(_ref) {
3386
3103
  var isDisabled = _ref.isDisabled,
3104
+ isReadOnly = _ref.isReadOnly,
3387
3105
  _ref$onChange = _ref.onChange,
3388
3106
  _onChange = _ref$onChange === void 0 ? function () {
3389
3107
  return null;
@@ -3392,6 +3110,8 @@ var SurfaceVisibility = function SurfaceVisibility(_ref) {
3392
3110
  var _useDraftFormHelpers = useDraftFormHelpers(),
3393
3111
  isRequired = _useDraftFormHelpers.isRequired;
3394
3112
 
3113
+ var visibilityLabel = getFieldLabel('Visibility', isReadOnly);
3114
+ var visibilityCauseLabel = getFieldLabel('Cause', isReadOnly);
3395
3115
  return /*#__PURE__*/React__default.createElement(Grid, {
3396
3116
  item: true,
3397
3117
  container: true,
@@ -3409,11 +3129,11 @@ var SurfaceVisibility = function SurfaceVisibility(_ref) {
3409
3129
  }, /*#__PURE__*/React__default.createElement(Grid, {
3410
3130
  item: true,
3411
3131
  xs: 12,
3412
- sx: styles$4.surfaceVisibility
3132
+ sx: styles$2.surfaceVisibility
3413
3133
  }, /*#__PURE__*/React__default.createElement(ReactHookFormNumberField, {
3414
3134
  name: "visibilityValue",
3415
3135
  "data-testid": "surfaceVisibility-visibilityValue",
3416
- label: "Select visibility",
3136
+ label: visibilityLabel,
3417
3137
  helperText: "Value in meters",
3418
3138
  rules: {
3419
3139
  min: {
@@ -3429,19 +3149,21 @@ var SurfaceVisibility = function SurfaceVisibility(_ref) {
3429
3149
  validateSurfaceVisibility: validateSurfaceVisibility
3430
3150
  }
3431
3151
  },
3432
- disabled: isDisabled
3152
+ disabled: isDisabled,
3153
+ isReadOnly: isReadOnly
3433
3154
  })), /*#__PURE__*/React__default.createElement(Grid, {
3434
3155
  item: true,
3435
3156
  xs: 12
3436
3157
  }, /*#__PURE__*/React__default.createElement(ReactHookFormSelect, {
3437
3158
  name: "visibilityCause",
3438
- label: "Select cause",
3159
+ label: visibilityCauseLabel,
3439
3160
  rules: {
3440
3161
  validate: {
3441
3162
  isRequired: isRequired
3442
3163
  }
3443
3164
  },
3444
3165
  disabled: isDisabled,
3166
+ isReadOnly: isReadOnly,
3445
3167
  "data-testid": "surfaceVisibility-visibilityCause",
3446
3168
  onChange: function onChange(event) {
3447
3169
  event.stopPropagation();
@@ -3482,6 +3204,7 @@ var validateSurfaceWindDirection = function validateSurfaceWindDirection(value)
3482
3204
 
3483
3205
  var SurfaceWind = function SurfaceWind(_ref) {
3484
3206
  var isDisabled = _ref.isDisabled,
3207
+ isReadOnly = _ref.isReadOnly,
3485
3208
  _ref$onChange = _ref.onChange,
3486
3209
  _onChange = _ref$onChange === void 0 ? function () {
3487
3210
  return null;
@@ -3501,6 +3224,8 @@ var SurfaceWind = function SurfaceWind(_ref) {
3501
3224
  var selectedFIR = watch('locationIndicatorATSR'); // Get allowed speed units based on selected FIR - if no FIR selected, allow all units
3502
3225
 
3503
3226
  var allowedWindUnitsForFir = getAllowedUnits(selectedFIR, allowedUnits, 'surfacewind_unit', WindUnit);
3227
+ var windLabel = getFieldLabel('Wind direction', isReadOnly, 'Set');
3228
+ var speedLabel = getFieldLabel('Speed', isReadOnly, 'Set');
3504
3229
  return /*#__PURE__*/React__default.createElement(Grid, {
3505
3230
  item: true,
3506
3231
  container: true,
@@ -3518,10 +3243,10 @@ var SurfaceWind = function SurfaceWind(_ref) {
3518
3243
  }, /*#__PURE__*/React__default.createElement(Grid, {
3519
3244
  item: true,
3520
3245
  xs: 12,
3521
- sx: styles$4.surfaceWind
3246
+ sx: styles$2.surfaceWind
3522
3247
  }, /*#__PURE__*/React__default.createElement(ReactHookFormNumberField, {
3523
3248
  name: "windDirection",
3524
- label: "Set wind direction",
3249
+ label: windLabel,
3525
3250
  helperText: "Value in degrees",
3526
3251
  rules: {
3527
3252
  min: {
@@ -3538,6 +3263,7 @@ var SurfaceWind = function SurfaceWind(_ref) {
3538
3263
  }
3539
3264
  },
3540
3265
  disabled: isDisabled,
3266
+ isReadOnly: isReadOnly,
3541
3267
  "data-testid": "surfaceWind-windDirection"
3542
3268
  })), /*#__PURE__*/React__default.createElement(Grid, {
3543
3269
  item: true,
@@ -3554,8 +3280,9 @@ var SurfaceWind = function SurfaceWind(_ref) {
3554
3280
  isRequired: isRequired
3555
3281
  }
3556
3282
  },
3557
- sx: styles$4.unit,
3283
+ sx: styles$2.unit,
3558
3284
  disabled: isDisabled,
3285
+ isReadOnly: isReadOnly,
3559
3286
  defaultValue: 'KT',
3560
3287
  "data-testid": "surfaceWind-windUnit",
3561
3288
  onChange: function onChange() {
@@ -3575,7 +3302,7 @@ var SurfaceWind = function SurfaceWind(_ref) {
3575
3302
  xs: 7
3576
3303
  }, /*#__PURE__*/React__default.createElement(ReactHookFormNumberField, {
3577
3304
  name: "windSpeed",
3578
- label: "Set speed",
3305
+ label: speedLabel,
3579
3306
  rules: {
3580
3307
  validate: {
3581
3308
  isRequired: isRequired,
@@ -3593,6 +3320,7 @@ var SurfaceWind = function SurfaceWind(_ref) {
3593
3320
  }
3594
3321
  },
3595
3322
  disabled: isDisabled,
3323
+ isReadOnly: isReadOnly,
3596
3324
  "data-testid": "surfaceWind-windSpeed"
3597
3325
  })))));
3598
3326
  };
@@ -3662,7 +3390,7 @@ var CloudLevels = function CloudLevels(_ref) {
3662
3390
  item: true,
3663
3391
  container: true,
3664
3392
  spacing: 2,
3665
- sx: styles$4.containerItem
3393
+ sx: styles$2.containerItem
3666
3394
  }, /*#__PURE__*/React__default.createElement(Grid, {
3667
3395
  item: true,
3668
3396
  xs: 4,
@@ -3670,7 +3398,7 @@ var CloudLevels = function CloudLevels(_ref) {
3670
3398
  justifyContent: "flex-end"
3671
3399
  }, /*#__PURE__*/React__default.createElement(Typography, {
3672
3400
  variant: "subtitle1",
3673
- sx: styles$4.label
3401
+ sx: styles$2.label
3674
3402
  }, "Levels")), /*#__PURE__*/React__default.createElement(Grid, {
3675
3403
  item: true,
3676
3404
  xs: 8,
@@ -3689,7 +3417,10 @@ var CloudLevels = function CloudLevels(_ref) {
3689
3417
  }, /*#__PURE__*/React__default.createElement(Grid, {
3690
3418
  item: true,
3691
3419
  xs: 4
3692
- }, (!isReadOnly || watch('cloudLevelInfoMode') === 'BETW_ABV' || watch('cloudLevelInfoMode') === 'BETW_SFC_ABV') && /*#__PURE__*/React__default.createElement(FormControlLabel, {
3420
+ }, (!isReadOnly || watch('cloudLevelInfoMode') === 'BETW_ABV' || watch('cloudLevelInfoMode') === 'BETW_SFC_ABV') && /*#__PURE__*/React__default.createElement(ReactHookFormFormControl, {
3421
+ disabled: isDisabled,
3422
+ isReadOnly: isReadOnly
3423
+ }, /*#__PURE__*/React__default.createElement(FormControlLabel, {
3693
3424
  control: /*#__PURE__*/React__default.createElement(Checkbox, {
3694
3425
  checked: watch('cloudLevelInfoMode') === 'BETW_ABV' || watch('cloudLevelInfoMode') === 'BETW_SFC_ABV',
3695
3426
  onChange: function onChange() {
@@ -3725,7 +3456,7 @@ var CloudLevels = function CloudLevels(_ref) {
3725
3456
  }),
3726
3457
  "data-testid": "cloudLevels-Above",
3727
3458
  label: "Above"
3728
- })), /*#__PURE__*/React__default.createElement(Grid, {
3459
+ }))), /*#__PURE__*/React__default.createElement(Grid, {
3729
3460
  item: true,
3730
3461
  xs: 3
3731
3462
  }, /*#__PURE__*/React__default.createElement(ReactHookFormSelect, {
@@ -3737,8 +3468,9 @@ var CloudLevels = function CloudLevels(_ref) {
3737
3468
  isRequired: isRequired
3738
3469
  }
3739
3470
  },
3740
- sx: styles$4.unit,
3471
+ sx: styles$2.unit,
3741
3472
  disabled: isDisabled,
3473
+ isReadOnly: isReadOnly,
3742
3474
  defaultValue: 'FT',
3743
3475
  onChange: function onChange() {
3744
3476
  if (getValues('cloudLevel.value') || getValues('cloudLevel.value') === 0) {
@@ -3766,7 +3498,7 @@ var CloudLevels = function CloudLevels(_ref) {
3766
3498
  name: "cloudLevel.value",
3767
3499
  label: "Upper level",
3768
3500
  "data-testid": "cloudLevel-value",
3769
- sx: styles$4.levelField,
3501
+ sx: styles$2.levelField,
3770
3502
  rules: {
3771
3503
  validate: {
3772
3504
  isRequired: isRequired,
@@ -3787,6 +3519,7 @@ var CloudLevels = function CloudLevels(_ref) {
3787
3519
  }
3788
3520
  },
3789
3521
  disabled: isDisabled,
3522
+ isReadOnly: isReadOnly,
3790
3523
  onChange: function onChange() {
3791
3524
  return (getValues('cloudLowerLevel.value') || getValues('cloudLowerLevel.value') === 0) && trigger('cloudLowerLevel.value');
3792
3525
  }
@@ -3797,7 +3530,10 @@ var CloudLevels = function CloudLevels(_ref) {
3797
3530
  }, /*#__PURE__*/React__default.createElement(Grid, {
3798
3531
  item: true,
3799
3532
  xs: 4
3800
- }, (!isReadOnly || watch('cloudLevelInfoMode') === 'BETW_SFC' || watch('cloudLevelInfoMode') === 'BETW_SFC_ABV') && /*#__PURE__*/React__default.createElement(FormControlLabel, {
3533
+ }, (!isReadOnly || watch('cloudLevelInfoMode') === 'BETW_SFC' || watch('cloudLevelInfoMode') === 'BETW_SFC_ABV') && /*#__PURE__*/React__default.createElement(ReactHookFormFormControl, {
3534
+ disabled: isDisabled,
3535
+ isReadOnly: isReadOnly
3536
+ }, /*#__PURE__*/React__default.createElement(FormControlLabel, {
3801
3537
  control: /*#__PURE__*/React__default.createElement(Checkbox, {
3802
3538
  checked: watch('cloudLevelInfoMode') === 'BETW_SFC' || watch('cloudLevelInfoMode') === 'BETW_SFC_ABV',
3803
3539
  onChange: function onChange() {
@@ -3833,7 +3569,7 @@ var CloudLevels = function CloudLevels(_ref) {
3833
3569
  }),
3834
3570
  "data-testid": "cloudLevels-SFC",
3835
3571
  label: "SFC"
3836
- })), watch('cloudLevelInfoMode') !== 'BETW_SFC' && watch('cloudLevelInfoMode') !== 'BETW_SFC_ABV' && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Grid, {
3572
+ }))), watch('cloudLevelInfoMode') !== 'BETW_SFC' && watch('cloudLevelInfoMode') !== 'BETW_SFC_ABV' && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Grid, {
3837
3573
  item: true,
3838
3574
  xs: 3
3839
3575
  }, /*#__PURE__*/React__default.createElement(ReactHookFormSelect, {
@@ -3845,8 +3581,9 @@ var CloudLevels = function CloudLevels(_ref) {
3845
3581
  isRequired: isRequired
3846
3582
  }
3847
3583
  },
3848
- sx: styles$4.unit,
3584
+ sx: styles$2.unit,
3849
3585
  disabled: isDisabled,
3586
+ isReadOnly: isReadOnly,
3850
3587
  defaultValue: getValues('cloudLevel.unit') ? getValues('cloudLevel.unit') : 'FT',
3851
3588
  onChange: function onChange() {
3852
3589
  if (getValues('cloudLowerLevel.value') || getValues('cloudLowerLevel.value') === 0) {
@@ -3898,26 +3635,11 @@ var CloudLevels = function CloudLevels(_ref) {
3898
3635
  }
3899
3636
  }
3900
3637
  },
3901
- disabled: isDisabled
3638
+ disabled: isDisabled,
3639
+ isReadOnly: isReadOnly
3902
3640
  })))))));
3903
3641
  };
3904
3642
 
3905
- var styles$2 = {
3906
- tacOutput: {
3907
- paddingTop: '16px',
3908
- whiteSpace: 'break-spaces'
3909
- },
3910
- tacLine: {
3911
- backgroundColor: '#FFF',
3912
- margin: '0',
3913
- padding: '.1em .1em .1em 0.8em',
3914
- textIndent: '-0.7em',
3915
- borderRadius: '3px',
3916
- '&:hover': {
3917
- backgroundColor: '#F4F4F4'
3918
- }
3919
- }
3920
- };
3921
3643
  var noTAC = 'Missing data: no TAC can be generated'; // Ensure we have enough data to retrieve a TAC
3922
3644
 
3923
3645
  var shouldRetrieveTAC = function shouldRetrieveTAC(product) {
@@ -3930,91 +3652,454 @@ var shouldRetrieveTAC = function shouldRetrieveTAC(product) {
3930
3652
  return true;
3931
3653
  }
3932
3654
 
3933
- return false;
3655
+ return false;
3656
+ };
3657
+ var useTAC = function useTAC(initialProduct, getTAC) {
3658
+ var _React$useState = React__default.useState(noTAC),
3659
+ _React$useState2 = _slicedToArray(_React$useState, 2),
3660
+ TAC = _React$useState2[0],
3661
+ setTAC = _React$useState2[1];
3662
+
3663
+ var _useIsMounted = useIsMounted(),
3664
+ isMounted = _useIsMounted.isMounted;
3665
+
3666
+ var retrieveTAC = function retrieveTAC(product) {
3667
+ return __awaiter(void 0, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
3668
+ var result;
3669
+ return regeneratorRuntime.wrap(function _callee$(_context) {
3670
+ while (1) {
3671
+ switch (_context.prev = _context.next) {
3672
+ case 0:
3673
+ _context.prev = 0;
3674
+ _context.next = 3;
3675
+ return getTAC(product);
3676
+
3677
+ case 3:
3678
+ result = _context.sent;
3679
+
3680
+ if (isMounted.current) {
3681
+ setTAC(result.data);
3682
+ }
3683
+
3684
+ _context.next = 10;
3685
+ break;
3686
+
3687
+ case 7:
3688
+ _context.prev = 7;
3689
+ _context.t0 = _context["catch"](0);
3690
+
3691
+ if (isMounted.current) {
3692
+ setTAC(noTAC);
3693
+ }
3694
+
3695
+ case 10:
3696
+ case "end":
3697
+ return _context.stop();
3698
+ }
3699
+ }
3700
+ }, _callee, null, [[0, 7]]);
3701
+ }));
3702
+ };
3703
+
3704
+ React__default.useEffect(function () {
3705
+ if (shouldRetrieveTAC(initialProduct)) {
3706
+ retrieveTAC(initialProduct);
3707
+ } // eslint-disable-next-line react-hooks/exhaustive-deps
3708
+
3709
+ }, []);
3710
+
3711
+ var update = function update(formValues) {
3712
+ if (shouldRetrieveTAC(formValues)) {
3713
+ retrieveTAC(formValues);
3714
+ } else if (isMounted.current) {
3715
+ setTAC(noTAC);
3716
+ }
3717
+ }; // eslint-disable-next-line react-hooks/exhaustive-deps
3718
+
3719
+
3720
+ var delayedQuery = React__default.useCallback(debounce(update, 1000), []);
3721
+ return [TAC, delayedQuery];
3722
+ };
3723
+
3724
+ var ProductFormTAC = function ProductFormTAC(_ref) {
3725
+ var tac = _ref.tac;
3726
+ var tacLines = tac.split('\n');
3727
+ var hasTac = tacLines.length && tacLines.toString() !== noTAC;
3728
+ return /*#__PURE__*/React__default.createElement(Typography, {
3729
+ variant: "body2",
3730
+ component: "div",
3731
+ sx: {
3732
+ paddingTop: '16px',
3733
+ whiteSpace: 'break-spaces'
3734
+ },
3735
+ "data-testid": "productform-tac-message"
3736
+ }, tacLines.map(function (line) {
3737
+ return /*#__PURE__*/React__default.createElement(Box, {
3738
+ component: "p",
3739
+ key: line,
3740
+ sx: {
3741
+ margin: 0,
3742
+ fontSize: hasTac ? '1.125rem' : '1rem',
3743
+ fontWeight: 'normal',
3744
+ fontStretch: 'normal',
3745
+ fontStyle: 'normal',
3746
+ lineHeight: 1.56,
3747
+ letterSpacing: '0.5px'
3748
+ },
3749
+ "data-testid": "productform-tac-message-line"
3750
+ }, line);
3751
+ }));
3752
+ };
3753
+
3754
+ /* *
3755
+ * Licensed under the Apache License, Version 2.0 (the "License");
3756
+ * you may not use this file except in compliance with the License.
3757
+ * You may obtain a copy of the License at
3758
+ *
3759
+ * http://www.apache.org/licenses/LICENSE-2.0
3760
+ *
3761
+ * Unless required by applicable law or agreed to in writing, software
3762
+ * distributed under the License is distributed on an "AS IS" BASIS,
3763
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3764
+ * See the License for the specific language governing permissions and
3765
+ * limitations under the License.
3766
+ *
3767
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
3768
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
3769
+ * */
3770
+
3771
+ var IssuedAt = function IssuedAt(_ref) {
3772
+ var date = _ref.date,
3773
+ isReadOnly = _ref.isReadOnly;
3774
+ return /*#__PURE__*/React__default.createElement(ProductFormFieldLayout, {
3775
+ title: "Issued at"
3776
+ }, /*#__PURE__*/React__default.createElement(Grid, {
3777
+ item: true,
3778
+ xs: 12
3779
+ }, /*#__PURE__*/React__default.createElement(Typography, {
3780
+ variant: "body2",
3781
+ sx: Object.assign(Object.assign({}, styles$2.body), {
3782
+ fontSize: '1rem',
3783
+ color: isReadOnly ? 'geowebColors.typographyAndIcons.text' : 'geowebColors.buttons.primary.disabled.color'
3784
+ })
3785
+ }, date)));
3934
3786
  };
3935
- var useTAC = function useTAC(initialProduct, getTAC) {
3936
- var _React$useState = React__default.useState(noTAC),
3937
- _React$useState2 = _slicedToArray(_React$useState, 2),
3938
- TAC = _React$useState2[0],
3939
- setTAC = _React$useState2[1];
3940
3787
 
3941
- var _useIsMounted = useIsMounted(),
3942
- isMounted = _useIsMounted.isMounted;
3788
+ /* *
3789
+ * Licensed under the Apache License, Version 2.0 (the "License");
3790
+ * you may not use this file except in compliance with the License.
3791
+ * You may obtain a copy of the License at
3792
+ *
3793
+ * http://www.apache.org/licenses/LICENSE-2.0
3794
+ *
3795
+ * Unless required by applicable law or agreed to in writing, software
3796
+ * distributed under the License is distributed on an "AS IS" BASIS,
3797
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3798
+ * See the License for the specific language governing permissions and
3799
+ * limitations under the License.
3800
+ *
3801
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
3802
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
3803
+ * */
3943
3804
 
3944
- var retrieveTAC = function retrieveTAC(product) {
3945
- return __awaiter(void 0, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
3946
- var result;
3947
- return regeneratorRuntime.wrap(function _callee$(_context) {
3948
- while (1) {
3949
- switch (_context.prev = _context.next) {
3950
- case 0:
3951
- _context.prev = 0;
3952
- _context.next = 3;
3953
- return getTAC(product);
3805
+ var Tac = function Tac(_ref) {
3806
+ var tac = _ref.tac,
3807
+ children = _ref.children;
3808
+ return /*#__PURE__*/React__default.createElement(ProductFormFieldLayout, {
3809
+ title: "TAC",
3810
+ sx: {
3811
+ paddingTop: 2
3812
+ }
3813
+ }, /*#__PURE__*/React__default.createElement(Grid, {
3814
+ item: true,
3815
+ xs: 12
3816
+ }, /*#__PURE__*/React__default.createElement(ProductFormTAC, {
3817
+ tac: tac
3818
+ }), children));
3819
+ };
3954
3820
 
3955
- case 3:
3956
- result = _context.sent;
3821
+ /* *
3822
+ * Licensed under the Apache License, Version 2.0 (the "License");
3823
+ * you may not use this file except in compliance with the License.
3824
+ * You may obtain a copy of the License at
3825
+ *
3826
+ * http://www.apache.org/licenses/LICENSE-2.0
3827
+ *
3828
+ * Unless required by applicable law or agreed to in writing, software
3829
+ * distributed under the License is distributed on an "AS IS" BASIS,
3830
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3831
+ * See the License for the specific language governing permissions and
3832
+ * limitations under the License.
3833
+ *
3834
+ * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
3835
+ * Copyright 2021 - Finnish Meteorological Institute (FMI)
3836
+ * */
3837
+ var adagucBaseUrl = 'https://adaguc-server-geoweb.geoweb.knmi.cloud/adagucserver';
3838
+ var KNMIGeoWebOverlays = {
3839
+ name: 'KNMIGeoWebOverlays',
3840
+ url: "".concat(adagucBaseUrl, "?dataset=OVL"),
3841
+ id: 'knmigeoweboverlays'
3842
+ };
3843
+ var northSeaPlatforms = {
3844
+ service: KNMIGeoWebOverlays.url,
3845
+ name: 'northseastations',
3846
+ format: 'image/png',
3847
+ layerType: mapTypes.LayerType.overLayer,
3848
+ enabled: true
3849
+ };
3850
+ var majorAirportsEHAA = {
3851
+ service: KNMIGeoWebOverlays.url,
3852
+ name: 'airports',
3853
+ format: 'image/png',
3854
+ layerType: mapTypes.LayerType.overLayer,
3855
+ enabled: true
3856
+ };
3957
3857
 
3958
- if (isMounted.current) {
3959
- setTAC(result.data);
3960
- }
3858
+ /* *
3859
+ * Licensed under the Apache License, Version 2.0 (the "License");
3860
+ * you may not use this file except in compliance with the License.
3861
+ * You may obtain a copy of the License at
3862
+ *
3863
+ * http://www.apache.org/licenses/LICENSE-2.0
3864
+ *
3865
+ * Unless required by applicable law or agreed to in writing, software
3866
+ * distributed under the License is distributed on an "AS IS" BASIS,
3867
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3868
+ * See the License for the specific language governing permissions and
3869
+ * limitations under the License.
3870
+ *
3871
+ * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
3872
+ * Copyright 2021 - Finnish Meteorological Institute (FMI)
3873
+ * */
3874
+ var allowOneGeoJSONFeature = function allowOneGeoJSONFeature(mode, geojson) {
3875
+ switch (mode) {
3876
+ case MapDrawMode.BOX:
3877
+ case MapDrawMode.POLYGON:
3878
+ return geojson.features[0].geometry.coordinates.length > 1 ? produce(geojson, function (draft) {
3879
+ draft.features[0].geometry.coordinates = [draft.features[0].geometry.coordinates[1]];
3880
+ }) : geojson;
3961
3881
 
3962
- _context.next = 10;
3963
- break;
3882
+ default:
3883
+ return geojson;
3884
+ }
3885
+ };
3964
3886
 
3965
- case 7:
3966
- _context.prev = 7;
3967
- _context.t0 = _context["catch"](0);
3887
+ var MapViewGeoJson = function MapViewGeoJson(_ref) {
3888
+ var geoJSONs = _ref.geoJSONs,
3889
+ _ref$setLayerGeoJSONs = _ref.setLayerGeoJSONs,
3890
+ setLayerGeoJSONs = _ref$setLayerGeoJSONs === void 0 ? function () {} : _ref$setLayerGeoJSONs,
3891
+ _ref$layerDrawModes = _ref.layerDrawModes,
3892
+ layerDrawModes = _ref$layerDrawModes === void 0 ? {
3893
+ start: null,
3894
+ end: null
3895
+ } : _ref$layerDrawModes,
3896
+ _ref$drawMode = _ref.drawMode,
3897
+ drawMode = _ref$drawMode === void 0 ? {
3898
+ start: null,
3899
+ end: null
3900
+ } : _ref$drawMode,
3901
+ _ref$setDrawMode = _ref.setDrawMode,
3902
+ setDrawMode = _ref$setDrawMode === void 0 ? function () {} : _ref$setDrawMode,
3903
+ _ref$exitDrawModeCall = _ref.exitDrawModeCallbackStart,
3904
+ exitDrawModeCallbackStart = _ref$exitDrawModeCall === void 0 ? function () {} : _ref$exitDrawModeCall,
3905
+ _ref$exitDrawModeCall2 = _ref.exitDrawModeCallbackEnd,
3906
+ exitDrawModeCallbackEnd = _ref$exitDrawModeCall2 === void 0 ? function () {} : _ref$exitDrawModeCall2;
3907
+ var dispatch = useDispatch();
3908
+ var firstMap = useSelector(function (store) {
3909
+ return mapSelectors.getFirstMap(store);
3910
+ }, shallowEqual);
3911
+ var firstMapId = firstMap && firstMap.id ? firstMap.id : null;
3912
+ var mapLayers = useSelector(function (store) {
3913
+ return mapSelectors.getMapLayers(store, firstMapId);
3914
+ }, shallowEqual);
3915
+ var mapDimensions = useSelector(function (store) {
3916
+ return mapSelectors.getMapDimensions(store, firstMapId);
3917
+ }, shallowEqual);
3918
+ var mapId = React.useRef("sigmet-".concat(generateMapId())).current;
3919
+ var timesliderId = React.useRef("sigmet-".concat(generateTimesliderId())).current;
3920
+ var syncGroupAddGroup = React.useCallback(function (payload) {
3921
+ dispatch(SyncGroups.actions.syncGroupAddGroup(payload));
3922
+ }, [dispatch]);
3923
+ var syncGroupAddTarget = React.useCallback(function (payload) {
3924
+ dispatch(SyncGroups.actions.syncGroupAddTarget(payload));
3925
+ }, [dispatch]);
3926
+ React.useEffect(function () {
3927
+ if (mapLayers && mapLayers.length) {
3928
+ // use maplayers, but change layerId and current mapId
3929
+ var layers = mapLayers.map(function (layer) {
3930
+ return Object.assign(Object.assign({}, layer), {
3931
+ id: generateLayerId(),
3932
+ mapId: mapId
3933
+ });
3934
+ });
3935
+ dispatch(mapActions.setLayers({
3936
+ mapId: mapId,
3937
+ layers: layers
3938
+ }));
3939
+ }
3968
3940
 
3969
- if (isMounted.current) {
3970
- setTAC(noTAC);
3971
- }
3941
+ if (mapDimensions && mapDimensions.length) {
3942
+ dispatch(mapActions.mapChangeDimension({
3943
+ mapId: mapId,
3944
+ dimension: mapDimensions[0],
3945
+ origin: 'MapViewGeoJson'
3946
+ }));
3947
+ }
3972
3948
 
3973
- case 10:
3974
- case "end":
3975
- return _context.stop();
3976
- }
3977
- }
3978
- }, _callee, null, [[0, 7]]);
3949
+ dispatch(mapActions.setBaseLayers({
3950
+ mapId: mapId,
3951
+ layers: [Object.assign(Object.assign({}, publicLayers.baseLayerGrey), {
3952
+ id: "baselayer-".concat(mapId)
3953
+ }), Object.assign(Object.assign({}, publicLayers.overLayer), {
3954
+ id: "countryborders-".concat(mapId)
3955
+ }), Object.assign(Object.assign({}, northSeaPlatforms), {
3956
+ id: "northseaplatforms-".concat(mapId)
3957
+ }), Object.assign(Object.assign({}, majorAirportsEHAA), {
3958
+ id: "majorairportsehaa-".concat(mapId)
3959
+ })]
3979
3960
  }));
3980
- };
3981
-
3982
- React__default.useEffect(function () {
3983
- if (shouldRetrieveTAC(initialProduct)) {
3984
- retrieveTAC(initialProduct);
3985
- } // eslint-disable-next-line react-hooks/exhaustive-deps
3986
-
3961
+ dispatch(mapActions.setBbox({
3962
+ mapId: mapId,
3963
+ bbox: srsAndBboxDefault.bbox,
3964
+ srs: srsAndBboxDefault.srs
3965
+ }));
3966
+ syncGroupAddGroup({
3967
+ groupId: 'Time_SigmetAirmet',
3968
+ title: 'Group 1 for sigmet/airmet map',
3969
+ type: SyncGroups.constants.SYNCGROUPS_TYPE_SETTIME
3970
+ });
3971
+ syncGroupAddTarget({
3972
+ groupId: 'Time_SigmetAirmet',
3973
+ targetId: mapId
3974
+ });
3975
+ syncGroupAddTarget({
3976
+ groupId: 'Time_SigmetAirmet',
3977
+ targetId: timesliderId
3978
+ }); // eslint-disable-next-line react-hooks/exhaustive-deps
3987
3979
  }, []);
3988
-
3989
- var update = function update(formValues) {
3990
- if (shouldRetrieveTAC(formValues)) {
3991
- retrieveTAC(formValues);
3992
- } else if (isMounted.current) {
3993
- setTAC(noTAC);
3980
+ return /*#__PURE__*/React.createElement("div", {
3981
+ style: {
3982
+ position: 'relative',
3983
+ height: '100%'
3984
+ },
3985
+ "data-testid": "MapView"
3986
+ }, /*#__PURE__*/React.createElement(MapControls, null, /*#__PURE__*/React.createElement(LayerManagerMapButtonConnect, {
3987
+ source: "module",
3988
+ mapId: mapId
3989
+ }), /*#__PURE__*/React.createElement(LegendMapButtonConnect, {
3990
+ source: "module",
3991
+ mapId: mapId
3992
+ }), /*#__PURE__*/React.createElement(MultiDimensionSelectMapButtonsConnect, {
3993
+ source: "module",
3994
+ mapId: mapId
3995
+ })), /*#__PURE__*/React.createElement(MapViewConnect, {
3996
+ mapId: mapId
3997
+ }, /*#__PURE__*/React.createElement(MapViewLayer, {
3998
+ id: "geojsonlayer-fir-".concat(mapId),
3999
+ isInEditMode: false,
4000
+ geojson: geoJSONs.fir
4001
+ }), /*#__PURE__*/React.createElement(MapViewLayer, {
4002
+ id: "geojsonlayer-end-".concat(mapId),
4003
+ isInEditMode: drawMode.end !== null && layerDrawModes.end !== null,
4004
+ geojson: geoJSONs.end,
4005
+ drawMode: layerDrawModes.end,
4006
+ updateGeojson: function updateGeojson(geojson) {
4007
+ var end = allowOneGeoJSONFeature(layerDrawModes.end, geojson);
4008
+ setLayerGeoJSONs(Object.assign(Object.assign({}, geoJSONs), {
4009
+ end: end
4010
+ }));
4011
+ },
4012
+ exitDrawModeCallback: function exitDrawModeCallback() {
4013
+ setDrawMode({
4014
+ start: null,
4015
+ end: null
4016
+ });
4017
+ exitDrawModeCallbackEnd();
4018
+ },
4019
+ featureNrToEdit: 0
4020
+ }), /*#__PURE__*/React.createElement(MapViewLayer, {
4021
+ id: "geojsonlayer-start-".concat(mapId),
4022
+ isInEditMode: drawMode.start !== null && layerDrawModes.start !== null,
4023
+ geojson: geoJSONs.start,
4024
+ drawMode: layerDrawModes.start,
4025
+ updateGeojson: function updateGeojson(geojson) {
4026
+ var start = allowOneGeoJSONFeature(layerDrawModes.start, geojson);
4027
+ setLayerGeoJSONs(Object.assign(Object.assign({}, geoJSONs), {
4028
+ start: start
4029
+ }));
4030
+ },
4031
+ exitDrawModeCallback: function exitDrawModeCallback() {
4032
+ setDrawMode({
4033
+ start: null,
4034
+ end: null
4035
+ });
4036
+ exitDrawModeCallbackStart();
4037
+ },
4038
+ featureNrToEdit: 0
4039
+ }), /*#__PURE__*/React.createElement(MapViewLayer, {
4040
+ id: "geojsonlayer-intersection-end-".concat(mapId),
4041
+ isInEditMode: false,
4042
+ geojson: geoJSONs.intersectionEnd
4043
+ }), /*#__PURE__*/React.createElement(MapViewLayer, {
4044
+ id: "geojsonlayer-intersection-start-".concat(mapId),
4045
+ isInEditMode: false,
4046
+ geojson: geoJSONs.intersectionStart
4047
+ })), /*#__PURE__*/React.createElement("div", {
4048
+ style: {
4049
+ position: 'absolute',
4050
+ left: '0',
4051
+ bottom: '0',
4052
+ zIndex: 1000,
4053
+ width: '100%'
3994
4054
  }
3995
- }; // eslint-disable-next-line react-hooks/exhaustive-deps
3996
-
3997
-
3998
- var delayedQuery = React__default.useCallback(debounce(update, 1000), []);
3999
- return [TAC, delayedQuery];
4055
+ }, /*#__PURE__*/React.createElement(TimeSliderConnect, {
4056
+ sourceId: timesliderId,
4057
+ mapId: mapId
4058
+ })), /*#__PURE__*/React.createElement(LegendConnect, {
4059
+ showMapId: true,
4060
+ mapId: mapId
4061
+ }));
4000
4062
  };
4001
4063
 
4002
- var ProductFormTAC = function ProductFormTAC(_ref) {
4003
- var tac = _ref.tac;
4004
- var tacLines = tac.split('\n');
4005
- return /*#__PURE__*/React__default.createElement(Typography, {
4006
- variant: "body2",
4007
- component: "div",
4008
- sx: styles$2.tacOutput,
4009
- "data-testid": "productform-tac-message"
4010
- }, tacLines.map(function (line) {
4011
- return /*#__PURE__*/React__default.createElement(Box, {
4012
- component: "p",
4013
- key: line,
4014
- sx: styles$2.tacLine,
4015
- "data-testid": "productform-tac-message-line"
4016
- }, line);
4017
- }));
4064
+ var ProductFormLayout = function ProductFormLayout(_a) {
4065
+ var children = _a.children,
4066
+ geojsonProps = __rest(_a, ["children"]);
4067
+
4068
+ var theme = useTheme();
4069
+ return /*#__PURE__*/React__default.createElement(Grid, {
4070
+ container: true,
4071
+ sx: _defineProperty({
4072
+ height: '100%',
4073
+ overflowY: 'auto'
4074
+ }, theme.breakpoints.up('sm'), {
4075
+ overflowY: 'hidden'
4076
+ })
4077
+ }, /*#__PURE__*/React__default.createElement(Grid, {
4078
+ item: true,
4079
+ xs: 12,
4080
+ sm: 6,
4081
+ lg: 8,
4082
+ sx: _defineProperty({
4083
+ height: 400,
4084
+ padding: 2
4085
+ }, theme.breakpoints.up('sm'), {
4086
+ height: '100%',
4087
+ padding: 0
4088
+ })
4089
+ }, /*#__PURE__*/React__default.createElement(MapViewGeoJson, Object.assign({}, geojsonProps))), /*#__PURE__*/React__default.createElement(Grid, {
4090
+ item: true,
4091
+ xs: 12,
4092
+ sm: 6,
4093
+ lg: 4,
4094
+ sx: _defineProperty({
4095
+ paddingTop: 5,
4096
+ paddingBottom: 5,
4097
+ paddingRight: 2
4098
+ }, theme.breakpoints.up('sm'), {
4099
+ overflowY: 'auto',
4100
+ height: '100%'
4101
+ })
4102
+ }, children));
4018
4103
  };
4019
4104
 
4020
4105
  var SigmetForm = function SigmetForm(_ref) {
@@ -4117,13 +4202,14 @@ var SigmetForm = function SigmetForm(_ref) {
4117
4202
  }, [drawMode.start, drawMode.end, isReadOnly, isDisabled]);
4118
4203
 
4119
4204
  var renderForm = function renderForm() {
4120
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Grid, {
4205
+ return /*#__PURE__*/React__default.createElement(Grid, {
4121
4206
  container: true,
4122
4207
  direction: "column",
4123
- spacing: 2
4208
+ spacing: 5
4124
4209
  }, !isCancelSigmet && /*#__PURE__*/React__default.createElement(Phenomenon, {
4125
4210
  productType: "sigmet",
4126
4211
  isDisabled: isDisabled,
4212
+ isReadOnly: isReadOnly,
4127
4213
  onChange: onChangeForm
4128
4214
  }), !isCancelSigmet && /*#__PURE__*/React__default.createElement(ObservationForecast, {
4129
4215
  isDisabled: isDisabled,
@@ -4140,14 +4226,17 @@ var SigmetForm = function SigmetForm(_ref) {
4140
4226
  }), /*#__PURE__*/React__default.createElement(ValidFrom, {
4141
4227
  productType: "sigmet",
4142
4228
  isDisabled: isDisabled,
4229
+ isReadOnly: isReadOnly,
4143
4230
  onChange: onChangeForm
4144
4231
  }), /*#__PURE__*/React__default.createElement(ValidUntil, {
4145
4232
  productType: "sigmet",
4146
4233
  isDisabled: isDisabled,
4234
+ isReadOnly: isReadOnly,
4147
4235
  onChange: onChangeForm
4148
- })), /*#__PURE__*/React__default.createElement(SelectFIR, {
4236
+ }), /*#__PURE__*/React__default.createElement(SelectFIR, {
4149
4237
  productType: "sigmet",
4150
- isDisabled: isDisabled
4238
+ isDisabled: isDisabled,
4239
+ isReadOnly: isReadOnly
4151
4240
  }), /*#__PURE__*/React__default.createElement(StartGeometry, {
4152
4241
  isReadOnly: isReadOnly,
4153
4242
  drawMode: drawMode,
@@ -4173,74 +4262,19 @@ var SigmetForm = function SigmetForm(_ref) {
4173
4262
  }), !isCancelSigmet && /*#__PURE__*/React__default.createElement(Change, {
4174
4263
  isDisabled: isDisabled,
4175
4264
  isReadOnly: isReadOnly
4176
- }), isCancelSigmet && watch('vaSigmetMoveToFIR') && /*#__PURE__*/React__default.createElement(Grid, {
4177
- item: true,
4178
- container: true,
4179
- spacing: 2
4180
- }, /*#__PURE__*/React__default.createElement(Grid, {
4181
- item: true,
4182
- xs: 4,
4183
- container: true,
4184
- justifyContent: "flex-end"
4185
- }), /*#__PURE__*/React__default.createElement(Grid, {
4186
- item: true,
4187
- xs: 8,
4188
- container: true,
4189
- justifyContent: "flex-start"
4190
- }, /*#__PURE__*/React__default.createElement(Grid, {
4265
+ }), isCancelSigmet && watch('vaSigmetMoveToFIR') && /*#__PURE__*/React__default.createElement(ProductFormFieldLayout, null, /*#__PURE__*/React__default.createElement(Grid, {
4191
4266
  item: true,
4192
4267
  xs: 12
4193
4268
  }, /*#__PURE__*/React__default.createElement(Typography, {
4194
4269
  variant: "body2",
4195
- sx: styles$4.body,
4270
+ sx: styles$2.body,
4196
4271
  "data-testid": "vaSigmetMoveToFIR"
4197
- }, "Volcanic Cloud is moving in the direction of:", ' ', /*#__PURE__*/React__default.createElement("b", null, " ", watch('vaSigmetMoveToFIR')))))), /*#__PURE__*/React__default.createElement(Grid, {
4198
- item: true,
4199
- container: true,
4200
- spacing: 2,
4201
- sx: styles$4.containerItem
4202
- }, /*#__PURE__*/React__default.createElement(Grid, {
4203
- item: true,
4204
- xs: 4,
4205
- container: true,
4206
- justifyContent: "flex-end"
4207
- }, /*#__PURE__*/React__default.createElement(Typography, {
4208
- variant: "subtitle1",
4209
- sx: styles$4.label
4210
- }, "Issued at")), /*#__PURE__*/React__default.createElement(Grid, {
4211
- item: true,
4212
- xs: 8,
4213
- container: true,
4214
- justifyContent: "flex-start"
4215
- }, /*#__PURE__*/React__default.createElement(Grid, {
4216
- item: true,
4217
- xs: 12
4218
- }, /*#__PURE__*/React__default.createElement(Typography, {
4219
- variant: "body2",
4220
- sx: styles$4.body
4221
- }, getProductIssueDate(initialSigmet, initialCancelSigmet)))), /*#__PURE__*/React__default.createElement(Grid, {
4222
- item: true,
4223
- container: true,
4224
- spacing: 2
4225
- }, /*#__PURE__*/React__default.createElement(Grid, {
4226
- item: true,
4227
- xs: 4,
4228
- container: true,
4229
- justifyContent: "flex-end"
4230
- }, /*#__PURE__*/React__default.createElement(Typography, {
4231
- variant: "subtitle1",
4232
- sx: styles$4.label
4233
- }, "TAC")), /*#__PURE__*/React__default.createElement(Grid, {
4234
- item: true,
4235
- xs: 8,
4236
- container: true,
4237
- justifyContent: "flex-start"
4238
- }, /*#__PURE__*/React__default.createElement(Grid, {
4239
- item: true,
4240
- xs: 12
4241
- }, /*#__PURE__*/React__default.createElement(ProductFormTAC, {
4272
+ }, "Volcanic Cloud is moving in the direction of:", ' ', /*#__PURE__*/React__default.createElement("b", null, " ", watch('vaSigmetMoveToFIR'))))), /*#__PURE__*/React__default.createElement(IssuedAt, {
4273
+ date: getProductIssueDate(initialSigmet, initialCancelSigmet),
4274
+ isReadOnly: isReadOnly
4275
+ }), /*#__PURE__*/React__default.createElement(Tac, {
4242
4276
  tac: tac
4243
- })))), /*#__PURE__*/React__default.createElement(ReactHookFormHiddenInput, {
4277
+ }, /*#__PURE__*/React__default.createElement(ReactHookFormHiddenInput, {
4244
4278
  name: "sequence",
4245
4279
  defaultValue: "-1"
4246
4280
  }),
@@ -4269,15 +4303,7 @@ var SigmetForm = function SigmetForm(_ref) {
4269
4303
  style: {
4270
4304
  width: '100%'
4271
4305
  }
4272
- }, /*#__PURE__*/React__default.createElement(Grid, {
4273
- container: true,
4274
- style: {
4275
- height: '100%'
4276
- }
4277
- }, /*#__PURE__*/React__default.createElement(Grid, {
4278
- item: true,
4279
- xs: 8
4280
- }, /*#__PURE__*/React__default.createElement(MapViewGeoJson, {
4306
+ }, /*#__PURE__*/React__default.createElement(ProductFormLayout, {
4281
4307
  geoJSONs: geoJSONs,
4282
4308
  setLayerGeoJSONs: function setLayerGeoJSONs(geoJSONs) {
4283
4309
  return _setLayerGeoJSONs(createInterSections(geoJSONs));
@@ -4287,11 +4313,7 @@ var SigmetForm = function SigmetForm(_ref) {
4287
4313
  setDrawMode: setDrawMode,
4288
4314
  exitDrawModeCallbackStart: updateStartDrawing,
4289
4315
  exitDrawModeCallbackEnd: updateEndDrawing
4290
- })), /*#__PURE__*/React__default.createElement(Grid, {
4291
- item: true,
4292
- xs: 4,
4293
- sx: styles$4.productForm
4294
- }, renderForm())));
4316
+ }, renderForm()));
4295
4317
  };
4296
4318
 
4297
4319
  var AirmetForm = function AirmetForm(_ref) {
@@ -4374,18 +4396,21 @@ var AirmetForm = function AirmetForm(_ref) {
4374
4396
  }, [drawMode.start, isReadOnly, isDisabled]);
4375
4397
 
4376
4398
  var renderForm = function renderForm() {
4377
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Grid, {
4399
+ return /*#__PURE__*/React__default.createElement(Grid, {
4378
4400
  container: true,
4379
4401
  direction: "column",
4380
- spacing: 2
4402
+ spacing: 6
4381
4403
  }, !isCancelAirmet && /*#__PURE__*/React__default.createElement(Phenomenon, {
4382
4404
  productType: "airmet",
4383
4405
  isDisabled: isDisabled,
4406
+ isReadOnly: isReadOnly,
4384
4407
  onChange: onChangeForm
4385
4408
  }), !isCancelAirmet && phenomenon === 'SFC_VIS' && /*#__PURE__*/React__default.createElement(SurfaceVisibility, {
4409
+ isReadOnly: isReadOnly,
4386
4410
  isDisabled: isDisabled,
4387
4411
  onChange: onChangeForm
4388
4412
  }), !isCancelAirmet && phenomenon === 'SFC_WIND' && /*#__PURE__*/React__default.createElement(SurfaceWind, {
4413
+ isReadOnly: isReadOnly,
4389
4414
  isDisabled: isDisabled,
4390
4415
  onChange: onChangeForm
4391
4416
  }), !isCancelAirmet && /*#__PURE__*/React__default.createElement(ObservationForecast, {
@@ -4398,14 +4423,17 @@ var AirmetForm = function AirmetForm(_ref) {
4398
4423
  onChange: onChangeForm
4399
4424
  }), /*#__PURE__*/React__default.createElement(ValidFrom, {
4400
4425
  productType: "airmet",
4426
+ isReadOnly: isReadOnly,
4401
4427
  isDisabled: isDisabled,
4402
4428
  onChange: onChangeForm
4403
4429
  }), /*#__PURE__*/React__default.createElement(ValidUntil, {
4404
4430
  productType: "airmet",
4431
+ isReadOnly: isReadOnly,
4405
4432
  isDisabled: isDisabled,
4406
4433
  onChange: onChangeForm
4407
- })), /*#__PURE__*/React__default.createElement(SelectFIR, {
4434
+ }), /*#__PURE__*/React__default.createElement(SelectFIR, {
4408
4435
  productType: "airmet",
4436
+ isReadOnly: isReadOnly,
4409
4437
  isDisabled: isDisabled
4410
4438
  }), /*#__PURE__*/React__default.createElement(StartGeometry, {
4411
4439
  isReadOnly: isReadOnly,
@@ -4431,53 +4459,12 @@ var AirmetForm = function AirmetForm(_ref) {
4431
4459
  }), !isCancelAirmet && /*#__PURE__*/React__default.createElement(Change, {
4432
4460
  isDisabled: isDisabled,
4433
4461
  isReadOnly: isReadOnly
4434
- }), /*#__PURE__*/React__default.createElement(Grid, {
4435
- item: true,
4436
- container: true,
4437
- spacing: 2,
4438
- sx: styles$4.containerItem
4439
- }, /*#__PURE__*/React__default.createElement(Grid, {
4440
- item: true,
4441
- xs: 4,
4442
- container: true,
4443
- justifyContent: "flex-end"
4444
- }, /*#__PURE__*/React__default.createElement(Typography, {
4445
- variant: "subtitle1",
4446
- sx: styles$4.label
4447
- }, "Issued at")), /*#__PURE__*/React__default.createElement(Grid, {
4448
- item: true,
4449
- xs: 8,
4450
- container: true,
4451
- justifyContent: "flex-start"
4452
- }, /*#__PURE__*/React__default.createElement(Grid, {
4453
- item: true,
4454
- xs: 12
4455
- }, /*#__PURE__*/React__default.createElement(Typography, {
4456
- variant: "body2",
4457
- sx: styles$4.body
4458
- }, getProductIssueDate(initialAirmet, initialCancelAirmet)))), /*#__PURE__*/React__default.createElement(Grid, {
4459
- item: true,
4460
- container: true,
4461
- spacing: 2
4462
- }, /*#__PURE__*/React__default.createElement(Grid, {
4463
- item: true,
4464
- xs: 4,
4465
- container: true,
4466
- justifyContent: "flex-end"
4467
- }, /*#__PURE__*/React__default.createElement(Typography, {
4468
- variant: "subtitle1",
4469
- sx: styles$4.label
4470
- }, "TAC")), /*#__PURE__*/React__default.createElement(Grid, {
4471
- item: true,
4472
- xs: 8,
4473
- container: true,
4474
- justifyContent: "flex-start"
4475
- }, /*#__PURE__*/React__default.createElement(Grid, {
4476
- item: true,
4477
- xs: 12
4478
- }, /*#__PURE__*/React__default.createElement(ProductFormTAC, {
4462
+ }), /*#__PURE__*/React__default.createElement(IssuedAt, {
4463
+ isReadOnly: isReadOnly,
4464
+ date: getProductIssueDate(initialAirmet, initialCancelAirmet)
4465
+ }), /*#__PURE__*/React__default.createElement(Tac, {
4479
4466
  tac: tac
4480
- })))), /*#__PURE__*/React__default.createElement(ReactHookFormHiddenInput, {
4467
+ }, /*#__PURE__*/React__default.createElement(ReactHookFormHiddenInput, {
4481
4468
  name: "sequence",
4482
4469
  defaultValue: "-1"
4483
4470
  }),
@@ -4506,15 +4493,7 @@ var AirmetForm = function AirmetForm(_ref) {
4506
4493
  style: {
4507
4494
  width: '100%'
4508
4495
  }
4509
- }, /*#__PURE__*/React__default.createElement(Grid, {
4510
- container: true,
4511
- style: {
4512
- height: '100%'
4513
- }
4514
- }, /*#__PURE__*/React__default.createElement(Grid, {
4515
- item: true,
4516
- xs: 8
4517
- }, /*#__PURE__*/React__default.createElement(MapViewGeoJson, {
4496
+ }, /*#__PURE__*/React__default.createElement(ProductFormLayout, {
4518
4497
  geoJSONs: geoJSONs,
4519
4498
  setLayerGeoJSONs: function setLayerGeoJSONs(geoJSONs) {
4520
4499
  return _setLayerGeoJSONs(createInterSections(geoJSONs));
@@ -4523,32 +4502,7 @@ var AirmetForm = function AirmetForm(_ref) {
4523
4502
  drawMode: drawMode,
4524
4503
  setDrawMode: setDrawMode,
4525
4504
  exitDrawModeCallbackStart: updateStartDrawing
4526
- })), /*#__PURE__*/React__default.createElement(Grid, {
4527
- item: true,
4528
- xs: 4,
4529
- sx: styles$4.productForm
4530
- }, renderForm())));
4531
- };
4532
-
4533
- var styles$1 = {
4534
- dialogHeader: {
4535
- boxShadow: '0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14)',
4536
- zIndex: 1,
4537
- padding: '4px 20px'
4538
- },
4539
- dialogTitle: {
4540
- display: 'flex',
4541
- justifyContent: 'center',
4542
- textAlign: 'center'
4543
- },
4544
- dialogChildren: {
4545
- display: 'flex',
4546
- padding: '20px',
4547
- minHeight: 200,
4548
- minWidth: 400,
4549
- height: '100%',
4550
- paddingTop: '20px!important'
4551
- }
4505
+ }, renderForm()));
4552
4506
  };
4553
4507
 
4554
4508
  var ContentDialog = function ContentDialog(_a) {
@@ -4562,6 +4516,8 @@ var ContentDialog = function ContentDialog(_a) {
4562
4516
  alertBanner = _a$alertBanner === void 0 ? null : _a$alertBanner,
4563
4517
  other = __rest(_a, ["open", "toggleDialogStatus", "title", "children", "options", "onClose", "alertBanner"]);
4564
4518
 
4519
+ var theme = useTheme();
4520
+
4565
4521
  var handleClose = function handleClose() {
4566
4522
  if (onClose) {
4567
4523
  onClose();
@@ -4575,53 +4531,77 @@ var ContentDialog = function ContentDialog(_a) {
4575
4531
  open: open,
4576
4532
  onClose: handleClose,
4577
4533
  maxWidth: other.maxWidth ? other.maxWidth : 'lg'
4578
- }, other), /*#__PURE__*/React.createElement(DialogTitle, {
4579
- sx: styles$1.dialogHeader
4534
+ }, other, {
4535
+ sx: {
4536
+ ' .MuiPaper-root': {
4537
+ minWidth: 300
4538
+ }
4539
+ }
4540
+ }), /*#__PURE__*/React.createElement(DialogTitle, {
4541
+ sx: _defineProperty({
4542
+ boxShadow: 1,
4543
+ zIndex: 1,
4544
+ padding: 0,
4545
+ height: 48,
4546
+ display: 'flex',
4547
+ paddingLeft: 2,
4548
+ paddingRight: 2
4549
+ }, theme.breakpoints.up('sm'), {
4550
+ paddingLeft: 3,
4551
+ paddingRight: 3
4552
+ }),
4553
+ component: "div"
4580
4554
  }, /*#__PURE__*/React.createElement(Grid, {
4581
4555
  container: true,
4582
4556
  alignItems: "center"
4583
4557
  }, /*#__PURE__*/React.createElement(Grid, {
4584
4558
  item: true,
4585
- xs: true
4559
+ xs: 4
4586
4560
  }, /*#__PURE__*/React.createElement(Button, {
4587
4561
  onClick: handleClose,
4588
- color: "secondary",
4589
- size: "medium",
4590
- startIcon: /*#__PURE__*/React.createElement(ChevronLeft, {
4591
- color: "secondary"
4592
- }),
4593
- "data-testid": "contentdialog-close"
4594
- }, /*#__PURE__*/React.createElement(Typography, {
4595
- variant: "subtitle1",
4596
- color: "secondary"
4597
- }, "BACK"))), /*#__PURE__*/React.createElement(Grid, {
4562
+ variant: "flat",
4563
+ startIcon: /*#__PURE__*/React.createElement(ChevronLeft, null),
4564
+ "data-testid": "contentdialog-close",
4565
+ sx: _defineProperty({}, theme.breakpoints.down('md'), {
4566
+ textIndent: -999999,
4567
+ width: 24,
4568
+ minWidth: 24,
4569
+ height: 24,
4570
+ ' .MuiSvgIcon-root': {
4571
+ marginRight: 0
4572
+ }
4573
+ })
4574
+ }, "BACK")), /*#__PURE__*/React.createElement(Grid, {
4598
4575
  item: true,
4599
- xs: true,
4600
- sx: styles$1.dialogTitle
4576
+ xs: 4,
4577
+ sx: {
4578
+ display: 'flex',
4579
+ justifyContent: 'center',
4580
+ textAlign: 'center'
4581
+ }
4601
4582
  }, /*#__PURE__*/React.createElement(Typography, {
4602
4583
  "data-testid": "dialogTitle",
4603
- variant: "h6"
4584
+ variant: "h6",
4585
+ sx: {
4586
+ fontSize: '1.0rem',
4587
+ textOverflow: 'ellipsis',
4588
+ overflow: 'hidden',
4589
+ whiteSpace: 'nowrap'
4590
+ }
4604
4591
  }, title)), /*#__PURE__*/React.createElement(Grid, {
4605
4592
  item: true,
4606
- xs: true
4607
- }, /*#__PURE__*/React.createElement(Grid, {
4608
- container: true
4609
- }, options)))), alertBanner !== null && alertBanner, /*#__PURE__*/React.createElement(DialogContent, {
4610
- sx: styles$1.dialogChildren
4593
+ xs: 4
4594
+ }, options))), alertBanner !== null && alertBanner, /*#__PURE__*/React.createElement(DialogContent, {
4595
+ sx: {
4596
+ display: 'flex',
4597
+ padding: 0,
4598
+ minHeight: 200,
4599
+ height: '100%'
4600
+ }
4611
4601
  }, children));
4612
4602
  };
4613
4603
 
4614
4604
  var styles = {
4615
- cardWrapper: {
4616
- width: '100%'
4617
- },
4618
- cardContent: {
4619
- width: '100%',
4620
- padding: '14px',
4621
- '&:last-child': {
4622
- paddingBottom: '14px'
4623
- }
4624
- },
4625
4605
  activeStatus: {
4626
4606
  color: '#72bb23',
4627
4607
  paddingLeft: '6px',
@@ -4653,27 +4633,40 @@ var getStatusTagList = function getStatusTagList(product) {
4653
4633
  if (cancelsSeqId !== null) {
4654
4634
  return /*#__PURE__*/React__default.createElement(StatusTag, {
4655
4635
  content: "cancels ".concat(cancelsSeqId),
4656
- color: "red"
4636
+ color: "red",
4637
+ sx: {
4638
+ width: '80px'
4639
+ }
4657
4640
  });
4658
4641
  }
4659
4642
 
4660
4643
  if (product.status === 'CANCELLED') {
4661
4644
  return /*#__PURE__*/React__default.createElement(StatusTag, {
4662
4645
  content: "cancelled ".concat(product.sequence),
4663
- color: "red"
4646
+ color: "red",
4647
+ sx: {
4648
+ width: '80px'
4649
+ }
4664
4650
  });
4665
4651
  }
4666
4652
 
4667
4653
  if (moment(product.validDateEnd) < moment.utc(new Date())) {
4668
4654
  return /*#__PURE__*/React__default.createElement(StatusTag, {
4669
4655
  content: "expired",
4670
- color: "grey"
4656
+ color: "grey",
4657
+ sx: {
4658
+ width: '80px'
4659
+ }
4671
4660
  });
4672
4661
  }
4673
4662
 
4674
4663
  return /*#__PURE__*/React__default.createElement(StatusTag, {
4675
4664
  content: product.status.toLowerCase(),
4676
- color: product.status === 'PUBLISHED' ? 'green' : 'grey'
4665
+ color: product.status === 'PUBLISHED' ? 'green' : 'grey',
4666
+ sx: {
4667
+ marginRight: '0!important',
4668
+ width: '80px'
4669
+ }
4677
4670
  });
4678
4671
  };
4679
4672
 
@@ -4701,9 +4694,19 @@ var formatValidTime = function formatValidTime(startDate, endDate, format) {
4701
4694
  return "".concat(moment.utc(startDate).format('DD MMM YYYY, HH:mm'), " - ").concat(moment.utc(endDate).format(format), " UTC");
4702
4695
  };
4703
4696
 
4704
- var ProductListRow = function ProductListRow(_ref) {
4705
- var product = _ref.product,
4706
- productType = _ref.productType;
4697
+ var ProductListRowHeader = function ProductListRowHeader(_ref) {
4698
+ var title = _ref.title;
4699
+ return /*#__PURE__*/React__default.createElement(Typography, {
4700
+ sx: {
4701
+ color: 'geowebColors.textInputField.label.rgba',
4702
+ fontSize: '0.75rem'
4703
+ }
4704
+ }, title);
4705
+ };
4706
+
4707
+ var ProductListRow = function ProductListRow(_ref2) {
4708
+ var product = _ref2.product,
4709
+ productType = _ref2.productType;
4707
4710
 
4708
4711
  var _useApiContext = useApiContext(),
4709
4712
  api = _useApiContext.api;
@@ -4740,80 +4743,119 @@ var ProductListRow = function ProductListRow(_ref) {
4740
4743
  return /*#__PURE__*/React__default.createElement(Card, {
4741
4744
  elevation: 0,
4742
4745
  variant: "outlined",
4743
- sx: styles.cardWrapper
4744
- }, /*#__PURE__*/React__default.createElement(CardContent, {
4745
- sx: styles.cardContent
4746
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
4747
+ sx: function sx(theme) {
4748
+ return _defineProperty({
4749
+ width: '100%',
4750
+ paddingLeft: 1,
4751
+ paddingRight: 1,
4752
+ paddingTop: 1.5,
4753
+ paddingBottom: 1.5,
4754
+ '&:last-child': {
4755
+ paddingBottom: 1.5
4756
+ }
4757
+ }, theme.breakpoints.up('sm'), {
4758
+ paddingLeft: 4,
4759
+ paddingRight: 4,
4760
+ paddingTop: 2,
4761
+ paddingBottom: 2,
4762
+ '&:last-child': {
4763
+ paddingBottom: 2
4764
+ }
4765
+ });
4766
+ }
4746
4767
  }, /*#__PURE__*/React__default.createElement(Grid, {
4747
4768
  container: true,
4748
4769
  alignItems: "center",
4749
- spacing: 1
4750
- }, /*#__PURE__*/React__default.createElement(Tooltip, {
4751
- title: phenomenon !== null ? getPhenomenon(productType, phenomenon) : '',
4752
- placement: "bottom-start"
4770
+ spacing: 2
4753
4771
  }, /*#__PURE__*/React__default.createElement(Grid, {
4754
4772
  item: true,
4755
4773
  xs: 3,
4756
- sm: 3,
4757
- md: 1
4758
- }, phenomenon !== null && /*#__PURE__*/React__default.createElement(Typography, {
4759
- variant: "overline"
4760
- }, productType.toUpperCase()), /*#__PURE__*/React__default.createElement(Typography, {
4774
+ sm: 1
4775
+ }, phenomenon !== null && /*#__PURE__*/React__default.createElement(ProductListRowHeader, {
4776
+ title: productType.toUpperCase()
4777
+ }), /*#__PURE__*/React__default.createElement(Tooltip, {
4778
+ title: phenomenon !== null ? getPhenomenon(productType, phenomenon) : '',
4779
+ placement: "bottom-start"
4780
+ }, /*#__PURE__*/React__default.createElement(Typography, {
4761
4781
  variant: "subtitle2",
4762
4782
  noWrap: true,
4763
4783
  sx: styles.font
4764
4784
  }, phenomenon !== null ? phenomenon : 'Cancel'))), /*#__PURE__*/React__default.createElement(Grid, {
4765
4785
  item: true,
4766
- xs: 3,
4767
- sm: 2,
4768
- md: 1
4769
- }, /*#__PURE__*/React__default.createElement(Tooltip, {
4770
- "data-testid": "productlistrow-tactooltip",
4771
- title: /*#__PURE__*/React__default.createElement("div", {
4786
+ xs: 9,
4787
+ sm: 3
4788
+ }, /*#__PURE__*/React__default.createElement(ProductListRowHeader, {
4789
+ title: "Issue time"
4790
+ }), /*#__PURE__*/React__default.createElement(Tooltip, {
4791
+ title: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(ProductListRowHeader, {
4792
+ title: "TAC"
4793
+ }), /*#__PURE__*/React__default.createElement(Typography, {
4772
4794
  style: {
4773
4795
  whiteSpace: 'pre-line'
4796
+ },
4797
+ variant: "subtitle2",
4798
+ sx: Object.assign(Object.assign({}, styles.font), {
4799
+ color: 'geowebColors.typographyAndIcons.text',
4800
+ fontSize: '1.125rem',
4801
+ fontWeight: 'normal',
4802
+ fontStyle: 'normal',
4803
+ lineHeight: '28px',
4804
+ letterSpacing: '0.5px'
4805
+ })
4806
+ }, TAC)),
4807
+ placement: "bottom-start",
4808
+ componentsProps: {
4809
+ tooltip: {
4810
+ sx: {
4811
+ bgcolor: 'geowebColors.background.surface',
4812
+ boxShadow: 8,
4813
+ '& .MuiTooltip-arrow': {
4814
+ color: 'common.black'
4815
+ },
4816
+ maxWidth: 472
4817
+ }
4774
4818
  }
4775
- }, TAC),
4776
- placement: "bottom-start"
4777
- }, /*#__PURE__*/React__default.createElement("span", null, /*#__PURE__*/React__default.createElement(Info, {
4778
- "data-testid": "productlistrow-tacicon",
4779
- color: "secondary"
4780
- })))), /*#__PURE__*/React__default.createElement(Grid, {
4781
- item: true,
4782
- xs: 9,
4783
- sm: 10,
4784
- md: 3,
4785
- lg: 2
4819
+ }
4786
4820
  }, /*#__PURE__*/React__default.createElement(Typography, {
4787
- variant: "overline"
4788
- }, "Issue time"), /*#__PURE__*/React__default.createElement(Typography, {
4789
4821
  variant: "subtitle2",
4790
4822
  sx: styles.font,
4791
4823
  "data-testid": "issueTime"
4792
- }, product.issueDate ? "".concat(moment.utc(product.issueDate).format('DD MMM YYYY, HH:mm'), " UTC") : '(Not published)')), /*#__PURE__*/React__default.createElement(Grid, {
4824
+ }, product.issueDate ? "".concat(moment.utc(product.issueDate).format('DD MMM YYYY, HH:mm'), " UTC") : '(Not published)'))), /*#__PURE__*/React__default.createElement(Grid, {
4793
4825
  item: true,
4794
4826
  xs: 12,
4795
- sm: 8,
4796
- md: 5,
4797
- lg: 6
4798
- }, /*#__PURE__*/React__default.createElement(Typography, {
4799
- variant: "overline"
4800
- }, "Valid time"), /*#__PURE__*/React__default.createElement(Typography, {
4827
+ sm: 6
4828
+ }, /*#__PURE__*/React__default.createElement(ProductListRowHeader, {
4829
+ title: "Valid time"
4830
+ }), /*#__PURE__*/React__default.createElement(Typography, {
4801
4831
  variant: "subtitle2",
4802
4832
  sx: styles.font,
4803
4833
  "data-testid": "validTime"
4804
4834
  }, validTime)), /*#__PURE__*/React__default.createElement(Grid, {
4805
4835
  item: true,
4806
- xs: 6,
4807
- sm: 4,
4808
- md: 2,
4809
- container: true
4836
+ xs: 12,
4837
+ sm: 2,
4838
+ container: true,
4839
+ justifyContent: "center",
4840
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
4841
+ sx: function sx(theme) {
4842
+ return _defineProperty({}, theme.breakpoints.up('sm'), {
4843
+ justifyContent: 'right',
4844
+ button: {
4845
+ marginRight: 3
4846
+ },
4847
+ ' .statusTag': {
4848
+ marginRight: 3
4849
+ }
4850
+ });
4851
+ }
4810
4852
  }, product.status === 'DRAFT' ? /*#__PURE__*/React__default.createElement(Button, {
4811
- color: "secondary",
4812
- size: "small",
4813
- startIcon: /*#__PURE__*/React__default.createElement(Edit, {
4814
- color: "secondary"
4815
- })
4816
- }, "Draft") : getStatusTagList(product, cancelsSeqId), product.status === 'PUBLISHED' && cancelsSeqId === null && getActiveStatus(product)))));
4853
+ sx: {
4854
+ marginTop: '6px'
4855
+ },
4856
+ variant: "flat",
4857
+ startIcon: /*#__PURE__*/React__default.createElement(Edit, null)
4858
+ }, "DRAFT") : getStatusTagList(product, cancelsSeqId), product.status === 'PUBLISHED' && cancelsSeqId === null && getActiveStatus(product))));
4817
4859
  };
4818
4860
 
4819
4861
  /* *
@@ -4849,10 +4891,12 @@ var ProductList = function ProductList(_ref) {
4849
4891
  item: true,
4850
4892
  justifyContent: "flex-end"
4851
4893
  }, /*#__PURE__*/React__default.createElement(Button, {
4852
- variant: "contained",
4853
- color: "secondary",
4894
+ variant: "primary",
4854
4895
  "data-testid": "productListCreateButton",
4855
- onClick: onClickNewProduct
4896
+ onClick: onClickNewProduct,
4897
+ sx: {
4898
+ textTransform: 'initial'
4899
+ }
4856
4900
  }, "Create a new ", productType.toUpperCase())), /*#__PURE__*/React__default.createElement(Grid, {
4857
4901
  item: true,
4858
4902
  sx: {
@@ -4864,7 +4908,11 @@ var ProductList = function ProductList(_ref) {
4864
4908
  title: "An error has occurred while retrieving the list, please try again",
4865
4909
  info: error.message ? error.message : '',
4866
4910
  dataTestId: "productList-alert"
4867
- }), productList && /*#__PURE__*/React__default.createElement(List, null, productList.map(function (productListItem, index) {
4911
+ }), productList && /*#__PURE__*/React__default.createElement(List, {
4912
+ sx: {
4913
+ paddingTop: 4
4914
+ }
4915
+ }, productList.map(function (productListItem, index) {
4868
4916
  var product = productListItem[productType];
4869
4917
  return /*#__PURE__*/React__default.createElement(ListItem, {
4870
4918
  "data-testid": "productListItem",
@@ -5130,6 +5178,11 @@ var ProductFormDialogContent = function ProductFormDialogContent(_ref) {
5130
5178
  options: getProductFormLifecycleButtons(productCanBe, onProductButtonPress),
5131
5179
  style: {
5132
5180
  zIndex: 1000
5181
+ },
5182
+ sx: {
5183
+ ' .MuiDialogContent-root': {
5184
+ overflowY: 'hidden'
5185
+ }
5133
5186
  }
5134
5187
  }, productType === 'sigmet' ? /*#__PURE__*/React.createElement(SigmetForm, {
5135
5188
  mode: mode,