mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-28 05:56:02 +03:00
TSK-989: transparent requests (PTO, extra, etc.) when not in department or it's descendants (#2861)
Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>
This commit is contained in:
parent
3ca0f8ba7c
commit
18a756a1a9
@ -25,6 +25,7 @@
|
||||
export let editable: boolean = false
|
||||
export let holidays: Map<Ref<Department>, Date[]>
|
||||
export let employee: Staff
|
||||
export let departments: Ref<Department>[]
|
||||
|
||||
const client = getClient()
|
||||
export let noWeekendHolidayType: Ref<RequestType>[]
|
||||
@ -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 @@
|
||||
<div
|
||||
class="request flex-center"
|
||||
class:cursor-pointer={editable}
|
||||
style={getStyle(type)}
|
||||
style={getStyle(type, request)}
|
||||
on:click={(e) => {
|
||||
click(e, request)
|
||||
}}
|
||||
|
@ -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'}
|
||||
|
@ -49,6 +49,7 @@
|
||||
|
||||
export let departmentStaff: Staff[]
|
||||
export let department: Ref<Department>
|
||||
export let departments: Ref<Department>[]
|
||||
|
||||
export let employeeRequests: Map<Ref<Staff>, Request[]>
|
||||
export let editableList: Ref<Employee>[]
|
||||
@ -237,6 +238,7 @@
|
||||
<div class:worked={ww > 0} class="h-full w-full">
|
||||
{#if requests.length}
|
||||
<ScheduleRequests
|
||||
{departments}
|
||||
{requests}
|
||||
{editable}
|
||||
date={day}
|
||||
|
Loading…
Reference in New Issue
Block a user