diff --git a/web/src/components/Label/Label.tsx b/web/src/components/Label/Label.tsx index 7d43763d6..7adc9b5ef 100644 --- a/web/src/components/Label/Label.tsx +++ b/web/src/components/Label/Label.tsx @@ -74,8 +74,9 @@ export const Label: React.FC = props => { { 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 = props => { { if (onClick) { - onClick() + e.preventDefault() e.stopPropagation() + onClick() } }} className={cx(css.labelTag, className, { [css.removeBtnTag]: removeLabelBtn })}> diff --git a/web/src/pages/PullRequests/PullRequests.tsx b/web/src/pages/PullRequests/PullRequests.tsx index c58620059..61863dec0 100644 --- a/web/src/pages/PullRequests/PullRequests.tsx +++ b/web/src/pages/PullRequests/PullRequests.tsx @@ -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) => { return ( - - 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) + })}> @@ -357,7 +353,7 @@ export default function PullRequests() { {/* TODO: Pass proper state when check api is fully implemented */} {/* */} - + ) } }