@plusscommunities/pluss-maintenance-web 1.1.31-beta.3 → 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
@@ -101,6 +101,7 @@ var values = {
101
101
  svgPathGridIcon: 'M22.7072 2.33998C20.5868 2.30886 18.2156 3.43862 16.824 4.83022C15.1138 6.54042 15.1486 8.34584 15.7894 10.5065L13.2058 13.0901L7.7566 7.64089C7.75294 7.60976 7.75477 7.5768 7.74927 7.54567L7.48926 6.30605C7.43799 6.06435 7.28968 5.84645 7.08277 5.71279L3.77589 3.56313C3.40601 3.32509 2.91163 3.37636 2.60035 3.68764L1.81116 4.47682C1.50171 4.7881 1.44861 5.28066 1.68848 5.6487L3.80152 8.91713C3.93336 9.12221 4.13843 9.26686 4.3783 9.32179L5.66004 9.61659C5.69483 9.62392 5.72962 9.62209 5.76441 9.62575L11.2155 15.0786L8.03309 18.2647C6.23316 18.0907 4.52112 18.8396 3.417 20.2971C2.0254 22.1373 2.05836 24.7814 3.49756 26.5886C4.41858 27.7459 5.78821 28.4563 7.25123 28.5405C7.34827 28.546 7.44532 28.5479 7.54236 28.5479C8.9065 28.5479 10.2212 28.0059 11.1898 27.0372C12.2866 25.9404 12.8195 24.4445 12.6711 22.9027L14.7311 20.8446C14.8391 21.2035 15.0259 21.5386 15.2987 21.8114L21.5939 28.1102C22.0516 28.5662 22.6522 28.7932 23.2528 28.7932C23.8534 28.7932 24.454 28.5662 24.9099 28.1102L26.2356 26.7827C27.1493 25.869 27.1493 24.3822 26.2356 23.4685L19.9368 17.1697C19.6658 16.8987 19.3307 16.7138 18.9718 16.6039L20.4275 15.1464C22.5881 15.7854 24.3954 15.822 26.1056 14.1118C27.814 12.4035 29.1323 9.21559 28.3834 6.83522C28.3358 6.67958 28.2076 6.55873 28.0483 6.52028C27.889 6.48183 27.7206 6.52944 27.6052 6.64479L24.681 9.56899C24.5638 9.68801 24.3899 9.73561 24.2288 9.68984L23.7161 9.55251C22.5863 9.25038 21.6964 8.36049 21.3943 7.23256L21.257 6.71987C21.213 6.55873 21.2606 6.38478 21.3796 6.2676L24.3093 3.33608C24.4247 3.22072 24.4705 3.05409 24.4338 2.89479C24.3936 2.73549 24.2764 2.60732 24.1189 2.55788C23.6721 2.41506 23.1961 2.34731 22.7072 2.33998ZM22.6669 3.28115C22.7877 3.28298 22.9067 3.28664 23.0239 3.29579L20.7168 5.60292C20.3616 5.95815 20.2242 6.47817 20.3543 6.96157L20.4916 7.47609C20.8798 8.92629 22.0223 10.0689 23.4744 10.4589L23.9871 10.5962C24.4705 10.7262 24.9905 10.5871 25.3439 10.2318L27.6437 7.93202C27.7883 9.80702 26.7318 12.1599 25.4446 13.4472C23.9834 14.9083 22.5021 14.8168 20.4367 14.1686C20.27 14.1173 20.0888 14.1613 19.9661 14.284L11.849 22.401C11.7446 22.5054 11.6952 22.6519 11.7172 22.7984C11.9039 24.1277 11.47 25.4314 10.527 26.3744C9.67737 27.224 8.5055 27.6708 7.30433 27.6049C6.08851 27.5353 4.9972 26.9677 4.22999 26.0045C3.05445 24.5287 3.02698 22.3662 4.16407 20.8648C4.98438 19.7826 6.20936 19.1765 7.52588 19.1765C7.7273 19.1765 7.93238 19.1912 8.13746 19.2186C8.28211 19.2388 8.43043 19.1912 8.53296 19.0868L16.65 10.9716C16.7745 10.8471 16.8203 10.6658 16.7672 10.4973C16.119 8.43373 16.0275 6.95424 17.4887 5.49306C18.7008 4.2809 20.8541 3.27931 22.6669 3.28115ZM3.26319 4.35048L6.57191 6.49831L6.83191 7.73793L5.86695 8.70107L4.58704 8.4081L2.474 5.13967L3.26319 4.35048ZM7.34095 8.55275L12.543 13.7529L11.8801 14.4158L6.67994 9.21559L7.0077 8.88967L7.34095 8.55275ZM18.4811 8.66994C18.3621 8.66994 18.243 8.71572 18.1497 8.80727C17.9666 8.99037 17.9666 9.287 18.1497 9.47011L21.4657 12.7843C21.5573 12.8759 21.6763 12.9216 21.7971 12.9216C21.9161 12.9216 22.037 12.8759 22.1267 12.7843C22.3117 12.6012 22.3117 12.3046 22.1267 12.1215L18.8143 8.80727C18.721 8.71572 18.6019 8.66994 18.4811 8.66994ZM17.1554 12.647C17.0364 12.647 16.9155 12.6928 16.824 12.7843C16.6409 12.9674 16.6409 13.2641 16.824 13.4472L17.4887 14.11C17.5802 14.2016 17.6992 14.2473 17.8201 14.2473C17.9409 14.2473 18.0599 14.2016 18.1515 14.11C18.3346 13.9269 18.3346 13.6303 18.1515 13.4472L17.4887 12.7843C17.3953 12.6928 17.2763 12.647 17.1554 12.647ZM15.4983 14.3041C15.3793 14.3041 15.2603 14.3499 15.1687 14.4433C14.9838 14.6264 14.9838 14.9212 15.1687 15.1043L15.8297 15.7689C15.9213 15.8587 16.0421 15.9063 16.163 15.9063C16.282 15.9063 16.4028 15.8587 16.4944 15.7689C16.6775 15.584 16.6775 15.2892 16.4944 15.1043L15.8297 14.4433C15.7382 14.3499 15.6191 14.3041 15.4983 14.3041ZM13.843 15.9612C13.7222 15.9612 13.6032 16.007 13.5116 16.0985C13.3267 16.2816 13.3267 16.5783 13.5116 16.7632L14.1726 17.4242C14.2642 17.5158 14.385 17.5634 14.504 17.5634C14.6249 17.5634 14.7457 17.5158 14.8373 17.4242C15.0204 17.2429 15.0204 16.9463 14.8373 16.7632L14.1726 16.0985C14.0811 16.007 13.962 15.9612 13.843 15.9612ZM18.4426 17.4444C18.7539 17.4755 19.0487 17.6073 19.2758 17.8344L25.5728 24.1314C26.1221 24.6807 26.1221 25.5706 25.5728 26.1199L24.2452 27.4456C23.6978 27.9949 22.806 27.9949 22.2586 27.4456L15.9597 21.1467C15.6594 20.8465 15.5258 20.4216 15.5734 20.0023L18.1277 17.4462C18.2339 17.4352 18.3383 17.4334 18.4426 17.4444ZM12.1859 17.6201C12.0651 17.6201 11.9461 17.6641 11.8527 17.7556C11.6696 17.9406 11.6696 18.2354 11.8527 18.4203L12.5173 19.0813C12.6071 19.1729 12.7279 19.2186 12.8469 19.2186C12.9678 19.2186 13.0886 19.1729 13.1784 19.0813C13.3633 18.8982 13.3633 18.6034 13.1784 18.4203L12.5173 17.7556C12.424 17.6641 12.3049 17.6201 12.1859 17.6201ZM10.527 19.2772C10.408 19.2772 10.2889 19.323 10.1956 19.4146C10.0125 19.5977 10.0125 19.8925 10.1956 20.0756L10.8584 20.7403C10.95 20.83 11.069 20.8757 11.1898 20.8757C11.3107 20.8757 11.4297 20.83 11.5212 20.7403C11.7044 20.5553 11.7044 20.2605 11.5212 20.0756L10.8584 19.4146C10.7669 19.323 10.646 19.2772 10.527 19.2772ZM19.2758 19.3523C19.1549 19.3523 19.0359 19.3981 18.9425 19.4896C18.7594 19.6746 18.7594 19.9694 18.9425 20.1543L23.5842 24.7942C23.6758 24.8858 23.7948 24.9315 23.9157 24.9315C24.0365 24.9315 24.1555 24.8858 24.2471 24.7942C24.4302 24.6111 24.4302 24.3145 24.2471 24.1314L19.6072 19.4896C19.5138 19.3981 19.3948 19.3523 19.2758 19.3523ZM17.9501 20.678C17.8292 20.678 17.7102 20.7238 17.6168 20.8153C17.4337 21.0003 17.4337 21.2951 17.6168 21.48L22.2586 26.1199C22.3483 26.2114 22.4691 26.2572 22.5881 26.2572C22.709 26.2572 22.8298 26.2114 22.9196 26.1199C23.1045 25.9368 23.1045 25.6402 22.9196 25.457L18.2815 20.8153C18.1881 20.7238 18.0691 20.678 17.9501 20.678ZM8.11182 20.8373C8.07154 20.8373 8.03126 20.8428 7.99097 20.8538L5.89808 21.4141C5.73694 21.458 5.6106 21.5844 5.56666 21.7455L5.00818 23.8366C4.96424 23.9977 5.01002 24.1698 5.1272 24.2888L6.65796 25.8196C6.74769 25.9093 6.86671 25.9569 6.98939 25.9569C7.0315 25.9569 7.07178 25.9514 7.11207 25.9423L9.20313 25.3801C9.36426 25.338 9.49061 25.2117 9.53455 25.0487L10.0949 22.9595C10.1388 22.7965 10.0912 22.6244 9.974 22.5054L8.44324 20.9746C8.35352 20.8867 8.2345 20.8391 8.11182 20.8373ZM7.97083 21.8279L9.1189 22.976L8.69959 24.5452L7.13038 24.9663L5.98231 23.8183L6.40162 22.249L7.97083 21.8279Z',
102
102
  svgPathGridIconViewBox: '0 0 30 30',
103
103
  menuOrder: 10,
104
+ optionOnlyForResidents: 'onlyForResidentsMaintenance',
104
105
  textEmptyDescription: 'allows your users to submit Requests (such as maintenance requests) that all appear in this job board.',
105
106
  textEmptyExample: 'Example might be; Fix my light bulb, hand rail is broken, or please send flowers to Mum.',
106
107
  textEmptyJobTypes: 'Please add the many categories of request types that exist in your village which work alongside the Maintenance area.',
@@ -143,7 +144,19 @@ var FeatureConfig = {
143
144
  singularName: values.textSingularName,
144
145
  description: 'Submit maintenance requests and track the progress.',
145
146
  emptyText: values.textYourRequestHere,
146
- widgetOptions: [],
147
+ widgetOptions: [{
148
+ key: values.featureKey,
149
+ widget: true,
150
+ main: true,
151
+ hideOnTabNumbers: [],
152
+ optionKey: values.optionOnlyForResidents,
153
+ type: 'toggle',
154
+ inverseOption: false,
155
+ title: 'Limit Admins to Only Submit on Behalf of Primary Users',
156
+ description: 'This will limit admins to only make a submission on behalf of a primary users in the site. Otherwise they can also submit on behalf of other admins/staff users.',
157
+ defaultNew: false,
158
+ default: false
159
+ }],
147
160
  menu: {
148
161
  order: values.menuOrder,
149
162
  text: values.textMenuTitle,
@@ -512,6 +525,15 @@ var maintenanceActions = {
512
525
  id: jobId
513
526
  })
514
527
  });
