diff --git a/.changeset/polite-bags-notice.md b/.changeset/polite-bags-notice.md new file mode 100644 index 000000000..04d3553b4 --- /dev/null +++ b/.changeset/polite-bags-notice.md @@ -0,0 +1,5 @@ +--- +'@roadiehq/backstage-plugin-argo-cd': patch +--- + +Filtered null values from ArgoCD revision history 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 433ed0913..b5e1952ae 100644 --- a/plugins/frontend/backstage-plugin-argo-cd/src/components/useAppDetails.ts +++ b/plugins/frontend/backstage-plugin-argo-cd/src/components/useAppDetails.ts @@ -143,8 +143,9 @@ export const useAppDetails = ({ return newItem; }, ); - const result = await Promise.all(getRevisionHistroyPromises); - return result; + return Promise.all(getRevisionHistroyPromises).then(result => + result.filter(n => n), + ); } if (appSelector || projectName) { const result = await api.listApps({ url, appSelector, projectName }); @@ -161,7 +162,9 @@ export const useAppDetails = ({ return newItem; }, ); - return await Promise.all(getRevisionHistroyPromises); + return Promise.all(getRevisionHistroyPromises).then(output => + output.filter(n => n), + ); } return result; }