Skip to content

Commit

Permalink
fix / commit id link
Browse files Browse the repository at this point in the history
  • Loading branch information
psiddharthdesign committed Aug 13, 2024
1 parent 621f0d3 commit 91228f2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ export default function AllActivityDetails({
>
<AllActivityTable runs={runs.map(run => ({
...run,
repo_full_name: run.repos?.repo_full_name || 'Unknown repository',
project_name: run.project_name || run.projects?.name || 'Unknown',
project_slug: run.projects?.slug || 'Unknown',
}))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const AllActivityTable = ({ runs, allowedRunsForUser }: {
project_slug: string;
project_name: string;
repo_id: number;
repo_full_name: string;
approver_user_name: string | null;
}[]
allowedRunsForUser: string[]
Expand All @@ -32,7 +33,7 @@ export const AllActivityTable = ({ runs, allowedRunsForUser }: {
<TableHead className="text-left">Commit ID</TableHead>
<TableHead className="text-left">Status</TableHead>
<TableHead className="text-left">Last updated</TableHead>
<TableHead className="text-left">Project ID</TableHead>
<TableHead className="text-left">Project name</TableHead>
<TableHead className="text-left">User name</TableHead>
</TableRow>
</TableHeader>
Expand Down Expand Up @@ -60,7 +61,16 @@ export const AllActivityTable = ({ runs, allowedRunsForUser }: {
</span>
)}
</TableCell>
<TableCell>{run.commit_id}</TableCell>
{allowedRunsForUser.includes(run.id) ?
<TableCell>
<Link href={`https://github.com/${run.repo_full_name}/commit/${run.commit_id}`}
className="hover:underline cursor-pointer">
{run.commit_id.substring(0, 8)}
</Link>
</TableCell>
:
<TableCell>{run.commit_id.substring(0, 8)}</TableCell>
}
<TableCell>
<span className={`px-2 py-1 rounded-full text-xs font-medium ${statusColors[ToSnakeCase(run.status)] || ''}`}>
{run.status.toUpperCase()}
Expand Down
3 changes: 2 additions & 1 deletion src/data/user/runs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ export async function getAllRunsByOrganizationId(organizationId: string) {
status,
updated_at,
project_id,
repo_id,
repo_id,
repos(repo_full_name),
approver_user_id,
projects(name, slug)
`,
Expand Down

0 comments on commit 91228f2

Please sign in to comment.