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