@plusscommunities/pluss-maintenance-app 6.0.20 → 6.0.21-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.
Files changed (97) hide show
  1. package/dist/module/actions/JobActions.js +4 -4
  2. package/dist/module/actions/JobActions.js.map +1 -1
  3. package/dist/module/actions/index.js +1 -1
  4. package/dist/module/actions/index.js.map +1 -1
  5. package/dist/module/actions/types.js +1 -1
  6. package/dist/module/actions/types.js.map +1 -1
  7. package/dist/module/apis/index.js +3 -3
  8. package/dist/module/apis/index.js.map +1 -1
  9. package/dist/module/apis/maintenanceActions.js +36 -36
  10. package/dist/module/apis/maintenanceActions.js.map +1 -1
  11. package/dist/module/apis/userActions.js +5 -5
  12. package/dist/module/apis/userActions.js.map +1 -1
  13. package/dist/module/components/FilterPopupMenu.js +49 -49
  14. package/dist/module/components/FilterPopupMenu.js.map +1 -1
  15. package/dist/module/components/MaintenanceList.js +38 -38
  16. package/dist/module/components/MaintenanceList.js.map +1 -1
  17. package/dist/module/components/MaintenanceListItem.js +62 -62
  18. package/dist/module/components/MaintenanceListItem.js.map +1 -1
  19. package/dist/module/components/MaintenanceWidgetItem.js +27 -27
  20. package/dist/module/components/MaintenanceWidgetItem.js.map +1 -1
  21. package/dist/module/components/PrioritySelectorPopup.js +15 -15
  22. package/dist/module/components/PrioritySelectorPopup.js.map +1 -1
  23. package/dist/module/components/StatusSelectorPopup.js +16 -16
  24. package/dist/module/components/StatusSelectorPopup.js.map +1 -1
  25. package/dist/module/components/WidgetLarge.js +2 -2
  26. package/dist/module/components/WidgetLarge.js.map +1 -1
  27. package/dist/module/components/WidgetSmall.js +19 -19
  28. package/dist/module/components/WidgetSmall.js.map +1 -1
  29. package/dist/module/core.config.js +1 -1
  30. package/dist/module/core.config.js.map +1 -1
  31. package/dist/module/feature.config.js +17 -17
  32. package/dist/module/feature.config.js.map +1 -1
  33. package/dist/module/helper.js +10 -10
  34. package/dist/module/helper.js.map +1 -1
  35. package/dist/module/index.js +11 -11
  36. package/dist/module/index.js.map +1 -1
  37. package/dist/module/reducers/JobsReducer.js +13 -13
  38. package/dist/module/reducers/JobsReducer.js.map +1 -1
  39. package/dist/module/screens/JobTypePicker.js +17 -17
  40. package/dist/module/screens/JobTypePicker.js.map +1 -1
  41. package/dist/module/screens/MaintenancePage.js +10 -10
  42. package/dist/module/screens/MaintenancePage.js.map +1 -1
  43. package/dist/module/screens/MaintenanceUserPicker.js +129 -22
  44. package/dist/module/screens/MaintenanceUserPicker.js.map +1 -1
  45. package/dist/module/screens/RequestDetail.js +145 -145
  46. package/dist/module/screens/RequestDetail.js.map +1 -1
  47. package/dist/module/screens/RequestNotes.js +59 -59
  48. package/dist/module/screens/RequestNotes.js.map +1 -1
  49. package/dist/module/screens/ServiceRequest.js +187 -187
  50. package/dist/module/screens/ServiceRequest.js.map +1 -1
  51. package/dist/module/values.config.a.js +30 -30
  52. package/dist/module/values.config.a.js.map +1 -1
  53. package/dist/module/values.config.default.js +34 -34
  54. package/dist/module/values.config.default.js.map +1 -1
  55. package/dist/module/values.config.enquiry.js +34 -34
  56. package/dist/module/values.config.enquiry.js.map +1 -1
  57. package/dist/module/values.config.feedback.js +34 -34
  58. package/dist/module/values.config.feedback.js.map +1 -1
  59. package/dist/module/values.config.food.js +34 -34
  60. package/dist/module/values.config.food.js.map +1 -1
  61. package/dist/module/values.config.forms.js +34 -34
  62. package/dist/module/values.config.forms.js.map +1 -1
  63. package/dist/module/values.config.js +34 -34
  64. package/dist/module/values.config.js.map +1 -1
  65. package/package.json +51 -51
  66. package/src/actions/JobActions.js +67 -60
  67. package/src/actions/index.js +1 -1
  68. package/src/actions/types.js +1 -2
  69. package/src/apis/index.js +3 -3
  70. package/src/apis/maintenanceActions.js +189 -178
  71. package/src/apis/userActions.js +17 -17
  72. package/src/components/FilterPopupMenu.js +313 -256
  73. package/src/components/MaintenanceList.js +396 -317
  74. package/src/components/MaintenanceListItem.js +347 -288
  75. package/src/components/MaintenanceWidgetItem.js +145 -124
  76. package/src/components/PrioritySelectorPopup.js +81 -68
  77. package/src/components/StatusSelectorPopup.js +81 -70
  78. package/src/components/WidgetLarge.js +5 -5
  79. package/src/components/WidgetSmall.js +153 -133
  80. package/src/core.config.js +27 -3
  81. package/src/feature.config.js +62 -62
  82. package/src/helper.js +58 -53
  83. package/src/index.js +22 -22
  84. package/src/reducers/JobsReducer.js +85 -66
  85. package/src/screens/JobTypePicker.js +115 -92
  86. package/src/screens/MaintenancePage.js +89 -80
  87. package/src/screens/MaintenanceUserPicker.js +252 -100
  88. package/src/screens/RequestDetail.js +1348 -1125
  89. package/src/screens/RequestNotes.js +950 -806
  90. package/src/screens/ServiceRequest.js +1778 -1550
  91. package/src/values.config.a.js +33 -33
  92. package/src/values.config.default.js +39 -39
  93. package/src/values.config.enquiry.js +39 -39
  94. package/src/values.config.feedback.js +39 -39
  95. package/src/values.config.food.js +39 -39
  96. package/src/values.config.forms.js +39 -39
  97. package/src/values.config.js +39 -39
