mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-4745] memory leak fixes (#4931)
* fix app-layout component * fix card-view component * fix cloud-layout service * code fixes * code fixes * even more fixes * even more fixes * lint fixes * test fixes * fix code * remove useless pipes * fix code owners * enable spellcheck for cloud components * update test * update test
This commit is contained in:
committed by
Eugenio Romano
parent
e2311ab045
commit
1abb9bfc89
@@ -16,18 +16,18 @@
|
||||
*/
|
||||
|
||||
import { AppsProcessService, TranslationService, CustomEmptyContentTemplateDirective } from '@alfresco/adf-core';
|
||||
import { AfterContentInit, Component, EventEmitter, Input, OnInit, Output, ContentChild } from '@angular/core';
|
||||
import { Observable, Observer, of } from 'rxjs';
|
||||
import { AfterContentInit, Component, EventEmitter, Input, OnInit, Output, ContentChild, OnDestroy } from '@angular/core';
|
||||
import { Observable, Observer, of, Subject } from 'rxjs';
|
||||
import { AppDefinitionRepresentationModel } from '../task-list';
|
||||
import { IconModel } from './icon.model';
|
||||
import { share } from 'rxjs/operators';
|
||||
import { share, takeUntil } from 'rxjs/operators';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-apps',
|
||||
templateUrl: 'apps-list.component.html',
|
||||
styleUrls: ['./apps-list.component.scss']
|
||||
})
|
||||
export class AppsListComponent implements OnInit, AfterContentInit {
|
||||
export class AppsListComponent implements OnInit, AfterContentInit, OnDestroy {
|
||||
|
||||
public static LAYOUT_LIST: string = 'LIST';
|
||||
public static LAYOUT_GRID: string = 'GRID';
|
||||
@@ -60,17 +60,16 @@ export class AppsListComponent implements OnInit, AfterContentInit {
|
||||
|
||||
private appsObserver: Observer<AppDefinitionRepresentationModel>;
|
||||
apps$: Observable<AppDefinitionRepresentationModel>;
|
||||
|
||||
currentApp: AppDefinitionRepresentationModel;
|
||||
|
||||
appList: AppDefinitionRepresentationModel [] = [];
|
||||
|
||||
private iconsMDL: IconModel;
|
||||
|
||||
loading: boolean = false;
|
||||
|
||||
hasEmptyCustomContentTemplate: boolean = false;
|
||||
|
||||
private onDestroy$ = new Subject<boolean>();
|
||||
|
||||
constructor(
|
||||
private appsProcessService: AppsProcessService,
|
||||
private translationService: TranslationService) {
|
||||
@@ -83,13 +82,19 @@ export class AppsListComponent implements OnInit, AfterContentInit {
|
||||
this.setDefaultLayoutType();
|
||||
}
|
||||
|
||||
this.apps$.subscribe((app: any) => {
|
||||
this.appList.push(app);
|
||||
});
|
||||
this.apps$
|
||||
.pipe(takeUntil(this.onDestroy$))
|
||||
.subscribe((app: any) => this.appList.push(app));
|
||||
|
||||
this.iconsMDL = new IconModel();
|
||||
this.load();
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
this.onDestroy$.next(true);
|
||||
this.onDestroy$.complete();
|
||||
}
|
||||
|
||||
ngAfterContentInit() {
|
||||
if (this.emptyCustomContent) {
|
||||
this.hasEmptyCustomContentTemplate = true;
|
||||
|
Reference in New Issue
Block a user