Resolve employee search on kanban board.

This commit is contained in:
Patrick Fic
2020-12-09 15:05:29 -08:00
parent 4212ba9c85
commit 5a502c4d1b
9 changed files with 36 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
import { Select, Tag } from "antd";
import { Select, Space, Tag } from "antd";
import React, { forwardRef, useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
const { Option } = Select;
@@ -37,7 +37,7 @@ const EmployeeSearchSelect = (
search={`${o.employee_number} ${o.first_name} ${o.last_name}`}
discount={o.discount}
>
<div style={{ display: "flex" }}>
<Space>
{`${o.employee_number} ${o.first_name} ${o.last_name}`}
<Tag color="blue">{o.cost_center}</Tag>
@@ -46,7 +46,7 @@ const EmployeeSearchSelect = (
? t("timetickets.labels.flat_rate")
: t("timetickets.labels.straight_time")}
</Tag>
</div>
</Space>
</Option>
))
: null}

View File

@@ -21,7 +21,7 @@ export function ProductionBoardFilters({ bodyshop, filter, setFilter }) {
const { t } = useTranslation();
return (
<div>
<div style={{ display: "flex" }}>
<Input.Search
//value={filter.search}
placeholder={t("general.labels.search")}
@@ -32,6 +32,7 @@ export function ProductionBoardFilters({ bodyshop, filter, setFilter }) {
<EmployeeSearchSelectComponent
options={bodyshop.employees}
value={filter.employeeId}
placeholder={t("production.labels.employeesearch")}
onChange={(emp) => setFilter({ ...filter, employeeId: emp })}
allowClear
/>

View File

@@ -63,10 +63,10 @@ export const createBoardData = (AllStatuses, Jobs, filter) => {
if (!!employeeId) {
include =
include &&
(j.employee_body === employeeId ||
j.employee_prep === employeeId ||
j.employee_refinish === employeeId);
include ||
j.employee_body === employeeId ||
j.employee_prep === employeeId ||
j.employee_refinish === employeeId;
}
return include;