mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
73 lines
2.2 KiB
TypeScript
73 lines
2.2 KiB
TypeScript
import { MutableRefObject, memo } from "react";
|
|
//types
|
|
import { TIssue, IIssueDisplayProperties, IIssueMap } from "@plane/types";
|
|
import { KanbanIssueBlock } from "@/components/issues";
|
|
import { TRenderQuickActions } from "../list/list-view-types";
|
|
// components
|
|
|
|
interface IssueBlocksListProps {
|
|
sub_group_id: string;
|
|
groupId: string;
|
|
issuesMap: IIssueMap;
|
|
issueIds: string[];
|
|
displayProperties: IIssueDisplayProperties | undefined;
|
|
isDragDisabled: boolean;
|
|
updateIssue: ((projectId: string, issueId: string, data: Partial<TIssue>) => Promise<void>) | undefined;
|
|
quickActions: TRenderQuickActions;
|
|
canEditProperties: (projectId: string | undefined) => boolean;
|
|
canDropOverIssue: boolean;
|
|
scrollableContainerRef?: MutableRefObject<HTMLDivElement | null>;
|
|
}
|
|
|
|
const KanbanIssueBlocksListMemo: React.FC<IssueBlocksListProps> = (props) => {
|
|
const {
|
|
sub_group_id,
|
|
groupId,
|
|
issuesMap,
|
|
issueIds,
|
|
displayProperties,
|
|
isDragDisabled,
|
|
canDropOverIssue,
|
|
updateIssue,
|
|
quickActions,
|
|
canEditProperties,
|
|
scrollableContainerRef,
|
|
} = props;
|
|
|
|
return (
|
|
<>
|
|
{issueIds && issueIds.length > 0 ? (
|
|
<>
|
|
{issueIds.map((issueId) => {
|
|
if (!issueId) return null;
|
|
|
|
let draggableId = issueId;
|
|
if (groupId) draggableId = `${draggableId}__${groupId}`;
|
|
if (sub_group_id) draggableId = `${draggableId}__${sub_group_id}`;
|
|
|
|
return (
|
|
<KanbanIssueBlock
|
|
key={draggableId}
|
|
issueId={issueId}
|
|
groupId={groupId}
|
|
subGroupId={sub_group_id}
|
|
issuesMap={issuesMap}
|
|
displayProperties={displayProperties}
|
|
updateIssue={updateIssue}
|
|
quickActions={quickActions}
|
|
draggableId={draggableId}
|
|
isDragDisabled={isDragDisabled}
|
|
canDropOverIssue={canDropOverIssue}
|
|
canEditProperties={canEditProperties}
|
|
scrollableContainerRef={scrollableContainerRef}
|
|
/>
|
|
);
|
|
})}
|
|
</>
|
|
) : null}
|
|
</>
|
|
);
|
|
};
|
|
|
|
export const KanbanIssueBlocksList = memo(KanbanIssueBlocksListMemo);
|