UI: Refactoring

This commit is contained in:
Artem Dzhereleiko 2023-02-08 11:02:29 +02:00
parent 17893201b6
commit f2088ad53b
8 changed files with 11 additions and 14 deletions

View File

@ -27,7 +27,7 @@ import {
Validator, Validator,
Validators Validators
} from '@angular/forms'; } from '@angular/forms';
import { Observable, of, Subject, Subscription } from 'rxjs'; import { Observable, of, Subject } from 'rxjs';
import { import {
ComplexFilterPredicateInfo, ComplexFilterPredicateInfo,
ComplexOperation, ComplexOperation,
@ -81,11 +81,9 @@ export class FilterPredicateListComponent implements ControlValueAccessor, Valid
complexOperationTranslations = complexOperationTranslationMap; complexOperationTranslations = complexOperationTranslationMap;
private destroy$ = new Subject(); private destroy$ = new Subject<void>();
private propagateChange = null; private propagateChange = null;
private valueChangeSubscription: Subscription = null;
constructor(private fb: UntypedFormBuilder, constructor(private fb: UntypedFormBuilder,
@Inject(COMPLEX_FILTER_PREDICATE_DIALOG_COMPONENT_TOKEN) private complexFilterPredicateDialogComponent: ComponentType<any>, @Inject(COMPLEX_FILTER_PREDICATE_DIALOG_COMPONENT_TOKEN) private complexFilterPredicateDialogComponent: ComponentType<any>,
private dialog: MatDialog) { private dialog: MatDialog) {
@ -151,7 +149,7 @@ export class FilterPredicateListComponent implements ControlValueAccessor, Valid
} }
public removePredicate(index: number) { public removePredicate(index: number) {
(this.filterListFormGroup.get('predicates') as UntypedFormArray).removeAt(index); this.predicatesFormArray.removeAt(index);
} }
public addPredicate(complex: boolean) { public addPredicate(complex: boolean) {

View File

@ -76,7 +76,7 @@ export class KeyFilterListComponent implements ControlValueAccessor, Validator,
keyFiltersControl: UntypedFormControl; keyFiltersControl: UntypedFormControl;
private destroy$ = new Subject(); private destroy$ = new Subject<void>();
private propagateChange = null; private propagateChange = null;
constructor(private fb: UntypedFormBuilder, constructor(private fb: UntypedFormBuilder,

View File

@ -68,7 +68,7 @@ export class CreateAlarmRulesComponent implements ControlValueAccessor, OnInit,
private usedSeverities: AlarmSeverity[] = []; private usedSeverities: AlarmSeverity[] = [];
private destroy$ = new Subject(); private destroy$ = new Subject<void>();
private propagateChange = (v: any) => { }; private propagateChange = (v: any) => { };
constructor(private dialog: MatDialog, constructor(private dialog: MatDialog,

View File

@ -72,12 +72,11 @@ export class DeviceProfileAlarmsComponent implements ControlValueAccessor, OnIni
@Input() @Input()
deviceProfileId: EntityId; deviceProfileId: EntityId;
private destroy$ = new Subject(); private destroy$ = new Subject<void>();
private propagateChange = (v: any) => { }; private propagateChange = (v: any) => { };
constructor(private store: Store<AppState>, constructor(private store: Store<AppState>,
private fb: UntypedFormBuilder, private fb: UntypedFormBuilder) {
private dialog: MatDialog) {
} }
registerOnChange(fn: any): void { registerOnChange(fn: any): void {

View File

@ -72,7 +72,7 @@ export class Lwm2mBootstrapConfigServersComponent implements OnInit, ControlValu
} }
} }
private destroy$ = new Subject(); private destroy$ = new Subject<void>();
private propagateChange = (v: any) => { }; private propagateChange = (v: any) => { };
constructor(public translate: TranslateService, constructor(public translate: TranslateService,

View File

@ -71,7 +71,7 @@ export class TenantProfileQueuesComponent implements ControlValueAccessor, Valid
@Input() @Input()
disabled: boolean; disabled: boolean;
private destroy$ = new Subject(); private destroy$ = new Subject<void>();
private propagateChange = (v: any) => { }; private propagateChange = (v: any) => { };
constructor(private store: Store<AppState>, constructor(private store: Store<AppState>,

View File

@ -51,7 +51,7 @@ export class RelationFiltersComponent extends PageComponent implements ControlVa
relationFiltersFormGroup: UntypedFormGroup; relationFiltersFormGroup: UntypedFormGroup;
private destroy$ = new Subject(); private destroy$ = new Subject<void>();
private propagateChange = null; private propagateChange = null;
constructor(protected store: Store<AppState>, constructor(protected store: Store<AppState>,

View File

@ -64,7 +64,7 @@ export class KeyValMapComponent extends PageComponent implements ControlValueAcc
kvListFormGroup: UntypedFormGroup; kvListFormGroup: UntypedFormGroup;
private destroy$ = new Subject(); private destroy$ = new Subject<void>();
private propagateChange = null; private propagateChange = null;
constructor(protected store: Store<AppState>, constructor(protected store: Store<AppState>,