@@ -1,181 +1,192 @@
1
- import { Helper, Session } from '../core.config';
2
- import { values } from '../values.config';
1
+ import { Helper, Session } from "../core.config";
2
+ import { values } from "../values.config";
3
3
 
4
4
  export const maintenanceActions = {
5
- getJob: (site, id) => {
6
- return Session.authedFunction({
7
- method: 'POST',
8
- url: Helper.getUrl(values.serviceKey, 'getJob'),
9
- data: { site, id },
10
- });
11
- },
12
- getJobByJobId: (site, jobId) => {
13
- return Session.authedFunction({
14
- method: 'POST',
15
- url: Helper.getUrl(values.serviceKey, 'getJob'),
16
- data: { site, jobId },
17
- });
18
- },
19
- getJobs: (site, status = '', type = '') => {
20
- return Session.authedFunction({
21
- method: 'POST',
22
- url: Helper.getUrl(values.serviceKey, 'getJobs'),
23
- data: { site, status, type },
24
- });
25
- },
26
- getJobs2: (site, status, priority, type, lastKey) => {
27
- const query = { site };
28
- if (status) {
29
- query.status = status;
30
- }
31
- if (priority) {
32
- query.priority = priority;
33
- }
34
- if (type) {
35
- query.type = type;
36
- }
37
- if (lastKey) {
38
- query.lastKey = JSON.stringify(lastKey);
39
- }
40
- return Session.authedFunction({
41
- method: 'GET',
42
- url: Helper.getUrl(values.serviceKey, 'get/requests', query),
43
- });
44
- },
45
- getJobsRecursive: (site, status, priority, type, lastKey, jobs = []) => {
46
- return new Promise(resolve => {
47
- maintenanceActions.getJobs2(site, status, priority, type, lastKey).then(jobRes => {
48
- const newJobs = [...jobs, ...jobRes.data.Items];
49
- if (!jobRes.data.LastKey) {
50
- return resolve(newJobs);
51
- }
52
- return resolve(maintenanceActions.getJobsRecursive(site, status, priority, type, jobRes.data.LastKey, newJobs));
53
- });
54
- });
55
- },
56
- sendMaintenanceRequest: (
57
- userID,
58
- userName,
59
- phone,
60
- room,
61
- title,
62
- description,
63
- date,
64
- type,
65
- images,
66
- location,
67
- isHome,
68
- homeText,
69
- customFields,
70
- ) => {
71
- const request = {
72
- method: 'POST',
73
- url: Helper.getUrl(values.serviceKey, 'sendMaintenance'),
74
- data: {
75
- userID,
76
- userName,
77
- phone,
78
- room,
79
- title,
80
- description,
81
- date,
82
- type,
83
- images,
84
- location,
85
- isHome,
86
- homeText,
87
- customFields,
88
- },
89
- };
90
- return Session.authedFunction(request);
91
- },
92
- editJob: (job, site) => {
93
- return Session.authedFunction({
94
- method: 'POST',
95
- url: Helper.getUrl(values.serviceKey, 'editJob'),
96
- data: { job, site },
97
- });
98
- },
99
- editJobStatus: (id, status) => {
100
- return Session.authedFunction({
101
- method: 'POST',
102
- url: Helper.getUrl(values.serviceKey, 'editJobStatus'),
103
- data: { id, status },
104
- });
105
- },
106
- editJobPriority: (id, priority) => {
107
- return Session.authedFunction({
108
- method: 'POST',
109
- url: Helper.getUrl(values.serviceKey, 'update/priority'),
110
- data: { id, priority },
111
- });
112
- },
113
- assignJob: (jobId, userId) => {
114
- return Session.authedFunction({
115
- method: 'POST',
116
- url: Helper.getUrl(values.serviceKey, 'update/assign'),
117
- data: {
118
- id: jobId,
119
- userId,
120
- },
121
- });
122
- },
123
- getAssignees: site => {
124
- return Session.authedFunction({
125
- method: 'GET',
126
- url: Helper.getUrl(values.serviceKey, 'get/assignees', { site }),
127
- });
128
- },
129
- addNote: (jobId, note, attachments, images) => {
130
- return Session.authedFunction({
131
- method: 'POST',
132
- url: Helper.getUrl(values.serviceKey, 'requests/note'),
133
- data: {
134
- id: jobId,
135
- note,
136
- attachments,
137
- images,
138
- action: 'AddNote',
139
- },
140
- });
141
- },
142
- editNote: (jobId, noteId, note, attachments, images) => {
143
- return Session.authedFunction({
144
- method: 'POST',
145
- url: Helper.getUrl(values.serviceKey, 'requests/note'),
146
- data: {
147
- id: jobId,
148
- note,
149
- attachments,
150
- images,
151
- noteId,
152
- action: 'EditNote',
153
- },
154
- });
155
- },
156
- deleteNote: (jobId, noteId) => {
157
- return Session.authedFunction({
158
- method: 'POST',
159
- url: Helper.getUrl(values.serviceKey, 'requests/note'),
160
- data: {
161
- id: jobId,
162
- noteId,
163
- action: 'DeleteNote',
164
- },
165
- });
166
- },
167
- getJobTypes: async site => {
168
- const url = Helper.getUrl(values.serviceKey, 'getjobtypes');
169
- return Session.authedFunction({
170
- method: 'POST',
171
- url,
172
- data: { site },
173
- });
174
- },
175
- getExternalSync: (jobId) => {
176
- return Session.authedFunction({
177
- method: 'GET',
178
- url: Helper.getUrl(values.serviceKey, 'get/externalsync', { id: jobId }),
179
- });
180
- },
5
+ getJob: (site, id) => {
6
+ return Session.authedFunction({
7
+ method: "POST",
8
+ url: Helper.getUrl(values.serviceKey, "getJob"),
9
+ data: { site, id },
10
+ });
11
+ },
12
+ getJobByJobId: (site, jobId) => {
13
+ return Session.authedFunction({
14
+ method: "POST",
15
+ url: Helper.getUrl(values.serviceKey, "getJob"),
16
+ data: { site, jobId },
17
+ });
18
+ },
19
+ getJobs: (site, status = "", type = "") => {
20
+ return Session.authedFunction({
21
+ method: "POST",
22
+ url: Helper.getUrl(values.serviceKey, "getJobs"),
23
+ data: { site, status, type },
24
+ });
25
+ },
26
+ getJobs2: (site, status, priority, type, lastKey) => {
27
+ const query = { site };
28
+ if (status) {
29
+ query.status = status;
30
+ }
31
+ if (priority) {
32
+ query.priority = priority;
33
+ }
34
+ if (type) {
35
+ query.type = type;
36
+ }
37
+ if (lastKey) {
38
+ query.lastKey = JSON.stringify(lastKey);
39
+ }
40
+ return Session.authedFunction({
41
+ method: "GET",
42
+ url: Helper.getUrl(values.serviceKey, "get/requests", query),
43
+ });
44
+ },
45
+ getJobsRecursive: (site, status, priority, type, lastKey, jobs = []) => {
46
+ return new Promise((resolve) => {
47
+ maintenanceActions
48
+ .getJobs2(site, status, priority, type, lastKey)
49
+ .then((jobRes) => {
50
+ const newJobs = [...jobs, ...jobRes.data.Items];
51
+ if (!jobRes.data.LastKey) {
52
+ return resolve(newJobs);
53
+ }
54
+ return resolve(
55
+ maintenanceActions.getJobsRecursive(
56
+ site,
57
+ status,
58
+ priority,
59
+ type,
60
+ jobRes.data.LastKey,
61
+ newJobs,
62
+ ),
63
+ );
64
+ });
65
+ });
66
+ },
67
+ sendMaintenanceRequest: (
68
+ userID,
69
+ userName,
70
+ phone,
71
+ room,
72
+ title,
73
+ description,
74
+ date,
75
+ type,
76
+ images,
77
+ location,
78
+ isHome,
79
+ homeText,
80
+ customFields,
81
+ ) => {
82
+ const request = {
83
+ method: "POST",
84
+ url: Helper.getUrl(values.serviceKey, "sendMaintenance"),
85
+ data: {
86
+ userID,
87
+ userName,
88
+ phone,
89
+ room,
90
+ title,
91
+ description,
92
+ date,
93
+ type,
94
+ images,
95
+ location,
96
+ isHome,
97
+ homeText,
98
+ customFields,
99
+ },
100
+ };
101
+ return Session.authedFunction(request);
102
+ },
103
+ editJob: (job, site) => {
104
+ return Session.authedFunction({
105
+ method: "POST",
106
+ url: Helper.getUrl(values.serviceKey, "editJob"),
107
+ data: { job, site },
108
+ });
109
+ },
110
+ editJobStatus: (id, status) => {
111
+ return Session.authedFunction({
112
+ method: "POST",
113
+ url: Helper.getUrl(values.serviceKey, "editJobStatus"),
114
+ data: { id, status },
115
+ });
116
+ },
117
+ editJobPriority: (id, priority) => {
118
+ return Session.authedFunction({
119
+ method: "POST",
120
+ url: Helper.getUrl(values.serviceKey, "update/priority"),
121
+ data: { id, priority },
122
+ });
123
+ },
124
+ assignJob: (jobId, userId) => {
125
+ return Session.authedFunction({
126
+ method: "POST",
127
+ url: Helper.getUrl(values.serviceKey, "update/assign"),
128
+ data: {
129
+ id: jobId,
130
+ userId,
131
+ },
132
+ });
133
+ },
134
+ getAssignees: (site) => {
135
+ return Session.authedFunction({
136
+ method: "GET",
137
+ url: Helper.getUrl(values.serviceKey, "get/assignees", { site }),
138
+ });
139
+ },
140
+ addNote: (jobId, note, attachments, images) => {
141
+ return Session.authedFunction({
142
+ method: "POST",
143
+ url: Helper.getUrl(values.serviceKey, "requests/note"),
144
+ data: {
145
+ id: jobId,
146
+ note,
147
+ attachments,
148
+ images,
149
+ action: "AddNote",
150
+ },
151
+ });
152
+ },
153
+ editNote: (jobId, noteId, note, attachments, images) => {
154
+ return Session.authedFunction({
155
+ method: "POST",
156
+ url: Helper.getUrl(values.serviceKey, "requests/note"),
157
+ data: {
158
+ id: jobId,
159
+ note,
160
+ attachments,
161
+ images,
162
+ noteId,
163
+ action: "EditNote",
164
+ },
165
+ });
166
+ },
167
+ deleteNote: (jobId, noteId) => {
168
+ return Session.authedFunction({
169
+ method: "POST",
170
+ url: Helper.getUrl(values.serviceKey, "requests/note"),
171
+ data: {
172
+ id: jobId,
173
+ noteId,
174
+ action: "DeleteNote",
175
+ },
176
+ });
177
+ },
178
+ getJobTypes: async (site) => {
179
+ const url = Helper.getUrl(values.serviceKey, "getjobtypes");
180
+ return Session.authedFunction({
181
+ method: "POST",
182
+ url,
183
+ data: { site },
184
+ });
185
+ },
186
+ getExternalSync: (jobId) => {
187
+ return Session.authedFunction({
188
+ method: "GET",
189
+ url: Helper.getUrl(values.serviceKey, "get/externalsync", { id: jobId }),
190
+ });
191
+ },
181
192
  };
@@ -1,21 +1,21 @@
1
- import { Helper, Session } from '../core.config';
1
+ import { Helper, Session } from "../core.config";
2
2
 
3
3
  export const userActions = {
4
- getSiteUsers: async site => {
5
- return Session.authedFunction({
6
- method: 'GET',
7
- url: Helper.getUrl('users', 'users/site', { site, compact: true }),
8
- });
9
- },
4
+ getSiteUsers: async (site) => {
5
+ return Session.authedFunction({
6
+ method: "GET",
7
+ url: Helper.getUrl("users", "users/site", { site, compact: true }),
8
+ });
9
+ },
10
10
 
11
- fetchUser: async (site, userId) => {
12
- return Session.authedFunction({
13
- method: 'POST',
14
- url: Helper.getUrl('users', 'getsingle'),
15
- data: {
16
- site,
17
- userId,
18
- },
19
- });
20
- },
11
+ fetchUser: async (site, userId) => {
12
+ return Session.authedFunction({
13
+ method: "POST",
14
+ url: Helper.getUrl("users", "getsingle"),
15
+ data: {
16
+ site,
17
+ userId,
18
+ },
19
+ });
20
+ },
21
21
  };