From b84935efdc007edfae550cc197fbb053ea410ef8 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Mon, 14 Feb 2022 10:38:58 -0800 Subject: [PATCH] IO-1707 Add employee filtering to time ticket list. --- .../time-ticket-list.component.jsx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/client/src/components/time-ticket-list/time-ticket-list.component.jsx b/client/src/components/time-ticket-list/time-ticket-list.component.jsx index 46e9462c3..40af8ca48 100644 --- a/client/src/components/time-ticket-list/time-ticket-list.component.jsx +++ b/client/src/components/time-ticket-list/time-ticket-list.component.jsx @@ -76,6 +76,21 @@ export function TimeTicketList({ state.sortedInfo.columnKey === "employee" && state.sortedInfo.order, render: (text, record) => `${record.employee.first_name} ${record.employee.last_name}`, + filters: + timetickets + .map((l) => l.employeeid) + .filter(onlyUnique) + .map((s) => { + return { + text: (() => { + const emp = bodyshop.employees.find((e) => e.id === s); + + return `${emp.first_name} ${emp.last_name}`; + })(), // + value: [s], + }; + }) || [], + onFilter: (value, record) => value.includes(record.employeeid), }, { title: t("timetickets.fields.cost_center"),