@plusscommunities/pluss-maintenance-web 1.1.27-auth.0 → 1.1.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -461,6 +461,14 @@ var maintenanceActions = {
461
461
  id: id
462
462
  }
463
463
  });
464
+ },
465
+ getExternalSync: function getExternalSync(jobId) {
466
+ return Session$9.authedFunction({
467
+ method: 'GET',
468
+ url: Helper$5.getUrl(values.serviceKey, 'get/externalsync', {
469
+ id: jobId
470
+ })
471
+ });
464
472
  }
465
473
  };
466
474
 
@@ -3331,6 +3339,54 @@ var Job = /*#__PURE__*/function (_Component) {
3331
3339
  }, _callee2, null, [[0, 7]]);
3332
3340
  })));
3333
3341
 
3342
+ _defineProperty(_assertThisInitialized(_this), "getExternalSync", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
3343
+ var res, _error$response;
3344
+
3345
+ return _regeneratorRuntime.wrap(function _callee3$(_context3) {
3346
+ while (1) {
3347
+ switch (_context3.prev = _context3.next) {
3348
+ case 0:
3349
+ _context3.prev = 0;
3350
+
3351
+ _this.setState({
3352
+ loadingExternalSync: true
3353
+ });
3354
+
3355
+ _context3.next = 4;
3356
+ return maintenanceActions.getExternalSync(_this.state.jobId);
3357
+
3358
+ case 4:
3359
+ res = _context3.sent;
3360
+
3361
+ _this.setState({
3362
+ externalSync: res.data,
3363
+ loadingExternalSync: false
3364
+ });
3365
+
3366
+ _context3.next = 12;
3367
+ break;
3368
+
3369
+ case 8:
3370
+ _context3.prev = 8;
3371
+ _context3.t0 = _context3["catch"](0);
3372
+
3373
+ // 404 is expected if no sync - don't show error
3374
+ if (((_error$response = _context3.t0.response) === null || _error$response === void 0 ? void 0 : _error$response.status) !== 404) {
3375
+ console.error('getExternalSync', _context3.t0);
3376
+ }
3377
+
3378
+ _this.setState({
3379
+ loadingExternalSync: false
3380
+ });
3381
+
3382
+ case 12:
3383
+ case "end":
3384
+ return _context3.stop();
3385
+ }
3386
+ }
3387
+ }, _callee3, null, [[0, 8]]);
3388
+ })));
3389
+
3334
3390
  _defineProperty(_assertThisInitialized(_this), "getStatusType", function (status) {
3335
3391
  var statusTypes = _this.props.statusTypes;
3336
3392
  var statusType = statusTypes.find(function (s) {
@@ -3496,35 +3552,35 @@ var Job = /*#__PURE__*/function (_Component) {
3496
3552
  });
3497
3553
  });
3498
3554
 
3499
- _defineProperty(_assertThisInitialized(_this), "onConfirmAssignee", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
3500
- return _regeneratorRuntime.wrap(function _callee3$(_context3) {
3555
+ _defineProperty(_assertThisInitialized(_this), "onConfirmAssignee", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
3556
+ return _regeneratorRuntime.wrap(function _callee4$(_context4) {
3501
3557
  while (1) {
3502
- switch (_context3.prev = _context3.next) {
3558
+ switch (_context4.prev = _context4.next) {
3503
3559
  case 0:
3504
3560
  _this.setState({
3505
3561
  confirmingAssignee: true
3506
3562
  });
3507
3563
 
3508
- _context3.prev = 1;
3564
+ _context4.prev = 1;
3509
3565
 
3510
3566
  if (!_this.state.selectedAssignee) {
3511
- _context3.next = 5;
3567
+ _context4.next = 5;
3512
3568
  break;
3513
3569
  }
3514
3570
 
3515
- _context3.next = 5;
3571
+ _context4.next = 5;
3516
3572
  return _this.onAssignUser(_this.state.selectedAssignee.id);
3517
3573
 
3518
3574
  case 5:
3519
3575
  _this.onCloseSelectAssignee();
3520
3576
 
3521
- _context3.next = 11;
3577
+ _context4.next = 11;
3522
3578
  break;
3523
3579
 
3524
3580
  case 8:
3525
- _context3.prev = 8;
3526
- _context3.t0 = _context3["catch"](1);
3527
- console.error('onConfirmAssignee', _context3.t0);
3581
+ _context4.prev = 8;
3582
+ _context4.t0 = _context4["catch"](1);
3583
+ console.error('onConfirmAssignee', _context4.t0);
3528
3584
 
3529
3585
  case 11:
3530
3586
  _this.setState({
@@ -3533,68 +3589,68 @@ var Job = /*#__PURE__*/function (_Component) {
3533
3589
 
3534
3590
  case 12:
3535
3591
  case "end":
3536
- return _context3.stop();
3592
+ return _context4.stop();
3537
3593
  }
3538
3594
  }
3539
- }, _callee3, null, [[1, 8]]);
3595
+ }, _callee4, null, [[1, 8]]);
3540
3596
  })));
3541
3597
 
3542
3598
  _defineProperty(_assertThisInitialized(_this), "onAssignUser", /*#__PURE__*/function () {
3543
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(userId) {
3544
- return _regeneratorRuntime.wrap(function _callee4$(_context4) {
3599
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(userId) {
3600
+ return _regeneratorRuntime.wrap(function _callee5$(_context5) {
3545
3601
  while (1) {
3546
- switch (_context4.prev = _context4.next) {
3602
+ switch (_context5.prev = _context5.next) {
3547
3603
  case 0:
3548
- _context4.prev = 0;
3549
- _context4.next = 3;
3604
+ _context5.prev = 0;
3605
+ _context5.next = 3;
3550
3606
  return maintenanceActions.assignJob(_this.state.jobId, userId);
3551
3607
 
3552
3608
  case 3:
3553
3609
 
3554
3610
  _this.getJob();
3555
3611
 
3556
- _context4.next = 10;
3612
+ _context5.next = 10;
3557
3613
  break;
3558
3614
 
3559
3615
  case 7:
3560
- _context4.prev = 7;
3561
- _context4.t0 = _context4["catch"](0);
3562
- console.error('onAssignUser', _context4.t0);
3616
+ _context5.prev = 7;
3617
+ _context5.t0 = _context5["catch"](0);
3618
+ console.error('onAssignUser', _context5.t0);
3563
3619
 
3564
3620
  case 10:
3565
3621
  case "end":
3566
- return _context4.stop();
3622
+ return _context5.stop();
3567
3623
  }
3568
3624
  }
3569
- }, _callee4, null, [[0, 7]]);
3625
+ }, _callee5, null, [[0, 7]]);
3570
3626
  }));
3571
3627
 
3572
3628
  return function (_x) {
3573
- return _ref4.apply(this, arguments);
3629
+ return _ref5.apply(this, arguments);
3574
3630
  };
3575
3631
  }());
3576
3632
 
3577
- _defineProperty(_assertThisInitialized(_this), "onConfirmAddNote", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
3633
+ _defineProperty(_assertThisInitialized(_this), "onConfirmAddNote", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
3578
3634
  var res;
3579
- return _regeneratorRuntime.wrap(function _callee5$(_context5) {
3635
+ return _regeneratorRuntime.wrap(function _callee6$(_context6) {
3580
3636
  while (1) {
3581
- switch (_context5.prev = _context5.next) {
3637
+ switch (_context6.prev = _context6.next) {
3582
3638
  case 0:
3583
3639
  if (_this.isReadyToSaveNote()) {
3584
- _context5.next = 2;
3640
+ _context6.next = 2;
3585
3641
  break;
3586
3642
  }
3587
3643
 
3588
- return _context5.abrupt("return");
3644
+ return _context6.abrupt("return");
3589
3645
 
3590
3646
  case 2:
3591
- _context5.prev = 2;
3647
+ _context6.prev = 2;
3592
3648
 
3593
3649
  _this.setState({
3594
3650
  submittingNote: true
3595
3651
  });
3596
3652
 
3597
- _context5.next = 6;
3653
+ _context6.next = 6;
3598
3654
  return _this.state.editingNote ? maintenanceActions.editNote(_this.state.jobId, _this.state.editingNote, _this.state.noteInput, _this.state.noteAttachments.map(function (a) {
3599
3655
  return {
3600
3656
  Title: a.Title,
@@ -3608,7 +3664,7 @@ var Job = /*#__PURE__*/function (_Component) {
3608
3664
  }), _this.state.noteImages);
3609
3665
 
3610
3666
  case 6:
3611
- res = _context5.sent;
3667
+ res = _context6.sent;
3612
3668
 
3613
3669
  _this.setState({
3614
3670
  job: res.data.job,
@@ -3622,20 +3678,20 @@ var Job = /*#__PURE__*/function (_Component) {
3622
3678
  _this.props.jobsLoaded([_this.state.job]);
3623
3679
  });
3624
3680
 
3625
- _context5.next = 13;
3681
+ _context6.next = 13;
3626
3682
  break;
3627
3683
 
3628
3684
  case 10:
3629
- _context5.prev = 10;
3630
- _context5.t0 = _context5["catch"](2);
3631
- console.error('onConfirmAddNote', _context5.t0);
3685
+ _context6.prev = 10;
3686
+ _context6.t0 = _context6["catch"](2);
3687
+ console.error('onConfirmAddNote', _context6.t0);
3632
3688
 
3633
3689
  case 13:
3634
3690
  case "end":
3635
- return _context5.stop();
3691
+ return _context6.stop();
3636
3692
  }
3637
3693
  }
3638
- }, _callee5, null, [[2, 10]]);
3694
+ }, _callee6, null, [[2, 10]]);
3639
3695
  })));
3640
3696
 
3641
3697
  _defineProperty(_assertThisInitialized(_this), "onDeleteNote", function (n) {
@@ -3683,42 +3739,42 @@ var Job = /*#__PURE__*/function (_Component) {
3683
3739
 
3684
3740
  _this.setState({
3685
3741
  updating: true
3686
- }, /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
3742
+ }, /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
3687
3743
  var update;
3688
- return _regeneratorRuntime.wrap(function _callee6$(_context6) {
3744
+ return _regeneratorRuntime.wrap(function _callee7$(_context7) {
3689
3745
  while (1) {
3690
- switch (_context6.prev = _context6.next) {
3746
+ switch (_context7.prev = _context7.next) {
3691
3747
  case 0:
3692
- _context6.prev = 0;
3748
+ _context7.prev = 0;
3693
3749
  update = {
3694
3750
  id: job.id,
3695
3751
  seen: true,
3696
3752
  status: job.status || 'Unassigned'
3697
3753
  };
3698
- _context6.next = 4;
3754
+ _context7.next = 4;
3699
3755
  return maintenanceActions.editJob(update, auth.site);
3700
3756
 
3701
3757
  case 4:
3702
- _context6.next = 11;
3758
+ _context7.next = 11;
3703
3759
  break;
3704
3760
 
3705
3761
  case 6:
3706
- _context6.prev = 6;
3707
- _context6.t0 = _context6["catch"](0);
3762
+ _context7.prev = 6;
3763
+ _context7.t0 = _context7["catch"](0);
3708
3764
 
3709
3765
  _this.setState({
3710
3766
  updating: false
3711
3767
  });
3712
3768
 
3713
- console.log('markSeen error', _context6.t0);
3769
+ console.log('markSeen error', _context7.t0);
3714
3770
  alert('Something went wrong with the request. Please try again.');
3715
3771
 
3716
3772
  case 11:
3717
3773
  case "end":
3718
- return _context6.stop();
3774
+ return _context7.stop();
3719
3775
  }
3720
3776
  }
3721
- }, _callee6, null, [[0, 6]]);
3777
+ }, _callee7, null, [[0, 6]]);
3722
3778
  })));
3723
3779
  });
3724
3780
 
@@ -3730,44 +3786,44 @@ var Job = /*#__PURE__*/function (_Component) {
3730
3786
  });
3731
3787
  });
