@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.umd.js CHANGED
@@ -487,6 +487,15 @@
487
487
  id: jobId
488
488
  })
489
489
  });
490
+ },
491
+ retrySync: function retrySync(jobId) {
492
+ return Session$9.authedFunction({
493
+ method: 'POST',
494
+ url: Helper$5.getUrl(values.serviceKey, 'update/retrysync'),
495
+ data: {
496
+ id: jobId
497
+ }
498
+ });
490
499
  }
491
500
  };
492
501
 
@@ -3400,6 +3409,63 @@
3400
3409
  }, _callee3, null, [[0, 8]]);
3401
3410
  })));
3402
3411
 
3412
+ _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onRetrySync", /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee4() {
3413
+ var job, errorMessage;
3414
+ return _regeneratorRuntime__default['default'].wrap(function _callee4$(_context4) {
3415
+ while (1) {
3416
+ switch (_context4.prev = _context4.next) {
3417
+ case 0:
3418
+ job = _this.state.job;
3419
+
3420
+ if (!(!job || _this.state.retryingSync)) {
3421
+ _context4.next = 3;
3422
+ break;
3423
+ }
3424
+
3425
+ return _context4.abrupt("return");
3426
+
3427
+ case 3:
3428
+ _this.setState({
3429
+ retryingSync: true,
3430
+ retrySyncError: null
3431
+ });
3432
+
3433
+ _context4.prev = 4;
3434
+ _context4.next = 7;
3435
+ return maintenanceActions.retrySync(job.id);
3436
+
3437
+ case 7:
3438
+ _context4.next = 9;
3439
+ return _this.getJob();
3440
+
3441
+ case 9:
3442
+ _this.setState({
3443
+ retryingSync: false,
3444
+ retrySyncInitiated: true
3445
+ });
3446
+
3447
+ _context4.next = 17;
3448
+ break;
3449
+
3450
+ case 12:
3451
+ _context4.prev = 12;
3452
+ _context4.t0 = _context4["catch"](4);
3453
+ console.error('onRetrySync', _context4.t0);
3454
+ errorMessage = _context4.t0 && _context4.t0.response && _context4.t0.response.data && _context4.t0.response.data.error || 'Failed to retry sync. Please try again.';
3455
+
3456
+ _this.setState({
3457
+ retryingSync: false,
3458
+ retrySyncError: errorMessage
3459
+ });
3460
+
3461
+ case 17:
3462
+ case "end":
3463
+ return _context4.stop();
3464
+ }
3465
+ }
3466
+ }, _callee4, null, [[4, 12]]);
3467
+ })));
3468
+
3403
3469
  _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "getStatusType", function (status) {
3404
3470
  var statusTypes = _this.props.statusTypes;
3405
3471
  var statusType = statusTypes.find(function (s) {
@@ -3565,35 +3631,35 @@
3565
3631
  });
3566
3632
  });
3567
3633
 
3568
- _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onConfirmAssignee", /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee4() {
3569
- return _regeneratorRuntime__default['default'].wrap(function _callee4$(_context4) {
3634
+ _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onConfirmAssignee", /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee5() {
3635
+ return _regeneratorRuntime__default['default'].wrap(function _callee5$(_context5) {
3570
3636
  while (1) {
3571
- switch (_context4.prev = _context4.next) {
3637
+ switch (_context5.prev = _context5.next) {
3572
3638
  case 0:
3573
3639
  _this.setState({
3574
3640
  confirmingAssignee: true
3575
3641
  });
3576
3642
 
3577
- _context4.prev = 1;
3643
+ _context5.prev = 1;
3578
3644
 
3579
3645
  if (!_this.state.selectedAssignee) {
3580
- _context4.next = 5;
3646
+ _context5.next = 5;
3581
3647
  break;
3582
3648
  }
3583
3649
 
3584
- _context4.next = 5;
3650
+ _context5.next = 5;
3585
3651
  return _this.onAssignUser(_this.state.selectedAssignee.id);
3586
3652
 
3587
3653
  case 5:
3588
3654
  _this.onCloseSelectAssignee();
3589
3655
 
3590
- _context4.next = 11;
3656
+ _context5.next = 11;
3591
3657
  break;
3592
3658
 
3593
3659
  case 8:
3594
- _context4.prev = 8;
3595
- _context4.t0 = _context4["catch"](1);
3596
- console.error('onConfirmAssignee', _context4.t0);
3660
+ _context5.prev = 8;
3661
+ _context5.t0 = _context5["catch"](1);
3662
+ console.error('onConfirmAssignee', _context5.t0);
3597
3663
 
3598
3664
  case 11:
3599
3665
  _this.setState({
@@ -3602,68 +3668,68 @@
3602
3668
 
3603
3669
  case 12:
3604
3670
  case "end":
3605
- return _context4.stop();
3671
+ return _context5.stop();
3606
3672
  }
3607
3673
  }
3608
- }, _callee4, null, [[1, 8]]);
3674
+ }, _callee5, null, [[1, 8]]);
3609
3675
  })));
