@plusscommunities/pluss-maintenance-app 8.0.8 → 8.0.9-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 +121 -24
- package/dist/module/screens/MaintenanceUserPicker.js.map +1 -1
- package/dist/module/screens/RequestDetail.js +147 -149
- 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 +196 -194
- package/dist/module/screens/ServiceRequest.js.map +1 -1
- package/dist/module/values.config.a.js +31 -30
- package/dist/module/values.config.a.js.map +1 -1
- package/dist/module/values.config.default.js +35 -34
- package/dist/module/values.config.default.js.map +1 -1
- package/dist/module/values.config.enquiry.js +35 -34
- package/dist/module/values.config.enquiry.js.map +1 -1
- package/dist/module/values.config.feedback.js +35 -34
- package/dist/module/values.config.feedback.js.map +1 -1
- package/dist/module/values.config.food.js +35 -34
- 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 +35 -34
- package/dist/module/values.config.js.map +1 -1
- package/package.json +52 -53
- 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 +186 -117
- package/src/screens/RequestDetail.js +1125 -1347
- package/src/screens/RequestNotes.js +806 -947
- package/src/screens/ServiceRequest.js +1557 -1783
- package/src/values.config.a.js +34 -33
- package/src/values.config.default.js +40 -39
- package/src/values.config.enquiry.js +40 -39
- package/src/values.config.feedback.js +40 -39
- package/src/values.config.food.js +40 -39
- package/src/values.config.forms.js +39 -39
- package/src/values.config.js +40 -39
|
@@ -1,131 +1,200 @@
|
|
|
1
|
-
import React, { Component } from
|
|
2
|
-
import _ from
|
|
3
|
-
import { TouchableOpacity, View, ScrollView, Text } from
|
|
4
|
-
import { connect } from
|
|
5
|
-
import { Icon } from
|
|
6
|
-
import { Services } from
|
|
7
|
-
import { Components, Colours } from
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import _ from 'lodash';
|
|
3
|
+
import { TouchableOpacity, View, ScrollView, Text, TextInput, Keyboard } from 'react-native';
|
|
4
|
+
import { connect } from 'react-redux';
|
|
5
|
+
import { Icon } from 'react-native-elements';
|
|
6
|
+
import { Services } from '../feature.config';
|
|
7
|
+
import { Components, Colours } from '../core.config';
|
|
8
8
|
|
|
9
9
|
class MaintenanceUserPicker extends Component {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
state = {
|
|
11
|
+
currentUser: null,
|
|
12
|
+
searchText: '',
|
|
13
|
+
};
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
UNSAFE_componentWillMount() {
|
|
16
|
+
this.setState({ currentUser: this.props.currentUser });
|
|
17
|
+
}
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
onPressBack() {
|
|
20
|
+
Services.navigation.goBack();
|
|
21
|
+
}
|
|
21
22
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
onUserPress(user) {
|
|
24
|
+
Keyboard.dismiss();
|
|
25
|
+
this.props.onSelectUser(user);
|
|
26
|
+
this.setState({ currentUser: user });
|
|
27
|
+
setTimeout(() => {
|
|
28
|
+
this.onPressBack();
|
|
29
|
+
}, 200);
|
|
30
|
+
}
|
|
29
31
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
<View style={{ marginTop: 16 }}>
|
|
34
|
-
<Components.Spinner />
|
|
35
|
-
</View>
|
|
36
|
-
);
|
|
37
|
-
}
|
|
32
|
+
onChangeSearch = (text) => {
|
|
33
|
+
this.setState({ searchText: text });
|
|
34
|
+
};
|
|
38
35
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
getFilteredUsers = () => {
|
|
37
|
+
const { searchText } = this.state;
|
|
38
|
+
const { users } = this.props;
|
|
39
|
+
if (!users) return [];
|
|
40
|
+
if (!searchText || searchText.length === 0) return users;
|
|
41
|
+
const searchLower = searchText.toLowerCase();
|
|
42
|
+
return users.filter(user => {
|
|
43
|
+
const displayName = (user.displayName || '').toLowerCase();
|
|
44
|
+
const unit = (user.unit || '').toLowerCase();
|
|
45
|
+
return displayName.includes(searchLower) || unit.includes(searchLower);
|
|
46
|
+
});
|
|
47
|
+
};
|
|
45
48
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
label={user.displayName}
|
|
55
|
-
labelStyle={{ height: 0, margin: 0 }}
|
|
56
|
-
hasUnderline
|
|
57
|
-
hasContent
|
|
58
|
-
>
|
|
59
|
-
<View style={styles.rowContainer}>
|
|
60
|
-
<View style={styles.userContainer}>
|
|
61
|
-
<Components.ProfilePic
|
|
62
|
-
ProfilePic={user.profilePic}
|
|
63
|
-
Diameter={30}
|
|
64
|
-
/>
|
|
65
|
-
<Text style={styles.labelText}>{user.displayName}</Text>
|
|
66
|
-
</View>
|
|
67
|
-
<Icon
|
|
68
|
-
name="check-circle"
|
|
69
|
-
type="font-awesome"
|
|
70
|
-
iconStyle={[
|
|
71
|
-
{ color: "#d5d9e0", fontSize: 20 },
|
|
72
|
-
_.isEqual(user, this.state.currentUser) && {
|
|
73
|
-
color: Colours.COLOUR_GREEN,
|
|
74
|
-
},
|
|
75
|
-
]}
|
|
76
|
-
/>
|
|
77
|
-
</View>
|
|
78
|
-
</Components.FormCardSection>
|
|
79
|
-
</TouchableOpacity>
|
|
80
|
-
);
|
|
81
|
-
});
|
|
82
|
-
}
|
|
49
|
+
renderMain() {
|
|
50
|
+
if (_.isEmpty(this.props.users)) {
|
|
51
|
+
return (
|
|
52
|
+
<View style={{ marginTop: 16 }}>
|
|
53
|
+
<Components.Spinner />
|
|
54
|
+
</View>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
83
57
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
58
|
+
const filteredUsers = this.getFilteredUsers();
|
|
59
|
+
if (filteredUsers.length === 0 && this.state.searchText.length > 0) {
|
|
60
|
+
return (
|
|
61
|
+
<View style={styles.noResultsContainer}>
|
|
62
|
+
<Text style={styles.noResultsText}>No users found</Text>
|
|
63
|
+
</View>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return <Components.FormCard style={{ marginTop: 16 }}>{this.renderOptions(filteredUsers)}</Components.FormCard>;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
renderOptions(users) {
|
|
71
|
+
return users.map((user, index) => {
|
|
72
|
+
return (
|
|
73
|
+
<TouchableOpacity key={index} onPress={this.onUserPress.bind(this, user)}>
|
|
74
|
+
<Components.FormCardSection label={user.displayName} labelStyle={{ height: 0, margin: 0 }} hasUnderline hasContent>
|
|
75
|
+
<View style={styles.rowContainer}>
|
|
76
|
+
<View style={styles.userContainer}>
|
|
77
|
+
<Components.ProfilePic ProfilePic={user.profilePic} Diameter={30} />
|
|
78
|
+
<Text style={styles.labelText}>{user.displayName}</Text>
|
|
79
|
+
</View>
|
|
80
|
+
<Icon
|
|
81
|
+
name="check-circle"
|
|
82
|
+
type="font-awesome"
|
|
83
|
+
iconStyle={[{ color: '#d5d9e0', fontSize: 20 }, _.isEqual(user, this.state.currentUser) && { color: Colours.COLOUR_GREEN }]}
|
|
84
|
+
/>
|
|
85
|
+
</View>
|
|
86
|
+
</Components.FormCardSection>
|
|
87
|
+
</TouchableOpacity>
|
|
88
|
+
);
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
renderSearch() {
|
|
93
|
+
return (
|
|
94
|
+
<View style={styles.searchContainer}>
|
|
95
|
+
<Icon name="search" type="font-awesome" iconStyle={styles.searchIcon} />
|
|
96
|
+
<TextInput
|
|
97
|
+
placeholder="Search by name or unit"
|
|
98
|
+
autoCorrect={false}
|
|
99
|
+
placeholderTextColor={Colours.TEXT_DARK_ALPHA10}
|
|
100
|
+
onChangeText={this.onChangeSearch}
|
|
101
|
+
value={this.state.searchText}
|
|
102
|
+
style={styles.searchText}
|
|
103
|
+
underlineColorAndroid={'rgba(0,0,0,0)'}
|
|
104
|
+
returnKeyType="search"
|
|
105
|
+
/>
|
|
106
|
+
{this.state.searchText.length > 0 && (
|
|
107
|
+
<TouchableOpacity onPress={() => this.onChangeSearch('')} style={styles.clearButton}>
|
|
108
|
+
<Icon name="times-circle" type="font-awesome" iconStyle={styles.clearIcon} />
|
|
109
|
+
</TouchableOpacity>
|
|
110
|
+
)}
|
|
111
|
+
</View>
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
render() {
|
|
116
|
+
return (
|
|
117
|
+
<View style={styles.container}>
|
|
118
|
+
<Components.Header leftIcon="angle-left" onPressLeft={this.onPressBack.bind(this)} text="Select user" />
|
|
119
|
+
{this.renderSearch()}
|
|
120
|
+
<ScrollView style={{ flex: 1 }} keyboardShouldPersistTaps="handled" keyboardDismissMode="on-drag">
|
|
121
|
+
{this.renderMain()}
|
|
122
|
+
</ScrollView>
|
|
123
|
+
</View>
|
|
124
|
+
);
|
|
125
|
+
}
|
|
96
126
|
}
|
|
97
127
|
|
|
98
128
|
const styles = {
|
|
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
|
+
container: {
|
|
130
|
+
flex: 1,
|
|
131
|
+
position: 'relative',
|
|
132
|
+
backgroundColor: '#f0f0f5',
|
|
133
|
+
},
|
|
134
|
+
row: {
|
|
135
|
+
flexDirection: 'row',
|
|
136
|
+
alignItems: 'center',
|
|
137
|
+
minHeight: 22,
|
|
138
|
+
},
|
|
139
|
+
text: {
|
|
140
|
+
flex: 1,
|
|
141
|
+
fontFamily: 'sf-regular',
|
|
142
|
+
fontSize: 14,
|
|
143
|
+
color: Colours.TEXT_DARK,
|
|
144
|
+
},
|
|
145
|
+
rowContainer: {
|
|
146
|
+
flexDirection: 'row',
|
|
147
|
+
justifyContent: 'space-between',
|
|
148
|
+
},
|
|
149
|
+
userContainer: {
|
|
150
|
+
flexDirection: 'row',
|
|
151
|
+
alignItems: 'center',
|
|
152
|
+
},
|
|
153
|
+
labelText: {
|
|
154
|
+
fontFamily: 'sf-medium',
|
|
155
|
+
fontSize: 16,
|
|
156
|
+
color: Colours.TEXT_DARK,
|
|
157
|
+
marginLeft: 8,
|
|
158
|
+
},
|
|
159
|
+
searchContainer: {
|
|
160
|
+
flexDirection: 'row',
|
|
161
|
+
alignItems: 'center',
|
|
162
|
+
margin: 15,
|
|
163
|
+
backgroundColor: '#fff',
|
|
164
|
+
borderRadius: 8,
|
|
165
|
+
paddingHorizontal: 12,
|
|
166
|
+
paddingVertical: 8,
|
|
167
|
+
},
|
|
168
|
+
searchIcon: {
|
|
169
|
+
fontSize: 16,
|
|
170
|
+
marginRight: 10,
|
|
171
|
+
color: Colours.TEXT_MID_ALPHA50,
|
|
172
|
+
},
|
|
173
|
+
searchText: {
|
|
174
|
+
flex: 1,
|
|
175
|
+
fontSize: 16,
|
|
176
|
+
fontFamily: 'sf-regular',
|
|
177
|
+
color: Colours.TEXT_DARK,
|
|
178
|
+
padding: 0,
|
|
179
|
+
},
|
|
180
|
+
clearButton: {
|
|
181
|
+
padding: 4,
|
|
182
|
+
},
|
|
183
|
+
clearIcon: {
|
|
184
|
+
fontSize: 16,
|
|
185
|
+
color: Colours.TEXT_MID_ALPHA50,
|
|
186
|
+
},
|
|
187
|
+
noResultsContainer: {
|
|
188
|
+
alignItems: 'center',
|
|
189
|
+
justifyContent: 'center',
|
|
190
|
+
paddingVertical: 40,
|
|
191
|
+
},
|
|
192
|
+
noResultsText: {
|
|
193
|
+
fontSize: 16,
|
|
194
|
+
fontFamily: 'sf-regular',
|
|
195
|
+
color: Colours.TEXT_LIGHT,
|
|
196
|
+
textAlign: 'center',
|
|
197
|
+
},
|
|
129
198
|
};
|
|
130
199
|
|
|
131
|
-
export default connect(null, {})(MaintenanceUserPicker);
|
|
200
|
+
export default connect(null, {})(MaintenanceUserPicker);
|