From e48332a55a82902b193b076c42ef420b218a7463 Mon Sep 17 00:00:00 2001 From: Ritik Kapoor Date: Wed, 26 Mar 2025 11:08:30 +0000 Subject: [PATCH] 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 --- web/src/components/DiffViewer/DiffViewer.tsx | 2 +- web/src/framework/strings/stringTypes.ts | 1 + web/src/i18n/strings.en.yaml | 1 + .../PullRequests/SpacePullRequestsListing.tsx | 20 +++++++++++++++++++ web/src/pages/Repository/Repository.tsx | 5 +++-- 5 files changed, 26 insertions(+), 3 deletions(-) diff --git a/web/src/components/DiffViewer/DiffViewer.tsx b/web/src/components/DiffViewer/DiffViewer.tsx index 6f9fb43c7..c6cfc3bd6 100644 --- a/web/src/components/DiffViewer/DiffViewer.tsx +++ b/web/src/components/DiffViewer/DiffViewer.tsx @@ -494,7 +494,7 @@ const DiffViewerInternal: React.FC = ({ ? 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} diff --git a/web/src/framework/strings/stringTypes.ts b/web/src/framework/strings/stringTypes.ts index ba8874e0f..4577e6785 100644 --- a/web/src/framework/strings/stringTypes.ts +++ b/web/src/framework/strings/stringTypes.ts @@ -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 diff --git a/web/src/i18n/strings.en.yaml b/web/src/i18n/strings.en.yaml index 6e7a65618..b7475093d 100644 --- a/web/src/i18n/strings.en.yaml +++ b/web/src/i18n/strings.en.yaml @@ -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. diff --git a/web/src/pages/PullRequests/SpacePullRequestsListing.tsx b/web/src/pages/PullRequests/SpacePullRequestsListing.tsx index 3c62ad41f..9dabcb986 100644 --- a/web/src/pages/PullRequests/SpacePullRequestsListing.tsx +++ b/web/src/pages/PullRequests/SpacePullRequestsListing.tsx @@ -378,6 +378,26 @@ export function SpacePullRequestsListing({ activeTab, includeSubspaces, setInclu /> + + + + + + + ) + }} + /> + diff --git a/web/src/pages/Repository/Repository.tsx b/web/src/pages/Repository/Repository.tsx index 7cfce9088..2f7a2e9c9 100644 --- a/web/src/pages/Repository/Repository.tsx +++ b/web/src/pages/Repository/Repository.tsx @@ -155,7 +155,7 @@ export default function Repository() { isFile={!isDir(resourceContent)} className={css.headerContainer} /> - {!!resourceContent && ( + {resourceContent ? ( + ) : ( + isRepositoryEmpty && )} - {isRepositoryEmpty && } )}