3610
3676
 
3611
3677
  _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onAssignUser", /*#__PURE__*/function () {
3612
- var _ref5 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee5(userId) {
3613
- return _regeneratorRuntime__default['default'].wrap(function _callee5$(_context5) {
3678
+ var _ref6 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee6(userId) {
3679
+ return _regeneratorRuntime__default['default'].wrap(function _callee6$(_context6) {
3614
3680
  while (1) {
3615
- switch (_context5.prev = _context5.next) {
3681
+ switch (_context6.prev = _context6.next) {
3616
3682
  case 0:
3617
- _context5.prev = 0;
3618
- _context5.next = 3;
3683
+ _context6.prev = 0;
3684
+ _context6.next = 3;
3619
3685
  return maintenanceActions.assignJob(_this.state.jobId, userId);
3620
3686
 
3621
3687
  case 3:
3622
3688
 
3623
3689
  _this.getJob();
3624
3690
 
3625
- _context5.next = 10;
3691
+ _context6.next = 10;
3626
3692
  break;
3627
3693
 
3628
3694
  case 7:
3629
- _context5.prev = 7;
3630
- _context5.t0 = _context5["catch"](0);
3631
- console.error('onAssignUser', _context5.t0);
3695
+ _context6.prev = 7;
3696
+ _context6.t0 = _context6["catch"](0);
3697
+ console.error('onAssignUser', _context6.t0);
3632
3698
 
3633
3699
  case 10:
3634
3700
  case "end":
3635
- return _context5.stop();
3701
+ return _context6.stop();
3636
3702
  }
3637
3703
  }
3638
- }, _callee5, null, [[0, 7]]);
3704
+ }, _callee6, null, [[0, 7]]);
3639
3705
  }));
3640
3706
 
3641
3707
  return function (_x) {
3642
- return _ref5.apply(this, arguments);
3708
+ return _ref6.apply(this, arguments);
3643
3709
  };
3644
3710
  }());
3645
3711
 
3646
- _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onConfirmAddNote", /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee6() {
3712
+ _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onConfirmAddNote", /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee7() {
3647
3713
  var res;
