@plusscommunities/pluss-maintenance-app-forms 6.0.12-beta.0 → 7.0.0-beta.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 (64) hide show
  1. package/dist/module/actions/JobActions.js +1 -44
  2. package/dist/module/actions/JobActions.js.map +1 -1
  3. package/dist/module/actions/types.js +0 -3
  4. package/dist/module/actions/types.js.map +1 -1
  5. package/dist/module/apis/index.js +0 -2
  6. package/dist/module/apis/index.js.map +1 -1
  7. package/dist/module/apis/maintenanceActions.js +6 -21
  8. package/dist/module/apis/maintenanceActions.js.map +1 -1
  9. package/dist/module/components/FilterPopupMenu.js +18 -34
  10. package/dist/module/components/FilterPopupMenu.js.map +1 -1
  11. package/dist/module/components/MaintenanceList.js +56 -47
  12. package/dist/module/components/MaintenanceList.js.map +1 -1
  13. package/dist/module/components/MaintenanceListItem.js +27 -40
  14. package/dist/module/components/MaintenanceListItem.js.map +1 -1
  15. package/dist/module/components/MaintenanceWidgetItem.js +13 -13
  16. package/dist/module/components/MaintenanceWidgetItem.js.map +1 -1
  17. package/dist/module/components/StatusSelectorPopup.js +14 -9
  18. package/dist/module/components/StatusSelectorPopup.js.map +1 -1
  19. package/dist/module/components/WidgetSmall.js +3 -7
  20. package/dist/module/components/WidgetSmall.js.map +1 -1
  21. package/dist/module/helper.js +25 -39
  22. package/dist/module/helper.js.map +1 -1
  23. package/dist/module/reducers/JobsReducer.js +2 -31
  24. package/dist/module/reducers/JobsReducer.js.map +1 -1
  25. package/dist/module/screens/JobTypePicker.js +1 -1
  26. package/dist/module/screens/JobTypePicker.js.map +1 -1
  27. package/dist/module/screens/RequestDetail.js +19 -91
  28. package/dist/module/screens/RequestDetail.js.map +1 -1
  29. package/dist/module/screens/RequestNotes.js +20 -336
  30. package/dist/module/screens/RequestNotes.js.map +1 -1
  31. package/dist/module/screens/ServiceRequest.js +1 -1
  32. package/dist/module/screens/ServiceRequest.js.map +1 -1
  33. package/dist/module/values.config.a.js +1 -6
  34. package/dist/module/values.config.a.js.map +1 -1
  35. package/dist/module/values.config.default.js +1 -6
  36. package/dist/module/values.config.default.js.map +1 -1
  37. package/dist/module/values.config.forms.js +1 -6
  38. package/dist/module/values.config.forms.js.map +1 -1
  39. package/dist/module/values.config.js +1 -6
  40. package/dist/module/values.config.js.map +1 -1
  41. package/package.json +9 -8
  42. package/src/actions/JobActions.js +1 -53
  43. package/src/actions/types.js +0 -4
  44. package/src/apis/index.js +0 -4
  45. package/src/apis/maintenanceActions.js +6 -18
  46. package/src/components/FilterPopupMenu.js +21 -40
  47. package/src/components/MaintenanceList.js +47 -38
  48. package/src/components/MaintenanceListItem.js +22 -36
  49. package/src/components/MaintenanceWidgetItem.js +13 -17
  50. package/src/components/StatusSelectorPopup.js +14 -8
  51. package/src/components/WidgetSmall.js +3 -5
  52. package/src/helper.js +21 -50
  53. package/src/reducers/JobsReducer.js +1 -25
  54. package/src/screens/JobTypePicker.js +1 -1
  55. package/src/screens/RequestDetail.js +25 -88
  56. package/src/screens/RequestNotes.js +22 -342
  57. package/src/screens/ServiceRequest.js +2 -2
  58. package/src/values.config.a.js +0 -5
  59. package/src/values.config.default.js +0 -5
  60. package/src/values.config.forms.js +0 -5
  61. package/src/values.config.js +0 -5
  62. package/dist/module/components/PrioritySelectorPopup.js +0 -82
  63. package/dist/module/components/PrioritySelectorPopup.js.map +0 -1
  64. package/src/components/PrioritySelectorPopup.js +0 -79
