@opengeoweb/sigmet-airmet 6.1.1 → 7.0.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.
package/index.esm.js CHANGED
@@ -4,13 +4,13 @@ import { FormControlLabel, Radio, Grid, Typography, Box as Box$2, Button, Checkb
4
4
  import { useFormContext } from 'react-hook-form';
5
5
  import { useDraftFormHelpers, ReactHookFormRadioGroup, ReactHookFormSelect, ReactHookFormNumberField, isInteger, isValidMax, isValidMin, isEmpty, ReactHookFormDateTime, isValidDate, isBefore, isBetween, hasMaxFeaturePoints, hasMulitpleIntersections, ReactHookFormHiddenInput, isMaximumOneDrawing, hasIntersectionWithFIR, isValidGeoJsonCoordinates, isXHoursBefore, isAfter, isXHoursAfter, ReactHookFormTextField, isLatitude, isNonOrBothCoordinates, isLongitude, ReactHookFormFormControl, isGeometryDirty, ReactHookFormProvider, defaultFormOptions } from '@opengeoweb/form-fields';
6
6
  import { useApiContext, useApi, createApiInstance, createNonAuthApiInstance, createFakeApiInstance, ApiProvider } from '@opengeoweb/api';
7
- import { defaultIntersectionStyleProperties, defaultPoint, defaultBox, defaultPolygon, defaultDelete, MapControls, LayerManagerMapButtonConnect, LegendMapButtonConnect, MultiDimensionSelectMapButtonsConnect, MapViewConnect, TimeSliderConnect, LegendConnect, LayerManagerConnect, useMapDrawTool } from '@opengeoweb/core';
8
- import { defaultStyleProperties, DRAWMODE, addFeatureProperties, MapViewLayer } from '@opengeoweb/webmap-react';
9
- import { CustomTooltip, ToggleMenu, useIsMounted, StatusTag, AlertBanner, ConfirmationServiceProvider, usePreventBrowserClose, useConfirmationDialog, isAxiosError, getAxiosErrorMessage, usePoller, ErrorBoundary } from '@opengeoweb/shared';
10
- import moment from 'moment';
7
+ import { defaultIntersectionStyleProperties, defaultPoint, defaultBox, defaultPolygon, defaultDelete, LayerManagerMapButtonConnect, LegendMapButtonConnect, MultiDimensionSelectMapButtonsConnect, MapViewConnect, TimeSliderConnect, LegendConnect, LayerManagerConnect, useMapDrawTool } from '@opengeoweb/core';
8
+ import { defaultStyleProperties, DRAWMODE, addFeatureProperties, MapControls, MapViewLayer } from '@opengeoweb/webmap-react';
9
+ import { CustomTooltip, dateUtils, ToggleMenu, useIsMounted, StatusTag, AlertBanner, ConfirmationServiceProvider, usePreventBrowserClose, useConfirmationDialog, isAxiosError, getAxiosErrorMessage, usePoller, ErrorBoundary } from '@opengeoweb/shared';
11
10
  import { polygonToLineString, booleanClockwise, rewind } from '@turf/turf';
12
11
  import { DrawFIRLand, ChevronLeft, Edit, Success, Clock } from '@opengeoweb/theme';
13
12
  import { LayerType, webmapUtils } from '@opengeoweb/webmap';
13
+ import moment from 'moment';
14
14
  import { debounce } from 'lodash';
15
15
  import 'react-dom';
16
16
  import { mapSelectors, syncGroupsActions, mapStoreActions, defaultLayers, syncConstants } from '@opengeoweb/store';
@@ -1236,10 +1236,10 @@ var getConfirmationDialogCancelLabel = function getConfirmationDialogCancelLabel
1236
1236
  };
1237
1237
  var getProductIssueDate = function getProductIssueDate(initialProduct, initialCancelProduct) {
1238
1238
  if (initialProduct !== null && (initialProduct.status === 'PUBLISHED' || initialProduct.status === 'EXPIRED') && initialProduct.issueDate) {
1239
- return "".concat(moment.utc(initialProduct.issueDate).format('YYYY/MM/DD HH:mm'), " UTC");
1239
+ return "".concat(dateUtils.dateToString(dateUtils.utc(initialProduct.issueDate), 'yyyy/MM/dd HH:mm'), " UTC");
1240
1240
  }
1241
1241
  if (initialCancelProduct !== null && initialCancelProduct.issueDate) {
1242
- return "".concat(moment.utc(initialCancelProduct.issueDate).format('YYYY/MM/DD HH:mm'), " UTC");
1242
+ return "".concat(dateUtils.dateToString(dateUtils.utc(initialCancelProduct.issueDate), 'yyyy/MM/dd HH:mm'), " UTC");
1243
1243
  }
1244
1244
  return '(Not published)';
1245
1245
  };