3648
- return _regeneratorRuntime__default['default'].wrap(function _callee6$(_context6) {
3714
+ return _regeneratorRuntime__default['default'].wrap(function _callee7$(_context7) {
3649
3715
  while (1) {
3650
- switch (_context6.prev = _context6.next) {
3716
+ switch (_context7.prev = _context7.next) {
3651
3717
  case 0:
3652
3718
  if (_this.isReadyToSaveNote()) {
3653
- _context6.next = 2;
3719
+ _context7.next = 2;
3654
3720
  break;
3655
3721
  }
3656
3722
 
3657
- return _context6.abrupt("return");
3723
+ return _context7.abrupt("return");
3658
3724
 
3659
3725
  case 2:
3660
- _context6.prev = 2;
3726
+ _context7.prev = 2;
3661
3727
 
3662
3728
  _this.setState({
3663
3729
  submittingNote: true
3664
3730
  });
3665
3731
 
3666
- _context6.next = 6;
3732
+ _context7.next = 6;
3667
3733
  return _this.state.editingNote ? maintenanceActions.editNote(_this.state.jobId, _this.state.editingNote, _this.state.noteInput, _this.state.noteAttachments.map(function (a) {
3668
3734
  return {
3669
3735
  Title: a.Title,
@@ -3677,7 +3743,7 @@
3677
3743
  }), _this.state.noteImages);
3678
3744
 
3679
3745
  case 6:
3680
- res = _context6.sent;
3746
+ res = _context7.sent;
3681
3747
 
3682
3748
  _this.setState({
3683
3749
  job: res.data.job,
@@ -3691,20 +3757,20 @@
3691
3757
  _this.props.jobsLoaded([_this.state.job]);
3692
3758
  });
3693
3759
 
3694
- _context6.next = 13;
3760
+ _context7.next = 13;
3695
3761
  break;
3696
3762
 
3697
3763
  case 10:
3698
- _context6.prev = 10;
3699
- _context6.t0 = _context6["catch"](2);
3700
- console.error('onConfirmAddNote', _context6.t0);
3764
+ _context7.prev = 10;
3765
+ _context7.t0 = _context7["catch"](2);
3766
+ console.error('onConfirmAddNote', _context7.t0);
3701
3767
 
3702
3768
  case 13:
3703
3769
  case "end":
3704
- return _context6.stop();
3770
+ return _context7.stop();
3705
3771
  }
3706
3772
  }
3707
- }, _callee6, null, [[2, 10]]);
3773
+ }, _callee7, null, [[2, 10]]);
3708
3774
  })));
3709
3775
 
3710
3776
  _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onDeleteNote", function (n) {
@@ -3752,42 +3818,42 @@
3752
3818
 
3753
3819
  _this.setState({
3754
3820
  updating: true
3755
- }, /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee7() {
3821
+ }, /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee8() {
3756
3822
  var update;
3757
- return _regeneratorRuntime__default['default'].wrap(function _callee7$(_context7) {
3823
+ return _regeneratorRuntime__default['default'].wrap(function _callee8$(_context8) {
3758
3824
  while (1) {
3759
- switch (_context7.prev = _context7.next) {
3825
+ switch (_context8.prev = _context8.next) {
3760
3826
  case 0:
3761
- _context7.prev = 0;
3827
+ _context8.prev = 0;
3762
3828
  update = {
3763
3829
  id: job.id,
3764
3830
  seen: true,
3765
3831
  status: job.status || 'Unassigned'
3766
3832
  };
3767
- _context7.next = 4;
3833
+ _context8.next = 4;
3768
3834
  return maintenanceActions.editJob(update, auth.site);
3769
3835
 
3770
3836
  case 4:
3771
- _context7.next = 11;
3837
+ _context8.next = 11;
3772
3838
  break;
3773
3839
 
3774
3840
  case 6:
3775
- _context7.prev = 6;
3776
- _context7.t0 = _context7["catch"](0);
3841
+ _context8.prev = 6;
3842
+ _context8.t0 = _context8["catch"](0);
3777
3843
 
3778
3844
  _this.setState({
3779
3845
  updating: false
3780
3846
  });
3781
3847
 
3782
- console.log('markSeen error', _context7.t0);
3848
+ console.log('markSeen error', _context8.t0);
3783
3849
  alert('Something went wrong with the request. Please try again.');
3784
3850
 
3785
3851
  case 11:
3786
3852
  case "end":
3787
- return _context7.stop();
3853
+ return _context8.stop();
3788
3854
  }
3789
3855
  }
3790
- }, _callee7, null, [[0, 6]]);
3856
+ }, _callee8, null, [[0, 6]]);
3791
3857
  })));
3792
3858
  });
3793
3859
 
@@ -3799,44 +3865,44 @@
3799
3865
  });
3800
3866
  });
3801
3867
 
3802
- _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onAddComment", /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee8() {
3868
+ _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onAddComment", /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee9() {
3803
3869
  var _this$state2, commentInput, jobId, job, comments, res;
3804
3870
 
