@opengeoweb/sigmet-airmet 9.25.3 → 9.26.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
@@ -8,7 +8,7 @@ import { useApiContext, useApi, createApiInstance, createNonAuthApiInstance, cre
8
8
  import { defaultGeoJSONStyleProperties, defaultIntersectionStyleProperties, defaultPoint, addGeoJSONProperties, defaultBox, defaultPolygon, DRAWMODE, addSelectionTypeToGeoJSON, defaultDelete, getIcon, MapControls, MapViewLayer, useMapDrawTool, addFeatureProperties, rewindGeometry } from '@opengeoweb/webmap-react';
9
9
  import i18n from 'i18next';
10
10
  import { useTranslation } from 'react-i18next';
11
- import { dateUtils, ToggleMenu, CustomTooltip, useIsMounted, StatusTag, AlertBanner, ConfirmationServiceProvider, usePreventBrowserClose, useConfirmationDialog, isAxiosError, getAxiosErrorMessage, usePoller, ErrorBoundary } from '@opengeoweb/shared';
11
+ import { PROJECTION, dateUtils, ToggleMenu, CustomTooltip, useIsMounted, StatusTag, AlertBanner, ConfirmationServiceProvider, usePreventBrowserClose, useConfirmationDialog, isAxiosError, getAxiosErrorMessage, usePoller, ErrorBoundary } from '@opengeoweb/shared';
12
12
  import { LayerManagerMapButtonConnect, LegendMapButtonConnect, MultiDimensionSelectMapButtonsConnect, MapViewConnect, TimeSliderConnect, LegendConnect, LayerManagerConnect } from '@opengeoweb/core';
13
13
  import { DrawFIRLand, ChevronLeft, Edit, Success, Clock } from '@opengeoweb/theme';
14
14
  import { LayerType, webmapUtils } from '@opengeoweb/webmap';
@@ -2890,7 +2890,7 @@ const srsAndBboxDefault = {
2890
2890
  top: 11688874,
2891
2891
  bottom: 5930186
2892
2892
  },
2893
- srs: 'EPSG:3857'
2893
+ srs: PROJECTION.EPSG_3857.value
2894
2894
  };
2895
2895
  const featurePropsStart = defaultGeoJSONStyleProperties;
