@opengeoweb/sigmet-airmet 12.0.0 → 12.1.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 +138 -133
- package/package.json +21 -35
- package/src/lib/components/ProductForms/ProductFormFields/Levels.d.ts +6 -6
- package/src/lib/components/ProductForms/ProductFormFields/Progress.d.ts +4 -3
- package/src/lib/components/ProductForms/ProductFormFields/SurfaceVisibility.d.ts +4 -3
- package/src/lib/components/ProductForms/ProductFormFields/SurfaceWind.d.ts +3 -2
- package/src/lib/components/ProductForms/ProductFormFields/ValidFrom.d.ts +2 -1
- package/src/lib/components/ProductForms/ProductFormTac.d.ts +3 -2
- package/src/lib/components/ProductForms/utils.d.ts +10 -9
package/index.esm.js
CHANGED
|
@@ -7,7 +7,7 @@ import { FORM_FIELDS_NAMESPACE, formFieldsTranslations, useDraftFormHelpers, Rea
|
|
|
7
7
|
import { useApiContext, useApi, createApiInstance, createFakeApiInstance, ApiProvider } from '@opengeoweb/api';
|
|
8
8
|
import { defaultGeoJSONStyleProperties, defaultIntersectionStyleProperties, addSelectionTypeToGeoJSON, defaultPoint, addGeoJSONProperties, defaultBox, defaultPolygon, DRAWMODE, defaultDelete, getIcon, OpenLayersFeatureLayer, genericOpenLayersFeatureStyle, OpenLayersMapDraw, useMapDrawTool, addFeatureProperties, rewindGeometry } from '@opengeoweb/webmap-react';
|
|
9
9
|
import i18n from 'i18next';
|
|
10
|
-
import {
|
|
10
|
+
import { useTranslation, initReactI18next } from 'react-i18next';
|
|
11
11
|
import { SHARED_NAMESPACE, sharedTranslations, PROJECTION, ToggleMenu, useIsMounted, dateUtils, CustomTooltip, ConfirmationServiceProvider, usePreventBrowserClose, useConfirmationDialog, AlertBanner, isAxiosError, getAxiosErrorMessage, StatusTag, usePoller, ErrorBoundary } from '@opengeoweb/shared';
|
|
12
12
|
import { CORE_NAMESPACE, coreTranslations, LegendConnect, OlMapViewConnect, TimeSliderConnect } from '@opengeoweb/core';
|
|
13
13
|
import { useSelector, useDispatch, shallowEqual } from 'react-redux';
|
|
@@ -234,7 +234,7 @@ var fi = {
|
|
|
234
234
|
"volcano-name": "Tulivuoren nimi",
|
|
235
235
|
latitude: "Leveysaste",
|
|
236
236
|
longitude: "Pituusaste",
|
|
237
|
-
"tac-missing-data": "Tarvittavia tietoja
|
|
237
|
+
"tac-missing-data": "Tarvittavia tietoja puuttuu, TAC:ia ei voida generoida",
|
|
238
238
|
"invalid-surface-wind-direction-message": "Suunta tulee pyöristää lähimpään {{value}} asteeseen.",
|
|
239
239
|
"surface-wind-label": "tuulen suunta",
|
|
240
240
|
"surface-wind-speed-label": "nopeus",
|
|
@@ -252,7 +252,7 @@ var fi = {
|
|
|
252
252
|
"levels-invalid-level-unit-combination-message": "Virheellinen yhdistelmä yksiköitä",
|
|
253
253
|
level: "Taso",
|
|
254
254
|
"levels-the-maximum-level": "Tason maksimiarvo käyttäen yksikköä {{levelUnit}} on {{maxLevelValue}}",
|
|
255
|
-
"levels-the-minimum-level": "Tason minimiarvo käyttäen
|
|
255
|
+
"levels-the-minimum-level": "Tason minimiarvo käyttäen yksikköä {{levelUnit}} on {{minLevelValue}} ",
|
|
256
256
|
"levels-upper-level-label": "Ylempi taso",
|
|
257
257
|
"unit-label": "Yksikkö",
|
|
258
258
|
"levels-lower-level-label": "Alempi taso",
|
|
@@ -1574,27 +1574,27 @@ var getPhenomenon = function getPhenomenon(selectedFIR, phenomenon, productConfi
|
|
|
1574
1574
|
if (!firArea) {
|
|
1575
1575
|
return undefined;
|
|
1576
1576
|
}
|
|
1577
|
-
var firPhenomenon = (_firArea$phenomenon = firArea.phenomenon) == null ? void 0 : _firArea$phenomenon.find(function (
|
|
1578
|
-
return
|
|
1577
|
+
var firPhenomenon = (_firArea$phenomenon = firArea.phenomenon) == null ? void 0 : _firArea$phenomenon.find(function (phen) {
|
|
1578
|
+
return phen.code === phenomenon;
|
|
1579
1579
|
});
|
|
1580
1580
|
if (!firPhenomenon) {
|
|
1581
1581
|
return undefined;
|
|
1582
1582
|
}
|
|
1583
1583
|
return firPhenomenon.description;
|
|
1584
1584
|
};
|
|
1585
|
-
var getDialogtitle = function getDialogtitle(product, productType, productConfig) {
|
|
1585
|
+
var getDialogtitle = function getDialogtitle(t, product, productType, productConfig) {
|
|
1586
1586
|
var productName = productType.toUpperCase();
|
|
1587
1587
|
if (product === null) {
|
|
1588
1588
|
return "New " + productName;
|
|
1589
1589
|
}
|
|
1590
1590
|
if (!isInstanceOfCancelSigmetOrAirmet(product)) {
|
|
1591
1591
|
var phenomenon = getPhenomenon(product.firName, product.phenomenon, productConfig);
|
|
1592
|
-
return productName + " " + (phenomenon || '') + " - " + (product.status === 'DRAFT' ?
|
|
1592
|
+
return productName + " " + (phenomenon || '') + " - " + (product.status === 'DRAFT' ? t('saved-as-draft') : ProductStatusDescription[product.status]);
|
|
1593
1593
|
}
|
|
1594
1594
|
if (isInstanceOfCancelSigmet(product)) {
|
|
1595
|
-
return productName + " " +
|
|
1595
|
+
return productName + " " + t('cancels') + " " + product.cancelsSigmetSequenceId;
|
|
1596
1596
|
}
|
|
1597
|
-
return productName + " " +
|
|
1597
|
+
return productName + " " + t('cancels') + " " + product.cancelsAirmetSequenceId;
|
|
1598
1598
|
};
|
|
1599
1599
|
var getProductFormMode = function getProductFormMode(canBeOptions, productListItem) {
|
|
1600
1600
|
if (!productListItem) {
|
|
@@ -1608,12 +1608,14 @@ var getProductFormMode = function getProductFormMode(canBeOptions, productListIt
|
|
|
1608
1608
|
var buttonStyle = {
|
|
1609
1609
|
minWidth: 96
|
|
1610
1610
|
};
|
|
1611
|
-
var
|
|
1611
|
+
var ProductFormLifecycleButtons = function ProductFormLifecycleButtons(_ref) {
|
|
1612
1612
|
var canBe = _ref.canBe,
|
|
1613
1613
|
onButtonPress = _ref.onButtonPress,
|
|
1614
1614
|
productType = _ref.productType,
|
|
1615
1615
|
_ref$areActionsDisabl = _ref.areActionsDisabled,
|
|
1616
1616
|
areActionsDisabled = _ref$areActionsDisabl === void 0 ? false : _ref$areActionsDisabl;
|
|
1617
|
+
var _useSigmetAirmetTrans = useSigmetAirmetTranslation(),
|
|
1618
|
+
t = _useSigmetAirmetTrans.t;
|
|
1617
1619
|
var hasDiscardButton = canBe.includes('DISCARDED');
|
|
1618
1620
|
var onDiscard = function onDiscard() {
|
|
1619
1621
|
return onButtonPress(ProductAction.DISCARD);
|
|
@@ -1635,23 +1637,23 @@ var getProductFormLifecycleButtons = function getProductFormLifecycleButtons(_re
|
|
|
1635
1637
|
return onButtonPress(ProductAction.PUBLISH);
|
|
1636
1638
|
};
|
|
1637
1639
|
var mobileMenuItems = [].concat(hasDiscardButton ? [{
|
|
1638
|
-
text:
|
|
1640
|
+
text: t('discard'),
|
|
1639
1641
|
action: onDiscard
|
|
1640
1642
|
}] : [], hasSaveButton ? [{
|
|
1641
|
-
text:
|
|
1643
|
+
text: t('save'),
|
|
1642
1644
|
action: onSave,
|
|
1643
1645
|
isDisabled: areActionsDisabled
|
|
1644
1646
|
}] : [], hasRenewButton ? [{
|
|
1645
|
-
text:
|
|
1647
|
+
text: t('renew', {
|
|
1646
1648
|
product: productType
|
|
1647
1649
|
}),
|
|
1648
1650
|
action: onRenew,
|
|
1649
1651
|
isDisabled: areActionsDisabled
|
|
1650
1652
|
}] : [], hasCancelButton ? [{
|
|
1651
|
-
text:
|
|
1653
|
+
text: t('cancel') + " " + productType,
|
|
1652
1654
|
action: onCancel
|
|
1653
1655
|
}] : [], hasPublishButton ? [{
|
|
1654
|
-
text:
|
|
1656
|
+
text: t('publish'),
|
|
1655
1657
|
action: onPublish,
|
|
1656
1658
|
isDisabled: areActionsDisabled
|
|
1657
1659
|
}] : []);
|
|
@@ -1673,7 +1675,7 @@ var getProductFormLifecycleButtons = function getProductFormLifecycleButtons(_re
|
|
|
1673
1675
|
onClick: onRenew,
|
|
1674
1676
|
sx: buttonStyle,
|
|
1675
1677
|
"data-testid": "productform-dialog-renew",
|
|
1676
|
-
children:
|
|
1678
|
+
children: t('renew', {
|
|
1677
1679
|
product: productType
|
|
1678
1680
|
})
|
|
1679
1681
|
}), hasDiscardButton && jsx(Button, {
|
|
@@ -1681,27 +1683,27 @@ var getProductFormLifecycleButtons = function getProductFormLifecycleButtons(_re
|
|
|
1681
1683
|
onClick: onDiscard,
|
|
1682
1684
|
sx: buttonStyle,
|
|
1683
1685
|
"data-testid": "productform-dialog-discard",
|
|
1684
|
-
children:
|
|
1686
|
+
children: t('discard')
|
|
1685
1687
|
}), hasSaveButton && jsx(Button, {
|
|
1686
1688
|
variant: "tertiary",
|
|
1687
1689
|
onClick: onSave,
|
|
1688
1690
|
sx: buttonStyle,
|
|
1689
1691
|
"data-testid": "productform-dialog-draft",
|
|
1690
1692
|
disabled: areActionsDisabled,
|
|
1691
|
-
children:
|
|
1693
|
+
children: t('save')
|
|
1692
1694
|
}), hasCancelButton && jsx(Button, {
|
|
1693
1695
|
variant: "tertiary",
|
|
1694
1696
|
onClick: onCancel,
|
|
1695
1697
|
sx: buttonStyle,
|
|
1696
1698
|
"data-testid": "productform-dialog-cancel",
|
|
1697
|
-
children:
|
|
1699
|
+
children: t('cancel') + " " + productType
|
|
1698
1700
|
}), hasPublishButton && jsx(Button, {
|
|
1699
1701
|
variant: "primary",
|
|
1700
1702
|
onClick: onPublish,
|
|
1701
1703
|
sx: buttonStyle,
|
|
1702
1704
|
"data-testid": "productform-dialog-publish",
|
|
1703
1705
|
disabled: areActionsDisabled,
|
|
1704
|
-
children:
|
|
1706
|
+
children: t('publish')
|
|
1705
1707
|
})]
|
|
1706
1708
|
}), jsx(Box, {
|
|
1707
1709
|
display: {
|
|
@@ -1799,71 +1801,71 @@ var useDelayedFormValues = function useDelayedFormValues(getValues, register, de
|
|
|
1799
1801
|
};
|
|
1800
1802
|
return [formValues, onChangeForm];
|
|
1801
1803
|
};
|
|
1802
|
-
var getConfirmationDialogTitle = function getConfirmationDialogTitle(action, productType) {
|
|
1804
|
+
var getConfirmationDialogTitle = function getConfirmationDialogTitle(t, action, productType) {
|
|
1803
1805
|
var product = productType.toUpperCase();
|
|
1804
1806
|
if (action === ProductAction.CLOSE) {
|
|
1805
|
-
return
|
|
1807
|
+
return t('close') + " " + product;
|
|
1806
1808
|
}
|
|
1807
1809
|
if (action === ProductAction.DISCARD) {
|
|
1808
|
-
return
|
|
1810
|
+
return t('discard-non-capitalized') + " " + product;
|
|
1809
1811
|
}
|
|
1810
1812
|
if (action === ProductAction.PUBLISH) {
|
|
1811
|
-
return
|
|
1813
|
+
return t('publish');
|
|
1812
1814
|
}
|
|
1813
|
-
return
|
|
1815
|
+
return t('cancel') + " " + product;
|
|
1814
1816
|
};
|
|
1815
|
-
var getConfirmationDialogContent = function getConfirmationDialogContent(action, productType) {
|
|
1817
|
+
var getConfirmationDialogContent = function getConfirmationDialogContent(t, action, productType) {
|
|
1816
1818
|
var product = productType.toUpperCase();
|
|
1817
1819
|
if (action === ProductAction.DISCARD) {
|
|
1818
|
-
return
|
|
1820
|
+
return t('are-you-sure-you-want-to-discard', {
|
|
1819
1821
|
product: product
|
|
1820
1822
|
});
|
|
1821
1823
|
}
|
|
1822
1824
|
if (action === ProductAction.CLOSE) {
|
|
1823
|
-
return
|
|
1825
|
+
return t('save-changes-made');
|
|
1824
1826
|
}
|
|
1825
1827
|
if (action === ProductAction.PUBLISH) {
|
|
1826
|
-
return
|
|
1828
|
+
return t('publish-this-product', {
|
|
1827
1829
|
product: product
|
|
1828
1830
|
});
|
|
1829
1831
|
}
|
|
1830
|
-
return
|
|
1832
|
+
return t('cancel-this-product', {
|
|
1831
1833
|
product: product
|
|
1832
1834
|
});
|
|
1833
1835
|
};
|
|
1834
|
-
var getConfirmationDialogButtonLabel = function getConfirmationDialogButtonLabel(action, productType) {
|
|
1836
|
+
var getConfirmationDialogButtonLabel = function getConfirmationDialogButtonLabel(t, action, productType) {
|
|
1835
1837
|
var product = productType.toUpperCase();
|
|
1836
1838
|
switch (action) {
|
|
1837
1839
|
case ProductAction.DISCARD:
|
|
1838
|
-
return "" +
|
|
1840
|
+
return "" + t('discard-product', {
|
|
1839
1841
|
product: product
|
|
1840
1842
|
});
|
|
1841
1843
|
case ProductAction.PUBLISH:
|
|
1842
|
-
return
|
|
1844
|
+
return t('publish');
|
|
1843
1845
|
case ProductAction.CANCEL:
|
|
1844
|
-
return
|
|
1846
|
+
return t('yes-cancel', {
|
|
1845
1847
|
product: product
|
|
1846
1848
|
});
|
|
1847
1849
|
default:
|
|
1848
|
-
return
|
|
1850
|
+
return t('save-and-close');
|
|
1849
1851
|
}
|
|
1850
1852
|
};
|
|
1851
|
-
var getConfirmationDialogCancelLabel = function getConfirmationDialogCancelLabel(action) {
|
|
1853
|
+
var getConfirmationDialogCancelLabel = function getConfirmationDialogCancelLabel(t, action) {
|
|
1852
1854
|
switch (action) {
|
|
1853
1855
|
case ProductAction.CLOSE:
|
|
1854
|
-
return
|
|
1856
|
+
return t('discard-and-close');
|
|
1855
1857
|
default:
|
|
1856
1858
|
return undefined;
|
|
1857
1859
|
}
|
|
1858
1860
|
};
|
|
1859
|
-
var getProductIssueDate = function getProductIssueDate(initialProduct, initialCancelProduct) {
|
|
1861
|
+
var getProductIssueDate = function getProductIssueDate(t, initialProduct, initialCancelProduct) {
|
|
1860
1862
|
if (initialProduct !== null && (initialProduct.status === 'PUBLISHED' || initialProduct.status === 'EXPIRED') && initialProduct.issueDate) {
|
|
1861
1863
|
return dateUtils.dateToString(dateUtils.utc(initialProduct.issueDate), dateUtils.DATE_FORMAT_DATEPICKER) + " UTC";
|
|
1862
1864
|
}
|
|
1863
1865
|
if (initialCancelProduct !== null && initialCancelProduct.issueDate) {
|
|
1864
1866
|
return dateUtils.dateToString(dateUtils.utc(initialCancelProduct.issueDate), dateUtils.DATE_FORMAT_DATEPICKER) + " UTC";
|
|
1865
1867
|
}
|
|
1866
|
-
return
|
|
1868
|
+
return t('not-published');
|
|
1867
1869
|
};
|
|
1868
1870
|
// Provide a cross section of the units from the config and the units as allowed by the type definition
|
|
1869
1871
|
// Units from the config which are not in the type definition should be ignored
|
|
@@ -1910,9 +1912,9 @@ var isFir = function isFir(geojson) {
|
|
|
1910
1912
|
var selectionType = (_geojson$features$ = geojson.features[0]) == null || (_geojson$features$ = _geojson$features$.properties) == null ? void 0 : _geojson$features$['selectionType'];
|
|
1911
1913
|
return geojson && geojson.features && geojson.features.length > 0 && selectionType === firSelectionType;
|
|
1912
1914
|
};
|
|
1913
|
-
var getFieldLabel = function getFieldLabel(title, isDisabled, action) {
|
|
1915
|
+
var getFieldLabel = function getFieldLabel(t, title, isDisabled, action) {
|
|
1914
1916
|
if (action === void 0) {
|
|
1915
|
-
action =
|
|
1917
|
+
action = t('select');
|
|
1916
1918
|
}
|
|
1917
1919
|
return isDisabled ? title : action + " " + title.toLowerCase();
|
|
1918
1920
|
};
|
|
@@ -1949,26 +1951,26 @@ var getProjection = function getProjection(productConfig) {
|
|
|
1949
1951
|
return ((_productConfig$mapPre2 = productConfig.mapPreset) == null ? void 0 : _productConfig$mapPre2.proj) || undefined;
|
|
1950
1952
|
};
|
|
1951
1953
|
var firSelectionType = 'fir';
|
|
1952
|
-
var getDrawTools = function getDrawTools(type, firShape) {
|
|
1954
|
+
var getDrawTools = function getDrawTools(t, type, firShape) {
|
|
1953
1955
|
var defaultStyleProperties = type === StartOrEndDrawing.start ? featurePropsStart : featurePropsEnd;
|
|
1954
1956
|
return [Object.assign({}, defaultPoint, {
|
|
1955
|
-
title:
|
|
1957
|
+
title: t('drop-a-point-as', {
|
|
1956
1958
|
type: type
|
|
1957
1959
|
}),
|
|
1958
1960
|
shape: addGeoJSONProperties(defaultPoint.shape, defaultStyleProperties)
|
|
1959
1961
|
}), Object.assign({}, defaultBox, {
|
|
1960
|
-
title:
|
|
1962
|
+
title: t('draw-a-box-as', {
|
|
1961
1963
|
type: type
|
|
1962
1964
|
}),
|
|
1963
1965
|
shape: addGeoJSONProperties(defaultBox.shape, defaultStyleProperties)
|
|
1964
1966
|
}), Object.assign({}, defaultPolygon, {
|
|
1965
|
-
title:
|
|
1967
|
+
title: t('draw-a-shape-as', {
|
|
1966
1968
|
type: type
|
|
1967
1969
|
}),
|
|
1968
1970
|
shape: addGeoJSONProperties(defaultPolygon.shape, defaultStyleProperties)
|
|
1969
1971
|
}), {
|
|
1970
1972
|
drawModeId: 'drawtools-fir',
|
|
1971
|
-
title:
|
|
1973
|
+
title: t('set-a-fir-as', {
|
|
1972
1974
|
type: type
|
|
1973
1975
|
}),
|
|
1974
1976
|
isSelectable: false,
|
|
@@ -1977,7 +1979,7 @@ var getDrawTools = function getDrawTools(type, firShape) {
|
|
|
1977
1979
|
shape: addSelectionTypeToGeoJSON(addGeoJSONProperties(firShape, Object.assign({}, defaultStyleProperties)), firSelectionType),
|
|
1978
1980
|
selectionType: firSelectionType
|
|
1979
1981
|
}, Object.assign({}, defaultDelete, {
|
|
1980
|
-
title:
|
|
1982
|
+
title: t('remove-geometry')
|
|
1981
1983
|
})];
|
|
1982
1984
|
};
|
|
1983
1985
|
var updateDrawToolsWithFir = function updateDrawToolsWithFir(drawTools, newFirShape) {
|
|
@@ -2065,32 +2067,34 @@ var DrawTools = function DrawTools(_ref) {
|
|
|
2065
2067
|
var DEFAULT_ROUNDING_LEVELS_FL = 5;
|
|
2066
2068
|
var DEFAULT_ROUNDING_LEVELS_FT = 500;
|
|
2067
2069
|
var DEFAULT_ROUNDING_LEVELS_M = 1;
|
|
2068
|
-
var getLevelInvalidStepsForFLUnitMessage = function getLevelInvalidStepsForFLUnitMessage(value) {
|
|
2070
|
+
var getLevelInvalidStepsForFLUnitMessage = function getLevelInvalidStepsForFLUnitMessage(t, value) {
|
|
2069
2071
|
if (value === void 0) {
|
|
2070
2072
|
value = DEFAULT_ROUNDING_LEVELS_FL;
|
|
2071
2073
|
}
|
|
2072
|
-
return
|
|
2074
|
+
return t('levels-get-level-invalid-steps-for-fl-unit-message', {
|
|
2073
2075
|
value: value
|
|
2074
2076
|
});
|
|
2075
2077
|
};
|
|
2076
|
-
var getLevelInvalidStepsForFTUnitMessage = function getLevelInvalidStepsForFTUnitMessage(value) {
|
|
2078
|
+
var getLevelInvalidStepsForFTUnitMessage = function getLevelInvalidStepsForFTUnitMessage(t, value) {
|
|
2077
2079
|
if (value === void 0) {
|
|
2078
2080
|
value = DEFAULT_ROUNDING_LEVELS_FT;
|
|
2079
2081
|
}
|
|
2080
|
-
return
|
|
2082
|
+
return t('levels-get-level-invalid-steps-for-ft-unit-message', {
|
|
2081
2083
|
value: value
|
|
2082
2084
|
});
|
|
2083
2085
|
};
|
|
2084
|
-
var getLevelInvalidStepsForMUnitMessage = function getLevelInvalidStepsForMUnitMessage(value) {
|
|
2086
|
+
var getLevelInvalidStepsForMUnitMessage = function getLevelInvalidStepsForMUnitMessage(t, value) {
|
|
2085
2087
|
if (value === void 0) {
|
|
2086
2088
|
value = DEFAULT_ROUNDING_LEVELS_M;
|
|
2087
2089
|
}
|
|
2088
|
-
return
|
|
2090
|
+
return t('levels-get-level-invalid-steps-for-m-unit-message', {
|
|
2089
2091
|
value: value
|
|
2090
2092
|
});
|
|
2091
2093
|
};
|
|
2092
|
-
var
|
|
2093
|
-
|
|
2094
|
+
var getInvalidUnitMessage = function getInvalidUnitMessage(t) {
|
|
2095
|
+
return t('levels-invalid-unit-message');
|
|
2096
|
+
};
|
|
2097
|
+
var _validateLevels = function validateLevels(t, value, unit, productConfig, selectedFIR) {
|
|
2094
2098
|
if (isEmpty(value)) {
|
|
2095
2099
|
return true;
|
|
2096
2100
|
}
|
|
@@ -2104,17 +2108,17 @@ var _validateLevels = function validateLevels(value, unit, productConfig, select
|
|
|
2104
2108
|
// Parse to integer to check for steps
|
|
2105
2109
|
var intLevel = parseInt(value, 10);
|
|
2106
2110
|
if (LevelUnits[unit] === LevelUnits.FT) {
|
|
2107
|
-
return intLevel % level_rounding_FT === 0 || getLevelInvalidStepsForFTUnitMessage(level_rounding_FT);
|
|
2111
|
+
return intLevel % level_rounding_FT === 0 || getLevelInvalidStepsForFTUnitMessage(t, level_rounding_FT);
|
|
2108
2112
|
}
|
|
2109
2113
|
if (LevelUnits[unit] === LevelUnits.FL) {
|
|
2110
|
-
return intLevel % level_rounding_FL === 0 || getLevelInvalidStepsForFLUnitMessage(level_rounding_FL);
|
|
2114
|
+
return intLevel % level_rounding_FL === 0 || getLevelInvalidStepsForFLUnitMessage(t, level_rounding_FL);
|
|
2111
2115
|
}
|
|
2112
2116
|
if (LevelUnits[unit] === LevelUnits.M) {
|
|
2113
|
-
return intLevel % level_rounding_M === 0 || getLevelInvalidStepsForMUnitMessage(level_rounding_M);
|
|
2117
|
+
return intLevel % level_rounding_M === 0 || getLevelInvalidStepsForMUnitMessage(t, level_rounding_M);
|
|
2114
2118
|
}
|
|
2115
|
-
return
|
|
2119
|
+
return getInvalidUnitMessage(t);
|
|
2116
2120
|
};
|
|
2117
|
-
var _validateLevelUnitCombinations = function validateLevelUnitCombinations(levelUnit, lowerLevelUnit
|
|
2121
|
+
var _validateLevelUnitCombinations = function validateLevelUnitCombinations(t, levelUnit, lowerLevelUnit) {
|
|
2118
2122
|
// If different units and lower level not SFC, only FL is allowed as upper level
|
|
2119
2123
|
if (lowerLevelUnit !== 'SFC' && levelUnit !== lowerLevelUnit && LevelUnits[levelUnit] !== LevelUnits.FL) {
|
|
2120
2124
|
return t('levels-invalid-level-unit-combination-message');
|
|
@@ -2279,7 +2283,7 @@ var Levels = function Levels(_ref) {
|
|
|
2279
2283
|
validateLevels: function validateLevels(value) {
|
|
2280
2284
|
return (
|
|
2281
2285
|
// level step depends on the unit
|
|
2282
|
-
_validateLevels(value, getValues('level.unit'), productConfig, getFIRValue())
|
|
2286
|
+
_validateLevels(t, value, getValues('level.unit'), productConfig, getFIRValue())
|
|
2283
2287
|
);
|
|
2284
2288
|
}
|
|
2285
2289
|
}
|
|
@@ -2319,7 +2323,7 @@ var Levels = function Levels(_ref) {
|
|
|
2319
2323
|
validateLevelUnitCombinations: function validateLevelUnitCombinations(value) {
|
|
2320
2324
|
return (
|
|
2321
2325
|
// level step depends on the unit
|
|
2322
|
-
_validateLevelUnitCombinations(value, levelInfoMode === 'BETW_SFC' ? 'SFC' : getValues('lowerLevel.unit')
|
|
2326
|
+
_validateLevelUnitCombinations(t, value, levelInfoMode === 'BETW_SFC' ? 'SFC' : getValues('lowerLevel.unit')) === true
|
|
2323
2327
|
);
|
|
2324
2328
|
}
|
|
2325
2329
|
}
|
|
@@ -2376,7 +2380,7 @@ var Levels = function Levels(_ref) {
|
|
|
2376
2380
|
validateLevels: function validateLevels(value) {
|
|
2377
2381
|
return (
|
|
2378
2382
|
// level step depends on the unit
|
|
2379
|
-
_validateLevels(value, getValues('level.unit'), productConfig, getFIRValue())
|
|
2383
|
+
_validateLevels(t, value, getValues('level.unit'), productConfig, getFIRValue())
|
|
2380
2384
|
);
|
|
2381
2385
|
}
|
|
2382
2386
|
}
|
|
@@ -2430,7 +2434,7 @@ var Levels = function Levels(_ref) {
|
|
|
2430
2434
|
validateLevelUnitCombinations: function validateLevelUnitCombinations(value) {
|
|
2431
2435
|
return (
|
|
2432
2436
|
// level step depends on the unit
|
|
2433
|
-
_validateLevelUnitCombinations(getValues('level.unit'), value
|
|
2437
|
+
_validateLevelUnitCombinations(t, getValues('level.unit'), value)
|
|
2434
2438
|
);
|
|
2435
2439
|
}
|
|
2436
2440
|
}
|
|
@@ -2490,7 +2494,7 @@ var Levels = function Levels(_ref) {
|
|
|
2490
2494
|
validateLevels: function validateLevels(value) {
|
|
2491
2495
|
return (
|
|
2492
2496
|
// level step depends on the unit
|
|
2493
|
-
_validateLevels(value, getValues('lowerLevel.unit'), productConfig, getFIRValue())
|
|
2497
|
+
_validateLevels(t, value, getValues('lowerLevel.unit'), productConfig, getFIRValue())
|
|
2494
2498
|
);
|
|
2495
2499
|
}
|
|
2496
2500
|
}
|
|
@@ -2593,7 +2597,7 @@ var Levels = function Levels(_ref) {
|
|
|
2593
2597
|
validateLevels: function validateLevels(value) {
|
|
2594
2598
|
return (
|
|
2595
2599
|
// level step depends on the unit
|
|
2596
|
-
_validateLevels(value, getValues('level.unit'), productConfig, getFIRValue())
|
|
2600
|
+
_validateLevels(t, value, getValues('level.unit'), productConfig, getFIRValue())
|
|
2597
2601
|
);
|
|
2598
2602
|
}
|
|
2599
2603
|
}
|
|
@@ -2681,7 +2685,7 @@ var ObservationForecastTime = function ObservationForecastTime(_ref) {
|
|
|
2681
2685
|
t = _useSigmetAirmetTrans.t;
|
|
2682
2686
|
var _useFormContext = useFormContext(),
|
|
2683
2687
|
watch = _useFormContext.watch;
|
|
2684
|
-
var label = getFieldLabel(t('date-and-time'), isReadOnly);
|
|
2688
|
+
var label = getFieldLabel(t, t('date-and-time'), isReadOnly);
|
|
2685
2689
|
var _useShortTestHelpers = useShortTestHelpers(),
|
|
2686
2690
|
isShortTest = _useShortTestHelpers.isShortTest;
|
|
2687
2691
|
var fieldsDisabled = isDisabled || isShortTest();
|
|
@@ -2730,12 +2734,12 @@ var Phenomenon = function Phenomenon(_ref) {
|
|
|
2730
2734
|
trigger = _useFormContext.trigger;
|
|
2731
2735
|
var _useShortTestHelpers = useShortTestHelpers(),
|
|
2732
2736
|
isShortTest = _useShortTestHelpers.isShortTest;
|
|
2733
|
-
var label = getFieldLabel(t('phenomenon'), isReadOnly);
|
|
2737
|
+
var label = getFieldLabel(t, t('phenomenon'), isReadOnly);
|
|
2734
2738
|
var fieldsDisabled = isDisabled || isShortTest();
|
|
2735
2739
|
var handleSinglePhenomenaSelection = function handleSinglePhenomenaSelection() {
|
|
2736
2740
|
var defaultPhenomenon = getValues('phenomenon');
|
|
2737
|
-
var isValidPhenomenon = phenomenaList.some(function (
|
|
2738
|
-
return
|
|
2741
|
+
var isValidPhenomenon = phenomenaList.some(function (phen) {
|
|
2742
|
+
return phen.code === defaultPhenomenon;
|
|
2739
2743
|
});
|
|
2740
2744
|
// Only auto-select if there is exactly one phenomenon available
|
|
2741
2745
|
if (!isValidPhenomenon && phenomenaList.length === 1) {
|
|
@@ -2789,23 +2793,23 @@ var Phenomenon = function Phenomenon(_ref) {
|
|
|
2789
2793
|
|
|
2790
2794
|
var DEFAULT_ROUNDING_MOVEMENT_KT = 5;
|
|
2791
2795
|
var DEFAULT_ROUNDING_MOVEMENT_KMH = 10;
|
|
2792
|
-
var getMovementStepValKTMessage = function getMovementStepValKTMessage(value) {
|
|
2796
|
+
var getMovementStepValKTMessage = function getMovementStepValKTMessage(t, value) {
|
|
2793
2797
|
if (value === void 0) {
|
|
2794
2798
|
value = DEFAULT_ROUNDING_MOVEMENT_KT;
|
|
2795
2799
|
}
|
|
2796
|
-
return
|
|
2800
|
+
return t('progress-get-movement-step-valktmessage', {
|
|
2797
2801
|
value: value
|
|
2798
2802
|
});
|
|
2799
2803
|
};
|
|
2800
|
-
var getMovementStepValKMHMessage = function getMovementStepValKMHMessage(value) {
|
|
2804
|
+
var getMovementStepValKMHMessage = function getMovementStepValKMHMessage(t, value) {
|
|
2801
2805
|
if (value === void 0) {
|
|
2802
2806
|
value = DEFAULT_ROUNDING_MOVEMENT_KMH;
|
|
2803
2807
|
}
|
|
2804
|
-
return
|
|
2808
|
+
return t('progress-get-movement-step-valkmhmessage', {
|
|
2805
2809
|
value: value
|
|
2806
2810
|
});
|
|
2807
2811
|
};
|
|
2808
|
-
var _validateMovementSteps = function validateMovementSteps(value, unit, productConfig, selectedFIR) {
|
|
2812
|
+
var _validateMovementSteps = function validateMovementSteps(t, value, unit, productConfig, selectedFIR) {
|
|
2809
2813
|
if (isEmpty(value)) {
|
|
2810
2814
|
return true;
|
|
2811
2815
|
}
|
|
@@ -2817,12 +2821,12 @@ var _validateMovementSteps = function validateMovementSteps(value, unit, product
|
|
|
2817
2821
|
// Parse to integer to check for steps
|
|
2818
2822
|
var intLevel = parseInt(value, 10);
|
|
2819
2823
|
if (MovementUnit[unit] === MovementUnit.KT) {
|
|
2820
|
-
return intLevel % movement_rounding_kt === 0 || getMovementStepValKTMessage(movement_rounding_kt);
|
|
2824
|
+
return intLevel % movement_rounding_kt === 0 || getMovementStepValKTMessage(t, movement_rounding_kt);
|
|
2821
2825
|
}
|
|
2822
2826
|
if (MovementUnit[unit] === MovementUnit.KMH) {
|
|
2823
|
-
return intLevel % movement_rounding_kmh === 0 || getMovementStepValKMHMessage(movement_rounding_kmh);
|
|
2827
|
+
return intLevel % movement_rounding_kmh === 0 || getMovementStepValKMHMessage(t, movement_rounding_kmh);
|
|
2824
2828
|
}
|
|
2825
|
-
return
|
|
2829
|
+
return t('invalid-unit');
|
|
2826
2830
|
};
|
|
2827
2831
|
var Progress = function Progress(_ref) {
|
|
2828
2832
|
var _geoJSON$features$, _geoJSONIntersection$;
|
|
@@ -3021,7 +3025,7 @@ var Progress = function Progress(_ref) {
|
|
|
3021
3025
|
validateMovementSteps: function validateMovementSteps(value) {
|
|
3022
3026
|
return (
|
|
3023
3027
|
// movement step depends on the unit
|
|
3024
|
-
_validateMovementSteps(value, getValues('movementUnit'), productConfig, getFIRValue())
|
|
3028
|
+
_validateMovementSteps(t, value, getValues('movementUnit'), productConfig, getFIRValue())
|
|
3025
3029
|
);
|
|
3026
3030
|
}
|
|
3027
3031
|
}
|
|
@@ -3155,8 +3159,8 @@ var SelectFIR = function SelectFIR(_ref) {
|
|
|
3155
3159
|
setValue('locationIndicatorMWO', valuesFromConfig.locationIndicatorMWO);
|
|
3156
3160
|
setValue('firGeometry', valuesFromConfig.firGeometry);
|
|
3157
3161
|
var currentPhenomenon = getValues('phenomenon');
|
|
3158
|
-
var isValidPhenomenon = valuesFromConfig.phenomena.some(function (
|
|
3159
|
-
return
|
|
3162
|
+
var isValidPhenomenon = valuesFromConfig.phenomena.some(function (phen) {
|
|
3163
|
+
return phen.code === currentPhenomenon;
|
|
3160
3164
|
});
|
|
3161
3165
|
if (!isValidPhenomenon) {
|
|
3162
3166
|
if (valuesFromConfig.phenomena.length === 1) {
|
|
@@ -3321,7 +3325,7 @@ var Type = function Type(_ref) {
|
|
|
3321
3325
|
var _useFormContext = useFormContext(),
|
|
3322
3326
|
getValues = _useFormContext.getValues,
|
|
3323
3327
|
trigger = _useFormContext.trigger;
|
|
3324
|
-
var label = getFieldLabel(t('type-title'), isReadOnly);
|
|
3328
|
+
var label = getFieldLabel(t, t('type-title'), isReadOnly);
|
|
3325
3329
|
var _useShortTestHelpers = useShortTestHelpers(),
|
|
3326
3330
|
onTypeChange = _useShortTestHelpers.onTypeChange;
|
|
3327
3331
|
var messageType = productType === 'airmet' ? AirmetType : SigmetType;
|
|
@@ -3351,8 +3355,8 @@ var Type = function Type(_ref) {
|
|
|
3351
3355
|
});
|
|
3352
3356
|
};
|
|
3353
3357
|
|
|
3354
|
-
var getValidFromXHoursBeforeMessage = function getValidFromXHoursBeforeMessage(hours) {
|
|
3355
|
-
return
|
|
3358
|
+
var getValidFromXHoursBeforeMessage = function getValidFromXHoursBeforeMessage(t, hours) {
|
|
3359
|
+
return t('valid-from-time-error', {
|
|
3356
3360
|
hours: hours
|
|
3357
3361
|
});
|
|
3358
3362
|
};
|
|
@@ -3382,7 +3386,7 @@ var ValidFrom = function ValidFrom(_ref) {
|
|
|
3382
3386
|
trigger = _useFormContext.trigger;
|
|
3383
3387
|
var _useDraftFormHelpers = useDraftFormHelpers(),
|
|
3384
3388
|
isRequired = _useDraftFormHelpers.isRequired;
|
|
3385
|
-
var label = getFieldLabel(t('date-and-time'), isReadOnly);
|
|
3389
|
+
var label = getFieldLabel(t, t('date-and-time'), isReadOnly);
|
|
3386
3390
|
return jsx(ProductFormFieldLayout, {
|
|
3387
3391
|
title: t('valid-from'),
|
|
3388
3392
|
children: jsx(ReactHookFormDateTime, {
|
|
@@ -3400,7 +3404,7 @@ var ValidFrom = function ValidFrom(_ref) {
|
|
|
3400
3404
|
},
|
|
3401
3405
|
// The current time can be no more than 4 hours before the validity start (12 for VA/TC SIGMET)
|
|
3402
3406
|
isCurrentTimeXHoursBeforeValue: function isCurrentTimeXHoursBeforeValue(value) {
|
|
3403
|
-
return isXHoursBefore(dateUtils.getCurrentTimeAsString(), value, getHoursBeforeValidity(getValues('phenomenon'), getValues('locationIndicatorATSR'), productConfig)) || getValidFromXHoursBeforeMessage(getHoursBeforeValidity(getValues('phenomenon'), getValues('locationIndicatorATSR'), productConfig));
|
|
3407
|
+
return isXHoursBefore(dateUtils.getCurrentTimeAsString(), value, getHoursBeforeValidity(getValues('phenomenon'), getValues('locationIndicatorATSR'), productConfig)) || getValidFromXHoursBeforeMessage(t, getHoursBeforeValidity(getValues('phenomenon'), getValues('locationIndicatorATSR'), productConfig));
|
|
3404
3408
|
}
|
|
3405
3409
|
}
|
|
3406
3410
|
},
|
|
@@ -3447,7 +3451,7 @@ var ValidUntil = function ValidUntil(_ref) {
|
|
|
3447
3451
|
var _useDraftFormHelpers = useDraftFormHelpers(),
|
|
3448
3452
|
isRequired = _useDraftFormHelpers.isRequired;
|
|
3449
3453
|
var dateAndTime = t('date-and-time');
|
|
3450
|
-
var label = getFieldLabel(dateAndTime, isReadOnly);
|
|
3454
|
+
var label = getFieldLabel(t, dateAndTime, isReadOnly);
|
|
3451
3455
|
var _React$useState = React__default.useState(getDefaultValidUntilValue(productConfig, getValues('phenomenon'), getValues('locationIndicatorATSR'), getValues('validDateStart'))),
|
|
3452
3456
|
defaultValidUntilValue = _React$useState[0],
|
|
3453
3457
|
setDefaultValidUntilValue = _React$useState[1];
|
|
@@ -3600,23 +3604,23 @@ var VolcanicFields = function VolcanicFields(_ref) {
|
|
|
3600
3604
|
|
|
3601
3605
|
var DEFAULT_ROUNDING_SURFACE_VISIBLILITY_BELOW = 50;
|
|
3602
3606
|
var DEFAULT_ROUNDING_SURFACE_VISIBLILITY_ABOVE = 100;
|
|
3603
|
-
var getInvalidSurfaceVisibilityTill750StepsMessage = function getInvalidSurfaceVisibilityTill750StepsMessage(value) {
|
|
3607
|
+
var getInvalidSurfaceVisibilityTill750StepsMessage = function getInvalidSurfaceVisibilityTill750StepsMessage(t, value) {
|
|
3604
3608
|
if (value === void 0) {
|
|
3605
3609
|
value = DEFAULT_ROUNDING_SURFACE_VISIBLILITY_BELOW;
|
|
3606
3610
|
}
|
|
3607
|
-
return
|
|
3611
|
+
return t('invalid-surface-visibility-till-750-steps-message', {
|
|
3608
3612
|
value: value
|
|
3609
3613
|
});
|
|
3610
3614
|
};
|
|
3611
|
-
var getInvalidSurfaceVisibilityFrom750StepsMessage = function getInvalidSurfaceVisibilityFrom750StepsMessage(value) {
|
|
3615
|
+
var getInvalidSurfaceVisibilityFrom750StepsMessage = function getInvalidSurfaceVisibilityFrom750StepsMessage(t, value) {
|
|
3612
3616
|
if (value === void 0) {
|
|
3613
3617
|
value = DEFAULT_ROUNDING_SURFACE_VISIBLILITY_ABOVE;
|
|
3614
3618
|
}
|
|
3615
|
-
return
|
|
3619
|
+
return t('invalid-surface-visibility-from-750-steps-message', {
|
|
3616
3620
|
value: value
|
|
3617
3621
|
});
|
|
3618
3622
|
};
|
|
3619
|
-
var _validateSurfaceVisibility = function validateSurfaceVisibility(value, productConfig, selectedFIR) {
|
|
3623
|
+
var _validateSurfaceVisibility = function validateSurfaceVisibility(t, value, productConfig, selectedFIR) {
|
|
3620
3624
|
if (isEmpty(value)) {
|
|
3621
3625
|
return true;
|
|
3622
3626
|
}
|
|
@@ -3628,9 +3632,9 @@ var _validateSurfaceVisibility = function validateSurfaceVisibility(value, produ
|
|
|
3628
3632
|
// Parse to integer to check for steps
|
|
3629
3633
|
var intVisibility = parseInt(value, 10);
|
|
3630
3634
|
if (intVisibility > 750) {
|
|
3631
|
-
return intVisibility % visibility_rounding_above === 0 || getInvalidSurfaceVisibilityFrom750StepsMessage(visibility_rounding_above);
|
|
3635
|
+
return intVisibility % visibility_rounding_above === 0 || getInvalidSurfaceVisibilityFrom750StepsMessage(t, visibility_rounding_above);
|
|
3632
3636
|
}
|
|
3633
|
-
return intVisibility % visibility_rounding_below === 0 || getInvalidSurfaceVisibilityTill750StepsMessage(visibility_rounding_below);
|
|
3637
|
+
return intVisibility % visibility_rounding_below === 0 || getInvalidSurfaceVisibilityTill750StepsMessage(t, visibility_rounding_below);
|
|
3634
3638
|
};
|
|
3635
3639
|
var SurfaceVisibility = function SurfaceVisibility(_ref) {
|
|
3636
3640
|
var isDisabled = _ref.isDisabled,
|
|
@@ -3647,8 +3651,8 @@ var SurfaceVisibility = function SurfaceVisibility(_ref) {
|
|
|
3647
3651
|
var getFIRValue = function getFIRValue() {
|
|
3648
3652
|
return getValues('locationIndicatorATSR');
|
|
3649
3653
|
};
|
|
3650
|
-
var visibilityLabel = getFieldLabel(t('surface-visibility'), isReadOnly);
|
|
3651
|
-
var visibilityCauseLabel = getFieldLabel(t('surface-visibility-cause'), isReadOnly);
|
|
3654
|
+
var visibilityLabel = getFieldLabel(t, t('surface-visibility'), isReadOnly);
|
|
3655
|
+
var visibilityCauseLabel = getFieldLabel(t, t('surface-visibility-cause'), isReadOnly);
|
|
3652
3656
|
return jsxs(Grid2, {
|
|
3653
3657
|
container: true,
|
|
3654
3658
|
spacing: 2,
|
|
@@ -3688,7 +3692,7 @@ var SurfaceVisibility = function SurfaceVisibility(_ref) {
|
|
|
3688
3692
|
);
|
|
3689
3693
|
},
|
|
3690
3694
|
validateSurfaceVisibility: function validateSurfaceVisibility(value) {
|
|
3691
|
-
return _validateSurfaceVisibility(value, productConfig, getFIRValue());
|
|
3695
|
+
return _validateSurfaceVisibility(t, value, productConfig, getFIRValue());
|
|
3692
3696
|
}
|
|
3693
3697
|
}
|
|
3694
3698
|
},
|
|
@@ -3735,15 +3739,15 @@ var SurfaceVisibility = function SurfaceVisibility(_ref) {
|
|
|
3735
3739
|
};
|
|
3736
3740
|
|
|
3737
3741
|
var DEFAULT_ROUNDING_SURFACE_WIND_DIRECTION = 10;
|
|
3738
|
-
var invalidSurfaceWindDirectionStepsMessage = function invalidSurfaceWindDirectionStepsMessage(value) {
|
|
3742
|
+
var invalidSurfaceWindDirectionStepsMessage = function invalidSurfaceWindDirectionStepsMessage(t, value) {
|
|
3739
3743
|
if (value === void 0) {
|
|
3740
3744
|
value = DEFAULT_ROUNDING_SURFACE_WIND_DIRECTION;
|
|
3741
3745
|
}
|
|
3742
|
-
return
|
|
3746
|
+
return t('invalid-surface-wind-direction-message', {
|
|
3743
3747
|
value: value
|
|
3744
3748
|
});
|
|
3745
3749
|
};
|
|
3746
|
-
var _validateSurfaceWindDirection = function validateSurfaceWindDirection(value, productConfig, selectedFIR) {
|
|
3750
|
+
var _validateSurfaceWindDirection = function validateSurfaceWindDirection(t, value, productConfig, selectedFIR) {
|
|
3747
3751
|
if (isEmpty(value)) {
|
|
3748
3752
|
return true;
|
|
3749
3753
|
}
|
|
@@ -3752,7 +3756,7 @@ var _validateSurfaceWindDirection = function validateSurfaceWindDirection(value,
|
|
|
3752
3756
|
wind_direction_rounding = _getActiveFIRArea$win === void 0 ? DEFAULT_ROUNDING_SURFACE_WIND_DIRECTION : _getActiveFIRArea$win;
|
|
3753
3757
|
// Parse to integer to check for steps
|
|
3754
3758
|
var intVisibility = parseInt(value, 10);
|
|
3755
|
-
return intVisibility % wind_direction_rounding === 0 || invalidSurfaceWindDirectionStepsMessage(wind_direction_rounding);
|
|
3759
|
+
return intVisibility % wind_direction_rounding === 0 || invalidSurfaceWindDirectionStepsMessage(t, wind_direction_rounding);
|
|
3756
3760
|
};
|
|
3757
3761
|
var SurfaceWind = function SurfaceWind(_ref) {
|
|
3758
3762
|
var isDisabled = _ref.isDisabled,
|
|
@@ -3774,8 +3778,8 @@ var SurfaceWind = function SurfaceWind(_ref) {
|
|
|
3774
3778
|
};
|
|
3775
3779
|
// Get allowed speed units based on selected FIR - if no FIR selected, allow all units
|
|
3776
3780
|
var allowedWindUnitsForFir = getAllowedUnits(getFIRValue(), productConfig, 'surfacewind_unit', WindUnit);
|
|
3777
|
-
var windLabel = getFieldLabel(t('surface-wind-label'), isReadOnly, t('set'));
|
|
3778
|
-
var speedLabel = getFieldLabel(t('surface-wind-speed-label'), isReadOnly, t('set'));
|
|
3781
|
+
var windLabel = getFieldLabel(t, t('surface-wind-label'), isReadOnly, t('set'));
|
|
3782
|
+
var speedLabel = getFieldLabel(t, t('surface-wind-speed-label'), isReadOnly, t('set'));
|
|
3779
3783
|
return jsxs(Grid2, {
|
|
3780
3784
|
container: true,
|
|
3781
3785
|
spacing: 2,
|
|
@@ -3806,7 +3810,7 @@ var SurfaceWind = function SurfaceWind(_ref) {
|
|
|
3806
3810
|
validate: {
|
|
3807
3811
|
isRequired: isRequired,
|
|
3808
3812
|
validateSurfaceWindDirection: function validateSurfaceWindDirection(value) {
|
|
3809
|
-
return _validateSurfaceWindDirection(value, productConfig, getFIRValue());
|
|
3813
|
+
return _validateSurfaceWindDirection(t, value, productConfig, getFIRValue());
|
|
3810
3814
|
}
|
|
3811
3815
|
}
|
|
3812
3816
|
},
|
|
@@ -4208,8 +4212,9 @@ var CloudLevels = function CloudLevels(_ref) {
|
|
|
4208
4212
|
});
|
|
4209
4213
|
};
|
|
4210
4214
|
|
|
4211
|
-
|
|
4212
|
-
|
|
4215
|
+
var noTAC = function noTAC(t) {
|
|
4216
|
+
return t('tac-missing-data');
|
|
4217
|
+
};
|
|
4213
4218
|
var isLevelFieldsComplete = function isLevelFieldsComplete(product) {
|
|
4214
4219
|
var isAirmet = function isAirmet(product) {
|
|
4215
4220
|
return product.cloudLevelInfoMode !== undefined;
|
|
@@ -4289,16 +4294,13 @@ var shouldRetrieveTAC = function shouldRetrieveTAC(product, omitChange) {
|
|
|
4289
4294
|
}
|
|
4290
4295
|
return false;
|
|
4291
4296
|
};
|
|
4292
|
-
var useTAC = function useTAC(initialProduct, getTAC, hasErrors, omitChange) {
|
|
4297
|
+
var useTAC = function useTAC(t, initialProduct, getTAC, hasErrors, omitChange) {
|
|
4293
4298
|
if (hasErrors === void 0) {
|
|
4294
4299
|
hasErrors = function hasErrors() {
|
|
4295
4300
|
return false;
|
|
4296
4301
|
};
|
|
4297
4302
|
}
|
|
4298
|
-
var
|
|
4299
|
-
t = _useSigmetAirmetTrans.t;
|
|
4300
|
-
var noTAC = t('tac-missing-data');
|
|
4301
|
-
var _React$useState = React__default.useState(noTAC),
|
|
4303
|
+
var _React$useState = React__default.useState(noTAC(t)),
|
|
4302
4304
|
TAC = _React$useState[0],
|
|
4303
4305
|
setTAC = _React$useState[1];
|
|
4304
4306
|
var _useIsMounted = useIsMounted(),
|
|
@@ -4323,7 +4325,7 @@ var useTAC = function useTAC(initialProduct, getTAC, hasErrors, omitChange) {
|
|
|
4323
4325
|
_context.prev = 7;
|
|
4324
4326
|
_context.t0 = _context["catch"](0);
|
|
4325
4327
|
if (isMounted.current) {
|
|
4326
|
-
setTAC(noTAC);
|
|
4328
|
+
setTAC(noTAC(t));
|
|
4327
4329
|
}
|
|
4328
4330
|
case 10:
|
|
4329
4331
|
case "end":
|
|
@@ -4345,7 +4347,7 @@ var useTAC = function useTAC(initialProduct, getTAC, hasErrors, omitChange) {
|
|
|
4345
4347
|
if (shouldRetrieveTAC(formValues, omitChange) && !hasFormErrors) {
|
|
4346
4348
|
void retrieveTAC(formValues);
|
|
4347
4349
|
} else if (isMounted.current) {
|
|
4348
|
-
setTAC(noTAC);
|
|
4350
|
+
setTAC(noTAC(t));
|
|
4349
4351
|
}
|
|
4350
4352
|
};
|
|
4351
4353
|
var debouncedSearch = React__default.useRef(debounce( /*#__PURE__*/function () {
|
|
@@ -4386,11 +4388,10 @@ var ProductFormTAC = function ProductFormTAC(_ref3) {
|
|
|
4386
4388
|
var _tacLines$0$split$;
|
|
4387
4389
|
var tac = _ref3.tac,
|
|
4388
4390
|
product = _ref3.product;
|
|
4389
|
-
var _useSigmetAirmetTrans2 = useSigmetAirmetTranslation(),
|
|
4390
|
-
t = _useSigmetAirmetTrans2.t;
|
|
4391
|
-
var noTAC = t('tac-missing-data');
|
|
4392
4391
|
var tacLines = tac.split('\n');
|
|
4393
|
-
var
|
|
4392
|
+
var _useSigmetAirmetTrans = useSigmetAirmetTranslation(),
|
|
4393
|
+
t = _useSigmetAirmetTrans.t;
|
|
4394
|
+
var hasTac = tacLines.length > 0 && tac !== noTAC(t);
|
|
4394
4395
|
var sequenceNumberInTac = hasTac ? (_tacLines$0$split$ = tacLines[0].split(' ')[2]) != null ? _tacLines$0$split$ : null : null;
|
|
4395
4396
|
var sequenceStyle = getSequenceStyling(product, hasTac);
|
|
4396
4397
|
return jsx(Typography, {
|
|
@@ -8053,7 +8054,7 @@ var SigmetForm = function SigmetForm(_ref) {
|
|
|
8053
8054
|
phenomenaList = _React$useState[0],
|
|
8054
8055
|
setPhenomenaList = _React$useState[1];
|
|
8055
8056
|
var _useMapDrawTool = useMapDrawTool({
|
|
8056
|
-
defaultDrawModes: getDrawTools(StartOrEndDrawing.start, getFir(productConfig, firBorderAtStart)),
|
|
8057
|
+
defaultDrawModes: getDrawTools(t, StartOrEndDrawing.start, getFir(productConfig, firBorderAtStart)),
|
|
8057
8058
|
defaultGeoJSON: !isCancelSigmet && initialSigmet && initialSigmet.startGeometry ? addFeatureProperties(initialSigmet.startGeometry, featurePropsStart) : undefined,
|
|
8058
8059
|
defaultGeoJSONIntersection: !isCancelSigmet && initialSigmet && initialSigmet.startGeometryIntersect ? addFeatureProperties(initialSigmet.startGeometryIntersect, featurePropsIntersectionStart) : undefined,
|
|
8059
8060
|
defaultGeoJSONIntersectionBounds: addFeatureProperties(getFir(productConfig, firBorderAtStart), featurePropsFIR)
|
|
@@ -8069,7 +8070,7 @@ var SigmetForm = function SigmetForm(_ref) {
|
|
|
8069
8070
|
setStartGeoJSONIntersectionBounds = _useMapDrawTool.setGeoJSONIntersectionBounds,
|
|
8070
8071
|
setStartEditModes = _useMapDrawTool.setDrawModes;
|
|
8071
8072
|
var _useMapDrawTool2 = useMapDrawTool({
|
|
8072
|
-
defaultDrawModes: getDrawTools(StartOrEndDrawing.end, getFir(productConfig)),
|
|
8073
|
+
defaultDrawModes: getDrawTools(t, StartOrEndDrawing.end, getFir(productConfig)),
|
|
8073
8074
|
defaultGeoJSON: !isCancelSigmet && initialSigmet && initialSigmet.endGeometry ? addFeatureProperties(initialSigmet.endGeometry, featurePropsEnd) : undefined,
|
|
8074
8075
|
defaultGeoJSONIntersection: !isCancelSigmet && initialSigmet && initialSigmet.endGeometryIntersect ? addFeatureProperties(initialSigmet.endGeometryIntersect, featurePropsIntersectionEnd) : undefined,
|
|
8075
8076
|
defaultGeoJSONIntersectionBounds: addFeatureProperties(getFir(productConfig), featurePropsFIR),
|
|
@@ -8161,7 +8162,7 @@ var SigmetForm = function SigmetForm(_ref) {
|
|
|
8161
8162
|
setIsDisabled = _React$useState2[1];
|
|
8162
8163
|
var isReadOnly = mode === 'view';
|
|
8163
8164
|
var helperText = isReadOnly ? '' : 'Optional';
|
|
8164
|
-
var _useTAC = useTAC(initialSigmet !== null ? initialSigmet : initialCancelSigmet, getTAC || api.getSigmetTAC, getHasFormErrors, getOmitChangeFromConfig(productConfig)),
|
|
8165
|
+
var _useTAC = useTAC(t, initialSigmet !== null ? initialSigmet : initialCancelSigmet, getTAC || api.getSigmetTAC, getHasFormErrors, getOmitChangeFromConfig(productConfig)),
|
|
8165
8166
|
tac = _useTAC[0],
|
|
8166
8167
|
updateTac = _useTAC[1];
|
|
8167
8168
|
var onChangeForm = function onChangeForm() {
|
|
@@ -8290,7 +8291,7 @@ var SigmetForm = function SigmetForm(_ref) {
|
|
|
8290
8291
|
})]
|
|
8291
8292
|
})
|
|
8292
8293
|
}), jsx(IssuedAt, {
|
|
8293
|
-
date: getProductIssueDate(initialSigmet, initialCancelSigmet),
|
|
8294
|
+
date: getProductIssueDate(t, initialSigmet, initialCancelSigmet),
|
|
8294
8295
|
isReadOnly: isReadOnly
|
|
8295
8296
|
}), jsxs(Tac, {
|
|
8296
8297
|
tac: tac,
|
|
@@ -8387,11 +8388,13 @@ var AirmetForm = function AirmetForm(_ref) {
|
|
|
8387
8388
|
var _React$useState = React__default.useState(getDefaultPhenomena(productConfig).phenomena),
|
|
8388
8389
|
phenomenaList = _React$useState[0],
|
|
8389
8390
|
setPhenomenaList = _React$useState[1];
|
|
8391
|
+
var _useSigmetAirmetTrans = useSigmetAirmetTranslation(),
|
|
8392
|
+
t = _useSigmetAirmetTrans.t;
|
|
8390
8393
|
var _useApiContext = useApiContext(),
|
|
8391
8394
|
api = _useApiContext.api;
|
|
8392
8395
|
var firBorderAtStart = initialAirmet ? initialAirmet.locationIndicatorATSR : productConfig.active_firs[0];
|
|
8393
8396
|
var _useMapDrawTool = useMapDrawTool({
|
|
8394
|
-
defaultDrawModes: getDrawTools(StartOrEndDrawing.start, getFir(productConfig, firBorderAtStart)),
|
|
8397
|
+
defaultDrawModes: getDrawTools(t, StartOrEndDrawing.start, getFir(productConfig, firBorderAtStart)),
|
|
8395
8398
|
defaultGeoJSON: !isCancelAirmet && initialAirmet && initialAirmet.startGeometry ? addFeatureProperties(initialAirmet.startGeometry, featurePropsStart) : undefined,
|
|
8396
8399
|
defaultGeoJSONIntersection: !isCancelAirmet && initialAirmet && initialAirmet.startGeometryIntersect ? addFeatureProperties(initialAirmet.startGeometryIntersect, featurePropsIntersectionStart) : undefined,
|
|
8397
8400
|
defaultGeoJSONIntersectionBounds: addFeatureProperties(getFir(productConfig, firBorderAtStart), featurePropsFIR)
|
|
@@ -8452,7 +8455,7 @@ var AirmetForm = function AirmetForm(_ref) {
|
|
|
8452
8455
|
setIsDisabled = _React$useState2[1];
|
|
8453
8456
|
var isReadOnly = mode === 'view';
|
|
8454
8457
|
var helperText = isReadOnly ? '' : 'Optional';
|
|
8455
|
-
var _useTAC = useTAC(initialAirmet !== null ? initialAirmet : initialCancelAirmet, getTAC || api.getAirmetTAC, getHasFormErrors),
|
|
8458
|
+
var _useTAC = useTAC(t, initialAirmet !== null ? initialAirmet : initialCancelAirmet, getTAC || api.getAirmetTAC, getHasFormErrors),
|
|
8456
8459
|
tac = _useTAC[0],
|
|
8457
8460
|
updateTac = _useTAC[1];
|
|
8458
8461
|
var onChangeForm = function onChangeForm() {
|
|
@@ -8574,7 +8577,7 @@ var AirmetForm = function AirmetForm(_ref) {
|
|
|
8574
8577
|
isReadOnly: isReadOnly
|
|
8575
8578
|
}), jsx(IssuedAt, {
|
|
8576
8579
|
isReadOnly: isReadOnly,
|
|
8577
|
-
date: getProductIssueDate(initialAirmet, initialCancelAirmet)
|
|
8580
|
+
date: getProductIssueDate(t, initialAirmet, initialCancelAirmet)
|
|
8578
8581
|
}), jsxs(Tac, {
|
|
8579
8582
|
tac: tac,
|
|
8580
8583
|
product: product,
|
|
@@ -8780,6 +8783,8 @@ var ProductFormDialogContent = function ProductFormDialogContent(_ref) {
|
|
|
8780
8783
|
productConfig = _ref.productConfig,
|
|
8781
8784
|
productCanBe = _ref.productCanBe,
|
|
8782
8785
|
product = _ref.product;
|
|
8786
|
+
var _useSigmetAirmetTrans = useSigmetAirmetTranslation(),
|
|
8787
|
+
t = _useSigmetAirmetTrans.t;
|
|
8783
8788
|
var _useApiContext = useApiContext(),
|
|
8784
8789
|
api = _useApiContext.api;
|
|
8785
8790
|
var apiCall = productType === 'sigmet' ? api.postSigmet : api.postAirmet;
|
|
@@ -8833,10 +8838,10 @@ var ProductFormDialogContent = function ProductFormDialogContent(_ref) {
|
|
|
8833
8838
|
};
|
|
8834
8839
|
var showConfirmDialog = function showConfirmDialog(action) {
|
|
8835
8840
|
return confirmationDialog({
|
|
8836
|
-
title: getConfirmationDialogTitle(action, productType),
|
|
8837
|
-
description: getConfirmationDialogContent(action, productType),
|
|
8838
|
-
confirmLabel: getConfirmationDialogButtonLabel(action, productType),
|
|
8839
|
-
cancelLabel: getConfirmationDialogCancelLabel(action),
|
|
8841
|
+
title: getConfirmationDialogTitle(t, action, productType),
|
|
8842
|
+
description: getConfirmationDialogContent(t, action, productType),
|
|
8843
|
+
confirmLabel: getConfirmationDialogButtonLabel(t, action, productType),
|
|
8844
|
+
cancelLabel: getConfirmationDialogCancelLabel(t, action),
|
|
8840
8845
|
catchOnCancel: action === ProductAction.CLOSE,
|
|
8841
8846
|
content: isVAPhenomenon(product, action) && !isShortTest() ? jsx(CancelSigmetVolcanicMovements, {
|
|
8842
8847
|
sigmet: product,
|
|
@@ -8904,7 +8909,7 @@ var ProductFormDialogContent = function ProductFormDialogContent(_ref) {
|
|
|
8904
8909
|
break;
|
|
8905
8910
|
}
|
|
8906
8911
|
};
|
|
8907
|
-
var title = getDialogtitle(product, productType, productConfig);
|
|
8912
|
+
var title = getDialogtitle(t, product, productType, productConfig);
|
|
8908
8913
|
return jsxs(ContentDialog, {
|
|
8909
8914
|
open: isOpen,
|
|
8910
8915
|
toggleDialogStatus: function toggleDialogStatus() {
|
|
@@ -8923,7 +8928,7 @@ var ProductFormDialogContent = function ProductFormDialogContent(_ref) {
|
|
|
8923
8928
|
title: "An error has occurred while saving, please try again",
|
|
8924
8929
|
info: errorStoreMessageText
|
|
8925
8930
|
}) : null,
|
|
8926
|
-
options:
|
|
8931
|
+
options: ProductFormLifecycleButtons({
|
|
8927
8932
|
canBe: productCanBe,
|
|
8928
8933
|
onButtonPress: onProductButtonPress,
|
|
8929
8934
|
productType: productType,
|
|
@@ -9195,10 +9200,10 @@ var ProductListRow = function ProductListRow(_ref2) {
|
|
|
9195
9200
|
if (shouldRetrieveTAC(product)) {
|
|
9196
9201
|
retrieveTAC(product);
|
|
9197
9202
|
} else if (isMounted.current) {
|
|
9198
|
-
setTAC(noTAC);
|
|
9203
|
+
setTAC(noTAC(t));
|
|
9199
9204
|
}
|
|
9200
9205
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
9201
|
-
}, [product, apiCall]);
|
|
9206
|
+
}, [product, apiCall, t]);
|
|
9202
9207
|
var cancelsSeqId = isInstanceOfCancelSigmetOrAirmet(product) ? getCancelSeqId(product) : null;
|
|
9203
9208
|
var fir = product.firName || '';
|
|
9204
9209
|
var phenomenon = isInstanceOfSigmetOrAirmet(product) && product.phenomenon ? product.phenomenon : null;
|
|
@@ -12257,4 +12262,4 @@ ConnectedModuleWrapper) {
|
|
|
12257
12262
|
}
|
|
12258
12263
|
};
|
|
12259
12264
|
|
|
12260
|
-
export { AirmetComponentsLookUp, AirmetForm, AirmetType, CloudLevelUnits, ContentDialog, DEFAULT_MINIMUM_SURFACE_LEVEL, DEFAULT_MIN_MOVEMENT_SPEED, DEFAULT_MIN_VISIBILITY, DEFAULT_MIN_WIND_SPEED, Direction, DownloadSigmetAirmetConfigWrapper, LevelUnits, MapViewGeoJson, MetInfoWrapper, MovementUnit, ProductAction, ProductFormDialog, ProductList, ProductListRow, ProductStatusDescription, SA_NAMESPACE, SigmetComponentsLookUp, SigmetForm, SigmetType, StartOrEndDrawing, VisibilityCause, WindUnit, airmetConfig, createAirmetPostParameter, createApi$1 as createApi, createApi as createFakeApi, createSigmetPostParameter, extractUnitsToShow, fakeAirmetList, fakeSigmetList, firSelectionType, getActiveFIRArea, getAllFirAreas, getAllowedUnits, getBaseLayers, getConfirmationDialogButtonLabel, getConfirmationDialogCancelLabel, getConfirmationDialogContent, getConfirmationDialogTitle, getDefaultPhenomena, getDefaultValidUntilValue, getDefaultValidityMinutesFromConfig, getDialogtitle, getDrawTools, getFieldLabel, getFir, getFirArea, getFirOptions, getHoursBeforeValidity, getLevelInFeet, getMaxCloudLevelValue, getMaxCloudLowerLevelValue, getMaxHoursOfValidity, getMaxLevelValue, getMaxMovementSpeedValue, getMaxPolygonPoints, getMaxVisibilityValue, getMaxWindSpeedValue, getMinCloudLevelValue, getMinCloudLowerLevelValue, getMinLevelValue, getMinMovementSpeedValue, getMinVisibilityValue, getMinWindSpeedValue, getOmitChangeFromConfig, getPhenomenon,
|
|
12265
|
+
export { AirmetComponentsLookUp, AirmetForm, AirmetType, CloudLevelUnits, ContentDialog, DEFAULT_MINIMUM_SURFACE_LEVEL, DEFAULT_MIN_MOVEMENT_SPEED, DEFAULT_MIN_VISIBILITY, DEFAULT_MIN_WIND_SPEED, Direction, DownloadSigmetAirmetConfigWrapper, LevelUnits, MapViewGeoJson, MetInfoWrapper, MovementUnit, ProductAction, ProductFormDialog, ProductFormLifecycleButtons, ProductList, ProductListRow, ProductStatusDescription, SA_NAMESPACE, SigmetComponentsLookUp, SigmetForm, SigmetType, StartOrEndDrawing, VisibilityCause, WindUnit, airmetConfig, createAirmetPostParameter, createApi$1 as createApi, createApi as createFakeApi, createSigmetPostParameter, extractUnitsToShow, fakeAirmetList, fakeSigmetList, firSelectionType, getActiveFIRArea, getAllFirAreas, getAllowedUnits, getBaseLayers, getConfirmationDialogButtonLabel, getConfirmationDialogCancelLabel, getConfirmationDialogContent, getConfirmationDialogTitle, getDefaultPhenomena, getDefaultValidUntilValue, getDefaultValidityMinutesFromConfig, getDialogtitle, getDrawTools, getFieldLabel, getFir, getFirArea, getFirOptions, getHoursBeforeValidity, getLevelInFeet, getMaxCloudLevelValue, getMaxCloudLowerLevelValue, getMaxHoursOfValidity, getMaxLevelValue, getMaxMovementSpeedValue, getMaxPolygonPoints, getMaxVisibilityValue, getMaxWindSpeedValue, getMinCloudLevelValue, getMinCloudLowerLevelValue, getMinLevelValue, getMinMovementSpeedValue, getMinVisibilityValue, getMinWindSpeedValue, getOmitChangeFromConfig, getPhenomenon, getProductFormMode, getProductIssueDate, getProjection, getToolIcon, getValidFromDelayTimeMinutesFromConfig, hasMaxFeaturePoints, hasValue, isFir, isInstanceOfAirmet, isInstanceOfCancelAirmet, isInstanceOfCancelSigmet, isInstanceOfCancelSigmetOrAirmet, isInstanceOfSigmet, isInstanceOfSigmetOrAirmet, isLevelLower, prepareFormValues, prepareProductValues, sigmetAirmetTranslations as saTranslations, sigmetConfig, triggerValidations, updateDrawToolsWithFir, useDelayedFormValues, useFormLayers };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/sigmet-airmet",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.1.0",
|
|
4
4
|
"description": "GeoWeb Sigmet/Airmet library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -8,44 +8,30 @@
|
|
|
8
8
|
"url": "git@gitlab.com:opengeoweb/opengeoweb.git"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@
|
|
12
|
-
"@
|
|
13
|
-
"@
|
|
11
|
+
"@opengeoweb/api": "12.1.0",
|
|
12
|
+
"@opengeoweb/shared": "12.1.0",
|
|
13
|
+
"@opengeoweb/theme": "12.1.0",
|
|
14
|
+
"@opengeoweb/store": "12.1.0",
|
|
15
|
+
"@opengeoweb/webmap": "12.1.0",
|
|
16
|
+
"@opengeoweb/webmap-react": "12.1.0",
|
|
17
|
+
"react-redux": "^8.1.3",
|
|
18
|
+
"@opengeoweb/core": "12.1.0",
|
|
19
|
+
"@opengeoweb/authentication": "12.1.0",
|
|
14
20
|
"@mui/system": "^6.1.1",
|
|
15
|
-
"@
|
|
16
|
-
"
|
|
17
|
-
"@sentry/react": "8.54.0",
|
|
18
|
-
"@storybook/core-events": "8.4.2",
|
|
19
|
-
"@storybook/preview-api": "8.4.2",
|
|
20
|
-
"@storybook/react": "8.4.2",
|
|
21
|
-
"@tanstack/query-core": "5.67.1",
|
|
22
|
-
"@tanstack/react-query": "^5.67.1",
|
|
23
|
-
"@testing-library/react": "16.0.1",
|
|
24
|
-
"@testing-library/user-event": "14.5.2",
|
|
25
|
-
"@turf/turf": "7.2.0",
|
|
21
|
+
"@opengeoweb/form-fields": "12.1.0",
|
|
22
|
+
"react-hook-form": "^7.50.1",
|
|
26
23
|
"axios": "^1.7.7",
|
|
27
|
-
"date-fns": "4.1.0",
|
|
28
|
-
"dompurify": "3.2.4",
|
|
29
|
-
"i18next": "^23.11.5",
|
|
30
|
-
"immer": "10.1.1",
|
|
31
|
-
"jest-canvas-mock": "2.5.2",
|
|
32
|
-
"jest-date-mock": "1.0.10",
|
|
33
24
|
"lodash": "^4.17.21",
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"proj4": "2.15.0",
|
|
38
|
-
"re-resizable": "6.11.2",
|
|
39
|
-
"react": "18.3.1",
|
|
40
|
-
"react-draggable": "4.4.6",
|
|
41
|
-
"react-hook-form": "^7.50.1",
|
|
25
|
+
"@reduxjs/toolkit": "^1.9.7",
|
|
26
|
+
"i18next": "^23.11.5",
|
|
27
|
+
"@mui/material": "^6.1.1",
|
|
42
28
|
"react-i18next": "^15.1.1",
|
|
43
|
-
"react-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"react
|
|
47
|
-
"react
|
|
48
|
-
"
|
|
29
|
+
"@tanstack/react-query": "^5.67.1"
|
|
30
|
+
},
|
|
31
|
+
"peerDependencies": {
|
|
32
|
+
"react": "18",
|
|
33
|
+
"@emotion/react": "*",
|
|
34
|
+
"@emotion/styled": "*"
|
|
49
35
|
},
|
|
50
36
|
"module": "./index.esm.js",
|
|
51
37
|
"type": "module",
|
|
@@ -4,11 +4,11 @@ import { ConfigurableFormFieldProps, ProductConfig } from '../../../types';
|
|
|
4
4
|
export declare const DEFAULT_ROUNDING_LEVELS_FL = 5;
|
|
5
5
|
export declare const DEFAULT_ROUNDING_LEVELS_FT = 500;
|
|
6
6
|
export declare const DEFAULT_ROUNDING_LEVELS_M = 1;
|
|
7
|
-
export declare const getLevelInvalidStepsForFLUnitMessage: (value?: number) => string;
|
|
8
|
-
export declare const getLevelInvalidStepsForFTUnitMessage: (value?: number) => string;
|
|
9
|
-
export declare const getLevelInvalidStepsForMUnitMessage: (value?: number) => string;
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const validateLevels: (value: string, unit: string, productConfig: ProductConfig, selectedFIR: string) => boolean | string;
|
|
12
|
-
export declare const validateLevelUnitCombinations: (
|
|
7
|
+
export declare const getLevelInvalidStepsForFLUnitMessage: (t: TFunction, value?: number) => string;
|
|
8
|
+
export declare const getLevelInvalidStepsForFTUnitMessage: (t: TFunction, value?: number) => string;
|
|
9
|
+
export declare const getLevelInvalidStepsForMUnitMessage: (t: TFunction, value?: number) => string;
|
|
10
|
+
export declare const getInvalidUnitMessage: (t: TFunction) => string;
|
|
11
|
+
export declare const validateLevels: (t: TFunction, value: string, unit: string, productConfig: ProductConfig, selectedFIR: string) => boolean | string;
|
|
12
|
+
export declare const validateLevelUnitCombinations: (t: TFunction, levelUnit: string, lowerLevelUnit: string) => boolean | string;
|
|
13
13
|
declare const Levels: React.FC<ConfigurableFormFieldProps>;
|
|
14
14
|
export default Levels;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { TFunction } from 'i18next';
|
|
2
3
|
import { DrawMode } from '@opengeoweb/webmap-react';
|
|
3
4
|
import { ConfigurableFormFieldProps, ProductConfig } from '../../../types';
|
|
4
5
|
export declare const DEFAULT_ROUNDING_MOVEMENT_KT = 5;
|
|
5
6
|
export declare const DEFAULT_ROUNDING_MOVEMENT_KMH = 10;
|
|
6
|
-
export declare const getMovementStepValKTMessage: (value?: number) => string;
|
|
7
|
-
export declare const getMovementStepValKMHMessage: (value?: number) => string;
|
|
8
|
-
export declare const validateMovementSteps: (value: string, unit: string, productConfig: ProductConfig, selectedFIR: string) => boolean | string;
|
|
7
|
+
export declare const getMovementStepValKTMessage: (t: TFunction, value?: number) => string;
|
|
8
|
+
export declare const getMovementStepValKMHMessage: (t: TFunction, value?: number) => string;
|
|
9
|
+
export declare const validateMovementSteps: (t: TFunction, value: string, unit: string, productConfig: ProductConfig, selectedFIR: string) => boolean | string;
|
|
9
10
|
interface ProgressProps extends ConfigurableFormFieldProps {
|
|
10
11
|
geoJSON?: GeoJSON.FeatureCollection;
|
|
11
12
|
geoJSONIntersection?: GeoJSON.FeatureCollection;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { TFunction } from 'i18next';
|
|
2
3
|
import { ConfigurableFormFieldProps, ProductConfig } from '../../../types';
|
|
3
4
|
export declare const DEFAULT_ROUNDING_SURFACE_VISIBLILITY_BELOW = 50;
|
|
4
5
|
export declare const DEFAULT_ROUNDING_SURFACE_VISIBLILITY_ABOVE = 100;
|
|
5
|
-
export declare const getInvalidSurfaceVisibilityTill750StepsMessage: (value?: number) => string;
|
|
6
|
-
export declare const getInvalidSurfaceVisibilityFrom750StepsMessage: (value?: number) => string;
|
|
7
|
-
export declare const validateSurfaceVisibility: (value: string, productConfig: ProductConfig, selectedFIR: string) => boolean | string;
|
|
6
|
+
export declare const getInvalidSurfaceVisibilityTill750StepsMessage: (t: TFunction, value?: number) => string;
|
|
7
|
+
export declare const getInvalidSurfaceVisibilityFrom750StepsMessage: (t: TFunction, value?: number) => string;
|
|
8
|
+
export declare const validateSurfaceVisibility: (t: TFunction, value: string, productConfig: ProductConfig, selectedFIR: string) => boolean | string;
|
|
8
9
|
declare const SurfaceVisibility: React.FC<ConfigurableFormFieldProps>;
|
|
9
10
|
export default SurfaceVisibility;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { TFunction } from 'i18next';
|
|
2
3
|
import { ConfigurableFormFieldProps, ProductConfig } from '../../../types';
|
|
3
4
|
export declare const DEFAULT_ROUNDING_SURFACE_WIND_DIRECTION = 10;
|
|
4
|
-
export declare const invalidSurfaceWindDirectionStepsMessage: (value?: number) => string;
|
|
5
|
-
export declare const validateSurfaceWindDirection: (value: string, productConfig: ProductConfig, selectedFIR: string) => boolean | string;
|
|
5
|
+
export declare const invalidSurfaceWindDirectionStepsMessage: (t: TFunction, value?: number) => string;
|
|
6
|
+
export declare const validateSurfaceWindDirection: (t: TFunction, value: string, productConfig: ProductConfig, selectedFIR: string) => boolean | string;
|
|
6
7
|
declare const SurfaceWind: React.FC<ConfigurableFormFieldProps>;
|
|
7
8
|
export default SurfaceWind;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { TFunction } from 'i18next';
|
|
2
3
|
import { ConfigurableFormFieldProps, ProductConfig } from '../../../types';
|
|
3
|
-
export declare const getValidFromXHoursBeforeMessage: (hours: number) => string;
|
|
4
|
+
export declare const getValidFromXHoursBeforeMessage: (t: TFunction, hours: number) => string;
|
|
4
5
|
export declare const getDefaultValidFromValue: (productConfig: ProductConfig) => string;
|
|
5
6
|
declare const ValidFrom: React.FC<ConfigurableFormFieldProps>;
|
|
6
7
|
export default ValidFrom;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { TFunction } from 'i18next';
|
|
2
3
|
import { CancelSigmet, Sigmet, Airmet, CancelAirmet } from '../../types';
|
|
3
4
|
type AviationProduct = Sigmet | CancelSigmet | Airmet | CancelAirmet;
|
|
4
|
-
export declare const noTAC: string;
|
|
5
|
+
export declare const noTAC: (t: TFunction) => string;
|
|
5
6
|
export declare const isLevelFieldsComplete: (product: Sigmet | Airmet) => boolean;
|
|
6
7
|
export declare const isChangeComplete: (product: Sigmet | Airmet, omitChange?: boolean) => boolean;
|
|
7
8
|
export declare const isSurfaceVisComplete: (product: Sigmet | Airmet) => boolean;
|
|
8
9
|
export declare const shouldRetrieveTAC: (product: AviationProduct, omitChange?: boolean) => boolean;
|
|
9
|
-
export declare const useTAC: (initialProduct: AviationProduct, getTAC: (product: AviationProduct) => Promise<{
|
|
10
|
+
export declare const useTAC: (t: TFunction, initialProduct: AviationProduct, getTAC: (product: AviationProduct) => Promise<{
|
|
10
11
|
data: string;
|
|
11
12
|
}>, hasErrors?: () => boolean, omitChange?: boolean) => [string, any];
|
|
12
13
|
interface ProductFormTACProps {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { TFunction } from 'i18next';
|
|
2
3
|
import { FieldValues, UseFormGetValues, UseFormTrigger } from 'react-hook-form';
|
|
3
4
|
import { layerTypes, mapTypes } from '@opengeoweb/store';
|
|
4
5
|
import { DrawMode, OpenLayersLayerProps } from '@opengeoweb/webmap-react';
|
|
@@ -36,7 +37,7 @@ export declare const getFirOptions: (productConfig: ProductConfig) => {
|
|
|
36
37
|
export declare const getLevelInFeet: (level: number, unit: string) => number;
|
|
37
38
|
export declare const isLevelLower: (ownValue: number | string, ownUnit: LevelUnits, otherValue: number, otherUnit: LevelUnits) => boolean;
|
|
38
39
|
export declare const getPhenomenon: (selectedFIR: string, phenomenon: string, productConfig: ProductConfig) => string | undefined;
|
|
39
|
-
export declare const getDialogtitle: (product: AviationProduct, productType: ProductType, productConfig: ProductConfig) => string;
|
|
40
|
+
export declare const getDialogtitle: (t: TFunction, product: AviationProduct, productType: ProductType, productConfig: ProductConfig) => string;
|
|
40
41
|
export declare const getProductFormMode: (canBeOptions: ProductCanbe[] | undefined, productListItem: SigmetFromBackend | AirmetFromBackend | null) => string;
|
|
41
42
|
interface ProductFormLifecycleButtonsProps {
|
|
42
43
|
canBe: string[];
|
|
@@ -44,17 +45,17 @@ interface ProductFormLifecycleButtonsProps {
|
|
|
44
45
|
onButtonPress: (newStatus: ProductAction) => void;
|
|
45
46
|
areActionsDisabled?: boolean;
|
|
46
47
|
}
|
|
47
|
-
export declare const
|
|
48
|
+
export declare const ProductFormLifecycleButtons: React.FC<ProductFormLifecycleButtonsProps>;
|
|
48
49
|
export declare const hasValue: (value: number | string) => boolean;
|
|
49
50
|
export declare const prepareFormValues: <T extends AviationProduct>(product: T) => T;
|
|
50
51
|
export declare const createSigmetPostParameter: (sigmetToPost: Sigmet | CancelSigmet, newStatus: ProductStatus, previousUuid: string) => SigmetFromFrontend;
|
|
51
52
|
export declare const createAirmetPostParameter: (airmetToPost: Airmet | CancelAirmet, newStatus: ProductStatus, previousUuid: string) => AirmetFromFrontend;
|
|
52
53
|
export declare const useDelayedFormValues: (getValues: () => void, register: () => void, delay?: number) => [unknown, () => void];
|
|
53
|
-
export declare const getConfirmationDialogTitle: (action: ProductAction, productType: ProductType) => string;
|
|
54
|
-
export declare const getConfirmationDialogContent: (action: ProductAction, productType: ProductType) => string;
|
|
55
|
-
export declare const getConfirmationDialogButtonLabel: (action: ProductAction, productType: ProductType) => string;
|
|
56
|
-
export declare const getConfirmationDialogCancelLabel: (action: ProductAction) => string;
|
|
57
|
-
export declare const getProductIssueDate: (initialProduct: Sigmet | Airmet, initialCancelProduct: CancelSigmet | CancelAirmet) => string;
|
|
54
|
+
export declare const getConfirmationDialogTitle: (t: TFunction, action: ProductAction, productType: ProductType) => string;
|
|
55
|
+
export declare const getConfirmationDialogContent: (t: TFunction, action: ProductAction, productType: ProductType) => string;
|
|
56
|
+
export declare const getConfirmationDialogButtonLabel: (t: TFunction, action: ProductAction, productType: ProductType) => string;
|
|
57
|
+
export declare const getConfirmationDialogCancelLabel: (t: TFunction, action: ProductAction) => string;
|
|
58
|
+
export declare const getProductIssueDate: (t: TFunction, initialProduct: Sigmet | Airmet, initialCancelProduct: CancelSigmet | CancelAirmet) => string;
|
|
58
59
|
export declare const extractUnitsToShow: (configUnits: string[], unitType: Record<string, string>) => Record<string, string>;
|
|
59
60
|
export declare const getAllowedUnits: (selectedFIR: string, productConfig: ProductConfig, config_type: string, unitType: Record<string, string>) => Record<string, string>;
|
|
60
61
|
/**
|
|
@@ -65,7 +66,7 @@ export declare const getFir: (productConfig: ProductConfig, firName?: string) =>
|
|
|
65
66
|
* Function to check if the given geojson object has 'fir' selectionType property
|
|
66
67
|
*/
|
|
67
68
|
export declare const isFir: (geojson: GeoJSON.FeatureCollection) => boolean;
|
|
68
|
-
export declare const getFieldLabel: (title: string, isDisabled: boolean, action?: string) => string;
|
|
69
|
+
export declare const getFieldLabel: (t: TFunction, title: string, isDisabled: boolean, action?: string) => string;
|
|
69
70
|
export declare const getBaseLayers: (productConfig: ProductConfig) => layerTypes.Layer[];
|
|
70
71
|
export declare const getMaxMovementSpeedValue: (unit: string, selectedFIR: string, productConfig: ProductConfig) => number | null;
|
|
71
72
|
export declare const DEFAULT_MIN_MOVEMENT_SPEED = 0;
|
|
@@ -74,7 +75,7 @@ export declare const getMinMovementSpeedValue: (unit: string, selectedFIR: strin
|
|
|
74
75
|
export declare const triggerValidations: (fieldNames: string[], getValues: UseFormGetValues<FieldValues>, trigger: UseFormTrigger<FieldValues>) => void;
|
|
75
76
|
export declare const getProjection: (productConfig: ProductConfig) => mapTypes.MapPreset['proj'];
|
|
76
77
|
export declare const firSelectionType = "fir";
|
|
77
|
-
export declare const getDrawTools: (type: StartOrEndDrawing, firShape: GeoJSON.FeatureCollection) => DrawMode[];
|
|
78
|
+
export declare const getDrawTools: (t: TFunction, type: StartOrEndDrawing, firShape: GeoJSON.FeatureCollection) => DrawMode[];
|
|
78
79
|
export declare const updateDrawToolsWithFir: (drawTools: DrawMode[], newFirShape: GeoJSON.FeatureCollection) => DrawMode[];
|
|
79
80
|
export declare const getToolIcon: (selectionType: string) => React.ReactElement;
|
|
80
81
|
export declare const useFormLayers: (layers: OpenLayersLayerProps[]) => void;
|