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:
@@ -24,10 +24,8 @@
|
||||
|
||||
import { Component, OnInit, ViewEncapsulation, OnDestroy } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { AppExtensionService, ContentApiService, PageComponent } from '@alfresco/aca-shared';
|
||||
import { AppStore, NavigateToPreviousPage, SetSelectedNodesAction } from '@alfresco/aca-shared/store';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { ContentManagementService } from '../../services/content-management.service';
|
||||
import { ContentApiService, PageComponent } from '@alfresco/aca-shared';
|
||||
import { NavigateToPreviousPage, SetSelectedNodesAction } from '@alfresco/aca-shared/store';
|
||||
import { Subject } from 'rxjs';
|
||||
|
||||
@Component({
|
||||
@@ -42,14 +40,8 @@ export class DetailsComponent extends PageComponent implements OnInit, OnDestroy
|
||||
onDestroy$ = new Subject<boolean>();
|
||||
activeTab = 1;
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private contentApi: ContentApiService,
|
||||
store: Store<AppStore>,
|
||||
content: ContentManagementService,
|
||||
extensions: AppExtensionService
|
||||
) {
|
||||
super(store, extensions, content);
|
||||
constructor(private route: ActivatedRoute, private contentApi: ContentApiService) {
|
||||
super();
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
|
@@ -22,12 +22,9 @@
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout';
|
||||
import { Component, OnInit, ChangeDetectorRef } from '@angular/core';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { SiteEntry, FavoritePaging, Pagination } from '@alfresco/js-api';
|
||||
import { ContentManagementService } from '../../services/content-management.service';
|
||||
import { AppExtensionService, AppHookService, ContentApiService, PageComponent } from '@alfresco/aca-shared';
|
||||
import { AppHookService, ContentApiService, PageComponent } from '@alfresco/aca-shared';
|
||||
import { NavigateLibraryAction } from '@alfresco/aca-shared/store';
|
||||
import { UserPreferencesService } from '@alfresco/adf-core';
|
||||
import { DocumentListPresetRef } from '@alfresco/adf-extensions';
|
||||
@@ -43,20 +40,15 @@ export class FavoriteLibrariesComponent extends PageComponent implements OnInit
|
||||
});
|
||||
isLoading = false;
|
||||
list: FavoritePaging;
|
||||
isSmallScreen = false;
|
||||
columns: DocumentListPresetRef[] = [];
|
||||
|
||||
constructor(
|
||||
content: ContentManagementService,
|
||||
store: Store<any>,
|
||||
extensions: AppExtensionService,
|
||||
private appHookService: AppHookService,
|
||||
private contentApiService: ContentApiService,
|
||||
private breakpointObserver: BreakpointObserver,
|
||||
private preferences: UserPreferencesService,
|
||||
private changeDetectorRef: ChangeDetectorRef
|
||||
) {
|
||||
super(store, extensions, content);
|
||||
super();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -69,11 +61,7 @@ export class FavoriteLibrariesComponent extends PageComponent implements OnInit
|
||||
this.appHookService.libraryUpdated.subscribe(() => this.reloadList()),
|
||||
this.appHookService.libraryJoined.subscribe(() => this.reloadList()),
|
||||
this.appHookService.libraryLeft.subscribe(() => this.reloadList()),
|
||||
this.appHookService.favoriteLibraryToggle.subscribe(() => this.reloadList()),
|
||||
|
||||
this.breakpointObserver.observe([Breakpoints.HandsetPortrait, Breakpoints.HandsetLandscape]).subscribe((result) => {
|
||||
this.isSmallScreen = result.matches;
|
||||
})
|
||||
this.appHookService.favoriteLibraryToggle.subscribe(() => this.reloadList())
|
||||
]);
|
||||
this.columns = this.extensions.documentListPresets.favoriteLibraries || [];
|
||||
}
|
||||
|
@@ -22,49 +22,28 @@
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { AcaFileAutoDownloadService, AppExtensionService, ContentApiService, PageComponent } from '@alfresco/aca-shared';
|
||||
import { AppStore } from '@alfresco/aca-shared/store';
|
||||
import { UploadService } from '@alfresco/adf-content-services';
|
||||
import { ContentApiService, PageComponent } from '@alfresco/aca-shared';
|
||||
import { MinimalNodeEntity, MinimalNodeEntryEntity, PathElementEntity, PathInfo } from '@alfresco/js-api';
|
||||
import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { debounceTime, map } from 'rxjs/operators';
|
||||
import { ContentManagementService } from '../../services/content-management.service';
|
||||
import { DocumentListPresetRef } from '@alfresco/adf-extensions';
|
||||
|
||||
@Component({
|
||||
templateUrl: './favorites.component.html'
|
||||
})
|
||||
export class FavoritesComponent extends PageComponent implements OnInit {
|
||||
isSmallScreen = false;
|
||||
|
||||
columns: DocumentListPresetRef[] = [];
|
||||
|
||||
constructor(
|
||||
private router: Router,
|
||||
store: Store<AppStore>,
|
||||
extensions: AppExtensionService,
|
||||
private contentApi: ContentApiService,
|
||||
content: ContentManagementService,
|
||||
private uploadService: UploadService,
|
||||
private breakpointObserver: BreakpointObserver,
|
||||
fileAutoDownloadService: AcaFileAutoDownloadService
|
||||
) {
|
||||
super(store, extensions, content, fileAutoDownloadService);
|
||||
constructor(private contentApi: ContentApiService) {
|
||||
super();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
super.ngOnInit();
|
||||
|
||||
this.subscriptions = this.subscriptions.concat([
|
||||
this.uploadService.fileUploadComplete.pipe(debounceTime(300)).subscribe((_) => this.reload()),
|
||||
this.uploadService.fileUploadDeleted.pipe(debounceTime(300)).subscribe((_) => this.reload()),
|
||||
|
||||
this.breakpointObserver.observe([Breakpoints.HandsetPortrait, Breakpoints.HandsetLandscape]).subscribe((result) => {
|
||||
this.isSmallScreen = result.matches;
|
||||
})
|
||||
this.uploadService.fileUploadComplete.pipe(debounceTime(300)).subscribe(() => this.reload()),
|
||||
this.uploadService.fileUploadDeleted.pipe(debounceTime(300)).subscribe(() => this.reload())
|
||||
]);
|
||||
|
||||
this.columns = this.extensions.documentListPresets.favorites;
|
||||
|
@@ -24,63 +24,45 @@
|
||||
|
||||
import { ShowHeaderMode } from '@alfresco/adf-core';
|
||||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute, Params, Router } from '@angular/router';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { ActivatedRoute, Params } from '@angular/router';
|
||||
import { MinimalNodeEntity, MinimalNodeEntryEntity, PathElement, PathElementEntity } from '@alfresco/js-api';
|
||||
import { ContentManagementService } from '../../services/content-management.service';
|
||||
import { NodeActionsService } from '../../services/node-actions.service';
|
||||
import { AcaFileAutoDownloadService, AppExtensionService, ContentApiService, PageComponent } from '@alfresco/aca-shared';
|
||||
import { SetCurrentFolderAction, isAdmin, AppStore, UploadFileVersionAction, showLoaderSelector } from '@alfresco/aca-shared/store';
|
||||
import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout';
|
||||
import { ContentApiService, PageComponent } from '@alfresco/aca-shared';
|
||||
import { SetCurrentFolderAction, isAdmin, UploadFileVersionAction, showLoaderSelector } from '@alfresco/aca-shared/store';
|
||||
import { debounceTime, takeUntil } from 'rxjs/operators';
|
||||
import { FilterSearch, ShareDataRow, UploadService, FileUploadEvent } from '@alfresco/adf-content-services';
|
||||
import { FilterSearch, ShareDataRow, FileUploadEvent } from '@alfresco/adf-content-services';
|
||||
import { DocumentListPresetRef } from '@alfresco/adf-extensions';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
@Component({
|
||||
templateUrl: './files.component.html'
|
||||
})
|
||||
export class FilesComponent extends PageComponent implements OnInit, OnDestroy {
|
||||
isValidPath = true;
|
||||
isSmallScreen = false;
|
||||
isAdmin = false;
|
||||
selectedNode: MinimalNodeEntity;
|
||||
queryParams = null;
|
||||
|
||||
showLoader$: Observable<boolean>;
|
||||
showLoader$ = this.store.select(showLoaderSelector);
|
||||
private nodePath: PathElement[];
|
||||
|
||||
columns: DocumentListPresetRef[] = [];
|
||||
|
||||
constructor(
|
||||
private router: Router,
|
||||
private route: ActivatedRoute,
|
||||
private contentApi: ContentApiService,
|
||||
store: Store<AppStore>,
|
||||
private nodeActionsService: NodeActionsService,
|
||||
private uploadService: UploadService,
|
||||
content: ContentManagementService,
|
||||
extensions: AppExtensionService,
|
||||
private breakpointObserver: BreakpointObserver,
|
||||
fileAutoDownloadService: AcaFileAutoDownloadService
|
||||
) {
|
||||
super(store, extensions, content, fileAutoDownloadService);
|
||||
constructor(private route: ActivatedRoute, private contentApi: ContentApiService, private nodeActionsService: NodeActionsService) {
|
||||
super();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
super.ngOnInit();
|
||||
|
||||
const { route, nodeActionsService, uploadService } = this;
|
||||
const { data } = route.snapshot;
|
||||
const { data } = this.route.snapshot;
|
||||
|
||||
this.title = data.title;
|
||||
|
||||
this.showLoader$ = this.store.select(showLoaderSelector);
|
||||
route.queryParamMap.subscribe((queryMap: Params) => {
|
||||
this.route.queryParamMap.subscribe((queryMap: Params) => {
|
||||
this.queryParams = queryMap.params;
|
||||
});
|
||||
|
||||
route.params.subscribe(({ folderId }: Params) => {
|
||||
this.route.params.subscribe(({ folderId }: Params) => {
|
||||
const nodeId = folderId || data.defaultNodeId;
|
||||
|
||||
this.contentApi.getNode(nodeId).subscribe(
|
||||
@@ -100,13 +82,9 @@ export class FilesComponent extends PageComponent implements OnInit, OnDestroy {
|
||||
});
|
||||
|
||||
this.subscriptions = this.subscriptions.concat([
|
||||
nodeActionsService.contentCopied.subscribe((nodes) => this.onContentCopied(nodes)),
|
||||
uploadService.fileUploadComplete.pipe(debounceTime(300)).subscribe((file) => this.onFileUploadedEvent(file)),
|
||||
uploadService.fileUploadDeleted.pipe(debounceTime(300)).subscribe((file) => this.onFileUploadedEvent(file)),
|
||||
|
||||
this.breakpointObserver.observe([Breakpoints.HandsetPortrait, Breakpoints.HandsetLandscape]).subscribe((result) => {
|
||||
this.isSmallScreen = result.matches;
|
||||
})
|
||||
this.nodeActionsService.contentCopied.subscribe((nodes) => this.onContentCopied(nodes)),
|
||||
this.uploadService.fileUploadComplete.pipe(debounceTime(300)).subscribe((file) => this.onFileUploadedEvent(file)),
|
||||
this.uploadService.fileUploadDeleted.pipe(debounceTime(300)).subscribe((file) => this.onFileUploadedEvent(file))
|
||||
]);
|
||||
|
||||
this.store
|
||||
|
@@ -22,31 +22,20 @@
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { AppStore, NavigateLibraryAction } from '@alfresco/aca-shared/store';
|
||||
import { 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 { AppExtensionService, AppHookService, PageComponent } from '@alfresco/aca-shared';
|
||||
import { AppHookService, PageComponent } 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: ContentManagementService,
|
||||
store: Store<AppStore>,
|
||||
extensions: AppExtensionService,
|
||||
private appHookService: AppHookService,
|
||||
private breakpointObserver: BreakpointObserver
|
||||
) {
|
||||
super(store, extensions, content);
|
||||
constructor(private appHookService: AppHookService) {
|
||||
super();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -55,11 +44,7 @@ export class LibrariesComponent extends PageComponent implements OnInit {
|
||||
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.appHookService.libraryLeft.subscribe(() => this.reload())
|
||||
);
|
||||
|
||||
this.columns = this.extensions.documentListPresets.libraries || [];
|
||||
|
@@ -23,47 +23,27 @@
|
||||
*/
|
||||
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout';
|
||||
import { MinimalNodeEntity } from '@alfresco/js-api';
|
||||
import { ContentManagementService } from '../../services/content-management.service';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { AppStore } from '@alfresco/aca-shared/store';
|
||||
import { UploadService } from '@alfresco/adf-content-services';
|
||||
import { debounceTime } from 'rxjs/operators';
|
||||
import { Router } from '@angular/router';
|
||||
import { AcaFileAutoDownloadService, AppExtensionService, PageComponent } from '@alfresco/aca-shared';
|
||||
import { PageComponent } from '@alfresco/aca-shared';
|
||||
import { DocumentListPresetRef } from '@alfresco/adf-extensions';
|
||||
|
||||
@Component({
|
||||
templateUrl: './recent-files.component.html'
|
||||
})
|
||||
export class RecentFilesComponent extends PageComponent implements OnInit {
|
||||
isSmallScreen = false;
|
||||
|
||||
columns: DocumentListPresetRef[] = [];
|
||||
|
||||
constructor(
|
||||
store: Store<AppStore>,
|
||||
extensions: AppExtensionService,
|
||||
content: ContentManagementService,
|
||||
private uploadService: UploadService,
|
||||
private breakpointObserver: BreakpointObserver,
|
||||
private router: Router,
|
||||
fileAutoDownloadService: AcaFileAutoDownloadService
|
||||
) {
|
||||
super(store, extensions, content, fileAutoDownloadService);
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
super.ngOnInit();
|
||||
|
||||
this.subscriptions = this.subscriptions.concat([
|
||||
this.uploadService.fileUploadComplete.pipe(debounceTime(300)).subscribe(() => this.onFileUploadedEvent()),
|
||||
this.uploadService.fileUploadDeleted.pipe(debounceTime(300)).subscribe(() => this.onFileUploadedEvent()),
|
||||
|
||||
this.breakpointObserver.observe([Breakpoints.HandsetPortrait, Breakpoints.HandsetLandscape]).subscribe((result) => {
|
||||
this.isSmallScreen = result.matches;
|
||||
})
|
||||
this.uploadService.fileUploadComplete.pipe(debounceTime(300)).subscribe(() => this.reload()),
|
||||
this.uploadService.fileUploadDeleted.pipe(debounceTime(300)).subscribe(() => this.reload())
|
||||
]);
|
||||
|
||||
this.columns = this.extensions.documentListPresets.recent || [];
|
||||
@@ -78,8 +58,4 @@ export class RecentFilesComponent extends PageComponent implements OnInit {
|
||||
handleNodeClick(event: Event) {
|
||||
this.onNodeDoubleClick((event as CustomEvent).detail?.node);
|
||||
}
|
||||
|
||||
private onFileUploadedEvent() {
|
||||
this.reload();
|
||||
}
|
||||
}
|
||||
|
@@ -22,15 +22,12 @@
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { NavigateLibraryAction, AppStore } from '@alfresco/aca-shared/store';
|
||||
import { NavigateLibraryAction } from '@alfresco/aca-shared/store';
|
||||
import { NodePaging, Pagination, SiteEntry } from '@alfresco/js-api';
|
||||
import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute, Params } from '@angular/router';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { ContentManagementService } from '../../../services/content-management.service';
|
||||
import { SearchLibrariesQueryBuilderService } from './search-libraries-query-builder.service';
|
||||
import { AppExtensionService, AppHookService, AppService, PageComponent } from '@alfresco/aca-shared';
|
||||
import { AppHookService, AppService, PageComponent } from '@alfresco/aca-shared';
|
||||
import { DocumentListPresetRef } from '@alfresco/adf-extensions';
|
||||
|
||||
@Component({
|
||||
@@ -39,7 +36,6 @@ import { DocumentListPresetRef } from '@alfresco/adf-extensions';
|
||||
styleUrls: ['./search-libraries-results.component.scss']
|
||||
})
|
||||
export class SearchLibrariesResultsComponent extends PageComponent implements OnInit {
|
||||
isSmallScreen = false;
|
||||
searchedWord: string;
|
||||
queryParamName = 'q';
|
||||
data: NodePaging;
|
||||
@@ -48,16 +44,12 @@ export class SearchLibrariesResultsComponent extends PageComponent implements On
|
||||
columns: DocumentListPresetRef[] = [];
|
||||
|
||||
constructor(
|
||||
private breakpointObserver: BreakpointObserver,
|
||||
private librariesQueryBuilder: SearchLibrariesQueryBuilderService,
|
||||
private route: ActivatedRoute,
|
||||
private appHookService: AppHookService,
|
||||
private appService: AppService,
|
||||
store: Store<AppStore>,
|
||||
extensions: AppExtensionService,
|
||||
content: ContentManagementService
|
||||
private appService: AppService
|
||||
) {
|
||||
super(store, extensions, content);
|
||||
super();
|
||||
|
||||
librariesQueryBuilder.paging = {
|
||||
skipCount: 0,
|
||||
@@ -96,10 +88,6 @@ export class SearchLibrariesResultsComponent extends PageComponent implements On
|
||||
this.appHookService.library400Error.next();
|
||||
}
|
||||
} catch (e) {}
|
||||
}),
|
||||
|
||||
this.breakpointObserver.observe([Breakpoints.HandsetPortrait, Breakpoints.HandsetLandscape]).subscribe((result) => {
|
||||
this.isSmallScreen = result.matches;
|
||||
})
|
||||
);
|
||||
|
||||
|
@@ -24,11 +24,9 @@
|
||||
|
||||
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import { MinimalNodeEntity, Pagination, ResultSetPaging } from '@alfresco/js-api';
|
||||
import { ActivatedRoute, Params, Router } from '@angular/router';
|
||||
import { ActivatedRoute, Params } from '@angular/router';
|
||||
import { SearchQueryBuilderService } from '@alfresco/adf-content-services';
|
||||
import { Store } from '@ngrx/store';
|
||||
import {
|
||||
AppStore,
|
||||
infoDrawerPreview,
|
||||
NavigateToFolder,
|
||||
SetInfoDrawerPreviewStateAction,
|
||||
@@ -37,13 +35,11 @@ import {
|
||||
ShowInfoDrawerPreviewAction,
|
||||
SnackbarErrorAction
|
||||
} from '@alfresco/aca-shared/store';
|
||||
import { ContentManagementService } from '../../../services/content-management.service';
|
||||
import { TranslationService } from '@alfresco/adf-core';
|
||||
import { combineLatest, Observable } from 'rxjs';
|
||||
import { AcaFileAutoDownloadService, AppExtensionService, PageComponent } from '@alfresco/aca-shared';
|
||||
import { combineLatest } from 'rxjs';
|
||||
import { PageComponent } from '@alfresco/aca-shared';
|
||||
import { SearchSortingDefinition } from '@alfresco/adf-content-services/lib/search/models/search-sorting-definition.interface';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout';
|
||||
|
||||
@Component({
|
||||
selector: 'aca-search-results',
|
||||
@@ -52,36 +48,23 @@ import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout';
|
||||
styleUrls: ['./search-results.component.scss']
|
||||
})
|
||||
export class SearchResultsComponent extends PageComponent implements OnInit {
|
||||
showFacetFilter$: Observable<boolean>;
|
||||
infoDrawerPreview$: Observable<boolean>;
|
||||
showFacetFilter$ = this.store.select(showFacetFilter);
|
||||
infoDrawerPreview$ = this.store.select(infoDrawerPreview);
|
||||
|
||||
searchedWord: string;
|
||||
queryParamName = 'q';
|
||||
data: ResultSetPaging;
|
||||
sorting = ['name', 'asc'];
|
||||
isLoading = false;
|
||||
isSmallScreen = false;
|
||||
|
||||
constructor(
|
||||
private queryBuilder: SearchQueryBuilderService,
|
||||
private route: ActivatedRoute,
|
||||
store: Store<AppStore>,
|
||||
extensions: AppExtensionService,
|
||||
content: ContentManagementService,
|
||||
private translationService: TranslationService,
|
||||
private router: Router,
|
||||
private breakpointObserver: BreakpointObserver,
|
||||
fileAutoDownloadService: AcaFileAutoDownloadService
|
||||
) {
|
||||
super(store, extensions, content, fileAutoDownloadService);
|
||||
constructor(private queryBuilder: SearchQueryBuilderService, private route: ActivatedRoute, private translationService: TranslationService) {
|
||||
super();
|
||||
|
||||
queryBuilder.paging = {
|
||||
skipCount: 0,
|
||||
maxItems: 25
|
||||
};
|
||||
|
||||
this.showFacetFilter$ = store.select(showFacetFilter);
|
||||
this.infoDrawerPreview$ = store.select(infoDrawerPreview);
|
||||
combineLatest([this.route.params, this.queryBuilder.configUpdated])
|
||||
.pipe(takeUntil(this.onDestroy$))
|
||||
.subscribe(([params, searchConfig]) => {
|
||||
@@ -92,13 +75,6 @@ export class SearchResultsComponent extends PageComponent implements OnInit {
|
||||
this.queryBuilder.userQuery = decodeURIComponent(query);
|
||||
}
|
||||
});
|
||||
|
||||
this.breakpointObserver
|
||||
.observe([Breakpoints.HandsetPortrait, Breakpoints.HandsetLandscape])
|
||||
.pipe(takeUntil(this.onDestroy$))
|
||||
.subscribe((result) => {
|
||||
this.isSmallScreen = result.matches;
|
||||
});
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
@@ -23,34 +23,18 @@
|
||||
*/
|
||||
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout';
|
||||
import { ContentManagementService } from '../../services/content-management.service';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { debounceTime } from 'rxjs/operators';
|
||||
import { UploadService } from '@alfresco/adf-content-services';
|
||||
import { Router } from '@angular/router';
|
||||
import { MinimalNodeEntity } from '@alfresco/js-api';
|
||||
import { AcaFileAutoDownloadService, AppExtensionService, AppHookService, PageComponent } from '@alfresco/aca-shared';
|
||||
import { AppHookService, PageComponent } from '@alfresco/aca-shared';
|
||||
import { DocumentListPresetRef } from '@alfresco/adf-extensions';
|
||||
@Component({
|
||||
templateUrl: './shared-files.component.html'
|
||||
})
|
||||
export class SharedFilesComponent extends PageComponent implements OnInit {
|
||||
isSmallScreen = false;
|
||||
|
||||
columns: DocumentListPresetRef[] = [];
|
||||
|
||||
constructor(
|
||||
store: Store<any>,
|
||||
extensions: AppExtensionService,
|
||||
content: ContentManagementService,
|
||||
private appHookService: AppHookService,
|
||||
private uploadService: UploadService,
|
||||
private breakpointObserver: BreakpointObserver,
|
||||
private router: Router,
|
||||
fileAutoDownloadService: AcaFileAutoDownloadService
|
||||
) {
|
||||
super(store, extensions, content, fileAutoDownloadService);
|
||||
constructor(private appHookService: AppHookService) {
|
||||
super();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -58,13 +42,8 @@ export class SharedFilesComponent extends PageComponent implements OnInit {
|
||||
|
||||
this.subscriptions = this.subscriptions.concat([
|
||||
this.appHookService.linksUnshared.pipe(debounceTime(300)).subscribe(() => this.reload()),
|
||||
|
||||
this.uploadService.fileUploadComplete.pipe(debounceTime(300)).subscribe((_) => this.reload()),
|
||||
this.uploadService.fileUploadDeleted.pipe(debounceTime(300)).subscribe((_) => this.reload()),
|
||||
|
||||
this.breakpointObserver.observe([Breakpoints.HandsetPortrait, Breakpoints.HandsetLandscape]).subscribe((result) => {
|
||||
this.isSmallScreen = result.matches;
|
||||
})
|
||||
this.uploadService.fileUploadComplete.pipe(debounceTime(300)).subscribe(() => this.reload()),
|
||||
this.uploadService.fileUploadDeleted.pipe(debounceTime(300)).subscribe(() => this.reload())
|
||||
]);
|
||||
|
||||
this.columns = this.extensions.documentListPresets.shared || [];
|
||||
|
@@ -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