forked from github/plane
b3393f5c48
* fix filters mutation issue * fix all issue filters for state group * disable drag in Kanban for non members * remove unused imports
66 lines
1.9 KiB
TypeScript
66 lines
1.9 KiB
TypeScript
import { memo } from "react";
|
|
//types
|
|
import { TIssue, IIssueDisplayProperties, IIssueMap } from "@plane/types";
|
|
import { EIssueActions } from "../types";
|
|
// components
|
|
import { KanbanIssueBlock } from "components/issues";
|
|
|
|
interface IssueBlocksListProps {
|
|
sub_group_id: string;
|
|
columnId: string;
|
|
issuesMap: IIssueMap;
|
|
issueIds: string[];
|
|
displayProperties: IIssueDisplayProperties | undefined;
|
|
isDragDisabled: boolean;
|
|
handleIssues: (issue: TIssue, action: EIssueActions) => void;
|
|
quickActions: (issue: TIssue, customActionButton?: React.ReactElement) => React.ReactNode;
|
|
canEditProperties: (projectId: string | undefined) => boolean;
|
|
}
|
|
|
|
const KanbanIssueBlocksListMemo: React.FC<IssueBlocksListProps> = (props) => {
|
|
const {
|
|
sub_group_id,
|
|
columnId,
|
|
issuesMap,
|
|
issueIds,
|
|
displayProperties,
|
|
isDragDisabled,
|
|
handleIssues,
|
|
quickActions,
|
|
canEditProperties,
|
|
} = props;
|
|
|
|
return (
|
|
<>
|
|
{issueIds && issueIds.length > 0 ? (
|
|
<>
|
|
{issueIds.map((issueId, index) => {
|
|
if (!issueId) return null;
|
|
|
|
let draggableId = issueId;
|
|
if (columnId) draggableId = `${draggableId}__${columnId}`;
|
|
if (sub_group_id) draggableId = `${draggableId}__${sub_group_id}`;
|
|
|
|
return (
|
|
<KanbanIssueBlock
|
|
key={draggableId}
|
|
issueId={issueId}
|
|
issuesMap={issuesMap}
|
|
displayProperties={displayProperties}
|
|
handleIssues={handleIssues}
|
|
quickActions={quickActions}
|
|
draggableId={draggableId}
|
|
index={index}
|
|
isDragDisabled={isDragDisabled}
|
|
canEditProperties={canEditProperties}
|
|
/>
|
|
);
|
|
})}
|
|
</>
|
|
) : null}
|
|
</>
|
|
);
|
|
};
|
|
|
|
export const KanbanIssueBlocksList = memo(KanbanIssueBlocksListMemo);
|