@plusscommunities/pluss-maintenance-app-forms 7.0.21 → 7.0.23-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 +4 -4
- package/dist/module/actions/JobActions.js.map +1 -1
- package/dist/module/actions/index.js +1 -1
- package/dist/module/actions/index.js.map +1 -1
- package/dist/module/actions/types.js +1 -1
- package/dist/module/actions/types.js.map +1 -1
- package/dist/module/apis/index.js +3 -3
- package/dist/module/apis/index.js.map +1 -1
- package/dist/module/apis/maintenanceActions.js +36 -36
- package/dist/module/apis/maintenanceActions.js.map +1 -1
- package/dist/module/apis/userActions.js +5 -5
- package/dist/module/apis/userActions.js.map +1 -1
- package/dist/module/components/FilterPopupMenu.js +49 -49
- package/dist/module/components/FilterPopupMenu.js.map +1 -1
- package/dist/module/components/MaintenanceList.js +38 -38
- package/dist/module/components/MaintenanceList.js.map +1 -1
- package/dist/module/components/MaintenanceListItem.js +62 -62
- package/dist/module/components/MaintenanceListItem.js.map +1 -1
- package/dist/module/components/MaintenanceWidgetItem.js +27 -27
- package/dist/module/components/MaintenanceWidgetItem.js.map +1 -1
- package/dist/module/components/PrioritySelectorPopup.js +15 -15
- package/dist/module/components/PrioritySelectorPopup.js.map +1 -1
- package/dist/module/components/StatusSelectorPopup.js +16 -16
- package/dist/module/components/StatusSelectorPopup.js.map +1 -1
- package/dist/module/components/WidgetLarge.js +2 -2
- package/dist/module/components/WidgetLarge.js.map +1 -1
- package/dist/module/components/WidgetSmall.js +19 -19
- package/dist/module/components/WidgetSmall.js.map +1 -1
- package/dist/module/core.config.js +1 -1
- package/dist/module/core.config.js.map +1 -1
- package/dist/module/feature.config.js +17 -17
- package/dist/module/feature.config.js.map +1 -1
- package/dist/module/helper.js +10 -10
- package/dist/module/helper.js.map +1 -1
- package/dist/module/index.js +11 -11
- package/dist/module/index.js.map +1 -1
- package/dist/module/reducers/JobsReducer.js +13 -13
- package/dist/module/reducers/JobsReducer.js.map +1 -1
- package/dist/module/screens/JobTypePicker.js +17 -17
- package/dist/module/screens/JobTypePicker.js.map +1 -1
- package/dist/module/screens/MaintenancePage.js +10 -10
- package/dist/module/screens/MaintenancePage.js.map +1 -1
- package/dist/module/screens/MaintenanceUserPicker.js +22 -129
- package/dist/module/screens/MaintenanceUserPicker.js.map +1 -1
- package/dist/module/screens/RequestDetail.js +145 -145
- package/dist/module/screens/RequestDetail.js.map +1 -1
- package/dist/module/screens/RequestNotes.js +59 -59
- package/dist/module/screens/RequestNotes.js.map +1 -1
- package/dist/module/screens/ServiceRequest.js +189 -189
- package/dist/module/screens/ServiceRequest.js.map +1 -1
- package/dist/module/values.config.a.js +31 -31
- package/dist/module/values.config.a.js.map +1 -1
- package/dist/module/values.config.default.js +35 -35
- package/dist/module/values.config.default.js.map +1 -1
- package/dist/module/values.config.enquiry.js +35 -35
- package/dist/module/values.config.enquiry.js.map +1 -1
- package/dist/module/values.config.feedback.js +35 -35
- package/dist/module/values.config.feedback.js.map +1 -1
- package/dist/module/values.config.food.js +35 -35
- package/dist/module/values.config.food.js.map +1 -1
- package/dist/module/values.config.forms.js +34 -34
- package/dist/module/values.config.forms.js.map +1 -1
- package/dist/module/values.config.js +34 -34
- package/dist/module/values.config.js.map +1 -1
- package/package.json +52 -52
- package/src/actions/JobActions.js +60 -67
- package/src/actions/index.js +1 -1
- package/src/actions/types.js +2 -1
- package/src/apis/index.js +3 -3
- package/src/apis/maintenanceActions.js +178 -189
- package/src/apis/userActions.js +17 -17
- package/src/components/FilterPopupMenu.js +256 -313
- package/src/components/MaintenanceList.js +317 -396
- package/src/components/MaintenanceListItem.js +288 -347
- package/src/components/MaintenanceWidgetItem.js +124 -145
- package/src/components/PrioritySelectorPopup.js +68 -81
- package/src/components/StatusSelectorPopup.js +70 -81
- package/src/components/WidgetLarge.js +5 -5
- package/src/components/WidgetSmall.js +133 -153
- package/src/core.config.js +3 -27
- package/src/feature.config.js +62 -62
- package/src/helper.js +53 -58
- package/src/index.js +22 -22
- package/src/reducers/JobsReducer.js +66 -85
- package/src/screens/JobTypePicker.js +92 -115
- package/src/screens/MaintenancePage.js +80 -89
- package/src/screens/MaintenanceUserPicker.js +99 -262
- package/src/screens/RequestDetail.js +1125 -1345
- package/src/screens/RequestNotes.js +805 -946
- package/src/screens/ServiceRequest.js +1557 -1773
- package/src/values.config.a.js +34 -34
- package/src/values.config.default.js +40 -40
- package/src/values.config.enquiry.js +40 -40
- package/src/values.config.feedback.js +40 -40
- package/src/values.config.food.js +40 -40
- package/src/values.config.forms.js +39 -39
- package/src/values.config.js +39 -39
|
@@ -1,157 +1,136 @@
|
|
|
1
|
-
import React, { Component } from
|
|
2
|
-
import { Text, View, StyleSheet, TouchableOpacity } from
|
|
3
|
-
import { connect } from
|
|
4
|
-
import { Icon } from
|
|
5
|
-
import moment from
|
|
6
|
-
import _ from
|
|
7
|
-
import { getJobStatus } from
|
|
8
|
-
import { Services } from
|
|
9
|
-
import { Colours, Helper } from
|
|
10
|
-
import { values } from
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import { Text, View, StyleSheet, TouchableOpacity } from 'react-native';
|
|
3
|
+
import { connect } from 'react-redux';
|
|
4
|
+
import { Icon } from '@rneui/themed';
|
|
5
|
+
import moment from 'moment';
|
|
6
|
+
import _ from 'lodash';
|
|
7
|
+
import { getJobStatus } from '../helper';
|
|
8
|
+
import { Services } from '../feature.config';
|
|
9
|
+
import { Colours, Helper } from '../core.config';
|
|
10
|
+
import { values } from '../values.config';
|
|
11
11
|
|
|
12
12
|
class MaintenanceWidgetItem extends Component {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
});
|
|
17
|
-
};
|
|
13
|
+
onPressJob = () => {
|
|
14
|
+
Services.navigation.navigate(values.screenRequestDetail, { job: this.props.job });
|
|
15
|
+
};
|
|
18
16
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
17
|
+
render() {
|
|
18
|
+
const { job, hideSeen } = this.props;
|
|
19
|
+
const createdTime = moment(job.createdUnix);
|
|
20
|
+
const createdTimeText = `${createdTime.format('ddd, D MMMM')} • ${createdTime.format('h:mma')}`;
|
|
21
|
+
const status = getJobStatus(job.status, this.props);
|
|
22
|
+
const seenText = (() => {
|
|
23
|
+
if (!job.status || job.status === getJobStatus(null, this.props).text) {
|
|
24
|
+
return job.seen ? 'Seen' : 'Unseen';
|
|
25
|
+
}
|
|
26
|
+
return '';
|
|
27
|
+
})();
|
|
30
28
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
</View>
|
|
61
|
-
) : null}
|
|
62
|
-
</View>
|
|
63
|
-
<View style={styles.jobBottomSection}>
|
|
64
|
-
<View
|
|
65
|
-
style={[
|
|
66
|
-
styles.jobStatusContainer,
|
|
67
|
-
{ backgroundColor: status?.color },
|
|
68
|
-
]}
|
|
69
|
-
>
|
|
70
|
-
{/* <Icon name="wrench" type="font-awesome" iconStyle={styles.jobStatusIcon} /> */}
|
|
71
|
-
<Text style={styles.jobStatusText}>{status?.text}</Text>
|
|
72
|
-
</View>
|
|
73
|
-
</View>
|
|
74
|
-
</View>
|
|
75
|
-
</View>
|
|
76
|
-
</TouchableOpacity>
|
|
77
|
-
);
|
|
78
|
-
}
|
|
29
|
+
return (
|
|
30
|
+
<TouchableOpacity key={job.id} onPress={this.onPressJob}>
|
|
31
|
+
<View style={styles.jobContainer}>
|
|
32
|
+
<View style={styles.jobInnerContainer}>
|
|
33
|
+
<View style={styles.jobTopSection}>
|
|
34
|
+
<Text numberOfLines={2} style={styles.jobTitleText}>
|
|
35
|
+
{job.title}
|
|
36
|
+
</Text>
|
|
37
|
+
<Text style={styles.jobCreatedTimeText}>{createdTimeText}</Text>
|
|
38
|
+
{!hideSeen ? (
|
|
39
|
+
<View style={styles.jobSeenContainer}>
|
|
40
|
+
{job.seen && !_.isEmpty(seenText) && (
|
|
41
|
+
<Icon name="check" type="font-awesome" iconStyle={[styles.jobSeenIcon, { color: this.props.colourBrandingMain }]} />
|
|
42
|
+
)}
|
|
43
|
+
<Text style={[styles.jobSeenText, job.seen && { color: this.props.colourBrandingMain }]}>{seenText}</Text>
|
|
44
|
+
</View>
|
|
45
|
+
) : null}
|
|
46
|
+
</View>
|
|
47
|
+
<View style={styles.jobBottomSection}>
|
|
48
|
+
<View style={[styles.jobStatusContainer, { backgroundColor: status?.color }]}>
|
|
49
|
+
{/* <Icon name="wrench" type="font-awesome" iconStyle={styles.jobStatusIcon} /> */}
|
|
50
|
+
<Text style={styles.jobStatusText}>{status?.text}</Text>
|
|
51
|
+
</View>
|
|
52
|
+
</View>
|
|
53
|
+
</View>
|
|
54
|
+
</View>
|
|
55
|
+
</TouchableOpacity>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
79
58
|
}
|
|
80
59
|
|
|
81
60
|
const styles = StyleSheet.create({
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
61
|
+
jobContainer: {
|
|
62
|
+
padding: 10,
|
|
63
|
+
},
|
|
64
|
+
jobInnerContainer: {
|
|
65
|
+
width: 140,
|
|
66
|
+
height: 160,
|
|
67
|
+
...Helper.getShadowStyle(),
|
|
68
|
+
},
|
|
69
|
+
jobTopSection: {
|
|
70
|
+
flex: 1,
|
|
71
|
+
padding: 10,
|
|
72
|
+
paddingTop: 20,
|
|
73
|
+
},
|
|
74
|
+
jobTitleText: {
|
|
75
|
+
flex: 1,
|
|
76
|
+
fontFamily: 'sf-semibold',
|
|
77
|
+
fontSize: 16,
|
|
78
|
+
color: Colours.TEXT_DARK,
|
|
79
|
+
},
|
|
80
|
+
jobCreatedTimeText: {
|
|
81
|
+
fontFamily: 'sf-medium',
|
|
82
|
+
fontSize: 11,
|
|
83
|
+
color: Colours.TEXT_LIGHT,
|
|
84
|
+
paddingTop: 3,
|
|
85
|
+
},
|
|
86
|
+
jobSeenContainer: {
|
|
87
|
+
flexDirection: 'row',
|
|
88
|
+
alignItems: 'center',
|
|
89
|
+
paddingTop: 5,
|
|
90
|
+
},
|
|
91
|
+
jobSeenIcon: {
|
|
92
|
+
fontSize: 12,
|
|
93
|
+
marginRight: 4,
|
|
94
|
+
},
|
|
95
|
+
jobSeenText: {
|
|
96
|
+
fontFamily: 'sf-semibold',
|
|
97
|
+
fontSize: 12,
|
|
98
|
+
color: Colours.TEXT_SUPER_LIGHT,
|
|
99
|
+
},
|
|
100
|
+
jobBottomSection: {
|
|
101
|
+
alignItems: 'center',
|
|
102
|
+
justifyContent: 'center',
|
|
103
|
+
paddingVertical: 10,
|
|
104
|
+
borderTopWidth: 1,
|
|
105
|
+
borderTopColor: Colours.LINEGREY,
|
|
106
|
+
},
|
|
107
|
+
jobStatusContainer: {
|
|
108
|
+
flexDirection: 'row',
|
|
109
|
+
alignItems: 'center',
|
|
110
|
+
justifyContent: 'space-between',
|
|
111
|
+
width: 105,
|
|
112
|
+
height: 30,
|
|
113
|
+
paddingHorizontal: 8,
|
|
114
|
+
borderRadius: 4,
|
|
115
|
+
},
|
|
116
|
+
jobStatusIcon: {
|
|
117
|
+
color: '#fff',
|
|
118
|
+
fontSize: 14,
|
|
119
|
+
},
|
|
120
|
+
jobStatusText: {
|
|
121
|
+
color: '#fff',
|
|
122
|
+
textAlign: 'center',
|
|
123
|
+
fontFamily: 'sf-semibold',
|
|
124
|
+
fontSize: 13,
|
|
125
|
+
},
|
|
147
126
|
});
|
|
148
127
|
|
|
149
|
-
const mapStateToProps =
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
128
|
+
const mapStateToProps = state => {
|
|
129
|
+
return {
|
|
130
|
+
colourBrandingMain: Colours.getMainBrandingColourFromState(state),
|
|
131
|
+
statusTypes: state[values.reducerKey].jobstatuses,
|
|
132
|
+
hideSeen: state[values.reducerKey].hideSeen,
|
|
133
|
+
};
|
|
155
134
|
};
|
|
156
135
|
|
|
157
136
|
export default connect(mapStateToProps, {})(MaintenanceWidgetItem);
|
|
@@ -1,92 +1,79 @@
|
|
|
1
|
-
import React, { PureComponent } from
|
|
2
|
-
import { View, StyleSheet, TouchableOpacity, Text } from
|
|
3
|
-
import { connect } from
|
|
4
|
-
import { jobPriorityOptions } from
|
|
5
|
-
import { Components, Colours } from
|
|
1
|
+
import React, { PureComponent } from 'react';
|
|
2
|
+
import { View, StyleSheet, TouchableOpacity, Text } from 'react-native';
|
|
3
|
+
import { connect } from 'react-redux';
|
|
4
|
+
import { jobPriorityOptions } from '../helper';
|
|
5
|
+
import { Components, Colours } from '../core.config';
|
|
6
6
|
|
|
7
7
|
class PrioritySelectorPopup extends PureComponent {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
8
|
+
render() {
|
|
9
|
+
const { title, includeAll, allText, onClose, onSelect } = this.props;
|
|
10
|
+
let priorities = jobPriorityOptions;
|
|
11
|
+
if (includeAll)
|
|
12
|
+
priorities = [
|
|
13
|
+
{
|
|
14
|
+
label: allText || 'Show All',
|
|
15
|
+
color: this.props.colourBrandingMain,
|
|
16
|
+
},
|
|
17
|
+
...priorities,
|
|
18
|
+
];
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
styles.jobStatusContainer,
|
|
38
|
-
{ backgroundColor: priority.color },
|
|
39
|
-
]}
|
|
40
|
-
>
|
|
41
|
-
<Text style={styles.jobStatusText}>{priority.label}</Text>
|
|
42
|
-
</View>
|
|
43
|
-
</TouchableOpacity>
|
|
44
|
-
);
|
|
45
|
-
})}
|
|
46
|
-
</View>
|
|
47
|
-
</Components.MiddlePopup>
|
|
48
|
-
);
|
|
49
|
-
}
|
|
20
|
+
return (
|
|
21
|
+
<Components.MiddlePopup style={[styles.statusPopup, { height: priorities.length * 50 + 40 }]} onClose={onClose}>
|
|
22
|
+
<Text style={styles.statusPopupTitle}>{title || 'Select Priority'}</Text>
|
|
23
|
+
<View style={styles.statusPopupOptionsContainer}>
|
|
24
|
+
{priorities.map(priority => {
|
|
25
|
+
return (
|
|
26
|
+
<TouchableOpacity key={priority.label} onPress={() => onSelect(priority.label)}>
|
|
27
|
+
<View style={[styles.jobStatusContainer, { backgroundColor: priority.color }]}>
|
|
28
|
+
<Text style={styles.jobStatusText}>{priority.label}</Text>
|
|
29
|
+
</View>
|
|
30
|
+
</TouchableOpacity>
|
|
31
|
+
);
|
|
32
|
+
})}
|
|
33
|
+
</View>
|
|
34
|
+
</Components.MiddlePopup>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
50
37
|
}
|
|
51
38
|
|
|
52
39
|
const styles = StyleSheet.create({
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
40
|
+
statusPopup: {
|
|
41
|
+
width: 160,
|
|
42
|
+
padding: 16,
|
|
43
|
+
borderRadius: 12,
|
|
44
|
+
},
|
|
45
|
+
statusPopupTitle: {
|
|
46
|
+
fontFamily: 'sf-bold',
|
|
47
|
+
color: Colours.TEXT_DARK,
|
|
48
|
+
fontSize: 18,
|
|
49
|
+
marginBottom: 16,
|
|
50
|
+
},
|
|
51
|
+
statusPopupOptionsContainer: {
|
|
52
|
+
flex: 1,
|
|
53
|
+
justifyContent: 'space-between',
|
|
54
|
+
},
|
|
55
|
+
jobStatusContainer: {
|
|
56
|
+
flexDirection: 'row',
|
|
57
|
+
alignItems: 'center',
|
|
58
|
+
justifyContent: 'space-between',
|
|
59
|
+
width: 105,
|
|
60
|
+
height: 30,
|
|
61
|
+
paddingHorizontal: 8,
|
|
62
|
+
borderRadius: 4,
|
|
63
|
+
},
|
|
64
|
+
jobStatusText: {
|
|
65
|
+
color: '#fff',
|
|
66
|
+
textAlign: 'center',
|
|
67
|
+
fontFamily: 'sf-semibold',
|
|
68
|
+
fontSize: 13,
|
|
69
|
+
flex: 1,
|
|
70
|
+
},
|
|
84
71
|
});
|
|
85
72
|
|
|
86
|
-
const mapStateToProps =
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
73
|
+
const mapStateToProps = state => {
|
|
74
|
+
return {
|
|
75
|
+
colourBrandingMain: Colours.getMainBrandingColourFromState(state),
|
|
76
|
+
};
|
|
90
77
|
};
|
|
91
78
|
|
|
92
79
|
export default connect(mapStateToProps, {})(PrioritySelectorPopup);
|
|
@@ -1,92 +1,81 @@
|
|
|
1
|
-
import React, { PureComponent } from
|
|
2
|
-
import { View, StyleSheet, TouchableOpacity, Text } from
|
|
3
|
-
import { connect } from
|
|
4
|
-
import { getJobStatusOptions } from
|
|
5
|
-
import { Components, Colours } from
|
|
6
|
-
import { values } from
|
|
1
|
+
import React, { PureComponent } from 'react';
|
|
2
|
+
import { View, StyleSheet, TouchableOpacity, Text } from 'react-native';
|
|
3
|
+
import { connect } from 'react-redux';
|
|
4
|
+
import { getJobStatusOptions } from '../helper';
|
|
5
|
+
import { Components, Colours } from '../core.config';
|
|
6
|
+
import { values } from '../values.config';
|
|
7
7
|
|
|
8
8
|
class StatusSelectorPopup extends PureComponent {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
render() {
|
|
10
|
+
const { title, includeAll, allText, onClose, onSelect } = this.props;
|
|
11
|
+
let statuses = getJobStatusOptions(this.props);
|
|
12
|
+
if (includeAll)
|
|
13
|
+
statuses = [
|
|
14
|
+
{
|
|
15
|
+
text: allText || 'Show All',
|
|
16
|
+
color: this.props.colourBrandingMain,
|
|
17
|
+
},
|
|
18
|
+
...statuses,
|
|
19
|
+
];
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
]}
|
|
39
|
-
>
|
|
40
|
-
<Text style={styles.jobStatusText}>{status.text}</Text>
|
|
41
|
-
</View>
|
|
42
|
-
</TouchableOpacity>
|
|
43
|
-
);
|
|
44
|
-
})}
|
|
45
|
-
</View>
|
|
46
|
-
</Components.MiddlePopup>
|
|
47
|
-
);
|
|
48
|
-
}
|
|
21
|
+
return (
|
|
22
|
+
<Components.MiddlePopup style={[styles.statusPopup, { height: statuses.length * 50 + 40 }]} onClose={onClose}>
|
|
23
|
+
<Text style={styles.statusPopupTitle}>{title || 'Select Status'}</Text>
|
|
24
|
+
<View style={styles.statusPopupOptionsContainer}>
|
|
25
|
+
{statuses.map(status => {
|
|
26
|
+
return (
|
|
27
|
+
<TouchableOpacity key={status.text} onPress={() => onSelect(status.text)}>
|
|
28
|
+
<View style={[styles.jobStatusContainer, { backgroundColor: status.color }]}>
|
|
29
|
+
<Text style={styles.jobStatusText}>{status.text}</Text>
|
|
30
|
+
</View>
|
|
31
|
+
</TouchableOpacity>
|
|
32
|
+
);
|
|
33
|
+
})}
|
|
34
|
+
</View>
|
|
35
|
+
</Components.MiddlePopup>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
49
38
|
}
|
|
50
39
|
|
|
51
40
|
const styles = StyleSheet.create({
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
41
|
+
statusPopup: {
|
|
42
|
+
width: 160,
|
|
43
|
+
padding: 16,
|
|
44
|
+
borderRadius: 12,
|
|
45
|
+
},
|
|
46
|
+
statusPopupTitle: {
|
|
47
|
+
fontFamily: 'sf-bold',
|
|
48
|
+
color: Colours.TEXT_DARK,
|
|
49
|
+
fontSize: 18,
|
|
50
|
+
marginBottom: 16,
|
|
51
|
+
},
|
|
52
|
+
statusPopupOptionsContainer: {
|
|
53
|
+
flex: 1,
|
|
54
|
+
justifyContent: 'space-between',
|
|
55
|
+
},
|
|
56
|
+
jobStatusContainer: {
|
|
57
|
+
flexDirection: 'row',
|
|
58
|
+
alignItems: 'center',
|
|
59
|
+
justifyContent: 'space-between',
|
|
60
|
+
width: 105,
|
|
61
|
+
height: 30,
|
|
62
|
+
paddingHorizontal: 8,
|
|
63
|
+
borderRadius: 4,
|
|
64
|
+
},
|
|
65
|
+
jobStatusText: {
|
|
66
|
+
color: '#fff',
|
|
67
|
+
textAlign: 'center',
|
|
68
|
+
fontFamily: 'sf-semibold',
|
|
69
|
+
fontSize: 13,
|
|
70
|
+
flex: 1,
|
|
71
|
+
},
|
|
83
72
|
});
|
|
84
73
|
|
|
85
|
-
const mapStateToProps =
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
74
|
+
const mapStateToProps = state => {
|
|
75
|
+
return {
|
|
76
|
+
colourBrandingMain: Colours.getMainBrandingColourFromState(state),
|
|
77
|
+
statusTypes: state[values.reducerKey].jobstatuses,
|
|
78
|
+
};
|
|
90
79
|
};
|
|
91
80
|
|
|
92
81
|
export default connect(mapStateToProps, {})(StatusSelectorPopup);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React, { PureComponent } from
|
|
2
|
-
import MaintenanceList from
|
|
1
|
+
import React, { PureComponent } from 'react';
|
|
2
|
+
import MaintenanceList from './MaintenanceList';
|
|
3
3
|
|
|
4
4
|
class WidgetLarge extends PureComponent {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
render() {
|
|
6
|
+
return <MaintenanceList {...this.props} />;
|
|
7
|
+
}
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export default WidgetLarge;
|