@plusscommunities/pluss-maintenance-app-forms 6.0.8-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 +20 -0
- package/dist/module/actions/JobActions.js.map +1 -0
- package/dist/module/actions/index.js +2 -0
- package/dist/module/actions/index.js.map +1 -0
- package/dist/module/actions/types.js +5 -0
- package/dist/module/actions/types.js.map +1 -0
- package/dist/module/apis/index.js +2 -0
- package/dist/module/apis/index.js.map +1 -0
- package/dist/module/apis/maintenanceActions.js +171 -0
- package/dist/module/apis/maintenanceActions.js.map +1 -0
- package/dist/module/components/FilterPopupMenu.js +271 -0
- package/dist/module/components/FilterPopupMenu.js.map +1 -0
- package/dist/module/components/MaintenanceList.js +360 -0
- package/dist/module/components/MaintenanceList.js.map +1 -0
- package/dist/module/components/MaintenanceListItem.js +322 -0
- package/dist/module/components/MaintenanceListItem.js.map +1 -0
- package/dist/module/components/MaintenanceWidgetItem.js +149 -0
- package/dist/module/components/MaintenanceWidgetItem.js.map +1 -0
- package/dist/module/components/StatusSelectorPopup.js +89 -0
- package/dist/module/components/StatusSelectorPopup.js.map +1 -0
- package/dist/module/components/WidgetLarge.js +9 -0
- package/dist/module/components/WidgetLarge.js.map +1 -0
- package/dist/module/components/WidgetSmall.js +171 -0
- package/dist/module/components/WidgetSmall.js.map +1 -0
- package/dist/module/core.config.js +17 -0
- package/dist/module/core.config.js.map +1 -0
- package/dist/module/feature.config.js +75 -0
- package/dist/module/feature.config.js.map +1 -0
- package/dist/module/helper.js +33 -0
- package/dist/module/helper.js.map +1 -0
- package/dist/module/images/speechbubble.png +0 -0
- package/dist/module/index.js +25 -0
- package/dist/module/index.js.map +1 -0
- package/dist/module/reducers/JobsReducer.js +63 -0
- package/dist/module/reducers/JobsReducer.js.map +1 -0
- package/dist/module/screens/JobTypePicker.js +130 -0
- package/dist/module/screens/JobTypePicker.js.map +1 -0
- package/dist/module/screens/MaintenancePage.js +92 -0
- package/dist/module/screens/MaintenancePage.js.map +1 -0
- package/dist/module/screens/RequestDetail.js +980 -0
- package/dist/module/screens/RequestDetail.js.map +1 -0
- package/dist/module/screens/RequestNotes.js +390 -0
- package/dist/module/screens/RequestNotes.js.map +1 -0
- package/dist/module/screens/ServiceRequest.js +1243 -0
- package/dist/module/screens/ServiceRequest.js.map +1 -0
- package/dist/module/values.config.a.js +30 -0
- package/dist/module/values.config.a.js.map +1 -0
- package/dist/module/values.config.b.js +30 -0
- package/dist/module/values.config.b.js.map +1 -0
- package/dist/module/values.config.c.js +30 -0
- package/dist/module/values.config.c.js.map +1 -0
- package/dist/module/values.config.d.js +30 -0
- package/dist/module/values.config.d.js.map +1 -0
- package/dist/module/values.config.default.js +35 -0
- package/dist/module/values.config.default.js.map +1 -0
- package/dist/module/values.config.forms.js +35 -0
- package/dist/module/values.config.forms.js.map +1 -0
- package/dist/module/values.config.js +35 -0
- package/dist/module/values.config.js.map +1 -0
- package/package.json +53 -0
- package/src/actions/JobActions.js +22 -0
- package/src/actions/index.js +1 -0
- package/src/actions/types.js +5 -0
- package/src/apis/index.js +1 -0
- package/src/apis/maintenanceActions.js +163 -0
- package/src/components/FilterPopupMenu.js +256 -0
- package/src/components/MaintenanceList.js +335 -0
- package/src/components/MaintenanceListItem.js +289 -0
- package/src/components/MaintenanceWidgetItem.js +132 -0
- package/src/components/StatusSelectorPopup.js +87 -0
- package/src/components/WidgetLarge.js +10 -0
- package/src/components/WidgetSmall.js +152 -0
- package/src/core.config.js +5 -0
- package/src/feature.config.js +73 -0
- package/src/helper.js +39 -0
- package/src/images/speechbubble.png +0 -0
- package/src/index.js +25 -0
- package/src/reducers/JobsReducer.js +51 -0
- package/src/screens/JobTypePicker.js +107 -0
- package/src/screens/MaintenancePage.js +96 -0
- package/src/screens/RequestDetail.js +915 -0
- package/src/screens/RequestNotes.js +418 -0
- package/src/screens/ServiceRequest.js +1219 -0
- package/src/values.config.a.js +30 -0
- package/src/values.config.b.js +30 -0
- package/src/values.config.c.js +30 -0
- package/src/values.config.d.js +30 -0
- package/src/values.config.default.js +35 -0
- package/src/values.config.forms.js +35 -0
- package/src/values.config.js +35 -0
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) 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 { Image, Text, TouchableOpacity, View, StyleSheet } from 'react-native';
|
|
6
|
+
import _ from 'lodash';
|
|
7
|
+
import { Icon } from 'react-native-elements';
|
|
8
|
+
import { connect } from 'react-redux';
|
|
9
|
+
import moment from 'moment';
|
|
10
|
+
// import {
|
|
11
|
+
// getShadowStyle,
|
|
12
|
+
// LINEGREY,
|
|
13
|
+
// TEXT_DARK,
|
|
14
|
+
// TEXT_LIGHT,
|
|
15
|
+
// COLOUR_GREEN,
|
|
16
|
+
// getMainBrandingColourFromState,
|
|
17
|
+
// hexToRGBAstring,
|
|
18
|
+
// getJobStatusProps,
|
|
19
|
+
// jobStatusOptions,
|
|
20
|
+
// } from '../../js';
|
|
21
|
+
// import NavigationService from '../../js/NavigationService';
|
|
22
|
+
import { getJobStatusProps, jobStatusOptions } from '../helper';
|
|
23
|
+
import { Services } from '../feature.config';
|
|
24
|
+
import { Helper, Colours } from '../core.config';
|
|
25
|
+
import { values } from '../values.config';
|
|
26
|
+
class MaintenanceListItem extends Component {
|
|
27
|
+
constructor(...args) {
|
|
28
|
+
super(...args);
|
|
29
|
+
_defineProperty(this, "onPressJob", () => {
|
|
30
|
+
Services.navigation.navigate(values.screenRequestDetail, {
|
|
31
|
+
job: this.props.job
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
renderCommentCount() {
|
|
36
|
+
const {
|
|
37
|
+
job
|
|
38
|
+
} = this.props;
|
|
39
|
+
if (!job.commentCount) {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
43
|
+
style: styles.commentCountContainer
|
|
44
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
45
|
+
style: styles.commentCountText
|
|
46
|
+
}, job.commentCount > 99 ? '99' : job.commentCount));
|
|
47
|
+
}
|
|
48
|
+
renderDescription() {
|
|
49
|
+
const {
|
|
50
|
+
job
|
|
51
|
+
} = this.props;
|
|
52
|
+
if (_.isEmpty(job.description)) {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
return /*#__PURE__*/React.createElement(Text, {
|
|
56
|
+
style: styles.jobDescriptionText
|
|
57
|
+
}, job.description);
|
|
58
|
+
}
|
|
59
|
+
renderSeen() {
|
|
60
|
+
const {
|
|
61
|
+
job
|
|
62
|
+
} = this.props;
|
|
63
|
+
const showSeen = !job.status || job.status === jobStatusOptions[0].name;
|
|
64
|
+
if (!showSeen || !job.seen) {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
68
|
+
style: styles.jobSeenContainer
|
|
69
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
70
|
+
name: "check",
|
|
71
|
+
type: "font-awesome",
|
|
72
|
+
iconStyle: [styles.jobSeenIcon, {
|
|
73
|
+
color: this.props.colourBrandingMain
|
|
74
|
+
}]
|
|
75
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
76
|
+
style: [styles.jobSeenText, {
|
|
77
|
+
color: this.props.colourBrandingMain
|
|
78
|
+
}]
|
|
79
|
+
}, "Seen"));
|
|
80
|
+
}
|
|
81
|
+
render() {
|
|
82
|
+
const {
|
|
83
|
+
job
|
|
84
|
+
} = this.props;
|
|
85
|
+
const createdTime = moment(job.createdUnix);
|
|
86
|
+
const createdTimeText = `${createdTime.format('ddd, D MMMM')} • ${createdTime.format('h:mma')}`;
|
|
87
|
+
const assigneeText = job.Assignee ? `Assigned to\n${job.Assignee.displayName}` : '';
|
|
88
|
+
const {
|
|
89
|
+
statusText,
|
|
90
|
+
statusColor
|
|
91
|
+
} = getJobStatusProps(job.status);
|
|
92
|
+
return /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
93
|
+
onPress: this.onPressJob
|
|
94
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
95
|
+
style: [styles.jobContainer, this.props.style]
|
|
96
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
97
|
+
style: styles.jobInnerContainer
|
|
98
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
99
|
+
style: styles.jobTopSection
|
|
100
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
101
|
+
style: styles.jobTopLeft
|
|
102
|
+
}, job.jobId ? /*#__PURE__*/React.createElement(Text, {
|
|
103
|
+
style: [styles.jobIdText, {
|
|
104
|
+
color: this.props.colourBrandingMain
|
|
105
|
+
}]
|
|
106
|
+
}, `${values.textEntityName} #${job.jobId}`) : null, /*#__PURE__*/React.createElement(Text, {
|
|
107
|
+
style: styles.jobTitleText
|
|
108
|
+
}, job.title), job.room ? /*#__PURE__*/React.createElement(Text, {
|
|
109
|
+
style: styles.jobLocationText
|
|
110
|
+
}, job.room) : null, /*#__PURE__*/React.createElement(View, {
|
|
111
|
+
style: styles.jobTypeSeenContainer
|
|
112
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
113
|
+
style: [styles.jobTypeContainer, {
|
|
114
|
+
backgroundColor: Colours.hexToRGBAstring(this.props.colourBrandingMain, 0.2)
|
|
115
|
+
}]
|
|
116
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
117
|
+
style: [styles.jobTypeText, {
|
|
118
|
+
color: this.props.colourBrandingMain
|
|
119
|
+
}],
|
|
120
|
+
numberOfLines: 2
|
|
121
|
+
}, job.type)), this.renderSeen())), /*#__PURE__*/React.createElement(View, {
|
|
122
|
+
style: styles.jobTopRight
|
|
123
|
+
}, /*#__PURE__*/React.createElement(Image, {
|
|
124
|
+
style: styles.jobCommentImage,
|
|
125
|
+
source: require('../images/speechbubble.png')
|
|
126
|
+
}), this.renderCommentCount())), /*#__PURE__*/React.createElement(View, {
|
|
127
|
+
style: styles.jobBottomSection
|
|
128
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
129
|
+
style: styles.jobCreatedText
|
|
130
|
+
}, createdTimeText), /*#__PURE__*/React.createElement(View, {
|
|
131
|
+
style: styles.jobActivityContainer
|
|
132
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
133
|
+
style: [styles.jobStatusContainer, {
|
|
134
|
+
backgroundColor: statusColor
|
|
135
|
+
}]
|
|
136
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
137
|
+
style: styles.jobStatusText
|
|
138
|
+
}, statusText)), /*#__PURE__*/React.createElement(View, {
|
|
139
|
+
style: [styles.jobStatusLine, {
|
|
140
|
+
borderColor: statusColor
|
|
141
|
+
}]
|
|
142
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
143
|
+
style: styles.jobStatusLineMask
|
|
144
|
+
})), /*#__PURE__*/React.createElement(View, {
|
|
145
|
+
style: [styles.jobStatusCircle, {
|
|
146
|
+
backgroundColor: statusColor
|
|
147
|
+
}]
|
|
148
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
149
|
+
style: styles.jobStatusDateText
|
|
150
|
+
}, assigneeText))))));
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
const styles = StyleSheet.create({
|
|
154
|
+
jobContainer: {
|
|
155
|
+
marginVertical: 8,
|
|
156
|
+
paddingHorizontal: 16
|
|
157
|
+
},
|
|
158
|
+
jobInnerContainer: {
|
|
159
|
+
...Helper.getShadowStyle()
|
|
160
|
+
},
|
|
161
|
+
jobTopSection: {
|
|
162
|
+
flexDirection: 'row',
|
|
163
|
+
alignItems: 'flex-end',
|
|
164
|
+
paddingHorizontal: 10,
|
|
165
|
+
paddingVertical: 10,
|
|
166
|
+
borderBottomWidth: 1,
|
|
167
|
+
borderBottomColor: Colours.LINEGREY
|
|
168
|
+
},
|
|
169
|
+
jobTopLeft: {
|
|
170
|
+
flex: 1
|
|
171
|
+
},
|
|
172
|
+
jobIdText: {
|
|
173
|
+
fontFamily: 'sf-medium',
|
|
174
|
+
fontSize: 12,
|
|
175
|
+
marginBottom: 4
|
|
176
|
+
},
|
|
177
|
+
jobTitleText: {
|
|
178
|
+
fontFamily: 'sf-semibold',
|
|
179
|
+
fontSize: 18,
|
|
180
|
+
color: Colours.TEXT_DARK,
|
|
181
|
+
marginBottom: 4
|
|
182
|
+
},
|
|
183
|
+
jobLocationText: {
|
|
184
|
+
fontFamily: 'sf-medium',
|
|
185
|
+
fontSize: 12,
|
|
186
|
+
color: Colours.TEXT_LIGHT,
|
|
187
|
+
marginBottom: 4
|
|
188
|
+
},
|
|
189
|
+
jobTypeSeenContainer: {
|
|
190
|
+
marginTop: 4,
|
|
191
|
+
flexDirection: 'row',
|
|
192
|
+
alignItems: 'center'
|
|
193
|
+
},
|
|
194
|
+
jobTypeContainer: {
|
|
195
|
+
padding: 4,
|
|
196
|
+
minWidth: 80,
|
|
197
|
+
maxWidth: 140,
|
|
198
|
+
borderRadius: 4,
|
|
199
|
+
justifyContent: 'center'
|
|
200
|
+
},
|
|
201
|
+
jobTypeText: {
|
|
202
|
+
fontFamily: 'sf-semibold',
|
|
203
|
+
fontSize: 12,
|
|
204
|
+
textAlign: 'center',
|
|
205
|
+
maxWidth: '100%'
|
|
206
|
+
},
|
|
207
|
+
jobSeenContainer: {
|
|
208
|
+
flexDirection: 'row',
|
|
209
|
+
alignItems: 'center',
|
|
210
|
+
marginLeft: 10
|
|
211
|
+
},
|
|
212
|
+
jobSeenIcon: {
|
|
213
|
+
fontSize: 12
|
|
214
|
+
},
|
|
215
|
+
jobSeenText: {
|
|
216
|
+
fontFamily: 'sf-semibold',
|
|
217
|
+
fontSize: 12,
|
|
218
|
+
marginLeft: 4
|
|
219
|
+
},
|
|
220
|
+
jobTopRight: {
|
|
221
|
+
alignItems: 'center',
|
|
222
|
+
justifyContent: 'center',
|
|
223
|
+
paddingHorizontal: 10,
|
|
224
|
+
paddingTop: 10
|
|
225
|
+
},
|
|
226
|
+
jobCommentImage: {
|
|
227
|
+
width: 34,
|
|
228
|
+
height: 34,
|
|
229
|
+
resizeMode: 'contain'
|
|
230
|
+
},
|
|
231
|
+
commentCountContainer: {
|
|
232
|
+
position: 'absolute',
|
|
233
|
+
top: 0,
|
|
234
|
+
right: 0,
|
|
235
|
+
borderRadius: 10,
|
|
236
|
+
borderWidth: 2,
|
|
237
|
+
borderColor: '#fff',
|
|
238
|
+
width: 20,
|
|
239
|
+
height: 20,
|
|
240
|
+
backgroundColor: Colours.COLOUR_GREEN,
|
|
241
|
+
justifyContent: 'center',
|
|
242
|
+
alignItems: 'center'
|
|
243
|
+
},
|
|
244
|
+
commentCountText: {
|
|
245
|
+
textAlign: 'center',
|
|
246
|
+
fontFamily: 'sf-bold',
|
|
247
|
+
fontSize: 10,
|
|
248
|
+
color: '#fff'
|
|
249
|
+
},
|
|
250
|
+
jobBottomSection: {
|
|
251
|
+
paddingHorizontal: 10,
|
|
252
|
+
paddingVertical: 16
|
|
253
|
+
},
|
|
254
|
+
jobDescriptionText: {
|
|
255
|
+
fontFamily: 'sf-medium',
|
|
256
|
+
fontSize: 14,
|
|
257
|
+
color: Colours.TEXT_DARK,
|
|
258
|
+
marginBottom: 8
|
|
259
|
+
},
|
|
260
|
+
jobCreatedText: {
|
|
261
|
+
fontFamily: 'sf-medium',
|
|
262
|
+
fontSize: 12,
|
|
263
|
+
color: Colours.TEXT_LIGHT,
|
|
264
|
+
marginBottom: 10
|
|
265
|
+
},
|
|
266
|
+
jobActivityContainer: {
|
|
267
|
+
flexDirection: 'row',
|
|
268
|
+
alignItems: 'center'
|
|
269
|
+
},
|
|
270
|
+
jobStatusContainer: {
|
|
271
|
+
flexDirection: 'row',
|
|
272
|
+
alignItems: 'center',
|
|
273
|
+
justifyContent: 'center',
|
|
274
|
+
width: 105,
|
|
275
|
+
height: 30,
|
|
276
|
+
paddingHorizontal: 8,
|
|
277
|
+
borderRadius: 4
|
|
278
|
+
},
|
|
279
|
+
jobStatusIcon: {
|
|
280
|
+
color: '#fff',
|
|
281
|
+
fontSize: 14
|
|
282
|
+
},
|
|
283
|
+
jobStatusText: {
|
|
284
|
+
color: '#fff',
|
|
285
|
+
textAlign: 'center',
|
|
286
|
+
fontFamily: 'sf-semibold',
|
|
287
|
+
fontSize: 13
|
|
288
|
+
},
|
|
289
|
+
jobStatusLine: {
|
|
290
|
+
borderWidth: 1,
|
|
291
|
+
borderStyle: 'dashed',
|
|
292
|
+
width: 30
|
|
293
|
+
},
|
|
294
|
+
jobStatusLineMask: {
|
|
295
|
+
position: 'absolute',
|
|
296
|
+
left: -1,
|
|
297
|
+
top: -1,
|
|
298
|
+
width: '100%',
|
|
299
|
+
height: 1,
|
|
300
|
+
backgroundColor: '#fff',
|
|
301
|
+
zIndex: 1
|
|
302
|
+
},
|
|
303
|
+
jobStatusCircle: {
|
|
304
|
+
width: 18,
|
|
305
|
+
height: 18,
|
|
306
|
+
borderRadius: 9
|
|
307
|
+
},
|
|
308
|
+
jobStatusDateText: {
|
|
309
|
+
flex: 1,
|
|
310
|
+
textAlign: 'right',
|
|
311
|
+
fontFamily: 'sf-medium',
|
|
312
|
+
fontSize: 14,
|
|
313
|
+
color: Colours.TEXT_DARK
|
|
314
|
+
}
|
|
315
|
+
});
|
|
316
|
+
const mapStateToProps = state => {
|
|
317
|
+
return {
|
|
318
|
+
colourBrandingMain: Colours.getMainBrandingColourFromState(state)
|
|
319
|
+
};
|
|
320
|
+
};
|
|
321
|
+
export default connect(mapStateToProps, {})(MaintenanceListItem);
|
|
322
|
+
//# sourceMappingURL=MaintenanceListItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Component","Image","Text","TouchableOpacity","View","StyleSheet","_","Icon","connect","moment","getJobStatusProps","jobStatusOptions","Services","Helper","Colours","values","MaintenanceListItem","constructor","args","_defineProperty","navigation","navigate","screenRequestDetail","job","props","renderCommentCount","commentCount","createElement","style","styles","commentCountContainer","commentCountText","renderDescription","isEmpty","description","jobDescriptionText","renderSeen","showSeen","status","name","seen","jobSeenContainer","type","iconStyle","jobSeenIcon","color","colourBrandingMain","jobSeenText","render","createdTime","createdUnix","createdTimeText","format","assigneeText","Assignee","displayName","statusText","statusColor","onPress","onPressJob","jobContainer","jobInnerContainer","jobTopSection","jobTopLeft","jobId","jobIdText","textEntityName","jobTitleText","title","room","jobLocationText","jobTypeSeenContainer","jobTypeContainer","backgroundColor","hexToRGBAstring","jobTypeText","numberOfLines","jobTopRight","jobCommentImage","source","require","jobBottomSection","jobCreatedText","jobActivityContainer","jobStatusContainer","jobStatusText","jobStatusLine","borderColor","jobStatusLineMask","jobStatusCircle","jobStatusDateText","create","marginVertical","paddingHorizontal","getShadowStyle","flexDirection","alignItems","paddingVertical","borderBottomWidth","borderBottomColor","LINEGREY","flex","fontFamily","fontSize","marginBottom","TEXT_DARK","TEXT_LIGHT","marginTop","padding","minWidth","maxWidth","borderRadius","justifyContent","textAlign","marginLeft","paddingTop","width","height","resizeMode","position","top","right","borderWidth","COLOUR_GREEN","jobStatusIcon","borderStyle","left","zIndex","mapStateToProps","state","getMainBrandingColourFromState"],"sources":["MaintenanceListItem.js"],"sourcesContent":["import React, { Component } from 'react';\nimport { Image, Text, TouchableOpacity, View, StyleSheet } from 'react-native';\nimport _ from 'lodash';\nimport { Icon } from 'react-native-elements';\nimport { connect } from 'react-redux';\nimport moment from 'moment';\n// import {\n// getShadowStyle,\n// LINEGREY,\n// TEXT_DARK,\n// TEXT_LIGHT,\n// COLOUR_GREEN,\n// getMainBrandingColourFromState,\n// hexToRGBAstring,\n// getJobStatusProps,\n// jobStatusOptions,\n// } from '../../js';\n// import NavigationService from '../../js/NavigationService';\nimport { getJobStatusProps, jobStatusOptions } from '../helper';\nimport { Services } from '../feature.config';\nimport { Helper, Colours } from '../core.config';\nimport { values } from '../values.config';\n\nclass MaintenanceListItem extends Component {\n onPressJob = () => {\n Services.navigation.navigate(values.screenRequestDetail, { job: this.props.job });\n };\n\n renderCommentCount() {\n const { job } = this.props;\n if (!job.commentCount) {\n return null;\n }\n return (\n <View style={styles.commentCountContainer}>\n <Text style={styles.commentCountText}>{job.commentCount > 99 ? '99' : job.commentCount}</Text>\n </View>\n );\n }\n\n renderDescription() {\n const { job } = this.props;\n if (_.isEmpty(job.description)) {\n return null;\n }\n return <Text style={styles.jobDescriptionText}>{job.description}</Text>;\n }\n\n renderSeen() {\n const { job } = this.props;\n const showSeen = !job.status || job.status === jobStatusOptions[0].name;\n if (!showSeen || !job.seen) {\n return null;\n }\n return (\n <View style={styles.jobSeenContainer}>\n <Icon name=\"check\" type=\"font-awesome\" iconStyle={[styles.jobSeenIcon, { color: this.props.colourBrandingMain }]} />\n <Text style={[styles.jobSeenText, { color: this.props.colourBrandingMain }]}>Seen</Text>\n </View>\n );\n }\n\n render() {\n const { job } = this.props;\n const createdTime = moment(job.createdUnix);\n const createdTimeText = `${createdTime.format('ddd, D MMMM')} • ${createdTime.format('h:mma')}`;\n const assigneeText = job.Assignee ? `Assigned to\\n${job.Assignee.displayName}` : '';\n const { statusText, statusColor } = getJobStatusProps(job.status);\n\n return (\n <TouchableOpacity onPress={this.onPressJob}>\n <View style={[styles.jobContainer, this.props.style]}>\n <View style={styles.jobInnerContainer}>\n <View style={styles.jobTopSection}>\n <View style={styles.jobTopLeft}>\n {job.jobId ? (\n <Text\n style={[styles.jobIdText, { color: this.props.colourBrandingMain }]}\n >{`${values.textEntityName} #${job.jobId}`}</Text>\n ) : null}\n <Text style={styles.jobTitleText}>{job.title}</Text>\n {job.room ? <Text style={styles.jobLocationText}>{job.room}</Text> : null}\n <View style={styles.jobTypeSeenContainer}>\n <View style={[styles.jobTypeContainer, { backgroundColor: Colours.hexToRGBAstring(this.props.colourBrandingMain, 0.2) }]}>\n <Text style={[styles.jobTypeText, { color: this.props.colourBrandingMain }]} numberOfLines={2}>\n {job.type}\n </Text>\n </View>\n {this.renderSeen()}\n </View>\n </View>\n <View style={styles.jobTopRight}>\n <Image style={styles.jobCommentImage} source={require('../images/speechbubble.png')} />\n {this.renderCommentCount()}\n </View>\n </View>\n <View style={styles.jobBottomSection}>\n {/* {this.renderDescription()} */}\n <Text style={styles.jobCreatedText}>{createdTimeText}</Text>\n <View style={styles.jobActivityContainer}>\n <View style={[styles.jobStatusContainer, { backgroundColor: statusColor }]}>\n {/* <Icon name=\"wrench\" type=\"font-awesome\" iconStyle={styles.jobStatusIcon} /> */}\n <Text style={styles.jobStatusText}>{statusText}</Text>\n </View>\n <View style={[styles.jobStatusLine, { borderColor: statusColor }]}>\n <View style={styles.jobStatusLineMask} />\n </View>\n <View style={[styles.jobStatusCircle, { backgroundColor: statusColor }]} />\n <Text style={styles.jobStatusDateText}>{assigneeText}</Text>\n </View>\n </View>\n </View>\n </View>\n </TouchableOpacity>\n );\n }\n}\n\nconst styles = StyleSheet.create({\n jobContainer: {\n marginVertical: 8,\n paddingHorizontal: 16,\n },\n jobInnerContainer: {\n ...Helper.getShadowStyle(),\n },\n jobTopSection: {\n flexDirection: 'row',\n alignItems: 'flex-end',\n paddingHorizontal: 10,\n paddingVertical: 10,\n borderBottomWidth: 1,\n borderBottomColor: Colours.LINEGREY,\n },\n jobTopLeft: {\n flex: 1,\n },\n jobIdText: {\n fontFamily: 'sf-medium',\n fontSize: 12,\n marginBottom: 4,\n },\n jobTitleText: {\n fontFamily: 'sf-semibold',\n fontSize: 18,\n color: Colours.TEXT_DARK,\n marginBottom: 4,\n },\n jobLocationText: {\n fontFamily: 'sf-medium',\n fontSize: 12,\n color: Colours.TEXT_LIGHT,\n marginBottom: 4,\n },\n jobTypeSeenContainer: {\n marginTop: 4,\n flexDirection: 'row',\n alignItems: 'center',\n },\n jobTypeContainer: {\n padding: 4,\n minWidth: 80,\n maxWidth: 140,\n borderRadius: 4,\n justifyContent: 'center',\n },\n jobTypeText: {\n fontFamily: 'sf-semibold',\n fontSize: 12,\n textAlign: 'center',\n maxWidth: '100%',\n },\n jobSeenContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n marginLeft: 10,\n },\n jobSeenIcon: {\n fontSize: 12,\n },\n jobSeenText: {\n fontFamily: 'sf-semibold',\n fontSize: 12,\n marginLeft: 4,\n },\n jobTopRight: {\n alignItems: 'center',\n justifyContent: 'center',\n paddingHorizontal: 10,\n paddingTop: 10,\n },\n jobCommentImage: {\n width: 34,\n height: 34,\n resizeMode: 'contain',\n },\n commentCountContainer: {\n position: 'absolute',\n top: 0,\n right: 0,\n borderRadius: 10,\n borderWidth: 2,\n borderColor: '#fff',\n width: 20,\n height: 20,\n backgroundColor: Colours.COLOUR_GREEN,\n justifyContent: 'center',\n alignItems: 'center',\n },\n commentCountText: {\n textAlign: 'center',\n fontFamily: 'sf-bold',\n fontSize: 10,\n color: '#fff',\n },\n jobBottomSection: {\n paddingHorizontal: 10,\n paddingVertical: 16,\n },\n jobDescriptionText: {\n fontFamily: 'sf-medium',\n fontSize: 14,\n color: Colours.TEXT_DARK,\n marginBottom: 8,\n },\n jobCreatedText: {\n fontFamily: 'sf-medium',\n fontSize: 12,\n color: Colours.TEXT_LIGHT,\n marginBottom: 10,\n },\n jobActivityContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n },\n jobStatusContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n width: 105,\n height: 30,\n paddingHorizontal: 8,\n borderRadius: 4,\n },\n jobStatusIcon: {\n color: '#fff',\n fontSize: 14,\n },\n jobStatusText: {\n color: '#fff',\n textAlign: 'center',\n fontFamily: 'sf-semibold',\n fontSize: 13,\n },\n jobStatusLine: {\n borderWidth: 1,\n borderStyle: 'dashed',\n width: 30,\n },\n jobStatusLineMask: {\n position: 'absolute',\n left: -1,\n top: -1,\n width: '100%',\n height: 1,\n backgroundColor: '#fff',\n zIndex: 1,\n },\n jobStatusCircle: {\n width: 18,\n height: 18,\n borderRadius: 9,\n },\n jobStatusDateText: {\n flex: 1,\n textAlign: 'right',\n fontFamily: 'sf-medium',\n fontSize: 14,\n color: Colours.TEXT_DARK,\n },\n});\n\nconst mapStateToProps = state => {\n return {\n colourBrandingMain: Colours.getMainBrandingColourFromState(state),\n };\n};\n\nexport default connect(mapStateToProps, {})(MaintenanceListItem);\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,KAAK,EAAEC,IAAI,EAAEC,gBAAgB,EAAEC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AAC9E,OAAOC,CAAC,MAAM,QAAQ;AACtB,SAASC,IAAI,QAAQ,uBAAuB;AAC5C,SAASC,OAAO,QAAQ,aAAa;AACrC,OAAOC,MAAM,MAAM,QAAQ;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,iBAAiB,EAAEC,gBAAgB,QAAQ,WAAW;AAC/D,SAASC,QAAQ,QAAQ,mBAAmB;AAC5C,SAASC,MAAM,EAAEC,OAAO,QAAQ,gBAAgB;AAChD,SAASC,MAAM,QAAQ,kBAAkB;AAEzC,MAAMC,mBAAmB,SAAShB,SAAS,CAAC;EAAAiB,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,qBAC7B,MAAM;MACjBP,QAAQ,CAACQ,UAAU,CAACC,QAAQ,CAACN,MAAM,CAACO,mBAAmB,EAAE;QAAEC,GAAG,EAAE,IAAI,CAACC,KAAK,CAACD;MAAI,CAAC,CAAC;IACnF,CAAC;EAAA;EAEDE,kBAAkBA,CAAA,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KAAK;EAClE,CAAC;AACH,CAAC;AAED,eAAezH,OAAO,CAACwH,eAAe,EAAE,CAAC,CAAC,CAAC,CAAChH,mBAAmB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) 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 { Text, View, StyleSheet, TouchableOpacity } from 'react-native';
|
|
6
|
+
import { connect } from 'react-redux';
|
|
7
|
+
import { Icon } from 'react-native-elements';
|
|
8
|
+
import moment from 'moment';
|
|
9
|
+
import _ from 'lodash';
|
|
10
|
+
import { getJobStatusProps, jobStatusOptions } from '../helper';
|
|
11
|
+
import { Services } from '../feature.config';
|
|
12
|
+
import { Colours, Helper } from '../core.config';
|
|
13
|
+
import { values } from '../values.config';
|
|
14
|
+
class MaintenanceWidgetItem extends Component {
|
|
15
|
+
constructor(...args) {
|
|
16
|
+
super(...args);
|
|
17
|
+
_defineProperty(this, "onPressJob", () => {
|
|
18
|
+
Services.navigation.navigate(values.screenRequestDetail, {
|
|
19
|
+
job: this.props.job
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
render() {
|
|
24
|
+
const {
|
|
25
|
+
job
|
|
26
|
+
} = this.props;
|
|
27
|
+
const createdTime = moment(job.createdUnix);
|
|
28
|
+
const createdTimeText = `${createdTime.format('ddd, D MMMM')} • ${createdTime.format('h:mma')}`;
|
|
29
|
+
const {
|
|
30
|
+
statusText,
|
|
31
|
+
statusColor
|
|
32
|
+
} = getJobStatusProps(job.status);
|
|
33
|
+
const seenText = (() => {
|
|
34
|
+
if (!job.status || job.status === jobStatusOptions[0].name) {
|
|
35
|
+
return job.seen ? 'Seen' : 'Unseen';
|
|
36
|
+
}
|
|
37
|
+
return '';
|
|
38
|
+
})();
|
|
39
|
+
return /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
40
|
+
key: job.id,
|
|
41
|
+
onPress: this.onPressJob
|
|
42
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
43
|
+
style: styles.jobContainer
|
|
44
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
45
|
+
style: styles.jobInnerContainer
|
|
46
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
47
|
+
style: styles.jobTopSection
|
|
48
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
49
|
+
numberOfLines: 2,
|
|
50
|
+
style: styles.jobTitleText
|
|
51
|
+
}, job.title), /*#__PURE__*/React.createElement(Text, {
|
|
52
|
+
style: styles.jobCreatedTimeText
|
|
53
|
+
}, createdTimeText), /*#__PURE__*/React.createElement(View, {
|
|
54
|
+
style: styles.jobSeenContainer
|
|
55
|
+
}, job.seen && !_.isEmpty(seenText) && /*#__PURE__*/React.createElement(Icon, {
|
|
56
|
+
name: "check",
|
|
57
|
+
type: "font-awesome",
|
|
58
|
+
iconStyle: [styles.jobSeenIcon, {
|
|
59
|
+
color: this.props.colourBrandingMain
|
|
60
|
+
}]
|
|
61
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
62
|
+
style: [styles.jobSeenText, job.seen && {
|
|
63
|
+
color: this.props.colourBrandingMain
|
|
64
|
+
}]
|
|
65
|
+
}, seenText))), /*#__PURE__*/React.createElement(View, {
|
|
66
|
+
style: styles.jobBottomSection
|
|
67
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
68
|
+
style: [styles.jobStatusContainer, {
|
|
69
|
+
backgroundColor: statusColor
|
|
70
|
+
}]
|
|
71
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
72
|
+
style: styles.jobStatusText
|
|
73
|
+
}, statusText))))));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
const styles = StyleSheet.create({
|
|
77
|
+
jobContainer: {
|
|
78
|
+
padding: 10
|
|
79
|
+
},
|
|
80
|
+
jobInnerContainer: {
|
|
81
|
+
width: 140,
|
|
82
|
+
height: 160,
|
|
83
|
+
...Helper.getShadowStyle()
|
|
84
|
+
},
|
|
85
|
+
jobTopSection: {
|
|
86
|
+
flex: 1,
|
|
87
|
+
padding: 10,
|
|
88
|
+
paddingTop: 20
|
|
89
|
+
},
|
|
90
|
+
jobTitleText: {
|
|
91
|
+
flex: 1,
|
|
92
|
+
fontFamily: 'sf-semibold',
|
|
93
|
+
fontSize: 16,
|
|
94
|
+
color: Colours.TEXT_DARK
|
|
95
|
+
},
|
|
96
|
+
jobCreatedTimeText: {
|
|
97
|
+
fontFamily: 'sf-medium',
|
|
98
|
+
fontSize: 11,
|
|
99
|
+
color: Colours.TEXT_LIGHT,
|
|
100
|
+
paddingTop: 3
|
|
101
|
+
},
|
|
102
|
+
jobSeenContainer: {
|
|
103
|
+
flexDirection: 'row',
|
|
104
|
+
alignItems: 'center',
|
|
105
|
+
paddingTop: 5
|
|
106
|
+
},
|
|
107
|
+
jobSeenIcon: {
|
|
108
|
+
fontSize: 12,
|
|
109
|
+
marginRight: 4
|
|
110
|
+
},
|
|
111
|
+
jobSeenText: {
|
|
112
|
+
fontFamily: 'sf-semibold',
|
|
113
|
+
fontSize: 12,
|
|
114
|
+
color: Colours.TEXT_SUPER_LIGHT
|
|
115
|
+
},
|
|
116
|
+
jobBottomSection: {
|
|
117
|
+
alignItems: 'center',
|
|
118
|
+
justifyContent: 'center',
|
|
119
|
+
paddingVertical: 10,
|
|
120
|
+
borderTopWidth: 1,
|
|
121
|
+
borderTopColor: Colours.LINEGREY
|
|
122
|
+
},
|
|
123
|
+
jobStatusContainer: {
|
|
124
|
+
flexDirection: 'row',
|
|
125
|
+
alignItems: 'center',
|
|
126
|
+
justifyContent: 'space-between',
|
|
127
|
+
width: 105,
|
|
128
|
+
height: 30,
|
|
129
|
+
paddingHorizontal: 8,
|
|
130
|
+
borderRadius: 4
|
|
131
|
+
},
|
|
132
|
+
jobStatusIcon: {
|
|
133
|
+
color: '#fff',
|
|
134
|
+
fontSize: 14
|
|
135
|
+
},
|
|
136
|
+
jobStatusText: {
|
|
137
|
+
color: '#fff',
|
|
138
|
+
textAlign: 'center',
|
|
139
|
+
fontFamily: 'sf-semibold',
|
|
140
|
+
fontSize: 13
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
const mapStateToProps = state => {
|
|
144
|
+
return {
|
|
145
|
+
colourBrandingMain: Colours.getMainBrandingColourFromState(state)
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
export default connect(mapStateToProps, {})(MaintenanceWidgetItem);
|
|
149
|
+
//# sourceMappingURL=MaintenanceWidgetItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Component","Text","View","StyleSheet","TouchableOpacity","connect","Icon","moment","_","getJobStatusProps","jobStatusOptions","Services","Colours","Helper","values","MaintenanceWidgetItem","constructor","args","_defineProperty","navigation","navigate","screenRequestDetail","job","props","render","createdTime","createdUnix","createdTimeText","format","statusText","statusColor","status","seenText","name","seen","createElement","key","id","onPress","onPressJob","style","styles","jobContainer","jobInnerContainer","jobTopSection","numberOfLines","jobTitleText","title","jobCreatedTimeText","jobSeenContainer","isEmpty","type","iconStyle","jobSeenIcon","color","colourBrandingMain","jobSeenText","jobBottomSection","jobStatusContainer","backgroundColor","jobStatusText","create","padding","width","height","getShadowStyle","flex","paddingTop","fontFamily","fontSize","TEXT_DARK","TEXT_LIGHT","flexDirection","alignItems","marginRight","TEXT_SUPER_LIGHT","justifyContent","paddingVertical","borderTopWidth","borderTopColor","LINEGREY","paddingHorizontal","borderRadius","jobStatusIcon","textAlign","mapStateToProps","state","getMainBrandingColourFromState"],"sources":["MaintenanceWidgetItem.js"],"sourcesContent":["import React, { Component } from 'react';\nimport { Text, View, StyleSheet, TouchableOpacity } from 'react-native';\nimport { connect } from 'react-redux';\nimport { Icon } from 'react-native-elements';\nimport moment from 'moment';\nimport _ from 'lodash';\nimport { getJobStatusProps, jobStatusOptions } from '../helper';\nimport { Services } from '../feature.config';\nimport { Colours, Helper } from '../core.config';\nimport { values } from '../values.config';\n\nclass MaintenanceWidgetItem extends Component {\n onPressJob = () => {\n Services.navigation.navigate(values.screenRequestDetail, { job: this.props.job });\n };\n\n render() {\n const { job } = this.props;\n const createdTime = moment(job.createdUnix);\n const createdTimeText = `${createdTime.format('ddd, D MMMM')} • ${createdTime.format('h:mma')}`;\n const { statusText, statusColor } = getJobStatusProps(job.status);\n const seenText = (() => {\n if (!job.status || job.status === jobStatusOptions[0].name) {\n return job.seen ? 'Seen' : 'Unseen';\n }\n return '';\n })();\n\n return (\n <TouchableOpacity key={job.id} onPress={this.onPressJob}>\n <View style={styles.jobContainer}>\n <View style={styles.jobInnerContainer}>\n <View style={styles.jobTopSection}>\n <Text numberOfLines={2} style={styles.jobTitleText}>\n {job.title}\n </Text>\n <Text style={styles.jobCreatedTimeText}>{createdTimeText}</Text>\n <View style={styles.jobSeenContainer}>\n {job.seen && !_.isEmpty(seenText) && (\n <Icon name=\"check\" type=\"font-awesome\" iconStyle={[styles.jobSeenIcon, { color: this.props.colourBrandingMain }]} />\n )}\n <Text style={[styles.jobSeenText, job.seen && { color: this.props.colourBrandingMain }]}>{seenText}</Text>\n </View>\n </View>\n <View style={styles.jobBottomSection}>\n <View style={[styles.jobStatusContainer, { backgroundColor: statusColor }]}>\n {/* <Icon name=\"wrench\" type=\"font-awesome\" iconStyle={styles.jobStatusIcon} /> */}\n <Text style={styles.jobStatusText}>{statusText}</Text>\n </View>\n </View>\n </View>\n </View>\n </TouchableOpacity>\n );\n }\n}\n\nconst styles = StyleSheet.create({\n jobContainer: {\n padding: 10,\n },\n jobInnerContainer: {\n width: 140,\n height: 160,\n ...Helper.getShadowStyle(),\n },\n jobTopSection: {\n flex: 1,\n padding: 10,\n paddingTop: 20,\n },\n jobTitleText: {\n flex: 1,\n fontFamily: 'sf-semibold',\n fontSize: 16,\n color: Colours.TEXT_DARK,\n },\n jobCreatedTimeText: {\n fontFamily: 'sf-medium',\n fontSize: 11,\n color: Colours.TEXT_LIGHT,\n paddingTop: 3,\n },\n jobSeenContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n paddingTop: 5,\n },\n jobSeenIcon: {\n fontSize: 12,\n marginRight: 4,\n },\n jobSeenText: {\n fontFamily: 'sf-semibold',\n fontSize: 12,\n color: Colours.TEXT_SUPER_LIGHT,\n },\n jobBottomSection: {\n alignItems: 'center',\n justifyContent: 'center',\n paddingVertical: 10,\n borderTopWidth: 1,\n borderTopColor: Colours.LINEGREY,\n },\n jobStatusContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n width: 105,\n height: 30,\n paddingHorizontal: 8,\n borderRadius: 4,\n },\n jobStatusIcon: {\n color: '#fff',\n fontSize: 14,\n },\n jobStatusText: {\n color: '#fff',\n textAlign: 'center',\n fontFamily: 'sf-semibold',\n fontSize: 13,\n },\n});\n\nconst mapStateToProps = state => {\n return {\n colourBrandingMain: Colours.getMainBrandingColourFromState(state),\n };\n};\n\nexport default connect(mapStateToProps, {})(MaintenanceWidgetItem);\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,IAAI,EAAEC,IAAI,EAAEC,UAAU,EAAEC,gBAAgB,QAAQ,cAAc;AACvE,SAASC,OAAO,QAAQ,aAAa;AACrC,SAASC,IAAI,QAAQ,uBAAuB;AAC5C,OAAOC,MAAM,MAAM,QAAQ;AAC3B,OAAOC,CAAC,MAAM,QAAQ;AACtB,SAASC,iBAAiB,EAAEC,gBAAgB,QAAQ,WAAW;AAC/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EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBG,cAAc,EAAE,eAAe;IAC/Bb,KAAK,EAAE,GAAG;IACVC,MAAM,EAAE,EAAE;IACViB,iBAAiB,EAAE,CAAC;IACpBC,YAAY,EAAE;EAChB,CAAC;EACDC,aAAa,EAAE;IACb7B,KAAK,EAAE,MAAM;IACbe,QAAQ,EAAE;EACZ,CAAC;EACDT,aAAa,EAAE;IACbN,KAAK,EAAE,MAAM;IACb8B,SAAS,EAAE,QAAQ;IACnBhB,UAAU,EAAE,aAAa;IACzBC,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC;AAEF,MAAMgB,eAAe,GAAGC,KAAK,IAAI;EAC/B,OAAO;IACL/B,kBAAkB,EAAE3C,OAAO,CAAC2E,8BAA8B,CAACD,KAAK;EAClE,CAAC;AACH,CAAC;AAED,eAAejF,OAAO,CAACgF,eAAe,EAAE,CAAC,CAAC,CAAC,CAACtE,qBAAqB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import React, { PureComponent } from 'react';
|
|
2
|
+
import { View, StyleSheet, TouchableOpacity, Text } from 'react-native';
|
|
3
|
+
import { connect } from 'react-redux';
|
|
4
|
+
import { jobStatusOptions, getJobStatusColour } from '../helper';
|
|
5
|
+
import { Components, Colours } from '../core.config';
|
|
6
|
+
class StatusSelectorPopup extends PureComponent {
|
|
7
|
+
render() {
|
|
8
|
+
const {
|
|
9
|
+
title,
|
|
10
|
+
filter,
|
|
11
|
+
includeAll,
|
|
12
|
+
allText,
|
|
13
|
+
onClose,
|
|
14
|
+
onSelect
|
|
15
|
+
} = this.props;
|
|
16
|
+
let statuses = filter ? filter.map(status => {
|
|
17
|
+
return {
|
|
18
|
+
name: status,
|
|
19
|
+
label: getJobStatusLabel(status),
|
|
20
|
+
color: getJobStatusColour(status)
|
|
21
|
+
};
|
|
22
|
+
}) : jobStatusOptions;
|
|
23
|
+
if (includeAll) statuses = [{
|
|
24
|
+
name: allText || 'Show All',
|
|
25
|
+
color: this.props.colourBrandingMain
|
|
26
|
+
}, ...statuses];
|
|
27
|
+
return /*#__PURE__*/React.createElement(Components.MiddlePopup, {
|
|
28
|
+
style: [styles.statusPopup, {
|
|
29
|
+
height: statuses.length * 50 + 40
|
|
30
|
+
}],
|
|
31
|
+
onClose: onClose
|
|
32
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
33
|
+
style: styles.statusPopupTitle
|
|
34
|
+
}, title || 'Select Status'), /*#__PURE__*/React.createElement(View, {
|
|
35
|
+
style: styles.statusPopupOptionsContainer
|
|
36
|
+
}, statuses.map(status => {
|
|
37
|
+
return /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
38
|
+
key: status.name,
|
|
39
|
+
onPress: () => onSelect(status.name)
|
|
40
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
41
|
+
style: [styles.jobStatusContainer, {
|
|
42
|
+
backgroundColor: status.color
|
|
43
|
+
}]
|
|
44
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
45
|
+
style: styles.jobStatusText
|
|
46
|
+
}, status.label)));
|
|
47
|
+
})));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
const styles = StyleSheet.create({
|
|
51
|
+
statusPopup: {
|
|
52
|
+
width: 160,
|
|
53
|
+
padding: 16,
|
|
54
|
+
borderRadius: 12
|
|
55
|
+
},
|
|
56
|
+
statusPopupTitle: {
|
|
57
|
+
fontFamily: 'sf-bold',
|
|
58
|
+
color: Colours.TEXT_DARK,
|
|
59
|
+
fontSize: 18,
|
|
60
|
+
marginBottom: 16
|
|
61
|
+
},
|
|
62
|
+
statusPopupOptionsContainer: {
|
|
63
|
+
flex: 1,
|
|
64
|
+
justifyContent: 'space-between'
|
|
65
|
+
},
|
|
66
|
+
jobStatusContainer: {
|
|
67
|
+
flexDirection: 'row',
|
|
68
|
+
alignItems: 'center',
|
|
69
|
+
justifyContent: 'space-between',
|
|
70
|
+
width: 105,
|
|
71
|
+
height: 30,
|
|
72
|
+
paddingHorizontal: 8,
|
|
73
|
+
borderRadius: 4
|
|
74
|
+
},
|
|
75
|
+
jobStatusText: {
|
|
76
|
+
color: '#fff',
|
|
77
|
+
textAlign: 'center',
|
|
78
|
+
fontFamily: 'sf-semibold',
|
|
79
|
+
fontSize: 13,
|
|
80
|
+
flex: 1
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
const mapStateToProps = state => {
|
|
84
|
+
return {
|
|
85
|
+
colourBrandingMain: Colours.getMainBrandingColourFromState(state)
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
export default connect(mapStateToProps, {})(StatusSelectorPopup);
|
|
89
|
+
//# sourceMappingURL=StatusSelectorPopup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","PureComponent","View","StyleSheet","TouchableOpacity","Text","connect","jobStatusOptions","getJobStatusColour","Components","Colours","StatusSelectorPopup","render","title","filter","includeAll","allText","onClose","onSelect","props","statuses","map","status","name","label","getJobStatusLabel","color","colourBrandingMain","createElement","MiddlePopup","style","styles","statusPopup","height","length","statusPopupTitle","statusPopupOptionsContainer","key","onPress","jobStatusContainer","backgroundColor","jobStatusText","create","width","padding","borderRadius","fontFamily","TEXT_DARK","fontSize","marginBottom","flex","justifyContent","flexDirection","alignItems","paddingHorizontal","textAlign","mapStateToProps","state","getMainBrandingColourFromState"],"sources":["StatusSelectorPopup.js"],"sourcesContent":["import React, { PureComponent } from 'react';\nimport { View, StyleSheet, TouchableOpacity, Text } from 'react-native';\nimport { connect } from 'react-redux';\nimport { jobStatusOptions, getJobStatusColour } from '../helper';\nimport { Components, Colours } from '../core.config';\n\nclass StatusSelectorPopup extends PureComponent {\n render() {\n const { title, filter, includeAll, allText, onClose, onSelect } = this.props;\n let statuses = filter\n ? filter.map(status => {\n return {\n name: status,\n label: getJobStatusLabel(status),\n color: getJobStatusColour(status),\n };\n })\n : jobStatusOptions;\n if (includeAll)\n statuses = [\n {\n name: allText || 'Show All',\n color: this.props.colourBrandingMain,\n },\n ...statuses,\n ];\n\n return (\n <Components.MiddlePopup style={[styles.statusPopup, { height: statuses.length * 50 + 40 }]} onClose={onClose}>\n <Text style={styles.statusPopupTitle}>{title || 'Select Status'}</Text>\n <View style={styles.statusPopupOptionsContainer}>\n {statuses.map(status => {\n return (\n <TouchableOpacity key={status.name} onPress={() => onSelect(status.name)}>\n <View style={[styles.jobStatusContainer, { backgroundColor: status.color }]}>\n <Text style={styles.jobStatusText}>{status.label}</Text>\n </View>\n </TouchableOpacity>\n );\n })}\n </View>\n </Components.MiddlePopup>\n );\n }\n}\n\nconst styles = StyleSheet.create({\n statusPopup: {\n width: 160,\n padding: 16,\n borderRadius: 12,\n },\n statusPopupTitle: {\n fontFamily: 'sf-bold',\n color: Colours.TEXT_DARK,\n fontSize: 18,\n marginBottom: 16,\n },\n statusPopupOptionsContainer: {\n flex: 1,\n justifyContent: 'space-between',\n },\n jobStatusContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n width: 105,\n height: 30,\n paddingHorizontal: 8,\n borderRadius: 4,\n },\n jobStatusText: {\n color: '#fff',\n textAlign: 'center',\n fontFamily: 'sf-semibold',\n fontSize: 13,\n flex: 1,\n },\n});\n\nconst mapStateToProps = state => {\n return {\n colourBrandingMain: Colours.getMainBrandingColourFromState(state),\n };\n};\n\nexport default connect(mapStateToProps, {})(StatusSelectorPopup);\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,aAAa,QAAQ,OAAO;AAC5C,SAASC,IAAI,EAAEC,UAAU,EAAEC,gBAAgB,EAAEC,IAAI,QAAQ,cAAc;AACvE,SAASC,OAAO,QAAQ,aAAa;AACrC,SAASC,gBAAgB,EAAEC,kBAAkB,QAAQ,WAAW;AAChE,SAASC,UAAU,EAAEC,OAAO,QAAQ,gBAAgB;AAEpD,MAAMC,mBAAmB,SAASV,aAAa,CAAC;EAC9CW,MAAMA,CAAA,EAAG;IACP,MAAM;MAAEC,KAAK;M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';
|
|
2
|
+
import MaintenanceList from './MaintenanceList';
|
|
3
|
+
class WidgetLarge extends PureComponent {
|
|
4
|
+
render() {
|
|
5
|
+
return /*#__PURE__*/React.createElement(MaintenanceList, this.props);
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
export default WidgetLarge;
|
|
9
|
+
//# sourceMappingURL=WidgetLarge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","PureComponent","MaintenanceList","WidgetLarge","render","createElement","props"],"sources":["WidgetLarge.js"],"sourcesContent":["import React, { PureComponent } from 'react';\nimport MaintenanceList from './MaintenanceList';\n\nclass WidgetLarge extends PureComponent {\n render() {\n return <MaintenanceList {...this.props} />;\n }\n}\n\nexport default WidgetLarge;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,aAAa,QAAQ,OAAO;AAC5C,OAAOC,eAAe,MAAM,mBAAmB;AAE/C,MAAMC,WAAW,SAASF,aAAa,CAAC;EACtCG,MAAMA,CAAA,EAAG;IACP,oBAAOJ,KAAA,CAAAK,aAAA,CAACH,eAAe,EAAK,IAAI,CAACI,KAAQ,CAAC;EAC5C;AACF;AAEA,eAAeH,WAAW","ignoreList":[]}
|