3805
- return _regeneratorRuntime__default['default'].wrap(function _callee8$(_context8) {
3871
+ return _regeneratorRuntime__default['default'].wrap(function _callee9$(_context9) {
3806
3872
  while (1) {
3807
- switch (_context8.prev = _context8.next) {
3873
+ switch (_context9.prev = _context9.next) {
3808
3874
  case 0:
3809
3875
  _this$state2 = _this.state, commentInput = _this$state2.commentInput, jobId = _this$state2.jobId, job = _this$state2.job, comments = _this$state2.comments;
3810
- _context8.prev = 1;
3876
+ _context9.prev = 1;
3811
3877
 
3812
3878
  _this.setState({
3813
3879
  commentInput: ''
3814
3880
  });
3815
3881
 
3816
- _context8.next = 5;
3882
+ _context9.next = 5;
3817
3883
  return reactionActions.addComment(jobId, values.commentKey, job.title, job.site, commentInput);
3818
3884
 
3819
3885
  case 5:
3820
- res = _context8.sent;
3886
+ res = _context9.sent;
3821
3887
 
3822
3888
  _this.setState({
3823
3889
  comments: [].concat(_toConsumableArray__default['default'](comments), [res.data])
3824
3890
  });
3825
3891
 
3826
- _context8.next = 12;
3892
+ _context9.next = 12;
3827
3893
  break;
3828
3894
 
3829
3895
  case 9:
3830
- _context8.prev = 9;
3831
- _context8.t0 = _context8["catch"](1);
3832
- console.error('onAddComment', _context8.t0);
3896
+ _context9.prev = 9;
3897
+ _context9.t0 = _context9["catch"](1);
3898
+ console.error('onAddComment', _context9.t0);
3833
3899
 
3834
3900
  case 12:
3835
3901
  case "end":
3836
- return _context8.stop();
3902
+ return _context9.stop();
3837
3903
  }
3838
3904
  }
3839
- }, _callee8, null, [[1, 9]]);
3905
+ }, _callee9, null, [[1, 9]]);
3840
3906
  })));
3841
3907
 
3842
3908
  _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onHandleChange", function (event) {
@@ -3853,11 +3919,11 @@
3853
3919
  });
3854
3920
 
3855
3921
  _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onSelectPriority", /*#__PURE__*/function () {
3856
- var _ref9 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee9(priority) {
3922
+ var _ref10 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee10(priority) {
3857
3923
  var res, job;
3858
- return _regeneratorRuntime__default['default'].wrap(function _callee9$(_context9) {
3924
+ return _regeneratorRuntime__default['default'].wrap(function _callee10$(_context10) {
3859
3925
  while (1) {
3860
- switch (_context9.prev = _context9.next) {
3926
+ switch (_context10.prev = _context10.next) {
3861
3927
  case 0:
3862
3928
  _this.setState({
3863
3929
  job: _objectSpread$4(_objectSpread$4({}, _this.state.job), {}, {
@@ -3866,12 +3932,12 @@
3866
3932
  priorityChangerOpen: false
3867
3933
  });
3868
3934
 
3869
- _context9.prev = 1;
3870
- _context9.next = 4;
3935
+ _context10.prev = 1;
3936
+ _context10.next = 4;
3871
3937
  return maintenanceActions.editJobPriority(_this.state.job.id, priority);
3872
3938
 
3873
3939
  case 4:
3874
- res = _context9.sent;
3940
+ res = _context10.sent;
3875
3941
  job = res.data.job;
3876
3942
 
3877
3943
  _this.props.jobsLoaded([job]);
@@ -3880,24 +3946,24 @@
3880
3946
  job: job
3881
3947
  });
3882
3948
 
3883
- _context9.next = 13;
3949
+ _context10.next = 13;
3884
3950
  break;
3885
3951
 
3886
3952
  case 10:
3887
- _context9.prev = 10;
3888
- _context9.t0 = _context9["catch"](1);
3889
- console.error('onSelectPriority', _context9.t0);
3953
+ _context10.prev = 10;
3954
+ _context10.t0 = _context10["catch"](1);
3955
+ console.error('onSelectPriority', _context10.t0);
3890
3956
 
3891
3957
  case 13:
3892
3958
  case "end":
3893
- return _context9.stop();
3959
+ return _context10.stop();
3894
3960
  }
3895
3961
  }
3896
- }, _callee9, null, [[1, 10]]);
3962
+ }, _callee10, null, [[1, 10]]);
3897
3963
  }));
