fix: [CODE-3401] UI updates for PR page (#3591)

* fix: [CODE-3401] show updated timestamp for all PRs in space listing
* fix: [CODE-3401] lint
* fix: [CODE-3401] remove empty repo details once content is added
* fix: [CODE-3401] file path in PR Compare view
* fix: [CODE-3401] add updated timestamp to PR listing on spaces
main
Ritik Kapoor 2025-03-26 11:08:30 +00:00 committed by Harness
parent 07e2a1a5b6
commit e48332a55a
5 changed files with 26 additions and 3 deletions

View File

@ -494,7 +494,7 @@ const DiffViewerInternal: React.FC<DiffViewerProps> = ({
? branchInfo
? pullReqMetadata?.source_branch
: pullReqMetadata?.source_sha
: commitSHA || '',
: sourceRef ?? commitSHA ?? '',
resourcePath: diff.isRename ? diff.newName : diff.filePath
})}>
{diff.isRename ? `${diff.oldName} -> ${diff.newName}` : diff.filePath}

View File

@ -884,6 +884,7 @@ export interface StringsMap {
'pr.titlePlaceHolder': string
'pr.toggleComments': string
'pr.unified': string
'pr.updatedLine': string
'pr.useCmdLineToResolveConflicts': string
'prChecks.error': string
'prChecks.failure': string

View File

@ -293,6 +293,7 @@ pr:
executionState: '{state|success:Success,failed:Failed}'
state: '{state|closed:Closed,merged:Merged,rejected:Rejected,draft:Draft,Open}'
statusLine: '#{number} {state|merged:merged,closed:closed,rejected:rejected,opened} {time} by {user}'
updatedLine: 'last updated {time}'
diffStatus: '{status|deleted:Deleted,new:Added,renamed:Renamed,copied:Copied,Changed}'
showDiff: Show Diff
fileDeleted: This file was deleted.

View File

@ -378,6 +378,26 @@ export function SpacePullRequestsListing({ activeTab, includeSubspaces, setInclu
/>
</Layout.Horizontal>
</Container>
<PipeSeparator height={10} />
<Icon name="execution-waiting" size={16} />
<Text color={Color.GREY_500} font={{ size: 'small' }}>
<StringSubstitute
str={getString('pr.updatedLine')}
vars={{
time: (
<strong>
<TimePopoverWithLocal
time={defaultTo(pull_request?.updated as number, 0)}
inline={false}
font={{ variation: FontVariation.SMALL_BOLD }}
color={Color.GREY_500}
tag="span"
/>
</strong>
)
}}
/>
</Text>
</Layout.Horizontal>
</Container>
</Layout.Vertical>

View File

@ -155,7 +155,7 @@ export default function Repository() {
isFile={!isDir(resourceContent)}
className={css.headerContainer}
/>
{!!resourceContent && (
{resourceContent ? (
<RepositoryContent
repoMetadata={repoMetadata}
gitRef={gitRef}
@ -163,8 +163,9 @@ export default function Repository() {
resourceContent={resourceContent}
commitRef={commitRef}
/>
) : (
isRepositoryEmpty && <EmptyRepositoryInfo repoMetadata={repoMetadata} />
)}
{isRepositoryEmpty && <EmptyRepositoryInfo repoMetadata={repoMetadata} />}
</>
)}
</PageBody>