3732
3788
 
3733
- _defineProperty(_assertThisInitialized(_this), "onAddComment", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
3789
+ _defineProperty(_assertThisInitialized(_this), "onAddComment", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
3734
3790
  var _this$state2, commentInput, jobId, job, comments, res;
3735
3791
 
3736
- return _regeneratorRuntime.wrap(function _callee7$(_context7) {
3792
+ return _regeneratorRuntime.wrap(function _callee8$(_context8) {
3737
3793
  while (1) {
3738
- switch (_context7.prev = _context7.next) {
3794
+ switch (_context8.prev = _context8.next) {
3739
3795
  case 0:
3740
3796
  _this$state2 = _this.state, commentInput = _this$state2.commentInput, jobId = _this$state2.jobId, job = _this$state2.job, comments = _this$state2.comments;
3741
- _context7.prev = 1;
3797
+ _context8.prev = 1;
3742
3798
 
3743
3799
  _this.setState({
3744
3800
  commentInput: ''
3745
3801
  });
3746
3802
 
3747
- _context7.next = 5;
3803
+ _context8.next = 5;
3748
3804
  return reactionActions.addComment(jobId, values.commentKey, job.title, job.site, commentInput);
3749
3805
 
3750
3806
  case 5:
3751
- res = _context7.sent;
3807
+ res = _context8.sent;
3752
3808
 
3753
3809
  _this.setState({
3754
3810
  comments: [].concat(_toConsumableArray(comments), [res.data])
3755
3811
  });
3756
3812
 
3757
- _context7.next = 12;
3813
+ _context8.next = 12;
3758
3814
  break;
3759
3815
 
3760
3816
  case 9:
3761
- _context7.prev = 9;
3762
- _context7.t0 = _context7["catch"](1);
3763
- console.error('onAddComment', _context7.t0);
3817
+ _context8.prev = 9;
3818
+ _context8.t0 = _context8["catch"](1);
3819
+ console.error('onAddComment', _context8.t0);
3764
3820
 
3765
3821
  case 12:
3766
3822
  case "end":
3767
- return _context7.stop();
3823
+ return _context8.stop();
3768
3824
  }
3769
3825
  }
3770
- }, _callee7, null, [[1, 9]]);
3826
+ }, _callee8, null, [[1, 9]]);
3771
3827
  })));
