Merged in feature/IO-2985-Production-List-View-Null-Handling (pull request #1818)
IO-2985-Production-List-View-Null-Handling - Handle Null md_production_config
This commit is contained in:
@@ -185,7 +185,7 @@ function ProductionBoardKanbanComponent({ data, bodyshop, refetch, insertAuditTr
|
|||||||
const cardSettings = useMemo(() => {
|
const cardSettings = useMemo(() => {
|
||||||
const kanbanSettings = associationSettings?.kanban_settings;
|
const kanbanSettings = associationSettings?.kanban_settings;
|
||||||
return mergeWithDefaults(kanbanSettings);
|
return mergeWithDefaults(kanbanSettings);
|
||||||
}, [associationSettings]);
|
}, [associationSettings?.kanban_settings]);
|
||||||
|
|
||||||
const handleSettingsChange = () => {
|
const handleSettingsChange = () => {
|
||||||
setFilter(defaultFilters);
|
setFilter(defaultFilters);
|
||||||
|
|||||||
@@ -457,7 +457,8 @@ export function ProductionListConfigManager({
|
|||||||
value={activeView}
|
value={activeView}
|
||||||
disabled={open || isAddingNewProfile} // Disable the Select box when the popover is open or adding a new profile
|
disabled={open || isAddingNewProfile} // Disable the Select box when the popover is open or adding a new profile
|
||||||
>
|
>
|
||||||
{bodyshop.production_config
|
{bodyshop?.production_config &&
|
||||||
|
bodyshop.production_config
|
||||||
.slice()
|
.slice()
|
||||||
.sort((a, b) =>
|
.sort((a, b) =>
|
||||||
a.name === t("production.constants.main_profile")
|
a.name === t("production.constants.main_profile")
|
||||||
|
|||||||
@@ -51,8 +51,8 @@ export function ProductionListTable({ loading, data, refetch, bodyshop, technici
|
|||||||
|
|
||||||
const initialColumnsRef = useRef(
|
const initialColumnsRef = useRef(
|
||||||
(initialStateRef.current &&
|
(initialStateRef.current &&
|
||||||
bodyshop.production_config
|
bodyshop?.production_config
|
||||||
.find((p) => p.name === defaultView)
|
?.find((p) => p.name === defaultView)
|
||||||
?.columns.columnKeys.map((k) => {
|
?.columns.columnKeys.map((k) => {
|
||||||
return {
|
return {
|
||||||
...ProductionListColumns({
|
...ProductionListColumns({
|
||||||
@@ -76,8 +76,8 @@ export function ProductionListTable({ loading, data, refetch, bodyshop, technici
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const matchingColumnConfig = useMemo(() => {
|
const matchingColumnConfig = useMemo(() => {
|
||||||
return bodyshop.production_config.find((p) => p.name === defaultView);
|
return bodyshop?.production_config?.find((p) => p.name === defaultView);
|
||||||
}, [bodyshop.production_config, defaultView]);
|
}, [bodyshop.production_config]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const newColumns =
|
const newColumns =
|
||||||
|
|||||||
Reference in New Issue
Block a user