@plusscommunities/pluss-maintenance-app-forms 7.0.20-auth.0 → 7.0.21

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.
Files changed (97) hide show
  1. package/dist/module/actions/JobActions.js +4 -4
  2. package/dist/module/actions/JobActions.js.map +1 -1
  3. package/dist/module/actions/index.js +1 -1
  4. package/dist/module/actions/index.js.map +1 -1
  5. package/dist/module/actions/types.js +1 -1
  6. package/dist/module/actions/types.js.map +1 -1
  7. package/dist/module/apis/index.js +3 -3
  8. package/dist/module/apis/index.js.map +1 -1
  9. package/dist/module/apis/maintenanceActions.js +42 -34
  10. package/dist/module/apis/maintenanceActions.js.map +1 -1
  11. package/dist/module/apis/userActions.js +5 -5
  12. package/dist/module/apis/userActions.js.map +1 -1
  13. package/dist/module/components/FilterPopupMenu.js +49 -49
  14. package/dist/module/components/FilterPopupMenu.js.map +1 -1
  15. package/dist/module/components/MaintenanceList.js +38 -38
  16. package/dist/module/components/MaintenanceList.js.map +1 -1
  17. package/dist/module/components/MaintenanceListItem.js +62 -62
  18. package/dist/module/components/MaintenanceListItem.js.map +1 -1
  19. package/dist/module/components/MaintenanceWidgetItem.js +27 -27
  20. package/dist/module/components/MaintenanceWidgetItem.js.map +1 -1
  21. package/dist/module/components/PrioritySelectorPopup.js +15 -15
  22. package/dist/module/components/PrioritySelectorPopup.js.map +1 -1
  23. package/dist/module/components/StatusSelectorPopup.js +16 -16
  24. package/dist/module/components/StatusSelectorPopup.js.map +1 -1
  25. package/dist/module/components/WidgetLarge.js +2 -2
  26. package/dist/module/components/WidgetLarge.js.map +1 -1
  27. package/dist/module/components/WidgetSmall.js +19 -19
  28. package/dist/module/components/WidgetSmall.js.map +1 -1
  29. package/dist/module/core.config.js +1 -1
  30. package/dist/module/core.config.js.map +1 -1
  31. package/dist/module/feature.config.js +17 -17
  32. package/dist/module/feature.config.js.map +1 -1
  33. package/dist/module/helper.js +10 -10
  34. package/dist/module/helper.js.map +1 -1
  35. package/dist/module/index.js +11 -11
  36. package/dist/module/index.js.map +1 -1
  37. package/dist/module/reducers/JobsReducer.js +13 -13
  38. package/dist/module/reducers/JobsReducer.js.map +1 -1
  39. package/dist/module/screens/JobTypePicker.js +17 -17
  40. package/dist/module/screens/JobTypePicker.js.map +1 -1
  41. package/dist/module/screens/MaintenancePage.js +10 -10
  42. package/dist/module/screens/MaintenancePage.js.map +1 -1
  43. package/dist/module/screens/MaintenanceUserPicker.js +129 -22
  44. package/dist/module/screens/MaintenanceUserPicker.js.map +1 -1
  45. package/dist/module/screens/RequestDetail.js +252 -137
  46. package/dist/module/screens/RequestDetail.js.map +1 -1
  47. package/dist/module/screens/RequestNotes.js +59 -59
  48. package/dist/module/screens/RequestNotes.js.map +1 -1
  49. package/dist/module/screens/ServiceRequest.js +198 -186
  50. package/dist/module/screens/ServiceRequest.js.map +1 -1
  51. package/dist/module/values.config.a.js +31 -30
  52. package/dist/module/values.config.a.js.map +1 -1
  53. package/dist/module/values.config.default.js +35 -34
  54. package/dist/module/values.config.default.js.map +1 -1
  55. package/dist/module/values.config.enquiry.js +35 -34
  56. package/dist/module/values.config.enquiry.js.map +1 -1
  57. package/dist/module/values.config.feedback.js +35 -34
  58. package/dist/module/values.config.feedback.js.map +1 -1
  59. package/dist/module/values.config.food.js +35 -34
  60. package/dist/module/values.config.food.js.map +1 -1
  61. package/dist/module/values.config.forms.js +34 -34
  62. package/dist/module/values.config.forms.js.map +1 -1
  63. package/dist/module/values.config.js +34 -34
  64. package/dist/module/values.config.js.map +1 -1
  65. package/package.json +52 -56
  66. package/src/actions/JobActions.js +67 -60
  67. package/src/actions/index.js +1 -1
  68. package/src/actions/types.js +1 -2
  69. package/src/apis/index.js +3 -3
  70. package/src/apis/maintenanceActions.js +189 -172
  71. package/src/apis/userActions.js +17 -17
  72. package/src/components/FilterPopupMenu.js +313 -256
  73. package/src/components/MaintenanceList.js +396 -317
  74. package/src/components/MaintenanceListItem.js +347 -288
  75. package/src/components/MaintenanceWidgetItem.js +145 -124
  76. package/src/components/PrioritySelectorPopup.js +81 -68
  77. package/src/components/StatusSelectorPopup.js +81 -70
  78. package/src/components/WidgetLarge.js +5 -5
  79. package/src/components/WidgetSmall.js +153 -133
  80. package/src/core.config.js +27 -3
  81. package/src/feature.config.js +62 -62
  82. package/src/helper.js +58 -53
  83. package/src/index.js +22 -22
  84. package/src/reducers/JobsReducer.js +85 -66
  85. package/src/screens/JobTypePicker.js +115 -92
  86. package/src/screens/MaintenancePage.js +89 -80
  87. package/src/screens/MaintenanceUserPicker.js +262 -99
  88. package/src/screens/RequestDetail.js +1344 -1021
  89. package/src/screens/RequestNotes.js +946 -805
  90. package/src/screens/ServiceRequest.js +1773 -1544
  91. package/src/values.config.a.js +34 -33
  92. package/src/values.config.default.js +40 -39
  93. package/src/values.config.enquiry.js +40 -39
  94. package/src/values.config.feedback.js +40 -39
  95. package/src/values.config.food.js +40 -39
  96. package/src/values.config.forms.js +39 -39
  97. package/src/values.config.js +39 -39
