Skip to content

Commit d0cc7e3

Browse files
committed
Fix disable rationale until revised forecast zero
1 parent 7b3b781 commit d0cc7e3

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

client/wfprev-war/src/main/angular/src/app/components/wfprev-performance-update-modal-window/wfprev-performance-update-modal-window.component.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export class PerformanceUpdateModalWindowComponent {
4141
]
4242
}),
4343

44-
forecastRationale: new FormControl("", { validators: [Validators.required] }),
44+
forecastRationale: new FormControl({value: '', disabled: true}, { validators: [Validators.required] }),
4545

4646
highRisk: new FormControl<number | null>(null, {
4747
validators: [
@@ -107,6 +107,16 @@ export class PerformanceUpdateModalWindowComponent {
107107
}
108108

109109
private bindAmountValidation() {
110+
this.revisedForecastControl.valueChanges.subscribe(value => {
111+
if (value && value > 0) {
112+
this.forecastRationaleControl.enable();
113+
} else {
114+
this.forecastRationaleControl.reset();
115+
this.forecastRationaleControl.disable();
116+
}
117+
this.calculateTotalAmount();
118+
});
119+
110120
this.highRiskControl.valueChanges.subscribe(value => {
111121
if (value > 0) {
112122
this.highRiskDescriptionControl.enable();

0 commit comments

Comments
 (0)