import { AppStore , NavigateLibraryAction } from '@alfresco/aca-shared/store' ; import { SiteEntry } from '@alfresco/js-api' ; import { BreakpointObserver , Breakpoints } from '@angular/cdk/layout' ; import { Component , OnInit } from '@angular/core' ; import { Store } from '@ngrx/store' ; import { ContentManagementService } from '../../services/content-management.service' ; import { PageComponent } from '../page.component' ; import { AppExtensionService , AppHookService } from '@alfresco/aca-shared' ; import { DocumentListPresetRef } from '@alfresco/adf-extensions' ; @ Component ( { templateUrl : './libraries.component.html' } ) export class LibrariesComponent extends PageComponent implements OnInit { isSmallScreen = false ; columns : DocumentListPresetRef [ ] = [ ] ; constructor ( content , store , extensions , private appHookService , private breakpointObserver ) { super ( store , extensions , content ) ; } ngOnInit ( ) { super . ngOnInit ( ) ; this . subscriptions . push ( this . appHookService . libraryDeleted . subscribe ( ( ) => this . reload ( ) ) , this . appHookService . libraryUpdated . subscribe ( ( ) => this . reload ( ) ) , this . appHookService . libraryLeft . subscribe ( ( ) => this . reload ( ) ) , this . breakpointObserver . observe ( [ Breakpoints . HandsetPortrait , Breakpoints . HandsetLandscape ] ) . subscribe ( ( result ) => { this . isSmallScreen = result . matches ; } ) ) ; this . columns = this . extensions . documentListPresets . libraries || [ ] ; } navigateTo ( node ) { if ( node && node . entry && node . entry . guid ) { this . store . dispatch ( new NavigateLibraryAction ( node . entry . guid ) ) ; } } handleNodeClick ( event ) { this . navigateTo ( ( event as CustomEvent ) . detail ?. node ) ; } }