@opengeoweb/sigmet-airmet 9.0.0 → 9.2.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 +87 -36
- package/package.json +1 -1
- package/src/lib/components/ComponentsLookUp/AviationProductApiWrapper.d.ts +1 -1
- package/src/lib/components/MetInfoWrapper/DownloadSigmetAirmetConfigWrapper.d.ts +2 -1
- package/src/lib/components/MetInfoWrapper/utils.d.ts +1 -0
- package/src/lib/components/ProductForms/SigmetForm/SigmetForm.d.ts +1 -0
- package/src/lib/components/ProductForms/utils.d.ts +7 -1
- package/src/lib/utils/api.d.ts +2 -2
package/index.esm.js
CHANGED
|
@@ -14,6 +14,7 @@ import 'react-dom';
|
|
|
14
14
|
import { mapSelectors, syncGroupsActions, mapStoreActions, defaultLayers, syncConstants } from '@opengeoweb/store';
|
|
15
15
|
import { LayerManagerMapButtonConnect, LegendMapButtonConnect, MultiDimensionSelectMapButtonsConnect, MapViewConnect, LegendConnect, LayerManagerConnect } from '@opengeoweb/core';
|
|
16
16
|
import { TimeSliderConnect } from '@opengeoweb/timeslider';
|
|
17
|
+
import { useAuthenticationContext } from '@opengeoweb/authentication';
|
|
17
18
|
import { jsx } from 'react/jsx-runtime';
|
|
18
19
|
|
|
19
20
|
function _iterableToArrayLimit(r, l) {
|
|
@@ -1046,7 +1047,11 @@ var getProductFormMode = function getProductFormMode(canBeOptions, productListIt
|
|
|
1046
1047
|
var buttonStyle = {
|
|
1047
1048
|
minWidth: 96
|
|
1048
1049
|
};
|
|
1049
|
-
var getProductFormLifecycleButtons = function getProductFormLifecycleButtons(
|
|
1050
|
+
var getProductFormLifecycleButtons = function getProductFormLifecycleButtons(_ref) {
|
|
1051
|
+
var canBe = _ref.canBe,
|
|
1052
|
+
onButtonPress = _ref.onButtonPress,
|
|
1053
|
+
_ref$areActionsDisabl = _ref.areActionsDisabled,
|
|
1054
|
+
areActionsDisabled = _ref$areActionsDisabl === void 0 ? false : _ref$areActionsDisabl;
|
|
1050
1055
|
var hasDiscardButton = canBe.includes('DISCARDED');
|
|
1051
1056
|
var onDiscard = function onDiscard() {
|
|
1052
1057
|
return onButtonPress('DISCARDED');
|
|
@@ -1068,13 +1073,15 @@ var getProductFormLifecycleButtons = function getProductFormLifecycleButtons(can
|
|
|
1068
1073
|
action: onDiscard
|
|
1069
1074
|
}] : []), _toConsumableArray(hasSaveButton ? [{
|
|
1070
1075
|
text: 'Save',
|
|
1071
|
-
action: onSave
|
|
1076
|
+
action: onSave,
|
|
1077
|
+
isDisabled: areActionsDisabled
|
|
1072
1078
|
}] : []), _toConsumableArray(hasCancelButton ? [{
|
|
1073
1079
|
text: 'Cancel',
|
|
1074
1080
|
action: onCancel
|
|
1075
1081
|
}] : []), _toConsumableArray(hasPublishButton ? [{
|
|
1076
1082
|
text: 'Publish',
|
|
1077
|
-
action: onPublish
|
|
1083
|
+
action: onPublish,
|
|
1084
|
+
isDisabled: areActionsDisabled
|
|
1078
1085
|
}] : []));
|
|
1079
1086
|
return /*#__PURE__*/React.createElement(Box$2, {
|
|
1080
1087
|
sx: {
|
|
@@ -1098,7 +1105,8 @@ var getProductFormLifecycleButtons = function getProductFormLifecycleButtons(can
|
|
|
1098
1105
|
variant: "tertiary",
|
|
1099
1106
|
onClick: onSave,
|
|
1100
1107
|
sx: buttonStyle,
|
|
1101
|
-
"data-testid": "productform-dialog-draft"
|
|
1108
|
+
"data-testid": "productform-dialog-draft",
|
|
1109
|
+
disabled: areActionsDisabled
|
|
1102
1110
|
}, "Save"), hasCancelButton && /*#__PURE__*/React.createElement(Button, {
|
|
1103
1111
|
variant: "tertiary",
|
|
1104
1112
|
onClick: onCancel,
|
|
@@ -1108,7 +1116,8 @@ var getProductFormLifecycleButtons = function getProductFormLifecycleButtons(can
|
|
|
1108
1116
|
variant: "primary",
|
|
1109
1117
|
onClick: onPublish,
|
|
1110
1118
|
sx: buttonStyle,
|
|
1111
|
-
"data-testid": "productform-dialog-publish"
|
|
1119
|
+
"data-testid": "productform-dialog-publish",
|
|
1120
|
+
disabled: areActionsDisabled
|
|
1112
1121
|
}, "Publish")), /*#__PURE__*/React.createElement(Box$2, {
|
|
1113
1122
|
display: {
|
|
1114
1123
|
lg: 'none'
|
|
@@ -2557,6 +2566,7 @@ var Type = function Type(_ref) {
|
|
|
2557
2566
|
isReadOnly: isReadOnly,
|
|
2558
2567
|
size: "small",
|
|
2559
2568
|
"data-testid": "type",
|
|
2569
|
+
defaultValue: "NORMAL",
|
|
2560
2570
|
onChange: function onChange() {
|
|
2561
2571
|
triggerValidations(['validDateStart', 'validDateEnd'], getValues, trigger);
|
|
2562
2572
|
_onChange();
|
|
@@ -8239,7 +8249,8 @@ var SigmetForm = function SigmetForm(_ref) {
|
|
|
8239
8249
|
_ref$showMap = _ref.showMap,
|
|
8240
8250
|
showMap = _ref$showMap === void 0 ? true : _ref$showMap,
|
|
8241
8251
|
_ref$productConfig = _ref.productConfig,
|
|
8242
|
-
productConfig = _ref$productConfig === void 0 ? sigmetConfig : _ref$productConfig
|
|
8252
|
+
productConfig = _ref$productConfig === void 0 ? sigmetConfig : _ref$productConfig,
|
|
8253
|
+
setDialogActionsDisabled = _ref.setDialogActionsDisabled;
|
|
8243
8254
|
var _useApiContext = useApiContext(),
|
|
8244
8255
|
api = _useApiContext.api;
|
|
8245
8256
|
var _useMapDrawTool = useMapDrawTool({
|
|
@@ -8341,7 +8352,7 @@ var SigmetForm = function SigmetForm(_ref) {
|
|
|
8341
8352
|
isDisabled = _React$useState2[0],
|
|
8342
8353
|
setIsDisabled = _React$useState2[1];
|
|
8343
8354
|
var isReadOnly = mode === 'view';
|
|
8344
|
-
var helperText =
|
|
8355
|
+
var helperText = isReadOnly ? '' : 'Optional';
|
|
8345
8356
|
var _useTAC = useTAC(initialSigmet !== null ? initialSigmet : initialCancelSigmet, api.getSigmetTAC, getHasFormErrors, getOmitChangeFromConfig(productConfig)),
|
|
8346
8357
|
_useTAC2 = _slicedToArray(_useTAC, 2),
|
|
8347
8358
|
tac = _useTAC2[0],
|
|
@@ -8351,10 +8362,11 @@ var SigmetForm = function SigmetForm(_ref) {
|
|
|
8351
8362
|
};
|
|
8352
8363
|
React__default.useEffect(function () {
|
|
8353
8364
|
var isInDrawMode = activeStartTool !== '' || activeEndTool !== '';
|
|
8365
|
+
setDialogActionsDisabled && setDialogActionsDisabled(isInDrawMode);
|
|
8354
8366
|
if (!isReadOnly && isInDrawMode !== isDisabled) {
|
|
8355
8367
|
setIsDisabled(isInDrawMode);
|
|
8356
8368
|
}
|
|
8357
|
-
}, [activeStartTool, activeEndTool, isReadOnly, isDisabled]);
|
|
8369
|
+
}, [activeStartTool, activeEndTool, isReadOnly, isDisabled, setDialogActionsDisabled]);
|
|
8358
8370
|
var _useConditionalFields = useConditionalFields$1(productConfig),
|
|
8359
8371
|
hasVolcanicAshes = _useConditionalFields.hasVolcanicAshes,
|
|
8360
8372
|
omitChange = _useConditionalFields.omitChange;
|
|
@@ -8611,7 +8623,7 @@ var AirmetForm = function AirmetForm(_ref) {
|
|
|
8611
8623
|
isDisabled = _React$useState2[0],
|
|
8612
8624
|
setIsDisabled = _React$useState2[1];
|
|
8613
8625
|
var isReadOnly = mode === 'view';
|
|
8614
|
-
var helperText =
|
|
8626
|
+
var helperText = isReadOnly ? '' : 'Optional';
|
|
8615
8627
|
var _useTAC = useTAC(initialAirmet !== null ? initialAirmet : initialCancelAirmet, api.getAirmetTAC, getHasFormErrors),
|
|
8616
8628
|
_useTAC2 = _slicedToArray(_useTAC, 2),
|
|
8617
8629
|
tac = _useTAC2[0],
|
|
@@ -8794,6 +8806,11 @@ var ContentDialog = function ContentDialog(_a) {
|
|
|
8794
8806
|
onClose: handleClose,
|
|
8795
8807
|
maxWidth: other.maxWidth ? other.maxWidth : 'lg'
|
|
8796
8808
|
}, other, {
|
|
8809
|
+
PaperProps: {
|
|
8810
|
+
sx: {
|
|
8811
|
+
height: '100%'
|
|
8812
|
+
}
|
|
8813
|
+
},
|
|
8797
8814
|
sx: {
|
|
8798
8815
|
'> div > .MuiPaper-root': {
|
|
8799
8816
|
minWidth: 300
|
|
@@ -9133,6 +9150,7 @@ var ProductListRow = function ProductListRow(_ref2) {
|
|
|
9133
9150
|
|
|
9134
9151
|
var ERROR_CONFIG = 'An error has occurred while loading the config';
|
|
9135
9152
|
var ERROR_BACKEND = 'An error has occurred while retrieving the list, please try again';
|
|
9153
|
+
var ERROR_AUTH$1 = 'This feature is protected by authentication.';
|
|
9136
9154
|
var validateConfig = function validateConfig(productType, productConfig) {
|
|
9137
9155
|
var validatedConfig = productType === 'sigmet' ? validateSigmet(productConfig) : validateAirmet(productConfig);
|
|
9138
9156
|
if (validatedConfig !== true && Array.isArray(validatedConfig)) {
|
|
@@ -9158,54 +9176,72 @@ var useProductApi = function useProductApi(productType, productConfig) {
|
|
|
9158
9176
|
var _useApiContext = useApiContext(),
|
|
9159
9177
|
api = _useApiContext.api;
|
|
9160
9178
|
var requestList = productType === 'sigmet' ? api.getSigmetList : api.getAirmetList;
|
|
9179
|
+
var _useAuthenticationCon = useAuthenticationContext(),
|
|
9180
|
+
isLoggedIn = _useAuthenticationCon.isLoggedIn;
|
|
9161
9181
|
var updateState = function updateState(newState) {
|
|
9162
9182
|
if (isMounted.current) {
|
|
9163
|
-
setState(
|
|
9183
|
+
setState(function (currentState) {
|
|
9184
|
+
return Object.assign(Object.assign({}, currentState), newState);
|
|
9185
|
+
});
|
|
9164
9186
|
}
|
|
9165
9187
|
};
|
|
9166
9188
|
var fetchNewData = function fetchNewData() {
|
|
9167
9189
|
return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
9168
|
-
var _a, _yield$requestList, data,
|
|
9190
|
+
var _a, newError, _yield$requestList, data, _newError;
|
|
9169
9191
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
9170
9192
|
while (1) switch (_context.prev = _context.next) {
|
|
9171
9193
|
case 0:
|
|
9194
|
+
if (!(!isLoggedIn && Array.isArray(isLoggedIn))) {
|
|
9195
|
+
_context.next = 4;
|
|
9196
|
+
break;
|
|
9197
|
+
}
|
|
9198
|
+
newError = {
|
|
9199
|
+
name: ERROR_AUTH$1,
|
|
9200
|
+
message: createReadableErrorMessage(isLoggedIn)
|
|
9201
|
+
};
|
|
9202
|
+
updateState(Object.assign(Object.assign({}, state), {
|
|
9203
|
+
error: newError,
|
|
9204
|
+
isLoading: false
|
|
9205
|
+
}));
|
|
9206
|
+
return _context.abrupt("return");
|
|
9207
|
+
case 4:
|
|
9172
9208
|
if (!(((_a = state.error) === null || _a === void 0 ? void 0 : _a.name) === ERROR_CONFIG || state.isLoading)) {
|
|
9173
|
-
_context.next =
|
|
9209
|
+
_context.next = 6;
|
|
9174
9210
|
break;
|
|
9175
9211
|
}
|
|
9176
9212
|
return _context.abrupt("return");
|
|
9177
|
-
case
|
|
9213
|
+
case 6:
|
|
9178
9214
|
updateState(Object.assign(Object.assign({}, state), {
|
|
9179
9215
|
isLoading: true,
|
|
9180
9216
|
error: undefined
|
|
9181
9217
|
}));
|
|
9182
|
-
_context.prev =
|
|
9183
|
-
_context.next =
|
|
9218
|
+
_context.prev = 7;
|
|
9219
|
+
_context.next = 10;
|
|
9184
9220
|
return requestList();
|
|
9185
|
-
case
|
|
9221
|
+
case 10:
|
|
9186
9222
|
_yield$requestList = _context.sent;
|
|
9187
9223
|
data = _yield$requestList.data;
|
|
9188
9224
|
updateState(Object.assign(Object.assign({}, state), {
|
|
9189
9225
|
result: data,
|
|
9190
9226
|
isLoading: false
|
|
9191
9227
|
}));
|
|
9192
|
-
_context.next =
|
|
9228
|
+
_context.next = 19;
|
|
9193
9229
|
break;
|
|
9194
|
-
case
|
|
9195
|
-
_context.prev =
|
|
9196
|
-
_context.t0 = _context["catch"](
|
|
9197
|
-
|
|
9230
|
+
case 15:
|
|
9231
|
+
_context.prev = 15;
|
|
9232
|
+
_context.t0 = _context["catch"](7);
|
|
9233
|
+
_newError = Object.assign(Object.assign({}, _context.t0), {
|
|
9198
9234
|
name: ERROR_BACKEND
|
|
9199
9235
|
});
|
|
9200
9236
|
updateState(Object.assign(Object.assign({}, state), {
|
|
9201
|
-
error:
|
|
9237
|
+
error: _newError,
|
|
9202
9238
|
isLoading: false
|
|
9203
9239
|
}));
|
|
9204
|
-
case
|
|
9240
|
+
case 19:
|
|
9205
9241
|
case "end":
|
|
9206
9242
|
return _context.stop();
|
|
9207
9243
|
}
|
|
9208
|
-
}, _callee, null, [[
|
|
9244
|
+
}, _callee, null, [[7, 15]]);
|
|
9209
9245
|
}));
|
|
9210
9246
|
};
|
|
9211
9247
|
React__default.useEffect(function () {
|
|
@@ -9247,7 +9283,7 @@ var ProductList = function ProductList(_ref) {
|
|
|
9247
9283
|
error = _ref.error,
|
|
9248
9284
|
onClickProductRow = _ref.onClickProductRow,
|
|
9249
9285
|
onClickNewProduct = _ref.onClickNewProduct;
|
|
9250
|
-
var shouldHideCreateNew = error && error.name === ERROR_CONFIG;
|
|
9286
|
+
var shouldHideCreateNew = error && (error.name === ERROR_AUTH$1 || error.name === ERROR_CONFIG);
|
|
9251
9287
|
return /*#__PURE__*/React__default.createElement(Grid, {
|
|
9252
9288
|
container: true,
|
|
9253
9289
|
direction: "column",
|
|
@@ -9281,7 +9317,7 @@ var ProductList = function ProductList(_ref) {
|
|
|
9281
9317
|
}
|
|
9282
9318
|
}), error && /*#__PURE__*/React__default.createElement(AlertBanner, {
|
|
9283
9319
|
severity: "error",
|
|
9284
|
-
title: error.name
|
|
9320
|
+
title: error.name,
|
|
9285
9321
|
info: error.message ? error.message : '',
|
|
9286
9322
|
dataTestId: "productList-alert"
|
|
9287
9323
|
}), productList && /*#__PURE__*/React__default.createElement(List, {
|
|
@@ -14054,6 +14090,10 @@ var ProductFormDialogContent = function ProductFormDialogContent(_ref) {
|
|
|
14054
14090
|
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
14055
14091
|
errorStoreMessageText = _React$useState6[0],
|
|
14056
14092
|
setErrorStoreMessageText = _React$useState6[1];
|
|
14093
|
+
var _React$useState7 = React.useState(false),
|
|
14094
|
+
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
14095
|
+
dialogActionsDisabled = _React$useState8[0],
|
|
14096
|
+
setDialogActionsDisabled = _React$useState8[1];
|
|
14057
14097
|
var postProduct = function postProduct(productToPost, newStatus) {
|
|
14058
14098
|
var uuid = product !== null && product.uuid ? product.uuid : null;
|
|
14059
14099
|
var postProductParam = productType === 'sigmet' ? createSigmetPostParameter(productToPost, newStatus, uuid) : createAirmetPostParameter(productToPost, newStatus, uuid);
|
|
@@ -14164,7 +14204,11 @@ var ProductFormDialogContent = function ProductFormDialogContent(_ref) {
|
|
|
14164
14204
|
title: "An error has occurred while saving, please try again",
|
|
14165
14205
|
info: errorStoreMessageText
|
|
14166
14206
|
}) : null,
|
|
14167
|
-
options: getProductFormLifecycleButtons(
|
|
14207
|
+
options: getProductFormLifecycleButtons({
|
|
14208
|
+
canBe: productCanBe,
|
|
14209
|
+
onButtonPress: onProductButtonPress,
|
|
14210
|
+
areActionsDisabled: dialogActionsDisabled
|
|
14211
|
+
}),
|
|
14168
14212
|
style: {
|
|
14169
14213
|
zIndex: 1000
|
|
14170
14214
|
},
|
|
@@ -14178,7 +14222,8 @@ var ProductFormDialogContent = function ProductFormDialogContent(_ref) {
|
|
|
14178
14222
|
isCancelSigmet: product !== null && isInstanceOfCancelSigmet(product),
|
|
14179
14223
|
initialSigmet: product !== null && !isInstanceOfCancelSigmet(product) ? product : null,
|
|
14180
14224
|
initialCancelSigmet: product !== null && isInstanceOfCancelSigmet(product) ? product : null,
|
|
14181
|
-
productConfig: productConfig
|
|
14225
|
+
productConfig: productConfig,
|
|
14226
|
+
setDialogActionsDisabled: setDialogActionsDisabled
|
|
14182
14227
|
}) : /*#__PURE__*/React.createElement(AirmetForm, {
|
|
14183
14228
|
mode: mode,
|
|
14184
14229
|
isCancelAirmet: product !== null && isInstanceOfCancelAirmet(product),
|
|
@@ -14283,10 +14328,7 @@ var MetInfoWrapper = function MetInfoWrapper(_ref) {
|
|
|
14283
14328
|
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
14284
14329
|
selectedProduct = _React$useState4[0],
|
|
14285
14330
|
setSelectedProduct = _React$useState4[1];
|
|
14286
|
-
|
|
14287
|
-
fetchNewProductList();
|
|
14288
|
-
};
|
|
14289
|
-
usePoller([productList, errorList], getNewProductList, 60000);
|
|
14331
|
+
usePoller([productList, errorList], fetchNewProductList, 60000);
|
|
14290
14332
|
React__default.useEffect(function () {
|
|
14291
14333
|
if (selectedProduct) {
|
|
14292
14334
|
toggleDialogOpen();
|
|
@@ -14297,7 +14339,7 @@ var MetInfoWrapper = function MetInfoWrapper(_ref) {
|
|
|
14297
14339
|
var shouldRefreshList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
14298
14340
|
// Refresh list on closing dialog
|
|
14299
14341
|
if (isFormDialogOpen === true && shouldRefreshList) {
|
|
14300
|
-
|
|
14342
|
+
fetchNewProductList();
|
|
14301
14343
|
}
|
|
14302
14344
|
setIsFormDialogOpen(!isFormDialogOpen);
|
|
14303
14345
|
};
|
|
@@ -14353,11 +14395,14 @@ var MetInfoWrapper = function MetInfoWrapper(_ref) {
|
|
|
14353
14395
|
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
14354
14396
|
* */
|
|
14355
14397
|
var ERROR_TITLE = 'Something went wrong with loading the configuration file';
|
|
14398
|
+
var ERROR_AUTH = 'This feature is protected by authentication. Please log in to proceed';
|
|
14356
14399
|
var DownloadSigmetAirmetConfigWrapper = function DownloadSigmetAirmetConfigWrapper(_ref) {
|
|
14357
14400
|
var productType = _ref.productType,
|
|
14358
14401
|
productConfigKey = _ref.productConfigKey;
|
|
14359
14402
|
var _useApiContext = useApiContext(),
|
|
14360
14403
|
api = _useApiContext.api;
|
|
14404
|
+
var _useAuthenticationCon = useAuthenticationContext(),
|
|
14405
|
+
isLoggedIn = _useAuthenticationCon.isLoggedIn;
|
|
14361
14406
|
var getConfigurationRequest = api[productType === 'sigmet' ? 'getSigmetConfiguration' : 'getAirmetConfiguration'];
|
|
14362
14407
|
var _useApi = useApi(getConfigurationRequest, productConfigKey),
|
|
14363
14408
|
productConfig = _useApi.result,
|
|
@@ -14377,7 +14422,7 @@ var DownloadSigmetAirmetConfigWrapper = function DownloadSigmetAirmetConfigWrapp
|
|
|
14377
14422
|
if (error) {
|
|
14378
14423
|
return /*#__PURE__*/React__default.createElement(AlertBanner, {
|
|
14379
14424
|
title: ERROR_TITLE,
|
|
14380
|
-
info: error.message
|
|
14425
|
+
info: !isLoggedIn ? ERROR_AUTH : error.message
|
|
14381
14426
|
});
|
|
14382
14427
|
}
|
|
14383
14428
|
return /*#__PURE__*/React__default.createElement(MetInfoWrapper, {
|
|
@@ -14405,7 +14450,10 @@ var DownloadSigmetAirmetConfigWrapper = function DownloadSigmetAirmetConfigWrapp
|
|
|
14405
14450
|
var getApiRoutes$1 = function getApiRoutes(axiosInstance, nonAuthAxiosInstance) {
|
|
14406
14451
|
return {
|
|
14407
14452
|
getSigmetConfiguration: function getSigmetConfiguration(productConfigKey) {
|
|
14408
|
-
|
|
14453
|
+
if (productConfigKey) {
|
|
14454
|
+
return nonAuthAxiosInstance.get("/assets/".concat(productConfigKey));
|
|
14455
|
+
}
|
|
14456
|
+
return axiosInstance.get('/sigmet-config');
|
|
14409
14457
|
},
|
|
14410
14458
|
getSigmetList: function getSigmetList() {
|
|
14411
14459
|
return axiosInstance.get('/sigmetlist');
|
|
@@ -14417,7 +14465,10 @@ var getApiRoutes$1 = function getApiRoutes(axiosInstance, nonAuthAxiosInstance)
|
|
|
14417
14465
|
return axiosInstance.post('/sigmet2tac', Object.assign({}, sigmetData));
|
|
14418
14466
|
},
|
|
14419
14467
|
getAirmetConfiguration: function getAirmetConfiguration(productConfigKey) {
|
|
14420
|
-
|
|
14468
|
+
if (productConfigKey) {
|
|
14469
|
+
return nonAuthAxiosInstance.get("/assets/".concat(productConfigKey));
|
|
14470
|
+
}
|
|
14471
|
+
return axiosInstance.get('/airmet-config');
|
|
14421
14472
|
},
|
|
14422
14473
|
getAirmetList: function getAirmetList() {
|
|
14423
14474
|
return axiosInstance.get('/airmetlist');
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@ import { ApiModule, ApiUrls } from '@opengeoweb/api';
|
|
|
3
3
|
import { ProductType } from '../../types';
|
|
4
4
|
export interface ApiModuleProps extends ApiModule {
|
|
5
5
|
config: ApiUrls;
|
|
6
|
-
productConfigKey
|
|
6
|
+
productConfigKey?: string;
|
|
7
7
|
productType: ProductType;
|
|
8
8
|
}
|
|
9
9
|
export declare const AviationProductApiWrapper: React.FC<ApiModuleProps>;
|
|
@@ -2,8 +2,9 @@ import React from 'react';
|
|
|
2
2
|
import { ProductType } from '../../types';
|
|
3
3
|
interface ModuleWrapperProps {
|
|
4
4
|
productType: ProductType;
|
|
5
|
-
productConfigKey
|
|
5
|
+
productConfigKey?: string;
|
|
6
6
|
}
|
|
7
7
|
export declare const ERROR_TITLE = "Something went wrong with loading the configuration file";
|
|
8
|
+
export declare const ERROR_AUTH = "This feature is protected by authentication. Please log in to proceed";
|
|
8
9
|
declare const DownloadSigmetAirmetConfigWrapper: React.FC<ModuleWrapperProps>;
|
|
9
10
|
export default DownloadSigmetAirmetConfigWrapper;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AirmetFromBackend, ProductConfig, ProductType, SigmetFromBackend } from '../../types';
|
|
2
2
|
export declare const ERROR_CONFIG = "An error has occurred while loading the config";
|
|
3
3
|
export declare const ERROR_BACKEND = "An error has occurred while retrieving the list, please try again";
|
|
4
|
+
export declare const ERROR_AUTH = "This feature is protected by authentication.";
|
|
4
5
|
export declare const validateConfig: (productType: ProductType, productConfig: ProductConfig) => true | Error;
|
|
5
6
|
type State = {
|
|
6
7
|
isLoading: boolean;
|
|
@@ -7,6 +7,7 @@ export interface SigmetFormProps {
|
|
|
7
7
|
initialCancelSigmet?: CancelSigmet;
|
|
8
8
|
showMap?: boolean;
|
|
9
9
|
productConfig?: ProductConfig;
|
|
10
|
+
setDialogActionsDisabled?: (disabled: boolean) => void;
|
|
10
11
|
}
|
|
11
12
|
declare const SigmetForm: React.FC<SigmetFormProps>;
|
|
12
13
|
export default SigmetForm;
|
|
@@ -32,7 +32,12 @@ export declare const getLevelInFeet: (level: number, unit: string) => number;
|
|
|
32
32
|
export declare const isLevelLower: (ownValue: number | string, ownUnit: LevelUnits, otherValue: number, otherUnit: LevelUnits) => boolean;
|
|
33
33
|
export declare const getDialogtitle: (product: AviationProduct, productType: ProductType) => string;
|
|
34
34
|
export declare const getProductFormMode: (canBeOptions: ProductCanbe[], productListItem: SigmetFromBackend | AirmetFromBackend) => string;
|
|
35
|
-
|
|
35
|
+
interface ProductFormLifecycleButtonsProps {
|
|
36
|
+
canBe: string[];
|
|
37
|
+
onButtonPress: (newStatus: ProductStatus | 'DISCARDED') => void;
|
|
38
|
+
areActionsDisabled?: boolean;
|
|
39
|
+
}
|
|
40
|
+
export declare const getProductFormLifecycleButtons: React.FC<ProductFormLifecycleButtonsProps>;
|
|
36
41
|
export declare const hasValue: (value: number | string) => boolean;
|
|
37
42
|
export declare const prepareFormValues: <T extends AviationProduct>(product: T) => T;
|
|
38
43
|
export declare const createSigmetPostParameter: (sigmetToPost: Sigmet | CancelSigmet, newStatus: ProductStatus, previousUuid: string) => SigmetFromFrontend;
|
|
@@ -66,3 +71,4 @@ export declare const firID = "drawtools-fir";
|
|
|
66
71
|
export declare const getDrawTools: (type: StartOrEndDrawing, firShape: GeoJSON.FeatureCollection) => DrawMode[];
|
|
67
72
|
export declare const updateDrawToolsWithFir: (drawTools: DrawMode[], newFirShape: GeoJSON.FeatureCollection) => DrawMode[];
|
|
68
73
|
export declare const getToolIcon: (id: string) => React.ReactElement;
|
|
74
|
+
export {};
|
package/src/lib/utils/api.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CreateApiProps } from '@opengeoweb/api';
|
|
2
2
|
import { Airmet, AirmetFromBackend, AirmetFromFrontend, ProductConfig, Sigmet, SigmetFromBackend, SigmetFromFrontend } from '../types';
|
|
3
3
|
export type SigmetAirmetApi = {
|
|
4
|
-
getSigmetConfiguration: (productConfigKey
|
|
4
|
+
getSigmetConfiguration: (productConfigKey?: string) => Promise<{
|
|
5
5
|
data: ProductConfig;
|
|
6
6
|
}>;
|
|
7
7
|
getSigmetList: () => Promise<{
|
|
@@ -11,7 +11,7 @@ export type SigmetAirmetApi = {
|
|
|
11
11
|
getSigmetTAC: (sigmetData: Sigmet) => Promise<{
|
|
12
12
|
data: string;
|
|
13
13
|
}>;
|
|
14
|
-
getAirmetConfiguration: (productConfigKey
|
|
14
|
+
getAirmetConfiguration: (productConfigKey?: string) => Promise<{
|
|
15
15
|
data: ProductConfig;
|
|
16
16
|
}>;
|
|
17
17
|
getAirmetList: () => Promise<{
|