mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-10-01 14:41:14 +00:00
update view profile unit tests
This commit is contained in:
committed by
Sheena Malhotra
parent
62ad3cd786
commit
7c89b53928
@@ -43,24 +43,17 @@ export class ViewProfileComponent implements OnInit {
|
||||
ngOnInit() {
|
||||
this.peopleApi
|
||||
.getPerson('-me-')
|
||||
.then((userInfo) => {
|
||||
this.personDetails = userInfo?.entry;
|
||||
this.populateForm(userInfo?.entry);
|
||||
})
|
||||
.catch((error) => {
|
||||
throwError(error);
|
||||
});
|
||||
.then((userInfo) => this.populateForm(userInfo?.entry))
|
||||
.catch((error) => throwError(error));
|
||||
}
|
||||
|
||||
populateForm(userInfo: Person) {
|
||||
this.personDetails = userInfo;
|
||||
this.profileForm = new FormGroup({
|
||||
jobTitle: new FormControl(userInfo?.jobTitle || ''),
|
||||
location: new FormControl(userInfo?.location || ''),
|
||||
telephone: new FormControl(userInfo?.telephone || '', [Validators.pattern('^([0-9]+-)*[0-9]+$')]),
|
||||
mobile: new FormControl(userInfo?.mobile || '', [Validators.pattern('^([0-9]+-)*[0-9]+$')]),
|
||||
oldPassword: new FormControl(''),
|
||||
newPassword: new FormControl(''),
|
||||
verifyPassword: new FormControl(''),
|
||||
companyName: new FormControl(userInfo?.company?.organization || ''),
|
||||
companyPostCode: new FormControl(userInfo?.company?.postcode || ''),
|
||||
companyAddress: new FormControl(userInfo?.company?.address1 || ''),
|
||||
|
Reference in New Issue
Block a user