528
+ },
529
+ retrySync: function retrySync(jobId) {
530
+ return Session$9.authedFunction({
531
+ method: 'POST',
532
+ url: Helper$5.getUrl(values.serviceKey, 'update/retrysync'),
533
+ data: {
534
+ id: jobId
535
+ }
536
+ });
515
537
  }
516
538
  };
517
539
 
@@ -3429,6 +3451,63 @@ var Job = /*#__PURE__*/function (_Component) {
3429
3451
  }, _callee3, null, [[0, 8]]);
3430
3452
  })));
3431
3453
 
3454
+ _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onRetrySync", /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee4() {
3455
+ var job, errorMessage;
3456
+ return _regeneratorRuntime__default['default'].wrap(function _callee4$(_context4) {
3457
+ while (1) {
3458
+ switch (_context4.prev = _context4.next) {
3459
+ case 0:
3460
+ job = _this.state.job;
3461
+
3462
+ if (!(!job || _this.state.retryingSync)) {
3463
+ _context4.next = 3;
3464
+ break;
3465
+ }
3466
+
3467
+ return _context4.abrupt("return");
3468
+
3469
+ case 3:
3470
+ _this.setState({
3471
+ retryingSync: true,
3472
+ retrySyncError: null
3473
+ });
3474
+
3475
+ _context4.prev = 4;
3476
+ _context4.next = 7;
3477
+ return maintenanceActions.retrySync(job.id);
3478
+
3479
+ case 7:
3480
+ _context4.next = 9;
3481
+ return _this.getJob();
3482
+
3483
+ case 9:
3484
+ _this.setState({
3485
+ retryingSync: false,
3486
+ retrySyncInitiated: true
3487
+ });
3488
+
3489
+ _context4.next = 17;
3490
+ break;
3491
+
3492
+ case 12:
3493
+ _context4.prev = 12;
3494
+ _context4.t0 = _context4["catch"](4);
3495
+ console.error('onRetrySync', _context4.t0);
3496
+ errorMessage = _context4.t0 && _context4.t0.response && _context4.t0.response.data && _context4.t0.response.data.error || 'Failed to retry sync. Please try again.';
3497
+
3498
+ _this.setState({
3499
+ retryingSync: false,
3500
+ retrySyncError: errorMessage
3501
+ });
3502
+
3503
+ case 17:
3504
+ case "end":
3505
+ return _context4.stop();
3506
+ }
3507
+ }
3508
+ }, _callee4, null, [[4, 12]]);
3509
+ })));
3510
+
3432
3511
  _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "getStatusType", function (status) {
3433
3512
  var statusTypes = _this.props.statusTypes;
3434
3513
  var statusType = statusTypes.find(function (s) {
@@ -3594,35 +3673,35 @@ var Job = /*#__PURE__*/function (_Component) {
3594
3673
  });
3595
3674
  });
