@plusscommunities/pluss-maintenance-web 1.1.27-auth.0 → 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 +209 -97
- package/dist/index.esm.js +209 -97
- package/dist/index.umd.js +209 -97
- package/package.json +3 -7
- package/src/apis/maintenanceActions.js +6 -0
- package/src/screens/AddJobType.js +7 -6
- package/src/screens/Job.js +73 -0
- package/src/values.config.feedback.js +2 -2
package/dist/index.cjs.js
CHANGED
|
@@ -504,6 +504,14 @@ var maintenanceActions = {
|
|
|
504
504
|
id: id
|
|
505
505
|
}
|
|
506
506
|
});
|
|
507
|
+
},
|
|
508
|
+
getExternalSync: function getExternalSync(jobId) {
|
|
509
|
+
return Session$9.authedFunction({
|
|
510
|
+
method: 'GET',
|
|
511
|
+
url: Helper$5.getUrl(values.serviceKey, 'get/externalsync', {
|
|
512
|
+
id: jobId
|
|
513
|
+
})
|
|
514
|
+
});
|
|
507
515
|
}
|
|
508
516
|
};
|
|
509
517
|
|
|
@@ -3374,6 +3382,54 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
3374
3382
|
}, _callee2, null, [[0, 7]]);
|
|
3375
3383
|
})));
|
|
3376
3384
|
|
|
3385
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "getExternalSync", /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3() {
|
|
3386
|
+
var res, _error$response;
|
|
3387
|
+
|
|
3388
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
|
3389
|
+
while (1) {
|
|
3390
|
+
switch (_context3.prev = _context3.next) {
|
|
3391
|
+
case 0:
|
|
3392
|
+
_context3.prev = 0;
|
|
3393
|
+
|
|
3394
|
+
_this.setState({
|
|
3395
|
+
loadingExternalSync: true
|
|
3396
|
+
});
|
|
3397
|
+
|
|
3398
|
+
_context3.next = 4;
|
|
3399
|
+
return maintenanceActions.getExternalSync(_this.state.jobId);
|
|
3400
|
+
|
|
3401
|
+
case 4:
|
|
3402
|
+
res = _context3.sent;
|
|
3403
|
+
|
|
3404
|
+
_this.setState({
|
|
3405
|
+
externalSync: res.data,
|
|
3406
|
+
loadingExternalSync: false
|
|
3407
|
+
});
|
|
3408
|
+
|
|
3409
|
+
_context3.next = 12;
|
|
3410
|
+
break;
|
|
3411
|
+
|
|
3412
|
+
case 8:
|
|
3413
|
+
_context3.prev = 8;
|
|
3414
|
+
_context3.t0 = _context3["catch"](0);
|
|
3415
|
+
|
|
3416
|
+
// 404 is expected if no sync - don't show error
|
|
3417
|
+
if (((_error$response = _context3.t0.response) === null || _error$response === void 0 ? void 0 : _error$response.status) !== 404) {
|
|
3418
|
+
console.error('getExternalSync', _context3.t0);
|
|
3419
|
+
}
|
|
3420
|
+
|
|
3421
|
+
_this.setState({
|
|
3422
|
+
loadingExternalSync: false
|
|
3423
|
+
});
|
|
3424
|
+
|
|
3425
|
+
case 12:
|
|
3426
|
+
case "end":
|
|
3427
|
+
return _context3.stop();
|
|
3428
|
+
}
|
|
3429
|
+
}
|
|
3430
|
+
}, _callee3, null, [[0, 8]]);
|
|
3431
|
+
})));
|
|
3432
|
+
|
|
3377
3433
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "getStatusType", function (status) {
|
|
3378
3434
|
var statusTypes = _this.props.statusTypes;
|
|
3379
3435
|
var statusType = statusTypes.find(function (s) {
|
|
@@ -3539,35 +3595,35 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
3539
3595
|
});
|
|
3540
3596
|
});
|
|
3541
3597
|
|
|
3542
|
-
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onConfirmAssignee", /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3543
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3598
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onConfirmAssignee", /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee4() {
|
|
3599
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee4$(_context4) {
|
|
3544
3600
|
while (1) {
|
|
3545
|
-
switch (
|
|
3601
|
+
switch (_context4.prev = _context4.next) {
|
|
3546
3602
|
case 0:
|
|
3547
3603
|
_this.setState({
|
|
3548
3604
|
confirmingAssignee: true
|
|
3549
3605
|
});
|
|
3550
3606
|
|
|
3551
|
-
|
|
3607
|
+
_context4.prev = 1;
|
|
3552
3608
|
|
|
3553
3609
|
if (!_this.state.selectedAssignee) {
|
|
3554
|
-
|
|
3610
|
+
_context4.next = 5;
|
|
3555
3611
|
break;
|
|
3556
3612
|
}
|
|
3557
3613
|
|
|
3558
|
-
|
|
3614
|
+
_context4.next = 5;
|
|
3559
3615
|
return _this.onAssignUser(_this.state.selectedAssignee.id);
|
|
3560
3616
|
|
|
3561
3617
|
case 5:
|
|
3562
3618
|
_this.onCloseSelectAssignee();
|
|
3563
3619
|
|
|
3564
|
-
|
|
3620
|
+
_context4.next = 11;
|
|
3565
3621
|
break;
|
|
3566
3622
|
|
|
3567
3623
|
case 8:
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
console.error('onConfirmAssignee',
|
|
3624
|
+
_context4.prev = 8;
|
|
3625
|
+
_context4.t0 = _context4["catch"](1);
|
|
3626
|
+
console.error('onConfirmAssignee', _context4.t0);
|
|
3571
3627
|
|
|
3572
3628
|
case 11:
|
|
3573
3629
|
_this.setState({
|
|
@@ -3576,68 +3632,68 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
3576
3632
|
|
|
3577
3633
|
case 12:
|
|
3578
3634
|
case "end":
|
|
3579
|
-
return
|
|
3635
|
+
return _context4.stop();
|
|
3580
3636
|
}
|
|
3581
3637
|
}
|
|
3582
|
-
},
|
|
3638
|
+
}, _callee4, null, [[1, 8]]);
|
|
3583
3639
|
})));
|
|
3584
3640
|
|
|
3585
3641
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onAssignUser", /*#__PURE__*/function () {
|
|
3586
|
-
var
|
|
3587
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3642
|
+
var _ref5 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee5(userId) {
|
|
3643
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee5$(_context5) {
|
|
3588
3644
|
while (1) {
|
|
3589
|
-
switch (
|
|
3645
|
+
switch (_context5.prev = _context5.next) {
|
|
3590
3646
|
case 0:
|
|
3591
|
-
|
|
3592
|
-
|
|
3647
|
+
_context5.prev = 0;
|
|
3648
|
+
_context5.next = 3;
|
|
3593
3649
|
return maintenanceActions.assignJob(_this.state.jobId, userId);
|
|
3594
3650
|
|
|
3595
3651
|
case 3:
|
|
3596
3652
|
|
|
3597
3653
|
_this.getJob();
|
|
3598
3654
|
|
|
3599
|
-
|
|
3655
|
+
_context5.next = 10;
|
|
3600
3656
|
break;
|
|
3601
3657
|
|
|
3602
3658
|
case 7:
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
console.error('onAssignUser',
|
|
3659
|
+
_context5.prev = 7;
|
|
3660
|
+
_context5.t0 = _context5["catch"](0);
|
|
3661
|
+
console.error('onAssignUser', _context5.t0);
|
|
3606
3662
|
|
|
3607
3663
|
case 10:
|
|
3608
3664
|
case "end":
|
|
3609
|
-
return
|
|
3665
|
+
return _context5.stop();
|
|
3610
3666
|
}
|
|
3611
3667
|
}
|
|
3612
|
-
},
|
|
3668
|
+
}, _callee5, null, [[0, 7]]);
|
|
3613
3669
|
}));
|
|
3614
3670
|
|
|
3615
3671
|
return function (_x) {
|
|
3616
|
-
return
|
|
3672
|
+
return _ref5.apply(this, arguments);
|
|
3617
3673
|
};
|
|
3618
3674
|
}());
|
|
3619
3675
|
|
|
3620
|
-
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onConfirmAddNote", /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3676
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onConfirmAddNote", /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee6() {
|
|
3621
3677
|
var res;
|
|
3622
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3678
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee6$(_context6) {
|
|
3623
3679
|
while (1) {
|
|
3624
|
-
switch (
|
|
3680
|
+
switch (_context6.prev = _context6.next) {
|
|
3625
3681
|
case 0:
|
|
3626
3682
|
if (_this.isReadyToSaveNote()) {
|
|
3627
|
-
|
|
3683
|
+
_context6.next = 2;
|
|
3628
3684
|
break;
|
|
3629
3685
|
}
|
|
3630
3686
|
|
|
3631
|
-
return
|
|
3687
|
+
return _context6.abrupt("return");
|
|
3632
3688
|
|
|
3633
3689
|
case 2:
|
|
3634
|
-
|
|
3690
|
+
_context6.prev = 2;
|
|
3635
3691
|
|
|
3636
3692
|
_this.setState({
|
|
3637
3693
|
submittingNote: true
|
|
3638
3694
|
});
|
|
3639
3695
|
|
|
3640
|
-
|
|
3696
|
+
_context6.next = 6;
|
|
3641
3697
|
return _this.state.editingNote ? maintenanceActions.editNote(_this.state.jobId, _this.state.editingNote, _this.state.noteInput, _this.state.noteAttachments.map(function (a) {
|
|
3642
3698
|
return {
|
|
3643
3699
|
Title: a.Title,
|
|
@@ -3651,7 +3707,7 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
3651
3707
|
}), _this.state.noteImages);
|
|
3652
3708
|
|
|
3653
3709
|
case 6:
|
|
3654
|
-
res =
|
|
3710
|
+
res = _context6.sent;
|
|
3655
3711
|
|
|
3656
3712
|
_this.setState({
|
|
3657
3713
|
job: res.data.job,
|
|
@@ -3665,20 +3721,20 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
3665
3721
|
_this.props.jobsLoaded([_this.state.job]);
|
|
3666
3722
|
});
|
|
3667
3723
|
|
|
3668
|
-
|
|
3724
|
+
_context6.next = 13;
|
|
3669
3725
|
break;
|
|
3670
3726
|
|
|
3671
3727
|
case 10:
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
console.error('onConfirmAddNote',
|
|
3728
|
+
_context6.prev = 10;
|
|
3729
|
+
_context6.t0 = _context6["catch"](2);
|
|
3730
|
+
console.error('onConfirmAddNote', _context6.t0);
|
|
3675
3731
|
|
|
3676
3732
|
case 13:
|
|
3677
3733
|
case "end":
|
|
3678
|
-
return
|
|
3734
|
+
return _context6.stop();
|
|
3679
3735
|
}
|
|
3680
3736
|
}
|
|
3681
|
-
},
|
|
3737
|
+
}, _callee6, null, [[2, 10]]);
|
|
3682
3738
|
})));
|
|
3683
3739
|
|
|
3684
3740
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onDeleteNote", function (n) {
|
|
@@ -3726,42 +3782,42 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
3726
3782
|
|
|
3727
3783
|
_this.setState({
|
|
3728
3784
|
updating: true
|
|
3729
|
-
}, /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3785
|
+
}, /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee7() {
|
|
3730
3786
|
var update;
|
|
3731
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3787
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee7$(_context7) {
|
|
3732
3788
|
while (1) {
|
|
3733
|
-
switch (
|
|
3789
|
+
switch (_context7.prev = _context7.next) {
|
|
3734
3790
|
case 0:
|
|
3735
|
-
|
|
3791
|
+
_context7.prev = 0;
|
|
3736
3792
|
update = {
|
|
3737
3793
|
id: job.id,
|
|
3738
3794
|
seen: true,
|
|
3739
3795
|
status: job.status || 'Unassigned'
|
|
3740
3796
|
};
|
|
3741
|
-
|
|
3797
|
+
_context7.next = 4;
|
|
3742
3798
|
return maintenanceActions.editJob(update, auth.site);
|
|
3743
3799
|
|
|
3744
3800
|
case 4:
|
|
3745
|
-
|
|
3801
|
+
_context7.next = 11;
|
|
3746
3802
|
break;
|
|
3747
3803
|
|
|
3748
3804
|
case 6:
|
|
3749
|
-
|
|
3750
|
-
|
|
3805
|
+
_context7.prev = 6;
|
|
3806
|
+
_context7.t0 = _context7["catch"](0);
|
|
3751
3807
|
|
|
3752
3808
|
_this.setState({
|
|
3753
3809
|
updating: false
|
|
3754
3810
|
});
|
|
3755
3811
|
|
|
3756
|
-
console.log('markSeen error',
|
|
3812
|
+
console.log('markSeen error', _context7.t0);
|
|
3757
3813
|
alert('Something went wrong with the request. Please try again.');
|
|
3758
3814
|
|
|
3759
3815
|
case 11:
|
|
3760
3816
|
case "end":
|
|
3761
|
-
return
|
|
3817
|
+
return _context7.stop();
|
|
3762
3818
|
}
|
|
3763
3819
|
}
|
|
3764
|
-
},
|
|
3820
|
+
}, _callee7, null, [[0, 6]]);
|
|
3765
3821
|
})));
|
|
3766
3822
|
});
|
|
3767
3823
|
|
|
@@ -3773,44 +3829,44 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
3773
3829
|
});
|
|
3774
3830
|
});
|
|
3775
3831
|
|
|
3776
|
-
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onAddComment", /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3832
|
+
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onAddComment", /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee8() {
|
|
3777
3833
|
var _this$state2, commentInput, jobId, job, comments, res;
|
|
3778
3834
|
|
|
3779
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3835
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee8$(_context8) {
|
|
3780
3836
|
while (1) {
|
|
3781
|
-
switch (
|
|
3837
|
+
switch (_context8.prev = _context8.next) {
|
|
3782
3838
|
case 0:
|
|
3783
3839
|
_this$state2 = _this.state, commentInput = _this$state2.commentInput, jobId = _this$state2.jobId, job = _this$state2.job, comments = _this$state2.comments;
|
|
3784
|
-
|
|
3840
|
+
_context8.prev = 1;
|
|
3785
3841
|
|
|
3786
3842
|
_this.setState({
|
|
3787
3843
|
commentInput: ''
|
|
3788
3844
|
});
|
|
3789
3845
|
|
|
3790
|
-
|
|
3846
|
+
_context8.next = 5;
|
|
3791
3847
|
return reactionActions.addComment(jobId, values.commentKey, job.title, job.site, commentInput);
|
|
3792
3848
|
|
|
3793
3849
|
case 5:
|
|
3794
|
-
res =
|
|
3850
|
+
res = _context8.sent;
|
|
3795
3851
|
|
|
3796
3852
|
_this.setState({
|
|
3797
3853
|
comments: [].concat(_toConsumableArray__default['default'](comments), [res.data])
|
|
3798
3854
|
});
|
|
3799
3855
|
|
|
3800
|
-
|
|
3856
|
+
_context8.next = 12;
|
|
3801
3857
|
break;
|
|
3802
3858
|
|
|
3803
3859
|
case 9:
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
console.error('onAddComment',
|
|
3860
|
+
_context8.prev = 9;
|
|
3861
|
+
_context8.t0 = _context8["catch"](1);
|
|
3862
|
+
console.error('onAddComment', _context8.t0);
|
|
3807
3863
|
|
|
3808
3864
|
case 12:
|
|
3809
3865
|
case "end":
|
|
3810
|
-
return
|
|
3866
|
+
return _context8.stop();
|
|
3811
3867
|
}
|
|
3812
3868
|
}
|
|
3813
|
-
},
|
|
3869
|
+
}, _callee8, null, [[1, 9]]);
|
|
3814
3870
|
})));
|
|
3815
3871
|
|
|
3816
3872
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onHandleChange", function (event) {
|
|
@@ -3827,11 +3883,11 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
3827
3883
|
});
|
|
3828
3884
|
|
|
3829
3885
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onSelectPriority", /*#__PURE__*/function () {
|
|
3830
|
-
var
|
|
3886
|
+
var _ref9 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee9(priority) {
|
|
3831
3887
|
var res, job;
|
|
3832
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3888
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee9$(_context9) {
|
|
3833
3889
|
while (1) {
|
|
3834
|
-
switch (
|
|
3890
|
+
switch (_context9.prev = _context9.next) {
|
|
3835
3891
|
case 0:
|
|
3836
3892
|
_this.setState({
|
|
3837
3893
|
job: _objectSpread$4(_objectSpread$4({}, _this.state.job), {}, {
|
|
@@ -3840,12 +3896,12 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
3840
3896
|
priorityChangerOpen: false
|
|
3841
3897
|
});
|
|
3842
3898
|
|
|
3843
|
-
|
|
3844
|
-
|
|
3899
|
+
_context9.prev = 1;
|
|
3900
|
+
_context9.next = 4;
|
|
3845
3901
|
return maintenanceActions.editJobPriority(_this.state.job.id, priority);
|
|
3846
3902
|
|
|
3847
3903
|
case 4:
|
|
3848
|
-
res =
|
|
3904
|
+
res = _context9.sent;
|
|
3849
3905
|
job = res.data.job;
|
|
3850
3906
|
|
|
3851
3907
|
_this.props.jobsLoaded([job]);
|
|
@@ -3854,24 +3910,24 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
3854
3910
|
job: job
|
|
3855
3911
|
});
|
|
3856
3912
|
|
|
3857
|
-
|
|
3913
|
+
_context9.next = 13;
|
|
3858
3914
|
break;
|
|
3859
3915
|
|
|
3860
3916
|
case 10:
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
console.error('onSelectPriority',
|
|
3917
|
+
_context9.prev = 10;
|
|
3918
|
+
_context9.t0 = _context9["catch"](1);
|
|
3919
|
+
console.error('onSelectPriority', _context9.t0);
|
|
3864
3920
|
|
|
3865
3921
|
case 13:
|
|
3866
3922
|
case "end":
|
|
3867
|
-
return
|
|
3923
|
+
return _context9.stop();
|
|
3868
3924
|
}
|
|
3869
3925
|
}
|
|
3870
|
-
},
|
|
3926
|
+
}, _callee9, null, [[1, 10]]);
|
|
3871
3927
|
}));
|
|
3872
3928
|
|
|
3873
3929
|
return function (_x2) {
|
|
3874
|
-
return
|
|
3930
|
+
return _ref9.apply(this, arguments);
|
|
3875
3931
|
};
|
|
3876
3932
|
}());
|
|
3877
3933
|
|
|
@@ -3882,11 +3938,11 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
3882
3938
|
});
|
|
3883
3939
|
|
|
3884
3940
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onSelectStatus", /*#__PURE__*/function () {
|
|
3885
|
-
var
|
|
3941
|
+
var _ref10 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee10(status) {
|
|
3886
3942
|
var res, job;
|
|
3887
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3943
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee10$(_context10) {
|
|
3888
3944
|
while (1) {
|
|
3889
|
-
switch (
|
|
3945
|
+
switch (_context10.prev = _context10.next) {
|
|
3890
3946
|
case 0:
|
|
3891
3947
|
_this.setState({
|
|
3892
3948
|
job: _objectSpread$4(_objectSpread$4({}, _this.state.job), {}, {
|
|
@@ -3895,12 +3951,12 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
3895
3951
|
statusChangerOpen: false
|
|
3896
3952
|
});
|
|
3897
3953
|
|
|
3898
|
-
|
|
3899
|
-
|
|
3954
|
+
_context10.prev = 1;
|
|
3955
|
+
_context10.next = 4;
|
|
3900
3956
|
return maintenanceActions.editJobStatus(_this.state.job.id, status);
|
|
3901
3957
|
|
|
3902
3958
|
case 4:
|
|
3903
|
-
res =
|
|
3959
|
+
res = _context10.sent;
|
|
3904
3960
|
job = res.data.job;
|
|
3905
3961
|
|
|
3906
3962
|
_this.props.jobsLoaded([job]);
|
|
@@ -3909,24 +3965,24 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
3909
3965
|
job: job
|
|
3910
3966
|
});
|
|
3911
3967
|
|
|
3912
|
-
|
|
3968
|
+
_context10.next = 13;
|
|
3913
3969
|
break;
|
|
3914
3970
|
|
|
3915
3971
|
case 10:
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
console.error('onSelectStatus',
|
|
3972
|
+
_context10.prev = 10;
|
|
3973
|
+
_context10.t0 = _context10["catch"](1);
|
|
3974
|
+
console.error('onSelectStatus', _context10.t0);
|
|
3919
3975
|
|
|
3920
3976
|
case 13:
|
|
3921
3977
|
case "end":
|
|
3922
|
-
return
|
|
3978
|
+
return _context10.stop();
|
|
3923
3979
|
}
|
|
3924
3980
|
}
|
|
3925
|
-
},
|
|
3981
|
+
}, _callee10, null, [[1, 10]]);
|
|
3926
3982
|
}));
|
|
3927
3983
|
|
|
3928
3984
|
return function (_x3) {
|
|
3929
|
-
return
|
|
3985
|
+
return _ref10.apply(this, arguments);
|
|
3930
3986
|
};
|
|
3931
3987
|
}());
|
|
3932
3988
|
|
|
@@ -3944,7 +4000,9 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
3944
4000
|
noteAttachments: [],
|
|
3945
4001
|
noteInput: '',
|
|
3946
4002
|
noteImages: [],
|
|
3947
|
-
assignees: []
|
|
4003
|
+
assignees: [],
|
|
4004
|
+
externalSync: null,
|
|
4005
|
+
loadingExternalSync: false
|
|
3948
4006
|
};
|
|
3949
4007
|
return _this;
|
|
3950
4008
|
}
|
|
@@ -3963,6 +4021,7 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
3963
4021
|
this.getJob();
|
|
3964
4022
|
this.getComments();
|
|
3965
4023
|
this.getAssignees();
|
|
4024
|
+
this.getExternalSync();
|
|
3966
4025
|
}
|
|
3967
4026
|
}
|
|
3968
4027
|
}, {
|
|
@@ -4441,6 +4500,26 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
4441
4500
|
className: "statusLabel_text"
|
|
4442
4501
|
}, e.user.displayName, " assigned the ", values.textSingularName, " to ", e.assignedUser ? e.assignedUser.displayName : 'Unassigned')));
|
|
4443
4502
|
}
|
|
4503
|
+
}, {
|
|
4504
|
+
key: "renderExternalSyncEntry",
|
|
4505
|
+
value: function renderExternalSyncEntry(e, i) {
|
|
4506
|
+
var isSuccess = e.EntryType === 'ExternalIDSet';
|
|
4507
|
+
var backgroundColor = isSuccess ? Colours$1.COLOUR_GREEN : Colours$1.COLOUR_RED; // Green for success, red for failure
|
|
4508
|
+
|
|
4509
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
4510
|
+
className: "ticketHistoryEntry",
|
|
4511
|
+
key: i
|
|
4512
|
+
}, /*#__PURE__*/React__default['default'].createElement("p", {
|
|
4513
|
+
className: "ticketHistoryEntry_timestamp"
|
|
4514
|
+
}, moment__default['default'].utc(e.timestamp).local().format('D MMM YYYY h:mma')), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
4515
|
+
className: "statusLabel statusLabel-large statusLabel-full",
|
|
4516
|
+
style: {
|
|
4517
|
+
backgroundColor: backgroundColor
|
|
4518
|
+
}
|
|
4519
|
+
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
4520
|
+
className: "statusLabel_text"
|
|
4521
|
+
}, 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) : ''))));
|
|
4522
|
+
}
|
|
4444
4523
|
}, {
|
|
4445
4524
|
key: "renderPriority",
|
|
4446
4525
|
value: function renderPriority() {
|
|
@@ -4455,6 +4534,34 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
4455
4534
|
className: "flex-1"
|
|
4456
4535
|
}, "Priority")));
|
|
4457
4536
|
}
|
|
4537
|
+
}, {
|
|
4538
|
+
key: "renderExternalSync",
|
|
4539
|
+
value: function renderExternalSync() {
|
|
4540
|
+
var _this$state3 = this.state,
|
|
4541
|
+
externalSync = _this$state3.externalSync,
|
|
4542
|
+
loadingExternalSync = _this$state3.loadingExternalSync; // Only show if external sync data exists
|
|
4543
|
+
|
|
4544
|
+
if (!externalSync || loadingExternalSync) return null;
|
|
4545
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
4546
|
+
className: "padding-32 paddingVertical-40 bottomDivideBorder relative"
|
|
4547
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
4548
|
+
className: "newTopBar clearfix flex flex-reverse"
|
|
4549
|
+
}, /*#__PURE__*/React__default['default'].createElement(Components$3.Text, {
|
|
4550
|
+
type: "formTitleSmall",
|
|
4551
|
+
className: "flex-1"
|
|
4552
|
+
}, "External Sync")), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
4553
|
+
className: "marginTop-16"
|
|
4554
|
+
}, externalSync.externalSystem && /*#__PURE__*/React__default['default'].createElement(Components$3.Text, {
|
|
4555
|
+
type: "body",
|
|
4556
|
+
className: "marginBottom-8"
|
|
4557
|
+
}, /*#__PURE__*/React__default['default'].createElement("strong", null, "System:"), " ", externalSync.externalSystem), externalSync.externalId && /*#__PURE__*/React__default['default'].createElement(Components$3.Text, {
|
|
4558
|
+
type: "body",
|
|
4559
|
+
className: "marginBottom-8"
|
|
4560
|
+
}, /*#__PURE__*/React__default['default'].createElement("strong", null, "External ID:"), " ", externalSync.externalId), externalSync.syncedAt && /*#__PURE__*/React__default['default'].createElement(Components$3.Text, {
|
|
4561
|
+
type: "body",
|
|
4562
|
+
className: "marginBottom-8"
|
|
4563
|
+
}, /*#__PURE__*/React__default['default'].createElement("strong", null, "Synced:"), " ", moment__default['default'].utc(externalSync.syncedAt).local().format('D MMM YYYY h:mma'))));
|
|
4564
|
+
}
|
|
4458
4565
|
}, {
|
|
4459
4566
|
key: "renderOverview",
|
|
4460
4567
|
value: function renderOverview() {
|
|
@@ -4491,6 +4598,10 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
4491
4598
|
|
|
4492
4599
|
case 'assignment':
|
|
4493
4600
|
return _this7.renderAssignmentEntry(e, i);
|
|
4601
|
+
|
|
4602
|
+
case 'ExternalIDSet':
|
|
4603
|
+
case 'ExternalIDSetFailed':
|
|
4604
|
+
return _this7.renderExternalSyncEntry(e, i);
|
|
4494
4605
|
}
|
|
4495
4606
|
}));
|
|
4496
4607
|
}
|
|
@@ -4607,8 +4718,8 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
4607
4718
|
}), /*#__PURE__*/React__default['default'].createElement("p", {
|
|
4608
4719
|
className: "iconTextButton_text"
|
|
4609
4720
|
}, "Add Attachment")), /*#__PURE__*/React__default['default'].createElement(Components$3.ImageInput, {
|
|
4610
|
-
ref: function ref(
|
|
4611
|
-
_this8.imageInput =
|
|
4721
|
+
ref: function ref(_ref11) {
|
|
4722
|
+
_this8.imageInput = _ref11;
|
|
4612
4723
|
},
|
|
4613
4724
|
multiple: true,
|
|
4614
4725
|
refreshCallback: function refreshCallback(images) {
|
|
@@ -4707,7 +4818,7 @@ var Job = /*#__PURE__*/function (_Component) {
|
|
|
4707
4818
|
className: "pageSectionWrapper--fixedPopupSize"
|
|
4708
4819
|
}, this.renderInner()), /*#__PURE__*/React__default['default'].createElement(Components$3.OverlayPageSection, {
|
|
4709
4820
|
className: "pageSectionWrapper--newPopupSide pageSectionWrapper--newPopupSide-fixedWidth"
|
|
4710
|
-
}, this.renderAssignment(), this.renderPriority(), this.renderOverview())), /*#__PURE__*/React__default['default'].createElement(Components$3.OverlayPageBottomButtons, null, this.renderButtons()));
|
|
4821
|
+
}, this.renderAssignment(), this.renderPriority(), this.renderExternalSync(), this.renderOverview())), /*#__PURE__*/React__default['default'].createElement(Components$3.OverlayPageBottomButtons, null, this.renderButtons()));
|
|
4711
4822
|
}
|
|
4712
4823
|
}]);
|
|
4713
4824
|
|
|
@@ -6038,8 +6149,8 @@ var AddJobType = /*#__PURE__*/function (_Component) {
|
|
|
6038
6149
|
jobTypeEmail: email,
|
|
6039
6150
|
jobTypeDescription: description,
|
|
6040
6151
|
jobTypeLevel: level,
|
|
6041
|
-
hasCustomFields: hasCustomFields,
|
|
6042
|
-
customFields: customFields
|
|
6152
|
+
hasCustomFields: !!hasCustomFields,
|
|
6153
|
+
customFields: customFields || [___default['default'].cloneDeep(DEFAULT_FIELD)]
|
|
6043
6154
|
});
|
|
6044
6155
|
|
|
6045
6156
|
_context.next = 11;
|
|
@@ -6322,10 +6433,11 @@ var AddJobType = /*#__PURE__*/function (_Component) {
|
|
|
6322
6433
|
}, {
|
|
6323
6434
|
Title: 'Image Input',
|
|
6324
6435
|
Key: 'image'
|
|
6325
|
-
}, {
|
|
6326
|
-
|
|
6327
|
-
|
|
6328
|
-
},
|
|
6436
|
+
}, // {
|
|
6437
|
+
// Title: 'Document Input',
|
|
6438
|
+
// Key: 'document',
|
|
6439
|
+
// },
|
|
6440
|
+
{
|
|
6329
6441
|
Title: 'Yes/No Question',
|
|
6330
6442
|
Key: 'yn'
|
|
6331
6443
|
}, {
|