@plusscommunities/pluss-maintenance-app 3.0.2 → 4.0.0

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 (39) hide show
  1. package/dist/module/actions/JobActions.js.map +1 -1
  2. package/dist/module/actions/index.js.map +1 -1
  3. package/dist/module/actions/types.js.map +1 -1
  4. package/dist/module/apis/generalActions.js +2 -8
  5. package/dist/module/apis/generalActions.js.map +1 -1
  6. package/dist/module/apis/index.js.map +1 -1
  7. package/dist/module/components/FilterPopupMenu.js +5 -19
  8. package/dist/module/components/FilterPopupMenu.js.map +1 -1
  9. package/dist/module/components/MaintenanceList.js +13 -49
  10. package/dist/module/components/MaintenanceList.js.map +1 -1
  11. package/dist/module/components/MaintenanceListItem.js +7 -21
  12. package/dist/module/components/MaintenanceListItem.js.map +1 -1
  13. package/dist/module/components/MaintenanceWidgetItem.js +3 -12
  14. package/dist/module/components/MaintenanceWidgetItem.js.map +1 -1
  15. package/dist/module/components/StatusSelectorPopup.js +0 -5
  16. package/dist/module/components/StatusSelectorPopup.js.map +1 -1
  17. package/dist/module/components/WidgetLarge.js +0 -3
  18. package/dist/module/components/WidgetLarge.js.map +1 -1
  19. package/dist/module/components/WidgetSmall.js +5 -22
  20. package/dist/module/components/WidgetSmall.js.map +1 -1
  21. package/dist/module/core.config.js.map +1 -1
  22. package/dist/module/feature.config.js +2 -3
  23. package/dist/module/feature.config.js.map +1 -1
  24. package/dist/module/helper.js +0 -3
  25. package/dist/module/helper.js.map +1 -1
  26. package/dist/module/index.js.map +1 -1
  27. package/dist/module/reducers/JobsReducer.js +6 -14
  28. package/dist/module/reducers/JobsReducer.js.map +1 -1
  29. package/dist/module/screens/JobTypePicker.js +5 -14
  30. package/dist/module/screens/JobTypePicker.js.map +1 -1
  31. package/dist/module/screens/MaintenancePage.js +3 -14
  32. package/dist/module/screens/MaintenancePage.js.map +1 -1
  33. package/dist/module/screens/RequestDetail.js +15 -59
  34. package/dist/module/screens/RequestDetail.js.map +1 -1
  35. package/dist/module/screens/RequestNotes.js +7 -40
  36. package/dist/module/screens/RequestNotes.js.map +1 -1
  37. package/dist/module/screens/ServiceRequest.js +7 -59
  38. package/dist/module/screens/ServiceRequest.js.map +1 -1
  39. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"names":["React","Component","View","StyleSheet","connect","_","MaintenanceList","Services","BaseComponents","Components","Helper","Styles","Config","MaintenancePage","constructor","props","navigation","goBack","loading","setState","state","isHomeTab","componentDidMount","getParentRoute","renderHeader","title","env","strings","MAINTENANCE","includes","user","hidden","styles","notificationContainer","colourBrandingHeader","notificationBell","onPressBack","render","container","maintenanceList","onLoadingChanged","options","create","flex","position","top","bottom","right","paddingTop","StatusBarHeight","marginTop","mapStateToProps"],"sources":["MaintenancePage.js"],"sourcesContent":["import React, { Component } from 'react';\nimport { View, StyleSheet } from 'react-native';\nimport { connect } from 'react-redux';\nimport _ from 'lodash';\nimport MaintenanceList from '../components/MaintenanceList';\nimport { Services, BaseComponents } from '../feature.config';\nimport { Components, Helper, Styles, Config } from '../core.config';\n\nclass MaintenancePage extends Component {\n constructor(props) {\n super(props);\n this.state = {\n isHomeTab: false,\n loading: false,\n };\n }\n\n componentDidMount() {\n // console.log('!Services.navigation.getParentRoute()', !Services.navigation.getParentRoute());\n this.setState({ isHomeTab: !Services.navigation.getParentRoute() });\n }\n\n onPressBack = () => {\n Services.navigation.goBack();\n };\n\n onLoadingChanged = loading => {\n this.setState({ loading });\n };\n\n renderHeader() {\n if (this.state.isHomeTab) {\n return (\n <Components.Header\n text={this.props.title || Config.env.strings.MAINTENANCE}\n rightContent={\n _.includes(this.props.user.hidden, 'notifications') ? null : (\n <View style={styles.notificationContainer}>\n <BaseComponents.NotificationBell\n colourBrandingHeader={this.props.colourBrandingHeader}\n containerStyle={Styles.notificationBell}\n />\n </View>\n )\n }\n />\n );\n }\n return (\n <Components.Header leftIcon=\"angle-left\" onPressLeft={this.onPressBack} text={this.props.title || Config.env.strings.MAINTENANCE} />\n );\n }\n\n render() {\n const { isHomeTab } = this.state;\n\n return (\n <View style={styles.container}>\n {this.renderHeader()}\n <Components.LoadingIndicator visible={this.state.loading} />\n <MaintenanceList\n style={styles.maintenanceList}\n onLoadingChanged={this.onLoadingChanged}\n enableAdd={!isHomeTab}\n options={this.props.options}\n />\n {/* {isHomeTab && <Components.AddContentButton />} */}\n </View>\n );\n }\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n notificationContainer: {\n position: 'absolute',\n top: 0,\n bottom: 0,\n right: 0,\n paddingTop: Helper.StatusBarHeight(0),\n },\n maintenanceList: {\n marginTop: 12,\n },\n});\n\nconst mapStateToProps = state => {\n return {\n user: state.user,\n };\n};\n\nexport default connect(mapStateToProps, {})(MaintenancePage);\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAgBC,SAAhB,QAAiC,OAAjC;AACA,SAASC,IAAT,EAAeC,UAAf,QAAiC,cAAjC;AACA,SAASC,OAAT,QAAwB,aAAxB;AACA,OAAOC,CAAP,MAAc,QAAd;AACA,OAAOC,eAAP,MAA4B,+BAA5B;AACA,SAASC,QAAT,EAAmBC,cAAnB,QAAyC,mBAAzC;AACA,SAASC,UAAT,EAAqBC,MAArB,EAA6BC,MAA7B,EAAqCC,MAArC,QAAmD,gBAAnD;;AAEA,MAAMC,eAAN,SAA8BZ,SAA9B,CAAwC;EACtCa,WAAW,CAACC,KAAD,EAAQ;IACjB,MAAMA,KAAN;;IADiB,qCAaL,MAAM;MAClBR,QAAQ,CAACS,UAAT,CAAoBC,MAApB;IACD,CAfkB;;IAAA,0CAiBAC,OAAO,IAAI;MAC5B,KAAKC,QAAL,CAAc;QAAED;MAAF,CAAd;IACD,CAnBkB;;IAEjB,KAAKE,KAAL,GAAa;MACXC,SAAS,EAAE,KADA;MAEXH,OAAO,EAAE;IAFE,CAAb;EAID;;EAEDI,iBAAiB,GAAG;IAClB;IACA,KAAKH,QAAL,CAAc;MAAEE,SAAS,EAAE,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ExC,MAAMT,MAAM,GAAG7B,UAAU,CAACuC,MAAX,CAAkB;EAC/BJ,SAAS,EAAE;IACTK,IAAI,EAAE;EADG,CADoB;EAI/BV,qBAAqB,EAAE;IACrBW,QAAQ,EAAE,UADW;IAErBC,GAAG,EAAE,CAFgB;IAGrBC,MAAM,EAAE,CAHa;IAIrBC,KAAK,EAAE,CAJc;IAKrBC,UAAU,EAAEtC,MAAM,CAACuC,eAAP,CAAuB,CAAvB;EALS,CAJQ;EAW/BV,eAAe,EAAE;IACfW,SAAS,EAAE;EADI;AAXc,CAAlB,CAAf;;AAgBA,MAAMC,eAAe,GAAG/B,KAAK,IAAI;EAC/B,OAAO;IACLU,IAAI,EAAEV,KAAK,CAACU;EADP,CAAP;AAGD,CAJD;;AAMA,eAAe1B,OAAO,CAAC+C,eAAD,EAAkB,EAAlB,CAAP,CAA6BtC,eAA7B,CAAf"}
