UBERF-4264 Show only employees from selected departments (#3979)

Signed-off-by: Alexander Onnikov <alexander.onnikov@xored.com>
This commit is contained in:
Alexander Onnikov 2023-11-13 19:02:34 +07:00 committed by GitHub
parent 4c3ba1fbc4
commit 0a16c2ff88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -178,15 +178,14 @@
function updateStaff (
staff: Staff[],
departments: Ref<Department>[],
employeeRequests: Map<Ref<Staff>, Request[]>,
descendants: Map<Ref<Department>, Department[]>,
departmentById: Map<Ref<Department>, Department>
) {
departmentStaff = staff.filter((p) => departments.includes(p.department) || employeeRequests.has(p._id))
departmentStaff = staff.filter((p) => departments.includes(p.department))
updateEditableList(departmentById, departmentStaff, descendants)
}
$: updateStaff(staff, departments, employeeRequests, descendants, departmentById)
$: updateStaff(staff, departments, descendants, departmentById)
const reportQuery = createQuery()
@ -290,15 +289,12 @@
<MonthView
{departmentStaff}
{employeeRequests}
{types}
{startDate}
{endDate}
{editableList}
{currentDate}
{timeReports}
{holidays}
{department}
{departments}
{departmentById}
{staffDepartmentMap}
/>