@plusscommunities/pluss-maintenance-web-a 1.1.32 → 1.1.33
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/index.cjs.js +186 -186
- package/dist/index.esm.js +186 -186
- package/dist/index.umd.js +186 -186
- package/package.json +1 -1
- package/src/screens/AddJob.js +1126 -970
- package/src/screens/Job.js +1521 -1261
package/dist/index.esm.js
CHANGED
|
@@ -2707,7 +2707,7 @@ class Job extends Component {
|
|
|
2707
2707
|
res.data.location = res.data.site;
|
|
2708
2708
|
this.setJob(res.data);
|
|
2709
2709
|
} catch (error) {
|
|
2710
|
-
console.error(
|
|
2710
|
+
console.error("getJob", error);
|
|
2711
2711
|
}
|
|
2712
2712
|
});
|
|
2713
2713
|
_defineProperty(this, "getAssignees", async () => {
|
|
@@ -2717,7 +2717,7 @@ class Job extends Component {
|
|
|
2717
2717
|
assignees: res.data.Users
|
|
2718
2718
|
});
|
|
2719
2719
|
} catch (error) {
|
|
2720
|
-
console.error(
|
|
2720
|
+
console.error("getAssignees", error);
|
|
2721
2721
|
}
|
|
2722
2722
|
});
|
|
2723
2723
|
_defineProperty(this, "getExternalSync", async () => {
|
|
@@ -2733,7 +2733,7 @@ class Job extends Component {
|
|
|
2733
2733
|
} catch (error) {
|
|
2734
2734
|
// 404 is expected if no sync - don't show error
|
|
2735
2735
|
if (error && error.response && error.response.status !== 404) {
|
|
2736
|
-
console.error(
|
|
2736
|
+
console.error("getExternalSync", error);
|
|
2737
2737
|
}
|
|
2738
2738
|
this.setState({
|
|
2739
2739
|
loadingExternalSync: false
|
|
@@ -2758,8 +2758,8 @@ class Job extends Component {
|
|
|
2758
2758
|
retrySyncInitiated: true
|
|
2759
2759
|
});
|
|
2760
2760
|
} catch (error) {
|
|
2761
|
-
console.error(
|
|
2762
|
-
const errorMessage = error && error.response && error.response.data && error.response.data.error ||
|
|
2761
|
+
console.error("onRetrySync", error);
|
|
2762
|
+
const errorMessage = error && error.response && error.response.data && error.response.data.error || "Failed to retry sync. Please try again.";
|
|
2763
2763
|
this.setState({
|
|
2764
2764
|
retryingSync: false,
|
|
2765
2765
|
retrySyncError: errorMessage
|
|
@@ -2781,16 +2781,16 @@ class Job extends Component {
|
|
|
2781
2781
|
});
|
|
2782
2782
|
_defineProperty(this, "setJob", job => {
|
|
2783
2783
|
if (_.isEmpty(job.lastActivity)) {
|
|
2784
|
-
job.lastActivity =
|
|
2784
|
+
job.lastActivity = "-- --";
|
|
2785
2785
|
job.noActivity = true;
|
|
2786
2786
|
}
|
|
2787
2787
|
if (_.isEmpty(job.status)) {
|
|
2788
|
-
job.status =
|
|
2788
|
+
job.status = "Unassigned";
|
|
2789
2789
|
job.notStatus = true;
|
|
2790
2790
|
}
|
|
2791
2791
|
if (_.isEmpty(job.audience)) {
|
|
2792
2792
|
job.audience = [{
|
|
2793
|
-
displayName:
|
|
2793
|
+
displayName: "Unassigned",
|
|
2794
2794
|
isEmpty: true
|
|
2795
2795
|
}];
|
|
2796
2796
|
}
|
|
@@ -2828,7 +2828,7 @@ class Job extends Component {
|
|
|
2828
2828
|
editingNote: null
|
|
2829
2829
|
};
|
|
2830
2830
|
if (!!this.state.editingNote) {
|
|
2831
|
-
newState.noteInput =
|
|
2831
|
+
newState.noteInput = "";
|
|
2832
2832
|
newState.noteAttachments = [];
|
|
2833
2833
|
newState.noteImages = [];
|
|
2834
2834
|
}
|
|
@@ -2870,7 +2870,7 @@ class Job extends Component {
|
|
|
2870
2870
|
noteAttachments: [...this.state.noteAttachments]
|
|
2871
2871
|
});
|
|
2872
2872
|
});
|
|
2873
|
-
event.target.value =
|
|
2873
|
+
event.target.value = "";
|
|
2874
2874
|
});
|
|
2875
2875
|
_defineProperty(this, "onRemoveAttachment", a => {
|
|
2876
2876
|
const index = this.state.noteAttachments.indexOf(a);
|
|
@@ -2907,7 +2907,7 @@ class Job extends Component {
|
|
|
2907
2907
|
}
|
|
2908
2908
|
this.onCloseSelectAssignee();
|
|
2909
2909
|
} catch (error) {
|
|
2910
|
-
console.error(
|
|
2910
|
+
console.error("onConfirmAssignee", error);
|
|
2911
2911
|
}
|
|
2912
2912
|
this.setState({
|
|
2913
2913
|
confirmingAssignee: false
|
|
@@ -2919,7 +2919,7 @@ class Job extends Component {
|
|
|
2919
2919
|
const res = await maintenanceActions.assignJob(this.state.jobId, userId);
|
|
2920
2920
|
this.getJob();
|
|
2921
2921
|
} catch (err) {
|
|
2922
|
-
console.error(
|
|
2922
|
+
console.error("onAssignUser", err);
|
|
2923
2923
|
}
|
|
2924
2924
|
});
|
|
2925
2925
|
_defineProperty(this, "onConfirmAddNote", async () => {
|
|
@@ -2943,7 +2943,7 @@ class Job extends Component {
|
|
|
2943
2943
|
job: res.data.job,
|
|
2944
2944
|
submittingNote: false,
|
|
2945
2945
|
addNoteOpen: false,
|
|
2946
|
-
noteInput:
|
|
2946
|
+
noteInput: "",
|
|
2947
2947
|
noteAttachments: [],
|
|
2948
2948
|
noteImages: [],
|
|
2949
2949
|
editingNote: null
|
|
@@ -2951,7 +2951,7 @@ class Job extends Component {
|
|
|
2951
2951
|
this.props.jobsLoaded([this.state.job]);
|
|
2952
2952
|
});
|
|
2953
2953
|
} catch (err) {
|
|
2954
|
-
console.error(
|
|
2954
|
+
console.error("onConfirmAddNote", err);
|
|
2955
2955
|
}
|
|
2956
2956
|
});
|
|
2957
2957
|
_defineProperty(this, "onDeleteNote", n => {
|
|
@@ -2974,7 +2974,7 @@ class Job extends Component {
|
|
|
2974
2974
|
this.setState({
|
|
2975
2975
|
noteAttachments: n.Attachments || [],
|
|
2976
2976
|
noteImages: n.Images || [],
|
|
2977
|
-
noteInput: n.Note ||
|
|
2977
|
+
noteInput: n.Note || "",
|
|
2978
2978
|
addNoteOpen: true,
|
|
2979
2979
|
editingNote: n.Id,
|
|
2980
2980
|
noteMenuOpen: null
|
|
@@ -2997,15 +2997,15 @@ class Job extends Component {
|
|
|
2997
2997
|
const update = {
|
|
2998
2998
|
id: job.id,
|
|
2999
2999
|
seen: true,
|
|
3000
|
-
status: job.status ||
|
|
3000
|
+
status: job.status || "Unassigned"
|
|
3001
3001
|
};
|
|
3002
3002
|
await maintenanceActions.editJob(update, auth.site);
|
|
3003
3003
|
} catch (error) {
|
|
3004
3004
|
this.setState({
|
|
3005
3005
|
updating: false
|
|
3006
3006
|
});
|
|
3007
|
-
console.log(
|
|
3008
|
-
alert(
|
|
3007
|
+
console.log("markSeen error", error);
|
|
3008
|
+
alert("Something went wrong with the request. Please try again.");
|
|
3009
3009
|
}
|
|
3010
3010
|
});
|
|
3011
3011
|
});
|
|
@@ -3025,19 +3025,19 @@ class Job extends Component {
|
|
|
3025
3025
|
} = this.state;
|
|
3026
3026
|
try {
|
|
3027
3027
|
this.setState({
|
|
3028
|
-
commentInput:
|
|
3028
|
+
commentInput: ""
|
|
3029
3029
|
});
|
|
3030
3030
|
const res = await reactionActions.addComment(jobId, values.commentKey, job.title, job.site, commentInput);
|
|
3031
3031
|
this.setState({
|
|
3032
3032
|
comments: [...comments, res.data]
|
|
3033
3033
|
});
|
|
3034
3034
|
} catch (error) {
|
|
3035
|
-
console.error(
|
|
3035
|
+
console.error("onAddComment", error);
|
|
3036
3036
|
}
|
|
3037
3037
|
});
|
|
3038
3038
|
_defineProperty(this, "onHandleChange", event => {
|
|
3039
3039
|
var stateChange = {};
|
|
3040
|
-
stateChange[event.target.getAttribute(
|
|
3040
|
+
stateChange[event.target.getAttribute("id")] = event.target.value;
|
|
3041
3041
|
this.setState(stateChange);
|
|
3042
3042
|
});
|
|
3043
3043
|
_defineProperty(this, "onTogglePriorityChanger", () => {
|
|
@@ -3062,7 +3062,7 @@ class Job extends Component {
|
|
|
3062
3062
|
job
|
|
3063
3063
|
});
|
|
3064
3064
|
} catch (error) {
|
|
3065
|
-
console.error(
|
|
3065
|
+
console.error("onSelectPriority", error);
|
|
3066
3066
|
}
|
|
3067
3067
|
});
|
|
3068
3068
|
_defineProperty(this, "onToggleStatusChanger", () => {
|
|
@@ -3087,22 +3087,22 @@ class Job extends Component {
|
|
|
3087
3087
|
job
|
|
3088
3088
|
});
|
|
3089
3089
|
} catch (error) {
|
|
3090
|
-
console.error(
|
|
3090
|
+
console.error("onSelectStatus", error);
|
|
3091
3091
|
}
|
|
3092
3092
|
});
|
|
3093
3093
|
this.state = {
|
|
3094
|
-
jobId: Helper$2.safeReadParams(props,
|
|
3094
|
+
jobId: Helper$2.safeReadParams(props, "jobId") ? props.match.params.jobId : null,
|
|
3095
3095
|
job: null,
|
|
3096
3096
|
showingSelector: false,
|
|
3097
3097
|
updating: false,
|
|
3098
3098
|
comments: [],
|
|
3099
|
-
commentInput:
|
|
3099
|
+
commentInput: "",
|
|
3100
3100
|
loadingComments: false,
|
|
3101
3101
|
priorityChangerOpen: false,
|
|
3102
3102
|
statusChangerOpen: false,
|
|
3103
3103
|
addNoteOpen: false,
|
|
3104
3104
|
noteAttachments: [],
|
|
3105
|
-
noteInput:
|
|
3105
|
+
noteInput: "",
|
|
3106
3106
|
noteImages: [],
|
|
3107
3107
|
assignees: [],
|
|
3108
3108
|
externalSync: null,
|
|
@@ -3126,7 +3126,7 @@ class Job extends Component {
|
|
|
3126
3126
|
}
|
|
3127
3127
|
checkSetImage() {
|
|
3128
3128
|
if (this.imageInput && !_.isEmpty(this.state.noteImages)) {
|
|
3129
|
-
this.imageInput.
|
|
3129
|
+
this.imageInput.setValue(this.state.noteImages);
|
|
3130
3130
|
} else {
|
|
3131
3131
|
setTimeout(this.checkSetImage, 100);
|
|
3132
3132
|
}
|
|
@@ -3266,7 +3266,7 @@ class Job extends Component {
|
|
|
3266
3266
|
}, this.state.comments.map(c => this.renderComment(c))), /*#__PURE__*/React.createElement("div", {
|
|
3267
3267
|
className: "commentReply"
|
|
3268
3268
|
}, /*#__PURE__*/React.createElement("div", {
|
|
3269
|
-
className: "commentReply_button".concat(!_.isEmpty(this.state.commentInput) ?
|
|
3269
|
+
className: "commentReply_button".concat(!_.isEmpty(this.state.commentInput) ? " commentReply_button-active" : ""),
|
|
3270
3270
|
onClick: this.onAddComment
|
|
3271
3271
|
}, /*#__PURE__*/React.createElement(FontAwesome, {
|
|
3272
3272
|
className: "commentReply_icon",
|
|
@@ -3329,29 +3329,29 @@ class Job extends Component {
|
|
|
3329
3329
|
const {
|
|
3330
3330
|
customFields
|
|
3331
3331
|
} = job;
|
|
3332
|
-
const labelClass =
|
|
3333
|
-
const answerClass =
|
|
3332
|
+
const labelClass = "fieldLabel";
|
|
3333
|
+
const answerClass = "fontRegular fontSize-16 text-dark marginTop-5";
|
|
3334
3334
|
const renderAnswer = field => {
|
|
3335
3335
|
switch (field.type) {
|
|
3336
|
-
case
|
|
3336
|
+
case "date":
|
|
3337
3337
|
return /*#__PURE__*/React.createElement("div", {
|
|
3338
3338
|
className: answerClass
|
|
3339
|
-
}, field.answer ? moment(field.answer,
|
|
3340
|
-
case
|
|
3339
|
+
}, field.answer ? moment(field.answer, "YYYY-MM-DD").format("DD-MMM-YYYY") : "");
|
|
3340
|
+
case "time":
|
|
3341
3341
|
return /*#__PURE__*/React.createElement("div", {
|
|
3342
3342
|
className: answerClass
|
|
3343
|
-
}, field.answer ? moment(field.answer,
|
|
3344
|
-
case
|
|
3343
|
+
}, field.answer ? moment(field.answer, "HH:mm").format("h:mm a") : "");
|
|
3344
|
+
case "yn":
|
|
3345
3345
|
return /*#__PURE__*/React.createElement("div", {
|
|
3346
3346
|
className: answerClass
|
|
3347
|
-
}, field.answer ?
|
|
3348
|
-
case
|
|
3347
|
+
}, field.answer ? "Yes" : "No");
|
|
3348
|
+
case "checkbox":
|
|
3349
3349
|
return /*#__PURE__*/React.createElement("div", {
|
|
3350
3350
|
className: answerClass
|
|
3351
|
-
}, field.answer && Array.isArray(field.answer) ? field.answer.join(
|
|
3352
|
-
case
|
|
3351
|
+
}, field.answer && Array.isArray(field.answer) ? field.answer.join(", ") : "");
|
|
3352
|
+
case "image":
|
|
3353
3353
|
return this.renderImageGrid(field.answer);
|
|
3354
|
-
case
|
|
3354
|
+
case "document":
|
|
3355
3355
|
return this.renderDocumentGrid(field.answer);
|
|
3356
3356
|
default:
|
|
3357
3357
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -3362,8 +3362,8 @@ class Job extends Component {
|
|
|
3362
3362
|
return /*#__PURE__*/React.createElement("div", {
|
|
3363
3363
|
className: "padding-60 paddingVertical-40 bottomDivideBorder"
|
|
3364
3364
|
}, customFields.map((field, index) => {
|
|
3365
|
-
if ([
|
|
3366
|
-
if (_.isNil(field.answer) || field.answer ===
|
|
3365
|
+
if (["staticTitle", "staticText"].includes(field.type)) return null;
|
|
3366
|
+
if (_.isNil(field.answer) || field.answer === "" || field.answer.length === 0) return null;
|
|
3367
3367
|
return /*#__PURE__*/React.createElement("div", {
|
|
3368
3368
|
key: index,
|
|
3369
3369
|
className: "marginTop-16"
|
|
@@ -3393,27 +3393,27 @@ class Job extends Component {
|
|
|
3393
3393
|
}, values.textEntityName, " #", this.state.job.jobId), /*#__PURE__*/React.createElement("div", {
|
|
3394
3394
|
className: "marginTop-16"
|
|
3395
3395
|
}, /*#__PURE__*/React.createElement("div", {
|
|
3396
|
-
className:
|
|
3396
|
+
className: "fieldLabel"
|
|
3397
3397
|
}, "Submission date"), /*#__PURE__*/React.createElement("div", {
|
|
3398
|
-
className:
|
|
3399
|
-
}, moment.utc(this.state.job.createdTime).local().format(
|
|
3398
|
+
className: "fontRegular fontSize-16 text-dark marginTop-5"
|
|
3399
|
+
}, moment.utc(this.state.job.createdTime).local().format("D MMM YY"))), /*#__PURE__*/React.createElement("div", {
|
|
3400
3400
|
className: "marginTop-16"
|
|
3401
3401
|
}, /*#__PURE__*/React.createElement("div", {
|
|
3402
|
-
className:
|
|
3402
|
+
className: "fieldLabel"
|
|
3403
3403
|
}, "Type"), /*#__PURE__*/React.createElement("div", {
|
|
3404
|
-
className:
|
|
3404
|
+
className: "fontRegular fontSize-16 text-dark marginTop-5"
|
|
3405
3405
|
}, this.state.job.type)), /*#__PURE__*/React.createElement("div", {
|
|
3406
3406
|
className: "marginTop-16"
|
|
3407
3407
|
}, /*#__PURE__*/React.createElement("div", {
|
|
3408
|
-
className:
|
|
3408
|
+
className: "fieldLabel"
|
|
3409
3409
|
}, "Address"), /*#__PURE__*/React.createElement("div", {
|
|
3410
|
-
className:
|
|
3410
|
+
className: "fontRegular fontSize-16 text-dark marginTop-5"
|
|
3411
3411
|
}, this.state.job.room)), hasCustomFields ? null : /*#__PURE__*/React.createElement("div", {
|
|
3412
3412
|
className: "marginTop-16"
|
|
3413
3413
|
}, /*#__PURE__*/React.createElement("div", {
|
|
3414
|
-
className:
|
|
3415
|
-
}, "Description ", this.state.job.image ?
|
|
3416
|
-
className:
|
|
3414
|
+
className: "fieldLabel"
|
|
3415
|
+
}, "Description ", this.state.job.image ? "- (image supplied)" : ""), /*#__PURE__*/React.createElement("div", {
|
|
3416
|
+
className: "fontRegular fontSize-16 text-dark marginTop-5"
|
|
3417
3417
|
}, this.state.job.description))), /*#__PURE__*/React.createElement("div", {
|
|
3418
3418
|
className: "padding-60 paddingVertical-40 bottomDivideBorder"
|
|
3419
3419
|
}, /*#__PURE__*/React.createElement(Components$3.Text, {
|
|
@@ -3422,27 +3422,27 @@ class Job extends Component {
|
|
|
3422
3422
|
}, "Contact Details"), /*#__PURE__*/React.createElement("div", {
|
|
3423
3423
|
className: "marginTop-16"
|
|
3424
3424
|
}, /*#__PURE__*/React.createElement("div", {
|
|
3425
|
-
className:
|
|
3425
|
+
className: "fieldLabel"
|
|
3426
3426
|
}, "Name"), /*#__PURE__*/React.createElement("div", {
|
|
3427
|
-
className:
|
|
3427
|
+
className: "fontRegular fontSize-16 text-dark marginTop-5"
|
|
3428
3428
|
}, this.state.job.userName)), /*#__PURE__*/React.createElement("div", {
|
|
3429
3429
|
className: "marginTop-16"
|
|
3430
3430
|
}, /*#__PURE__*/React.createElement("div", {
|
|
3431
|
-
className:
|
|
3431
|
+
className: "fieldLabel"
|
|
3432
3432
|
}, "Contact number"), /*#__PURE__*/React.createElement("div", {
|
|
3433
|
-
className:
|
|
3434
|
-
}, _.isEmpty(this.state.job.phone) ?
|
|
3433
|
+
className: "fontRegular fontSize-16 text-dark marginTop-5"
|
|
3434
|
+
}, _.isEmpty(this.state.job.phone) ? "No phone provided" : this.state.job.phone)), hasCustomFields ? null : /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
3435
3435
|
className: "marginTop-16"
|
|
3436
3436
|
}, /*#__PURE__*/React.createElement("div", {
|
|
3437
|
-
className:
|
|
3437
|
+
className: "fieldLabel"
|
|
3438
3438
|
}, "Should person be home?"), /*#__PURE__*/React.createElement("div", {
|
|
3439
|
-
className:
|
|
3440
|
-
}, this.state.job.isHome ?
|
|
3439
|
+
className: "fontRegular fontSize-16 text-dark marginTop-5"
|
|
3440
|
+
}, this.state.job.isHome ? "Yes" : "No")), this.state.job.isHome && this.state.job.homeText && /*#__PURE__*/React.createElement("div", {
|
|
3441
3441
|
className: "marginTop-16"
|
|
3442
3442
|
}, /*#__PURE__*/React.createElement("div", {
|
|
3443
|
-
className:
|
|
3443
|
+
className: "fieldLabel"
|
|
3444
3444
|
}, "When"), /*#__PURE__*/React.createElement("div", {
|
|
3445
|
-
className:
|
|
3445
|
+
className: "fontRegular fontSize-16 text-dark marginTop-5"
|
|
3446
3446
|
}, this.state.job.homeText)))), hasCustomFields ? null : this.renderImages(), hasCustomFields ? this.renderCustomFields() : null, this.renderCommentSection());
|
|
3447
3447
|
}
|
|
3448
3448
|
renderHistoryEntry(e, i) {
|
|
@@ -3451,7 +3451,7 @@ class Job extends Component {
|
|
|
3451
3451
|
} = this.state;
|
|
3452
3452
|
const entryToUse = e || {
|
|
3453
3453
|
timestamp: job.createdTime,
|
|
3454
|
-
status:
|
|
3454
|
+
status: "Unassigned",
|
|
3455
3455
|
user: {
|
|
3456
3456
|
displayName: job.userName,
|
|
3457
3457
|
id: job.userID,
|
|
@@ -3464,7 +3464,7 @@ class Job extends Component {
|
|
|
3464
3464
|
key: i
|
|
3465
3465
|
}, /*#__PURE__*/React.createElement("p", {
|
|
3466
3466
|
className: "ticketHistoryEntry_timestamp"
|
|
3467
|
-
}, moment.utc(entryToUse.timestamp).local().format(
|
|
3467
|
+
}, moment.utc(entryToUse.timestamp).local().format("D MMM YYYY h:mma")), /*#__PURE__*/React.createElement("div", {
|
|
3468
3468
|
className: "statusLabel statusLabel-large statusLabel-full",
|
|
3469
3469
|
style: {
|
|
3470
3470
|
backgroundColor: statusType.color
|
|
@@ -3479,10 +3479,10 @@ class Job extends Component {
|
|
|
3479
3479
|
key: index
|
|
3480
3480
|
}, /*#__PURE__*/React.createElement("p", {
|
|
3481
3481
|
className: "ticketHistoryEntry_timestamp"
|
|
3482
|
-
}, moment.utc(note.Timestamp).local().format(
|
|
3482
|
+
}, moment.utc(note.Timestamp).local().format("D MMM YYYY h:mma")), /*#__PURE__*/React.createElement("div", {
|
|
3483
3483
|
className: "statusLabel statusLabel-large statusLabel-full",
|
|
3484
3484
|
style: {
|
|
3485
|
-
backgroundColor:
|
|
3485
|
+
backgroundColor: "#6e79c5"
|
|
3486
3486
|
}
|
|
3487
3487
|
}, /*#__PURE__*/React.createElement("span", {
|
|
3488
3488
|
className: "statusLabel_text"
|
|
@@ -3499,12 +3499,12 @@ class Job extends Component {
|
|
|
3499
3499
|
className: "maintenanceNote_name"
|
|
3500
3500
|
}, note.User.displayName), this.state.noteMenuOpen === index && /*#__PURE__*/React.createElement(Components$3.MoreMenu, {
|
|
3501
3501
|
options: [{
|
|
3502
|
-
key:
|
|
3503
|
-
text:
|
|
3502
|
+
key: "edit",
|
|
3503
|
+
text: "Edit",
|
|
3504
3504
|
onPress: () => this.onOpenEditNote(note)
|
|
3505
3505
|
}, {
|
|
3506
|
-
key:
|
|
3507
|
-
text:
|
|
3506
|
+
key: "delete",
|
|
3507
|
+
text: "Delete",
|
|
3508
3508
|
onPress: () => this.onDeleteNote(note)
|
|
3509
3509
|
}]
|
|
3510
3510
|
})), /*#__PURE__*/React.createElement("p", {
|
|
@@ -3526,12 +3526,12 @@ class Job extends Component {
|
|
|
3526
3526
|
}, "Assignment")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
3527
3527
|
className: "marginTop-16"
|
|
3528
3528
|
}, /*#__PURE__*/React.createElement("div", {
|
|
3529
|
-
className:
|
|
3529
|
+
className: "fieldLabel"
|
|
3530
3530
|
}, "Assigned to"), /*#__PURE__*/React.createElement("div", {
|
|
3531
|
-
className:
|
|
3531
|
+
className: "fontRegular fontSize-16 text-dark marginTop-5"
|
|
3532
3532
|
}, job.Assignee ? /*#__PURE__*/React.createElement(Components$3.UserListing, {
|
|
3533
3533
|
user: job.Assignee
|
|
3534
|
-
}) :
|
|
3534
|
+
}) : "Unassigned"))));
|
|
3535
3535
|
}
|
|
3536
3536
|
renderAssignmentEntry(e, i) {
|
|
3537
3537
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -3539,17 +3539,17 @@ class Job extends Component {
|
|
|
3539
3539
|
key: i
|
|
3540
3540
|
}, /*#__PURE__*/React.createElement("p", {
|
|
3541
3541
|
className: "ticketHistoryEntry_timestamp"
|
|
3542
|
-
}, moment.utc(e.timestamp).local().format(
|
|
3542
|
+
}, moment.utc(e.timestamp).local().format("D MMM YYYY h:mma")), /*#__PURE__*/React.createElement("div", {
|
|
3543
3543
|
className: "statusLabel statusLabel-large statusLabel-full",
|
|
3544
3544
|
style: {
|
|
3545
3545
|
backgroundColor: Colours$1.COLOUR_DUSK
|
|
3546
3546
|
}
|
|
3547
3547
|
}, /*#__PURE__*/React.createElement("span", {
|
|
3548
3548
|
className: "statusLabel_text"
|
|
3549
|
-
}, e.user.displayName, " assigned the ", values.textSingularName, " to ", e.assignedUser ? e.assignedUser.displayName :
|
|
3549
|
+
}, e.user.displayName, " assigned the ", values.textSingularName, " to", " ", e.assignedUser ? e.assignedUser.displayName : "Unassigned")));
|
|
3550
3550
|
}
|
|
3551
3551
|
renderExternalSyncEntry(e, i) {
|
|
3552
|
-
const isSuccess = e.EntryType ===
|
|
3552
|
+
const isSuccess = e.EntryType === "ExternalIDSet";
|
|
3553
3553
|
const backgroundColor = isSuccess ? Colours$1.COLOUR_GREEN : Colours$1.COLOUR_RED; // Green for success, red for failure
|
|
3554
3554
|
|
|
3555
3555
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -3557,14 +3557,14 @@ class Job extends Component {
|
|
|
3557
3557
|
key: i
|
|
3558
3558
|
}, /*#__PURE__*/React.createElement("p", {
|
|
3559
3559
|
className: "ticketHistoryEntry_timestamp"
|
|
3560
|
-
}, moment.utc(e.timestamp).local().format(
|
|
3560
|
+
}, moment.utc(e.timestamp).local().format("D MMM YYYY h:mma")), /*#__PURE__*/React.createElement("div", {
|
|
3561
3561
|
className: "statusLabel statusLabel-large statusLabel-full",
|
|
3562
3562
|
style: {
|
|
3563
3563
|
backgroundColor
|
|
3564
3564
|
}
|
|
3565
3565
|
}, /*#__PURE__*/React.createElement("span", {
|
|
3566
3566
|
className: "statusLabel_text"
|
|
3567
|
-
}, isSuccess ? "Synced to ".concat(e.systemType ||
|
|
3567
|
+
}, isSuccess ? "Synced to ".concat(e.systemType || "external system").concat(e.externalId ? " (ID: ".concat(e.externalId, ")") : "") : "Failed to sync to ".concat(e.systemType || "external system").concat(e.error ? ": ".concat(e.error) : ""))));
|
|
3568
3568
|
}
|
|
3569
3569
|
renderPriority() {
|
|
3570
3570
|
const {
|
|
@@ -3586,8 +3586,8 @@ class Job extends Component {
|
|
|
3586
3586
|
} = this.state;
|
|
3587
3587
|
if (!job || !job.history) return false;
|
|
3588
3588
|
const history = job.history || [];
|
|
3589
|
-
const hasSuccess = history.some(entry => entry.EntryType ===
|
|
3590
|
-
const hasFailure = history.some(entry => entry.EntryType ===
|
|
3589
|
+
const hasSuccess = history.some(entry => entry.EntryType === "ExternalIDSet");
|
|
3590
|
+
const hasFailure = history.some(entry => entry.EntryType === "ExternalIDSetFailed");
|
|
3591
3591
|
return hasFailure && !hasSuccess;
|
|
3592
3592
|
}
|
|
3593
3593
|
renderRetrySyncButton() {
|
|
@@ -3656,7 +3656,7 @@ class Job extends Component {
|
|
|
3656
3656
|
style: {
|
|
3657
3657
|
color: Colours$1.COLOUR_GREEN
|
|
3658
3658
|
}
|
|
3659
|
-
}), " Sync retry initiated. Check back shortly for results.");
|
|
3659
|
+
}), " ", "Sync retry initiated. Check back shortly for results.");
|
|
3660
3660
|
}
|
|
3661
3661
|
|
|
3662
3662
|
// Show failure message with instruction
|
|
@@ -3669,7 +3669,7 @@ class Job extends Component {
|
|
|
3669
3669
|
style: {
|
|
3670
3670
|
color: Colours$1.COLOUR_RED
|
|
3671
3671
|
}
|
|
3672
|
-
}), " External sync failed. Use the retry button to attempt again.");
|
|
3672
|
+
}), " ", "External sync failed. Use the retry button to attempt again.");
|
|
3673
3673
|
}
|
|
3674
3674
|
return null;
|
|
3675
3675
|
}
|
|
@@ -3703,7 +3703,7 @@ class Job extends Component {
|
|
|
3703
3703
|
}, /*#__PURE__*/React.createElement("strong", null, "External ID:"), " ", externalSync.externalId), externalSync.syncedAt && /*#__PURE__*/React.createElement(Components$3.Text, {
|
|
3704
3704
|
type: "body",
|
|
3705
3705
|
className: "marginBottom-8"
|
|
3706
|
-
}, /*#__PURE__*/React.createElement("strong", null, "Synced:"), " ", moment.utc(externalSync.syncedAt).local().format(
|
|
3706
|
+
}, /*#__PURE__*/React.createElement("strong", null, "Synced:"), " ", moment.utc(externalSync.syncedAt).local().format("D MMM YYYY h:mma"))) : this.renderExternalSyncStatus()));
|
|
3707
3707
|
}
|
|
3708
3708
|
renderOverview() {
|
|
3709
3709
|
const {
|
|
@@ -3712,14 +3712,14 @@ class Job extends Component {
|
|
|
3712
3712
|
if (!job || !job.history) return null;
|
|
3713
3713
|
const source = _.sortBy([...job.history.map(e => {
|
|
3714
3714
|
return _objectSpread$4(_objectSpread$4({}, e), {}, {
|
|
3715
|
-
EntryType: e.EntryType ||
|
|
3715
|
+
EntryType: e.EntryType || "status"
|
|
3716
3716
|
});
|
|
3717
3717
|
}), ...(job.Notes || []).map(e => {
|
|
3718
3718
|
return _objectSpread$4(_objectSpread$4({}, e), {}, {
|
|
3719
3719
|
timestamp: e.Timestamp,
|
|
3720
|
-
EntryType:
|
|
3720
|
+
EntryType: "note"
|
|
3721
3721
|
});
|
|
3722
|
-
})],
|
|
3722
|
+
})], "timestamp");
|
|
3723
3723
|
return /*#__PURE__*/React.createElement("div", {
|
|
3724
3724
|
className: "padding-32 paddingVertical-40 bottomDivideBorder relative"
|
|
3725
3725
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -3729,14 +3729,14 @@ class Job extends Component {
|
|
|
3729
3729
|
className: "flex-1"
|
|
3730
3730
|
}, "Status History")), this.renderHistoryEntry(null, -1), _.map(source, (e, i) => {
|
|
3731
3731
|
switch (e.EntryType) {
|
|
3732
|
-
case
|
|
3732
|
+
case "status":
|
|
3733
3733
|
return this.renderHistoryEntry(e, i);
|
|
3734
|
-
case
|
|
3734
|
+
case "note":
|
|
3735
3735
|
return this.renderNote(e, i);
|
|
3736
|
-
case
|
|
3736
|
+
case "assignment":
|
|
3737
3737
|
return this.renderAssignmentEntry(e, i);
|
|
3738
|
-
case
|
|
3739
|
-
case
|
|
3738
|
+
case "ExternalIDSet":
|
|
3739
|
+
case "ExternalIDSetFailed":
|
|
3740
3740
|
return this.renderExternalSyncEntry(e, i);
|
|
3741
3741
|
}
|
|
3742
3742
|
}));
|
|
@@ -3789,20 +3789,20 @@ class Job extends Component {
|
|
|
3789
3789
|
})));
|
|
3790
3790
|
}
|
|
3791
3791
|
return /*#__PURE__*/React.createElement(Components$3.Popup, {
|
|
3792
|
-
title: "".concat(this.state.editingNote ?
|
|
3792
|
+
title: "".concat(this.state.editingNote ? "Edit" : "Add", " Note"),
|
|
3793
3793
|
onClose: this.onCloseAddNote,
|
|
3794
3794
|
maxWidth: 600,
|
|
3795
3795
|
hasPadding: true,
|
|
3796
3796
|
buttons: [{
|
|
3797
|
-
type:
|
|
3797
|
+
type: "primary",
|
|
3798
3798
|
onClick: this.onConfirmAddNote,
|
|
3799
3799
|
isActive: this.isReadyToSaveNote(),
|
|
3800
|
-
text:
|
|
3800
|
+
text: "Save"
|
|
3801
3801
|
}, {
|
|
3802
|
-
type:
|
|
3802
|
+
type: "tertiary",
|
|
3803
3803
|
onClick: this.onCloseAddNote,
|
|
3804
3804
|
isActive: true,
|
|
3805
|
-
text:
|
|
3805
|
+
text: "Cancel"
|
|
3806
3806
|
}]
|
|
3807
3807
|
}, /*#__PURE__*/React.createElement(Components$3.GenericInput, {
|
|
3808
3808
|
id: "noteInput",
|
|
@@ -3904,15 +3904,15 @@ class Job extends Component {
|
|
|
3904
3904
|
maxWidth: 600,
|
|
3905
3905
|
hasPadding: true,
|
|
3906
3906
|
buttons: [{
|
|
3907
|
-
type:
|
|
3907
|
+
type: "primary",
|
|
3908
3908
|
onClick: this.onConfirmAssignee,
|
|
3909
3909
|
isActive: !!this.state.selectedAssignee,
|
|
3910
|
-
text:
|
|
3910
|
+
text: "Confirm"
|
|
3911
3911
|
}, {
|
|
3912
|
-
type:
|
|
3912
|
+
type: "tertiary",
|
|
3913
3913
|
onClick: this.onCloseSelectAssignee,
|
|
3914
3914
|
isActive: true,
|
|
3915
|
-
text:
|
|
3915
|
+
text: "Cancel"
|
|
3916
3916
|
}]
|
|
3917
3917
|
}, this.renderUsers());
|
|
3918
3918
|
}
|
|
@@ -3978,13 +3978,13 @@ class AddJob extends Component {
|
|
|
3978
3978
|
this.checkSetImages(this.imageInput, res.data.images);
|
|
3979
3979
|
if (customFields) {
|
|
3980
3980
|
customFields.forEach((field, index) => {
|
|
3981
|
-
if (field.type ===
|
|
3981
|
+
if (field.type === "image" && field.answer) {
|
|
3982
3982
|
this.checkSetImages(this.customImageInputs[index], field.answer);
|
|
3983
3983
|
}
|
|
3984
3984
|
});
|
|
3985
3985
|
}
|
|
3986
3986
|
} catch (error) {
|
|
3987
|
-
console.error(
|
|
3987
|
+
console.error("getJob", error);
|
|
3988
3988
|
}
|
|
3989
3989
|
});
|
|
3990
3990
|
_defineProperty(this, "getJobTypes", async () => {
|
|
@@ -3995,7 +3995,7 @@ class AddJob extends Component {
|
|
|
3995
3995
|
});
|
|
3996
3996
|
this.getDefaultJob();
|
|
3997
3997
|
} catch (error) {
|
|
3998
|
-
console.error(
|
|
3998
|
+
console.error("getJobTypes", error);
|
|
3999
3999
|
}
|
|
4000
4000
|
});
|
|
4001
4001
|
_defineProperty(this, "getUsers", async () => {
|
|
@@ -4005,16 +4005,16 @@ class AddJob extends Component {
|
|
|
4005
4005
|
if (res.data != null && !_.isEmpty(res.data.results.Items)) {
|
|
4006
4006
|
let items = res.data.results.Items;
|
|
4007
4007
|
if (this.props.optionOnlyForResidents) {
|
|
4008
|
-
items = _.filter(items, u => u.category ===
|
|
4008
|
+
items = _.filter(items, u => u.category === "resident");
|
|
4009
4009
|
}
|
|
4010
4010
|
this.setState({
|
|
4011
4011
|
users: _.sortBy(items, u => {
|
|
4012
|
-
return (u.displayName ||
|
|
4012
|
+
return (u.displayName || "").toLowerCase();
|
|
4013
4013
|
})
|
|
4014
4014
|
});
|
|
4015
4015
|
}
|
|
4016
4016
|
} catch (error) {
|
|
4017
|
-
console.error(
|
|
4017
|
+
console.error("getUsers", error);
|
|
4018
4018
|
}
|
|
4019
4019
|
});
|
|
4020
4020
|
_defineProperty(this, "getDefaultJob", () => {
|
|
@@ -4031,7 +4031,7 @@ class AddJob extends Component {
|
|
|
4031
4031
|
});
|
|
4032
4032
|
} else {
|
|
4033
4033
|
this.setState({
|
|
4034
|
-
type:
|
|
4034
|
+
type: "General"
|
|
4035
4035
|
});
|
|
4036
4036
|
}
|
|
4037
4037
|
}
|
|
@@ -4049,14 +4049,14 @@ class AddJob extends Component {
|
|
|
4049
4049
|
type: selectedType.typeName,
|
|
4050
4050
|
customFields: hasPrevCustomFields ? prevCustomFileds : selectedType.hasCustomFields ? selectedType.customFields : []
|
|
4051
4051
|
};
|
|
4052
|
-
if (!_.isEmpty(update.customFields) && !_.some(update.customFields,
|
|
4053
|
-
update.title = this.state.selectedUser ? this.state.selectedUser.displayName :
|
|
4052
|
+
if (!_.isEmpty(update.customFields) && !_.some(update.customFields, "isTitle")) {
|
|
4053
|
+
update.title = this.state.selectedUser ? this.state.selectedUser.displayName : "";
|
|
4054
4054
|
}
|
|
4055
4055
|
this.setState(update);
|
|
4056
4056
|
});
|
|
4057
4057
|
_defineProperty(this, "onHandleChange", event => {
|
|
4058
4058
|
var stateChange = {};
|
|
4059
|
-
stateChange[event.target.getAttribute(
|
|
4059
|
+
stateChange[event.target.getAttribute("id")] = event.target.value;
|
|
4060
4060
|
this.setState(stateChange);
|
|
4061
4061
|
});
|
|
4062
4062
|
_defineProperty(this, "onOpenUserSelector", () => {
|
|
@@ -4076,7 +4076,7 @@ class AddJob extends Component {
|
|
|
4076
4076
|
userName: user.displayName,
|
|
4077
4077
|
userFilterOpen: false
|
|
4078
4078
|
};
|
|
4079
|
-
if (!_.isEmpty(this.state.customFields) && !_.some(this.state.customFields,
|
|
4079
|
+
if (!_.isEmpty(this.state.customFields) && !_.some(this.state.customFields, "isTitle")) {
|
|
4080
4080
|
update.title = user.displayName;
|
|
4081
4081
|
}
|
|
4082
4082
|
|
|
@@ -4104,19 +4104,19 @@ class AddJob extends Component {
|
|
|
4104
4104
|
}).catch(error => {
|
|
4105
4105
|
// Permission denied (403) or other error - continue without auto-population
|
|
4106
4106
|
// Staff can still create the request, just need to enter contact details manually
|
|
4107
|
-
console.log(
|
|
4107
|
+
console.log("Could not fetch user details for auto-population:", error);
|
|
4108
4108
|
});
|
|
4109
4109
|
});
|
|
4110
4110
|
_defineProperty(this, "onUnselectUser", () => {
|
|
4111
4111
|
const update = {
|
|
4112
4112
|
selectedUser: null,
|
|
4113
|
-
userID:
|
|
4114
|
-
userName:
|
|
4115
|
-
phone:
|
|
4116
|
-
room:
|
|
4113
|
+
userID: "",
|
|
4114
|
+
userName: "",
|
|
4115
|
+
phone: "",
|
|
4116
|
+
room: ""
|
|
4117
4117
|
};
|
|
4118
|
-
if (!_.isEmpty(this.state.customFields) && !_.some(this.state.customFields,
|
|
4119
|
-
update.title =
|
|
4118
|
+
if (!_.isEmpty(this.state.customFields) && !_.some(this.state.customFields, "isTitle")) {
|
|
4119
|
+
update.title = "";
|
|
4120
4120
|
}
|
|
4121
4121
|
this.setState(update);
|
|
4122
4122
|
});
|
|
@@ -4144,7 +4144,7 @@ class AddJob extends Component {
|
|
|
4144
4144
|
};
|
|
4145
4145
|
const field = update.customFields[qId];
|
|
4146
4146
|
field.answer = _.xor(field.answer || [], [answer]);
|
|
4147
|
-
if (field.isTitle) update.title = field.answer.join(
|
|
4147
|
+
if (field.isTitle) update.title = field.answer.join(", ");
|
|
4148
4148
|
this.setState(update);
|
|
4149
4149
|
});
|
|
4150
4150
|
_defineProperty(this, "onChangeDateAnswer", function (qId, answer) {
|
|
@@ -4154,7 +4154,7 @@ class AddJob extends Component {
|
|
|
4154
4154
|
};
|
|
4155
4155
|
const field = update.customFields[qId];
|
|
4156
4156
|
field.answer = answer;
|
|
4157
|
-
if (field.isTitle) update.title = moment(field.answer,
|
|
4157
|
+
if (field.isTitle) update.title = moment(field.answer, "YYYY-MM-DD").format("DD-MMM-YYYY");
|
|
4158
4158
|
_this.setState(update);
|
|
4159
4159
|
if (togglePicker) _this.onToggleDatePicker(qId);
|
|
4160
4160
|
});
|
|
@@ -4164,7 +4164,7 @@ class AddJob extends Component {
|
|
|
4164
4164
|
};
|
|
4165
4165
|
const field = update.customFields[qId];
|
|
4166
4166
|
field.answer = answer;
|
|
4167
|
-
if (field.isTitle) update.title = moment(field.answer,
|
|
4167
|
+
if (field.isTitle) update.title = moment(field.answer, "HH:mm").format("h:mm a");
|
|
4168
4168
|
this.setState(update);
|
|
4169
4169
|
});
|
|
4170
4170
|
_defineProperty(this, "onChangeImageAnswer", (qId, answer) => {
|
|
@@ -4191,7 +4191,7 @@ class AddJob extends Component {
|
|
|
4191
4191
|
};
|
|
4192
4192
|
const field = update.customFields[qId];
|
|
4193
4193
|
const attachments = field.answer || [];
|
|
4194
|
-
const [name, ext] = file.name.split(
|
|
4194
|
+
const [name, ext] = file.name.split(".");
|
|
4195
4195
|
const newAttachment = {
|
|
4196
4196
|
uploading: true,
|
|
4197
4197
|
name,
|
|
@@ -4209,7 +4209,7 @@ class AddJob extends Component {
|
|
|
4209
4209
|
delete newAttachment.uploading;
|
|
4210
4210
|
this.setState(update);
|
|
4211
4211
|
});
|
|
4212
|
-
event.target.value =
|
|
4212
|
+
event.target.value = "";
|
|
4213
4213
|
});
|
|
4214
4214
|
_defineProperty(this, "onToggleDatePicker", qId => {
|
|
4215
4215
|
const showDate = _objectSpread$3({}, this.state.showDate);
|
|
@@ -4259,7 +4259,7 @@ class AddJob extends Component {
|
|
|
4259
4259
|
this.setState({
|
|
4260
4260
|
updating: false
|
|
4261
4261
|
});
|
|
4262
|
-
alert(
|
|
4262
|
+
alert("Something went wrong with the request. Please try again.");
|
|
4263
4263
|
});
|
|
4264
4264
|
} else {
|
|
4265
4265
|
// Create New Job
|
|
@@ -4273,7 +4273,7 @@ class AddJob extends Component {
|
|
|
4273
4273
|
this.setState({
|
|
4274
4274
|
updating: false
|
|
4275
4275
|
});
|
|
4276
|
-
alert(
|
|
4276
|
+
alert("Something went wrong with the request. Please try again.");
|
|
4277
4277
|
});
|
|
4278
4278
|
}
|
|
4279
4279
|
});
|
|
@@ -4283,15 +4283,15 @@ class AddJob extends Component {
|
|
|
4283
4283
|
type,
|
|
4284
4284
|
answer
|
|
4285
4285
|
} = field;
|
|
4286
|
-
if ([
|
|
4286
|
+
if (["staticTitle", "staticText"].includes(type)) return true;
|
|
4287
4287
|
const checkMandatory = () => {
|
|
4288
4288
|
if (!mandatory) return true;
|
|
4289
4289
|
switch (type) {
|
|
4290
|
-
case
|
|
4290
|
+
case "yn":
|
|
4291
4291
|
return _.isBoolean(answer);
|
|
4292
|
-
case
|
|
4293
|
-
case
|
|
4294
|
-
case
|
|
4292
|
+
case "image":
|
|
4293
|
+
case "document":
|
|
4294
|
+
case "checkbox":
|
|
4295
4295
|
return _.isArray(answer) && answer.length > 0;
|
|
4296
4296
|
default:
|
|
4297
4297
|
return !_.isNil(answer) && !_.isEmpty(answer);
|
|
@@ -4300,12 +4300,12 @@ class AddJob extends Component {
|
|
|
4300
4300
|
const checkFormat = () => {
|
|
4301
4301
|
if (_.isNil(answer) || _.isEmpty(answer)) return true;
|
|
4302
4302
|
switch (type) {
|
|
4303
|
-
case
|
|
4303
|
+
case "email":
|
|
4304
4304
|
return Helper$1.isEmail(answer);
|
|
4305
|
-
case
|
|
4306
|
-
return moment(answer,
|
|
4307
|
-
case
|
|
4308
|
-
return moment(answer,
|
|
4305
|
+
case "date":
|
|
4306
|
+
return moment(answer, "YYYY-MM-DD", true).isValid();
|
|
4307
|
+
case "time":
|
|
4308
|
+
return moment(answer, "HH:mm", true).isValid();
|
|
4309
4309
|
default:
|
|
4310
4310
|
return true;
|
|
4311
4311
|
}
|
|
@@ -4316,13 +4316,13 @@ class AddJob extends Component {
|
|
|
4316
4316
|
_defineProperty(this, "getFieldContainerClass", function () {
|
|
4317
4317
|
let isValid = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
4318
4318
|
const showError = _this.state.showWarnings && !isValid;
|
|
4319
|
-
return "genericInputContainer ".concat(isValid ?
|
|
4319
|
+
return "genericInputContainer ".concat(isValid ? "genericInput-valid" : "", " ").concat(showError ? "genericInput-error" : "").trim();
|
|
4320
4320
|
});
|
|
4321
4321
|
this.imageInput = null;
|
|
4322
4322
|
this.customImageInputs = {};
|
|
4323
4323
|
this.customDocumentInputs = {};
|
|
4324
4324
|
this.state = {
|
|
4325
|
-
jobId: Helper$1.safeReadParams(this.props,
|
|
4325
|
+
jobId: Helper$1.safeReadParams(this.props, "jobId") ? this.props.match.params.jobId : null,
|
|
4326
4326
|
job: null,
|
|
4327
4327
|
showingSelector: false,
|
|
4328
4328
|
updating: false,
|
|
@@ -4330,21 +4330,21 @@ class AddJob extends Component {
|
|
|
4330
4330
|
types: [],
|
|
4331
4331
|
users: [],
|
|
4332
4332
|
images: [],
|
|
4333
|
-
userSearch:
|
|
4333
|
+
userSearch: "",
|
|
4334
4334
|
userFilterOpen: false,
|
|
4335
4335
|
selectedUser: null,
|
|
4336
4336
|
id: null,
|
|
4337
|
-
userID:
|
|
4338
|
-
userName:
|
|
4339
|
-
room:
|
|
4340
|
-
phone:
|
|
4337
|
+
userID: "",
|
|
4338
|
+
userName: "",
|
|
4339
|
+
room: "",
|
|
4340
|
+
phone: "",
|
|
4341
4341
|
location: this.props.auth.site,
|
|
4342
|
-
title:
|
|
4343
|
-
description:
|
|
4342
|
+
title: "",
|
|
4343
|
+
description: "",
|
|
4344
4344
|
isHome: false,
|
|
4345
|
-
homeText:
|
|
4346
|
-
prevType:
|
|
4347
|
-
type:
|
|
4345
|
+
homeText: "",
|
|
4346
|
+
prevType: "General",
|
|
4347
|
+
type: "General",
|
|
4348
4348
|
image: null,
|
|
4349
4349
|
thumbnail: null,
|
|
4350
4350
|
showWarnings: false,
|
|
@@ -4366,7 +4366,7 @@ class AddJob extends Component {
|
|
|
4366
4366
|
checkSetImages(imageRef, images) {
|
|
4367
4367
|
if (imageRef) {
|
|
4368
4368
|
if (!_.isEmpty(images)) {
|
|
4369
|
-
imageRef.
|
|
4369
|
+
imageRef.setValue(images);
|
|
4370
4370
|
}
|
|
4371
4371
|
} else {
|
|
4372
4372
|
setTimeout(() => {
|
|
@@ -4394,9 +4394,9 @@ class AddJob extends Component {
|
|
|
4394
4394
|
if (!this.state.success) return null;
|
|
4395
4395
|
const title = this.props.strings["".concat(values.featureKey, "_textTitleRequests")] || values.textTitleRequests;
|
|
4396
4396
|
return /*#__PURE__*/React.createElement(Components$2.SuccessPopup, {
|
|
4397
|
-
text: "".concat(values.textEntityName, " has been ").concat(this.state.id != null ?
|
|
4397
|
+
text: "".concat(values.textEntityName, " has been ").concat(this.state.id != null ? "edited" : "added"),
|
|
4398
4398
|
buttons: [{
|
|
4399
|
-
type:
|
|
4399
|
+
type: "outlined",
|
|
4400
4400
|
onClick: () => {
|
|
4401
4401
|
window.history.back();
|
|
4402
4402
|
},
|
|
@@ -4524,13 +4524,13 @@ class AddJob extends Component {
|
|
|
4524
4524
|
label: "Person must be home during work?",
|
|
4525
4525
|
isActive: this.state.isHome,
|
|
4526
4526
|
options: [{
|
|
4527
|
-
Label:
|
|
4527
|
+
Label: "No",
|
|
4528
4528
|
Value: false,
|
|
4529
4529
|
onChange: () => this.setState({
|
|
4530
4530
|
isHome: false
|
|
4531
4531
|
})
|
|
4532
4532
|
}, {
|
|
4533
|
-
Label:
|
|
4533
|
+
Label: "Yes",
|
|
4534
4534
|
Value: true,
|
|
4535
4535
|
onChange: () => this.setState({
|
|
4536
4536
|
isHome: true
|
|
@@ -4561,7 +4561,7 @@ class AddJob extends Component {
|
|
|
4561
4561
|
}
|
|
4562
4562
|
renderField(field, fieldId) {
|
|
4563
4563
|
switch (field.type) {
|
|
4564
|
-
case
|
|
4564
|
+
case "yn":
|
|
4565
4565
|
return /*#__PURE__*/React.createElement("div", {
|
|
4566
4566
|
key: fieldId,
|
|
4567
4567
|
className: "visitorSignIn_question ".concat(this.getFieldContainerClass(this.isFieldValid(field))),
|
|
@@ -4577,16 +4577,16 @@ class AddJob extends Component {
|
|
|
4577
4577
|
noHoverHighlight: true,
|
|
4578
4578
|
highlightColour: this.props.colour,
|
|
4579
4579
|
options: [{
|
|
4580
|
-
Label:
|
|
4580
|
+
Label: "Yes",
|
|
4581
4581
|
Value: true,
|
|
4582
4582
|
onChange: this.onChangeToggleAnswer.bind(this, fieldId, true)
|
|
4583
4583
|
}, {
|
|
4584
|
-
Label:
|
|
4584
|
+
Label: "No",
|
|
4585
4585
|
Value: false,
|
|
4586
4586
|
onChange: this.onChangeToggleAnswer.bind(this, fieldId, false)
|
|
4587
4587
|
}]
|
|
4588
4588
|
}));
|
|
4589
|
-
case
|
|
4589
|
+
case "multichoice":
|
|
4590
4590
|
return /*#__PURE__*/React.createElement("div", {
|
|
4591
4591
|
key: fieldId,
|
|
4592
4592
|
className: "visitorSignIn_question ".concat(this.getFieldContainerClass(this.isFieldValid(field))),
|
|
@@ -4609,14 +4609,14 @@ class AddJob extends Component {
|
|
|
4609
4609
|
};
|
|
4610
4610
|
}),
|
|
4611
4611
|
rowStyle: {
|
|
4612
|
-
flexDirection:
|
|
4612
|
+
flexDirection: "column"
|
|
4613
4613
|
},
|
|
4614
4614
|
buttonStyle: {
|
|
4615
|
-
marginTop:
|
|
4616
|
-
marginBottom:
|
|
4615
|
+
marginTop: "5px",
|
|
4616
|
+
marginBottom: "5px"
|
|
4617
4617
|
}
|
|
4618
4618
|
}));
|
|
4619
|
-
case
|
|
4619
|
+
case "checkbox":
|
|
4620
4620
|
return /*#__PURE__*/React.createElement("div", {
|
|
4621
4621
|
key: fieldId,
|
|
4622
4622
|
className: this.getFieldContainerClass(this.isFieldValid(field)),
|
|
@@ -4631,7 +4631,7 @@ class AddJob extends Component {
|
|
|
4631
4631
|
}, /*#__PURE__*/React.createElement("div", {
|
|
4632
4632
|
className: "fieldLabel",
|
|
4633
4633
|
style: {
|
|
4634
|
-
marginBottom:
|
|
4634
|
+
marginBottom: "5px",
|
|
4635
4635
|
color: this.props.colour
|
|
4636
4636
|
}
|
|
4637
4637
|
}, field.label), field.values.map((option, optionIndex) => {
|
|
@@ -4644,9 +4644,9 @@ class AddJob extends Component {
|
|
|
4644
4644
|
onChange: () => this.onChangeCheckboxAnswer(fieldId, option)
|
|
4645
4645
|
});
|
|
4646
4646
|
})));
|
|
4647
|
-
case
|
|
4648
|
-
case
|
|
4649
|
-
case
|
|
4647
|
+
case "text":
|
|
4648
|
+
case "email":
|
|
4649
|
+
case "phone":
|
|
4650
4650
|
return /*#__PURE__*/React.createElement("div", {
|
|
4651
4651
|
key: fieldId
|
|
4652
4652
|
}, /*#__PURE__*/React.createElement(Components$2.GenericInput, {
|
|
@@ -4659,10 +4659,10 @@ class AddJob extends Component {
|
|
|
4659
4659
|
isRequired: field.mandatory,
|
|
4660
4660
|
isValid: () => this.isFieldValid(field),
|
|
4661
4661
|
showError: () => this.state.showWarnings && !this.isFieldValid(field),
|
|
4662
|
-
errorMessage: field.type ===
|
|
4662
|
+
errorMessage: field.type === "email" ? "Not a valid email" : undefined,
|
|
4663
4663
|
alwaysShowLabel: true
|
|
4664
4664
|
}));
|
|
4665
|
-
case
|
|
4665
|
+
case "staticTitle":
|
|
4666
4666
|
return /*#__PURE__*/React.createElement("p", {
|
|
4667
4667
|
className: "visitorSignIn_text-staticTitle",
|
|
4668
4668
|
style: {
|
|
@@ -4670,21 +4670,21 @@ class AddJob extends Component {
|
|
|
4670
4670
|
},
|
|
4671
4671
|
key: fieldId
|
|
4672
4672
|
}, field.label);
|
|
4673
|
-
case
|
|
4673
|
+
case "staticText":
|
|
4674
4674
|
return /*#__PURE__*/React.createElement("p", {
|
|
4675
4675
|
className: "visitorSignIn_text-staticText",
|
|
4676
4676
|
key: fieldId
|
|
4677
4677
|
}, Helper$1.toParagraphed(field.label, {
|
|
4678
4678
|
marginTop: 10
|
|
4679
4679
|
}));
|
|
4680
|
-
case
|
|
4680
|
+
case "date":
|
|
4681
4681
|
return /*#__PURE__*/React.createElement("div", {
|
|
4682
4682
|
key: fieldId
|
|
4683
4683
|
}, /*#__PURE__*/React.createElement(Components$2.GenericInput, {
|
|
4684
4684
|
id: fieldId,
|
|
4685
4685
|
label: field.label,
|
|
4686
|
-
placeholder:
|
|
4687
|
-
value: field.answer ? moment(field.answer,
|
|
4686
|
+
placeholder: "DD-MMM-YYYY",
|
|
4687
|
+
value: field.answer ? moment(field.answer, "YYYY-MM-DD").format("DD-MMM-YYYY") : "",
|
|
4688
4688
|
onClick: e => this.onToggleDatePicker(fieldId),
|
|
4689
4689
|
isRequired: field.mandatory,
|
|
4690
4690
|
isValid: () => this.isFieldValid(field),
|
|
@@ -4702,14 +4702,14 @@ class AddJob extends Component {
|
|
|
4702
4702
|
selectedDate: field.answer,
|
|
4703
4703
|
selectDate: date => this.onChangeDateAnswer(fieldId, date)
|
|
4704
4704
|
}));
|
|
4705
|
-
case
|
|
4705
|
+
case "time":
|
|
4706
4706
|
return /*#__PURE__*/React.createElement("div", {
|
|
4707
4707
|
key: fieldId
|
|
4708
4708
|
}, /*#__PURE__*/React.createElement(Components$2.GenericInput, {
|
|
4709
4709
|
id: fieldId,
|
|
4710
4710
|
label: field.label,
|
|
4711
|
-
placeholder:
|
|
4712
|
-
value: field.answer ? moment(field.answer,
|
|
4711
|
+
placeholder: "--:-- --",
|
|
4712
|
+
value: field.answer ? moment(field.answer, "HH:mm").format("h:mm a") : "",
|
|
4713
4713
|
type: "time",
|
|
4714
4714
|
isRequired: field.mandatory,
|
|
4715
4715
|
isValid: () => this.isFieldValid(field),
|
|
@@ -4722,7 +4722,7 @@ class AddJob extends Component {
|
|
|
4722
4722
|
className: "timepicker-condensed",
|
|
4723
4723
|
callbackFormat: "HH:mm",
|
|
4724
4724
|
style: {
|
|
4725
|
-
width:
|
|
4725
|
+
width: "100%"
|
|
4726
4726
|
}
|
|
4727
4727
|
}),
|
|
4728
4728
|
rightContent: !_.isEmpty(field.answer) && /*#__PURE__*/React.createElement(Components$2.SVGIcon, {
|
|
@@ -4732,7 +4732,7 @@ class AddJob extends Component {
|
|
|
4732
4732
|
onClick: () => this.onChangeTimeAnswer(fieldId, undefined)
|
|
4733
4733
|
})
|
|
4734
4734
|
}));
|
|
4735
|
-
case
|
|
4735
|
+
case "image":
|
|
4736
4736
|
return /*#__PURE__*/React.createElement("div", {
|
|
4737
4737
|
key: fieldId,
|
|
4738
4738
|
className: this.getFieldContainerClass(this.isFieldValid(field)),
|
|
@@ -4752,7 +4752,7 @@ class AddJob extends Component {
|
|
|
4752
4752
|
multiple: true,
|
|
4753
4753
|
refreshCallback: images => this.onChangeImageAnswer(fieldId, images)
|
|
4754
4754
|
})));
|
|
4755
|
-
case
|
|
4755
|
+
case "document":
|
|
4756
4756
|
const documents = field.answer || [];
|
|
4757
4757
|
return /*#__PURE__*/React.createElement("div", {
|
|
4758
4758
|
key: fieldId,
|
|
@@ -4816,7 +4816,7 @@ class AddJob extends Component {
|
|
|
4816
4816
|
}, /*#__PURE__*/React.createElement(Components$2.Text, {
|
|
4817
4817
|
type: "formTitleLarge",
|
|
4818
4818
|
className: "marginBottom-24"
|
|
4819
|
-
}, this.state.infoId == null ?
|
|
4819
|
+
}, this.state.infoId == null ? "New" : "Edit", " ", values.textSingularName), this.renderSelectUser(), /*#__PURE__*/React.createElement(Components$2.GenericInput, {
|
|
4820
4820
|
id: "phone",
|
|
4821
4821
|
type: "text",
|
|
4822
4822
|
label: "Contact number",
|
|
@@ -4873,10 +4873,10 @@ class AddJob extends Component {
|
|
|
4873
4873
|
hasPadding: true,
|
|
4874
4874
|
onClose: this.onCloseUserSelector,
|
|
4875
4875
|
buttons: [{
|
|
4876
|
-
type:
|
|
4876
|
+
type: "tertiary",
|
|
4877
4877
|
onClick: this.onCloseUserSelector,
|
|
4878
4878
|
isActive: true,
|
|
4879
|
-
text:
|
|
4879
|
+
text: "Cancel"
|
|
4880
4880
|
}]
|
|
4881
4881
|
}, /*#__PURE__*/React.createElement(Components$2.GenericInput, {
|
|
4882
4882
|
id: "userSearch",
|
|
@@ -4910,16 +4910,16 @@ class AddJob extends Component {
|
|
|
4910
4910
|
}
|
|
4911
4911
|
const styles$4 = {
|
|
4912
4912
|
userLabelContainer: {
|
|
4913
|
-
display:
|
|
4914
|
-
flexDirection:
|
|
4915
|
-
alignItems:
|
|
4913
|
+
display: "flex",
|
|
4914
|
+
flexDirection: "row",
|
|
4915
|
+
alignItems: "center",
|
|
4916
4916
|
marginBottom: 0,
|
|
4917
|
-
justifyContent:
|
|
4917
|
+
justifyContent: "space-between"
|
|
4918
4918
|
},
|
|
4919
4919
|
fieldContainer: {
|
|
4920
|
-
display:
|
|
4921
|
-
flexDirection:
|
|
4922
|
-
alignItems:
|
|
4920
|
+
display: "flex",
|
|
4921
|
+
flexDirection: "row",
|
|
4922
|
+
alignItems: "center"
|
|
4923
4923
|
}
|
|
4924
4924
|
};
|
|
4925
4925
|
const mapStateToProps$2 = state => {
|