diff --git a/plugins/azure-devops/src/api/AzureDevOpsApi.ts b/plugins/azure-devops/src/api/AzureDevOpsApi.ts index 63e6dc3125..49cb7f9644 100644 --- a/plugins/azure-devops/src/api/AzureDevOpsApi.ts +++ b/plugins/azure-devops/src/api/AzureDevOpsApi.ts @@ -18,6 +18,7 @@ import { BuildRun, BuildRunOptions, DashboardPullRequest, + GitTag, PullRequest, PullRequestOptions, RepoBuild, @@ -42,7 +43,7 @@ export interface AzureDevOpsApi { projectName: string, repoName: string, options?: PullRequestOptions, - ): Promise<{ items: PullRequest[] }>; + ): Promise<{ items: GitTag[] }>; getPullRequests( projectName: string, diff --git a/plugins/azure-devops/src/api/AzureDevOpsClient.ts b/plugins/azure-devops/src/api/AzureDevOpsClient.ts index 4ebb72fcf9..a0fe8d8791 100644 --- a/plugins/azure-devops/src/api/AzureDevOpsClient.ts +++ b/plugins/azure-devops/src/api/AzureDevOpsClient.ts @@ -18,6 +18,7 @@ import { BuildRun, BuildRunOptions, DashboardPullRequest, + GitTag, PullRequest, PullRequestOptions, RepoBuild, @@ -62,7 +63,7 @@ export class AzureDevOpsClient implements AzureDevOpsApi { projectName: string, repoName: string, options?: PullRequestOptions, - ): Promise<{ items: PullRequest[] }> { + ): Promise<{ items: GitTag[] }> { const queryString = new URLSearchParams(); if (options?.top) { queryString.append('top', options.top.toString()); @@ -74,7 +75,7 @@ export class AzureDevOpsClient implements AzureDevOpsApi { projectName, )}/${encodeURIComponent(repoName)}?${queryString}`; - const items = await this.get(urlSegment); + const items = await this.get(urlSegment); return { items }; } diff --git a/plugins/azure-devops/src/components/GitTagTable/GitTagTable.tsx b/plugins/azure-devops/src/components/GitTagTable/GitTagTable.tsx index 7b4929bfb9..3d37f1af31 100644 --- a/plugins/azure-devops/src/components/GitTagTable/GitTagTable.tsx +++ b/plugins/azure-devops/src/components/GitTagTable/GitTagTable.tsx @@ -35,39 +35,14 @@ import { useGitTags } from '../../hooks/useGitTags'; const columns: TableColumn[] = [ { - title: 'ID', - field: 'pullRequestId', + title: 'Tag', + field: 'name', highlight: false, width: 'auto', }, { - title: 'Title', - field: 'title', - width: 'auto', - render: (row: Partial) => ( - - {row.title} - {row.isDraft && ( - - - - )} - - ), - }, - { - title: 'Source', - field: 'sourceRefName', - width: 'auto', - }, - { - title: 'Target', - field: 'targetRefName', + title: 'Commit', + field: 'peeledObjectId', width: 'auto', }, { @@ -75,16 +50,6 @@ const columns: TableColumn[] = [ field: 'createdBy', width: 'auto', }, - { - title: 'Created', - field: 'creationDate', - width: 'auto', - render: (row: Partial) => - (row.creationDate - ? DateTime.fromISO(row.creationDate) - : DateTime.now() - ).toRelative(), - }, ]; type PullRequestTableProps = { diff --git a/plugins/azure-devops/src/hooks/useGitTags.ts b/plugins/azure-devops/src/hooks/useGitTags.ts index a20d73d940..2a513f1492 100644 --- a/plugins/azure-devops/src/hooks/useGitTags.ts +++ b/plugins/azure-devops/src/hooks/useGitTags.ts @@ -15,7 +15,7 @@ */ import { - PullRequest, + GitTag, PullRequestOptions, PullRequestStatus, } from '@backstage/plugin-azure-devops-common'; @@ -33,7 +33,7 @@ export function useGitTags( defaultLimit?: number, requestedStatus?: PullRequestStatus, ): { - items?: PullRequest[]; + items?: GitTag[]; loading: boolean; error?: Error; } {