3596
3675
 
3597
- _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onConfirmAssignee", /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee4() {
3598
- return _regeneratorRuntime__default['default'].wrap(function _callee4$(_context4) {
3676
+ _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onConfirmAssignee", /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee5() {
3677
+ return _regeneratorRuntime__default['default'].wrap(function _callee5$(_context5) {
3599
3678
  while (1) {
3600
- switch (_context4.prev = _context4.next) {
3679
+ switch (_context5.prev = _context5.next) {
3601
3680
  case 0:
3602
3681
  _this.setState({
3603
3682
  confirmingAssignee: true
3604
3683
  });
3605
3684
 
3606
- _context4.prev = 1;
3685
+ _context5.prev = 1;
3607
3686
 
3608
3687
  if (!_this.state.selectedAssignee) {
3609
- _context4.next = 5;
3688
+ _context5.next = 5;
3610
3689
  break;
3611
3690
  }
3612
3691
 
3613
- _context4.next = 5;
3692
+ _context5.next = 5;
3614
3693
  return _this.onAssignUser(_this.state.selectedAssignee.id);
3615
3694
 
3616
3695
  case 5:
3617
3696
  _this.onCloseSelectAssignee();
3618
3697
 
3619
- _context4.next = 11;
3698
+ _context5.next = 11;
3620
3699
  break;
3621
3700
 
3622
3701
  case 8:
3623
- _context4.prev = 8;
3624
- _context4.t0 = _context4["catch"](1);
3625
- console.error('onConfirmAssignee', _context4.t0);
3702
+ _context5.prev = 8;
3703
+ _context5.t0 = _context5["catch"](1);
3704
+ console.error('onConfirmAssignee', _context5.t0);
3626
3705
 
3627
3706
  case 11:
3628
3707
  _this.setState({
@@ -3631,68 +3710,68 @@ var Job = /*#__PURE__*/function (_Component) {
3631
3710
 
3632
3711
  case 12:
3633
3712
  case "end":
3634
- return _context4.stop();
3713
+ return _context5.stop();
3635
3714
  }
3636
3715
  }
3637
- }, _callee4, null, [[1, 8]]);
3716
+ }, _callee5, null, [[1, 8]]);
3638
3717
  })));
