@plusscommunities/pluss-maintenance-app-forms 6.0.10 → 6.0.11-auth.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 (106) hide show
  1. package/dist/module/actions/JobActions.js +44 -1
  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 +4 -1
  6. package/dist/module/actions/types.js.map +1 -1
  7. package/dist/module/apis/index.js +4 -1
  8. package/dist/module/apis/index.js.map +1 -1
  9. package/dist/module/apis/maintenanceActions.js +61 -38
  10. package/dist/module/apis/maintenanceActions.js.map +1 -1
  11. package/dist/module/apis/userActions.js +23 -0
  12. package/dist/module/apis/userActions.js.map +1 -0
  13. package/dist/module/components/FilterPopupMenu.js +82 -58
  14. package/dist/module/components/FilterPopupMenu.js.map +1 -1
  15. package/dist/module/components/MaintenanceList.js +84 -92
  16. package/dist/module/components/MaintenanceList.js.map +1 -1
  17. package/dist/module/components/MaintenanceListItem.js +94 -80
  18. package/dist/module/components/MaintenanceListItem.js.map +1 -1
  19. package/dist/module/components/MaintenanceWidgetItem.js +39 -38
  20. package/dist/module/components/MaintenanceWidgetItem.js.map +1 -1
  21. package/dist/module/components/PrioritySelectorPopup.js +83 -0
  22. package/dist/module/components/PrioritySelectorPopup.js.map +1 -0
  23. package/dist/module/components/StatusSelectorPopup.js +23 -27
  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 +25 -20
  28. package/dist/module/components/WidgetSmall.js.map +1 -1
  29. package/dist/module/core.config.js +2 -3
  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 +41 -26
  34. package/dist/module/helper.js.map +1 -1
  35. package/dist/module/index.js +12 -10
  36. package/dist/module/index.js.map +1 -1
  37. package/dist/module/reducers/JobsReducer.js +36 -6
  38. package/dist/module/reducers/JobsReducer.js.map +1 -1
  39. package/dist/module/screens/JobTypePicker.js +18 -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 +219 -0
  44. package/dist/module/screens/MaintenanceUserPicker.js.map +1 -0
  45. package/dist/module/screens/RequestDetail.js +410 -142
  46. package/dist/module/screens/RequestDetail.js.map +1 -1
  47. package/dist/module/screens/RequestNotes.js +462 -52
  48. package/dist/module/screens/RequestNotes.js.map +1 -1
  49. package/dist/module/screens/ServiceRequest.js +519 -181
  50. package/dist/module/screens/ServiceRequest.js.map +1 -1
  51. package/dist/module/values.config.a.js +30 -23
  52. package/dist/module/values.config.a.js.map +1 -1
  53. package/dist/module/values.config.default.js +35 -28
  54. package/dist/module/values.config.default.js.map +1 -1
  55. package/dist/module/values.config.enquiry.js +43 -0
  56. package/dist/module/values.config.enquiry.js.map +1 -0
  57. package/dist/module/values.config.feedback.js +43 -0
  58. package/dist/module/values.config.feedback.js.map +1 -0
  59. package/dist/module/values.config.food.js +43 -0
  60. package/dist/module/values.config.food.js.map +1 -0
  61. package/dist/module/values.config.forms.js +35 -28
  62. package/dist/module/values.config.forms.js.map +1 -1
  63. package/dist/module/values.config.js +35 -28
  64. package/dist/module/values.config.js.map +1 -1
  65. package/package.json +55 -51
  66. package/src/actions/JobActions.js +75 -16
  67. package/src/actions/index.js +1 -1
  68. package/src/actions/types.js +4 -1
  69. package/src/apis/index.js +6 -1
  70. package/src/apis/maintenanceActions.js +189 -160
  71. package/src/apis/userActions.js +21 -0
  72. package/src/components/FilterPopupMenu.js +316 -230
  73. package/src/components/MaintenanceList.js +391 -326
  74. package/src/components/MaintenanceListItem.js +348 -274
  75. package/src/components/MaintenanceWidgetItem.js +146 -120
  76. package/src/components/PrioritySelectorPopup.js +93 -0
  77. package/src/components/StatusSelectorPopup.js +82 -76
  78. package/src/components/WidgetLarge.js +5 -5
  79. package/src/components/WidgetSmall.js +154 -131
  80. package/src/core.config.js +25 -3
  81. package/src/feature.config.js +62 -62
  82. package/src/helper.js +67 -30
  83. package/src/index.js +22 -20
  84. package/src/reducers/JobsReducer.js +85 -41
  85. package/src/screens/JobTypePicker.js +116 -92
  86. package/src/screens/MaintenancePage.js +89 -80
  87. package/src/screens/MaintenanceUserPicker.js +233 -0
  88. package/src/screens/RequestDetail.js +1354 -892
  89. package/src/screens/RequestNotes.js +946 -408
  90. package/src/screens/ServiceRequest.js +1808 -1222
  91. package/src/values.config.a.js +33 -26
  92. package/src/values.config.default.js +39 -32
  93. package/src/values.config.enquiry.js +43 -0
  94. package/src/values.config.feedback.js +43 -0
  95. package/src/values.config.food.js +43 -0
  96. package/src/values.config.forms.js +39 -32
  97. package/src/values.config.js +39 -32
  98. package/dist/module/values.config.b.js +0 -30
  99. package/dist/module/values.config.b.js.map +0 -1
  100. package/dist/module/values.config.c.js +0 -30
  101. package/dist/module/values.config.c.js.map +0 -1
  102. package/dist/module/values.config.d.js +0 -30
  103. package/dist/module/values.config.d.js.map +0 -1
  104. package/src/values.config.b.js +0 -30
  105. package/src/values.config.c.js +0 -30
  106. package/src/values.config.d.js +0 -30
