@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.esm.js CHANGED
@@ -465,6 +465,15 @@ var maintenanceActions = {
465
465
  id: jobId
466
466
  })
467
467
  });
468
+ },
469
+ retrySync: function retrySync(jobId) {
470
+ return Session$9.authedFunction({
471
+ method: 'POST',
472
+ url: Helper$5.getUrl(values.serviceKey, 'update/retrysync'),
473
+ data: {
474
+ id: jobId
475
+ }
476
+ });
468
477
  }
469
478
  };
470
479
 
@@ -3378,6 +3387,63 @@ var Job = /*#__PURE__*/function (_Component) {
3378
3387
  }, _callee3, null, [[0, 8]]);
3379
3388
  })));
3380
3389
 
3390
+ _defineProperty(_assertThisInitialized(_this), "onRetrySync", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
3391
+ var job, errorMessage;
3392
+ return _regeneratorRuntime.wrap(function _callee4$(_context4) {
3393
+ while (1) {
3394
+ switch (_context4.prev = _context4.next) {
3395
+ case 0:
3396
+ job = _this.state.job;
3397
+
3398
+ if (!(!job || _this.state.retryingSync)) {
3399
+ _context4.next = 3;
3400
+ break;
3401
+ }
3402
+
3403
+ return _context4.abrupt("return");
3404
+
3405
+ case 3:
3406
+ _this.setState({
3407
+ retryingSync: true,
3408
+ retrySyncError: null
3409
+ });
3410
+
3411
+ _context4.prev = 4;
3412
+ _context4.next = 7;
3413
+ return maintenanceActions.retrySync(job.id);
3414
+
3415
+ case 7:
3416
+ _context4.next = 9;
3417
+ return _this.getJob();
3418
+
3419
+ case 9:
3420
+ _this.setState({
3421
+ retryingSync: false,
3422
+ retrySyncInitiated: true
3423
+ });
3424
+
3425
+ _context4.next = 17;
3426
+ break;
3427
+
3428
+ case 12:
3429
+ _context4.prev = 12;
3430
+ _context4.t0 = _context4["catch"](4);
3431
+ console.error('onRetrySync', _context4.t0);
3432
+ errorMessage = _context4.t0 && _context4.t0.response && _context4.t0.response.data && _context4.t0.response.data.error || 'Failed to retry sync. Please try again.';
3433
+
3434
+ _this.setState({
3435
+ retryingSync: false,
3436
+ retrySyncError: errorMessage
3437
+ });
3438
+
3439
+ case 17:
3440
+ case "end":
3441
+ return _context4.stop();
3442
+ }
3443
+ }
3444
+ }, _callee4, null, [[4, 12]]);
3445
+ })));
3446
+
3381
3447
  _defineProperty(_assertThisInitialized(_this), "getStatusType", function (status) {
3382
3448
  var statusTypes = _this.props.statusTypes;
3383
3449
  var statusType = statusTypes.find(function (s) {
@@ -3543,35 +3609,35 @@ var Job = /*#__PURE__*/function (_Component) {
3543
3609
  });
3544
3610
  });
3545
3611
 
3546
- _defineProperty(_assertThisInitialized(_this), "onConfirmAssignee", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
3547
- return _regeneratorRuntime.wrap(function _callee4$(_context4) {
3612
+ _defineProperty(_assertThisInitialized(_this), "onConfirmAssignee", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
3613
+ return _regeneratorRuntime.wrap(function _callee5$(_context5) {
3548
3614
  while (1) {
3549
- switch (_context4.prev = _context4.next) {
3615
+ switch (_context5.prev = _context5.next) {
3550
3616
  case 0:
3551
3617
  _this.setState({
3552
3618
  confirmingAssignee: true
3553
3619
  });
3554
3620
 
3555
- _context4.prev = 1;
3621
+ _context5.prev = 1;
3556
3622
 
3557
3623
  if (!_this.state.selectedAssignee) {
3558
- _context4.next = 5;
3624
+ _context5.next = 5;
3559
3625
  break;
3560
3626
  }
3561
3627
 
3562
- _context4.next = 5;
3628
+ _context5.next = 5;
3563
3629
  return _this.onAssignUser(_this.state.selectedAssignee.id);
3564
3630
 
3565
3631
  case 5:
3566
3632
  _this.onCloseSelectAssignee();
3567
3633
 
3568
- _context4.next = 11;
3634
+ _context5.next = 11;
3569
3635
  break;
3570
3636
 
3571
3637
  case 8:
3572
- _context4.prev = 8;
3573
- _context4.t0 = _context4["catch"](1);
3574
- console.error('onConfirmAssignee', _context4.t0);
3638
+ _context5.prev = 8;
3639
+ _context5.t0 = _context5["catch"](1);
3640
+ console.error('onConfirmAssignee', _context5.t0);
3575
3641
 
3576
3642
  case 11:
3577
3643
  _this.setState({
@@ -3580,68 +3646,68 @@ var Job = /*#__PURE__*/function (_Component) {
3580
3646
 
3581
3647
  case 12:
3582
3648
  case "end":
3583
- return _context4.stop();
3649
+ return _context5.stop();
3584
3650
  }
3585
3651
  }
3586
- }, _callee4, null, [[1, 8]]);
3652
+ }, _callee5, null, [[1, 8]]);
3587
3653
  })));
3588
3654
 
3589
3655
  _defineProperty(_assertThisInitialized(_this), "onAssignUser", /*#__PURE__*/function () {
3590
- var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(userId) {
3591
- return _regeneratorRuntime.wrap(function _callee5$(_context5) {
3656
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(userId) {
3657
+ return _regeneratorRuntime.wrap(function _callee6$(_context6) {
3592
3658
  while (1) {
3593
- switch (_context5.prev = _context5.next) {
3659
+ switch (_context6.prev = _context6.next) {
3594
3660
  case 0:
3595
- _context5.prev = 0;
3596
- _context5.next = 3;
3661
+ _context6.prev = 0;
3662
+ _context6.next = 3;
3597
3663
  return maintenanceActions.assignJob(_this.state.jobId, userId);
3598
3664
 
3599
3665
  case 3:
3600
3666
 
3601
3667
  _this.getJob();
3602
3668
 
3603
- _context5.next = 10;
3669
+ _context6.next = 10;
3604
3670
  break;
3605
3671
 
3606
3672
  case 7:
3607
- _context5.prev = 7;
3608
- _context5.t0 = _context5["catch"](0);
3609
- console.error('onAssignUser', _context5.t0);
3673
+ _context6.prev = 7;
3674
+ _context6.t0 = _context6["catch"](0);
3675
+ console.error('onAssignUser', _context6.t0);
3610
3676
 
3611
3677
  case 10:
3612
3678
  case "end":
3613
- return _context5.stop();
3679
+ return _context6.stop();
3614
3680
  }
3615
3681
  }
3616
- }, _callee5, null, [[0, 7]]);
3682
+ }, _callee6, null, [[0, 7]]);
3617
3683
  }));
3618
3684
 
3619
3685
  return function (_x) {
3620
- return _ref5.apply(this, arguments);
3686
+ return _ref6.apply(this, arguments);
3621
3687
  };
3622
3688
  }());
3623
3689
 
3624
- _defineProperty(_assertThisInitialized(_this), "onConfirmAddNote", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
3690
+ _defineProperty(_assertThisInitialized(_this), "onConfirmAddNote", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
3625
3691
  var res;
3626
- return _regeneratorRuntime.wrap(function _callee6$(_context6) {
3692
+ return _regeneratorRuntime.wrap(function _callee7$(_context7) {
3627
3693
  while (1) {
3628
- switch (_context6.prev = _context6.next) {
3694
+ switch (_context7.prev = _context7.next) {
3629
3695
  case 0:
3630
3696
  if (_this.isReadyToSaveNote()) {
3631
- _context6.next = 2;
3697
+ _context7.next = 2;
3632
3698
  break;
3633
3699
  }
3634
3700
 
3635
- return _context6.abrupt("return");
3701
+ return _context7.abrupt("return");
3636
3702
 
3637
3703
  case 2:
3638
- _context6.prev = 2;
3704
+ _context7.prev = 2;
3639
3705
 
3640
3706
  _this.setState({
3641
3707
  submittingNote: true
3642
3708
  });
3643
3709
 
3644
- _context6.next = 6;
3710
+ _context7.next = 6;
3645
3711
  return _this.state.editingNote ? maintenanceActions.editNote(_this.state.jobId, _this.state.editingNote, _this.state.noteInput, _this.state.noteAttachments.map(function (a) {
3646
3712
  return {
3647
3713
  Title: a.Title,
@@ -3655,7 +3721,7 @@ var Job = /*#__PURE__*/function (_Component) {
3655
3721
  }), _this.state.noteImages);
3656
3722
 
3657
3723
  case 6:
3658
- res = _context6.sent;
3724
+ res = _context7.sent;
3659
3725
 
3660
3726
  _this.setState({
3661
3727
  job: res.data.job,
@@ -3669,20 +3735,20 @@ var Job = /*#__PURE__*/function (_Component) {
3669
3735
  _this.props.jobsLoaded([_this.state.job]);
3670
3736
  });
3671
3737
 
3672
- _context6.next = 13;
3738
+ _context7.next = 13;
3673
3739
  break;
3674
3740
 
3675
3741
  case 10:
3676
- _context6.prev = 10;
3677
- _context6.t0 = _context6["catch"](2);
3678
- console.error('onConfirmAddNote', _context6.t0);
3742
+ _context7.prev = 10;
3743
+ _context7.t0 = _context7["catch"](2);
3744
+ console.error('onConfirmAddNote', _context7.t0);
3679
3745
 
3680
3746
  case 13:
3681
3747
  case "end":
3682
- return _context6.stop();
3748
+ return _context7.stop();
3683
3749
  }
3684
3750
  }
3685
- }, _callee6, null, [[2, 10]]);
3751
+ }, _callee7, null, [[2, 10]]);
3686
3752
  })));
3687
3753
 
3688
3754
  _defineProperty(_assertThisInitialized(_this), "onDeleteNote", function (n) {
@@ -3730,42 +3796,42 @@ var Job = /*#__PURE__*/function (_Component) {
3730
3796
 
3731
3797
  _this.setState({
3732
3798
  updating: true
3733
- }, /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
3799
+ }, /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
3734
3800
  var update;
3735
- return _regeneratorRuntime.wrap(function _callee7$(_context7) {
3801
+ return _regeneratorRuntime.wrap(function _callee8$(_context8) {
3736
3802
  while (1) {
3737
- switch (_context7.prev = _context7.next) {
3803
+ switch (_context8.prev = _context8.next) {
3738
3804
  case 0:
3739
- _context7.prev = 0;
3805
+ _context8.prev = 0;
3740
3806
  update = {
3741
3807
  id: job.id,
3742
3808
  seen: true,
3743
3809
  status: job.status || 'Unassigned'
3744
3810
  };
3745
- _context7.next = 4;
3811
+ _context8.next = 4;
3746
3812
  return maintenanceActions.editJob(update, auth.site);
3747
3813
 
3748
3814
  case 4:
3749
- _context7.next = 11;
3815
+ _context8.next = 11;
3750
3816
  break;
3751
3817
 
3752
3818
  case 6:
3753
- _context7.prev = 6;
3754
- _context7.t0 = _context7["catch"](0);
3819
+ _context8.prev = 6;
3820
+ _context8.t0 = _context8["catch"](0);
3755
3821
 
3756
3822
  _this.setState({
3757
3823
  updating: false
3758
3824
  });
3759
3825
 
3760
- console.log('markSeen error', _context7.t0);
3826
+ console.log('markSeen error', _context8.t0);
3761
3827
  alert('Something went wrong with the request. Please try again.');
3762
3828
 
3763
3829
  case 11:
3764
3830
  case "end":
3765
- return _context7.stop();
3831
+ return _context8.stop();
3766
3832
  }
3767
3833
  }
3768
- }, _callee7, null, [[0, 6]]);
3834
+ }, _callee8, null, [[0, 6]]);
3769
3835
  })));
3770
3836
  });
3771
3837
 
@@ -3777,44 +3843,44 @@ var Job = /*#__PURE__*/function (_Component) {
3777
3843
  });
3778
3844
  });
