@plusscommunities/pluss-maintenance-app-feedback 6.0.14-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 (90) hide show
  1. package/dist/module/actions/JobActions.js +63 -0
  2. package/dist/module/actions/JobActions.js.map +1 -0
  3. package/dist/module/actions/index.js +2 -0
  4. package/dist/module/actions/index.js.map +1 -0
  5. package/dist/module/actions/types.js +8 -0
  6. package/dist/module/actions/types.js.map +1 -0
  7. package/dist/module/apis/index.js +4 -0
  8. package/dist/module/apis/index.js.map +1 -0
  9. package/dist/module/apis/maintenanceActions.js +186 -0
  10. package/dist/module/apis/maintenanceActions.js.map +1 -0
  11. package/dist/module/components/FilterPopupMenu.js +294 -0
  12. package/dist/module/components/FilterPopupMenu.js.map +1 -0
  13. package/dist/module/components/MaintenanceList.js +351 -0
  14. package/dist/module/components/MaintenanceList.js.map +1 -0
  15. package/dist/module/components/MaintenanceListItem.js +335 -0
  16. package/dist/module/components/MaintenanceListItem.js.map +1 -0
  17. package/dist/module/components/MaintenanceWidgetItem.js +149 -0
  18. package/dist/module/components/MaintenanceWidgetItem.js.map +1 -0
  19. package/dist/module/components/PrioritySelectorPopup.js +82 -0
  20. package/dist/module/components/PrioritySelectorPopup.js.map +1 -0
  21. package/dist/module/components/StatusSelectorPopup.js +84 -0
  22. package/dist/module/components/StatusSelectorPopup.js.map +1 -0
  23. package/dist/module/components/WidgetLarge.js +9 -0
  24. package/dist/module/components/WidgetLarge.js.map +1 -0
  25. package/dist/module/components/WidgetSmall.js +175 -0
  26. package/dist/module/components/WidgetSmall.js.map +1 -0
  27. package/dist/module/core.config.js +18 -0
  28. package/dist/module/core.config.js.map +1 -0
  29. package/dist/module/feature.config.js +75 -0
  30. package/dist/module/feature.config.js.map +1 -0
  31. package/dist/module/helper.js +48 -0
  32. package/dist/module/helper.js.map +1 -0
  33. package/dist/module/images/speechbubble.png +0 -0
  34. package/dist/module/index.js +25 -0
  35. package/dist/module/index.js.map +1 -0
  36. package/dist/module/reducers/JobsReducer.js +93 -0
  37. package/dist/module/reducers/JobsReducer.js.map +1 -0
  38. package/dist/module/screens/JobTypePicker.js +130 -0
  39. package/dist/module/screens/JobTypePicker.js.map +1 -0
  40. package/dist/module/screens/MaintenancePage.js +92 -0
  41. package/dist/module/screens/MaintenancePage.js.map +1 -0
  42. package/dist/module/screens/RequestDetail.js +1123 -0
  43. package/dist/module/screens/RequestDetail.js.map +1 -0
  44. package/dist/module/screens/RequestNotes.js +799 -0
  45. package/dist/module/screens/RequestNotes.js.map +1 -0
  46. package/dist/module/screens/ServiceRequest.js +1431 -0
  47. package/dist/module/screens/ServiceRequest.js.map +1 -0
  48. package/dist/module/values.config.a.js +36 -0
  49. package/dist/module/values.config.a.js.map +1 -0
  50. package/dist/module/values.config.default.js +42 -0
  51. package/dist/module/values.config.default.js.map +1 -0
  52. package/dist/module/values.config.enquiry.js +42 -0
  53. package/dist/module/values.config.enquiry.js.map +1 -0
  54. package/dist/module/values.config.feedback.js +42 -0
  55. package/dist/module/values.config.feedback.js.map +1 -0
  56. package/dist/module/values.config.forms.js +42 -0
  57. package/dist/module/values.config.forms.js.map +1 -0
  58. package/dist/module/values.config.js +42 -0
  59. package/dist/module/values.config.js.map +1 -0
  60. package/package.json +54 -0
  61. package/src/actions/JobActions.js +74 -0
  62. package/src/actions/index.js +1 -0
  63. package/src/actions/types.js +9 -0
  64. package/src/apis/index.js +5 -0
  65. package/src/apis/maintenanceActions.js +175 -0
  66. package/src/components/FilterPopupMenu.js +285 -0
  67. package/src/components/MaintenanceList.js +326 -0
  68. package/src/components/MaintenanceListItem.js +303 -0
  69. package/src/components/MaintenanceWidgetItem.js +136 -0
  70. package/src/components/PrioritySelectorPopup.js +79 -0
  71. package/src/components/StatusSelectorPopup.js +81 -0
  72. package/src/components/WidgetLarge.js +10 -0
  73. package/src/components/WidgetSmall.js +154 -0
  74. package/src/core.config.js +5 -0
  75. package/src/feature.config.js +73 -0
  76. package/src/helper.js +71 -0
  77. package/src/images/speechbubble.png +0 -0
  78. package/src/index.js +25 -0
  79. package/src/reducers/JobsReducer.js +76 -0
  80. package/src/screens/JobTypePicker.js +107 -0
  81. package/src/screens/MaintenancePage.js +96 -0
  82. package/src/screens/RequestDetail.js +1043 -0
  83. package/src/screens/RequestNotes.js +817 -0
  84. package/src/screens/ServiceRequest.js +1416 -0
  85. package/src/values.config.a.js +36 -0
  86. package/src/values.config.default.js +42 -0
  87. package/src/values.config.enquiry.js +42 -0
  88. package/src/values.config.feedback.js +42 -0
  89. package/src/values.config.forms.js +42 -0
  90. package/src/values.config.js +42 -0