3898
3964
 
3899
3965
  return function (_x2) {
3900
- return _ref9.apply(this, arguments);
3966
+ return _ref10.apply(this, arguments);
3901
3967
  };
3902
3968
  }());
3903
3969
 
@@ -3908,11 +3974,11 @@
3908
3974
  });
3909
3975
 
3910
3976
  _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onSelectStatus", /*#__PURE__*/function () {
3911
- var _ref10 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee10(status) {
3977
+ var _ref11 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee11(status) {
3912
3978
  var res, job;
3913
- return _regeneratorRuntime__default['default'].wrap(function _callee10$(_context10) {
3979
+ return _regeneratorRuntime__default['default'].wrap(function _callee11$(_context11) {
3914
3980
  while (1) {
3915
- switch (_context10.prev = _context10.next) {
3981
+ switch (_context11.prev = _context11.next) {
3916
3982
  case 0:
3917
3983
  _this.setState({
3918
3984
  job: _objectSpread$4(_objectSpread$4({}, _this.state.job), {}, {
@@ -3921,12 +3987,12 @@
3921
3987
  statusChangerOpen: false
3922
3988
  });
3923
3989
 
3924
- _context10.prev = 1;
3925
- _context10.next = 4;
3990
+ _context11.prev = 1;
3991
+ _context11.next = 4;
3926
3992
  return maintenanceActions.editJobStatus(_this.state.job.id, status);
3927
3993
 
3928
3994
  case 4:
3929
- res = _context10.sent;
3995
+ res = _context11.sent;
3930
3996
  job = res.data.job;
3931
3997
 
3932
3998
  _this.props.jobsLoaded([job]);
@@ -3935,24 +4001,24 @@
3935
4001
  job: job
3936
4002
  });
3937
4003
 
3938
- _context10.next = 13;
4004
+ _context11.next = 13;
3939
4005
  break;
3940
4006
 
3941
4007
  case 10:
3942
- _context10.prev = 10;
3943
- _context10.t0 = _context10["catch"](1);
3944
- console.error('onSelectStatus', _context10.t0);
4008
+ _context11.prev = 10;
4009
+ _context11.t0 = _context11["catch"](1);
4010
+ console.error('onSelectStatus', _context11.t0);
3945
4011
 
3946
4012
  case 13:
3947
4013
  case "end":
3948
- return _context10.stop();
4014
+ return _context11.stop();
3949
4015
  }
3950
4016
  }
3951
- }, _callee10, null, [[1, 10]]);
4017
+ }, _callee11, null, [[1, 10]]);
3952
4018
  }));
3953
4019
 
3954
4020
  return function (_x3) {
3955
- return _ref10.apply(this, arguments);
4021
+ return _ref11.apply(this, arguments);
3956
4022
  };
3957
4023
  }());
3958
4024
 
@@ -3972,7 +4038,10 @@
3972
4038
  noteImages: [],
3973
4039
  assignees: [],
3974
4040
  externalSync: null,
3975
- loadingExternalSync: false
4041
+ loadingExternalSync: false,
4042
+ retryingSync: false,
4043
+ retrySyncError: null,
4044
+ retrySyncInitiated: false
3976
4045
  };
3977
4046
  return _this;
3978
4047
  }
@@ -4504,24 +4573,122 @@
4504
4573
  className: "flex-1"
4505
4574
  }, "Priority")));
4506
4575
  }