@@ -1,21 +1,21 @@
1
1
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
2
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
3
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
- import React, { Component } from 'react';
5
- import { ScrollView, View, StyleSheet, Text, KeyboardAvoidingView, TouchableOpacity, ImageBackground, Platform } from 'react-native';
6
- import DateTimePicker from 'react-native-modal-datetime-picker';
7
- import { Icon } from '@rneui/themed';
8
- import _ from 'lodash';
9
- import moment from 'moment';
10
- import { connect } from 'react-redux';
11
- import { maintenanceActions } from '../apis';
12
- import { jobAdded, jobStatusesUpdate, jobHideSeenUpdate } from '../actions';
13
- import StatusSelectorPopup from '../components/StatusSelectorPopup';
14
- import PrioritySelectorPopup from '../components/PrioritySelectorPopup';
15
- import { getJobStatus, getJobPriority } from '../helper';
16
- import { Services } from '../feature.config';
17
- import { Colours, Helper, Components, Config } from '../core.config';
18
- import { values } from '../values.config';
4
+ import React, { Component } from "react";
5
+ import { ScrollView, View, StyleSheet, Text, KeyboardAvoidingView, TouchableOpacity, ImageBackground, Platform } from "react-native";
6
+ import DateTimePicker from "react-native-modal-datetime-picker";
7
+ import { Icon } from "@rneui/themed";
8
+ import _ from "lodash";
9
+ import moment from "moment";
10
+ import { connect } from "react-redux";
11
+ import { maintenanceActions } from "../apis";
12
+ import { jobAdded, jobStatusesUpdate, jobHideSeenUpdate } from "../actions";
13
+ import StatusSelectorPopup from "../components/StatusSelectorPopup";
14
+ import PrioritySelectorPopup from "../components/PrioritySelectorPopup";
15
+ import { getJobStatus, getJobPriority } from "../helper";
16
+ import { Services } from "../feature.config";
17
+ import { Colours, Helper, Components, Config } from "../core.config";
18
+ import { values } from "../values.config";
19
19
  class RequestDetail extends Component {
20
20
  constructor(props) {
21
21
  super(props);
@@ -28,15 +28,17 @@ class RequestDetail extends Component {
28
28
  // console.log('getJob', JSON.stringify(res.data, null, 2));
29
29
  this.props.jobAdded(res.data);
30
30
  this.updateJobState(res.data);
31
+ // Refresh external sync data when job is refreshed
32
+ this.getExternalSync();
31
33
  } catch (error) {
32
- console.log('getJob error', error.toString());
34
+ console.log("getJob error", error.toString());
33
35
  // check for 403 or 404 error
34
36
  if (error.response.status === 403 || error.response.status === 404) {
35
37
  this.setState({
36
38
  forbidden: true
37
39
  });
38
40
  }
39
- console.log('getJob error', error);
41
+ console.log("getJob error", error);
40
42
  } finally {
41
43
  this.setState({
42
44
  loading: false
@@ -52,7 +54,32 @@ class RequestDetail extends Component {
52
54
  assignees: res.data.Users
53
55
  });
54
56
  } catch (error) {
55
- console.log('getAssignees error', error);
57
+ console.log("getAssignees error", error);
58
+ }
59
+ });
60
+ _defineProperty(this, "getExternalSync", async () => {
61
+ var _this$props$job;
62
+ // Only fetch if user has maintenance tracking permission
63
+ if (!this.hasPermission()) return;
64
+ if (!((_this$props$job = this.props.job) !== null && _this$props$job !== void 0 && _this$props$job.id)) return;
65
+ try {
66
+ this.setState({
67
+ loadingExternalSync: true
68
+ });
69
+ const res = await maintenanceActions.getExternalSync(this.props.job.id);
70
+ this.setState({
71
+ externalSync: res.data,
72
+ loadingExternalSync: false
73
+ });
74
+ } catch (error) {
75
+ var _error$response;
76
+ // 404 is expected if no sync - don't show error
77
+ if (((_error$response = error.response) === null || _error$response === void 0 ? void 0 : _error$response.status) !== 404) {
78
+ console.log("getExternalSync error", error);
79
+ }
80
+ this.setState({
81
+ loadingExternalSync: false
82
+ });
56
83
  }
57
84
  });
58
85
  _defineProperty(this, "markSeen", () => {
@@ -74,7 +101,7 @@ class RequestDetail extends Component {
74
101
  const updated = {
75
102
  id: job.id,
76
103
  seen: true,
77
- status: job.status || 'Unassigned'
104
+ status: job.status || "Unassigned"
78
105
  };
79
106
  const res = await maintenanceActions.editJob(updated, user.site);
80
107
  // console.log('markSeen updated');
@@ -85,7 +112,7 @@ class RequestDetail extends Component {
85
112
  seen: true
86
113
  });
87
114
  } catch (error) {
88
- console.log('markSeen error', error);
115
+ console.log("markSeen error", error);
89
116
  this.setState({
90
117
  loading: false
91
118
  });
@@ -113,7 +140,7 @@ class RequestDetail extends Component {
113
140
  this.props.jobAdded(res.data.job);
114
141
  this.getJob();
115
142
  } catch (error) {
116
- console.log('updateJob error', error);
143
+ console.log("updateJob error", error);
117
144
  } finally {
118
145
  this.setState({
119
146
  loading: false
@@ -130,7 +157,7 @@ class RequestDetail extends Component {
130
157
  this.props.jobAdded(res.data.job);
131
158
  this.getJob();
132
159
  } catch (error) {
133
- console.log('updateJobStatus error', error);
160
+ console.log("updateJobStatus error", error);
134
161
  } finally {
135
162
  this.setState({
136
163
  loading: false
@@ -147,7 +174,7 @@ class RequestDetail extends Component {
147
174
  this.props.jobAdded(res.data.job);
148
175
  this.getJob();
149
176
  } catch (error) {
150
- console.log('updateJobPriority error', error);
177
+ console.log("updateJobPriority error", error);
151
178
  } finally {
152
179
  this.setState({
153
180
  loading: false
@@ -204,7 +231,7 @@ class RequestDetail extends Component {
204
231
  });
205
232
  _defineProperty(this, "onOpenDatePicker", () => {
206
233
  this.setState({
207
- popUpType: 'date',
234
+ popUpType: "date",
208
235
  isDateTimePickerVisible: true
209
236
  });
210
237
  });
@@ -214,11 +241,11 @@ class RequestDetail extends Component {
214
241
  });
215
242
  });
216
243
  _defineProperty(this, "onDateSelected", date => {
217
- if (this.state.popUpType === 'date') {
244
+ if (this.state.popUpType === "date") {
218
245
  date = moment(date);
219
246
  this.setState({
220
247
  expectedDate: date,
221
- expectedDateText: date.format('DD/MM/YYYY'),
248
+ expectedDateText: date.format("DD/MM/YYYY"),
222
249
  isDateTimePickerVisible: false
223
250
  }, () => {
224
251
  this.updateJob();
@@ -252,7 +279,7 @@ class RequestDetail extends Component {
252
279
  this.props.jobAdded(job.data);
253
280
  this.getJob();
254
281
  } catch (error) {
255
- console.log('onCommentAdded error', error);
282
+ console.log("onCommentAdded error", error);
256
283
  } finally {
257
284
  this.setState({
258
285
  loading: false
@@ -276,7 +303,7 @@ class RequestDetail extends Component {
276
303
  return false;
277
304
  });
278
305
  _defineProperty(this, "toggleFullscreenVideo", url => {
279
- if (typeof url !== 'string') url = '';
306
+ if (typeof url !== "string") url = "";
280
307
  this.setState({
281
308
  showFullscreenVideo: url.length > 0,
282
309
  currentVideoUrl: url
@@ -289,10 +316,10 @@ class RequestDetail extends Component {
289
316
  name: a.displayName
290
317
  };
291
318
  });
292
- Services.navigation.navigate('optionSelector', {
319
+ Services.navigation.navigate("optionSelector", {
293
320
  options,
294
321
  selection: this.state.job.AssigneeId,
295
- title: 'Assign request',
322
+ title: "Assign request",
296
323
  onSelect: this.onSelectAssignee
297
324
  });
298
325
  });
@@ -301,12 +328,12 @@ class RequestDetail extends Component {
301
328
  loading: true
302
329
  }, async () => {
303
330
  try {
304
- console.log('onSelectAssignee', this.props.job.id, assignee.key);
331
+ console.log("onSelectAssignee", this.props.job.id, assignee.key);
305
332
  const res = await maintenanceActions.assignJob(this.props.job.id, assignee.key);
306
333
  this.props.jobAdded(res.data.job);
307
334
  this.getJob();
308
335
  } catch (error) {
309
- console.log('onSelectAssignee error', error);
336
+ console.log("onSelectAssignee error", error);
310
337
  } finally {
311
338
  this.setState({
312
339
  loading: false
@@ -317,23 +344,25 @@ class RequestDetail extends Component {
317
344
  this.state = {
318
345
  job: {},
319
346
  isDateTimePickerVisible: false,
320
- popUpType: '',
321
- status: '',
322
- priority: '',
347
+ popUpType: "",
348
+ status: "",
349
+ priority: "",
323
350
  expectedDate: null,
324
- expectedDateText: '',
351
+ expectedDateText: "",
325
352
  seen: false,
326
353
  showMore: true,
327
354
  showStatusPopup: false,
328
355
  showPriorityPopup: false,
329
356
  loading: false,
330
357
  showFullscreenVideo: false,
331
- currentVideoUrl: '',
358
+ currentVideoUrl: "",
332
359
  galleryOpen: false,
333
360
  galleryImages: [],
334
361
  showMessages: false,
335
362
  assignees: [],
336
- selectedPDF: null
363
+ selectedPDF: null,
364
+ externalSync: null,
365
+ loadingExternalSync: false
337
366
  };
338
367
  this.scrollView = /*#__PURE__*/React.createRef();
339
368
  this.commentReply = /*#__PURE__*/React.createRef();
@@ -345,6 +374,7 @@ class RequestDetail extends Component {
345
374
  this.getJob();
346
375
  this.updateJobState(this.props.job);
347
376
  this.getAssignees();
377
+ this.getExternalSync();
348
378
  }
349
379
  updateJobState(defaultJob) {
350
380
  const job = _.find(this.props.jobs, j => j.id === this.props.job.id) || defaultJob;
@@ -358,7 +388,7 @@ class RequestDetail extends Component {
358
388
  };
359
389
  if (job.expectedDate) {
360
390
  newState.expectedDate = moment(job.expectedDate);
361
- newState.expectedDateText = newState.expectedDate.format('DD/MM/YYYY');
391
+ newState.expectedDateText = newState.expectedDate.format("DD/MM/YYYY");
362
392
  }
363
393
  if (job.seen) newState.seen = job.seen;
364
394
  this.setState(newState, () => {
@@ -390,7 +420,7 @@ class RequestDetail extends Component {
390
420
  const statusOption = getJobStatus(status, this.props);
391
421
  const priority = getJobPriority(job.priority);
392
422
  const canEdit = this.hasPermission();
393
- const isStaff = this.props.user.category === 'staff';
423
+ const isStaff = this.props.user.category === "staff";
394
424
  const showSeen = !status || status === getJobStatus(null, this.props).text;
395
425
  return /*#__PURE__*/React.createElement(View, {
396
426
  style: {
@@ -435,7 +465,7 @@ class RequestDetail extends Component {
435
465
  style: styles.textSectionTextContainer
436
466
  }, /*#__PURE__*/React.createElement(Text, {
437
467
  style: styles.textSectionText
438
- }, moment(job.lastActivityUnix).format('ddd D MMMM, h:mm A'))))), /*#__PURE__*/React.createElement(View, {
468
+ }, moment(job.lastActivityUnix).format("ddd D MMMM, h:mm A"))))), /*#__PURE__*/React.createElement(View, {
439
469
  style: styles.jobInfoContainer
440
470
  }, /*#__PURE__*/React.createElement(View, {
441
471
  style: styles.jobStatusExpectedContainer
@@ -557,7 +587,7 @@ class RequestDetail extends Component {
557
587
  style: styles.documentTypeText
558
588
  }, document.ext)), /*#__PURE__*/React.createElement(Text, {
559
589
  style: styles.documentText
560
- }, `${document.name}${document.uploading ? ` - ${document.uploadProgress}` : ''}`));
590
+ }, `${document.name}${document.uploading ? ` - ${document.uploadProgress}` : ""}`));
561
591
  });
562
592
  }
563
593
  return null;
@@ -602,13 +632,56 @@ class RequestDetail extends Component {
602
632
  return /*#__PURE__*/React.createElement(Components.FormCardSectionOptionLauncher, {
603
633
  onPress: this.onOpenAssigneePicker,
604
634
  title: "Assigned To",
605
- value: job.Assignee ? job.Assignee.displayName : 'Unassigned',
635
+ value: job.Assignee ? job.Assignee.displayName : "Unassigned",
606
636
  textStyle: styles.detailsText,
607
637
  sectionStyle: styles.detailsSection
608
638
  }, content);
609
639
  }
610
640
  return content;
611
641
  }
642
+ renderExternalSync() {
643
+ const {
644
+ externalSync,
645
+ loadingExternalSync
646
+ } = this.state;
647
+
648
+ // Only show if user has permission and external sync data exists
649
+ if (!this.hasPermission()) return null;
650
+ if (!externalSync || loadingExternalSync) return null;
651
+ return /*#__PURE__*/React.createElement(View, {
652
+ style: [styles.externalSyncContainer, Helper.getShadowStyle()]
653
+ }, /*#__PURE__*/React.createElement(View, {
654
+ style: styles.externalSyncHeader
655
+ }, /*#__PURE__*/React.createElement(Text, {
656
+ style: styles.externalSyncTitle
657
+ }, "External Sync"), /*#__PURE__*/React.createElement(Icon, {
658
+ name: "sync",
659
+ type: "material",
660
+ iconStyle: [styles.externalSyncIcon, {
661
+ color: this.props.colourBrandingMain
662
+ }]
663
+ })), /*#__PURE__*/React.createElement(View, {
664
+ style: styles.externalSyncContent
665
+ }, externalSync.systemType && /*#__PURE__*/React.createElement(View, {
666
+ style: styles.externalSyncRow
667
+ }, /*#__PURE__*/React.createElement(Text, {
668
+ style: styles.externalSyncLabel
669
+ }, "System:"), /*#__PURE__*/React.createElement(Text, {
670
+ style: styles.externalSyncValue
671
+ }, externalSync.systemType)), externalSync.externalId && /*#__PURE__*/React.createElement(View, {
672
+ style: styles.externalSyncRow
673
+ }, /*#__PURE__*/React.createElement(Text, {
674
+ style: styles.externalSyncLabel
675
+ }, "External ID:"), /*#__PURE__*/React.createElement(Text, {
676
+ style: styles.externalSyncValue
677
+ }, externalSync.externalId)), externalSync.syncedAt && /*#__PURE__*/React.createElement(View, {
678
+ style: styles.externalSyncRow
679
+ }, /*#__PURE__*/React.createElement(Text, {
680
+ style: styles.externalSyncLabel
681
+ }, "Synced:"), /*#__PURE__*/React.createElement(Text, {
682
+ style: styles.externalSyncValue
683
+ }, moment(externalSync.syncedAt).format("D MMM YYYY h:mma")))));
684
+ }
612
685
  renderCustomFields() {
613
686
  const {
614
687
  job
@@ -618,27 +691,27 @@ class RequestDetail extends Component {
618
691
  } = job;
619
692
  const renderAnswer = field => {
620
693
  switch (field.type) {
621
- case 'date':
694
+ case "date":
622
695
  return /*#__PURE__*/React.createElement(Text, {
623
696
  style: styles.customText
624
- }, field.answer ? moment(field.answer, 'YYYY-MM-DD').format('DD MMM YYYY') : '');
625
- case 'time':
697
+ }, field.answer ? moment(field.answer, "YYYY-MM-DD").format("DD MMM YYYY") : "");
698
+ case "time":
626
699
  return /*#__PURE__*/React.createElement(Text, {
627
700
  style: styles.customText
628
- }, field.answer ? moment(field.answer, 'HH:mm').format('h:mm a') : '');
629
- case 'yn':
701
+ }, field.answer ? moment(field.answer, "HH:mm").format("h:mm a") : "");
702
+ case "yn":
630
703
  return /*#__PURE__*/React.createElement(Text, {
631
704
  style: styles.customText
632
- }, field.answer ? 'Yes' : 'No');
633
- case 'checkbox':
705
+ }, field.answer ? "Yes" : "No");
706
+ case "checkbox":
634
707
  return /*#__PURE__*/React.createElement(Text, {
635
708
  style: styles.customText
636
- }, field.answer && Array.isArray(field.answer) ? field.answer.join(', ') : '');
637
- case 'image':
709
+ }, field.answer && Array.isArray(field.answer) ? field.answer.join(", ") : "");
710
+ case "image":
638
711
  return /*#__PURE__*/React.createElement(View, {
639
712
  style: styles.customImage
640
713
  }, this.renderImage(field.answer));
641
- case 'document':
714
+ case "document":
642
715
  return /*#__PURE__*/React.createElement(View, {
643
716
  style: styles.customDocument
644
717
  }, this.renderDocument(field.answer));
@@ -649,8 +722,8 @@ class RequestDetail extends Component {
649
722
  }
650
723
  };
651
724
  return customFields.map((field, index) => {
652
- if (['staticTitle', 'staticText'].includes(field.type)) return null;
653
- if (_.isNil(field.answer) || field.answer === '' || Array.isArray(field.answer) && field.answer.length === 0) return null;
725
+ if (["staticTitle", "staticText"].includes(field.type)) return null;
726
+ if (_.isNil(field.answer) || field.answer === "" || Array.isArray(field.answer) && field.answer.length === 0) return null;
654
727
  return /*#__PURE__*/React.createElement(View, {
655
728
  key: index
656
729
  }, /*#__PURE__*/React.createElement(Text, {
@@ -669,7 +742,7 @@ class RequestDetail extends Component {
669
742
  return /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(Components.FormCardSectionOptionLauncher, {
670
743
  onPress: this.onToggleDetails,
671
744
  title: "Details",
672
- icon: this.state.showMore ? 'angle-up' : 'angle-down',
745
+ icon: this.state.showMore ? "angle-up" : "angle-down",
673
746
  textStyle: styles.detailsText,
674
747
  sectionStyle: styles.detailsSection
675
748
  }), this.state.showMore && /*#__PURE__*/React.createElement(View, null, hasCustomFields ? this.renderCustomFields() : null, !hasCustomFields ? /*#__PURE__*/React.createElement(React.Fragment, null, this.renderImage(job.images, job.image), !_.isEmpty(job.description) && /*#__PURE__*/React.createElement(Text, {
@@ -698,7 +771,7 @@ class RequestDetail extends Component {
698
771
  style: styles.nameText
699
772
  }, job.userName), !_.isEmpty(job.phone) && /*#__PURE__*/React.createElement(Text, {
700
773
  style: styles.phoneText
701
- }, job.phone)))));
774
+ }, job.phone))), this.renderExternalSync()));
702
775
  }
703
776
  renderMessages() {
704
777
  return /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(Components.CommentSection, {
@@ -712,7 +785,7 @@ class RequestDetail extends Component {
712
785
  site: this.state.job.site || this.state.job.location,
713
786
  live: true,
714
787
  refreshFrequency: 10000,
715
- placeHolder: '',
788
+ placeHolder: "",
716
789
  style: {
717
790
  flex: 1,
718
791
  paddingHorizontal: 0,
@@ -732,7 +805,7 @@ class RequestDetail extends Component {
732
805
  height: 36
733
806
  },
734
807
  textStyle: {
735
- color: '#fff'
808
+ color: "#fff"
736
809
  },
737
810
  fullWidth: true
738
811
  }, "Leave Message"));
@@ -770,7 +843,7 @@ class RequestDetail extends Component {
770
843
  return /*#__PURE__*/React.createElement(Components.Forbidden, null);
771
844
  }
772
845
  return /*#__PURE__*/React.createElement(KeyboardAvoidingView, {
773
- behavior: 'padding',
846
+ behavior: "padding",
774
847
  style: styles.container
775
848
  }, /*#__PURE__*/React.createElement(Components.Header, {
776
849
  leftIcon: "angle-left",
@@ -782,7 +855,7 @@ class RequestDetail extends Component {
782
855
  paddingBottom: 26
783
856
  },
784
857
  style: {
785
- height: '100%'
858
+ height: "100%"
786
859
  }
787
860
  }, /*#__PURE__*/React.createElement(View, {
788
861
  style: styles.innerContainer
@@ -798,7 +871,7 @@ class RequestDetail extends Component {
798
871
  const styles = StyleSheet.create({
799
872
  container: {
800
873
  flex: 1,
801
- backgroundColor: '#fff'
874
+ backgroundColor: "#fff"
802
875
  },
803
876
  innerContainer: {
804
877
  paddingTop: 23,
@@ -809,49 +882,49 @@ const styles = StyleSheet.create({
809
882
  paddingHorizontal: 12
810
883
  },
811
884
  jobIdText: {
812
- fontFamily: 'sf-medium',
885
+ fontFamily: "sf-medium",
813
886
  fontSize: 12,
814
887
  marginBottom: 4
815
888
  },
816
889
  jobTitleText: {
817
- fontFamily: 'sf-semibold',
890
+ fontFamily: "sf-semibold",
818
891
  fontSize: 20,
819
892
  color: Colours.TEXT_DARKEST,
820
893
  marginBottom: 8
821
894
  },
822
895
  jobTypeSeenContainer: {
823
- flexDirection: 'row',
824
- alignItems: 'center'
896
+ flexDirection: "row",
897
+ alignItems: "center"
825
898
  },
826
899
  jobTypeContainer: {
827
900
  padding: 4,
828
901
  minWidth: 80,
829
902
  maxWidth: 140,
830
903
  borderRadius: 4,
831
- justifyContent: 'center'
904
+ justifyContent: "center"
832
905
  },
833
906
  jobTypeText: {
834
- fontFamily: 'sf-semibold',
907
+ fontFamily: "sf-semibold",
835
908
  fontSize: 12,
836
- textAlign: 'center',
837
- maxWidth: '100%'
909
+ textAlign: "center",
910
+ maxWidth: "100%"
838
911
  },
839
912
  jobSeenContainer: {
840
- flexDirection: 'row',
841
- alignItems: 'center',
913
+ flexDirection: "row",
914
+ alignItems: "center",
842
915
  marginLeft: 10
843
916
  },
844
917
  jobSeenIcon: {
845
918
  fontSize: 12
846
919
  },
847
920
  jobSeenText: {
848
- fontFamily: 'sf-semibold',
921
+ fontFamily: "sf-semibold",
849
922
  fontSize: 12,
850
923
  marginLeft: 4
851
924
  },
852
925
  jobStatusDateText: {
853
926
  marginTop: 8,
854
- fontFamily: 'sf-medium',
927
+ fontFamily: "sf-medium",
855
928
  fontSize: 13,
856
929
  color: Colours.TEXT_LIGHT
857
930
  },
@@ -862,60 +935,60 @@ const styles = StyleSheet.create({
862
935
  paddingHorizontal: 12
863
936
  },
864
937
  jobStatusExpectedContainer: {
865
- flexDirection: 'row',
866
- alignItems: 'flex-start',
867
- justifyContent: 'space-between'
938
+ flexDirection: "row",
939
+ alignItems: "flex-start",
940
+ justifyContent: "space-between"
868
941
  },
869
942
  jobStatusOuterContainer: {
870
943
  // marginRight: 50,
871
944
  },
872
945
  jobStatusHeading: {
873
- fontFamily: 'sf-bold',
946
+ fontFamily: "sf-bold",
874
947
  fontSize: 11,
875
948
  letterSpacing: 0.8,
876
949
  color: Colours.TEXT_DARK,
877
950
  marginBottom: 6
878
951
  },
879
952
  jobStatusContainer: {
880
- flexDirection: 'row',
881
- alignItems: 'center',
953
+ flexDirection: "row",
954
+ alignItems: "center",
882
955
  width: 120,
883
956
  height: 30,
884
957
  paddingHorizontal: 8,
885
958
  borderRadius: 4
886
959
  },
887
960
  jobStatusIcon: {
888
- color: '#fff',
961
+ color: "#fff",
889
962
  fontSize: 14,
890
963
  marginRight: 8
891
964
  },
892
965
  jobStatusText: {
893
- color: '#fff',
894
- textAlign: 'center',
895
- fontFamily: 'sf-semibold',
966
+ color: "#fff",
967
+ textAlign: "center",
968
+ fontFamily: "sf-semibold",
896
969
  fontSize: 13,
897
970
  flex: 1,
898
- textAlign: 'center'
971
+ textAlign: "center"
899
972
  },
900
973
  jobPriorityOuterContainer: {
901
974
  marginTop: 12
902
975
  },
903
976
  jobExpectedDateContainer: {
904
977
  backgroundColor: Colours.BOXGREY,
905
- flexDirection: 'row',
978
+ flexDirection: "row",
906
979
  width: 115,
907
980
  height: 30,
908
981
  borderRadius: 4,
909
- alignItems: 'center',
982
+ alignItems: "center",
910
983
  paddingLeft: 8
911
984
  },
912
985
  jobExpectedDate: {
913
- fontFamily: 'sf-regular',
986
+ fontFamily: "sf-regular",
914
987
  fontSize: 13,
915
988
  color: Colours.hexToRGBAstring(Colours.TEXT_DARKEST, 0.5)
916
989
  },
917
990
  detailsText: {
918
- fontFamily: 'sf-semibold',
991
+ fontFamily: "sf-semibold",
919
992
  fontSize: 16,
920
993
  color: Colours.TEXT_DARKEST
921
994
  },
@@ -926,55 +999,55 @@ const styles = StyleSheet.create({
926
999
  },
927
1000
  sideBySideImages: {
928
1001
  flex: 1,
929
- flexDirection: 'row',
930
- justifyContent: 'space-between',
1002
+ flexDirection: "row",
1003
+ justifyContent: "space-between",
931
1004
  marginBottom: 16
932
1005
  },
933
1006
  sideBySideImageContainer: {
934
- backgroundColor: '#fff',
935
- width: '48%',
1007
+ backgroundColor: "#fff",
1008
+ width: "48%",
936
1009
  height: 150,
937
1010
  borderRadius: 2,
938
- overflow: 'hidden'
1011
+ overflow: "hidden"
939
1012
  },
940
1013
  singleImageContainer: {
941
- backgroundColor: '#fff',
942
- width: '100%',
1014
+ backgroundColor: "#fff",
1015
+ width: "100%",
943
1016
  height: 150,
944
1017
  flex: 1,
945
1018
  borderRadius: 2,
946
- overflow: 'hidden',
1019
+ overflow: "hidden",
947
1020
  marginBottom: 16
948
1021
  },
949
1022
  imageContainer: {
950
1023
  height: 150,
951
- width: 'auto',
952
- justifyContent: 'center'
1024
+ width: "auto",
1025
+ justifyContent: "center"
953
1026
  },
954
1027
  imagePlayContainer: {
955
- position: 'absolute',
1028
+ position: "absolute",
956
1029
  top: 0,
957
1030
  left: 0,
958
1031
  right: 0,
959
1032
  bottom: 0,
960
- alignItems: 'center',
961
- justifyContent: 'center'
1033
+ alignItems: "center",
1034
+ justifyContent: "center"
962
1035
  },
963
1036
  imageControlIcon: {
964
- color: '#fff',
1037
+ color: "#fff",
965
1038
  fontSize: 30,
966
- textShadowColor: 'rgba(0,0,0,0.3)',
1039
+ textShadowColor: "rgba(0,0,0,0.3)",
967
1040
  textShadowOffset: {
968
1041
  width: 2,
969
1042
  height: 2
970
1043
  }
971
1044
  },
972
1045
  plusImages: {
973
- fontFamily: 'sf-bold',
1046
+ fontFamily: "sf-bold",
974
1047
  fontSize: 32,
975
- textAlign: 'center',
976
- color: '#fff',
977
- textShadowColor: 'rgba(0, 0, 0, 0.5)',
1048
+ textAlign: "center",
1049
+ color: "#fff",
1050
+ textShadowColor: "rgba(0, 0, 0, 0.5)",
978
1051
  textShadowOffset: {
979
1052
  width: 0,
980
1053
  height: 2
@@ -982,64 +1055,64 @@ const styles = StyleSheet.create({
982
1055
  textShadowRadius: 8
983
1056
  },
984
1057
  jobDescriptionText: {
985
- fontFamily: 'sf-medium',
1058
+ fontFamily: "sf-medium",
986
1059
  fontSize: 14,
987
1060
  color: Colours.TEXT_LIGHT,
988
1061
  paddingBottom: 16
989
1062
  },
990
1063
  locationLabel: {
991
- fontFamily: 'sf-bold',
1064
+ fontFamily: "sf-bold",
992
1065
  fontSize: 14,
993
1066
  color: Colours.TEXT_DARKEST
994
1067
  },
995
1068
  locationText: {
996
- fontFamily: 'sf-regular',
1069
+ fontFamily: "sf-regular",
997
1070
  fontSize: 16,
998
1071
  color: Colours.TEXT_DARKEST,
999
1072
  paddingVertical: 8
1000
1073
  },
1001
1074
  requesterLabel: {
1002
- fontFamily: 'sf-bold',
1075
+ fontFamily: "sf-bold",
1003
1076
  fontSize: 14,
1004
1077
  color: Colours.TEXT_DARKEST,
1005
1078
  paddingVertical: 10
1006
1079
  },
1007
1080
  profileContainer: {
1008
- flexDirection: 'row',
1009
- alignItems: 'center'
1081
+ flexDirection: "row",
1082
+ alignItems: "center"
1010
1083
  },
1011
1084
  nameContainer: {
1012
1085
  marginLeft: 18
1013
1086
  },
1014
1087
  nameText: {
1015
- fontSize: 'sf-semibold',
1088
+ fontSize: "sf-semibold",
1016
1089
  fontSize: 14,
1017
1090
  color: Colours.TEXT_DARKEST,
1018
1091
  marginBottom: 4
1019
1092
  },
1020
1093
  phoneText: {
1021
- fontSize: 'sf-medium',
1094
+ fontSize: "sf-medium",
1022
1095
  fontSize: 14,
1023
1096
  color: Colours.TEXT_LIGHT
1024
1097
  },
1025
1098
  textSectionInner: {
1026
- flexDirection: 'row',
1027
- justifyContent: 'space-between',
1028
- alignItems: 'center',
1099
+ flexDirection: "row",
1100
+ justifyContent: "space-between",
1101
+ alignItems: "center",
1029
1102
  marginTop: 8
1030
1103
  },
1031
1104
  textSectionLabel: {
1032
- fontFamily: 'sf-semibold',
1105
+ fontFamily: "sf-semibold",
1033
1106
  fontSize: 12,
1034
1107
  lineHeight: 24,
1035
1108
  color: Colours.TEXT_DARKEST
1036
1109
  },
1037
1110
  textSectionTextContainer: {
1038
- flexDirection: 'row',
1039
- alignItems: 'center'
1111
+ flexDirection: "row",
1112
+ alignItems: "center"
1040
1113
  },
1041
1114
  textSectionText: {
1042
- fontFamily: 'sf-regular',
1115
+ fontFamily: "sf-regular",
1043
1116
  fontSize: 13,
1044
1117
  lineHeight: 24,
1045
1118
  color: Colours.TEXT_LIGHT
@@ -1050,12 +1123,12 @@ const styles = StyleSheet.create({
1050
1123
  lineHeight: 24
1051
1124
  },
1052
1125
  customLabel: {
1053
- fontFamily: 'sf-bold',
1126
+ fontFamily: "sf-bold",
1054
1127
  fontSize: 14,
1055
1128
  color: Colours.TEXT_DARKEST
1056
1129
  },
1057
1130
  customText: {
1058
- fontFamily: 'sf-regular',
1131
+ fontFamily: "sf-regular",
1059
1132
  fontSize: 16,
1060
1133
  color: Colours.TEXT_DARKEST,
1061
1134
  paddingVertical: 8
@@ -1069,41 +1142,83 @@ const styles = StyleSheet.create({
1069
1142
  },
1070
1143
  customStaticTitle: {
1071
1144
  fontSize: 20,
1072
- fontFamily: 'sf-semibold',
1145
+ fontFamily: "sf-semibold",
1073
1146
  color: Colours.TEXT_DARKEST,
1074
1147
  marginBottom: 10
1075
1148
  },
1076
1149
  customStaticText: {
1077
1150
  fontSize: 17,
1078
- fontFamily: 'sf-regular',
1151
+ fontFamily: "sf-regular",
1079
1152
  color: Colours.TEXT_DARKEST,
1080
1153
  lineHeight: 24,
1081
1154
  marginBottom: 10
1082
1155
  },
1083
1156
  documentContainer: {
1084
- flexDirection: 'row',
1085
- alignItems: 'center',
1086
- justifyContent: 'space-between',
1157
+ flexDirection: "row",
1158
+ alignItems: "center",
1159
+ justifyContent: "space-between",
1087
1160
  paddingVertical: 4
1088
1161
  },
1089
1162
  documentTypeContainer: {
1090
1163
  width: 50,
1091
1164
  height: 60,
1092
- justifyContent: 'center',
1093
- alignItems: 'center',
1165
+ justifyContent: "center",
1166
+ alignItems: "center",
1094
1167
  borderRadius: 5,
1095
1168
  marginRight: 8
1096
1169
  },
1097
1170
  documentTypeText: {
1098
- color: '#fff',
1099
- fontFamily: 'sf-semibold',
1100
- textAlign: 'center'
1171
+ color: "#fff",
1172
+ fontFamily: "sf-semibold",
1173
+ textAlign: "center"
1101
1174
  },
1102
1175
  documentText: {
1103
1176
  flex: 1,
1104
- fontFamily: 'sf-semibold',
1177
+ fontFamily: "sf-semibold",
1178
+ fontSize: 16,
1179
+ color: "#65686D"
1180
+ },
1181
+ externalSyncContainer: {
1182
+ backgroundColor: "#fff",
1183
+ marginTop: 16,
1184
+ borderRadius: 8,
1185
+ padding: 16
1186
+ },
1187
+ externalSyncHeader: {
1188
+ flexDirection: "row",
1189
+ justifyContent: "space-between",
1190
+ alignItems: "center",
1191
+ marginBottom: 12,
1192
+ paddingBottom: 12,
1193
+ borderBottomWidth: 1,
1194
+ borderBottomColor: Colours.LINEGREY
1195
+ },
1196
+ externalSyncTitle: {
1197
+ fontFamily: "sf-semibold",
1105
1198
  fontSize: 16,
1106
- color: '#65686D'
1199
+ color: Colours.TEXT_DARKEST
1200
+ },
1201
+ externalSyncIcon: {
1202
+ fontSize: 20
1203
+ },
1204
+ externalSyncContent: {
1205
+ paddingTop: 4
1206
+ },
1207
+ externalSyncRow: {
1208
+ flexDirection: "row",
1209
+ marginBottom: 10
1210
+ },
1211
+ externalSyncLabel: {
1212
+ fontFamily: "sf-semibold",
1213
+ fontSize: 14,
1214
+ color: Colours.TEXT_DARK,
1215
+ width: 100
1216
+ },
1217
+ externalSyncValue: {
1218
+ fontFamily: "sf-regular",
1219
+ fontSize: 14,
1220
+ color: Colours.TEXT_DARKEST,
1221
+ flex: 1
1107
1222
  }
1108
1223
  });
1109
1224
  const mapStateToProps = state => {