3772
3828
 
3773
3829
  _defineProperty(_assertThisInitialized(_this), "onHandleChange", function (event) {
@@ -3784,11 +3840,11 @@ var Job = /*#__PURE__*/function (_Component) {
3784
3840
  });
3785
3841
 
3786
3842
  _defineProperty(_assertThisInitialized(_this), "onSelectPriority", /*#__PURE__*/function () {
3787
- var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(priority) {
3843
+ var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(priority) {
3788
3844
  var res, job;
3789
- return _regeneratorRuntime.wrap(function _callee8$(_context8) {
3845
+ return _regeneratorRuntime.wrap(function _callee9$(_context9) {
3790
3846
  while (1) {
3791
- switch (_context8.prev = _context8.next) {
3847
+ switch (_context9.prev = _context9.next) {
3792
3848
  case 0:
3793
3849
  _this.setState({
3794
3850
  job: _objectSpread$4(_objectSpread$4({}, _this.state.job), {}, {
@@ -3797,12 +3853,12 @@ var Job = /*#__PURE__*/function (_Component) {
3797
3853
  priorityChangerOpen: false
3798
3854
  });
3799
3855
 
3800
- _context8.prev = 1;
3801
- _context8.next = 4;
3856
+ _context9.prev = 1;
3857
+ _context9.next = 4;
3802
3858
  return maintenanceActions.editJobPriority(_this.state.job.id, priority);
3803
3859
 
3804
3860
  case 4:
3805
- res = _context8.sent;
3861
+ res = _context9.sent;
3806
3862
  job = res.data.job;
3807
3863
 
3808
3864
  _this.props.jobsLoaded([job]);
@@ -3811,24 +3867,24 @@ var Job = /*#__PURE__*/function (_Component) {
3811
3867
  job: job
3812
3868
  });
3813
3869
 
3814
- _context8.next = 13;
3870
+ _context9.next = 13;
3815
3871
  break;
3816
3872
 
3817
3873
  case 10:
3818
- _context8.prev = 10;
3819
- _context8.t0 = _context8["catch"](1);
3820
- console.error('onSelectPriority', _context8.t0);
3874
+ _context9.prev = 10;
3875
+ _context9.t0 = _context9["catch"](1);
3876
+ console.error('onSelectPriority', _context9.t0);
3821
3877
 
3822
3878
  case 13:
3823
3879
  case "end":
3824
- return _context8.stop();
3880
+ return _context9.stop();
3825
3881
  }
3826
3882
  }
3827
- }, _callee8, null, [[1, 10]]);
3883
+ }, _callee9, null, [[1, 10]]);
3828
3884
  }));
3829
3885
 
3830
3886
  return function (_x2) {
3831
- return _ref8.apply(this, arguments);
3887
+ return _ref9.apply(this, arguments);
3832
3888
  };
3833
3889
  }());
3834
3890
 
@@ -3839,11 +3895,11 @@ var Job = /*#__PURE__*/function (_Component) {
3839
3895
  });
3840
3896
 
3841
3897
  _defineProperty(_assertThisInitialized(_this), "onSelectStatus", /*#__PURE__*/function () {
3842
- var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(status) {
3898
+ var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(status) {
3843
3899
  var res, job;
3844
- return _regeneratorRuntime.wrap(function _callee9$(_context9) {
3900
+ return _regeneratorRuntime.wrap(function _callee10$(_context10) {
3845
3901
  while (1) {
3846
- switch (_context9.prev = _context9.next) {
3902
+ switch (_context10.prev = _context10.next) {
3847
3903
  case 0:
3848
3904
  _this.setState({
3849
3905
  job: _objectSpread$4(_objectSpread$4({}, _this.state.job), {}, {
@@ -3852,12 +3908,12 @@ var Job = /*#__PURE__*/function (_Component) {
3852
3908
  statusChangerOpen: false
3853
3909
  });
3854
3910
 
3855
- _context9.prev = 1;
3856
- _context9.next = 4;
3911
+ _context10.prev = 1;
3912
+ _context10.next = 4;
3857
3913
  return maintenanceActions.editJobStatus(_this.state.job.id, status);
3858
3914
 
3859
3915
  case 4:
3860
- res = _context9.sent;
3916
+ res = _context10.sent;
3861
3917
  job = res.data.job;
3862
3918
 
3863
3919
  _this.props.jobsLoaded([job]);
@@ -3866,24 +3922,24 @@ var Job = /*#__PURE__*/function (_Component) {
3866
3922
  job: job
3867
3923
  });
3868
3924
 
3869
- _context9.next = 13;
3925
+ _context10.next = 13;
3870
3926
  break;
3871
3927
 
3872
3928
  case 10:
3873
- _context9.prev = 10;
3874
- _context9.t0 = _context9["catch"](1);
3875
- console.error('onSelectStatus', _context9.t0);
3929
+ _context10.prev = 10;
3930
+ _context10.t0 = _context10["catch"](1);
3931
+ console.error('onSelectStatus', _context10.t0);
3876
3932
 
3877
3933
  case 13:
3878
3934
  case "end":
3879
- return _context9.stop();
3935
+ return _context10.stop();
3880
3936
  }
3881
3937
  }
3882
- }, _callee9, null, [[1, 10]]);
3938
+ }, _callee10, null, [[1, 10]]);
3883
3939
  }));
3884
3940
 
3885
3941
  return function (_x3) {
3886
- return _ref9.apply(this, arguments);
3942
+ return _ref10.apply(this, arguments);
3887
3943
  };
3888
3944
  }());
3889
3945
 
@@ -3901,7 +3957,9 @@ var Job = /*#__PURE__*/function (_Component) {
3901
3957
  noteAttachments: [],
3902
3958
  noteInput: '',
3903
3959
  noteImages: [],
3904
- assignees: []
3960
+ assignees: [],
3961
+ externalSync: null,
3962
+ loadingExternalSync: false
3905
3963
  };
3906
3964
  return _this;
3907
3965
  }
@@ -3920,6 +3978,7 @@ var Job = /*#__PURE__*/function (_Component) {
3920
3978
  this.getJob();
3921
3979
  this.getComments();
3922
3980
  this.getAssignees();
3981
+ this.getExternalSync();
3923
3982
  }
3924
3983
  }
3925
3984
  }, {
@@ -4398,6 +4457,26 @@ var Job = /*#__PURE__*/function (_Component) {
4398
4457
  className: "statusLabel_text"
4399
4458
  }, e.user.displayName, " assigned the ", values.textSingularName, " to ", e.assignedUser ? e.assignedUser.displayName : 'Unassigned')));