4576
+ }, {
4577
+ key: "hasSyncFailureWithoutSuccess",
4578
+ value: function hasSyncFailureWithoutSuccess() {
4579
+ var job = this.state.job;
4580
+ if (!job || !job.history) return false;
4581
+ var history = job.history || [];
4582
+ var hasSuccess = history.some(function (entry) {
4583
+ return entry.EntryType === 'ExternalIDSet';
4584
+ });
4585
+ var hasFailure = history.some(function (entry) {
4586
+ return entry.EntryType === 'ExternalIDSetFailed';
4587
+ });
4588
+ return hasFailure && !hasSuccess;
4589
+ }
4590
+ }, {
4591
+ key: "renderRetrySyncButton",
4592
+ value: function renderRetrySyncButton() {
4593
+ var auth = this.props.auth;
4594
+ var _this$state3 = this.state,
4595
+ retryingSync = _this$state3.retryingSync,
4596
+ retrySyncInitiated = _this$state3.retrySyncInitiated; // Only show for users with maintenance tracking permission
4597
+
4598
+ 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
4599
+
4600
+ if (!this.hasSyncFailureWithoutSuccess() || retrySyncInitiated) return null; // Show spinner while retrying
4601
+
4602
+ if (retryingSync) {
4603
+ return /*#__PURE__*/React__default['default'].createElement(FontAwesome__default['default'], {
4604
+ style: {
4605
+ fontSize: 20,
4606
+ color: Colours$1.COLOUR_DUSK_LIGHT,
4607
+ marginLeft: 8
4608
+ },
4609
+ name: "spinner fa-pulse fa-fw"
4610
+ });
4611
+ }
4612
+
4613
+ return /*#__PURE__*/React__default['default'].createElement("div", {
4614
+ className: "statusLabel pointer",
4615
+ onClick: this.onRetrySync,
4616
+ style: {
4617
+ backgroundColor: Colours$1.COLOUR_RED,
4618
+ marginLeft: 8
4619
+ }
4620
+ }, /*#__PURE__*/React__default['default'].createElement("span", {
4621
+ className: "statusLabel_text"
4622
+ }, "Retry Sync"));
4623
+ }
4624
+ }, {
4625
+ key: "renderExternalSyncStatus",
4626
+ value: function renderExternalSyncStatus() {
4627
+ var _this$state4 = this.state,
4628
+ retrySyncError = _this$state4.retrySyncError,
4629
+ retrySyncInitiated = _this$state4.retrySyncInitiated; // Show error message if retry failed
4630
+
4631
+ if (retrySyncError) {
4632
+ return /*#__PURE__*/React__default['default'].createElement(Components$3.Text, {
4633
+ type: "body"
4634
+ }, /*#__PURE__*/React__default['default'].createElement(FontAwesome__default['default'], {
4635
+ className: "userStatusIcon",
4636
+ name: "times-circle",
4637
+ style: {
4638
+ color: Colours$1.COLOUR_RED
4639
+ }
4640
+ }), " ", retrySyncError);
4641
+ } // Show success message if retry was initiated
4642
+
4643
+
4644
+ if (retrySyncInitiated) {
4645
+ return /*#__PURE__*/React__default['default'].createElement(Components$3.Text, {
4646
+ type: "body"
4647
+ }, /*#__PURE__*/React__default['default'].createElement(FontAwesome__default['default'], {
4648
+ className: "userStatusIcon",
4649
+ name: "check-circle",
4650
+ style: {
4651
+ color: Colours$1.COLOUR_GREEN
4652
+ }
4653
+ }), " Sync retry initiated. Check back shortly for results.");
4654
+ } // Show failure message with instruction
4655
+
4656
+
4657
+ if (this.hasSyncFailureWithoutSuccess()) {
4658
+ return /*#__PURE__*/React__default['default'].createElement(Components$3.Text, {
4659
+ type: "body"
4660
+ }, /*#__PURE__*/React__default['default'].createElement(FontAwesome__default['default'], {
4661
+ className: "userStatusIcon",
4662
+ name: "times-circle",
4663
+ style: {
4664
+ color: Colours$1.COLOUR_RED
4665
+ }
4666
+ }), " External sync failed. Use the retry button to attempt again.");
4667
+ }
4668
+
4669
+ return null;
4670
+ }
4507
4671
  }, {
4508
4672
  key: "renderExternalSync",
4509
4673
  value: function renderExternalSync() {
4510
- var _this$state3 = this.state,
4511
- externalSync = _this$state3.externalSync,
4512
- loadingExternalSync = _this$state3.loadingExternalSync; // Only show if external sync data exists
4674
+ var _this$state5 = this.state,
4675
+ externalSync = _this$state5.externalSync,
4676
+ loadingExternalSync = _this$state5.loadingExternalSync; // Check if we should show this section at all
4677
+
4678
+ var hasExternalSyncData = externalSync && !loadingExternalSync;
4679
+ var hasSyncFailure = this.hasSyncFailureWithoutSuccess(); // Show section if we have sync data OR if there's a failure that can be retried
4513
4680
 
4514
- if (!externalSync || loadingExternalSync) return null;
4681
+ if (!hasExternalSyncData && !hasSyncFailure) return null;
4515
4682
  return /*#__PURE__*/React__default['default'].createElement("div", {
4516
4683
  className: "padding-32 paddingVertical-40 bottomDivideBorder relative"
4517
4684
  }, /*#__PURE__*/React__default['default'].createElement("div", {
4518
4685
  className: "newTopBar clearfix flex flex-reverse"
4519
- }, /*#__PURE__*/React__default['default'].createElement(Components$3.Text, {
4686
+ }, this.renderRetrySyncButton(), /*#__PURE__*/React__default['default'].createElement(Components$3.Text, {
4520
4687
  type: "formTitleSmall",
4521
4688
  className: "flex-1"
4522
4689
  }, "External Sync")), /*#__PURE__*/React__default['default'].createElement("div", {
4523
4690
  className: "marginTop-16"
4524
- }, externalSync.systemType && /*#__PURE__*/React__default['default'].createElement(Components$3.Text, {
4691
+ }, hasExternalSyncData ? /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, externalSync.systemType && /*#__PURE__*/React__default['default'].createElement(Components$3.Text, {
4525
4692
  type: "body",
4526
4693
  className: "marginBottom-8"
4527
4694
  }, /*#__PURE__*/React__default['default'].createElement("strong", null, "System:"), " ", externalSync.systemType), externalSync.externalId && /*#__PURE__*/React__default['default'].createElement(Components$3.Text, {
@@ -4530,7 +4697,7 @@
4530
4697
  }, /*#__PURE__*/React__default['default'].createElement("strong", null, "External ID:"), " ", externalSync.externalId), externalSync.syncedAt && /*#__PURE__*/React__default['default'].createElement(Components$3.Text, {
4531
4698
  type: "body",
4532
4699
  className: "marginBottom-8"
4533
- }, /*#__PURE__*/React__default['default'].createElement("strong", null, "Synced:"), " ", moment__default['default'].utc(externalSync.syncedAt).local().format('D MMM YYYY h:mma'))));
4700
+ }, /*#__PURE__*/React__default['default'].createElement("strong", null, "Synced:"), " ", moment__default['default'].utc(externalSync.syncedAt).local().format('D MMM YYYY h:mma'))) : this.renderExternalSyncStatus()));
4534
4701
  }