3639
3718
 
3640
3719
  _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onAssignUser", /*#__PURE__*/function () {
3641
- var _ref5 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee5(userId) {
3642
- return _regeneratorRuntime__default['default'].wrap(function _callee5$(_context5) {
3720
+ var _ref6 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee6(userId) {
3721
+ return _regeneratorRuntime__default['default'].wrap(function _callee6$(_context6) {
3643
3722
  while (1) {
3644
- switch (_context5.prev = _context5.next) {
3723
+ switch (_context6.prev = _context6.next) {
3645
3724
  case 0:
3646
- _context5.prev = 0;
3647
- _context5.next = 3;
3725
+ _context6.prev = 0;
3726
+ _context6.next = 3;
3648
3727
  return maintenanceActions.assignJob(_this.state.jobId, userId);
3649
3728
 
3650
3729
  case 3:
3651
3730
 
3652
3731
  _this.getJob();
3653
3732
 
3654
- _context5.next = 10;
3733
+ _context6.next = 10;
3655
3734
  break;
3656
3735
 
3657
3736
  case 7:
3658
- _context5.prev = 7;
3659
- _context5.t0 = _context5["catch"](0);
3660
- console.error('onAssignUser', _context5.t0);
3737
+ _context6.prev = 7;
3738
+ _context6.t0 = _context6["catch"](0);
3739
+ console.error('onAssignUser', _context6.t0);
3661
3740
 
3662
3741
  case 10:
3663
3742
  case "end":
3664
- return _context5.stop();
3743
+ return _context6.stop();
3665
3744
  }
3666
3745
  }
3667
- }, _callee5, null, [[0, 7]]);
3746
+ }, _callee6, null, [[0, 7]]);
3668
3747
  }));
3669
3748
 
3670
3749
  return function (_x) {
3671
- return _ref5.apply(this, arguments);
3750
+ return _ref6.apply(this, arguments);
3672
3751
  };
3673
3752
  }());
3674
3753
 
3675
- _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onConfirmAddNote", /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee6() {
3754
+ _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onConfirmAddNote", /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee7() {
3676
3755
  var res;
3677
- return _regeneratorRuntime__default['default'].wrap(function _callee6$(_context6) {
3756
+ return _regeneratorRuntime__default['default'].wrap(function _callee7$(_context7) {
3678
3757
  while (1) {
3679
- switch (_context6.prev = _context6.next) {
3758
+ switch (_context7.prev = _context7.next) {
3680
3759
  case 0:
3681
3760
  if (_this.isReadyToSaveNote()) {
3682
- _context6.next = 2;
3761
+ _context7.next = 2;
3683
3762
  break;
3684
3763
  }
3685
3764
 
3686
- return _context6.abrupt("return");
3765
+ return _context7.abrupt("return");
3687
3766
 
3688
3767
  case 2:
3689
- _context6.prev = 2;
3768
+ _context7.prev = 2;
3690
3769
 
3691
3770
  _this.setState({
3692
3771
  submittingNote: true
3693
3772
  });
3694
3773
 
3695
- _context6.next = 6;
3774
+ _context7.next = 6;
3696
3775
  return _this.state.editingNote ? maintenanceActions.editNote(_this.state.jobId, _this.state.editingNote, _this.state.noteInput, _this.state.noteAttachments.map(function (a) {
3697
3776
  return {
3698
3777
  Title: a.Title,
@@ -3706,7 +3785,7 @@ var Job = /*#__PURE__*/function (_Component) {
3706
3785
  }), _this.state.noteImages);
3707
3786
 
3708
3787
  case 6:
3709
- res = _context6.sent;
3788
+ res = _context7.sent;
3710
3789
 
3711
3790
  _this.setState({
3712
3791
  job: res.data.job,
@@ -3720,20 +3799,20 @@ var Job = /*#__PURE__*/function (_Component) {
3720
3799
  _this.props.jobsLoaded([_this.state.job]);
3721
3800
  });
3722
3801
 
3723
- _context6.next = 13;
3802
+ _context7.next = 13;
3724
3803
  break;
3725
3804
 
3726
3805
  case 10:
3727
- _context6.prev = 10;
3728
- _context6.t0 = _context6["catch"](2);
3729
- console.error('onConfirmAddNote', _context6.t0);
3806
+ _context7.prev = 10;
3807
+ _context7.t0 = _context7["catch"](2);
3808
+ console.error('onConfirmAddNote', _context7.t0);
3730
3809
 
3731
3810
  case 13:
3732
3811
  case "end":
3733
- return _context6.stop();
3812
+ return _context7.stop();
3734
3813
  }
3735
3814
  }
3736
- }, _callee6, null, [[2, 10]]);
3815
+ }, _callee7, null, [[2, 10]]);
3737
3816
  })));
