Skip to content

Commit d08be01

Browse files
authored
Merge pull request #106 from flock-community/fix/small_bugs
Fix/small bugs
2 parents 7e565cb + f9ffbe8 commit d08be01

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

src/main/kotlin/controllers/ExpenseController.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class ExpenseController(
4747
pageable: Pageable
4848
) = when {
4949
authentication.isAdmin() -> expenseService.findAllByPersonCode(personCode, pageable)
50-
else -> expenseService.findAllByPersonCode(authentication.name, pageable)
50+
else -> expenseService.findAllByPersonUserCode(authentication.name, pageable)
5151
}
5252
.toResponse()
5353

src/main/kotlin/repository/ExpenseRepository.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import java.util.UUID
1717
@Repository
1818
interface ExpenseRepository : PagingAndSortingRepository<Expense, UUID>{
1919
fun findAllByPersonCode(personCode: String, pageable: Pageable): Page<Expense>
20+
fun findAllByPersonUserCode(personCode: String, pageable: Pageable): Page<Expense>
2021
fun findAllByStatus(status: Status):Iterable<Expense>
2122
}
2223

src/main/kotlin/services/ExpenseService.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ class ExpenseService(
3535
fun findAllByPersonCode(personCode: String, pageable: Pageable): Page<Expense> = expenseRepository
3636
.findAllByPersonCode(personCode, pageable)
3737

38+
fun findAllByPersonUserCode(personCode: String, pageable: Pageable): Page<Expense> = expenseRepository
39+
.findAllByPersonUserCode(personCode, pageable)
40+
3841
fun findAllByStatus(status: Status) = expenseRepository.findAllByStatus(status)
3942

4043
@Transactional

src/main/react/features/month/MonthFeature.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export function MonthFeature() {
5555
.map(it => ({
5656
...it,
5757
missing: Math.max(
58-
it.total - (it.workDays + it.holiDays + it.sickDays + it.event),
58+
it.total - (it.workDays + it.holiDayUsed + it.sickDays + it.event),
5959
0
6060
),
6161
}))
@@ -74,7 +74,12 @@ export function MonthFeature() {
7474
<Tooltip formatter={value => new Intl.NumberFormat().format(value)} />
7575
<Legend />
7676
<Bar stackId="days" dataKey="workDays" name="worked hours" fill="#1de8b5" />
77-
<Bar stackId="days" dataKey="holiDays" name="holiday hours" fill="#42a5f5" />
77+
<Bar
78+
stackId="days"
79+
dataKey="holiDayUsed"
80+
name="holiday hours"
81+
fill="#42a5f5"
82+
/>
7883
<Bar stackId="days" dataKey="sickDays" name="sick hours" fill="#ef5350" />
7984
<Bar stackId="days" dataKey="event" name="event hours" fill="#fed766" />
8085
<Bar stackId="days" dataKey="missing" name="missing hours" fill="#9e9e9e" />

0 commit comments

Comments
 (0)