@plusscommunities/pluss-maintenance-app-forms 6.0.21-beta.0 → 6.0.21
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 +22 -129
- package/dist/module/screens/MaintenanceUserPicker.js.map +1 -1
- package/dist/module/screens/RequestDetail.js +0 -1
- 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 +194 -190
- 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 +34 -34
- package/dist/module/values.config.js.map +1 -1
- package/package.json +51 -51
- 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 +100 -252
- package/src/screens/RequestDetail.js +1 -1
- package/src/screens/RequestNotes.js +806 -950
- package/src/screens/ServiceRequest.js +1557 -1781
- 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 +39 -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));
|
|
@@ -642,7 +645,7 @@ class MaintenanceRequest extends Component {
|
|
|
642
645
|
customFields: selected.hasCustomFields && selected.customFields.length > 0 ? _.cloneDeep(selected.customFields) : [],
|
|
643
646
|
loadingTypes: false
|
|
644
647
|
};
|
|
645
|
-
if (!_.isEmpty(update.customFields) && !_.some(update.customFields,
|
|
648
|
+
if (!_.isEmpty(update.customFields) && !_.some(update.customFields, 'isTitle')) {
|
|
646
649
|
update.title = this.state.userName;
|
|
647
650
|
}
|
|
648
651
|
this.setState(update);
|
|
@@ -672,7 +675,7 @@ class MaintenanceRequest extends Component {
|
|
|
672
675
|
if (!this.props.connected) {
|
|
673
676
|
this.setState({
|
|
674
677
|
error: {
|
|
675
|
-
message:
|
|
678
|
+
message: 'No internet connection detected'
|
|
676
679
|
}
|
|
677
680
|
});
|
|
678
681
|
}
|
|
@@ -686,14 +689,14 @@ class MaintenanceRequest extends Component {
|
|
|
686
689
|
|
|
687
690
|
// PC-1255: Validate user selection for on-behalf requests
|
|
688
691
|
if (this.state.canCreateOnBehalf && !this.state.selectedUser) {
|
|
689
|
-
console.log(
|
|
692
|
+
console.log('submitRequest - no user selected for on-behalf request');
|
|
690
693
|
this.setState({
|
|
691
694
|
showError: true
|
|
692
695
|
});
|
|
693
696
|
return;
|
|
694
697
|
}
|
|
695
698
|
if (title.length === 0 || !roomNumber || roomNumber.length === 0) {
|
|
696
|
-
console.log(
|
|
699
|
+
console.log('submitRequest - error', {
|
|
697
700
|
title,
|
|
698
701
|
roomNumber
|
|
699
702
|
});
|
|
@@ -704,7 +707,7 @@ class MaintenanceRequest extends Component {
|
|
|
704
707
|
}
|
|
705
708
|
if (hasCustomFields) {
|
|
706
709
|
if (!this.validateCustomFields()) {
|
|
707
|
-
console.log(
|
|
710
|
+
console.log('submitRequest - custom fields error');
|
|
708
711
|
this.setState({
|
|
709
712
|
showError: true
|
|
710
713
|
});
|
|
@@ -712,7 +715,7 @@ class MaintenanceRequest extends Component {
|
|
|
712
715
|
}
|
|
713
716
|
} else {
|
|
714
717
|
if (isHome && times.length < 2) {
|
|
715
|
-
console.log(
|
|
718
|
+
console.log('submitRequest - error', {
|
|
716
719
|
isHome,
|
|
717
720
|
times
|
|
718
721
|
});
|
|
@@ -736,8 +739,8 @@ class MaintenanceRequest extends Component {
|
|
|
736
739
|
width: 1400
|
|
737
740
|
},
|
|
738
741
|
quality: 0.8,
|
|
739
|
-
fileName:
|
|
740
|
-
popupTitle:
|
|
742
|
+
fileName: 'serviceImage',
|
|
743
|
+
popupTitle: 'Upload Image',
|
|
741
744
|
userId: this.props.uid,
|
|
742
745
|
allowsEditing: false,
|
|
743
746
|
multiple: true,
|
|
@@ -812,7 +815,7 @@ class MaintenanceRequest extends Component {
|
|
|
812
815
|
style: styles.documentTypeText
|
|
813
816
|
}, item.documentExt)), /*#__PURE__*/React.createElement(Text, {
|
|
814
817
|
style: styles.documentText
|
|
815
|
-
}, `${item.documentName}${item.uploading ? ` - ${item.uploadProgress}` :
|
|
818
|
+
}, `${item.documentName}${item.uploading ? ` - ${item.uploadProgress}` : ''}`), !item.uploading && /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
816
819
|
style: styles.removeDocumentButton,
|
|
817
820
|
onPress: () => this.removeDocument(index, fieldId)
|
|
818
821
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
@@ -829,7 +832,7 @@ class MaintenanceRequest extends Component {
|
|
|
829
832
|
style: {
|
|
830
833
|
padding: 16,
|
|
831
834
|
flex: 1,
|
|
832
|
-
backgroundColor:
|
|
835
|
+
backgroundColor: '#fff'
|
|
833
836
|
}
|
|
834
837
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
835
838
|
style: styles.requestSuccess
|
|
@@ -857,7 +860,7 @@ class MaintenanceRequest extends Component {
|
|
|
857
860
|
style: styles.documentListContainer
|
|
858
861
|
}, documentsList.length > 0 ? documentsList.map((document, index) => this.renderDocument(document, index, fieldId)) : null, /*#__PURE__*/React.createElement(Components.DocumentUploader, {
|
|
859
862
|
buttonTitle: "Add Files",
|
|
860
|
-
allowedTypes: [
|
|
863
|
+
allowedTypes: ['application/pdf'],
|
|
861
864
|
onUploadStarted: (uploadUri, uri, name, ext) => this.onUploadStartedDocument(uploadUri, uri, name, ext, fieldId),
|
|
862
865
|
onUploadProgress: progress => this.onUploadProgressDocument(progress, fieldId),
|
|
863
866
|
onUploadSuccess: (uri, uploadUri) => this.onUploadSuccessDocument(uri, uploadUri, fieldId),
|
|
@@ -870,16 +873,16 @@ class MaintenanceRequest extends Component {
|
|
|
870
873
|
}
|
|
871
874
|
renderDateField(field, fieldId, sectionStyle) {
|
|
872
875
|
let displayText, placeHolder, icon, errorText;
|
|
873
|
-
if (field.type ===
|
|
874
|
-
displayText = field.answer ? moment(field.answer,
|
|
875
|
-
placeHolder =
|
|
876
|
-
icon =
|
|
877
|
-
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';
|
|
878
881
|
} else {
|
|
879
|
-
displayText = field.answer ? moment(field.answer,
|
|
880
|
-
placeHolder =
|
|
881
|
-
icon =
|
|
882
|
-
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';
|
|
883
886
|
}
|
|
884
887
|
return /*#__PURE__*/React.createElement(Components.GenericInputSection, {
|
|
885
888
|
key: fieldId,
|
|
@@ -917,7 +920,7 @@ class MaintenanceRequest extends Component {
|
|
|
917
920
|
marginBottom: 24
|
|
918
921
|
};
|
|
919
922
|
switch (field.type) {
|
|
920
|
-
case
|
|
923
|
+
case 'yn':
|
|
921
924
|
return /*#__PURE__*/React.createElement(Components.GenericInputSection, {
|
|
922
925
|
key: fieldId,
|
|
923
926
|
label: field.label,
|
|
@@ -929,7 +932,7 @@ class MaintenanceRequest extends Component {
|
|
|
929
932
|
showError: this.state.showError,
|
|
930
933
|
required: field.mandatory
|
|
931
934
|
});
|
|
932
|
-
case
|
|
935
|
+
case 'multichoice':
|
|
933
936
|
return /*#__PURE__*/React.createElement(Components.GenericInputSection, {
|
|
934
937
|
key: fieldId,
|
|
935
938
|
label: field.label,
|
|
@@ -947,7 +950,7 @@ class MaintenanceRequest extends Component {
|
|
|
947
950
|
showError: this.state.showError,
|
|
948
951
|
required: field.mandatory
|
|
949
952
|
});
|
|
950
|
-
case
|
|
953
|
+
case 'checkbox':
|
|
951
954
|
return /*#__PURE__*/React.createElement(Components.GenericInputSection, {
|
|
952
955
|
key: fieldId,
|
|
953
956
|
label: field.label,
|
|
@@ -977,9 +980,9 @@ class MaintenanceRequest extends Component {
|
|
|
977
980
|
style: styles.multiChoiceText
|
|
978
981
|
}, o));
|
|
979
982
|
}));
|
|
980
|
-
case
|
|
981
|
-
case
|
|
982
|
-
case
|
|
983
|
+
case 'text':
|
|
984
|
+
case 'email':
|
|
985
|
+
case 'phone':
|
|
983
986
|
return /*#__PURE__*/React.createElement(Components.GenericInputSection, {
|
|
984
987
|
key: fieldId,
|
|
985
988
|
label: field.label,
|
|
@@ -990,28 +993,28 @@ class MaintenanceRequest extends Component {
|
|
|
990
993
|
squaredCorners: true,
|
|
991
994
|
isValid: () => this.isFieldValid(field, fieldId),
|
|
992
995
|
showError: this.state.showError,
|
|
993
|
-
errorText: field.type ===
|
|
996
|
+
errorText: field.type === 'email' ? 'Not a valid email' : undefined,
|
|
994
997
|
required: field.mandatory,
|
|
995
998
|
sectionStyle: sectionStyle,
|
|
996
999
|
autoCapitalize: "sentences",
|
|
997
1000
|
keyboardType: this.keyboardTypes[field.type]
|
|
998
1001
|
});
|
|
999
|
-
case
|
|
1002
|
+
case 'staticTitle':
|
|
1000
1003
|
return /*#__PURE__*/React.createElement(Text, {
|
|
1001
1004
|
key: fieldId,
|
|
1002
1005
|
style: [styles.staticTitle, {
|
|
1003
1006
|
color: this.props.colourBrandingMain
|
|
1004
1007
|
}, sectionStyle]
|
|
1005
1008
|
}, field.label);
|
|
1006
|
-
case
|
|
1009
|
+
case 'staticText':
|
|
1007
1010
|
return /*#__PURE__*/React.createElement(View, {
|
|
1008
1011
|
key: fieldId,
|
|
1009
1012
|
style: [styles.staticText, sectionStyle]
|
|
1010
1013
|
}, Helper.toParagraphed(field.label, styles.staticText));
|
|
1011
|
-
case
|
|
1012
|
-
case
|
|
1014
|
+
case 'date':
|
|
1015
|
+
case 'time':
|
|
1013
1016
|
return this.renderDateField(field, fieldId, sectionStyle);
|
|
1014
|
-
case
|
|
1017
|
+
case 'image':
|
|
1015
1018
|
return /*#__PURE__*/React.createElement(Components.GenericInputSection, {
|
|
1016
1019
|
key: fieldId,
|
|
1017
1020
|
label: field.label,
|
|
@@ -1020,7 +1023,7 @@ class MaintenanceRequest extends Component {
|
|
|
1020
1023
|
required: field.mandatory,
|
|
1021
1024
|
showError: this.state.showError
|
|
1022
1025
|
}, this.renderImageList(fieldId));
|
|
1023
|
-
case
|
|
1026
|
+
case 'document':
|
|
1024
1027
|
return /*#__PURE__*/React.createElement(Components.GenericInputSection, {
|
|
1025
1028
|
key: fieldId,
|
|
1026
1029
|
label: field.label,
|
|
@@ -1077,7 +1080,7 @@ class MaintenanceRequest extends Component {
|
|
|
1077
1080
|
marginTop: 16
|
|
1078
1081
|
}
|
|
1079
1082
|
}, this.state.canCreateOnBehalf && /*#__PURE__*/React.createElement(Components.FormCardSection, {
|
|
1080
|
-
label:
|
|
1083
|
+
label: 'Select User',
|
|
1081
1084
|
textValue: (_this$state$selectedU = this.state.selectedUser) === null || _this$state$selectedU === void 0 ? void 0 : _this$state$selectedU.displayName,
|
|
1082
1085
|
hasContent: true,
|
|
1083
1086
|
hasUnderline: true,
|
|
@@ -1099,7 +1102,7 @@ class MaintenanceRequest extends Component {
|
|
|
1099
1102
|
Diameter: 30
|
|
1100
1103
|
}), /*#__PURE__*/React.createElement(Text, {
|
|
1101
1104
|
style: styles.nameText
|
|
1102
|
-
}, ((_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, {
|
|
1103
1106
|
name: "angle-right",
|
|
1104
1107
|
type: "font-awesome",
|
|
1105
1108
|
iconStyle: [styles.sectionTitle, {
|
|
@@ -1107,11 +1110,11 @@ class MaintenanceRequest extends Component {
|
|
|
1107
1110
|
color: this.props.colourBrandingMain
|
|
1108
1111
|
}]
|
|
1109
1112
|
})))), !this.state.canCreateOnBehalf && /*#__PURE__*/React.createElement(Components.FormCardSection, {
|
|
1110
|
-
label:
|
|
1111
|
-
placeholder:
|
|
1113
|
+
label: 'Name',
|
|
1114
|
+
placeholder: 'Enter your name',
|
|
1112
1115
|
textValue: this.state.userName,
|
|
1113
1116
|
onChangeText: userName => this.onChangeName(userName),
|
|
1114
|
-
editable: this.props.userType ===
|
|
1117
|
+
editable: this.props.userType === 'KIOSK' && this.state.submitting === false,
|
|
1115
1118
|
isValid: () => {
|
|
1116
1119
|
return this.state.userName.length > 1;
|
|
1117
1120
|
},
|
|
@@ -1120,18 +1123,18 @@ class MaintenanceRequest extends Component {
|
|
|
1120
1123
|
showError: this.state.showError && this.state.userName.length < 2,
|
|
1121
1124
|
hasUnderline: true
|
|
1122
1125
|
}), /*#__PURE__*/React.createElement(Components.FormCardSection, {
|
|
1123
|
-
label:
|
|
1124
|
-
placeholder:
|
|
1126
|
+
label: 'Contact number',
|
|
1127
|
+
placeholder: 'Enter phone number',
|
|
1125
1128
|
textValue: this.state.phone,
|
|
1126
1129
|
onChangeText: phone => this.setState({
|
|
1127
1130
|
phone
|
|
1128
1131
|
}),
|
|
1129
1132
|
editable: this.state.submitting === false,
|
|
1130
1133
|
hasUnderline: true,
|
|
1131
|
-
keyboardType:
|
|
1134
|
+
keyboardType: 'phone-pad'
|
|
1132
1135
|
}), /*#__PURE__*/React.createElement(Components.FormCardSection, {
|
|
1133
|
-
label:
|
|
1134
|
-
placeholder:
|
|
1136
|
+
label: 'Address',
|
|
1137
|
+
placeholder: 'Enter your address',
|
|
1135
1138
|
textValue: this.state.roomNumber,
|
|
1136
1139
|
onChangeText: roomNumber => this.setState({
|
|
1137
1140
|
roomNumber
|
|
@@ -1149,8 +1152,8 @@ class MaintenanceRequest extends Component {
|
|
|
1149
1152
|
marginTop: 16,
|
|
1150
1153
|
paddingHorizontal: 24,
|
|
1151
1154
|
paddingVertical: 16,
|
|
1152
|
-
flexDirection:
|
|
1153
|
-
justifyContent:
|
|
1155
|
+
flexDirection: 'row',
|
|
1156
|
+
justifyContent: 'space-between'
|
|
1154
1157
|
}
|
|
1155
1158
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
1156
1159
|
style: styles.sectionTitle
|
|
@@ -1158,7 +1161,7 @@ class MaintenanceRequest extends Component {
|
|
|
1158
1161
|
onPress: this.onPressType.bind(this)
|
|
1159
1162
|
}, /*#__PURE__*/React.createElement(View, {
|
|
1160
1163
|
style: {
|
|
1161
|
-
flexDirection:
|
|
1164
|
+
flexDirection: 'row'
|
|
1162
1165
|
}
|
|
1163
1166
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
1164
1167
|
style: [styles.sectionTitle, {
|
|
@@ -1177,8 +1180,8 @@ class MaintenanceRequest extends Component {
|
|
|
1177
1180
|
marginTop: 16
|
|
1178
1181
|
}
|
|
1179
1182
|
}, /*#__PURE__*/React.createElement(Components.FormCardSection, {
|
|
1180
|
-
label:
|
|
1181
|
-
placeholder:
|
|
1183
|
+
label: 'Title',
|
|
1184
|
+
placeholder: 'Enter a title for your request',
|
|
1182
1185
|
textValue: this.state.title,
|
|
1183
1186
|
onChangeText: title => this.setState({
|
|
1184
1187
|
title
|
|
@@ -1195,8 +1198,8 @@ class MaintenanceRequest extends Component {
|
|
|
1195
1198
|
multiline: true,
|
|
1196
1199
|
autoGrow: true
|
|
1197
1200
|
}), /*#__PURE__*/React.createElement(Components.FormCardSection, {
|
|
1198
|
-
label:
|
|
1199
|
-
placeholder:
|
|
1201
|
+
label: 'Description',
|
|
1202
|
+
placeholder: 'Describe your request here in detail',
|
|
1200
1203
|
textValue: this.state.description,
|
|
1201
1204
|
onChangeText: description => this.setState({
|
|
1202
1205
|
description
|
|
@@ -1213,12 +1216,12 @@ class MaintenanceRequest extends Component {
|
|
|
1213
1216
|
}
|
|
1214
1217
|
}, /*#__PURE__*/React.createElement(View, {
|
|
1215
1218
|
style: [{
|
|
1216
|
-
width:
|
|
1219
|
+
width: '100%',
|
|
1217
1220
|
paddingVertical: 16,
|
|
1218
|
-
flexDirection:
|
|
1219
|
-
justifyContent:
|
|
1220
|
-
alignItems:
|
|
1221
|
-
position:
|
|
1221
|
+
flexDirection: 'row',
|
|
1222
|
+
justifyContent: 'space-between',
|
|
1223
|
+
alignItems: 'center',
|
|
1224
|
+
position: 'relative'
|
|
1222
1225
|
}, this.state.isHome && {
|
|
1223
1226
|
borderBottomWidth: 1,
|
|
1224
1227
|
borderBottomColor: Colours.LINEGREY
|
|
@@ -1232,13 +1235,13 @@ class MaintenanceRequest extends Component {
|
|
|
1232
1235
|
isHome: value
|
|
1233
1236
|
}),
|
|
1234
1237
|
trackColor: {
|
|
1235
|
-
false:
|
|
1238
|
+
false: '#ddd',
|
|
1236
1239
|
true: this.props.colourBrandingMain
|
|
1237
1240
|
},
|
|
1238
|
-
thumbColor: Platform.OS ===
|
|
1241
|
+
thumbColor: Platform.OS === 'android' ? '#fff' : null
|
|
1239
1242
|
})), this.state.isHome && /*#__PURE__*/React.createElement(Components.FormCardSection, {
|
|
1240
|
-
label:
|
|
1241
|
-
placeholder:
|
|
1243
|
+
label: 'Available times',
|
|
1244
|
+
placeholder: 'Describe your available times here in detail.',
|
|
1242
1245
|
textValue: this.state.times,
|
|
1243
1246
|
onChangeText: times => this.setState({
|
|
1244
1247
|
times
|
|
@@ -1260,7 +1263,7 @@ class MaintenanceRequest extends Component {
|
|
|
1260
1263
|
renderRegisterConfirmation() {
|
|
1261
1264
|
return /*#__PURE__*/React.createElement(Components.ConfirmationPopup, {
|
|
1262
1265
|
confirmText: `${values.textEntityName} submitted`,
|
|
1263
|
-
repeatText:
|
|
1266
|
+
repeatText: 'Submit another',
|
|
1264
1267
|
visible: this.state.confirmationToShow,
|
|
1265
1268
|
onClose: this.onCloseConfirmationPopup.bind(this),
|
|
1266
1269
|
onPressAction: this.onConfirmationReset.bind(this)
|
|
@@ -1284,8 +1287,8 @@ class MaintenanceRequest extends Component {
|
|
|
1284
1287
|
return null;
|
|
1285
1288
|
}
|
|
1286
1289
|
return /*#__PURE__*/React.createElement(Components.WarningPopup, {
|
|
1287
|
-
confirmText:
|
|
1288
|
-
infoText:
|
|
1290
|
+
confirmText: 'No forms are available',
|
|
1291
|
+
infoText: 'Check back later for forms.',
|
|
1289
1292
|
visible: this.state.noType,
|
|
1290
1293
|
onClose: this.onPressBack.bind(this),
|
|
1291
1294
|
padHorizontal: true
|
|
@@ -1299,7 +1302,7 @@ class MaintenanceRequest extends Component {
|
|
|
1299
1302
|
popUpType
|
|
1300
1303
|
} = this.state;
|
|
1301
1304
|
return /*#__PURE__*/React.createElement(KeyboardAvoidingView, {
|
|
1302
|
-
behavior: Platform.OS ===
|
|
1305
|
+
behavior: Platform.OS === 'ios' && 'padding',
|
|
1303
1306
|
style: styles.viewContainer
|
|
1304
1307
|
}, this.renderImageUploader(), /*#__PURE__*/React.createElement(View, {
|
|
1305
1308
|
style: styles.container
|
|
@@ -1307,7 +1310,7 @@ class MaintenanceRequest extends Component {
|
|
|
1307
1310
|
leftIcon: "angle-left",
|
|
1308
1311
|
onPressLeft: this.onPressBack.bind(this),
|
|
1309
1312
|
text: this.props.strings[`${values.featureKey}_textFeatureTitle`] || values.textFeatureTitle,
|
|
1310
|
-
rightText: submitting || success ? null :
|
|
1313
|
+
rightText: submitting || success ? null : 'Done',
|
|
1311
1314
|
onPressRight: this.submitRequest.bind(this),
|
|
1312
1315
|
absoluteRight: true
|
|
1313
1316
|
}), this.renderForm()), this.renderRegisterConfirmation(), this.renderVideoPlayerPopup(), this.renderNoType(), /*#__PURE__*/React.createElement(DateTimePicker, {
|
|
@@ -1324,52 +1327,52 @@ class MaintenanceRequest extends Component {
|
|
|
1324
1327
|
const styles = {
|
|
1325
1328
|
viewContainer: {
|
|
1326
1329
|
flex: 1,
|
|
1327
|
-
backgroundColor:
|
|
1330
|
+
backgroundColor: '#fff'
|
|
1328
1331
|
},
|
|
1329
1332
|
container: {
|
|
1330
1333
|
flex: 1,
|
|
1331
|
-
position:
|
|
1332
|
-
backgroundColor:
|
|
1334
|
+
position: 'relative',
|
|
1335
|
+
backgroundColor: '#f0f0f5'
|
|
1333
1336
|
},
|
|
1334
1337
|
errorText: {
|
|
1335
|
-
fontFamily:
|
|
1338
|
+
fontFamily: 'sf-regular',
|
|
1336
1339
|
color: Colours.COLOUR_TANGERINE,
|
|
1337
1340
|
fontSize: 16
|
|
1338
1341
|
},
|
|
1339
1342
|
requestSuccess: {
|
|
1340
|
-
fontFamily:
|
|
1343
|
+
fontFamily: 'sf-regular',
|
|
1341
1344
|
color: Colours.TEXT_DARK,
|
|
1342
1345
|
fontSize: 17,
|
|
1343
|
-
textAlign:
|
|
1346
|
+
textAlign: 'center'
|
|
1344
1347
|
},
|
|
1345
1348
|
sectionTitle: {
|
|
1346
|
-
fontFamily:
|
|
1349
|
+
fontFamily: 'sf-regular',
|
|
1347
1350
|
fontSize: 17,
|
|
1348
1351
|
color: Colours.TEXT_DARK
|
|
1349
1352
|
},
|
|
1350
1353
|
imageListContainer: {
|
|
1351
1354
|
marginTop: 8,
|
|
1352
1355
|
padding: 8,
|
|
1353
|
-
flexDirection:
|
|
1356
|
+
flexDirection: 'row',
|
|
1354
1357
|
backgroundColor: Colours.BOXGREY,
|
|
1355
1358
|
minHeight: 106
|
|
1356
1359
|
},
|
|
1357
1360
|
imageListContainerEmpty: {
|
|
1358
|
-
justifyContent:
|
|
1359
|
-
alignItems:
|
|
1360
|
-
flexDirection:
|
|
1361
|
+
justifyContent: 'center',
|
|
1362
|
+
alignItems: 'center',
|
|
1363
|
+
flexDirection: 'column'
|
|
1361
1364
|
},
|
|
1362
1365
|
documentListContainer: {
|
|
1363
1366
|
marginTop: 8,
|
|
1364
|
-
flexDirection:
|
|
1365
|
-
alignItems:
|
|
1367
|
+
flexDirection: 'column',
|
|
1368
|
+
alignItems: 'flex-start'
|
|
1366
1369
|
},
|
|
1367
1370
|
imageContainer: {
|
|
1368
1371
|
width: PHOTO_SIZE,
|
|
1369
1372
|
height: PHOTO_SIZE,
|
|
1370
|
-
borderStyle:
|
|
1371
|
-
justifyContent:
|
|
1372
|
-
alignItems:
|
|
1373
|
+
borderStyle: 'dashed',
|
|
1374
|
+
justifyContent: 'center',
|
|
1375
|
+
alignItems: 'center',
|
|
1373
1376
|
borderWidth: 1,
|
|
1374
1377
|
borderColor: Colours.LINEGREY,
|
|
1375
1378
|
borderRadius: 4,
|
|
@@ -1378,13 +1381,13 @@ const styles = {
|
|
|
1378
1381
|
imageContainerNotEmpty: {
|
|
1379
1382
|
borderWidth: 1,
|
|
1380
1383
|
borderColor: Colours.LINEGREY,
|
|
1381
|
-
backgroundColor:
|
|
1382
|
-
borderStyle:
|
|
1384
|
+
backgroundColor: '#fff',
|
|
1385
|
+
borderStyle: 'dashed'
|
|
1383
1386
|
},
|
|
1384
1387
|
imageBackground: {
|
|
1385
1388
|
flex: 1,
|
|
1386
|
-
height:
|
|
1387
|
-
width:
|
|
1389
|
+
height: '100%',
|
|
1390
|
+
width: '100%',
|
|
1388
1391
|
borderRadius: 4
|
|
1389
1392
|
},
|
|
1390
1393
|
imageCircle: {
|
|
@@ -1392,60 +1395,60 @@ const styles = {
|
|
|
1392
1395
|
height: 90,
|
|
1393
1396
|
borderRadius: 45,
|
|
1394
1397
|
backgroundColor: Colours.PINKISH_GREY,
|
|
1395
|
-
justifyContent:
|
|
1398
|
+
justifyContent: 'center'
|
|
1396
1399
|
},
|
|
1397
1400
|
addImageIcon: {
|
|
1398
|
-
color:
|
|
1401
|
+
color: '#fff',
|
|
1399
1402
|
fontSize: 32
|
|
1400
1403
|
},
|
|
1401
1404
|
imagePlayContainer: {
|
|
1402
|
-
position:
|
|
1405
|
+
position: 'absolute',
|
|
1403
1406
|
top: 0,
|
|
1404
1407
|
left: 0,
|
|
1405
1408
|
right: 0,
|
|
1406
1409
|
bottom: 0,
|
|
1407
|
-
alignItems:
|
|
1408
|
-
justifyContent:
|
|
1410
|
+
alignItems: 'center',
|
|
1411
|
+
justifyContent: 'center'
|
|
1409
1412
|
},
|
|
1410
1413
|
imageControlIcon: {
|
|
1411
|
-
color:
|
|
1414
|
+
color: '#fff',
|
|
1412
1415
|
fontSize: 20,
|
|
1413
|
-
textShadowColor:
|
|
1416
|
+
textShadowColor: 'rgba(0,0,0,0.3)',
|
|
1414
1417
|
textShadowOffset: {
|
|
1415
1418
|
width: 2,
|
|
1416
1419
|
height: 2
|
|
1417
1420
|
}
|
|
1418
1421
|
},
|
|
1419
1422
|
removeImage: {
|
|
1420
|
-
position:
|
|
1423
|
+
position: 'absolute',
|
|
1421
1424
|
top: 0,
|
|
1422
1425
|
right: 0,
|
|
1423
1426
|
padding: 4,
|
|
1424
1427
|
width: 40,
|
|
1425
1428
|
height: 40,
|
|
1426
|
-
alignItems:
|
|
1427
|
-
justifyContent:
|
|
1429
|
+
alignItems: 'center',
|
|
1430
|
+
justifyContent: 'center'
|
|
1428
1431
|
},
|
|
1429
1432
|
staticTitle: {
|
|
1430
1433
|
fontSize: 20,
|
|
1431
|
-
fontFamily:
|
|
1434
|
+
fontFamily: 'sf-semibold',
|
|
1432
1435
|
color: Colours.TEXT_DARKEST
|
|
1433
1436
|
},
|
|
1434
1437
|
staticText: {
|
|
1435
1438
|
fontSize: 17,
|
|
1436
|
-
fontFamily:
|
|
1439
|
+
fontFamily: 'sf-regular',
|
|
1437
1440
|
color: Colours.TEXT_DARKEST,
|
|
1438
1441
|
lineHeight: 24
|
|
1439
1442
|
},
|
|
1440
1443
|
multiChoiceOption: {
|
|
1441
1444
|
marginTop: 16,
|
|
1442
|
-
flexDirection:
|
|
1443
|
-
alignItems:
|
|
1445
|
+
flexDirection: 'row',
|
|
1446
|
+
alignItems: 'center',
|
|
1444
1447
|
minHeight: 20
|
|
1445
1448
|
},
|
|
1446
1449
|
multiChoiceText: {
|
|
1447
1450
|
flex: 1,
|
|
1448
|
-
fontFamily:
|
|
1451
|
+
fontFamily: 'sf-medium',
|
|
1449
1452
|
fontSize: 14,
|
|
1450
1453
|
color: Colours.TEXT_DARK
|
|
1451
1454
|
},
|
|
@@ -1462,24 +1465,24 @@ const styles = {
|
|
|
1462
1465
|
borderRadius: 4
|
|
1463
1466
|
},
|
|
1464
1467
|
dateContainer: {
|
|
1465
|
-
flexDirection:
|
|
1466
|
-
alignItems:
|
|
1468
|
+
flexDirection: 'row',
|
|
1469
|
+
alignItems: 'center'
|
|
1467
1470
|
},
|
|
1468
1471
|
dateFieldButton: {
|
|
1469
1472
|
flex: 1
|
|
1470
1473
|
},
|
|
1471
1474
|
dateFieldContainer: {
|
|
1472
|
-
flexDirection:
|
|
1475
|
+
flexDirection: 'row',
|
|
1473
1476
|
borderRadius: 2,
|
|
1474
|
-
backgroundColor:
|
|
1477
|
+
backgroundColor: '#ebeff2',
|
|
1475
1478
|
padding: 8,
|
|
1476
1479
|
marginTop: 8
|
|
1477
1480
|
},
|
|
1478
1481
|
dateText: {
|
|
1479
1482
|
flex: 1,
|
|
1480
|
-
fontFamily:
|
|
1483
|
+
fontFamily: 'sf-regular',
|
|
1481
1484
|
fontSize: 16,
|
|
1482
|
-
color:
|
|
1485
|
+
color: '#65686D'
|
|
1483
1486
|
},
|
|
1484
1487
|
dateIcon: {
|
|
1485
1488
|
fontSize: 18,
|
|
@@ -1493,36 +1496,36 @@ const styles = {
|
|
|
1493
1496
|
color: Colours.TEXT_BLUEGREY
|
|
1494
1497
|
},
|
|
1495
1498
|
documentContainer: {
|
|
1496
|
-
flexDirection:
|
|
1497
|
-
alignItems:
|
|
1498
|
-
justifyContent:
|
|
1499
|
+
flexDirection: 'row',
|
|
1500
|
+
alignItems: 'center',
|
|
1501
|
+
justifyContent: 'space-between',
|
|
1499
1502
|
paddingVertical: 4
|
|
1500
1503
|
},
|
|
1501
1504
|
documentTypeContainer: {
|
|
1502
1505
|
width: 50,
|
|
1503
1506
|
height: 60,
|
|
1504
|
-
justifyContent:
|
|
1505
|
-
alignItems:
|
|
1507
|
+
justifyContent: 'center',
|
|
1508
|
+
alignItems: 'center',
|
|
1506
1509
|
borderRadius: 5,
|
|
1507
1510
|
marginRight: 8
|
|
1508
1511
|
},
|
|
1509
1512
|
documentTypeText: {
|
|
1510
|
-
color:
|
|
1511
|
-
fontFamily:
|
|
1512
|
-
textAlign:
|
|
1513
|
+
color: '#fff',
|
|
1514
|
+
fontFamily: 'sf-semibold',
|
|
1515
|
+
textAlign: 'center'
|
|
1513
1516
|
},
|
|
1514
1517
|
documentText: {
|
|
1515
1518
|
flex: 1,
|
|
1516
|
-
fontFamily:
|
|
1519
|
+
fontFamily: 'sf-semibold',
|
|
1517
1520
|
fontSize: 16,
|
|
1518
|
-
color:
|
|
1521
|
+
color: '#65686D'
|
|
1519
1522
|
},
|
|
1520
1523
|
removeDocumentButton: {
|
|
1521
1524
|
padding: 4,
|
|
1522
1525
|
width: 40,
|
|
1523
1526
|
height: 40,
|
|
1524
|
-
alignItems:
|
|
1525
|
-
justifyContent:
|
|
1527
|
+
alignItems: 'center',
|
|
1528
|
+
justifyContent: 'center',
|
|
1526
1529
|
marginLeft: 8
|
|
1527
1530
|
},
|
|
1528
1531
|
removeDocumentIcon: {
|
|
@@ -1530,16 +1533,16 @@ const styles = {
|
|
|
1530
1533
|
},
|
|
1531
1534
|
// PC-1255: User picker styles
|
|
1532
1535
|
userPickerContainer: {
|
|
1533
|
-
flexDirection:
|
|
1534
|
-
justifyContent:
|
|
1535
|
-
alignItems:
|
|
1536
|
+
flexDirection: 'row',
|
|
1537
|
+
justifyContent: 'space-between',
|
|
1538
|
+
alignItems: 'center'
|
|
1536
1539
|
},
|
|
1537
1540
|
profileContainer: {
|
|
1538
|
-
flexDirection:
|
|
1539
|
-
alignItems:
|
|
1541
|
+
flexDirection: 'row',
|
|
1542
|
+
alignItems: 'center'
|
|
1540
1543
|
},
|
|
1541
1544
|
nameText: {
|
|
1542
|
-
fontFamily:
|
|
1545
|
+
fontFamily: 'sf-medium',
|
|
1543
1546
|
fontSize: 16,
|
|
1544
1547
|
color: Colours.TEXT_DARK,
|
|
1545
1548
|
marginLeft: 8
|
|
@@ -1571,7 +1574,8 @@ const mapStateToProps = state => {
|
|
|
1571
1574
|
phoneNumber,
|
|
1572
1575
|
permissions,
|
|
1573
1576
|
colourBrandingMain: Colours.getMainBrandingColourFromState(state),
|
|
1574
|
-
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)
|
|
1575
1579
|
};
|
|
1576
1580
|
};
|
|
1577
1581
|
export default connect(mapStateToProps, {
|