4400
4459
  }
4460
+ }, {
4461
+ key: "renderExternalSyncEntry",
4462
+ value: function renderExternalSyncEntry(e, i) {
4463
+ var isSuccess = e.EntryType === 'ExternalIDSet';
4464
+ var backgroundColor = isSuccess ? Colours$1.COLOUR_GREEN : Colours$1.COLOUR_RED; // Green for success, red for failure
4465
+
4466
+ return /*#__PURE__*/React.createElement("div", {
4467
+ className: "ticketHistoryEntry",
4468
+ key: i
4469
+ }, /*#__PURE__*/React.createElement("p", {
4470
+ className: "ticketHistoryEntry_timestamp"
4471
+ }, moment.utc(e.timestamp).local().format('D MMM YYYY h:mma')), /*#__PURE__*/React.createElement("div", {
4472
+ className: "statusLabel statusLabel-large statusLabel-full",
4473
+ style: {
4474
+ backgroundColor: backgroundColor
4475
+ }
4476
+ }, /*#__PURE__*/React.createElement("span", {
4477
+ className: "statusLabel_text"
4478
+ }, isSuccess ? "Synced to ".concat(e.externalSystem || 'external system').concat(e.externalId ? " (ID: ".concat(e.externalId, ")") : '') : "Failed to sync to external system".concat(e.error ? ": ".concat(e.error) : ''))));
4479
+ }
4401
4480
  }, {
4402
4481
  key: "renderPriority",
4403
4482
  value: function renderPriority() {
@@ -4412,6 +4491,34 @@ var Job = /*#__PURE__*/function (_Component) {
4412
4491
  className: "flex-1"
4413
4492
  }, "Priority")));
