@@ -148,8 +148,11 @@ export class AzureDevOpsApi {
|
||||
const linkBaseUrl = `${this.webApi.serverUrl}/${encodeURIComponent(
|
||||
projectName,
|
||||
)}/_git/${encodeURIComponent(repoName)}?version=GT`;
|
||||
const commitBaseUrl = `${this.webApi.serverUrl}/${encodeURIComponent(
|
||||
projectName,
|
||||
)}/_git/${encodeURIComponent(repoName)}/commit`;
|
||||
const gitTags: GitTag[] = tagRefs.map(tagRef => {
|
||||
return mappedGitTag(tagRef, linkBaseUrl);
|
||||
return mappedGitTag(tagRef, linkBaseUrl, commitBaseUrl);
|
||||
});
|
||||
|
||||
return gitTags;
|
||||
@@ -391,7 +394,11 @@ export function mappedRepoBuild(build: Build): RepoBuild {
|
||||
};
|
||||
}
|
||||
|
||||
export function mappedGitTag(gitRef: GitRef, linkBaseUrl: string): GitTag {
|
||||
export function mappedGitTag(
|
||||
gitRef: GitRef,
|
||||
linkBaseUrl: string,
|
||||
commitBaseUrl: string,
|
||||
): GitTag {
|
||||
return {
|
||||
objectId: gitRef.objectId,
|
||||
peeledObjectId: gitRef.peeledObjectId,
|
||||
@@ -400,6 +407,9 @@ export function mappedGitTag(gitRef: GitRef, linkBaseUrl: string): GitTag {
|
||||
link: `${linkBaseUrl}${encodeURIComponent(
|
||||
gitRef.name?.replace('refs/tags/', '') ?? '',
|
||||
)}`,
|
||||
commitLink: `${commitBaseUrl}/${encodeURIComponent(
|
||||
gitRef.peeledObjectId ?? '',
|
||||
)}`,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -114,6 +114,7 @@ export type GitTag = {
|
||||
name?: string;
|
||||
createdBy?: string;
|
||||
link: string;
|
||||
commitLink: string;
|
||||
};
|
||||
|
||||
export type PullRequest = {
|
||||
|
||||
@@ -44,6 +44,11 @@ const columns: TableColumn[] = [
|
||||
title: 'Commit',
|
||||
field: 'peeledObjectId',
|
||||
width: 'auto',
|
||||
render: (row: Partial<GitTag>) => (
|
||||
<Box display="flex" alignItems="center">
|
||||
<Link to={row.commitLink ?? ''}>{row.peeledObjectId}</Link>
|
||||
</Box>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: 'Created By',
|
||||
|
||||
Reference in New Issue
Block a user