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
@@ -17,7 +17,7 @@
|
||||
|
||||
/* tslint:disable:component-selector */
|
||||
|
||||
import { Component, ViewEncapsulation, OnInit } from '@angular/core';
|
||||
import { Component, ViewEncapsulation, OnInit, OnDestroy } from '@angular/core';
|
||||
import {
|
||||
UploadWidgetComponent,
|
||||
FormService,
|
||||
@@ -26,14 +26,13 @@ import {
|
||||
ProcessContentService,
|
||||
ActivitiContentService,
|
||||
ContentService,
|
||||
FormEvent,
|
||||
AppConfigValues,
|
||||
AppConfigService
|
||||
} from '@alfresco/adf-core';
|
||||
import { ContentNodeDialogService } from '@alfresco/adf-content-services';
|
||||
import { Node, RelatedContentRepresentation } from '@alfresco/js-api';
|
||||
import { from, zip, of } from 'rxjs';
|
||||
import { mergeMap } from 'rxjs/operators';
|
||||
import { from, zip, of, Subject } from 'rxjs';
|
||||
import { mergeMap, takeUntil } from 'rxjs/operators';
|
||||
import { AttachFileWidgetDialogService } from './attach-file-widget-dialog.service';
|
||||
|
||||
@Component({
|
||||
@@ -53,10 +52,11 @@ import { AttachFileWidgetDialogService } from './attach-file-widget-dialog.servi
|
||||
},
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class AttachFileWidgetComponent extends UploadWidgetComponent implements OnInit {
|
||||
export class AttachFileWidgetComponent extends UploadWidgetComponent implements OnInit, OnDestroy {
|
||||
|
||||
repositoryList = [];
|
||||
private tempFilesList = [];
|
||||
private onDestroy$ = new Subject<boolean>();
|
||||
|
||||
constructor(public formService: FormService,
|
||||
private logger: LogService,
|
||||
@@ -82,11 +82,18 @@ export class AttachFileWidgetComponent extends UploadWidgetComponent implements
|
||||
this.repositoryList = repoList;
|
||||
});
|
||||
|
||||
this.formService.taskSaved.subscribe((formSaved: FormEvent) => {
|
||||
if (formSaved.form.id === this.field.form.id) {
|
||||
this.tempFilesList = [];
|
||||
}
|
||||
});
|
||||
this.formService.taskSaved
|
||||
.pipe(takeUntil(this.onDestroy$))
|
||||
.subscribe(formSaved => {
|
||||
if (formSaved.form.id === this.field.form.id) {
|
||||
this.tempFilesList = [];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
this.onDestroy$.next(true);
|
||||
this.onDestroy$.complete();
|
||||
}
|
||||
|
||||
isFileSourceConfigured(): boolean {
|
||||
|
Reference in New Issue
Block a user