@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.
Files changed (106) hide show
  1. package/dist/module/actions/JobActions.js +44 -1
  2. package/dist/module/actions/JobActions.js.map +1 -1
  3. package/dist/module/actions/index.js +1 -1
  4. package/dist/module/actions/index.js.map +1 -1
  5. package/dist/module/actions/types.js +4 -1
  6. package/dist/module/actions/types.js.map +1 -1
  7. package/dist/module/apis/index.js +4 -1
  8. package/dist/module/apis/index.js.map +1 -1
  9. package/dist/module/apis/maintenanceActions.js +61 -38
  10. package/dist/module/apis/maintenanceActions.js.map +1 -1
  11. package/dist/module/apis/userActions.js +23 -0
  12. package/dist/module/apis/userActions.js.map +1 -0
  13. package/dist/module/components/FilterPopupMenu.js +82 -58
  14. package/dist/module/components/FilterPopupMenu.js.map +1 -1
  15. package/dist/module/components/MaintenanceList.js +84 -92
  16. package/dist/module/components/MaintenanceList.js.map +1 -1
  17. package/dist/module/components/MaintenanceListItem.js +94 -80
  18. package/dist/module/components/MaintenanceListItem.js.map +1 -1
  19. package/dist/module/components/MaintenanceWidgetItem.js +39 -38
  20. package/dist/module/components/MaintenanceWidgetItem.js.map +1 -1
  21. package/dist/module/components/PrioritySelectorPopup.js +83 -0
  22. package/dist/module/components/PrioritySelectorPopup.js.map +1 -0
  23. package/dist/module/components/StatusSelectorPopup.js +23 -27
  24. package/dist/module/components/StatusSelectorPopup.js.map +1 -1
  25. package/dist/module/components/WidgetLarge.js +2 -2
  26. package/dist/module/components/WidgetLarge.js.map +1 -1
  27. package/dist/module/components/WidgetSmall.js +25 -20
  28. package/dist/module/components/WidgetSmall.js.map +1 -1
  29. package/dist/module/core.config.js +2 -3
  30. package/dist/module/core.config.js.map +1 -1
  31. package/dist/module/feature.config.js +17 -17
  32. package/dist/module/feature.config.js.map +1 -1
  33. package/dist/module/helper.js +41 -26
  34. package/dist/module/helper.js.map +1 -1
  35. package/dist/module/index.js +12 -10
  36. package/dist/module/index.js.map +1 -1
  37. package/dist/module/reducers/JobsReducer.js +36 -6
  38. package/dist/module/reducers/JobsReducer.js.map +1 -1
  39. package/dist/module/screens/JobTypePicker.js +18 -17
  40. package/dist/module/screens/JobTypePicker.js.map +1 -1
  41. package/dist/module/screens/MaintenancePage.js +10 -10
  42. package/dist/module/screens/MaintenancePage.js.map +1 -1
  43. package/dist/module/screens/MaintenanceUserPicker.js +219 -0
  44. package/dist/module/screens/MaintenanceUserPicker.js.map +1 -0
  45. package/dist/module/screens/RequestDetail.js +410 -142
  46. package/dist/module/screens/RequestDetail.js.map +1 -1
  47. package/dist/module/screens/RequestNotes.js +462 -52
  48. package/dist/module/screens/RequestNotes.js.map +1 -1
  49. package/dist/module/screens/ServiceRequest.js +519 -181
  50. package/dist/module/screens/ServiceRequest.js.map +1 -1
  51. package/dist/module/values.config.a.js +30 -23
  52. package/dist/module/values.config.a.js.map +1 -1
  53. package/dist/module/values.config.default.js +35 -28
  54. package/dist/module/values.config.default.js.map +1 -1
  55. package/dist/module/values.config.enquiry.js +43 -0
  56. package/dist/module/values.config.enquiry.js.map +1 -0
  57. package/dist/module/values.config.feedback.js +43 -0
  58. package/dist/module/values.config.feedback.js.map +1 -0
  59. package/dist/module/values.config.food.js +43 -0
  60. package/dist/module/values.config.food.js.map +1 -0
  61. package/dist/module/values.config.forms.js +35 -28
  62. package/dist/module/values.config.forms.js.map +1 -1
  63. package/dist/module/values.config.js +35 -28
  64. package/dist/module/values.config.js.map +1 -1
  65. package/package.json +55 -51
  66. package/src/actions/JobActions.js +75 -16
  67. package/src/actions/index.js +1 -1
  68. package/src/actions/types.js +4 -1
  69. package/src/apis/index.js +6 -1
  70. package/src/apis/maintenanceActions.js +189 -160
  71. package/src/apis/userActions.js +21 -0
  72. package/src/components/FilterPopupMenu.js +316 -230
  73. package/src/components/MaintenanceList.js +391 -326
  74. package/src/components/MaintenanceListItem.js +348 -274
  75. package/src/components/MaintenanceWidgetItem.js +146 -120
  76. package/src/components/PrioritySelectorPopup.js +93 -0
  77. package/src/components/StatusSelectorPopup.js +82 -76
  78. package/src/components/WidgetLarge.js +5 -5
  79. package/src/components/WidgetSmall.js +154 -131
  80. package/src/core.config.js +25 -3
  81. package/src/feature.config.js +62 -62
  82. package/src/helper.js +67 -30
  83. package/src/index.js +22 -20
  84. package/src/reducers/JobsReducer.js +85 -41
  85. package/src/screens/JobTypePicker.js +116 -92
  86. package/src/screens/MaintenancePage.js +89 -80
  87. package/src/screens/MaintenanceUserPicker.js +233 -0
  88. package/src/screens/RequestDetail.js +1354 -892
  89. package/src/screens/RequestNotes.js +946 -408
  90. package/src/screens/ServiceRequest.js +1808 -1222
  91. package/src/values.config.a.js +33 -26
  92. package/src/values.config.default.js +39 -32
  93. package/src/values.config.enquiry.js +43 -0
  94. package/src/values.config.feedback.js +43 -0
  95. package/src/values.config.food.js +43 -0
  96. package/src/values.config.forms.js +39 -32
  97. package/src/values.config.js +39 -32
  98. package/dist/module/values.config.b.js +0 -30
  99. package/dist/module/values.config.b.js.map +0 -1
  100. package/dist/module/values.config.c.js +0 -30
  101. package/dist/module/values.config.c.js.map +0 -1
  102. package/dist/module/values.config.d.js +0 -30
  103. package/dist/module/values.config.d.js.map +0 -1
  104. package/src/values.config.b.js +0 -30
  105. package/src/values.config.c.js +0 -30
  106. 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);