Skip to content

Commit

Permalink
add strict equality
Browse files Browse the repository at this point in the history
  • Loading branch information
nevio18324 committed Dec 23, 2024
1 parent 8153e04 commit 85a08b0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions frontend/src/app/shared/custom/scoring/scoring.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export class ScoringComponent implements OnInit, AfterViewInit, OnChanges {
this.targetElement.nativeElement.style.width = this.targetPercent + '%';
}

if (this.keyResult.keyResultType == 'metric') {
if (this.keyResult.keyResultType === 'metric') {
this.labelPercentage.subscribe((value) => {
if (this.valueLabel) {
this.valueLabel.nativeElement.style.width = value + '%';
Expand Down Expand Up @@ -164,9 +164,9 @@ export class ScoringComponent implements OnInit, AfterViewInit, OnChanges {
getScoringColorClassAndSetBorder(): string | null {
if (this.targetPercent > 100) {
return 'score-stretch';
} else if (this.targetPercent > 0 || this.commitPercent == 100 && this.keyResult.keyResultType === 'metric') {
} else if (this.targetPercent > 0 || this.commitPercent === 100 && this.keyResult.keyResultType === 'metric') {
return 'score-green';
} else if (this.commitPercent > 0 || this.failPercent == 100 && this.keyResult.keyResultType === 'metric') {
} else if (this.commitPercent > 0 || this.failPercent === 100 && this.keyResult.keyResultType === 'metric') {
return 'score-yellow';
} else if (this.failPercent >= 3.3333) {
// 3.3333% because if lower fail is not visible in overview and we display !
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,16 @@ export class CompleteDialogComponent {

constructor(public dialogRef: MatDialogRef<CompleteDialogComponent>,
@Inject(MAT_DIALOG_DATA) public data: { objectiveTitle: string },
private translate: TranslateService) {}
private translate: TranslateService) {
}

switchSuccessState(input: string) {
this.removeStandardHover();
let successfulValue = this.completeForm.value.isSuccessful;
if (
successfulValue == null ||
input == 'successful' && !successfulValue ||
input == 'notSuccessful' && successfulValue
input === 'successful' ||
input === 'notSuccessful'
) {
successfulValue = input == 'successful';
this.completeForm.patchValue({ isSuccessful: successfulValue });
Expand Down

0 comments on commit 85a08b0

Please sign in to comment.