@plusscommunities/pluss-maintenance-web-feedback 1.1.25-beta.2 → 1.1.26
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/index.cjs.js +32 -3
- package/dist/index.esm.js +32 -3
- package/dist/index.umd.js +32 -3
- package/package.json +2 -2
- package/src/screens/AddJob.js +30 -1
package/dist/index.cjs.js
CHANGED
|
@@ -4955,16 +4955,45 @@ var AddJob = /*#__PURE__*/function (_Component) {
|
|
|
4955
4955
|
|
|
4956
4956
|
if (!___default['default'].isEmpty(_this.state.customFields) && !___default['default'].some(_this.state.customFields, 'isTitle')) {
|
|
4957
4957
|
update.title = user.displayName;
|
|
4958
|
-
}
|
|
4958
|
+
} // Update UI immediately (non-blocking)
|
|
4959
4959
|
|
|
4960
|
-
|
|
4960
|
+
|
|
4961
|
+
_this.setState(update); // PC-1255: Auto-populate contact details when staff create requests on behalf of residents
|
|
4962
|
+
// Requires userManagement permission - gracefully falls back to manual entry if denied
|
|
4963
|
+
// Fetch in background to avoid blocking UI
|
|
4964
|
+
|
|
4965
|
+
|
|
4966
|
+
userActions.fetchUser(_this.props.auth.site, user.userId).then(function (response) {
|
|
4967
|
+
if (response.data && response.data.user) {
|
|
4968
|
+
var contactUpdate = {}; // Auto-populate phone and room from user profile
|
|
4969
|
+
|
|
4970
|
+
if (response.data.user.phoneNumber) {
|
|
4971
|
+
contactUpdate.phone = response.data.user.phoneNumber;
|
|
4972
|
+
}
|
|
4973
|
+
|
|
4974
|
+
if (response.data.user.unit) {
|
|
4975
|
+
contactUpdate.room = response.data.user.unit;
|
|
4976
|
+
} // Update contact fields when data arrives
|
|
4977
|
+
|
|
4978
|
+
|
|
4979
|
+
if (Object.keys(contactUpdate).length > 0) {
|
|
4980
|
+
_this.setState(contactUpdate);
|
|
4981
|
+
}
|
|
4982
|
+
}
|
|
4983
|
+
}).catch(function (error) {
|
|
4984
|
+
// Permission denied (403) or other error - continue without auto-population
|
|
4985
|
+
// Staff can still create the request, just need to enter contact details manually
|
|
4986
|
+
console.log('Could not fetch user details for auto-population:', error);
|
|
4987
|
+
});
|
|
4961
4988
|
});
|
|
4962
4989
|
|
|
4963
4990
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onUnselectUser", function () {
|
|
4964
4991
|
var update = {
|
|
4965
4992
|
selectedUser: null,
|
|
4966
4993
|
userID: '',
|
|
4967
|
-
userName: ''
|
|
4994
|
+
userName: '',
|
|
4995
|
+
phone: '',
|
|
4996
|
+
room: ''
|
|
4968
4997
|
};
|
|
4969
4998
|
|
|
4970
4999
|
if (!___default['default'].isEmpty(_this.state.customFields) && !___default['default'].some(_this.state.customFields, 'isTitle')) {
|
package/dist/index.esm.js
CHANGED
|
@@ -4912,16 +4912,45 @@ var AddJob = /*#__PURE__*/function (_Component) {
|
|
|
4912
4912
|
|
|
4913
4913
|
if (!_.isEmpty(_this.state.customFields) && !_.some(_this.state.customFields, 'isTitle')) {
|
|
4914
4914
|
update.title = user.displayName;
|
|
4915
|
-
}
|
|
4915
|
+
} // Update UI immediately (non-blocking)
|
|
4916
4916
|
|
|
4917
|
-
|
|
4917
|
+
|
|
4918
|
+
_this.setState(update); // PC-1255: Auto-populate contact details when staff create requests on behalf of residents
|
|
4919
|
+
// Requires userManagement permission - gracefully falls back to manual entry if denied
|
|
4920
|
+
// Fetch in background to avoid blocking UI
|
|
4921
|
+
|
|
4922
|
+
|
|
4923
|
+
userActions.fetchUser(_this.props.auth.site, user.userId).then(function (response) {
|
|
4924
|
+
if (response.data && response.data.user) {
|
|
4925
|
+
var contactUpdate = {}; // Auto-populate phone and room from user profile
|
|
4926
|
+
|
|
4927
|
+
if (response.data.user.phoneNumber) {
|
|
4928
|
+
contactUpdate.phone = response.data.user.phoneNumber;
|
|
4929
|
+
}
|
|
4930
|
+
|
|
4931
|
+
if (response.data.user.unit) {
|
|
4932
|
+
contactUpdate.room = response.data.user.unit;
|
|
4933
|
+
} // Update contact fields when data arrives
|
|
4934
|
+
|
|
4935
|
+
|
|
4936
|
+
if (Object.keys(contactUpdate).length > 0) {
|
|
4937
|
+
_this.setState(contactUpdate);
|
|
4938
|
+
}
|
|
4939
|
+
}
|
|
4940
|
+
}).catch(function (error) {
|
|
4941
|
+
// Permission denied (403) or other error - continue without auto-population
|
|
4942
|
+
// Staff can still create the request, just need to enter contact details manually
|
|
4943
|
+
console.log('Could not fetch user details for auto-population:', error);
|
|
4944
|
+
});
|
|
4918
4945
|
});
|
|
4919
4946
|
|
|
4920
4947
|
_defineProperty(_assertThisInitialized(_this), "onUnselectUser", function () {
|
|
4921
4948
|
var update = {
|
|
4922
4949
|
selectedUser: null,
|
|
4923
4950
|
userID: '',
|
|
4924
|
-
userName: ''
|
|
4951
|
+
userName: '',
|
|
4952
|
+
phone: '',
|
|
4953
|
+
room: ''
|
|
4925
4954
|
};
|
|
4926
4955
|
|
|
4927
4956
|
if (!_.isEmpty(_this.state.customFields) && !_.some(_this.state.customFields, 'isTitle')) {
|
package/dist/index.umd.js
CHANGED
|
@@ -4934,16 +4934,45 @@
|
|
|
4934
4934
|
|
|
4935
4935
|
if (!___default['default'].isEmpty(_this.state.customFields) && !___default['default'].some(_this.state.customFields, 'isTitle')) {
|
|
4936
4936
|
update.title = user.displayName;
|
|
4937
|
-
}
|
|
4937
|
+
} // Update UI immediately (non-blocking)
|
|
4938
4938
|
|
|
4939
|
-
|
|
4939
|
+
|
|
4940
|
+
_this.setState(update); // PC-1255: Auto-populate contact details when staff create requests on behalf of residents
|
|
4941
|
+
// Requires userManagement permission - gracefully falls back to manual entry if denied
|
|
4942
|
+
// Fetch in background to avoid blocking UI
|
|
4943
|
+
|
|
4944
|
+
|
|
4945
|
+
userActions.fetchUser(_this.props.auth.site, user.userId).then(function (response) {
|
|
4946
|
+
if (response.data && response.data.user) {
|
|
4947
|
+
var contactUpdate = {}; // Auto-populate phone and room from user profile
|
|
4948
|
+
|
|
4949
|
+
if (response.data.user.phoneNumber) {
|
|
4950
|
+
contactUpdate.phone = response.data.user.phoneNumber;
|
|
4951
|
+
}
|
|
4952
|
+
|
|
4953
|
+
if (response.data.user.unit) {
|
|
4954
|
+
contactUpdate.room = response.data.user.unit;
|
|
4955
|
+
} // Update contact fields when data arrives
|
|
4956
|
+
|
|
4957
|
+
|
|
4958
|
+
if (Object.keys(contactUpdate).length > 0) {
|
|
4959
|
+
_this.setState(contactUpdate);
|
|
4960
|
+
}
|
|
4961
|
+
}
|
|
4962
|
+
}).catch(function (error) {
|
|
4963
|
+
// Permission denied (403) or other error - continue without auto-population
|
|
4964
|
+
// Staff can still create the request, just need to enter contact details manually
|
|
4965
|
+
console.log('Could not fetch user details for auto-population:', error);
|
|
4966
|
+
});
|
|
4940
4967
|
});
|
|
4941
4968
|
|
|
4942
4969
|
_defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onUnselectUser", function () {
|
|
4943
4970
|
var update = {
|
|
4944
4971
|
selectedUser: null,
|
|
4945
4972
|
userID: '',
|
|
4946
|
-
userName: ''
|
|
4973
|
+
userName: '',
|
|
4974
|
+
phone: '',
|
|
4975
|
+
room: ''
|
|
4947
4976
|
};
|
|
4948
4977
|
|
|
4949
4978
|
if (!___default['default'].isEmpty(_this.state.customFields) && !___default['default'].some(_this.state.customFields, 'isTitle')) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plusscommunities/pluss-maintenance-web-feedback",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.26",
|
|
4
4
|
"description": "Extension package to enable maintenance on Pluss Communities Platform",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"scripts": {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@babel/runtime": "^7.14.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@plusscommunities/pluss-core-web": "1.6.
|
|
40
|
+
"@plusscommunities/pluss-core-web": "^1.6.8",
|
|
41
41
|
"@fortawesome/fontawesome-svg-core": "^6.4.0",
|
|
42
42
|
"@fortawesome/free-solid-svg-icons": "^6.4.0",
|
|
43
43
|
"@fortawesome/react-fontawesome": "^0.2.0",
|
package/src/screens/AddJob.js
CHANGED
|
@@ -199,11 +199,40 @@ class AddJob extends Component {
|
|
|
199
199
|
if (!_.isEmpty(this.state.customFields) && !_.some(this.state.customFields, 'isTitle')) {
|
|
200
200
|
update.title = user.displayName;
|
|
201
201
|
}
|
|
202
|
+
|
|
203
|
+
// Update UI immediately (non-blocking)
|
|
202
204
|
this.setState(update);
|
|
205
|
+
|
|
206
|
+
// PC-1255: Auto-populate contact details when staff create requests on behalf of residents
|
|
207
|
+
// Requires userManagement permission - gracefully falls back to manual entry if denied
|
|
208
|
+
// Fetch in background to avoid blocking UI
|
|
209
|
+
userActions
|
|
210
|
+
.fetchUser(this.props.auth.site, user.userId)
|
|
211
|
+
.then((response) => {
|
|
212
|
+
if (response.data && response.data.user) {
|
|
213
|
+
const contactUpdate = {};
|
|
214
|
+
// Auto-populate phone and room from user profile
|
|
215
|
+
if (response.data.user.phoneNumber) {
|
|
216
|
+
contactUpdate.phone = response.data.user.phoneNumber;
|
|
217
|
+
}
|
|
218
|
+
if (response.data.user.unit) {
|
|
219
|
+
contactUpdate.room = response.data.user.unit;
|
|
220
|
+
}
|
|
221
|
+
// Update contact fields when data arrives
|
|
222
|
+
if (Object.keys(contactUpdate).length > 0) {
|
|
223
|
+
this.setState(contactUpdate);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
})
|
|
227
|
+
.catch((error) => {
|
|
228
|
+
// Permission denied (403) or other error - continue without auto-population
|
|
229
|
+
// Staff can still create the request, just need to enter contact details manually
|
|
230
|
+
console.log('Could not fetch user details for auto-population:', error);
|
|
231
|
+
});
|
|
203
232
|
};
|
|
204
233
|
|
|
205
234
|
onUnselectUser = () => {
|
|
206
|
-
const update = { selectedUser: null, userID: '', userName: '' };
|
|
235
|
+
const update = { selectedUser: null, userID: '', userName: '', phone: '', room: '' };
|
|
207
236
|
if (!_.isEmpty(this.state.customFields) && !_.some(this.state.customFields, 'isTitle')) {
|
|
208
237
|
update.title = '';
|
|
209
238
|
}
|