Create test run editor

This commit is contained in:
Takeshi Kimata
2024-04-13 00:18:11 +09:00
parent 5f9d849ee1
commit 4b2608d176
10 changed files with 238 additions and 258 deletions

View File

@@ -27,12 +27,12 @@ const headerColumns = [
];
type Props = {
projectId: string;
runs: RunType[];
onEditRun: (run: RunType) => void;
onDeleteRun: (runId: number) => void;
};
export default function RunsTable({ runs, onEditRun, onDeleteRun }: Props) {
export default function RunsTable({ projectId, runs, onDeleteRun }: Props) {
const [sortDescriptor, setSortDescriptor] = useState<SortDescriptor>({
column: "id",
direction: "ascending",
@@ -62,7 +62,7 @@ export default function RunsTable({ runs, onEditRun, onDeleteRun }: Props) {
return (
<Link
underline="hover"
href={`/runs/${run.id}/home`}
href={`/projects/${projectId}/runs/${run.id}`}
className="text-blue-500"
>
{cellValue}
@@ -87,9 +87,6 @@ export default function RunsTable({ runs, onEditRun, onDeleteRun }: Props) {
</Button>
</DropdownTrigger>
<DropdownMenu aria-label="run actions">
<DropdownItem onClick={() => onEditRun(run)}>
Edit run
</DropdownItem>
<DropdownItem
className="text-danger"
onClick={() => onDeleteRun(run.id)}