4414
4493
  }
4494
+ }, {
4495
+ key: "renderExternalSync",
4496
+ value: function renderExternalSync() {
4497
+ var _this$state3 = this.state,
4498
+ externalSync = _this$state3.externalSync,
4499
+ loadingExternalSync = _this$state3.loadingExternalSync; // Only show if external sync data exists
4500
+
4501
+ if (!externalSync || loadingExternalSync) return null;
4502
+ return /*#__PURE__*/React.createElement("div", {
4503
+ className: "padding-32 paddingVertical-40 bottomDivideBorder relative"
4504
+ }, /*#__PURE__*/React.createElement("div", {
4505
+ className: "newTopBar clearfix flex flex-reverse"
4506
+ }, /*#__PURE__*/React.createElement(Components$3.Text, {
4507
+ type: "formTitleSmall",
4508
+ className: "flex-1"
4509
+ }, "External Sync")), /*#__PURE__*/React.createElement("div", {
4510
+ className: "marginTop-16"
4511
+ }, externalSync.externalSystem && /*#__PURE__*/React.createElement(Components$3.Text, {
4512
+ type: "body",
4513
+ className: "marginBottom-8"
4514
+ }, /*#__PURE__*/React.createElement("strong", null, "System:"), " ", externalSync.externalSystem), externalSync.externalId && /*#__PURE__*/React.createElement(Components$3.Text, {
4515
+ type: "body",
4516
+ className: "marginBottom-8"
4517
+ }, /*#__PURE__*/React.createElement("strong", null, "External ID:"), " ", externalSync.externalId), externalSync.syncedAt && /*#__PURE__*/React.createElement(Components$3.Text, {
4518
+ type: "body",
4519
+ className: "marginBottom-8"
4520
+ }, /*#__PURE__*/React.createElement("strong", null, "Synced:"), " ", moment.utc(externalSync.syncedAt).local().format('D MMM YYYY h:mma'))));
4521
+ }
4415
4522
  }, {
4416
4523
  key: "renderOverview",
4417
4524
  value: function renderOverview() {
@@ -4448,6 +4555,10 @@ var Job = /*#__PURE__*/function (_Component) {
4448
4555
 
4449
4556
  case 'assignment':
4450
4557
  return _this7.renderAssignmentEntry(e, i);
4558
+
4559
+ case 'ExternalIDSet':
4560
+ case 'ExternalIDSetFailed':
4561
+ return _this7.renderExternalSyncEntry(e, i);
4451
4562
  }
4452
4563
  }));
