fix: [CODE-2406] pr link in pr listing (#2740)

* fix: [CODE-2406] pr link in pr listing
gitness-as-lib v3.0.0
Ritik Kapoor 2024-09-25 11:58:35 +00:00 committed by Harness
parent 51020b71e7
commit 9f38e07bf3
2 changed files with 11 additions and 13 deletions

View File

@ -74,8 +74,9 @@ export const Label: React.FC<LabelProps> = props => {
<Tag
onClick={e => {
if (onClick) {
onClick()
e.preventDefault()
e.stopPropagation()
onClick()
}
}}
className={cx(css.labelTag, className, { [css.removeBtnTag]: removeLabelBtn })}>
@ -154,8 +155,9 @@ export const Label: React.FC<LabelProps> = props => {
<Tag
onClick={e => {
if (onClick) {
onClick()
e.preventDefault()
e.stopPropagation()
onClick()
}
}}
className={cx(css.labelTag, className, { [css.removeBtnTag]: removeLabelBtn })}>

View File

@ -28,7 +28,7 @@ import {
} from '@harnessio/uicore'
import { Icon } from '@harnessio/icons'
import { Color, FontVariation } from '@harnessio/design-system'
import { useHistory } from 'react-router-dom'
import { Link, useHistory } from 'react-router-dom'
import { useGet } from 'restful-react'
import type { CellProps, Column } from 'react-table'
import { Case, Match, Render, Truthy } from 'react-jsx-match'
@ -236,16 +236,12 @@ export default function PullRequests() {
width: '100%',
Cell: ({ row }: CellProps<TypesPullReq>) => {
return (
<Container
<Link
className={css.rowLink}
onClick={() =>
history.push(
routes.toCODEPullRequest({
repoPath: repoMetadata?.path as string,
pullRequestId: String(row.original.number)
})
)
}>
to={routes.toCODEPullRequest({
repoPath: repoMetadata?.path as string,
pullRequestId: String(row.original.number)
})}>
<Layout.Horizontal className={css.titleRow} spacing="medium">
<PullRequestStateLabel iconSize={22} data={row.original} iconOnly />
<Container padding={{ left: 'small' }}>
@ -357,7 +353,7 @@ export default function PullRequests() {
{/* TODO: Pass proper state when check api is fully implemented */}
{/* <ExecutionStatusLabel data={{ state: 'success' }} /> */}
</Layout.Horizontal>
</Container>
</Link>
)
}
}