@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.umd.js
CHANGED
|
@@ -466,6 +466,14 @@
|
|
|
466
466
|
id: id
|
|
467
467
|
}
|
|
468
468
|
});
|
|
469
|
+
},
|
|
470
|
+
getExternalSync: function getExternalSync(jobId) {
|
|
471
|
+
return Session$9.authedFunction({
|
|
472
|
+
method: 'GET',
|
|
473
|
+
url: Helper$5.getUrl(values.serviceKey, 'get/externalsync', {
|
|
474
|
+
id: jobId
|
|
475
|
+
})
|
|
476
|
+
});
|
|
469
477
|
}
|
|
470
478
|
};
|
|
471
479
|
|
|
@@ -3332,6 +3340,54 @@
|
|
|
3332
3340
|
}, _callee2, null, [[0, 7]]);
|
|
3333
3341
|
})));
|
|
3334
3342
|
|
|
3343
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "getExternalSync", /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3() {
|
|
3344
|
+
var res, _error$response;
|
|
3345
|
+
|
|
3346
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
|
3347
|
+
while (1) {
|
|
3348
|
+
switch (_context3.prev = _context3.next) {
|
|
3349
|
+
case 0:
|
|
3350
|
+
_context3.prev = 0;
|
|
3351
|
+
|
|
3352
|
+
_this.setState({
|
|
3353
|
+
loadingExternalSync: true
|
|
3354
|
+
});
|
|
3355
|
+
|
|
3356
|
+
_context3.next = 4;
|
|
3357
|
+
return maintenanceActions.getExternalSync(_this.state.jobId);
|
|
3358
|
+
|
|
3359
|
+
case 4:
|
|
3360
|
+
res = _context3.sent;
|
|
3361
|
+
|
|
3362
|
+
_this.setState({
|
|
3363
|
+
externalSync: res.data,
|
|
3364
|
+
loadingExternalSync: false
|
|
3365
|
+
});
|
|
3366
|
+
|
|
3367
|
+
_context3.next = 12;
|
|
3368
|
+
break;
|
|
3369
|
+
|
|
3370
|
+
case 8:
|
|
3371
|
+
_context3.prev = 8;
|
|
3372
|
+
_context3.t0 = _context3["catch"](0);
|
|
3373
|
+
|
|
3374
|
+
// 404 is expected if no sync - don't show error
|
|
3375
|
+
if (((_error$response = _context3.t0.response) === null || _error$response === void 0 ? void 0 : _error$response.status) !== 404) {
|
|
3376
|
+
console.error('getExternalSync', _context3.t0);
|
|
3377
|
+
}
|
|
3378
|
+
|
|
3379
|
+
_this.setState({
|
|
3380
|
+
loadingExternalSync: false
|
|
3381
|
+
});
|
|
3382
|
+
|
|
3383
|
+
case 12:
|
|
3384
|
+
case "end":
|
|
3385
|
+
return _context3.stop();
|
|
3386
|
+
}
|
|
3387
|
+
}
|
|
3388
|
+
}, _callee3, null, [[0, 8]]);
|
|
3389
|
+
})));
|
|
3390
|
+
|
|
3335
3391
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "getStatusType", function (status) {
|
|
3336
3392
|
var statusTypes = _this.props.statusTypes;
|
|
3337
3393
|
var statusType = statusTypes.find(function (s) {
|
|
@@ -3497,35 +3553,35 @@
|
|
|
3497
3553
|
});
|
|
3498
3554
|
});
|
|
3499
3555
|
|
|
3500
|
-
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onConfirmAssignee", /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3501
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3556
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onConfirmAssignee", /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee4() {
|
|
3557
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee4$(_context4) {
|
|
3502
3558
|
while (1) {
|
|
3503
|
-
switch (
|
|
3559
|
+
switch (_context4.prev = _context4.next) {
|
|
3504
3560
|
case 0:
|
|
3505
3561
|
_this.setState({
|
|
3506
3562
|
confirmingAssignee: true
|
|
3507
3563
|
});
|
|
3508
3564
|
|
|
3509
|
-
|
|
3565
|
+
_context4.prev = 1;
|
|
3510
3566
|
|
|
3511
3567
|
if (!_this.state.selectedAssignee) {
|
|
3512
|
-
|
|
3568
|
+
_context4.next = 5;
|
|
3513
3569
|
break;
|
|
3514
3570
|
}
|
|
3515
3571
|
|
|
3516
|
-
|
|
3572
|
+
_context4.next = 5;
|
|
3517
3573
|
return _this.onAssignUser(_this.state.selectedAssignee.id);
|
|
3518
3574
|
|
|
3519
3575
|
case 5:
|
|
3520
3576
|
_this.onCloseSelectAssignee();
|
|
3521
3577
|
|
|
3522
|
-
|
|
3578
|
+
_context4.next = 11;
|
|
3523
3579
|
break;
|
|
3524
3580
|
|
|
3525
3581
|
case 8:
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
console.error('onConfirmAssignee',
|
|
3582
|
+
_context4.prev = 8;
|
|
3583
|
+
_context4.t0 = _context4["catch"](1);
|
|
3584
|
+
console.error('onConfirmAssignee', _context4.t0);
|
|
3529
3585
|
|
|
3530
3586
|
case 11:
|
|
3531
3587
|
_this.setState({
|
|
@@ -3534,68 +3590,68 @@
|
|
|
3534
3590
|
|
|
3535
3591
|
case 12:
|
|
3536
3592
|
case "end":
|
|
3537
|
-
return
|
|
3593
|
+
return _context4.stop();
|
|
3538
3594
|
}
|
|
3539
3595
|
}
|
|
3540
|
-
},
|
|
3596
|
+
}, _callee4, null, [[1, 8]]);
|
|
3541
3597
|
})));
|
|
3542
3598
|
|
|
3543
3599
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onAssignUser", /*#__PURE__*/function () {
|
|
3544
|
-
var
|
|
3545
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3600
|
+
var _ref5 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee5(userId) {
|
|
3601
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee5$(_context5) {
|
|
3546
3602
|
while (1) {
|
|
3547
|
-
switch (
|
|
3603
|
+
switch (_context5.prev = _context5.next) {
|
|
3548
3604
|
case 0:
|
|
3549
|
-
|
|
3550
|
-
|
|
3605
|
+
_context5.prev = 0;
|
|
3606
|
+
_context5.next = 3;
|
|
3551
3607
|
return maintenanceActions.assignJob(_this.state.jobId, userId);
|
|
3552
3608
|
|
|
3553
3609
|
case 3:
|
|
3554
3610
|
|
|
3555
3611
|
_this.getJob();
|
|
3556
3612
|
|
|
3557
|
-
|
|
3613
|
+
_context5.next = 10;
|
|
3558
3614
|
break;
|
|
3559
3615
|
|
|
3560
3616
|
case 7:
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
console.error('onAssignUser',
|
|
3617
|
+
_context5.prev = 7;
|
|
3618
|
+
_context5.t0 = _context5["catch"](0);
|
|
3619
|
+
console.error('onAssignUser', _context5.t0);
|
|
3564
3620
|
|
|
3565
3621
|
case 10:
|
|
3566
3622
|
case "end":
|
|
3567
|
-
return
|
|
3623
|
+
return _context5.stop();
|
|
3568
3624
|
}
|
|
3569
3625
|
}
|
|
3570
|
-
},
|
|
3626
|
+
}, _callee5, null, [[0, 7]]);
|
|
3571
3627
|
}));
|
|
3572
3628
|
|
|
3573
3629
|
return function (_x) {
|
|
3574
|
-
return
|
|
3630
|
+
return _ref5.apply(this, arguments);
|
|
3575
3631
|
};
|
|
3576
3632
|
}());
|
|
3577
3633
|
|
|
3578
|
-
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onConfirmAddNote", /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3634
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onConfirmAddNote", /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee6() {
|
|
3579
3635
|
var res;
|
|
3580
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3636
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee6$(_context6) {
|
|
3581
3637
|
while (1) {
|
|
3582
|
-
switch (
|
|
3638
|
+
switch (_context6.prev = _context6.next) {
|
|
3583
3639
|
case 0:
|
|
3584
3640
|
if (_this.isReadyToSaveNote()) {
|
|
3585
|
-
|
|
3641
|
+
_context6.next = 2;
|
|
3586
3642
|
break;
|
|
3587
3643
|
}
|
|
3588
3644
|
|
|
3589
|
-
return
|
|
3645
|
+
return _context6.abrupt("return");
|
|
3590
3646
|
|
|
3591
3647
|
case 2:
|
|
3592
|
-
|
|
3648
|
+
_context6.prev = 2;
|
|
3593
3649
|
|
|
3594
3650
|
_this.setState({
|
|
3595
3651
|
submittingNote: true
|
|
3596
3652
|
});
|
|
3597
3653
|
|
|
3598
|
-
|
|
3654
|
+
_context6.next = 6;
|
|
3599
3655
|
return _this.state.editingNote ? maintenanceActions.editNote(_this.state.jobId, _this.state.editingNote, _this.state.noteInput, _this.state.noteAttachments.map(function (a) {
|
|
3600
3656
|
return {
|
|
3601
3657
|
Title: a.Title,
|
|
@@ -3609,7 +3665,7 @@
|
|
|
3609
3665
|
}), _this.state.noteImages);
|
|
3610
3666
|
|
|
3611
3667
|
case 6:
|
|
3612
|
-
res =
|
|
3668
|
+
res = _context6.sent;
|
|
3613
3669
|
|
|
3614
3670
|
_this.setState({
|
|
3615
3671
|
job: res.data.job,
|
|
@@ -3623,20 +3679,20 @@
|
|
|
3623
3679
|
_this.props.jobsLoaded([_this.state.job]);
|
|
3624
3680
|
});
|
|
3625
3681
|
|
|
3626
|
-
|
|
3682
|
+
_context6.next = 13;
|
|
3627
3683
|
break;
|
|
3628
3684
|
|
|
3629
3685
|
case 10:
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
console.error('onConfirmAddNote',
|
|
3686
|
+
_context6.prev = 10;
|
|
3687
|
+
_context6.t0 = _context6["catch"](2);
|
|
3688
|
+
console.error('onConfirmAddNote', _context6.t0);
|
|
3633
3689
|
|
|
3634
3690
|
case 13:
|
|
3635
3691
|
case "end":
|
|
3636
|
-
return
|
|
3692
|
+
return _context6.stop();
|
|
3637
3693
|
}
|
|
3638
3694
|
}
|
|
3639
|
-
},
|
|
3695
|
+
}, _callee6, null, [[2, 10]]);
|
|
3640
3696
|
})));
|
|
3641
3697
|
|
|
3642
3698
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onDeleteNote", function (n) {
|
|
@@ -3684,42 +3740,42 @@
|
|
|
3684
3740
|
|
|
3685
3741
|
_this.setState({
|
|
3686
3742
|
updating: true
|
|
3687
|
-
}, /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3743
|
+
}, /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee7() {
|
|
3688
3744
|
var update;
|
|
3689
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3745
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee7$(_context7) {
|
|
3690
3746
|
while (1) {
|
|
3691
|
-
switch (
|
|
3747
|
+
switch (_context7.prev = _context7.next) {
|
|
3692
3748
|
case 0:
|
|
3693
|
-
|
|
3749
|
+
_context7.prev = 0;
|
|
3694
3750
|
update = {
|
|
3695
3751
|
id: job.id,
|
|
3696
3752
|
seen: true,
|
|
3697
3753
|
status: job.status || 'Unassigned'
|
|
3698
3754
|
};
|
|
3699
|
-
|
|
3755
|
+
_context7.next = 4;
|
|
3700
3756
|
return maintenanceActions.editJob(update, auth.site);
|
|
3701
3757
|
|
|
3702
3758
|
case 4:
|
|
3703
|
-
|
|
3759
|
+
_context7.next = 11;
|
|
3704
3760
|
break;
|
|
3705
3761
|
|
|
3706
3762
|
case 6:
|
|
3707
|
-
|
|
3708
|
-
|
|
3763
|
+
_context7.prev = 6;
|
|
3764
|
+
_context7.t0 = _context7["catch"](0);
|
|
3709
3765
|
|
|
3710
3766
|
_this.setState({
|
|
3711
3767
|
updating: false
|
|
3712
3768
|
});
|
|
3713
3769
|
|
|
3714
|
-
console.log('markSeen error',
|
|
3770
|
+
console.log('markSeen error', _context7.t0);
|
|
3715
3771
|
alert('Something went wrong with the request. Please try again.');
|
|
3716
3772
|
|
|
3717
3773
|
case 11:
|
|
3718
3774
|
case "end":
|
|
3719
|
-
return
|
|
3775
|
+
return _context7.stop();
|
|
3720
3776
|
}
|
|
3721
3777
|
}
|
|
3722
|
-
},
|
|
3778
|
+
}, _callee7, null, [[0, 6]]);
|
|
3723
3779
|
})));
|
|
3724
3780
|
});
|
|
3725
3781
|
|
|
@@ -3731,44 +3787,44 @@
|
|
|
3731
3787
|
});
|
|
3732
3788
|
});
|
|
3733
3789
|
|
|
3734
|
-
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onAddComment", /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3790
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onAddComment", /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee8() {
|
|
3735
3791
|
var _this$state2, commentInput, jobId, job, comments, res;
|
|
3736
3792
|
|
|
3737
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3793
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee8$(_context8) {
|
|
3738
3794
|
while (1) {
|
|
3739
|
-
switch (
|
|
3795
|
+
switch (_context8.prev = _context8.next) {
|
|
3740
3796
|
case 0:
|
|
3741
3797
|
_this$state2 = _this.state, commentInput = _this$state2.commentInput, jobId = _this$state2.jobId, job = _this$state2.job, comments = _this$state2.comments;
|
|
3742
|
-
|
|
3798
|
+
_context8.prev = 1;
|
|
3743
3799
|
|
|
3744
3800
|
_this.setState({
|
|
3745
3801
|
commentInput: ''
|
|
3746
3802
|
});
|
|
3747
3803
|
|
|
3748
|
-
|
|
3804
|
+
_context8.next = 5;
|
|
3749
3805
|
return reactionActions.addComment(jobId, values.commentKey, job.title, job.site, commentInput);
|
|
3750
3806
|
|
|
3751
3807
|
case 5:
|
|
3752
|
-
res =
|
|
3808
|
+
res = _context8.sent;
|
|
3753
3809
|
|
|
3754
3810
|
_this.setState({
|
|
3755
3811
|
comments: [].concat(_toConsumableArray__default['default'](comments), [res.data])
|
|
3756
3812
|
});
|
|
3757
3813
|
|
|
3758
|
-
|
|
3814
|
+
_context8.next = 12;
|
|
3759
3815
|
break;
|
|
3760
3816
|
|
|
3761
3817
|
case 9:
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
console.error('onAddComment',
|
|
3818
|
+
_context8.prev = 9;
|
|
3819
|
+
_context8.t0 = _context8["catch"](1);
|
|
3820
|
+
console.error('onAddComment', _context8.t0);
|
|
3765
3821
|
|
|
3766
3822
|
case 12:
|
|
3767
3823
|
case "end":
|
|
3768
|
-
return
|
|
3824
|
+
return _context8.stop();
|
|
3769
3825
|
}
|
|
3770
3826
|
}
|
|
3771
|
-
},
|
|
3827
|
+
}, _callee8, null, [[1, 9]]);
|
|
3772
3828
|
})));
|
|
3773
3829
|
|
|
3774
3830
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onHandleChange", function (event) {
|
|
@@ -3785,11 +3841,11 @@
|
|
|
3785
3841
|
});
|
|
3786
3842
|
|
|
3787
3843
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onSelectPriority", /*#__PURE__*/function () {
|
|
3788
|
-
var
|
|
3844
|
+
var _ref9 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee9(priority) {
|
|
3789
3845
|
var res, job;
|
|
3790
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3846
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee9$(_context9) {
|
|
3791
3847
|
while (1) {
|
|
3792
|
-
switch (
|
|
3848
|
+
switch (_context9.prev = _context9.next) {
|
|
3793
3849
|
case 0:
|
|
3794
3850
|
_this.setState({
|
|
3795
3851
|
job: _objectSpread$4(_objectSpread$4({}, _this.state.job), {}, {
|
|
@@ -3798,12 +3854,12 @@
|
|
|
3798
3854
|
priorityChangerOpen: false
|
|
3799
3855
|
});
|
|
3800
3856
|
|
|
3801
|
-
|
|
3802
|
-
|
|
3857
|
+
_context9.prev = 1;
|
|
3858
|
+
_context9.next = 4;
|
|
3803
3859
|
return maintenanceActions.editJobPriority(_this.state.job.id, priority);
|
|
3804
3860
|
|
|
3805
3861
|
case 4:
|
|
3806
|
-
res =
|
|
3862
|
+
res = _context9.sent;
|
|
3807
3863
|
job = res.data.job;
|
|
3808
3864
|
|
|
3809
3865
|
_this.props.jobsLoaded([job]);
|
|
@@ -3812,24 +3868,24 @@
|
|
|
3812
3868
|
job: job
|
|
3813
3869
|
});
|
|
3814
3870
|
|
|
3815
|
-
|
|
3871
|
+
_context9.next = 13;
|
|
3816
3872
|
break;
|
|
3817
3873
|
|
|
3818
3874
|
case 10:
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
console.error('onSelectPriority',
|
|
3875
|
+
_context9.prev = 10;
|
|
3876
|
+
_context9.t0 = _context9["catch"](1);
|
|
3877
|
+
console.error('onSelectPriority', _context9.t0);
|
|
3822
3878
|
|
|
3823
3879
|
case 13:
|
|
3824
3880
|
case "end":
|
|
3825
|
-
return
|
|
3881
|
+
return _context9.stop();
|
|
3826
3882
|
}
|
|
3827
3883
|
}
|
|
3828
|
-
},
|
|
3884
|
+
}, _callee9, null, [[1, 10]]);
|
|
3829
3885
|
}));
|
|
3830
3886
|
|
|
3831
3887
|
return function (_x2) {
|
|
3832
|
-
return
|
|
3888
|
+
return _ref9.apply(this, arguments);
|
|
3833
3889
|
};
|
|
3834
3890
|
}());
|
|
3835
3891
|
|
|
@@ -3840,11 +3896,11 @@
|
|
|
3840
3896
|
});
|
|
3841
3897
|
|
|
3842
3898
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onSelectStatus", /*#__PURE__*/function () {
|
|
3843
|
-
var
|
|
3899
|
+
var _ref10 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee10(status) {
|
|
3844
3900
|
var res, job;
|
|
3845
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3901
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee10$(_context10) {
|
|
3846
3902
|
while (1) {
|
|
3847
|
-
switch (
|
|
3903
|
+
switch (_context10.prev = _context10.next) {
|
|
3848
3904
|
case 0:
|
|
3849
3905
|
_this.setState({
|
|
3850
3906
|
job: _objectSpread$4(_objectSpread$4({}, _this.state.job), {}, {
|
|
@@ -3853,12 +3909,12 @@
|
|
|
3853
3909
|
statusChangerOpen: false
|
|
3854
3910
|
});
|
|
3855
3911
|
|
|
3856
|
-
|
|
3857
|
-
|
|
3912
|
+
_context10.prev = 1;
|
|
3913
|
+
_context10.next = 4;
|
|
3858
3914
|
return maintenanceActions.editJobStatus(_this.state.job.id, status);
|
|
3859
3915
|
|
|
3860
3916
|
case 4:
|
|
3861
|
-
res =
|
|
3917
|
+
res = _context10.sent;
|
|
3862
3918
|
job = res.data.job;
|
|
3863
3919
|
|
|
3864
3920
|
_this.props.jobsLoaded([job]);
|
|
@@ -3867,24 +3923,24 @@
|
|
|
3867
3923
|
job: job
|
|
3868
3924
|
});
|
|
3869
3925
|
|
|
3870
|
-
|
|
3926
|
+
_context10.next = 13;
|
|
3871
3927
|
break;
|
|
3872
3928
|
|
|
3873
3929
|
case 10:
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
console.error('onSelectStatus',
|
|
3930
|
+
_context10.prev = 10;
|
|
3931
|
+
_context10.t0 = _context10["catch"](1);
|
|
3932
|
+
console.error('onSelectStatus', _context10.t0);
|
|
3877
3933
|
|
|
3878
3934
|
case 13:
|
|
3879
3935
|
case "end":
|
|
3880
|
-
return
|
|
3936
|
+
return _context10.stop();
|
|
3881
3937
|
}
|
|
3882
3938
|
}
|
|
3883
|
-
},
|
|
3939
|
+
}, _callee10, null, [[1, 10]]);
|
|
3884
3940
|
}));
|
|
3885
3941
|
|
|
3886
3942
|
return function (_x3) {
|
|
3887
|
-
return
|
|
3943
|
+
return _ref10.apply(this, arguments);
|
|
3888
3944
|
};
|
|
3889
3945
|
}());
|
|
3890
3946
|
|
|
@@ -3902,7 +3958,9 @@
|
|
|
3902
3958
|
noteAttachments: [],
|
|
3903
3959
|
noteInput: '',
|
|
3904
3960
|
noteImages: [],
|
|
3905
|
-
assignees: []
|
|
3961
|
+
assignees: [],
|
|
3962
|
+
externalSync: null,
|
|
3963
|
+
loadingExternalSync: false
|
|
3906
3964
|
};
|
|
3907
3965
|
return _this;
|
|
3908
3966
|
}
|
|
@@ -3921,6 +3979,7 @@
|
|
|
3921
3979
|
this.getJob();
|
|
3922
3980
|
this.getComments();
|
|
3923
3981
|
this.getAssignees();
|
|
3982
|
+
this.getExternalSync();
|
|
3924
3983
|
}
|
|
3925
3984
|
}
|
|
3926
3985
|
}, {
|
|
@@ -4399,6 +4458,26 @@
|
|
|
4399
4458
|
className: "statusLabel_text"
|
|
4400
4459
|
}, e.user.displayName, " assigned the ", values.textSingularName, " to ", e.assignedUser ? e.assignedUser.displayName : 'Unassigned')));
|
|
4401
4460
|
}
|
|
4461
|
+
}, {
|
|
4462
|
+
key: "renderExternalSyncEntry",
|
|
4463
|
+
value: function renderExternalSyncEntry(e, i) {
|
|
4464
|
+
var isSuccess = e.EntryType === 'ExternalIDSet';
|
|
4465
|
+
var backgroundColor = isSuccess ? Colours$1.COLOUR_GREEN : Colours$1.COLOUR_RED; // Green for success, red for failure
|
|
4466
|
+
|
|
4467
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
4468
|
+
className: "ticketHistoryEntry",
|
|
4469
|
+
key: i
|
|
4470
|
+
}, /*#__PURE__*/React__default['default'].createElement("p", {
|
|
4471
|
+
className: "ticketHistoryEntry_timestamp"
|
|
4472
|
+
}, moment__default['default'].utc(e.timestamp).local().format('D MMM YYYY h:mma')), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
4473
|
+
className: "statusLabel statusLabel-large statusLabel-full",
|
|
4474
|
+
style: {
|
|
4475
|
+
backgroundColor: backgroundColor
|
|
4476
|
+
}
|
|
4477
|
+
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
4478
|
+
className: "statusLabel_text"
|
|
4479
|
+
}, 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) : ''))));
|
|
4480
|
+
}
|
|
4402
4481
|
}, {
|
|
4403
4482
|
key: "renderPriority",
|
|
4404
4483
|
value: function renderPriority() {
|
|
@@ -4413,6 +4492,34 @@
|
|
|
4413
4492
|
className: "flex-1"
|
|
4414
4493
|
}, "Priority")));
|
|
4415
4494
|
}
|
|
4495
|
+
}, {
|
|
4496
|
+
key: "renderExternalSync",
|
|
4497
|
+
value: function renderExternalSync() {
|
|
4498
|
+
var _this$state3 = this.state,
|
|
4499
|
+
externalSync = _this$state3.externalSync,
|
|
4500
|
+
loadingExternalSync = _this$state3.loadingExternalSync; // Only show if external sync data exists
|
|
4501
|
+
|
|
4502
|
+
if (!externalSync || loadingExternalSync) return null;
|
|
4503
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
4504
|
+
className: "padding-32 paddingVertical-40 bottomDivideBorder relative"
|
|
4505
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
4506
|
+
className: "newTopBar clearfix flex flex-reverse"
|
|
4507
|
+
}, /*#__PURE__*/React__default['default'].createElement(Components$3.Text, {
|
|
4508
|
+
type: "formTitleSmall",
|
|
4509
|
+
className: "flex-1"
|
|
4510
|
+
}, "External Sync")), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
4511
|
+
className: "marginTop-16"
|
|
4512
|
+
}, externalSync.externalSystem && /*#__PURE__*/React__default['default'].createElement(Components$3.Text, {
|
|
4513
|
+
type: "body",
|
|
4514
|
+
className: "marginBottom-8"
|
|
4515
|
+
}, /*#__PURE__*/React__default['default'].createElement("strong", null, "System:"), " ", externalSync.externalSystem), externalSync.externalId && /*#__PURE__*/React__default['default'].createElement(Components$3.Text, {
|
|
4516
|
+
type: "body",
|
|
4517
|
+
className: "marginBottom-8"
|
|
4518
|
+
}, /*#__PURE__*/React__default['default'].createElement("strong", null, "External ID:"), " ", externalSync.externalId), externalSync.syncedAt && /*#__PURE__*/React__default['default'].createElement(Components$3.Text, {
|
|
4519
|
+
type: "body",
|
|
4520
|
+
className: "marginBottom-8"
|
|
4521
|
+
}, /*#__PURE__*/React__default['default'].createElement("strong", null, "Synced:"), " ", moment__default['default'].utc(externalSync.syncedAt).local().format('D MMM YYYY h:mma'))));
|
|
4522
|
+
}
|
|
4416
4523
|
}, {
|
|
4417
4524
|
key: "renderOverview",
|
|
4418
4525
|
value: function renderOverview() {
|
|
@@ -4449,6 +4556,10 @@
|
|
|
4449
4556
|
|
|
4450
4557
|
case 'assignment':
|
|
4451
4558
|
return _this7.renderAssignmentEntry(e, i);
|
|
4559
|
+
|
|
4560
|
+
case 'ExternalIDSet':
|
|
4561
|
+
case 'ExternalIDSetFailed':
|
|
4562
|
+
return _this7.renderExternalSyncEntry(e, i);
|
|
4452
4563
|
}
|
|
4453
4564
|
}));
|
|
4454
4565
|
}
|
|
@@ -4565,8 +4676,8 @@
|
|
|
4565
4676
|
}), /*#__PURE__*/React__default['default'].createElement("p", {
|
|
4566
4677
|
className: "iconTextButton_text"
|
|
4567
4678
|
}, "Add Attachment")), /*#__PURE__*/React__default['default'].createElement(Components$3.ImageInput, {
|
|
4568
|
-
ref: function ref(
|
|
4569
|
-
_this8.imageInput =
|
|
4679
|
+
ref: function ref(_ref11) {
|
|
4680
|
+
_this8.imageInput = _ref11;
|
|
4570
4681
|
},
|
|
4571
4682
|
multiple: true,
|
|
4572
4683
|
refreshCallback: function refreshCallback(images) {
|
|
@@ -4665,7 +4776,7 @@
|
|
|
4665
4776
|
className: "pageSectionWrapper--fixedPopupSize"
|
|
4666
4777
|
}, this.renderInner()), /*#__PURE__*/React__default['default'].createElement(Components$3.OverlayPageSection, {
|
|
4667
4778
|
className: "pageSectionWrapper--newPopupSide pageSectionWrapper--newPopupSide-fixedWidth"
|
|
4668
|
-
}, this.renderAssignment(), this.renderPriority(), this.renderOverview())), /*#__PURE__*/React__default['default'].createElement(Components$3.OverlayPageBottomButtons, null, this.renderButtons()));
|
|
4779
|
+
}, this.renderAssignment(), this.renderPriority(), this.renderExternalSync(), this.renderOverview())), /*#__PURE__*/React__default['default'].createElement(Components$3.OverlayPageBottomButtons, null, this.renderButtons()));
|
|
4669
4780
|
}
|
|
4670
4781
|
}]);
|
|
4671
4782
|
|
package/package.json
CHANGED