-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* style: gantt chart polishing * chore: sidebar y-axis drag and drop * chore: remove y-axis drag and drop from the main content * refactor: drop end function * refactor: resizing logic * chore: x-axis block move * chore: x-axis block move flag * chore: update scroll end logic * style: modules gantt chart * style: block background tint * refactor: context dispatcher types * refactor: draggable component * chore: filters added to gantt chart * refactor: folder structure * style: cycle blocks * chore: move to block arrow * chore: move to block on the right side arrow * chore: added proper comments for functions * refactor: blocks render logic * fix: x-axis drag and drop * chore: minor ui fixes * chore: remove link tag from blocks --------- Co-authored-by: Aaryan Khandelwal <aaryan610@Aaryans-MacBook-Pro.local>
- Loading branch information
Showing
38 changed files
with
965 additions
and
635 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,83 @@ | ||
import { useRouter } from "next/router"; | ||
|
||
// ui | ||
import { Tooltip } from "components/ui"; | ||
// icons | ||
import { ContrastIcon } from "components/icons"; | ||
// helpers | ||
import { getDateRangeStatus, renderShortDate } from "helpers/date-time.helper"; | ||
// types | ||
import { ICycle } from "types"; | ||
|
||
export const CycleGanttBlock = ({ data }: { data: ICycle }) => { | ||
const router = useRouter(); | ||
const { workspaceSlug } = router.query; | ||
|
||
const cycleStatus = getDateRangeStatus(data?.start_date, data?.end_date); | ||
|
||
return ( | ||
<div | ||
className="flex items-center relative h-full w-full rounded" | ||
style={{ | ||
backgroundColor: | ||
cycleStatus === "current" | ||
? "#09a953" | ||
: cycleStatus === "upcoming" | ||
? "#f7ae59" | ||
: cycleStatus === "completed" | ||
? "#3f76ff" | ||
: cycleStatus === "draft" | ||
? "rgb(var(--color-text-200))" | ||
: "", | ||
}} | ||
onClick={() => router.push(`/${workspaceSlug}/projects/${data?.project}/cycles/${data?.id}`)} | ||
> | ||
<div className="absolute top-0 left-0 h-full w-full bg-custom-background-100/50" /> | ||
<Tooltip | ||
tooltipContent={ | ||
<div className="space-y-1"> | ||
<h5>{data?.name}</h5> | ||
<div> | ||
{renderShortDate(data?.start_date ?? "")} to {renderShortDate(data?.end_date ?? "")} | ||
</div> | ||
</div> | ||
} | ||
position="top-left" | ||
> | ||
<div className="relative text-custom-text-100 text-sm truncate py-1 px-2.5 w-full"> | ||
{data?.name} | ||
</div> | ||
</Tooltip> | ||
</div> | ||
); | ||
}; | ||
|
||
export const CycleGanttSidebarBlock = ({ data }: { data: ICycle }) => { | ||
const router = useRouter(); | ||
const { workspaceSlug } = router.query; | ||
|
||
const cycleStatus = getDateRangeStatus(data?.start_date, data?.end_date); | ||
|
||
return ( | ||
<div | ||
className="relative w-full flex items-center gap-2 h-full" | ||
onClick={() => router.push(`/${workspaceSlug}/projects/${data?.project}/cycles/${data?.id}`)} | ||
> | ||
<ContrastIcon | ||
className="h-5 w-5 flex-shrink-0" | ||
color={`${ | ||
cycleStatus === "current" | ||
? "#09a953" | ||
: cycleStatus === "upcoming" | ||
? "#f7ae59" | ||
: cycleStatus === "completed" | ||
? "#3f76ff" | ||
: cycleStatus === "draft" | ||
? "rgb(var(--color-text-200))" | ||
: "" | ||
}`} | ||
/> | ||
<h6 className="text-sm font-medium flex-grow truncate">{data?.name}</h6> | ||
</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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export * from "./blocks"; | ||
export * from "./cycle-issues-layout"; | ||
export * from "./cycles-list-layout"; |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.