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