From f1622e1eafe62cd119765216e5a586616a0fedfe Mon Sep 17 00:00:00 2001 From: Jonathan Mezach Date: Tue, 18 Apr 2023 09:00:23 +0200 Subject: [PATCH] React to breaking change Signed-off-by: Jonathan Mezach --- .../EntityPageOctopusDeploy.tsx | 6 +++--- plugins/octopus-deploy/src/hooks/useReleases.ts | 14 +++++++------- .../src/utils/getAnnotationFromEntity.ts | 6 ++++-- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/plugins/octopus-deploy/src/components/EntityPageOctopusDeploy/EntityPageOctopusDeploy.tsx b/plugins/octopus-deploy/src/components/EntityPageOctopusDeploy/EntityPageOctopusDeploy.tsx index b263c67566..34ff780f70 100644 --- a/plugins/octopus-deploy/src/components/EntityPageOctopusDeploy/EntityPageOctopusDeploy.tsx +++ b/plugins/octopus-deploy/src/components/EntityPageOctopusDeploy/EntityPageOctopusDeploy.tsx @@ -28,11 +28,11 @@ export const EntityPageOctopusDeploy = (props: { defaultLimit?: number }) => { const projectId = getProjectIdAnnotationFromEntity(entity); const spaceId = getSpaceIdAnnotationFromEntity(entity); - const { environments, releases, loading, error } = useReleases( + const { environments, releases, loading, error } = useReleases({ projectId, spaceId, - props.defaultLimit ?? 3, - ); + releaseHistoryCount: props.defaultLimit ?? 3, + }); return ( { - return api.getReleaseProgression(projectId, spaceId, releaseHistoryCount); - }, [api, projectId, spaceId, releaseHistoryCount]); + return api.getReleaseProgression(opts); + }, [api, opts]); return { environments: value?.Environments, diff --git a/plugins/octopus-deploy/src/utils/getAnnotationFromEntity.ts b/plugins/octopus-deploy/src/utils/getAnnotationFromEntity.ts index 5c4a2e1788..14d8739962 100644 --- a/plugins/octopus-deploy/src/utils/getAnnotationFromEntity.ts +++ b/plugins/octopus-deploy/src/utils/getAnnotationFromEntity.ts @@ -32,9 +32,11 @@ export function getProjectIdAnnotationFromEntity(entity: Entity): string { return annotation; } -export function getSpaceIdAnnotationFromEntity(entity: Entity): string | null { +export function getSpaceIdAnnotationFromEntity( + entity: Entity, +): string | undefined { const annotation = entity.metadata.annotations?.[OCTOPUS_DEPLOY_SPACE_ID_ANNOTATION]; - return annotation || null; + return annotation || undefined; }