Added production level statuses for shop page and updated production board to filter accordingly BOD-4
This commit is contained in:
@@ -25,9 +25,16 @@ export function ProductionBoardKanbanComponent({ data, bodyshop }) {
|
||||
|
||||
const { t } = useTranslation();
|
||||
useEffect(() => {
|
||||
setBoardLanes(createBoardData(bodyshop.md_ro_statuses.open_statuses, data));
|
||||
setBoardLanes(
|
||||
createBoardData(bodyshop.md_ro_statuses.production_statuses, data)
|
||||
);
|
||||
setIsMoving(false);
|
||||
}, [data, setBoardLanes, setIsMoving, bodyshop.md_ro_statuses.open_statuses]);
|
||||
}, [
|
||||
data,
|
||||
setBoardLanes,
|
||||
setIsMoving,
|
||||
bodyshop.md_ro_statuses.production_statuses,
|
||||
]);
|
||||
|
||||
const findById = (id) => {
|
||||
return id;
|
||||
@@ -108,7 +115,6 @@ export function ProductionBoardKanbanComponent({ data, bodyshop }) {
|
||||
return (
|
||||
<div>
|
||||
<IndefiniteLoading loading={isMoving} />
|
||||
<div>{isMoving}</div>
|
||||
<Board
|
||||
children={boardLanes}
|
||||
disableCardDrag={isMoving}
|
||||
|
||||
@@ -1,10 +1,21 @@
|
||||
import { useSubscription } from "@apollo/react-hooks";
|
||||
import React from "react";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { SUBSCRIPTION_JOBS_IN_PRODUCTION } from "../../graphql/jobs.queries";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
import ProductionBoardKanbanComponent from "./production-board-kanban.component";
|
||||
|
||||
export default function ProductionBoardKanbanContainer({ columnState }) {
|
||||
const { loading, data } = useSubscription(SUBSCRIPTION_JOBS_IN_PRODUCTION);
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
bodyshop: selectBodyshop,
|
||||
});
|
||||
|
||||
export function ProductionBoardKanbanContainer({ bodyshop }) {
|
||||
const { loading, data } = useSubscription(SUBSCRIPTION_JOBS_IN_PRODUCTION, {
|
||||
variables: {
|
||||
statusList: bodyshop.md_ro_statuses.production_statuses || [],
|
||||
},
|
||||
});
|
||||
|
||||
return (
|
||||
<ProductionBoardKanbanComponent
|
||||
@@ -13,3 +24,4 @@ export default function ProductionBoardKanbanContainer({ columnState }) {
|
||||
/>
|
||||
);
|
||||
}
|
||||
export default connect(mapStateToProps, null)(ProductionBoardKanbanContainer);
|
||||
|
||||
@@ -25,6 +25,16 @@ const sortByParentId = (arr) => {
|
||||
if (byParentsIdsList["null"])
|
||||
byParentsIdsList["null"].map((i) => sortedList.push(i));
|
||||
|
||||
//Validate that the 2 arrays are of the same length and no children are missing.
|
||||
if (arr.length !== sortedList.length) {
|
||||
arr.map((origItem) => {
|
||||
if (!!!sortedList.find((s) => s.id === origItem.id)) {
|
||||
sortedList.push(origItem);
|
||||
console.log("DATA CONSISTENCY ERROR: ", origItem.ro_number);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return sortedList;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user