diff --git a/plugins/hr-resources/src/components/ScheduleRequests.svelte b/plugins/hr-resources/src/components/ScheduleRequests.svelte index 72dbb77851..dc5ef291e8 100644 --- a/plugins/hr-resources/src/components/ScheduleRequests.svelte +++ b/plugins/hr-resources/src/components/ScheduleRequests.svelte @@ -25,6 +25,7 @@ export let editable: boolean = false export let holidays: Map, Date[]> export let employee: Staff + export let departments: Ref[] const client = getClient() export let noWeekendHolidayType: Ref[] @@ -35,13 +36,14 @@ }) } - function getStyle (type: RequestType): string { + function getStyle (type: RequestType, request: Request): string { let res = `background-color: ${ isWeekend(date) && noWeekendHolidayType.includes(type._id) ? getPlatformColor(16) : getPlatformColor(type.color) };` if (Math.abs(type.value % 1) === 0.5) { res += ' height: 50%;' } + if (!departments.includes(request.space)) res += ' opacity: 0.5;' return res } @@ -63,7 +65,7 @@
{ click(e, request) }} diff --git a/plugins/hr-resources/src/components/ScheduleView.svelte b/plugins/hr-resources/src/components/ScheduleView.svelte index 3803bf7ab0..6eaf505930 100644 --- a/plugins/hr-resources/src/components/ScheduleView.svelte +++ b/plugins/hr-resources/src/components/ScheduleView.svelte @@ -95,8 +95,7 @@ hr.class.Request, { 'tzDueDate.year': { $gte: startDate.getFullYear() }, - 'tzDate.year': { $lte: endDate.getFullYear() }, - space: { $in: departments } + 'tzDate.year': { $lte: endDate.getFullYear() } }, (res) => { reqests = res @@ -294,6 +293,7 @@ {timeReports} {holidays} {department} + {departments} {staffDepartmentMap} /> {:else if display === 'stats'} diff --git a/plugins/hr-resources/src/components/schedule/MonthView.svelte b/plugins/hr-resources/src/components/schedule/MonthView.svelte index 8255399f2f..91aeae3941 100644 --- a/plugins/hr-resources/src/components/schedule/MonthView.svelte +++ b/plugins/hr-resources/src/components/schedule/MonthView.svelte @@ -49,6 +49,7 @@ export let departmentStaff: Staff[] export let department: Ref + export let departments: Ref[] export let employeeRequests: Map, Request[]> export let editableList: Ref[] @@ -237,6 +238,7 @@
0} class="h-full w-full"> {#if requests.length}