@plusscommunities/pluss-maintenance-app 8.0.8 → 8.0.9-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.
- package/dist/module/actions/JobActions.js +4 -4
- package/dist/module/actions/JobActions.js.map +1 -1
- package/dist/module/actions/index.js +1 -1
- package/dist/module/actions/index.js.map +1 -1
- package/dist/module/actions/types.js +1 -1
- package/dist/module/actions/types.js.map +1 -1
- package/dist/module/apis/index.js +3 -3
- package/dist/module/apis/index.js.map +1 -1
- package/dist/module/apis/maintenanceActions.js +36 -36
- package/dist/module/apis/maintenanceActions.js.map +1 -1
- package/dist/module/apis/userActions.js +5 -5
- package/dist/module/apis/userActions.js.map +1 -1
- package/dist/module/components/FilterPopupMenu.js +49 -49
- package/dist/module/components/FilterPopupMenu.js.map +1 -1
- package/dist/module/components/MaintenanceList.js +38 -38
- package/dist/module/components/MaintenanceList.js.map +1 -1
- package/dist/module/components/MaintenanceListItem.js +62 -62
- package/dist/module/components/MaintenanceListItem.js.map +1 -1
- package/dist/module/components/MaintenanceWidgetItem.js +27 -27
- package/dist/module/components/MaintenanceWidgetItem.js.map +1 -1
- package/dist/module/components/PrioritySelectorPopup.js +15 -15
- package/dist/module/components/PrioritySelectorPopup.js.map +1 -1
- package/dist/module/components/StatusSelectorPopup.js +16 -16
- package/dist/module/components/StatusSelectorPopup.js.map +1 -1
- package/dist/module/components/WidgetLarge.js +2 -2
- package/dist/module/components/WidgetLarge.js.map +1 -1
- package/dist/module/components/WidgetSmall.js +19 -19
- package/dist/module/components/WidgetSmall.js.map +1 -1
- package/dist/module/core.config.js +1 -1
- package/dist/module/core.config.js.map +1 -1
- package/dist/module/feature.config.js +17 -17
- package/dist/module/feature.config.js.map +1 -1
- package/dist/module/helper.js +10 -10
- package/dist/module/helper.js.map +1 -1
- package/dist/module/index.js +11 -11
- package/dist/module/index.js.map +1 -1
- package/dist/module/reducers/JobsReducer.js +13 -13
- package/dist/module/reducers/JobsReducer.js.map +1 -1
- package/dist/module/screens/JobTypePicker.js +17 -17
- package/dist/module/screens/JobTypePicker.js.map +1 -1
- package/dist/module/screens/MaintenancePage.js +10 -10
- package/dist/module/screens/MaintenancePage.js.map +1 -1
- package/dist/module/screens/MaintenanceUserPicker.js +121 -24
- package/dist/module/screens/MaintenanceUserPicker.js.map +1 -1
- package/dist/module/screens/RequestDetail.js +147 -149
- package/dist/module/screens/RequestDetail.js.map +1 -1
- package/dist/module/screens/RequestNotes.js +59 -59
- package/dist/module/screens/RequestNotes.js.map +1 -1
- package/dist/module/screens/ServiceRequest.js +196 -194
- package/dist/module/screens/ServiceRequest.js.map +1 -1
- package/dist/module/values.config.a.js +31 -30
- package/dist/module/values.config.a.js.map +1 -1
- package/dist/module/values.config.default.js +35 -34
- package/dist/module/values.config.default.js.map +1 -1
- package/dist/module/values.config.enquiry.js +35 -34
- package/dist/module/values.config.enquiry.js.map +1 -1
- package/dist/module/values.config.feedback.js +35 -34
- package/dist/module/values.config.feedback.js.map +1 -1
- package/dist/module/values.config.food.js +35 -34
- package/dist/module/values.config.food.js.map +1 -1
- package/dist/module/values.config.forms.js +34 -34
- package/dist/module/values.config.forms.js.map +1 -1
- package/dist/module/values.config.js +35 -34
- package/dist/module/values.config.js.map +1 -1
- package/package.json +52 -53
- package/src/actions/JobActions.js +60 -67
- package/src/actions/index.js +1 -1
- package/src/actions/types.js +2 -1
- package/src/apis/index.js +3 -3
- package/src/apis/maintenanceActions.js +178 -189
- package/src/apis/userActions.js +17 -17
- package/src/components/FilterPopupMenu.js +256 -313
- package/src/components/MaintenanceList.js +317 -396
- package/src/components/MaintenanceListItem.js +288 -347
- package/src/components/MaintenanceWidgetItem.js +124 -145
- package/src/components/PrioritySelectorPopup.js +68 -81
- package/src/components/StatusSelectorPopup.js +70 -81
- package/src/components/WidgetLarge.js +5 -5
- package/src/components/WidgetSmall.js +133 -153
- package/src/core.config.js +3 -27
- package/src/feature.config.js +62 -62
- package/src/helper.js +53 -58
- package/src/index.js +22 -22
- package/src/reducers/JobsReducer.js +66 -85
- package/src/screens/JobTypePicker.js +92 -115
- package/src/screens/MaintenancePage.js +80 -89
- package/src/screens/MaintenanceUserPicker.js +186 -117
- package/src/screens/RequestDetail.js +1125 -1347
- package/src/screens/RequestNotes.js +806 -947
- package/src/screens/ServiceRequest.js +1557 -1783
- package/src/values.config.a.js +34 -33
- package/src/values.config.default.js +40 -39
- package/src/values.config.enquiry.js +40 -39
- package/src/values.config.feedback.js +40 -39
- package/src/values.config.food.js +40 -39
- package/src/values.config.forms.js +39 -39
- package/src/values.config.js +40 -39
|
@@ -1,26 +1,26 @@
|
|
|
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
|
|
5
|
-
import { Dimensions, Platform, KeyboardAvoidingView, ScrollView, Text, TouchableOpacity, View, Switch, FlatList, ImageBackground, Keyboard } from
|
|
6
|
-
import DateTimePicker from
|
|
7
|
-
import { Icon } from
|
|
8
|
-
import _ from
|
|
9
|
-
import moment from
|
|
10
|
-
import { connect } from
|
|
11
|
-
import { jobAdded } from
|
|
12
|
-
import { maintenanceActions, userActions } from
|
|
13
|
-
import { Services } from
|
|
14
|
-
import { Components, Colours, Helper, Config } from
|
|
15
|
-
import { values } from
|
|
16
|
-
const PHOTO_SIZE = (Dimensions.get(
|
|
4
|
+
import React, { Component } from 'react';
|
|
5
|
+
import { Dimensions, Platform, KeyboardAvoidingView, ScrollView, Text, TouchableOpacity, View, Switch, FlatList, ImageBackground, Keyboard } from 'react-native';
|
|
6
|
+
import DateTimePicker from 'react-native-modal-datetime-picker';
|
|
7
|
+
import { Icon } from 'react-native-elements';
|
|
8
|
+
import _ from 'lodash';
|
|
9
|
+
import moment from 'moment';
|
|
10
|
+
import { connect } from 'react-redux';
|
|
11
|
+
import { jobAdded } from '../actions';
|
|
12
|
+
import { maintenanceActions, userActions } from '../apis';
|
|
13
|
+
import { Services } from '../feature.config';
|
|
14
|
+
import { Components, Colours, Helper, Config } from '../core.config';
|
|
15
|
+
import { values } from '../values.config';
|
|
16
|
+
const PHOTO_SIZE = (Dimensions.get('window').width - 64) / 3;
|
|
17
17
|
class MaintenanceRequest extends Component {
|
|
18
18
|
constructor(props) {
|
|
19
19
|
super(props);
|
|
20
20
|
_defineProperty(this, "checkUserPermissions", async () => {
|
|
21
21
|
var _this$props$permissio;
|
|
22
22
|
// PC-1255: Check if user has userManagement permission
|
|
23
|
-
const hasUserManagement = ((_this$props$permissio = this.props.permissions) === null || _this$props$permissio === void 0 ? void 0 : _this$props$permissio.includes(
|
|
23
|
+
const hasUserManagement = ((_this$props$permissio = this.props.permissions) === null || _this$props$permissio === void 0 ? void 0 : _this$props$permissio.includes('userManagement')) || false;
|
|
24
24
|
if (hasUserManagement) {
|
|
25
25
|
this.setState({
|
|
26
26
|
canCreateOnBehalf: true
|
|
@@ -35,19 +35,22 @@ class MaintenanceRequest extends Component {
|
|
|
35
35
|
_defineProperty(this, "loadSiteUsers", async () => {
|
|
36
36
|
try {
|
|
37
37
|
const response = await userActions.getSiteUsers(this.props.site);
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
let items = response.data.Items || [];
|
|
39
|
+
if (this.props.optionOnlyForResidents) {
|
|
40
|
+
items = _.filter(items, u => u.category === 'resident');
|
|
41
|
+
}
|
|
42
|
+
const users = _.sortBy(items, u => (u.displayName || '').toLowerCase());
|
|
40
43
|
this.setState({
|
|
41
44
|
users
|
|
42
45
|
});
|
|
43
46
|
} catch (error) {
|
|
44
|
-
console.log(
|
|
47
|
+
console.log('Error loading site users:', error);
|
|
45
48
|
// Fall back to default user if loading fails
|
|
46
49
|
this.setDefaultUser();
|
|
47
50
|
}
|
|
48
51
|
});
|
|
49
52
|
_defineProperty(this, "setDefaultUser", () => {
|
|
50
|
-
if (this.props.userType !==
|
|
53
|
+
if (this.props.userType !== 'KIOSK') {
|
|
51
54
|
const defaultUser = {
|
|
52
55
|
userId: this.props.uid,
|
|
53
56
|
displayName: this.props.displayName,
|
|
@@ -57,7 +60,7 @@ class MaintenanceRequest extends Component {
|
|
|
57
60
|
selectedUser: defaultUser,
|
|
58
61
|
userName: this.props.displayName,
|
|
59
62
|
roomNumber: this.props.unit,
|
|
60
|
-
phone: !_.isEmpty(this.props.phoneNumber) ? this.props.phoneNumber :
|
|
63
|
+
phone: !_.isEmpty(this.props.phoneNumber) ? this.props.phoneNumber : ''
|
|
61
64
|
});
|
|
62
65
|
}
|
|
63
66
|
});
|
|
@@ -65,7 +68,7 @@ class MaintenanceRequest extends Component {
|
|
|
65
68
|
const update = {
|
|
66
69
|
userName
|
|
67
70
|
};
|
|
68
|
-
if (!this.state.customFields || !_.some(this.state.customFields,
|
|
71
|
+
if (!this.state.customFields || !_.some(this.state.customFields, 'isTitle')) {
|
|
69
72
|
update.title = userName;
|
|
70
73
|
}
|
|
71
74
|
this.setState(update);
|
|
@@ -103,18 +106,18 @@ class MaintenanceRequest extends Component {
|
|
|
103
106
|
if (userDetails.unit) {
|
|
104
107
|
update.roomNumber = userDetails.unit;
|
|
105
108
|
}
|
|
106
|
-
if (!this.state.customFields || !_.some(this.state.customFields,
|
|
109
|
+
if (!this.state.customFields || !_.some(this.state.customFields, 'isTitle')) {
|
|
107
110
|
update.title = userDetails.displayName || null;
|
|
108
111
|
}
|
|
109
112
|
}
|
|
110
113
|
} catch (error) {
|
|
111
114
|
// Permission denied (403) or other error - continue without auto-population
|
|
112
115
|
// User can still manually enter contact details
|
|
113
|
-
console.log(
|
|
116
|
+
console.log('Could not fetch user details for auto-population:', error);
|
|
114
117
|
} finally {
|
|
115
118
|
// In any case, we still need a title. Inform the user to set one form field as a title.
|
|
116
119
|
if (!state.title && !update.title) {
|
|
117
|
-
update.title =
|
|
120
|
+
update.title = '[Missing title - Set one of the form field as title in the community manager]';
|
|
118
121
|
}
|
|
119
122
|
}
|
|
120
123
|
this.setState(update);
|
|
@@ -143,7 +146,7 @@ class MaintenanceRequest extends Component {
|
|
|
143
146
|
};
|
|
144
147
|
const field = update.customFields[fieldId];
|
|
145
148
|
field.answer = _.xor(field.answer || [], [answer]);
|
|
146
|
-
if (field.isTitle) update.title = field.answer.join(
|
|
149
|
+
if (field.isTitle) update.title = field.answer.join(', ');
|
|
147
150
|
this.setState(update);
|
|
148
151
|
});
|
|
149
152
|
_defineProperty(this, "onOpenDatePicker", (field, fieldId) => {
|
|
@@ -176,12 +179,12 @@ class MaintenanceRequest extends Component {
|
|
|
176
179
|
};
|
|
177
180
|
const field = update.customFields[dateFieldId];
|
|
178
181
|
const dateObj = moment(date);
|
|
179
|
-
if (popUpType ===
|
|
180
|
-
field.answer = dateObj.format(
|
|
181
|
-
if (field.isTitle) update.title = dateObj.format(
|
|
182
|
+
if (popUpType === 'date') {
|
|
183
|
+
field.answer = dateObj.format('YYYY-MM-DD');
|
|
184
|
+
if (field.isTitle) update.title = dateObj.format('DD MMM YYYY');
|
|
182
185
|
} else {
|
|
183
|
-
field.answer = dateObj.format(
|
|
184
|
-
if (field.isTitle) update.title = dateObj.format(
|
|
186
|
+
field.answer = dateObj.format('HH:mm');
|
|
187
|
+
if (field.isTitle) update.title = dateObj.format('h:mm a');
|
|
185
188
|
}
|
|
186
189
|
this.setState(update);
|
|
187
190
|
});
|
|
@@ -192,7 +195,7 @@ class MaintenanceRequest extends Component {
|
|
|
192
195
|
const imagesUpdate = this.getImages(imageFieldId);
|
|
193
196
|
imagesUpdate.splice(imagesUpdate.length - 1, 0, {
|
|
194
197
|
uploading: true,
|
|
195
|
-
uploadProgress:
|
|
198
|
+
uploadProgress: '0%',
|
|
196
199
|
uploadUri,
|
|
197
200
|
imageUri,
|
|
198
201
|
allowRetry: true
|
|
@@ -220,7 +223,7 @@ class MaintenanceRequest extends Component {
|
|
|
220
223
|
const imagesUpdate = this.getImages(imageFieldId);
|
|
221
224
|
imagesUpdate.map(img => {
|
|
222
225
|
if (img.uploadUri === uploadUri && img.uploading) {
|
|
223
|
-
img.url = uri.replace(
|
|
226
|
+
img.url = uri.replace('/general/', '/general1400/');
|
|
224
227
|
img.thumbNailExists = false;
|
|
225
228
|
img.thumbNailUrl = Helper.getThumb300(img.url);
|
|
226
229
|
img.allowRetry = true;
|
|
@@ -236,7 +239,7 @@ class MaintenanceRequest extends Component {
|
|
|
236
239
|
imagesUpdate.map(img => {
|
|
237
240
|
if (img.uploadUri === uploadUri) {
|
|
238
241
|
img.uploading = true; // Requried for retry
|
|
239
|
-
img.uploadProgress =
|
|
242
|
+
img.uploadProgress = '';
|
|
240
243
|
img.allowRetry = true;
|
|
241
244
|
}
|
|
242
245
|
});
|
|
@@ -260,7 +263,7 @@ class MaintenanceRequest extends Component {
|
|
|
260
263
|
const documentsUpdate = this.getDocuments(documentFieldId);
|
|
261
264
|
documentsUpdate.splice(documentsUpdate.length - 1, 0, {
|
|
262
265
|
uploading: true,
|
|
263
|
-
uploadProgress:
|
|
266
|
+
uploadProgress: '0%',
|
|
264
267
|
uploadUri,
|
|
265
268
|
documentUri,
|
|
266
269
|
documentName,
|
|
@@ -285,7 +288,7 @@ class MaintenanceRequest extends Component {
|
|
|
285
288
|
documentsUpdate.map(doc => {
|
|
286
289
|
if (doc.uploadUri === uploadUri && doc.uploading) {
|
|
287
290
|
doc.uploading = false;
|
|
288
|
-
doc.uploadProgress =
|
|
291
|
+
doc.uploadProgress = '100%';
|
|
289
292
|
doc.url = uri;
|
|
290
293
|
doc.allowRetry = true;
|
|
291
294
|
}
|
|
@@ -297,7 +300,7 @@ class MaintenanceRequest extends Component {
|
|
|
297
300
|
documentsUpdate.map(doc => {
|
|
298
301
|
if (doc.uploadUri === uploadUri) {
|
|
299
302
|
doc.uploading = true; // Requried for retry
|
|
300
|
-
doc.uploadProgress =
|
|
303
|
+
doc.uploadProgress = '';
|
|
301
304
|
doc.allowRetry = true;
|
|
302
305
|
}
|
|
303
306
|
});
|
|
@@ -309,19 +312,19 @@ class MaintenanceRequest extends Component {
|
|
|
309
312
|
type,
|
|
310
313
|
answer
|
|
311
314
|
} = field;
|
|
312
|
-
if ([
|
|
315
|
+
if (['staticTitle', 'staticText'].includes(type)) return true;
|
|
313
316
|
const checkMandatory = () => {
|
|
314
317
|
if (!mandatory) return true;
|
|
315
318
|
switch (type) {
|
|
316
|
-
case
|
|
319
|
+
case 'yn':
|
|
317
320
|
return _.isBoolean(answer);
|
|
318
|
-
case
|
|
321
|
+
case 'image':
|
|
319
322
|
const imagesList = this.getImageUrls(fieldId);
|
|
320
323
|
return imagesList.length > 0;
|
|
321
|
-
case
|
|
324
|
+
case 'document':
|
|
322
325
|
const documentsList = this.getDocumentAnswers(fieldId);
|
|
323
326
|
return documentsList.length > 0;
|
|
324
|
-
case
|
|
327
|
+
case 'checkbox':
|
|
325
328
|
return _.isArray(answer) && answer.length > 0;
|
|
326
329
|
default:
|
|
327
330
|
return !_.isNil(answer) && !_.isEmpty(answer);
|
|
@@ -330,12 +333,12 @@ class MaintenanceRequest extends Component {
|
|
|
330
333
|
const checkFormat = () => {
|
|
331
334
|
if (_.isNil(answer) || _.isEmpty(answer)) return true;
|
|
332
335
|
switch (type) {
|
|
333
|
-
case
|
|
336
|
+
case 'email':
|
|
334
337
|
return Helper.isEmail(answer);
|
|
335
|
-
case
|
|
336
|
-
return moment(answer,
|
|
337
|
-
case
|
|
338
|
-
return moment(answer,
|
|
338
|
+
case 'date':
|
|
339
|
+
return moment(answer, 'YYYY-MM-DD', true).isValid();
|
|
340
|
+
case 'time':
|
|
341
|
+
return moment(answer, 'HH:mm', true).isValid();
|
|
339
342
|
default:
|
|
340
343
|
return true;
|
|
341
344
|
}
|
|
@@ -371,8 +374,8 @@ class MaintenanceRequest extends Component {
|
|
|
371
374
|
// Fix custom images field answers
|
|
372
375
|
const customFields = _.cloneDeep(this.state.customFields);
|
|
373
376
|
const updatedCustomFields = customFields.map((field, fieldId) => {
|
|
374
|
-
if (field.type ===
|
|
375
|
-
if (field.type ===
|
|
377
|
+
if (field.type === 'image') field.answer = this.getImageUrls(fieldId);
|
|
378
|
+
if (field.type === 'document') field.answer = this.getDocumentAnswers(fieldId);
|
|
376
379
|
return field;
|
|
377
380
|
});
|
|
378
381
|
maintenanceActions.sendMaintenanceRequest(this.props.uid, this.state.userName, this.state.phone, this.state.roomNumber, this.state.title, description, null, this.state.type, images, Helper.getSite(this.props.site), this.state.isHome, this.state.times, updatedCustomFields).then(res => {
|
|
@@ -390,7 +393,7 @@ class MaintenanceRequest extends Component {
|
|
|
390
393
|
});
|
|
391
394
|
}
|
|
392
395
|
}).catch(err => {
|
|
393
|
-
console.log(
|
|
396
|
+
console.log('maintenance submission fail.');
|
|
394
397
|
console.log(err);
|
|
395
398
|
this.setState({
|
|
396
399
|
submitting: false
|
|
@@ -402,7 +405,7 @@ class MaintenanceRequest extends Component {
|
|
|
402
405
|
const job = await maintenanceActions.getJob(Helper.getSite(this.props.site), id);
|
|
403
406
|
this.props.jobAdded(job.data);
|
|
404
407
|
} catch (error) {
|
|
405
|
-
console.log(
|
|
408
|
+
console.log('refreshRequest error', error);
|
|
406
409
|
}
|
|
407
410
|
});
|
|
408
411
|
_defineProperty(this, "validateCustomFields", () => {
|
|
@@ -521,7 +524,7 @@ class MaintenanceRequest extends Component {
|
|
|
521
524
|
this.setDocuments(documentsUpdate, fieldId);
|
|
522
525
|
});
|
|
523
526
|
_defineProperty(this, "toggleFullscreenVideo", url => {
|
|
524
|
-
if (typeof url !==
|
|
527
|
+
if (typeof url !== 'string') url = '';
|
|
525
528
|
this.setState({
|
|
526
529
|
showFullscreenVideo: url.length > 0,
|
|
527
530
|
currentVideoUrl: url
|
|
@@ -534,19 +537,19 @@ class MaintenanceRequest extends Component {
|
|
|
534
537
|
error: null,
|
|
535
538
|
showError: false,
|
|
536
539
|
loadingTypes: values.forceCustomFields,
|
|
537
|
-
userName:
|
|
538
|
-
roomNumber:
|
|
539
|
-
phone:
|
|
540
|
-
title:
|
|
541
|
-
description:
|
|
542
|
-
times:
|
|
543
|
-
type:
|
|
540
|
+
userName: '',
|
|
541
|
+
roomNumber: '',
|
|
542
|
+
phone: '',
|
|
543
|
+
title: '',
|
|
544
|
+
description: '',
|
|
545
|
+
times: '',
|
|
546
|
+
type: 'General',
|
|
544
547
|
uploadingImage: false,
|
|
545
548
|
images: [{
|
|
546
549
|
add: true
|
|
547
550
|
}],
|
|
548
551
|
showFullscreenVideo: false,
|
|
549
|
-
currentVideoUrl:
|
|
552
|
+
currentVideoUrl: '',
|
|
550
553
|
isHome: false,
|
|
551
554
|
types: [],
|
|
552
555
|
confirmationToShow: false,
|
|
@@ -554,7 +557,7 @@ class MaintenanceRequest extends Component {
|
|
|
554
557
|
customFieldImages: {},
|
|
555
558
|
customFieldDocuments: {},
|
|
556
559
|
isDateTimePickerVisible: false,
|
|
557
|
-
popUpType:
|
|
560
|
+
popUpType: 'date',
|
|
558
561
|
dateFieldId: null,
|
|
559
562
|
imageFieldId: null,
|
|
560
563
|
// PC-1255: On-behalf request fields
|
|
@@ -564,9 +567,9 @@ class MaintenanceRequest extends Component {
|
|
|
564
567
|
};
|
|
565
568
|
this.checkThumb = null;
|
|
566
569
|
this.keyboardTypes = {
|
|
567
|
-
phone:
|
|
568
|
-
email:
|
|
569
|
-
text:
|
|
570
|
+
phone: 'phone-pad',
|
|
571
|
+
email: 'email-address',
|
|
572
|
+
text: 'default'
|
|
570
573
|
};
|
|
571
574
|
}
|
|
572
575
|
componentDidMount() {
|
|
@@ -596,9 +599,9 @@ class MaintenanceRequest extends Component {
|
|
|
596
599
|
onConfirmationReset() {
|
|
597
600
|
this.setState({
|
|
598
601
|
confirmationToShow: false,
|
|
599
|
-
title:
|
|
600
|
-
description:
|
|
601
|
-
times:
|
|
602
|
+
title: '',
|
|
603
|
+
description: '',
|
|
604
|
+
times: '',
|
|
602
605
|
isHome: false,
|
|
603
606
|
uploadingImage: false,
|
|
604
607
|
images: [{
|
|
@@ -611,7 +614,7 @@ class MaintenanceRequest extends Component {
|
|
|
611
614
|
customFieldImages: {},
|
|
612
615
|
customFieldDocuments: {},
|
|
613
616
|
isDateTimePickerVisible: false,
|
|
614
|
-
popUpType:
|
|
617
|
+
popUpType: 'date',
|
|
615
618
|
dateFieldId: null,
|
|
616
619
|
imageFieldId: null
|
|
617
620
|
}, () => this.pickType(this.state.type));
|
|
@@ -620,9 +623,8 @@ class MaintenanceRequest extends Component {
|
|
|
620
623
|
maintenanceActions.getJobTypes(Helper.getSite(this.props.site)).then(res => {
|
|
621
624
|
this.setState({
|
|
622
625
|
types: res.data
|
|
623
|
-
}, () => {
|
|
624
|
-
this.getDefaultJob();
|
|
625
626
|
});
|
|
627
|
+
this.getDefaultJob();
|
|
626
628
|
}).catch(() => {});
|
|
627
629
|
}
|
|
628
630
|
pickType(type) {
|
|
@@ -643,7 +645,7 @@ class MaintenanceRequest extends Component {
|
|
|
643
645
|
customFields: selected.hasCustomFields && selected.customFields.length > 0 ? _.cloneDeep(selected.customFields) : [],
|
|
644
646
|
loadingTypes: false
|
|
645
647
|
};
|
|
646
|
-
if (!_.isEmpty(update.customFields) && !_.some(update.customFields,
|
|
648
|
+
if (!_.isEmpty(update.customFields) && !_.some(update.customFields, 'isTitle')) {
|
|
647
649
|
update.title = this.state.userName;
|
|
648
650
|
}
|
|
649
651
|
this.setState(update);
|
|
@@ -673,7 +675,7 @@ class MaintenanceRequest extends Component {
|
|
|
673
675
|
if (!this.props.connected) {
|
|
674
676
|
this.setState({
|
|
675
677
|
error: {
|
|
676
|
-
message:
|
|
678
|
+
message: 'No internet connection detected'
|
|
677
679
|
}
|
|
678
680
|
});
|
|
679
681
|
}
|
|
@@ -687,14 +689,14 @@ class MaintenanceRequest extends Component {
|
|
|
687
689
|
|
|
688
690
|
// PC-1255: Validate user selection for on-behalf requests
|
|
689
691
|
if (this.state.canCreateOnBehalf && !this.state.selectedUser) {
|
|
690
|
-
console.log(
|
|
692
|
+
console.log('submitRequest - no user selected for on-behalf request');
|
|
691
693
|
this.setState({
|
|
692
694
|
showError: true
|
|
693
695
|
});
|
|
694
696
|
return;
|
|
695
697
|
}
|
|
696
698
|
if (title.length === 0 || !roomNumber || roomNumber.length === 0) {
|
|
697
|
-
console.log(
|
|
699
|
+
console.log('submitRequest - error', {
|
|
698
700
|
title,
|
|
699
701
|
roomNumber
|
|
700
702
|
});
|
|
@@ -705,7 +707,7 @@ class MaintenanceRequest extends Component {
|
|
|
705
707
|
}
|
|
706
708
|
if (hasCustomFields) {
|
|
707
709
|
if (!this.validateCustomFields()) {
|
|
708
|
-
console.log(
|
|
710
|
+
console.log('submitRequest - custom fields error');
|
|
709
711
|
this.setState({
|
|
710
712
|
showError: true
|
|
711
713
|
});
|
|
@@ -713,7 +715,7 @@ class MaintenanceRequest extends Component {
|
|
|
713
715
|
}
|
|
714
716
|
} else {
|
|
715
717
|
if (isHome && times.length < 2) {
|
|
716
|
-
console.log(
|
|
718
|
+
console.log('submitRequest - error', {
|
|
717
719
|
isHome,
|
|
718
720
|
times
|
|
719
721
|
});
|
|
@@ -737,8 +739,8 @@ class MaintenanceRequest extends Component {
|
|
|
737
739
|
width: 1400
|
|
738
740
|
},
|
|
739
741
|
quality: 0.8,
|
|
740
|
-
fileName:
|
|
741
|
-
popupTitle:
|
|
742
|
+
fileName: 'serviceImage',
|
|
743
|
+
popupTitle: 'Upload Image',
|
|
742
744
|
userId: this.props.uid,
|
|
743
745
|
allowsEditing: false,
|
|
744
746
|
multiple: true,
|
|
@@ -813,7 +815,7 @@ class MaintenanceRequest extends Component {
|
|
|
813
815
|
style: styles.documentTypeText
|
|
814
816
|
}, item.documentExt)), /*#__PURE__*/React.createElement(Text, {
|
|
815
817
|
style: styles.documentText
|
|
816
|
-
}, `${item.documentName}${item.uploading ? ` - ${item.uploadProgress}` :
|
|
818
|
+
}, `${item.documentName}${item.uploading ? ` - ${item.uploadProgress}` : ''}`), !item.uploading && /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
817
819
|
style: styles.removeDocumentButton,
|
|
818
820
|
onPress: () => this.removeDocument(index, fieldId)
|
|
819
821
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
@@ -830,7 +832,7 @@ class MaintenanceRequest extends Component {
|
|
|
830
832
|
style: {
|
|
831
833
|
padding: 16,
|
|
832
834
|
flex: 1,
|
|
833
|
-
backgroundColor:
|
|
835
|
+
backgroundColor: '#fff'
|
|
834
836
|
}
|
|
835
837
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
836
838
|
style: styles.requestSuccess
|
|
@@ -858,7 +860,7 @@ class MaintenanceRequest extends Component {
|
|
|
858
860
|
style: styles.documentListContainer
|
|
859
861
|
}, documentsList.length > 0 ? documentsList.map((document, index) => this.renderDocument(document, index, fieldId)) : null, /*#__PURE__*/React.createElement(Components.DocumentUploader, {
|
|
860
862
|
buttonTitle: "Add Files",
|
|
861
|
-
allowedTypes: [
|
|
863
|
+
allowedTypes: ['application/pdf'],
|
|
862
864
|
onUploadStarted: (uploadUri, uri, name, ext) => this.onUploadStartedDocument(uploadUri, uri, name, ext, fieldId),
|
|
863
865
|
onUploadProgress: progress => this.onUploadProgressDocument(progress, fieldId),
|
|
864
866
|
onUploadSuccess: (uri, uploadUri) => this.onUploadSuccessDocument(uri, uploadUri, fieldId),
|
|
@@ -871,16 +873,16 @@ class MaintenanceRequest extends Component {
|
|
|
871
873
|
}
|
|
872
874
|
renderDateField(field, fieldId, sectionStyle) {
|
|
873
875
|
let displayText, placeHolder, icon, errorText;
|
|
874
|
-
if (field.type ===
|
|
875
|
-
displayText = field.answer ? moment(field.answer,
|
|
876
|
-
placeHolder =
|
|
877
|
-
icon =
|
|
878
|
-
errorText =
|
|
876
|
+
if (field.type === 'date') {
|
|
877
|
+
displayText = field.answer ? moment(field.answer, 'YYYY-MM-DD').format('DD MMM YYYY') : '';
|
|
878
|
+
placeHolder = 'dd mmm yyyy';
|
|
879
|
+
icon = 'calendar';
|
|
880
|
+
errorText = 'Not a valid date';
|
|
879
881
|
} else {
|
|
880
|
-
displayText = field.answer ? moment(field.answer,
|
|
881
|
-
placeHolder =
|
|
882
|
-
icon =
|
|
883
|
-
errorText =
|
|
882
|
+
displayText = field.answer ? moment(field.answer, 'HH:mm').format('h:mm a') : '';
|
|
883
|
+
placeHolder = '--:-- --';
|
|
884
|
+
icon = 'clock-o';
|
|
885
|
+
errorText = 'Not a valid time';
|
|
884
886
|
}
|
|
885
887
|
return /*#__PURE__*/React.createElement(Components.GenericInputSection, {
|
|
886
888
|
key: fieldId,
|
|
@@ -918,7 +920,7 @@ class MaintenanceRequest extends Component {
|
|
|
918
920
|
marginBottom: 24
|
|
919
921
|
};
|
|
920
922
|
switch (field.type) {
|
|
921
|
-
case
|
|
923
|
+
case 'yn':
|
|
922
924
|
return /*#__PURE__*/React.createElement(Components.GenericInputSection, {
|
|
923
925
|
key: fieldId,
|
|
924
926
|
label: field.label,
|
|
@@ -930,7 +932,7 @@ class MaintenanceRequest extends Component {
|
|
|
930
932
|
showError: this.state.showError,
|
|
931
933
|
required: field.mandatory
|
|
932
934
|
});
|
|
933
|
-
case
|
|
935
|
+
case 'multichoice':
|
|
934
936
|
return /*#__PURE__*/React.createElement(Components.GenericInputSection, {
|
|
935
937
|
key: fieldId,
|
|
936
938
|
label: field.label,
|
|
@@ -948,7 +950,7 @@ class MaintenanceRequest extends Component {
|
|
|
948
950
|
showError: this.state.showError,
|
|
949
951
|
required: field.mandatory
|
|
950
952
|
});
|
|
951
|
-
case
|
|
953
|
+
case 'checkbox':
|
|
952
954
|
return /*#__PURE__*/React.createElement(Components.GenericInputSection, {
|
|
953
955
|
key: fieldId,
|
|
954
956
|
label: field.label,
|
|
@@ -978,9 +980,9 @@ class MaintenanceRequest extends Component {
|
|
|
978
980
|
style: styles.multiChoiceText
|
|
979
981
|
}, o));
|
|
980
982
|
}));
|
|
981
|
-
case
|
|
982
|
-
case
|
|
983
|
-
case
|
|
983
|
+
case 'text':
|
|
984
|
+
case 'email':
|
|
985
|
+
case 'phone':
|
|
984
986
|
return /*#__PURE__*/React.createElement(Components.GenericInputSection, {
|
|
985
987
|
key: fieldId,
|
|
986
988
|
label: field.label,
|
|
@@ -991,28 +993,28 @@ class MaintenanceRequest extends Component {
|
|
|
991
993
|
squaredCorners: true,
|
|
992
994
|
isValid: () => this.isFieldValid(field, fieldId),
|
|
993
995
|
showError: this.state.showError,
|
|
994
|
-
errorText: field.type ===
|
|
996
|
+
errorText: field.type === 'email' ? 'Not a valid email' : undefined,
|
|
995
997
|
required: field.mandatory,
|
|
996
998
|
sectionStyle: sectionStyle,
|
|
997
999
|
autoCapitalize: "sentences",
|
|
998
1000
|
keyboardType: this.keyboardTypes[field.type]
|
|
999
1001
|
});
|
|
1000
|
-
case
|
|
1002
|
+
case 'staticTitle':
|
|
1001
1003
|
return /*#__PURE__*/React.createElement(Text, {
|
|
1002
1004
|
key: fieldId,
|
|
1003
1005
|
style: [styles.staticTitle, {
|
|
1004
1006
|
color: this.props.colourBrandingMain
|
|
1005
1007
|
}, sectionStyle]
|
|
1006
1008
|
}, field.label);
|
|
1007
|
-
case
|
|
1009
|
+
case 'staticText':
|
|
1008
1010
|
return /*#__PURE__*/React.createElement(View, {
|
|
1009
1011
|
key: fieldId,
|
|
1010
1012
|
style: [styles.staticText, sectionStyle]
|
|
1011
1013
|
}, Helper.toParagraphed(field.label, styles.staticText));
|
|
1012
|
-
case
|
|
1013
|
-
case
|
|
1014
|
+
case 'date':
|
|
1015
|
+
case 'time':
|
|
1014
1016
|
return this.renderDateField(field, fieldId, sectionStyle);
|
|
1015
|
-
case
|
|
1017
|
+
case 'image':
|
|
1016
1018
|
return /*#__PURE__*/React.createElement(Components.GenericInputSection, {
|
|
1017
1019
|
key: fieldId,
|
|
1018
1020
|
label: field.label,
|
|
@@ -1021,7 +1023,7 @@ class MaintenanceRequest extends Component {
|
|
|
1021
1023
|
required: field.mandatory,
|
|
1022
1024
|
showError: this.state.showError
|
|
1023
1025
|
}, this.renderImageList(fieldId));
|
|
1024
|
-
case
|
|
1026
|
+
case 'document':
|
|
1025
1027
|
return /*#__PURE__*/React.createElement(Components.GenericInputSection, {
|
|
1026
1028
|
key: fieldId,
|
|
1027
1029
|
label: field.label,
|
|
@@ -1078,7 +1080,7 @@ class MaintenanceRequest extends Component {
|
|
|
1078
1080
|
marginTop: 16
|
|
1079
1081
|
}
|
|
1080
1082
|
}, this.state.canCreateOnBehalf && /*#__PURE__*/React.createElement(Components.FormCardSection, {
|
|
1081
|
-
label:
|
|
1083
|
+
label: 'Select User',
|
|
1082
1084
|
textValue: (_this$state$selectedU = this.state.selectedUser) === null || _this$state$selectedU === void 0 ? void 0 : _this$state$selectedU.displayName,
|
|
1083
1085
|
hasContent: true,
|
|
1084
1086
|
hasUnderline: true,
|
|
@@ -1100,7 +1102,7 @@ class MaintenanceRequest extends Component {
|
|
|
1100
1102
|
Diameter: 30
|
|
1101
1103
|
}), /*#__PURE__*/React.createElement(Text, {
|
|
1102
1104
|
style: styles.nameText
|
|
1103
|
-
}, ((_this$state$selectedU3 = this.state.selectedUser) === null || _this$state$selectedU3 === void 0 ? void 0 : _this$state$selectedU3.displayName) ||
|
|
1105
|
+
}, ((_this$state$selectedU3 = this.state.selectedUser) === null || _this$state$selectedU3 === void 0 ? void 0 : _this$state$selectedU3.displayName) || 'Select User')), /*#__PURE__*/React.createElement(Icon, {
|
|
1104
1106
|
name: "angle-right",
|
|
1105
1107
|
type: "font-awesome",
|
|
1106
1108
|
iconStyle: [styles.sectionTitle, {
|
|
@@ -1108,11 +1110,11 @@ class MaintenanceRequest extends Component {
|
|
|
1108
1110
|
color: this.props.colourBrandingMain
|
|
1109
1111
|
}]
|
|
1110
1112
|
})))), !this.state.canCreateOnBehalf && /*#__PURE__*/React.createElement(Components.FormCardSection, {
|
|
1111
|
-
label:
|
|
1112
|
-
placeholder:
|
|
1113
|
+
label: 'Name',
|
|
1114
|
+
placeholder: 'Enter your name',
|
|
1113
1115
|
textValue: this.state.userName,
|
|
1114
1116
|
onChangeText: userName => this.onChangeName(userName),
|
|
1115
|
-
editable: this.props.userType ===
|
|
1117
|
+
editable: this.props.userType === 'KIOSK' && this.state.submitting === false,
|
|
1116
1118
|
isValid: () => {
|
|
1117
1119
|
return this.state.userName.length > 1;
|
|
1118
1120
|
},
|
|
@@ -1121,18 +1123,18 @@ class MaintenanceRequest extends Component {
|
|
|
1121
1123
|
showError: this.state.showError && this.state.userName.length < 2,
|
|
1122
1124
|
hasUnderline: true
|
|
1123
1125
|
}), /*#__PURE__*/React.createElement(Components.FormCardSection, {
|
|
1124
|
-
label:
|
|
1125
|
-
placeholder:
|
|
1126
|
+
label: 'Contact number',
|
|
1127
|
+
placeholder: 'Enter phone number',
|
|
1126
1128
|
textValue: this.state.phone,
|
|
1127
1129
|
onChangeText: phone => this.setState({
|
|
1128
1130
|
phone
|
|
1129
1131
|
}),
|
|
1130
1132
|
editable: this.state.submitting === false,
|
|
1131
1133
|
hasUnderline: true,
|
|
1132
|
-
keyboardType:
|
|
1134
|
+
keyboardType: 'phone-pad'
|
|
1133
1135
|
}), /*#__PURE__*/React.createElement(Components.FormCardSection, {
|
|
1134
|
-
label:
|
|
1135
|
-
placeholder:
|
|
1136
|
+
label: 'Address',
|
|
1137
|
+
placeholder: 'Enter your address',
|
|
1136
1138
|
textValue: this.state.roomNumber,
|
|
1137
1139
|
onChangeText: roomNumber => this.setState({
|
|
1138
1140
|
roomNumber
|
|
@@ -1150,8 +1152,8 @@ class MaintenanceRequest extends Component {
|
|
|
1150
1152
|
marginTop: 16,
|
|
1151
1153
|
paddingHorizontal: 24,
|
|
1152
1154
|
paddingVertical: 16,
|
|
1153
|
-
flexDirection:
|
|
1154
|
-
justifyContent:
|
|
1155
|
+
flexDirection: 'row',
|
|
1156
|
+
justifyContent: 'space-between'
|
|
1155
1157
|
}
|
|
1156
1158
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
1157
1159
|
style: styles.sectionTitle
|
|
@@ -1159,7 +1161,7 @@ class MaintenanceRequest extends Component {
|
|
|
1159
1161
|
onPress: this.onPressType.bind(this)
|
|
1160
1162
|
}, /*#__PURE__*/React.createElement(View, {
|
|
1161
1163
|
style: {
|
|
1162
|
-
flexDirection:
|
|
1164
|
+
flexDirection: 'row'
|
|
1163
1165
|
}
|
|
1164
1166
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
1165
1167
|
style: [styles.sectionTitle, {
|
|
@@ -1178,8 +1180,8 @@ class MaintenanceRequest extends Component {
|
|
|
1178
1180
|
marginTop: 16
|
|
1179
1181
|
}
|
|
1180
1182
|
}, /*#__PURE__*/React.createElement(Components.FormCardSection, {
|
|
1181
|
-
label:
|
|
1182
|
-
placeholder:
|
|
1183
|
+
label: 'Title',
|
|
1184
|
+
placeholder: 'Enter a title for your request',
|
|
1183
1185
|
textValue: this.state.title,
|
|
1184
1186
|
onChangeText: title => this.setState({
|
|
1185
1187
|
title
|
|
@@ -1196,8 +1198,8 @@ class MaintenanceRequest extends Component {
|
|
|
1196
1198
|
multiline: true,
|
|
1197
1199
|
autoGrow: true
|
|
1198
1200
|
}), /*#__PURE__*/React.createElement(Components.FormCardSection, {
|
|
1199
|
-
label:
|
|
1200
|
-
placeholder:
|
|
1201
|
+
label: 'Description',
|
|
1202
|
+
placeholder: 'Describe your request here in detail',
|
|
1201
1203
|
textValue: this.state.description,
|
|
1202
1204
|
onChangeText: description => this.setState({
|
|
1203
1205
|
description
|
|
@@ -1214,12 +1216,12 @@ class MaintenanceRequest extends Component {
|
|
|
1214
1216
|
}
|
|
1215
1217
|
}, /*#__PURE__*/React.createElement(View, {
|
|
1216
1218
|
style: [{
|
|
1217
|
-
width:
|
|
1219
|
+
width: '100%',
|
|
1218
1220
|
paddingVertical: 16,
|
|
1219
|
-
flexDirection:
|
|
1220
|
-
justifyContent:
|
|
1221
|
-
alignItems:
|
|
1222
|
-
position:
|
|
1221
|
+
flexDirection: 'row',
|
|
1222
|
+
justifyContent: 'space-between',
|
|
1223
|
+
alignItems: 'center',
|
|
1224
|
+
position: 'relative'
|
|
1223
1225
|
}, this.state.isHome && {
|
|
1224
1226
|
borderBottomWidth: 1,
|
|
1225
1227
|
borderBottomColor: Colours.LINEGREY
|
|
@@ -1233,13 +1235,13 @@ class MaintenanceRequest extends Component {
|
|
|
1233
1235
|
isHome: value
|
|
1234
1236
|
}),
|
|
1235
1237
|
trackColor: {
|
|
1236
|
-
false:
|
|
1238
|
+
false: '#ddd',
|
|
1237
1239
|
true: this.props.colourBrandingMain
|
|
1238
1240
|
},
|
|
1239
|
-
thumbColor: Platform.OS ===
|
|
1241
|
+
thumbColor: Platform.OS === 'android' ? '#fff' : null
|
|
1240
1242
|
})), this.state.isHome && /*#__PURE__*/React.createElement(Components.FormCardSection, {
|
|
1241
|
-
label:
|
|
1242
|
-
placeholder:
|
|
1243
|
+
label: 'Available times',
|
|
1244
|
+
placeholder: 'Describe your available times here in detail.',
|
|
1243
1245
|
textValue: this.state.times,
|
|
1244
1246
|
onChangeText: times => this.setState({
|
|
1245
1247
|
times
|
|
@@ -1261,7 +1263,7 @@ class MaintenanceRequest extends Component {
|
|
|
1261
1263
|
renderRegisterConfirmation() {
|
|
1262
1264
|
return /*#__PURE__*/React.createElement(Components.ConfirmationPopup, {
|
|
1263
1265
|
confirmText: `${values.textEntityName} submitted`,
|
|
1264
|
-
repeatText:
|
|
1266
|
+
repeatText: 'Submit another',
|
|
1265
1267
|
visible: this.state.confirmationToShow,
|
|
1266
1268
|
onClose: this.onCloseConfirmationPopup.bind(this),
|
|
1267
1269
|
onPressAction: this.onConfirmationReset.bind(this)
|
|
@@ -1285,8 +1287,8 @@ class MaintenanceRequest extends Component {
|
|
|
1285
1287
|
return null;
|
|
1286
1288
|
}
|
|
1287
1289
|
return /*#__PURE__*/React.createElement(Components.WarningPopup, {
|
|
1288
|
-
confirmText:
|
|
1289
|
-
infoText:
|
|
1290
|
+
confirmText: 'No forms are available',
|
|
1291
|
+
infoText: 'Check back later for forms.',
|
|
1290
1292
|
visible: this.state.noType,
|
|
1291
1293
|
onClose: this.onPressBack.bind(this),
|
|
1292
1294
|
padHorizontal: true
|
|
@@ -1300,7 +1302,7 @@ class MaintenanceRequest extends Component {
|
|
|
1300
1302
|
popUpType
|
|
1301
1303
|
} = this.state;
|
|
1302
1304
|
return /*#__PURE__*/React.createElement(KeyboardAvoidingView, {
|
|
1303
|
-
behavior:
|
|
1305
|
+
behavior: Platform.OS === 'ios' && 'padding',
|
|
1304
1306
|
style: styles.viewContainer
|
|
1305
1307
|
}, this.renderImageUploader(), /*#__PURE__*/React.createElement(View, {
|
|
1306
1308
|
style: styles.container
|
|
@@ -1308,7 +1310,7 @@ class MaintenanceRequest extends Component {
|
|
|
1308
1310
|
leftIcon: "angle-left",
|
|
1309
1311
|
onPressLeft: this.onPressBack.bind(this),
|
|
1310
1312
|
text: this.props.strings[`${values.featureKey}_textFeatureTitle`] || values.textFeatureTitle,
|
|
1311
|
-
rightText: submitting || success ? null :
|
|
1313
|
+
rightText: submitting || success ? null : 'Done',
|
|
1312
1314
|
onPressRight: this.submitRequest.bind(this),
|
|
1313
1315
|
absoluteRight: true
|
|
1314
1316
|
}), this.renderForm()), this.renderRegisterConfirmation(), this.renderVideoPlayerPopup(), this.renderNoType(), /*#__PURE__*/React.createElement(DateTimePicker, {
|
|
@@ -1318,60 +1320,59 @@ class MaintenanceRequest extends Component {
|
|
|
1318
1320
|
isDateTimePickerVisible: false
|
|
1319
1321
|
}),
|
|
1320
1322
|
mode: popUpType,
|
|
1321
|
-
headerTextIOS: `Pick a ${popUpType}
|
|
1322
|
-
date: new Date()
|
|
1323
|
+
headerTextIOS: `Pick a ${popUpType}`
|
|
1323
1324
|
}));
|
|
1324
1325
|
}
|
|
1325
1326
|
}
|
|
1326
1327
|
const styles = {
|
|
1327
1328
|
viewContainer: {
|
|
1328
1329
|
flex: 1,
|
|
1329
|
-
backgroundColor:
|
|
1330
|
+
backgroundColor: '#fff'
|
|
1330
1331
|
},
|
|
1331
1332
|
container: {
|
|
1332
1333
|
flex: 1,
|
|
1333
|
-
position:
|
|
1334
|
-
backgroundColor:
|
|
1334
|
+
position: 'relative',
|
|
1335
|
+
backgroundColor: '#f0f0f5'
|
|
1335
1336
|
},
|
|
1336
1337
|
errorText: {
|
|
1337
|
-
fontFamily:
|
|
1338
|
+
fontFamily: 'sf-regular',
|
|
1338
1339
|
color: Colours.COLOUR_TANGERINE,
|
|
1339
1340
|
fontSize: 16
|
|
1340
1341
|
},
|
|
1341
1342
|
requestSuccess: {
|
|
1342
|
-
fontFamily:
|
|
1343
|
+
fontFamily: 'sf-regular',
|
|
1343
1344
|
color: Colours.TEXT_DARK,
|
|
1344
1345
|
fontSize: 17,
|
|
1345
|
-
textAlign:
|
|
1346
|
+
textAlign: 'center'
|
|
1346
1347
|
},
|
|
1347
1348
|
sectionTitle: {
|
|
1348
|
-
fontFamily:
|
|
1349
|
+
fontFamily: 'sf-regular',
|
|
1349
1350
|
fontSize: 17,
|
|
1350
1351
|
color: Colours.TEXT_DARK
|
|
1351
1352
|
},
|
|
1352
1353
|
imageListContainer: {
|
|
1353
1354
|
marginTop: 8,
|
|
1354
1355
|
padding: 8,
|
|
1355
|
-
flexDirection:
|
|
1356
|
+
flexDirection: 'row',
|
|
1356
1357
|
backgroundColor: Colours.BOXGREY,
|
|
1357
1358
|
minHeight: 106
|
|
1358
1359
|
},
|
|
1359
1360
|
imageListContainerEmpty: {
|
|
1360
|
-
justifyContent:
|
|
1361
|
-
alignItems:
|
|
1362
|
-
flexDirection:
|
|
1361
|
+
justifyContent: 'center',
|
|
1362
|
+
alignItems: 'center',
|
|
1363
|
+
flexDirection: 'column'
|
|
1363
1364
|
},
|
|
1364
1365
|
documentListContainer: {
|
|
1365
1366
|
marginTop: 8,
|
|
1366
|
-
flexDirection:
|
|
1367
|
-
alignItems:
|
|
1367
|
+
flexDirection: 'column',
|
|
1368
|
+
alignItems: 'flex-start'
|
|
1368
1369
|
},
|
|
1369
1370
|
imageContainer: {
|
|
1370
1371
|
width: PHOTO_SIZE,
|
|
1371
1372
|
height: PHOTO_SIZE,
|
|
1372
|
-
borderStyle:
|
|
1373
|
-
justifyContent:
|
|
1374
|
-
alignItems:
|
|
1373
|
+
borderStyle: 'dashed',
|
|
1374
|
+
justifyContent: 'center',
|
|
1375
|
+
alignItems: 'center',
|
|
1375
1376
|
borderWidth: 1,
|
|
1376
1377
|
borderColor: Colours.LINEGREY,
|
|
1377
1378
|
borderRadius: 4,
|
|
@@ -1380,13 +1381,13 @@ const styles = {
|
|
|
1380
1381
|
imageContainerNotEmpty: {
|
|
1381
1382
|
borderWidth: 1,
|
|
1382
1383
|
borderColor: Colours.LINEGREY,
|
|
1383
|
-
backgroundColor:
|
|
1384
|
-
borderStyle:
|
|
1384
|
+
backgroundColor: '#fff',
|
|
1385
|
+
borderStyle: 'dashed'
|
|
1385
1386
|
},
|
|
1386
1387
|
imageBackground: {
|
|
1387
1388
|
flex: 1,
|
|
1388
|
-
height:
|
|
1389
|
-
width:
|
|
1389
|
+
height: '100%',
|
|
1390
|
+
width: '100%',
|
|
1390
1391
|
borderRadius: 4
|
|
1391
1392
|
},
|
|
1392
1393
|
imageCircle: {
|
|
@@ -1394,60 +1395,60 @@ const styles = {
|
|
|
1394
1395
|
height: 90,
|
|
1395
1396
|
borderRadius: 45,
|
|
1396
1397
|
backgroundColor: Colours.PINKISH_GREY,
|
|
1397
|
-
justifyContent:
|
|
1398
|
+
justifyContent: 'center'
|
|
1398
1399
|
},
|
|
1399
1400
|
addImageIcon: {
|
|
1400
|
-
color:
|
|
1401
|
+
color: '#fff',
|
|
1401
1402
|
fontSize: 32
|
|
1402
1403
|
},
|
|
1403
1404
|
imagePlayContainer: {
|
|
1404
|
-
position:
|
|
1405
|
+
position: 'absolute',
|
|
1405
1406
|
top: 0,
|
|
1406
1407
|
left: 0,
|
|
1407
1408
|
right: 0,
|
|
1408
1409
|
bottom: 0,
|
|
1409
|
-
alignItems:
|
|
1410
|
-
justifyContent:
|
|
1410
|
+
alignItems: 'center',
|
|
1411
|
+
justifyContent: 'center'
|
|
1411
1412
|
},
|
|
1412
1413
|
imageControlIcon: {
|
|
1413
|
-
color:
|
|
1414
|
+
color: '#fff',
|
|
1414
1415
|
fontSize: 20,
|
|
1415
|
-
textShadowColor:
|
|
1416
|
+
textShadowColor: 'rgba(0,0,0,0.3)',
|
|
1416
1417
|
textShadowOffset: {
|
|
1417
1418
|
width: 2,
|
|
1418
1419
|
height: 2
|
|
1419
1420
|
}
|
|
1420
1421
|
},
|
|
1421
1422
|
removeImage: {
|
|
1422
|
-
position:
|
|
1423
|
+
position: 'absolute',
|
|
1423
1424
|
top: 0,
|
|
1424
1425
|
right: 0,
|
|
1425
1426
|
padding: 4,
|
|
1426
1427
|
width: 40,
|
|
1427
1428
|
height: 40,
|
|
1428
|
-
alignItems:
|
|
1429
|
-
justifyContent:
|
|
1429
|
+
alignItems: 'center',
|
|
1430
|
+
justifyContent: 'center'
|
|
1430
1431
|
},
|
|
1431
1432
|
staticTitle: {
|
|
1432
1433
|
fontSize: 20,
|
|
1433
|
-
fontFamily:
|
|
1434
|
+
fontFamily: 'sf-semibold',
|
|
1434
1435
|
color: Colours.TEXT_DARKEST
|
|
1435
1436
|
},
|
|
1436
1437
|
staticText: {
|
|
1437
1438
|
fontSize: 17,
|
|
1438
|
-
fontFamily:
|
|
1439
|
+
fontFamily: 'sf-regular',
|
|
1439
1440
|
color: Colours.TEXT_DARKEST,
|
|
1440
1441
|
lineHeight: 24
|
|
1441
1442
|
},
|
|
1442
1443
|
multiChoiceOption: {
|
|
1443
1444
|
marginTop: 16,
|
|
1444
|
-
flexDirection:
|
|
1445
|
-
alignItems:
|
|
1445
|
+
flexDirection: 'row',
|
|
1446
|
+
alignItems: 'center',
|
|
1446
1447
|
minHeight: 20
|
|
1447
1448
|
},
|
|
1448
1449
|
multiChoiceText: {
|
|
1449
1450
|
flex: 1,
|
|
1450
|
-
fontFamily:
|
|
1451
|
+
fontFamily: 'sf-medium',
|
|
1451
1452
|
fontSize: 14,
|
|
1452
1453
|
color: Colours.TEXT_DARK
|
|
1453
1454
|
},
|
|
@@ -1464,24 +1465,24 @@ const styles = {
|
|
|
1464
1465
|
borderRadius: 4
|
|
1465
1466
|
},
|
|
1466
1467
|
dateContainer: {
|
|
1467
|
-
flexDirection:
|
|
1468
|
-
alignItems:
|
|
1468
|
+
flexDirection: 'row',
|
|
1469
|
+
alignItems: 'center'
|
|
1469
1470
|
},
|
|
1470
1471
|
dateFieldButton: {
|
|
1471
1472
|
flex: 1
|
|
1472
1473
|
},
|
|
1473
1474
|
dateFieldContainer: {
|
|
1474
|
-
flexDirection:
|
|
1475
|
+
flexDirection: 'row',
|
|
1475
1476
|
borderRadius: 2,
|
|
1476
|
-
backgroundColor:
|
|
1477
|
+
backgroundColor: '#ebeff2',
|
|
1477
1478
|
padding: 8,
|
|
1478
1479
|
marginTop: 8
|
|
1479
1480
|
},
|
|
1480
1481
|
dateText: {
|
|
1481
1482
|
flex: 1,
|
|
1482
|
-
fontFamily:
|
|
1483
|
+
fontFamily: 'sf-regular',
|
|
1483
1484
|
fontSize: 16,
|
|
1484
|
-
color:
|
|
1485
|
+
color: '#65686D'
|
|
1485
1486
|
},
|
|
1486
1487
|
dateIcon: {
|
|
1487
1488
|
fontSize: 18,
|
|
@@ -1495,36 +1496,36 @@ const styles = {
|
|
|
1495
1496
|
color: Colours.TEXT_BLUEGREY
|
|
1496
1497
|
},
|
|
1497
1498
|
documentContainer: {
|
|
1498
|
-
flexDirection:
|
|
1499
|
-
alignItems:
|
|
1500
|
-
justifyContent:
|
|
1499
|
+
flexDirection: 'row',
|
|
1500
|
+
alignItems: 'center',
|
|
1501
|
+
justifyContent: 'space-between',
|
|
1501
1502
|
paddingVertical: 4
|
|
1502
1503
|
},
|
|
1503
1504
|
documentTypeContainer: {
|
|
1504
1505
|
width: 50,
|
|
1505
1506
|
height: 60,
|
|
1506
|
-
justifyContent:
|
|
1507
|
-
alignItems:
|
|
1507
|
+
justifyContent: 'center',
|
|
1508
|
+
alignItems: 'center',
|
|
1508
1509
|
borderRadius: 5,
|
|
1509
1510
|
marginRight: 8
|
|
1510
1511
|
},
|
|
1511
1512
|
documentTypeText: {
|
|
1512
|
-
color:
|
|
1513
|
-
fontFamily:
|
|
1514
|
-
textAlign:
|
|
1513
|
+
color: '#fff',
|
|
1514
|
+
fontFamily: 'sf-semibold',
|
|
1515
|
+
textAlign: 'center'
|
|
1515
1516
|
},
|
|
1516
1517
|
documentText: {
|
|
1517
1518
|
flex: 1,
|
|
1518
|
-
fontFamily:
|
|
1519
|
+
fontFamily: 'sf-semibold',
|
|
1519
1520
|
fontSize: 16,
|
|
1520
|
-
color:
|
|
1521
|
+
color: '#65686D'
|
|
1521
1522
|
},
|
|
1522
1523
|
removeDocumentButton: {
|
|
1523
1524
|
padding: 4,
|
|
1524
1525
|
width: 40,
|
|
1525
1526
|
height: 40,
|
|
1526
|
-
alignItems:
|
|
1527
|
-
justifyContent:
|
|
1527
|
+
alignItems: 'center',
|
|
1528
|
+
justifyContent: 'center',
|
|
1528
1529
|
marginLeft: 8
|
|
1529
1530
|
},
|
|
1530
1531
|
removeDocumentIcon: {
|
|
@@ -1532,16 +1533,16 @@ const styles = {
|
|
|
1532
1533
|
},
|
|
1533
1534
|
// PC-1255: User picker styles
|
|
1534
1535
|
userPickerContainer: {
|
|
1535
|
-
flexDirection:
|
|
1536
|
-
justifyContent:
|
|
1537
|
-
alignItems:
|
|
1536
|
+
flexDirection: 'row',
|
|
1537
|
+
justifyContent: 'space-between',
|
|
1538
|
+
alignItems: 'center'
|
|
1538
1539
|
},
|
|
1539
1540
|
profileContainer: {
|
|
1540
|
-
flexDirection:
|
|
1541
|
-
alignItems:
|
|
1541
|
+
flexDirection: 'row',
|
|
1542
|
+
alignItems: 'center'
|
|
1542
1543
|
},
|
|
1543
1544
|
nameText: {
|
|
1544
|
-
fontFamily:
|
|
1545
|
+
fontFamily: 'sf-medium',
|
|
1545
1546
|
fontSize: 16,
|
|
1546
1547
|
color: Colours.TEXT_DARK,
|
|
1547
1548
|
marginLeft: 8
|
|
@@ -1573,7 +1574,8 @@ const mapStateToProps = state => {
|
|
|
1573
1574
|
phoneNumber,
|
|
1574
1575
|
permissions,
|
|
1575
1576
|
colourBrandingMain: Colours.getMainBrandingColourFromState(state),
|
|
1576
|
-
strings: ((_state$strings = state.strings) === null || _state$strings === void 0 ? void 0 : _state$strings.config) || {}
|
|
1577
|
+
strings: ((_state$strings = state.strings) === null || _state$strings === void 0 ? void 0 : _state$strings.config) || {},
|
|
1578
|
+
optionOnlyForResidents: Helper.getSiteSettingFromState(state, values.optionOnlyForResidents)
|
|
1577
1579
|
};
|
|
1578
1580
|
};
|
|
1579
1581
|
export default connect(mapStateToProps, {
|