4535
4702
  }, {
4536
4703
  key: "renderOverview",
@@ -4688,8 +4855,8 @@
4688
4855
  }), /*#__PURE__*/React__default['default'].createElement("p", {
4689
4856
  className: "iconTextButton_text"
4690
4857
  }, "Add Attachment")), /*#__PURE__*/React__default['default'].createElement(Components$3.ImageInput, {
4691
- ref: function ref(_ref11) {
4692
- _this8.imageInput = _ref11;
4858
+ ref: function ref(_ref12) {
4859
+ _this8.imageInput = _ref12;
4693
4860
  },
4694
4861
  multiple: true,
4695
4862
  refreshCallback: function refreshCallback(images) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plusscommunities/pluss-maintenance-web-a",
3
- "version": "1.1.30",
3
+ "version": "1.1.31",
4
4
  "description": "Extension package to enable maintenance on Pluss Communities Platform",
5
5
  "main": "dist/index.cjs.js",
6
6
  "scripts": {
@@ -193,4 +193,11 @@ export const maintenanceActions = {
193
193
  url: Helper.getUrl(values.serviceKey, 'get/externalsync', { id: jobId }),
194
194
  });
195
195
  },
196
+ retrySync: (jobId) => {
197
+ return Session.authedFunction({
198
+ method: 'POST',
199
+ url: Helper.getUrl(values.serviceKey, 'update/retrysync'),
200
+ data: { id: jobId },
201
+ });
202
+ },
196
203
  };