@plusscommunities/pluss-maintenance-web-a 1.1.30 → 1.1.31

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 CHANGED
@@ -508,6 +508,15 @@ var maintenanceActions = {
508
508
  id: jobId
509
509
  })
510
510
  });
511
+ },
512
+ retrySync: function retrySync(jobId) {
513
+ return Session$9.authedFunction({
514
+ method: 'POST',
515
+ url: Helper$5.getUrl(values.serviceKey, 'update/retrysync'),
516
+ data: {
517
+ id: jobId
518
+ }
519
+ });
511
520
  }
512
521
  };
513
522
 
@@ -3421,6 +3430,63 @@ var Job = /*#__PURE__*/function (_Component) {
3421
3430
  }, _callee3, null, [[0, 8]]);
3422
3431
  })));
3423
3432
 
3433
+ _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onRetrySync", /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee4() {
3434
+ var job, errorMessage;
3435
+ return _regeneratorRuntime__default['default'].wrap(function _callee4$(_context4) {
3436
+ while (1) {
3437
+ switch (_context4.prev = _context4.next) {
3438
+ case 0:
3439
+ job = _this.state.job;
3440
+
3441
+ if (!(!job || _this.state.retryingSync)) {
3442
+ _context4.next = 3;
3443
+ break;
3444
+ }
3445
+
3446
+ return _context4.abrupt("return");
3447
+
3448
+ case 3:
3449
+ _this.setState({
3450
+ retryingSync: true,
3451
+ retrySyncError: null
3452
+ });
3453
+
3454
+ _context4.prev = 4;
3455
+ _context4.next = 7;
3456
+ return maintenanceActions.retrySync(job.id);
3457
+
3458
+ case 7:
3459
+ _context4.next = 9;
3460
+ return _this.getJob();
3461
+
3462
+ case 9:
3463
+ _this.setState({
3464
+ retryingSync: false,
3465
+ retrySyncInitiated: true
3466
+ });
3467
+
3468
+ _context4.next = 17;
3469
+ break;
3470
+
3471
+ case 12:
3472
+ _context4.prev = 12;
3473
+ _context4.t0 = _context4["catch"](4);
3474
+ console.error('onRetrySync', _context4.t0);
3475
+ errorMessage = _context4.t0 && _context4.t0.response && _context4.t0.response.data && _context4.t0.response.data.error || 'Failed to retry sync. Please try again.';
3476
+
3477
+ _this.setState({
3478
+ retryingSync: false,
3479
+ retrySyncError: errorMessage
3480
+ });
3481
+
3482
+ case 17:
3483
+ case "end":
3484
+ return _context4.stop();
3485
+ }
3486
+ }
3487
+ }, _callee4, null, [[4, 12]]);
3488
+ })));
3489
+
3424
3490
  _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "getStatusType", function (status) {
3425
3491
  var statusTypes = _this.props.statusTypes;
3426
3492
  var statusType = statusTypes.find(function (s) {
@@ -3586,35 +3652,35 @@ var Job = /*#__PURE__*/function (_Component) {
3586
3652
  });
3587
3653
  });
3588
3654
 