3738
3817
 
3739
3818
  _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onDeleteNote", function (n) {
@@ -3781,42 +3860,42 @@ var Job = /*#__PURE__*/function (_Component) {
3781
3860
 
3782
3861
  _this.setState({
3783
3862
  updating: true
3784
- }, /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee7() {
3863
+ }, /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee8() {
3785
3864
  var update;
3786
- return _regeneratorRuntime__default['default'].wrap(function _callee7$(_context7) {
3865
+ return _regeneratorRuntime__default['default'].wrap(function _callee8$(_context8) {
3787
3866
  while (1) {
3788
- switch (_context7.prev = _context7.next) {
3867
+ switch (_context8.prev = _context8.next) {
3789
3868
  case 0:
3790
- _context7.prev = 0;
3869
+ _context8.prev = 0;
3791
3870
  update = {
3792
3871
  id: job.id,
3793
3872
  seen: true,
3794
3873
  status: job.status || 'Unassigned'
3795
3874
  };
3796
- _context7.next = 4;
3875
+ _context8.next = 4;
3797
3876
  return maintenanceActions.editJob(update, auth.site);
3798
3877
 
3799
3878
  case 4:
3800
- _context7.next = 11;
3879
+ _context8.next = 11;
3801
3880
  break;
3802
3881
 
3803
3882
  case 6:
3804
- _context7.prev = 6;
3805
- _context7.t0 = _context7["catch"](0);
3883
+ _context8.prev = 6;
3884
+ _context8.t0 = _context8["catch"](0);
3806
3885
 
3807
3886
  _this.setState({
3808
3887
  updating: false
3809
3888
  });
3810
3889
 
3811
- console.log('markSeen error', _context7.t0);
3890
+ console.log('markSeen error', _context8.t0);
3812
3891
  alert('Something went wrong with the request. Please try again.');
3813
3892
 
3814
3893
  case 11:
3815
3894
  case "end":
3816
- return _context7.stop();
3895
+ return _context8.stop();
3817
3896
  }
3818
3897
  }
3819
- }, _callee7, null, [[0, 6]]);
3898
+ }, _callee8, null, [[0, 6]]);
3820
3899
  })));
3821
3900
  });
3822
3901
 
@@ -3828,44 +3907,44 @@ var Job = /*#__PURE__*/function (_Component) {
3828
3907
  });
3829
3908
  });
3830
3909
 
3831
- _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onAddComment", /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee8() {
3910
+ _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onAddComment", /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee9() {
3832
3911
  var _this$state2, commentInput, jobId, job, comments, res;
3833
3912
 
3834
- return _regeneratorRuntime__default['default'].wrap(function _callee8$(_context8) {
3913
+ return _regeneratorRuntime__default['default'].wrap(function _callee9$(_context9) {
3835
3914
  while (1) {
3836
- switch (_context8.prev = _context8.next) {
3915
+ switch (_context9.prev = _context9.next) {
3837
3916
  case 0:
3838
3917
  _this$state2 = _this.state, commentInput = _this$state2.commentInput, jobId = _this$state2.jobId, job = _this$state2.job, comments = _this$state2.comments;
3839
- _context8.prev = 1;
3918
+ _context9.prev = 1;
3840
3919
 
3841
3920
  _this.setState({
3842
3921
  commentInput: ''
3843
3922
  });
3844
3923
 
3845
- _context8.next = 5;
3924
+ _context9.next = 5;
3846
3925
  return reactionActions.addComment(jobId, values.commentKey, job.title, job.site, commentInput);
3847
3926
 
3848
3927
  case 5:
3849
- res = _context8.sent;
3928
+ res = _context9.sent;
3850
3929
 
3851
3930
  _this.setState({
3852
3931
  comments: [].concat(_toConsumableArray__default['default'](comments), [res.data])
3853
3932
  });
3854
3933
 
3855
- _context8.next = 12;
3934
+ _context9.next = 12;
3856
3935
  break;
3857
3936
 
3858
3937
  case 9:
3859
- _context8.prev = 9;
3860
- _context8.t0 = _context8["catch"](1);
3861
- console.error('onAddComment', _context8.t0);
3938
+ _context9.prev = 9;
3939
+ _context9.t0 = _context9["catch"](1);
3940
+ console.error('onAddComment', _context9.t0);
3862
3941
 
3863
3942
  case 12:
3864
3943
  case "end":
3865
- return _context8.stop();
3944
+ return _context9.stop();
3866
3945
  }
3867
3946
  }
3868
- }, _callee8, null, [[1, 9]]);
3947
+ }, _callee9, null, [[1, 9]]);
3869
3948
  })));
