File tree 3 files changed +13
-8
lines changed
server/src/main/java/com/objectcomputing/checkins
web-ui/src/components/contribution_hours
3 files changed +13
-8
lines changed Original file line number Diff line number Diff line change 1
1
package com .objectcomputing .checkins .services .employee_hours ;
2
2
3
3
import com .objectcomputing .checkins .converter .LocalDateConverter ;
4
+ import com .objectcomputing .checkins .util .Util ;
4
5
import io .micronaut .core .annotation .Introspected ;
5
6
import io .micronaut .core .annotation .Nullable ;
6
7
import io .micronaut .data .annotation .AutoPopulated ;
@@ -117,8 +118,8 @@ public boolean equals(Object o) {
117
118
updatedDate .equals (that .updatedDate ) &&
118
119
Float .compare (that .targetHours , targetHours ) == 0 &&
119
120
asOfDate .equals (that .asOfDate ) &&
120
- Float . compare (that .billableUtilization , this .billableUtilization ) == 0 &&
121
- Float . compare (that .overtimeWorked , this .overtimeWorked ) == 0
121
+ Util . floatCompareNullSafeAndEqualWhenBothNull (that .billableUtilization , this .billableUtilization ) == 0 &&
122
+ Util . floatCompareNullSafeAndEqualWhenBothNull (that .overtimeWorked , this .overtimeWorked ) == 0
122
123
;
123
124
}
124
125
Original file line number Diff line number Diff line change @@ -31,4 +31,11 @@ public static List<String> nullSafeUUIDListToStringList(List<UUID> uuidList) {
31
31
}
32
32
return stringsList ;
33
33
}
34
+
35
+ public static int floatCompareNullSafeAndEqualWhenBothNull (Float f1 , Float f2 ) {
36
+ if (f1 == null && f2 == null ) return 0 ;
37
+ if (f1 == null || f2 == null ) return 1 ;
38
+ return Float .compare (f1 , f2 );
39
+ }
40
+
34
41
}
Original file line number Diff line number Diff line change @@ -44,8 +44,8 @@ const LinearBuffer = ({
44
44
contributionHours = 925 ,
45
45
targetHours = 1850 ,
46
46
ptoHours = 0 ,
47
- billableUtilization = 0 ,
48
- overtimeWorked = 0 ,
47
+ billableUtilization,
48
+ overtimeWorked,
49
49
} ) => {
50
50
return (
51
51
< Root className = { classes . root } >
@@ -67,10 +67,7 @@ const LinearBuffer = ({
67
67
style = { { display : 'block' } }
68
68
>
69
69
Billable Hours: { billableHours } - Contribution Hours:{ ' ' }
70
- { contributionHours } - Target Hours: { targetHours } - PTO Hours:{ ' ' }
71
- { ptoHours } - Billable Utilization:{ ' ' }
72
- { billableUtilization } - Overtime Worked:{ ' ' }
73
- { overtimeWorked }
70
+ { contributionHours } - Target Hours: { targetHours } - PTO Hours:{ ' ' } { ptoHours } - Billable Utilization:{ ' ' } { ( billableUtilization ) ? billableUtilization : '(none)' } - Overtime Worked:{ ' ' } { ( overtimeWorked ) ? overtimeWorked : '(none)' }
74
71
</ Typography >
75
72
</ Root >
76
73
) ;
You can’t perform that action at this time.
0 commit comments