diff --git a/client/src/components/production-board-kanban/production-board-kanban.component.jsx b/client/src/components/production-board-kanban/production-board-kanban.component.jsx index 0c515132b..ef10f99b9 100644 --- a/client/src/components/production-board-kanban/production-board-kanban.component.jsx +++ b/client/src/components/production-board-kanban/production-board-kanban.component.jsx @@ -185,7 +185,7 @@ function ProductionBoardKanbanComponent({ data, bodyshop, refetch, insertAuditTr const cardSettings = useMemo(() => { const kanbanSettings = associationSettings?.kanban_settings; return mergeWithDefaults(kanbanSettings); - }, [associationSettings]); + }, [associationSettings?.kanban_settings]); const handleSettingsChange = () => { setFilter(defaultFilters); diff --git a/client/src/components/production-list-table/production-list-config-manager.component.jsx b/client/src/components/production-list-table/production-list-config-manager.component.jsx index b34fb92d7..ef8b07af7 100644 --- a/client/src/components/production-list-table/production-list-config-manager.component.jsx +++ b/client/src/components/production-list-table/production-list-config-manager.component.jsx @@ -457,41 +457,42 @@ export function ProductionListConfigManager({ value={activeView} disabled={open || isAddingNewProfile} // Disable the Select box when the popover is open or adding a new profile > - {bodyshop.production_config - .slice() - .sort((a, b) => - a.name === t("production.constants.main_profile") - ? -1 - : b.name === t("production.constants.main_profile") - ? 1 - : 0 - ) // - .map((config) => ( - -
- - {config.name} - - {config.name !== t("production.constants.main_profile") && ( - handleTrash(config.name)} - onCancel={(e) => e.stopPropagation()} + {bodyshop?.production_config && + bodyshop.production_config + .slice() + .sort((a, b) => + a.name === t("production.constants.main_profile") + ? -1 + : b.name === t("production.constants.main_profile") + ? 1 + : 0 + ) // + .map((config) => ( + +
+ - e.stopPropagation()} /> - - )} -
-
- ))} + {config.name} + + {config.name !== t("production.constants.main_profile") && ( + handleTrash(config.name)} + onCancel={(e) => e.stopPropagation()} + > + e.stopPropagation()} /> + + )} +
+
+ ))}
diff --git a/client/src/components/production-list-table/production-list-table.component.jsx b/client/src/components/production-list-table/production-list-table.component.jsx index ea3d9c2a2..c8763ad13 100644 --- a/client/src/components/production-list-table/production-list-table.component.jsx +++ b/client/src/components/production-list-table/production-list-table.component.jsx @@ -51,8 +51,8 @@ export function ProductionListTable({ loading, data, refetch, bodyshop, technici const initialColumnsRef = useRef( (initialStateRef.current && - bodyshop.production_config - .find((p) => p.name === defaultView) + bodyshop?.production_config + ?.find((p) => p.name === defaultView) ?.columns.columnKeys.map((k) => { return { ...ProductionListColumns({ @@ -76,8 +76,8 @@ export function ProductionListTable({ loading, data, refetch, bodyshop, technici const { t } = useTranslation(); const matchingColumnConfig = useMemo(() => { - return bodyshop.production_config.find((p) => p.name === defaultView); - }, [bodyshop.production_config, defaultView]); + return bodyshop?.production_config?.find((p) => p.name === defaultView); + }, [bodyshop.production_config]); useEffect(() => { const newColumns =