3589
- _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onConfirmAssignee", /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee4() {
3590
- return _regeneratorRuntime__default['default'].wrap(function _callee4$(_context4) {
3655
+ _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onConfirmAssignee", /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee5() {
3656
+ return _regeneratorRuntime__default['default'].wrap(function _callee5$(_context5) {
3591
3657
  while (1) {
3592
- switch (_context4.prev = _context4.next) {
3658
+ switch (_context5.prev = _context5.next) {
3593
3659
  case 0:
3594
3660
  _this.setState({
3595
3661
  confirmingAssignee: true
3596
3662
  });
3597
3663
 
3598
- _context4.prev = 1;
3664
+ _context5.prev = 1;
3599
3665
 
3600
3666
  if (!_this.state.selectedAssignee) {
3601
- _context4.next = 5;
3667
+ _context5.next = 5;
3602
3668
  break;
3603
3669
  }
3604
3670
 
3605
- _context4.next = 5;
3671
+ _context5.next = 5;
3606
3672
  return _this.onAssignUser(_this.state.selectedAssignee.id);
3607
3673
 
3608
3674
  case 5:
3609
3675
  _this.onCloseSelectAssignee();
3610
3676
 
3611
- _context4.next = 11;
3677
+ _context5.next = 11;
3612
3678
  break;
3613
3679
 
3614
3680
  case 8:
3615
- _context4.prev = 8;
3616
- _context4.t0 = _context4["catch"](1);
3617
- console.error('onConfirmAssignee', _context4.t0);
3681
+ _context5.prev = 8;
3682
+ _context5.t0 = _context5["catch"](1);
3683
+ console.error('onConfirmAssignee', _context5.t0);
3618
3684
 
3619
3685
  case 11:
3620
3686
  _this.setState({
@@ -3623,68 +3689,68 @@ var Job = /*#__PURE__*/function (_Component) {
3623
3689
 
3624
3690
  case 12:
3625
3691
  case "end":
3626
- return _context4.stop();
3692
+ return _context5.stop();
3627
3693
  }
3628
3694
  }
3629
- }, _callee4, null, [[1, 8]]);
3695
+ }, _callee5, null, [[1, 8]]);
3630
3696
  })));
3631
3697
 
3632
3698
  _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onAssignUser", /*#__PURE__*/function () {
3633
- var _ref5 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee5(userId) {
3634
- return _regeneratorRuntime__default['default'].wrap(function _callee5$(_context5) {
3699
+ var _ref6 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee6(userId) {
3700
+ return _regeneratorRuntime__default['default'].wrap(function _callee6$(_context6) {
3635
3701
  while (1) {
3636
- switch (_context5.prev = _context5.next) {
3702
+ switch (_context6.prev = _context6.next) {
3637
3703
  case 0:
3638
- _context5.prev = 0;
3639
- _context5.next = 3;
3704
+ _context6.prev = 0;
3705
+ _context6.next = 3;
3640
3706
  return maintenanceActions.assignJob(_this.state.jobId, userId);
3641
3707
 
3642
3708
  case 3:
3643
3709
 
3644
3710
  _this.getJob();
3645
3711
 
3646
- _context5.next = 10;
3712
+ _context6.next = 10;
3647
3713
  break;
3648
3714
 
3649
3715
  case 7:
3650
- _context5.prev = 7;
3651
- _context5.t0 = _context5["catch"](0);
3652
- console.error('onAssignUser', _context5.t0);
3716
+ _context6.prev = 7;
3717
+ _context6.t0 = _context6["catch"](0);
3718
+ console.error('onAssignUser', _context6.t0);
3653
3719
 
3654
3720
  case 10:
3655
3721
  case "end":
3656
- return _context5.stop();
3722
+ return _context6.stop();
3657
3723
  }
3658
3724
  }
3659
- }, _callee5, null, [[0, 7]]);
3725
+ }, _callee6, null, [[0, 7]]);
3660
3726
  }));
3661
3727
 
3662
3728
  return function (_x) {
3663
- return _ref5.apply(this, arguments);
3729
+ return _ref6.apply(this, arguments);
3664
3730
  };
3665
3731
  }());
3666
3732
 
3667
- _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onConfirmAddNote", /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee6() {
3733
+ _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onConfirmAddNote", /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee7() {
3668
3734
  var res;
