|
|
@@ -11,6 +11,8 @@ import { |
|
|
|
fetchTimesheets, |
|
|
|
} from "@/app/api/timesheets"; |
|
|
|
import { fetchHolidays } from "@/app/api/holidays"; |
|
|
|
import { getUserAbilities } from "@/app/utils/commonUtil"; |
|
|
|
import { MAINTAIN_TIMESHEET_FAST_TIME_ENTRY } from "@/middleware"; |
|
|
|
|
|
|
|
const UserWorkspaceWrapper: React.FC = async () => { |
|
|
|
const [ |
|
|
@@ -22,6 +24,7 @@ const UserWorkspaceWrapper: React.FC = async () => { |
|
|
|
leaves, |
|
|
|
leaveTypes, |
|
|
|
holidays, |
|
|
|
abilities, |
|
|
|
] = await Promise.all([ |
|
|
|
fetchTeamMemberLeaves(), |
|
|
|
fetchTeamMemberTimesheets(), |
|
|
@@ -31,8 +34,11 @@ const UserWorkspaceWrapper: React.FC = async () => { |
|
|
|
fetchLeaves(), |
|
|
|
fetchLeaveTypes(), |
|
|
|
fetchHolidays(), |
|
|
|
getUserAbilities() |
|
|
|
]); |
|
|
|
|
|
|
|
const fastEntryEnabled = abilities.includes(MAINTAIN_TIMESHEET_FAST_TIME_ENTRY) |
|
|
|
|
|
|
|
return ( |
|
|
|
<UserWorkspacePage |
|
|
|
teamLeaves={teamLeaves} |
|
|
@@ -44,7 +50,7 @@ const UserWorkspaceWrapper: React.FC = async () => { |
|
|
|
leaveTypes={leaveTypes} |
|
|
|
holidays={holidays} |
|
|
|
// Change to access check |
|
|
|
fastEntryEnabled={true} |
|
|
|
fastEntryEnabled={fastEntryEnabled} |
|
|
|
/> |
|
|
|
); |
|
|
|
}; |
|
|
|