3870
3949
 
3871
3950
  _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onHandleChange", function (event) {
@@ -3882,11 +3961,11 @@ var Job = /*#__PURE__*/function (_Component) {
3882
3961
  });
3883
3962
 
3884
3963
  _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onSelectPriority", /*#__PURE__*/function () {
3885
- var _ref9 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee9(priority) {
3964
+ var _ref10 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee10(priority) {
3886
3965
  var res, job;
3887
- return _regeneratorRuntime__default['default'].wrap(function _callee9$(_context9) {
3966
+ return _regeneratorRuntime__default['default'].wrap(function _callee10$(_context10) {
3888
3967
  while (1) {
3889
- switch (_context9.prev = _context9.next) {
3968
+ switch (_context10.prev = _context10.next) {
3890
3969
  case 0:
3891
3970
  _this.setState({
3892
3971
  job: _objectSpread$4(_objectSpread$4({}, _this.state.job), {}, {
@@ -3895,12 +3974,12 @@ var Job = /*#__PURE__*/function (_Component) {
3895
3974
  priorityChangerOpen: false
3896
3975
  });
3897
3976
 
3898
- _context9.prev = 1;
3899
- _context9.next = 4;
3977
+ _context10.prev = 1;
3978
+ _context10.next = 4;
3900
3979
  return maintenanceActions.editJobPriority(_this.state.job.id, priority);
3901
3980
 
3902
3981
  case 4:
3903
- res = _context9.sent;
3982
+ res = _context10.sent;
3904
3983
  job = res.data.job;
3905
3984
 
3906
3985
  _this.props.jobsLoaded([job]);
@@ -3909,24 +3988,24 @@ var Job = /*#__PURE__*/function (_Component) {
3909
3988
  job: job
3910
3989
  });
3911
3990
 
3912
- _context9.next = 13;
3991
+ _context10.next = 13;
3913
3992
  break;
3914
3993
 
3915
3994
  case 10:
3916
- _context9.prev = 10;
3917
- _context9.t0 = _context9["catch"](1);
3918
- console.error('onSelectPriority', _context9.t0);
3995
+ _context10.prev = 10;
3996
+ _context10.t0 = _context10["catch"](1);
3997
+ console.error('onSelectPriority', _context10.t0);
3919
3998
 
3920
3999
  case 13:
3921
4000
  case "end":
3922
- return _context9.stop();
4001
+ return _context10.stop();
3923
4002
  }
3924
4003
  }
3925
- }, _callee9, null, [[1, 10]]);
4004
+ }, _callee10, null, [[1, 10]]);
3926
4005
  }));
3927
4006
 
3928
4007
  return function (_x2) {
3929
- return _ref9.apply(this, arguments);
4008
+ return _ref10.apply(this, arguments);
3930
4009
  };
3931
4010
  }());
3932
4011
 
@@ -3937,11 +4016,11 @@ var Job = /*#__PURE__*/function (_Component) {
3937
4016
  });
3938
4017
 
3939
4018
  _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onSelectStatus", /*#__PURE__*/function () {
3940
- var _ref10 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee10(status) {
4019
+ var _ref11 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee11(status) {
3941
4020
  var res, job;
3942
- return _regeneratorRuntime__default['default'].wrap(function _callee10$(_context10) {
4021
+ return _regeneratorRuntime__default['default'].wrap(function _callee11$(_context11) {
3943
4022
  while (1) {
3944
- switch (_context10.prev = _context10.next) {
4023
+ switch (_context11.prev = _context11.next) {
3945
4024
  case 0:
3946
4025
  _this.setState({
3947
4026
  job: _objectSpread$4(_objectSpread$4({}, _this.state.job), {}, {
@@ -3950,12 +4029,12 @@ var Job = /*#__PURE__*/function (_Component) {
3950
4029
  statusChangerOpen: false
3951
4030
  });
3952
4031
 
3953
- _context10.prev = 1;
3954
- _context10.next = 4;
4032
+ _context11.prev = 1;
4033
+ _context11.next = 4;
3955
4034
  return maintenanceActions.editJobStatus(_this.state.job.id, status);
3956
4035
 
3957
4036
  case 4:
3958
- res = _context10.sent;
4037
+ res = _context11.sent;
3959
4038
  job = res.data.job;
3960
4039
 
3961
4040
  _this.props.jobsLoaded([job]);
@@ -3964,24 +4043,24 @@ var Job = /*#__PURE__*/function (_Component) {
3964
4043
  job: job
3965
4044
  });
3966
4045
 
3967
- _context10.next = 13;
4046
+ _context11.next = 13;
3968
4047
  break;
3969
4048
 
3970
4049
  case 10:
3971
- _context10.prev = 10;
3972
- _context10.t0 = _context10["catch"](1);
3973
- console.error('onSelectStatus', _context10.t0);
4050
+ _context11.prev = 10;
4051
+ _context11.t0 = _context11["catch"](1);
4052
+ console.error('onSelectStatus', _context11.t0);
3974
4053
 
3975
4054
  case 13:
3976
4055
  case "end":
3977
- return _context10.stop();
4056
+ return _context11.stop();
3978
4057
  }
3979
4058
  }
3980
- }, _callee10, null, [[1, 10]]);
4059
+ }, _callee11, null, [[1, 10]]);
3981
4060
  }));
3982
4061
 
3983
4062
  return function (_x3) {
3984
- return _ref10.apply(this, arguments);
4063
+ return _ref11.apply(this, arguments);
3985
4064
  };
3986
4065
  }());
