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