From 30af1c4d6b22d819354aeb4f9a9901c4eec7d8e0 Mon Sep 17 00:00:00 2001 From: Sam Robson Date: Wed, 26 May 2021 19:40:18 +0100 Subject: [PATCH] refactor: rename to avoid breaking changes Signed-off-by: Sam Robson --- .changeset/shiny-hotels-tell.md | 2 +- plugins/github-deployments/src/api/index.ts | 6 +++--- .../src/components/GithubDeploymentsCard.tsx | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.changeset/shiny-hotels-tell.md b/.changeset/shiny-hotels-tell.md index d907f5e2b2..7443a8d639 100644 --- a/.changeset/shiny-hotels-tell.md +++ b/.changeset/shiny-hotels-tell.md @@ -1,5 +1,5 @@ --- -'@backstage/plugin-github-deployments': minor +'@backstage/plugin-github-deployments': patch --- Add deployment statuses to the GithubDeployments plugin diff --git a/plugins/github-deployments/src/api/index.ts b/plugins/github-deployments/src/api/index.ts index 3c2b492b10..63b56d87e1 100644 --- a/plugins/github-deployments/src/api/index.ts +++ b/plugins/github-deployments/src/api/index.ts @@ -81,7 +81,7 @@ type QueryParams = { host: string | undefined; owner: string; repo: string; - lastDeployments: number; + last: number; lastStatuses: number; }; @@ -100,9 +100,9 @@ export type Options = { }; const deploymentsQuery = ` -query deployments($owner: String!, $repo: String!, $lastDeployments: Int, $lastStatuses: Int) { +query deployments($owner: String!, $repo: String!, $last: Int, $lastStatuses: Int) { repository(owner: $owner, name: $repo) { - deployments(last: $lastDeployments) { + deployments(last: $last) { nodes { state environment diff --git a/plugins/github-deployments/src/components/GithubDeploymentsCard.tsx b/plugins/github-deployments/src/components/GithubDeploymentsCard.tsx index b8a8ac1969..597b800cf5 100644 --- a/plugins/github-deployments/src/components/GithubDeploymentsCard.tsx +++ b/plugins/github-deployments/src/components/GithubDeploymentsCard.tsx @@ -35,13 +35,13 @@ import { const GithubDeploymentsComponent = ({ projectSlug, - lastDeployments, + last, lastStatuses, columns, host, }: { projectSlug: string; - lastDeployments: number; + last: number; lastStatuses: number; columns: TableColumn[]; host: string | undefined; @@ -55,8 +55,8 @@ const GithubDeploymentsComponent = ({ host, owner, repo, + last, lastStatuses, - lastDeployments, }), ); @@ -75,11 +75,11 @@ const GithubDeploymentsComponent = ({ }; export const GithubDeploymentsCard = ({ - lastDeployments, + last, lastStatuses, columns, }: { - lastDeployments?: number; + last?: number; lastStatuses?: number; columns?: TableColumn[]; }) => { @@ -96,7 +96,7 @@ export const GithubDeploymentsCard = ({ projectSlug={ entity?.metadata.annotations?.[GITHUB_PROJECT_SLUG_ANNOTATION] || '' } - lastDeployments={lastDeployments || 10} + last={last || 10} lastStatuses={lastStatuses || 5} host={host} columns={columns || GithubDeploymentsTable.defaultDeploymentColumns}