Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ build
!.env.example
.DS_Store
next-env.d.ts
*.tsbuildinfo
19,647 changes: 10,814 additions & 8,833 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@
"prepare": "husky || true"
},
"dependencies": {
"@octokit/auth-app": "6.1.1",
"@octokit/auth-app": "^7.1.5",
"@octokit/graphql-schema": "15.26.0",
"@primer/octicons-react": "19.15.2",
"@primer/react": "36.27.0",
"@probot/octokit-plugin-config": "^4.0.0",
"@t3-oss/env-nextjs": "0.13.7",
"@tanstack/react-query": "4.36.1",
"@trpc/client": "10.45.3",
Expand All @@ -34,9 +35,9 @@
"fast-safe-stringify": "2.1.1",
"fuse.js": "7.1.0",
"next": "16.2.6",
"next-auth": "4.24.12",
"octokit": "3.2.2",
"probot": "13.4.7",
"next-auth": "4.24.14",
"octokit": "^5.0.5",
"probot": "14.3.2",
"proxy-agent": "6.5.0",
"react": "18.3.1",
"react-dom": "18.3.1",
Expand All @@ -50,6 +51,7 @@
},
"devDependencies": {
"@eslint/js": "9.39.2",
"@octokit/openapi-webhooks-types-transition": "^12.1.0",
"@tanstack/eslint-plugin-query": "5.78.0",
"@tsconfig/next": "^2.0.6",
"@types/node": "^22.19.15",
Expand Down
192 changes: 106 additions & 86 deletions src/app/[organizationId]/forks/[forkId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ const Fork = () => {
})

// perform search if there is a search value
let mirrorSet = []
let mirrorSet: typeof mirrors = []
if (searchValue) {
mirrorSet = fuse.search(searchValue).map((result) => result.item)
} else {
Expand Down Expand Up @@ -566,94 +566,114 @@ const Fork = () => {
<DataTable
aria-describedby="mirrors table"
aria-labelledby="mirrors table"
data={mirrorPaginationSet}
columns={[
{
header: 'Mirror name',
rowHeader: true,
field: 'name',
sortBy: 'alphanumeric',
width: '400px',
renderCell: (row) => {
return (
<Link
sx={{
paddingRight: '5px',
fontWeight: 'bold',
fontSize: 2,
}}
href={row.html_url}
target="_blank"
rel="noreferrer noopener"
>
{row.name}
</Link>
)
data={
mirrorPaginationSet as Array<{
id: number
name: string
html_url: string
updated_at: string
}>
}
// `satisfies` cannot be used here — the issue is that under moduleResolution:"bundler", DataTable's
// generic Data param isn't inferred from the data prop and falls back to UniqueRow, making `field`
// only accept "id". `satisfies` would still error on field:"name" etc. `as any` is the only workaround
// until @primer/react fixes DataTable generic inference (draft component).
columns={
[
{
header: 'Mirror name',
rowHeader: true,
field: 'name',
sortBy: 'alphanumeric',
width: '400px',
// eslint-disable-next-line @typescript-eslint/no-explicit-any
renderCell: (row: any) => {
return (
<Link
sx={{
paddingRight: '5px',
fontWeight: 'bold',
fontSize: 2,
}}
href={row.html_url}
target="_blank"
rel="noreferrer noopener"
>
{row.name}
</Link>
)
},
},
},
{
header: 'Last updated',
field: 'updated_at',
sortBy: 'datetime',
width: 'auto',
renderCell: (row) => {
return (
<RelativeTime date={new Date(row.updated_at)} tense="past" />
)
{
header: 'Last updated',
field: 'updated_at',
sortBy: 'datetime',
width: 'auto',
// eslint-disable-next-line @typescript-eslint/no-explicit-any
renderCell: (row: any) => {
return (
<RelativeTime
date={new Date(row.updated_at)}
tense="past"
/>
)
},
},
},
{
id: 'actions',
header: '',
width: '50px',
align: 'end',
renderCell: (row) => {
return (
<ActionMenu>
<ActionMenu.Anchor>
<IconButton
aria-label={`Actions: ${row.name}`}
icon={KebabHorizontalIcon}
variant="invisible"
/>
</ActionMenu.Anchor>
<ActionMenu.Overlay>
<ActionList>
<ActionList.Item
onSelect={() => {
openEditDialog(row.name)
}}
>
<Stack align="center" direction="horizontal">
<Stack.Item>
<Octicon icon={PencilIcon}></Octicon>
</Stack.Item>
<Stack.Item>Edit mirror</Stack.Item>
</Stack>
</ActionList.Item>
<ActionList.Item
variant="danger"
onSelect={() => {
openDeleteDialog(
row.name,
mirrorPaginationSet.length,
)
}}
>
<Stack align="center" direction="horizontal">
<Stack.Item>
<Octicon icon={TrashIcon}></Octicon>
</Stack.Item>
<Stack.Item>Delete mirror</Stack.Item>
</Stack>
</ActionList.Item>
</ActionList>
</ActionMenu.Overlay>
</ActionMenu>
)
{
id: 'actions',
header: '',
width: '50px',
align: 'end',
// eslint-disable-next-line @typescript-eslint/no-explicit-any
renderCell: (row: any) => {
return (
<ActionMenu>
<ActionMenu.Anchor>
<IconButton
aria-label={`Actions: ${row.name}`}
icon={KebabHorizontalIcon}
variant="invisible"
/>
</ActionMenu.Anchor>
<ActionMenu.Overlay>
<ActionList>
<ActionList.Item
onSelect={() => {
openEditDialog(row.name)
}}
>
<Stack align="center" direction="horizontal">
<Stack.Item>
<Octicon icon={PencilIcon}></Octicon>
</Stack.Item>
<Stack.Item>Edit mirror</Stack.Item>
</Stack>
</ActionList.Item>
<ActionList.Item
variant="danger"
onSelect={() => {
openDeleteDialog(
row.name,
mirrorPaginationSet.length,
)
}}
>
<Stack align="center" direction="horizontal">
<Stack.Item>
<Octicon icon={TrashIcon}></Octicon>
</Stack.Item>
<Stack.Item>Delete mirror</Stack.Item>
</Stack>
</ActionList.Item>
</ActionList>
</ActionMenu.Overlay>
</ActionMenu>
)
},
},
},
]}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
] as any
}
cellPadding="spacious"
/>
<Table.Pagination
Expand Down
Loading
Loading