1
+ {"version":3,"names":["React","Component","View","StyleSheet","connect","_","MaintenanceList","Services","BaseComponents","Components","Helper","Styles","Config","MaintenancePage","constructor","props","_defineProperty","navigation","goBack","loading","setState","state","isHomeTab","componentDidMount","getParentRoute","renderHeader","createElement","Header","text","title","env","strings","MAINTENANCE","rightContent","includes","user","hidden","style","styles","notificationContainer","NotificationBell","colourBrandingHeader","containerStyle","notificationBell","leftIcon","onPressLeft","onPressBack","render","container","LoadingIndicator","visible","maintenanceList","onLoadingChanged","enableAdd","options","create","flex","position","top","bottom","right","paddingTop","StatusBarHeight","marginTop","mapStateToProps"],"sources":["MaintenancePage.js"],"sourcesContent":["import React, { Component } from 'react';\nimport { View, StyleSheet } from 'react-native';\nimport { connect } from 'react-redux';\nimport _ from 'lodash';\nimport MaintenanceList from '../components/MaintenanceList';\nimport { Services, BaseComponents } from '../feature.config';\nimport { Components, Helper, Styles, Config } from '../core.config';\n\nclass MaintenancePage extends Component {\n constructor(props) {\n super(props);\n this.state = {\n isHomeTab: false,\n loading: false,\n };\n }\n\n componentDidMount() {\n // console.log('!Services.navigation.getParentRoute()', !Services.navigation.getParentRoute());\n this.setState({ isHomeTab: !Services.navigation.getParentRoute() });\n }\n\n onPressBack = () => {\n Services.navigation.goBack();\n };\n\n onLoadingChanged = loading => {\n this.setState({ loading });\n };\n\n renderHeader() {\n if (this.state.isHomeTab) {\n return (\n <Components.Header\n text={this.props.title || Config.env.strings.MAINTENANCE}\n rightContent={\n _.includes(this.props.user.hidden, 'notifications') ? null : (\n <View style={styles.notificationContainer}>\n <BaseComponents.NotificationBell\n colourBrandingHeader={this.props.colourBrandingHeader}\n containerStyle={Styles.notificationBell}\n />\n </View>\n )\n }\n />\n );\n }\n return (\n <Components.Header leftIcon=\"angle-left\" onPressLeft={this.onPressBack} text={this.props.title || Config.env.strings.MAINTENANCE} />\n );\n }\n\n render() {\n const { isHomeTab } = this.state;\n\n return (\n <View style={styles.container}>\n {this.renderHeader()}\n <Components.LoadingIndicator visible={this.state.loading} />\n <MaintenanceList\n style={styles.maintenanceList}\n onLoadingChanged={this.onLoadingChanged}\n enableAdd={!isHomeTab}\n options={this.props.options}\n />\n {/* {isHomeTab && <Components.AddContentButton />} */}\n </View>\n );\n }\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n notificationContainer: {\n position: 'absolute',\n top: 0,\n bottom: 0,\n right: 0,\n paddingTop: Helper.StatusBarHeight(0),\n },\n maintenanceList: {\n marginTop: 12,\n },\n});\n\nconst mapStateToProps = state => {\n return {\n user: state.user,\n };\n};\n\nexport default connect(mapStateToProps, {})(MaintenancePage);\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AAC/C,SAASC,OAAO,QAAQ,aAAa;AACrC,OAAOC,CAAC,MAAM,QAAQ;AACtB,OAAOC,eAAe,MAAM,+BAA+B;AAC3D,SAASC,QAAQ,EAAEC,cAAc,QAAQ,mBAAmB;AAC5D,SAASC,UAAU,EAAEC,MAAM,EAAEC,MAAM,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ACH,CAAC;AAED,eAAe/B,OAAO,CAAC4D,eAAe,EAAE,CAAC,CAAC,CAAC,CAACnD,eAAe,CAAC"}
@@ -1,5 +1,6 @@
1
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
-
1
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
3
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
3
4
  import React, { Component } from 'react';
4
5
  import { ScrollView, View, StyleSheet, Text, KeyboardAvoidingView, TouchableOpacity, ImageBackground } from 'react-native';
5
6
  import DateTimePicker from 'react-native-modal-datetime-picker';
@@ -13,20 +14,18 @@ import StatusSelectorPopup from '../components/StatusSelectorPopup';
13
14
  import { jobStatusOptions, getJobStatusProps } from '../helper';
14
15
  import { Services } from '../feature.config';
15
16
  import { Colours, Helper, Components, Config } from '../core.config';
16
-
17
17
  class RequestDetail extends Component {
18
18
  constructor(props) {
19
19
  super(props);
20
-
21
20
  _defineProperty(this, "markSeen", () => {
22
21
  const {
23
22
  user
24
23
  } = this.props;
25
24
  const {
26
25
  job
27
- } = this.state; // Must have maintenance permission and not the requester
26
+ } = this.state;
27
+ // Must have maintenance permission and not the requester
28
28
  // console.log('markSeen check', job.userID, user.Id);
29
-
30
29
  if (job.seen === true) return;
31
30
  if (!this.hasPermission()) return;
32
31
  if (user.Id === job.userID) return;
@@ -39,8 +38,8 @@ class RequestDetail extends Component {
39
38
  seen: true,
40
39
  status: job.status || 'Unassigned'
41
40
  };
42
- const res = await generalActions.editJob(updated, user.site); // console.log('markSeen updated');
43
-
41
+ const res = await generalActions.editJob(updated, user.site);
42
+ // console.log('markSeen updated');
44
43
  this.props.jobAdded(res.data.job);
45
44
  this.setState({
46
45
  loading: false,
@@ -54,7 +53,6 @@ class RequestDetail extends Component {
54
53
  }
55
54
  });
56
55
  });
57
-
58
56
  _defineProperty(this, "updateJob", () => {
59
57
  this.setState({
60
58
  loading: true
@@ -65,16 +63,13 @@ class RequestDetail extends Component {
65
63
  const {
66
64
  job
67
65
  } = this.state;
68
-
69
66
  try {
70
67
  const updated = {
71
68
  id: job.id
72
69
  };
73
-
74
70
  if (this.state.expectedDate) {
75
71
  updated.expectedDate = moment(this.state.expectedDate).utc().toISOString();
76
72
  }
77
-
78
73
  const res = await generalActions.editJob(updated, user.site);
79
74
  this.props.jobAdded(res.data.job);
80
75
  } catch (error) {
@@ -86,7 +81,6 @@ class RequestDetail extends Component {
86
81
  }
87
82
  });
88
83
  });
89
-
90
84
  _defineProperty(this, "updateJobStatus", () => {
91
85
  this.setState({
92
86
  loading: true
@@ -103,23 +97,19 @@ class RequestDetail extends Component {
103
97
  }
104
98
  });
105
99
  });
106
-
107
100
  _defineProperty(this, "onPressBack", () => {
108
101
  Services.navigation.goBack();
109
102
  });
110
-
111
103
  _defineProperty(this, "onOpenStatusPicker", () => {
112
104
  this.setState({
113
105
  showStatusPopup: true
114
106
  });
115
107
  });
116
-
117
108
  _defineProperty(this, "onCloseStatusPopup", () => {
118
109
  this.setState({
119
110
  showStatusPopup: false
120
111
  });
121
112
  });
122
-
123
113
  _defineProperty(this, "onSelectStatus", status => {
124
114
  this.setState({
125
115
  status,
@@ -128,26 +118,22 @@ class RequestDetail extends Component {
128
118
  this.updateJobStatus();
129
119
  });
130
120
  });
131
-
132
121
  _defineProperty(this, "openStaffNotes", () => {
133
122
  Services.navigation.navigate('requestNotes', {
134
123
  job: this.state.job
135
124
  });
136
125
  });
137
-
138
126
  _defineProperty(this, "onOpenDatePicker", () => {
139
127
  this.setState({
140
128
  popUpType: 'date',
141
129
  isDateTimePickerVisible: true
142
130
  });
143
131
  });
144
-
145
132
  _defineProperty(this, "onCloseDatePicker", () => {
146
133
  this.setState({
147
134
  isDateTimePickerVisible: false
148
135
  });
149
136
  });
150
-
151
137
  _defineProperty(this, "onDateSelected", date => {
152
138
  if (this.state.popUpType === 'date') {
153
139
  date = moment(date);
@@ -160,19 +146,16 @@ class RequestDetail extends Component {
160
146
  });
161
147
  }
162
148
  });
163
-
164
149
  _defineProperty(this, "onToggleDetails", () => {
165
150
  this.setState({
166
151
  showMore: !this.state.showMore
167
152
  });
168
153
  });
169
-
170
154
  _defineProperty(this, "onLeaveMessage", () => {
171
155
  this.setState({
172
156
  showMessages: true
173
157
  });
174
158
  });
175
-
176
159
  _defineProperty(this, "onCommentsLoaded", count => {
177
160
  if (count > 0) {
178
161
  this.setState({
@@ -180,14 +163,13 @@ class RequestDetail extends Component {
180
163
  });
181
164
  }
182
165
  });
183
-
184
166
  _defineProperty(this, "onCommentAdded", () => {
185
167
  this.setState({
186
168
  loading: true
187
169
  }, async () => {
188
170
  try {
189
- const job = await generalActions.getJob(this.props.user.site, this.props.job.id); // console.log('onCommentAdded', job?.data);
190
-
171
+ const job = await generalActions.getJob(this.props.user.site, this.props.job.id);
172
+ // console.log('onCommentAdded', job?.data);
191
173
  this.props.jobAdded(job.data);
192
174
  } catch (error) {
193
175
  console.log('onCommentAdded error', error);
@@ -198,14 +180,12 @@ class RequestDetail extends Component {
198
180
  }
199
181
  });
200
182
  });
201
-
202
183
  _defineProperty(this, "hasPermission", () => {
203
184
  const {
204
185
  permissions
205
186
  } = this.props.user;
206
187
  return _.includes(permissions, 'maintenanceTracking');
207
188
  });
208
-
209
189
  _defineProperty(this, "toggleFullscreenVideo", url => {
210
190
  if (typeof url !== 'string') url = '';
211
191
  this.setState({
@@ -213,7 +193,6 @@ class RequestDetail extends Component {
213
193
  currentVideoUrl: url
214
194
  });
215
195
  });
216
-
217
196
  this.state = {
218
197
  job: {},
219
198
  isDateTimePickerVisible: false,
@@ -234,54 +213,45 @@ class RequestDetail extends Component {
234
213
  this.commentReply = /*#__PURE__*/React.createRef();
235
214
  this.commentSection = /*#__PURE__*/React.createRef();
236
215
  }
237
-
238
216
  componentDidMount() {
239
217
  this.updateJobState();
240
218
  }
241
-
242
219
  componentDidUpdate(prevProps) {
243
220
  if (prevProps.jobs !== this.props.jobs) {
244
221
  this.updateJobState();
245
222
  }
246
223
  }
247
-
248
224
  updateJobState() {
249
225
  const job = _.find(this.props.jobs, j => j.id === this.props.job.id) || this.props.job;
250
226
  const newState = {
251
227
  job,
252
228
  status: job.status
253
229
  };
254
-
255
230
  if (job.expectedDate) {
256
231
  newState.expectedDate = moment(job.expectedDate);
257
232
  newState.expectedDateText = newState.expectedDate.format('DD/MM/YYYY');
258
233
  }
259
-
260
234
  if (job.seen) newState.seen = job.seen;
261
235
  this.setState(newState, () => {
262
236
  this.markSeen();
263
237
  });
264
238
  }
265
-
266
239
  openGallery(index) {
267
240
  this.setState({
268
241
  galleryOpen: true
269
242
  });
270
243
  this.refs.imagePopup.scrollTo(index);
271
244
  }
272
-
273
245
  closeGallery() {
274
246
  this.setState({
275
247
  galleryOpen: false
276
248
  });
277
249
  }
278
-
279
250
  renderLoading() {
280
251
  return /*#__PURE__*/React.createElement(Components.LoadingIndicator, {
281
252
  visible: this.state.loading
282
253
  });
283
254
  }
284
-
285
255
  renderTop() {
286
256
  const {
287
257
  status,
@@ -294,7 +264,8 @@ class RequestDetail extends Component {
294
264
  const canEdit = this.hasPermission();
295
265
  const showSeen = !status || status === jobStatusOptions[0].name;
296
266
  return /*#__PURE__*/React.createElement(View, {
297
- style: { ...Helper.getShadowStyle()
267
+ style: {
268
+ ...Helper.getShadowStyle()
298
269
  }
299
270
  }, /*#__PURE__*/React.createElement(View, {
300
271
  style: styles.jobTitleContainer
@@ -382,10 +353,8 @@ class RequestDetail extends Component {
382
353
  style: styles.jobStatusText
383
354
  }, "Notes (", (job.Notes || []).length, ")"))))));
384
355
  }
385
-
386
356
  renderPlayableImageUrl(url, index, containerStyle, showMore) {
387
357
  const thumbUrl = Helper.getThumb300(url);
388
-
389
358
  if (Helper.isVideo(url)) {
390
359
  return /*#__PURE__*/React.createElement(ImageBackground, {
391
360
  style: [{
@@ -404,7 +373,6 @@ class RequestDetail extends Component {
404
373
  iconStyle: styles.imageControlIcon
405
374
  }))));
406
375
  }
407
-
408
376
  const imageUrl = Helper.get1400(url);
409
377
  return /*#__PURE__*/React.createElement(TouchableOpacity, {
410
378
  style: containerStyle,
@@ -418,17 +386,14 @@ class RequestDetail extends Component {
418
386
  style: styles.plusImages
419
387
  }, "+", this.state.job.images.length - 2)));
420
388
  }
421
-
422
389
  renderPlayableImage(index, containerStyle, showMore) {
423
390
  const url = this.state.job.images[index];
424
391
  return this.renderPlayableImageUrl(url, index, containerStyle, showMore);
425
392
  }
426
-
427
393
  renderImage() {
428
394
  const {
429
395
  job
430
396
  } = this.state;
431
-
432
397
  if (!_.isNil(job.images) && !_.isEmpty(job.images)) {
433
398
  if (job.images.length >= 2) {
434
399
  return /*#__PURE__*/React.createElement(View, {
@@ -444,10 +409,8 @@ class RequestDetail extends Component {
444
409
  style: styles.singleImageContainer
445
410
  }, this.renderPlayableImageUrl(job.image));
446
411
  }
447
-
448
412
  return null;
449
413
  }
450
-
451
414
  renderImagePopup() {
452
415
  return /*#__PURE__*/React.createElement(Components.ImagePopup, {
453
416
  visible: this.state.galleryOpen,
@@ -456,7 +419,6 @@ class RequestDetail extends Component {
456
419
  ref: "imagePopup"
457
420
  });
458
421
  }
459
-
460
422
  rendeDetails() {
461
423
  const {
462
424
  job
@@ -489,7 +451,6 @@ class RequestDetail extends Component {
489
451
  style: styles.phoneText
490
452
  }, job.phone)))));
491
453
  }
492
-
493
454
  renderMessages() {
494
455
  return /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(Components.CommentSection, {
495
456
  ref: this.commentSection,
@@ -527,7 +488,6 @@ class RequestDetail extends Component {
527
488
  fullWidth: true
528
489
  }, "Leave Message"));
529
490
  }
530
-
531
491
  renderMessagesReply() {
532
492
  if (!this.state.showMessages) return null;
533
493
  return /*#__PURE__*/React.createElement(Components.CommentReply, {
@@ -537,9 +497,9 @@ class RequestDetail extends Component {
537
497
  entityType: "maintenancerequest",
538
498
  entityId: this.props.job.id,
539
499
  entityName: this.props.job.title,
540
- site: this.state.job.site || this.state.job.location // noScroll={true}
500
+ site: this.state.job.site || this.state.job.location
501
+ // noScroll={true}
541
502
  // style={{ position: 'absolute', bottom: 0, left: 0, right: 0 }}
542
-
543
503
  });
544
504
  }
545
505
 
@@ -550,7 +510,6 @@ class RequestDetail extends Component {
550
510
  onSelect: this.onSelectStatus
551
511
  });
552
512
  }
553
-
554
513
  render() {
555
514
  return /*#__PURE__*/React.createElement(KeyboardAvoidingView, {
556
515
  behavior: Platform.OS === 'ios' && 'padding',
@@ -577,9 +536,7 @@ class RequestDetail extends Component {
577
536
  headerTextIOS: `Pick a ${this.state.popUpType}`
578
537
  }));
579
538
  }
580
-
581
539
  }
582
-
583
540
  const styles = StyleSheet.create({
584
541
  container: {
585
542
  flex: 1,
@@ -642,7 +599,8 @@ const styles = StyleSheet.create({
642
599
  paddingVertical: 14,
643
600
  paddingHorizontal: 12
644
601
  },
645
- jobStatusOuterContainer: {// marginRight: 50,
602
+ jobStatusOuterContainer: {
603
+ // marginRight: 50,
646
604
  },
647
605
  jobStatusHeading: {
648
606
  fontFamily: 'sf-bold',
@@ -822,7 +780,6 @@ const styles = StyleSheet.create({
822
780
  lineHeight: 24
823
781
  }
824
782
  });
825
-
826
783
  const mapStateToProps = state => {
827
784
  return {
828
785
  user: state.user,
@@ -830,7 +787,6 @@ const mapStateToProps = state => {
830
787
  jobs: state.jobs.jobs
831
788
  };
832
789
  };
833
-
834
790
  export default connect(mapStateToProps, {
835
791
  jobAdded
836
792
  })(RequestDetail);