@ -2,7 +2,7 @@ import { XRayRulesSettings } from '@ghostfolio/common/interfaces';
import { GfValueComponent } from '@ghostfolio/ui/value' ;
import { GfValueComponent } from '@ghostfolio/ui/value' ;
import { CommonModule } from '@angular/common' ;
import { CommonModule } from '@angular/common' ;
import { Component , Inject } from '@angular/core' ;
import { Component , Inject , OnInit } from '@angular/core' ;
import { FormsModule } from '@angular/forms' ;
import { FormsModule } from '@angular/forms' ;
import { MatButtonModule } from '@angular/material/button' ;
import { MatButtonModule } from '@angular/material/button' ;
import {
import {
@ -27,11 +27,27 @@ import { RuleSettingsDialogParams } from './interfaces/interfaces';
styleUrls : [ './rule-settings-dialog.scss' ] ,
styleUrls : [ './rule-settings-dialog.scss' ] ,
templateUrl : './rule-settings-dialog.html'
templateUrl : './rule-settings-dialog.html'
} )
} )
export class GfRuleSettingsDialogComponent {
export class GfRuleSettingsDialogComponent implements OnInit {
public hasChanges = false ;
public settings : XRayRulesSettings [ 'AccountClusterRiskCurrentInvestment' ] ;
public settings : XRayRulesSettings [ 'AccountClusterRiskCurrentInvestment' ] ;
private originalSettings : XRayRulesSettings [ 'AccountClusterRiskCurrentInvestment' ] ;
public constructor (
public constructor (
@Inject ( MAT_DIALOG_DATA ) public data : RuleSettingsDialogParams ,
@Inject ( MAT_DIALOG_DATA ) public data : RuleSettingsDialogParams ,
public dialogRef : MatDialogRef < GfRuleSettingsDialogComponent >
public dialogRef : MatDialogRef < GfRuleSettingsDialogComponent >
) { }
) { }
public ngOnInit() {
this . originalSettings = {
. . . this . data . settings
} ;
this . settings = this . data . settings ;
}
public onChange() {
this . hasChanges =
this . settings . thresholdMin !== this . originalSettings . thresholdMin ||
this . settings . thresholdMax !== this . originalSettings . thresholdMax ;
}
}
}