@plusscommunities/pluss-maintenance-web-a 1.1.27 → 1.1.28
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/dist/index.cjs.js +202 -91
- package/dist/index.esm.js +202 -91
- package/dist/index.umd.js +202 -91
- package/package.json +1 -1
- package/src/apis/maintenanceActions.js +6 -0
- package/src/screens/Job.js +73 -0
package/dist/index.esm.js
CHANGED
|
@@ -444,6 +444,14 @@ var maintenanceActions = {
|
|
|
444
444
|
id: id
|
|
445
445
|
}
|
|
446
446
|
});
|
|
447
|
+
},
|
|
448
|
+
getExternalSync: function getExternalSync(jobId) {
|
|
449
|
+
return Session$9.authedFunction({
|
|
450
|
+
method: 'GET',
|
|
451
|
+
url: Helper$5.getUrl(values.serviceKey, 'get/externalsync', {
|
|
452
|
+
id: jobId
|
|
453
|
+
})
|
|
454
|
+
});
|
|
447
455
|
}
|
|
448
456
|
};
|
|
449
457
|
|
|
@@ -3310,6 +3318,54 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
3310
3318
|
}, _callee2, null, [[0, 7]]);
|
|
3311
3319
|
})));
|
|
3312
3320
|
|
|
3321
|
+
_defineProperty(_assertThisInitialized(_this), "getExternalSync", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
3322
|
+
var res, _error$response;
|
|
3323
|
+
|
|
3324
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
3325
|
+
while (1) {
|
|
3326
|
+
switch (_context3.prev = _context3.next) {
|
|
3327
|
+
case 0:
|
|
3328
|
+
_context3.prev = 0;
|
|
3329
|
+
|
|
3330
|
+
_this.setState({
|
|
3331
|
+
loadingExternalSync: true
|
|
3332
|
+
});
|
|
3333
|
+
|
|
3334
|
+
_context3.next = 4;
|
|
3335
|
+
return maintenanceActions.getExternalSync(_this.state.jobId);
|
|
3336
|
+
|
|
3337
|
+
case 4:
|
|
3338
|
+
res = _context3.sent;
|
|
3339
|
+
|
|
3340
|
+
_this.setState({
|
|
3341
|
+
externalSync: res.data,
|
|
3342
|
+
loadingExternalSync: false
|
|
3343
|
+
});
|
|
3344
|
+
|
|
3345
|
+
_context3.next = 12;
|
|
3346
|
+
break;
|
|
3347
|
+
|
|
3348
|
+
case 8:
|
|
3349
|
+
_context3.prev = 8;
|
|
3350
|
+
_context3.t0 = _context3["catch"](0);
|
|
3351
|
+
|
|
3352
|
+
// 404 is expected if no sync - don't show error
|
|
3353
|
+
if (((_error$response = _context3.t0.response) === null || _error$response === void 0 ? void 0 : _error$response.status) !== 404) {
|
|
3354
|
+
console.error('getExternalSync', _context3.t0);
|
|
3355
|
+
}
|
|
3356
|
+
|
|
3357
|
+
_this.setState({
|
|
3358
|
+
loadingExternalSync: false
|
|
3359
|
+
});
|
|
3360
|
+
|
|
3361
|
+
case 12:
|
|
3362
|
+
case "end":
|
|
3363
|
+
return _context3.stop();
|
|
3364
|
+
}
|
|
3365
|
+
}
|
|
3366
|
+
}, _callee3, null, [[0, 8]]);
|
|
3367
|
+
})));
|
|
3368
|
+
|
|
3313
3369
|
_defineProperty(_assertThisInitialized(_this), "getStatusType", function (status) {
|
|
3314
3370
|
var statusTypes = _this.props.statusTypes;
|
|
3315
3371
|
var statusType = statusTypes.find(function (s) {
|
|
@@ -3475,35 +3531,35 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
3475
3531
|
});
|
|
3476
3532
|
});
|
|
3477
3533
|
|
|
3478
|
-
_defineProperty(_assertThisInitialized(_this), "onConfirmAssignee", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
3479
|
-
return _regeneratorRuntime.wrap(function
|
|
3534
|
+
_defineProperty(_assertThisInitialized(_this), "onConfirmAssignee", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
3535
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
3480
3536
|
while (1) {
|
|
3481
|
-
switch (
|
|
3537
|
+
switch (_context4.prev = _context4.next) {
|
|
3482
3538
|
case 0:
|
|
3483
3539
|
_this.setState({
|
|
3484
3540
|
confirmingAssignee: true
|
|
3485
3541
|
});
|
|
3486
3542
|
|
|
3487
|
-
|
|
3543
|
+
_context4.prev = 1;
|
|
3488
3544
|
|
|
3489
3545
|
if (!_this.state.selectedAssignee) {
|
|
3490
|
-
|
|
3546
|
+
_context4.next = 5;
|
|
3491
3547
|
break;
|
|
3492
3548
|
}
|
|
3493
3549
|
|
|
3494
|
-
|
|
3550
|
+
_context4.next = 5;
|
|
3495
3551
|
return _this.onAssignUser(_this.state.selectedAssignee.id);
|
|
3496
3552
|
|
|
3497
3553
|
case 5:
|
|
3498
3554
|
_this.onCloseSelectAssignee();
|
|
3499
3555
|
|
|
3500
|
-
|
|
3556
|
+
_context4.next = 11;
|
|
3501
3557
|
break;
|
|
3502
3558
|
|
|
3503
3559
|
case 8:
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
console.error('onConfirmAssignee',
|
|
3560
|
+
_context4.prev = 8;
|
|
3561
|
+
_context4.t0 = _context4["catch"](1);
|
|
3562
|
+
console.error('onConfirmAssignee', _context4.t0);
|
|
3507
3563
|
|
|
3508
3564
|
case 11:
|
|
3509
3565
|
_this.setState({
|
|
@@ -3512,68 +3568,68 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
3512
3568
|
|
|
3513
3569
|
case 12:
|
|
3514
3570
|
case "end":
|
|
3515
|
-
return
|
|
3571
|
+
return _context4.stop();
|
|
3516
3572
|
}
|
|
3517
3573
|
}
|
|
3518
|
-
},
|
|
3574
|
+
}, _callee4, null, [[1, 8]]);
|
|
3519
3575
|
})));
|
|
3520
3576
|
|
|
3521
3577
|
_defineProperty(_assertThisInitialized(_this), "onAssignUser", /*#__PURE__*/function () {
|
|
3522
|
-
var
|
|
3523
|
-
return _regeneratorRuntime.wrap(function
|
|
3578
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(userId) {
|
|
3579
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
3524
3580
|
while (1) {
|
|
3525
|
-
switch (
|
|
3581
|
+
switch (_context5.prev = _context5.next) {
|
|
3526
3582
|
case 0:
|
|
3527
|
-
|
|
3528
|
-
|
|
3583
|
+
_context5.prev = 0;
|
|
3584
|
+
_context5.next = 3;
|
|
3529
3585
|
return maintenanceActions.assignJob(_this.state.jobId, userId);
|
|
3530
3586
|
|
|
3531
3587
|
case 3:
|
|
3532
3588
|
|
|
3533
3589
|
_this.getJob();
|
|
3534
3590
|
|
|
3535
|
-
|
|
3591
|
+
_context5.next = 10;
|
|
3536
3592
|
break;
|
|
3537
3593
|
|
|
3538
3594
|
case 7:
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
console.error('onAssignUser',
|
|
3595
|
+
_context5.prev = 7;
|
|
3596
|
+
_context5.t0 = _context5["catch"](0);
|
|
3597
|
+
console.error('onAssignUser', _context5.t0);
|
|
3542
3598
|
|
|
3543
3599
|
case 10:
|
|
3544
3600
|
case "end":
|
|
3545
|
-
return
|
|
3601
|
+
return _context5.stop();
|
|
3546
3602
|
}
|
|
3547
3603
|
}
|
|
3548
|
-
},
|
|
3604
|
+
}, _callee5, null, [[0, 7]]);
|
|
3549
3605
|
}));
|
|
3550
3606
|
|
|
3551
3607
|
return function (_x) {
|
|
3552
|
-
return
|
|
3608
|
+
return _ref5.apply(this, arguments);
|
|
3553
3609
|
};
|
|
3554
3610
|
}());
|
|
3555
3611
|
|
|
3556
|
-
_defineProperty(_assertThisInitialized(_this), "onConfirmAddNote", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
3612
|
+
_defineProperty(_assertThisInitialized(_this), "onConfirmAddNote", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
|
|
3557
3613
|
var res;
|
|
3558
|
-
return _regeneratorRuntime.wrap(function
|
|
3614
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
3559
3615
|
while (1) {
|
|
3560
|
-
switch (
|
|
3616
|
+
switch (_context6.prev = _context6.next) {
|
|
3561
3617
|
case 0:
|
|
3562
3618
|
if (_this.isReadyToSaveNote()) {
|
|
3563
|
-
|
|
3619
|
+
_context6.next = 2;
|
|
3564
3620
|
break;
|
|
3565
3621
|
}
|
|
3566
3622
|
|
|
3567
|
-
return
|
|
3623
|
+
return _context6.abrupt("return");
|
|
3568
3624
|
|
|
3569
3625
|
case 2:
|
|
3570
|
-
|
|
3626
|
+
_context6.prev = 2;
|
|
3571
3627
|
|
|
3572
3628
|
_this.setState({
|
|
3573
3629
|
submittingNote: true
|
|
3574
3630
|
});
|
|
3575
3631
|
|
|
3576
|
-
|
|
3632
|
+
_context6.next = 6;
|
|
3577
3633
|
return _this.state.editingNote ? maintenanceActions.editNote(_this.state.jobId, _this.state.editingNote, _this.state.noteInput, _this.state.noteAttachments.map(function (a) {
|
|
3578
3634
|
return {
|
|
3579
3635
|
Title: a.Title,
|
|
@@ -3587,7 +3643,7 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
3587
3643
|
}), _this.state.noteImages);
|
|
3588
3644
|
|
|
3589
3645
|
case 6:
|
|
3590
|
-
res =
|
|
3646
|
+
res = _context6.sent;
|
|
3591
3647
|
|
|
3592
3648
|
_this.setState({
|
|
3593
3649
|
job: res.data.job,
|
|
@@ -3601,20 +3657,20 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
3601
3657
|
_this.props.jobsLoaded([_this.state.job]);
|
|
3602
3658
|
});
|
|
3603
3659
|
|
|
3604
|
-
|
|
3660
|
+
_context6.next = 13;
|
|
3605
3661
|
break;
|
|
3606
3662
|
|
|
3607
3663
|
case 10:
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
console.error('onConfirmAddNote',
|
|
3664
|
+
_context6.prev = 10;
|
|
3665
|
+
_context6.t0 = _context6["catch"](2);
|
|
3666
|
+
console.error('onConfirmAddNote', _context6.t0);
|
|
3611
3667
|
|
|
3612
3668
|
case 13:
|
|
3613
3669
|
case "end":
|
|
3614
|
-
return
|
|
3670
|
+
return _context6.stop();
|
|
3615
3671
|
}
|
|
3616
3672
|
}
|
|
3617
|
-
},
|
|
3673
|
+
}, _callee6, null, [[2, 10]]);
|
|
3618
3674
|
})));
|
|
3619
3675
|
|
|
3620
3676
|
_defineProperty(_assertThisInitialized(_this), "onDeleteNote", function (n) {
|
|
@@ -3662,42 +3718,42 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
3662
3718
|
|
|
3663
3719
|
_this.setState({
|
|
3664
3720
|
updating: true
|
|
3665
|
-
}, /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
3721
|
+
}, /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
|
|
3666
3722
|
var update;
|
|
3667
|
-
return _regeneratorRuntime.wrap(function
|
|
3723
|
+
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
3668
3724
|
while (1) {
|
|
3669
|
-
switch (
|
|
3725
|
+
switch (_context7.prev = _context7.next) {
|
|
3670
3726
|
case 0:
|
|
3671
|
-
|
|
3727
|
+
_context7.prev = 0;
|
|
3672
3728
|
update = {
|
|
3673
3729
|
id: job.id,
|
|
3674
3730
|
seen: true,
|
|
3675
3731
|
status: job.status || 'Unassigned'
|
|
3676
3732
|
};
|
|
3677
|
-
|
|
3733
|
+
_context7.next = 4;
|
|
3678
3734
|
return maintenanceActions.editJob(update, auth.site);
|
|
3679
3735
|
|
|
3680
3736
|
case 4:
|
|
3681
|
-
|
|
3737
|
+
_context7.next = 11;
|
|
3682
3738
|
break;
|
|
3683
3739
|
|
|
3684
3740
|
case 6:
|
|
3685
|
-
|
|
3686
|
-
|
|
3741
|
+
_context7.prev = 6;
|
|
3742
|
+
_context7.t0 = _context7["catch"](0);
|
|
3687
3743
|
|
|
3688
3744
|
_this.setState({
|
|
3689
3745
|
updating: false
|
|
3690
3746
|
});
|
|
3691
3747
|
|
|
3692
|
-
console.log('markSeen error',
|
|
3748
|
+
console.log('markSeen error', _context7.t0);
|
|
3693
3749
|
alert('Something went wrong with the request. Please try again.');
|
|
3694
3750
|
|
|
3695
3751
|
case 11:
|
|
3696
3752
|
case "end":
|
|
3697
|
-
return
|
|
3753
|
+
return _context7.stop();
|
|
3698
3754
|
}
|
|
3699
3755
|
}
|
|
3700
|
-
},
|
|
3756
|
+
}, _callee7, null, [[0, 6]]);
|
|
3701
3757
|
})));
|
|
3702
3758
|
});
|
|
3703
3759
|
|
|
@@ -3709,44 +3765,44 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
3709
3765
|
});
|
|
3710
3766
|
});
|
|
3711
3767
|
|
|
3712
|
-
_defineProperty(_assertThisInitialized(_this), "onAddComment", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
3768
|
+
_defineProperty(_assertThisInitialized(_this), "onAddComment", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
|
|
3713
3769
|
var _this$state2, commentInput, jobId, job, comments, res;
|
|
3714
3770
|
|
|
3715
|
-
return _regeneratorRuntime.wrap(function
|
|
3771
|
+
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
3716
3772
|
while (1) {
|
|
3717
|
-
switch (
|
|
3773
|
+
switch (_context8.prev = _context8.next) {
|
|
3718
3774
|
case 0:
|
|
3719
3775
|
_this$state2 = _this.state, commentInput = _this$state2.commentInput, jobId = _this$state2.jobId, job = _this$state2.job, comments = _this$state2.comments;
|
|
3720
|
-
|
|
3776
|
+
_context8.prev = 1;
|
|
3721
3777
|
|
|
3722
3778
|
_this.setState({
|
|
3723
3779
|
commentInput: ''
|
|
3724
3780
|
});
|
|
3725
3781
|
|
|
3726
|
-
|
|
3782
|
+
_context8.next = 5;
|
|
3727
3783
|
return reactionActions.addComment(jobId, values.commentKey, job.title, job.site, commentInput);
|
|
3728
3784
|
|
|
3729
3785
|
case 5:
|
|
3730
|
-
res =
|
|
3786
|
+
res = _context8.sent;
|
|
3731
3787
|
|
|
3732
3788
|
_this.setState({
|
|
3733
3789
|
comments: [].concat(_toConsumableArray(comments), [res.data])
|
|
3734
3790
|
});
|
|
3735
3791
|
|
|
3736
|
-
|
|
3792
|
+
_context8.next = 12;
|
|
3737
3793
|
break;
|
|
3738
3794
|
|
|
3739
3795
|
case 9:
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
console.error('onAddComment',
|
|
3796
|
+
_context8.prev = 9;
|
|
3797
|
+
_context8.t0 = _context8["catch"](1);
|
|
3798
|
+
console.error('onAddComment', _context8.t0);
|
|
3743
3799
|
|
|
3744
3800
|
case 12:
|
|
3745
3801
|
case "end":
|
|
3746
|
-
return
|
|
3802
|
+
return _context8.stop();
|
|
3747
3803
|
}
|
|
3748
3804
|
}
|
|
3749
|
-
},
|
|
3805
|
+
}, _callee8, null, [[1, 9]]);
|
|
3750
3806
|
})));
|
|
3751
3807
|
|
|
3752
3808
|
_defineProperty(_assertThisInitialized(_this), "onHandleChange", function (event) {
|
|
@@ -3763,11 +3819,11 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
3763
3819
|
});
|
|
3764
3820
|
|
|
3765
3821
|
_defineProperty(_assertThisInitialized(_this), "onSelectPriority", /*#__PURE__*/function () {
|
|
3766
|
-
var
|
|
3822
|
+
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(priority) {
|
|
3767
3823
|
var res, job;
|
|
3768
|
-
return _regeneratorRuntime.wrap(function
|
|
3824
|
+
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
|
3769
3825
|
while (1) {
|
|
3770
|
-
switch (
|
|
3826
|
+
switch (_context9.prev = _context9.next) {
|
|
3771
3827
|
case 0:
|
|
3772
3828
|
_this.setState({
|
|
3773
3829
|
job: _objectSpread$4(_objectSpread$4({}, _this.state.job), {}, {
|
|
@@ -3776,12 +3832,12 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
3776
3832
|
priorityChangerOpen: false
|
|
3777
3833
|
});
|
|
3778
3834
|
|
|
3779
|
-
|
|
3780
|
-
|
|
3835
|
+
_context9.prev = 1;
|
|
3836
|
+
_context9.next = 4;
|
|
3781
3837
|
return maintenanceActions.editJobPriority(_this.state.job.id, priority);
|
|
3782
3838
|
|
|
3783
3839
|
case 4:
|
|
3784
|
-
res =
|
|
3840
|
+
res = _context9.sent;
|
|
3785
3841
|
job = res.data.job;
|
|
3786
3842
|
|
|
3787
3843
|
_this.props.jobsLoaded([job]);
|
|
@@ -3790,24 +3846,24 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
3790
3846
|
job: job
|
|
3791
3847
|
});
|
|
3792
3848
|
|
|
3793
|
-
|
|
3849
|
+
_context9.next = 13;
|
|
3794
3850
|
break;
|
|
3795
3851
|
|
|
3796
3852
|
case 10:
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
console.error('onSelectPriority',
|
|
3853
|
+
_context9.prev = 10;
|
|
3854
|
+
_context9.t0 = _context9["catch"](1);
|
|
3855
|
+
console.error('onSelectPriority', _context9.t0);
|
|
3800
3856
|
|
|
3801
3857
|
case 13:
|
|
3802
3858
|
case "end":
|
|
3803
|
-
return
|
|
3859
|
+
return _context9.stop();
|
|
3804
3860
|
}
|
|
3805
3861
|
}
|
|
3806
|
-
},
|
|
3862
|
+
}, _callee9, null, [[1, 10]]);
|
|
3807
3863
|
}));
|
|
3808
3864
|
|
|
3809
3865
|
return function (_x2) {
|
|
3810
|
-
return
|
|
3866
|
+
return _ref9.apply(this, arguments);
|
|
3811
3867
|
};
|
|
3812
3868
|
}());
|
|
3813
3869
|
|
|
@@ -3818,11 +3874,11 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
3818
3874
|
});
|
|
3819
3875
|
|
|
3820
3876
|
_defineProperty(_assertThisInitialized(_this), "onSelectStatus", /*#__PURE__*/function () {
|
|
3821
|
-
var
|
|
3877
|
+
var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(status) {
|
|
3822
3878
|
var res, job;
|
|
3823
|
-
return _regeneratorRuntime.wrap(function
|
|
3879
|
+
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
3824
3880
|
while (1) {
|
|
3825
|
-
switch (
|
|
3881
|
+
switch (_context10.prev = _context10.next) {
|
|
3826
3882
|
case 0:
|
|
3827
3883
|
_this.setState({
|
|
3828
3884
|
job: _objectSpread$4(_objectSpread$4({}, _this.state.job), {}, {
|
|
@@ -3831,12 +3887,12 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
3831
3887
|
statusChangerOpen: false
|
|
3832
3888
|
});
|
|
3833
3889
|
|
|
3834
|
-
|
|
3835
|
-
|
|
3890
|
+
_context10.prev = 1;
|
|
3891
|
+
_context10.next = 4;
|
|
3836
3892
|
return maintenanceActions.editJobStatus(_this.state.job.id, status);
|
|
3837
3893
|
|
|
3838
3894
|
case 4:
|
|
3839
|
-
res =
|
|
3895
|
+
res = _context10.sent;
|
|
3840
3896
|
job = res.data.job;
|
|
3841
3897
|
|
|
3842
3898
|
_this.props.jobsLoaded([job]);
|
|
@@ -3845,24 +3901,24 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
3845
3901
|
job: job
|
|
3846
3902
|
});
|
|
3847
3903
|
|
|
3848
|
-
|
|
3904
|
+
_context10.next = 13;
|
|
3849
3905
|
break;
|
|
3850
3906
|
|
|
3851
3907
|
case 10:
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
console.error('onSelectStatus',
|
|
3908
|
+
_context10.prev = 10;
|
|
3909
|
+
_context10.t0 = _context10["catch"](1);
|
|
3910
|
+
console.error('onSelectStatus', _context10.t0);
|
|
3855
3911
|
|
|
3856
3912
|
case 13:
|
|
3857
3913
|
case "end":
|
|
3858
|
-
return
|
|
3914
|
+
return _context10.stop();
|
|
3859
3915
|
}
|
|
3860
3916
|
}
|
|
3861
|
-
},
|
|
3917
|
+
}, _callee10, null, [[1, 10]]);
|
|
3862
3918
|
}));
|
|
3863
3919
|
|
|
3864
3920
|
return function (_x3) {
|
|
3865
|
-
return
|
|
3921
|
+
return _ref10.apply(this, arguments);
|
|
3866
3922
|
};
|
|
3867
3923
|
}());
|
|
3868
3924
|
|
|
@@ -3880,7 +3936,9 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
3880
3936
|
noteAttachments: [],
|
|
3881
3937
|
noteInput: '',
|
|
3882
3938
|
noteImages: [],
|
|
3883
|
-
assignees: []
|
|
3939
|
+
assignees: [],
|
|
3940
|
+
externalSync: null,
|
|
3941
|
+
loadingExternalSync: false
|
|
3884
3942
|
};
|
|
3885
3943
|
return _this;
|
|
3886
3944
|
}
|
|
@@ -3899,6 +3957,7 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
3899
3957
|
this.getJob();
|
|
3900
3958
|
this.getComments();
|
|
3901
3959
|
this.getAssignees();
|
|
3960
|
+
this.getExternalSync();
|
|
3902
3961
|
}
|
|
3903
3962
|
}
|
|
3904
3963
|
}, {
|
|
@@ -4377,6 +4436,26 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
4377
4436
|
className: "statusLabel_text"
|
|
4378
4437
|
}, e.user.displayName, " assigned the ", values.textSingularName, " to ", e.assignedUser ? e.assignedUser.displayName : 'Unassigned')));
|
|
4379
4438
|
}
|
|
4439
|
+
}, {
|
|
4440
|
+
key: "renderExternalSyncEntry",
|
|
4441
|
+
value: function renderExternalSyncEntry(e, i) {
|
|
4442
|
+
var isSuccess = e.EntryType === 'ExternalIDSet';
|
|
4443
|
+
var backgroundColor = isSuccess ? Colours$1.COLOUR_GREEN : Colours$1.COLOUR_RED; // Green for success, red for failure
|
|
4444
|
+
|
|
4445
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
4446
|
+
className: "ticketHistoryEntry",
|
|
4447
|
+
key: i
|
|
4448
|
+
}, /*#__PURE__*/React.createElement("p", {
|
|
4449
|
+
className: "ticketHistoryEntry_timestamp"
|
|
4450
|
+
}, moment.utc(e.timestamp).local().format('D MMM YYYY h:mma')), /*#__PURE__*/React.createElement("div", {
|
|
4451
|
+
className: "statusLabel statusLabel-large statusLabel-full",
|
|
4452
|
+
style: {
|
|
4453
|
+
backgroundColor: backgroundColor
|
|
4454
|
+
}
|
|
4455
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
4456
|
+
className: "statusLabel_text"
|
|
4457
|
+
}, isSuccess ? "Synced to ".concat(e.externalSystem || 'external system').concat(e.externalId ? " (ID: ".concat(e.externalId, ")") : '') : "Failed to sync to external system".concat(e.error ? ": ".concat(e.error) : ''))));
|
|
4458
|
+
}
|
|
4380
4459
|
}, {
|
|
4381
4460
|
key: "renderPriority",
|
|
4382
4461
|
value: function renderPriority() {
|
|
@@ -4391,6 +4470,34 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
4391
4470
|
className: "flex-1"
|
|
4392
4471
|
}, "Priority")));
|
|
4393
4472
|
}
|
|
4473
|
+
}, {
|
|
4474
|
+
key: "renderExternalSync",
|
|
4475
|
+
value: function renderExternalSync() {
|
|
4476
|
+
var _this$state3 = this.state,
|
|
4477
|
+
externalSync = _this$state3.externalSync,
|
|
4478
|
+
loadingExternalSync = _this$state3.loadingExternalSync; // Only show if external sync data exists
|
|
4479
|
+
|
|
4480
|
+
if (!externalSync || loadingExternalSync) return null;
|
|
4481
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
4482
|
+
className: "padding-32 paddingVertical-40 bottomDivideBorder relative"
|
|
4483
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
4484
|
+
className: "newTopBar clearfix flex flex-reverse"
|
|
4485
|
+
}, /*#__PURE__*/React.createElement(Components$3.Text, {
|
|
4486
|
+
type: "formTitleSmall",
|
|
4487
|
+
className: "flex-1"
|
|
4488
|
+
}, "External Sync")), /*#__PURE__*/React.createElement("div", {
|
|
4489
|
+
className: "marginTop-16"
|
|
4490
|
+
}, externalSync.externalSystem && /*#__PURE__*/React.createElement(Components$3.Text, {
|
|
4491
|
+
type: "body",
|
|
4492
|
+
className: "marginBottom-8"
|
|
4493
|
+
}, /*#__PURE__*/React.createElement("strong", null, "System:"), " ", externalSync.externalSystem), externalSync.externalId && /*#__PURE__*/React.createElement(Components$3.Text, {
|
|
4494
|
+
type: "body",
|
|
4495
|
+
className: "marginBottom-8"
|
|
4496
|
+
}, /*#__PURE__*/React.createElement("strong", null, "External ID:"), " ", externalSync.externalId), externalSync.syncedAt && /*#__PURE__*/React.createElement(Components$3.Text, {
|
|
4497
|
+
type: "body",
|
|
4498
|
+
className: "marginBottom-8"
|
|
4499
|
+
}, /*#__PURE__*/React.createElement("strong", null, "Synced:"), " ", moment.utc(externalSync.syncedAt).local().format('D MMM YYYY h:mma'))));
|
|
4500
|
+
}
|
|
4394
4501
|
}, {
|
|
4395
4502
|
key: "renderOverview",
|
|
4396
4503
|
value: function renderOverview() {
|
|
@@ -4427,6 +4534,10 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
4427
4534
|
|
|
4428
4535
|
case 'assignment':
|
|
4429
4536
|
return _this7.renderAssignmentEntry(e, i);
|
|
4537
|
+
|
|
4538
|
+
case 'ExternalIDSet':
|
|
4539
|
+
case 'ExternalIDSetFailed':
|
|
4540
|
+
return _this7.renderExternalSyncEntry(e, i);
|
|
4430
4541
|
}
|
|
4431
4542
|
}));
|
|
4432
4543
|
}
|
|
@@ -4543,8 +4654,8 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
4543
4654
|
}), /*#__PURE__*/React.createElement("p", {
|
|
4544
4655
|
className: "iconTextButton_text"
|
|
4545
4656
|
}, "Add Attachment")), /*#__PURE__*/React.createElement(Components$3.ImageInput, {
|
|
4546
|
-
ref: function ref(
|
|
4547
|
-
_this8.imageInput =
|
|
4657
|
+
ref: function ref(_ref11) {
|
|
4658
|
+
_this8.imageInput = _ref11;
|
|
4548
4659
|
},
|
|
4549
4660
|
multiple: true,
|
|
4550
4661
|
refreshCallback: function refreshCallback(images) {
|
|
@@ -4643,7 +4754,7 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
4643
4754
|
className: "pageSectionWrapper--fixedPopupSize"
|
|
4644
4755
|
}, this.renderInner()), /*#__PURE__*/React.createElement(Components$3.OverlayPageSection, {
|
|
4645
4756
|
className: "pageSectionWrapper--newPopupSide pageSectionWrapper--newPopupSide-fixedWidth"
|
|
4646
|
-
}, this.renderAssignment(), this.renderPriority(), this.renderOverview())), /*#__PURE__*/React.createElement(Components$3.OverlayPageBottomButtons, null, this.renderButtons()));
|
|
4757
|
+
}, this.renderAssignment(), this.renderPriority(), this.renderExternalSync(), this.renderOverview())), /*#__PURE__*/React.createElement(Components$3.OverlayPageBottomButtons, null, this.renderButtons()));
|
|
4647
4758
|
}
|
|
4648
4759
|
}]);
|
|
4649
4760
|
|