Skip to content

Commit 2990dac

Browse files
rishyym0927coderabbitai[bot]kasyaarkid15r
authored andcommitted
Fix Recent Releases Card: Show Tag as Fallback and Correct Release URLs (OWASP#1566)
* fix * Update frontend/src/components/RecentReleases.tsx Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix * Fix * Fix * Update query to pass in release url to repository data * Update code * Update code --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Kate Golovanova <[email protected]> Co-authored-by: Arkadii Yakovets <[email protected]>
1 parent ea69633 commit 2990dac

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

frontend/src/components/RecentReleases.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,24 +41,24 @@ const RecentReleases: React.FC<RecentReleasesProps> = ({
4141
<div key={index} className="mb-4 w-full rounded-lg bg-gray-200 p-4 dark:bg-gray-700">
4242
<div className="flex w-full flex-col justify-between">
4343
<div className="flex w-full items-center">
44-
{showAvatar && (
44+
{showAvatar && item?.author && (
4545
<Tooltip
4646
closeDelay={100}
47-
content={item?.author?.name || item?.author?.login}
47+
content={item?.author?.name ?? item?.author?.login}
4848
id={`avatar-tooltip-${index}`}
4949
delay={100}
5050
placement="bottom"
5151
showArrow
5252
>
5353
<Link
5454
className="flex-shrink-0 text-blue-400 hover:underline"
55-
href={`/members/${item?.author?.login}`}
55+
href={item?.author?.login ? `/members/${item?.author?.login}` : '#'}
5656
>
5757
<Image
58-
alt={item?.author?.name || 'author'}
58+
alt={item?.author?.name ?? ''}
5959
className="mr-2 h-6 w-6 rounded-full"
6060
height={24}
61-
src={item?.author?.avatarUrl || ''}
61+
src={item?.author?.avatarUrl ?? ''}
6262
width={24}
6363
/>
6464
</Link>
@@ -67,11 +67,11 @@ const RecentReleases: React.FC<RecentReleasesProps> = ({
6767
<h3 className="flex-1 overflow-hidden text-ellipsis whitespace-nowrap font-semibold">
6868
<Link
6969
className="text-blue-400 hover:underline"
70-
href={item?.url || '/'}
70+
href={`https://github.com/${item.organizationName}/${item.repositoryName}/releases/tag/${item.tagName}`}
7171
target="_blank"
7272
rel="noopener noreferrer"
7373
>
74-
<TruncatedText text={item?.name} />
74+
<TruncatedText text={item?.name || item?.tagName} />
7575
</Link>
7676
</h3>
7777
</div>
@@ -86,7 +86,7 @@ const RecentReleases: React.FC<RecentReleasesProps> = ({
8686
className="cursor-pointer overflow-hidden text-ellipsis whitespace-nowrap text-gray-600 hover:underline dark:text-gray-400"
8787
onClick={() =>
8888
router.push(
89-
`/organizations/${item?.organizationName}/repositories/${item.repositoryName || ''}`
89+
`/organizations/${item?.organizationName}/repositories/${item.repositoryName ?? ''}`
9090
)
9191
}
9292
>

0 commit comments

Comments
 (0)