diff --git a/web/core/components/issues/issue-layouts/kanban/default.tsx b/web/core/components/issues/issue-layouts/kanban/default.tsx index a8a21a299..42377585b 100644 --- a/web/core/components/issues/issue-layouts/kanban/default.tsx +++ b/web/core/components/issues/issue-layouts/kanban/default.tsx @@ -52,7 +52,6 @@ export interface IKanBan { scrollableContainerRef?: MutableRefObject; handleOnDrop: (source: GroupDropLocation, destination: GroupDropLocation) => Promise; showEmptyGroup?: boolean; - subGroupIssueHeaderCount?: (listId: string) => number; } export const KanBan: React.FC = observer((props) => { @@ -77,7 +76,6 @@ export const KanBan: React.FC = observer((props) => { scrollableContainerRef, handleOnDrop, showEmptyGroup = true, - subGroupIssueHeaderCount, orderBy, isDropDisabled, dropErrorMessage, @@ -116,7 +114,7 @@ export const KanBan: React.FC = observer((props) => { showIssues: true, }; if (!showEmptyGroup) { - groupVisibility.showGroup = subGroupIssueHeaderCount ? subGroupIssueHeaderCount(_list.id) > 0 : true; + groupVisibility.showGroup = (getGroupIssueCount(_list.id, undefined, false) ?? 0) > 0; } return groupVisibility; } else { @@ -172,7 +170,7 @@ export const KanBan: React.FC = observer((props) => { { ? (groupedIssueIds as TSubGroupedIssues)?.[groupId]?.[sub_group_id] ?? [] : (groupedIssueIds as TGroupedIssues)?.[groupId] ?? []; - const groupIssueCount = getGroupIssueCount(groupId, sub_group_id, false); + const groupIssueCount = getGroupIssueCount(groupId, sub_group_id, false) ?? 0; const nextPageResults = getPaginationData(groupId, sub_group_id)?.nextPageResults; @@ -230,10 +230,7 @@ export const KanbanGroup = observer((props: IKanbanGroup) => { ); - const shouldLoadMore = - nextPageResults === undefined && groupIssueCount !== undefined - ? issueIds?.length < groupIssueCount - : !!nextPageResults; + const shouldLoadMore = nextPageResults === undefined ? issueIds?.length < groupIssueCount : !!nextPageResults; const canOverlayBeVisible = orderBy !== "sort_order" || isDropDisabled; const shouldOverlayBeVisible = isDraggingOverColumn && canOverlayBeVisible; diff --git a/web/core/components/issues/issue-layouts/kanban/swimlanes.tsx b/web/core/components/issues/issue-layouts/kanban/swimlanes.tsx index 8f11dbdcb..c5309bfa9 100644 --- a/web/core/components/issues/issue-layouts/kanban/swimlanes.tsx +++ b/web/core/components/issues/issue-layouts/kanban/swimlanes.tsx @@ -196,9 +196,6 @@ const SubGroupSwimlane: React.FC = observer((props) => { orderBy={orderBy} isDropDisabled={_list.isDropDisabled} dropErrorMessage={_list.dropErrorMessage} - subGroupIssueHeaderCount={(groupByListId: string) => - getGroupIssueCount(groupByListId, _list.id, true) ?? 0 - } /> )} diff --git a/web/core/components/issues/issue-layouts/list/list-group.tsx b/web/core/components/issues/issue-layouts/list/list-group.tsx index 1dd6dbe6d..060714f33 100644 --- a/web/core/components/issues/issue-layouts/list/list-group.tsx +++ b/web/core/components/issues/issue-layouts/list/list-group.tsx @@ -64,7 +64,7 @@ interface Props { export const ListGroup = observer((props: Props) => { const { - groupIssueIds, + groupIssueIds = [], group, issuesMap, group_by, @@ -101,7 +101,7 @@ export const ListGroup = observer((props: Props) => { useIntersectionObserver(containerRef, intersectionElement, loadMoreIssues, `50% 0% 50% 0%`); - const groupIssueCount = getGroupIssueCount(group.id, undefined, false); + const groupIssueCount = getGroupIssueCount(group.id, undefined, false) ?? 0; const nextPageResults = getPaginationData(group.id, undefined)?.nextPageResults; const isPaginating = !!getIssueLoader(group.id); @@ -223,7 +223,7 @@ export const ListGroup = observer((props: Props) => { const isGroupByCreatedBy = group_by === "created_by"; const shouldExpand = (!!groupIssueCount && isExpanded) || !group_by; - return groupIssueIds && !isNil(groupIssueCount) && validateEmptyIssueGroups(groupIssueCount) ? ( + return validateEmptyIssueGroups(groupIssueCount) ? (