diff --git a/.changeset/swift-fans-shout.md b/.changeset/swift-fans-shout.md new file mode 100644 index 0000000000..7a11b70592 --- /dev/null +++ b/.changeset/swift-fans-shout.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-gocd': patch +--- + +Add pagination controls to GoCD build table diff --git a/plugins/gocd/src/api/gocdApi.client.ts b/plugins/gocd/src/api/gocdApi.client.ts index 1f4955a80d..2c45632b33 100644 --- a/plugins/gocd/src/api/gocdApi.client.ts +++ b/plugins/gocd/src/api/gocdApi.client.ts @@ -18,6 +18,8 @@ import { GoCdApiError, PipelineHistory } from './gocdApi.model'; import { DiscoveryApi } from '@backstage/core-plugin-api'; import { ResponseError } from '@backstage/errors'; +const DEFAULT_PAGE_SIZE = 100; + export class GoCdClientApi implements GoCdApi { constructor(private readonly discoveryApi: DiscoveryApi) {} @@ -26,7 +28,7 @@ export class GoCdClientApi implements GoCdApi { ): Promise { const baseUrl = await this.discoveryApi.getBaseUrl('proxy'); const pipelineHistoryResponse = await fetch( - `${baseUrl}/gocd/pipelines/${pipelineName}/history`, + `${baseUrl}/gocd/pipelines/${pipelineName}/history?page_size=${DEFAULT_PAGE_SIZE}`, { headers: { Accept: 'application/vnd.go.cd+json', diff --git a/plugins/gocd/src/components/GoCdBuildsTable/GoCdBuildsTable.tsx b/plugins/gocd/src/components/GoCdBuildsTable/GoCdBuildsTable.tsx index 51ba2b6e8c..58dfbcca39 100644 --- a/plugins/gocd/src/components/GoCdBuildsTable/GoCdBuildsTable.tsx +++ b/plugins/gocd/src/components/GoCdBuildsTable/GoCdBuildsTable.tsx @@ -244,9 +244,11 @@ export const GoCdBuildsTable = (props: GoCdBuildsProps): JSX.Element => { search: true, searchAutoFocus: true, debounceInterval: 800, - paging: false, + paging: true, + padding: 'dense', + pageSizeOptions: [5, 10, 20, 50], showFirstLastPageButtons: false, - pageSize: 10, + pageSize: 20, }} columns={columns} data={