@@ -1,22 +1,81 @@
1
- import { JOBS_LOADED, JOB_ADDED, JOBS_ADDED } from './types';
1
+ import {
2
+ JOBS_LOADED,
3
+ JOB_ADDED,
4
+ JOBS_ADDED,
5
+ JOBS_STATUSES_LOADED,
6
+ JOBS_HIDE_SEEN,
7
+ JOB_FILTER_LOADED,
8
+ } from "./types";
9
+ import { stringActions } from "../apis";
10
+ import { values } from "../values.config";
11
+ import { jobStatusOptions } from "../helper";
2
12
 
3
- export const jobsLoaded = jobs => {
4
- return {
5
- type: JOBS_LOADED,
6
- payload: jobs,
7
- };
13
+ export const jobsLoaded = (jobs) => {
14
+ return {
15
+ type: JOBS_LOADED,
16
+ payload: jobs,
17
+ };
8
18
  };
9
19
 
10
- export const jobAdded = job => {
11
- return {
12
- type: JOB_ADDED,
13
- payload: job,
14
- };
20
+ export const jobAdded = (job) => {
21
+ return {
22
+ type: JOB_ADDED,
23
+ payload: job,
24
+ };
15
25
  };
16
26
 
17
- export const jobsAdded = jobs => {
18
- return {
19
- type: JOBS_ADDED,
20
- payload: jobs,
21
- };
27
+ export const jobsAdded = (jobs) => {
28
+ return {
29
+ type: JOBS_ADDED,
30
+ payload: jobs,
31
+ };
32
+ };
33
+
34
+ export const jobStatusesUpdate = (site, callback = null) => {
35
+ return (dispatch) => {
36
+ stringActions
37
+ .getString(site, values.stringConfigJobStatus)
38
+ .then((res) => {
39
+ dispatch({
40
+ type: JOBS_STATUSES_LOADED,
41
+ payload: res.data,
42
+ });
43
+ if (callback) callback(res.data);
44
+ })
45
+ .catch(() => {
46
+ dispatch({
47
+ type: JOBS_STATUSES_LOADED,
48
+ payload: jobStatusOptions,
49
+ });
50
+ if (callback) callback(jobStatusOptions);
51
+ });
52
+ };
53
+ };
54
+
55
+ export const jobHideSeenUpdate = (site, callback = null) => {
56
+ return (dispatch) => {
57
+ stringActions
58
+ .getString(site, values.stringConfigHideSeen)
59
+ .then((res) => {
60
+ dispatch({
61
+ type: JOBS_HIDE_SEEN,
62
+ payload: res.data,
63
+ });
64
+ if (callback) callback(res.data);
65
+ })
66
+ .catch((_error) => {
67
+ dispatch({
68
+ type: JOBS_HIDE_SEEN,
69
+ payload: false,
70
+ });
71
+ if (callback) callback(false);
72
+ });
73
+ };
74
+ };
75
+
76
+ export const jobsFilterLoaded = (filters) => {
77
+ return {
78
+ type: JOB_FILTER_LOADED,
79
+ payload: filters,
80
+ };
22
81
  };
@@ -1 +1 @@
1
- export * from './JobActions';
1
+ export * from "./JobActions";
@@ -1,5 +1,8 @@
1
- import { values } from '../values.config';
1
+ import { values } from "../values.config";
2
2
 
3
3
  export const JOBS_LOADED = values.actionJobsLoaded;
4
4
  export const JOB_ADDED = values.actionJobAdded;
5
5
  export const JOBS_ADDED = values.actionJobsAdded;
6
+ export const JOBS_STATUSES_LOADED = values.actionJobsStatusesLoaded;
7
+ export const JOBS_HIDE_SEEN = values.actionJobsHideSeen;
8
+ export const JOB_FILTER_LOADED = values.actionJobFilterLoaded;
package/src/apis/index.js CHANGED
@@ -1 +1,6 @@
1
- export * from './maintenanceActions';
1
+ import { Apis } from "../core.config";
2
+
3
+ export const stringActions = Apis.stringActions;
4
+
5
+ export * from "./maintenanceActions";
6
+ export * from "./userActions";
@@ -1,163 +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, type, lastKey) => {
27
- const query = { site };
28
- if (status) {
29
- query.status = status;
30
- }
31
- if (type) {
32
- query.type = type;
33
- }
34
- if (lastKey) {
35
- query.lastKey = JSON.stringify(lastKey);
36
- }
37
- return Session.authedFunction({
38
- method: 'GET',
39
- url: Helper.getUrl(values.serviceKey, 'get/requests', query),
40
- });
41
- },
42
- getJobsRecursive: (site, status, type, lastKey, jobs = []) => {
43
- return new Promise(resolve => {
44
- maintenanceActions.getJobs2(site, status, type, lastKey).then(jobRes => {
45
- const newJobs = [...jobs, ...jobRes.data.Items];
46
- if (!jobRes.data.LastKey) {
47
- return resolve(newJobs);
48
- }
49
- return resolve(maintenanceActions.getJobsRecursive(site, status, type, jobRes.data.LastKey, newJobs));
50
- });
51
- });
52
- },
53
- sendMaintenanceRequest: (
54
- userID,
55
- userName,
56
- phone,
57
- room,
58
- title,
59
- description,
60
- date,
61
- type,
62
- images,
63
- location,
64
- isHome,
65
- homeText,
66
- customFields,
67
- ) => {
68
- const request = {
69
- method: 'POST',
70
- url: Helper.getUrl(values.serviceKey, 'sendMaintenance'),
71
- data: {
72
- userID,
73
- userName,
74
- phone,
75
- room,
76
- title,
77
- description,
78
- date,
79
- type,
80
- images,
81
- location,
82
- isHome,
83
- homeText,
84
- customFields,
85
- },
86
- };
87
- return Session.authedFunction(request);
88
- },
89
- editJob: (job, site) => {
90
- return Session.authedFunction({
91
- method: 'POST',
92
- url: Helper.getUrl(values.serviceKey, 'editJob'),
93
- data: { job, site },
94
- });
95
- },
96
- editJobStatus: (id, status) => {
97
- return Session.authedFunction({
98
- method: 'POST',
99
- url: Helper.getUrl(values.serviceKey, 'editJobStatus'),
100
- data: { id, status },
101
- });
102
- },
103
- assignJob: (jobId, userId) => {
104
- return Session.authedFunction({
105
- method: 'POST',
106
- url: Helper.getUrl(values.serviceKey, 'update/assign'),
107
- data: {
108
- id: jobId,
109
- userId,
110
- },
111
- });
112
- },
113
- getAssignees: site => {
114
- return Session.authedFunction({
115
- method: 'GET',
116
- url: Helper.getUrl(values.serviceKey, 'get/assignees', { site }),
117
- });
118
- },
119
- addNote: (jobId, note, attachments) => {
120
- return Session.authedFunction({
121
- method: 'POST',
122
- url: Helper.getUrl(values.serviceKey, 'requests/note'),
123
- data: {
124
- id: jobId,
125
- note,
126
- attachments,
127
- action: 'AddNote',
128
- },
129
- });
130
- },
131
- editNote: (jobId, noteId, note, attachments) => {
132
- return Session.authedFunction({
133
- method: 'POST',
134
- url: Helper.getUrl(values.serviceKey, 'requests/note'),
135
- data: {
136
- id: jobId,
137
- note,
138
- attachments,
139
- noteId,
140
- action: 'EditNote',
141
- },
142
- });
143
- },
144
- deleteNote: (jobId, noteId) => {
145
- return Session.authedFunction({
146
- method: 'POST',
147
- url: Helper.getUrl(values.serviceKey, 'requests/note'),
148
- data: {
149
- id: jobId,
150
- noteId,
151
- action: 'DeleteNote',
152
- },
153
- });
154
- },
155
- getJobTypes: async site => {
156
- const url = Helper.getUrl(values.serviceKey, 'getjobtypes');
157
- return Session.authedFunction({
158
- method: 'POST',
159
- url,
160
- data: { site },
161
- });
162
- },
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
+ },
163
192
  };
@@ -0,0 +1,21 @@
1
+ import { Helper, Session } from "../core.config";
2
+
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
+ },
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
+ },
21
+ };