mirror of
https://github.com/harness/drone.git
synced 2025-05-20 19:09:59 +08:00
fix: [code-1121]: fix file redirection in commits view (#847)
This commit is contained in:
parent
03b33aca77
commit
b78a25a337
@ -289,7 +289,6 @@ export const Changes: React.FC<ChangesProps> = ({
|
||||
)
|
||||
|
||||
useShowRequestError(errorActivities || errorFileViews)
|
||||
|
||||
return (
|
||||
<Container className={cx(css.container, className)} {...(!!loading || !!error ? { flex: true } : {})}>
|
||||
<LoadingSpinner visible={loading || showSpinner} withBorder={true} />
|
||||
@ -395,6 +394,7 @@ export const Changes: React.FC<ChangesProps> = ({
|
||||
sourceRef={_sourceRef}
|
||||
commitRange={commitRange}
|
||||
scrollElement={scrollElement}
|
||||
commitSHA={commitSHA}
|
||||
/>
|
||||
))}
|
||||
</Layout.Vertical>
|
||||
|
@ -85,6 +85,7 @@ interface DiffViewerProps extends Pick<GitInfoProps, 'repoMetadata'> {
|
||||
sourceRef?: string
|
||||
commitRange?: string[]
|
||||
scrollElement: HTMLElement
|
||||
commitSHA?: string
|
||||
}
|
||||
|
||||
//
|
||||
@ -103,7 +104,8 @@ export const DiffViewer: React.FC<DiffViewerProps> = ({
|
||||
targetRef,
|
||||
sourceRef,
|
||||
commitRange,
|
||||
scrollElement
|
||||
scrollElement,
|
||||
commitSHA
|
||||
}) => {
|
||||
const { routes, routingId } = useAppContext()
|
||||
const { getString } = useStrings()
|
||||
@ -690,7 +692,7 @@ export const DiffViewer: React.FC<DiffViewerProps> = ({
|
||||
<Link
|
||||
to={routes.toCODERepository({
|
||||
repoPath: repoMetadata.path as string,
|
||||
gitRef: pullRequestMetadata?.source_branch,
|
||||
gitRef: pullRequestMetadata?.source_branch || commitSHA || '',
|
||||
resourcePath: diff.isRename ? diff.newName : diff.filePath
|
||||
})}>
|
||||
{diff.isRename ? `${diff.oldName} -> ${diff.newName}` : diff.filePath}
|
||||
|
Loading…
Reference in New Issue
Block a user