3779
3845
 
3780
- _defineProperty(_assertThisInitialized(_this), "onAddComment", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
3846
+ _defineProperty(_assertThisInitialized(_this), "onAddComment", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9() {
3781
3847
  var _this$state2, commentInput, jobId, job, comments, res;
3782
3848
 
3783
- return _regeneratorRuntime.wrap(function _callee8$(_context8) {
3849
+ return _regeneratorRuntime.wrap(function _callee9$(_context9) {
3784
3850
  while (1) {
3785
- switch (_context8.prev = _context8.next) {
3851
+ switch (_context9.prev = _context9.next) {
3786
3852
  case 0:
3787
3853
  _this$state2 = _this.state, commentInput = _this$state2.commentInput, jobId = _this$state2.jobId, job = _this$state2.job, comments = _this$state2.comments;
3788
- _context8.prev = 1;
3854
+ _context9.prev = 1;
3789
3855
 
3790
3856
  _this.setState({
3791
3857
  commentInput: ''
3792
3858
  });
3793
3859
 
3794
- _context8.next = 5;
3860
+ _context9.next = 5;
3795
3861
  return reactionActions.addComment(jobId, values.commentKey, job.title, job.site, commentInput);
3796
3862
 
3797
3863
  case 5:
3798
- res = _context8.sent;
3864
+ res = _context9.sent;
3799
3865
 
3800
3866
  _this.setState({
3801
3867
  comments: [].concat(_toConsumableArray(comments), [res.data])
3802
3868
  });
3803
3869
 
3804
- _context8.next = 12;
3870
+ _context9.next = 12;
3805
3871
  break;
3806
3872
 
3807
3873
  case 9:
3808
- _context8.prev = 9;
3809
- _context8.t0 = _context8["catch"](1);
3810
- console.error('onAddComment', _context8.t0);
3874
+ _context9.prev = 9;
3875
+ _context9.t0 = _context9["catch"](1);
3876
+ console.error('onAddComment', _context9.t0);
3811
3877
 
3812
3878
  case 12:
3813
3879
  case "end":
3814
- return _context8.stop();
3880
+ return _context9.stop();
3815
3881
  }
3816
3882
  }
3817
- }, _callee8, null, [[1, 9]]);
3883
+ }, _callee9, null, [[1, 9]]);
3818
3884
  })));
