-
{isMoving}
);
}
+export default connect(mapStateToProps, null)(ProductionBoardKanbanContainer);
diff --git a/client/src/components/production-board-kanban/production-board-kanban.utils.js b/client/src/components/production-board-kanban/production-board-kanban.utils.js
index 624bb0076..ddbb9b936 100644
--- a/client/src/components/production-board-kanban/production-board-kanban.utils.js
+++ b/client/src/components/production-board-kanban/production-board-kanban.utils.js
@@ -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;
};
diff --git a/client/src/components/production-list-table/production-list-table.container.jsx b/client/src/components/production-list-table/production-list-table.container.jsx
index b92fe8b0f..fc31dfa9c 100644
--- a/client/src/components/production-list-table/production-list-table.container.jsx
+++ b/client/src/components/production-list-table/production-list-table.container.jsx
@@ -1,10 +1,35 @@
import { useSubscription } from "@apollo/react-hooks";
-import React from "react";
+import React, { useState } 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 ProductionListColumns from "../production-list-columns/production-list-columns.data";
import ProductionListTable from "./production-list-table.component";
-export default function ProductionListTableContainer({ columnState }) {
- const { loading, data } = useSubscription(SUBSCRIPTION_JOBS_IN_PRODUCTION);
+const mapStateToProps = createStructuredSelector({
+ bodyshop: selectBodyshop,
+});
+
+export default connect(mapStateToProps, null)(ProductionListTableContainer);
+
+export function ProductionListTableContainer({ bodyshop }) {
+ const { loading, data } = useSubscription(SUBSCRIPTION_JOBS_IN_PRODUCTION, {
+ variables: {
+ statusList: bodyshop.md_ro_statuses.production_statuses || [],
+ },
+ });
+
+ const columnState = useState(
+ (bodyshop.production_config &&
+ bodyshop.production_config.columnKeys.map((k) => {
+ return {
+ ...ProductionListColumns.find((e) => e.key === k.key),
+ width: k.width,
+ };
+ })) ||
+ []
+ );
return (
(
+ style={{ padding: 0, margin: 2 }}
+ >
+ message: t("general.validation.required"),
+ },
+ ]}
+ >
@@ -80,10 +83,30 @@ export default function ShopInfoROStatusComponent({ form }) {
{
required: true,
message: t("general.validation.required"),
- type: "array"
- }
- ]}>
-