3669
- return _regeneratorRuntime__default['default'].wrap(function _callee6$(_context6) {
3735
+ return _regeneratorRuntime__default['default'].wrap(function _callee7$(_context7) {
3670
3736
  while (1) {
3671
- switch (_context6.prev = _context6.next) {
3737
+ switch (_context7.prev = _context7.next) {
3672
3738
  case 0:
3673
3739
  if (_this.isReadyToSaveNote()) {
3674
- _context6.next = 2;
3740
+ _context7.next = 2;
3675
3741
  break;
3676
3742
  }
3677
3743
 
3678
- return _context6.abrupt("return");
3744
+ return _context7.abrupt("return");
3679
3745
 
3680
3746
  case 2:
3681
- _context6.prev = 2;
3747
+ _context7.prev = 2;
3682
3748
 
3683
3749
  _this.setState({
3684
3750
  submittingNote: true
3685
3751
  });
3686
3752
 
3687
- _context6.next = 6;
3753
+ _context7.next = 6;
3688
3754
  return _this.state.editingNote ? maintenanceActions.editNote(_this.state.jobId, _this.state.editingNote, _this.state.noteInput, _this.state.noteAttachments.map(function (a) {
3689
3755
  return {
3690
3756
  Title: a.Title,
@@ -3698,7 +3764,7 @@ var Job = /*#__PURE__*/function (_Component) {
3698
3764
  }), _this.state.noteImages);
3699
3765
 
3700
3766
  case 6:
3701
- res = _context6.sent;
3767
+ res = _context7.sent;
3702
3768
 
3703
3769
  _this.setState({
3704
3770
  job: res.data.job,
@@ -3712,20 +3778,20 @@ var Job = /*#__PURE__*/function (_Component) {
3712
3778
  _this.props.jobsLoaded([_this.state.job]);
3713
3779
  });
3714
3780
 
3715
- _context6.next = 13;
3781
+ _context7.next = 13;
3716
3782
  break;
3717
3783
 
3718
3784
  case 10:
3719
- _context6.prev = 10;
3720
- _context6.t0 = _context6["catch"](2);
3721
- console.error('onConfirmAddNote', _context6.t0);
3785
+ _context7.prev = 10;
3786
+ _context7.t0 = _context7["catch"](2);
3787
+ console.error('onConfirmAddNote', _context7.t0);
3722
3788
 
3723
3789
  case 13:
3724
3790
  case "end":
3725
- return _context6.stop();
3791
+ return _context7.stop();
3726
3792
  }
3727
3793
  }
3728
- }, _callee6, null, [[2, 10]]);
3794
+ }, _callee7, null, [[2, 10]]);
3729
3795
  })));
3730
3796
 
3731
3797
  _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onDeleteNote", function (n) {
@@ -3773,42 +3839,42 @@ var Job = /*#__PURE__*/function (_Component) {
3773
3839
 
3774
3840
  _this.setState({
3775
3841
  updating: true
3776
- }, /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee7() {
3842
+ }, /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee8() {
3777
3843
  var update;
3778
- return _regeneratorRuntime__default['default'].wrap(function _callee7$(_context7) {
3844
+ return _regeneratorRuntime__default['default'].wrap(function _callee8$(_context8) {
3779
3845
  while (1) {
3780
- switch (_context7.prev = _context7.next) {
3846
+ switch (_context8.prev = _context8.next) {
3781
3847
  case 0:
3782
- _context7.prev = 0;
3848
+ _context8.prev = 0;
3783
3849
  update = {
3784
3850
  id: job.id,
3785
3851
  seen: true,
3786
3852
  status: job.status || 'Unassigned'
3787
3853
  };
3788
- _context7.next = 4;
3854
+ _context8.next = 4;
3789
3855
  return maintenanceActions.editJob(update, auth.site);
3790
3856
 
3791
3857
  case 4:
3792
- _context7.next = 11;
3858
+ _context8.next = 11;
3793
3859
  break;
3794
3860
 
3795
3861
  case 6:
3796
- _context7.prev = 6;
3797
- _context7.t0 = _context7["catch"](0);
3862
+ _context8.prev = 6;
3863
+ _context8.t0 = _context8["catch"](0);
3798
3864
 
3799
3865
  _this.setState({
3800
3866
  updating: false
3801
3867
  });
3802
3868
 
3803
- console.log('markSeen error', _context7.t0);
3869
+ console.log('markSeen error', _context8.t0);
3804
3870
  alert('Something went wrong with the request. Please try again.');
3805
3871
 
3806
3872
  case 11:
3807
3873
  case "end":
3808
- return _context7.stop();
3874
+ return _context8.stop();
3809
3875
  }
3810
3876
  }
3811
- }, _callee7, null, [[0, 6]]);
3877
+ }, _callee8, null, [[0, 6]]);
3812
3878
  })));
3813
3879
  });
3814
3880
 
@@ -3820,44 +3886,44 @@ var Job = /*#__PURE__*/function (_Component) {
3820
3886
  });
3821
3887
  });
3822
3888
 
3823
- _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onAddComment", /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee8() {
3889
+ _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onAddComment", /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee9() {
3824
3890
  var _this$state2, commentInput, jobId, job, comments, res;
