user profile basic cleanup

This commit is contained in:
Denys Vuika
2023-02-11 15:24:23 -05:00
committed by Yasa-Nataliya
parent c43b0cb6fe
commit 243eb9ffae
5 changed files with 14 additions and 31 deletions

View File

@@ -1,7 +1,7 @@
<div class="app-profile-container" [ngClass]="{'app-view-profile-container' : hideSidenav === true}">
<div class="app-profile-container">
<div class="app-profile-row">
<div class="app-profile-title">
<mat-icon class="app-profile-icon" (click)="navigateToPersonalFiles()" id="backButton">arrow_back</mat-icon>
<mat-icon class="app-profile-icon" [routerLink]="landingPage">arrow_back</mat-icon>
<h3 class="app-profile">{{'APP.EDIT_PROFILE.MY_PROFILE' | translate}}</h3>
</div>
</div>

View File

@@ -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%;
}
}

View File

@@ -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;

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;

View File

@@ -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 {}