@@ -2522,7 +2522,9 @@ var getValidFromXHoursBeforeMessage = function getValidFromXHoursBeforeMessage(h
2522
2522
  };
2523
2523
  var getDefaultValidFromValue = function getDefaultValidFromValue(productConfig) {
2524
2524
  var validFromDelayTimeMinutes = getValidFromDelayTimeMinutesFromConfig(productConfig);
2525
- return moment.utc().add(validFromDelayTimeMinutes, 'minutes').format('YYYY-MM-DDTHH:mm:ss[Z]');
2525
+ return dateUtils.dateToString(dateUtils.add(dateUtils.utc(), {
2526
+ minutes: validFromDelayTimeMinutes
2527
+ }));
2526
2528
  };
2527
2529
  var ValidFrom = function ValidFrom(_ref) {
2528
2530
  var productConfig = _ref.productConfig,
@@ -2549,11 +2551,11 @@ var ValidFrom = function ValidFrom(_ref) {
2549
2551
  isValidDate: isValidDate,
2550
2552
  // The validity start can not be before the current time
2551
2553
  isValueBeforeCurrentTime: function isValueBeforeCurrentTime(value) {
2552
- return isXHoursBefore(value, moment.utc().format(), 0) || VALID_FROM_ERROR_BEFORE_CURRENT;
2554
+ return isXHoursBefore(value, dateUtils.dateToString(dateUtils.utc()), 0) || VALID_FROM_ERROR_BEFORE_CURRENT;
2553
2555
  },
2554
2556
  // The current time can be no more than 4 hours before the validity start (12 for VA/TC SIGMET)
2555
2557
  isCurrentTimeXHoursBeforeValue: function isCurrentTimeXHoursBeforeValue(value) {
2556
- return isXHoursBefore(moment.utc().format(), value, getHoursBeforeValidity(getValues('phenomenon'), getValues('locationIndicatorATSR'), productConfig)) || getValidFromXHoursBeforeMessage(getHoursBeforeValidity(getValues('phenomenon'), getValues('locationIndicatorATSR'), productConfig));
2558
+ return isXHoursBefore(dateUtils.dateToString(dateUtils.utc()), value, getHoursBeforeValidity(getValues('phenomenon'), getValues('locationIndicatorATSR'), productConfig)) || getValidFromXHoursBeforeMessage(getHoursBeforeValidity(getValues('phenomenon'), getValues('locationIndicatorATSR'), productConfig));
2557
2559
  }
2558
2560
  }
2559
2561
  },
