diff --git a/projects/aca-content/src/lib/components/view-profile/view-profile.component.html b/projects/aca-content/src/lib/components/view-profile/view-profile.component.html index 06091c816..5aa17fef9 100644 --- a/projects/aca-content/src/lib/components/view-profile/view-profile.component.html +++ b/projects/aca-content/src/lib/components/view-profile/view-profile.component.html @@ -1,7 +1,7 @@ -
+
- arrow_back + arrow_back

{{'APP.EDIT_PROFILE.MY_PROFILE' | translate}}

diff --git a/projects/aca-content/src/lib/components/view-profile/view-profile.component.scss b/projects/aca-content/src/lib/components/view-profile/view-profile.component.scss index c6d8adafe..ec9cee641 100644 --- a/projects/aca-content/src/lib/components/view-profile/view-profile.component.scss +++ b/projects/aca-content/src/lib/components/view-profile/view-profile.component.scss @@ -195,14 +195,4 @@ app-view-profile { padding-top: 2rem; padding-left: .5rem; } - - .app-view-profile-container { - position: fixed; - top: 0; - left: 0; - width: 100%; - bottom: 0; - right: 0; - height: 100%; - } } diff --git a/projects/aca-content/src/lib/components/view-profile/view-profile.component.spec.ts b/projects/aca-content/src/lib/components/view-profile/view-profile.component.spec.ts index b928f0939..6e12b24f5 100644 --- a/projects/aca-content/src/lib/components/view-profile/view-profile.component.spec.ts +++ b/projects/aca-content/src/lib/components/view-profile/view-profile.component.spec.ts @@ -104,13 +104,6 @@ describe('ViewProfileComponent', () => { expect(component.isSaveButtonDisabled()).toBeFalsy(); }); - it('should navigate to personal files when back button is clicked', () => { - const navigateSpy = spyOn(router, 'navigate'); - component.navigateToPersonalFiles(); - - expect(navigateSpy).toHaveBeenCalledWith(['/personal-files'], { replaceUrl: true }); - }); - it('should expand or compress general dropdown when arrow button is clicked', () => { spyOn(component, 'toggleGeneralDropdown').and.callThrough(); component.generalSectionDropdown = false; diff --git a/projects/aca-content/src/lib/components/view-profile/view-profile.component.ts b/projects/aca-content/src/lib/components/view-profile/view-profile.component.ts index 3ac5bfdbd..4c5625311 100644 --- a/projects/aca-content/src/lib/components/view-profile/view-profile.component.ts +++ b/projects/aca-content/src/lib/components/view-profile/view-profile.component.ts @@ -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; diff --git a/projects/aca-content/src/lib/components/view-profile/view-profile.module.ts b/projects/aca-content/src/lib/components/view-profile/view-profile.module.ts index ff817f799..e01aebee3 100644 --- a/projects/aca-content/src/lib/components/view-profile/view-profile.module.ts +++ b/projects/aca-content/src/lib/components/view-profile/view-profile.module.ts @@ -27,9 +27,10 @@ import { NgModule } from '@angular/core'; import { ViewProfileComponent } from './view-profile.component'; import { CommonModule } from '@angular/common'; import { CoreModule } from '@alfresco/adf-core'; +import { RouterModule } from '@angular/router'; @NgModule({ - imports: [CommonModule, CoreModule.forChild()], + imports: [CommonModule, RouterModule, CoreModule.forChild()], declarations: [ViewProfileComponent] }) export class ViewProfileModule {}