@plusscommunities/pluss-maintenance-app-forms 7.0.20-auth.0 → 7.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 +42 -34
- 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 +129 -22
- package/dist/module/screens/MaintenanceUserPicker.js.map +1 -1
- package/dist/module/screens/RequestDetail.js +252 -137
- 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 +198 -186
- 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 +52 -56
- package/src/actions/JobActions.js +67 -60
- package/src/actions/index.js +1 -1
- package/src/actions/types.js +1 -2
- package/src/apis/index.js +3 -3
- package/src/apis/maintenanceActions.js +189 -172
- package/src/apis/userActions.js +17 -17
- package/src/components/FilterPopupMenu.js +313 -256
- package/src/components/MaintenanceList.js +396 -317
- package/src/components/MaintenanceListItem.js +347 -288
- package/src/components/MaintenanceWidgetItem.js +145 -124
- package/src/components/PrioritySelectorPopup.js +81 -68
- package/src/components/StatusSelectorPopup.js +81 -70
- package/src/components/WidgetLarge.js +5 -5
- package/src/components/WidgetSmall.js +153 -133
- package/src/core.config.js +27 -3
- package/src/feature.config.js +62 -62
- package/src/helper.js +58 -53
- package/src/index.js +22 -22
- package/src/reducers/JobsReducer.js +85 -66
- package/src/screens/JobTypePicker.js +115 -92
- package/src/screens/MaintenancePage.js +89 -80
- package/src/screens/MaintenanceUserPicker.js +262 -99
- package/src/screens/RequestDetail.js +1344 -1021
- package/src/screens/RequestNotes.js +946 -805
- package/src/screens/ServiceRequest.js +1773 -1544
- 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 "@rneui/themed";
|
|
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,11 +106,19 @@ class MaintenanceRequest extends Component {
|
|
|
103
106
|
if (userDetails.unit) {
|
|
104
107
|
update.roomNumber = userDetails.unit;
|
|
105
108
|
}
|
|
109
|
+
if (!this.state.customFields || !_.some(this.state.customFields, "isTitle")) {
|
|
110
|
+
update.title = userDetails.displayName || null;
|
|
111
|
+
}
|
|
106
112
|
}
|
|
107
113
|
} catch (error) {
|
|
108
114
|
// Permission denied (403) or other error - continue without auto-population
|
|
109
115
|
// User can still manually enter contact details
|
|
110
|
-
console.log(
|
|
116
|
+
console.log("Could not fetch user details for auto-population:", error);
|
|
117
|
+
} finally {
|
|
118
|
+
// In any case, we still need a title. Inform the user to set one form field as a title.
|
|
119
|
+
if (!state.title && !update.title) {
|
|
120
|
+
update.title = "[Missing title - Set one of the form field as title in the community manager]";
|
|
121
|
+
}
|
|
111
122
|
}
|
|
112
123
|
this.setState(update);
|
|
113
124
|
});
|
|
@@ -135,7 +146,7 @@ class MaintenanceRequest extends Component {
|
|
|
135
146
|
};
|
|
136
147
|
const field = update.customFields[fieldId];
|
|
137
148
|
field.answer = _.xor(field.answer || [], [answer]);
|
|
138
|
-
if (field.isTitle) update.title = field.answer.join(
|
|
149
|
+
if (field.isTitle) update.title = field.answer.join(", ");
|
|
139
150
|
this.setState(update);
|
|
140
151
|
});
|
|
141
152
|
_defineProperty(this, "onOpenDatePicker", (field, fieldId) => {
|
|
@@ -168,12 +179,12 @@ class MaintenanceRequest extends Component {
|
|
|
168
179
|
};
|
|
169
180
|
const field = update.customFields[dateFieldId];
|
|
170
181
|
const dateObj = moment(date);
|
|
171
|
-
if (popUpType ===
|
|
172
|
-
field.answer = dateObj.format(
|
|
173
|
-
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");
|
|
174
185
|
} else {
|
|
175
|
-
field.answer = dateObj.format(
|
|
176
|
-
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");
|
|
177
188
|
}
|
|
178
189
|
this.setState(update);
|
|
179
190
|
});
|
|
@@ -184,7 +195,7 @@ class MaintenanceRequest extends Component {
|
|
|
184
195
|
const imagesUpdate = this.getImages(imageFieldId);
|
|
185
196
|
imagesUpdate.splice(imagesUpdate.length - 1, 0, {
|
|
186
197
|
uploading: true,
|
|
187
|
-
uploadProgress:
|
|
198
|
+
uploadProgress: "0%",
|
|
188
199
|
uploadUri,
|
|
189
200
|
imageUri,
|
|
190
201
|
allowRetry: true
|
|
@@ -212,7 +223,7 @@ class MaintenanceRequest extends Component {
|
|
|
212
223
|
const imagesUpdate = this.getImages(imageFieldId);
|
|
213
224
|
imagesUpdate.map(img => {
|
|
214
225
|
if (img.uploadUri === uploadUri && img.uploading) {
|
|
215
|
-
img.url = uri.replace(
|
|
226
|
+
img.url = uri.replace("/general/", "/general1400/");
|
|
216
227
|
img.thumbNailExists = false;
|
|
217
228
|
img.thumbNailUrl = Helper.getThumb300(img.url);
|
|
218
229
|
img.allowRetry = true;
|
|
@@ -228,7 +239,7 @@ class MaintenanceRequest extends Component {
|
|
|
228
239
|
imagesUpdate.map(img => {
|
|
229
240
|
if (img.uploadUri === uploadUri) {
|
|
230
241
|
img.uploading = true; // Requried for retry
|
|
231
|
-
img.uploadProgress =
|
|
242
|
+
img.uploadProgress = "";
|
|
232
243
|
img.allowRetry = true;
|
|
233
244
|
}
|
|
234
245
|
});
|
|
@@ -252,7 +263,7 @@ class MaintenanceRequest extends Component {
|
|
|
252
263
|
const documentsUpdate = this.getDocuments(documentFieldId);
|
|
253
264
|
documentsUpdate.splice(documentsUpdate.length - 1, 0, {
|
|
254
265
|
uploading: true,
|
|
255
|
-
uploadProgress:
|
|
266
|
+
uploadProgress: "0%",
|
|
256
267
|
uploadUri,
|
|
257
268
|
documentUri,
|
|
258
269
|
documentName,
|
|
@@ -277,7 +288,7 @@ class MaintenanceRequest extends Component {
|
|
|
277
288
|
documentsUpdate.map(doc => {
|
|
278
289
|
if (doc.uploadUri === uploadUri && doc.uploading) {
|
|
279
290
|
doc.uploading = false;
|
|
280
|
-
doc.uploadProgress =
|
|
291
|
+
doc.uploadProgress = "100%";
|
|
281
292
|
doc.url = uri;
|
|
282
293
|
doc.allowRetry = true;
|
|
283
294
|
}
|
|
@@ -289,7 +300,7 @@ class MaintenanceRequest extends Component {
|
|
|
289
300
|
documentsUpdate.map(doc => {
|
|
290
301
|
if (doc.uploadUri === uploadUri) {
|
|
291
302
|
doc.uploading = true; // Requried for retry
|
|
292
|
-
doc.uploadProgress =
|
|
303
|
+
doc.uploadProgress = "";
|
|
293
304
|
doc.allowRetry = true;
|
|
294
305
|
}
|
|
295
306
|
});
|
|
@@ -301,19 +312,19 @@ class MaintenanceRequest extends Component {
|
|
|
301
312
|
type,
|
|
302
313
|
answer
|
|
303
314
|
} = field;
|
|
304
|
-
if ([
|
|
315
|
+
if (["staticTitle", "staticText"].includes(type)) return true;
|
|
305
316
|
const checkMandatory = () => {
|
|
306
317
|
if (!mandatory) return true;
|
|
307
318
|
switch (type) {
|
|
308
|
-
case
|
|
319
|
+
case "yn":
|
|
309
320
|
return _.isBoolean(answer);
|
|
310
|
-
case
|
|
321
|
+
case "image":
|
|
311
322
|
const imagesList = this.getImageUrls(fieldId);
|
|
312
323
|
return imagesList.length > 0;
|
|
313
|
-
case
|
|
324
|
+
case "document":
|
|
314
325
|
const documentsList = this.getDocumentAnswers(fieldId);
|
|
315
326
|
return documentsList.length > 0;
|
|
316
|
-
case
|
|
327
|
+
case "checkbox":
|
|
317
328
|
return _.isArray(answer) && answer.length > 0;
|
|
318
329
|
default:
|
|
319
330
|
return !_.isNil(answer) && !_.isEmpty(answer);
|
|
@@ -322,12 +333,12 @@ class MaintenanceRequest extends Component {
|
|
|
322
333
|
const checkFormat = () => {
|
|
323
334
|
if (_.isNil(answer) || _.isEmpty(answer)) return true;
|
|
324
335
|
switch (type) {
|
|
325
|
-
case
|
|
336
|
+
case "email":
|
|
326
337
|
return Helper.isEmail(answer);
|
|
327
|
-
case
|
|
328
|
-
return moment(answer,
|
|
329
|
-
case
|
|
330
|
-
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();
|
|
331
342
|
default:
|
|
332
343
|
return true;
|
|
333
344
|
}
|
|
@@ -363,8 +374,8 @@ class MaintenanceRequest extends Component {
|
|
|
363
374
|
// Fix custom images field answers
|
|
364
375
|
const customFields = _.cloneDeep(this.state.customFields);
|
|
365
376
|
const updatedCustomFields = customFields.map((field, fieldId) => {
|
|
366
|
-
if (field.type ===
|
|
367
|
-
if (field.type ===
|
|
377
|
+
if (field.type === "image") field.answer = this.getImageUrls(fieldId);
|
|
378
|
+
if (field.type === "document") field.answer = this.getDocumentAnswers(fieldId);
|
|
368
379
|
return field;
|
|
369
380
|
});
|
|
370
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 => {
|
|
@@ -382,7 +393,7 @@ class MaintenanceRequest extends Component {
|
|
|
382
393
|
});
|
|
383
394
|
}
|
|
384
395
|
}).catch(err => {
|
|
385
|
-
console.log(
|
|
396
|
+
console.log("maintenance submission fail.");
|
|
386
397
|
console.log(err);
|
|
387
398
|
this.setState({
|
|
388
399
|
submitting: false
|
|
@@ -394,7 +405,7 @@ class MaintenanceRequest extends Component {
|
|
|
394
405
|
const job = await maintenanceActions.getJob(Helper.getSite(this.props.site), id);
|
|
395
406
|
this.props.jobAdded(job.data);
|
|
396
407
|
} catch (error) {
|
|
397
|
-
console.log(
|
|
408
|
+
console.log("refreshRequest error", error);
|
|
398
409
|
}
|
|
399
410
|
});
|
|
400
411
|
_defineProperty(this, "validateCustomFields", () => {
|
|
@@ -513,7 +524,7 @@ class MaintenanceRequest extends Component {
|
|
|
513
524
|
this.setDocuments(documentsUpdate, fieldId);
|
|
514
525
|
});
|
|
515
526
|
_defineProperty(this, "toggleFullscreenVideo", url => {
|
|
516
|
-
if (typeof url !==
|
|
527
|
+
if (typeof url !== "string") url = "";
|
|
517
528
|
this.setState({
|
|
518
529
|
showFullscreenVideo: url.length > 0,
|
|
519
530
|
currentVideoUrl: url
|
|
@@ -526,19 +537,19 @@ class MaintenanceRequest extends Component {
|
|
|
526
537
|
error: null,
|
|
527
538
|
showError: false,
|
|
528
539
|
loadingTypes: values.forceCustomFields,
|
|
529
|
-
userName:
|
|
530
|
-
roomNumber:
|
|
531
|
-
phone:
|
|
532
|
-
title:
|
|
533
|
-
description:
|
|
534
|
-
times:
|
|
535
|
-
type:
|
|
540
|
+
userName: "",
|
|
541
|
+
roomNumber: "",
|
|
542
|
+
phone: "",
|
|
543
|
+
title: "",
|
|
544
|
+
description: "",
|
|
545
|
+
times: "",
|
|
546
|
+
type: "General",
|
|
536
547
|
uploadingImage: false,
|
|
537
548
|
images: [{
|
|
538
549
|
add: true
|
|
539
550
|
}],
|
|
540
551
|
showFullscreenVideo: false,
|
|
541
|
-
currentVideoUrl:
|
|
552
|
+
currentVideoUrl: "",
|
|
542
553
|
isHome: false,
|
|
543
554
|
types: [],
|
|
544
555
|
confirmationToShow: false,
|
|
@@ -546,7 +557,7 @@ class MaintenanceRequest extends Component {
|
|
|
546
557
|
customFieldImages: {},
|
|
547
558
|
customFieldDocuments: {},
|
|
548
559
|
isDateTimePickerVisible: false,
|
|
549
|
-
popUpType:
|
|
560
|
+
popUpType: "date",
|
|
550
561
|
dateFieldId: null,
|
|
551
562
|
imageFieldId: null,
|
|
552
563
|
// PC-1255: On-behalf request fields
|
|
@@ -556,9 +567,9 @@ class MaintenanceRequest extends Component {
|
|
|
556
567
|
};
|
|
557
568
|
this.checkThumb = null;
|
|
558
569
|
this.keyboardTypes = {
|
|
559
|
-
phone:
|
|
560
|
-
email:
|
|
561
|
-
text:
|
|
570
|
+
phone: "phone-pad",
|
|
571
|
+
email: "email-address",
|
|
572
|
+
text: "default"
|
|
562
573
|
};
|
|
563
574
|
}
|
|
564
575
|
componentDidMount() {
|
|
@@ -588,9 +599,9 @@ class MaintenanceRequest extends Component {
|
|
|
588
599
|
onConfirmationReset() {
|
|
589
600
|
this.setState({
|
|
590
601
|
confirmationToShow: false,
|
|
591
|
-
title:
|
|
592
|
-
description:
|
|
593
|
-
times:
|
|
602
|
+
title: "",
|
|
603
|
+
description: "",
|
|
604
|
+
times: "",
|
|
594
605
|
isHome: false,
|
|
595
606
|
uploadingImage: false,
|
|
596
607
|
images: [{
|
|
@@ -603,7 +614,7 @@ class MaintenanceRequest extends Component {
|
|
|
603
614
|
customFieldImages: {},
|
|
604
615
|
customFieldDocuments: {},
|
|
605
616
|
isDateTimePickerVisible: false,
|
|
606
|
-
popUpType:
|
|
617
|
+
popUpType: "date",
|
|
607
618
|
dateFieldId: null,
|
|
608
619
|
imageFieldId: null
|
|
609
620
|
}, () => this.pickType(this.state.type));
|
|
@@ -634,7 +645,7 @@ class MaintenanceRequest extends Component {
|
|
|
634
645
|
customFields: selected.hasCustomFields && selected.customFields.length > 0 ? _.cloneDeep(selected.customFields) : [],
|
|
635
646
|
loadingTypes: false
|
|
636
647
|
};
|
|
637
|
-
if (!_.isEmpty(update.customFields) && !_.some(update.customFields,
|
|
648
|
+
if (!_.isEmpty(update.customFields) && !_.some(update.customFields, "isTitle")) {
|
|
638
649
|
update.title = this.state.userName;
|
|
639
650
|
}
|
|
640
651
|
this.setState(update);
|
|
@@ -664,7 +675,7 @@ class MaintenanceRequest extends Component {
|
|
|
664
675
|
if (!this.props.connected) {
|
|
665
676
|
this.setState({
|
|
666
677
|
error: {
|
|
667
|
-
message:
|
|
678
|
+
message: "No internet connection detected"
|
|
668
679
|
}
|
|
669
680
|
});
|
|
670
681
|
}
|
|
@@ -678,14 +689,14 @@ class MaintenanceRequest extends Component {
|
|
|
678
689
|
|
|
679
690
|
// PC-1255: Validate user selection for on-behalf requests
|
|
680
691
|
if (this.state.canCreateOnBehalf && !this.state.selectedUser) {
|
|
681
|
-
console.log(
|
|
692
|
+
console.log("submitRequest - no user selected for on-behalf request");
|
|
682
693
|
this.setState({
|
|
683
694
|
showError: true
|
|
684
695
|
});
|
|
685
696
|
return;
|
|
686
697
|
}
|
|
687
698
|
if (title.length === 0 || !roomNumber || roomNumber.length === 0) {
|
|
688
|
-
console.log(
|
|
699
|
+
console.log("submitRequest - error", {
|
|
689
700
|
title,
|
|
690
701
|
roomNumber
|
|
691
702
|
});
|
|
@@ -696,7 +707,7 @@ class MaintenanceRequest extends Component {
|
|
|
696
707
|
}
|
|
697
708
|
if (hasCustomFields) {
|
|
698
709
|
if (!this.validateCustomFields()) {
|
|
699
|
-
console.log(
|
|
710
|
+
console.log("submitRequest - custom fields error");
|
|
700
711
|
this.setState({
|
|
701
712
|
showError: true
|
|
702
713
|
});
|
|
@@ -704,7 +715,7 @@ class MaintenanceRequest extends Component {
|
|
|
704
715
|
}
|
|
705
716
|
} else {
|
|
706
717
|
if (isHome && times.length < 2) {
|
|
707
|
-
console.log(
|
|
718
|
+
console.log("submitRequest - error", {
|
|
708
719
|
isHome,
|
|
709
720
|
times
|
|
710
721
|
});
|
|
@@ -728,8 +739,8 @@ class MaintenanceRequest extends Component {
|
|
|
728
739
|
width: 1400
|
|
729
740
|
},
|
|
730
741
|
quality: 0.8,
|
|
731
|
-
fileName:
|
|
732
|
-
popupTitle:
|
|
742
|
+
fileName: "serviceImage",
|
|
743
|
+
popupTitle: "Upload Image",
|
|
733
744
|
userId: this.props.uid,
|
|
734
745
|
allowsEditing: false,
|
|
735
746
|
multiple: true,
|
|
@@ -804,7 +815,7 @@ class MaintenanceRequest extends Component {
|
|
|
804
815
|
style: styles.documentTypeText
|
|
805
816
|
}, item.documentExt)), /*#__PURE__*/React.createElement(Text, {
|
|
806
817
|
style: styles.documentText
|
|
807
|
-
}, `${item.documentName}${item.uploading ? ` - ${item.uploadProgress}` :
|
|
818
|
+
}, `${item.documentName}${item.uploading ? ` - ${item.uploadProgress}` : ""}`), !item.uploading && /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
808
819
|
style: styles.removeDocumentButton,
|
|
809
820
|
onPress: () => this.removeDocument(index, fieldId)
|
|
810
821
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
@@ -821,7 +832,7 @@ class MaintenanceRequest extends Component {
|
|
|
821
832
|
style: {
|
|
822
833
|
padding: 16,
|
|
823
834
|
flex: 1,
|
|
824
|
-
backgroundColor:
|
|
835
|
+
backgroundColor: "#fff"
|
|
825
836
|
}
|
|
826
837
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
827
838
|
style: styles.requestSuccess
|
|
@@ -867,16 +878,16 @@ class MaintenanceRequest extends Component {
|
|
|
867
878
|
|
|
868
879
|
renderDateField(field, fieldId, sectionStyle) {
|
|
869
880
|
let displayText, placeHolder, icon, errorText;
|
|
870
|
-
if (field.type ===
|
|
871
|
-
displayText = field.answer ? moment(field.answer,
|
|
872
|
-
placeHolder =
|
|
873
|
-
icon =
|
|
874
|
-
errorText =
|
|
881
|
+
if (field.type === "date") {
|
|
882
|
+
displayText = field.answer ? moment(field.answer, "YYYY-MM-DD").format("DD MMM YYYY") : "";
|
|
883
|
+
placeHolder = "dd mmm yyyy";
|
|
884
|
+
icon = "calendar";
|
|
885
|
+
errorText = "Not a valid date";
|
|
875
886
|
} else {
|
|
876
|
-
displayText = field.answer ? moment(field.answer,
|
|
877
|
-
placeHolder =
|
|
878
|
-
icon =
|
|
879
|
-
errorText =
|
|
887
|
+
displayText = field.answer ? moment(field.answer, "HH:mm").format("h:mm a") : "";
|
|
888
|
+
placeHolder = "--:-- --";
|
|
889
|
+
icon = "clock-o";
|
|
890
|
+
errorText = "Not a valid time";
|
|
880
891
|
}
|
|
881
892
|
return /*#__PURE__*/React.createElement(Components.GenericInputSection, {
|
|
882
893
|
key: fieldId,
|
|
@@ -914,7 +925,7 @@ class MaintenanceRequest extends Component {
|
|
|
914
925
|
marginBottom: 24
|
|
915
926
|
};
|
|
916
927
|
switch (field.type) {
|
|
917
|
-
case
|
|
928
|
+
case "yn":
|
|
918
929
|
return /*#__PURE__*/React.createElement(Components.GenericInputSection, {
|
|
919
930
|
key: fieldId,
|
|
920
931
|
label: field.label,
|
|
@@ -926,7 +937,7 @@ class MaintenanceRequest extends Component {
|
|
|
926
937
|
showError: this.state.showError,
|
|
927
938
|
required: field.mandatory
|
|
928
939
|
});
|
|
929
|
-
case
|
|
940
|
+
case "multichoice":
|
|
930
941
|
return /*#__PURE__*/React.createElement(Components.GenericInputSection, {
|
|
931
942
|
key: fieldId,
|
|
932
943
|
label: field.label,
|
|
@@ -944,7 +955,7 @@ class MaintenanceRequest extends Component {
|
|
|
944
955
|
showError: this.state.showError,
|
|
945
956
|
required: field.mandatory
|
|
946
957
|
});
|
|
947
|
-
case
|
|
958
|
+
case "checkbox":
|
|
948
959
|
return /*#__PURE__*/React.createElement(Components.GenericInputSection, {
|
|
949
960
|
key: fieldId,
|
|
950
961
|
label: field.label,
|
|
@@ -974,9 +985,9 @@ class MaintenanceRequest extends Component {
|
|
|
974
985
|
style: styles.multiChoiceText
|
|
975
986
|
}, o));
|
|
976
987
|
}));
|
|
977
|
-
case
|
|
978
|
-
case
|
|
979
|
-
case
|
|
988
|
+
case "text":
|
|
989
|
+
case "email":
|
|
990
|
+
case "phone":
|
|
980
991
|
return /*#__PURE__*/React.createElement(Components.GenericInputSection, {
|
|
981
992
|
key: fieldId,
|
|
982
993
|
label: field.label,
|
|
@@ -987,28 +998,28 @@ class MaintenanceRequest extends Component {
|
|
|
987
998
|
squaredCorners: true,
|
|
988
999
|
isValid: () => this.isFieldValid(field, fieldId),
|
|
989
1000
|
showError: this.state.showError,
|
|
990
|
-
errorText: field.type ===
|
|
1001
|
+
errorText: field.type === "email" ? "Not a valid email" : undefined,
|
|
991
1002
|
required: field.mandatory,
|
|
992
1003
|
sectionStyle: sectionStyle,
|
|
993
1004
|
autoCapitalize: "sentences",
|
|
994
1005
|
keyboardType: this.keyboardTypes[field.type]
|
|
995
1006
|
});
|
|
996
|
-
case
|
|
1007
|
+
case "staticTitle":
|
|
997
1008
|
return /*#__PURE__*/React.createElement(Text, {
|
|
998
1009
|
key: fieldId,
|
|
999
1010
|
style: [styles.staticTitle, {
|
|
1000
1011
|
color: this.props.colourBrandingMain
|
|
1001
1012
|
}, sectionStyle]
|
|
1002
1013
|
}, field.label);
|
|
1003
|
-
case
|
|
1014
|
+
case "staticText":
|
|
1004
1015
|
return /*#__PURE__*/React.createElement(View, {
|
|
1005
1016
|
key: fieldId,
|
|
1006
1017
|
style: [styles.staticText, sectionStyle]
|
|
1007
1018
|
}, Helper.toParagraphed(field.label, styles.staticText));
|
|
1008
|
-
case
|
|
1009
|
-
case
|
|
1019
|
+
case "date":
|
|
1020
|
+
case "time":
|
|
1010
1021
|
return this.renderDateField(field, fieldId, sectionStyle);
|
|
1011
|
-
case
|
|
1022
|
+
case "image":
|
|
1012
1023
|
return /*#__PURE__*/React.createElement(Components.GenericInputSection, {
|
|
1013
1024
|
key: fieldId,
|
|
1014
1025
|
label: field.label,
|
|
@@ -1078,7 +1089,7 @@ class MaintenanceRequest extends Component {
|
|
|
1078
1089
|
marginTop: 16
|
|
1079
1090
|
}
|
|
1080
1091
|
}, this.state.canCreateOnBehalf && /*#__PURE__*/React.createElement(Components.FormCardSection, {
|
|
1081
|
-
label:
|
|
1092
|
+
label: "Select User",
|
|
1082
1093
|
textValue: (_this$state$selectedU = this.state.selectedUser) === null || _this$state$selectedU === void 0 ? void 0 : _this$state$selectedU.displayName,
|
|
1083
1094
|
hasContent: true,
|
|
1084
1095
|
hasUnderline: true,
|
|
@@ -1100,7 +1111,7 @@ class MaintenanceRequest extends Component {
|
|
|
1100
1111
|
Diameter: 30
|
|
1101
1112
|
}), /*#__PURE__*/React.createElement(Text, {
|
|
1102
1113
|
style: styles.nameText
|
|
1103
|
-
}, ((_this$state$selectedU3 = this.state.selectedUser) === null || _this$state$selectedU3 === void 0 ? void 0 : _this$state$selectedU3.displayName) ||
|
|
1114
|
+
}, ((_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
1115
|
name: "angle-right",
|
|
1105
1116
|
type: "font-awesome",
|
|
1106
1117
|
iconStyle: [styles.sectionTitle, {
|
|
@@ -1108,11 +1119,11 @@ class MaintenanceRequest extends Component {
|
|
|
1108
1119
|
color: this.props.colourBrandingMain
|
|
1109
1120
|
}]
|
|
1110
1121
|
})))), !this.state.canCreateOnBehalf && /*#__PURE__*/React.createElement(Components.FormCardSection, {
|
|
1111
|
-
label:
|
|
1112
|
-
placeholder:
|
|
1122
|
+
label: "Name",
|
|
1123
|
+
placeholder: "Enter your name",
|
|
1113
1124
|
textValue: this.state.userName,
|
|
1114
1125
|
onChangeText: userName => this.onChangeName(userName),
|
|
1115
|
-
editable: this.props.userType ===
|
|
1126
|
+
editable: this.props.userType === "KIOSK" && this.state.submitting === false,
|
|
1116
1127
|
isValid: () => {
|
|
1117
1128
|
return this.state.userName.length > 1;
|
|
1118
1129
|
},
|
|
@@ -1121,18 +1132,18 @@ class MaintenanceRequest extends Component {
|
|
|
1121
1132
|
showError: this.state.showError && this.state.userName.length < 2,
|
|
1122
1133
|
hasUnderline: true
|
|
1123
1134
|
}), /*#__PURE__*/React.createElement(Components.FormCardSection, {
|
|
1124
|
-
label:
|
|
1125
|
-
placeholder:
|
|
1135
|
+
label: "Contact number",
|
|
1136
|
+
placeholder: "Enter phone number",
|
|
1126
1137
|
textValue: this.state.phone,
|
|
1127
1138
|
onChangeText: phone => this.setState({
|
|
1128
1139
|
phone
|
|
1129
1140
|
}),
|
|
1130
1141
|
editable: this.state.submitting === false,
|
|
1131
1142
|
hasUnderline: true,
|
|
1132
|
-
keyboardType:
|
|
1143
|
+
keyboardType: "phone-pad"
|
|
1133
1144
|
}), /*#__PURE__*/React.createElement(Components.FormCardSection, {
|
|
1134
|
-
label:
|
|
1135
|
-
placeholder:
|
|
1145
|
+
label: "Address",
|
|
1146
|
+
placeholder: "Enter your address",
|
|
1136
1147
|
textValue: this.state.roomNumber,
|
|
1137
1148
|
onChangeText: roomNumber => this.setState({
|
|
1138
1149
|
roomNumber
|
|
@@ -1150,8 +1161,8 @@ class MaintenanceRequest extends Component {
|
|
|
1150
1161
|
marginTop: 16,
|
|
1151
1162
|
paddingHorizontal: 24,
|
|
1152
1163
|
paddingVertical: 16,
|
|
1153
|
-
flexDirection:
|
|
1154
|
-
justifyContent:
|
|
1164
|
+
flexDirection: "row",
|
|
1165
|
+
justifyContent: "space-between"
|
|
1155
1166
|
}
|
|
1156
1167
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
1157
1168
|
style: styles.sectionTitle
|
|
@@ -1159,7 +1170,7 @@ class MaintenanceRequest extends Component {
|
|
|
1159
1170
|
onPress: this.onPressType.bind(this)
|
|
1160
1171
|
}, /*#__PURE__*/React.createElement(View, {
|
|
1161
1172
|
style: {
|
|
1162
|
-
flexDirection:
|
|
1173
|
+
flexDirection: "row"
|
|
1163
1174
|
}
|
|
1164
1175
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
1165
1176
|
style: [styles.sectionTitle, {
|
|
@@ -1178,8 +1189,8 @@ class MaintenanceRequest extends Component {
|
|
|
1178
1189
|
marginTop: 16
|
|
1179
1190
|
}
|
|
1180
1191
|
}, /*#__PURE__*/React.createElement(Components.FormCardSection, {
|
|
1181
|
-
label:
|
|
1182
|
-
placeholder:
|
|
1192
|
+
label: "Title",
|
|
1193
|
+
placeholder: "Enter a title for your request",
|
|
1183
1194
|
textValue: this.state.title,
|
|
1184
1195
|
onChangeText: title => this.setState({
|
|
1185
1196
|
title
|
|
@@ -1196,8 +1207,8 @@ class MaintenanceRequest extends Component {
|
|
|
1196
1207
|
multiline: true,
|
|
1197
1208
|
autoGrow: true
|
|
1198
1209
|
}), /*#__PURE__*/React.createElement(Components.FormCardSection, {
|
|
1199
|
-
label:
|
|
1200
|
-
placeholder:
|
|
1210
|
+
label: "Description",
|
|
1211
|
+
placeholder: "Describe your request here in detail",
|
|
1201
1212
|
textValue: this.state.description,
|
|
1202
1213
|
onChangeText: description => this.setState({
|
|
1203
1214
|
description
|
|
@@ -1214,12 +1225,12 @@ class MaintenanceRequest extends Component {
|
|
|
1214
1225
|
}
|
|
1215
1226
|
}, /*#__PURE__*/React.createElement(View, {
|
|
1216
1227
|
style: [{
|
|
1217
|
-
width:
|
|
1228
|
+
width: "100%",
|
|
1218
1229
|
paddingVertical: 16,
|
|
1219
|
-
flexDirection:
|
|
1220
|
-
justifyContent:
|
|
1221
|
-
alignItems:
|
|
1222
|
-
position:
|
|
1230
|
+
flexDirection: "row",
|
|
1231
|
+
justifyContent: "space-between",
|
|
1232
|
+
alignItems: "center",
|
|
1233
|
+
position: "relative"
|
|
1223
1234
|
}, this.state.isHome && {
|
|
1224
1235
|
borderBottomWidth: 1,
|
|
1225
1236
|
borderBottomColor: Colours.LINEGREY
|
|
@@ -1233,13 +1244,13 @@ class MaintenanceRequest extends Component {
|
|
|
1233
1244
|
isHome: value
|
|
1234
1245
|
}),
|
|
1235
1246
|
trackColor: {
|
|
1236
|
-
false:
|
|
1247
|
+
false: "#ddd",
|
|
1237
1248
|
true: this.props.colourBrandingMain
|
|
1238
1249
|
},
|
|
1239
|
-
thumbColor: Platform.OS ===
|
|
1250
|
+
thumbColor: Platform.OS === "android" ? "#fff" : null
|
|
1240
1251
|
})), this.state.isHome && /*#__PURE__*/React.createElement(Components.FormCardSection, {
|
|
1241
|
-
label:
|
|
1242
|
-
placeholder:
|
|
1252
|
+
label: "Available times",
|
|
1253
|
+
placeholder: "Describe your available times here in detail.",
|
|
1243
1254
|
textValue: this.state.times,
|
|
1244
1255
|
onChangeText: times => this.setState({
|
|
1245
1256
|
times
|
|
@@ -1261,7 +1272,7 @@ class MaintenanceRequest extends Component {
|
|
|
1261
1272
|
renderRegisterConfirmation() {
|
|
1262
1273
|
return /*#__PURE__*/React.createElement(Components.ConfirmationPopup, {
|
|
1263
1274
|
confirmText: `${values.textEntityName} submitted`,
|
|
1264
|
-
repeatText:
|
|
1275
|
+
repeatText: "Submit another",
|
|
1265
1276
|
visible: this.state.confirmationToShow,
|
|
1266
1277
|
onClose: this.onCloseConfirmationPopup.bind(this),
|
|
1267
1278
|
onPressAction: this.onConfirmationReset.bind(this)
|
|
@@ -1285,8 +1296,8 @@ class MaintenanceRequest extends Component {
|
|
|
1285
1296
|
return null;
|
|
1286
1297
|
}
|
|
1287
1298
|
return /*#__PURE__*/React.createElement(Components.WarningPopup, {
|
|
1288
|
-
confirmText:
|
|
1289
|
-
infoText:
|
|
1299
|
+
confirmText: "No forms are available",
|
|
1300
|
+
infoText: "Check back later for forms.",
|
|
1290
1301
|
visible: this.state.noType,
|
|
1291
1302
|
onClose: this.onPressBack.bind(this),
|
|
1292
1303
|
padHorizontal: true
|
|
@@ -1300,7 +1311,7 @@ class MaintenanceRequest extends Component {
|
|
|
1300
1311
|
popUpType
|
|
1301
1312
|
} = this.state;
|
|
1302
1313
|
return /*#__PURE__*/React.createElement(KeyboardAvoidingView, {
|
|
1303
|
-
behavior:
|
|
1314
|
+
behavior: "padding",
|
|
1304
1315
|
style: styles.viewContainer
|
|
1305
1316
|
}, this.renderImageUploader(), /*#__PURE__*/React.createElement(View, {
|
|
1306
1317
|
style: styles.container
|
|
@@ -1308,7 +1319,7 @@ class MaintenanceRequest extends Component {
|
|
|
1308
1319
|
leftIcon: "angle-left",
|
|
1309
1320
|
onPressLeft: this.onPressBack.bind(this),
|
|
1310
1321
|
text: this.props.strings[`${values.featureKey}_textFeatureTitle`] || values.textFeatureTitle,
|
|
1311
|
-
rightText: submitting || success ? null :
|
|
1322
|
+
rightText: submitting || success ? null : "Done",
|
|
1312
1323
|
onPressRight: this.submitRequest.bind(this),
|
|
1313
1324
|
absoluteRight: true
|
|
1314
1325
|
}), this.renderForm()), this.renderRegisterConfirmation(), this.renderVideoPlayerPopup(), this.renderNoType(), /*#__PURE__*/React.createElement(DateTimePicker, {
|
|
@@ -1325,52 +1336,52 @@ class MaintenanceRequest extends Component {
|
|
|
1325
1336
|
const styles = {
|
|
1326
1337
|
viewContainer: {
|
|
1327
1338
|
flex: 1,
|
|
1328
|
-
backgroundColor:
|
|
1339
|
+
backgroundColor: "#fff"
|
|
1329
1340
|
},
|
|
1330
1341
|
container: {
|
|
1331
1342
|
flex: 1,
|
|
1332
|
-
position:
|
|
1333
|
-
backgroundColor:
|
|
1343
|
+
position: "relative",
|
|
1344
|
+
backgroundColor: "#f0f0f5"
|
|
1334
1345
|
},
|
|
1335
1346
|
errorText: {
|
|
1336
|
-
fontFamily:
|
|
1347
|
+
fontFamily: "sf-regular",
|
|
1337
1348
|
color: Colours.COLOUR_TANGERINE,
|
|
1338
1349
|
fontSize: 16
|
|
1339
1350
|
},
|
|
1340
1351
|
requestSuccess: {
|
|
1341
|
-
fontFamily:
|
|
1352
|
+
fontFamily: "sf-regular",
|
|
1342
1353
|
color: Colours.TEXT_DARK,
|
|
1343
1354
|
fontSize: 17,
|
|
1344
|
-
textAlign:
|
|
1355
|
+
textAlign: "center"
|
|
1345
1356
|
},
|
|
1346
1357
|
sectionTitle: {
|
|
1347
|
-
fontFamily:
|
|
1358
|
+
fontFamily: "sf-regular",
|
|
1348
1359
|
fontSize: 17,
|
|
1349
1360
|
color: Colours.TEXT_DARK
|
|
1350
1361
|
},
|
|
1351
1362
|
imageListContainer: {
|
|
1352
1363
|
marginTop: 8,
|
|
1353
1364
|
padding: 8,
|
|
1354
|
-
flexDirection:
|
|
1365
|
+
flexDirection: "row",
|
|
1355
1366
|
backgroundColor: Colours.BOXGREY,
|
|
1356
1367
|
minHeight: 106
|
|
1357
1368
|
},
|
|
1358
1369
|
imageListContainerEmpty: {
|
|
1359
|
-
justifyContent:
|
|
1360
|
-
alignItems:
|
|
1361
|
-
flexDirection:
|
|
1370
|
+
justifyContent: "center",
|
|
1371
|
+
alignItems: "center",
|
|
1372
|
+
flexDirection: "column"
|
|
1362
1373
|
},
|
|
1363
1374
|
documentListContainer: {
|
|
1364
1375
|
marginTop: 8,
|
|
1365
|
-
flexDirection:
|
|
1366
|
-
alignItems:
|
|
1376
|
+
flexDirection: "column",
|
|
1377
|
+
alignItems: "flex-start"
|
|
1367
1378
|
},
|
|
1368
1379
|
imageContainer: {
|
|
1369
1380
|
width: PHOTO_SIZE,
|
|
1370
1381
|
height: PHOTO_SIZE,
|
|
1371
|
-
borderStyle:
|
|
1372
|
-
justifyContent:
|
|
1373
|
-
alignItems:
|
|
1382
|
+
borderStyle: "dashed",
|
|
1383
|
+
justifyContent: "center",
|
|
1384
|
+
alignItems: "center",
|
|
1374
1385
|
borderWidth: 1,
|
|
1375
1386
|
borderColor: Colours.LINEGREY,
|
|
1376
1387
|
borderRadius: 4,
|
|
@@ -1379,13 +1390,13 @@ const styles = {
|
|
|
1379
1390
|
imageContainerNotEmpty: {
|
|
1380
1391
|
borderWidth: 1,
|
|
1381
1392
|
borderColor: Colours.LINEGREY,
|
|
1382
|
-
backgroundColor:
|
|
1383
|
-
borderStyle:
|
|
1393
|
+
backgroundColor: "#fff",
|
|
1394
|
+
borderStyle: "dashed"
|
|
1384
1395
|
},
|
|
1385
1396
|
imageBackground: {
|
|
1386
1397
|
flex: 1,
|
|
1387
|
-
height:
|
|
1388
|
-
width:
|
|
1398
|
+
height: "100%",
|
|
1399
|
+
width: "100%",
|
|
1389
1400
|
borderRadius: 4
|
|
1390
1401
|
},
|
|
1391
1402
|
imageCircle: {
|
|
@@ -1393,60 +1404,60 @@ const styles = {
|
|
|
1393
1404
|
height: 90,
|
|
1394
1405
|
borderRadius: 45,
|
|
1395
1406
|
backgroundColor: Colours.PINKISH_GREY,
|
|
1396
|
-
justifyContent:
|
|
1407
|
+
justifyContent: "center"
|
|
1397
1408
|
},
|
|
1398
1409
|
addImageIcon: {
|
|
1399
|
-
color:
|
|
1410
|
+
color: "#fff",
|
|
1400
1411
|
fontSize: 32
|
|
1401
1412
|
},
|
|
1402
1413
|
imagePlayContainer: {
|
|
1403
|
-
position:
|
|
1414
|
+
position: "absolute",
|
|
1404
1415
|
top: 0,
|
|
1405
1416
|
left: 0,
|
|
1406
1417
|
right: 0,
|
|
1407
1418
|
bottom: 0,
|
|
1408
|
-
alignItems:
|
|
1409
|
-
justifyContent:
|
|
1419
|
+
alignItems: "center",
|
|
1420
|
+
justifyContent: "center"
|
|
1410
1421
|
},
|
|
1411
1422
|
imageControlIcon: {
|
|
1412
|
-
color:
|
|
1423
|
+
color: "#fff",
|
|
1413
1424
|
fontSize: 20,
|
|
1414
|
-
textShadowColor:
|
|
1425
|
+
textShadowColor: "rgba(0,0,0,0.3)",
|
|
1415
1426
|
textShadowOffset: {
|
|
1416
1427
|
width: 2,
|
|
1417
1428
|
height: 2
|
|
1418
1429
|
}
|
|
1419
1430
|
},
|
|
1420
1431
|
removeImage: {
|
|
1421
|
-
position:
|
|
1432
|
+
position: "absolute",
|
|
1422
1433
|
top: 0,
|
|
1423
1434
|
right: 0,
|
|
1424
1435
|
padding: 4,
|
|
1425
1436
|
width: 40,
|
|
1426
1437
|
height: 40,
|
|
1427
|
-
alignItems:
|
|
1428
|
-
justifyContent:
|
|
1438
|
+
alignItems: "center",
|
|
1439
|
+
justifyContent: "center"
|
|
1429
1440
|
},
|
|
1430
1441
|
staticTitle: {
|
|
1431
1442
|
fontSize: 20,
|
|
1432
|
-
fontFamily:
|
|
1443
|
+
fontFamily: "sf-semibold",
|
|
1433
1444
|
color: Colours.TEXT_DARKEST
|
|
1434
1445
|
},
|
|
1435
1446
|
staticText: {
|
|
1436
1447
|
fontSize: 17,
|
|
1437
|
-
fontFamily:
|
|
1448
|
+
fontFamily: "sf-regular",
|
|
1438
1449
|
color: Colours.TEXT_DARKEST,
|
|
1439
1450
|
lineHeight: 24
|
|
1440
1451
|
},
|
|
1441
1452
|
multiChoiceOption: {
|
|
1442
1453
|
marginTop: 16,
|
|
1443
|
-
flexDirection:
|
|
1444
|
-
alignItems:
|
|
1454
|
+
flexDirection: "row",
|
|
1455
|
+
alignItems: "center",
|
|
1445
1456
|
minHeight: 20
|
|
1446
1457
|
},
|
|
1447
1458
|
multiChoiceText: {
|
|
1448
1459
|
flex: 1,
|
|
1449
|
-
fontFamily:
|
|
1460
|
+
fontFamily: "sf-medium",
|
|
1450
1461
|
fontSize: 14,
|
|
1451
1462
|
color: Colours.TEXT_DARK
|
|
1452
1463
|
},
|
|
@@ -1463,24 +1474,24 @@ const styles = {
|
|
|
1463
1474
|
borderRadius: 4
|
|
1464
1475
|
},
|
|
1465
1476
|
dateContainer: {
|
|
1466
|
-
flexDirection:
|
|
1467
|
-
alignItems:
|
|
1477
|
+
flexDirection: "row",
|
|
1478
|
+
alignItems: "center"
|
|
1468
1479
|
},
|
|
1469
1480
|
dateFieldButton: {
|
|
1470
1481
|
flex: 1
|
|
1471
1482
|
},
|
|
1472
1483
|
dateFieldContainer: {
|
|
1473
|
-
flexDirection:
|
|
1484
|
+
flexDirection: "row",
|
|
1474
1485
|
borderRadius: 2,
|
|
1475
|
-
backgroundColor:
|
|
1486
|
+
backgroundColor: "#ebeff2",
|
|
1476
1487
|
padding: 8,
|
|
1477
1488
|
marginTop: 8
|
|
1478
1489
|
},
|
|
1479
1490
|
dateText: {
|
|
1480
1491
|
flex: 1,
|
|
1481
|
-
fontFamily:
|
|
1492
|
+
fontFamily: "sf-regular",
|
|
1482
1493
|
fontSize: 16,
|
|
1483
|
-
color:
|
|
1494
|
+
color: "#65686D"
|
|
1484
1495
|
},
|
|
1485
1496
|
dateIcon: {
|
|
1486
1497
|
fontSize: 18,
|
|
@@ -1494,36 +1505,36 @@ const styles = {
|
|
|
1494
1505
|
color: Colours.TEXT_BLUEGREY
|
|
1495
1506
|
},
|
|
1496
1507
|
documentContainer: {
|
|
1497
|
-
flexDirection:
|
|
1498
|
-
alignItems:
|
|
1499
|
-
justifyContent:
|
|
1508
|
+
flexDirection: "row",
|
|
1509
|
+
alignItems: "center",
|
|
1510
|
+
justifyContent: "space-between",
|
|
1500
1511
|
paddingVertical: 4
|
|
1501
1512
|
},
|
|
1502
1513
|
documentTypeContainer: {
|
|
1503
1514
|
width: 50,
|
|
1504
1515
|
height: 60,
|
|
1505
|
-
justifyContent:
|
|
1506
|
-
alignItems:
|
|
1516
|
+
justifyContent: "center",
|
|
1517
|
+
alignItems: "center",
|
|
1507
1518
|
borderRadius: 5,
|
|
1508
1519
|
marginRight: 8
|
|
1509
1520
|
},
|
|
1510
1521
|
documentTypeText: {
|
|
1511
|
-
color:
|
|
1512
|
-
fontFamily:
|
|
1513
|
-
textAlign:
|
|
1522
|
+
color: "#fff",
|
|
1523
|
+
fontFamily: "sf-semibold",
|
|
1524
|
+
textAlign: "center"
|
|
1514
1525
|
},
|
|
1515
1526
|
documentText: {
|
|
1516
1527
|
flex: 1,
|
|
1517
|
-
fontFamily:
|
|
1528
|
+
fontFamily: "sf-semibold",
|
|
1518
1529
|
fontSize: 16,
|
|
1519
|
-
color:
|
|
1530
|
+
color: "#65686D"
|
|
1520
1531
|
},
|
|
1521
1532
|
removeDocumentButton: {
|
|
1522
1533
|
padding: 4,
|
|
1523
1534
|
width: 40,
|
|
1524
1535
|
height: 40,
|
|
1525
|
-
alignItems:
|
|
1526
|
-
justifyContent:
|
|
1536
|
+
alignItems: "center",
|
|
1537
|
+
justifyContent: "center",
|
|
1527
1538
|
marginLeft: 8
|
|
1528
1539
|
},
|
|
1529
1540
|
removeDocumentIcon: {
|
|
@@ -1531,16 +1542,16 @@ const styles = {
|
|
|
1531
1542
|
},
|
|
1532
1543
|
// PC-1255: User picker styles
|
|
1533
1544
|
userPickerContainer: {
|
|
1534
|
-
flexDirection:
|
|
1535
|
-
justifyContent:
|
|
1536
|
-
alignItems:
|
|
1545
|
+
flexDirection: "row",
|
|
1546
|
+
justifyContent: "space-between",
|
|
1547
|
+
alignItems: "center"
|
|
1537
1548
|
},
|
|
1538
1549
|
profileContainer: {
|
|
1539
|
-
flexDirection:
|
|
1540
|
-
alignItems:
|
|
1550
|
+
flexDirection: "row",
|
|
1551
|
+
alignItems: "center"
|
|
1541
1552
|
},
|
|
1542
1553
|
nameText: {
|
|
1543
|
-
fontFamily:
|
|
1554
|
+
fontFamily: "sf-medium",
|
|
1544
1555
|
fontSize: 16,
|
|
1545
1556
|
color: Colours.TEXT_DARK,
|
|
1546
1557
|
marginLeft: 8
|
|
@@ -1572,7 +1583,8 @@ const mapStateToProps = state => {
|
|
|
1572
1583
|
phoneNumber,
|
|
1573
1584
|
permissions,
|
|
1574
1585
|
colourBrandingMain: Colours.getMainBrandingColourFromState(state),
|
|
1575
|
-
strings: ((_state$strings = state.strings) === null || _state$strings === void 0 ? void 0 : _state$strings.config) || {}
|
|
1586
|
+
strings: ((_state$strings = state.strings) === null || _state$strings === void 0 ? void 0 : _state$strings.config) || {},
|
|
1587
|
+
optionOnlyForResidents: Helper.getSiteSettingFromState(state, values.optionOnlyForResidents)
|
|
1576
1588
|
};
|
|
1577
1589
|
};
|
|
1578
1590
|
export default connect(mapStateToProps, {
|