@opengeoweb/taf 11.0.0 → 12.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -0
- package/index.esm.js +646 -172
- package/package.json +36 -21
- package/src/lib/TafDemo.stories.d.ts +1 -0
- package/src/lib/components/AutoTaf/AutoTaf.d.ts +9 -0
- package/src/lib/components/AutoTaf/AutoTaf.spec.d.ts +1 -0
- package/src/lib/components/AutoTaf/AutoTaf.stories.d.ts +8 -0
- package/src/lib/components/AutoTaf/index.d.ts +1 -0
- package/src/lib/components/ComponentsLookUp/ComponentsLookUp.d.ts +5 -1
- package/src/lib/components/TafForm/TafForm.d.ts +0 -1
- package/src/lib/components/TafLayout/TacOverview/TacContainer.d.ts +4 -0
- package/src/lib/components/TafLayout/TacOverview/TacContainerLayout.d.ts +10 -0
- package/src/lib/components/TafLayout/TacOverview/TacOverviewMobile.d.ts +1 -0
- package/src/lib/components/TafLayout/TacOverview/TacOverviewMobile.stories.d.ts +2 -0
- package/src/lib/components/TafLayout/TafLayout.d.ts +2 -1
- package/src/lib/components/TafLayout/TafLayout.stories.d.ts +2 -0
- package/src/lib/components/TafLayout/TafPanel/TafPanel.d.ts +0 -1
- package/src/lib/components/TafLayout/utils.d.ts +3 -1
- package/src/lib/components/TafModule/TafModule.d.ts +3 -1
- package/src/lib/components/TafModule/TafModule.stories.d.ts +27 -3
- package/src/lib/types.d.ts +3 -1
- package/src/lib/utils/api.d.ts +1 -4
- package/src/lib/utils/fakeApi.d.ts +2 -0
- package/src/lib/utils/taf-api/api.d.ts +3 -0
- package/src/lib/utils/taf-api/fakeApi.d.ts +1 -0
- package/src/lib/utils/taf-api/hooks.d.ts +3 -0
package/index.esm.js
CHANGED
|
@@ -6,9 +6,9 @@ import { useFormContext, useFieldArray, Controller } from 'react-hook-form';
|
|
|
6
6
|
import { useDispatch } from 'react-redux';
|
|
7
7
|
import { ReactSortable } from 'react-sortablejs';
|
|
8
8
|
import Sortable from 'sortablejs';
|
|
9
|
-
import { useAuthenticationContext } from '@opengeoweb/authentication';
|
|
9
|
+
import { getConfig, useAuthenticationContext } from '@opengeoweb/authentication';
|
|
10
10
|
import { HIDDEN_INPUT_HELPER_IS_DRAFT, getDeepProperty, useDraftFormHelpers, ReactHookFormHiddenInput, ReactHookFormProvider } from '@opengeoweb/form-fields';
|
|
11
|
-
import { SHARED_NAMESPACE, dateUtils, useIsMounted, CustomIconButton, CustomTooltip, ToolContainerDraggable, Avatar, getInitials, ToggleMenu, useConfirmationDialog, usePreventBrowserClose, SwitchButton, ToolHeader, AlertBanner, getErrorMessage as getErrorMessage$1, getWarningMessage, LastUpdateTime,
|
|
11
|
+
import { SHARED_NAMESPACE, dateUtils, useIsMounted, CustomIconButton, CustomTooltip, ToolContainerDraggable, Avatar, getInitials, ToggleMenu, useConfirmationDialog, usePreventBrowserClose, SwitchButton, ToolHeader, AlertBanner, getErrorMessage as getErrorMessage$1, getWarningMessage, LastUpdateTime, ErrorBoundary } from '@opengeoweb/shared';
|
|
12
12
|
import { snackbarActions, snackbarTypes } from '@opengeoweb/snackbar';
|
|
13
13
|
import 'i18next';
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
@@ -16,7 +16,7 @@ import { isEqual } from 'lodash';
|
|
|
16
16
|
import { DragHandle as DragHandle$1, ThumbsUp, Add, Delete, Close, Clock, Cancel, Success, Edit, Export, ListItem } from '@opengeoweb/theme';
|
|
17
17
|
import ReactDOM from 'react-dom';
|
|
18
18
|
import { useTheme } from '@emotion/react';
|
|
19
|
-
import { useApiContext, createApiInstance, createFakeApiInstance, ApiProvider } from '@opengeoweb/api';
|
|
19
|
+
import { getHeaders, handleResponse, useAuthQuery, useApiContext, createApiInstance, createFakeApiInstance, ApiProvider } from '@opengeoweb/api';
|
|
20
20
|
import LinearProgress from '@mui/material/LinearProgress';
|
|
21
21
|
import Box$1 from '@mui/material/Box';
|
|
22
22
|
|
|
@@ -96,7 +96,11 @@ var en = {
|
|
|
96
96
|
"confirm-clear-description": "Are you sure you want to clear this row?",
|
|
97
97
|
"issues-button-0": "0 issues",
|
|
98
98
|
"issues-button-1": "1 issue",
|
|
99
|
-
"issues-button-multiple": "{{amount}} issues"
|
|
99
|
+
"issues-button-multiple": "{{amount}} issues",
|
|
100
|
+
autotaf: "Autotaf",
|
|
101
|
+
"autotaf-no-data": "No autoTAFs available",
|
|
102
|
+
"autotaf-no-location": "No data available for this location",
|
|
103
|
+
"autotaf-no-config": "Missing config key: autoTAFlocations"
|
|
100
104
|
};
|
|
101
105
|
var fi = {
|
|
102
106
|
"issues-button-title": "Näkymän yksityiskohdat",
|
|
@@ -174,7 +178,11 @@ var fi = {
|
|
|
174
178
|
"confirm-clear-description": "Oletko varma, että haluat tyhjentää tämän rivin?",
|
|
175
179
|
"issues-button-0": "0 ongelmaa",
|
|
176
180
|
"issues-button-1": "1 ongelma",
|
|
177
|
-
"issues-button-multiple": "{{amount}} ongelmaa"
|
|
181
|
+
"issues-button-multiple": "{{amount}} ongelmaa",
|
|
182
|
+
autotaf: "Autotaf",
|
|
183
|
+
"autotaf-no-data": "Ei autoTAF-tietoja saatavilla",
|
|
184
|
+
"autotaf-no-location": "Tietoja ei ole saatavilla tälle sijainnille",
|
|
185
|
+
"autotaf-no-config": "Puuttuva määritysavain: autoTAFlocations"
|
|
178
186
|
};
|
|
179
187
|
var no = {
|
|
180
188
|
"issues-button-title": "Vis detaljer",
|
|
@@ -252,7 +260,11 @@ var no = {
|
|
|
252
260
|
"confirm-clear-description": "Er du sikker på at du tømme denne raden?",
|
|
253
261
|
"issues-button-0": "Ingen problem",
|
|
254
262
|
"issues-button-1": "1 problem",
|
|
255
|
-
"issues-button-multiple": "{{amount}} problem"
|
|
263
|
+
"issues-button-multiple": "{{amount}} problem",
|
|
264
|
+
autotaf: "Autotaf",
|
|
265
|
+
"autotaf-no-data": "Ingen autoTAF-er tilgjengelig",
|
|
266
|
+
"autotaf-no-location": "Ingen data tilgjengelig for denne lokasjonen",
|
|
267
|
+
"autotaf-no-config": "Mangler konfigurasjonsnøkkel: autoTAFlocations"
|
|
256
268
|
};
|
|
257
269
|
var nl = {
|
|
258
270
|
"issues-button-title": "Bekijk details",
|
|
@@ -330,7 +342,11 @@ var nl = {
|
|
|
330
342
|
"confirm-clear-description": "Weet je zeker dat je deze rij leeg wilt maken?",
|
|
331
343
|
"issues-button-0": "0 problemen",
|
|
332
344
|
"issues-button-1": "1 probleem",
|
|
333
|
-
"issues-button-multiple": "{{amount}} problemen"
|
|
345
|
+
"issues-button-multiple": "{{amount}} problemen",
|
|
346
|
+
autotaf: "Autotaf",
|
|
347
|
+
"autotaf-no-data": "Geen autoTAFs beschikbaar",
|
|
348
|
+
"autotaf-no-location": "Geen data beschikbaar voor deze locatie",
|
|
349
|
+
"autotaf-no-config": "Ontbrekende configuratie: autoTAFlocations"
|
|
334
350
|
};
|
|
335
351
|
var tafTranslations = {
|
|
336
352
|
en: en,
|
|
@@ -1185,14 +1201,14 @@ var validateOverlapWithFM = function validateOverlapWithFM(currentChangeGroup, n
|
|
|
1185
1201
|
return true;
|
|
1186
1202
|
};
|
|
1187
1203
|
|
|
1188
|
-
var config$
|
|
1204
|
+
var config$2 = [{
|
|
1189
1205
|
key: 'range',
|
|
1190
1206
|
size: 4
|
|
1191
1207
|
}, {
|
|
1192
1208
|
key: 'unit',
|
|
1193
1209
|
size: 1
|
|
1194
1210
|
}];
|
|
1195
|
-
var configAsObject$1 = Object.assign(config$
|
|
1211
|
+
var configAsObject$1 = Object.assign(config$2).reduce(function (list, item) {
|
|
1196
1212
|
var _Object$assign;
|
|
1197
1213
|
return Object.assign({}, list, (_Object$assign = {}, _Object$assign[item.key] = item, _Object$assign));
|
|
1198
1214
|
}, {});
|
|
@@ -1822,7 +1838,7 @@ function parseWeatherToObject(value) {
|
|
|
1822
1838
|
return trimmedWeather;
|
|
1823
1839
|
}
|
|
1824
1840
|
|
|
1825
|
-
var config = [{
|
|
1841
|
+
var config$1 = [{
|
|
1826
1842
|
key: 'direction',
|
|
1827
1843
|
size: 3
|
|
1828
1844
|
}, {
|
|
@@ -1839,7 +1855,7 @@ var config = [{
|
|
|
1839
1855
|
key: 'unit',
|
|
1840
1856
|
size: 2
|
|
1841
1857
|
}];
|
|
1842
|
-
var configAsObject = Object.assign(config).reduce(function (list, item) {
|
|
1858
|
+
var configAsObject = Object.assign(config$1).reduce(function (list, item) {
|
|
1843
1859
|
var _Object$assign;
|
|
1844
1860
|
return Object.assign({}, list, (_Object$assign = {}, _Object$assign[item.key] = item, _Object$assign));
|
|
1845
1861
|
}, {});
|
|
@@ -1887,7 +1903,7 @@ var formatWindToString = function formatWindToString(value) {
|
|
|
1887
1903
|
if (!value) {
|
|
1888
1904
|
return value;
|
|
1889
1905
|
}
|
|
1890
|
-
return config.reduce(function (stringValue, item) {
|
|
1906
|
+
return config$1.reduce(function (stringValue, item) {
|
|
1891
1907
|
var key = item.key;
|
|
1892
1908
|
var propValue = value[key];
|
|
1893
1909
|
var hasValue = propValue !== undefined && propValue !== null && propValue !== '';
|
|
@@ -1898,7 +1914,7 @@ var extractValidateWindSections = function extractValidateWindSections(value, va
|
|
|
1898
1914
|
if (validation === void 0) {
|
|
1899
1915
|
validation = false;
|
|
1900
1916
|
}
|
|
1901
|
-
return config.reduce(function (obj, item) {
|
|
1917
|
+
return config$1.reduce(function (obj, item) {
|
|
1902
1918
|
var key = item.key,
|
|
1903
1919
|
size = item.size;
|
|
1904
1920
|
var returnObj = obj;
|
|
@@ -2591,7 +2607,7 @@ var validateFourthCloud = function validateFourthCloud(firstCloudValue, secondCl
|
|
|
2591
2607
|
var DATE_FORMAT_ISSUE_TIME = "ddHHmm'Z";
|
|
2592
2608
|
var DATE_FORMAT_BASE_TIME = 'HH:mm dd MMM';
|
|
2593
2609
|
|
|
2594
|
-
var _excluded$
|
|
2610
|
+
var _excluded$5 = ["cavOK"],
|
|
2595
2611
|
_excluded2 = ["visibility"],
|
|
2596
2612
|
_excluded3 = ["cloud"],
|
|
2597
2613
|
_excluded4 = ["weather"],
|
|
@@ -2648,7 +2664,7 @@ function formatFormValues(row) {
|
|
|
2648
2664
|
{
|
|
2649
2665
|
// Assume if cavOK field set to true - no visibility field, otherwise return the original list containing the visibility and remove cavOK
|
|
2650
2666
|
list.cavOK;
|
|
2651
|
-
var formData = _objectWithoutPropertiesLoose(list, _excluded$
|
|
2667
|
+
var formData = _objectWithoutPropertiesLoose(list, _excluded$5);
|
|
2652
2668
|
if (list[key]) {
|
|
2653
2669
|
return Object.assign({}, formData, {
|
|
2654
2670
|
visibility: formatVisibilityToString(list[key])
|
|
@@ -3566,7 +3582,7 @@ var ResponsiveWrapper = function ResponsiveWrapper(_ref) {
|
|
|
3566
3582
|
});
|
|
3567
3583
|
};
|
|
3568
3584
|
|
|
3569
|
-
var _excluded$
|
|
3585
|
+
var _excluded$4 = ["shouldPreventUppercase"];
|
|
3570
3586
|
var textFieldStyle = function textFieldStyle(theme, shouldPreventUppercase) {
|
|
3571
3587
|
var _ref;
|
|
3572
3588
|
return _ref = {
|
|
@@ -3646,7 +3662,7 @@ var getDisplayValue = function getDisplayValue(value, disabled) {
|
|
|
3646
3662
|
var BaseTextField = /*#__PURE__*/React__default.memo(function (_ref2) {
|
|
3647
3663
|
var _ref2$shouldPreventUp = _ref2.shouldPreventUppercase,
|
|
3648
3664
|
shouldPreventUppercase = _ref2$shouldPreventUp === void 0 ? false : _ref2$shouldPreventUp,
|
|
3649
|
-
props = _objectWithoutPropertiesLoose(_ref2, _excluded$
|
|
3665
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded$4);
|
|
3650
3666
|
var theme = useTheme();
|
|
3651
3667
|
var styling = textFieldStyle(theme, shouldPreventUppercase);
|
|
3652
3668
|
return jsx(TextField, Object.assign({
|
|
@@ -3874,7 +3890,7 @@ var TafFormOptionsButton = function TafFormOptionsButton(_ref) {
|
|
|
3874
3890
|
});
|
|
3875
3891
|
};
|
|
3876
3892
|
|
|
3877
|
-
var _excluded$
|
|
3893
|
+
var _excluded$3 = ["isNotRequiredForAction", "isChangeGroup", "disabled", "index", "onRemoveChangeGroup", "field", "dragHandle", "onAddChangeGroupBelow", "onAddChangeGroupAbove", "onClearRow"];
|
|
3878
3894
|
var getDefaultValue = function getDefaultValue(fieldName, data) {
|
|
3879
3895
|
if (!data) {
|
|
3880
3896
|
return '';
|
|
@@ -3908,7 +3924,7 @@ var TafFormRow = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
3908
3924
|
onAddChangeGroupAbove = _ref$onAddChangeGroup2 === void 0 ? function () {} : _ref$onAddChangeGroup2,
|
|
3909
3925
|
_ref$onClearRow = _ref.onClearRow,
|
|
3910
3926
|
onClearRow = _ref$onClearRow === void 0 ? function () {} : _ref$onClearRow,
|
|
3911
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
3927
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$3);
|
|
3912
3928
|
var namePrefix = !isChangeGroup ? 'baseForecast' : "changeGroups[" + index + "]";
|
|
3913
3929
|
var fieldNames = getFieldNames(isChangeGroup, index);
|
|
3914
3930
|
var _useFormContext = useFormContext(),
|
|
@@ -4332,6 +4348,55 @@ var TafFormRow = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
4332
4348
|
}));
|
|
4333
4349
|
});
|
|
4334
4350
|
|
|
4351
|
+
/* *
|
|
4352
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4353
|
+
* you may not use this file except in compliance with the License.
|
|
4354
|
+
* You may obtain a copy of the License at
|
|
4355
|
+
*
|
|
4356
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
4357
|
+
*
|
|
4358
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
4359
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
4360
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4361
|
+
* See the License for the specific language governing permissions and
|
|
4362
|
+
* limitations under the License.
|
|
4363
|
+
*
|
|
4364
|
+
* Copyright 2025 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
4365
|
+
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
4366
|
+
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
4367
|
+
* */
|
|
4368
|
+
var config = getConfig();
|
|
4369
|
+
var tafBaseUrl = config.GW_TAF_BASE_URL || '';
|
|
4370
|
+
var getTafList = function getTafList(auth) {
|
|
4371
|
+
return fetch(tafBaseUrl + "/taflist", {
|
|
4372
|
+
headers: getHeaders(auth)
|
|
4373
|
+
}).then(handleResponse);
|
|
4374
|
+
};
|
|
4375
|
+
|
|
4376
|
+
/* *
|
|
4377
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4378
|
+
* you may not use this file except in compliance with the License.
|
|
4379
|
+
* You may obtain a copy of the License at
|
|
4380
|
+
*
|
|
4381
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
4382
|
+
*
|
|
4383
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
4384
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
4385
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4386
|
+
* See the License for the specific language governing permissions and
|
|
4387
|
+
* limitations under the License.
|
|
4388
|
+
*
|
|
4389
|
+
* Copyright 2025 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
4390
|
+
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
4391
|
+
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
4392
|
+
* */
|
|
4393
|
+
var useTafList = function useTafList(disabled) {
|
|
4394
|
+
if (disabled === void 0) {
|
|
4395
|
+
disabled = false;
|
|
4396
|
+
}
|
|
4397
|
+
return useAuthQuery(['taf-list'], getTafList, disabled, 1000 * 60 * 5);
|
|
4398
|
+
};
|
|
4399
|
+
|
|
4335
4400
|
// prevents default functionality
|
|
4336
4401
|
var noop = function noop() {};
|
|
4337
4402
|
var TafForm = /*#__PURE__*/React__default.memo(function (_ref) {
|
|
@@ -4356,10 +4421,6 @@ var TafForm = /*#__PURE__*/React__default.memo(function (_ref) {
|
|
|
4356
4421
|
onSwitchEditor = _ref$onSwitchEditor === void 0 ? function () {
|
|
4357
4422
|
return null;
|
|
4358
4423
|
} : _ref$onSwitchEditor,
|
|
4359
|
-
_ref$fetchNewTafList = _ref.fetchNewTafList,
|
|
4360
|
-
fetchNewTafList = _ref$fetchNewTafList === void 0 ? function () {
|
|
4361
|
-
return null;
|
|
4362
|
-
} : _ref$fetchNewTafList,
|
|
4363
4424
|
_ref$previousTaf = _ref.previousTaf,
|
|
4364
4425
|
previousTaf = _ref$previousTaf === void 0 ? null : _ref$previousTaf;
|
|
4365
4426
|
var _useTafTranslation = useTafTranslation(),
|
|
@@ -4463,9 +4524,11 @@ var TafForm = /*#__PURE__*/React__default.memo(function (_ref) {
|
|
|
4463
4524
|
var isLatestEditor = function isLatestEditor(latestEditor, userName) {
|
|
4464
4525
|
return latestEditor !== '' && latestEditor !== null && latestEditor !== userName;
|
|
4465
4526
|
};
|
|
4527
|
+
var _useTafList = useTafList(true),
|
|
4528
|
+
fetchNewTafList = _useTafList.refetch;
|
|
4466
4529
|
var setIsEditor = /*#__PURE__*/function () {
|
|
4467
4530
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(checked) {
|
|
4468
|
-
var username, latestList, _latestList$find, latestEditor, didSucceed;
|
|
4531
|
+
var username, _yield$fetchNewTafLis, latestList, _latestList$find, latestEditor, didSucceed;
|
|
4469
4532
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
4470
4533
|
while (1) switch (_context.prev = _context.next) {
|
|
4471
4534
|
case 0:
|
|
@@ -4473,38 +4536,45 @@ var TafForm = /*#__PURE__*/React__default.memo(function (_ref) {
|
|
|
4473
4536
|
_context.next = 3;
|
|
4474
4537
|
return fetchNewTafList();
|
|
4475
4538
|
case 3:
|
|
4476
|
-
|
|
4539
|
+
_yield$fetchNewTafLis = _context.sent;
|
|
4540
|
+
latestList = _yield$fetchNewTafLis.data;
|
|
4541
|
+
if (latestList) {
|
|
4542
|
+
_context.next = 7;
|
|
4543
|
+
break;
|
|
4544
|
+
}
|
|
4545
|
+
return _context.abrupt("return", false);
|
|
4546
|
+
case 7:
|
|
4477
4547
|
_latestList$find = latestList.find(function (taf) {
|
|
4478
4548
|
return taf.taf.uuid === originalTaf.uuid;
|
|
4479
4549
|
}), latestEditor = _latestList$find.editor;
|
|
4480
4550
|
if (!(username === latestEditor)) {
|
|
4481
|
-
_context.next =
|
|
4551
|
+
_context.next = 10;
|
|
4482
4552
|
break;
|
|
4483
4553
|
}
|
|
4484
4554
|
return _context.abrupt("return", true);
|
|
4485
|
-
case
|
|
4555
|
+
case 10:
|
|
4486
4556
|
if (!(!checked && isLatestEditor(latestEditor, auth == null ? void 0 : auth.username))) {
|
|
4487
|
-
_context.next =
|
|
4557
|
+
_context.next = 12;
|
|
4488
4558
|
break;
|
|
4489
4559
|
}
|
|
4490
4560
|
return _context.abrupt("return", true);
|
|
4491
|
-
case
|
|
4561
|
+
case 12:
|
|
4492
4562
|
if (!(checked && isLatestEditor(latestEditor, auth == null ? void 0 : auth.username))) {
|
|
4493
|
-
_context.next =
|
|
4563
|
+
_context.next = 15;
|
|
4494
4564
|
break;
|
|
4495
4565
|
}
|
|
4496
|
-
_context.next =
|
|
4566
|
+
_context.next = 15;
|
|
4497
4567
|
return confirmDialog({
|
|
4498
4568
|
title: t('switch-title'),
|
|
4499
4569
|
description: t('switch-description'),
|
|
4500
4570
|
confirmLabel: t('switch-confirm')
|
|
4501
4571
|
});
|
|
4502
|
-
case
|
|
4503
|
-
_context.next =
|
|
4572
|
+
case 15:
|
|
4573
|
+
_context.next = 17;
|
|
4504
4574
|
return onSwitchEditor(Object.assign({}, tafFromBackend, {
|
|
4505
4575
|
editor: username
|
|
4506
4576
|
}));
|
|
4507
|
-
case
|
|
4577
|
+
case 17:
|
|
4508
4578
|
didSucceed = _context.sent;
|
|
4509
4579
|
if (didSucceed) {
|
|
4510
4580
|
showSnackbar(checked ? t('editor-on', {
|
|
@@ -4514,7 +4584,7 @@ var TafForm = /*#__PURE__*/React__default.memo(function (_ref) {
|
|
|
4514
4584
|
}));
|
|
4515
4585
|
}
|
|
4516
4586
|
return _context.abrupt("return", didSucceed);
|
|
4517
|
-
case
|
|
4587
|
+
case 20:
|
|
4518
4588
|
case "end":
|
|
4519
4589
|
return _context.stop();
|
|
4520
4590
|
}
|
|
@@ -4885,12 +4955,12 @@ var TafForm = /*#__PURE__*/React__default.memo(function (_ref) {
|
|
|
4885
4955
|
prevProps.tafFromBackend.editor === nextProps.tafFromBackend.editor;
|
|
4886
4956
|
});
|
|
4887
4957
|
|
|
4888
|
-
var _excluded$
|
|
4958
|
+
var _excluded$2 = ["children", "value", "index"];
|
|
4889
4959
|
var TabPanel = function TabPanel(_ref) {
|
|
4890
4960
|
var children = _ref.children,
|
|
4891
4961
|
value = _ref.value,
|
|
4892
4962
|
index = _ref.index,
|
|
4893
|
-
other = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
4963
|
+
other = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
4894
4964
|
return jsx(Box, Object.assign({
|
|
4895
4965
|
role: "tabpanel",
|
|
4896
4966
|
hidden: value !== index,
|
|
@@ -4958,10 +5028,18 @@ var locationOrder = [
|
|
|
4958
5028
|
"EHBK",
|
|
4959
5029
|
"TNCB"
|
|
4960
5030
|
];
|
|
5031
|
+
var autoTAFlocations = [
|
|
5032
|
+
"EHAM",
|
|
5033
|
+
"EHRD",
|
|
5034
|
+
"EHLE",
|
|
5035
|
+
"EHGG",
|
|
5036
|
+
"EHBK"
|
|
5037
|
+
];
|
|
4961
5038
|
var tafConfig = {
|
|
4962
5039
|
location_indicator_mwo: location_indicator_mwo,
|
|
4963
5040
|
locations: locations,
|
|
4964
|
-
locationOrder: locationOrder
|
|
5041
|
+
locationOrder: locationOrder,
|
|
5042
|
+
autoTAFlocations: autoTAFlocations
|
|
4965
5043
|
};
|
|
4966
5044
|
|
|
4967
5045
|
/* *
|
|
@@ -5108,6 +5186,23 @@ var getPreviousTaf = function getPreviousTaf(tafList, currentTaf) {
|
|
|
5108
5186
|
});
|
|
5109
5187
|
return previousTaf ? previousTaf.taf : null;
|
|
5110
5188
|
};
|
|
5189
|
+
var getAutoTafLocations = function getAutoTafLocations(autoTAFlocations) {
|
|
5190
|
+
if (autoTAFlocations === void 0) {
|
|
5191
|
+
autoTAFlocations = tafSettings.autoTAFlocations;
|
|
5192
|
+
}
|
|
5193
|
+
return autoTAFlocations || null;
|
|
5194
|
+
};
|
|
5195
|
+
var scrollToPosition = function scrollToPosition(scrollRef, activeLocation) {
|
|
5196
|
+
if (!scrollRef.current) {
|
|
5197
|
+
return;
|
|
5198
|
+
}
|
|
5199
|
+
var containerTop = scrollRef.current.getBoundingClientRect().top;
|
|
5200
|
+
var firstLocation = scrollRef.current.querySelector("[data-location=\"" + activeLocation + "\"]");
|
|
5201
|
+
var paddingTop = parseInt(getComputedStyle(scrollRef.current).paddingTop, 10);
|
|
5202
|
+
var firstLocationTop = firstLocation == null ? void 0 : firstLocation.getBoundingClientRect().top;
|
|
5203
|
+
var newScrollPosition = firstLocationTop - containerTop + scrollRef.current.scrollTop - paddingTop;
|
|
5204
|
+
scrollRef.current.scrollTo(newScrollPosition, newScrollPosition);
|
|
5205
|
+
};
|
|
5111
5206
|
|
|
5112
5207
|
var IconWithTooltip = function IconWithTooltip(_ref) {
|
|
5113
5208
|
var title = _ref.title,
|
|
@@ -5239,12 +5334,27 @@ var AdverseWeatherTACMessage = function AdverseWeatherTACMessage(_ref) {
|
|
|
5239
5334
|
});
|
|
5240
5335
|
};
|
|
5241
5336
|
|
|
5242
|
-
var
|
|
5243
|
-
var
|
|
5244
|
-
|
|
5245
|
-
|
|
5246
|
-
|
|
5247
|
-
|
|
5337
|
+
var TacHighLight = function TacHighLight(_ref) {
|
|
5338
|
+
var isActive = _ref.isActive,
|
|
5339
|
+
children = _ref.children;
|
|
5340
|
+
return jsx(Box, {
|
|
5341
|
+
component: "span",
|
|
5342
|
+
sx: Object.assign({
|
|
5343
|
+
display: 'inline',
|
|
5344
|
+
boxDecorationBreak: 'clone',
|
|
5345
|
+
WebkitBoxDecorationBreak: 'clone'
|
|
5346
|
+
}, isActive && {
|
|
5347
|
+
backgroundColor: 'geowebColors.functional.warningHighlight.rgba'
|
|
5348
|
+
}),
|
|
5349
|
+
children: children
|
|
5350
|
+
});
|
|
5351
|
+
};
|
|
5352
|
+
var TacContainer = function TacContainer(_ref2) {
|
|
5353
|
+
var taf = _ref2.taf,
|
|
5354
|
+
_ref2$isActive = _ref2.isActive,
|
|
5355
|
+
isActive = _ref2$isActive === void 0 ? false : _ref2$isActive,
|
|
5356
|
+
_ref2$isFormDisabled = _ref2.isFormDisabled,
|
|
5357
|
+
isFormDisabled = _ref2$isFormDisabled === void 0 ? false : _ref2$isFormDisabled;
|
|
5248
5358
|
var _useTafTranslation = useTafTranslation(),
|
|
5249
5359
|
t = _useTafTranslation.t;
|
|
5250
5360
|
var _useApiContext = useApiContext(),
|
|
@@ -5372,15 +5482,8 @@ var TacContainer = function TacContainer(_ref) {
|
|
|
5372
5482
|
letterSpacing: '0.4px',
|
|
5373
5483
|
color: 'geowebColors.captions.captionStatus.rgba'
|
|
5374
5484
|
},
|
|
5375
|
-
children: typeof TAC === 'string' ? jsx(
|
|
5376
|
-
|
|
5377
|
-
sx: Object.assign({
|
|
5378
|
-
display: 'inline',
|
|
5379
|
-
boxDecorationBreak: 'clone',
|
|
5380
|
-
WebkitBoxDecorationBreak: 'clone'
|
|
5381
|
-
}, isActive && {
|
|
5382
|
-
backgroundColor: 'geowebColors.functional.warningHighlight.rgba'
|
|
5383
|
-
}),
|
|
5485
|
+
children: typeof TAC === 'string' ? jsx(TacHighLight, {
|
|
5486
|
+
isActive: isActive,
|
|
5384
5487
|
children: TAC
|
|
5385
5488
|
}) : jsx(AdverseWeatherTACMessage, {
|
|
5386
5489
|
TAC: TAC,
|
|
@@ -5420,17 +5523,6 @@ var TacOverview = function TacOverview(_ref) {
|
|
|
5420
5523
|
var isActiveLocation = function isActiveLocation(location) {
|
|
5421
5524
|
return location === activeLocation;
|
|
5422
5525
|
};
|
|
5423
|
-
var scrollToPosition = React__default.useCallback(function () {
|
|
5424
|
-
if (!scrollRef.current) {
|
|
5425
|
-
return;
|
|
5426
|
-
}
|
|
5427
|
-
var containerTop = scrollRef.current.getBoundingClientRect().top;
|
|
5428
|
-
var firstLocation = scrollRef.current.querySelector("[data-location=\"" + activeLocation + "\"]");
|
|
5429
|
-
var paddingTop = parseInt(getComputedStyle(scrollRef.current).paddingTop, 10);
|
|
5430
|
-
var firstLocationTop = firstLocation == null ? void 0 : firstLocation.getBoundingClientRect().top;
|
|
5431
|
-
var newScrollPosition = firstLocationTop - containerTop + scrollRef.current.scrollTop - paddingTop;
|
|
5432
|
-
scrollRef.current.scrollTo(newScrollPosition, newScrollPosition);
|
|
5433
|
-
}, [activeLocation]);
|
|
5434
5526
|
var resetScrollPosition = function resetScrollPosition() {
|
|
5435
5527
|
return scrollRef.current.scrollTo(0, 0);
|
|
5436
5528
|
};
|
|
@@ -5440,18 +5532,18 @@ var TacOverview = function TacOverview(_ref) {
|
|
|
5440
5532
|
};
|
|
5441
5533
|
React__default.useEffect(function () {
|
|
5442
5534
|
if (activeLocation) {
|
|
5443
|
-
scrollToPosition();
|
|
5535
|
+
scrollToPosition(scrollRef, activeLocation);
|
|
5444
5536
|
}
|
|
5445
|
-
}, [activeLocation
|
|
5537
|
+
}, [activeLocation]);
|
|
5446
5538
|
React__default.useEffect(function () {
|
|
5447
5539
|
var SCROLL_DELAY = 1000;
|
|
5448
5540
|
var timer = setTimeout(function () {
|
|
5449
|
-
scrollToPosition();
|
|
5541
|
+
scrollToPosition(scrollRef, activeLocation);
|
|
5450
5542
|
}, SCROLL_DELAY);
|
|
5451
5543
|
return function () {
|
|
5452
5544
|
clearTimeout(timer);
|
|
5453
5545
|
};
|
|
5454
|
-
}, [
|
|
5546
|
+
}, [activeLocation, activeTab]);
|
|
5455
5547
|
return jsxs(Card, {
|
|
5456
5548
|
variant: "outlined",
|
|
5457
5549
|
sx: {
|
|
@@ -5510,11 +5602,183 @@ var TacOverview = function TacOverview(_ref) {
|
|
|
5510
5602
|
});
|
|
5511
5603
|
};
|
|
5512
5604
|
|
|
5605
|
+
var TacContainerLayout = function TacContainerLayout(_ref) {
|
|
5606
|
+
var location = _ref.location,
|
|
5607
|
+
_ref$isActive = _ref.isActive,
|
|
5608
|
+
isActive = _ref$isActive === void 0 ? false : _ref$isActive,
|
|
5609
|
+
exportBtnSlot = _ref.exportBtnSlot,
|
|
5610
|
+
statusSlot = _ref.statusSlot,
|
|
5611
|
+
children = _ref.children;
|
|
5612
|
+
var locationLabel = getLocationSetting(location).label;
|
|
5613
|
+
return jsxs(Box, {
|
|
5614
|
+
sx: {
|
|
5615
|
+
marginBottom: '20px'
|
|
5616
|
+
},
|
|
5617
|
+
"data-location": location,
|
|
5618
|
+
className: isActive ? 'active' : undefined,
|
|
5619
|
+
role: "listitem",
|
|
5620
|
+
"aria-label": location,
|
|
5621
|
+
children: [jsxs(Box, {
|
|
5622
|
+
sx: {
|
|
5623
|
+
display: 'flex',
|
|
5624
|
+
alignItems: 'center',
|
|
5625
|
+
justifyContent: 'space-between',
|
|
5626
|
+
height: 24
|
|
5627
|
+
},
|
|
5628
|
+
children: [jsxs(Box, {
|
|
5629
|
+
sx: {
|
|
5630
|
+
display: 'flex',
|
|
5631
|
+
alignItems: 'center'
|
|
5632
|
+
},
|
|
5633
|
+
children: [jsx(Box, {
|
|
5634
|
+
sx: {
|
|
5635
|
+
width: 24,
|
|
5636
|
+
height: 24,
|
|
5637
|
+
display: 'flex',
|
|
5638
|
+
marginRight: '2px',
|
|
5639
|
+
paddingTop: '6px',
|
|
5640
|
+
alignItems: 'center',
|
|
5641
|
+
justifyContent: 'center'
|
|
5642
|
+
},
|
|
5643
|
+
children: statusSlot
|
|
5644
|
+
}), jsxs(Typography, {
|
|
5645
|
+
sx: Object.assign({
|
|
5646
|
+
lineHeight: 1
|
|
5647
|
+
}, isActive && {
|
|
5648
|
+
backgroundColor: 'geowebColors.functional.warningHighlight.rgba',
|
|
5649
|
+
padding: '0 2px',
|
|
5650
|
+
marginLeft: '-2px'
|
|
5651
|
+
}),
|
|
5652
|
+
children: [jsx(Typography, {
|
|
5653
|
+
sx: {
|
|
5654
|
+
fontSize: '12px',
|
|
5655
|
+
color: 'geowebColors.captions.captionInformation.rgba'
|
|
5656
|
+
},
|
|
5657
|
+
"data-testid": "tafLocation",
|
|
5658
|
+
component: "span",
|
|
5659
|
+
children: location
|
|
5660
|
+
}), jsx(Typography, {
|
|
5661
|
+
sx: {
|
|
5662
|
+
fontSize: '12px',
|
|
5663
|
+
marginLeft: '10px'
|
|
5664
|
+
},
|
|
5665
|
+
"data-testid": "tafLocationLabel",
|
|
5666
|
+
component: "span",
|
|
5667
|
+
children: locationLabel
|
|
5668
|
+
})]
|
|
5669
|
+
})]
|
|
5670
|
+
}), exportBtnSlot]
|
|
5671
|
+
}), jsx(Box, {
|
|
5672
|
+
sx: {
|
|
5673
|
+
fontSize: '12px',
|
|
5674
|
+
letterSpacing: '0.4px',
|
|
5675
|
+
color: 'geowebColors.captions.captionStatus.rgba'
|
|
5676
|
+
},
|
|
5677
|
+
children: children
|
|
5678
|
+
})]
|
|
5679
|
+
});
|
|
5680
|
+
};
|
|
5681
|
+
|
|
5682
|
+
var Message = function Message(_ref) {
|
|
5683
|
+
var text = _ref.text;
|
|
5684
|
+
return jsx(Typography, {
|
|
5685
|
+
variant: "body2",
|
|
5686
|
+
sx: {
|
|
5687
|
+
fontSize: '12px',
|
|
5688
|
+
fontWeight: 'normal',
|
|
5689
|
+
fontStyle: 'normal',
|
|
5690
|
+
lineHeight: 0.96,
|
|
5691
|
+
color: 'geowebColors.textInputField.label.rgba'
|
|
5692
|
+
},
|
|
5693
|
+
children: text
|
|
5694
|
+
});
|
|
5695
|
+
};
|
|
5696
|
+
var AutoTaf = function AutoTaf(_ref2) {
|
|
5697
|
+
var tafList = _ref2.tafList,
|
|
5698
|
+
_ref2$isFormDisabled = _ref2.isFormDisabled,
|
|
5699
|
+
isFormDisabled = _ref2$isFormDisabled === void 0 ? false : _ref2$isFormDisabled,
|
|
5700
|
+
activeTaf = _ref2.activeTaf;
|
|
5701
|
+
var _useTafTranslation = useTafTranslation(),
|
|
5702
|
+
t = _useTafTranslation.t;
|
|
5703
|
+
var scrollRef = React__default.useRef(null);
|
|
5704
|
+
React__default.useEffect(function () {
|
|
5705
|
+
if (activeTaf) {
|
|
5706
|
+
scrollToPosition(scrollRef, activeTaf.taf.location);
|
|
5707
|
+
}
|
|
5708
|
+
}, [activeTaf]);
|
|
5709
|
+
var renderAutoTaf = function renderAutoTaf(tafList) {
|
|
5710
|
+
var autoTafLocations = getAutoTafLocations();
|
|
5711
|
+
if (!autoTafLocations) {
|
|
5712
|
+
return jsx(Message, {
|
|
5713
|
+
text: t('autotaf-no-config')
|
|
5714
|
+
});
|
|
5715
|
+
}
|
|
5716
|
+
if (tafList.length === 0) {
|
|
5717
|
+
return jsx(Message, {
|
|
5718
|
+
text: t('autotaf-no-data')
|
|
5719
|
+
});
|
|
5720
|
+
}
|
|
5721
|
+
return autoTafLocations.map(function (tafLocation) {
|
|
5722
|
+
var foundLocation = tafList.find(function (tafFromBackend) {
|
|
5723
|
+
return tafFromBackend.taf.location === tafLocation;
|
|
5724
|
+
});
|
|
5725
|
+
if (foundLocation) {
|
|
5726
|
+
return jsx(TacContainer, {
|
|
5727
|
+
taf: foundLocation.taf,
|
|
5728
|
+
isFormDisabled: isFormDisabled,
|
|
5729
|
+
isActive: foundLocation.taf.location === (activeTaf == null ? void 0 : activeTaf.taf.location)
|
|
5730
|
+
}, tafLocation);
|
|
5731
|
+
}
|
|
5732
|
+
return jsx(TacContainerLayout, {
|
|
5733
|
+
location: tafLocation,
|
|
5734
|
+
isActive: tafLocation === (activeTaf == null ? void 0 : activeTaf.taf.location),
|
|
5735
|
+
children: jsx(TacHighLight, {
|
|
5736
|
+
isActive: tafLocation === (activeTaf == null ? void 0 : activeTaf.taf.location),
|
|
5737
|
+
children: t('autotaf-no-location')
|
|
5738
|
+
})
|
|
5739
|
+
}, tafLocation);
|
|
5740
|
+
});
|
|
5741
|
+
};
|
|
5742
|
+
return jsxs(Card, {
|
|
5743
|
+
variant: "outlined",
|
|
5744
|
+
sx: {
|
|
5745
|
+
my: 1,
|
|
5746
|
+
display: 'flex',
|
|
5747
|
+
flexDirection: 'column',
|
|
5748
|
+
maxHeight: '252px',
|
|
5749
|
+
overflow: {
|
|
5750
|
+
xs: 'hidden',
|
|
5751
|
+
sm: 'initial'
|
|
5752
|
+
}
|
|
5753
|
+
},
|
|
5754
|
+
"data-testid": "autotaf",
|
|
5755
|
+
children: [jsx(TafHeader, {
|
|
5756
|
+
title: t('autotaf'),
|
|
5757
|
+
sx: {
|
|
5758
|
+
textTransform: 'uppercase'
|
|
5759
|
+
}
|
|
5760
|
+
}), jsx(Box, {
|
|
5761
|
+
ref: scrollRef,
|
|
5762
|
+
sx: {
|
|
5763
|
+
padding: {
|
|
5764
|
+
xs: '12px',
|
|
5765
|
+
sm: '6px',
|
|
5766
|
+
md: '16px',
|
|
5767
|
+
lg: '24px'
|
|
5768
|
+
},
|
|
5769
|
+
overflow: 'auto'
|
|
5770
|
+
},
|
|
5771
|
+
children: renderAutoTaf(tafList)
|
|
5772
|
+
})]
|
|
5773
|
+
});
|
|
5774
|
+
};
|
|
5775
|
+
|
|
5513
5776
|
var TacOverviewMobile = function TacOverviewMobile(_ref) {
|
|
5514
5777
|
var upcomingTafs = _ref.upcomingTafs,
|
|
5515
5778
|
currentTafs = _ref.currentTafs,
|
|
5516
5779
|
expiredTafs = _ref.expiredTafs,
|
|
5517
5780
|
activeTaf = _ref.activeTaf,
|
|
5781
|
+
autoTafs = _ref.autoTafs,
|
|
5518
5782
|
_ref$defaultOpen = _ref.defaultOpen,
|
|
5519
5783
|
defaultOpen = _ref$defaultOpen === void 0 ? false : _ref$defaultOpen;
|
|
5520
5784
|
var _useTafTranslation = useTafTranslation(),
|
|
@@ -5565,6 +5829,9 @@ var TacOverviewMobile = function TacOverviewMobile(_ref) {
|
|
|
5565
5829
|
expiredTafs: expiredTafs,
|
|
5566
5830
|
activeTaf: activeTaf,
|
|
5567
5831
|
hideTitle: true
|
|
5832
|
+
}), autoTafs && jsx(AutoTaf, {
|
|
5833
|
+
tafList: autoTafs,
|
|
5834
|
+
activeTaf: activeTaf
|
|
5568
5835
|
})]
|
|
5569
5836
|
})]
|
|
5570
5837
|
});
|
|
@@ -5844,10 +6111,6 @@ var TafPanel = function TafPanel(_ref2) {
|
|
|
5844
6111
|
return null;
|
|
5845
6112
|
} : _ref2$setIsFormDisabl,
|
|
5846
6113
|
error = _ref2.error,
|
|
5847
|
-
_ref2$fetchNewTafList = _ref2.fetchNewTafList,
|
|
5848
|
-
fetchNewTafList = _ref2$fetchNewTafList === void 0 ? function () {
|
|
5849
|
-
return null;
|
|
5850
|
-
} : _ref2$fetchNewTafList,
|
|
5851
6114
|
_ref2$previousTaf = _ref2.previousTaf,
|
|
5852
6115
|
previousTaf = _ref2$previousTaf === void 0 ? null : _ref2$previousTaf,
|
|
5853
6116
|
tafAction = _ref2.tafAction;
|
|
@@ -5928,7 +6191,6 @@ var TafPanel = function TafPanel(_ref2) {
|
|
|
5928
6191
|
isDisabled: isFormDisabled,
|
|
5929
6192
|
setIsDisabled: setIsFormDisabled,
|
|
5930
6193
|
onSwitchEditor: patchTaf,
|
|
5931
|
-
fetchNewTafList: fetchNewTafList,
|
|
5932
6194
|
previousTaf: previousTaf
|
|
5933
6195
|
})
|
|
5934
6196
|
})]
|
|
@@ -5981,14 +6243,31 @@ var getSnackbarMessage = function getSnackbarMessage(tafFromFrontEnd, isAutoSave
|
|
|
5981
6243
|
return t('snackbar-save', content);
|
|
5982
6244
|
}
|
|
5983
6245
|
};
|
|
6246
|
+
var filterAutoTafs = function filterAutoTafs(tafList) {
|
|
6247
|
+
return tafList.reduce(function (tList, tafFromBackend) {
|
|
6248
|
+
var _Object$assign;
|
|
6249
|
+
var status = tafFromBackend.taf.status;
|
|
6250
|
+
var listToAdd = status === 'AUTO' ? 'autoTafList' : 'tafList';
|
|
6251
|
+
return Object.assign({}, tList, (_Object$assign = {}, _Object$assign[listToAdd] = tList[listToAdd].concat(tafFromBackend), _Object$assign));
|
|
6252
|
+
}, {
|
|
6253
|
+
tafList: [],
|
|
6254
|
+
autoTafList: []
|
|
6255
|
+
});
|
|
6256
|
+
};
|
|
5984
6257
|
var TafLayout = function TafLayout(_ref2) {
|
|
5985
|
-
var
|
|
5986
|
-
tafList = _ref2$tafList === void 0 ? [] : _ref2$tafList,
|
|
6258
|
+
var completTafList = _ref2.tafList,
|
|
5987
6259
|
_ref2$onUpdateTaf = _ref2.onUpdateTaf,
|
|
5988
6260
|
onUpdateTaf = _ref2$onUpdateTaf === void 0 ? function () {
|
|
5989
6261
|
return null;
|
|
5990
6262
|
} : _ref2$onUpdateTaf,
|
|
5991
|
-
lastUpdateTime = _ref2.lastUpdateTime
|
|
6263
|
+
lastUpdateTime = _ref2.lastUpdateTime,
|
|
6264
|
+
_ref2$isAutoTafEnable = _ref2.isAutoTafEnabled,
|
|
6265
|
+
isAutoTafEnabled = _ref2$isAutoTafEnable === void 0 ? false : _ref2$isAutoTafEnable;
|
|
6266
|
+
var _React$useMemo = React__default.useMemo(function () {
|
|
6267
|
+
return filterAutoTafs(completTafList);
|
|
6268
|
+
}, [completTafList]),
|
|
6269
|
+
tafList = _React$useMemo.tafList,
|
|
6270
|
+
autoTafList = _React$useMemo.autoTafList;
|
|
5992
6271
|
var _useTafTranslation = useTafTranslation(),
|
|
5993
6272
|
t = _useTafTranslation.t;
|
|
5994
6273
|
var _useApiContext = useApiContext(),
|
|
@@ -6284,12 +6563,14 @@ var TafLayout = function TafLayout(_ref2) {
|
|
|
6284
6563
|
position: 'relative',
|
|
6285
6564
|
minHeight: locations.length * 62 + 32
|
|
6286
6565
|
},
|
|
6287
|
-
children: [jsx(TacOverviewMobile, {
|
|
6566
|
+
children: [jsx(TacOverviewMobile, Object.assign({
|
|
6288
6567
|
upcomingTafs: upcoming,
|
|
6289
6568
|
currentTafs: current,
|
|
6290
6569
|
expiredTafs: expired,
|
|
6291
6570
|
activeTaf: activeTaf
|
|
6292
|
-
}
|
|
6571
|
+
}, isAutoTafEnabled && {
|
|
6572
|
+
autoTafs: autoTafList
|
|
6573
|
+
})), locations.map(function (tafFromBackend, index) {
|
|
6293
6574
|
return jsx(TafPanel, {
|
|
6294
6575
|
activeTafIndex: activeTafIndex,
|
|
6295
6576
|
index: index,
|
|
@@ -6302,30 +6583,36 @@ var TafLayout = function TafLayout(_ref2) {
|
|
|
6302
6583
|
patchTaf: patchTaf,
|
|
6303
6584
|
isLoading: isLoading,
|
|
6304
6585
|
error: error,
|
|
6305
|
-
fetchNewTafList: onUpdateTaf,
|
|
6306
6586
|
previousTaf: getPreviousTaf(tafList, tafFromBackend),
|
|
6307
6587
|
tafAction: tafAction
|
|
6308
6588
|
}, tafFromBackend.taf.uuid);
|
|
6309
6589
|
})]
|
|
6310
6590
|
})
|
|
6311
|
-
}),
|
|
6591
|
+
}), jsxs(Grid2, {
|
|
6312
6592
|
size: {
|
|
6313
6593
|
xs: 0,
|
|
6314
6594
|
sm: 3
|
|
6315
6595
|
},
|
|
6316
|
-
sx: {
|
|
6596
|
+
sx: Object.assign({
|
|
6317
6597
|
height: {
|
|
6318
6598
|
xs: 0,
|
|
6319
6599
|
sm: '100%'
|
|
6320
6600
|
}
|
|
6321
|
-
},
|
|
6322
|
-
|
|
6601
|
+
}, isAutoTafEnabled && {
|
|
6602
|
+
display: 'flex',
|
|
6603
|
+
flexDirection: 'column'
|
|
6604
|
+
}),
|
|
6605
|
+
children: [jsx(TacOverview, {
|
|
6323
6606
|
upcomingTafs: upcoming,
|
|
6324
6607
|
currentTafs: current,
|
|
6325
6608
|
expiredTafs: expired,
|
|
6326
6609
|
activeTaf: activeTaf,
|
|
6327
6610
|
isFormDisabled: isFormDisabled
|
|
6328
|
-
})
|
|
6611
|
+
}), isAutoTafEnabled && jsx(AutoTaf, {
|
|
6612
|
+
tafList: autoTafList,
|
|
6613
|
+
isFormDisabled: isFormDisabled,
|
|
6614
|
+
activeTaf: activeTaf
|
|
6615
|
+
})]
|
|
6329
6616
|
})]
|
|
6330
6617
|
})
|
|
6331
6618
|
})]
|
|
@@ -6339,10 +6626,10 @@ var TafLayout = function TafLayout(_ref2) {
|
|
|
6339
6626
|
});
|
|
6340
6627
|
};
|
|
6341
6628
|
|
|
6342
|
-
var _excluded = ["children"];
|
|
6629
|
+
var _excluded$1 = ["children"];
|
|
6343
6630
|
var TafWrapper = function TafWrapper(_ref) {
|
|
6344
6631
|
var children = _ref.children,
|
|
6345
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
6632
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
6346
6633
|
return jsx(ReactHookFormProvider, {
|
|
6347
6634
|
options: {
|
|
6348
6635
|
mode: 'onTouched',
|
|
@@ -6371,77 +6658,37 @@ var TafWrapper = function TafWrapper(_ref) {
|
|
|
6371
6658
|
});
|
|
6372
6659
|
};
|
|
6373
6660
|
|
|
6374
|
-
var
|
|
6375
|
-
|
|
6376
|
-
|
|
6377
|
-
var TafModule = function TafModule() {
|
|
6661
|
+
var _excluded = ["isAutoTafEnabled"];
|
|
6662
|
+
var TafModule = function TafModule(_ref) {
|
|
6663
|
+
var isAutoTafEnabled = _ref.isAutoTafEnabled;
|
|
6378
6664
|
var _useTafTranslation = useTafTranslation(),
|
|
6379
6665
|
t = _useTafTranslation.t;
|
|
6380
|
-
var
|
|
6381
|
-
|
|
6382
|
-
|
|
6383
|
-
tafList = _React$useState[0],
|
|
6384
|
-
setTafList = _React$useState[1];
|
|
6385
|
-
var _React$useState2 = React.useState(true),
|
|
6386
|
-
isLoading = _React$useState2[0],
|
|
6387
|
-
setIsLoading = _React$useState2[1];
|
|
6388
|
-
var _React$useState3 = React.useState(null),
|
|
6389
|
-
errorMessage = _React$useState3[0],
|
|
6390
|
-
setErrorMessage = _React$useState3[1];
|
|
6391
|
-
var _React$useState4 = React.useState(),
|
|
6392
|
-
lastUpdateTime = _React$useState4[0],
|
|
6393
|
-
setLastUpdateTime = _React$useState4[1];
|
|
6666
|
+
var _React$useState = React.useState(null),
|
|
6667
|
+
errorMessage = _React$useState[0],
|
|
6668
|
+
setErrorMessage = _React$useState[1];
|
|
6394
6669
|
var _useAuthenticationCon = useAuthenticationContext(),
|
|
6395
6670
|
isLoggedIn = _useAuthenticationCon.isLoggedIn;
|
|
6396
6671
|
var ERROR_AUTH = t('error-auth');
|
|
6397
6672
|
var ERROR_AUTH_MESSAGE = t('error-auth-message');
|
|
6398
|
-
var
|
|
6399
|
-
|
|
6400
|
-
|
|
6673
|
+
var _useTafList = useTafList(),
|
|
6674
|
+
isFetching = _useTafList.isFetching,
|
|
6675
|
+
tafListError = _useTafList.error,
|
|
6676
|
+
tafList = _useTafList.data,
|
|
6677
|
+
dataUpdatedAt = _useTafList.dataUpdatedAt,
|
|
6678
|
+
fetchNewTafList = _useTafList.refetch;
|
|
6679
|
+
var lastUpdateTime = dateUtils.dateToString(new Date(dataUpdatedAt), dateUtils.DATE_FORMAT_HOURS);
|
|
6680
|
+
var onUpdateTaf = /*#__PURE__*/function () {
|
|
6681
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
6401
6682
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
6402
6683
|
while (1) switch (_context.prev = _context.next) {
|
|
6403
6684
|
case 0:
|
|
6404
|
-
|
|
6405
|
-
|
|
6406
|
-
|
|
6407
|
-
_context.next = 5;
|
|
6408
|
-
return api.getTafList();
|
|
6409
|
-
case 5:
|
|
6410
|
-
result = _context.sent;
|
|
6411
|
-
setTafList(result.data);
|
|
6412
|
-
setIsLoading(false);
|
|
6413
|
-
setLastUpdateTime(getCurrentDate());
|
|
6414
|
-
return _context.abrupt("return", result.data);
|
|
6415
|
-
case 12:
|
|
6416
|
-
_context.prev = 12;
|
|
6417
|
-
_context.t0 = _context["catch"](2);
|
|
6418
|
-
setErrorMessage({
|
|
6419
|
-
title: t('error-list'),
|
|
6420
|
-
info: _context.t0.message
|
|
6421
|
-
});
|
|
6422
|
-
setIsLoading(false);
|
|
6423
|
-
return _context.abrupt("return", []);
|
|
6424
|
-
case 17:
|
|
6685
|
+
_context.next = 2;
|
|
6686
|
+
return fetchNewTafList();
|
|
6687
|
+
case 2:
|
|
6425
6688
|
case "end":
|
|
6426
6689
|
return _context.stop();
|
|
6427
6690
|
}
|
|
6428
|
-
}, _callee
|
|
6429
|
-
}));
|
|
6430
|
-
return function fetchNewTafList() {
|
|
6431
|
-
return _ref.apply(this, arguments);
|
|
6432
|
-
};
|
|
6433
|
-
}();
|
|
6434
|
-
var onUpdateTaf = /*#__PURE__*/function () {
|
|
6435
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
6436
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
6437
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
6438
|
-
case 0:
|
|
6439
|
-
return _context2.abrupt("return", fetchNewTafList());
|
|
6440
|
-
case 1:
|
|
6441
|
-
case "end":
|
|
6442
|
-
return _context2.stop();
|
|
6443
|
-
}
|
|
6444
|
-
}, _callee2);
|
|
6691
|
+
}, _callee);
|
|
6445
6692
|
}));
|
|
6446
6693
|
return function onUpdateTaf() {
|
|
6447
6694
|
return _ref2.apply(this, arguments);
|
|
@@ -6453,12 +6700,15 @@ var TafModule = function TafModule() {
|
|
|
6453
6700
|
title: ERROR_AUTH,
|
|
6454
6701
|
info: ERROR_AUTH_MESSAGE
|
|
6455
6702
|
});
|
|
6703
|
+
} else if (tafListError) {
|
|
6704
|
+
setErrorMessage({
|
|
6705
|
+
title: t('error-list'),
|
|
6706
|
+
info: tafListError.message
|
|
6707
|
+
});
|
|
6456
6708
|
} else {
|
|
6457
|
-
|
|
6709
|
+
setErrorMessage(null);
|
|
6458
6710
|
}
|
|
6459
|
-
|
|
6460
|
-
}, [isLoggedIn]);
|
|
6461
|
-
usePoller([tafList, errorMessage], fetchNewTafList);
|
|
6711
|
+
}, [t, tafListError, isLoggedIn, ERROR_AUTH, ERROR_AUTH_MESSAGE]);
|
|
6462
6712
|
return jsx(ResponsiveWrapper, {
|
|
6463
6713
|
children: jsxs(Box, {
|
|
6464
6714
|
component: "div",
|
|
@@ -6467,7 +6717,7 @@ var TafModule = function TafModule() {
|
|
|
6467
6717
|
sx: {
|
|
6468
6718
|
height: '100%'
|
|
6469
6719
|
},
|
|
6470
|
-
children: [isLoggedIn &&
|
|
6720
|
+
children: [isLoggedIn && isFetching && jsx(LinearProgress, {
|
|
6471
6721
|
"data-testid": "loading-bar",
|
|
6472
6722
|
color: "secondary",
|
|
6473
6723
|
sx: {
|
|
@@ -6480,19 +6730,25 @@ var TafModule = function TafModule() {
|
|
|
6480
6730
|
"data-testid": "error-message",
|
|
6481
6731
|
actionButtonProps: errorMessage.title !== ERROR_AUTH ? {
|
|
6482
6732
|
title: t('error-title-retry'),
|
|
6483
|
-
onClick:
|
|
6733
|
+
onClick: onUpdateTaf
|
|
6484
6734
|
} : undefined
|
|
6485
6735
|
}) : null, jsx(TafLayout, {
|
|
6486
|
-
tafList: tafList,
|
|
6736
|
+
tafList: tafList || [],
|
|
6487
6737
|
onUpdateTaf: onUpdateTaf,
|
|
6488
|
-
lastUpdateTime: lastUpdateTime
|
|
6738
|
+
lastUpdateTime: lastUpdateTime,
|
|
6739
|
+
isAutoTafEnabled: isAutoTafEnabled
|
|
6489
6740
|
})]
|
|
6490
6741
|
})
|
|
6491
6742
|
});
|
|
6492
6743
|
};
|
|
6493
|
-
var Wrapper = function Wrapper(
|
|
6744
|
+
var Wrapper = function Wrapper(_ref3) {
|
|
6745
|
+
var _ref3$isAutoTafEnable = _ref3.isAutoTafEnabled,
|
|
6746
|
+
isAutoTafEnabled = _ref3$isAutoTafEnable === void 0 ? false : _ref3$isAutoTafEnable,
|
|
6747
|
+
props = _objectWithoutPropertiesLoose(_ref3, _excluded);
|
|
6494
6748
|
return jsx(TafWrapper, Object.assign({}, props, {
|
|
6495
|
-
children: jsx(TafModule, {
|
|
6749
|
+
children: jsx(TafModule, {
|
|
6750
|
+
isAutoTafEnabled: isAutoTafEnabled
|
|
6751
|
+
})
|
|
6496
6752
|
}));
|
|
6497
6753
|
};
|
|
6498
6754
|
|
|
@@ -6515,9 +6771,6 @@ var Wrapper = function Wrapper(props) {
|
|
|
6515
6771
|
* */
|
|
6516
6772
|
var getApiRoutes$1 = function getApiRoutes(axiosInstance) {
|
|
6517
6773
|
return {
|
|
6518
|
-
getTafList: function getTafList() {
|
|
6519
|
-
return axiosInstance.get('/taflist');
|
|
6520
|
-
},
|
|
6521
6774
|
postTaf: function postTaf(formData) {
|
|
6522
6775
|
return axiosInstance.post('/taf', Object.assign({}, formData));
|
|
6523
6776
|
},
|
|
@@ -7090,6 +7343,228 @@ var fakeTafList = [{
|
|
|
7090
7343
|
}
|
|
7091
7344
|
}]
|
|
7092
7345
|
}
|
|
7346
|
+
},
|
|
7347
|
+
// auto tafs
|
|
7348
|
+
{
|
|
7349
|
+
creationDate: upcomingValidDateStart,
|
|
7350
|
+
canbe: [],
|
|
7351
|
+
editor: null,
|
|
7352
|
+
taf: {
|
|
7353
|
+
uuid: '5f9583fjdf0sdf337925',
|
|
7354
|
+
baseTime: upcomingValidDateStart,
|
|
7355
|
+
validDateStart: upcomingValidDateStart,
|
|
7356
|
+
validDateEnd: upcomingValidDateEnd,
|
|
7357
|
+
location: 'EHAM',
|
|
7358
|
+
status: 'AUTO',
|
|
7359
|
+
messageType: 'ORG',
|
|
7360
|
+
baseForecast: {
|
|
7361
|
+
valid: {
|
|
7362
|
+
start: upcomingValidDateStart,
|
|
7363
|
+
end: upcomingValidDateEnd
|
|
7364
|
+
}
|
|
7365
|
+
}
|
|
7366
|
+
}
|
|
7367
|
+
}, {
|
|
7368
|
+
creationDate: upcomingValidDateStart,
|
|
7369
|
+
canbe: [],
|
|
7370
|
+
editor: null,
|
|
7371
|
+
taf: {
|
|
7372
|
+
uuid: '5fsds9583fjd111137925',
|
|
7373
|
+
baseTime: upcomingValidDateStart,
|
|
7374
|
+
validDateStart: upcomingValidDateStart,
|
|
7375
|
+
validDateEnd: upcomingValidDateEnd,
|
|
7376
|
+
location: 'EHRD',
|
|
7377
|
+
status: 'AUTO',
|
|
7378
|
+
messageType: 'ORG',
|
|
7379
|
+
baseForecast: {
|
|
7380
|
+
valid: {
|
|
7381
|
+
start: upcomingValidDateStart,
|
|
7382
|
+
end: upcomingValidDateEnd
|
|
7383
|
+
},
|
|
7384
|
+
wind: {
|
|
7385
|
+
direction: 180,
|
|
7386
|
+
speed: 10,
|
|
7387
|
+
unit: 'KT'
|
|
7388
|
+
},
|
|
7389
|
+
cavOK: true
|
|
7390
|
+
}
|
|
7391
|
+
}
|
|
7392
|
+
}, {
|
|
7393
|
+
creationDate: upcomingValidDateStart,
|
|
7394
|
+
canbe: [],
|
|
7395
|
+
editor: null,
|
|
7396
|
+
taf: {
|
|
7397
|
+
uuid: '7549054545485',
|
|
7398
|
+
baseTime: upcomingValidDateStart,
|
|
7399
|
+
validDateStart: upcomingValidDateStart,
|
|
7400
|
+
validDateEnd: upcomingValidDateEnd,
|
|
7401
|
+
location: 'EHLE',
|
|
7402
|
+
status: 'AUTO',
|
|
7403
|
+
messageType: 'ORG',
|
|
7404
|
+
baseForecast: {
|
|
7405
|
+
valid: {
|
|
7406
|
+
start: upcomingValidDateStart,
|
|
7407
|
+
end: upcomingValidDateEnd
|
|
7408
|
+
},
|
|
7409
|
+
visibility: {
|
|
7410
|
+
range: 600,
|
|
7411
|
+
unit: 'M'
|
|
7412
|
+
},
|
|
7413
|
+
wind: {
|
|
7414
|
+
direction: 180,
|
|
7415
|
+
speed: 10,
|
|
7416
|
+
unit: 'KT'
|
|
7417
|
+
},
|
|
7418
|
+
weather: {
|
|
7419
|
+
weather1: 'SN'
|
|
7420
|
+
},
|
|
7421
|
+
cloud: {
|
|
7422
|
+
cloud1: {
|
|
7423
|
+
coverage: 'BKN',
|
|
7424
|
+
height: 35
|
|
7425
|
+
}
|
|
7426
|
+
}
|
|
7427
|
+
},
|
|
7428
|
+
changeGroups: [{
|
|
7429
|
+
change: 'TEMPO',
|
|
7430
|
+
probability: 'PROB30',
|
|
7431
|
+
valid: {
|
|
7432
|
+
start: dateAdd(upcomingValidDateStart, 3),
|
|
7433
|
+
end: dateAdd(upcomingValidDateStart, 4)
|
|
7434
|
+
},
|
|
7435
|
+
visibility: {
|
|
7436
|
+
range: 100,
|
|
7437
|
+
unit: 'M'
|
|
7438
|
+
},
|
|
7439
|
+
cloud: {
|
|
7440
|
+
cloud1: {
|
|
7441
|
+
verticalVisibility: 5
|
|
7442
|
+
}
|
|
7443
|
+
}
|
|
7444
|
+
}]
|
|
7445
|
+
}
|
|
7446
|
+
}, {
|
|
7447
|
+
creationDate: upcomingValidDateStart,
|
|
7448
|
+
canbe: [],
|
|
7449
|
+
editor: null,
|
|
7450
|
+
taf: {
|
|
7451
|
+
uuid: '4354545345345',
|
|
7452
|
+
issueDate: upcomingValidDateStart,
|
|
7453
|
+
baseTime: currentDate + "T18:00:00Z",
|
|
7454
|
+
validDateStart: currentDate + "T18:00:00Z",
|
|
7455
|
+
validDateEnd: upcomingValidDateEnd,
|
|
7456
|
+
location: 'EHLE',
|
|
7457
|
+
status: 'AUTO',
|
|
7458
|
+
messageType: 'ORG',
|
|
7459
|
+
baseForecast: {
|
|
7460
|
+
valid: {
|
|
7461
|
+
start: upcomingValidDateStart,
|
|
7462
|
+
end: upcomingValidDateEnd
|
|
7463
|
+
},
|
|
7464
|
+
wind: {
|
|
7465
|
+
direction: 350,
|
|
7466
|
+
speed: 46,
|
|
7467
|
+
gust: 67,
|
|
7468
|
+
unit: 'KT'
|
|
7469
|
+
},
|
|
7470
|
+
cavOK: true
|
|
7471
|
+
},
|
|
7472
|
+
changeGroups: [{
|
|
7473
|
+
change: 'BECMG',
|
|
7474
|
+
valid: {
|
|
7475
|
+
start: dateAdd(upcomingValidDateStart, 1),
|
|
7476
|
+
end: dateAdd(upcomingValidDateStart, 2)
|
|
7477
|
+
},
|
|
7478
|
+
visibility: {
|
|
7479
|
+
range: 1000,
|
|
7480
|
+
unit: 'M'
|
|
7481
|
+
},
|
|
7482
|
+
weather: {
|
|
7483
|
+
weather1: 'MIFG'
|
|
7484
|
+
},
|
|
7485
|
+
cloud: {
|
|
7486
|
+
cloud1: 'NSC'
|
|
7487
|
+
}
|
|
7488
|
+
}, {
|
|
7489
|
+
change: 'FM',
|
|
7490
|
+
valid: {
|
|
7491
|
+
start: dateAdd(upcomingValidDateStart, 2)
|
|
7492
|
+
},
|
|
7493
|
+
visibility: {
|
|
7494
|
+
range: 6000,
|
|
7495
|
+
unit: 'M'
|
|
7496
|
+
},
|
|
7497
|
+
weather: {
|
|
7498
|
+
weather1: '+SHRA'
|
|
7499
|
+
},
|
|
7500
|
+
cloud: {
|
|
7501
|
+
cloud1: {
|
|
7502
|
+
coverage: 'BKN',
|
|
7503
|
+
height: 40
|
|
7504
|
+
},
|
|
7505
|
+
cloud2: {
|
|
7506
|
+
coverage: 'OVC',
|
|
7507
|
+
height: 60,
|
|
7508
|
+
type: 'CB'
|
|
7509
|
+
}
|
|
7510
|
+
}
|
|
7511
|
+
}]
|
|
7512
|
+
}
|
|
7513
|
+
}, {
|
|
7514
|
+
creationDate: upcomingValidDateStart,
|
|
7515
|
+
canbe: ['CANCELLED', 'AMENDED', 'CORRECTED'],
|
|
7516
|
+
editor: null,
|
|
7517
|
+
taf: {
|
|
7518
|
+
uuid: '5f9583fjdf45454ff4330f337925',
|
|
7519
|
+
issueDate: upcomingValidDateStart,
|
|
7520
|
+
baseTime: upcomingValidDateStart,
|
|
7521
|
+
validDateStart: upcomingValidDateStart,
|
|
7522
|
+
validDateEnd: upcomingValidDateEnd,
|
|
7523
|
+
location: 'EHGG',
|
|
7524
|
+
status: 'AUTO',
|
|
7525
|
+
messageType: 'ORG',
|
|
7526
|
+
baseForecast: {
|
|
7527
|
+
valid: {
|
|
7528
|
+
start: upcomingValidDateStart,
|
|
7529
|
+
end: upcomingValidDateEnd
|
|
7530
|
+
},
|
|
7531
|
+
visibility: {
|
|
7532
|
+
range: 600,
|
|
7533
|
+
unit: 'M'
|
|
7534
|
+
},
|
|
7535
|
+
wind: {
|
|
7536
|
+
direction: 180,
|
|
7537
|
+
speed: 10,
|
|
7538
|
+
unit: 'KT'
|
|
7539
|
+
},
|
|
7540
|
+
weather: {
|
|
7541
|
+
weather1: 'SN'
|
|
7542
|
+
},
|
|
7543
|
+
cloud: {
|
|
7544
|
+
cloud1: {
|
|
7545
|
+
coverage: 'BKN',
|
|
7546
|
+
height: 35
|
|
7547
|
+
}
|
|
7548
|
+
}
|
|
7549
|
+
},
|
|
7550
|
+
changeGroups: [{
|
|
7551
|
+
change: 'TEMPO',
|
|
7552
|
+
probability: 'PROB30',
|
|
7553
|
+
valid: {
|
|
7554
|
+
start: dateAdd(upcomingValidDateStart, 1),
|
|
7555
|
+
end: dateAdd(upcomingValidDateStart, 2)
|
|
7556
|
+
},
|
|
7557
|
+
visibility: {
|
|
7558
|
+
range: 200,
|
|
7559
|
+
unit: 'M'
|
|
7560
|
+
},
|
|
7561
|
+
cloud: {
|
|
7562
|
+
cloud1: {
|
|
7563
|
+
verticalVisibility: 5
|
|
7564
|
+
}
|
|
7565
|
+
}
|
|
7566
|
+
}]
|
|
7567
|
+
}
|
|
7093
7568
|
}];
|
|
7094
7569
|
var fakeNewTaf = {
|
|
7095
7570
|
creationDate: currentDate + "T12:00:00Z",
|
|
@@ -7554,15 +8029,6 @@ var getFakeUpdatedList = function getFakeUpdatedList() {
|
|
|
7554
8029
|
};
|
|
7555
8030
|
var getApiRoutes = function getApiRoutes(axiosInstance) {
|
|
7556
8031
|
return {
|
|
7557
|
-
getTafList: function getTafList() {
|
|
7558
|
-
// eslint-disable-next-line no-console
|
|
7559
|
-
console.log('Retrieving new TAF list');
|
|
7560
|
-
return axiosInstance.get('/taflist').then(function () {
|
|
7561
|
-
return {
|
|
7562
|
-
data: getFakeUpdatedList()
|
|
7563
|
-
};
|
|
7564
|
-
});
|
|
7565
|
-
},
|
|
7566
8032
|
postTaf: function postTaf(_postTaf) {
|
|
7567
8033
|
// eslint-disable-next-line no-console
|
|
7568
8034
|
console.log("The new status of the taf will be " + _postTaf.changeStatusTo);
|
|
@@ -7624,7 +8090,8 @@ var TafApiWrapper = function TafApiWrapper(_ref) {
|
|
|
7624
8090
|
var config = _ref.config,
|
|
7625
8091
|
auth = _ref.auth,
|
|
7626
8092
|
onSetAuth = _ref.onSetAuth,
|
|
7627
|
-
onPreventCloseView = _ref.onPreventCloseView
|
|
8093
|
+
onPreventCloseView = _ref.onPreventCloseView,
|
|
8094
|
+
initialProps = _ref.initialProps;
|
|
7628
8095
|
return config ? jsx(ApiProvider, {
|
|
7629
8096
|
config: {
|
|
7630
8097
|
baseURL: config.baseURL,
|
|
@@ -7637,7 +8104,8 @@ var TafApiWrapper = function TafApiWrapper(_ref) {
|
|
|
7637
8104
|
createApi: createApi$1,
|
|
7638
8105
|
children: jsx(ErrorBoundary, {
|
|
7639
8106
|
children: jsx(Wrapper, {
|
|
7640
|
-
onPreventCloseView: onPreventCloseView
|
|
8107
|
+
onPreventCloseView: onPreventCloseView,
|
|
8108
|
+
isAutoTafEnabled: initialProps == null ? void 0 : initialProps.isAutoTafEnabled
|
|
7641
8109
|
})
|
|
7642
8110
|
})
|
|
7643
8111
|
}) : null;
|
|
@@ -7653,12 +8121,17 @@ ConnectedModuleWrapper) {
|
|
|
7653
8121
|
if (ConnectedModuleWrapper === void 0) {
|
|
7654
8122
|
ConnectedModuleWrapper = null;
|
|
7655
8123
|
}
|
|
7656
|
-
var componentType = payload.componentType
|
|
8124
|
+
var componentType = payload.componentType,
|
|
8125
|
+
initialProps = payload.initialProps;
|
|
7657
8126
|
switch (componentType) {
|
|
7658
8127
|
case 'TafModule':
|
|
7659
8128
|
if (ConnectedModuleWrapper) {
|
|
7660
8129
|
return jsx(ConnectedModuleWrapper, {
|
|
7661
|
-
component:
|
|
8130
|
+
component: function component(props) {
|
|
8131
|
+
return jsx(TafApiWrapper, Object.assign({}, props, {
|
|
8132
|
+
initialProps: initialProps
|
|
8133
|
+
}));
|
|
8134
|
+
},
|
|
7662
8135
|
payload: payload,
|
|
7663
8136
|
"data-testid": "tafmodule",
|
|
7664
8137
|
config: config,
|
|
@@ -7670,7 +8143,8 @@ ConnectedModuleWrapper) {
|
|
|
7670
8143
|
"data-testid": "tafmodule",
|
|
7671
8144
|
config: config,
|
|
7672
8145
|
auth: auth,
|
|
7673
|
-
onSetAuth: onSetAuth
|
|
8146
|
+
onSetAuth: onSetAuth,
|
|
8147
|
+
initialProps: initialProps
|
|
7674
8148
|
});
|
|
7675
8149
|
default:
|
|
7676
8150
|
return null;
|