[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

@@ -17,7 +17,7 @@
import {
Component, EventEmitter,
Input, OnInit, Output, TemplateRef, ViewEncapsulation
Input, OnInit, Output, TemplateRef, ViewEncapsulation, OnDestroy
} from '@angular/core';
import { AbstractControl, FormBuilder, FormGroup, Validators } from '@angular/forms';
import { Router, ActivatedRoute, Params } from '@angular/router';
@@ -36,6 +36,8 @@ import {
} from '../../app-config/app-config.service';
import { OauthConfigModel } from '../../models/oauth-config.model';
import { DomSanitizer } from '@angular/platform-browser';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
enum LoginSteps {
Landing = 0,
@@ -57,7 +59,7 @@ interface ValidationMessage {
class: 'adf-login'
}
})
export class LoginComponent implements OnInit {
export class LoginComponent implements OnInit, OnDestroy {
isPasswordShow: boolean = false;
/**
@@ -127,6 +129,7 @@ export class LoginComponent implements OnInit {
data: any;
private _message: { [id: string]: { [id: string]: ValidationMessage } };
private onDestroy$ = new Subject<boolean>();
/**
* Constructor
@@ -175,7 +178,14 @@ export class LoginComponent implements OnInit {
this.initFormFieldsDefault();
this.initFormFieldsMessagesDefault();
}
this.form.valueChanges.subscribe((data) => this.onValueChanged(data));
this.form.valueChanges
.pipe(takeUntil(this.onDestroy$))
.subscribe(data => this.onValueChanged(data));
}
ngOnDestroy() {
this.onDestroy$.next(true);
this.onDestroy$.complete();
}
submit() {