3825
3891
 
3826
- return _regeneratorRuntime__default['default'].wrap(function _callee8$(_context8) {
3892
+ return _regeneratorRuntime__default['default'].wrap(function _callee9$(_context9) {
3827
3893
  while (1) {
3828
- switch (_context8.prev = _context8.next) {
3894
+ switch (_context9.prev = _context9.next) {
3829
3895
  case 0:
3830
3896
  _this$state2 = _this.state, commentInput = _this$state2.commentInput, jobId = _this$state2.jobId, job = _this$state2.job, comments = _this$state2.comments;
3831
- _context8.prev = 1;
3897
+ _context9.prev = 1;
3832
3898
 
3833
3899
  _this.setState({
3834
3900
  commentInput: ''
3835
3901
  });
3836
3902
 
3837
- _context8.next = 5;
3903
+ _context9.next = 5;
3838
3904
  return reactionActions.addComment(jobId, values.commentKey, job.title, job.site, commentInput);
3839
3905
 
3840
3906
  case 5:
3841
- res = _context8.sent;
3907
+ res = _context9.sent;
3842
3908
 
3843
3909
  _this.setState({
3844
3910
  comments: [].concat(_toConsumableArray__default['default'](comments), [res.data])
3845
3911
  });
3846
3912
 
3847
- _context8.next = 12;
3913
+ _context9.next = 12;
3848
3914
  break;
3849
3915
 
3850
3916
  case 9:
3851
- _context8.prev = 9;
3852
- _context8.t0 = _context8["catch"](1);
3853
- console.error('onAddComment', _context8.t0);
3917
+ _context9.prev = 9;
3918
+ _context9.t0 = _context9["catch"](1);
3919
+ console.error('onAddComment', _context9.t0);
3854
3920
 
3855
3921
  case 12:
3856
3922
  case "end":
3857
- return _context8.stop();
3923
+ return _context9.stop();
3858
3924
  }
3859
3925
  }
3860
- }, _callee8, null, [[1, 9]]);
3926
+ }, _callee9, null, [[1, 9]]);
3861
3927
  })));
3862
3928
 
3863
3929
  _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onHandleChange", function (event) {
@@ -3874,11 +3940,11 @@ var Job = /*#__PURE__*/function (_Component) {
3874
3940
  });
3875
3941
 
3876
3942
  _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onSelectPriority", /*#__PURE__*/function () {
3877
- var _ref9 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee9(priority) {
3943
+ var _ref10 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee10(priority) {
3878
3944
  var res, job;
3879
- return _regeneratorRuntime__default['default'].wrap(function _callee9$(_context9) {
3945
+ return _regeneratorRuntime__default['default'].wrap(function _callee10$(_context10) {
3880
3946
  while (1) {
3881
- switch (_context9.prev = _context9.next) {
3947
+ switch (_context10.prev = _context10.next) {
3882
3948
  case 0:
3883
3949
  _this.setState({
3884
3950
  job: _objectSpread$4(_objectSpread$4({}, _this.state.job), {}, {
@@ -3887,12 +3953,12 @@ var Job = /*#__PURE__*/function (_Component) {
3887
3953
  priorityChangerOpen: false
3888
3954
  });
3889
3955
 
3890
- _context9.prev = 1;
3891
- _context9.next = 4;
3956
+ _context10.prev = 1;
3957
+ _context10.next = 4;
3892
3958
  return maintenanceActions.editJobPriority(_this.state.job.id, priority);
3893
3959
 
3894
3960
  case 4:
3895
- res = _context9.sent;
3961
+ res = _context10.sent;
3896
3962
  job = res.data.job;
3897
3963
 
3898
3964
  _this.props.jobsLoaded([job]);
@@ -3901,24 +3967,24 @@ var Job = /*#__PURE__*/function (_Component) {
3901
3967
  job: job
3902
3968
  });
3903
3969
 
3904
- _context9.next = 13;
3970
+ _context10.next = 13;
3905
3971
  break;
3906
3972
 
3907
3973
  case 10:
3908
- _context9.prev = 10;
3909
- _context9.t0 = _context9["catch"](1);
3910
- console.error('onSelectPriority', _context9.t0);
3974
+ _context10.prev = 10;
3975
+ _context10.t0 = _context10["catch"](1);
3976
+ console.error('onSelectPriority', _context10.t0);
3911
3977
 
3912
3978
  case 13:
3913
3979
  case "end":
3914
- return _context9.stop();
3980
+ return _context10.stop();
3915
3981
  }
3916
3982
  }
3917
- }, _callee9, null, [[1, 10]]);
3983
+ }, _callee10, null, [[1, 10]]);
3918
3984
  }));
3919
3985
 
3920
3986
  return function (_x2) {
3921
- return _ref9.apply(this, arguments);
3987
+ return _ref10.apply(this, arguments);
3922
3988
  };
3923
3989
  }());
