diff --git a/webapp/src/components/kanban/kanban.tsx b/webapp/src/components/kanban/kanban.tsx index 64fc567ed..190895fcf 100644 --- a/webapp/src/components/kanban/kanban.tsx +++ b/webapp/src/components/kanban/kanban.tsx @@ -66,12 +66,7 @@ const Kanban = (props: Props) => { } }, [activeView.fields.defaultTemplateId]) - if (!groupByProperty) { - Utils.assertFailure('Board views must have groupByProperty set') - return
- } - - const propertyValues = groupByProperty.options || [] + const propertyValues = groupByProperty?.options || [] Utils.log(`${propertyValues.length} propertyValues`) const visiblePropertyTemplates = useMemo(() => { @@ -168,7 +163,7 @@ const Kanban = (props: Props) => { }, [cards, visibleGroups, activeView.id, activeView.fields.cardOrder, groupByProperty, props.selectedCardIds]) const onDropToCard = useCallback(async (srcCard: Card, dstCard: Card) => { - if (srcCard.id === dstCard.id) { + if (srcCard.id === dstCard.id || !groupByProperty) { return } Utils.log(`onDropToCard: ${dstCard.title}`) @@ -217,6 +212,11 @@ const Kanban = (props: Props) => { setShowCalculationsMenu(newShowOptions) } + if (!groupByProperty) { + Utils.assertFailure('Board views must have groupByProperty set') + return
+ } + return ( { {/* Hidden columns */} {(hiddenGroups.length > 0 || hiddenCardsCount > 0) && -
- {hiddenGroups.map((group) => ( - onDropToColumn(group.option, card)} - /> - ))} - {hiddenCardsCount > 0 && -
- +
+ {hiddenGroups.map((group) => ( + onDropToColumn(group.option, card)} + /> + ))} + {hiddenCardsCount > 0 && +
+ +
}
} -
}
) diff --git a/webapp/src/components/kanban/kanbanColumnHeader.tsx b/webapp/src/components/kanban/kanbanColumnHeader.tsx index 11184c52c..3228a1a13 100644 --- a/webapp/src/components/kanban/kanbanColumnHeader.tsx +++ b/webapp/src/components/kanban/kanbanColumnHeader.tsx @@ -85,7 +85,6 @@ export default function KanbanColumnHeader(props: Props): JSX.Element { const groupCalculation = props.activeView.fields.kanbanCalculations[props.group.option.id] const calculationValue = groupCalculation ? groupCalculation.calculation : defaultCalculation const calculationProperty = groupCalculation ? props.board.cardProperties.find((property) => property.id === groupCalculation.propertyId) || defaultProperty : defaultProperty - return (