@@ -2586,7 +2588,9 @@ var ValidFrom = function ValidFrom(_ref) {
2586
2588
  var getDefaultValidUntilValue = function getDefaultValidUntilValue(productConfig) {
2587
2589
  var defaultValidityMinutes = getDefaultValidityMinutesFromConfig(productConfig);
2588
2590
  var validFromDelayTimeMinutes = getValidFromDelayTimeMinutesFromConfig(productConfig);
2589
- return moment.utc().add(defaultValidityMinutes, 'minutes').add(validFromDelayTimeMinutes, 'minutes').format('YYYY-MM-DDTHH:mm:ss[Z]');
2591
+ return dateUtils.dateToString(dateUtils.add(dateUtils.utc(), {
2592
+ minutes: defaultValidityMinutes + validFromDelayTimeMinutes
2593
+ }));
2590
2594
  };
2591
2595
  var ValidUntil = function ValidUntil(_ref) {
2592
2596
  var productConfig = _ref.productConfig,
@@ -3327,13 +3331,54 @@ var CloudLevels = function CloudLevels(_ref) {
3327
3331
  };
3328
3332
 
3329
3333
  var noTAC = 'Missing data: no TAC can be generated';
3334
+ var isLevelFieldsComplete = function isLevelFieldsComplete(product) {
3335
+ var _a, _b, _c, _d, _e, _f;
3336
+ switch (product.phenomenon) {
3337
+ // For certain AIRMETs no levels are provided
3338
+ case 'SFC_VIS':
3339
+ case 'SFC_WIND':
3340
+ return true;
3341
+ // For certain AIRMETs we have cloudlevels
3342
+ case 'OVC_CLD':
3343
+ case 'BKN_CLD':
3344
+ {
3345
+ if (!product.cloudLevelInfoMode) {
3346
+ return false;
3347
+ }
3348
+ var cloudLevelMode = product.cloudLevelInfoMode;
3349
+ var levelNeeded = cloudLevelMode === 'BETW_SFC_ABV' || cloudLevelMode === 'BETW_SFC';
3350
+ var levelAndLowerLevelNeeded = cloudLevelMode === 'BETW' || cloudLevelMode === 'BETW_ABV';
3351
+ if (levelAndLowerLevelNeeded && (!((_a = product.cloudLevel) === null || _a === void 0 ? void 0 : _a.value) || !((_b = product.cloudLowerLevel) === null || _b === void 0 ? void 0 : _b.value)) || levelNeeded && !((_c = product.cloudLevel) === null || _c === void 0 ? void 0 : _c.value)) {
3352
+ return false;
3353
+ }
3354
+ return true;
3355
+ }
3356
+ // Other AIRMETs and all SIGMETs
3357
+ default:
3358
+ {
3359
+ if (!product.levelInfoMode) {
3360
+ return false;
3361
+ }
3362
+ var levelMode = product.levelInfoMode;
3363
+ var _levelNeeded = levelMode === 'AT' || levelMode === 'ABV' || levelMode === 'TOPS' || levelMode === 'TOPS_ABV' || levelMode === 'BETW_SFC';
3364
+ var _levelAndLowerLevelNeeded = levelMode === 'BETW';
3365
+ if (_levelNeeded && !((_d = product.level) === null || _d === void 0 ? void 0 : _d.value) || _levelAndLowerLevelNeeded && (!((_e = product.level) === null || _e === void 0 ? void 0 : _e.value) || !((_f = product.lowerLevel) === null || _f === void 0 ? void 0 : _f.value))) {
3366
+ return false;
3367
+ }
3368
+ return true;
3369
+ }
3370
+ }
3371
+ };
3330
3372
  // Ensure we have enough data to retrieve a TAC
3331
3373
  var shouldRetrieveTAC = function shouldRetrieveTAC(product) {
3374
+ if (!product) {
3375
+ return false;
3376
+ }
3332
3377
  // always retrieve for a cancel product - this is always complete
3333
3378
  if (product && isInstanceOfCancelSigmetOrAirmet(product)) {
3334
3379
  return true;
3335
3380
  }
3336
- if (product && isInstanceOfSigmetOrAirmet(product) && product.phenomenon && product.phenomenon !== '' && product.isObservationOrForecast && product.isObservationOrForecast !== '' && product.validDateStart && product.validDateStart !== null && product.validDateEnd && product.validDateEnd !== null && product.startGeometry && product.startGeometry !== null && product.startGeometryIntersect && product.startGeometryIntersect !== null && product.movementType && product.movementType !== '' && product.change && product.change !== '') {
3381
+ if (product && isInstanceOfSigmetOrAirmet(product) && product.phenomenon && product.phenomenon !== '' && product.isObservationOrForecast && product.isObservationOrForecast !== '' && product.validDateStart && product.validDateStart !== null && product.validDateEnd && product.validDateEnd !== null && isLevelFieldsComplete(product) && product.startGeometry && product.startGeometry !== null && product.startGeometryIntersect && product.startGeometryIntersect !== null && product.movementType && product.movementType !== '' && product.change && product.change !== '') {
3337
3382
  return true;
3338
3383
  }
3339
3384
  return false;
@@ -14233,7 +14278,6 @@ var createApi$1 = function createApi(props) {
14233
14278
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
14234
14279
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
14235
14280
  * */
14236
- var dateFormatUTC$1 = 'YYYY-MM-DDTHH:mmZ';
14237
14281
  var fakeAirmetList = [{
14238
14282
  creationDate: '2020-09-17T12:00:00Z',
14239
14283
  canbe: ['DRAFTED', 'DISCARDED', 'PUBLISHED'],
@@ -14241,14 +14285,20 @@ var fakeAirmetList = [{
14241
14285
  uuid: 'someuniqueidprescibedbyBE',
14242
14286
  phenomenon: 'ISOL_TSGR',
14243
14287
  sequence: 'A01',
14244
- validDateStart: moment.utc().add(1, 'hour').format(dateFormatUTC$1),
14245
- validDateEnd: moment.utc().add(3, 'hours').format(dateFormatUTC$1),
14288
+ validDateStart: dateUtils.dateToString(dateUtils.add(dateUtils.utc(), {
14289
+ hours: 1
14290
+ })),
14291
+ validDateEnd: dateUtils.dateToString(dateUtils.add(dateUtils.utc(), {
14292
+ hours: 3
14293
+ })),
14246
14294
  firName: 'AMSTERDAM FIR',
14247
14295
  locationIndicatorATSU: 'EHAA',
14248
14296
  locationIndicatorATSR: 'EHAA',
14249
14297
  locationIndicatorMWO: 'EHDB',
14250
14298
  isObservationOrForecast: 'OBS',
14251
- observationOrForecastTime: moment.utc().subtract(2, 'hour').format(dateFormatUTC$1),
14299
+ observationOrForecastTime: dateUtils.dateToString(dateUtils.sub(dateUtils.utc(), {
14300
+ hours: 2
14301
+ })),
14252
14302
  movementType: 'STATIONARY',
14253
14303
  change: 'WKN',
14254
14304
  type: 'NORMAL',
@@ -14287,21 +14337,27 @@ var fakeAirmetList = [{
14287
14337
  }
14288
14338
  }
14289
14339
  }, {
14290
- creationDate: moment.utc().format(dateFormatUTC$1),
14340
+ creationDate: dateUtils.dateToString(dateUtils.utc()),
14291
14341
  canbe: ['CANCELLED'],
14292
14342
  airmet: {
14293
14343
  uuid: 'someuniqueidprescibedbyBE2',
14294
14344
  phenomenon: 'SFC_VIS',
14295
14345
  sequence: 'A01V',
14296
14346
  issueDate: '2020-09-17T12:00:00Z',
14297
- validDateStart: moment.utc().add(1, 'hour').format(dateFormatUTC$1),
14298
- validDateEnd: moment.utc().add(2, 'hours').format(dateFormatUTC$1),
14347
+ validDateStart: dateUtils.dateToString(dateUtils.add(dateUtils.utc(), {
14348
+ hours: 1
14349
+ })),
14350
+ validDateEnd: dateUtils.dateToString(dateUtils.add(dateUtils.utc(), {
14351
+ hours: 2
14352
+ })),
14299
14353
  firName: 'AMSTERDAM FIR',
14300
14354
  locationIndicatorATSU: 'EHAA',
14301
14355
  locationIndicatorATSR: 'EHAA',
14302
14356
  locationIndicatorMWO: 'EHDB',
14303
14357
  isObservationOrForecast: 'OBS',
14304
- observationOrForecastTime: moment.utc().add(1, 'hour').format(dateFormatUTC$1),
14358
+ observationOrForecastTime: dateUtils.dateToString(dateUtils.add(dateUtils.utc(), {
14359
+ hours: 1
14360
+ })),
14305
14361
  movementType: 'STATIONARY',
14306
14362
  change: 'WKN',
14307
14363
  type: 'NORMAL',
@@ -14338,21 +14394,23 @@ var fakeAirmetList = [{
14338
14394
  }
14339
14395
  }
14340
14396
  }, {
14341
- creationDate: moment.utc().format(dateFormatUTC$1),
14397
+ creationDate: dateUtils.dateToString(dateUtils.utc()),
14342
14398
  canbe: ['CANCELLED'],
14343
14399
  airmet: {
14344
14400
  uuid: 'someuniqueidprescibedbyBE3',
14345
14401
  phenomenon: 'ISOL_TS',
14346
14402
  sequence: 'A02V30',
14347
- issueDate: moment.utc().format(dateFormatUTC$1),
14348
- validDateStart: moment.utc().format(dateFormatUTC$1),
14349
- validDateEnd: moment.utc().add(1, 'hour').format(dateFormatUTC$1),
14403
+ issueDate: dateUtils.dateToString(dateUtils.utc()),
14404
+ validDateStart: dateUtils.dateToString(dateUtils.utc()),
14405
+ validDateEnd: dateUtils.dateToString(dateUtils.add(dateUtils.utc(), {
14406
+ hours: 1
14407
+ })),
14350
14408
  firName: 'AMSTERDAM FIR',
14351
14409
  locationIndicatorATSU: 'EHAA',
14352
14410
  locationIndicatorATSR: 'EHAA',
14353
14411
  locationIndicatorMWO: 'EHDB',
14354
14412
  isObservationOrForecast: 'OBS',
14355
- observationOrForecastTime: moment.utc().format(dateFormatUTC$1),
14413
+ observationOrForecastTime: dateUtils.dateToString(dateUtils.utc()),
14356
14414
  movementType: 'STATIONARY',
14357
14415
  change: 'WKN',
14358
14416
  type: 'NORMAL',
@@ -14638,14 +14696,20 @@ var fakeAirmetList = [{
14638
14696
  uuid: 'someuniqueidprescibedbyBE',
14639
14697
  phenomenon: 'MOD_ICE',
14640
14698
  sequence: 'A01',
14641
- validDateStart: moment.utc().add(1, 'hour').format(dateFormatUTC$1),
14642
- validDateEnd: moment.utc().add(3, 'hours').format(dateFormatUTC$1),
14699
+ validDateStart: dateUtils.dateToString(dateUtils.add(dateUtils.utc(), {
14700
+ hours: 1
14701
+ })),
14702
+ validDateEnd: dateUtils.dateToString(dateUtils.add(dateUtils.utc(), {
14703
+ hours: 3
14704
+ })),
14643
14705
  firName: 'AMSTERDAM FIR',
14644
14706
  locationIndicatorATSU: 'EHAA',
14645
14707
  locationIndicatorATSR: 'EHAA',
14646
14708
  locationIndicatorMWO: 'EHDB',
14647
14709
  isObservationOrForecast: 'OBS',
14648
- observationOrForecastTime: moment.utc().subtract(2, 'hour').format(dateFormatUTC$1),
14710
+ observationOrForecastTime: dateUtils.dateToString(dateUtils.sub(dateUtils.utc(), {
14711
+ hours: 2
14712
+ })),
14649
14713
  movementType: 'STATIONARY',
14650
14714
  change: 'WKN',
14651
14715
  type: 'NORMAL',
@@ -14686,16 +14750,22 @@ var fakeAirmetList = [{
14686
14750
  ({
14687
14751
  uuid: 'someuniqueidprescibedbyBE02',
14688
14752
  phenomenon: 'ISOL_TCU',
14689
- issueDate: moment.utc().format(dateFormatUTC$1),
14753
+ issueDate: dateUtils.dateToString(dateUtils.utc()),
14690
14754
  sequence: 'A02',
14691
- validDateStart: moment.utc().add(1, 'hour').format(dateFormatUTC$1),
14692
- validDateEnd: moment.utc().add(3, 'hours').format(dateFormatUTC$1),
14755
+ validDateStart: dateUtils.dateToString(dateUtils.add(dateUtils.utc(), {
14756
+ hours: 1
14757
+ })),
14758
+ validDateEnd: dateUtils.dateToString(dateUtils.add(dateUtils.utc(), {
14759
+ hours: 3
14760
+ })),
14693
14761
  firName: 'AMSTERDAM FIR',
14694
14762
  locationIndicatorATSU: 'EHAA',
14695
14763
  locationIndicatorATSR: 'EHAA',
14696
14764
  locationIndicatorMWO: 'EHDB',
14697
14765
  isObservationOrForecast: 'OBS',
14698
- observationOrForecastTime: moment.utc().subtract(2, 'hour').format(dateFormatUTC$1),
14766
+ observationOrForecastTime: dateUtils.dateToString(dateUtils.sub(dateUtils.utc(), {
14767
+ hours: 2
14768
+ })),
14699
14769
  movementType: 'STATIONARY',
14700
14770
  change: 'WKN',
14701
14771
  type: 'NORMAL',
@@ -14788,10 +14858,14 @@ var fakeAirmetList = [{
14788
14858
  uuid: 'someuniqueidprescibedbyBE',
14789
14859
  phenomenon: 'BKN_CLD',
14790
14860
  sequence: 'A02V',
14791
- issueDate: moment.utc().format(dateFormatUTC$1),
14861
+ issueDate: dateUtils.dateToString(dateUtils.utc()),
14792
14862
  observationOrForecastTime: null,
14793
- validDateStart: moment.utc().add(1, 'hour').format(dateFormatUTC$1),
14794
- validDateEnd: moment.utc().add(3, 'hours').format(dateFormatUTC$1),
14863
+ validDateStart: dateUtils.dateToString(dateUtils.add(dateUtils.utc(), {
14864
+ hours: 1
14865
+ })),
14866
+ validDateEnd: dateUtils.dateToString(dateUtils.add(dateUtils.utc(), {
14867
+ hours: 3
14868
+ })),
14795
14869
  firName: 'AMSTERDAM FIR',
14796
14870
  locationIndicatorATSU: 'EHAA',
14797
14871
  locationIndicatorATSR: 'EHAA',
@@ -14849,14 +14923,20 @@ var fakeAirmetList = [{
14849
14923
  uuid: 'someuniqueidprescribedbyBE',
14850
14924
  phenomenon: 'ISOL_TSGR',
14851
14925
  sequence: 'A01',
14852
- validDateStart: moment.utc().add(1, 'hour').format(dateFormatUTC$1),
14853
- validDateEnd: moment.utc().add(3, 'hours').format(dateFormatUTC$1),
14926
+ validDateStart: dateUtils.dateToString(dateUtils.add(dateUtils.utc(), {
14927
+ hours: 1
14928
+ })),
14929
+ validDateEnd: dateUtils.dateToString(dateUtils.add(dateUtils.utc(), {
14930
+ hours: 3
14931
+ })),
14854
14932
  firName: 'AMSTERDAM FIR',
14855
14933
  locationIndicatorATSU: 'EHAA',
14856
14934
  locationIndicatorATSR: 'EHAA',
14857
14935
  locationIndicatorMWO: 'EHDB',
14858
14936
  isObservationOrForecast: 'OBS',
14859
- observationOrForecastTime: moment.utc().subtract(2, 'hour').format(dateFormatUTC$1),
14937
+ observationOrForecastTime: dateUtils.dateToString(dateUtils.sub(dateUtils.utc(), {
14938
+ hours: 2
14939
+ })),
14860
14940
  movementType: 'STATIONARY',
14861
14941
  change: 'WKN',
14862
14942
  type: 'NORMAL',
@@ -15199,7 +15279,6 @@ var fakeAirmetList = [{
15199
15279
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
15200
15280
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
15201
15281
  * */
15202
- var dateFormatUTC = 'YYYY-MM-DDTHH:mmZ';
15203
15282
  // TODO: [Loes Cornelis] Replace with correct strucutre and in JSON format - not js object
15204
15283
  var fakeSigmetList = [{
15205
15284
  creationDate: '2020-09-17T12:00:00Z',
@@ -15208,14 +15287,20 @@ var fakeSigmetList = [{
15208
15287
  uuid: 'someuniqueidprescibedbyBE',
15209
15288
  phenomenon: 'OBSC_TS',
15210
15289
  sequence: 'A01',
15211
- validDateStart: moment.utc().add(1, 'hour').format(dateFormatUTC),
15212
- validDateEnd: moment.utc().add(3, 'hours').format(dateFormatUTC),
15290
+ validDateStart: dateUtils.dateToString(dateUtils.add(dateUtils.utc(), {
15291
+ hours: 1
15292
+ })),
15293
+ validDateEnd: dateUtils.dateToString(dateUtils.add(dateUtils.utc(), {
15294
+ hours: 3
15295
+ })),
15213
15296
  firName: 'AMSTERDAM FIR',
15214
15297
  locationIndicatorATSU: 'EHAA',
15215
15298
  locationIndicatorATSR: 'EHAA',
15216
15299
  locationIndicatorMWO: 'EHDB',
15217
15300
  isObservationOrForecast: 'OBS',
15218
- observationOrForecastTime: moment.utc().subtract(2, 'hour').format(dateFormatUTC),
15301
+ observationOrForecastTime: dateUtils.dateToString(dateUtils.sub(dateUtils.utc(), {
15302
+ hours: 2
15303
+ })),
15219
15304
  movementType: 'FORECAST_POSITION',
15220
15305
  change: 'WKN',
15221
15306
  type: 'NORMAL',
@@ -15280,21 +15365,27 @@ var fakeSigmetList = [{
15280
15365
  }
15281
15366
  }
15282
15367
  }, {
15283
- creationDate: moment.utc().format(dateFormatUTC),
15368
+ creationDate: dateUtils.dateToString(dateUtils.utc()),
15284
15369
  canbe: ['CANCELLED'],
15285
15370
  sigmet: {
15286
15371
  uuid: 'someuniqueidprescibedbyBE2',
15287
15372
  phenomenon: 'VA_CLD',
15288
15373
  sequence: 'A01V',
15289
15374
  issueDate: '2020-09-17T12:00:00Z',
15290
- validDateStart: moment.utc().add(1, 'hour').format(dateFormatUTC),
15291
- validDateEnd: moment.utc().add(2, 'hours').format(dateFormatUTC),
15375
+ validDateStart: dateUtils.dateToString(dateUtils.add(dateUtils.utc(), {
15376
+ hours: 1
15377
+ })),
15378
+ validDateEnd: dateUtils.dateToString(dateUtils.add(dateUtils.utc(), {
15379
+ hours: 2
15380
+ })),
15292
15381
  firName: 'AMSTERDAM FIR',
15293
15382
  locationIndicatorATSU: 'EHAA',
15294
15383
  locationIndicatorATSR: 'EHAA',
15295
15384
  locationIndicatorMWO: 'EHDB',
15296
15385
  isObservationOrForecast: 'OBS',
15297
- observationOrForecastTime: moment.utc().add(1, 'hour').format(dateFormatUTC),
15386
+ observationOrForecastTime: dateUtils.dateToString(dateUtils.add(dateUtils.utc(), {
15387
+ hours: 1
15388
+ })),
15298
15389
  movementType: 'STATIONARY',
15299
15390
  change: 'WKN',
15300
15391
  type: 'NORMAL',
@@ -15342,21 +15433,23 @@ var fakeSigmetList = [{
15342
15433
  }
15343
15434
  }
15344
15435
  }, {
15345
- creationDate: moment.utc().format(dateFormatUTC),
15436
+ creationDate: dateUtils.dateToString(dateUtils.utc()),
15346
15437
  canbe: ['CANCELLED'],
15347
15438
  sigmet: {
15348
15439
  uuid: 'someuniqueidprescibedbyBE3',
15349
15440
  phenomenon: 'VA_CLD',
15350
15441
  sequence: 'A02V',
15351
- issueDate: moment.utc().format(dateFormatUTC),
15352
- validDateStart: moment.utc().subtract(1, 'hour').format(dateFormatUTC),
15353
- validDateEnd: moment.utc().add(1, 'hour').format(dateFormatUTC),
15442
+ issueDate: dateUtils.dateToString(dateUtils.utc()),
15443
+ validDateStart: dateUtils.dateToString(dateUtils.utc()),
15444
+ validDateEnd: dateUtils.dateToString(dateUtils.add(dateUtils.utc(), {
15445
+ hours: 1
15446
+ })),
15354
15447
  firName: 'AMSTERDAM FIR',
15355
15448
  locationIndicatorATSU: 'EHAA',
15356
15449
  locationIndicatorATSR: 'EHAA',
15357
15450
  locationIndicatorMWO: 'EHDB',
15358
15451
  isObservationOrForecast: 'OBS',
15359
- observationOrForecastTime: moment.utc().format(dateFormatUTC),
15452
+ observationOrForecastTime: dateUtils.dateToString(dateUtils.utc()),
15360
15453
  movementType: 'NO_VA_EXP',
15361
15454
  change: 'WKN',
15362
15455
  type: 'NORMAL',
@@ -15704,14 +15797,20 @@ var fakeSigmetList = [{
15704
15797
  uuid: '41d4dd4f-82bb-4944-a8f5-f9635086156b',
15705
15798
  phenomenon: 'OBSC_TS',
15706
15799
  sequence: 'A05',
15707
- validDateStart: moment.utc().add(1, 'hour').format(dateFormatUTC),
15708
- validDateEnd: moment.utc().add(2, 'hours').format(dateFormatUTC),
15800
+ validDateStart: dateUtils.dateToString(dateUtils.add(dateUtils.utc(), {
15801
+ hours: 1
15802
+ })),
15803
+ validDateEnd: dateUtils.dateToString(dateUtils.add(dateUtils.utc(), {
15804
+ hours: 2
15805
+ })),
15709
15806
  firName: 'AMSTERDAM FIR',
15710
15807
  locationIndicatorATSU: 'EHAA',
15711
15808
  locationIndicatorATSR: 'EHAA',
15712
15809
  locationIndicatorMWO: 'EHDB',
15713
15810
  isObservationOrForecast: 'OBS',
15714
- observationOrForecastTime: moment.utc().add(-1, 'hour').format(dateFormatUTC),
15811
+ observationOrForecastTime: dateUtils.dateToString(dateUtils.sub(dateUtils.utc(), {
15812
+ hours: 1
15813
+ })),
15715
15814
  movementType: 'FORECAST_POSITION',
15716
15815
  change: '',
15717
15816
  type: 'NORMAL',
@@ -15776,21 +15875,27 @@ var fakeSigmetList = [{
15776
15875
  }
15777
15876
  }
15778
15877
  }, {
15779
- creationDate: moment.utc().format(dateFormatUTC),
15878
+ creationDate: dateUtils.dateToString(dateUtils.utc()),
15780
15879
  canbe: ['CANCELLED'],
15781
15880
  sigmet: {
15782
15881
  uuid: 'someuniqueidprescibedbyPET',
15783
15882
  phenomenon: 'EMBD_TS',
15784
15883
  sequence: '10',
15785
15884
  issueDate: '2020-09-17T12:00:00Z',
15786
- validDateStart: moment.utc().add(1, 'hour').format(dateFormatUTC),
15787
- validDateEnd: moment.utc().add(2, 'hours').format(dateFormatUTC),
15885
+ validDateStart: dateUtils.dateToString(dateUtils.add(dateUtils.utc(), {
15886
+ hours: 1
15887
+ })),
15888
+ validDateEnd: dateUtils.dateToString(dateUtils.add(dateUtils.utc(), {
15889
+ hours: 2
15890
+ })),
15788
15891
  firName: 'AMSTERDAM FIR',
15789
15892
  locationIndicatorATSU: 'EHAA',
15790
15893
  locationIndicatorATSR: 'EHAA',
15791
15894
  locationIndicatorMWO: 'EHDB',
15792
15895
  isObservationOrForecast: 'OBS',
15793
- observationOrForecastTime: moment.utc().add(1, 'hour').format(dateFormatUTC),
15896
+ observationOrForecastTime: dateUtils.dateToString(dateUtils.add(dateUtils.utc(), {
15897
+ hours: 1
15898
+ })),
15794
15899
  movementType: 'STATIONARY',
15795
15900
  change: 'WKN',
15796
15901
  type: 'NORMAL',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/sigmet-airmet",
3
- "version": "6.1.1",
3
+ "version": "7.0.0",
4
4
  "description": "GeoWeb Sigmet/Airmet library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -13,15 +13,15 @@
13
13
  "dependencies": {
14
14
  "@mui/material": "5.12.0",
15
15
  "@mui/system": "5.14.8",
16
- "@opengeoweb/api": "6.1.1",
17
- "@opengeoweb/authentication": "6.1.1",
18
- "@opengeoweb/core": "6.1.1",
19
- "@opengeoweb/form-fields": "6.1.1",
20
- "@opengeoweb/shared": "6.1.1",
21
- "@opengeoweb/store": "6.1.1",
22
- "@opengeoweb/theme": "6.1.1",
23
- "@opengeoweb/webmap": "6.1.1",
24
- "@opengeoweb/webmap-react": "6.1.1",
16
+ "@opengeoweb/api": "7.0.0",
17
+ "@opengeoweb/authentication": "7.0.0",
18
+ "@opengeoweb/core": "7.0.0",
19
+ "@opengeoweb/form-fields": "7.0.0",
20
+ "@opengeoweb/shared": "7.0.0",
21
+ "@opengeoweb/store": "7.0.0",
22
+ "@opengeoweb/theme": "7.0.0",
23
+ "@opengeoweb/webmap": "7.0.0",
24
+ "@opengeoweb/webmap-react": "7.0.0",
25
25
  "@redux-eggs/redux-toolkit": "2.2.0",
26
26
  "@redux-eggs/saga-extension": "2.2.0",
27
27
  "@reduxjs/toolkit": "1.9.5",
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { CancelSigmet, Sigmet, Airmet, CancelAirmet } from '../../types';
3
3
  type AviationProduct = Sigmet | CancelSigmet | Airmet | CancelAirmet;
4
4
  export declare const noTAC = "Missing data: no TAC can be generated";
5
+ export declare const isLevelFieldsComplete: (product: Sigmet | Airmet) => boolean;
5
6
  export declare const shouldRetrieveTAC: (product: AviationProduct) => boolean;
6
7
  export declare const useTAC: (initialProduct: AviationProduct, getTAC: (product: AviationProduct) => Promise<{
7
8
  data: string;