@plusscommunities/pluss-maintenance-app 6.0.4-auth.0 → 6.0.4
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.map +1 -1
- package/dist/module/actions/index.js.map +1 -1
- package/dist/module/actions/types.js.map +1 -1
- package/dist/module/apis/index.js +1 -1
- package/dist/module/apis/index.js.map +1 -1
- package/dist/module/apis/{generalActions.js → maintenanceActions.js} +22 -39
- package/dist/module/apis/maintenanceActions.js.map +1 -0
- package/dist/module/components/FilterPopupMenu.js +48 -12
- package/dist/module/components/FilterPopupMenu.js.map +1 -1
- package/dist/module/components/MaintenanceList.js +49 -15
- package/dist/module/components/MaintenanceList.js.map +1 -1
- package/dist/module/components/MaintenanceListItem.js +14 -15
- package/dist/module/components/MaintenanceListItem.js.map +1 -1
- package/dist/module/components/MaintenanceWidgetItem.js +3 -7
- package/dist/module/components/MaintenanceWidgetItem.js.map +1 -1
- package/dist/module/components/StatusSelectorPopup.js +2 -1
- package/dist/module/components/StatusSelectorPopup.js.map +1 -1
- package/dist/module/components/WidgetLarge.js.map +1 -1
- package/dist/module/components/WidgetSmall.js +4 -4
- package/dist/module/components/WidgetSmall.js.map +1 -1
- package/dist/module/core.config.js.map +1 -1
- package/dist/module/feature.config.js.map +1 -1
- package/dist/module/helper.js +10 -2
- package/dist/module/helper.js.map +1 -1
- package/dist/module/index.js.map +1 -1
- package/dist/module/reducers/JobsReducer.js.map +1 -1
- package/dist/module/screens/JobTypePicker.js +2 -2
- package/dist/module/screens/JobTypePicker.js.map +1 -1
- package/dist/module/screens/MaintenancePage.js +2 -2
- package/dist/module/screens/MaintenancePage.js.map +1 -1
- package/dist/module/screens/RequestDetail.js +141 -39
- package/dist/module/screens/RequestDetail.js.map +1 -1
- package/dist/module/screens/RequestNotes.js +6 -6
- package/dist/module/screens/RequestNotes.js.map +1 -1
- package/dist/module/screens/ServiceRequest.js +6 -6
- package/dist/module/screens/ServiceRequest.js.map +1 -1
- package/package.json +2 -5
- package/src/apis/index.js +1 -1
- package/src/apis/{generalActions.js → maintenanceActions.js} +19 -38
- package/src/components/FilterPopupMenu.js +39 -7
- package/src/components/MaintenanceList.js +56 -16
- package/src/components/MaintenanceListItem.js +12 -8
- package/src/components/MaintenanceWidgetItem.js +1 -1
- package/src/components/StatusSelectorPopup.js +2 -1
- package/src/components/WidgetSmall.js +2 -2
- package/src/helper.js +11 -2
- package/src/screens/RequestDetail.js +131 -14
- package/src/screens/RequestNotes.js +4 -4
- package/src/screens/ServiceRequest.js +4 -4
- package/dist/module/apis/generalActions.js.map +0 -1
@@ -1,11 +1,11 @@
|
|
1
1
|
import React, { Component } from 'react';
|
2
|
-
import { ScrollView, View, StyleSheet, Text, KeyboardAvoidingView, TouchableOpacity, ImageBackground } from 'react-native';
|
2
|
+
import { ScrollView, View, StyleSheet, Text, KeyboardAvoidingView, TouchableOpacity, ImageBackground, Platform } from 'react-native';
|
3
3
|
import DateTimePicker from 'react-native-modal-datetime-picker';
|
4
4
|
import { Icon } from 'react-native-elements';
|
5
5
|
import _ from 'lodash';
|
6
6
|
import moment from 'moment';
|
7
7
|
import { connect } from 'react-redux';
|
8
|
-
import {
|
8
|
+
import { maintenanceActions } from '../apis';
|
9
9
|
import { jobAdded } from '../actions';
|
10
10
|
import StatusSelectorPopup from '../components/StatusSelectorPopup';
|
11
11
|
import { jobStatusOptions, getJobStatusProps } from '../helper';
|
@@ -24,13 +24,14 @@ class RequestDetail extends Component {
|
|
24
24
|
expectedDate: null,
|
25
25
|
expectedDateText: '',
|
26
26
|
seen: false,
|
27
|
-
showMore:
|
27
|
+
showMore: true,
|
28
28
|
showStatusPopup: false,
|
29
29
|
loading: false,
|
30
30
|
showFullscreenVideo: false,
|
31
31
|
currentVideoUrl: '',
|
32
32
|
galleryOpen: false,
|
33
33
|
showMessages: false,
|
34
|
+
assignees: [],
|
34
35
|
};
|
35
36
|
|
36
37
|
this.scrollView = React.createRef();
|
@@ -39,7 +40,9 @@ class RequestDetail extends Component {
|
|
39
40
|
}
|
40
41
|
|
41
42
|
componentDidMount() {
|
43
|
+
this.getJob();
|
42
44
|
this.updateJobState();
|
45
|
+
this.getAssignees();
|
43
46
|
}
|
44
47
|
|
45
48
|
componentDidUpdate(prevProps) {
|
@@ -48,6 +51,38 @@ class RequestDetail extends Component {
|
|
48
51
|
}
|
49
52
|
}
|
50
53
|
|
54
|
+
getJob = async () => {
|
55
|
+
console.log('getting job');
|
56
|
+
this.setState({ loading: true }, async () => {
|
57
|
+
try {
|
58
|
+
const res = await maintenanceActions.getJob(this.props.job.site, this.props.job.id);
|
59
|
+
this.props.jobAdded(res.data);
|
60
|
+
console.log('got the job');
|
61
|
+
} catch (error) {
|
62
|
+
console.log('getJob error', error.toString());
|
63
|
+
// check for 403 or 404 error
|
64
|
+
if (error.response.status === 403 || error.response.status === 404) {
|
65
|
+
this.setState({
|
66
|
+
forbidden: true,
|
67
|
+
});
|
68
|
+
}
|
69
|
+
console.log('getJob error', error);
|
70
|
+
} finally {
|
71
|
+
this.setState({ loading: false });
|
72
|
+
}
|
73
|
+
});
|
74
|
+
};
|
75
|
+
|
76
|
+
getAssignees = async () => {
|
77
|
+
if (!this.hasPermission()) return;
|
78
|
+
try {
|
79
|
+
const res = await maintenanceActions.getAssignees(this.props.user.site);
|
80
|
+
this.setState({ assignees: res.data.Users });
|
81
|
+
} catch (error) {
|
82
|
+
console.log('getAssignees error', error);
|
83
|
+
}
|
84
|
+
};
|
85
|
+
|
51
86
|
updateJobState() {
|
52
87
|
const job = _.find(this.props.jobs, j => j.id === this.props.job.id) || this.props.job;
|
53
88
|
const newState = { job, status: job.status };
|
@@ -73,7 +108,7 @@ class RequestDetail extends Component {
|
|
73
108
|
this.setState({ loading: true }, async () => {
|
74
109
|
try {
|
75
110
|
const updated = { id: job.id, seen: true, status: job.status || 'Unassigned' };
|
76
|
-
const res = await
|
111
|
+
const res = await maintenanceActions.editJob(updated, user.site);
|
77
112
|
// console.log('markSeen updated');
|
78
113
|
this.props.jobAdded(res.data.job);
|
79
114
|
this.setState({ loading: false, seen: true });
|
@@ -95,7 +130,7 @@ class RequestDetail extends Component {
|
|
95
130
|
.utc()
|
96
131
|
.toISOString();
|
97
132
|
}
|
98
|
-
const res = await
|
133
|
+
const res = await maintenanceActions.editJob(updated, user.site);
|
99
134
|
this.props.jobAdded(res.data.job);
|
100
135
|
} catch (error) {
|
101
136
|
console.log('updateJob error', error);
|
@@ -108,7 +143,7 @@ class RequestDetail extends Component {
|
|
108
143
|
updateJobStatus = () => {
|
109
144
|
this.setState({ loading: true }, async () => {
|
110
145
|
try {
|
111
|
-
const res = await
|
146
|
+
const res = await maintenanceActions.editJobStatus(this.props.job.id, this.state.status);
|
112
147
|
this.props.jobAdded(res.data.job);
|
113
148
|
} catch (error) {
|
114
149
|
console.log('updateJobStatus error', error);
|
@@ -181,7 +216,7 @@ class RequestDetail extends Component {
|
|
181
216
|
onCommentAdded = () => {
|
182
217
|
this.setState({ loading: true }, async () => {
|
183
218
|
try {
|
184
|
-
const job = await
|
219
|
+
const job = await maintenanceActions.getJob(this.props.user.site, this.props.job.id);
|
185
220
|
// console.log('onCommentAdded', job?.data);
|
186
221
|
this.props.jobAdded(job.data);
|
187
222
|
} catch (error) {
|
@@ -193,8 +228,15 @@ class RequestDetail extends Component {
|
|
193
228
|
};
|
194
229
|
|
195
230
|
hasPermission = () => {
|
231
|
+
const { job } = this.state;
|
196
232
|
const { permissions } = this.props.user;
|
197
|
-
|
233
|
+
if (_.includes(permissions, 'maintenanceTracking')) {
|
234
|
+
return true;
|
235
|
+
}
|
236
|
+
if (_.includes(permissions, 'maintenanceAssignment')) {
|
237
|
+
return job.AssigneeId === this.props.user.Id;
|
238
|
+
}
|
239
|
+
return false;
|
198
240
|
};
|
199
241
|
|
200
242
|
toggleFullscreenVideo = url => {
|
@@ -215,6 +257,32 @@ class RequestDetail extends Component {
|
|
215
257
|
});
|
216
258
|
}
|
217
259
|
|
260
|
+
onOpenAssigneePicker = () => {
|
261
|
+
const options = this.state.assignees.map(a => {
|
262
|
+
return { key: a.id, name: a.displayName };
|
263
|
+
});
|
264
|
+
Services.navigation.navigate('optionSelector', {
|
265
|
+
options,
|
266
|
+
selection: this.state.job.AssigneeId,
|
267
|
+
title: 'Assign request',
|
268
|
+
onSelect: this.onSelectAssignee,
|
269
|
+
});
|
270
|
+
};
|
271
|
+
|
272
|
+
onSelectAssignee = assignee => {
|
273
|
+
this.setState({ loading: true }, async () => {
|
274
|
+
try {
|
275
|
+
console.log('onSelectAssignee', this.props.job.id, assignee.key);
|
276
|
+
const res = await maintenanceActions.assignJob(this.props.job.id, assignee.key);
|
277
|
+
this.props.jobAdded(res.data.job);
|
278
|
+
} catch (error) {
|
279
|
+
console.log('onSelectAssignee error', error);
|
280
|
+
} finally {
|
281
|
+
this.setState({ loading: false });
|
282
|
+
}
|
283
|
+
});
|
284
|
+
};
|
285
|
+
|
218
286
|
renderLoading() {
|
219
287
|
return <Components.LoadingIndicator visible={this.state.loading} />;
|
220
288
|
}
|
@@ -228,10 +296,13 @@ class RequestDetail extends Component {
|
|
228
296
|
return (
|
229
297
|
<View style={{ ...Helper.getShadowStyle() }}>
|
230
298
|
<View style={styles.jobTitleContainer}>
|
299
|
+
{job.jobId ? <Text style={[styles.jobIdText, { color: this.props.colourBrandingMain }]}>{`Job #${job.jobId}`}</Text> : null}
|
231
300
|
<Text style={styles.jobTitleText}>{job.title}</Text>
|
232
301
|
<View style={styles.jobTypeSeenContainer}>
|
233
302
|
<View style={[styles.jobTypeContainer, { backgroundColor: Colours.hexToRGBAstring(this.props.colourBrandingMain, 0.2) }]}>
|
234
|
-
<Text style={[styles.jobTypeText, { color: this.props.colourBrandingMain }]}
|
303
|
+
<Text style={[styles.jobTypeText, { color: this.props.colourBrandingMain }]} numberOfLines={2}>
|
304
|
+
{job.type}
|
305
|
+
</Text>
|
235
306
|
</View>
|
236
307
|
{showSeen && this.state.seen && (
|
237
308
|
<View style={styles.jobSeenContainer}>
|
@@ -249,7 +320,7 @@ class RequestDetail extends Component {
|
|
249
320
|
</View>
|
250
321
|
</View>
|
251
322
|
)}
|
252
|
-
<View style={styles.textSectionInner}>
|
323
|
+
{/* <View style={styles.textSectionInner}>
|
253
324
|
<Text style={styles.textSectionLabel}>Expected Date</Text>
|
254
325
|
<TouchableOpacity onPress={this.onOpenDatePicker}>
|
255
326
|
<View style={styles.textSectionTextContainer}>
|
@@ -261,14 +332,13 @@ class RequestDetail extends Component {
|
|
261
332
|
/>
|
262
333
|
</View>
|
263
334
|
</TouchableOpacity>
|
264
|
-
</View>
|
335
|
+
</View> */}
|
265
336
|
</View>
|
266
337
|
<View style={styles.jobStatusExpectedContainer}>
|
267
338
|
<View style={styles.jobStatusOuterContainer}>
|
268
339
|
<Text style={styles.jobStatusHeading}>STATUS</Text>
|
269
340
|
<TouchableOpacity onPress={canEdit ? this.onOpenStatusPicker : null}>
|
270
341
|
<View style={[styles.jobStatusContainer, { backgroundColor: statusColor }]}>
|
271
|
-
<Icon name="wrench" type="font-awesome" iconStyle={styles.jobStatusIcon} />
|
272
342
|
<Text style={styles.jobStatusText}>{statusText}</Text>
|
273
343
|
</View>
|
274
344
|
</TouchableOpacity>
|
@@ -349,6 +419,42 @@ class RequestDetail extends Component {
|
|
349
419
|
);
|
350
420
|
}
|
351
421
|
|
422
|
+
renderAssignee() {
|
423
|
+
const { job } = this.state;
|
424
|
+
if (!this.hasPermission() && !job.Assignee) return null;
|
425
|
+
|
426
|
+
const content = (
|
427
|
+
<View>
|
428
|
+
<Text style={styles.locationLabel}>Assigned To</Text>
|
429
|
+
<View>
|
430
|
+
{job.Assignee && (
|
431
|
+
<View style={styles.profileContainer}>
|
432
|
+
<Components.ProfilePic ProfilePic={job.Assignee.profilePic} Diameter={40} />
|
433
|
+
<View style={styles.nameContainer}>
|
434
|
+
<Text style={styles.nameText}>{job.Assignee.displayName}</Text>
|
435
|
+
</View>
|
436
|
+
</View>
|
437
|
+
)}
|
438
|
+
</View>
|
439
|
+
</View>
|
440
|
+
);
|
441
|
+
|
442
|
+
if (this.hasPermission()) {
|
443
|
+
return (
|
444
|
+
<Components.FormCardSectionOptionLauncher
|
445
|
+
onPress={this.onOpenAssigneePicker}
|
446
|
+
title="Assigned To"
|
447
|
+
value={job.Assignee ? job.Assignee.displayName : 'Unassigned'}
|
448
|
+
textStyle={styles.detailsText}
|
449
|
+
sectionStyle={styles.detailsSection}
|
450
|
+
>
|
451
|
+
{content}
|
452
|
+
</Components.FormCardSectionOptionLauncher>
|
453
|
+
);
|
454
|
+
}
|
455
|
+
return content;
|
456
|
+
}
|
457
|
+
|
352
458
|
rendeDetails() {
|
353
459
|
const { job } = this.state;
|
354
460
|
|
@@ -452,6 +558,9 @@ class RequestDetail extends Component {
|
|
452
558
|
}
|
453
559
|
|
454
560
|
render() {
|
561
|
+
if (this.state.forbidden) {
|
562
|
+
return <Components.Forbidden />;
|
563
|
+
}
|
455
564
|
return (
|
456
565
|
<KeyboardAvoidingView behavior={Platform.OS === 'ios' && 'padding'} style={styles.container}>
|
457
566
|
<Components.Header leftIcon="angle-left" onPressLeft={this.onPressBack} text={Config.env.strings.MAINTENANCE_REQUEST_DETAILS} />
|
@@ -459,6 +568,7 @@ class RequestDetail extends Component {
|
|
459
568
|
<ScrollView ref={this.scrollView} contentContainerStyle={{ paddingBottom: 26 }} style={{ height: '100%' }}>
|
460
569
|
<View style={styles.innerContainer}>
|
461
570
|
{this.renderTop()}
|
571
|
+
{this.renderAssignee()}
|
462
572
|
{this.rendeDetails()}
|
463
573
|
{this.renderMessages()}
|
464
574
|
</View>
|
@@ -491,6 +601,11 @@ const styles = StyleSheet.create({
|
|
491
601
|
paddingVertical: 14,
|
492
602
|
paddingHorizontal: 12,
|
493
603
|
},
|
604
|
+
jobIdText: {
|
605
|
+
fontFamily: 'sf-medium',
|
606
|
+
fontSize: 12,
|
607
|
+
marginBottom: 4,
|
608
|
+
},
|
494
609
|
jobTitleText: {
|
495
610
|
fontFamily: 'sf-semibold',
|
496
611
|
fontSize: 20,
|
@@ -502,8 +617,9 @@ const styles = StyleSheet.create({
|
|
502
617
|
alignItems: 'center',
|
503
618
|
},
|
504
619
|
jobTypeContainer: {
|
505
|
-
|
506
|
-
|
620
|
+
padding: 4,
|
621
|
+
minWidth: 80,
|
622
|
+
maxWidth: 140,
|
507
623
|
borderRadius: 4,
|
508
624
|
justifyContent: 'center',
|
509
625
|
},
|
@@ -511,6 +627,7 @@ const styles = StyleSheet.create({
|
|
511
627
|
fontFamily: 'sf-semibold',
|
512
628
|
fontSize: 12,
|
513
629
|
textAlign: 'center',
|
630
|
+
maxWidth: '100%',
|
514
631
|
},
|
515
632
|
jobSeenContainer: {
|
516
633
|
flexDirection: 'row',
|
@@ -5,7 +5,7 @@ import { Icon } from 'react-native-elements';
|
|
5
5
|
import _ from 'lodash';
|
6
6
|
import moment from 'moment';
|
7
7
|
import { jobAdded } from '../actions';
|
8
|
-
import {
|
8
|
+
import { maintenanceActions } from '../apis';
|
9
9
|
import { getBottomSpace } from 'react-native-iphone-x-helper';
|
10
10
|
import { Services } from '../feature.config';
|
11
11
|
import { Components, Colours, Helper } from '../core.config';
|
@@ -61,7 +61,7 @@ class RequestNotes extends Component {
|
|
61
61
|
};
|
62
62
|
|
63
63
|
onPressConfirmDelete = () => {
|
64
|
-
|
64
|
+
maintenanceActions.deleteNote(this.props.job.id, this.state.noteToDelete.Id);
|
65
65
|
const newNotes = _.filter(this.state.job.Notes, note => {
|
66
66
|
return note.Id !== this.state.noteToDelete.Id;
|
67
67
|
});
|
@@ -126,7 +126,7 @@ class RequestNotes extends Component {
|
|
126
126
|
try {
|
127
127
|
this.setState({ submittingNote: true });
|
128
128
|
const res = await (this.state.editingNote
|
129
|
-
?
|
129
|
+
? maintenanceActions.editNote(
|
130
130
|
this.props.job.id,
|
131
131
|
this.state.editingNote,
|
132
132
|
this.state.noteInput,
|
@@ -137,7 +137,7 @@ class RequestNotes extends Component {
|
|
137
137
|
};
|
138
138
|
}),
|
139
139
|
)
|
140
|
-
:
|
140
|
+
: maintenanceActions.addNote(
|
141
141
|
this.props.job.id,
|
142
142
|
this.state.noteInput,
|
143
143
|
this.state.noteAttachments.map(a => {
|
@@ -16,7 +16,7 @@ import _ from 'lodash';
|
|
16
16
|
import { Icon } from 'react-native-elements';
|
17
17
|
import { connect } from 'react-redux';
|
18
18
|
import { jobAdded } from '../actions';
|
19
|
-
import {
|
19
|
+
import { maintenanceActions } from '../apis';
|
20
20
|
import { Services } from '../feature.config';
|
21
21
|
import { Components, Colours, Helper, Config } from '../core.config';
|
22
22
|
|
@@ -179,7 +179,7 @@ class MaintenanceRequest extends Component {
|
|
179
179
|
|
180
180
|
getJobTypes() {
|
181
181
|
const self = this;
|
182
|
-
|
182
|
+
maintenanceActions
|
183
183
|
.getJobTypes(Helper.getSite(this.props.site))
|
184
184
|
.then(res => {
|
185
185
|
self.setState({
|
@@ -227,7 +227,7 @@ class MaintenanceRequest extends Component {
|
|
227
227
|
return img.url;
|
228
228
|
});
|
229
229
|
|
230
|
-
|
230
|
+
maintenanceActions
|
231
231
|
.sendMaintenanceRequest(
|
232
232
|
this.props.uid,
|
233
233
|
this.state.userName,
|
@@ -268,7 +268,7 @@ class MaintenanceRequest extends Component {
|
|
268
268
|
|
269
269
|
refreshRequest = async id => {
|
270
270
|
try {
|
271
|
-
const job = await
|
271
|
+
const job = await maintenanceActions.getJob(Helper.getSite(this.props.site), id);
|
272
272
|
// console.log('refreshRequest', job?.data);
|
273
273
|
this.props.jobAdded(job.data);
|
274
274
|
} catch (error) {
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["Helper","Session","generalActions","getJob","site","id","authedFunction","method","url","getUrl","data","getJobByJobId","jobId","getJobs","status","type","getJobs2","lastKey","query","JSON","stringify","getJobsRecursive","jobs","Promise","resolve","then","jobRes","newJobs","Items","LastKey","sendMaintenanceRequest","userID","userName","phone","room","title","description","date","images","location","isHome","homeText","request","editJob","job","editJobStatus","addNote","note","attachments","action","editNote","noteId","deleteNote","getJobTypes"],"sources":["generalActions.js"],"sourcesContent":["// import axios from 'axios';\n// import { getUrl } from './helper';\n// import { authedFunction } from '../js';\nimport { Helper, Session } from '../core.config';\n\nexport const generalActions = {\n getJob: (site, id) => {\n return Session.authedFunction({\n method: 'POST',\n url: Helper.getUrl('maintenance', 'getJob'),\n data: { site, id },\n });\n },\n getJobByJobId: (site, jobId) => {\n return Session.authedFunction({\n method: 'POST',\n url: Helper.getUrl('maintenance', 'getJob'),\n data: { site, jobId },\n });\n },\n getJobs: (site, status = '', type = '') => {\n return Session.authedFunction({\n method: 'POST',\n url: Helper.getUrl('maintenance', 'getJobs'),\n data: { site, status, type },\n });\n },\n getJobs2: (site, status, type, lastKey) => {\n const query = { site };\n if (status) {\n query.status = status;\n }\n if (type) {\n query.type = type;\n }\n if (lastKey) {\n query.lastKey = JSON.stringify(lastKey);\n }\n return Session.authedFunction({\n method: 'GET',\n url: Helper.getUrl('maintenance', 'get/requests', query),\n });\n },\n getJobsRecursive: (site, status, type, lastKey, jobs = []) => {\n return new Promise(resolve => {\n generalActions.getJobs2(site, status, type, lastKey).then(jobRes => {\n const newJobs = [...jobs, ...jobRes.data.Items];\n if (!jobRes.data.LastKey) {\n return resolve(newJobs);\n }\n return resolve(generalActions.getJobsRecursive(site, status, type, jobRes.data.LastKey, newJobs));\n });\n });\n },\n sendMaintenanceRequest: (userID, userName, phone, room, title, description, date, type, images, location, isHome, homeText) => {\n const request = {\n method: 'POST',\n url: Helper.getUrl('maintenance', 'sendMaintenance'),\n data: {\n userID,\n userName,\n phone,\n room,\n title,\n description,\n date,\n type,\n images,\n location,\n isHome,\n homeText,\n },\n };\n return Session.authedFunction(request);\n },\n editJob: (job, site) => {\n return Session.authedFunction({\n method: 'POST',\n url: Helper.getUrl('maintenance', 'editJob'),\n data: { job, site },\n });\n },\n editJobStatus: (id, status) => {\n return Session.authedFunction({\n method: 'POST',\n url: Helper.getUrl('maintenance', 'editJobStatus'),\n data: { id, status },\n });\n },\n addNote: (jobId, note, attachments) => {\n return Session.authedFunction({\n method: 'POST',\n url: Helper.getUrl('maintenance', 'requests/note'),\n data: {\n id: jobId,\n note,\n attachments,\n action: 'AddNote',\n },\n });\n },\n editNote: (jobId, noteId, note, attachments) => {\n return Session.authedFunction({\n method: 'POST',\n url: Helper.getUrl('maintenance', 'requests/note'),\n data: {\n id: jobId,\n note,\n attachments,\n noteId,\n action: 'EditNote',\n },\n });\n },\n deleteNote: (jobId, noteId) => {\n return Session.authedFunction({\n method: 'POST',\n url: Helper.getUrl('maintenance', 'requests/note'),\n data: {\n id: jobId,\n noteId,\n action: 'DeleteNote',\n },\n });\n },\n // getWeeklyMenu: async time => {\n // //deprecated\n // return null;\n // },\n getJobTypes: async site => {\n const url = Helper.getUrl('maintenance', 'getjobtypes');\n return Session.authedFunction({\n method: 'POST',\n url,\n data: { site },\n });\n },\n // sendBookingRequest: async bookingInfo => {\n // return authedFunction({\n // method: 'POST',\n // data: {\n // bookingInfo,\n // },\n // url: getUrl('utility', 'sendBookingRequest'),\n // });\n // },\n // getString: async (site, id, useDefault) => {\n // return axios({\n // method: 'GET',\n // url: getUrl('strings', `get/${site}_${id}`, useDefault ? { useDefault } : undefined),\n // }).catch(error => {\n // console.log('getString error', error);\n // throw error;\n // });\n // },\n // getGeneralTerms: async () => {\n // return axios({\n // method: 'GET',\n // url: 'https://pluss.plussapp.com.au/strings-prd/get/plussSpace_termsofuse',\n // });\n // },\n // declineTerms: async (site, userID) => {\n // //deprecated\n // return null;\n // },\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,MAAM,EAAEC,OAAO,QAAQ,gBAAgB;AAEhD,OAAO,MAAMC,cAAc,GAAG;EAC5BC,MAAM,EAAEA,CAACC,IAAI,EAAEC,EAAE,KAAK;IACpB,OAAOJ,OAAO,CAACK,cAAc,CAAC;MAC5BC,MAAM,EAAE,MAAM;MACdC,GAAG,EAAER,MAAM,CAACS,MAAM,CAAC,aAAa,EAAE,QAA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