From e9702d811fd4c71be4e369e4daa70518cf28df14 Mon Sep 17 00:00:00 2001 From: Sam Robson Date: Wed, 26 May 2021 15:43:25 +0100 Subject: [PATCH] fix: update query params Signed-off-by: Sam Robson --- plugins/github-deployments/src/api/index.ts | 3 ++- .../src/components/GithubDeploymentsCard.tsx | 24 ++++++++++++++----- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/plugins/github-deployments/src/api/index.ts b/plugins/github-deployments/src/api/index.ts index 4049e082da..3c2b492b10 100644 --- a/plugins/github-deployments/src/api/index.ts +++ b/plugins/github-deployments/src/api/index.ts @@ -81,7 +81,8 @@ type QueryParams = { host: string | undefined; owner: string; repo: string; - last: number; + lastDeployments: number; + lastStatuses: number; }; export interface GithubDeploymentsApi { diff --git a/plugins/github-deployments/src/components/GithubDeploymentsCard.tsx b/plugins/github-deployments/src/components/GithubDeploymentsCard.tsx index a13c205084..b8a8ac1969 100644 --- a/plugins/github-deployments/src/components/GithubDeploymentsCard.tsx +++ b/plugins/github-deployments/src/components/GithubDeploymentsCard.tsx @@ -35,12 +35,14 @@ import { const GithubDeploymentsComponent = ({ projectSlug, - last, + lastDeployments, + lastStatuses, columns, host, }: { projectSlug: string; - last: number; + lastDeployments: number; + lastStatuses: number; columns: TableColumn[]; host: string | undefined; }) => { @@ -48,7 +50,14 @@ const GithubDeploymentsComponent = ({ const [owner, repo] = projectSlug.split('/'); const { loading, value, error, retry: reload } = useAsyncRetry( - async () => await api.listDeployments({ host, owner, repo, last }), + async () => + await api.listDeployments({ + host, + owner, + repo, + lastStatuses, + lastDeployments, + }), ); if (error) { @@ -66,10 +75,12 @@ const GithubDeploymentsComponent = ({ }; export const GithubDeploymentsCard = ({ - last, + lastDeployments, + lastStatuses, columns, }: { - last?: number; + lastDeployments?: number; + lastStatuses?: number; columns?: TableColumn[]; }) => { const { entity } = useEntity(); @@ -85,7 +96,8 @@ export const GithubDeploymentsCard = ({ projectSlug={ entity?.metadata.annotations?.[GITHUB_PROJECT_SLUG_ANNOTATION] || '' } - last={last || 10} + lastDeployments={lastDeployments || 10} + lastStatuses={lastStatuses || 5} host={host} columns={columns || GithubDeploymentsTable.defaultDeploymentColumns} />