-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: implemented assigned profiles issues and filters and updated w…
…orkflow in list layout (#2462)
- Loading branch information
1 parent
4bd7363
commit 123634f
Showing
45 changed files
with
2,774 additions
and
1,144 deletions.
There are no files selected for viewing
85 changes: 85 additions & 0 deletions
85
web/components/issues/issue-layouts/kanban/profile-issues-root.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
import React from "react"; | ||
// react beautiful dnd | ||
import { DragDropContext } from "@hello-pangea/dnd"; | ||
// mobx | ||
import { observer } from "mobx-react-lite"; | ||
// components | ||
import { KanBanSwimLanes } from "./swimlanes"; | ||
import { KanBan } from "./default"; | ||
// store | ||
import { useMobxStore } from "lib/mobx/store-provider"; | ||
import { RootStore } from "store/root"; | ||
|
||
export interface IProfileIssuesKanBanLayout {} | ||
|
||
export const ProfileIssuesKanBanLayout: React.FC = observer(() => { | ||
const { | ||
profileIssues: profileIssuesStore, | ||
profileIssueFilters: profileIssueFiltersStore, | ||
issueKanBanView: issueKanBanViewStore, | ||
}: RootStore = useMobxStore(); | ||
|
||
const issues = profileIssuesStore?.getIssues; | ||
|
||
const sub_group_by: string | null = profileIssueFiltersStore?.userDisplayFilters?.sub_group_by || null; | ||
|
||
const group_by: string | null = profileIssueFiltersStore?.userDisplayFilters?.group_by || null; | ||
|
||
const display_properties = profileIssueFiltersStore?.userDisplayProperties || null; | ||
|
||
const currentKanBanView: "swimlanes" | "default" = profileIssueFiltersStore?.userDisplayFilters?.sub_group_by | ||
? "swimlanes" | ||
: "default"; | ||
|
||
const onDragEnd = (result: any) => { | ||
if (!result) return; | ||
|
||
if ( | ||
result.destination && | ||
result.source && | ||
result.destination.droppableId === result.source.droppableId && | ||
result.destination.index === result.source.index | ||
) | ||
return; | ||
|
||
currentKanBanView === "default" | ||
? issueKanBanViewStore?.handleDragDrop(result.source, result.destination) | ||
: issueKanBanViewStore?.handleSwimlaneDragDrop(result.source, result.destination); | ||
}; | ||
|
||
const updateIssue = (sub_group_by: string | null, group_by: string | null, issue: any) => { | ||
profileIssuesStore.updateIssueStructure(group_by, sub_group_by, issue); | ||
}; | ||
|
||
const handleKanBanToggle = (toggle: "groupByHeaderMinMax" | "subgroupByIssuesVisibility", value: string) => { | ||
issueKanBanViewStore.handleKanBanToggle(toggle, value); | ||
}; | ||
|
||
return ( | ||
<div className={`relative min-w-full w-max min-h-full h-max bg-custom-background-90 px-3`}> | ||
<DragDropContext onDragEnd={onDragEnd}> | ||
{currentKanBanView === "default" ? ( | ||
<KanBan | ||
issues={issues} | ||
sub_group_by={sub_group_by} | ||
group_by={group_by} | ||
handleIssues={updateIssue} | ||
display_properties={display_properties} | ||
kanBanToggle={issueKanBanViewStore?.kanBanToggle} | ||
handleKanBanToggle={handleKanBanToggle} | ||
/> | ||
) : ( | ||
<KanBanSwimLanes | ||
issues={issues} | ||
sub_group_by={sub_group_by} | ||
group_by={group_by} | ||
handleIssues={updateIssue} | ||
display_properties={display_properties} | ||
kanBanToggle={issueKanBanViewStore?.kanBanToggle} | ||
handleKanBanToggle={handleKanBanToggle} | ||
/> | ||
)} | ||
</DragDropContext> | ||
</div> | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,52 @@ | ||
import { FC } from "react"; | ||
// components | ||
import { KanBanProperties } from "./properties"; | ||
// ui | ||
import { Tooltip } from "@plane/ui"; | ||
|
||
interface IssueBlockProps { | ||
columnId: string; | ||
issues: any; | ||
handleIssues?: (group_by: string | null, issue: any) => void; | ||
display_properties: any; | ||
states: any; | ||
labels: any; | ||
members: any; | ||
priorities: any; | ||
} | ||
|
||
export const IssueBlock = ({ columnId, issues, handleIssues, display_properties }: IssueBlockProps) => ( | ||
<> | ||
{issues && issues.length > 0 ? ( | ||
<> | ||
{issues.map((issue: any, index: any) => ( | ||
export const IssueBlock: FC<IssueBlockProps> = (props) => { | ||
const { columnId, issues, handleIssues, display_properties, states, labels, members, priorities } = props; | ||
|
||
return ( | ||
<> | ||
{issues && | ||
issues?.length > 0 && | ||
issues.map((issue: any, index: any) => ( | ||
<div | ||
key={index} | ||
className={`text-sm p-3 shadow-custom-shadow-2xs transition-all bg-custom-background-100 flex items-center flex-wrap gap-3 border-b border-custom-border-200`} | ||
className={`text-sm p-3 shadow-custom-shadow-2xs transition-all bg-custom-background-100 flex items-center gap-3 border-b border-custom-border-200`} | ||
> | ||
{display_properties && display_properties?.key && ( | ||
<div className="flex-shrink-0 text-xs text-custom-text-300">ONE-{issue.sequence_id}</div> | ||
)} | ||
<div className="line-clamp-1 text-sm font-medium text-custom-text-100">{issue.name}</div> | ||
<Tooltip tooltipHeading="Title" tooltipContent={issue.name}> | ||
<div className="line-clamp-1 text-sm font-medium text-custom-text-100">{issue.name}</div> | ||
</Tooltip> | ||
<div className="ml-auto flex-shrink-0"> | ||
<KanBanProperties | ||
columnId={columnId} | ||
issue={issue} | ||
handleIssues={handleIssues} | ||
display_properties={display_properties} | ||
states={states} | ||
labels={labels} | ||
members={members} | ||
priorities={priorities} | ||
/> | ||
</div> | ||
</div> | ||
))} | ||
</> | ||
) : ( | ||
<div className="absolute top-0 left-0 w-full h-full flex items-center justify-center"> | ||
No issues are available | ||
</div> | ||
)} | ||
</> | ||
); | ||
</> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.