Skip to content

Commit

Permalink
Move logic into a separate method
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterEvarior committed Dec 6, 2024
1 parent b95cd7a commit 99ee404
Showing 1 changed file with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,7 @@ export class CheckInFormComponent implements OnInit {
this.dialogForm.controls.actionList.setValue(this.keyResult.actionList);
if (this.data.checkIn != null) {
this.checkIn = this.data.checkIn;
if ((this.checkIn as CheckInMetricMin).value != null) {
this.dialogForm.controls.value.setValue(this.getCheckInMetric().value!.toString());
} else {
this.dialogForm.controls.value.setValue(this.getCheckInOrdinal().zone!);
}
this.dialogForm.controls.value.setValue(this.getCheckInValue());
this.dialogForm.controls.confidence.setValue(this.checkIn.confidence);
this.dialogForm.controls.changeInfo.setValue(this.checkIn.changeInfo);
this.dialogForm.controls.initiatives.setValue(this.checkIn.initiatives);
Expand Down Expand Up @@ -109,12 +105,12 @@ export class CheckInFormComponent implements OnInit {
});
}

getCheckInMetric(): CheckInMetricMin {
return this.checkIn as CheckInMetricMin;
}

getCheckInOrdinal(): CheckInOrdinalMin {
return this.checkIn as CheckInOrdinalMin;
getCheckInValue(): string {
if ((this.checkIn as CheckInMetricMin).value != null) {
return (this.checkIn as CheckInMetricMin).value!.toString();
} else {
return (this.checkIn as CheckInOrdinalMin).zone!;
}
}

getKeyResultMetric(): KeyResultMetric {
Expand Down

0 comments on commit 99ee404

Please sign in to comment.