mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
Optmise injections and imports (#3174)
* cleanup base page injections * optimise breakpoint observer * cleanup subscriptions * optimise upload service injections * optimise router imports * fix test setup * fix tests
This commit is contained in:
@@ -22,43 +22,20 @@
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { AppStore, getUserProfile } from '@alfresco/aca-shared/store';
|
||||
import { DocumentListPresetRef, ProfileState } from '@alfresco/adf-extensions';
|
||||
import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout';
|
||||
import { getUserProfile } from '@alfresco/aca-shared/store';
|
||||
import { DocumentListPresetRef } from '@alfresco/adf-extensions';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { Observable } from 'rxjs';
|
||||
import { ContentManagementService } from '../../services/content-management.service';
|
||||
import { AppExtensionService, PageComponent } from '@alfresco/aca-shared';
|
||||
import { PageComponent } from '@alfresco/aca-shared';
|
||||
|
||||
@Component({
|
||||
templateUrl: './trashcan.component.html'
|
||||
})
|
||||
export class TrashcanComponent extends PageComponent implements OnInit {
|
||||
isSmallScreen = false;
|
||||
user$: Observable<ProfileState>;
|
||||
|
||||
user$ = this.store.select(getUserProfile);
|
||||
columns: DocumentListPresetRef[] = [];
|
||||
|
||||
constructor(
|
||||
content: ContentManagementService,
|
||||
extensions: AppExtensionService,
|
||||
store: Store<AppStore>,
|
||||
private breakpointObserver: BreakpointObserver
|
||||
) {
|
||||
super(store, extensions, content);
|
||||
this.user$ = this.store.select(getUserProfile);
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
super.ngOnInit();
|
||||
|
||||
this.subscriptions.push(
|
||||
this.breakpointObserver.observe([Breakpoints.HandsetPortrait, Breakpoints.HandsetLandscape]).subscribe((result) => {
|
||||
this.isSmallScreen = result.matches;
|
||||
})
|
||||
);
|
||||
|
||||
this.columns = this.extensions.documentListPresets.trashcan || [];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user