3987
4066
 
@@ -4001,7 +4080,10 @@ var Job = /*#__PURE__*/function (_Component) {
4001
4080
  noteImages: [],
4002
4081
  assignees: [],
4003
4082
  externalSync: null,
4004
- loadingExternalSync: false
4083
+ loadingExternalSync: false,
4084
+ retryingSync: false,
4085
+ retrySyncError: null,
4086
+ retrySyncInitiated: false
4005
4087
  };
4006
4088
  return _this;
4007
4089
  }
@@ -4533,24 +4615,122 @@ var Job = /*#__PURE__*/function (_Component) {
4533
4615
  className: "flex-1"
4534
4616
  }, "Priority")));
4535
4617
  }
4618
+ }, {
4619
+ key: "hasSyncFailureWithoutSuccess",
4620
+ value: function hasSyncFailureWithoutSuccess() {
4621
+ var job = this.state.job;
4622
+ if (!job || !job.history) return false;
4623
+ var history = job.history || [];
4624
+ var hasSuccess = history.some(function (entry) {
4625
+ return entry.EntryType === 'ExternalIDSet';
4626
+ });
4627
+ var hasFailure = history.some(function (entry) {
4628
+ return entry.EntryType === 'ExternalIDSetFailed';
4629
+ });
4630
+ return hasFailure && !hasSuccess;
4631
+ }
4632
+ }, {
4633
+ key: "renderRetrySyncButton",
4634
+ value: function renderRetrySyncButton() {
4635
+ var auth = this.props.auth;
4636
+ var _this$state3 = this.state,
4637
+ retryingSync = _this$state3.retryingSync,
4638
+ retrySyncInitiated = _this$state3.retrySyncInitiated; // Only show for users with maintenance tracking permission
4639
+
4640
+ 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
4641
+
4642
+ if (!this.hasSyncFailureWithoutSuccess() || retrySyncInitiated) return null; // Show spinner while retrying
4643
+
4644
+ if (retryingSync) {
4645
+ return /*#__PURE__*/React__default['default'].createElement(FontAwesome__default['default'], {
4646
+ style: {
4647
+ fontSize: 20,
4648
+ color: Colours$1.COLOUR_DUSK_LIGHT,
4649
+ marginLeft: 8
4650
+ },
4651
+ name: "spinner fa-pulse fa-fw"
4652
+ });
4653
+ }
4654
+
4655
+ return /*#__PURE__*/React__default['default'].createElement("div", {
4656
+ className: "statusLabel pointer",
4657
+ onClick: this.onRetrySync,
4658
+ style: {
4659
+ backgroundColor: Colours$1.COLOUR_RED,
4660
+ marginLeft: 8
4661
+ }
4662
+ }, /*#__PURE__*/React__default['default'].createElement("span", {
4663
+ className: "statusLabel_text"
4664
+ }, "Retry Sync"));
4665
+ }
4666
+ }, {
4667
+ key: "renderExternalSyncStatus",
4668
+ value: function renderExternalSyncStatus() {
4669
+ var _this$state4 = this.state,
4670
+ retrySyncError = _this$state4.retrySyncError,
4671
+ retrySyncInitiated = _this$state4.retrySyncInitiated; // Show error message if retry failed
4672
+
4673
+ if (retrySyncError) {
4674
+ return /*#__PURE__*/React__default['default'].createElement(Components$3.Text, {
4675
+ type: "body"
4676
+ }, /*#__PURE__*/React__default['default'].createElement(FontAwesome__default['default'], {
4677
+ className: "userStatusIcon",
4678
+ name: "times-circle",
4679
+ style: {
4680
+ color: Colours$1.COLOUR_RED
4681
+ }
4682
+ }), " ", retrySyncError);
4683
+ } // Show success message if retry was initiated
4684
+
4685
+
4686
+ if (retrySyncInitiated) {
4687
+ return /*#__PURE__*/React__default['default'].createElement(Components$3.Text, {
4688
+ type: "body"
4689
+ }, /*#__PURE__*/React__default['default'].createElement(FontAwesome__default['default'], {
4690
+ className: "userStatusIcon",
4691
+ name: "check-circle",
4692
+ style: {
4693
+ color: Colours$1.COLOUR_GREEN
4694
+ }
4695
+ }), " Sync retry initiated. Check back shortly for results.");
4696
+ } // Show failure message with instruction
4697
+
4698
+
4699
+ if (this.hasSyncFailureWithoutSuccess()) {
4700
+ return /*#__PURE__*/React__default['default'].createElement(Components$3.Text, {
4701
+ type: "body"
4702
+ }, /*#__PURE__*/React__default['default'].createElement(FontAwesome__default['default'], {
4703
+ className: "userStatusIcon",
4704
+ name: "times-circle",
4705
+ style: {
4706
+ color: Colours$1.COLOUR_RED
4707
+ }
4708
+ }), " External sync failed. Use the retry button to attempt again.");
4709
+ }
4710
+
4711
+ return null;
4712
+ }
4536
4713
  }, {
4537
4714
  key: "renderExternalSync",
4538
4715
  value: function renderExternalSync() {
4539
- var _this$state3 = this.state,
4540
- externalSync = _this$state3.externalSync,
4541
- loadingExternalSync = _this$state3.loadingExternalSync; // Only show if external sync data exists
4716
+ var _this$state5 = this.state,
4717
+ externalSync = _this$state5.externalSync,
4718
+ loadingExternalSync = _this$state5.loadingExternalSync; // Check if we should show this section at all
4719
+
4720
+ var hasExternalSyncData = externalSync && !loadingExternalSync;
4721
+ var hasSyncFailure = this.hasSyncFailureWithoutSuccess(); // Show section if we have sync data OR if there's a failure that can be retried
4542
4722
 
4543
- if (!externalSync || loadingExternalSync) return null;
4723
+ if (!hasExternalSyncData && !hasSyncFailure) return null;
4544
4724
  return /*#__PURE__*/React__default['default'].createElement("div", {
4545
4725
  className: "padding-32 paddingVertical-40 bottomDivideBorder relative"
4546
4726
  }, /*#__PURE__*/React__default['default'].createElement("div", {
4547
4727
  className: "newTopBar clearfix flex flex-reverse"
4548
- }, /*#__PURE__*/React__default['default'].createElement(Components$3.Text, {
4728
+ }, this.renderRetrySyncButton(), /*#__PURE__*/React__default['default'].createElement(Components$3.Text, {
4549
4729
  type: "formTitleSmall",
4550
4730
  className: "flex-1"
4551
4731
  }, "External Sync")), /*#__PURE__*/React__default['default'].createElement("div", {
4552
4732
  className: "marginTop-16"
4553
- }, externalSync.systemType && /*#__PURE__*/React__default['default'].createElement(Components$3.Text, {
4733
+ }, hasExternalSyncData ? /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, externalSync.systemType && /*#__PURE__*/React__default['default'].createElement(Components$3.Text, {
4554
4734
  type: "body",
4555
4735
  className: "marginBottom-8"
4556
4736
  }, /*#__PURE__*/React__default['default'].createElement("strong", null, "System:"), " ", externalSync.systemType), externalSync.externalId && /*#__PURE__*/React__default['default'].createElement(Components$3.Text, {
@@ -4559,7 +4739,7 @@ var Job = /*#__PURE__*/function (_Component) {
4559
4739
  }, /*#__PURE__*/React__default['default'].createElement("strong", null, "External ID:"), " ", externalSync.externalId), externalSync.syncedAt && /*#__PURE__*/React__default['default'].createElement(Components$3.Text, {
4560
4740
  type: "body",
4561
4741
  className: "marginBottom-8"
4562
- }, /*#__PURE__*/React__default['default'].createElement("strong", null, "Synced:"), " ", moment__default['default'].utc(externalSync.syncedAt).local().format('D MMM YYYY h:mma'))));
4742
+ }, /*#__PURE__*/React__default['default'].createElement("strong", null, "Synced:"), " ", moment__default['default'].utc(externalSync.syncedAt).local().format('D MMM YYYY h:mma'))) : this.renderExternalSyncStatus()));
4563
4743
  }
