diff --git a/.changeset/polite-bags-notice.md b/.changeset/polite-bags-notice.md index ca561a4c7..04d3553b4 100644 --- a/.changeset/polite-bags-notice.md +++ b/.changeset/polite-bags-notice.md @@ -2,4 +2,4 @@ '@roadiehq/backstage-plugin-argo-cd': patch --- -Filtered null values from ArgoCD data +Filtered null values from ArgoCD revision history diff --git a/plugins/frontend/backstage-plugin-argo-cd/src/components/ArgoCDDetailsCard.tsx b/plugins/frontend/backstage-plugin-argo-cd/src/components/ArgoCDDetailsCard.tsx index 4603d14b0..b071bb6de 100644 --- a/plugins/frontend/backstage-plugin-argo-cd/src/components/ArgoCDDetailsCard.tsx +++ b/plugins/frontend/backstage-plugin-argo-cd/src/components/ArgoCDDetailsCard.tsx @@ -254,6 +254,15 @@ const ArgoCDDetails = ({ ); } if (value) { + if ((value as ArgoCDAppList).items !== undefined) { + return ( + + ); + } if (Array.isArray(value)) { const wrapped: ArgoCDAppList = { items: value as Array, diff --git a/plugins/frontend/backstage-plugin-argo-cd/src/components/ArgoCDHistoryCard.tsx b/plugins/frontend/backstage-plugin-argo-cd/src/components/ArgoCDHistoryCard.tsx index 2aec5158e..f89ea8d4e 100644 --- a/plugins/frontend/backstage-plugin-argo-cd/src/components/ArgoCDHistoryCard.tsx +++ b/plugins/frontend/backstage-plugin-argo-cd/src/components/ArgoCDHistoryCard.tsx @@ -192,6 +192,9 @@ const ArgoCDHistory = ({ entity }: { entity: Entity }) => { } if (value) { + if ((value as ArgoCDAppList).items !== undefined) { + return ; + } if (Array.isArray(value)) { const wrapped: ArgoCDAppList = { items: value as Array, diff --git a/plugins/frontend/backstage-plugin-argo-cd/src/components/useAppDetails.ts b/plugins/frontend/backstage-plugin-argo-cd/src/components/useAppDetails.ts index 0f5f69576..b5e1952ae 100644 --- a/plugins/frontend/backstage-plugin-argo-cd/src/components/useAppDetails.ts +++ b/plugins/frontend/backstage-plugin-argo-cd/src/components/useAppDetails.ts @@ -166,7 +166,7 @@ export const useAppDetails = ({ output.filter(n => n), ); } - return result.items?.filter(n => n); + return result; } return Promise.reject('Neither appName nor appSelector provided'); } catch (e: any) {