@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,270 +1,107 @@
|
|
|
1
|
-
import React, { Component } from
|
|
2
|
-
import _ from
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
TextInput,
|
|
9
|
-
} from "react-native";
|
|
10
|
-
import { connect } from "react-redux";
|
|
11
|
-
import { Icon } from "@rneui/themed";
|
|
12
|
-
import { Services } from "../feature.config";
|
|
13
|
-
import { Components, Colours, Fonts } from "../core.config";
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import _ from 'lodash';
|
|
3
|
+
import { TouchableOpacity, View, ScrollView, Text } from 'react-native';
|
|
4
|
+
import { connect } from 'react-redux';
|
|
5
|
+
import { Icon } from '@rneui/themed';
|
|
6
|
+
import { Services } from '../feature.config';
|
|
7
|
+
import { Components, Colours } from '../core.config';
|
|
14
8
|
|
|
15
9
|
class MaintenanceUserPicker extends Component {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
const searchLower = searchText.toLowerCase();
|
|
79
|
-
|
|
80
|
-
return (
|
|
81
|
-
displayName.toLowerCase().includes(searchLower) ||
|
|
82
|
-
unit.toLowerCase().includes(searchLower)
|
|
83
|
-
);
|
|
84
|
-
});
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
renderSearch = () => {
|
|
88
|
-
return (
|
|
89
|
-
<View style={styles.searchContainer}>
|
|
90
|
-
<Fonts.PlIcon name="nav-search" style={styles.searchIcon} />
|
|
91
|
-
<TextInput
|
|
92
|
-
placeholder="Search by name or unit"
|
|
93
|
-
autoCorrect={false}
|
|
94
|
-
placeholderTextColor={"rgba(60, 60, 80, .1)"}
|
|
95
|
-
onChangeText={this.onChangeSearch}
|
|
96
|
-
value={this.state.searchText}
|
|
97
|
-
style={styles.searchText}
|
|
98
|
-
underlineColorAndroid={"rgba(0,0,0,0)"}
|
|
99
|
-
returnKeyType="search"
|
|
100
|
-
/>
|
|
101
|
-
{this.state.searchText.length > 0 && (
|
|
102
|
-
<TouchableOpacity
|
|
103
|
-
onPress={() => this.onChangeSearch("")}
|
|
104
|
-
style={styles.clearButton}
|
|
105
|
-
>
|
|
106
|
-
<Icon
|
|
107
|
-
name="times-circle"
|
|
108
|
-
type="font-awesome"
|
|
109
|
-
iconStyle={styles.clearIcon}
|
|
110
|
-
/>
|
|
111
|
-
</TouchableOpacity>
|
|
112
|
-
)}
|
|
113
|
-
</View>
|
|
114
|
-
);
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
renderMain() {
|
|
118
|
-
if (_.isEmpty(this.props.users)) {
|
|
119
|
-
return (
|
|
120
|
-
<View style={{ marginTop: 16 }}>
|
|
121
|
-
<Components.Spinner />
|
|
122
|
-
</View>
|
|
123
|
-
);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
return (
|
|
127
|
-
<Components.FormCard style={{ marginTop: 16 }}>
|
|
128
|
-
{this.renderOptions()}
|
|
129
|
-
</Components.FormCard>
|
|
130
|
-
);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
renderOptions() {
|
|
134
|
-
const users = this.state.filteredUsers;
|
|
135
|
-
|
|
136
|
-
if (users.length === 0 && this.state.searchText.length > 0) {
|
|
137
|
-
return (
|
|
138
|
-
<View style={styles.noResultsContainer}>
|
|
139
|
-
<Text style={styles.noResultsText}>
|
|
140
|
-
No users found matching "{this.state.searchText}"
|
|
141
|
-
</Text>
|
|
142
|
-
</View>
|
|
143
|
-
);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
return users.map((user, index) => {
|
|
147
|
-
return (
|
|
148
|
-
<TouchableOpacity
|
|
149
|
-
key={index}
|
|
150
|
-
onPress={this.onUserPress.bind(this, user)}
|
|
151
|
-
>
|
|
152
|
-
<Components.FormCardSection
|
|
153
|
-
label={user.displayName}
|
|
154
|
-
labelStyle={{ height: 0, margin: 0 }}
|
|
155
|
-
hasUnderline
|
|
156
|
-
hasContent
|
|
157
|
-
>
|
|
158
|
-
<View style={styles.rowContainer}>
|
|
159
|
-
<View style={styles.userContainer}>
|
|
160
|
-
<Components.ProfilePic
|
|
161
|
-
ProfilePic={user.profilePic}
|
|
162
|
-
Diameter={30}
|
|
163
|
-
/>
|
|
164
|
-
<Text style={styles.labelText}>{user.displayName}</Text>
|
|
165
|
-
</View>
|
|
166
|
-
<Icon
|
|
167
|
-
name="check-circle"
|
|
168
|
-
type="font-awesome"
|
|
169
|
-
iconStyle={[
|
|
170
|
-
{ color: "#d5d9e0", fontSize: 20 },
|
|
171
|
-
_.isEqual(user, this.state.currentUser) && {
|
|
172
|
-
color: Colours.COLOUR_GREEN,
|
|
173
|
-
},
|
|
174
|
-
]}
|
|
175
|
-
/>
|
|
176
|
-
</View>
|
|
177
|
-
</Components.FormCardSection>
|
|
178
|
-
</TouchableOpacity>
|
|
179
|
-
);
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
render() {
|
|
184
|
-
return (
|
|
185
|
-
<View style={styles.container}>
|
|
186
|
-
<Components.Header
|
|
187
|
-
leftIcon="angle-left"
|
|
188
|
-
onPressLeft={this.onPressBack.bind(this)}
|
|
189
|
-
text="Select user"
|
|
190
|
-
/>
|
|
191
|
-
{this.renderSearch()}
|
|
192
|
-
<ScrollView style={{ flex: 1 }}>{this.renderMain()}</ScrollView>
|
|
193
|
-
</View>
|
|
194
|
-
);
|
|
195
|
-
}
|
|
10
|
+
state = {
|
|
11
|
+
currentUser: null,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
UNSAFE_componentWillMount() {
|
|
15
|
+
this.setState({ currentUser: this.props.currentUser });
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
onPressBack() {
|
|
19
|
+
Services.navigation.goBack();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
onUserPress(user) {
|
|
23
|
+
this.props.onSelectUser(user);
|
|
24
|
+
this.setState({ currentUser: user });
|
|
25
|
+
setTimeout(() => {
|
|
26
|
+
this.onPressBack();
|
|
27
|
+
}, 200);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
renderMain() {
|
|
31
|
+
if (_.isEmpty(this.props.users)) {
|
|
32
|
+
return (
|
|
33
|
+
<View style={{ marginTop: 16 }}>
|
|
34
|
+
<Components.Spinner />
|
|
35
|
+
</View>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return <Components.FormCard style={{ marginTop: 16 }}>{this.renderOptions()}</Components.FormCard>;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
renderOptions() {
|
|
43
|
+
return this.props.users.map((user, index) => {
|
|
44
|
+
return (
|
|
45
|
+
<TouchableOpacity key={index} onPress={this.onUserPress.bind(this, user)}>
|
|
46
|
+
<Components.FormCardSection label={user.displayName} labelStyle={{ height: 0, margin: 0 }} hasUnderline hasContent>
|
|
47
|
+
<View style={styles.rowContainer}>
|
|
48
|
+
<View style={styles.userContainer}>
|
|
49
|
+
<Components.ProfilePic ProfilePic={user.profilePic} Diameter={30} />
|
|
50
|
+
<Text style={styles.labelText}>{user.displayName}</Text>
|
|
51
|
+
</View>
|
|
52
|
+
<Icon
|
|
53
|
+
name="check-circle"
|
|
54
|
+
type="font-awesome"
|
|
55
|
+
iconStyle={[{ color: '#d5d9e0', fontSize: 20 }, _.isEqual(user, this.state.currentUser) && { color: Colours.COLOUR_GREEN }]}
|
|
56
|
+
/>
|
|
57
|
+
</View>
|
|
58
|
+
</Components.FormCardSection>
|
|
59
|
+
</TouchableOpacity>
|
|
60
|
+
);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
render() {
|
|
65
|
+
return (
|
|
66
|
+
<View style={styles.container}>
|
|
67
|
+
<Components.Header leftIcon="angle-left" onPressLeft={this.onPressBack.bind(this)} text="Select user" />
|
|
68
|
+
<ScrollView style={{ flex: 1 }}>{this.renderMain()}</ScrollView>
|
|
69
|
+
</View>
|
|
70
|
+
);
|
|
71
|
+
}
|
|
196
72
|
}
|
|
197
73
|
|
|
198
74
|
const styles = {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
searchContainer: {
|
|
230
|
-
flexDirection: "row",
|
|
231
|
-
alignItems: "center",
|
|
232
|
-
paddingHorizontal: 16,
|
|
233
|
-
paddingVertical: 12,
|
|
234
|
-
backgroundColor: "#fff",
|
|
235
|
-
borderBottomWidth: 1,
|
|
236
|
-
borderBottomColor: "#f0f0f5",
|
|
237
|
-
},
|
|
238
|
-
searchIcon: {
|
|
239
|
-
fontSize: 20,
|
|
240
|
-
marginRight: 10,
|
|
241
|
-
color: "rgba(90, 90, 110, .5)",
|
|
242
|
-
},
|
|
243
|
-
searchText: {
|
|
244
|
-
flex: 1,
|
|
245
|
-
fontSize: 16,
|
|
246
|
-
fontFamily: "sf-regular",
|
|
247
|
-
color: Colours.TEXT_DARK,
|
|
248
|
-
},
|
|
249
|
-
clearButton: {
|
|
250
|
-
padding: 8,
|
|
251
|
-
},
|
|
252
|
-
clearIcon: {
|
|
253
|
-
fontSize: 18,
|
|
254
|
-
color: "rgba(90, 90, 110, .5)",
|
|
255
|
-
},
|
|
256
|
-
noResultsContainer: {
|
|
257
|
-
flex: 1,
|
|
258
|
-
alignItems: "center",
|
|
259
|
-
justifyContent: "center",
|
|
260
|
-
paddingVertical: 40,
|
|
261
|
-
},
|
|
262
|
-
noResultsText: {
|
|
263
|
-
fontSize: 16,
|
|
264
|
-
fontFamily: "sf-regular",
|
|
265
|
-
color: Colours.TEXT_LIGHT,
|
|
266
|
-
textAlign: "center",
|
|
267
|
-
},
|
|
75
|
+
container: {
|
|
76
|
+
flex: 1,
|
|
77
|
+
position: 'relative',
|
|
78
|
+
backgroundColor: '#f0f0f5',
|
|
79
|
+
},
|
|
80
|
+
row: {
|
|
81
|
+
flexDirection: 'row',
|
|
82
|
+
alignItems: 'center',
|
|
83
|
+
minHeight: 22,
|
|
84
|
+
},
|
|
85
|
+
text: {
|
|
86
|
+
flex: 1,
|
|
87
|
+
fontFamily: 'sf-regular',
|
|
88
|
+
fontSize: 14,
|
|
89
|
+
color: Colours.TEXT_DARK,
|
|
90
|
+
},
|
|
91
|
+
rowContainer: {
|
|
92
|
+
flexDirection: 'row',
|
|
93
|
+
justifyContent: 'space-between',
|
|
94
|
+
},
|
|
95
|
+
userContainer: {
|
|
96
|
+
flexDirection: 'row',
|
|
97
|
+
alignItems: 'center',
|
|
98
|
+
},
|
|
99
|
+
labelText: {
|
|
100
|
+
fontFamily: 'sf-medium',
|
|
101
|
+
fontSize: 16,
|
|
102
|
+
color: Colours.TEXT_DARK,
|
|
103
|
+
marginLeft: 8,
|
|
104
|
+
},
|
|
268
105
|
};
|
|
269
106
|
|
|
270
107
|
export default connect(null, {})(MaintenanceUserPicker);
|