3924
3990
 
@@ -3929,11 +3995,11 @@ var Job = /*#__PURE__*/function (_Component) {
3929
3995
  });
3930
3996
 
3931
3997
  _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onSelectStatus", /*#__PURE__*/function () {
3932
- var _ref10 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee10(status) {
3998
+ var _ref11 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee11(status) {
3933
3999
  var res, job;
3934
- return _regeneratorRuntime__default['default'].wrap(function _callee10$(_context10) {
4000
+ return _regeneratorRuntime__default['default'].wrap(function _callee11$(_context11) {
3935
4001
  while (1) {
3936
- switch (_context10.prev = _context10.next) {
4002
+ switch (_context11.prev = _context11.next) {
3937
4003
  case 0:
3938
4004
  _this.setState({
3939
4005
  job: _objectSpread$4(_objectSpread$4({}, _this.state.job), {}, {
@@ -3942,12 +4008,12 @@ var Job = /*#__PURE__*/function (_Component) {
3942
4008
  statusChangerOpen: false
3943
4009
  });
3944
4010
 
3945
- _context10.prev = 1;
3946
- _context10.next = 4;
4011
+ _context11.prev = 1;
4012
+ _context11.next = 4;
3947
4013
  return maintenanceActions.editJobStatus(_this.state.job.id, status);
3948
4014
 
3949
4015
  case 4:
3950
- res = _context10.sent;
4016
+ res = _context11.sent;
3951
4017
  job = res.data.job;
3952
4018
 
3953
4019
  _this.props.jobsLoaded([job]);
@@ -3956,24 +4022,24 @@ var Job = /*#__PURE__*/function (_Component) {
3956
4022
  job: job
3957
4023
  });
3958
4024
 
3959
- _context10.next = 13;
4025
+ _context11.next = 13;
3960
4026
  break;
3961
4027
 
3962
4028
  case 10:
3963
- _context10.prev = 10;
3964
- _context10.t0 = _context10["catch"](1);
3965
- console.error('onSelectStatus', _context10.t0);
4029
+ _context11.prev = 10;
4030
+ _context11.t0 = _context11["catch"](1);
4031
+ console.error('onSelectStatus', _context11.t0);
3966
4032
 
3967
4033
  case 13:
3968
4034
  case "end":
3969
- return _context10.stop();
4035
+ return _context11.stop();
3970
4036
  }
3971
4037
  }
3972
- }, _callee10, null, [[1, 10]]);
4038
+ }, _callee11, null, [[1, 10]]);
3973
4039
  }));
3974
4040
 
3975
4041
  return function (_x3) {
3976
- return _ref10.apply(this, arguments);
4042
+ return _ref11.apply(this, arguments);
3977
4043
  };
3978
4044
  }());
3979
4045
 
@@ -3993,7 +4059,10 @@ var Job = /*#__PURE__*/function (_Component) {
3993
4059
  noteImages: [],
3994
4060
  assignees: [],
3995
4061
  externalSync: null,
3996
- loadingExternalSync: false
4062
+ loadingExternalSync: false,
4063
+ retryingSync: false,
4064
+ retrySyncError: null,
4065
+ retrySyncInitiated: false
3997
4066
  };
3998
4067
  return _this;
3999
4068
  }
@@ -4525,24 +4594,122 @@ var Job = /*#__PURE__*/function (_Component) {
4525
4594
  className: "flex-1"
4526
4595
  }, "Priority")));
4527
4596
  }
