user profile basic cleanup

This commit is contained in:
Denys Vuika
2023-02-11 15:24:23 -05:00
committed by Sheena Malhotra
parent 111f71279c
commit 16278ae181
5 changed files with 14 additions and 31 deletions

View File

@@ -5,11 +5,10 @@
* pursuant to a written agreement and any use of this program without such an
* agreement is prohibited.
*/
import { AlfrescoApiService } from '@alfresco/adf-core';
import { AlfrescoApiService, AppConfigService } from '@alfresco/adf-core';
import { PeopleApi, Person } from '@alfresco/js-api';
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
import { FormControl, FormGroup, Validators } from '@angular/forms';
import { Router } from '@angular/router';
import { throwError } from 'rxjs';
@Component({
@@ -19,7 +18,11 @@ import { throwError } from 'rxjs';
encapsulation: ViewEncapsulation.None
})
export class ViewProfileComponent implements OnInit {
peopleApi: PeopleApi;
private _peopleApi: PeopleApi;
get peopleApi(): PeopleApi {
return this._peopleApi ?? (this._peopleApi = new PeopleApi(this.apiService.getInstance()));
}
profileForm: FormGroup;
personDetails: Person;
@@ -35,8 +38,10 @@ export class ViewProfileComponent implements OnInit {
contactSectionButtonsToggle = true;
hideSidenav: boolean;
constructor(private router: Router, apiService: AlfrescoApiService) {
this.peopleApi = new PeopleApi(apiService.getInstance());
landingPage: string;
constructor(private apiService: AlfrescoApiService, private appConfigService: AppConfigService) {
this.landingPage = this.appConfigService.get('landingPage', '/personal-files');
}
ngOnInit() {
@@ -69,12 +74,6 @@ export class ViewProfileComponent implements OnInit {
});
}
navigateToPersonalFiles() {
this.router.navigate(['/personal-files'], {
replaceUrl: true
});
}
toggleGeneralDropdown() {
this.generalSectionDropdown = !this.generalSectionDropdown;