@plusscommunities/pluss-maintenance-app 3.0.1 → 3.0.3-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module/actions/JobActions.js.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/generalActions.js +32 -2
- package/dist/module/apis/generalActions.js.map +1 -1
- package/dist/module/apis/index.js.map +1 -1
- package/dist/module/components/FilterPopupMenu.js +5 -19
- package/dist/module/components/FilterPopupMenu.js.map +1 -1
- package/dist/module/components/MaintenanceList.js +15 -51
- package/dist/module/components/MaintenanceList.js.map +1 -1
- package/dist/module/components/MaintenanceListItem.js +7 -21
- package/dist/module/components/MaintenanceListItem.js.map +1 -1
- package/dist/module/components/MaintenanceWidgetItem.js +3 -12
- package/dist/module/components/MaintenanceWidgetItem.js.map +1 -1
- package/dist/module/components/StatusSelectorPopup.js +0 -5
- package/dist/module/components/StatusSelectorPopup.js.map +1 -1
- package/dist/module/components/WidgetLarge.js +0 -3
- package/dist/module/components/WidgetLarge.js.map +1 -1
- package/dist/module/components/WidgetSmall.js +6 -23
- package/dist/module/components/WidgetSmall.js.map +1 -1
- package/dist/module/core.config.js.map +1 -1
- package/dist/module/feature.config.js +2 -3
- package/dist/module/feature.config.js.map +1 -1
- package/dist/module/helper.js +0 -3
- package/dist/module/helper.js.map +1 -1
- package/dist/module/index.js.map +1 -1
- package/dist/module/reducers/JobsReducer.js +6 -14
- package/dist/module/reducers/JobsReducer.js.map +1 -1
- package/dist/module/screens/JobTypePicker.js +5 -14
- package/dist/module/screens/JobTypePicker.js.map +1 -1
- package/dist/module/screens/MaintenancePage.js +3 -14
- package/dist/module/screens/MaintenancePage.js.map +1 -1
- package/dist/module/screens/RequestDetail.js +15 -59
- package/dist/module/screens/RequestDetail.js.map +1 -1
- package/dist/module/screens/RequestNotes.js +7 -40
- package/dist/module/screens/RequestNotes.js.map +1 -1
- package/dist/module/screens/ServiceRequest.js +7 -59
- package/dist/module/screens/ServiceRequest.js.map +1 -1
- package/package.json +4 -4
- package/src/apis/generalActions.js +27 -0
- package/src/components/MaintenanceList.js +3 -3
- package/src/components/WidgetSmall.js +2 -2
@@ -25,6 +25,33 @@ export const generalActions = {
|
|
25
25
|
data: { site, status, type },
|
26
26
|
});
|
27
27
|
},
|
28
|
+
getJobs2: (site, status, type, lastKey) => {
|
29
|
+
const query = { site };
|
30
|
+
if (status) {
|
31
|
+
query.status = status;
|
32
|
+
}
|
33
|
+
if (type) {
|
34
|
+
query.type = type;
|
35
|
+
}
|
36
|
+
if (lastKey) {
|
37
|
+
query.lastKey = JSON.stringify(lastKey);
|
38
|
+
}
|
39
|
+
return Session.authedFunction({
|
40
|
+
method: 'GET',
|
41
|
+
url: Helper.getUrl('maintenance', 'get/requests', query),
|
42
|
+
});
|
43
|
+
},
|
44
|
+
getJobsRecursive: (site, status, type, lastKey, jobs = []) => {
|
45
|
+
return new Promise(resolve => {
|
46
|
+
generalActions.getJobs2(site, status, type, lastKey).then(jobRes => {
|
47
|
+
const newJobs = [...jobs, ...jobRes.data.Items];
|
48
|
+
if (!jobRes.data.LastKey) {
|
49
|
+
return resolve(newJobs);
|
50
|
+
}
|
51
|
+
return resolve(generalActions.getJobsRecursive(site, status, type, jobRes.data.LastKey, newJobs));
|
52
|
+
});
|
53
|
+
});
|
54
|
+
},
|
28
55
|
sendMaintenanceRequest: (userID, userName, phone, room, title, description, date, type, images, location, isHome, homeText) => {
|
29
56
|
const request = {
|
30
57
|
method: 'POST',
|
@@ -40,12 +40,12 @@ class MaintenanceList extends Component {
|
|
40
40
|
try {
|
41
41
|
const { selectedStatus, selectedType } = this.state;
|
42
42
|
// console.log('filters', { selectedStatus, selectedType });
|
43
|
-
const res = await generalActions.
|
43
|
+
const res = await generalActions.getJobsRecursive(this.props.site, selectedStatus, selectedType);
|
44
44
|
// console.log('refresh', res?.data);
|
45
45
|
if (selectedStatus || selectedType) {
|
46
|
-
this.props.jobsAdded(res
|
46
|
+
this.props.jobsAdded(res);
|
47
47
|
} else {
|
48
|
-
this.props.jobsLoaded(res
|
48
|
+
this.props.jobsLoaded(res);
|
49
49
|
}
|
50
50
|
} catch (error) {
|
51
51
|
console.log('refresh error', error);
|
@@ -39,9 +39,9 @@ class WidgetSmall extends Component {
|
|
39
39
|
refresh = () => {
|
40
40
|
this.onLoadingChanged(true, async () => {
|
41
41
|
try {
|
42
|
-
const res = await generalActions.
|
42
|
+
const res = await generalActions.getJobsRecursive(this.props.site);
|
43
43
|
// console.log('WidgetSmall - refresh', res.data);
|
44
|
-
this.props.jobsLoaded(res
|
44
|
+
this.props.jobsLoaded(res);
|
45
45
|
} catch (error) {
|
46
46
|
console.log('refresh error', error);
|
47
47
|
} finally {
|