4564
4744
  }, {
4565
4745
  key: "renderOverview",
@@ -4717,8 +4897,8 @@ var Job = /*#__PURE__*/function (_Component) {
4717
4897
  }), /*#__PURE__*/React__default['default'].createElement("p", {
4718
4898
  className: "iconTextButton_text"
4719
4899
  }, "Add Attachment")), /*#__PURE__*/React__default['default'].createElement(Components$3.ImageInput, {
4720
- ref: function ref(_ref11) {
4721
- _this8.imageInput = _ref11;
4900
+ ref: function ref(_ref12) {
4901
+ _this8.imageInput = _ref12;
4722
4902
  },
4723
4903
  multiple: true,
4724
4904
  refreshCallback: function refreshCallback(images) {
@@ -4976,6 +5156,12 @@ var AddJob = /*#__PURE__*/function (_Component) {
4976
5156
  if (res.data != null && !___default['default'].isEmpty(res.data.results.Items)) {
4977
5157
  items = res.data.results.Items;
4978
5158
 
5159
+ if (_this.props.optionOnlyForResidents) {
5160
+ items = ___default['default'].filter(items, function (u) {
5161
+ return u.category === 'resident';
5162
+ });
5163
+ }
5164
+
4979
5165
  _this.setState({
4980
5166
  users: ___default['default'].sortBy(items, function (u) {
4981
5167
  return (u.displayName || '').toLowerCase();
@@ -6092,7 +6278,8 @@ var mapStateToProps$2 = function mapStateToProps(state) {
6092
6278
  var auth = state.auth;
6093
6279
  return {
6094
6280
  auth: auth,
6095
- strings: state.strings && state.strings.config || {}
6281
+ strings: state.strings && state.strings.config || {},
6282
+ optionOnlyForResidents: Helper$1.getSiteSettingFromState(state, values.optionOnlyForResidents)
6096
6283
  };
6097
6284
  };
6098
6285