4453
4564
  }
@@ -4564,8 +4675,8 @@ var Job = /*#__PURE__*/function (_Component) {
4564
4675
  }), /*#__PURE__*/React.createElement("p", {
4565
4676
  className: "iconTextButton_text"
4566
4677
  }, "Add Attachment")), /*#__PURE__*/React.createElement(Components$3.ImageInput, {
4567
- ref: function ref(_ref10) {
4568
- _this8.imageInput = _ref10;
4678
+ ref: function ref(_ref11) {
4679
+ _this8.imageInput = _ref11;
4569
4680
  },
4570
4681
  multiple: true,
4571
4682
  refreshCallback: function refreshCallback(images) {
@@ -4664,7 +4775,7 @@ var Job = /*#__PURE__*/function (_Component) {
4664
4775
  className: "pageSectionWrapper--fixedPopupSize"
4665
4776
  }, this.renderInner()), /*#__PURE__*/React.createElement(Components$3.OverlayPageSection, {
4666
4777
  className: "pageSectionWrapper--newPopupSide pageSectionWrapper--newPopupSide-fixedWidth"
4667
- }, this.renderAssignment(), this.renderPriority(), this.renderOverview())), /*#__PURE__*/React.createElement(Components$3.OverlayPageBottomButtons, null, this.renderButtons()));
4778
+ }, this.renderAssignment(), this.renderPriority(), this.renderExternalSync(), this.renderOverview())), /*#__PURE__*/React.createElement(Components$3.OverlayPageBottomButtons, null, this.renderButtons()));
4668
4779
  }
4669
4780
  }]);
4670
4781
 
@@ -5995,8 +6106,8 @@ var AddJobType = /*#__PURE__*/function (_Component) {
5995
6106
  jobTypeEmail: email,
5996
6107
  jobTypeDescription: description,
5997
6108
  jobTypeLevel: level,
5998
- hasCustomFields: hasCustomFields,
5999
- customFields: customFields
6109
+ hasCustomFields: !!hasCustomFields,
6110
+ customFields: customFields || [_.cloneDeep(DEFAULT_FIELD)]
6000
6111
  });
6001
6112
 
6002
6113
  _context.next = 11;
@@ -6279,10 +6390,11 @@ var AddJobType = /*#__PURE__*/function (_Component) {
6279
6390
  }, {
6280
6391
  Title: 'Image Input',
6281
6392
  Key: 'image'
6282
- }, {
6283
- Title: 'Document Input',
6284
- Key: 'document'
6285
- }, {
6393
+ }, // {
6394
+ // Title: 'Document Input',
6395
+ // Key: 'document',
6396
+ // },
6397
+ {
6286
6398
  Title: 'Yes/No Question',
6287
6399
  Key: 'yn'
6288
6400
  }, {