feature/IO-3545-Production-Board-List-DND - Checkpoint
This commit is contained in:
@@ -94,29 +94,30 @@ export function ProductionListEmpAssignment({ insertAuditTrail, bodyshop, record
|
|||||||
|
|
||||||
const [visibility, setVisibility] = useState(false);
|
const [visibility, setVisibility] = useState(false);
|
||||||
const onChange = (e, option) => {
|
const onChange = (e, option) => {
|
||||||
setAssignment({ ...assignment, employeeid: e, name: option.name });
|
setAssignment({ ...assignment, employeeid: e, name: option.label });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const employeeOptions = bodyshop.employees
|
||||||
|
.filter((emp) => emp.active)
|
||||||
|
.map((emp) => ({
|
||||||
|
value: emp.id,
|
||||||
|
label: `${emp.first_name} ${emp.last_name}`,
|
||||||
|
name: `${emp.first_name} ${emp.last_name}`
|
||||||
|
}));
|
||||||
|
|
||||||
const popContent = (
|
const popContent = (
|
||||||
<Row gutter={[16, 16]}>
|
<Row gutter={[16, 16]}>
|
||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
<Select
|
<Select
|
||||||
id="employeeSelector"
|
id="employeeSelector"
|
||||||
showSearch={{
|
showSearch={{
|
||||||
optionFilterProp: "children",
|
optionFilterProp: "label",
|
||||||
filterOption: (input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
filterOption: (input, option) => option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
||||||
}}
|
}}
|
||||||
style={{ width: 200 }}
|
style={{ width: 200 }}
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
>
|
options={employeeOptions}
|
||||||
{bodyshop.employees
|
/>
|
||||||
.filter((emp) => emp.active)
|
|
||||||
.map((emp) => (
|
|
||||||
<Select.Option value={emp.id} key={emp.id} name={`${emp.first_name} ${emp.last_name}`}>
|
|
||||||
{`${emp.first_name} ${emp.last_name}`}
|
|
||||||
</Select.Option>
|
|
||||||
))}
|
|
||||||
</Select>
|
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
<Space wrap>
|
<Space wrap>
|
||||||
|
|||||||
@@ -43,7 +43,9 @@ function DraggableHeaderCell(props) {
|
|||||||
...restProps.style,
|
...restProps.style,
|
||||||
transform: CSS.Transform.toString(transform),
|
transform: CSS.Transform.toString(transform),
|
||||||
transition,
|
transition,
|
||||||
opacity: isDragging ? 0.3 : 1
|
opacity: isDragging ? 0.3 : 1,
|
||||||
|
userSelect: "none",
|
||||||
|
textAlign: "left"
|
||||||
};
|
};
|
||||||
|
|
||||||
// If no columnKey, render as regular header
|
// If no columnKey, render as regular header
|
||||||
@@ -237,35 +239,51 @@ export function ProductionListTable({ loading, data, refetch, bodyshop, technici
|
|||||||
};
|
};
|
||||||
|
|
||||||
const headerItem = (col) => {
|
const headerItem = (col) => {
|
||||||
const menu = {
|
const menu = { onClick: removeColumn, items: [{ key: col.key, label: t("production.actions.removecolumn") }] };
|
||||||
onClick: removeColumn,
|
|
||||||
items: [
|
|
||||||
{
|
|
||||||
key: col.key,
|
|
||||||
label: t("production.actions.removecolumn")
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div style={{ display: "flex", alignItems: "center", width: "100%" }}>
|
<div
|
||||||
|
style={{
|
||||||
|
display: "flex",
|
||||||
|
alignItems: "left",
|
||||||
|
width: "100%",
|
||||||
|
userSelect: "none",
|
||||||
|
minWidth: 0 // critical: allow the flex row to shrink
|
||||||
|
}}
|
||||||
|
>
|
||||||
<span
|
<span
|
||||||
className="drag-handle-trigger"
|
className="drag-handle-trigger"
|
||||||
data-drag-handle="true"
|
data-drag-handle="true"
|
||||||
style={{
|
style={{
|
||||||
marginRight: "8px",
|
marginRight: 8,
|
||||||
color: "#999",
|
color: "#999",
|
||||||
cursor: "grab",
|
cursor: "grab",
|
||||||
padding: "4px",
|
padding: 4,
|
||||||
display: "inline-flex",
|
display: "inline-flex",
|
||||||
alignItems: "center"
|
alignItems: "left",
|
||||||
|
userSelect: "none",
|
||||||
|
flex: "0 0 auto"
|
||||||
}}
|
}}
|
||||||
title="Drag to reorder column"
|
title="Drag to reorder column"
|
||||||
>
|
>
|
||||||
<HolderOutlined />
|
<HolderOutlined />
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<Dropdown className="prod-header-dropdown" menu={menu} trigger={["contextMenu"]}>
|
<Dropdown className="prod-header-dropdown" menu={menu} trigger={["contextMenu"]}>
|
||||||
<span style={{ flex: 1, cursor: "default" }}>{col.title}</span>
|
<span
|
||||||
|
style={{
|
||||||
|
flex: "1 1 auto",
|
||||||
|
minWidth: 0, // critical: allow text to shrink
|
||||||
|
overflow: "hidden", // clip
|
||||||
|
textOverflow: "ellipsis", // show …
|
||||||
|
whiteSpace: "nowrap", // keep single line
|
||||||
|
cursor: "default",
|
||||||
|
userSelect: "none",
|
||||||
|
display: "block"
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{col.title}
|
||||||
|
</span>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
@@ -389,6 +407,7 @@ export function ProductionListTable({ loading, data, refetch, bodyshop, technici
|
|||||||
<SortableContext items={columns.map((col) => col.key)} strategy={horizontalListSortingStrategy}>
|
<SortableContext items={columns.map((col) => col.key)} strategy={horizontalListSortingStrategy}>
|
||||||
<Table
|
<Table
|
||||||
sticky
|
sticky
|
||||||
|
tableLayout="fixed"
|
||||||
pagination={false}
|
pagination={false}
|
||||||
size="small"
|
size="small"
|
||||||
{...(Production_List_Status_Colors.treatment === "on" && {
|
{...(Production_List_Status_Colors.treatment === "on" && {
|
||||||
|
|||||||
@@ -14,14 +14,7 @@ const ResizableComponent = forwardRef((props, ref) => {
|
|||||||
height={0}
|
height={0}
|
||||||
onResize={onResize}
|
onResize={onResize}
|
||||||
draggableOpts={{ enableUserSelectHack: false }}
|
draggableOpts={{ enableUserSelectHack: false }}
|
||||||
handle={
|
handle={<span className="react-resizable-handle" />}
|
||||||
<span
|
|
||||||
className="react-resizable-handle"
|
|
||||||
onClick={(e) => {
|
|
||||||
e.stopPropagation();
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
>
|
>
|
||||||
<th ref={ref} {...restProps} {...(dragAttributes || {})} {...(dragListeners || {})} />
|
<th ref={ref} {...restProps} {...(dragAttributes || {})} {...(dragListeners || {})} />
|
||||||
</Resizable>
|
</Resizable>
|
||||||
|
|||||||
Reference in New Issue
Block a user