@plusscommunities/pluss-maintenance-web-a 1.1.27 → 1.1.29
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 +201 -91
- package/dist/index.esm.js +201 -91
- package/dist/index.umd.js +201 -91
- package/package.json +1 -1
- package/src/apis/maintenanceActions.js +6 -0
- package/src/screens/Job.js +73 -0
package/dist/index.cjs.js
CHANGED
|
@@ -487,6 +487,14 @@ var maintenanceActions = {
|
|
|
487
487
|
id: id
|
|
488
488
|
}
|
|
489
489
|
});
|
|
490
|
+
},
|
|
491
|
+
getExternalSync: function getExternalSync(jobId) {
|
|
492
|
+
return Session$9.authedFunction({
|
|
493
|
+
method: 'GET',
|
|
494
|
+
url: Helper$5.getUrl(values.serviceKey, 'get/externalsync', {
|
|
495
|
+
id: jobId
|
|
496
|
+
})
|
|
497
|
+
});
|
|
490
498
|
}
|
|
491
499
|
};
|
|
492
500
|
|
|
@@ -3353,6 +3361,53 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
3353
3361
|
}, _callee2, null, [[0, 7]]);
|
|
3354
3362
|
})));
|
|
3355
3363
|
|
|
3364
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "getExternalSync", /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3() {
|
|
3365
|
+
var res;
|
|
3366
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
|
3367
|
+
while (1) {
|
|
3368
|
+
switch (_context3.prev = _context3.next) {
|
|
3369
|
+
case 0:
|
|
3370
|
+
_context3.prev = 0;
|
|
3371
|
+
|
|
3372
|
+
_this.setState({
|
|
3373
|
+
loadingExternalSync: true
|
|
3374
|
+
});
|
|
3375
|
+
|
|
3376
|
+
_context3.next = 4;
|
|
3377
|
+
return maintenanceActions.getExternalSync(_this.state.jobId);
|
|
3378
|
+
|
|
3379
|
+
case 4:
|
|
3380
|
+
res = _context3.sent;
|
|
3381
|
+
|
|
3382
|
+
_this.setState({
|
|
3383
|
+
externalSync: res.data,
|
|
3384
|
+
loadingExternalSync: false
|
|
3385
|
+
});
|
|
3386
|
+
|
|
3387
|
+
_context3.next = 12;
|
|
3388
|
+
break;
|
|
3389
|
+
|
|
3390
|
+
case 8:
|
|
3391
|
+
_context3.prev = 8;
|
|
3392
|
+
_context3.t0 = _context3["catch"](0);
|
|
3393
|
+
|
|
3394
|
+
// 404 is expected if no sync - don't show error
|
|
3395
|
+
if (_context3.t0 && _context3.t0.response && _context3.t0.response.status !== 404) {
|
|
3396
|
+
console.error('getExternalSync', _context3.t0);
|
|
3397
|
+
}
|
|
3398
|
+
|
|
3399
|
+
_this.setState({
|
|
3400
|
+
loadingExternalSync: false
|
|
3401
|
+
});
|
|
3402
|
+
|
|
3403
|
+
case 12:
|
|
3404
|
+
case "end":
|
|
3405
|
+
return _context3.stop();
|
|
3406
|
+
}
|
|
3407
|
+
}
|
|
3408
|
+
}, _callee3, null, [[0, 8]]);
|
|
3409
|
+
})));
|
|
3410
|
+
|
|
3356
3411
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "getStatusType", function (status) {
|
|
3357
3412
|
var statusTypes = _this.props.statusTypes;
|
|
3358
3413
|
var statusType = statusTypes.find(function (s) {
|
|
@@ -3518,35 +3573,35 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
3518
3573
|
});
|
|
3519
3574
|
});
|
|
3520
3575
|
|
|
3521
|
-
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onConfirmAssignee", /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3522
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3576
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onConfirmAssignee", /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee4() {
|
|
3577
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee4$(_context4) {
|
|
3523
3578
|
while (1) {
|
|
3524
|
-
switch (
|
|
3579
|
+
switch (_context4.prev = _context4.next) {
|
|
3525
3580
|
case 0:
|
|
3526
3581
|
_this.setState({
|
|
3527
3582
|
confirmingAssignee: true
|
|
3528
3583
|
});
|
|
3529
3584
|
|
|
3530
|
-
|
|
3585
|
+
_context4.prev = 1;
|
|
3531
3586
|
|
|
3532
3587
|
if (!_this.state.selectedAssignee) {
|
|
3533
|
-
|
|
3588
|
+
_context4.next = 5;
|
|
3534
3589
|
break;
|
|
3535
3590
|
}
|
|
3536
3591
|
|
|
3537
|
-
|
|
3592
|
+
_context4.next = 5;
|
|
3538
3593
|
return _this.onAssignUser(_this.state.selectedAssignee.id);
|
|
3539
3594
|
|
|
3540
3595
|
case 5:
|
|
3541
3596
|
_this.onCloseSelectAssignee();
|
|
3542
3597
|
|
|
3543
|
-
|
|
3598
|
+
_context4.next = 11;
|
|
3544
3599
|
break;
|
|
3545
3600
|
|
|
3546
3601
|
case 8:
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
console.error('onConfirmAssignee',
|
|
3602
|
+
_context4.prev = 8;
|
|
3603
|
+
_context4.t0 = _context4["catch"](1);
|
|
3604
|
+
console.error('onConfirmAssignee', _context4.t0);
|
|
3550
3605
|
|
|
3551
3606
|
case 11:
|
|
3552
3607
|
_this.setState({
|
|
@@ -3555,68 +3610,68 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
3555
3610
|
|
|
3556
3611
|
case 12:
|
|
3557
3612
|
case "end":
|
|
3558
|
-
return
|
|
3613
|
+
return _context4.stop();
|
|
3559
3614
|
}
|
|
3560
3615
|
}
|
|
3561
|
-
},
|
|
3616
|
+
}, _callee4, null, [[1, 8]]);
|
|
3562
3617
|
})));
|
|
3563
3618
|
|
|
3564
3619
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onAssignUser", /*#__PURE__*/function () {
|
|
3565
|
-
var
|
|
3566
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3620
|
+
var _ref5 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee5(userId) {
|
|
3621
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee5$(_context5) {
|
|
3567
3622
|
while (1) {
|
|
3568
|
-
switch (
|
|
3623
|
+
switch (_context5.prev = _context5.next) {
|
|
3569
3624
|
case 0:
|
|
3570
|
-
|
|
3571
|
-
|
|
3625
|
+
_context5.prev = 0;
|
|
3626
|
+
_context5.next = 3;
|
|
3572
3627
|
return maintenanceActions.assignJob(_this.state.jobId, userId);
|
|
3573
3628
|
|
|
3574
3629
|
case 3:
|
|
3575
3630
|
|
|
3576
3631
|
_this.getJob();
|
|
3577
3632
|
|
|
3578
|
-
|
|
3633
|
+
_context5.next = 10;
|
|
3579
3634
|
break;
|
|
3580
3635
|
|
|
3581
3636
|
case 7:
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
console.error('onAssignUser',
|
|
3637
|
+
_context5.prev = 7;
|
|
3638
|
+
_context5.t0 = _context5["catch"](0);
|
|
3639
|
+
console.error('onAssignUser', _context5.t0);
|
|
3585
3640
|
|
|
3586
3641
|
case 10:
|
|
3587
3642
|
case "end":
|
|
3588
|
-
return
|
|
3643
|
+
return _context5.stop();
|
|
3589
3644
|
}
|
|
3590
3645
|
}
|
|
3591
|
-
},
|
|
3646
|
+
}, _callee5, null, [[0, 7]]);
|
|
3592
3647
|
}));
|
|
3593
3648
|
|
|
3594
3649
|
return function (_x) {
|
|
3595
|
-
return
|
|
3650
|
+
return _ref5.apply(this, arguments);
|
|
3596
3651
|
};
|
|
3597
3652
|
}());
|
|
3598
3653
|
|
|
3599
|
-
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onConfirmAddNote", /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3654
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onConfirmAddNote", /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee6() {
|
|
3600
3655
|
var res;
|
|
3601
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3656
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee6$(_context6) {
|
|
3602
3657
|
while (1) {
|
|
3603
|
-
switch (
|
|
3658
|
+
switch (_context6.prev = _context6.next) {
|
|
3604
3659
|
case 0:
|
|
3605
3660
|
if (_this.isReadyToSaveNote()) {
|
|
3606
|
-
|
|
3661
|
+
_context6.next = 2;
|
|
3607
3662
|
break;
|
|
3608
3663
|
}
|
|
3609
3664
|
|
|
3610
|
-
return
|
|
3665
|
+
return _context6.abrupt("return");
|
|
3611
3666
|
|
|
3612
3667
|
case 2:
|
|
3613
|
-
|
|
3668
|
+
_context6.prev = 2;
|
|
3614
3669
|
|
|
3615
3670
|
_this.setState({
|
|
3616
3671
|
submittingNote: true
|
|
3617
3672
|
});
|
|
3618
3673
|
|
|
3619
|
-
|
|
3674
|
+
_context6.next = 6;
|
|
3620
3675
|
return _this.state.editingNote ? maintenanceActions.editNote(_this.state.jobId, _this.state.editingNote, _this.state.noteInput, _this.state.noteAttachments.map(function (a) {
|
|
3621
3676
|
return {
|
|
3622
3677
|
Title: a.Title,
|
|
@@ -3630,7 +3685,7 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
3630
3685
|
}), _this.state.noteImages);
|
|
3631
3686
|
|
|
3632
3687
|
case 6:
|
|
3633
|
-
res =
|
|
3688
|
+
res = _context6.sent;
|
|
3634
3689
|
|
|
3635
3690
|
_this.setState({
|
|
3636
3691
|
job: res.data.job,
|
|
@@ -3644,20 +3699,20 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
3644
3699
|
_this.props.jobsLoaded([_this.state.job]);
|
|
3645
3700
|
});
|
|
3646
3701
|
|
|
3647
|
-
|
|
3702
|
+
_context6.next = 13;
|
|
3648
3703
|
break;
|
|
3649
3704
|
|
|
3650
3705
|
case 10:
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
console.error('onConfirmAddNote',
|
|
3706
|
+
_context6.prev = 10;
|
|
3707
|
+
_context6.t0 = _context6["catch"](2);
|
|
3708
|
+
console.error('onConfirmAddNote', _context6.t0);
|
|
3654
3709
|
|
|
3655
3710
|
case 13:
|
|
3656
3711
|
case "end":
|
|
3657
|
-
return
|
|
3712
|
+
return _context6.stop();
|
|
3658
3713
|
}
|
|
3659
3714
|
}
|
|
3660
|
-
},
|
|
3715
|
+
}, _callee6, null, [[2, 10]]);
|
|
3661
3716
|
})));
|
|
3662
3717
|
|
|
3663
3718
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onDeleteNote", function (n) {
|
|
@@ -3705,42 +3760,42 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
3705
3760
|
|
|
3706
3761
|
_this.setState({
|
|
3707
3762
|
updating: true
|
|
3708
|
-
}, /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3763
|
+
}, /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee7() {
|
|
3709
3764
|
var update;
|
|
3710
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3765
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee7$(_context7) {
|
|
3711
3766
|
while (1) {
|
|
3712
|
-
switch (
|
|
3767
|
+
switch (_context7.prev = _context7.next) {
|
|
3713
3768
|
case 0:
|
|
3714
|
-
|
|
3769
|
+
_context7.prev = 0;
|
|
3715
3770
|
update = {
|
|
3716
3771
|
id: job.id,
|
|
3717
3772
|
seen: true,
|
|
3718
3773
|
status: job.status || 'Unassigned'
|
|
3719
3774
|
};
|
|
3720
|
-
|
|
3775
|
+
_context7.next = 4;
|
|
3721
3776
|
return maintenanceActions.editJob(update, auth.site);
|
|
3722
3777
|
|
|
3723
3778
|
case 4:
|
|
3724
|
-
|
|
3779
|
+
_context7.next = 11;
|
|
3725
3780
|
break;
|
|
3726
3781
|
|
|
3727
3782
|
case 6:
|
|
3728
|
-
|
|
3729
|
-
|
|
3783
|
+
_context7.prev = 6;
|
|
3784
|
+
_context7.t0 = _context7["catch"](0);
|
|
3730
3785
|
|
|
3731
3786
|
_this.setState({
|
|
3732
3787
|
updating: false
|
|
3733
3788
|
});
|
|
3734
3789
|
|
|
3735
|
-
console.log('markSeen error',
|
|
3790
|
+
console.log('markSeen error', _context7.t0);
|
|
3736
3791
|
alert('Something went wrong with the request. Please try again.');
|
|
3737
3792
|
|
|
3738
3793
|
case 11:
|
|
3739
3794
|
case "end":
|
|
3740
|
-
return
|
|
3795
|
+
return _context7.stop();
|
|
3741
3796
|
}
|
|
3742
3797
|
}
|
|
3743
|
-
},
|
|
3798
|
+
}, _callee7, null, [[0, 6]]);
|
|
3744
3799
|
})));
|
|
3745
3800
|
});
|
|
3746
3801
|
|
|
@@ -3752,44 +3807,44 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
3752
3807
|
});
|
|
3753
3808
|
});
|
|
3754
3809
|
|
|
3755
|
-
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onAddComment", /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3810
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onAddComment", /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee8() {
|
|
3756
3811
|
var _this$state2, commentInput, jobId, job, comments, res;
|
|
3757
3812
|
|
|
3758
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3813
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee8$(_context8) {
|
|
3759
3814
|
while (1) {
|
|
3760
|
-
switch (
|
|
3815
|
+
switch (_context8.prev = _context8.next) {
|
|
3761
3816
|
case 0:
|
|
3762
3817
|
_this$state2 = _this.state, commentInput = _this$state2.commentInput, jobId = _this$state2.jobId, job = _this$state2.job, comments = _this$state2.comments;
|
|
3763
|
-
|
|
3818
|
+
_context8.prev = 1;
|
|
3764
3819
|
|
|
3765
3820
|
_this.setState({
|
|
3766
3821
|
commentInput: ''
|
|
3767
3822
|
});
|
|
3768
3823
|
|
|
3769
|
-
|
|
3824
|
+
_context8.next = 5;
|
|
3770
3825
|
return reactionActions.addComment(jobId, values.commentKey, job.title, job.site, commentInput);
|
|
3771
3826
|
|
|
3772
3827
|
case 5:
|
|
3773
|
-
res =
|
|
3828
|
+
res = _context8.sent;
|
|
3774
3829
|
|
|
3775
3830
|
_this.setState({
|
|
3776
3831
|
comments: [].concat(_toConsumableArray__default['default'](comments), [res.data])
|
|
3777
3832
|
});
|
|
3778
3833
|
|
|
3779
|
-
|
|
3834
|
+
_context8.next = 12;
|
|
3780
3835
|
break;
|
|
3781
3836
|
|
|
3782
3837
|
case 9:
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
console.error('onAddComment',
|
|
3838
|
+
_context8.prev = 9;
|
|
3839
|
+
_context8.t0 = _context8["catch"](1);
|
|
3840
|
+
console.error('onAddComment', _context8.t0);
|
|
3786
3841
|
|
|
3787
3842
|
case 12:
|
|
3788
3843
|
case "end":
|
|
3789
|
-
return
|
|
3844
|
+
return _context8.stop();
|
|
3790
3845
|
}
|
|
3791
3846
|
}
|
|
3792
|
-
},
|
|
3847
|
+
}, _callee8, null, [[1, 9]]);
|
|
3793
3848
|
})));
|
|
3794
3849
|
|
|
3795
3850
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onHandleChange", function (event) {
|
|
@@ -3806,11 +3861,11 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
3806
3861
|
});
|
|
3807
3862
|
|
|
3808
3863
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onSelectPriority", /*#__PURE__*/function () {
|
|
3809
|
-
var
|
|
3864
|
+
var _ref9 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee9(priority) {
|
|
3810
3865
|
var res, job;
|
|
3811
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3866
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee9$(_context9) {
|
|
3812
3867
|
while (1) {
|
|
3813
|
-
switch (
|
|
3868
|
+
switch (_context9.prev = _context9.next) {
|
|
3814
3869
|
case 0:
|
|
3815
3870
|
_this.setState({
|
|
3816
3871
|
job: _objectSpread$4(_objectSpread$4({}, _this.state.job), {}, {
|
|
@@ -3819,12 +3874,12 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
3819
3874
|
priorityChangerOpen: false
|
|
3820
3875
|
});
|
|
3821
3876
|
|
|
3822
|
-
|
|
3823
|
-
|
|
3877
|
+
_context9.prev = 1;
|
|
3878
|
+
_context9.next = 4;
|
|
3824
3879
|
return maintenanceActions.editJobPriority(_this.state.job.id, priority);
|
|
3825
3880
|
|
|
3826
3881
|
case 4:
|
|
3827
|
-
res =
|
|
3882
|
+
res = _context9.sent;
|
|
3828
3883
|
job = res.data.job;
|
|
3829
3884
|
|
|
3830
3885
|
_this.props.jobsLoaded([job]);
|
|
@@ -3833,24 +3888,24 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
3833
3888
|
job: job
|
|
3834
3889
|
});
|
|
3835
3890
|
|
|
3836
|
-
|
|
3891
|
+
_context9.next = 13;
|
|
3837
3892
|
break;
|
|
3838
3893
|
|
|
3839
3894
|
case 10:
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
console.error('onSelectPriority',
|
|
3895
|
+
_context9.prev = 10;
|
|
3896
|
+
_context9.t0 = _context9["catch"](1);
|
|
3897
|
+
console.error('onSelectPriority', _context9.t0);
|
|
3843
3898
|
|
|
3844
3899
|
case 13:
|
|
3845
3900
|
case "end":
|
|
3846
|
-
return
|
|
3901
|
+
return _context9.stop();
|
|
3847
3902
|
}
|
|
3848
3903
|
}
|
|
3849
|
-
},
|
|
3904
|
+
}, _callee9, null, [[1, 10]]);
|
|
3850
3905
|
}));
|
|
3851
3906
|
|
|
3852
3907
|
return function (_x2) {
|
|
3853
|
-
return
|
|
3908
|
+
return _ref9.apply(this, arguments);
|
|
3854
3909
|
};
|
|
3855
3910
|
}());
|
|
3856
3911
|
|
|
@@ -3861,11 +3916,11 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
3861
3916
|
});
|
|
3862
3917
|
|
|
3863
3918
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onSelectStatus", /*#__PURE__*/function () {
|
|
3864
|
-
var
|
|
3919
|
+
var _ref10 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee10(status) {
|
|
3865
3920
|
var res, job;
|
|
3866
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3921
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee10$(_context10) {
|
|
3867
3922
|
while (1) {
|
|
3868
|
-
switch (
|
|
3923
|
+
switch (_context10.prev = _context10.next) {
|
|
3869
3924
|
case 0:
|
|
3870
3925
|
_this.setState({
|
|
3871
3926
|
job: _objectSpread$4(_objectSpread$4({}, _this.state.job), {}, {
|
|
@@ -3874,12 +3929,12 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
3874
3929
|
statusChangerOpen: false
|
|
3875
3930
|
});
|
|
3876
3931
|
|
|
3877
|
-
|
|
3878
|
-
|
|
3932
|
+
_context10.prev = 1;
|
|
3933
|
+
_context10.next = 4;
|
|
3879
3934
|
return maintenanceActions.editJobStatus(_this.state.job.id, status);
|
|
3880
3935
|
|
|
3881
3936
|
case 4:
|
|
3882
|
-
res =
|
|
3937
|
+
res = _context10.sent;
|
|
3883
3938
|
job = res.data.job;
|
|
3884
3939
|
|
|
3885
3940
|
_this.props.jobsLoaded([job]);
|
|
@@ -3888,24 +3943,24 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
3888
3943
|
job: job
|
|
3889
3944
|
});
|
|
3890
3945
|
|
|
3891
|
-
|
|
3946
|
+
_context10.next = 13;
|
|
3892
3947
|
break;
|
|
3893
3948
|
|
|
3894
3949
|
case 10:
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
console.error('onSelectStatus',
|
|
3950
|
+
_context10.prev = 10;
|
|
3951
|
+
_context10.t0 = _context10["catch"](1);
|
|
3952
|
+
console.error('onSelectStatus', _context10.t0);
|
|
3898
3953
|
|
|
3899
3954
|
case 13:
|
|
3900
3955
|
case "end":
|
|
3901
|
-
return
|
|
3956
|
+
return _context10.stop();
|
|
3902
3957
|
}
|
|
3903
3958
|
}
|
|
3904
|
-
},
|
|
3959
|
+
}, _callee10, null, [[1, 10]]);
|
|
3905
3960
|
}));
|
|
3906
3961
|
|
|
3907
3962
|
return function (_x3) {
|
|
3908
|
-
return
|
|
3963
|
+
return _ref10.apply(this, arguments);
|
|
3909
3964
|
};
|
|
3910
3965
|
}());
|
|
3911
3966
|
|
|
@@ -3923,7 +3978,9 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
3923
3978
|
noteAttachments: [],
|
|
3924
3979
|
noteInput: '',
|
|
3925
3980
|
noteImages: [],
|
|
3926
|
-
assignees: []
|
|
3981
|
+
assignees: [],
|
|
3982
|
+
externalSync: null,
|
|
3983
|
+
loadingExternalSync: false
|
|
3927
3984
|
};
|
|
3928
3985
|
return _this;
|
|
3929
3986
|
}
|
|
@@ -3942,6 +3999,7 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
3942
3999
|
this.getJob();
|
|
3943
4000
|
this.getComments();
|
|
3944
4001
|
this.getAssignees();
|
|
4002
|
+
this.getExternalSync();
|
|
3945
4003
|
}
|
|
3946
4004
|
}
|
|
3947
4005
|
}, {
|
|
@@ -4420,6 +4478,26 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
4420
4478
|
className: "statusLabel_text"
|
|
4421
4479
|
}, e.user.displayName, " assigned the ", values.textSingularName, " to ", e.assignedUser ? e.assignedUser.displayName : 'Unassigned')));
|
|
4422
4480
|
}
|
|
4481
|
+
}, {
|
|
4482
|
+
key: "renderExternalSyncEntry",
|
|
4483
|
+
value: function renderExternalSyncEntry(e, i) {
|
|
4484
|
+
var isSuccess = e.EntryType === 'ExternalIDSet';
|
|
4485
|
+
var backgroundColor = isSuccess ? Colours$1.COLOUR_GREEN : Colours$1.COLOUR_RED; // Green for success, red for failure
|
|
4486
|
+
|
|
4487
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
4488
|
+
className: "ticketHistoryEntry",
|
|
4489
|
+
key: i
|
|
4490
|
+
}, /*#__PURE__*/React__default['default'].createElement("p", {
|
|
4491
|
+
className: "ticketHistoryEntry_timestamp"
|
|
4492
|
+
}, moment__default['default'].utc(e.timestamp).local().format('D MMM YYYY h:mma')), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
4493
|
+
className: "statusLabel statusLabel-large statusLabel-full",
|
|
4494
|
+
style: {
|
|
4495
|
+
backgroundColor: backgroundColor
|
|
4496
|
+
}
|
|
4497
|
+
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
4498
|
+
className: "statusLabel_text"
|
|
4499
|
+
}, isSuccess ? "Synced to ".concat(e.systemType || 'external system').concat(e.externalId ? " (ID: ".concat(e.externalId, ")") : '') : "Failed to sync to ".concat(e.systemType || 'external system').concat(e.error ? ": ".concat(e.error) : ''))));
|
|
4500
|
+
}
|
|
4423
4501
|
}, {
|
|
4424
4502
|
key: "renderPriority",
|
|
4425
4503
|
value: function renderPriority() {
|
|
@@ -4434,6 +4512,34 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
4434
4512
|
className: "flex-1"
|
|
4435
4513
|
}, "Priority")));
|
|
4436
4514
|
}
|
|
4515
|
+
}, {
|
|
4516
|
+
key: "renderExternalSync",
|
|
4517
|
+
value: function renderExternalSync() {
|
|
4518
|
+
var _this$state3 = this.state,
|
|
4519
|
+
externalSync = _this$state3.externalSync,
|
|
4520
|
+
loadingExternalSync = _this$state3.loadingExternalSync; // Only show if external sync data exists
|
|
4521
|
+
|
|
4522
|
+
if (!externalSync || loadingExternalSync) return null;
|
|
4523
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
4524
|
+
className: "padding-32 paddingVertical-40 bottomDivideBorder relative"
|
|
4525
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
4526
|
+
className: "newTopBar clearfix flex flex-reverse"
|
|
4527
|
+
}, /*#__PURE__*/React__default['default'].createElement(Components$3.Text, {
|
|
4528
|
+
type: "formTitleSmall",
|
|
4529
|
+
className: "flex-1"
|
|
4530
|
+
}, "External Sync")), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
4531
|
+
className: "marginTop-16"
|
|
4532
|
+
}, externalSync.systemType && /*#__PURE__*/React__default['default'].createElement(Components$3.Text, {
|
|
4533
|
+
type: "body",
|
|
4534
|
+
className: "marginBottom-8"
|
|
4535
|
+
}, /*#__PURE__*/React__default['default'].createElement("strong", null, "System:"), " ", externalSync.systemType), externalSync.externalId && /*#__PURE__*/React__default['default'].createElement(Components$3.Text, {
|
|
4536
|
+
type: "body",
|
|
4537
|
+
className: "marginBottom-8"
|
|
4538
|
+
}, /*#__PURE__*/React__default['default'].createElement("strong", null, "External ID:"), " ", externalSync.externalId), externalSync.syncedAt && /*#__PURE__*/React__default['default'].createElement(Components$3.Text, {
|
|
4539
|
+
type: "body",
|
|
4540
|
+
className: "marginBottom-8"
|
|
4541
|
+
}, /*#__PURE__*/React__default['default'].createElement("strong", null, "Synced:"), " ", moment__default['default'].utc(externalSync.syncedAt).local().format('D MMM YYYY h:mma'))));
|
|
4542
|
+
}
|
|
4437
4543
|
}, {
|
|
4438
4544
|
key: "renderOverview",
|
|
4439
4545
|
value: function renderOverview() {
|
|
@@ -4470,6 +4576,10 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
4470
4576
|
|
|
4471
4577
|
case 'assignment':
|
|
4472
4578
|
return _this7.renderAssignmentEntry(e, i);
|
|
4579
|
+
|
|
4580
|
+
case 'ExternalIDSet':
|
|
4581
|
+
case 'ExternalIDSetFailed':
|
|
4582
|
+
return _this7.renderExternalSyncEntry(e, i);
|
|
4473
4583
|
}
|
|
4474
4584
|
}));
|
|
4475
4585
|
}
|
|
@@ -4586,8 +4696,8 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
4586
4696
|
}), /*#__PURE__*/React__default['default'].createElement("p", {
|
|
4587
4697
|
className: "iconTextButton_text"
|
|
4588
4698
|
}, "Add Attachment")), /*#__PURE__*/React__default['default'].createElement(Components$3.ImageInput, {
|
|
4589
|
-
ref: function ref(
|
|
4590
|
-
_this8.imageInput =
|
|
4699
|
+
ref: function ref(_ref11) {
|
|
4700
|
+
_this8.imageInput = _ref11;
|
|
4591
4701
|
},
|
|
4592
4702
|
multiple: true,
|
|
4593
4703
|
refreshCallback: function refreshCallback(images) {
|
|
@@ -4686,7 +4796,7 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
4686
4796
|
className: "pageSectionWrapper--fixedPopupSize"
|
|
4687
4797
|
}, this.renderInner()), /*#__PURE__*/React__default['default'].createElement(Components$3.OverlayPageSection, {
|
|
4688
4798
|
className: "pageSectionWrapper--newPopupSide pageSectionWrapper--newPopupSide-fixedWidth"
|
|
4689
|
-
}, this.renderAssignment(), this.renderPriority(), this.renderOverview())), /*#__PURE__*/React__default['default'].createElement(Components$3.OverlayPageBottomButtons, null, this.renderButtons()));
|
|
4799
|
+
}, this.renderAssignment(), this.renderPriority(), this.renderExternalSync(), this.renderOverview())), /*#__PURE__*/React__default['default'].createElement(Components$3.OverlayPageBottomButtons, null, this.renderButtons()));
|
|
4690
4800
|
}
|
|
4691
4801
|
}]);
|
|
4692
4802
|
|