2896
2896
  const featurePropsEnd = {
@@ -4329,7 +4329,7 @@ const Progress = ({
4329
4329
  const intersectingPolygonPointsTotal = interceptionGeometry && interceptionGeometry.coordinates[0] ? interceptionGeometry.coordinates[0].length : 0;
4330
4330
  const showMaxFeaturePointsWarning = intersectionPointCount > 7 && hasMaxFeaturePoints(geoJSONIntersection, maxPoints) && !activeTool && !errors.startGeometry && !isFir(geoJSON);
4331
4331
  const showMoreThan6PointsWarning = totalDrawnPoints > 7 && intersectionPointCount < 1 && !activeTool && !errors.startGeometry && !isFir(geoJSON);
4332
- const showIntersectionAbove6PointsWarning = intersectingPolygonPointsTotal > 7 && intersectionPointCount > 6 && maxPoints > 7 && !activeTool && !errors.startGeometry && !isFir(geoJSON);
4332
+ const showIntersectionAbove6PointsWarning = intersectingPolygonPointsTotal > 7 && intersectionPointCount > 1 && maxPoints > 7 && !activeTool && !errors.startGeometry && !isFir(geoJSON);
4333
4333
  return jsx(ProductFormFieldLayout, Object.assign({
4334
4334
  title: t('progress'),
4335
4335
  sx: styles$2.containerItem
@@ -4686,7 +4686,7 @@ const StartGeometry = ({
4686
4686
  const intersectingPolygonPointsTotal = interceptionGeometry && interceptionGeometry.coordinates[0] ? interceptionGeometry.coordinates[0].length : 0;
4687
4687
  const showMaxFeaturePointsWarning = intersectionPointCount > 7 && hasMaxFeaturePoints(geoJSONIntersection, maxPoints) && !activeTool && !errors.startGeometry && !isFir(geoJSON);
4688
4688
  const showMoreThan6PointsWarning = totalDrawnPoints > 7 && intersectionPointCount < 1 && !activeTool && !errors.startGeometry && !isFir(geoJSON);
4689
- const showIntersectionAbove6PointsWarning = intersectingPolygonPointsTotal > 7 && intersectionPointCount > 6 && maxPoints > 7 && !activeTool && !errors.startGeometry && !isFir(geoJSON);
4689
+ const showIntersectionAbove6PointsWarning = intersectingPolygonPointsTotal > 7 && intersectionPointCount > 1 && maxPoints > 7 && !activeTool && !errors.startGeometry && !isFir(geoJSON);
4690
4690
  return !_isReadOnly ? jsxs(ProductFormFieldLayout, Object.assign({
4691
4691
  title: t('start-position'),
4692
4692
  sx: styles$2.drawSection,
@@ -5702,11 +5702,28 @@ const useTAC = (initialProduct, getTAC, hasErrors = () => false, omitChange) =>
5702
5702
  };
5703
5703
  return [TAC, delayedQuery];
5704
5704
  };
5705
+ const getSequenceStyling = (product, hasTac = false) => {
5706
+ if (hasTac && !product || product && product.status === 'DRAFT') {
5707
+ return {
5708
+ fontWeight: 'lighter',
5709
+ color: 'geowebColors.typographyAndIcons.inactiveText'
5710
+ };
5711
+ }
5712
+ return {};
5713
+ };
5705
5714
  const ProductFormTAC = ({
5706
- tac
5715
+ tac,
5716
+ product
5707
5717
  }) => {
5718
+ var _a;
5719
+ const {
5720
+ t
5721
+ } = useSigmetAirmetTranslation();
5722
+ const noTAC = t('tac-missing-data');
5708
5723
  const tacLines = tac.split('\n');
5709
- const hasTac = tacLines.length && tacLines.toString() !== noTAC;
5724
+ const hasTac = tacLines.length > 0 && tac !== noTAC;
5725
+ const sequenceNumberInTac = hasTac ? (_a = tacLines[0].split(' ')[2]) !== null && _a !== void 0 ? _a : null : null;
5726
+ const sequenceStyle = getSequenceStyling(product, hasTac);
5710
5727
  return jsx(Typography, Object.assign({
5711
5728
  variant: "body2",
5712
5729
  component: "div",
@@ -5716,21 +5733,24 @@ const ProductFormTAC = ({
5716
5733
  },
5717
5734
  "data-testid": "productform-tac-message"
5718
5735
  }, {
5719
- children: tacLines.map(line => jsx(Box, Object.assign({
5736
+ children: jsx(Box, Object.assign({
5720
5737
  component: "p",
5721
5738
  sx: {
5722
5739
  margin: 0,
5723
- fontSize: hasTac ? '1.125rem' : '1rem',
5740
+ fontSize: '1.125rem',
5724
5741
  fontWeight: 'normal',
5725
- fontStretch: 'normal',
5726
- fontStyle: 'normal',
5727
5742
  lineHeight: 1.56,
5728
5743
  letterSpacing: '0.5px'
5729
5744
  },
5730
5745
  "data-testid": "productform-tac-message-line"
5731
5746
  }, {
5732
- children: line
5733
- }), line))
5747
+ children: tac.split(' ').map((word, index) => jsx(Box, Object.assign({
5748
+ component: "span",
5749
+ sx: hasTac && word === sequenceNumberInTac ? sequenceStyle : {}
5750
+ }, {
5751
+ children: word + (index < tac.split(' ').length - 1 ? ' ' : '')
5752
+ }), index))
5753
+ }))
5734
5754
  }));
5735
5755
  };
5736
5756
 
@@ -5769,7 +5789,8 @@ const IssuedAt = ({
5769
5789
 
5770
5790
  const Tac = ({
5771
5791
  tac,
5772
- children
5792
+ children,
5793
+ product
5773
5794
  }) => {
5774
5795
  return jsx(ProductFormFieldLayout, Object.assign({
5775
5796
  title: "TAC",
@@ -5782,7 +5803,8 @@ const Tac = ({
5782
5803
  xs: 12
5783
5804
  }, {
5784
5805
  children: [jsx(ProductFormTAC, {
5785
- tac: tac
5806
+ tac: tac,
5807
+ product: product
5786
5808
  }), children]
5787
5809
  }))
5788
5810
  }));
@@ -10002,7 +10024,8 @@ const SigmetForm = ({
10002
10024
  initialCancelSigmet: _initialCancelSigmet = null,
10003
10025
  showMap: _showMap = true,
10004
10026
  productConfig: _productConfig = sigmetConfig,
10005
- setDialogActionsDisabled
10027
+ setDialogActionsDisabled,
10028
+ product
10006
10029
  }) => {
10007
10030
  const {
10008
10031
  t
@@ -10251,7 +10274,8 @@ const SigmetForm = ({
10251
10274
  date: getProductIssueDate(_initialSigmet, _initialCancelSigmet),
10252
10275
  isReadOnly: isReadOnly
10253
10276
  }), jsxs(Tac, Object.assign({
10254
- tac: tac
10277
+ tac: tac,
10278
+ product: product
10255
10279
  }, {
10256
10280
  children: [jsx(ReactHookFormHiddenInput, {
10257
10281
  name: "sequence",
@@ -10334,7 +10358,8 @@ const AirmetForm = ({
10334
10358
  initialAirmet: _initialAirmet = null,
10335
10359
  initialCancelAirmet: _initialCancelAirmet = null,
10336
10360
  showMap: _showMap = true,
10337
- productConfig: _productConfig = airmetConfig
10361
+ productConfig: _productConfig = airmetConfig,
10362
+ product
10338
10363
  }) => {
10339
10364
  const {
10340
10365
  api
@@ -10524,7 +10549,8 @@ const AirmetForm = ({
10524
10549
  isReadOnly: isReadOnly,
10525
10550
  date: getProductIssueDate(_initialAirmet, _initialCancelAirmet)
10526
10551
  }), jsxs(Tac, Object.assign({
10527
- tac: tac
10552
+ tac: tac,
10553
+ product: product
10528
10554
  }, {
10529
10555
  children: [jsx(ReactHookFormHiddenInput, {
10530
10556
  name: "sequence",
@@ -11306,13 +11332,15 @@ const ProductFormDialogContent = ({
11306
11332
  initialSigmet: product !== null && !isInstanceOfCancelSigmet(product) ? product : null,
11307
11333
  initialCancelSigmet: product !== null && isInstanceOfCancelSigmet(product) ? product : null,
11308
11334
  productConfig: productConfig,
11309
- setDialogActionsDisabled: setDialogActionsDisabled
11335
+ setDialogActionsDisabled: setDialogActionsDisabled,
11336
+ product: product
11310
11337
  }) : jsx(AirmetForm, {
11311
11338
  mode: mode,
11312
11339
  isCancelAirmet: product !== null && isInstanceOfCancelAirmet(product),
11313
11340
  initialAirmet: product !== null && !isInstanceOfCancelAirmet(product) ? product : null,
11314
11341
  initialCancelAirmet: product !== null && isInstanceOfCancelAirmet(product) ? product : null,
11315
- productConfig: productConfig
11342
+ productConfig: productConfig,
11343
+ product: product
11316
11344
  }), jsx(DraftFieldHelper, {}), jsx(Backdrop, Object.assign({
11317
11345
  "data-testid": "loader",
11318
11346
  open: showLoader,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/sigmet-airmet",
3
- "version": "9.25.3",
3
+ "version": "9.26.0",
4
4
  "description": "GeoWeb Sigmet/Airmet library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -5,7 +5,7 @@ export declare const srsAndBboxDefault: {
5
5
  top: number;
6
6
  bottom: number;
7
7
  };
8
- srs: string;
8
+ srs: "EPSG:3857";
9
9
  };
10
10
  export declare const simplePolygonGeoJSON: GeoJSON.FeatureCollection;
11
11
  export declare const simplePolygonGeoJSONHalfOfNL: GeoJSON.FeatureCollection;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { FormMode, Airmet, CancelAirmet, ProductConfig } from '../../../types';
2
+ import { FormMode, Airmet, CancelAirmet, ProductConfig, AviationProduct } from '../../../types';
3
3
  export interface AirmetFormProps {
4
4
  mode: FormMode;
5
5
  isCancelAirmet?: boolean;
@@ -7,6 +7,7 @@ export interface AirmetFormProps {
7
7
  initialCancelAirmet?: CancelAirmet;
8
8
  showMap?: boolean;
9
9
  productConfig?: ProductConfig;
10
+ product?: AviationProduct;
10
11
  }
11
12
  declare const AirmetForm: React.FC<AirmetFormProps>;
12
13
  export default AirmetForm;
@@ -1,7 +1,9 @@
1
1
  import React from 'react';
2
+ import { AviationProduct } from '../../../types';
2
3
  interface TacProps {
3
4
  tac: string;
4
5
  children: React.ReactNode;
6
+ product?: AviationProduct;
5
7
  }
6
8
  declare const Tac: React.FC<TacProps>;
7
9
  export default Tac;
@@ -11,6 +11,14 @@ export declare const useTAC: (initialProduct: AviationProduct, getTAC: (product:
11
11
  }>, hasErrors?: () => boolean, omitChange?: boolean) => [string, any];
12
12
  interface ProductFormTACProps {
13
13
  tac: string;
14
+ product?: AviationProduct;
14
15
  }
16
+ export declare const getSequenceStyling: (product?: ProductFormTACProps['product'], hasTac?: boolean) => {
17
+ fontWeight: string;
18
+ color: string;
19
+ } | {
20
+ fontWeight?: undefined;
21
+ color?: undefined;
22
+ };
15
23
  declare const ProductFormTAC: React.FC<ProductFormTACProps>;
16
24
  export default ProductFormTAC;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { CancelSigmet, Sigmet, FormMode, ProductConfig } from '../../../types';
2
+ import { CancelSigmet, Sigmet, FormMode, ProductConfig, AviationProduct } from '../../../types';
3
3
  export interface SigmetFormProps {
4
4
  mode: FormMode;
5
5
  isCancelSigmet?: boolean;
@@ -8,6 +8,7 @@ export interface SigmetFormProps {
8
8
  showMap?: boolean;
9
9
  productConfig?: ProductConfig;
10
10
  setDialogActionsDisabled?: (disabled: boolean) => void;
11
+ product?: AviationProduct;
11
12
  }
12
13
  declare const SigmetForm: React.FC<SigmetFormProps>;
13
14
  export default SigmetForm;