mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-10-01 14:41:14 +00:00
cleanup code, back buttons for about and profile
This commit is contained in:
committed by
Sheena Malhotra
parent
b1c794c5d1
commit
f3bfe720a1
@@ -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>
|
||||||
|
|
||||||
|
@@ -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 {
|
||||||
|
@@ -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'])]
|
||||||
})
|
})
|
||||||
|
@@ -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"
|
||||||
|
@@ -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();
|
||||||
|
|
||||||
|
@@ -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">
|
||||||
|
@@ -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>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user