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 53173e5bb..0ed42b338 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 @@ -222,19 +222,21 @@ export function ProductionBoardKanbanComponent({ technician, card, bodyshop, - (associationSettings && + associationSettings && associationSettings.kanban_settings && - Object.keys(associationSettings.kanban_settings).length > 0) || { - ats: true, - clm_no: true, - compact: false, - ownr_nm: true, - sublets: true, - ins_co_nm: true, - production_note: true, - employeeassignments: true, - scheduled_completion: true, - } + Object.keys(associationSettings.kanban_settings).length > 0 + ? associationSettings.kanban_settings + : { + ats: true, + clm_no: true, + compact: false, + ownr_nm: true, + sublets: true, + ins_co_nm: true, + production_note: true, + employeeassignments: true, + scheduled_completion: true, + } ) } onCardDragEnd={handleDragEnd} diff --git a/hasura/migrations/1637255828361_alter_table_public_associations_alter_column_kanban_settings/down.sql b/hasura/migrations/1637255828361_alter_table_public_associations_alter_column_kanban_settings/down.sql new file mode 100644 index 000000000..117cc4a4e --- /dev/null +++ b/hasura/migrations/1637255828361_alter_table_public_associations_alter_column_kanban_settings/down.sql @@ -0,0 +1 @@ +alter table "public"."associations" alter column "kanban_settings" set default jsonb_build_object(); diff --git a/hasura/migrations/1637255828361_alter_table_public_associations_alter_column_kanban_settings/up.sql b/hasura/migrations/1637255828361_alter_table_public_associations_alter_column_kanban_settings/up.sql new file mode 100644 index 000000000..485ed2ac1 --- /dev/null +++ b/hasura/migrations/1637255828361_alter_table_public_associations_alter_column_kanban_settings/up.sql @@ -0,0 +1 @@ +alter table "public"."associations" alter column "kanban_settings" set default '{"ats": true, "clm_no": true, "compact": false, "ownr_nm": true, "sublets": true, "ins_co_nm": true, "production_note": true, "employeeassignments": true, "scheduled_completion": true}';