@@ -1,7 +1,7 @@
1
1
  import React, { Component } from 'react';
2
- import { ScrollView, View, Text, TouchableOpacity, Modal, KeyboardAvoidingView, Platform, FlatList, Dimensions, ImageBackground, Keyboard } from 'react-native';
2
+ import { ScrollView, View, Text, TouchableOpacity, Modal, KeyboardAvoidingView, Platform } from 'react-native';
3
3
  import { connect } from 'react-redux';
4
- import { Icon } from 'react-native-elements';
4
+ import { Icon } from '@rneui/themed';
5
5
  import _ from 'lodash';
6
6
  import moment from 'moment';
7
7
  import { jobAdded } from '../actions';
@@ -11,8 +11,6 @@ import { Services } from '../feature.config';
11
11
  import { Components, Colours, Helper } from '../core.config';
12
12
  import { values } from '../values.config';
13
13
 
14
- const PHOTO_SIZE = (Dimensions.get('window').width - 64) / 3;
15
-
16
14
  class RequestNotes extends Component {
17
15
  constructor(props) {
18
16
  super(props);
@@ -23,10 +21,7 @@ class RequestNotes extends Component {
23
21
  noteAttachments: [],
24
22
  noteInput: '',
25
23
  addNoteOpen: false,
26
- noteImages: [{ add: true }],
27
- uploadingImage: false,
28
24
  };
29
- this.checkThumb = null;
30
25
  }
31
26
 
32
27
  componentDidMount() {
@@ -39,10 +34,6 @@ class RequestNotes extends Component {
39
34
  }
40
35
  }
41
36
 
42
- componentWillUnmount() {
43
- clearInterval(this.checkThumb);
44
- }
45
-
46
37
  updateJobState() {
47
38
  const job = _.find(this.props.jobs, j => j.id === this.props.job.id) || this.props.job;
48
39
  this.setState({ job });
@@ -90,10 +81,14 @@ class RequestNotes extends Component {
90
81
  };
91
82
 
92
83
  isReadyToSaveNote = () => {
93
- const uploadingAttachments = _.some(this.state.noteAttachments, n => n.Uploading);
94
- const uploadingImages = _.some(this.state.noteImages, n => n.uploading);
95
- if (uploadingAttachments || uploadingImages) return false;
96
- return !_.isEmpty(this.state.noteInput) || !_.isEmpty(this.state.noteAttachments) || !_.isEmpty(this.state.noteImages.filter(img => !img.add));
84
+ if (
85
+ _.some(this.state.noteAttachments, n => {
86
+ return n.Uploading;
87
+ })
88
+ ) {
89
+ return false;
90
+ }
91
+ return !_.isEmpty(this.state.noteInput) || !_.isEmpty(this.state.noteAttachments);
97
92
  };
98
93
 
99
94
  openAddNote = () => {
@@ -111,16 +106,13 @@ class RequestNotes extends Component {
111
106
  if (!!this.state.editingNote) {
112
107
  newState.noteInput = '';
113
108
  newState.noteAttachments = [];
114
- newState.noteImages = [];
115
109
  }
116
110
  this.setState(newState);
117
111
  };
118
112
 
119
113
  openEditNote = n => {
120
- const noteImages = [...((n.Images || []).map(i => ({ url: i, thumbNailUrl: Helper.getThumb300(i) }))), { add: true }];
121
114
  this.setState({
122
115
  noteAttachments: n.Attachments || [],
123
- noteImages,
124
116
  noteInput: n.Note || '',
125
117
  addNoteOpen: true,
126
118
  editingNote: n.Id,
@@ -135,26 +127,27 @@ class RequestNotes extends Component {
135
127
 
136
128
  try {
137
129
  this.setState({ submittingNote: true });
138
- const attachments = this.state.noteAttachments.filter(a => !a.add).map(a => {
139
- return {
140
- Title: a.Title,
141
- Source: a.Source,
142
- };
143
- });
144
- const images = this.state.noteImages.filter(img => !img.add).map(img => img.url);
145
130
  const res = await (this.state.editingNote
146
131
  ? maintenanceActions.editNote(
147
132
  this.props.job.id,
148
133
  this.state.editingNote,
149
134
  this.state.noteInput,
150
- attachments,
151
- images,
135
+ this.state.noteAttachments.map(a => {
136
+ return {
137
+ Title: a.Title,
138
+ Source: a.Source,
139
+ };
140
+ }),
152
141
  )
153
142
  : maintenanceActions.addNote(
154
143
  this.props.job.id,
155
144
  this.state.noteInput,
156
- attachments,
157
- images,
145
+ this.state.noteAttachments.map(a => {
146
+ return {
147
+ Title: a.Title,
148
+ Source: a.Source,
149
+ };
150
+ }),
158
151
  ));
159
152
  this.setState(
160
153
  {
@@ -163,8 +156,6 @@ class RequestNotes extends Component {
163
156
  addNoteOpen: false,
164
157
  noteInput: '',
165
158
  noteAttachments: [],
166
- noteImages: [{ add: true }],
167
- uploadingImage: false,
168
159
  editingNote: null,
169
160
  },
170
161
  () => {
@@ -177,148 +168,10 @@ class RequestNotes extends Component {
177
168
  console.log(err);
178
169
  this.setState({
179
170
  submittingNote: false,
180
- uploadingImage: false,
181
171
  });
182
172
  }
183
173
  };
184
174
 
185
- setImages = (noteImages, uploadingImage = false, callback = null) => {
186
- this.setState({ noteImages, uploadingImage }, callback);
187
- };
188
-
189
- getImages = () => {
190
- const { noteImages } = this.state;
191
- const imagesList = _.cloneDeep(noteImages);
192
- if (!imagesList || !Array.isArray(imagesList) || imagesList.length === 0) {
193
- return [{ add: true }];
194
- }
195
- return imagesList;
196
- };
197
-
198
- getImageUrls = () => {
199
- const imagesList = this.getImages();
200
- return _.filter(imagesList, img => {
201
- return !img.uploading && !img.add;
202
- }).map(img => {
203
- return img.url;
204
- });
205
- };
206
-
207
- waitForThumbnails = () => {
208
- if (this.checkThumb) return;
209
-
210
- this.checkThumb = setInterval(async () => {
211
- const imagesList = this.getImages();
212
- const imagesUpdate = [];
213
- await Promise.all(
214
- imagesList.map(image => {
215
- return new Promise(async resolve => {
216
- const newImage = { ...image };
217
- imagesUpdate.push(newImage);
218
- if (newImage.url && !newImage.thumbNailExists) {
219
- newImage.uploading = false;
220
- newImage.allowRetry = false;
221
- newImage.thumbNailExists = await Helper.imageExists(newImage.thumbNailUrl);
222
- resolve(newImage.thumbNailExists);
223
- }
224
- resolve(true);
225
- });
226
- }),
227
- );
228
- const thumbnailsExist = imagesUpdate.every(image => !image.url || image.thumbNailExists);
229
- if (thumbnailsExist) {
230
- clearInterval(this.checkThumb);
231
- this.checkThumb = null;
232
- this.setImages(imagesUpdate);
233
- }
234
- }, 2000);
235
- };
236
-
237
- removeImage = (index) => {
238
- const imagesUpdate = this.getImages();
239
- imagesUpdate.splice(index, 1);
240
-
241
- this.setImages(imagesUpdate);
242
- };
243
-
244
- showUploadMenu = () => {
245
- Keyboard.dismiss();
246
- const { uploadingImage, submittingNote } = this.state;
247
- if (uploadingImage || submittingNote) return;
248
- this.imageUploader.showUploadMenu();
249
- };
250
-
251
- toggleFullscreenVideo = url => {
252
- if (typeof url !== 'string') url = '';
253
- this.setState({ showFullscreenVideo: url.length > 0, currentVideoUrl: url });
254
- };
255
-
256
- onUploadStarted = (uploadUri, imageUri) => {
257
- const imagesUpdate = this.getImages();
258
- imagesUpdate.splice(imagesUpdate.length - 1, 0, {
259
- uploading: true,
260
- uploadProgress: '0%',
261
- uploadUri,
262
- imageUri,
263
- allowRetry: true,
264
- });
265
-
266
- this.setImages(imagesUpdate, true);
267
- };
268
-
269
- onUploadProgress = progress => {
270
- const imagesUpdate = this.getImages();
271
- imagesUpdate.map(img => {
272
- if (img.uploadUri === progress.uri) {
273
- img.uploadProgress = progress.percentage;
274
- img.uploading = true;
275
- img.allowRetry = true;
276
- }
277
- });
278
-
279
- this.setImages(imagesUpdate, true);
280
- };
281
-
282
- onUploadSuccess = async (uri, uploadUri) => {
283
- const imagesUpdate = this.getImages();
284
- imagesUpdate.map(img => {
285
- if (img.uploadUri === uploadUri && img.uploading) {
286
- img.url = uri.replace('/general/', '/general1400/');
287
- img.thumbNailExists = false;
288
- img.thumbNailUrl = Helper.getThumb300(img.url);
289
- img.allowRetry = true;
290
- }
291
- });
292
-
293
- this.setImages(imagesUpdate, false, () => this.waitForThumbnails());
294
- };
295
-
296
- onUploadFailed = uploadUri => {
297
- const imagesUpdate = this.getImages();
298
- imagesUpdate.map(img => {
299
- if (img.uploadUri === uploadUri) {
300
- img.uploading = true; // Requried for retry
301
- img.uploadProgress = '';
302
- img.allowRetry = true;
303
- }
304
- });
305
-
306
- this.setImages(imagesUpdate);
307
- };
308
-
309
- onLibrarySelected = uri => {
310
- const imagesUpdate = this.getImages();
311
- imagesUpdate.splice(imagesUpdate.length - 1, 0, {
312
- uploading: false,
313
- allowRetry: false,
314
- url: Helper.get1400(uri),
315
- thumbNailExists: true,
316
- thumbNailUrl: Helper.getThumb300(uri),
317
- });
318
-
319
- this.setImages(imagesUpdate);
320
- };
321
-
322
175
  renderAttachment(a, i) {
323
176
  return (
324
177
  <Components.Attachment
@@ -419,118 +272,10 @@ class RequestNotes extends Component {
419
272
  );
420
273
  }
421
274
 
422
- renderUploadMenu() {
423
- return (
424
- <Components.ImageUploader
425
- ref={ref => (this.imageUploader = ref)}
426
- onUploadStarted={this.onUploadStarted}
427
- onUploadSuccess={this.onUploadSuccess}
428
- onUploadFailed={this.onUploadFailed}
429
- onUploadProgress={this.onUploadProgress}
430
- onLibrarySelected={this.onLibrarySelected}
431
- size={{ width: 1400 }}
432
- quality={0.8}
433
- fileName={'serviceNoteImage'}
434
- popupTitle={'Upload Image'}
435
- userId={this.props.user.uid}
436
- allowsEditing={false}
437
- multiple
438
- hideLibrary
439
- />
440
- );
441
- }
442
-
443
- renderImage(item, index) {
444
- const isVideoUrl = Helper.isVideo(item.url);
445
- const imagesList = this.getImages();
446
-
447
- if (item.add) {
448
- return (
449
- <TouchableOpacity activeOpacity={0.8} onPress={() => this.showUploadMenu()}>
450
- <View
451
- style={[
452
- styles.imageContainer,
453
- imagesList.length > 1 && styles.imageContainerNotEmpty,
454
- index % 3 === 0 && { marginLeft: 0 },
455
- index > 2 && { marginTop: 8 },
456
- ]}
457
- >
458
- <View style={styles.imageCircle}>
459
- <Icon name="camera" type="font-awesome" iconStyle={styles.addImageIcon} />
460
- </View>
461
- </View>
462
- </TouchableOpacity>
463
- );
464
- }
465
- return (
466
- <View
467
- style={[
468
- styles.imageContainer,
469
- imagesList.length > 1 && styles.imageContainerNotEmpty,
470
- index % 3 === 0 && { marginLeft: 0 },
471
- index > 2 && { marginTop: 8 },
472
- ]}
473
- >
474
- {item.uploading ? (
475
- <Components.ImageUploadProgress uploader={this.imageUploader} image={item} color={this.props.colourBrandingMain} />
476
- ) : (
477
- <ImageBackground
478
- style={styles.imageBackground}
479
- source={Helper.getImageSource(item.thumbNailExists ? item.thumbNailUrl : (item.url || item))}
480
- >
481
- {isVideoUrl && (
482
- <View style={styles.imagePlayContainer}>
483
- <TouchableOpacity onPress={this.toggleFullscreenVideo.bind(this, item.url)}>
484
- <Icon name="play" type="font-awesome" iconStyle={styles.imageControlIcon} />
485
- </TouchableOpacity>
486
- </View>
487
- )}
488
- <TouchableOpacity style={styles.removeImage} onPress={() => this.removeImage(index)}>
489
- <Icon name="remove" type="font-awesome" iconStyle={styles.imageControlIcon} style={styles.removeImage} />
490
- </TouchableOpacity>
491
- </ImageBackground>
492
- )}
493
- </View>
494
- );
495
- }
496
-
497
- renderImageList() {
498
- const imagesList = this.getImages();
499
-
500
- return (
501
- <View style={styles.imageListContainer}>
502
- <FlatList
503
- keyboardShouldPersistTaps="always"
504
- enableEmptySections
505
- data={imagesList}
506
- renderItem={({ item, index }) => this.renderImage(item, index)}
507
- keyExtractor={(item, index) => index}
508
- numColumns={3}
509
- scrollEnabled={false}
510
- />
511
- </View>
512
- );
513
- }
514
-
515
- renderVideoPlayerPopup() {
516
- const { showFullscreenVideo, currentVideoUrl } = this.state;
517
- if (!currentVideoUrl) return;
518
-
519
- return (
520
- <Components.VideoPopup
521
- uri={currentVideoUrl}
522
- visible={showFullscreenVideo}
523
- showFullscreenButton={false}
524
- onClose={this.toggleFullscreenVideo}
525
- />
526
- );
527
- }
528
-
529
275
  renderAdd() {
530
276
  return (
531
277
  <Modal animationType="slide" visible={this.state.addNoteOpen}>
532
278
  <KeyboardAvoidingView style={styles.container} behavior={Platform.OS === 'ios' && 'padding'}>
533
- {this.renderUploadMenu()}
534
279
  <Components.Header leftText="Cancel" onPressLeft={this.closeAddNote} text="" />
535
280
  <ScrollView style={styles.scrollContainer} contentContainerStyle={styles.innerContainer}>
536
281
  <Components.TextStyle type="pageHeading">Add Staff Note</Components.TextStyle>
@@ -552,7 +297,6 @@ class RequestNotes extends Component {
552
297
  sectionStyle={styles.inputSection}
553
298
  />
554
299
  <Components.GenericInputSection label="Attachments" sectionStyle={styles.inputSection}>
555
- {this.renderImageList()}
556
300
  {this.state.editingNote ? (
557
301
  (this.state.noteAttachments || []).map((a, i) => this.renderAttachment(a, i))
558
302
  ) : (
@@ -563,7 +307,6 @@ class RequestNotes extends Component {
563
307
  </Components.GenericInputSection>
564
308
  </ScrollView>
565
309
  <View style={styles.popupFooter}>{this.renderFooterContent()}</View>
566
- {this.renderVideoPlayerPopup()}
567
310
  </KeyboardAvoidingView>
568
311
  </Modal>
569
312
  );
@@ -661,69 +404,6 @@ const styles = {
661
404
  attachmentInfo: {
662
405
  marginTop: 8,
663
406
  },
664
- imageListContainer: {
665
- marginVertical: 8,
666
- },
667
- imageContainer: {
668
- width: PHOTO_SIZE,
669
- height: PHOTO_SIZE,
670
- borderStyle: 'dashed',
671
- justifyContent: 'center',
672
- alignItems: 'center',
673
- borderWidth: 1,
674
- borderColor: Colours.LINEGREY,
675
- backgroundColor: Colours.BOXGREY,
676
- borderRadius: 4,
677
- marginLeft: 8,
678
- },
679
- imageContainerNotEmpty: {
680
- borderWidth: 1,
681
- borderColor: Colours.LINEGREY,
682
- backgroundColor: '#fff',
683
- borderStyle: 'dashed',
684
- },
685
- imageBackground: {
686
- flex: 1,
687
- height: '100%',
688
- width: '100%',
689
- borderRadius: 4,
690
- },
691
- imageCircle: {
692
- width: 90,
693
- height: 90,
694
- borderRadius: 45,
695
- backgroundColor: Colours.PINKISH_GREY,
696
- justifyContent: 'center',
697
- },
698
- addImageIcon: {
699
- color: '#fff',
700
- fontSize: 32,
701
- },
702
- imagePlayContainer: {
703
- position: 'absolute',
704
- top: 0,
705
- left: 0,
706
- right: 0,
707
- bottom: 0,
708
- alignItems: 'center',
709
- justifyContent: 'center',
710
- },
711
- imageControlIcon: {
712
- color: '#fff',
713
- fontSize: 20,
714
- textShadowColor: 'rgba(0,0,0,0.3)',
715
- textShadowOffset: { width: 2, height: 2 },
716
- },
717
- removeImage: {
718
- position: 'absolute',
719
- top: 0,
720
- right: 0,
721
- padding: 4,
722
- width: 40,
723
- height: 40,
724
- alignItems: 'center',
725
- justifyContent: 'center',
726
- },
727
407
  };
728
408
 
729
409
  const mapStateToProps = state => {
@@ -13,7 +13,7 @@ import {
13
13
  Keyboard,
14
14
  } from 'react-native';
15
15
  import DateTimePicker from 'react-native-modal-datetime-picker';
16
- import { Icon } from 'react-native-elements';
16
+ import { Icon } from '@rneui/themed';
17
17
  import _ from 'lodash';
18
18
  import moment from 'moment';
19
19
  import { connect } from 'react-redux';
@@ -315,7 +315,7 @@ class MaintenanceRequest extends Component {
315
315
  console.log(res.data);
316
316
  this.getDefaultJob();
317
317
  })
318
- .catch(() => {});
318
+ .catch(() => { });
319
319
  }
320
320
 
321
321
  pickType(type) {
@@ -8,9 +8,6 @@ const values = {
8
8
  actionJobsLoaded: 'JOBS_LOADEDA',
9
9
  actionJobAdded: 'JOB_ADDEDA',
10
10
  actionJobsAdded: 'JOBS_ADDEDA',
11
- actionJobsStatusesLoaded: 'JOBS_STATUSES_LOADEDA',
12
- actionJobsHideSeen: 'JOBS_HIDE_SEENA',
13
- actionJobFilterLoaded: 'JOBS_FILTER_LOADEDA',
14
11
  screenMaintenance: 'maintenanceA',
15
12
  screenRequestDetail: 'requestDetailA',
16
13
  screenServiceRequest: 'serviceRequestA',
@@ -29,8 +26,6 @@ const values = {
29
26
  textMoreMenuTitle: 'Request A',
30
27
  textKioskActionTitle: 'Request A',
31
28
  textEntityName: 'Job',
32
- stringConfigJobStatus: 'maintenanceJobStatusA',
33
- stringConfigHideSeen: 'maintenanceDisableSeenA',
34
29
  };
35
30
 
36
31
  export { values };
@@ -8,9 +8,6 @@ const values = {
8
8
  actionJobsLoaded: 'JOBS_LOADED',
9
9
  actionJobAdded: 'JOB_ADDED',
10
10
  actionJobsAdded: 'JOBS_ADDED',
11
- actionJobsStatusesLoaded: 'JOBS_STATUSES_LOADED',
12
- actionJobsHideSeen: 'JOBS_HIDE_SEEN',
13
- actionJobFilterLoaded: 'JOBS_FILTER_LOADED',
14
11
  screenMaintenance: 'maintenance',
15
12
  screenRequestDetail: 'requestDetail',
16
13
  screenServiceRequest: 'serviceRequest',
@@ -35,8 +32,6 @@ const values = {
35
32
  emptyRequestsStaff: 'No active Requests',
36
33
  emptyRequestsUser: 'Your Requests will show here',
37
34
  forceCustomFields: false,
38
- stringConfigJobStatus: 'maintenanceJobStatus',
39
- stringConfigHideSeen: 'maintenanceDisableSeen',
40
35
  };
41
36
 
42
37
  export { values };
@@ -8,9 +8,6 @@ const values = {
8
8
  actionJobsLoaded: 'JOBS_LOADEDForms',
9
9
  actionJobAdded: 'JOB_ADDEDForms',
10
10
  actionJobsAdded: 'JOBS_ADDEDForms',
11
- actionJobsStatusesLoaded: 'JOBS_STATUSES_LOADEDForms',
12
- actionJobsHideSeen: 'JOBS_HIDE_SEENForms',
13
- actionJobFilterLoaded: 'JOBS_FILTER_LOADEDForms',
14
11
  screenMaintenance: 'maintenanceForms',
15
12
  screenRequestDetail: 'requestDetailForms',
16
13
  screenServiceRequest: 'serviceRequestForms',
@@ -35,8 +32,6 @@ const values = {
35
32
  emptyRequestsStaff: 'No active Form Submissions',
36
33
  emptyRequestsUser: 'Your Form Submissions will show here',
37
34
  forceCustomFields: true,
38
- stringConfigJobStatus: 'maintenanceJobStatusForms',
39
- stringConfigHideSeen: 'maintenanceDisableSeenForms',
40
35
  };
41
36
 
42
37
  export { values };
@@ -8,9 +8,6 @@ const values = {
8
8
  actionJobsLoaded: 'JOBS_LOADEDForms',
9
9
  actionJobAdded: 'JOB_ADDEDForms',
10
10
  actionJobsAdded: 'JOBS_ADDEDForms',
11
- actionJobsStatusesLoaded: 'JOBS_STATUSES_LOADEDForms',
12
- actionJobsHideSeen: 'JOBS_HIDE_SEENForms',
13
- actionJobFilterLoaded: 'JOBS_FILTER_LOADEDForms',
14
11
  screenMaintenance: 'maintenanceForms',
15
12
  screenRequestDetail: 'requestDetailForms',
16
13
  screenServiceRequest: 'serviceRequestForms',
@@ -35,8 +32,6 @@ const values = {
35
32
  emptyRequestsStaff: 'No active Form Submissions',
36
33
  emptyRequestsUser: 'Your Form Submissions will show here',
37
34
  forceCustomFields: true,
38
- stringConfigJobStatus: 'maintenanceJobStatusForms',
39
- stringConfigHideSeen: 'maintenanceDisableSeenForms',
40
35
  };
41
36
 
42
37
  export { values };
@@ -1,82 +0,0 @@
1
- import React, { PureComponent } from 'react';
2
- import { View, StyleSheet, TouchableOpacity, Text } from 'react-native';
3
- import { connect } from 'react-redux';
4
- import { jobPriorityOptions } from '../helper';
5
- import { Components, Colours } from '../core.config';
6
- class PrioritySelectorPopup extends PureComponent {
7
- render() {
8
- const {
9
- title,
10
- includeAll,
11
- allText,
12
- onClose,
13
- onSelect
14
- } = this.props;
15
- let priorities = jobPriorityOptions;
16
- if (includeAll) priorities = [{
17
- label: allText || 'Show All',
18
- color: this.props.colourBrandingMain
19
- }, ...priorities];
20
- return /*#__PURE__*/React.createElement(Components.MiddlePopup, {
21
- style: [styles.statusPopup, {
22
- height: priorities.length * 50 + 40
23
- }],
24
- onClose: onClose
25
- }, /*#__PURE__*/React.createElement(Text, {
26
- style: styles.statusPopupTitle
27
- }, title || 'Select Priority'), /*#__PURE__*/React.createElement(View, {
28
- style: styles.statusPopupOptionsContainer
29
- }, priorities.map(priority => {
30
- return /*#__PURE__*/React.createElement(TouchableOpacity, {
31
- key: priority.label,
32
- onPress: () => onSelect(priority.label)
33
- }, /*#__PURE__*/React.createElement(View, {
34
- style: [styles.jobStatusContainer, {
35
- backgroundColor: priority.color
36
- }]
37
- }, /*#__PURE__*/React.createElement(Text, {
38
- style: styles.jobStatusText
39
- }, priority.label)));
40
- })));
41
- }
42
- }
43
- const styles = StyleSheet.create({
44
- statusPopup: {
45
- width: 160,
46
- padding: 16,
47
- borderRadius: 12
48
- },
49
- statusPopupTitle: {
50
- fontFamily: 'sf-bold',
51
- color: Colours.TEXT_DARK,
52
- fontSize: 18,
53
- marginBottom: 16
54
- },
55
- statusPopupOptionsContainer: {
56
- flex: 1,
57
- justifyContent: 'space-between'
58
- },
59
- jobStatusContainer: {
60
- flexDirection: 'row',
61
- alignItems: 'center',
62
- justifyContent: 'space-between',
63
- width: 105,
64
- height: 30,
65
- paddingHorizontal: 8,
66
- borderRadius: 4
67
- },
68
- jobStatusText: {
69
- color: '#fff',
70
- textAlign: 'center',
71
- fontFamily: 'sf-semibold',
72
- fontSize: 13,
73
- flex: 1
74
- }
75
- });
76
- const mapStateToProps = state => {
77
- return {
78
- colourBrandingMain: Colours.getMainBrandingColourFromState(state)
79
- };
80
- };
81
- export default connect(mapStateToProps, {})(PrioritySelectorPopup);
82
- //# sourceMappingURL=PrioritySelectorPopup.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["React","PureComponent","View","StyleSheet","TouchableOpacity","Text","connect","jobPriorityOptions","Components","Colours","PrioritySelectorPopup","render","title","includeAll","allText","onClose","onSelect","props","priorities","label","color","colourBrandingMain","createElement","MiddlePopup","style","styles","statusPopup","height","length","statusPopupTitle","statusPopupOptionsContainer","map","priority","key","onPress","jobStatusContainer","backgroundColor","jobStatusText","create","width","padding","borderRadius","fontFamily","TEXT_DARK","fontSize","marginBottom","flex","justifyContent","flexDirection","alignItems","paddingHorizontal","textAlign","mapStateToProps","state","getMainBrandingColourFromState"],"sources":["PrioritySelectorPopup.js"],"sourcesContent":["import React, { PureComponent } from 'react';\nimport { View, StyleSheet, TouchableOpacity, Text } from 'react-native';\nimport { connect } from 'react-redux';\nimport { jobPriorityOptions } from '../helper';\nimport { Components, Colours } from '../core.config';\n\nclass PrioritySelectorPopup extends PureComponent {\n render() {\n const { title, includeAll, allText, onClose, onSelect } = this.props;\n let priorities = jobPriorityOptions;\n if (includeAll)\n priorities = [\n {\n label: allText || 'Show All',\n color: this.props.colourBrandingMain,\n },\n ...priorities,\n ];\n\n return (\n <Components.MiddlePopup style={[styles.statusPopup, { height: priorities.length * 50 + 40 }]} onClose={onClose}>\n <Text style={styles.statusPopupTitle}>{title || 'Select Priority'}</Text>\n <View style={styles.statusPopupOptionsContainer}>\n {priorities.map(priority => {\n return (\n <TouchableOpacity key={priority.label} onPress={() => onSelect(priority.label)}>\n <View style={[styles.jobStatusContainer, { backgroundColor: priority.color }]}>\n <Text style={styles.jobStatusText}>{priority.label}</Text>\n </View>\n </TouchableOpacity>\n );\n })}\n </View>\n </Components.MiddlePopup>\n );\n }\n}\n\nconst styles = StyleSheet.create({\n statusPopup: {\n width: 160,\n padding: 16,\n borderRadius: 12,\n },\n statusPopupTitle: {\n fontFamily: 'sf-bold',\n color: Colours.TEXT_DARK,\n fontSize: 18,\n marginBottom: 16,\n },\n statusPopupOptionsContainer: {\n flex: 1,\n justifyContent: 'space-between',\n },\n jobStatusContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n width: 105,\n height: 30,\n paddingHorizontal: 8,\n borderRadius: 4,\n },\n jobStatusText: {\n color: '#fff',\n textAlign: 'center',\n fontFamily: 'sf-semibold',\n fontSize: 13,\n flex: 1,\n },\n});\n\nconst mapStateToProps = state => {\n return {\n colourBrandingMain: Colours.getMainBrandingColourFromState(state),\n };\n};\n\nexport default connect(mapStateToProps, {})(PrioritySelectorPopup);\n"],"mappings":"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","ignoreList":[]}