3819
3885
 
3820
3886
  _defineProperty(_assertThisInitialized(_this), "onHandleChange", function (event) {
@@ -3831,11 +3897,11 @@ var Job = /*#__PURE__*/function (_Component) {
3831
3897
  });
3832
3898
 
3833
3899
  _defineProperty(_assertThisInitialized(_this), "onSelectPriority", /*#__PURE__*/function () {
3834
- var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(priority) {
3900
+ var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(priority) {
3835
3901
  var res, job;
3836
- return _regeneratorRuntime.wrap(function _callee9$(_context9) {
3902
+ return _regeneratorRuntime.wrap(function _callee10$(_context10) {
3837
3903
  while (1) {
3838
- switch (_context9.prev = _context9.next) {
3904
+ switch (_context10.prev = _context10.next) {
3839
3905
  case 0:
3840
3906
  _this.setState({
3841
3907
  job: _objectSpread$4(_objectSpread$4({}, _this.state.job), {}, {
@@ -3844,12 +3910,12 @@ var Job = /*#__PURE__*/function (_Component) {
3844
3910
  priorityChangerOpen: false
3845
3911
  });
3846
3912
 
3847
- _context9.prev = 1;
3848
- _context9.next = 4;
3913
+ _context10.prev = 1;
3914
+ _context10.next = 4;
3849
3915
  return maintenanceActions.editJobPriority(_this.state.job.id, priority);
3850
3916
 
3851
3917
  case 4:
3852
- res = _context9.sent;
3918
+ res = _context10.sent;
3853
3919
  job = res.data.job;
3854
3920
 
3855
3921
  _this.props.jobsLoaded([job]);
@@ -3858,24 +3924,24 @@ var Job = /*#__PURE__*/function (_Component) {
3858
3924
  job: job
3859
3925
  });
3860
3926
 
3861
- _context9.next = 13;
3927
+ _context10.next = 13;
3862
3928
  break;
3863
3929
 
3864
3930
  case 10:
3865
- _context9.prev = 10;
3866
- _context9.t0 = _context9["catch"](1);
3867
- console.error('onSelectPriority', _context9.t0);
3931
+ _context10.prev = 10;
3932
+ _context10.t0 = _context10["catch"](1);
3933
+ console.error('onSelectPriority', _context10.t0);
3868
3934
 
3869
3935
  case 13:
3870
3936
  case "end":
3871
- return _context9.stop();
3937
+ return _context10.stop();
3872
3938
  }
3873
3939
  }
3874
- }, _callee9, null, [[1, 10]]);
3940
+ }, _callee10, null, [[1, 10]]);
3875
3941
  }));
3876
3942
 
3877
3943
  return function (_x2) {
3878
- return _ref9.apply(this, arguments);
3944
+ return _ref10.apply(this, arguments);
3879
3945
  };
3880
3946
  }());
3881
3947
 
@@ -3886,11 +3952,11 @@ var Job = /*#__PURE__*/function (_Component) {
3886
3952
  });
3887
3953
 
3888
3954
  _defineProperty(_assertThisInitialized(_this), "onSelectStatus", /*#__PURE__*/function () {
3889
- var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(status) {
3955
+ var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(status) {
3890
3956
  var res, job;
3891
- return _regeneratorRuntime.wrap(function _callee10$(_context10) {
3957
+ return _regeneratorRuntime.wrap(function _callee11$(_context11) {
3892
3958
  while (1) {
3893
- switch (_context10.prev = _context10.next) {
3959
+ switch (_context11.prev = _context11.next) {
3894
3960
  case 0:
3895
3961
  _this.setState({
3896
3962
  job: _objectSpread$4(_objectSpread$4({}, _this.state.job), {}, {
@@ -3899,12 +3965,12 @@ var Job = /*#__PURE__*/function (_Component) {
3899
3965
  statusChangerOpen: false
3900
3966
  });
3901
3967
 
3902
- _context10.prev = 1;
3903
- _context10.next = 4;
3968
+ _context11.prev = 1;
3969
+ _context11.next = 4;
3904
3970
  return maintenanceActions.editJobStatus(_this.state.job.id, status);
3905
3971
 
3906
3972
  case 4:
3907
- res = _context10.sent;
3973
+ res = _context11.sent;
3908
3974
  job = res.data.job;
3909
3975
 
3910
3976
  _this.props.jobsLoaded([job]);
@@ -3913,24 +3979,24 @@ var Job = /*#__PURE__*/function (_Component) {
3913
3979
  job: job
3914
3980
  });
3915
3981
 
3916
- _context10.next = 13;
3982
+ _context11.next = 13;
3917
3983
  break;
3918
3984
 
3919
3985
  case 10:
3920
- _context10.prev = 10;
3921
- _context10.t0 = _context10["catch"](1);
3922
- console.error('onSelectStatus', _context10.t0);
3986
+ _context11.prev = 10;
3987
+ _context11.t0 = _context11["catch"](1);
3988
+ console.error('onSelectStatus', _context11.t0);
3923
3989
 
3924
3990
  case 13:
3925
3991
  case "end":
3926
- return _context10.stop();
3992
+ return _context11.stop();
3927
3993
  }
3928
3994
  }
3929
- }, _callee10, null, [[1, 10]]);
3995
+ }, _callee11, null, [[1, 10]]);
3930
3996
  }));
3931
3997
 
3932
3998
  return function (_x3) {
3933
- return _ref10.apply(this, arguments);
3999
+ return _ref11.apply(this, arguments);
3934
4000
  };
3935
4001
  }());
3936
4002
 
@@ -3950,7 +4016,10 @@ var Job = /*#__PURE__*/function (_Component) {
3950
4016
  noteImages: [],
3951
4017
  assignees: [],
3952
4018
  externalSync: null,
3953
- loadingExternalSync: false
4019
+ loadingExternalSync: false,
4020
+ retryingSync: false,
4021
+ retrySyncError: null,
4022
+ retrySyncInitiated: false
3954
4023
  };
3955
4024
  return _this;
3956
4025
  }
@@ -4482,24 +4551,122 @@ var Job = /*#__PURE__*/function (_Component) {
4482
4551
  className: "flex-1"
4483
4552
  }, "Priority")));
