@opengeoweb/taf 9.19.1 → 9.20.2
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 +1153 -1102
- package/package.json +2 -2
- package/src/lib/components/TafForm/TafFormRow/TafFormRow.d.ts +1 -1
package/index.esm.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import React__default from 'react';
|
|
3
4
|
import { Grid, Button, Chip, Box, Typography, TextField, Card, Tabs, Tab, Dialog, MenuList, MenuItem, Backdrop, CircularProgress } from '@mui/material';
|
|
@@ -162,7 +163,9 @@ var store$3 = sharedStore.exports = globalThis$1[SHARED] || defineGlobalProperty
|
|
|
162
163
|
source: 'https://github.com/zloirock/core-js'
|
|
163
164
|
});
|
|
164
165
|
|
|
165
|
-
var
|
|
166
|
+
var sharedStoreExports = sharedStore.exports;
|
|
167
|
+
|
|
168
|
+
var store$2 = sharedStoreExports;
|
|
166
169
|
|
|
167
170
|
var shared$4 = function (key, value) {
|
|
168
171
|
return store$2[key] || (store$2[key] = value || {});
|
|
@@ -820,7 +823,7 @@ var global$e = global$m;
|
|
|
820
823
|
var isObject$6 = isObject$b;
|
|
821
824
|
var createNonEnumerableProperty$4 = createNonEnumerableProperty$5;
|
|
822
825
|
var hasOwn$8 = hasOwnProperty_1;
|
|
823
|
-
var shared$1 =
|
|
826
|
+
var shared$1 = sharedStoreExports;
|
|
824
827
|
var sharedKey$1 = sharedKey$3;
|
|
825
828
|
var hiddenKeys$1 = hiddenKeys$4;
|
|
826
829
|
|
|
@@ -949,7 +952,7 @@ var functionName = {
|
|
|
949
952
|
|
|
950
953
|
var uncurryThis$g = functionUncurryThis;
|
|
951
954
|
var isCallable$e = isCallable$l;
|
|
952
|
-
var store =
|
|
955
|
+
var store = sharedStoreExports;
|
|
953
956
|
|
|
954
957
|
var functionToString = uncurryThis$g(Function.toString);
|
|
955
958
|
|
|
@@ -1017,9 +1020,11 @@ Function.prototype.toString = makeBuiltIn$2(function toString() {
|
|
|
1017
1020
|
return isCallable$d(this) && getInternalState$2(this).source || inspectSource$2(this);
|
|
1018
1021
|
}, 'toString');
|
|
1019
1022
|
|
|
1023
|
+
var makeBuiltInExports = makeBuiltIn$3.exports;
|
|
1024
|
+
|
|
1020
1025
|
var isCallable$c = isCallable$l;
|
|
1021
1026
|
var definePropertyModule$1 = objectDefineProperty;
|
|
1022
|
-
var makeBuiltIn$1 =
|
|
1027
|
+
var makeBuiltIn$1 = makeBuiltInExports;
|
|
1023
1028
|
var defineGlobalProperty$1 = defineGlobalProperty$3;
|
|
1024
1029
|
|
|
1025
1030
|
var defineBuiltIn$7 = function (O, key, value, options) {
|
|
@@ -1574,7 +1579,7 @@ var classof$7 = classofRaw$2;
|
|
|
1574
1579
|
|
|
1575
1580
|
var engineIsNode = classof$7(global$c.process) === 'process';
|
|
1576
1581
|
|
|
1577
|
-
var makeBuiltIn =
|
|
1582
|
+
var makeBuiltIn = makeBuiltInExports;
|
|
1578
1583
|
var defineProperty = objectDefineProperty;
|
|
1579
1584
|
|
|
1580
1585
|
var defineBuiltInAccessor$1 = function (target, name, descriptor) {
|
|
@@ -3350,6 +3355,8 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
3350
3355
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
3351
3356
|
PERFORMANCE OF THIS SOFTWARE.
|
|
3352
3357
|
***************************************************************************** */
|
|
3358
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
3359
|
+
|
|
3353
3360
|
|
|
3354
3361
|
function __rest(s, e) {
|
|
3355
3362
|
var t = {};
|
|
@@ -3506,19 +3513,27 @@ const ViewModeButtons = ({
|
|
|
3506
3513
|
canBe,
|
|
3507
3514
|
onTafViewModeButtonPress
|
|
3508
3515
|
}) => {
|
|
3509
|
-
return !canBe.includes('CANCELLED') && !canBe.includes('CORRECTED') && !canBe.includes('AMENDED') ? null : (
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3516
|
+
return !canBe.includes('CANCELLED') && !canBe.includes('CORRECTED') && !canBe.includes('AMENDED') ? null : jsxs(Fragment, {
|
|
3517
|
+
children: [canBe.includes('CANCELLED') && jsx(Button, Object.assign({
|
|
3518
|
+
"data-testid": "canceltaf",
|
|
3519
|
+
variant: "tertiary",
|
|
3520
|
+
onClick: () => onTafViewModeButtonPress('CANCEL')
|
|
3521
|
+
}, {
|
|
3522
|
+
children: "Cancel"
|
|
3523
|
+
})), canBe.includes('CORRECTED') && jsx(Button, Object.assign({
|
|
3524
|
+
"data-testid": "correcttaf",
|
|
3525
|
+
variant: "tertiary",
|
|
3526
|
+
onClick: () => onTafViewModeButtonPress('CORRECT')
|
|
3527
|
+
}, {
|
|
3528
|
+
children: "Correct"
|
|
3529
|
+
})), canBe.includes('AMENDED') && jsx(Button, Object.assign({
|
|
3530
|
+
"data-testid": "amendtaf",
|
|
3531
|
+
variant: "tertiary",
|
|
3532
|
+
onClick: () => onTafViewModeButtonPress('AMEND')
|
|
3533
|
+
}, {
|
|
3534
|
+
children: "Amend"
|
|
3535
|
+
}))]
|
|
3536
|
+
});
|
|
3522
3537
|
};
|
|
3523
3538
|
const TafFormButtons = ({
|
|
3524
3539
|
isFormDisabled: _isFormDisabled = false,
|
|
@@ -3527,58 +3542,70 @@ const TafFormButtons = ({
|
|
|
3527
3542
|
onTafEditModeButtonPress,
|
|
3528
3543
|
onTafViewModeButtonPress
|
|
3529
3544
|
}) => {
|
|
3530
|
-
return
|
|
3545
|
+
return jsxs(Grid, Object.assign({
|
|
3531
3546
|
container: true,
|
|
3532
3547
|
justifyContent: "flex-end",
|
|
3533
3548
|
sx: buttonsStyle,
|
|
3534
3549
|
columns: 24
|
|
3535
|
-
},
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3550
|
+
}, {
|
|
3551
|
+
children: [jsx(Grid, Object.assign({
|
|
3552
|
+
item: true,
|
|
3553
|
+
container: true,
|
|
3554
|
+
justifyContent: "flex-end",
|
|
3555
|
+
columns: 24,
|
|
3556
|
+
xs: 24,
|
|
3557
|
+
sm: 23
|
|
3558
|
+
}, {
|
|
3559
|
+
children: _isFormDisabled ? jsx(ViewModeButtons, {
|
|
3560
|
+
canBe: _canBe,
|
|
3561
|
+
onTafViewModeButtonPress: onTafViewModeButtonPress
|
|
3562
|
+
}) : jsxs(Fragment, {
|
|
3563
|
+
children: [jsx(Button, Object.assign({
|
|
3564
|
+
"data-testid": "cleartaf",
|
|
3565
|
+
variant: "tertiary",
|
|
3566
|
+
onClick: () => {
|
|
3567
|
+
// Simply discard the changes and close the dialog.
|
|
3568
|
+
onTafEditModeButtonPress('CLEAR');
|
|
3569
|
+
}
|
|
3570
|
+
}, {
|
|
3571
|
+
children: "Clear"
|
|
3572
|
+
})), jsx(Button, Object.assign({
|
|
3573
|
+
"data-testid": "savedrafttaf",
|
|
3574
|
+
variant: "tertiary",
|
|
3575
|
+
onClick: () => {
|
|
3576
|
+
/* Save the TAF as draft:
|
|
3577
|
+
if action NEW or DRAFT - new status will be DRAFT -- default
|
|
3578
|
+
if action AMEND - new status will be DRAFT_AMENDED
|
|
3579
|
+
if action CORRECT - new status will be DRAFT_CORRECTED
|
|
3580
|
+
if action DRAFT_AMEND - new status will be DRAFT_AMENDED
|
|
3581
|
+
if action DRAFT_CORRECT - new status will be DRAFT_CORRECTED
|
|
3582
|
+
*/
|
|
3583
|
+
onTafEditModeButtonPress(tafActionToDraftAction(tafAction));
|
|
3584
|
+
}
|
|
3585
|
+
}, {
|
|
3586
|
+
children: "Save"
|
|
3587
|
+
})), jsx(Button, Object.assign({
|
|
3588
|
+
"data-testid": "publishtaf",
|
|
3589
|
+
variant: "tertiary",
|
|
3590
|
+
onClick: () => {
|
|
3591
|
+
/* Publish the TAF:
|
|
3592
|
+
if action NEW or DRAFT - new status will be PUBLISHED -- default
|
|
3593
|
+
if action AMEND - new status will be AMENDED
|
|
3594
|
+
if action CORRECT - new status will be CORRECTED
|
|
3595
|
+
if action DRAFT_AMEND - new status will be AMENDED
|
|
3596
|
+
if action DRAFT_CORRECT - new status will be CORRECTED
|
|
3597
|
+
*/
|
|
3598
|
+
onTafEditModeButtonPress(tafActionToPublishAction(tafAction));
|
|
3599
|
+
}
|
|
3600
|
+
}, {
|
|
3601
|
+
children: "Publish"
|
|
3602
|
+
}))]
|
|
3603
|
+
})
|
|
3604
|
+
})), jsx(Grid, {
|
|
3605
|
+
item: true,
|
|
3606
|
+
columns: 24,
|
|
3607
|
+
sm: 1
|
|
3608
|
+
})]
|
|
3582
3609
|
}));
|
|
3583
3610
|
};
|
|
3584
3611
|
|
|
@@ -6227,28 +6254,12 @@ const getFormRowPosition = formRow => {
|
|
|
6227
6254
|
};
|
|
6228
6255
|
};
|
|
6229
6256
|
|
|
6230
|
-
/* *
|
|
6231
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6232
|
-
* you may not use this file except in compliance with the License.
|
|
6233
|
-
* You may obtain a copy of the License at
|
|
6234
|
-
*
|
|
6235
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
6236
|
-
*
|
|
6237
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
6238
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
6239
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6240
|
-
* See the License for the specific language governing permissions and
|
|
6241
|
-
* limitations under the License.
|
|
6242
|
-
*
|
|
6243
|
-
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6244
|
-
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
6245
|
-
* */
|
|
6246
6257
|
const DragHandle = ({
|
|
6247
6258
|
isSorting: _isSorting = false,
|
|
6248
6259
|
isDisabled: _isDisabled = false,
|
|
6249
6260
|
index
|
|
6250
6261
|
}) => {
|
|
6251
|
-
return
|
|
6262
|
+
return jsx(CustomIconButton, Object.assign({
|
|
6252
6263
|
className: "handle",
|
|
6253
6264
|
"data-testid": `dragHandle-${index}`,
|
|
6254
6265
|
disableRipple: true,
|
|
@@ -6264,7 +6275,9 @@ const DragHandle = ({
|
|
|
6264
6275
|
}
|
|
6265
6276
|
}
|
|
6266
6277
|
}
|
|
6267
|
-
},
|
|
6278
|
+
}, {
|
|
6279
|
+
children: jsx(DragHandle$1, {})
|
|
6280
|
+
}));
|
|
6268
6281
|
};
|
|
6269
6282
|
|
|
6270
6283
|
/* *
|
|
@@ -6337,22 +6350,6 @@ const getErrors = errors => {
|
|
|
6337
6350
|
return errorList;
|
|
6338
6351
|
};
|
|
6339
6352
|
|
|
6340
|
-
/* *
|
|
6341
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6342
|
-
* you may not use this file except in compliance with the License.
|
|
6343
|
-
* You may obtain a copy of the License at
|
|
6344
|
-
*
|
|
6345
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
6346
|
-
*
|
|
6347
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
6348
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
6349
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6350
|
-
* See the License for the specific language governing permissions and
|
|
6351
|
-
* limitations under the License.
|
|
6352
|
-
*
|
|
6353
|
-
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6354
|
-
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
6355
|
-
* */
|
|
6356
6353
|
const IssuesButton = ({
|
|
6357
6354
|
errors: _errors = {},
|
|
6358
6355
|
isIssuesPaneOpen: _isIssuesPaneOpen = false,
|
|
@@ -6379,26 +6376,28 @@ const IssuesButton = ({
|
|
|
6379
6376
|
};
|
|
6380
6377
|
toggleIssuesPane(newPosition);
|
|
6381
6378
|
};
|
|
6382
|
-
return
|
|
6379
|
+
return jsx(CustomTooltip, Object.assign({
|
|
6383
6380
|
title: "View details"
|
|
6384
|
-
},
|
|
6385
|
-
|
|
6386
|
-
|
|
6387
|
-
|
|
6388
|
-
|
|
6389
|
-
|
|
6390
|
-
|
|
6391
|
-
|
|
6392
|
-
|
|
6393
|
-
|
|
6394
|
-
|
|
6395
|
-
|
|
6396
|
-
|
|
6397
|
-
|
|
6398
|
-
|
|
6399
|
-
|
|
6400
|
-
|
|
6401
|
-
|
|
6381
|
+
}, {
|
|
6382
|
+
children: jsx(Chip, {
|
|
6383
|
+
"data-testid": "issuesButton",
|
|
6384
|
+
className: `status-${errorStatus}`,
|
|
6385
|
+
size: "small",
|
|
6386
|
+
label: getIssuesLabel(totalErrors),
|
|
6387
|
+
onClick: onClickButton,
|
|
6388
|
+
sx: {
|
|
6389
|
+
width: '74px',
|
|
6390
|
+
color: '#ffffff',
|
|
6391
|
+
backgroundColor: buttonColor,
|
|
6392
|
+
'&:hover': {
|
|
6393
|
+
backgroundColor: buttonColor
|
|
6394
|
+
},
|
|
6395
|
+
'&:focus': {
|
|
6396
|
+
backgroundColor: buttonColor
|
|
6397
|
+
},
|
|
6398
|
+
fontSize: 12
|
|
6399
|
+
}
|
|
6400
|
+
})
|
|
6402
6401
|
}));
|
|
6403
6402
|
};
|
|
6404
6403
|
|
|
@@ -6457,7 +6456,7 @@ const IssuesPane = ({
|
|
|
6457
6456
|
onUserHasDragged: _onUserHasDragged = () => {}
|
|
6458
6457
|
}) => {
|
|
6459
6458
|
const rootElement = document.getElementById(MODAL_DIALOG_ELEMENT) || document.body;
|
|
6460
|
-
return /*#__PURE__*/ReactDOM.createPortal(
|
|
6459
|
+
return /*#__PURE__*/ReactDOM.createPortal(jsx(ToolContainerDraggable, Object.assign({
|
|
6461
6460
|
startSize: {
|
|
6462
6461
|
width: '577px',
|
|
6463
6462
|
height: '200px'
|
|
@@ -6475,31 +6474,37 @@ const IssuesPane = ({
|
|
|
6475
6474
|
_onUserHasDragged();
|
|
6476
6475
|
}
|
|
6477
6476
|
}
|
|
6478
|
-
},
|
|
6479
|
-
|
|
6480
|
-
|
|
6481
|
-
|
|
6482
|
-
|
|
6483
|
-
|
|
6484
|
-
|
|
6485
|
-
|
|
6486
|
-
|
|
6487
|
-
|
|
6488
|
-
|
|
6489
|
-
|
|
6490
|
-
|
|
6491
|
-
|
|
6492
|
-
|
|
6493
|
-
|
|
6494
|
-
|
|
6495
|
-
|
|
6496
|
-
|
|
6497
|
-
|
|
6498
|
-
|
|
6499
|
-
|
|
6500
|
-
|
|
6501
|
-
|
|
6502
|
-
|
|
6477
|
+
}, {
|
|
6478
|
+
children: jsxs(Box, Object.assign({
|
|
6479
|
+
component: "div",
|
|
6480
|
+
sx: {
|
|
6481
|
+
marginTop: '16px',
|
|
6482
|
+
marginLeft: '24px'
|
|
6483
|
+
}
|
|
6484
|
+
}, {
|
|
6485
|
+
children: [_errorList.length === 0 && jsx(Box, Object.assign({
|
|
6486
|
+
component: "div",
|
|
6487
|
+
sx: {
|
|
6488
|
+
fontSize: '4rem'
|
|
6489
|
+
},
|
|
6490
|
+
"data-testid": "zeroIssuesImage"
|
|
6491
|
+
}, {
|
|
6492
|
+
children: jsx(ThumbsUp, {
|
|
6493
|
+
sx: {
|
|
6494
|
+
height: '69px',
|
|
6495
|
+
width: '58px'
|
|
6496
|
+
}
|
|
6497
|
+
})
|
|
6498
|
+
})), _errorList.length > 0 && _errorList.map((error, index) => jsx(Typography
|
|
6499
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
6500
|
+
, Object.assign({
|
|
6501
|
+
variant: "body1",
|
|
6502
|
+
"data-testid": "errorMessage"
|
|
6503
|
+
}, {
|
|
6504
|
+
children: getErrorMessage(error, index)
|
|
6505
|
+
}), `message-${index}`))]
|
|
6506
|
+
}))
|
|
6507
|
+
})), rootElement);
|
|
6503
6508
|
};
|
|
6504
6509
|
|
|
6505
6510
|
const TafModuleContext = /*#__PURE__*/React.createContext({
|
|
@@ -6544,49 +6549,43 @@ const TafModuleProvider = ({
|
|
|
6544
6549
|
const contextState = useTafModuleState({
|
|
6545
6550
|
onPreventCloseView: _onPreventCloseView
|
|
6546
6551
|
});
|
|
6547
|
-
return
|
|
6552
|
+
return jsx(TafModuleContext.Provider, Object.assign({
|
|
6548
6553
|
value: contextState
|
|
6549
|
-
},
|
|
6554
|
+
}, {
|
|
6555
|
+
children: children
|
|
6556
|
+
}));
|
|
6550
6557
|
};
|
|
6551
6558
|
|
|
6552
6559
|
const TafAvatar = ({
|
|
6553
6560
|
editor,
|
|
6554
6561
|
tooltipPlacement: _tooltipPlacement = 'bottom'
|
|
6555
6562
|
}) => {
|
|
6556
|
-
return
|
|
6563
|
+
return jsx(CustomTooltip, Object.assign({
|
|
6557
6564
|
title: `Editor: ${editor}`,
|
|
6558
6565
|
placement: _tooltipPlacement
|
|
6559
|
-
},
|
|
6560
|
-
|
|
6561
|
-
|
|
6566
|
+
}, {
|
|
6567
|
+
children: jsx("span", {
|
|
6568
|
+
children: jsx(Avatar, Object.assign({
|
|
6569
|
+
size: "small"
|
|
6570
|
+
}, {
|
|
6571
|
+
children: getInitials(editor)
|
|
6572
|
+
}))
|
|
6573
|
+
})
|
|
6574
|
+
}));
|
|
6562
6575
|
};
|
|
6563
6576
|
|
|
6564
|
-
/* *
|
|
6565
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6566
|
-
* you may not use this file except in compliance with the License.
|
|
6567
|
-
* You may obtain a copy of the License at
|
|
6568
|
-
*
|
|
6569
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
6570
|
-
*
|
|
6571
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
6572
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
6573
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6574
|
-
* See the License for the specific language governing permissions and
|
|
6575
|
-
* limitations under the License.
|
|
6576
|
-
*
|
|
6577
|
-
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6578
|
-
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
6579
|
-
* */
|
|
6580
6577
|
const TAF_MODULE_ID = 'tafmodule';
|
|
6581
6578
|
const ResponsiveWrapper = ({
|
|
6582
6579
|
children
|
|
6583
|
-
}) => (
|
|
6580
|
+
}) => jsx(Box, Object.assign({
|
|
6584
6581
|
sx: {
|
|
6585
6582
|
containerType: 'inline-size',
|
|
6586
6583
|
containerName: TAF_MODULE_ID,
|
|
6587
6584
|
height: '100%'
|
|
6588
6585
|
}
|
|
6589
|
-
},
|
|
6586
|
+
}, {
|
|
6587
|
+
children: children
|
|
6588
|
+
}));
|
|
6590
6589
|
|
|
6591
6590
|
const textFieldStyle = (theme, shouldPreventUppercase) => ({
|
|
6592
6591
|
// input
|
|
@@ -6669,7 +6668,7 @@ const BaseTextField = /*#__PURE__*/React__default.memo(_a => {
|
|
|
6669
6668
|
props = __rest(_a, ["shouldPreventUppercase"]);
|
|
6670
6669
|
const theme = useTheme();
|
|
6671
6670
|
const styling = textFieldStyle(theme, shouldPreventUppercase);
|
|
6672
|
-
return
|
|
6671
|
+
return jsx(TextField, Object.assign({
|
|
6673
6672
|
type: "text",
|
|
6674
6673
|
variant: "filled",
|
|
6675
6674
|
sx: styling
|
|
@@ -6747,40 +6746,42 @@ const TafFormTextField = ({
|
|
|
6747
6746
|
_onBlur();
|
|
6748
6747
|
}, [_onBlur, _name, setValue, _shouldPreventUppercase]);
|
|
6749
6748
|
const hasError = !!fieldErrors;
|
|
6750
|
-
return
|
|
6749
|
+
return jsx(Grid, Object.assign({
|
|
6751
6750
|
item: true,
|
|
6752
6751
|
sx: {
|
|
6753
6752
|
width: `${100 / 13}%`,
|
|
6754
6753
|
minWidth: 60
|
|
6755
6754
|
}
|
|
6756
|
-
},
|
|
6757
|
-
|
|
6758
|
-
|
|
6759
|
-
|
|
6760
|
-
|
|
6761
|
-
|
|
6762
|
-
|
|
6763
|
-
|
|
6764
|
-
|
|
6765
|
-
|
|
6766
|
-
|
|
6767
|
-
|
|
6768
|
-
|
|
6769
|
-
|
|
6770
|
-
|
|
6771
|
-
|
|
6772
|
-
|
|
6773
|
-
|
|
6774
|
-
|
|
6775
|
-
|
|
6776
|
-
|
|
6777
|
-
|
|
6778
|
-
|
|
6779
|
-
|
|
6780
|
-
|
|
6781
|
-
|
|
6782
|
-
|
|
6783
|
-
|
|
6755
|
+
}, {
|
|
6756
|
+
children: jsx(Controller, {
|
|
6757
|
+
render: ({
|
|
6758
|
+
field
|
|
6759
|
+
}) => {
|
|
6760
|
+
const displayValue = _formatter ? _formatter(field.value) : getDisplayValue(field.value, _disabled);
|
|
6761
|
+
return jsx(BaseTextField, {
|
|
6762
|
+
label: label,
|
|
6763
|
+
disabled: _disabled,
|
|
6764
|
+
name: _name,
|
|
6765
|
+
value: displayValue,
|
|
6766
|
+
inputRef: field.ref,
|
|
6767
|
+
onChange: event => onChangeField(event, field.onChange),
|
|
6768
|
+
onKeyDown: onKeyDown,
|
|
6769
|
+
error: hasError,
|
|
6770
|
+
onBlur: event => onBlurField(event, field.onBlur),
|
|
6771
|
+
inputProps: {
|
|
6772
|
+
maxLength,
|
|
6773
|
+
className: 'inputText',
|
|
6774
|
+
'aria-label': _name
|
|
6775
|
+
},
|
|
6776
|
+
autoFocus: _autoFocus,
|
|
6777
|
+
shouldPreventUppercase: _shouldPreventUppercase
|
|
6778
|
+
});
|
|
6779
|
+
},
|
|
6780
|
+
name: _name,
|
|
6781
|
+
control: control,
|
|
6782
|
+
defaultValue: _defaultValue,
|
|
6783
|
+
rules: rules
|
|
6784
|
+
})
|
|
6784
6785
|
}));
|
|
6785
6786
|
};
|
|
6786
6787
|
|
|
@@ -6843,22 +6844,6 @@ const validateProbabilityField = value => {
|
|
|
6843
6844
|
return isValid ? true : invalidProbabilityMessage;
|
|
6844
6845
|
};
|
|
6845
6846
|
|
|
6846
|
-
/* *
|
|
6847
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6848
|
-
* you may not use this file except in compliance with the License.
|
|
6849
|
-
* You may obtain a copy of the License at
|
|
6850
|
-
*
|
|
6851
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
6852
|
-
*
|
|
6853
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
6854
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
6855
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6856
|
-
* See the License for the specific language governing permissions and
|
|
6857
|
-
* limitations under the License.
|
|
6858
|
-
*
|
|
6859
|
-
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6860
|
-
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
6861
|
-
* */
|
|
6862
6847
|
const TafFormOptionsButton = ({
|
|
6863
6848
|
isChangeGroup,
|
|
6864
6849
|
addChangeGroupBelow,
|
|
@@ -6869,27 +6854,27 @@ const TafFormOptionsButton = ({
|
|
|
6869
6854
|
}) => {
|
|
6870
6855
|
const insertAbove = {
|
|
6871
6856
|
text: 'Insert 1 row above',
|
|
6872
|
-
icon:
|
|
6857
|
+
icon: jsx(Add, {}),
|
|
6873
6858
|
action: addChangeGroupAbove
|
|
6874
6859
|
};
|
|
6875
6860
|
const insertBelow = {
|
|
6876
6861
|
text: 'Insert 1 row below',
|
|
6877
|
-
icon:
|
|
6862
|
+
icon: jsx(Add, {}),
|
|
6878
6863
|
action: addChangeGroupBelow
|
|
6879
6864
|
};
|
|
6880
6865
|
const deleteRow = {
|
|
6881
6866
|
text: 'Delete row',
|
|
6882
|
-
icon:
|
|
6867
|
+
icon: jsx(Delete, {}),
|
|
6883
6868
|
action: removeChangeGroup
|
|
6884
6869
|
};
|
|
6885
6870
|
const clear = {
|
|
6886
6871
|
text: 'Clear row',
|
|
6887
|
-
icon:
|
|
6872
|
+
icon: jsx(Close, {}),
|
|
6888
6873
|
action: clearRow
|
|
6889
6874
|
};
|
|
6890
6875
|
const menuItemsBaseForecast = [insertBelow, clear];
|
|
6891
6876
|
const menuItemsChangeGroup = [insertAbove, insertBelow, deleteRow, clear];
|
|
6892
|
-
return
|
|
6877
|
+
return jsx(ToggleMenu, {
|
|
6893
6878
|
buttonTestId: `tafFormOptions[${index}]`,
|
|
6894
6879
|
buttonSx: {
|
|
6895
6880
|
marginTop: '10px',
|
|
@@ -7017,7 +7002,7 @@ const TafFormRow = /*#__PURE__*/React__default.forwardRef((_a, ref) => {
|
|
|
7017
7002
|
const clearRow = React__default.useCallback(() => {
|
|
7018
7003
|
onClearRow(index);
|
|
7019
7004
|
}, [onClearRow, index]);
|
|
7020
|
-
return
|
|
7005
|
+
return jsxs(Grid, Object.assign({
|
|
7021
7006
|
sx: {
|
|
7022
7007
|
marginTop: '8px',
|
|
7023
7008
|
backgroundColor: 'geowebColors.cards.cardContainer',
|
|
@@ -7043,258 +7028,270 @@ const TafFormRow = /*#__PURE__*/React__default.forwardRef((_a, ref) => {
|
|
|
7043
7028
|
ref: ref
|
|
7044
7029
|
}, props, {
|
|
7045
7030
|
className: "formRow"
|
|
7046
|
-
}
|
|
7047
|
-
|
|
7048
|
-
|
|
7049
|
-
|
|
7050
|
-
|
|
7051
|
-
|
|
7052
|
-
label: "Type",
|
|
7053
|
-
name: fieldNames.messageType,
|
|
7054
|
-
disabled: true
|
|
7055
|
-
}), /*#__PURE__*/React__default.createElement(TafFormTextField, {
|
|
7056
|
-
label: "Location",
|
|
7057
|
-
name: "location",
|
|
7058
|
-
disabled: true
|
|
7059
|
-
}), /*#__PURE__*/React__default.createElement(TafFormTextField, {
|
|
7060
|
-
formatter: formatIssueTime,
|
|
7061
|
-
label: "Issue time",
|
|
7062
|
-
name: "issueDate",
|
|
7063
|
-
disabled: true,
|
|
7064
|
-
shouldPreventUppercase: true
|
|
7065
|
-
}))), isChangeGroup && ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Box, {
|
|
7066
|
-
sx: {
|
|
7067
|
-
marginRight: '2px',
|
|
7068
|
-
minWidth: 60
|
|
7069
|
-
},
|
|
7070
|
-
display: "flex",
|
|
7071
|
-
justifyContent: "center"
|
|
7072
|
-
}, !disabled && dragHandle), /*#__PURE__*/React__default.createElement(TafFormTextField, {
|
|
7073
|
-
label: "Prob",
|
|
7074
|
-
name: fieldNames.probability,
|
|
7075
|
-
disabled: disabled,
|
|
7076
|
-
defaultValue: getDefaultValue('probability', field),
|
|
7077
|
-
rules: {
|
|
7078
|
-
validate: {
|
|
7079
|
-
validateRequiredMainOptional,
|
|
7080
|
-
validateProbabilityField
|
|
7081
|
-
}
|
|
7082
|
-
},
|
|
7083
|
-
autoComplete: [{
|
|
7084
|
-
key: '3',
|
|
7085
|
-
value: 'PROB30'
|
|
7031
|
+
}, {
|
|
7032
|
+
children: [jsxs(Grid, Object.assign({
|
|
7033
|
+
item: true,
|
|
7034
|
+
container: true,
|
|
7035
|
+
justifyContent: "flex-end",
|
|
7036
|
+
xs: true
|
|
7086
7037
|
}, {
|
|
7087
|
-
|
|
7088
|
-
|
|
7089
|
-
|
|
7090
|
-
|
|
7091
|
-
|
|
7092
|
-
|
|
7093
|
-
|
|
7094
|
-
|
|
7095
|
-
|
|
7096
|
-
|
|
7097
|
-
|
|
7098
|
-
|
|
7099
|
-
|
|
7100
|
-
|
|
7101
|
-
|
|
7102
|
-
|
|
7103
|
-
|
|
7104
|
-
|
|
7105
|
-
|
|
7038
|
+
children: [!isChangeGroup && jsxs(Fragment, {
|
|
7039
|
+
children: [jsx(TafFormTextField, {
|
|
7040
|
+
label: "Type",
|
|
7041
|
+
name: fieldNames.messageType,
|
|
7042
|
+
disabled: true
|
|
7043
|
+
}), jsx(TafFormTextField, {
|
|
7044
|
+
label: "Location",
|
|
7045
|
+
name: "location",
|
|
7046
|
+
disabled: true
|
|
7047
|
+
}), jsx(TafFormTextField, {
|
|
7048
|
+
formatter: formatIssueTime,
|
|
7049
|
+
label: "Issue time",
|
|
7050
|
+
name: "issueDate",
|
|
7051
|
+
disabled: true,
|
|
7052
|
+
shouldPreventUppercase: true
|
|
7053
|
+
})]
|
|
7054
|
+
}), isChangeGroup && jsxs(Fragment, {
|
|
7055
|
+
children: [jsx(Box, Object.assign({
|
|
7056
|
+
sx: {
|
|
7057
|
+
marginRight: '2px',
|
|
7058
|
+
minWidth: 60
|
|
7059
|
+
},
|
|
7060
|
+
display: "flex",
|
|
7061
|
+
justifyContent: "center"
|
|
7062
|
+
}, {
|
|
7063
|
+
children: !disabled && dragHandle
|
|
7064
|
+
})), jsx(TafFormTextField, {
|
|
7065
|
+
label: "Prob",
|
|
7066
|
+
name: fieldNames.probability,
|
|
7067
|
+
disabled: disabled,
|
|
7068
|
+
defaultValue: getDefaultValue('probability', field),
|
|
7069
|
+
rules: {
|
|
7070
|
+
validate: {
|
|
7071
|
+
validateRequiredMainOptional,
|
|
7072
|
+
validateProbabilityField
|
|
7073
|
+
}
|
|
7074
|
+
},
|
|
7075
|
+
autoComplete: [{
|
|
7076
|
+
key: '3',
|
|
7077
|
+
value: 'PROB30'
|
|
7078
|
+
}, {
|
|
7079
|
+
key: '4',
|
|
7080
|
+
value: 'PROB40'
|
|
7081
|
+
}],
|
|
7082
|
+
onBlur: () => {
|
|
7083
|
+
if (isChangeGroup) {
|
|
7084
|
+
const nextValidFieldName = getValidFieldFromNextRow();
|
|
7085
|
+
trigger([...subFields, ...mainOptionalFields, ...mainFields, ...nextValidFieldName]);
|
|
7086
|
+
}
|
|
7087
|
+
}
|
|
7088
|
+
}), jsx(TafFormTextField, {
|
|
7089
|
+
label: "Change",
|
|
7090
|
+
name: fieldNames.change,
|
|
7091
|
+
disabled: disabled,
|
|
7092
|
+
defaultValue: getDefaultValue('change', field),
|
|
7093
|
+
rules: {
|
|
7094
|
+
validate: {
|
|
7095
|
+
validateRequiredMainOptional,
|
|
7096
|
+
validateChangeField,
|
|
7097
|
+
validateChangeFieldInterField: value => validateChangeFieldInterField(value, getValues(fieldNames.probability))
|
|
7098
|
+
}
|
|
7099
|
+
},
|
|
7100
|
+
autoComplete: [{
|
|
7101
|
+
key: 'T',
|
|
7102
|
+
value: 'TEMPO'
|
|
7103
|
+
}, {
|
|
7104
|
+
key: 'B',
|
|
7105
|
+
value: 'BECMG'
|
|
7106
|
+
}, {
|
|
7107
|
+
key: 'F',
|
|
7108
|
+
value: 'FM'
|
|
7109
|
+
}],
|
|
7110
|
+
onBlur: () => {
|
|
7111
|
+
if (isChangeGroup) {
|
|
7112
|
+
const nextValidFieldName = getValidFieldFromNextRow();
|
|
7113
|
+
const previousValidFieldNames = getPreviousValidFields(index);
|
|
7114
|
+
trigger([...subFields, ...mainOptionalFields, ...mainFields, ...nextValidFieldName, ...previousValidFieldNames]);
|
|
7115
|
+
}
|
|
7116
|
+
}
|
|
7117
|
+
})]
|
|
7118
|
+
}), jsx(TafFormTextField, {
|
|
7119
|
+
label: "Valid",
|
|
7120
|
+
name: fieldNames.valid,
|
|
7121
|
+
// always disabled for baseforecast row
|
|
7122
|
+
disabled: !isChangeGroup ? true : disabled,
|
|
7123
|
+
defaultValue: getDefaultValue('valid', field),
|
|
7124
|
+
rules: {
|
|
7125
|
+
validate: {
|
|
7126
|
+
validateRequiredMain,
|
|
7127
|
+
validateValidField: value => isChangeGroup ? validateValidField(value, getValues('validDateStart'), getValues('validDateEnd')) : true,
|
|
7128
|
+
validateValidChangeGroupInterField: value => isChangeGroup ? validateValidChangeGroupInterField(value, getValues(fieldNames.change), getValues(fieldNames.probability), getValues('validDateStart'), getValues('validDateEnd')) : true,
|
|
7129
|
+
validatePreviousRow,
|
|
7130
|
+
validateNextRows
|
|
7131
|
+
}
|
|
7132
|
+
},
|
|
7133
|
+
onBlur: () => {
|
|
7134
|
+
if (isChangeGroup) {
|
|
7135
|
+
const nextValidFieldName = getValidFieldFromNextRow();
|
|
7136
|
+
const previousValidFieldNames = getPreviousValidFields(index);
|
|
7137
|
+
trigger([...subFields, ...mainOptionalFields, ...mainFields, ...nextValidFieldName, ...previousValidFieldNames]);
|
|
7138
|
+
}
|
|
7139
|
+
}
|
|
7140
|
+
}), jsx(TafFormTextField, {
|
|
7141
|
+
label: "Wind",
|
|
7142
|
+
name: fieldNames.wind,
|
|
7143
|
+
disabled: disabled,
|
|
7144
|
+
defaultValue: getDefaultValue('wind', field),
|
|
7145
|
+
rules: {
|
|
7146
|
+
validate: {
|
|
7147
|
+
validateRequiredMainFields: value => validateRequiredMainFields(value, 'Wind'),
|
|
7148
|
+
validateRequiredSub,
|
|
7149
|
+
validateWindField: value => validateWindField(value, getValues(fieldNames.weather1), getValues(fieldNames.weather2), getValues(fieldNames.weather3))
|
|
7150
|
+
}
|
|
7151
|
+
},
|
|
7152
|
+
onBlur: () => {
|
|
7153
|
+
if (isChangeGroup) {
|
|
7154
|
+
trigger([...subFields, ...mainFields]);
|
|
7155
|
+
}
|
|
7156
|
+
},
|
|
7157
|
+
autoFocus: !isChangeGroup
|
|
7158
|
+
}), jsx(TafFormTextField, {
|
|
7159
|
+
label: "Visibility",
|
|
7160
|
+
name: fieldNames.visibility,
|
|
7161
|
+
disabled: disabled,
|
|
7162
|
+
defaultValue: getDefaultValue('visibility', field),
|
|
7163
|
+
rules: {
|
|
7164
|
+
validate: {
|
|
7165
|
+
validateRequiredMainFields: value => validateRequiredMainFields(value, 'Visibility'),
|
|
7166
|
+
validateRequiredSub,
|
|
7167
|
+
validateVisibilityField
|
|
7168
|
+
}
|
|
7169
|
+
},
|
|
7170
|
+
autoComplete: [{
|
|
7171
|
+
key: 'C',
|
|
7172
|
+
value: 'CAVOK'
|
|
7173
|
+
}],
|
|
7174
|
+
onBlur: () => {
|
|
7175
|
+
const fields = isChangeGroup ? [...subFields, ...mainFields] : subFields;
|
|
7176
|
+
trigger([...fields, fieldNames.weather1, fieldNames.weather2, fieldNames.weather3]);
|
|
7177
|
+
}
|
|
7178
|
+
}), jsx(TafFormTextField, {
|
|
7179
|
+
label: "Weather",
|
|
7180
|
+
name: fieldNames.weather1,
|
|
7181
|
+
disabled: disabled,
|
|
7182
|
+
defaultValue: getDefaultValue('weather.weather1', field),
|
|
7183
|
+
rules: {
|
|
7184
|
+
validate: {
|
|
7185
|
+
validateRequiredMainFields: value => validateRequiredMainFields(value, 'Weather'),
|
|
7186
|
+
validateRequiredSub,
|
|
7187
|
+
validateWeatherField: value => validateWeatherField(value, getValues(fieldNames.visibility), !!isChangeGroup)
|
|
7188
|
+
}
|
|
7189
|
+
},
|
|
7190
|
+
onBlur: () => {
|
|
7191
|
+
const fields = isChangeGroup ? [...subFields, ...mainFields] : [];
|
|
7192
|
+
return trigger([...fields, fieldNames.weather2, fieldNames.weather3, fieldNames.wind, fieldNames.cloud1]);
|
|
7193
|
+
}
|
|
7194
|
+
}), jsx(TafFormTextField, {
|
|
7195
|
+
label: "Weather",
|
|
7196
|
+
name: fieldNames.weather2,
|
|
7197
|
+
disabled: disabled,
|
|
7198
|
+
defaultValue: getDefaultValue('weather.weather2', field),
|
|
7199
|
+
rules: {
|
|
7200
|
+
validate: {
|
|
7201
|
+
validateSecondWeatherField: value => validateSecondWeatherField(getValues(fieldNames.weather1), value, getValues(fieldNames.visibility))
|
|
7202
|
+
}
|
|
7203
|
+
},
|
|
7204
|
+
onBlur: () => {
|
|
7205
|
+
const fields = isChangeGroup ? [...subFields, ...mainFields] : [];
|
|
7206
|
+
return trigger([...fields, fieldNames.weather3, fieldNames.wind, fieldNames.cloud1]);
|
|
7207
|
+
}
|
|
7208
|
+
}), jsx(TafFormTextField, {
|
|
7209
|
+
label: "Weather",
|
|
7210
|
+
name: fieldNames.weather3,
|
|
7211
|
+
disabled: disabled,
|
|
7212
|
+
defaultValue: getDefaultValue('weather.weather3', field),
|
|
7213
|
+
rules: {
|
|
7214
|
+
validate: {
|
|
7215
|
+
validateThirdWeatherField: value => validateThirdWeatherField(getValues(fieldNames.weather1), getValues(fieldNames.weather2), value, getValues(fieldNames.visibility))
|
|
7216
|
+
}
|
|
7217
|
+
},
|
|
7218
|
+
onBlur: () => {
|
|
7219
|
+
return trigger([fieldNames.wind, fieldNames.cloud1]);
|
|
7220
|
+
}
|
|
7221
|
+
}), jsx(TafFormTextField, {
|
|
7222
|
+
label: "Cloud",
|
|
7223
|
+
name: fieldNames.cloud1,
|
|
7224
|
+
disabled: disabled,
|
|
7225
|
+
defaultValue: getDefaultValue('cloud.cloud1', field),
|
|
7226
|
+
rules: {
|
|
7227
|
+
validate: {
|
|
7228
|
+
validateRequiredMainFields: value => validateRequiredMainFields(value, 'Clouds'),
|
|
7229
|
+
validateRequiredSub,
|
|
7230
|
+
validateFirstCloud: value => validateFirstCloud(value, getValues(fieldNames.visibility), getValues(fieldNames.weather1), getValues(fieldNames.weather2), getValues(fieldNames.weather3))
|
|
7231
|
+
}
|
|
7232
|
+
},
|
|
7233
|
+
onBlur: () => {
|
|
7234
|
+
const fields = isChangeGroup ? [...subFields, ...mainFields] : [];
|
|
7235
|
+
return trigger([...fields, fieldNames.cloud2, fieldNames.cloud3, fieldNames.cloud4]);
|
|
7236
|
+
}
|
|
7237
|
+
}), jsx(TafFormTextField, {
|
|
7238
|
+
label: "Cloud",
|
|
7239
|
+
name: fieldNames.cloud2,
|
|
7240
|
+
disabled: disabled,
|
|
7241
|
+
defaultValue: getDefaultValue('cloud.cloud2', field),
|
|
7242
|
+
rules: {
|
|
7243
|
+
validate: {
|
|
7244
|
+
validateSecondCloud: value => validateSecondCloud(getValues(fieldNames.cloud1), value, getValues(fieldNames.visibility))
|
|
7245
|
+
}
|
|
7246
|
+
},
|
|
7247
|
+
onBlur: () => {
|
|
7248
|
+
return trigger([fieldNames.cloud3, fieldNames.cloud4]);
|
|
7249
|
+
}
|
|
7250
|
+
}), jsx(TafFormTextField, {
|
|
7251
|
+
label: "Cloud",
|
|
7252
|
+
name: fieldNames.cloud3,
|
|
7253
|
+
disabled: disabled,
|
|
7254
|
+
defaultValue: getDefaultValue('cloud.cloud3', field),
|
|
7255
|
+
rules: {
|
|
7256
|
+
validate: {
|
|
7257
|
+
validateThirdCloud: value => validateThirdCloud(getValues(fieldNames.cloud1), getValues(fieldNames.cloud2), value, getValues(fieldNames.visibility))
|
|
7258
|
+
}
|
|
7259
|
+
},
|
|
7260
|
+
onBlur: () => {
|
|
7261
|
+
return trigger(fieldNames.cloud4);
|
|
7262
|
+
}
|
|
7263
|
+
}), jsx(TafFormTextField, {
|
|
7264
|
+
label: "Cloud",
|
|
7265
|
+
name: fieldNames.cloud4,
|
|
7266
|
+
disabled: disabled,
|
|
7267
|
+
defaultValue: getDefaultValue('cloud.cloud4', field),
|
|
7268
|
+
rules: {
|
|
7269
|
+
validate: {
|
|
7270
|
+
validateFourthCloud: value => validateFourthCloud(getValues(fieldNames.cloud1), getValues(fieldNames.cloud2), getValues(fieldNames.cloud3), value, getValues(fieldNames.visibility))
|
|
7271
|
+
}
|
|
7272
|
+
}
|
|
7273
|
+
})]
|
|
7274
|
+
})), !disabled && jsx(Grid, Object.assign({
|
|
7275
|
+
item: true,
|
|
7276
|
+
container: true,
|
|
7277
|
+
justifyContent: "flex-end",
|
|
7278
|
+
alignItems: "flex-end",
|
|
7279
|
+
sx: {
|
|
7280
|
+
width: '3.5%',
|
|
7281
|
+
marginBottom: '14px',
|
|
7282
|
+
minWidth: 28
|
|
7106
7283
|
}
|
|
7107
|
-
},
|
|
7108
|
-
autoComplete: [{
|
|
7109
|
-
key: 'T',
|
|
7110
|
-
value: 'TEMPO'
|
|
7111
|
-
}, {
|
|
7112
|
-
key: 'B',
|
|
7113
|
-
value: 'BECMG'
|
|
7114
7284
|
}, {
|
|
7115
|
-
|
|
7116
|
-
|
|
7117
|
-
|
|
7118
|
-
|
|
7119
|
-
|
|
7120
|
-
|
|
7121
|
-
|
|
7122
|
-
|
|
7123
|
-
|
|
7124
|
-
|
|
7125
|
-
}))), /*#__PURE__*/React__default.createElement(TafFormTextField, {
|
|
7126
|
-
label: "Valid",
|
|
7127
|
-
name: fieldNames.valid,
|
|
7128
|
-
// always disabled for baseforecast row
|
|
7129
|
-
disabled: !isChangeGroup ? true : disabled,
|
|
7130
|
-
defaultValue: getDefaultValue('valid', field),
|
|
7131
|
-
rules: {
|
|
7132
|
-
validate: {
|
|
7133
|
-
validateRequiredMain,
|
|
7134
|
-
validateValidField: value => isChangeGroup ? validateValidField(value, getValues('validDateStart'), getValues('validDateEnd')) : true,
|
|
7135
|
-
validateValidChangeGroupInterField: value => isChangeGroup ? validateValidChangeGroupInterField(value, getValues(fieldNames.change), getValues(fieldNames.probability), getValues('validDateStart'), getValues('validDateEnd')) : true,
|
|
7136
|
-
validatePreviousRow,
|
|
7137
|
-
validateNextRows
|
|
7138
|
-
}
|
|
7139
|
-
},
|
|
7140
|
-
onBlur: () => {
|
|
7141
|
-
if (isChangeGroup) {
|
|
7142
|
-
const nextValidFieldName = getValidFieldFromNextRow();
|
|
7143
|
-
const previousValidFieldNames = getPreviousValidFields(index);
|
|
7144
|
-
trigger([...subFields, ...mainOptionalFields, ...mainFields, ...nextValidFieldName, ...previousValidFieldNames]);
|
|
7145
|
-
}
|
|
7146
|
-
}
|
|
7147
|
-
}), /*#__PURE__*/React__default.createElement(TafFormTextField, {
|
|
7148
|
-
label: "Wind",
|
|
7149
|
-
name: fieldNames.wind,
|
|
7150
|
-
disabled: disabled,
|
|
7151
|
-
defaultValue: getDefaultValue('wind', field),
|
|
7152
|
-
rules: {
|
|
7153
|
-
validate: {
|
|
7154
|
-
validateRequiredMainFields: value => validateRequiredMainFields(value, 'Wind'),
|
|
7155
|
-
validateRequiredSub,
|
|
7156
|
-
validateWindField: value => validateWindField(value, getValues(fieldNames.weather1), getValues(fieldNames.weather2), getValues(fieldNames.weather3))
|
|
7157
|
-
}
|
|
7158
|
-
},
|
|
7159
|
-
onBlur: () => {
|
|
7160
|
-
if (isChangeGroup) {
|
|
7161
|
-
trigger([...subFields, ...mainFields]);
|
|
7162
|
-
}
|
|
7163
|
-
},
|
|
7164
|
-
autoFocus: !isChangeGroup
|
|
7165
|
-
}), /*#__PURE__*/React__default.createElement(TafFormTextField, {
|
|
7166
|
-
label: "Visibility",
|
|
7167
|
-
name: fieldNames.visibility,
|
|
7168
|
-
disabled: disabled,
|
|
7169
|
-
defaultValue: getDefaultValue('visibility', field),
|
|
7170
|
-
rules: {
|
|
7171
|
-
validate: {
|
|
7172
|
-
validateRequiredMainFields: value => validateRequiredMainFields(value, 'Visibility'),
|
|
7173
|
-
validateRequiredSub,
|
|
7174
|
-
validateVisibilityField
|
|
7175
|
-
}
|
|
7176
|
-
},
|
|
7177
|
-
autoComplete: [{
|
|
7178
|
-
key: 'C',
|
|
7179
|
-
value: 'CAVOK'
|
|
7180
|
-
}],
|
|
7181
|
-
onBlur: () => {
|
|
7182
|
-
const fields = isChangeGroup ? [...subFields, ...mainFields] : subFields;
|
|
7183
|
-
trigger([...fields, fieldNames.weather1, fieldNames.weather2, fieldNames.weather3]);
|
|
7184
|
-
}
|
|
7185
|
-
}), /*#__PURE__*/React__default.createElement(TafFormTextField, {
|
|
7186
|
-
label: "Weather",
|
|
7187
|
-
name: fieldNames.weather1,
|
|
7188
|
-
disabled: disabled,
|
|
7189
|
-
defaultValue: getDefaultValue('weather.weather1', field),
|
|
7190
|
-
rules: {
|
|
7191
|
-
validate: {
|
|
7192
|
-
validateRequiredMainFields: value => validateRequiredMainFields(value, 'Weather'),
|
|
7193
|
-
validateRequiredSub,
|
|
7194
|
-
validateWeatherField: value => validateWeatherField(value, getValues(fieldNames.visibility), !!isChangeGroup)
|
|
7195
|
-
}
|
|
7196
|
-
},
|
|
7197
|
-
onBlur: () => {
|
|
7198
|
-
const fields = isChangeGroup ? [...subFields, ...mainFields] : [];
|
|
7199
|
-
return trigger([...fields, fieldNames.weather2, fieldNames.weather3, fieldNames.wind, fieldNames.cloud1]);
|
|
7200
|
-
}
|
|
7201
|
-
}), /*#__PURE__*/React__default.createElement(TafFormTextField, {
|
|
7202
|
-
label: "Weather",
|
|
7203
|
-
name: fieldNames.weather2,
|
|
7204
|
-
disabled: disabled,
|
|
7205
|
-
defaultValue: getDefaultValue('weather.weather2', field),
|
|
7206
|
-
rules: {
|
|
7207
|
-
validate: {
|
|
7208
|
-
validateSecondWeatherField: value => validateSecondWeatherField(getValues(fieldNames.weather1), value, getValues(fieldNames.visibility))
|
|
7209
|
-
}
|
|
7210
|
-
},
|
|
7211
|
-
onBlur: () => {
|
|
7212
|
-
const fields = isChangeGroup ? [...subFields, ...mainFields] : [];
|
|
7213
|
-
return trigger([...fields, fieldNames.weather3, fieldNames.wind, fieldNames.cloud1]);
|
|
7214
|
-
}
|
|
7215
|
-
}), /*#__PURE__*/React__default.createElement(TafFormTextField, {
|
|
7216
|
-
label: "Weather",
|
|
7217
|
-
name: fieldNames.weather3,
|
|
7218
|
-
disabled: disabled,
|
|
7219
|
-
defaultValue: getDefaultValue('weather.weather3', field),
|
|
7220
|
-
rules: {
|
|
7221
|
-
validate: {
|
|
7222
|
-
validateThirdWeatherField: value => validateThirdWeatherField(getValues(fieldNames.weather1), getValues(fieldNames.weather2), value, getValues(fieldNames.visibility))
|
|
7223
|
-
}
|
|
7224
|
-
},
|
|
7225
|
-
onBlur: () => {
|
|
7226
|
-
return trigger([fieldNames.wind, fieldNames.cloud1]);
|
|
7227
|
-
}
|
|
7228
|
-
}), /*#__PURE__*/React__default.createElement(TafFormTextField, {
|
|
7229
|
-
label: "Cloud",
|
|
7230
|
-
name: fieldNames.cloud1,
|
|
7231
|
-
disabled: disabled,
|
|
7232
|
-
defaultValue: getDefaultValue('cloud.cloud1', field),
|
|
7233
|
-
rules: {
|
|
7234
|
-
validate: {
|
|
7235
|
-
validateRequiredMainFields: value => validateRequiredMainFields(value, 'Clouds'),
|
|
7236
|
-
validateRequiredSub,
|
|
7237
|
-
validateFirstCloud: value => validateFirstCloud(value, getValues(fieldNames.visibility), getValues(fieldNames.weather1), getValues(fieldNames.weather2), getValues(fieldNames.weather3))
|
|
7238
|
-
}
|
|
7239
|
-
},
|
|
7240
|
-
onBlur: () => {
|
|
7241
|
-
const fields = isChangeGroup ? [...subFields, ...mainFields] : [];
|
|
7242
|
-
return trigger([...fields, fieldNames.cloud2, fieldNames.cloud3, fieldNames.cloud4]);
|
|
7243
|
-
}
|
|
7244
|
-
}), /*#__PURE__*/React__default.createElement(TafFormTextField, {
|
|
7245
|
-
label: "Cloud",
|
|
7246
|
-
name: fieldNames.cloud2,
|
|
7247
|
-
disabled: disabled,
|
|
7248
|
-
defaultValue: getDefaultValue('cloud.cloud2', field),
|
|
7249
|
-
rules: {
|
|
7250
|
-
validate: {
|
|
7251
|
-
validateSecondCloud: value => validateSecondCloud(getValues(fieldNames.cloud1), value, getValues(fieldNames.visibility))
|
|
7252
|
-
}
|
|
7253
|
-
},
|
|
7254
|
-
onBlur: () => {
|
|
7255
|
-
return trigger([fieldNames.cloud3, fieldNames.cloud4]);
|
|
7256
|
-
}
|
|
7257
|
-
}), /*#__PURE__*/React__default.createElement(TafFormTextField, {
|
|
7258
|
-
label: "Cloud",
|
|
7259
|
-
name: fieldNames.cloud3,
|
|
7260
|
-
disabled: disabled,
|
|
7261
|
-
defaultValue: getDefaultValue('cloud.cloud3', field),
|
|
7262
|
-
rules: {
|
|
7263
|
-
validate: {
|
|
7264
|
-
validateThirdCloud: value => validateThirdCloud(getValues(fieldNames.cloud1), getValues(fieldNames.cloud2), value, getValues(fieldNames.visibility))
|
|
7265
|
-
}
|
|
7266
|
-
},
|
|
7267
|
-
onBlur: () => {
|
|
7268
|
-
return trigger(fieldNames.cloud4);
|
|
7269
|
-
}
|
|
7270
|
-
}), /*#__PURE__*/React__default.createElement(TafFormTextField, {
|
|
7271
|
-
label: "Cloud",
|
|
7272
|
-
name: fieldNames.cloud4,
|
|
7273
|
-
disabled: disabled,
|
|
7274
|
-
defaultValue: getDefaultValue('cloud.cloud4', field),
|
|
7275
|
-
rules: {
|
|
7276
|
-
validate: {
|
|
7277
|
-
validateFourthCloud: value => validateFourthCloud(getValues(fieldNames.cloud1), getValues(fieldNames.cloud2), getValues(fieldNames.cloud3), value, getValues(fieldNames.visibility))
|
|
7278
|
-
}
|
|
7279
|
-
}
|
|
7280
|
-
})), !disabled && ( /*#__PURE__*/React__default.createElement(Grid, {
|
|
7281
|
-
item: true,
|
|
7282
|
-
container: true,
|
|
7283
|
-
justifyContent: "flex-end",
|
|
7284
|
-
alignItems: "flex-end",
|
|
7285
|
-
sx: {
|
|
7286
|
-
width: '3.5%',
|
|
7287
|
-
marginBottom: '14px',
|
|
7288
|
-
minWidth: 28
|
|
7289
|
-
}
|
|
7290
|
-
}, /*#__PURE__*/React__default.createElement(TafFormOptionsButton, {
|
|
7291
|
-
isChangeGroup: isChangeGroup,
|
|
7292
|
-
addChangeGroupBelow: addChangeGroupBelow,
|
|
7293
|
-
addChangeGroupAbove: addChangeGroupAbove,
|
|
7294
|
-
removeChangeGroup: () => onRemoveChangeGroup === null || onRemoveChangeGroup === void 0 ? void 0 : onRemoveChangeGroup(index),
|
|
7295
|
-
clearRow: clearRow,
|
|
7296
|
-
index: index
|
|
7297
|
-
}))));
|
|
7285
|
+
children: jsx(TafFormOptionsButton, {
|
|
7286
|
+
isChangeGroup: isChangeGroup,
|
|
7287
|
+
addChangeGroupBelow: addChangeGroupBelow,
|
|
7288
|
+
addChangeGroupAbove: addChangeGroupAbove,
|
|
7289
|
+
removeChangeGroup: () => onRemoveChangeGroup === null || onRemoveChangeGroup === void 0 ? void 0 : onRemoveChangeGroup(index),
|
|
7290
|
+
clearRow: clearRow,
|
|
7291
|
+
index: index
|
|
7292
|
+
})
|
|
7293
|
+
}))]
|
|
7294
|
+
}));
|
|
7298
7295
|
});
|
|
7299
7296
|
|
|
7300
7297
|
// prevents default functionality
|
|
@@ -7631,97 +7628,109 @@ const TafForm = /*#__PURE__*/React__default.memo(({
|
|
|
7631
7628
|
}
|
|
7632
7629
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
7633
7630
|
}, [shouldValidate, _isDisabled]);
|
|
7634
|
-
return
|
|
7635
|
-
|
|
7636
|
-
|
|
7637
|
-
|
|
7638
|
-
|
|
7639
|
-
|
|
7640
|
-
|
|
7641
|
-
|
|
7642
|
-
|
|
7643
|
-
|
|
7644
|
-
|
|
7645
|
-
|
|
7646
|
-
|
|
7647
|
-
|
|
7648
|
-
|
|
7649
|
-
}, /*#__PURE__*/React__default.createElement(SwitchButton, {
|
|
7650
|
-
checked: isEditor,
|
|
7651
|
-
onChange: onSwitchMode
|
|
7652
|
-
}), /*#__PURE__*/React__default.createElement(Box, {
|
|
7653
|
-
sx: {
|
|
7654
|
-
width: '16px',
|
|
7655
|
-
marginLeft: 1
|
|
7656
|
-
}
|
|
7657
|
-
}, editor && /*#__PURE__*/React__default.createElement(TafAvatar, {
|
|
7658
|
-
editor: editor
|
|
7659
|
-
}))), /*#__PURE__*/React__default.createElement("form", {
|
|
7660
|
-
"data-testid": "taf-form",
|
|
7661
|
-
onSubmit: handleSubmit(onSubmit),
|
|
7662
|
-
ref: formRef
|
|
7663
|
-
}, /*#__PURE__*/React__default.createElement(TafFormRow, {
|
|
7664
|
-
disabled: _isDisabled,
|
|
7665
|
-
onAddChangeGroupBelow: onAddRow,
|
|
7666
|
-
onClearRow: onClearRow,
|
|
7667
|
-
isNotRequiredForAction: isNotRequiredForAction
|
|
7668
|
-
}), /*#__PURE__*/React__default.createElement(ReactSortable, {
|
|
7669
|
-
tag: "div",
|
|
7670
|
-
list: fields,
|
|
7671
|
-
setList: noop,
|
|
7672
|
-
animation: 200,
|
|
7673
|
-
onSort: onChangeOrder,
|
|
7674
|
-
handle: ".handle",
|
|
7675
|
-
direction: "vertical",
|
|
7676
|
-
// hover props
|
|
7677
|
-
forceFallback: false,
|
|
7678
|
-
onStart: event => {
|
|
7679
|
-
onStartDrag(event);
|
|
7680
|
-
if (Sortable.ghost) {
|
|
7681
|
-
Sortable.ghost.style.opacity = '1';
|
|
7631
|
+
return jsxs(Fragment, {
|
|
7632
|
+
children: [jsxs(Box, Object.assign({
|
|
7633
|
+
sx: {
|
|
7634
|
+
display: 'flex',
|
|
7635
|
+
flexDirection: 'row',
|
|
7636
|
+
alignItems: 'center',
|
|
7637
|
+
position: 'absolute',
|
|
7638
|
+
top: {
|
|
7639
|
+
xs: '34px',
|
|
7640
|
+
sm: '-3px'
|
|
7641
|
+
},
|
|
7642
|
+
right: {
|
|
7643
|
+
xs: 'calc(50% - 70px)',
|
|
7644
|
+
sm: '8px'
|
|
7645
|
+
}
|
|
7682
7646
|
}
|
|
7683
|
-
}
|
|
7684
|
-
|
|
7685
|
-
|
|
7686
|
-
|
|
7687
|
-
|
|
7688
|
-
|
|
7689
|
-
|
|
7690
|
-
|
|
7691
|
-
|
|
7692
|
-
|
|
7693
|
-
|
|
7694
|
-
|
|
7695
|
-
|
|
7696
|
-
|
|
7697
|
-
|
|
7698
|
-
|
|
7699
|
-
|
|
7700
|
-
|
|
7701
|
-
|
|
7702
|
-
|
|
7703
|
-
|
|
7704
|
-
|
|
7705
|
-
|
|
7706
|
-
|
|
7707
|
-
|
|
7708
|
-
|
|
7709
|
-
|
|
7710
|
-
|
|
7711
|
-
|
|
7712
|
-
|
|
7713
|
-
|
|
7714
|
-
|
|
7715
|
-
|
|
7716
|
-
|
|
7717
|
-
|
|
7718
|
-
|
|
7719
|
-
|
|
7720
|
-
|
|
7721
|
-
|
|
7722
|
-
|
|
7723
|
-
|
|
7724
|
-
|
|
7647
|
+
}, {
|
|
7648
|
+
children: [jsx(SwitchButton, {
|
|
7649
|
+
checked: isEditor,
|
|
7650
|
+
onChange: onSwitchMode
|
|
7651
|
+
}), jsx(Box, Object.assign({
|
|
7652
|
+
sx: {
|
|
7653
|
+
width: '16px',
|
|
7654
|
+
marginLeft: 1
|
|
7655
|
+
}
|
|
7656
|
+
}, {
|
|
7657
|
+
children: editor && jsx(TafAvatar, {
|
|
7658
|
+
editor: editor
|
|
7659
|
+
})
|
|
7660
|
+
}))]
|
|
7661
|
+
})), jsxs("form", Object.assign({
|
|
7662
|
+
"data-testid": "taf-form",
|
|
7663
|
+
onSubmit: handleSubmit(onSubmit),
|
|
7664
|
+
ref: formRef
|
|
7665
|
+
}, {
|
|
7666
|
+
children: [jsx(TafFormRow, {
|
|
7667
|
+
disabled: _isDisabled,
|
|
7668
|
+
onAddChangeGroupBelow: onAddRow,
|
|
7669
|
+
onClearRow: onClearRow,
|
|
7670
|
+
isNotRequiredForAction: isNotRequiredForAction
|
|
7671
|
+
}), jsx(ReactSortable, Object.assign({
|
|
7672
|
+
tag: "div",
|
|
7673
|
+
list: fields,
|
|
7674
|
+
setList: noop,
|
|
7675
|
+
animation: 200,
|
|
7676
|
+
onSort: onChangeOrder,
|
|
7677
|
+
handle: ".handle",
|
|
7678
|
+
direction: "vertical",
|
|
7679
|
+
// hover props
|
|
7680
|
+
forceFallback: false,
|
|
7681
|
+
onStart: event => {
|
|
7682
|
+
onStartDrag(event);
|
|
7683
|
+
if (Sortable.ghost) {
|
|
7684
|
+
Sortable.ghost.style.opacity = '1';
|
|
7685
|
+
}
|
|
7686
|
+
}
|
|
7687
|
+
}, {
|
|
7688
|
+
children: fields.map((item, index) => jsx(TafFormRow, {
|
|
7689
|
+
field: item,
|
|
7690
|
+
index: index,
|
|
7691
|
+
disabled: _isDisabled,
|
|
7692
|
+
onRemoveChangeGroup: onRemoverow,
|
|
7693
|
+
onAddChangeGroupBelow: onAddRow,
|
|
7694
|
+
onAddChangeGroupAbove: () => onAddRow(index, true),
|
|
7695
|
+
onClearRow: () => onClearRow(index, true),
|
|
7696
|
+
isChangeGroup: true,
|
|
7697
|
+
dragHandle: jsx(DragHandle, {
|
|
7698
|
+
isDisabled: fields.length === 1 || _isDisabled,
|
|
7699
|
+
isSorting: activeDraggingIndex === index,
|
|
7700
|
+
index: index
|
|
7701
|
+
}),
|
|
7702
|
+
isNotRequiredForAction: isNotRequiredForAction
|
|
7703
|
+
}, item.id))
|
|
7704
|
+
})), !_isDisabled && isEditor && jsx(Grid, Object.assign({
|
|
7705
|
+
container: true,
|
|
7706
|
+
justifyContent: "space-between",
|
|
7707
|
+
alignItems: "center",
|
|
7708
|
+
sx: {
|
|
7709
|
+
marginLeft: 1.5,
|
|
7710
|
+
marginTop: 1
|
|
7711
|
+
}
|
|
7712
|
+
}, {
|
|
7713
|
+
children: jsx(Grid, Object.assign({
|
|
7714
|
+
item: true
|
|
7715
|
+
}, {
|
|
7716
|
+
children: jsx(IssuesButton, {
|
|
7717
|
+
errors: errors,
|
|
7718
|
+
isIssuesPaneOpen: _isIssuesPaneOpen,
|
|
7719
|
+
setIsIssuesPaneOpen: _setIsIssuesPaneOpen
|
|
7720
|
+
})
|
|
7721
|
+
}))
|
|
7722
|
+
})), isEditor && jsx(TafFormButtons, {
|
|
7723
|
+
isFormDisabled: _isDisabled,
|
|
7724
|
+
tafAction: tafAction,
|
|
7725
|
+
canBe: tafFromBackend.canbe,
|
|
7726
|
+
onTafEditModeButtonPress: onTafEditModeButtonPress,
|
|
7727
|
+
onTafViewModeButtonPress: onTafViewModeButtonPress
|
|
7728
|
+
}), hiddenInputFields.map(field => jsx(ReactHookFormHiddenInput, {
|
|
7729
|
+
name: field,
|
|
7730
|
+
"data-testid": field
|
|
7731
|
+
}, field))]
|
|
7732
|
+
}))]
|
|
7733
|
+
});
|
|
7725
7734
|
}, (prevProps, nextProps) => {
|
|
7726
7735
|
// prevent re-render
|
|
7727
7736
|
return !nextProps.isDisabled && prevProps.tafFromBackend !== nextProps.tafFromBackend &&
|
|
@@ -7736,26 +7745,30 @@ const TabPanel = _a => {
|
|
|
7736
7745
|
index
|
|
7737
7746
|
} = _a,
|
|
7738
7747
|
other = __rest(_a, ["children", "value", "index"]);
|
|
7739
|
-
return
|
|
7748
|
+
return jsx(Box, Object.assign({
|
|
7740
7749
|
role: "tabpanel",
|
|
7741
7750
|
hidden: value !== index,
|
|
7742
7751
|
id: `simple-tabpanel-${index}`,
|
|
7743
7752
|
"aria-labelledby": `simple-tab-${index}`,
|
|
7744
7753
|
"data-testid": `tab-panel-${index}`
|
|
7745
|
-
}, other
|
|
7754
|
+
}, other, {
|
|
7755
|
+
children: value === index && children
|
|
7756
|
+
}));
|
|
7746
7757
|
};
|
|
7747
7758
|
|
|
7748
7759
|
const TafHeader = ({
|
|
7749
7760
|
title,
|
|
7750
7761
|
sx: _sx = {}
|
|
7751
|
-
}) => (
|
|
7762
|
+
}) => jsx(Typography, Object.assign({
|
|
7752
7763
|
sx: Object.assign({
|
|
7753
7764
|
textAlign: 'center',
|
|
7754
7765
|
fontWeight: 500,
|
|
7755
7766
|
paddingTop: '4px',
|
|
7756
7767
|
textTransform: 'capitalize'
|
|
7757
7768
|
}, _sx)
|
|
7758
|
-
},
|
|
7769
|
+
}, {
|
|
7770
|
+
children: title
|
|
7771
|
+
}));
|
|
7759
7772
|
|
|
7760
7773
|
var tryToString = tryToString$5;
|
|
7761
7774
|
|
|
@@ -8096,32 +8109,20 @@ const getPreviousTaf = (tafList, currentTaf) => {
|
|
|
8096
8109
|
return previousTaf ? previousTaf.taf : null;
|
|
8097
8110
|
};
|
|
8098
8111
|
|
|
8099
|
-
/* *
|
|
8100
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8101
|
-
* you may not use this file except in compliance with the License.
|
|
8102
|
-
* You may obtain a copy of the License at
|
|
8103
|
-
*
|
|
8104
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8105
|
-
*
|
|
8106
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
8107
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
8108
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
8109
|
-
* See the License for the specific language governing permissions and
|
|
8110
|
-
* limitations under the License.
|
|
8111
|
-
*
|
|
8112
|
-
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8113
|
-
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
8114
|
-
* */
|
|
8115
8112
|
const IconWithTooltip = ({
|
|
8116
8113
|
title,
|
|
8117
8114
|
children
|
|
8118
|
-
}) => (
|
|
8115
|
+
}) => jsx(CustomTooltip, Object.assign({
|
|
8119
8116
|
title: title,
|
|
8120
8117
|
placement: "right",
|
|
8121
8118
|
"data-testid": "statusIcon-tooltip"
|
|
8122
|
-
},
|
|
8123
|
-
|
|
8124
|
-
|
|
8119
|
+
}, {
|
|
8120
|
+
children: jsx(Box, Object.assign({
|
|
8121
|
+
component: "span"
|
|
8122
|
+
}, {
|
|
8123
|
+
children: children
|
|
8124
|
+
}))
|
|
8125
|
+
}));
|
|
8125
8126
|
const StatusIcon = ({
|
|
8126
8127
|
status,
|
|
8127
8128
|
timeSlot
|
|
@@ -8130,48 +8131,56 @@ const StatusIcon = ({
|
|
|
8130
8131
|
case 'DRAFT':
|
|
8131
8132
|
case 'DRAFT_AMENDED':
|
|
8132
8133
|
case 'DRAFT_CORRECTED':
|
|
8133
|
-
return
|
|
8134
|
+
return jsx(IconWithTooltip, Object.assign({
|
|
8134
8135
|
title: getTafStatusLabel(status)
|
|
8135
|
-
},
|
|
8136
|
-
|
|
8137
|
-
|
|
8138
|
-
|
|
8139
|
-
|
|
8136
|
+
}, {
|
|
8137
|
+
children: jsx(Edit, {
|
|
8138
|
+
"data-testid": "status-draft",
|
|
8139
|
+
sx: {
|
|
8140
|
+
color: 'geowebColors.buttons.tertiary.default.color'
|
|
8141
|
+
}
|
|
8142
|
+
})
|
|
8140
8143
|
}));
|
|
8141
8144
|
case 'PUBLISHED':
|
|
8142
8145
|
case 'CORRECTED':
|
|
8143
8146
|
case 'AMENDED':
|
|
8144
|
-
return
|
|
8147
|
+
return jsx(IconWithTooltip, Object.assign({
|
|
8145
8148
|
title: getTafStatusLabel(status)
|
|
8146
|
-
},
|
|
8147
|
-
|
|
8148
|
-
|
|
8149
|
-
|
|
8150
|
-
|
|
8151
|
-
|
|
8152
|
-
|
|
8153
|
-
|
|
8154
|
-
|
|
8155
|
-
|
|
8156
|
-
|
|
8149
|
+
}, {
|
|
8150
|
+
children: timeSlot === 'ACTIVE' ? jsx(Success, {
|
|
8151
|
+
"data-testid": "status-active",
|
|
8152
|
+
sx: {
|
|
8153
|
+
color: 'geowebColors.functional.success'
|
|
8154
|
+
}
|
|
8155
|
+
}) : jsx(Clock, {
|
|
8156
|
+
"data-testid": "status-upcoming",
|
|
8157
|
+
sx: {
|
|
8158
|
+
color: 'geowebColors.functional.success'
|
|
8159
|
+
}
|
|
8160
|
+
})
|
|
8161
|
+
}));
|
|
8157
8162
|
case 'CANCELLED':
|
|
8158
|
-
return
|
|
8163
|
+
return jsx(IconWithTooltip, Object.assign({
|
|
8159
8164
|
title: getTafStatusLabel(status)
|
|
8160
|
-
},
|
|
8161
|
-
|
|
8162
|
-
|
|
8163
|
-
|
|
8164
|
-
|
|
8165
|
+
}, {
|
|
8166
|
+
children: jsx(Cancel, {
|
|
8167
|
+
"data-testid": "status-cancelled",
|
|
8168
|
+
sx: {
|
|
8169
|
+
color: 'geowebColors.captions.captionError.rgba'
|
|
8170
|
+
}
|
|
8171
|
+
})
|
|
8165
8172
|
}));
|
|
8166
8173
|
case 'EXPIRED':
|
|
8167
|
-
return
|
|
8174
|
+
return jsx(IconWithTooltip, Object.assign({
|
|
8168
8175
|
title: getTafStatusLabel(status)
|
|
8169
|
-
},
|
|
8170
|
-
|
|
8171
|
-
|
|
8172
|
-
|
|
8173
|
-
|
|
8174
|
-
|
|
8176
|
+
}, {
|
|
8177
|
+
children: jsx(Clock, {
|
|
8178
|
+
"data-testid": "status-expired",
|
|
8179
|
+
sx: {
|
|
8180
|
+
transform: 'scaleX(-1)',
|
|
8181
|
+
color: 'geowebColors.buttons.tertiary.disabled.color'
|
|
8182
|
+
}
|
|
8183
|
+
})
|
|
8175
8184
|
}));
|
|
8176
8185
|
case 'NEW':
|
|
8177
8186
|
default:
|
|
@@ -8179,28 +8188,12 @@ const StatusIcon = ({
|
|
|
8179
8188
|
}
|
|
8180
8189
|
};
|
|
8181
8190
|
|
|
8182
|
-
/* *
|
|
8183
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8184
|
-
* you may not use this file except in compliance with the License.
|
|
8185
|
-
* You may obtain a copy of the License at
|
|
8186
|
-
*
|
|
8187
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8188
|
-
*
|
|
8189
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
8190
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
8191
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
8192
|
-
* See the License for the specific language governing permissions and
|
|
8193
|
-
* limitations under the License.
|
|
8194
|
-
*
|
|
8195
|
-
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8196
|
-
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
8197
|
-
* */
|
|
8198
8191
|
const TOOLTIP_TITLE = 'Import TAC';
|
|
8199
8192
|
const ExportButton = ({
|
|
8200
8193
|
onClick,
|
|
8201
8194
|
isHidden
|
|
8202
8195
|
}) => {
|
|
8203
|
-
return isHidden ? null : (
|
|
8196
|
+
return isHidden ? null : jsx(CustomIconButton, Object.assign({
|
|
8204
8197
|
onClick: onClick,
|
|
8205
8198
|
"data-testid": "export-tac-button",
|
|
8206
8199
|
variant: "tool",
|
|
@@ -8208,14 +8201,16 @@ const ExportButton = ({
|
|
|
8208
8201
|
title: TOOLTIP_TITLE,
|
|
8209
8202
|
placement: 'left'
|
|
8210
8203
|
}
|
|
8211
|
-
},
|
|
8204
|
+
}, {
|
|
8205
|
+
children: jsx(Export, {})
|
|
8206
|
+
}));
|
|
8212
8207
|
};
|
|
8213
8208
|
|
|
8214
8209
|
const AdverseWeatherTACMessage = ({
|
|
8215
8210
|
TAC,
|
|
8216
8211
|
isActive
|
|
8217
8212
|
}) => {
|
|
8218
|
-
return
|
|
8213
|
+
return jsx(Box$1, Object.assign({
|
|
8219
8214
|
"data-testid": "adverse-weather-tac",
|
|
8220
8215
|
sx: {
|
|
8221
8216
|
fontSize: '12px',
|
|
@@ -8223,26 +8218,30 @@ const AdverseWeatherTACMessage = ({
|
|
|
8223
8218
|
letterSpacing: '0.4px',
|
|
8224
8219
|
color: 'geowebColors.captions.captionStatus.rgba'
|
|
8225
8220
|
}
|
|
8226
|
-
},
|
|
8227
|
-
|
|
8228
|
-
|
|
8229
|
-
|
|
8230
|
-
|
|
8231
|
-
|
|
8232
|
-
|
|
8233
|
-
|
|
8234
|
-
|
|
8235
|
-
|
|
8236
|
-
|
|
8237
|
-
|
|
8238
|
-
|
|
8239
|
-
|
|
8240
|
-
|
|
8241
|
-
|
|
8242
|
-
|
|
8243
|
-
|
|
8244
|
-
|
|
8245
|
-
|
|
8221
|
+
}, {
|
|
8222
|
+
children: TAC.tac.map((line, index) => jsx(Box$1, Object.assign({
|
|
8223
|
+
component: "span",
|
|
8224
|
+
sx: {
|
|
8225
|
+
display: 'block'
|
|
8226
|
+
}
|
|
8227
|
+
}, {
|
|
8228
|
+
children: line.map((word, index) => jsx(Box$1, Object.assign({
|
|
8229
|
+
component: "span",
|
|
8230
|
+
sx: Object.assign(Object.assign({
|
|
8231
|
+
display: 'inline',
|
|
8232
|
+
boxDecorationBreak: 'clone',
|
|
8233
|
+
WebkitBoxDecorationBreak: 'clone'
|
|
8234
|
+
}, isActive && {
|
|
8235
|
+
backgroundColor: 'geowebColors.functional.warningHighlight.rgba'
|
|
8236
|
+
}), word.type === 'adverse' && {
|
|
8237
|
+
color: 'geowebColors.captions.captionError.rgba',
|
|
8238
|
+
fontWeight: 'bold'
|
|
8239
|
+
})
|
|
8240
|
+
}, {
|
|
8241
|
+
children: word.text === '=' ? `${word.text}` : ` ${word.text}`
|
|
8242
|
+
}), word.text + index.toString()))
|
|
8243
|
+
}), line.toString() + index.toString()))
|
|
8244
|
+
}));
|
|
8246
8245
|
};
|
|
8247
8246
|
|
|
8248
8247
|
const getSnackbarMessage$1 = (location, locationLabel) => {
|
|
@@ -8309,7 +8308,7 @@ const TacContainer = ({
|
|
|
8309
8308
|
retrieveTAC(taf);
|
|
8310
8309
|
}
|
|
8311
8310
|
}, [taf, _isActive, retrieveTAC]);
|
|
8312
|
-
return
|
|
8311
|
+
return jsxs(Box, Object.assign({
|
|
8313
8312
|
sx: {
|
|
8314
8313
|
marginBottom: '20px'
|
|
8315
8314
|
},
|
|
@@ -8317,75 +8316,93 @@ const TacContainer = ({
|
|
|
8317
8316
|
className: _isActive ? 'active' : undefined,
|
|
8318
8317
|
role: "listitem",
|
|
8319
8318
|
"aria-label": location
|
|
8320
|
-
},
|
|
8321
|
-
|
|
8322
|
-
|
|
8323
|
-
|
|
8324
|
-
|
|
8325
|
-
|
|
8326
|
-
|
|
8327
|
-
|
|
8328
|
-
|
|
8329
|
-
|
|
8330
|
-
|
|
8331
|
-
|
|
8332
|
-
|
|
8333
|
-
|
|
8334
|
-
|
|
8335
|
-
|
|
8336
|
-
|
|
8337
|
-
|
|
8338
|
-
|
|
8339
|
-
|
|
8340
|
-
|
|
8341
|
-
|
|
8342
|
-
|
|
8343
|
-
|
|
8344
|
-
|
|
8345
|
-
|
|
8346
|
-
|
|
8347
|
-
|
|
8348
|
-
|
|
8349
|
-
|
|
8350
|
-
|
|
8351
|
-
|
|
8352
|
-
|
|
8353
|
-
|
|
8354
|
-
|
|
8355
|
-
|
|
8356
|
-
|
|
8357
|
-
|
|
8358
|
-
|
|
8359
|
-
|
|
8360
|
-
|
|
8361
|
-
|
|
8362
|
-
|
|
8363
|
-
|
|
8364
|
-
|
|
8365
|
-
|
|
8366
|
-
|
|
8367
|
-
|
|
8368
|
-
|
|
8369
|
-
|
|
8370
|
-
|
|
8371
|
-
|
|
8372
|
-
|
|
8373
|
-
|
|
8374
|
-
|
|
8375
|
-
|
|
8376
|
-
|
|
8377
|
-
|
|
8378
|
-
|
|
8379
|
-
|
|
8380
|
-
|
|
8381
|
-
|
|
8382
|
-
|
|
8383
|
-
|
|
8384
|
-
|
|
8385
|
-
|
|
8386
|
-
|
|
8387
|
-
|
|
8388
|
-
|
|
8319
|
+
}, {
|
|
8320
|
+
children: [jsxs(Box, Object.assign({
|
|
8321
|
+
sx: {
|
|
8322
|
+
display: 'flex',
|
|
8323
|
+
alignItems: 'center',
|
|
8324
|
+
justifyContent: 'space-between',
|
|
8325
|
+
height: 24
|
|
8326
|
+
}
|
|
8327
|
+
}, {
|
|
8328
|
+
children: [jsxs(Box, Object.assign({
|
|
8329
|
+
sx: {
|
|
8330
|
+
display: 'flex',
|
|
8331
|
+
alignItems: 'center'
|
|
8332
|
+
}
|
|
8333
|
+
}, {
|
|
8334
|
+
children: [jsx(Box, Object.assign({
|
|
8335
|
+
sx: {
|
|
8336
|
+
width: 24,
|
|
8337
|
+
height: 24,
|
|
8338
|
+
display: 'flex',
|
|
8339
|
+
marginRight: '2px',
|
|
8340
|
+
paddingTop: '6px',
|
|
8341
|
+
alignItems: 'center',
|
|
8342
|
+
justifyContent: 'center'
|
|
8343
|
+
}
|
|
8344
|
+
}, {
|
|
8345
|
+
children: jsx(StatusIcon, {
|
|
8346
|
+
timeSlot: timeSlot,
|
|
8347
|
+
status: status
|
|
8348
|
+
})
|
|
8349
|
+
})), jsxs(Typography, Object.assign({
|
|
8350
|
+
sx: Object.assign({
|
|
8351
|
+
lineHeight: 1
|
|
8352
|
+
}, _isActive && {
|
|
8353
|
+
backgroundColor: 'geowebColors.functional.warningHighlight.rgba',
|
|
8354
|
+
padding: '0 2px',
|
|
8355
|
+
marginLeft: '-2px'
|
|
8356
|
+
})
|
|
8357
|
+
}, {
|
|
8358
|
+
children: [jsx(Typography, Object.assign({
|
|
8359
|
+
sx: {
|
|
8360
|
+
fontSize: '12px',
|
|
8361
|
+
color: 'geowebColors.captions.captionInformation.rgba'
|
|
8362
|
+
},
|
|
8363
|
+
"data-testid": "tafLocation",
|
|
8364
|
+
component: "span"
|
|
8365
|
+
}, {
|
|
8366
|
+
children: location
|
|
8367
|
+
})), jsx(Typography, Object.assign({
|
|
8368
|
+
sx: {
|
|
8369
|
+
fontSize: '12px',
|
|
8370
|
+
marginLeft: '10px'
|
|
8371
|
+
},
|
|
8372
|
+
"data-testid": "tafLocationLabel",
|
|
8373
|
+
component: "span"
|
|
8374
|
+
}, {
|
|
8375
|
+
children: locationLabel
|
|
8376
|
+
}))]
|
|
8377
|
+
}))]
|
|
8378
|
+
})), jsx(ExportButton, {
|
|
8379
|
+
onClick: handleExport,
|
|
8380
|
+
isHidden: _isFormDisabled || tacHasError(TAC)
|
|
8381
|
+
})]
|
|
8382
|
+
})), jsx(Box, Object.assign({
|
|
8383
|
+
sx: {
|
|
8384
|
+
fontSize: '12px',
|
|
8385
|
+
letterSpacing: '0.4px',
|
|
8386
|
+
color: 'geowebColors.captions.captionStatus.rgba'
|
|
8387
|
+
}
|
|
8388
|
+
}, {
|
|
8389
|
+
children: typeof TAC === 'string' ? jsx(Box, Object.assign({
|
|
8390
|
+
component: "span",
|
|
8391
|
+
sx: Object.assign({
|
|
8392
|
+
display: 'inline',
|
|
8393
|
+
boxDecorationBreak: 'clone',
|
|
8394
|
+
WebkitBoxDecorationBreak: 'clone'
|
|
8395
|
+
}, _isActive && {
|
|
8396
|
+
backgroundColor: 'geowebColors.functional.warningHighlight.rgba'
|
|
8397
|
+
})
|
|
8398
|
+
}, {
|
|
8399
|
+
children: TAC
|
|
8400
|
+
})) : jsx(AdverseWeatherTACMessage, {
|
|
8401
|
+
TAC: TAC,
|
|
8402
|
+
isActive: _isActive
|
|
8403
|
+
})
|
|
8404
|
+
}))]
|
|
8405
|
+
}));
|
|
8389
8406
|
};
|
|
8390
8407
|
|
|
8391
8408
|
const TacOverview = ({
|
|
@@ -8437,7 +8454,7 @@ const TacOverview = ({
|
|
|
8437
8454
|
clearTimeout(timer);
|
|
8438
8455
|
};
|
|
8439
8456
|
}, [activeTab, scrollToPosition]);
|
|
8440
|
-
return
|
|
8457
|
+
return jsxs(Card, Object.assign({
|
|
8441
8458
|
variant: "outlined",
|
|
8442
8459
|
sx: {
|
|
8443
8460
|
maxHeight: '100%',
|
|
@@ -8445,47 +8462,54 @@ const TacOverview = ({
|
|
|
8445
8462
|
display: 'flex',
|
|
8446
8463
|
flexDirection: 'column'
|
|
8447
8464
|
}
|
|
8448
|
-
},
|
|
8449
|
-
|
|
8450
|
-
|
|
8451
|
-
|
|
8452
|
-
|
|
8453
|
-
|
|
8454
|
-
|
|
8455
|
-
|
|
8456
|
-
|
|
8457
|
-
|
|
8458
|
-
|
|
8459
|
-
|
|
8460
|
-
|
|
8461
|
-
|
|
8462
|
-
|
|
8463
|
-
|
|
8464
|
-
|
|
8465
|
-
|
|
8466
|
-
|
|
8467
|
-
|
|
8468
|
-
|
|
8469
|
-
|
|
8470
|
-
|
|
8471
|
-
|
|
8472
|
-
|
|
8473
|
-
|
|
8474
|
-
|
|
8475
|
-
|
|
8476
|
-
|
|
8477
|
-
|
|
8478
|
-
|
|
8479
|
-
|
|
8480
|
-
|
|
8481
|
-
|
|
8482
|
-
|
|
8483
|
-
|
|
8484
|
-
|
|
8485
|
-
|
|
8486
|
-
|
|
8487
|
-
|
|
8488
|
-
|
|
8465
|
+
}, {
|
|
8466
|
+
children: [jsxs(Box, Object.assign({
|
|
8467
|
+
sx: {
|
|
8468
|
+
zIndex: 1
|
|
8469
|
+
}
|
|
8470
|
+
}, {
|
|
8471
|
+
children: [!_hideTitle && jsx(TafHeader, {
|
|
8472
|
+
title: "TAC Overview"
|
|
8473
|
+
}), jsx(Tabs, Object.assign({
|
|
8474
|
+
value: activeTab,
|
|
8475
|
+
onChange: onChangeTab,
|
|
8476
|
+
"aria-label": "tabs"
|
|
8477
|
+
}, {
|
|
8478
|
+
children: tabs.map((tab, index) => jsx(Tab, Object.assign({
|
|
8479
|
+
sx: {
|
|
8480
|
+
flexGrow: 1
|
|
8481
|
+
},
|
|
8482
|
+
label: tab.title,
|
|
8483
|
+
"data-testid": `tab-${index}`
|
|
8484
|
+
}, muiTabA11yProps(index)), tab.title))
|
|
8485
|
+
}))]
|
|
8486
|
+
})), jsx(Box, Object.assign({
|
|
8487
|
+
ref: scrollRef,
|
|
8488
|
+
sx: {
|
|
8489
|
+
padding: {
|
|
8490
|
+
xs: '12px',
|
|
8491
|
+
sm: '6px',
|
|
8492
|
+
md: '16px',
|
|
8493
|
+
lg: '24px'
|
|
8494
|
+
},
|
|
8495
|
+
maxHeight: '100%',
|
|
8496
|
+
overflow: 'auto'
|
|
8497
|
+
}
|
|
8498
|
+
}, {
|
|
8499
|
+
children: tabs.map((tab, index) => jsx(TabPanel, Object.assign({
|
|
8500
|
+
value: activeTab,
|
|
8501
|
+
index: index
|
|
8502
|
+
}, {
|
|
8503
|
+
children: tab.tafList.map(({
|
|
8504
|
+
taf
|
|
8505
|
+
}) => jsx(TacContainer, {
|
|
8506
|
+
taf: taf,
|
|
8507
|
+
isActive: isActiveLocation(taf.location),
|
|
8508
|
+
isFormDisabled: _isFormDisabled
|
|
8509
|
+
}, taf.uuid))
|
|
8510
|
+
}), tab.title))
|
|
8511
|
+
}))]
|
|
8512
|
+
}));
|
|
8489
8513
|
};
|
|
8490
8514
|
|
|
8491
8515
|
const TacOverviewMobile = ({
|
|
@@ -8497,43 +8521,49 @@ const TacOverviewMobile = ({
|
|
|
8497
8521
|
}) => {
|
|
8498
8522
|
const [isOpen, toggleOpen] = React.useState(_defaultOpen);
|
|
8499
8523
|
const onClose = () => toggleOpen(false);
|
|
8500
|
-
return
|
|
8501
|
-
|
|
8502
|
-
|
|
8503
|
-
|
|
8504
|
-
|
|
8505
|
-
display: {
|
|
8506
|
-
xs: 'inline-flex',
|
|
8507
|
-
sm: 'none'
|
|
8508
|
-
},
|
|
8509
|
-
position: 'absolute',
|
|
8510
|
-
right: '4px',
|
|
8511
|
-
top: '42px'
|
|
8512
|
-
},
|
|
8513
|
-
variant: "tool"
|
|
8514
|
-
}, /*#__PURE__*/React.createElement(ListItem, null)), /*#__PURE__*/React.createElement(Dialog, {
|
|
8515
|
-
open: isOpen,
|
|
8516
|
-
onClose: onClose,
|
|
8517
|
-
PaperProps: {
|
|
8524
|
+
return jsxs(Fragment, {
|
|
8525
|
+
children: [jsx(CustomIconButton, Object.assign({
|
|
8526
|
+
isSelected: isOpen,
|
|
8527
|
+
onClick: () => toggleOpen(true),
|
|
8528
|
+
"data-testid": "tac-overview-mobile-button",
|
|
8518
8529
|
sx: {
|
|
8519
|
-
|
|
8520
|
-
|
|
8521
|
-
|
|
8522
|
-
|
|
8523
|
-
|
|
8524
|
-
|
|
8525
|
-
|
|
8526
|
-
|
|
8527
|
-
|
|
8528
|
-
|
|
8529
|
-
|
|
8530
|
-
|
|
8531
|
-
|
|
8532
|
-
|
|
8533
|
-
|
|
8534
|
-
|
|
8535
|
-
|
|
8536
|
-
|
|
8530
|
+
display: {
|
|
8531
|
+
xs: 'inline-flex',
|
|
8532
|
+
sm: 'none'
|
|
8533
|
+
},
|
|
8534
|
+
position: 'absolute',
|
|
8535
|
+
right: '4px',
|
|
8536
|
+
top: '42px'
|
|
8537
|
+
},
|
|
8538
|
+
variant: "tool"
|
|
8539
|
+
}, {
|
|
8540
|
+
children: jsx(ListItem, {})
|
|
8541
|
+
})), jsxs(Dialog, Object.assign({
|
|
8542
|
+
open: isOpen,
|
|
8543
|
+
onClose: onClose,
|
|
8544
|
+
PaperProps: {
|
|
8545
|
+
sx: {
|
|
8546
|
+
margin: 2,
|
|
8547
|
+
width: '100%',
|
|
8548
|
+
height: '100%'
|
|
8549
|
+
}
|
|
8550
|
+
},
|
|
8551
|
+
"data-testid": "tac-overview-mobile"
|
|
8552
|
+
}, {
|
|
8553
|
+
children: [jsx(ToolHeader, {
|
|
8554
|
+
title: "TAC Overview",
|
|
8555
|
+
size: "small",
|
|
8556
|
+
isDraggable: false,
|
|
8557
|
+
onClose: onClose
|
|
8558
|
+
}), jsx(TacOverview, {
|
|
8559
|
+
upcomingTafs: upcomingTafs,
|
|
8560
|
+
currentTafs: currentTafs,
|
|
8561
|
+
expiredTafs: expiredTafs,
|
|
8562
|
+
activeTaf: activeTaf,
|
|
8563
|
+
hideTitle: true
|
|
8564
|
+
})]
|
|
8565
|
+
}))]
|
|
8566
|
+
});
|
|
8537
8567
|
};
|
|
8538
8568
|
|
|
8539
8569
|
const formatBaseTime = time => dateUtils.dateToString(time, DATE_FORMAT_BASE_TIME);
|
|
@@ -8570,38 +8600,23 @@ const TopTabs = ({
|
|
|
8570
8600
|
const onChangeTab = (_event, newValue) => {
|
|
8571
8601
|
_onChangeTimeSlot(tabs[newValue].timeSlot, isDirty);
|
|
8572
8602
|
};
|
|
8573
|
-
return
|
|
8603
|
+
return jsx(Tabs, Object.assign({
|
|
8574
8604
|
value: activeTab,
|
|
8575
8605
|
onChange: onChangeTab,
|
|
8576
8606
|
"aria-label": "timeslot-tabs",
|
|
8577
8607
|
"data-testid": "timeslot-tabs",
|
|
8578
8608
|
variant: "fullWidth"
|
|
8579
|
-
},
|
|
8580
|
-
|
|
8581
|
-
|
|
8582
|
-
|
|
8583
|
-
|
|
8584
|
-
|
|
8585
|
-
|
|
8586
|
-
|
|
8609
|
+
}, {
|
|
8610
|
+
children: tabs.map((tab, index) => jsx(Tab, Object.assign({
|
|
8611
|
+
label: tab.title,
|
|
8612
|
+
"data-testid": `toptab-${index}`,
|
|
8613
|
+
sx: {
|
|
8614
|
+
fontSize: 16
|
|
8615
|
+
}
|
|
8616
|
+
}, muiTabA11yProps(index)), tab.title))
|
|
8617
|
+
}));
|
|
8587
8618
|
};
|
|
8588
8619
|
|
|
8589
|
-
/* *
|
|
8590
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8591
|
-
* you may not use this file except in compliance with the License.
|
|
8592
|
-
* You may obtain a copy of the License at
|
|
8593
|
-
*
|
|
8594
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8595
|
-
*
|
|
8596
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
8597
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
8598
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
8599
|
-
* See the License for the specific language governing permissions and
|
|
8600
|
-
* limitations under the License.
|
|
8601
|
-
*
|
|
8602
|
-
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8603
|
-
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
8604
|
-
* */
|
|
8605
8620
|
const LocationTabs = ({
|
|
8606
8621
|
tafList,
|
|
8607
8622
|
activeIndex: _activeIndex = 0,
|
|
@@ -8613,73 +8628,84 @@ const LocationTabs = ({
|
|
|
8613
8628
|
isDirty
|
|
8614
8629
|
}
|
|
8615
8630
|
} = useFormContext();
|
|
8616
|
-
return
|
|
8631
|
+
return jsx(MenuList, Object.assign({
|
|
8617
8632
|
"data-testid": "location-tabs",
|
|
8618
8633
|
sx: {
|
|
8619
8634
|
paddingTop: '32px'
|
|
8620
8635
|
}
|
|
8621
|
-
},
|
|
8622
|
-
|
|
8623
|
-
|
|
8624
|
-
|
|
8625
|
-
|
|
8626
|
-
|
|
8627
|
-
|
|
8628
|
-
backgroundColor: 'geowebColors.cards.cardContainer',
|
|
8629
|
-
borderColor: 'geowebColors.cards.cardContainerBorder',
|
|
8630
|
-
borderWidth: '1px',
|
|
8631
|
-
borderStyle: 'solid',
|
|
8632
|
-
margin: '0 0 4px',
|
|
8633
|
-
height: '56px',
|
|
8634
|
-
justifyContent: 'center',
|
|
8635
|
-
':after': {
|
|
8636
|
-
background: 'none!important'
|
|
8637
|
-
},
|
|
8638
|
-
'&.Mui-selected': {
|
|
8636
|
+
}, {
|
|
8637
|
+
children: tafList.map(({
|
|
8638
|
+
taf,
|
|
8639
|
+
editor
|
|
8640
|
+
}, index) => jsxs(MenuItem, Object.assign({
|
|
8641
|
+
selected: index === _activeIndex,
|
|
8642
|
+
sx: {
|
|
8639
8643
|
backgroundColor: 'geowebColors.cards.cardContainer',
|
|
8640
|
-
|
|
8641
|
-
|
|
8642
|
-
|
|
8643
|
-
|
|
8644
|
-
|
|
8645
|
-
|
|
8646
|
-
|
|
8647
|
-
|
|
8648
|
-
|
|
8649
|
-
|
|
8650
|
-
|
|
8651
|
-
|
|
8652
|
-
|
|
8653
|
-
|
|
8654
|
-
|
|
8655
|
-
|
|
8656
|
-
|
|
8657
|
-
|
|
8658
|
-
|
|
8659
|
-
|
|
8660
|
-
|
|
8661
|
-
|
|
8662
|
-
|
|
8663
|
-
|
|
8664
|
-
|
|
8665
|
-
|
|
8666
|
-
|
|
8667
|
-
|
|
8668
|
-
|
|
8669
|
-
|
|
8670
|
-
|
|
8671
|
-
|
|
8672
|
-
|
|
8673
|
-
|
|
8674
|
-
|
|
8644
|
+
borderColor: 'geowebColors.cards.cardContainerBorder',
|
|
8645
|
+
borderWidth: '1px',
|
|
8646
|
+
borderStyle: 'solid',
|
|
8647
|
+
margin: '0 0 4px',
|
|
8648
|
+
height: '56px',
|
|
8649
|
+
justifyContent: 'center',
|
|
8650
|
+
':after': {
|
|
8651
|
+
background: 'none!important'
|
|
8652
|
+
},
|
|
8653
|
+
'&.Mui-selected': {
|
|
8654
|
+
backgroundColor: 'geowebColors.cards.cardContainer',
|
|
8655
|
+
marginRight: '-17px',
|
|
8656
|
+
borderRight: '0px',
|
|
8657
|
+
zIndex: 1
|
|
8658
|
+
}
|
|
8659
|
+
},
|
|
8660
|
+
onClick: () => _onChangeTab(index, isDirty)
|
|
8661
|
+
}, {
|
|
8662
|
+
children: [editor && jsx(Box$1, Object.assign({
|
|
8663
|
+
sx: {
|
|
8664
|
+
position: 'absolute',
|
|
8665
|
+
top: '4px',
|
|
8666
|
+
left: '8px'
|
|
8667
|
+
}
|
|
8668
|
+
}, {
|
|
8669
|
+
children: jsx(TafAvatar, {
|
|
8670
|
+
editor: editor,
|
|
8671
|
+
tooltipPlacement: "right"
|
|
8672
|
+
})
|
|
8673
|
+
})), jsx(Box$1, Object.assign({
|
|
8674
|
+
component: "span",
|
|
8675
|
+
"data-testid": "taf-location",
|
|
8676
|
+
sx: {
|
|
8677
|
+
fontSize: '12px',
|
|
8678
|
+
fontWeight: '500',
|
|
8679
|
+
letterSpacing: '0.09px'
|
|
8680
|
+
}
|
|
8681
|
+
}, {
|
|
8682
|
+
children: taf.location
|
|
8683
|
+
})), jsx(Box$1, Object.assign({
|
|
8684
|
+
component: "span",
|
|
8685
|
+
sx: {
|
|
8686
|
+
position: 'absolute',
|
|
8687
|
+
bottom: '-1px',
|
|
8688
|
+
width: '24px',
|
|
8689
|
+
height: '24px'
|
|
8690
|
+
}
|
|
8691
|
+
}, {
|
|
8692
|
+
children: jsx(StatusIcon, {
|
|
8693
|
+
timeSlot: timeSlot,
|
|
8694
|
+
status: taf.status
|
|
8695
|
+
})
|
|
8696
|
+
}))]
|
|
8697
|
+
}), taf.uuid))
|
|
8698
|
+
}));
|
|
8675
8699
|
};
|
|
8676
8700
|
|
|
8677
|
-
const Spinner = props => (
|
|
8701
|
+
const Spinner = props => jsx(Backdrop, Object.assign({
|
|
8678
8702
|
open: true
|
|
8679
|
-
}, props
|
|
8680
|
-
|
|
8681
|
-
|
|
8682
|
-
|
|
8703
|
+
}, props, {
|
|
8704
|
+
children: jsx(CircularProgress, {
|
|
8705
|
+
"data-testid": "spinner",
|
|
8706
|
+
color: "inherit"
|
|
8707
|
+
})
|
|
8708
|
+
}));
|
|
8683
8709
|
|
|
8684
8710
|
const fromActionToStatus = tafAction => {
|
|
8685
8711
|
switch (tafAction) {
|
|
@@ -8795,47 +8821,51 @@ const TafPanel = ({
|
|
|
8795
8821
|
return false;
|
|
8796
8822
|
}
|
|
8797
8823
|
});
|
|
8798
|
-
return
|
|
8824
|
+
return jsxs(TabPanel, Object.assign({
|
|
8799
8825
|
value: activeTafIndex,
|
|
8800
8826
|
index: index,
|
|
8801
8827
|
"data-testid": `taf-panel${activeTafIndex === index ? '-active' : ''}`
|
|
8802
|
-
},
|
|
8803
|
-
|
|
8804
|
-
|
|
8805
|
-
|
|
8806
|
-
|
|
8807
|
-
|
|
8808
|
-
|
|
8809
|
-
|
|
8810
|
-
|
|
8811
|
-
|
|
8812
|
-
|
|
8813
|
-
|
|
8814
|
-
|
|
8815
|
-
|
|
8816
|
-
|
|
8817
|
-
|
|
8818
|
-
|
|
8819
|
-
|
|
8820
|
-
|
|
8821
|
-
|
|
8822
|
-
|
|
8823
|
-
|
|
8824
|
-
|
|
8825
|
-
|
|
8826
|
-
|
|
8827
|
-
|
|
8828
|
-
|
|
8829
|
-
|
|
8830
|
-
|
|
8831
|
-
|
|
8832
|
-
|
|
8833
|
-
|
|
8834
|
-
|
|
8835
|
-
|
|
8836
|
-
|
|
8837
|
-
|
|
8838
|
-
|
|
8828
|
+
}, {
|
|
8829
|
+
children: [jsx(TafHeader, {
|
|
8830
|
+
title: getTafStatusLabel(tafFromBackend.taf.status, tafAction, _isFormDisabled),
|
|
8831
|
+
sx: {
|
|
8832
|
+
marginBottom: '4px'
|
|
8833
|
+
}
|
|
8834
|
+
}), _isLoading && jsx(Spinner, {
|
|
8835
|
+
"data-testid": "taf-loading",
|
|
8836
|
+
sx: {
|
|
8837
|
+
position: 'absolute',
|
|
8838
|
+
zIndex: 1,
|
|
8839
|
+
color: 'geowebColors.backdrops.white.fill'
|
|
8840
|
+
}
|
|
8841
|
+
}), error && jsx(AlertBanner, {
|
|
8842
|
+
severity: severity,
|
|
8843
|
+
title: error.title,
|
|
8844
|
+
info: error.message,
|
|
8845
|
+
dataTestId: "taf-error",
|
|
8846
|
+
shouldClose: true
|
|
8847
|
+
}), jsx(Box, Object.assign({
|
|
8848
|
+
sx: {
|
|
8849
|
+
marginTop: {
|
|
8850
|
+
xs: '44px',
|
|
8851
|
+
sm: '10px'
|
|
8852
|
+
},
|
|
8853
|
+
padding: 1
|
|
8854
|
+
}
|
|
8855
|
+
}, {
|
|
8856
|
+
children: jsx(TafForm, {
|
|
8857
|
+
tafFromBackend: tafFromBackend,
|
|
8858
|
+
onFormAction: onTafAction,
|
|
8859
|
+
isIssuesPaneOpen: _isIssuesPaneOpen,
|
|
8860
|
+
setIsIssuesPaneOpen: _setIsIssuesPaneOpen,
|
|
8861
|
+
isDisabled: _isFormDisabled,
|
|
8862
|
+
setIsDisabled: _setIsFormDisabled,
|
|
8863
|
+
onSwitchEditor: _patchTaf,
|
|
8864
|
+
fetchNewTafList: _fetchNewTafList,
|
|
8865
|
+
previousTaf: _previousTaf
|
|
8866
|
+
})
|
|
8867
|
+
}))]
|
|
8868
|
+
}));
|
|
8839
8869
|
};
|
|
8840
8870
|
|
|
8841
8871
|
const IssuesPaneWrapper = props => {
|
|
@@ -8845,7 +8875,7 @@ const IssuesPaneWrapper = props => {
|
|
|
8845
8875
|
}
|
|
8846
8876
|
} = useFormContext();
|
|
8847
8877
|
const errorList = filterDuplicateErrors(getErrors(errors));
|
|
8848
|
-
return
|
|
8878
|
+
return jsx(IssuesPane, Object.assign({
|
|
8849
8879
|
errorList: errorList
|
|
8850
8880
|
}, props));
|
|
8851
8881
|
};
|
|
@@ -9024,130 +9054,153 @@ const TafLayout = ({
|
|
|
9024
9054
|
return null;
|
|
9025
9055
|
}
|
|
9026
9056
|
const activeTaf = locations[activeTafIndex];
|
|
9027
|
-
return
|
|
9028
|
-
|
|
9029
|
-
|
|
9030
|
-
|
|
9031
|
-
|
|
9032
|
-
|
|
9033
|
-
|
|
9034
|
-
|
|
9035
|
-
|
|
9036
|
-
|
|
9037
|
-
|
|
9038
|
-
|
|
9039
|
-
|
|
9040
|
-
|
|
9041
|
-
|
|
9042
|
-
|
|
9043
|
-
|
|
9044
|
-
|
|
9045
|
-
|
|
9046
|
-
|
|
9047
|
-
|
|
9048
|
-
|
|
9049
|
-
|
|
9050
|
-
|
|
9051
|
-
|
|
9052
|
-
|
|
9053
|
-
|
|
9054
|
-
|
|
9055
|
-
|
|
9056
|
-
|
|
9057
|
-
|
|
9058
|
-
|
|
9059
|
-
|
|
9060
|
-
|
|
9061
|
-
|
|
9062
|
-
|
|
9063
|
-
|
|
9064
|
-
|
|
9065
|
-
|
|
9066
|
-
|
|
9067
|
-
|
|
9068
|
-
|
|
9069
|
-
|
|
9070
|
-
|
|
9071
|
-
|
|
9072
|
-
|
|
9073
|
-
|
|
9074
|
-
|
|
9075
|
-
|
|
9076
|
-
|
|
9077
|
-
|
|
9078
|
-
|
|
9079
|
-
|
|
9080
|
-
|
|
9081
|
-
|
|
9082
|
-
|
|
9083
|
-
|
|
9084
|
-
|
|
9085
|
-
|
|
9086
|
-
|
|
9087
|
-
|
|
9088
|
-
|
|
9089
|
-
|
|
9090
|
-
|
|
9091
|
-
|
|
9092
|
-
|
|
9093
|
-
|
|
9094
|
-
|
|
9095
|
-
|
|
9096
|
-
|
|
9097
|
-
|
|
9098
|
-
|
|
9099
|
-
|
|
9100
|
-
|
|
9101
|
-
|
|
9102
|
-
|
|
9103
|
-
|
|
9104
|
-
|
|
9105
|
-
|
|
9106
|
-
|
|
9107
|
-
|
|
9108
|
-
|
|
9109
|
-
|
|
9110
|
-
|
|
9111
|
-
|
|
9112
|
-
|
|
9113
|
-
|
|
9114
|
-
|
|
9115
|
-
|
|
9116
|
-
|
|
9117
|
-
|
|
9118
|
-
|
|
9119
|
-
|
|
9120
|
-
|
|
9121
|
-
|
|
9122
|
-
|
|
9123
|
-
|
|
9124
|
-
|
|
9125
|
-
|
|
9126
|
-
|
|
9127
|
-
|
|
9128
|
-
|
|
9129
|
-
|
|
9130
|
-
|
|
9131
|
-
|
|
9132
|
-
|
|
9133
|
-
|
|
9134
|
-
|
|
9135
|
-
|
|
9136
|
-
|
|
9137
|
-
|
|
9138
|
-
|
|
9139
|
-
|
|
9140
|
-
|
|
9141
|
-
|
|
9142
|
-
|
|
9143
|
-
|
|
9144
|
-
|
|
9145
|
-
|
|
9146
|
-
|
|
9147
|
-
|
|
9148
|
-
|
|
9149
|
-
|
|
9150
|
-
|
|
9057
|
+
return jsxs(Fragment, {
|
|
9058
|
+
children: [jsx(Box, {
|
|
9059
|
+
id: MODAL_DIALOG_ELEMENT,
|
|
9060
|
+
component: "div",
|
|
9061
|
+
sx: {
|
|
9062
|
+
width: '100%',
|
|
9063
|
+
height: '100%',
|
|
9064
|
+
position: 'absolute',
|
|
9065
|
+
overflow: 'hidden',
|
|
9066
|
+
pointerEvents: 'none'
|
|
9067
|
+
}
|
|
9068
|
+
}), jsx(Box, Object.assign({
|
|
9069
|
+
sx: {
|
|
9070
|
+
height: '100%',
|
|
9071
|
+
maxHeight: '100%'
|
|
9072
|
+
}
|
|
9073
|
+
}, {
|
|
9074
|
+
children: jsxs(Box, Object.assign({
|
|
9075
|
+
sx: {
|
|
9076
|
+
minWidth: 320,
|
|
9077
|
+
margin: 'auto',
|
|
9078
|
+
height: '100%',
|
|
9079
|
+
display: 'flex',
|
|
9080
|
+
flexDirection: 'column'
|
|
9081
|
+
}
|
|
9082
|
+
}, {
|
|
9083
|
+
children: [jsxs(Grid, Object.assign({
|
|
9084
|
+
container: true,
|
|
9085
|
+
spacing: 2,
|
|
9086
|
+
sx: {
|
|
9087
|
+
paddingLeft: 1,
|
|
9088
|
+
paddingRight: 1
|
|
9089
|
+
}
|
|
9090
|
+
}, {
|
|
9091
|
+
children: [jsx(Grid, Object.assign({
|
|
9092
|
+
item: true,
|
|
9093
|
+
xs: 12,
|
|
9094
|
+
sm: 9
|
|
9095
|
+
}, {
|
|
9096
|
+
children: jsx(TopTabs, {
|
|
9097
|
+
tafFromBackend: lastCurrentTaf,
|
|
9098
|
+
timeSlot: timeSlot,
|
|
9099
|
+
onChangeTimeSlot: onChangeTimeSlot
|
|
9100
|
+
})
|
|
9101
|
+
})), jsx(Grid, Object.assign({
|
|
9102
|
+
item: true,
|
|
9103
|
+
xs: 12,
|
|
9104
|
+
sm: 3
|
|
9105
|
+
}, {
|
|
9106
|
+
children: lastUpdateTime && jsx(LastUpdateTime, {
|
|
9107
|
+
lastUpdateTime: lastUpdateTime,
|
|
9108
|
+
onPressRefresh: _onUpdateTaf,
|
|
9109
|
+
dataTestId: "lastupdated-time"
|
|
9110
|
+
})
|
|
9111
|
+
}))]
|
|
9112
|
+
})), jsx(Grid, Object.assign({
|
|
9113
|
+
container: true,
|
|
9114
|
+
flexGrow: 1,
|
|
9115
|
+
overflow: "hidden"
|
|
9116
|
+
}, {
|
|
9117
|
+
children: jsxs(Grid, Object.assign({
|
|
9118
|
+
container: true,
|
|
9119
|
+
spacing: 2,
|
|
9120
|
+
sx: {
|
|
9121
|
+
height: '100%',
|
|
9122
|
+
paddingLeft: 1,
|
|
9123
|
+
paddingRight: 1,
|
|
9124
|
+
paddingTop: 2,
|
|
9125
|
+
overflow: 'auto'
|
|
9126
|
+
}
|
|
9127
|
+
}, {
|
|
9128
|
+
children: [jsx(Grid, Object.assign({
|
|
9129
|
+
item: true,
|
|
9130
|
+
xs: 3,
|
|
9131
|
+
sm: 1
|
|
9132
|
+
}, {
|
|
9133
|
+
children: jsx(LocationTabs, {
|
|
9134
|
+
tafList: locations,
|
|
9135
|
+
activeIndex: activeTafIndex,
|
|
9136
|
+
onChangeTab: onChangeLocationTab,
|
|
9137
|
+
timeSlot: timeSlot
|
|
9138
|
+
})
|
|
9139
|
+
})), jsx(Grid, Object.assign({
|
|
9140
|
+
item: true,
|
|
9141
|
+
xs: true
|
|
9142
|
+
}, {
|
|
9143
|
+
children: jsxs(Card, Object.assign({
|
|
9144
|
+
variant: "outlined",
|
|
9145
|
+
sx: {
|
|
9146
|
+
marginBottom: '12px',
|
|
9147
|
+
position: 'relative',
|
|
9148
|
+
minHeight: locations.length * 62 + 32
|
|
9149
|
+
}
|
|
9150
|
+
}, {
|
|
9151
|
+
children: [jsx(TacOverviewMobile, {
|
|
9152
|
+
upcomingTafs: upcoming,
|
|
9153
|
+
currentTafs: current,
|
|
9154
|
+
expiredTafs: expired,
|
|
9155
|
+
activeTaf: activeTaf
|
|
9156
|
+
}), locations.map((tafFromBackend, index) => jsx(TafPanel, {
|
|
9157
|
+
activeTafIndex: activeTafIndex,
|
|
9158
|
+
index: index,
|
|
9159
|
+
tafFromBackend: tafFromBackend,
|
|
9160
|
+
isIssuesPaneOpen: isIssuesPaneOpen,
|
|
9161
|
+
setIsIssuesPaneOpen: onToggleIssuesPane,
|
|
9162
|
+
isFormDisabled: isFormDisabled,
|
|
9163
|
+
setIsFormDisabled: setIsFormDisabled,
|
|
9164
|
+
postTaf: postTaf,
|
|
9165
|
+
patchTaf: patchTaf,
|
|
9166
|
+
isLoading: isLoading,
|
|
9167
|
+
error: error,
|
|
9168
|
+
fetchNewTafList: _onUpdateTaf,
|
|
9169
|
+
previousTaf: getPreviousTaf(_tafList, tafFromBackend),
|
|
9170
|
+
tafAction: tafAction
|
|
9171
|
+
}, tafFromBackend.taf.uuid))]
|
|
9172
|
+
}))
|
|
9173
|
+
})), jsx(Grid, Object.assign({
|
|
9174
|
+
item: true,
|
|
9175
|
+
xs: 0,
|
|
9176
|
+
sm: 3,
|
|
9177
|
+
height: {
|
|
9178
|
+
xs: 0,
|
|
9179
|
+
sm: '100%'
|
|
9180
|
+
},
|
|
9181
|
+
width: {
|
|
9182
|
+
xs: 0,
|
|
9183
|
+
sm: '100%'
|
|
9184
|
+
}
|
|
9185
|
+
}, {
|
|
9186
|
+
children: jsx(TacOverview, {
|
|
9187
|
+
upcomingTafs: upcoming,
|
|
9188
|
+
currentTafs: current,
|
|
9189
|
+
expiredTafs: expired,
|
|
9190
|
+
activeTaf: activeTaf,
|
|
9191
|
+
isFormDisabled: isFormDisabled
|
|
9192
|
+
})
|
|
9193
|
+
}))]
|
|
9194
|
+
}))
|
|
9195
|
+
}))]
|
|
9196
|
+
}))
|
|
9197
|
+
})), jsx(IssuesPaneWrapper, {
|
|
9198
|
+
handleClose: onCloseIssuesPane,
|
|
9199
|
+
isOpen: isIssuesPaneOpen,
|
|
9200
|
+
startPosition: startPosition,
|
|
9201
|
+
onUserHasDragged: onUserHasDragged
|
|
9202
|
+
})]
|
|
9203
|
+
});
|
|
9151
9204
|
};
|
|
9152
9205
|
|
|
9153
9206
|
const TafWrapper = _a => {
|
|
@@ -9155,7 +9208,7 @@ const TafWrapper = _a => {
|
|
|
9155
9208
|
children
|
|
9156
9209
|
} = _a,
|
|
9157
9210
|
props = __rest(_a, ["children"]);
|
|
9158
|
-
return
|
|
9211
|
+
return jsx(ReactHookFormProvider, Object.assign({
|
|
9159
9212
|
options: {
|
|
9160
9213
|
mode: 'onTouched',
|
|
9161
9214
|
reValidateMode: 'onChange',
|
|
@@ -9177,7 +9230,11 @@ const TafWrapper = _a => {
|
|
|
9177
9230
|
IS_DRAFT: false
|
|
9178
9231
|
}
|
|
9179
9232
|
}
|
|
9180
|
-
},
|
|
9233
|
+
}, {
|
|
9234
|
+
children: jsx(TafModuleProvider, Object.assign({}, props, {
|
|
9235
|
+
children: children
|
|
9236
|
+
}))
|
|
9237
|
+
}));
|
|
9181
9238
|
};
|
|
9182
9239
|
|
|
9183
9240
|
const getCurrentDate = () => dateUtils.dateToString(dateUtils.utc(), dateUtils.DATE_FORMAT_HOURS);
|
|
@@ -9227,35 +9284,41 @@ const TafModule = () => {
|
|
|
9227
9284
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
9228
9285
|
}, [isLoggedIn]);
|
|
9229
9286
|
usePoller([tafList, errorMessage], fetchNewTafList);
|
|
9230
|
-
return
|
|
9231
|
-
|
|
9232
|
-
|
|
9233
|
-
|
|
9234
|
-
|
|
9235
|
-
|
|
9236
|
-
|
|
9237
|
-
|
|
9238
|
-
|
|
9239
|
-
|
|
9240
|
-
|
|
9241
|
-
|
|
9242
|
-
|
|
9243
|
-
|
|
9244
|
-
|
|
9245
|
-
|
|
9246
|
-
|
|
9247
|
-
|
|
9248
|
-
|
|
9249
|
-
|
|
9250
|
-
|
|
9251
|
-
|
|
9252
|
-
|
|
9253
|
-
|
|
9254
|
-
|
|
9255
|
-
|
|
9256
|
-
|
|
9257
|
-
|
|
9258
|
-
|
|
9287
|
+
return jsx(ResponsiveWrapper, {
|
|
9288
|
+
children: jsxs(Box, Object.assign({
|
|
9289
|
+
component: "div",
|
|
9290
|
+
id: "tafmodule",
|
|
9291
|
+
"data-testid": "tafmodule",
|
|
9292
|
+
sx: {
|
|
9293
|
+
height: '100%'
|
|
9294
|
+
}
|
|
9295
|
+
}, {
|
|
9296
|
+
children: [isLoggedIn && isLoading && jsx(LinearProgress, {
|
|
9297
|
+
"data-testid": "loading-bar",
|
|
9298
|
+
color: "secondary",
|
|
9299
|
+
sx: {
|
|
9300
|
+
marginBottom: '-4px'
|
|
9301
|
+
}
|
|
9302
|
+
}), errorMessage ? jsx(AlertBanner, {
|
|
9303
|
+
severity: "error",
|
|
9304
|
+
title: errorMessage.title,
|
|
9305
|
+
info: errorMessage.info,
|
|
9306
|
+
"data-testid": "error-message",
|
|
9307
|
+
actionButtonProps: errorMessage.title !== ERROR_AUTH ? {
|
|
9308
|
+
title: 'Try again',
|
|
9309
|
+
onClick: fetchNewTafList
|
|
9310
|
+
} : undefined
|
|
9311
|
+
}) : null, jsx(TafLayout, {
|
|
9312
|
+
tafList: tafList,
|
|
9313
|
+
onUpdateTaf: onUpdateTaf,
|
|
9314
|
+
lastUpdateTime: lastUpdateTime
|
|
9315
|
+
})]
|
|
9316
|
+
}))
|
|
9317
|
+
});
|
|
9318
|
+
};
|
|
9319
|
+
const Wrapper = props => jsx(TafWrapper, Object.assign({}, props, {
|
|
9320
|
+
children: jsx(TafModule, {})
|
|
9321
|
+
}));
|
|
9259
9322
|
|
|
9260
9323
|
const getApiRoutes$1 = axiosInstance => ({
|
|
9261
9324
|
getTafList: () => {
|
|
@@ -10314,22 +10377,6 @@ const createApi = () => {
|
|
|
10314
10377
|
return getApiRoutes(instance);
|
|
10315
10378
|
};
|
|
10316
10379
|
|
|
10317
|
-
/* *
|
|
10318
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10319
|
-
* you may not use this file except in compliance with the License.
|
|
10320
|
-
* You may obtain a copy of the License at
|
|
10321
|
-
*
|
|
10322
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10323
|
-
*
|
|
10324
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
10325
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
10326
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10327
|
-
* See the License for the specific language governing permissions and
|
|
10328
|
-
* limitations under the License.
|
|
10329
|
-
*
|
|
10330
|
-
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
10331
|
-
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
10332
|
-
* */
|
|
10333
10380
|
const tafScreenPreset = {
|
|
10334
10381
|
id: 'screenConfigTaf',
|
|
10335
10382
|
title: 'TAF',
|
|
@@ -10352,7 +10399,7 @@ const TafApiWrapper = ({
|
|
|
10352
10399
|
onSetAuth,
|
|
10353
10400
|
onPreventCloseView
|
|
10354
10401
|
}) => {
|
|
10355
|
-
return config ? (
|
|
10402
|
+
return config ? jsx(ApiProvider, Object.assign({
|
|
10356
10403
|
config: {
|
|
10357
10404
|
baseURL: config.baseURL,
|
|
10358
10405
|
appURL: config.baseURL,
|
|
@@ -10362,9 +10409,13 @@ const TafApiWrapper = ({
|
|
|
10362
10409
|
auth: auth,
|
|
10363
10410
|
onSetAuth: onSetAuth,
|
|
10364
10411
|
createApi: createApi$1
|
|
10365
|
-
},
|
|
10366
|
-
|
|
10367
|
-
|
|
10412
|
+
}, {
|
|
10413
|
+
children: jsx(ErrorBoundary, {
|
|
10414
|
+
children: jsx(Wrapper, {
|
|
10415
|
+
onPreventCloseView: onPreventCloseView
|
|
10416
|
+
})
|
|
10417
|
+
})
|
|
10418
|
+
})) : null;
|
|
10368
10419
|
};
|
|
10369
10420
|
const componentsLookUp = (payload, {
|
|
10370
10421
|
config,
|
|
@@ -10381,7 +10432,7 @@ ConnectedModuleWrapper = null) => {
|
|
|
10381
10432
|
switch (componentType) {
|
|
10382
10433
|
case 'TafModule':
|
|
10383
10434
|
if (ConnectedModuleWrapper) {
|
|
10384
|
-
return
|
|
10435
|
+
return jsx(ConnectedModuleWrapper, {
|
|
10385
10436
|
component: TafApiWrapper,
|
|
10386
10437
|
payload: payload,
|
|
10387
10438
|
"data-testid": "tafmodule",
|
|
@@ -10390,7 +10441,7 @@ ConnectedModuleWrapper = null) => {
|
|
|
10390
10441
|
onSetAuth: onSetAuth
|
|
10391
10442
|
});
|
|
10392
10443
|
}
|
|
10393
|
-
return
|
|
10444
|
+
return jsx(TafApiWrapper, {
|
|
10394
10445
|
"data-testid": "tafmodule",
|
|
10395
10446
|
config: config,
|
|
10396
10447
|
auth: auth,
|