@plusscommunities/pluss-maintenance-app 6.0.11 → 6.0.12-beta.1
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/module/actions/JobActions.js +44 -1
- package/dist/module/actions/JobActions.js.map +1 -1
- package/dist/module/actions/types.js +3 -0
- package/dist/module/actions/types.js.map +1 -1
- package/dist/module/apis/index.js +2 -0
- package/dist/module/apis/index.js.map +1 -1
- package/dist/module/apis/maintenanceActions.js +21 -6
- package/dist/module/apis/maintenanceActions.js.map +1 -1
- package/dist/module/components/FilterPopupMenu.js +34 -18
- package/dist/module/components/FilterPopupMenu.js.map +1 -1
- package/dist/module/components/MaintenanceList.js +47 -56
- package/dist/module/components/MaintenanceList.js.map +1 -1
- package/dist/module/components/MaintenanceListItem.js +39 -26
- package/dist/module/components/MaintenanceListItem.js.map +1 -1
- package/dist/module/components/MaintenanceWidgetItem.js +12 -12
- package/dist/module/components/MaintenanceWidgetItem.js.map +1 -1
- package/dist/module/components/PrioritySelectorPopup.js +82 -0
- package/dist/module/components/PrioritySelectorPopup.js.map +1 -0
- package/dist/module/components/StatusSelectorPopup.js +9 -14
- package/dist/module/components/StatusSelectorPopup.js.map +1 -1
- package/dist/module/components/WidgetSmall.js +7 -3
- package/dist/module/components/WidgetSmall.js.map +1 -1
- package/dist/module/helper.js +39 -25
- package/dist/module/helper.js.map +1 -1
- package/dist/module/reducers/JobsReducer.js +31 -2
- package/dist/module/reducers/JobsReducer.js.map +1 -1
- package/dist/module/screens/RequestDetail.js +90 -18
- package/dist/module/screens/RequestDetail.js.map +1 -1
- package/dist/module/screens/RequestNotes.js +430 -21
- package/dist/module/screens/RequestNotes.js.map +1 -1
- package/dist/module/values.config.a.js +6 -1
- package/dist/module/values.config.a.js.map +1 -1
- package/dist/module/values.config.default.js +6 -1
- package/dist/module/values.config.default.js.map +1 -1
- package/dist/module/values.config.forms.js +6 -1
- package/dist/module/values.config.forms.js.map +1 -1
- package/dist/module/values.config.js +6 -1
- package/dist/module/values.config.js.map +1 -1
- package/package.json +2 -2
- package/src/actions/JobActions.js +53 -1
- package/src/actions/types.js +4 -0
- package/src/apis/index.js +4 -0
- package/src/apis/maintenanceActions.js +18 -6
- package/src/components/FilterPopupMenu.js +40 -21
- package/src/components/MaintenanceList.js +38 -47
- package/src/components/MaintenanceListItem.js +35 -21
- package/src/components/MaintenanceWidgetItem.js +16 -12
- package/src/components/PrioritySelectorPopup.js +79 -0
- package/src/components/StatusSelectorPopup.js +8 -14
- package/src/components/WidgetSmall.js +5 -3
- package/src/helper.js +50 -21
- package/src/reducers/JobsReducer.js +25 -1
- package/src/screens/RequestDetail.js +89 -26
- package/src/screens/RequestNotes.js +427 -28
- package/src/values.config.a.js +5 -0
- package/src/values.config.default.js +5 -0
- package/src/values.config.forms.js +5 -0
- package/src/values.config.js +5 -0
@@ -1,5 +1,5 @@
|
|
1
1
|
import React, { Component } from 'react';
|
2
|
-
import { ScrollView, View, Text, TouchableOpacity, Modal, KeyboardAvoidingView, Platform } from 'react-native';
|
2
|
+
import { ScrollView, View, Text, TouchableOpacity, Modal, KeyboardAvoidingView, Platform, FlatList, Dimensions, ImageBackground, Keyboard } from 'react-native';
|
3
3
|
import { connect } from 'react-redux';
|
4
4
|
import { Icon } from 'react-native-elements';
|
5
5
|
import _ from 'lodash';
|
@@ -11,6 +11,9 @@ 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 SCREEN_WIDTH = Dimensions.get('window').width;
|
15
|
+
const PHOTO_SIZE = (SCREEN_WIDTH - 64) / 3;
|
16
|
+
|
14
17
|
class RequestNotes extends Component {
|
15
18
|
constructor(props) {
|
16
19
|
super(props);
|
@@ -21,7 +24,13 @@ class RequestNotes extends Component {
|
|
21
24
|
noteAttachments: [],
|
22
25
|
noteInput: '',
|
23
26
|
addNoteOpen: false,
|
27
|
+
noteImages: [{ add: true }],
|
28
|
+
uploadingImage: false,
|
29
|
+
galleryOpen: false,
|
30
|
+
galleryImages: [],
|
31
|
+
galleryIndex: 0
|
24
32
|
};
|
33
|
+
this.checkThumb = null;
|
25
34
|
}
|
26
35
|
|
27
36
|
componentDidMount() {
|
@@ -34,6 +43,10 @@ class RequestNotes extends Component {
|
|
34
43
|
}
|
35
44
|
}
|
36
45
|
|
46
|
+
componentWillUnmount() {
|
47
|
+
clearInterval(this.checkThumb);
|
48
|
+
}
|
49
|
+
|
37
50
|
updateJobState() {
|
38
51
|
const job = _.find(this.props.jobs, j => j.id === this.props.job.id) || this.props.job;
|
39
52
|
this.setState({ job });
|
@@ -81,14 +94,10 @@ class RequestNotes extends Component {
|
|
81
94
|
};
|
82
95
|
|
83
96
|
isReadyToSaveNote = () => {
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
) {
|
89
|
-
return false;
|
90
|
-
}
|
91
|
-
return !_.isEmpty(this.state.noteInput) || !_.isEmpty(this.state.noteAttachments);
|
97
|
+
const uploadingAttachments = _.some(this.state.noteAttachments, n => n.Uploading);
|
98
|
+
const uploadingImages = _.some(this.state.noteImages, n => n.uploading);
|
99
|
+
if (uploadingAttachments || uploadingImages) return false;
|
100
|
+
return !_.isEmpty(this.state.noteInput) || !_.isEmpty(this.state.noteAttachments) || !_.isEmpty(this.state.noteImages.filter(img => !img.add));
|
92
101
|
};
|
93
102
|
|
94
103
|
openAddNote = () => {
|
@@ -106,13 +115,16 @@ class RequestNotes extends Component {
|
|
106
115
|
if (!!this.state.editingNote) {
|
107
116
|
newState.noteInput = '';
|
108
117
|
newState.noteAttachments = [];
|
118
|
+
newState.noteImages = [];
|
109
119
|
}
|
110
120
|
this.setState(newState);
|
111
121
|
};
|
112
122
|
|
113
123
|
openEditNote = n => {
|
124
|
+
const noteImages = [...((n.Images || []).map(i => ({ url: i, thumbNailUrl: Helper.getThumb300(i) }))), { add: true }];
|
114
125
|
this.setState({
|
115
126
|
noteAttachments: n.Attachments || [],
|
127
|
+
noteImages,
|
116
128
|
noteInput: n.Note || '',
|
117
129
|
addNoteOpen: true,
|
118
130
|
editingNote: n.Id,
|
@@ -127,28 +139,27 @@ class RequestNotes extends Component {
|
|
127
139
|
|
128
140
|
try {
|
129
141
|
this.setState({ submittingNote: true });
|
142
|
+
const attachments = this.state.noteAttachments.filter(a => !a.add).map(a => {
|
143
|
+
return {
|
144
|
+
Title: a.Title,
|
145
|
+
Source: a.Source,
|
146
|
+
};
|
147
|
+
});
|
148
|
+
const images = this.state.noteImages.filter(img => !img.add).map(img => img.url);
|
130
149
|
const res = await (this.state.editingNote
|
131
150
|
? maintenanceActions.editNote(
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
Source: a.Source,
|
139
|
-
};
|
140
|
-
}),
|
141
|
-
)
|
151
|
+
this.props.job.id,
|
152
|
+
this.state.editingNote,
|
153
|
+
this.state.noteInput,
|
154
|
+
attachments,
|
155
|
+
images,
|
156
|
+
)
|
142
157
|
: maintenanceActions.addNote(
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
Source: a.Source,
|
149
|
-
};
|
150
|
-
}),
|
151
|
-
));
|
158
|
+
this.props.job.id,
|
159
|
+
this.state.noteInput,
|
160
|
+
attachments,
|
161
|
+
images,
|
162
|
+
));
|
152
163
|
this.setState(
|
153
164
|
{
|
154
165
|
job: res.data.job,
|
@@ -156,6 +167,8 @@ class RequestNotes extends Component {
|
|
156
167
|
addNoteOpen: false,
|
157
168
|
noteInput: '',
|
158
169
|
noteAttachments: [],
|
170
|
+
noteImages: [{ add: true }],
|
171
|
+
uploadingImage: false,
|
159
172
|
editingNote: null,
|
160
173
|
},
|
161
174
|
() => {
|
@@ -168,10 +181,156 @@ class RequestNotes extends Component {
|
|
168
181
|
console.log(err);
|
169
182
|
this.setState({
|
170
183
|
submittingNote: false,
|
184
|
+
uploadingImage: false,
|
171
185
|
});
|
172
186
|
}
|
173
187
|
};
|
174
188
|
|
189
|
+
setImages = (noteImages, uploadingImage = false, callback = null) => {
|
190
|
+
this.setState({ noteImages, uploadingImage }, callback);
|
191
|
+
};
|
192
|
+
|
193
|
+
getImages = () => {
|
194
|
+
const { noteImages } = this.state;
|
195
|
+
const imagesList = _.cloneDeep(noteImages);
|
196
|
+
if (!imagesList || !Array.isArray(imagesList) || imagesList.length === 0) {
|
197
|
+
return [{ add: true }];
|
198
|
+
}
|
199
|
+
return imagesList;
|
200
|
+
};
|
201
|
+
|
202
|
+
getImageUrls = () => {
|
203
|
+
const imagesList = this.getImages();
|
204
|
+
return _.filter(imagesList, img => {
|
205
|
+
return !img.uploading && !img.add;
|
206
|
+
}).map(img => {
|
207
|
+
return img.url;
|
208
|
+
});
|
209
|
+
};
|
210
|
+
|
211
|
+
waitForThumbnails = () => {
|
212
|
+
if (this.checkThumb) return;
|
213
|
+
|
214
|
+
this.checkThumb = setInterval(async () => {
|
215
|
+
const imagesList = this.getImages();
|
216
|
+
const imagesUpdate = [];
|
217
|
+
await Promise.all(
|
218
|
+
imagesList.map(image => {
|
219
|
+
return new Promise(async resolve => {
|
220
|
+
const newImage = { ...image };
|
221
|
+
imagesUpdate.push(newImage);
|
222
|
+
if (newImage.url && !newImage.thumbNailExists) {
|
223
|
+
newImage.uploading = false;
|
224
|
+
newImage.allowRetry = false;
|
225
|
+
newImage.thumbNailExists = await Helper.imageExists(newImage.thumbNailUrl);
|
226
|
+
resolve(newImage.thumbNailExists);
|
227
|
+
}
|
228
|
+
resolve(true);
|
229
|
+
});
|
230
|
+
}),
|
231
|
+
);
|
232
|
+
const thumbnailsExist = imagesUpdate.every(image => !image.url || image.thumbNailExists);
|
233
|
+
if (thumbnailsExist) {
|
234
|
+
clearInterval(this.checkThumb);
|
235
|
+
this.checkThumb = null;
|
236
|
+
this.setImages(imagesUpdate);
|
237
|
+
}
|
238
|
+
}, 2000);
|
239
|
+
};
|
240
|
+
|
241
|
+
removeImage = (index) => {
|
242
|
+
const imagesUpdate = this.getImages();
|
243
|
+
imagesUpdate.splice(index, 1);
|
244
|
+
|
245
|
+
this.setImages(imagesUpdate);
|
246
|
+
};
|
247
|
+
|
248
|
+
showUploadMenu = () => {
|
249
|
+
Keyboard.dismiss();
|
250
|
+
const { uploadingImage, submittingNote } = this.state;
|
251
|
+
if (uploadingImage || submittingNote) return;
|
252
|
+
this.imageUploader.showUploadMenu();
|
253
|
+
};
|
254
|
+
|
255
|
+
toggleFullscreenVideo = url => {
|
256
|
+
if (typeof url !== 'string') url = '';
|
257
|
+
this.setState({ showFullscreenVideo: url.length > 0, currentVideoUrl: url });
|
258
|
+
};
|
259
|
+
|
260
|
+
openGallery(images, index) {
|
261
|
+
this.setState({ galleryOpen: true, galleryImages: images, galleryIndex: index });
|
262
|
+
}
|
263
|
+
|
264
|
+
closeGallery() {
|
265
|
+
this.setState({ galleryOpen: false, galleryImages: [], galleryIndex: 0 });
|
266
|
+
}
|
267
|
+
|
268
|
+
onUploadStarted = (uploadUri, imageUri) => {
|
269
|
+
const imagesUpdate = this.getImages();
|
270
|
+
imagesUpdate.splice(imagesUpdate.length - 1, 0, {
|
271
|
+
uploading: true,
|
272
|
+
uploadProgress: '0%',
|
273
|
+
uploadUri,
|
274
|
+
imageUri,
|
275
|
+
allowRetry: true,
|
276
|
+
});
|
277
|
+
|
278
|
+
this.setImages(imagesUpdate, true);
|
279
|
+
};
|
280
|
+
|
281
|
+
onUploadProgress = progress => {
|
282
|
+
const imagesUpdate = this.getImages();
|
283
|
+
imagesUpdate.map(img => {
|
284
|
+
if (img.uploadUri === progress.uri) {
|
285
|
+
img.uploadProgress = progress.percentage;
|
286
|
+
img.uploading = true;
|
287
|
+
img.allowRetry = true;
|
288
|
+
}
|
289
|
+
});
|
290
|
+
|
291
|
+
this.setImages(imagesUpdate, true);
|
292
|
+
};
|
293
|
+
|
294
|
+
onUploadSuccess = async (uri, uploadUri) => {
|
295
|
+
const imagesUpdate = this.getImages();
|
296
|
+
imagesUpdate.map(img => {
|
297
|
+
if (img.uploadUri === uploadUri && img.uploading) {
|
298
|
+
img.url = uri.replace('/general/', '/general1400/');
|
299
|
+
img.thumbNailExists = false;
|
300
|
+
img.thumbNailUrl = Helper.getThumb300(img.url);
|
301
|
+
img.allowRetry = true;
|
302
|
+
}
|
303
|
+
});
|
304
|
+
|
305
|
+
this.setImages(imagesUpdate, false, () => this.waitForThumbnails());
|
306
|
+
};
|
307
|
+
|
308
|
+
onUploadFailed = uploadUri => {
|
309
|
+
const imagesUpdate = this.getImages();
|
310
|
+
imagesUpdate.map(img => {
|
311
|
+
if (img.uploadUri === uploadUri) {
|
312
|
+
img.uploading = true; // Requried for retry
|
313
|
+
img.uploadProgress = '';
|
314
|
+
img.allowRetry = true;
|
315
|
+
}
|
316
|
+
});
|
317
|
+
|
318
|
+
this.setImages(imagesUpdate);
|
319
|
+
};
|
320
|
+
|
321
|
+
onLibrarySelected = uri => {
|
322
|
+
const imagesUpdate = this.getImages();
|
323
|
+
imagesUpdate.splice(imagesUpdate.length - 1, 0, {
|
324
|
+
uploading: false,
|
325
|
+
allowRetry: false,
|
326
|
+
url: Helper.get1400(uri),
|
327
|
+
thumbNailExists: true,
|
328
|
+
thumbNailUrl: Helper.getThumb300(uri),
|
329
|
+
});
|
330
|
+
|
331
|
+
this.setImages(imagesUpdate);
|
332
|
+
};
|
333
|
+
|
175
334
|
renderAttachment(a, i) {
|
176
335
|
return (
|
177
336
|
<Components.Attachment
|
@@ -184,6 +343,57 @@ class RequestNotes extends Component {
|
|
184
343
|
);
|
185
344
|
}
|
186
345
|
|
346
|
+
renderPlayableImageUrl(images, index, containerStyle) {
|
347
|
+
const url = images[index];
|
348
|
+
const thumbUrl = Helper.getThumb300(url);
|
349
|
+
|
350
|
+
if (Helper.isVideo(url)) {
|
351
|
+
return (
|
352
|
+
<ImageBackground style={[{ flex: 1 }, containerStyle]} source={{ uri: thumbUrl }}>
|
353
|
+
<View style={styles.imagePlayContainer}>
|
354
|
+
<TouchableOpacity onPress={this.toggleFullscreenVideo.bind(this, url)}>
|
355
|
+
<Icon name="play" type="font-awesome" iconStyle={styles.imageControlIcon} />
|
356
|
+
</TouchableOpacity>
|
357
|
+
</View>
|
358
|
+
</ImageBackground>
|
359
|
+
);
|
360
|
+
}
|
361
|
+
|
362
|
+
const imageUrl = Helper.get1400(url);
|
363
|
+
return (
|
364
|
+
<TouchableOpacity style={containerStyle} onPress={this.openGallery.bind(this, images, index || 0)}>
|
365
|
+
<ImageBackground resizeMode='cover' style={styles.imageContainer} source={{ uri: imageUrl }} />
|
366
|
+
</TouchableOpacity>
|
367
|
+
);
|
368
|
+
}
|
369
|
+
|
370
|
+
renderImages(note) {
|
371
|
+
if (!note) return null
|
372
|
+
if (!_.isNil(note.Images) && !_.isEmpty(note.Images)) {
|
373
|
+
return (
|
374
|
+
<ScrollView horizontal style={styles.sideBySideImages}>
|
375
|
+
{note.Images.map((_p, index) =>
|
376
|
+
this.renderPlayableImageUrl(note.Images, index, styles.sideBySideImageContainer),
|
377
|
+
)}
|
378
|
+
</ScrollView>
|
379
|
+
);
|
380
|
+
}
|
381
|
+
return null;
|
382
|
+
}
|
383
|
+
|
384
|
+
renderImagePopup() {
|
385
|
+
const { galleryOpen, galleryImages, galleryIndex } = this.state;
|
386
|
+
console.log('renderimagepopup', { galleryOpen, galleryImages, galleryIndex });
|
387
|
+
return (
|
388
|
+
<Components.ImagePopup
|
389
|
+
visible={galleryOpen}
|
390
|
+
images={galleryImages}
|
391
|
+
index={galleryIndex}
|
392
|
+
onClose={this.closeGallery.bind(this)}
|
393
|
+
/>
|
394
|
+
);
|
395
|
+
}
|
396
|
+
|
187
397
|
renderNote(n) {
|
188
398
|
return (
|
189
399
|
<View style={styles.noteContainer} key={n.Id}>
|
@@ -219,6 +429,7 @@ class RequestNotes extends Component {
|
|
219
429
|
</View>
|
220
430
|
<Text style={styles.noteContainerText}>{n.Note}</Text>
|
221
431
|
{(n.Attachments || []).map((a, i) => this.renderAttachment(a, i))}
|
432
|
+
{this.renderImages(n)}
|
222
433
|
<Text style={styles.noteTimestamp}>
|
223
434
|
{moment
|
224
435
|
.utc(n.Timestamp)
|
@@ -272,10 +483,118 @@ class RequestNotes extends Component {
|
|
272
483
|
);
|
273
484
|
}
|
274
485
|
|
486
|
+
renderUploadMenu() {
|
487
|
+
return (
|
488
|
+
<Components.ImageUploader
|
489
|
+
ref={ref => (this.imageUploader = ref)}
|
490
|
+
onUploadStarted={this.onUploadStarted}
|
491
|
+
onUploadSuccess={this.onUploadSuccess}
|
492
|
+
onUploadFailed={this.onUploadFailed}
|
493
|
+
onUploadProgress={this.onUploadProgress}
|
494
|
+
onLibrarySelected={this.onLibrarySelected}
|
495
|
+
size={{ width: 1400 }}
|
496
|
+
quality={0.8}
|
497
|
+
fileName={'serviceNoteImage'}
|
498
|
+
popupTitle={'Upload Image'}
|
499
|
+
userId={this.props.user.uid}
|
500
|
+
allowsEditing={false}
|
501
|
+
multiple
|
502
|
+
hideLibrary
|
503
|
+
/>
|
504
|
+
);
|
505
|
+
}
|
506
|
+
|
507
|
+
renderImage(item, index) {
|
508
|
+
const isVideoUrl = Helper.isVideo(item.url);
|
509
|
+
const imagesList = this.getImages();
|
510
|
+
|
511
|
+
if (item.add) {
|
512
|
+
return (
|
513
|
+
<TouchableOpacity activeOpacity={0.8} onPress={() => this.showUploadMenu()}>
|
514
|
+
<View
|
515
|
+
style={[
|
516
|
+
styles.imageContainer,
|
517
|
+
imagesList.length > 1 && styles.imageContainerNotEmpty,
|
518
|
+
index % 3 === 0 && { marginLeft: 0 },
|
519
|
+
index > 2 && { marginTop: 8 },
|
520
|
+
]}
|
521
|
+
>
|
522
|
+
<View style={styles.imageCircle}>
|
523
|
+
<Icon name="camera" type="font-awesome" iconStyle={styles.addImageIcon} />
|
524
|
+
</View>
|
525
|
+
</View>
|
526
|
+
</TouchableOpacity>
|
527
|
+
);
|
528
|
+
}
|
529
|
+
return (
|
530
|
+
<View
|
531
|
+
style={[
|
532
|
+
styles.imageContainer,
|
533
|
+
imagesList.length > 1 && styles.imageContainerNotEmpty,
|
534
|
+
index % 3 === 0 && { marginLeft: 0 },
|
535
|
+
index > 2 && { marginTop: 8 },
|
536
|
+
]}
|
537
|
+
>
|
538
|
+
{item.uploading ? (
|
539
|
+
<Components.ImageUploadProgress uploader={this.imageUploader} image={item} color={this.props.colourBrandingMain} />
|
540
|
+
) : (
|
541
|
+
<ImageBackground
|
542
|
+
style={styles.imageBackground}
|
543
|
+
source={Helper.getImageSource(item.thumbNailExists ? item.thumbNailUrl : (item.url || item))}
|
544
|
+
>
|
545
|
+
{isVideoUrl && (
|
546
|
+
<View style={styles.imagePlayContainer}>
|
547
|
+
<TouchableOpacity onPress={this.toggleFullscreenVideo.bind(this, item.url)}>
|
548
|
+
<Icon name="play" type="font-awesome" iconStyle={styles.imageControlIcon} />
|
549
|
+
</TouchableOpacity>
|
550
|
+
</View>
|
551
|
+
)}
|
552
|
+
<TouchableOpacity style={styles.removeImage} onPress={() => this.removeImage(index)}>
|
553
|
+
<Icon name="remove" type="font-awesome" iconStyle={styles.imageControlIcon} style={styles.removeImage} />
|
554
|
+
</TouchableOpacity>
|
555
|
+
</ImageBackground>
|
556
|
+
)}
|
557
|
+
</View>
|
558
|
+
);
|
559
|
+
}
|
560
|
+
|
561
|
+
renderImageList() {
|
562
|
+
const imagesList = this.getImages();
|
563
|
+
|
564
|
+
return (
|
565
|
+
<View style={styles.imageListContainer}>
|
566
|
+
<FlatList
|
567
|
+
keyboardShouldPersistTaps="always"
|
568
|
+
enableEmptySections
|
569
|
+
data={imagesList}
|
570
|
+
renderItem={({ item, index }) => this.renderImage(item, index)}
|
571
|
+
keyExtractor={(item, index) => index}
|
572
|
+
numColumns={3}
|
573
|
+
scrollEnabled={false}
|
574
|
+
/>
|
575
|
+
</View>
|
576
|
+
);
|
577
|
+
}
|
578
|
+
|
579
|
+
renderVideoPlayerPopup() {
|
580
|
+
const { showFullscreenVideo, currentVideoUrl } = this.state;
|
581
|
+
if (!currentVideoUrl) return;
|
582
|
+
|
583
|
+
return (
|
584
|
+
<Components.VideoPopup
|
585
|
+
uri={currentVideoUrl}
|
586
|
+
visible={showFullscreenVideo}
|
587
|
+
showFullscreenButton={false}
|
588
|
+
onClose={this.toggleFullscreenVideo}
|
589
|
+
/>
|
590
|
+
);
|
591
|
+
}
|
592
|
+
|
275
593
|
renderAdd() {
|
276
594
|
return (
|
277
595
|
<Modal animationType="slide" visible={this.state.addNoteOpen}>
|
278
596
|
<KeyboardAvoidingView style={styles.container} behavior={Platform.OS === 'ios' && 'padding'}>
|
597
|
+
{this.renderUploadMenu()}
|
279
598
|
<Components.Header leftText="Cancel" onPressLeft={this.closeAddNote} text="" />
|
280
599
|
<ScrollView style={styles.scrollContainer} contentContainerStyle={styles.innerContainer}>
|
281
600
|
<Components.TextStyle type="pageHeading">Add Staff Note</Components.TextStyle>
|
@@ -297,6 +616,7 @@ class RequestNotes extends Component {
|
|
297
616
|
sectionStyle={styles.inputSection}
|
298
617
|
/>
|
299
618
|
<Components.GenericInputSection label="Attachments" sectionStyle={styles.inputSection}>
|
619
|
+
{this.renderImageList()}
|
300
620
|
{this.state.editingNote ? (
|
301
621
|
(this.state.noteAttachments || []).map((a, i) => this.renderAttachment(a, i))
|
302
622
|
) : (
|
@@ -307,6 +627,7 @@ class RequestNotes extends Component {
|
|
307
627
|
</Components.GenericInputSection>
|
308
628
|
</ScrollView>
|
309
629
|
<View style={styles.popupFooter}>{this.renderFooterContent()}</View>
|
630
|
+
{this.renderVideoPlayerPopup()}
|
310
631
|
</KeyboardAvoidingView>
|
311
632
|
</Modal>
|
312
633
|
);
|
@@ -323,6 +644,7 @@ class RequestNotes extends Component {
|
|
323
644
|
{this.renderNotes()}
|
324
645
|
</ScrollView>
|
325
646
|
<Components.AddButton onPress={this.openAddNote} />
|
647
|
+
{this.renderImagePopup()}
|
326
648
|
</View>
|
327
649
|
);
|
328
650
|
}
|
@@ -404,6 +726,83 @@ const styles = {
|
|
404
726
|
attachmentInfo: {
|
405
727
|
marginTop: 8,
|
406
728
|
},
|
729
|
+
imageListContainer: {
|
730
|
+
marginVertical: 8,
|
731
|
+
},
|
732
|
+
imageContainer: {
|
733
|
+
width: PHOTO_SIZE,
|
734
|
+
height: PHOTO_SIZE,
|
735
|
+
borderStyle: 'dashed',
|
736
|
+
justifyContent: 'center',
|
737
|
+
alignItems: 'center',
|
738
|
+
borderWidth: 1,
|
739
|
+
borderColor: Colours.LINEGREY,
|
740
|
+
backgroundColor: Colours.BOXGREY,
|
741
|
+
borderRadius: 4,
|
742
|
+
marginLeft: 8,
|
743
|
+
},
|
744
|
+
imageContainerNotEmpty: {
|
745
|
+
borderWidth: 1,
|
746
|
+
borderColor: Colours.LINEGREY,
|
747
|
+
backgroundColor: '#fff',
|
748
|
+
borderStyle: 'dashed',
|
749
|
+
},
|
750
|
+
imageBackground: {
|
751
|
+
flex: 1,
|
752
|
+
height: '100%',
|
753
|
+
width: '100%',
|
754
|
+
borderRadius: 4,
|
755
|
+
},
|
756
|
+
imageCircle: {
|
757
|
+
width: 90,
|
758
|
+
height: 90,
|
759
|
+
borderRadius: 45,
|
760
|
+
backgroundColor: Colours.PINKISH_GREY,
|
761
|
+
justifyContent: 'center',
|
762
|
+
},
|
763
|
+
addImageIcon: {
|
764
|
+
color: '#fff',
|
765
|
+
fontSize: 32,
|
766
|
+
},
|
767
|
+
imagePlayContainer: {
|
768
|
+
position: 'absolute',
|
769
|
+
top: 0,
|
770
|
+
left: 0,
|
771
|
+
right: 0,
|
772
|
+
bottom: 0,
|
773
|
+
alignItems: 'center',
|
774
|
+
justifyContent: 'center',
|
775
|
+
},
|
776
|
+
imageControlIcon: {
|
777
|
+
color: '#fff',
|
778
|
+
fontSize: 20,
|
779
|
+
textShadowColor: 'rgba(0,0,0,0.3)',
|
780
|
+
textShadowOffset: { width: 2, height: 2 },
|
781
|
+
},
|
782
|
+
removeImage: {
|
783
|
+
position: 'absolute',
|
784
|
+
top: 0,
|
785
|
+
right: 0,
|
786
|
+
padding: 4,
|
787
|
+
width: 40,
|
788
|
+
height: 40,
|
789
|
+
alignItems: 'center',
|
790
|
+
justifyContent: 'center',
|
791
|
+
},
|
792
|
+
sideBySideImages: {
|
793
|
+
flex: 1,
|
794
|
+
flexDirection: 'row',
|
795
|
+
marginTop: 12,
|
796
|
+
marginHorizontal: -8,
|
797
|
+
},
|
798
|
+
sideBySideImageContainer: {
|
799
|
+
backgroundColor: '#fff',
|
800
|
+
width: 60,
|
801
|
+
height: 50,
|
802
|
+
borderRadius: 2,
|
803
|
+
overflow: 'hidden',
|
804
|
+
marginRight: 2,
|
805
|
+
},
|
407
806
|
};
|
408
807
|
|
409
808
|
const mapStateToProps = state => {
|
package/src/values.config.a.js
CHANGED
@@ -8,6 +8,9 @@ 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',
|
11
14
|
screenMaintenance: 'maintenanceA',
|
12
15
|
screenRequestDetail: 'requestDetailA',
|
13
16
|
screenServiceRequest: 'serviceRequestA',
|
@@ -26,6 +29,8 @@ const values = {
|
|
26
29
|
textMoreMenuTitle: 'Request A',
|
27
30
|
textKioskActionTitle: 'Request A',
|
28
31
|
textEntityName: 'Job',
|
32
|
+
stringConfigJobStatus: 'maintenanceJobStatusA',
|
33
|
+
stringConfigHideSeen: 'maintenanceDisableSeenA',
|
29
34
|
};
|
30
35
|
|
31
36
|
export { values };
|
@@ -8,6 +8,9 @@ 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',
|
11
14
|
screenMaintenance: 'maintenance',
|
12
15
|
screenRequestDetail: 'requestDetail',
|
13
16
|
screenServiceRequest: 'serviceRequest',
|
@@ -32,6 +35,8 @@ const values = {
|
|
32
35
|
emptyRequestsStaff: 'No active Requests',
|
33
36
|
emptyRequestsUser: 'Your Requests will show here',
|
34
37
|
forceCustomFields: false,
|
38
|
+
stringConfigJobStatus: 'maintenanceJobStatus',
|
39
|
+
stringConfigHideSeen: 'maintenanceDisableSeen',
|
35
40
|
};
|
36
41
|
|
37
42
|
export { values };
|
@@ -8,6 +8,9 @@ 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',
|
11
14
|
screenMaintenance: 'maintenanceForms',
|
12
15
|
screenRequestDetail: 'requestDetailForms',
|
13
16
|
screenServiceRequest: 'serviceRequestForms',
|
@@ -32,6 +35,8 @@ const values = {
|
|
32
35
|
emptyRequestsStaff: 'No active Form Submissions',
|
33
36
|
emptyRequestsUser: 'Your Form Submissions will show here',
|
34
37
|
forceCustomFields: true,
|
38
|
+
stringConfigJobStatus: 'maintenanceJobStatusForms',
|
39
|
+
stringConfigHideSeen: 'maintenanceDisableSeenForms',
|
35
40
|
};
|
36
41
|
|
37
42
|
export { values };
|
package/src/values.config.js
CHANGED
@@ -8,6 +8,9 @@ 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',
|
11
14
|
screenMaintenance: 'maintenance',
|
12
15
|
screenRequestDetail: 'requestDetail',
|
13
16
|
screenServiceRequest: 'serviceRequest',
|
@@ -32,6 +35,8 @@ const values = {
|
|
32
35
|
emptyRequestsStaff: 'No active Requests',
|
33
36
|
emptyRequestsUser: 'Your Requests will show here',
|
34
37
|
forceCustomFields: false,
|
38
|
+
stringConfigJobStatus: 'maintenanceJobStatus',
|
39
|
+
stringConfigHideSeen: 'maintenanceDisableSeen',
|
35
40
|
};
|
36
41
|
|
37
42
|
export { values };
|