mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-09-17 14:21:14 +00:00
proper toggle of the side menu
This commit is contained in:
committed by
Sheena Malhotra
parent
475c4f401a
commit
b915f3e750
@@ -43,7 +43,7 @@ import {
|
|||||||
LibraryStatusColumnComponent,
|
LibraryStatusColumnComponent,
|
||||||
TrashcanNameColumnComponent
|
TrashcanNameColumnComponent
|
||||||
} from '@alfresco/adf-content-services';
|
} from '@alfresco/adf-content-services';
|
||||||
import { DocumentBasePageService, ExtensionsDataLoaderGuard, RouterExtensionService, SharedModule } from '@alfresco/aca-shared';
|
import { DocumentBasePageService, ExtensionsDataLoaderGuard, PageLayoutModule, RouterExtensionService, SharedModule } from '@alfresco/aca-shared';
|
||||||
import * as rules from '@alfresco/aca-shared/rules';
|
import * as rules from '@alfresco/aca-shared/rules';
|
||||||
|
|
||||||
import { FilesComponent } from './components/files/files.component';
|
import { FilesComponent } from './components/files/files.component';
|
||||||
@@ -62,11 +62,9 @@ import { AppToolbarModule } from './components/toolbar/toolbar.module';
|
|||||||
import { AppCreateMenuModule } from './components/create-menu/create-menu.module';
|
import { AppCreateMenuModule } from './components/create-menu/create-menu.module';
|
||||||
import { AppSidenavModule } from './components/sidenav/sidenav.module';
|
import { AppSidenavModule } from './components/sidenav/sidenav.module';
|
||||||
import { AppCommonModule } from './components/common/common.module';
|
import { AppCommonModule } from './components/common/common.module';
|
||||||
import { AppLayoutModule } from './components/layout/layout.module';
|
|
||||||
import { AppSearchInputModule } from './components/search/search-input.module';
|
import { AppSearchInputModule } from './components/search/search-input.module';
|
||||||
import { DocumentListCustomComponentsModule } from './components/dl-custom-components/document-list-custom-components.module';
|
import { DocumentListCustomComponentsModule } from './components/dl-custom-components/document-list-custom-components.module';
|
||||||
import { AppSearchResultsModule } from './components/search/search-results.module';
|
import { AppSearchResultsModule } from './components/search/search-results.module';
|
||||||
import { AppHeaderModule } from './components/header/header.module';
|
|
||||||
import { AppNodeVersionModule } from './components/node-version/node-version.module';
|
import { AppNodeVersionModule } from './components/node-version/node-version.module';
|
||||||
import { FavoritesComponent } from './components/favorites/favorites.component';
|
import { FavoritesComponent } from './components/favorites/favorites.component';
|
||||||
import { RecentFilesComponent } from './components/recent-files/recent-files.component';
|
import { RecentFilesComponent } from './components/recent-files/recent-files.component';
|
||||||
@@ -97,7 +95,6 @@ import { LocationLinkComponent } from './components/common/location-link/locatio
|
|||||||
import { LogoutComponent } from './components/common/logout/logout.component';
|
import { LogoutComponent } from './components/common/logout/logout.component';
|
||||||
import { ToggleSharedComponent } from './components/common/toggle-shared/toggle-shared.component';
|
import { ToggleSharedComponent } from './components/common/toggle-shared/toggle-shared.component';
|
||||||
import { CustomNameColumnComponent } from './components/dl-custom-components/name-column/name-column.component';
|
import { CustomNameColumnComponent } from './components/dl-custom-components/name-column/name-column.component';
|
||||||
import { AppHeaderComponent } from './components/header/header.component';
|
|
||||||
import { CommentsTabComponent } from './components/info-drawer/comments-tab/comments-tab.component';
|
import { CommentsTabComponent } from './components/info-drawer/comments-tab/comments-tab.component';
|
||||||
import { LibraryMetadataTabComponent } from './components/info-drawer/library-metadata-tab/library-metadata-tab.component';
|
import { LibraryMetadataTabComponent } from './components/info-drawer/library-metadata-tab/library-metadata-tab.component';
|
||||||
import { MetadataTabComponent } from './components/info-drawer/metadata-tab/metadata-tab.component';
|
import { MetadataTabComponent } from './components/info-drawer/metadata-tab/metadata-tab.component';
|
||||||
@@ -114,14 +111,14 @@ import { ViewNodeComponent } from './components/toolbar/view-node/view-node.comp
|
|||||||
import { CONTENT_ROUTES } from './aca-content.routes';
|
import { CONTENT_ROUTES } from './aca-content.routes';
|
||||||
import { RouterModule } from '@angular/router';
|
import { RouterModule } from '@angular/router';
|
||||||
import { UploadFilesDialogComponent } from './components/upload-files-dialog/upload-files-dialog.component';
|
import { UploadFilesDialogComponent } from './components/upload-files-dialog/upload-files-dialog.component';
|
||||||
import { SidenavWrapperComponent } from './components/sidenav/sidenav-wrapper/sidenav-wrapper.component';
|
|
||||||
import { AppLayoutComponent } from './components/layout/app-layout/app-layout.component';
|
|
||||||
import { AppTrashcanModule } from './components/trashcan/trashcan.module';
|
import { AppTrashcanModule } from './components/trashcan/trashcan.module';
|
||||||
import { AppSharedLinkViewModule } from './components/shared-link-view/shared-link-view.module';
|
import { AppSharedLinkViewModule } from './components/shared-link-view/shared-link-view.module';
|
||||||
import { AcaFolderRulesModule } from '@alfresco/aca-folder-rules';
|
import { AcaFolderRulesModule } from '@alfresco/aca-folder-rules';
|
||||||
import { TagsColumnComponent } from './components/dl-custom-components/tags-column/tags-column.component';
|
import { TagsColumnComponent } from './components/dl-custom-components/tags-column/tags-column.component';
|
||||||
import { ContentManagementService } from './services/content-management.service';
|
|
||||||
import { UserInfoComponent } from './components/common/user-info/user-info.component';
|
import { UserInfoComponent } from './components/common/user-info/user-info.component';
|
||||||
|
import { SidenavComponent } from './components/sidenav/sidenav.component';
|
||||||
|
import { ContentManagementService } from './services/content-management.service';
|
||||||
|
import { ShellLayoutComponent, SHELL_NAVBAR_MIN_WIDTH } from '@alfresco/adf-core/shell';
|
||||||
|
|
||||||
registerLocaleData(localeFr);
|
registerLocaleData(localeFr);
|
||||||
registerLocaleData(localeDe);
|
registerLocaleData(localeDe);
|
||||||
@@ -154,7 +151,7 @@ registerLocaleData(localeSv);
|
|||||||
MaterialModule,
|
MaterialModule,
|
||||||
AppStoreModule,
|
AppStoreModule,
|
||||||
AppCommonModule,
|
AppCommonModule,
|
||||||
AppLayoutModule,
|
PageLayoutModule,
|
||||||
DirectivesModule,
|
DirectivesModule,
|
||||||
ContextMenuModule,
|
ContextMenuModule,
|
||||||
AppInfoDrawerModule,
|
AppInfoDrawerModule,
|
||||||
@@ -164,7 +161,6 @@ registerLocaleData(localeSv);
|
|||||||
DocumentListCustomComponentsModule,
|
DocumentListCustomComponentsModule,
|
||||||
AppSearchInputModule,
|
AppSearchInputModule,
|
||||||
AppSearchResultsModule,
|
AppSearchResultsModule,
|
||||||
AppHeaderModule,
|
|
||||||
AppNodeVersionModule,
|
AppNodeVersionModule,
|
||||||
HammerModule,
|
HammerModule,
|
||||||
ViewProfileModule,
|
ViewProfileModule,
|
||||||
@@ -195,7 +191,8 @@ registerLocaleData(localeSv);
|
|||||||
name: 'app',
|
name: 'app',
|
||||||
source: 'assets'
|
source: 'assets'
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
{ provide: SHELL_NAVBAR_MIN_WIDTH, useValue: 0 }
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class ContentServiceExtensionModule {
|
export class ContentServiceExtensionModule {
|
||||||
@@ -206,9 +203,8 @@ export class ContentServiceExtensionModule {
|
|||||||
});
|
});
|
||||||
|
|
||||||
extensions.setComponents({
|
extensions.setComponents({
|
||||||
'app.layout.main': AppLayoutComponent,
|
'app.layout.main': ShellLayoutComponent,
|
||||||
'app.layout.header': AppHeaderComponent,
|
'app.layout.sidenav': SidenavComponent,
|
||||||
'app.layout.sidenav': SidenavWrapperComponent,
|
|
||||||
'app.shell.sibling': UploadFilesDialogComponent,
|
'app.shell.sibling': UploadFilesDialogComponent,
|
||||||
'app.components.tabs.metadata': MetadataTabComponent,
|
'app.components.tabs.metadata': MetadataTabComponent,
|
||||||
'app.components.tabs.library.metadata': LibraryMetadataTabComponent,
|
'app.components.tabs.library.metadata': LibraryMetadataTabComponent,
|
||||||
@@ -301,7 +297,10 @@ export class ContentServiceExtensionModule {
|
|||||||
'repository.isQuickShareEnabled': rules.hasQuickShareEnabled,
|
'repository.isQuickShareEnabled': rules.hasQuickShareEnabled,
|
||||||
'user.isAdmin': rules.isAdmin,
|
'user.isAdmin': rules.isAdmin,
|
||||||
'app.canShowLogout': rules.canShowLogout,
|
'app.canShowLogout': rules.canShowLogout,
|
||||||
'app.isContentServiceEnabled': rules.isContentServiceEnabled
|
'app.isContentServiceEnabled': rules.isContentServiceEnabled,
|
||||||
|
'app.isUploadSupported': rules.isUploadSupported,
|
||||||
|
'app.canCreateLibrary': rules.canCreateLibrary,
|
||||||
|
'app.isSearchSupported': rules.isSearchSupported
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,18 @@
|
|||||||
|
<adf-layout-header
|
||||||
|
[logo]="logo$ | async"
|
||||||
|
[redirectUrl]="landingPage"
|
||||||
|
[tooltip]="appName$ | async"
|
||||||
|
[title]="appName$ | async"
|
||||||
|
(clicked)="onToggleSidenav($event)"
|
||||||
|
[expandedSidenav]="isSidenavExpanded"
|
||||||
|
>
|
||||||
|
<div class="adf-toolbar--spacer adf-toolbar-divider"></div>
|
||||||
|
|
||||||
|
<aca-search-input *ngIf="isContentServiceEnabled()"></aca-search-input>
|
||||||
|
|
||||||
|
<adf-toolbar-divider></adf-toolbar-divider>
|
||||||
|
|
||||||
|
<ng-container *ngFor="let actionRef of actions; trackBy: trackByActionId">
|
||||||
|
<aca-toolbar-action [actionRef]="actionRef"> </aca-toolbar-action>
|
||||||
|
</ng-container>
|
||||||
|
</adf-layout-header>
|
||||||
|
@@ -33,6 +33,7 @@ import { takeUntil } from 'rxjs/operators';
|
|||||||
import { AppConfigService, SidenavLayoutComponent } from '@alfresco/adf-core';
|
import { AppConfigService, SidenavLayoutComponent } from '@alfresco/adf-core';
|
||||||
import { isContentServiceEnabled } from '@alfresco/aca-shared/rules';
|
import { isContentServiceEnabled } from '@alfresco/aca-shared/rules';
|
||||||
|
|
||||||
|
/** @deprecated */
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-header',
|
selector: 'app-header',
|
||||||
templateUrl: './header.component.html',
|
templateUrl: './header.component.html',
|
||||||
|
@@ -24,7 +24,7 @@
|
|||||||
<adf-sidenav-layout-navigation>
|
<adf-sidenav-layout-navigation>
|
||||||
<ng-template let-isMenuMinimized="isMenuMinimized">
|
<ng-template let-isMenuMinimized="isMenuMinimized">
|
||||||
<app-sidenav
|
<app-sidenav
|
||||||
[mode]="isMenuMinimized() ? 'collapsed' : 'expanded'"
|
[data]="{ layout, mode: layout.isMenuMinimized ? 'collapsed' : 'expanded'}"
|
||||||
[attr.data-automation-id]="isMenuMinimized() ? 'collapsed' : 'expanded'"
|
[attr.data-automation-id]="isMenuMinimized() ? 'collapsed' : 'expanded'"
|
||||||
(swipeleft)="hideMenu($event)"
|
(swipeleft)="hideMenu($event)"
|
||||||
>
|
>
|
||||||
|
@@ -26,6 +26,7 @@
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { CoreModule } from '@alfresco/adf-core';
|
import { CoreModule } from '@alfresco/adf-core';
|
||||||
|
import { SHELL_NAVBAR_MIN_WIDTH } from '@alfresco/adf-core/shell';
|
||||||
import { AppLayoutComponent } from './app-layout/app-layout.component';
|
import { AppLayoutComponent } from './app-layout/app-layout.component';
|
||||||
import { ContentModule } from '@alfresco/adf-content-services';
|
import { ContentModule } from '@alfresco/adf-content-services';
|
||||||
import { RouterModule } from '@angular/router';
|
import { RouterModule } from '@angular/router';
|
||||||
@@ -48,6 +49,7 @@ import { PageLayoutModule } from '@alfresco/aca-shared';
|
|||||||
PageLayoutModule
|
PageLayoutModule
|
||||||
],
|
],
|
||||||
declarations: [AppLayoutComponent],
|
declarations: [AppLayoutComponent],
|
||||||
exports: [AppLayoutComponent, PageLayoutModule]
|
exports: [AppLayoutComponent, PageLayoutModule],
|
||||||
|
providers: [{ provide: SHELL_NAVBAR_MIN_WIDTH, useValue: 0 }]
|
||||||
})
|
})
|
||||||
export class AppLayoutModule {}
|
export class AppLayoutModule {}
|
||||||
|
@@ -1,3 +0,0 @@
|
|||||||
<app-sidenav
|
|
||||||
[mode]="data.mode"
|
|
||||||
></app-sidenav>
|
|
@@ -1,39 +0,0 @@
|
|||||||
/*!
|
|
||||||
* @license
|
|
||||||
* Alfresco Example Content Application
|
|
||||||
*
|
|
||||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
|
||||||
*
|
|
||||||
* This file is part of the Alfresco Example Content Application.
|
|
||||||
* If the software was purchased under a paid Alfresco license, the terms of
|
|
||||||
* the paid license agreement will prevail. Otherwise, the software is
|
|
||||||
* provided under the following open source license terms:
|
|
||||||
*
|
|
||||||
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public License
|
|
||||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { Component, Input } from '@angular/core';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This wrapper is designated to be used with 'adf-dynamic-component'.
|
|
||||||
* It forwards the dynamic component inputs to original sidenav.
|
|
||||||
*/
|
|
||||||
@Component({
|
|
||||||
selector: 'aca-sidenav-wrapper',
|
|
||||||
templateUrl: './sidenav-wrapper.component.html'
|
|
||||||
})
|
|
||||||
export class SidenavWrapperComponent {
|
|
||||||
@Input()
|
|
||||||
data: { mode?: 'collapsed' | 'expanded' } = {};
|
|
||||||
}
|
|
@@ -1,5 +1,5 @@
|
|||||||
<div class="sidenav" *ngIf="!hideSidenav">
|
<div class="sidenav">
|
||||||
<ng-container [ngSwitch]="mode">
|
<ng-container [ngSwitch]="data.mode">
|
||||||
<div class="sidenav-header">
|
<div class="sidenav-header">
|
||||||
<div class="sidenav-header-title">
|
<div class="sidenav-header-title">
|
||||||
<div class="sidenav-header-title-logo" (click)="toggleClick()" (keypress)="toggleClick()">
|
<div class="sidenav-header-title-logo" (click)="toggleClick()" (keypress)="toggleClick()">
|
||||||
@@ -16,8 +16,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="section-sub-actions">
|
<div class="section-sub-actions">
|
||||||
<div *ngFor="let group of groups; trackBy: trackByGroupId" class="section" [ngClass]="'section--' + mode">
|
<div *ngFor="let group of groups; trackBy: trackByGroupId" class="section" [ngClass]="'section--' + data.mode">
|
||||||
<ng-container *ngSwitchCase="'expanded'">
|
<ng-container *ngSwitchCase="'expanded'">
|
||||||
<mat-list-item *ngFor="let item of group.items; trackBy: trackByLinkId">
|
<mat-list-item *ngFor="let item of group.items; trackBy: trackByLinkId">
|
||||||
<ng-container *ngIf="!item.component">
|
<ng-container *ngIf="!item.component">
|
||||||
|
@@ -30,6 +30,7 @@ import { AppStore, getSideNavState } from '@alfresco/aca-shared/store';
|
|||||||
import { Subject } from 'rxjs';
|
import { Subject } from 'rxjs';
|
||||||
import { takeUntil, distinctUntilChanged, debounceTime } from 'rxjs/operators';
|
import { takeUntil, distinctUntilChanged, debounceTime } from 'rxjs/operators';
|
||||||
import { AppExtensionService, AppService } from '@alfresco/aca-shared';
|
import { AppExtensionService, AppService } from '@alfresco/aca-shared';
|
||||||
|
import { SidenavLayoutComponent } from '@alfresco/adf-core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-sidenav',
|
selector: 'app-sidenav',
|
||||||
@@ -40,13 +41,15 @@ import { AppExtensionService, AppService } from '@alfresco/aca-shared';
|
|||||||
})
|
})
|
||||||
export class SidenavComponent implements OnInit, OnDestroy {
|
export class SidenavComponent implements OnInit, OnDestroy {
|
||||||
@Input()
|
@Input()
|
||||||
mode: 'collapsed' | 'expanded' = 'expanded';
|
data: {
|
||||||
hideSidenav: boolean;
|
layout?: SidenavLayoutComponent;
|
||||||
|
mode?: 'collapsed' | 'expanded';
|
||||||
|
} = {};
|
||||||
|
|
||||||
groups: Array<NavBarGroupRef> = [];
|
groups: Array<NavBarGroupRef> = [];
|
||||||
private onDestroy$ = new Subject<boolean>();
|
private onDestroy$ = new Subject<boolean>();
|
||||||
|
|
||||||
constructor(private store: Store<AppStore>, private extensions: AppExtensionService, private appServices: AppService) {}
|
constructor(private store: Store<AppStore>, private extensions: AppExtensionService, private appService: AppService) {}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.store
|
this.store
|
||||||
@@ -55,7 +58,9 @@ export class SidenavComponent implements OnInit, OnDestroy {
|
|||||||
.subscribe(() => {
|
.subscribe(() => {
|
||||||
this.groups = this.extensions.getApplicationNavigation(this.extensions.navbar);
|
this.groups = this.extensions.getApplicationNavigation(this.extensions.navbar);
|
||||||
});
|
});
|
||||||
this.appServices.cast.subscribe((data) => (this.hideSidenav = data));
|
|
||||||
|
this.appService.appNavNarMode$.next(this.data.mode);
|
||||||
|
this.appService.toggleAppNavBar$.pipe(takeUntil(this.onDestroy$)).subscribe(() => this.toggleNavBar());
|
||||||
}
|
}
|
||||||
|
|
||||||
trackByGroupId(_: number, obj: NavBarGroupRef): string {
|
trackByGroupId(_: number, obj: NavBarGroupRef): string {
|
||||||
@@ -67,8 +72,12 @@ export class SidenavComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
toggleClick() {
|
toggleClick() {
|
||||||
this.hideSidenav = !this.hideSidenav;
|
this.toggleNavBar();
|
||||||
this.appServices.getSidenavValue(this.hideSidenav);
|
}
|
||||||
|
|
||||||
|
private toggleNavBar() {
|
||||||
|
this.data.layout.toggleMenu();
|
||||||
|
this.appService.appNavNarMode$.next(this.data.layout.isMenuMinimized ? 'collapsed' : 'expanded');
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy() {
|
ngOnDestroy() {
|
||||||
|
@@ -38,7 +38,6 @@ import { ExpandMenuComponent } from './components/expand-menu.component';
|
|||||||
import { ButtonMenuComponent } from './components/button-menu.component';
|
import { ButtonMenuComponent } from './components/button-menu.component';
|
||||||
import { ActionDirective } from './directives/action.directive';
|
import { ActionDirective } from './directives/action.directive';
|
||||||
import { MainActionModule } from '../main-action/main-action.module';
|
import { MainActionModule } from '../main-action/main-action.module';
|
||||||
import { SidenavWrapperComponent } from './sidenav-wrapper/sidenav-wrapper.component';
|
|
||||||
import { NavigationMenuComponent } from './navigation-menu/navigation-menu.component';
|
import { NavigationMenuComponent } from './navigation-menu/navigation-menu.component';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
@@ -59,7 +58,6 @@ import { NavigationMenuComponent } from './navigation-menu/navigation-menu.compo
|
|||||||
ExpandMenuComponent,
|
ExpandMenuComponent,
|
||||||
ButtonMenuComponent,
|
ButtonMenuComponent,
|
||||||
SidenavComponent,
|
SidenavComponent,
|
||||||
SidenavWrapperComponent,
|
|
||||||
NavigationMenuComponent
|
NavigationMenuComponent
|
||||||
],
|
],
|
||||||
exports: [
|
exports: [
|
||||||
|
@@ -11,7 +11,6 @@ import { Component, OnInit, ViewEncapsulation } from '@angular/core';
|
|||||||
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { throwError } from 'rxjs';
|
import { throwError } from 'rxjs';
|
||||||
import { AppService } from '@alfresco/aca-shared';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-view-profile',
|
selector: 'app-view-profile',
|
||||||
@@ -36,7 +35,7 @@ export class ViewProfileComponent implements OnInit {
|
|||||||
contactSectionButtonsToggle = true;
|
contactSectionButtonsToggle = true;
|
||||||
hideSidenav: boolean;
|
hideSidenav: boolean;
|
||||||
|
|
||||||
constructor(private router: Router, apiService: AlfrescoApiService, private appService: AppService) {
|
constructor(private router: Router, apiService: AlfrescoApiService) {
|
||||||
this.peopleApi = new PeopleApi(apiService.getInstance());
|
this.peopleApi = new PeopleApi(apiService.getInstance());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,7 +50,6 @@ export class ViewProfileComponent implements OnInit {
|
|||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
throwError(error);
|
throwError(error);
|
||||||
});
|
});
|
||||||
this.appService.cast.subscribe((data) => (this.hideSidenav = data));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
populateForm(userInfo: Person) {
|
populateForm(userInfo: Person) {
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
<div class="aca-content-container">
|
<div class="aca-content-container">
|
||||||
<div class="aca-content-header">
|
<div class="aca-content-header">
|
||||||
<div class="aca-menu-icon" [ngClass]="{'aca-menu-hidden' : !hideSidenav}" (click)="toggleClick()" (keypress)="toggleClick()">
|
<div *ngIf="(appNavNarMode$ | async) === 'collapsed'" class="aca-menu-icon" (click)="toggleClick()" (keypress)="toggleClick()">
|
||||||
<mat-icon title="{{'APP.TOOLTIPS.EXPAND_NAVIGATION' | translate}}">menu</mat-icon>
|
<mat-icon title="{{'APP.TOOLTIPS.EXPAND_NAVIGATION' | translate}}">menu</mat-icon>
|
||||||
</div>
|
</div>
|
||||||
<ng-content select="aca-page-layout-header"></ng-content>
|
<ng-content select="aca-page-layout-header"></ng-content>
|
||||||
|
@@ -29,10 +29,6 @@
|
|||||||
margin-top: 2px;
|
margin-top: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.aca-menu-hidden {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.aca-page-layout-header {
|
.aca-page-layout-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
@@ -23,7 +23,9 @@
|
|||||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Component, ViewEncapsulation, ChangeDetectionStrategy, Input, ChangeDetectorRef } from '@angular/core';
|
import { Component, ViewEncapsulation, Input, OnDestroy } from '@angular/core';
|
||||||
|
import { Observable, Subject } from 'rxjs';
|
||||||
|
import { takeUntil } from 'rxjs/operators';
|
||||||
import { AppService } from '../../services/app.service';
|
import { AppService } from '../../services/app.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -31,26 +33,25 @@ import { AppService } from '../../services/app.service';
|
|||||||
templateUrl: './page-layout.component.html',
|
templateUrl: './page-layout.component.html',
|
||||||
styleUrls: ['./page-layout.component.scss'],
|
styleUrls: ['./page-layout.component.scss'],
|
||||||
encapsulation: ViewEncapsulation.None,
|
encapsulation: ViewEncapsulation.None,
|
||||||
host: { class: 'aca-page-layout' },
|
host: { class: 'aca-page-layout' }
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush
|
|
||||||
})
|
})
|
||||||
export class PageLayoutComponent {
|
export class PageLayoutComponent implements OnDestroy {
|
||||||
@Input()
|
@Input()
|
||||||
hasError = false;
|
hasError = false;
|
||||||
hideSidenav: boolean;
|
|
||||||
|
|
||||||
constructor(private appService: AppService, private ref: ChangeDetectorRef) {
|
private onDestroy$ = new Subject<boolean>();
|
||||||
setInterval(() => {
|
appNavNarMode$: Observable<'collapsed' | 'expanded'>;
|
||||||
this.ref.detectChanges();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
ngOnInit() {
|
constructor(private appService: AppService) {
|
||||||
this.appService.cast.subscribe((data) => (this.hideSidenav = data));
|
this.appNavNarMode$ = appService.appNavNarMode$.pipe(takeUntil(this.onDestroy$));
|
||||||
}
|
}
|
||||||
|
|
||||||
toggleClick() {
|
toggleClick() {
|
||||||
this.hideSidenav = !this.hideSidenav;
|
this.appService.toggleAppNavBar$.next();
|
||||||
this.appService.getSidenavValue(this.hideSidenav);
|
}
|
||||||
|
|
||||||
|
ngOnDestroy() {
|
||||||
|
this.onDestroy$.next(true);
|
||||||
|
this.onDestroy$.complete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -58,11 +58,11 @@ export class AppService {
|
|||||||
private ready: BehaviorSubject<boolean>;
|
private ready: BehaviorSubject<boolean>;
|
||||||
ready$: Observable<boolean>;
|
ready$: Observable<boolean>;
|
||||||
|
|
||||||
public hideSidenav = new BehaviorSubject<boolean>(false);
|
|
||||||
cast = this.hideSidenav.asObservable();
|
|
||||||
|
|
||||||
pageHeading$: Observable<string>;
|
pageHeading$: Observable<string>;
|
||||||
|
|
||||||
|
appNavNarMode$: Subject<'collapsed' | 'expanded'> = new BehaviorSubject('expanded');
|
||||||
|
toggleAppNavBar$ = new Subject();
|
||||||
|
|
||||||
hideSidenavConditions = ['/preview/'];
|
hideSidenavConditions = ['/preview/'];
|
||||||
minimizeSidenavConditions = ['search'];
|
minimizeSidenavConditions = ['search'];
|
||||||
onDestroy$ = new Subject<boolean>();
|
onDestroy$ = new Subject<boolean>();
|
||||||
|
Reference in New Issue
Block a user