4484
4553
  }
4554
+ }, {
4555
+ key: "hasSyncFailureWithoutSuccess",
4556
+ value: function hasSyncFailureWithoutSuccess() {
4557
+ var job = this.state.job;
4558
+ if (!job || !job.history) return false;
4559
+ var history = job.history || [];
4560
+ var hasSuccess = history.some(function (entry) {
4561
+ return entry.EntryType === 'ExternalIDSet';
4562
+ });
4563
+ var hasFailure = history.some(function (entry) {
4564
+ return entry.EntryType === 'ExternalIDSetFailed';
4565
+ });
4566
+ return hasFailure && !hasSuccess;
4567
+ }
4568
+ }, {
4569
+ key: "renderRetrySyncButton",
4570
+ value: function renderRetrySyncButton() {
4571
+ var auth = this.props.auth;
4572
+ var _this$state3 = this.state,
4573
+ retryingSync = _this$state3.retryingSync,
4574
+ retrySyncInitiated = _this$state3.retrySyncInitiated; // Only show for users with maintenance tracking permission
4575
+
4576
+ 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
4577
+
4578
+ if (!this.hasSyncFailureWithoutSuccess() || retrySyncInitiated) return null; // Show spinner while retrying
4579
+
4580
+ if (retryingSync) {
4581
+ return /*#__PURE__*/React.createElement(FontAwesome, {
4582
+ style: {
4583
+ fontSize: 20,
4584
+ color: Colours$1.COLOUR_DUSK_LIGHT,
4585
+ marginLeft: 8
4586
+ },
4587
+ name: "spinner fa-pulse fa-fw"
4588
+ });
4589
+ }
4590
+
4591
+ return /*#__PURE__*/React.createElement("div", {
4592
+ className: "statusLabel pointer",
4593
+ onClick: this.onRetrySync,
4594
+ style: {
4595
+ backgroundColor: Colours$1.COLOUR_RED,
4596
+ marginLeft: 8
4597
+ }
4598
+ }, /*#__PURE__*/React.createElement("span", {
4599
+ className: "statusLabel_text"
4600
+ }, "Retry Sync"));
4601
+ }
4602
+ }, {
4603
+ key: "renderExternalSyncStatus",
4604
+ value: function renderExternalSyncStatus() {
4605
+ var _this$state4 = this.state,
4606
+ retrySyncError = _this$state4.retrySyncError,
4607
+ retrySyncInitiated = _this$state4.retrySyncInitiated; // Show error message if retry failed
4608
+
4609
+ if (retrySyncError) {
4610
+ return /*#__PURE__*/React.createElement(Components$3.Text, {
4611
+ type: "body"
4612
+ }, /*#__PURE__*/React.createElement(FontAwesome, {
4613
+ className: "userStatusIcon",
4614
+ name: "times-circle",
4615
+ style: {
4616
+ color: Colours$1.COLOUR_RED
4617
+ }
4618
+ }), " ", retrySyncError);
4619
+ } // Show success message if retry was initiated
4620
+
4621
+
4622
+ if (retrySyncInitiated) {
4623
+ return /*#__PURE__*/React.createElement(Components$3.Text, {
4624
+ type: "body"
4625
+ }, /*#__PURE__*/React.createElement(FontAwesome, {
4626
+ className: "userStatusIcon",
4627
+ name: "check-circle",
4628
+ style: {
4629
+ color: Colours$1.COLOUR_GREEN
4630
+ }
4631
+ }), " Sync retry initiated. Check back shortly for results.");
4632
+ } // Show failure message with instruction
4633
+
4634
+
4635
+ if (this.hasSyncFailureWithoutSuccess()) {
4636
+ return /*#__PURE__*/React.createElement(Components$3.Text, {
4637
+ type: "body"
4638
+ }, /*#__PURE__*/React.createElement(FontAwesome, {
4639
+ className: "userStatusIcon",
4640
+ name: "times-circle",
4641
+ style: {
4642
+ color: Colours$1.COLOUR_RED
4643
+ }
4644
+ }), " External sync failed. Use the retry button to attempt again.");
4645
+ }
4646
+
4647
+ return null;
4648
+ }
4485
4649
  }, {
4486
4650
  key: "renderExternalSync",
4487
4651
  value: function renderExternalSync() {
4488
- var _this$state3 = this.state,
4489
- externalSync = _this$state3.externalSync,
4490
- loadingExternalSync = _this$state3.loadingExternalSync; // Only show if external sync data exists
4652
+ var _this$state5 = this.state,
4653
+ externalSync = _this$state5.externalSync,
4654
+ loadingExternalSync = _this$state5.loadingExternalSync; // Check if we should show this section at all
4655
+
4656
+ var hasExternalSyncData = externalSync && !loadingExternalSync;
4657
+ var hasSyncFailure = this.hasSyncFailureWithoutSuccess(); // Show section if we have sync data OR if there's a failure that can be retried
4491
4658
 
4492
- if (!externalSync || loadingExternalSync) return null;
4659
+ if (!hasExternalSyncData && !hasSyncFailure) return null;
4493
4660
  return /*#__PURE__*/React.createElement("div", {
4494
4661
  className: "padding-32 paddingVertical-40 bottomDivideBorder relative"
4495
4662
  }, /*#__PURE__*/React.createElement("div", {
4496
4663
  className: "newTopBar clearfix flex flex-reverse"
4497
- }, /*#__PURE__*/React.createElement(Components$3.Text, {
4664
+ }, this.renderRetrySyncButton(), /*#__PURE__*/React.createElement(Components$3.Text, {
4498
4665
  type: "formTitleSmall",
4499
4666
  className: "flex-1"
4500
4667
  }, "External Sync")), /*#__PURE__*/React.createElement("div", {
4501
4668
  className: "marginTop-16"
4502
- }, externalSync.systemType && /*#__PURE__*/React.createElement(Components$3.Text, {
4669
+ }, hasExternalSyncData ? /*#__PURE__*/React.createElement(React.Fragment, null, externalSync.systemType && /*#__PURE__*/React.createElement(Components$3.Text, {
4503
4670
  type: "body",
4504
4671
  className: "marginBottom-8"
4505
4672
  }, /*#__PURE__*/React.createElement("strong", null, "System:"), " ", externalSync.systemType), externalSync.externalId && /*#__PURE__*/React.createElement(Components$3.Text, {
@@ -4508,7 +4675,7 @@ var Job = /*#__PURE__*/function (_Component) {
4508
4675
  }, /*#__PURE__*/React.createElement("strong", null, "External ID:"), " ", externalSync.externalId), externalSync.syncedAt && /*#__PURE__*/React.createElement(Components$3.Text, {
4509
4676
  type: "body",
4510
4677
  className: "marginBottom-8"
4511
- }, /*#__PURE__*/React.createElement("strong", null, "Synced:"), " ", moment.utc(externalSync.syncedAt).local().format('D MMM YYYY h:mma'))));
4678
+ }, /*#__PURE__*/React.createElement("strong", null, "Synced:"), " ", moment.utc(externalSync.syncedAt).local().format('D MMM YYYY h:mma'))) : this.renderExternalSyncStatus()));
4512
4679
  }
4513
4680
  }, {
4514
4681
  key: "renderOverview",
@@ -4666,8 +4833,8 @@ var Job = /*#__PURE__*/function (_Component) {
4666
4833
  }), /*#__PURE__*/React.createElement("p", {
4667
4834
  className: "iconTextButton_text"
4668
4835
  }, "Add Attachment")), /*#__PURE__*/React.createElement(Components$3.ImageInput, {
4669
- ref: function ref(_ref11) {
4670
- _this8.imageInput = _ref11;
4836
+ ref: function ref(_ref12) {
4837
+ _this8.imageInput = _ref12;
4671
4838
  },
4672
4839
  multiple: true,
4673
4840
  refreshCallback: function refreshCallback(images) {