[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:
Denys Vuika
2019-07-16 15:56:00 +01:00
committed by Eugenio Romano
parent e2311ab045
commit 1abb9bfc89
98 changed files with 1581 additions and 1066 deletions

View File

@@ -15,32 +15,42 @@
* limitations under the License.
*/
import { Component, ViewChild } from '@angular/core';
import { Component, ViewChild, OnInit, OnDestroy } from '@angular/core';
import { DocumentListComponent } from '@alfresco/adf-content-services';
import { UserPreferencesService, UserPreferenceValues, RestoreMessageModel, NotificationService } from '@alfresco/adf-core';
import { Router } from '@angular/router';
import { PathInfoEntity } from '@alfresco/js-api';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
@Component({
templateUrl: './trashcan.component.html',
styleUrls: ['trashcan.component.scss']
})
export class TrashcanComponent {
export class TrashcanComponent implements OnInit, OnDestroy {
@ViewChild('documentList')
documentList: DocumentListComponent;
currentLocale;
private onDestroy$ = new Subject<boolean>();
constructor(
private preference: UserPreferencesService,
private router: Router,
private notificationService: NotificationService
) {
private notificationService: NotificationService) {
}
ngOnInit() {
this.preference
.select(UserPreferenceValues.Locale)
.subscribe((locale) => {
this.currentLocale = locale;
});
.pipe(takeUntil(this.onDestroy$))
.subscribe(locale => this.currentLocale = locale);
}
ngOnDestroy() {
this.onDestroy$.next(true);
this.onDestroy$.complete();
}
onRestore(restoreMessage: RestoreMessageModel) {