mirror of
https://github.com/hex248/sprint.git
synced 2026-02-08 02:33:01 +00:00
implemented issue identifiers (<project_blob>-<issue_number>)
This commit is contained in:
@@ -78,18 +78,27 @@ function Index() {
|
|||||||
</div>
|
</div>
|
||||||
{/* main body */}
|
{/* main body */}
|
||||||
<div className="w-full h-full flex items-start justify-between pt-2 gap-2">
|
<div className="w-full h-full flex items-start justify-between pt-2 gap-2">
|
||||||
{/* issues list (table) */}
|
{selectedProject && issues.length > 0 && (
|
||||||
<IssuesTable
|
<>
|
||||||
issues={issues}
|
{/* issues list (table) */}
|
||||||
columns={{ description: false }}
|
<IssuesTable
|
||||||
issueSelectAction={setSelectedIssue}
|
project={selectedProject}
|
||||||
className="border w-full flex-shrink"
|
issues={issues}
|
||||||
/>
|
columns={{ description: false }}
|
||||||
{/* issue detail pane */}
|
issueSelectAction={setSelectedIssue}
|
||||||
{selectedIssue && (
|
className="border w-full flex-shrink"
|
||||||
<div className="border w-2xl">
|
/>
|
||||||
<IssueDetailPane issue={selectedIssue} close={() => setSelectedIssue(null)} />
|
{/* issue detail pane */}
|
||||||
</div>
|
{selectedIssue && (
|
||||||
|
<div className="border w-2xl">
|
||||||
|
<IssueDetailPane
|
||||||
|
project={selectedProject}
|
||||||
|
issue={selectedIssue}
|
||||||
|
close={() => setSelectedIssue(null)}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|||||||
@@ -1,13 +1,28 @@
|
|||||||
import type { IssueRecord } from "@issue/shared";
|
import type { IssueRecord, ProjectRecord } from "@issue/shared";
|
||||||
import { X } from "lucide-react";
|
import { X } from "lucide-react";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
|
import { issueID } from "@/lib/utils";
|
||||||
|
|
||||||
export function IssueDetailPane({ issue, close }: { issue: IssueRecord; close: () => void }) {
|
export function IssueDetailPane({
|
||||||
|
project,
|
||||||
|
issue,
|
||||||
|
close,
|
||||||
|
}: {
|
||||||
|
project: ProjectRecord;
|
||||||
|
issue: IssueRecord;
|
||||||
|
close: () => void;
|
||||||
|
}) {
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col items-end">
|
<div className="flex flex-col">
|
||||||
<Button variant={"dummy"} onClick={close} className="px-0 py-0 w-6 h-6">
|
<div className="flex flex-row items-center justify-end border-b">
|
||||||
<X />
|
<span className="w-full px-0.5">
|
||||||
</Button>
|
<p className="text-sm w-fit px-0.75">{issueID(project.blob, issue.number)}</p>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<Button variant={"dummy"} onClick={close} className="px-0 py-0 w-6 h-6">
|
||||||
|
<X />
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div className="flex flex-col w-full p-2 gap-2">
|
<div className="flex flex-col w-full p-2 gap-2">
|
||||||
<h1 className="text-md">{issue.title}</h1>
|
<h1 className="text-md">{issue.title}</h1>
|
||||||
|
|||||||
@@ -1,25 +1,26 @@
|
|||||||
import type { IssueRecord } from "@issue/shared";
|
import type { IssueRecord, ProjectRecord } from "@issue/shared";
|
||||||
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table";
|
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn, issueID } from "@/lib/utils";
|
||||||
|
|
||||||
export function IssuesTable({
|
export function IssuesTable({
|
||||||
|
project,
|
||||||
issues,
|
issues,
|
||||||
columns = {},
|
columns = {},
|
||||||
issueSelectAction,
|
issueSelectAction,
|
||||||
className,
|
className,
|
||||||
}: {
|
}: {
|
||||||
|
project: ProjectRecord;
|
||||||
issues: IssueRecord[];
|
issues: IssueRecord[];
|
||||||
columns?: { id?: boolean; title?: boolean; description?: boolean; assignee?: boolean };
|
columns?: { id?: boolean; title?: boolean; description?: boolean; assignee?: boolean };
|
||||||
issueSelectAction?: (issue: IssueRecord) => void;
|
issueSelectAction?: (issue: IssueRecord) => void;
|
||||||
className: string;
|
className: string;
|
||||||
}) {
|
}) {
|
||||||
if (issues.length === 0) return;
|
|
||||||
return (
|
return (
|
||||||
<Table className={cn(className)}>
|
<Table className={cn(className)}>
|
||||||
<TableHeader>
|
<TableHeader>
|
||||||
<TableRow hoverEffect={false}>
|
<TableRow hoverEffect={false}>
|
||||||
{(columns.id == null || columns.id === true) && (
|
{(columns.id == null || columns.id === true) && (
|
||||||
<TableHead className="w-[1px] border-r">ID</TableHead>
|
<TableHead className="text-right w-[1px] border-r">ID</TableHead>
|
||||||
)}
|
)}
|
||||||
{(columns.title == null || columns.title === true) && <TableHead>Title</TableHead>}
|
{(columns.title == null || columns.title === true) && <TableHead>Title</TableHead>}
|
||||||
{(columns.description == null || columns.description === true) && (
|
{(columns.description == null || columns.description === true) && (
|
||||||
@@ -39,8 +40,8 @@ export function IssuesTable({
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{(columns.id == null || columns.id === true) && (
|
{(columns.id == null || columns.id === true) && (
|
||||||
<TableCell className="font-medium border-r">
|
<TableCell className="font-medium border-r text-right">
|
||||||
{String(issue.id).padStart(3, "0")}
|
{issue.number.toString().padStart(3, "0")}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
)}
|
)}
|
||||||
{(columns.title == null || columns.title === true) && (
|
{(columns.title == null || columns.title === true) && (
|
||||||
|
|||||||
Reference in New Issue
Block a user