@plusscommunities/pluss-maintenance-app-feedback 6.0.20 → 6.0.21
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/screens/RequestDetail.js +145 -146
- package/dist/module/screens/RequestDetail.js.map +1 -1
- package/dist/module/screens/ServiceRequest.js +8 -4
- package/dist/module/screens/ServiceRequest.js.map +1 -1
- package/dist/module/values.config.a.js +2 -1
- package/dist/module/values.config.a.js.map +1 -1
- package/dist/module/values.config.default.js +2 -1
- package/dist/module/values.config.default.js.map +1 -1
- package/dist/module/values.config.enquiry.js +2 -1
- package/dist/module/values.config.enquiry.js.map +1 -1
- package/dist/module/values.config.feedback.js +2 -1
- package/dist/module/values.config.feedback.js.map +1 -1
- package/dist/module/values.config.food.js +2 -1
- package/dist/module/values.config.food.js.map +1 -1
- package/dist/module/values.config.js +2 -1
- package/dist/module/values.config.js.map +1 -1
- package/package.json +1 -1
- package/src/screens/RequestDetail.js +1348 -1125
- package/src/screens/ServiceRequest.js +15 -11
- package/src/values.config.a.js +1 -0
- package/src/values.config.default.js +1 -0
- package/src/values.config.enquiry.js +1 -0
- package/src/values.config.feedback.js +1 -0
- package/src/values.config.food.js +1 -0
- package/src/values.config.js +1 -0
|
@@ -103,8 +103,13 @@ class MaintenanceRequest extends Component {
|
|
|
103
103
|
loadSiteUsers = async () => {
|
|
104
104
|
try {
|
|
105
105
|
const response = await userActions.getSiteUsers(this.props.site);
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
|
|
107
|
+
let items = response.data.Items || [];
|
|
108
|
+
if (this.props.optionOnlyForResidents) {
|
|
109
|
+
items = _.filter(items, u => u.category === 'resident');
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const users = _.sortBy(items, u => (u.displayName || '').toLowerCase());
|
|
108
113
|
this.setState({ users });
|
|
109
114
|
} catch (error) {
|
|
110
115
|
console.log('Error loading site users:', error);
|
|
@@ -173,25 +178,23 @@ class MaintenanceRequest extends Component {
|
|
|
173
178
|
if (userDetails.unit) {
|
|
174
179
|
update.roomNumber = userDetails.unit;
|
|
175
180
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
181
|
+
if (!this.state.customFields || !_.some(this.state.customFields, 'isTitle')) {
|
|
182
|
+
update.title = userDetails.displayName || null;
|
|
183
|
+
}
|
|
179
184
|
}
|
|
180
185
|
} catch (error) {
|
|
181
186
|
// Permission denied (403) or other error - continue without auto-population
|
|
182
187
|
// User can still manually enter contact details
|
|
183
188
|
console.log('Could not fetch user details for auto-population:', error);
|
|
184
189
|
} finally {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
+
// In any case, we still need a title. Inform the user to set one form field as a title.
|
|
191
|
+
if (!state.title && !update.title) {
|
|
192
|
+
update.title = '[Missing title - Set one of the form field as title in the community manager]';
|
|
193
|
+
}
|
|
190
194
|
}
|
|
191
195
|
this.setState(update);
|
|
192
196
|
};
|
|
193
197
|
|
|
194
|
-
|
|
195
198
|
onChangeAnswer = (fieldId, answer) => {
|
|
196
199
|
const update = { customFields: _.cloneDeep(this.state.customFields) };
|
|
197
200
|
const field = update.customFields[fieldId];
|
|
@@ -1558,6 +1561,7 @@ const mapStateToProps = state => {
|
|
|
1558
1561
|
permissions,
|
|
1559
1562
|
colourBrandingMain: Colours.getMainBrandingColourFromState(state),
|
|
1560
1563
|
strings: state.strings?.config || {},
|
|
1564
|
+
optionOnlyForResidents: Helper.getSiteSettingFromState(state, values.optionOnlyForResidents),
|
|
1561
1565
|
};
|
|
1562
1566
|
};
|
|
1563
1567
|
|
package/src/values.config.a.js
CHANGED
package/src/values.config.js
CHANGED