@@ -0,0 +1,63 @@
1
+ import { JOBS_LOADED, JOB_ADDED, JOBS_ADDED, JOBS_STATUSES_LOADED, JOBS_HIDE_SEEN, JOB_FILTER_LOADED } from './types';
2
+ import { stringActions } from '../apis';
3
+ import { values } from '../values.config';
4
+ import { jobStatusOptions } from '../helper';
5
+ export const jobsLoaded = jobs => {
6
+ return {
7
+ type: JOBS_LOADED,
8
+ payload: jobs
9
+ };
10
+ };
11
+ export const jobAdded = job => {
12
+ return {
13
+ type: JOB_ADDED,
14
+ payload: job
15
+ };
16
+ };
17
+ export const jobsAdded = jobs => {
18
+ return {
19
+ type: JOBS_ADDED,
20
+ payload: jobs
21
+ };
22
+ };
23
+ export const jobStatusesUpdate = (site, callback = null) => {
24
+ return dispatch => {
25
+ stringActions.getString(site, values.stringConfigJobStatus).then(res => {
26
+ dispatch({
27
+ type: JOBS_STATUSES_LOADED,
28
+ payload: res.data
29
+ });
30
+ if (callback) callback(res.data);
31
+ }).catch(() => {
32
+ dispatch({
33
+ type: JOBS_STATUSES_LOADED,
34
+ payload: jobStatusOptions
35
+ });
36
+ if (callback) callback(jobStatusOptions);
37
+ });
38
+ };
39
+ };
40
+ export const jobHideSeenUpdate = (site, callback = null) => {
41
+ return dispatch => {
42
+ stringActions.getString(site, values.stringConfigHideSeen).then(res => {
43
+ dispatch({
44
+ type: JOBS_HIDE_SEEN,
45
+ payload: res.data
46
+ });
47
+ if (callback) callback(res.data);
48
+ }).catch(_error => {
49
+ dispatch({
50
+ type: JOBS_HIDE_SEEN,
51
+ payload: false
52
+ });
53
+ if (callback) callback(false);
54
+ });
55
+ };
56
+ };
57
+ export const jobsFilterLoaded = filters => {
58
+ return {
59
+ type: JOB_FILTER_LOADED,
60
+ payload: filters
61
+ };
62
+ };
63
+ //# sourceMappingURL=JobActions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["JOBS_LOADED","JOB_ADDED","JOBS_ADDED","JOBS_STATUSES_LOADED","JOBS_HIDE_SEEN","JOB_FILTER_LOADED","stringActions","values","jobStatusOptions","jobsLoaded","jobs","type","payload","jobAdded","job","jobsAdded","jobStatusesUpdate","site","callback","dispatch","getString","stringConfigJobStatus","then","res","data","catch","jobHideSeenUpdate","stringConfigHideSeen","_error","jobsFilterLoaded","filters"],"sources":["JobActions.js"],"sourcesContent":["import { JOBS_LOADED, JOB_ADDED, JOBS_ADDED, JOBS_STATUSES_LOADED, JOBS_HIDE_SEEN, JOB_FILTER_LOADED } from './types';\nimport { stringActions } from '../apis';\nimport { values } from '../values.config';\nimport { jobStatusOptions } from '../helper';\n\nexport const jobsLoaded = jobs => {\n return {\n type: JOBS_LOADED,\n payload: jobs,\n };\n};\n\nexport const jobAdded = job => {\n return {\n type: JOB_ADDED,\n payload: job,\n };\n};\n\nexport const jobsAdded = jobs => {\n return {\n type: JOBS_ADDED,\n payload: jobs,\n };\n};\n\nexport const jobStatusesUpdate = (site, callback = null) => {\n return dispatch => {\n stringActions\n .getString(site, values.stringConfigJobStatus)\n .then(res => {\n dispatch({\n type: JOBS_STATUSES_LOADED,\n payload: res.data,\n });\n if (callback) callback(res.data);\n })\n .catch(() => {\n dispatch({\n type: JOBS_STATUSES_LOADED,\n payload: jobStatusOptions,\n });\n if (callback) callback(jobStatusOptions);\n });\n };\n};\n\nexport const jobHideSeenUpdate = (site, callback = null) => {\n return (dispatch) => {\n stringActions\n .getString(site, values.stringConfigHideSeen)\n .then((res) => {\n dispatch({\n type: JOBS_HIDE_SEEN,\n payload: res.data,\n });\n if (callback) callback(res.data);\n })\n .catch((_error) => {\n dispatch({\n type: JOBS_HIDE_SEEN,\n payload: false,\n });\n if (callback) callback(false);\n });\n };\n};\n\nexport const jobsFilterLoaded = filters => {\n return {\n type: JOB_FILTER_LOADED,\n payload: filters,\n };\n};\n"],"mappings":"AAAA,SAASA,WAAW,EAAEC,SAAS,EAAEC,UAAU,EAAEC,oBAAoB,EAAEC,cAAc,EAAEC,iBAAiB,QAAQ,SAAS;AACrH,SAASC,aAAa,QAAQ,SAAS;AACvC,SAASC,MAAM,QAAQ,kBAAkB;AACzC,SAASC,gBAAgB,QAAQ,WAAW;AAE5C,OAAO,MAAMC,UAAU,GAAGC,IAAI,IAAI;EAChC,OAAO;IACLC,IAAI,EAAEX,WAAW;IACjBY,OAAO,EAAEF;EACX,CAAC;AACH,CAAC;AAED,OAAO,MAAMG,QAAQ,GAAGC,GAAG,IAAI;EAC7B,OAAO;IACLH,IAAI,EAAEV,SAAS;IACfW,OAAO,EAAEE;EACX,CAAC;AACH,CAAC;AAED,OAAO,MAAMC,SAAS,GAAGL,IAAI,IAAI;EAC/B,OAAO;IACLC,IAAI,EAAET,UAAU;IAChBU,OAAO,EAAEF;EACX,CAAC;AACH,CAAC;AAED,OAAO,MAAMM,iBAAiB,GAAGA,CAACC,IAAI,EAAEC,QAAQ,GAAG,IAAI,KAAK;EAC1D,OAAOC,QAAQ,IAAI;IACjBb,aAAa,CACVc,SAAS,CAACH,IAAI,EAAEV,MAAM,CAACc,qBAAqB,CAAC,CAC7CC,IAAI,CAACC,GAAG,IAAI;MACXJ,QAAQ,CAAC;QACPR,IAAI,EAAER,oBAAoB;QAC1BS,OAAO,EAAEW,GAAG,CAACC;MACf,CAAC,CAAC;MACF,IAAIN,QAAQ,EAAEA,QAAQ,CAACK,GAAG,CAACC,IAAI,CAAC;IAClC,CAAC,CAAC,CACDC,KAAK,CAAC,MAAM;MACXN,QAAQ,CAAC;QACPR,IAAI,EAAER,oBAAoB;QAC1BS,OAAO,EAAEJ;MACX,CAAC,CAAC;MACF,IAAIU,QAAQ,EAAEA,QAAQ,CAACV,gBAAgB,CAAC;IAC1C,CAAC,CAAC;EACN,CAAC;AACH,CAAC;AAED,OAAO,MAAMkB,iBAAiB,GAAGA,CAACT,IAAI,EAAEC,QAAQ,GAAG,IAAI,KAAK;EAC1D,OAAQC,QAAQ,IAAK;IACnBb,aAAa,CACVc,SAAS,CAACH,IAAI,EAAEV,MAAM,CAACoB,oBAAoB,CAAC,CAC5CL,IAAI,CAAEC,GAAG,IAAK;MACbJ,QAAQ,CAAC;QACPR,IAAI,EAAEP,cAAc;QACpBQ,OAAO,EAAEW,GAAG,CAACC;MACf,CAAC,CAAC;MACF,IAAIN,QAAQ,EAAEA,QAAQ,CAACK,GAAG,CAACC,IAAI,CAAC;IAClC,CAAC,CAAC,CACDC,KAAK,CAAEG,MAAM,IAAK;MACjBT,QAAQ,CAAC;QACPR,IAAI,EAAEP,cAAc;QACpBQ,OAAO,EAAE;MACX,CAAC,CAAC;MACF,IAAIM,QAAQ,EAAEA,QAAQ,CAAC,KAAK,CAAC;IAC/B,CAAC,CAAC;EACN,CAAC;AACH,CAAC;AAED,OAAO,MAAMW,gBAAgB,GAAGC,OAAO,IAAI;EACzC,OAAO;IACLnB,IAAI,EAAEN,iBAAiB;IACvBO,OAAO,EAAEkB;EACX,CAAC;AACH,CAAC","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export * from './JobActions';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["index.js"],"sourcesContent":["export * from './JobActions';\n"],"mappings":"AAAA,cAAc,cAAc","ignoreList":[]}
@@ -0,0 +1,8 @@
1
+ import { values } from '../values.config';
2
+ export const JOBS_LOADED = values.actionJobsLoaded;
3
+ export const JOB_ADDED = values.actionJobAdded;
4
+ export const JOBS_ADDED = values.actionJobsAdded;
5
+ export const JOBS_STATUSES_LOADED = values.actionJobsStatusesLoaded;
6
+ export const JOBS_HIDE_SEEN = values.actionJobsHideSeen;
7
+ export const JOB_FILTER_LOADED = values.actionJobFilterLoaded;
8
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["values","JOBS_LOADED","actionJobsLoaded","JOB_ADDED","actionJobAdded","JOBS_ADDED","actionJobsAdded","JOBS_STATUSES_LOADED","actionJobsStatusesLoaded","JOBS_HIDE_SEEN","actionJobsHideSeen","JOB_FILTER_LOADED","actionJobFilterLoaded"],"sources":["types.js"],"sourcesContent":["import { values } from '../values.config';\n\nexport const JOBS_LOADED = values.actionJobsLoaded;\nexport const JOB_ADDED = values.actionJobAdded;\nexport const JOBS_ADDED = values.actionJobsAdded;\nexport const JOBS_STATUSES_LOADED = values.actionJobsStatusesLoaded;\nexport const JOBS_HIDE_SEEN = values.actionJobsHideSeen;\nexport const JOB_FILTER_LOADED = values.actionJobFilterLoaded;\n\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,kBAAkB;AAEzC,OAAO,MAAMC,WAAW,GAAGD,MAAM,CAACE,gBAAgB;AAClD,OAAO,MAAMC,SAAS,GAAGH,MAAM,CAACI,cAAc;AAC9C,OAAO,MAAMC,UAAU,GAAGL,MAAM,CAACM,eAAe;AAChD,OAAO,MAAMC,oBAAoB,GAAGP,MAAM,CAACQ,wBAAwB;AACnE,OAAO,MAAMC,cAAc,GAAGT,MAAM,CAACU,kBAAkB;AACvD,OAAO,MAAMC,iBAAiB,GAAGX,MAAM,CAACY,qBAAqB","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ import { Apis } from '../core.config';
2
+ export const stringActions = Apis.stringActions;
3
+ export * from './maintenanceActions';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Apis","stringActions"],"sources":["index.js"],"sourcesContent":["import { Apis } from '../core.config';\n\nexport const stringActions = Apis.stringActions;\n\nexport * from './maintenanceActions';\n"],"mappings":"AAAA,SAASA,IAAI,QAAQ,gBAAgB;AAErC,OAAO,MAAMC,aAAa,GAAGD,IAAI,CAACC,aAAa;AAE/C,cAAc,sBAAsB","ignoreList":[]}
@@ -0,0 +1,186 @@
1
+ import { Helper, Session } from '../core.config';
2
+ import { values } from '../values.config';
3
+ export const maintenanceActions = {
4
+ getJob: (site, id) => {
5
+ return Session.authedFunction({
6
+ method: 'POST',
7
+ url: Helper.getUrl(values.serviceKey, 'getJob'),
8
+ data: {
9
+ site,
10
+ id
11
+ }
12
+ });
13
+ },
14
+ getJobByJobId: (site, jobId) => {
15
+ return Session.authedFunction({
16
+ method: 'POST',
17
+ url: Helper.getUrl(values.serviceKey, 'getJob'),
18
+ data: {
19
+ site,
20
+ jobId
21
+ }
22
+ });
23
+ },
24
+ getJobs: (site, status = '', type = '') => {
25
+ return Session.authedFunction({
26
+ method: 'POST',
27
+ url: Helper.getUrl(values.serviceKey, 'getJobs'),
28
+ data: {
29
+ site,
30
+ status,
31
+ type
32
+ }
33
+ });
34
+ },
35
+ getJobs2: (site, status, priority, type, lastKey) => {
36
+ const query = {
37
+ site
38
+ };
39
+ if (status) {
40
+ query.status = status;
41
+ }
42
+ if (priority) {
43
+ query.priority = priority;
44
+ }
45
+ if (type) {
46
+ query.type = type;
47
+ }
48
+ if (lastKey) {
49
+ query.lastKey = JSON.stringify(lastKey);
50
+ }
51
+ return Session.authedFunction({
52
+ method: 'GET',
53
+ url: Helper.getUrl(values.serviceKey, 'get/requests', query)
54
+ });
55
+ },
56
+ getJobsRecursive: (site, status, priority, type, lastKey, jobs = []) => {
57
+ return new Promise(resolve => {
58
+ maintenanceActions.getJobs2(site, status, priority, type, lastKey).then(jobRes => {
59
+ const newJobs = [...jobs, ...jobRes.data.Items];
60
+ if (!jobRes.data.LastKey) {
61
+ return resolve(newJobs);
62
+ }
63
+ return resolve(maintenanceActions.getJobsRecursive(site, status, priority, type, jobRes.data.LastKey, newJobs));
64
+ });
65
+ });
66
+ },
67
+ sendMaintenanceRequest: (userID, userName, phone, room, title, description, date, type, images, location, isHome, homeText, customFields) => {
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: {
94
+ job,
95
+ site
96
+ }
97
+ });
98
+ },
99
+ editJobStatus: (id, status) => {
100
+ return Session.authedFunction({
101
+ method: 'POST',
102
+ url: Helper.getUrl(values.serviceKey, 'editJobStatus'),
103
+ data: {
104
+ id,
105
+ status
106
+ }
107
+ });
108
+ },
109
+ editJobPriority: (id, priority) => {
110
+ return Session.authedFunction({
111
+ method: 'POST',
112
+ url: Helper.getUrl(values.serviceKey, 'update/priority'),
113
+ data: {
114
+ id,
115
+ priority
116
+ }
117
+ });
118
+ },
119
+ assignJob: (jobId, userId) => {
120
+ return Session.authedFunction({
121
+ method: 'POST',
122
+ url: Helper.getUrl(values.serviceKey, 'update/assign'),
123
+ data: {
124
+ id: jobId,
125
+ userId
126
+ }
127
+ });
128
+ },
129
+ getAssignees: site => {
130
+ return Session.authedFunction({
131
+ method: 'GET',
132
+ url: Helper.getUrl(values.serviceKey, 'get/assignees', {
133
+ site
134
+ })
135
+ });
136
+ },
137
+ addNote: (jobId, note, attachments, images) => {
138
+ return Session.authedFunction({
139
+ method: 'POST',
140
+ url: Helper.getUrl(values.serviceKey, 'requests/note'),
141
+ data: {
142
+ id: jobId,
143
+ note,
144
+ attachments,
145
+ images,
146
+ action: 'AddNote'
147
+ }
148
+ });
149
+ },
150
+ editNote: (jobId, noteId, note, attachments, images) => {
151
+ return Session.authedFunction({
152
+ method: 'POST',
153
+ url: Helper.getUrl(values.serviceKey, 'requests/note'),
154
+ data: {
155
+ id: jobId,
156
+ note,
157
+ attachments,
158
+ images,
159
+ noteId,
160
+ action: 'EditNote'
161
+ }
162
+ });
163
+ },
164
+ deleteNote: (jobId, noteId) => {
165
+ return Session.authedFunction({
166
+ method: 'POST',
167
+ url: Helper.getUrl(values.serviceKey, 'requests/note'),
168
+ data: {
169
+ id: jobId,
170
+ noteId,
171
+ action: 'DeleteNote'
172
+ }
173
+ });
174
+ },
175
+ getJobTypes: async site => {
176
+ const url = Helper.getUrl(values.serviceKey, 'getjobtypes');
177
+ return Session.authedFunction({
178
+ method: 'POST',
179
+ url,
180
+ data: {
181
+ site
182
+ }
183
+ });
184
+ }
185
+ };
186
+ //# sourceMappingURL=maintenanceActions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Helper","Session","values","maintenanceActions","getJob","site","id","authedFunction","method","url","getUrl","serviceKey","data","getJobByJobId","jobId","getJobs","status","type","getJobs2","priority","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","customFields","request","editJob","job","editJobStatus","editJobPriority","assignJob","userId","getAssignees","addNote","note","attachments","action","editNote","noteId","deleteNote","getJobTypes"],"sources":["maintenanceActions.js"],"sourcesContent":["import { Helper, Session } from '../core.config';\nimport { values } from '../values.config';\n\nexport const maintenanceActions = {\n getJob: (site, id) => {\n return Session.authedFunction({\n method: 'POST',\n url: Helper.getUrl(values.serviceKey, 'getJob'),\n data: { site, id },\n });\n },\n getJobByJobId: (site, jobId) => {\n return Session.authedFunction({\n method: 'POST',\n url: Helper.getUrl(values.serviceKey, 'getJob'),\n data: { site, jobId },\n });\n },\n getJobs: (site, status = '', type = '') => {\n return Session.authedFunction({\n method: 'POST',\n url: Helper.getUrl(values.serviceKey, 'getJobs'),\n data: { site, status, type },\n });\n },\n getJobs2: (site, status, priority, type, lastKey) => {\n const query = { site };\n if (status) {\n query.status = status;\n }\n if (priority) {\n query.priority = priority;\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(values.serviceKey, 'get/requests', query),\n });\n },\n getJobsRecursive: (site, status, priority, type, lastKey, jobs = []) => {\n return new Promise(resolve => {\n maintenanceActions.getJobs2(site, status, priority, type, lastKey).then(jobRes => {\n const newJobs = [...jobs, ...jobRes.data.Items];\n if (!jobRes.data.LastKey) {\n return resolve(newJobs);\n }\n return resolve(maintenanceActions.getJobsRecursive(site, status, priority, type, jobRes.data.LastKey, newJobs));\n });\n });\n },\n sendMaintenanceRequest: (\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 customFields,\n ) => {\n const request = {\n method: 'POST',\n url: Helper.getUrl(values.serviceKey, '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 customFields,\n },\n };\n return Session.authedFunction(request);\n },\n editJob: (job, site) => {\n return Session.authedFunction({\n method: 'POST',\n url: Helper.getUrl(values.serviceKey, 'editJob'),\n data: { job, site },\n });\n },\n editJobStatus: (id, status) => {\n return Session.authedFunction({\n method: 'POST',\n url: Helper.getUrl(values.serviceKey, 'editJobStatus'),\n data: { id, status },\n });\n },\n editJobPriority: (id, priority) => {\n return Session.authedFunction({\n method: 'POST',\n url: Helper.getUrl(values.serviceKey, 'update/priority'),\n data: { id, priority },\n });\n },\n assignJob: (jobId, userId) => {\n return Session.authedFunction({\n method: 'POST',\n url: Helper.getUrl(values.serviceKey, 'update/assign'),\n data: {\n id: jobId,\n userId,\n },\n });\n },\n getAssignees: site => {\n return Session.authedFunction({\n method: 'GET',\n url: Helper.getUrl(values.serviceKey, 'get/assignees', { site }),\n });\n },\n addNote: (jobId, note, attachments, images) => {\n return Session.authedFunction({\n method: 'POST',\n url: Helper.getUrl(values.serviceKey, 'requests/note'),\n data: {\n id: jobId,\n note,\n attachments,\n images,\n action: 'AddNote',\n },\n });\n },\n editNote: (jobId, noteId, note, attachments, images) => {\n return Session.authedFunction({\n method: 'POST',\n url: Helper.getUrl(values.serviceKey, 'requests/note'),\n data: {\n id: jobId,\n note,\n attachments,\n images,\n noteId,\n action: 'EditNote',\n },\n });\n },\n deleteNote: (jobId, noteId) => {\n return Session.authedFunction({\n method: 'POST',\n url: Helper.getUrl(values.serviceKey, 'requests/note'),\n data: {\n id: jobId,\n noteId,\n action: 'DeleteNote',\n },\n });\n },\n getJobTypes: async site => {\n const url = Helper.getUrl(values.serviceKey, 'getjobtypes');\n return Session.authedFunction({\n method: 'POST',\n url,\n data: { site },\n });\n },\n};\n"],"mappings":"AAAA,SAASA,MAAM,EAAEC,OAAO,QAAQ,gBAAgB;AAChD,SAASC,MAAM,QAAQ,kBAAkB;AAEzC,OAAO,MAAMC,kBAAkB,GAAG;EAChCC,MAAM,EAAEA,CAACC,IAAI,EAAEC,EAAE,KAAK;IACpB,OAAOL,OAAO,CAACM,cAAc,CAAC;MAC5BC,MAAM,EAAE,MAAM;MACdC,GAAG,EAAET,MAAM,CAACU,MAAM,CAACR,MAAM,CAACS,UAAU,EAAE,QAAQ,CAAC;MAC/CC,IAAI,EAAE;QAAEP,IAAI;QAAEC;MAAG;IACnB,CAAC,CAAC;EACJ,CAAC;EACDO,aAAa,EAAEA,CAACR,IAAI,EAAES,KAAK,KAAK;IAC9B,OAAOb,OAAO,CAACM,cAAc,CAAC;MAC5BC,MAAM,EAAE,MAAM;MACdC,GAAG,EAAET,MAAM,CAACU,MAAM,CAACR,MAAM,CAACS,UAAU,EAAE,QAAQ,CAAC;MAC/CC,IAAI,EAAE;QAAEP,IAAI;QAAES;MAAM;IACtB,CAAC,CAAC;EACJ,CAAC;EACDC,OAAO,EAAEA,CAACV,IAAI,EAA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)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
+ import React, { Component } from 'react';
5
+ import { View, Text, TouchableOpacity, Modal, ScrollView, Dimensions } from 'react-native';
6
+ import { connect } from 'react-redux';
7
+ import _ from 'lodash';
8
+ import { maintenanceActions } from '../apis';
9
+ import { Colours, Helper } from '../core.config';
10
+ import { getJobStatusOptions, getIncompleteJobStatuses, jobPriorityOptions, getDefaultJobPriority } from '../helper';
11
+ import { values } from '../values.config';
12
+ const SCREEN_HEIGHT = Dimensions.get('window').height;
13
+ class FilterPopupMenu extends Component {
14
+ constructor(props) {
15
+ super(props);
16
+ _defineProperty(this, "getStatusOptions", () => {
17
+ const statusOptions = getJobStatusOptions(this.props);
18
+ const options = [{
19
+ label: 'All',
20
+ value: ''
21
+ }, {
22
+ label: 'Incomplete',
23
+ value: `Unassigned|${getIncompleteJobStatuses(this.props).map(s => s.text).join('|')}`
24
+ }, ...statusOptions.map(s => ({
25
+ label: s.text,
26
+ value: s.text
27
+ }))];
28
+ // console.log('getStatusOptions', JSON.stringify(options, null, 2));
29
+ return options;
30
+ });
31
+ _defineProperty(this, "getPriorityOptions", () => {
32
+ const priorityOptions = jobPriorityOptions;
33
+ const defaultPriority = getDefaultJobPriority();
34
+ const options = [{
35
+ label: 'All',
36
+ value: ''
37
+ }, ...priorityOptions.map(p => ({
38
+ label: p.label,
39
+ value: p.label === (defaultPriority === null || defaultPriority === void 0 ? void 0 : defaultPriority.label) ? `${p.label}|undefined` : p.label
40
+ }))];
41
+ // console.log('getPriorityOptions', JSON.stringify(options, null, 2));
42
+ return options;
43
+ });
44
+ _defineProperty(this, "getAssignees", async () => {
45
+ try {
46
+ const res = await maintenanceActions.getAssignees(this.props.site);
47
+ let assignees = res.data.Users.map(t => {
48
+ return {
49
+ label: t.displayName,
50
+ value: t.id
51
+ };
52
+ });
53
+ assignees = _.orderBy(assignees, 'label');
54
+ assignees.splice(0, 0, {
55
+ label: 'All',
56
+ value: ''
57
+ });
58
+ const newState = {
59
+ assignees
60
+ };
61
+ if (!assignees.some(a => a.value === this.state.selectedAssignee)) {
62
+ newState.selectedAssignee = '';
63
+ }
64
+ // console.log('refreshassignees', assignees);
65
+ this.setState(newState);
66
+ } catch (error) {
67
+ console.error('getAssignees', error);
68
+ }
69
+ });
70
+ _defineProperty(this, "refreshTypes", async () => {
71
+ const {
72
+ data
73
+ } = await maintenanceActions.getJobTypes(Helper.getSite(this.props.site));
74
+ const types = data.map(t => {
75
+ return {
76
+ label: t.typeName,
77
+ value: t.typeName
78
+ };
79
+ });
80
+ types.splice(0, 0, {
81
+ label: 'All',
82
+ value: ''
83
+ });
84
+ // console.log('refreshTypes', types);
85
+ this.setState({
86
+ types
87
+ });
88
+ });
89
+ _defineProperty(this, "onSelectOption", (key, value) => {
90
+ const newState = {};
91
+ newState[key] = value;
92
+ this.setState(newState);
93
+ });
94
+ _defineProperty(this, "onDone", () => {
95
+ var _this$getStatusOption, _this$getPriorityOpti, _this$state$assignees;
96
+ const {
97
+ onClose
98
+ } = this.props;
99
+ const {
100
+ selectedStatus,
101
+ selectedPriority,
102
+ selectedType,
103
+ selectedAssignee
104
+ } = this.state;
105
+ if (onClose) onClose({
106
+ status: selectedStatus,
107
+ statusText: (_this$getStatusOption = this.getStatusOptions().find(o => o.value === selectedStatus)) === null || _this$getStatusOption === void 0 ? void 0 : _this$getStatusOption.label,
108
+ priority: selectedPriority,
109
+ priorityText: (_this$getPriorityOpti = this.getPriorityOptions().find(o => o.value === selectedPriority)) === null || _this$getPriorityOpti === void 0 ? void 0 : _this$getPriorityOpti.label,
110
+ type: selectedType,
111
+ assignee: selectedAssignee,
112
+ assigneeName: (_this$state$assignees = this.state.assignees.find(a => a.value === selectedAssignee)) === null || _this$state$assignees === void 0 ? void 0 : _this$state$assignees.label
113
+ });
114
+ });
115
+ this.state = {
116
+ types: props.types || [],
117
+ selectedStatus: props.status || '',
118
+ selectedPriority: props.priority || '',
119
+ selectedType: props.type || '',
120
+ selectedAssignee: props.assignee || '',
121
+ assignees: []
122
+ };
123
+ }
124
+ componentDidMount() {
125
+ this.getAssignees();
126
+ if (_.isEmpty(this.state.types)) this.refreshTypes();
127
+ }
128
+ componentDidUpdate(prevProps) {
129
+ if (prevProps.site !== this.props.site) {
130
+ this.refreshTypes();
131
+ }
132
+ }
133
+ renderTitle() {
134
+ const {
135
+ title
136
+ } = this.props;
137
+ return /*#__PURE__*/React.createElement(View, {
138
+ style: styles.titleContainer
139
+ }, /*#__PURE__*/React.createElement(Text, {
140
+ style: styles.titleText
141
+ }, title || 'Filter By'));
142
+ }
143
+ renderCancel() {
144
+ const {
145
+ colourBrandingMain,
146
+ cancelText
147
+ } = this.props;
148
+ return /*#__PURE__*/React.createElement(TouchableOpacity, {
149
+ onPress: this.onDone
150
+ }, /*#__PURE__*/React.createElement(View, {
151
+ style: styles.cancelContainer
152
+ }, /*#__PURE__*/React.createElement(Text, {
153
+ style: [styles.cancelText, {
154
+ color: colourBrandingMain
155
+ }]
156
+ }, cancelText || 'Done')));
157
+ }
158
+ renderOptions(title, options, selectedKey) {
159
+ const {
160
+ colourBrandingMain
161
+ } = this.props;
162
+ return /*#__PURE__*/React.createElement(View, {
163
+ style: styles.optionsContainer
164
+ }, /*#__PURE__*/React.createElement(Text, {
165
+ style: styles.optionsTitle
166
+ }, title), /*#__PURE__*/React.createElement(View, {
167
+ style: styles.options
168
+ }, options.map(o => {
169
+ const selected = this.state[selectedKey];
170
+ const backgroundColor = o.value === selected ? colourBrandingMain : '#fff';
171
+ const color = o.value === selected ? '#fff' : colourBrandingMain;
172
+ return /*#__PURE__*/React.createElement(TouchableOpacity, {
173
+ key: o.label,
174
+ onPress: () => this.onSelectOption(selectedKey, o.value)
175
+ }, /*#__PURE__*/React.createElement(View, {
176
+ style: [styles.optionContainer, {
177
+ backgroundColor,
178
+ borderColor: colourBrandingMain
179
+ }]
180
+ }, /*#__PURE__*/React.createElement(Text, {
181
+ style: [styles.optionText, {
182
+ color
183
+ }]
184
+ }, o.label)));
185
+ })));
186
+ }
187
+ render() {
188
+ // console.log('FilterPopupMenu', JSON.stringify({ category: this.props.user.category, permissions: this.props.user.permissions }, null, 2))
189
+ const isStaff = this.props.user.category === 'staff';
190
+ const canFilterAssignee = !_.includes(this.props.user.permissions, values.permissionMaintenanceAssignment);
191
+ return /*#__PURE__*/React.createElement(Modal, {
192
+ visible: true,
193
+ transparent: true,
194
+ animationType: "slide",
195
+ onRequestClose: this.onDone
196
+ }, /*#__PURE__*/React.createElement(View, {
197
+ style: styles.container
198
+ }, /*#__PURE__*/React.createElement(View, {
199
+ style: styles.menu
200
+ }, this.renderTitle(), /*#__PURE__*/React.createElement(ScrollView, {
201
+ style: styles.optionContent
202
+ }, this.renderOptions('Status', this.getStatusOptions(), 'selectedStatus'), isStaff ? this.renderOptions('Priority', this.getPriorityOptions(), 'selectedPriority') : null, this.renderOptions('Type', this.state.types, 'selectedType'), canFilterAssignee ? this.renderOptions('Assigned To', this.state.assignees, 'selectedAssignee') : null), this.renderCancel())));
203
+ }
204
+ }
205
+ const styles = {
206
+ container: {
207
+ position: 'absolute',
208
+ bottom: 0,
209
+ left: 0,
210
+ right: 0,
211
+ top: 0,
212
+ backgroundColor: 'rgba(0,0,0,0.5)',
213
+ zIndex: 1000
214
+ },
215
+ menu: {
216
+ position: 'absolute',
217
+ bottom: 0,
218
+ left: 0,
219
+ right: 0,
220
+ backgroundColor: '#fff',
221
+ borderTopLeftRadius: 12,
222
+ borderTopRightRadius: 12,
223
+ maxHeight: SCREEN_HEIGHT * 0.8
224
+ },
225
+ cancelContainer: {
226
+ paddingVertical: 16,
227
+ borderColor: Colours.LINEGREY,
228
+ borderTopWidth: 1,
229
+ paddingHorizontal: 16
230
+ },
231
+ cancelText: {
232
+ fontFamily: 'sf-medium',
233
+ fontSize: 16,
234
+ textAlign: 'center',
235
+ color: Colours.TEXT_DARK
236
+ },
237
+ titleContainer: {
238
+ padding: 16,
239
+ borderColor: Colours.LINEGREY,
240
+ borderBottomWidth: 1
241
+ },
242
+ titleText: {
243
+ fontFamily: 'sf-semibold',
244
+ fontSize: 16,
245
+ textAlign: 'center',
246
+ color: Colours.TEXT_DARK
247
+ },
248
+ optionContent: {
249
+ paddingVertical: 10
250
+ },
251
+ optionsContainer: {
252
+ marginHorizontal: 14
253
+ },
254
+ optionsTitle: {
255
+ fontFamily: 'sf-semibold',
256
+ marginBottom: 4
257
+ },
258
+ options: {
259
+ flex: 1,
260
+ flexDirection: 'row',
261
+ flexWrap: 'wrap'
262
+ },
263
+ optionContainer: {
264
+ flexDirection: 'row',
265
+ alignItems: 'center',
266
+ justifyContent: 'center',
267
+ minWidth: 50,
268
+ height: 30,
269
+ paddingHorizontal: 8,
270
+ borderRadius: 4,
271
+ borderWidth: 1,
272
+ marginRight: 8,
273
+ marginBottom: 8
274
+ },
275
+ optionText: {
276
+ color: '#fff',
277
+ textAlign: 'center',
278
+ fontFamily: 'sf-semibold',
279
+ fontSize: 13
280
+ }
281
+ };
282
+ const mapStateToProps = state => {
283
+ const {
284
+ user
285
+ } = state;
286
+ return {
287
+ user,
288
+ site: user.site,
289
+ colourBrandingMain: Colours.getMainBrandingColourFromState(state),
290
+ statusTypes: state[values.reducerKey].jobstatuses
291
+ };
292
+ };
293
+ export default connect(mapStateToProps, {})(FilterPopupMenu);
294
+ //# sourceMappingURL=FilterPopupMenu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","Component","View","Text","TouchableOpacity","Modal","ScrollView","Dimensions","connect","_","maintenanceActions","Colours","Helper","getJobStatusOptions","getIncompleteJobStatuses","jobPriorityOptions","getDefaultJobPriority","values","SCREEN_HEIGHT","get","height","FilterPopupMenu","constructor","props","_defineProperty","statusOptions","options","label","value","map","s","text","join","priorityOptions","defaultPriority","p","res","getAssignees","site","assignees","data","Users","t","displayName","id","orderBy","splice","newState","some","a","state","selectedAssignee","setState","error","console","getJobTypes","getSite","types","typeName","key","_this$getStatusOption","_this$getPriorityOpti","_this$state$assignees","onClose","selectedStatus","selectedPriority","selectedType","status","statusText","getStatusOptions","find","o","priority","priorityText","getPriorityOptions","type","assignee","assigneeName","componentDidMount","isEmpty","refreshTypes","componentDidUpdate","prevProps","renderTitle","title","createElement","style","styles","titleContainer","titleText","renderCancel","colourBrandingMain","cancelText","onPress","onDone","cancelContainer","color","renderOptions","selectedKey","optionsContainer","optionsTitle","selected","backgroundColor","onSelectOption","optionContainer","borderColor","optionText","render","isStaff","user","category","canFilterAssignee","includes","permissions","permissionMaintenanceAssignment","visible","transparent","animationType","onRequestClose","container","menu","optionContent","position","bottom","left","right","top","zIndex","borderTopLeftRadius","borderTopRightRadius","maxHeight","paddingVertical","LINEGREY","borderTopWidth","paddingHorizontal","fontFamily","fontSize","textAlign","TEXT_DARK","padding","borderBottomWidth","marginHorizontal","marginBottom","flex","flexDirection","flexWrap","alignItems","justifyContent","minWidth","borderRadius","borderWidth","marginRight","mapStateToProps","getMainBrandingColourFromState","statusTypes","reducerKey","jobstatuses"],"sources":["FilterPopupMenu.js"],"sourcesContent":["import React, { Component } from 'react';\nimport { View, Text, TouchableOpacity, Modal, ScrollView, Dimensions } from 'react-native';\nimport { connect } from 'react-redux';\nimport _ from 'lodash';\nimport { maintenanceActions } from '../apis';\nimport { Colours, Helper } from '../core.config';\nimport { getJobStatusOptions, getIncompleteJobStatuses, jobPriorityOptions, getDefaultJobPriority } from '../helper';\nimport { values } from '../values.config';\n\nconst SCREEN_HEIGHT = Dimensions.get('window').height;\n\nclass FilterPopupMenu extends Component {\n constructor(props) {\n super(props);\n\n this.state = {\n types: props.types || [],\n selectedStatus: props.status || '',\n selectedPriority: props.priority || '',\n selectedType: props.type || '',\n selectedAssignee: props.assignee || '',\n assignees: [],\n };\n }\n\n componentDidMount() {\n this.getAssignees();\n if (_.isEmpty(this.state.types)) this.refreshTypes();\n }\n\n componentDidUpdate(prevProps) {\n if (prevProps.site !== this.props.site) {\n this.refreshTypes();\n }\n }\n\n getStatusOptions = () => {\n const statusOptions = getJobStatusOptions(this.props);\n const options = [\n {\n label: 'All',\n value: '',\n },\n {\n label: 'Incomplete',\n value: `Unassigned|${getIncompleteJobStatuses(this.props)\n .map(s => s.text)\n .join('|')}`,\n },\n ...statusOptions.map(s => ({\n label: s.text,\n value: s.text,\n })),\n ];\n // console.log('getStatusOptions', JSON.stringify(options, null, 2));\n return options;\n };\n\n getPriorityOptions = () => {\n const priorityOptions = jobPriorityOptions;\n const defaultPriority = getDefaultJobPriority();\n const options = [\n {\n label: 'All',\n value: '',\n },\n ...priorityOptions.map(p => ({\n label: p.label,\n value: p.label === defaultPriority?.label ? `${p.label}|undefined` : p.label,\n })),\n ];\n // console.log('getPriorityOptions', JSON.stringify(options, null, 2));\n return options;\n };\n\n getAssignees = async () => {\n try {\n const res = await maintenanceActions.getAssignees(this.props.site);\n let assignees = res.data.Users.map(t => {\n return { label: t.displayName, value: t.id };\n });\n assignees = _.orderBy(assignees, 'label');\n\n assignees.splice(0, 0, { label: 'All', value: '' });\n\n const newState = { assignees };\n\n if (!assignees.some(a => a.value === this.state.selectedAssignee)) {\n newState.selectedAssignee = '';\n }\n // console.log('refreshassignees', assignees);\n this.setState(newState);\n } catch (error) {\n console.error('getAssignees', error);\n }\n };\n\n refreshTypes = async () => {\n const { data } = await maintenanceActions.getJobTypes(Helper.getSite(this.props.site));\n const types = data.map(t => {\n return { label: t.typeName, value: t.typeName };\n });\n types.splice(0, 0, { label: 'All', value: '' });\n // console.log('refreshTypes', types);\n this.setState({ types });\n };\n\n onSelectOption = (key, value) => {\n const newState = {};\n newState[key] = value;\n this.setState(newState);\n };\n\n onDone = () => {\n const { onClose } = this.props;\n const { selectedStatus, selectedPriority, selectedType, selectedAssignee } = this.state;\n if (onClose)\n onClose({\n status: selectedStatus,\n statusText: this.getStatusOptions().find(o => o.value === selectedStatus)?.label,\n priority: selectedPriority,\n priorityText: this.getPriorityOptions().find(o => o.value === selectedPriority)?.label,\n type: selectedType,\n assignee: selectedAssignee,\n assigneeName: this.state.assignees.find(a => a.value === selectedAssignee)?.label,\n });\n };\n\n renderTitle() {\n const { title } = this.props;\n return (\n <View style={styles.titleContainer}>\n <Text style={styles.titleText}>{title || 'Filter By'}</Text>\n </View>\n );\n }\n\n renderCancel() {\n const { colourBrandingMain, cancelText } = this.props;\n return (\n <TouchableOpacity onPress={this.onDone}>\n <View style={styles.cancelContainer}>\n <Text style={[styles.cancelText, { color: colourBrandingMain }]}>{cancelText || 'Done'}</Text>\n </View>\n </TouchableOpacity>\n );\n }\n\n renderOptions(title, options, selectedKey) {\n const { colourBrandingMain } = this.props;\n return (\n <View style={styles.optionsContainer}>\n <Text style={styles.optionsTitle}>{title}</Text>\n <View style={styles.options}>\n {options.map(o => {\n const selected = this.state[selectedKey];\n const backgroundColor = o.value === selected ? colourBrandingMain : '#fff';\n const color = o.value === selected ? '#fff' : colourBrandingMain;\n return (\n <TouchableOpacity key={o.label} onPress={() => this.onSelectOption(selectedKey, o.value)}>\n <View style={[styles.optionContainer, { backgroundColor, borderColor: colourBrandingMain }]}>\n <Text style={[styles.optionText, { color }]}>{o.label}</Text>\n </View>\n </TouchableOpacity>\n );\n })}\n </View>\n </View>\n );\n }\n\n render() {\n // console.log('FilterPopupMenu', JSON.stringify({ category: this.props.user.category, permissions: this.props.user.permissions }, null, 2))\n const isStaff = this.props.user.category === 'staff';\n const canFilterAssignee = !_.includes(this.props.user.permissions, values.permissionMaintenanceAssignment);\n\n return (\n <Modal visible transparent animationType=\"slide\" onRequestClose={this.onDone}>\n <View style={styles.container}>\n <View style={styles.menu}>\n {this.renderTitle()}\n <ScrollView style={styles.optionContent}>\n {this.renderOptions('Status', this.getStatusOptions(), 'selectedStatus')}\n {isStaff ? this.renderOptions('Priority', this.getPriorityOptions(), 'selectedPriority') : null}\n {this.renderOptions('Type', this.state.types, 'selectedType')}\n {canFilterAssignee ? this.renderOptions('Assigned To', this.state.assignees, 'selectedAssignee') : null}\n </ScrollView>\n {this.renderCancel()}\n </View>\n </View>\n </Modal>\n );\n }\n}\n\nconst styles = {\n container: {\n position: 'absolute',\n bottom: 0,\n left: 0,\n right: 0,\n top: 0,\n backgroundColor: 'rgba(0,0,0,0.5)',\n zIndex: 1000,\n },\n menu: {\n position: 'absolute',\n bottom: 0,\n left: 0,\n right: 0,\n backgroundColor: '#fff',\n borderTopLeftRadius: 12,\n borderTopRightRadius: 12,\n maxHeight: SCREEN_HEIGHT * 0.8,\n },\n cancelContainer: {\n paddingVertical: 16,\n borderColor: Colours.LINEGREY,\n borderTopWidth: 1,\n paddingHorizontal: 16,\n },\n cancelText: {\n fontFamily: 'sf-medium',\n fontSize: 16,\n textAlign: 'center',\n color: Colours.TEXT_DARK,\n },\n titleContainer: {\n padding: 16,\n borderColor: Colours.LINEGREY,\n borderBottomWidth: 1,\n },\n titleText: {\n fontFamily: 'sf-semibold',\n fontSize: 16,\n textAlign: 'center',\n color: Colours.TEXT_DARK,\n },\n optionContent: {\n paddingVertical: 10,\n },\n optionsContainer: {\n marginHorizontal: 14,\n },\n optionsTitle: {\n fontFamily: 'sf-semibold',\n marginBottom: 4,\n },\n options: {\n flex: 1,\n flexDirection: 'row',\n flexWrap: 'wrap',\n },\n optionContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n minWidth: 50,\n height: 30,\n paddingHorizontal: 8,\n borderRadius: 4,\n borderWidth: 1,\n marginRight: 8,\n marginBottom: 8,\n },\n optionText: {\n color: '#fff',\n textAlign: 'center',\n fontFamily: 'sf-semibold',\n fontSize: 13,\n },\n};\n\nconst mapStateToProps = state => {\n const { user } = state;\n\n return {\n user,\n site: user.site,\n colourBrandingMain: Colours.getMainBrandingColourFromState(state),\n statusTypes: state[values.reducerKey].jobstatuses,\n };\n};\n\nexport default connect(mapStateToProps, {})(FilterPopupMenu);\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,IAAI,EAAEC,IAAI,EAAEC,gBAAgB,EAAEC,KAAK,EAAEC,UAAU,EAAEC,UAAU,QAAQ,cAAc;AAC1F,SAASC,OAAO,QAAQ,aAAa;AACrC,OAAOC,CAAC,MAAM,QAAQ;AACtB,SAASC,kBAAkB,QAAQ,SAAS;AAC5C,SAASC,OAAO,EAAEC,MAAM,QAAQ,gBAAgB;AAChD,SAASC,mBAAmB,EAAEC,wBAAwB,EAAEC,kBAAkB,EAAEC,qBAAqB,QAAQ,WAAW;AACpH,SAASC,MAAM,QAAQ,kBAAkB;AAEzC,MAAMC,aAAa,GAAGX,UAAU,CAACY,GAAG,CAAC,QAAQ,CAAC,CAACC,MAAM;AAErD,MAAMC,eAAe,SAASpB,SAAS,CAAC;EACtCqB,WAAWA,CAACC,KAAK,EAAE;IACjB,KAAK,CAACA,KAAK,CAAC;IAACC,eAAA,2BAuBI,MAAM;MACvB,MAAMC,aAAa,GAAGZ,mBAAmB,CAAC,IAAI,CAACU,KAAK,CAAC;MACrD,MAAMG,OAAO,GAAG,CACd;QACEC,KAAK,EAAE,KAAK;QACZC,KAAK,EAAE;MACT,CAAC,EACD;QACED,KAAK,EAAE,YAAY;QACnBC,KAAK,EAAE,cAAcd,wBAAwB,CAAC,IAAI,CAACS,KAAK,CAAC,CACtDM,GAAG,CAACC,CAAC,IAAIA,CAAC,CAACC,IAAI,CAAC,CAChBC,IAAI,CAAC,GAAG,CAAC;MACd,CAAC,EACD,GAAGP,aAAa,CAACI,GAAG,CAACC,CAAC,KAAK;QACzBH,KAAK,EAAEG,CAAC,CAACC,IAAI;QACbH,KAAK,EAAEE,CAAC,CAACC;MACX,CAAC,CAAC,CAAC,CACJ;MACD;MACA,OAAO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