@plusscommunities/pluss-maintenance-app-forms 6.0.12 → 7.0.0-auth.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.
- package/dist/module/components/MaintenanceListItem.js +1 -1
- package/dist/module/components/MaintenanceListItem.js.map +1 -1
- package/dist/module/components/MaintenanceWidgetItem.js +1 -1
- package/dist/module/components/MaintenanceWidgetItem.js.map +1 -1
- package/dist/module/screens/JobTypePicker.js +1 -1
- package/dist/module/screens/JobTypePicker.js.map +1 -1
- package/dist/module/screens/RequestDetail.js +1 -1
- package/dist/module/screens/RequestDetail.js.map +1 -1
- package/dist/module/screens/RequestNotes.js +1 -1
- package/dist/module/screens/RequestNotes.js.map +1 -1
- package/dist/module/screens/ServiceRequest.js +1 -1
- package/dist/module/screens/ServiceRequest.js.map +1 -1
- package/package.json +13 -8
- package/src/components/MaintenanceListItem.js +1 -1
- package/src/components/MaintenanceWidgetItem.js +1 -1
- package/src/screens/JobTypePicker.js +1 -1
- package/src/screens/RequestDetail.js +1 -1
- package/src/screens/RequestNotes.js +37 -37
- package/src/screens/ServiceRequest.js +2 -2
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
ScrollView,
|
|
4
|
+
View,
|
|
5
|
+
Text,
|
|
6
|
+
TouchableOpacity,
|
|
7
|
+
Modal,
|
|
8
|
+
KeyboardAvoidingView,
|
|
9
|
+
Platform,
|
|
10
|
+
FlatList,
|
|
11
|
+
Dimensions,
|
|
12
|
+
ImageBackground,
|
|
13
|
+
Keyboard,
|
|
14
|
+
} from 'react-native';
|
|
3
15
|
import { connect } from 'react-redux';
|
|
4
|
-
import { Icon } from '
|
|
16
|
+
import { Icon } from '@rneui/themed';
|
|
5
17
|
import _ from 'lodash';
|
|
6
18
|
import moment from 'moment';
|
|
7
19
|
import { jobAdded } from '../actions';
|
|
@@ -28,7 +40,7 @@ class RequestNotes extends Component {
|
|
|
28
40
|
uploadingImage: false,
|
|
29
41
|
galleryOpen: false,
|
|
30
42
|
galleryImages: [],
|
|
31
|
-
galleryIndex: 0
|
|
43
|
+
galleryIndex: 0,
|
|
32
44
|
};
|
|
33
45
|
this.checkThumb = null;
|
|
34
46
|
}
|
|
@@ -97,7 +109,11 @@ class RequestNotes extends Component {
|
|
|
97
109
|
const uploadingAttachments = _.some(this.state.noteAttachments, n => n.Uploading);
|
|
98
110
|
const uploadingImages = _.some(this.state.noteImages, n => n.uploading);
|
|
99
111
|
if (uploadingAttachments || uploadingImages) return false;
|
|
100
|
-
return
|
|
112
|
+
return (
|
|
113
|
+
!_.isEmpty(this.state.noteInput) ||
|
|
114
|
+
!_.isEmpty(this.state.noteAttachments) ||
|
|
115
|
+
!_.isEmpty(this.state.noteImages.filter(img => !img.add))
|
|
116
|
+
);
|
|
101
117
|
};
|
|
102
118
|
|
|
103
119
|
openAddNote = () => {
|
|
@@ -121,7 +137,7 @@ class RequestNotes extends Component {
|
|
|
121
137
|
};
|
|
122
138
|
|
|
123
139
|
openEditNote = n => {
|
|
124
|
-
const noteImages = [...(
|
|
140
|
+
const noteImages = [...(n.Images || []).map(i => ({ url: i, thumbNailUrl: Helper.getThumb300(i) })), { add: true }];
|
|
125
141
|
this.setState({
|
|
126
142
|
noteAttachments: n.Attachments || [],
|
|
127
143
|
noteImages,
|
|
@@ -139,27 +155,18 @@ class RequestNotes extends Component {
|
|
|
139
155
|
|
|
140
156
|
try {
|
|
141
157
|
this.setState({ submittingNote: true });
|
|
142
|
-
const attachments = this.state.noteAttachments
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
158
|
+
const attachments = this.state.noteAttachments
|
|
159
|
+
.filter(a => !a.add)
|
|
160
|
+
.map(a => {
|
|
161
|
+
return {
|
|
162
|
+
Title: a.Title,
|
|
163
|
+
Source: a.Source,
|
|
164
|
+
};
|
|
165
|
+
});
|
|
148
166
|
const images = this.state.noteImages.filter(img => !img.add).map(img => img.url);
|
|
149
167
|
const res = await (this.state.editingNote
|
|
150
|
-
? maintenanceActions.editNote(
|
|
151
|
-
|
|
152
|
-
this.state.editingNote,
|
|
153
|
-
this.state.noteInput,
|
|
154
|
-
attachments,
|
|
155
|
-
images,
|
|
156
|
-
)
|
|
157
|
-
: maintenanceActions.addNote(
|
|
158
|
-
this.props.job.id,
|
|
159
|
-
this.state.noteInput,
|
|
160
|
-
attachments,
|
|
161
|
-
images,
|
|
162
|
-
));
|
|
168
|
+
? maintenanceActions.editNote(this.props.job.id, this.state.editingNote, this.state.noteInput, attachments, images)
|
|
169
|
+
: maintenanceActions.addNote(this.props.job.id, this.state.noteInput, attachments, images));
|
|
163
170
|
this.setState(
|
|
164
171
|
{
|
|
165
172
|
job: res.data.job,
|
|
@@ -238,7 +245,7 @@ class RequestNotes extends Component {
|
|
|
238
245
|
}, 2000);
|
|
239
246
|
};
|
|
240
247
|
|
|
241
|
-
removeImage =
|
|
248
|
+
removeImage = index => {
|
|
242
249
|
const imagesUpdate = this.getImages();
|
|
243
250
|
imagesUpdate.splice(index, 1);
|
|
244
251
|
|
|
@@ -362,19 +369,17 @@ class RequestNotes extends Component {
|
|
|
362
369
|
const imageUrl = Helper.get1400(url);
|
|
363
370
|
return (
|
|
364
371
|
<TouchableOpacity style={containerStyle} onPress={this.openGallery.bind(this, images, index || 0)}>
|
|
365
|
-
<ImageBackground resizeMode=
|
|
372
|
+
<ImageBackground resizeMode="cover" style={styles.imageContainer} source={{ uri: imageUrl }} />
|
|
366
373
|
</TouchableOpacity>
|
|
367
374
|
);
|
|
368
375
|
}
|
|
369
376
|
|
|
370
377
|
renderImages(note) {
|
|
371
|
-
if (!note) return null
|
|
378
|
+
if (!note) return null;
|
|
372
379
|
if (!_.isNil(note.Images) && !_.isEmpty(note.Images)) {
|
|
373
380
|
return (
|
|
374
381
|
<ScrollView horizontal style={styles.sideBySideImages}>
|
|
375
|
-
{note.Images.map((_p, index) =>
|
|
376
|
-
this.renderPlayableImageUrl(note.Images, index, styles.sideBySideImageContainer),
|
|
377
|
-
)}
|
|
382
|
+
{note.Images.map((_p, index) => this.renderPlayableImageUrl(note.Images, index, styles.sideBySideImageContainer))}
|
|
378
383
|
</ScrollView>
|
|
379
384
|
);
|
|
380
385
|
}
|
|
@@ -385,12 +390,7 @@ class RequestNotes extends Component {
|
|
|
385
390
|
const { galleryOpen, galleryImages, galleryIndex } = this.state;
|
|
386
391
|
console.log('renderimagepopup', { galleryOpen, galleryImages, galleryIndex });
|
|
387
392
|
return (
|
|
388
|
-
<Components.ImagePopup
|
|
389
|
-
visible={galleryOpen}
|
|
390
|
-
images={galleryImages}
|
|
391
|
-
index={galleryIndex}
|
|
392
|
-
onClose={this.closeGallery.bind(this)}
|
|
393
|
-
/>
|
|
393
|
+
<Components.ImagePopup visible={galleryOpen} images={galleryImages} index={galleryIndex} onClose={this.closeGallery.bind(this)} />
|
|
394
394
|
);
|
|
395
395
|
}
|
|
396
396
|
|
|
@@ -540,7 +540,7 @@ class RequestNotes extends Component {
|
|
|
540
540
|
) : (
|
|
541
541
|
<ImageBackground
|
|
542
542
|
style={styles.imageBackground}
|
|
543
|
-
source={Helper.getImageSource(item.thumbNailExists ? item.thumbNailUrl :
|
|
543
|
+
source={Helper.getImageSource(item.thumbNailExists ? item.thumbNailUrl : item.url || item)}
|
|
544
544
|
>
|
|
545
545
|
{isVideoUrl && (
|
|
546
546
|
<View style={styles.imagePlayContainer}>
|
|
@@ -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 '
|
|
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) {
|