@plusscommunities/pluss-maintenance-app-forms 6.0.21 → 6.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.
@@ -103,13 +103,8 @@ class MaintenanceRequest extends Component {
103
103
  loadSiteUsers = async () => {
104
104
  try {
105
105
  const response = await userActions.getSiteUsers(this.props.site);
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());
106
+ // PC-1255: Load all users (not just residents) to match web admin behavior
107
+ const users = _.sortBy(response.data.Items || [], u => (u.displayName || '').toLowerCase());
113
108
  this.setState({ users });
114
109
  } catch (error) {
115
110
  console.log('Error loading site users:', error);
@@ -178,23 +173,25 @@ class MaintenanceRequest extends Component {
178
173
  if (userDetails.unit) {
179
174
  update.roomNumber = userDetails.unit;
180
175
  }
181
- if (!this.state.customFields || !_.some(this.state.customFields, 'isTitle')) {
182
- update.title = userDetails.displayName || null;
183
- }
176
+ if (!this.state.customFields || !_.some(this.state.customFields, 'isTitle')) {
177
+ update.title = userDetails.displayName || null;
178
+ }
184
179
  }
185
180
  } catch (error) {
186
181
  // Permission denied (403) or other error - continue without auto-population
187
182
  // User can still manually enter contact details
188
183
  console.log('Could not fetch user details for auto-population:', error);
189
184
  } finally {
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
- }
185
+ // In any case, we still need a title. Inform the user to set one form field as a title.
186
+ if (!this.state.title && !update.title) {
187
+ update.title = "[Missing title - Set one of the form field as title in the community manager]"
188
+ }
189
+
194
190
  }
195
191
  this.setState(update);
196
192
  };
197
193
 
194
+
198
195
  onChangeAnswer = (fieldId, answer) => {
199
196
  const update = { customFields: _.cloneDeep(this.state.customFields) };
200
197
  const field = update.customFields[fieldId];
@@ -1561,7 +1558,6 @@ const mapStateToProps = state => {
1561
1558
  permissions,
1562
1559
  colourBrandingMain: Colours.getMainBrandingColourFromState(state),
1563
1560
  strings: state.strings?.config || {},
1564
- optionOnlyForResidents: Helper.getSiteSettingFromState(state, values.optionOnlyForResidents),
1565
1561
  };
1566
1562
  };
1567
1563
 
@@ -32,7 +32,6 @@ const values = {
32
32
  textEntityName: 'Job',
33
33
  stringConfigJobStatus: 'maintenanceJobStatusA',
34
34
  stringConfigHideSeen: 'maintenanceDisableSeenA',
35
- optionOnlyForResidents: 'onlyForResidentsMaintenanceA',
36
35
  };
37
36
 
38
37
  export { values };
@@ -38,7 +38,6 @@ const values = {
38
38
  forceCustomFields: false,
39
39
  stringConfigJobStatus: 'maintenanceJobStatus',
40
40
  stringConfigHideSeen: 'maintenanceDisableSeen',
41
- optionOnlyForResidents: 'onlyForResidentsMaintenance',
42
41
  };
43
42
 
44
43
  export { values };
@@ -38,7 +38,6 @@ const values = {
38
38
  forceCustomFields: true,
39
39
  stringConfigJobStatus: 'maintenanceJobStatusEnquiry',
40
40
  stringConfigHideSeen: 'maintenanceDisableSeenEnquiry',
41
- optionOnlyForResidents: 'onlyForResidentsMaintenanceEnquiry',
42
41
  };
43
42
 
44
43
  export { values };
@@ -38,7 +38,6 @@ const values = {
38
38
  forceCustomFields: true,
39
39
  stringConfigJobStatus: 'maintenanceJobStatusFeedback',
40
40
  stringConfigHideSeen: 'maintenanceDisableSeenFeedback',
41
- optionOnlyForResidents: 'onlyForResidentsMaintenanceFeedback',
42
41
  };
43
42
 
44
43
  export { values };
@@ -38,7 +38,6 @@ const values = {
38
38
  forceCustomFields: true,
39
39
  stringConfigJobStatus: 'maintenanceJobStatusFood',
40
40
  stringConfigHideSeen: 'maintenanceDisableSeenFood',
41
- optionOnlyForResidents: 'onlyForResidentsMaintenanceFood',
42
41
  };
43
42
 
44
43
  export { values };