cleanup code, back buttons for about and profile

This commit is contained in:
Denys Vuika
2023-02-13 14:20:48 -05:00
committed by Sheena Malhotra
parent b1c794c5d1
commit f3bfe720a1
7 changed files with 17 additions and 27 deletions

View File

@@ -1,5 +1,8 @@
<aca-page-layout> <aca-page-layout>
<aca-page-layout-header> <aca-page-layout-header>
<button mat-icon-button [routerLink]="landingPage">
<mat-icon class="app-profile-icon">arrow_back</mat-icon>
</button>
<h1>{{ 'APP.BROWSE.ABOUT.TITLE' | translate }}</h1> <h1>{{ 'APP.BROWSE.ABOUT.TITLE' | translate }}</h1>
</aca-page-layout-header> </aca-page-layout-header>

View File

@@ -27,7 +27,7 @@ import { Component, Inject, OnInit, Optional } from '@angular/core';
import { DEV_MODE_TOKEN } from './dev-mode.tokens'; import { DEV_MODE_TOKEN } from './dev-mode.tokens';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { AppExtensionService, ExtensionRef } from '@alfresco/adf-extensions'; import { AppExtensionService, ExtensionRef } from '@alfresco/adf-extensions';
import { AuthenticationService, RepositoryInfo } from '@alfresco/adf-core'; import { AppConfigService, AuthenticationService, RepositoryInfo } from '@alfresco/adf-core';
import { DiscoveryApiService } from '@alfresco/adf-content-services'; import { DiscoveryApiService } from '@alfresco/adf-content-services';
import { PACKAGE_JSON } from './package-json.token'; import { PACKAGE_JSON } from './package-json.token';
@@ -47,6 +47,7 @@ export class AboutComponent implements OnInit {
dev = false; dev = false;
extensions$: Observable<ExtensionRef[]>; extensions$: Observable<ExtensionRef[]>;
repository: RepositoryInfo = null; repository: RepositoryInfo = null;
landingPage: string;
constructor( constructor(
@Inject(DEV_MODE_TOKEN) devMode, @Inject(DEV_MODE_TOKEN) devMode,
@@ -55,10 +56,12 @@ export class AboutComponent implements OnInit {
public packageJson, public packageJson,
private authService: AuthenticationService, private authService: AuthenticationService,
private appExtensions: AppExtensionService, private appExtensions: AppExtensionService,
private discovery: DiscoveryApiService private discovery: DiscoveryApiService,
appConfigService: AppConfigService
) { ) {
this.dev = !devMode; this.dev = !devMode;
this.extensions$ = this.appExtensions.references$; this.extensions$ = this.appExtensions.references$;
this.landingPage = appConfigService.get('landingPage', '/personal-files');
} }
ngOnInit(): void { ngOnInit(): void {

View File

@@ -32,9 +32,10 @@ import { SharedModule, PageLayoutModule } from '@alfresco/aca-shared';
import { ExtensionService, provideExtensionConfig } from '@alfresco/adf-extensions'; import { ExtensionService, provideExtensionConfig } from '@alfresco/adf-extensions';
import { DEV_MODE_TOKEN } from './dev-mode.tokens'; import { DEV_MODE_TOKEN } from './dev-mode.tokens';
import { PACKAGE_JSON } from './package-json.token'; import { PACKAGE_JSON } from './package-json.token';
import { RouterModule } from '@angular/router';
@NgModule({ @NgModule({
imports: [CommonModule, CoreModule.forChild(), SharedModule, PageLayoutModule], imports: [CommonModule, RouterModule, CoreModule.forChild(), SharedModule, PageLayoutModule],
declarations: [AboutComponent], declarations: [AboutComponent],
providers: [provideExtensionConfig(['about.plugin.json'])] providers: [provideExtensionConfig(['about.plugin.json'])]
}) })

View File

@@ -18,7 +18,7 @@
<ng-container *ngIf="item.children && item.children.length"> <ng-container *ngIf="item.children && item.children.length">
<mat-expansion-panel <mat-expansion-panel
[expanded]="acaExpansionPanel.isItemExpanded()" [expanded]="acaExpansionPanel.hasActiveLinks()"
[acaExpansionPanel]="item" [acaExpansionPanel]="item"
#acaExpansionPanel="acaExpansionPanel" #acaExpansionPanel="acaExpansionPanel"
[@.disabled]="true" [@.disabled]="true"

View File

@@ -64,26 +64,6 @@ export class ExpansionPanelDirective implements OnInit, OnDestroy {
return false; return false;
} }
isRouteAbout(): boolean {
return this.router.url.includes('/about');
}
isRouteProfile(): boolean {
return this.router.url.includes('/profile');
}
isRouteSearch(): boolean {
return this.router.url.includes('/search');
}
isItemExpanded() {
if (this.isRouteAbout() || this.isRouteProfile() || this.isRouteSearch()) {
return !this.hasActiveLinks();
} else {
return this.hasActiveLinks();
}
}
ngOnInit() { ngOnInit() {
this.hasActiveChildren = this.hasActiveLinks(); this.hasActiveChildren = this.hasActiveLinks();

View File

@@ -1,8 +1,10 @@
<div class="app-profile-container"> <div class="app-profile-container">
<div class="app-profile-row"> <div class="app-profile-row">
<div class="app-profile-title"> <div class="app-profile-title">
<mat-icon class="app-profile-icon" [routerLink]="landingPage">arrow_back</mat-icon> <button mat-icon-button [routerLink]="landingPage">
<h3 class="app-profile">{{'APP.EDIT_PROFILE.MY_PROFILE' | translate}}</h3> <mat-icon class="app-profile-icon">arrow_back</mat-icon>
</button>
<h1 class="app-profile">{{'APP.EDIT_PROFILE.MY_PROFILE' | translate}}</h1>
</div> </div>
</div> </div>
<div class="app-profile-general-row" [formGroup]="profileForm"> <div class="app-profile-general-row" [formGroup]="profileForm">

View File

@@ -64,7 +64,8 @@ export class AppService {
toggleAppNavBar$ = new Subject(); toggleAppNavBar$ = new Subject();
hideSidenavConditions = ['/preview/']; hideSidenavConditions = ['/preview/'];
minimizeSidenavConditions = ['search']; minimizeSidenavConditions = ['search', 'about', 'profile'];
onDestroy$ = new Subject<boolean>(); onDestroy$ = new Subject<boolean>();
/** /**