import React from "react"; // react beautiful dnd import { Droppable } from "@hello-pangea/dnd"; // components import { KanBanGroupByHeaderRoot } from "./headers/group-by-root"; import { IssueBlock } from "./block"; // constants import { ISSUE_STATE_GROUPS, ISSUE_PRIORITIES, getValueFromObject } from "constants/issue"; // mobx import { observer } from "mobx-react-lite"; // mobx import { useMobxStore } from "lib/mobx/store-provider"; import { RootStore } from "store/root"; export interface IGroupByKanBan { issues: any; sub_group_by: string | null; group_by: string | null; sub_group_id: string; list: any; listKey: string; isDragDisabled: boolean; handleIssues?: (sub_group_by: string | null, group_by: string | null, issue: any) => void; display_properties: any; kanBanToggle: any; handleKanBanToggle: any; } const GroupByKanBan: React.FC = observer( ({ issues, sub_group_by, group_by, sub_group_id = "null", list, listKey, isDragDisabled, handleIssues, display_properties, kanBanToggle, handleKanBanToggle, }) => { const verticalAlignPosition = (_list: any) => kanBanToggle?.groupByHeaderMinMax.includes(getValueFromObject(_list, listKey) as string); return (
{list && list.length > 0 && list.map((_list: any) => (
{sub_group_by === null && (
)}
{(provided: any, snapshot: any) => (
{issues ? ( ) : ( isDragDisabled && (
{/*
Drop here
*/}
) )} {provided.placeholder}
)}
))}
); } ); export interface IKanBan { issues: any; sub_group_by: string | null; group_by: string | null; sub_group_id?: string; handleDragDrop?: (result: any) => void | undefined; handleIssues?: (sub_group_by: string | null, group_by: string | null, issue: any) => void; display_properties: any; kanBanToggle: any; handleKanBanToggle: any; } export const KanBan: React.FC = observer( ({ issues, sub_group_by, group_by, sub_group_id = "null", handleIssues, display_properties, kanBanToggle, handleKanBanToggle, }) => { const { project: projectStore, issueKanBanView: issueKanBanViewStore }: RootStore = useMobxStore(); return (
{group_by && group_by === "state" && ( )} {group_by && group_by === "state_detail.group" && ( )} {group_by && group_by === "priority" && ( )} {group_by && group_by === "labels" && ( )} {group_by && group_by === "assignees" && ( )} {group_by && group_by === "created_by" && ( )}
); } );