4597
+ }, {
4598
+ key: "hasSyncFailureWithoutSuccess",
4599
+ value: function hasSyncFailureWithoutSuccess() {
4600
+ var job = this.state.job;
4601
+ if (!job || !job.history) return false;
4602
+ var history = job.history || [];
4603
+ var hasSuccess = history.some(function (entry) {
4604
+ return entry.EntryType === 'ExternalIDSet';
4605
+ });
4606
+ var hasFailure = history.some(function (entry) {
4607
+ return entry.EntryType === 'ExternalIDSetFailed';
4608
+ });
4609
+ return hasFailure && !hasSuccess;
4610
+ }
4611
+ }, {
4612
+ key: "renderRetrySyncButton",
4613
+ value: function renderRetrySyncButton() {
4614
+ var auth = this.props.auth;
4615
+ var _this$state3 = this.state,
4616
+ retryingSync = _this$state3.retryingSync,
4617
+ retrySyncInitiated = _this$state3.retrySyncInitiated; // Only show for users with maintenance tracking permission
4618
+
4619
+ if (!Session$3.validateAccess(auth.site, values.permissionMaintenanceTracking, auth)) return null; // Only show if there's a failure without success and retry hasn't been initiated
4620
+
4621
+ if (!this.hasSyncFailureWithoutSuccess() || retrySyncInitiated) return null; // Show spinner while retrying
4622
+
4623
+ if (retryingSync) {
4624
+ return /*#__PURE__*/React__default['default'].createElement(FontAwesome__default['default'], {
4625
+ style: {
4626
+ fontSize: 20,
4627
+ color: Colours$1.COLOUR_DUSK_LIGHT,
4628
+ marginLeft: 8
4629
+ },
4630
+ name: "spinner fa-pulse fa-fw"
4631
+ });
4632
+ }
4633
+
4634
+ return /*#__PURE__*/React__default['default'].createElement("div", {
4635
+ className: "statusLabel pointer",
4636
+ onClick: this.onRetrySync,
4637
+ style: {
4638
+ backgroundColor: Colours$1.COLOUR_RED,
4639
+ marginLeft: 8
4640
+ }
4641
+ }, /*#__PURE__*/React__default['default'].createElement("span", {
4642
+ className: "statusLabel_text"
4643
+ }, "Retry Sync"));
4644
+ }
4645
+ }, {
4646
+ key: "renderExternalSyncStatus",
4647
+ value: function renderExternalSyncStatus() {
4648
+ var _this$state4 = this.state,
4649
+ retrySyncError = _this$state4.retrySyncError,
4650
+ retrySyncInitiated = _this$state4.retrySyncInitiated; // Show error message if retry failed
4651
+
4652
+ if (retrySyncError) {
4653
+ return /*#__PURE__*/React__default['default'].createElement(Components$3.Text, {
4654
+ type: "body"
4655
+ }, /*#__PURE__*/React__default['default'].createElement(FontAwesome__default['default'], {
4656
+ className: "userStatusIcon",
4657
+ name: "times-circle",
4658
+ style: {
4659
+ color: Colours$1.COLOUR_RED
4660
+ }
4661
+ }), " ", retrySyncError);
4662
+ } // Show success message if retry was initiated
4663
+
4664
+
4665
+ if (retrySyncInitiated) {
4666
+ return /*#__PURE__*/React__default['default'].createElement(Components$3.Text, {
4667
+ type: "body"
4668
+ }, /*#__PURE__*/React__default['default'].createElement(FontAwesome__default['default'], {
4669
+ className: "userStatusIcon",
4670
+ name: "check-circle",
4671
+ style: {
4672
+ color: Colours$1.COLOUR_GREEN
4673
+ }
4674
+ }), " Sync retry initiated. Check back shortly for results.");
4675
+ } // Show failure message with instruction
4676
+
4677
+
4678
+ if (this.hasSyncFailureWithoutSuccess()) {
4679
+ return /*#__PURE__*/React__default['default'].createElement(Components$3.Text, {
4680
+ type: "body"
4681
+ }, /*#__PURE__*/React__default['default'].createElement(FontAwesome__default['default'], {
4682
+ className: "userStatusIcon",
4683
+ name: "times-circle",
4684
+ style: {
4685
+ color: Colours$1.COLOUR_RED
4686
+ }
4687
+ }), " External sync failed. Use the retry button to attempt again.");
4688
+ }
4689
+
4690
+ return null;
4691
+ }
4528
4692
  }, {
4529
4693
  key: "renderExternalSync",
4530
4694
  value: function renderExternalSync() {
4531
- var _this$state3 = this.state,
4532
- externalSync = _this$state3.externalSync,
4533
- loadingExternalSync = _this$state3.loadingExternalSync; // Only show if external sync data exists
4695
+ var _this$state5 = this.state,
4696
+ externalSync = _this$state5.externalSync,
4697
+ loadingExternalSync = _this$state5.loadingExternalSync; // Check if we should show this section at all
4698
+
4699
+ var hasExternalSyncData = externalSync && !loadingExternalSync;
4700
+ var hasSyncFailure = this.hasSyncFailureWithoutSuccess(); // Show section if we have sync data OR if there's a failure that can be retried
4534
4701
 
4535
- if (!externalSync || loadingExternalSync) return null;
4702
+ if (!hasExternalSyncData && !hasSyncFailure) return null;
4536
4703
  return /*#__PURE__*/React__default['default'].createElement("div", {
4537
4704
  className: "padding-32 paddingVertical-40 bottomDivideBorder relative"
4538
4705
  }, /*#__PURE__*/React__default['default'].createElement("div", {
4539
4706
  className: "newTopBar clearfix flex flex-reverse"
4540
- }, /*#__PURE__*/React__default['default'].createElement(Components$3.Text, {
4707
+ }, this.renderRetrySyncButton(), /*#__PURE__*/React__default['default'].createElement(Components$3.Text, {
4541
4708
  type: "formTitleSmall",
4542
4709
  className: "flex-1"
4543
4710
  }, "External Sync")), /*#__PURE__*/React__default['default'].createElement("div", {
4544
4711
  className: "marginTop-16"
4545
- }, externalSync.systemType && /*#__PURE__*/React__default['default'].createElement(Components$3.Text, {
4712
+ }, hasExternalSyncData ? /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, externalSync.systemType && /*#__PURE__*/React__default['default'].createElement(Components$3.Text, {
4546
4713
  type: "body",
4547
4714
  className: "marginBottom-8"
4548
4715
  }, /*#__PURE__*/React__default['default'].createElement("strong", null, "System:"), " ", externalSync.systemType), externalSync.externalId && /*#__PURE__*/React__default['default'].createElement(Components$3.Text, {
@@ -4551,7 +4718,7 @@ var Job = /*#__PURE__*/function (_Component) {
4551
4718
  }, /*#__PURE__*/React__default['default'].createElement("strong", null, "External ID:"), " ", externalSync.externalId), externalSync.syncedAt && /*#__PURE__*/React__default['default'].createElement(Components$3.Text, {
4552
4719
  type: "body",
4553
4720
  className: "marginBottom-8"
4554
- }, /*#__PURE__*/React__default['default'].createElement("strong", null, "Synced:"), " ", moment__default['default'].utc(externalSync.syncedAt).local().format('D MMM YYYY h:mma'))));
4721
+ }, /*#__PURE__*/React__default['default'].createElement("strong", null, "Synced:"), " ", moment__default['default'].utc(externalSync.syncedAt).local().format('D MMM YYYY h:mma'))) : this.renderExternalSyncStatus()));
4555
4722
  }
4556
4723
  }, {
4557
4724
  key: "renderOverview",
@@ -4709,8 +4876,8 @@ var Job = /*#__PURE__*/function (_Component) {
4709
4876
  }), /*#__PURE__*/React__default['default'].createElement("p", {
4710
4877
  className: "iconTextButton_text"
4711
4878
  }, "Add Attachment")), /*#__PURE__*/React__default['default'].createElement(Components$3.ImageInput, {
4712
- ref: function ref(_ref11) {
4713
- _this8.imageInput = _ref11;
4879
+ ref: function ref(_ref12) {
4880
+ _this8.imageInput = _ref12;
4714
4881
  },
4715
4882
  multiple: true,
4716
4883
  refreshCallback: function refreshCallback(images) {