Skip to content

Commit

Permalink
Refactor app/shared/custom
Browse files Browse the repository at this point in the history
  • Loading branch information
RandomTannenbaum committed Dec 20, 2024
1 parent 613f522 commit 7f65fe9
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions frontend/src/app/shared/custom/scoring/scoring.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,13 @@ export class ScoringComponent implements OnInit, AfterViewInit, OnChanges {
targetPercent: number = 0;
labelPercentage: Observable<number>;
stretched: boolean = false;
protected readonly isLastCheckInNegative = isLastCheckInNegative;

@ViewChild('fail')
private failElement: ElementRef<HTMLSpanElement> | undefined = undefined;
@ViewChild('commit')
private commitElement: ElementRef<HTMLSpanElement> | undefined = undefined;
@ViewChild('target')
private targetElement: ElementRef<HTMLSpanElement> | undefined = undefined;
@ViewChild('valueLabel')
private valueLabel: ElementRef<HTMLSpanElement> | undefined = undefined;

constructor(private changeDetectionRef: ChangeDetectorRef) {
this.labelPercentage = new Observable<number>();
Expand All @@ -65,13 +62,6 @@ export class ScoringComponent implements OnInit, AfterViewInit, OnChanges {
this.commitElement!.nativeElement.style.width = this.commitPercent + '%';
this.targetElement!.nativeElement.style.width = this.targetPercent + '%';

if (this.valueLabel != undefined && this.keyResult.keyResultType == 'metric') {
this.labelPercentage.subscribe((value) => {
this.valueLabel!.nativeElement.style.width = value + '%';
this.changeDetectionRef.detectChanges();
});
}

// Set color of scoring component
let scoringClass = this.getScoringColorClassAndSetBorder();
if (scoringClass !== null) {
Expand Down

0 comments on commit 7f65fe9

Please sign in to comment.