Skip to content

Commit

Permalink
updated to fix the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
planeiii-te committed Aug 4, 2023
1 parent bd70499 commit 6580746
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .changeset/polite-bags-notice.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
'@roadiehq/backstage-plugin-argo-cd': patch
---

Filtered null values from ArgoCD data
Filtered null values from ArgoCD revision history
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,15 @@ const ArgoCDDetails = ({
);
}
if (value) {
if ((value as ArgoCDAppList).items !== undefined) {
return (
<OverviewComponent
data={value as ArgoCDAppList}
retry={retry}
extraColumns={extraColumns}
/>
);
}
if (Array.isArray(value)) {
const wrapped: ArgoCDAppList = {
items: value as Array<ArgoCDAppDetails>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ const ArgoCDHistory = ({ entity }: { entity: Entity }) => {
}

if (value) {
if ((value as ArgoCDAppList).items !== undefined) {
return <HistoryTable data={value as ArgoCDAppList} retry={retry} />;
}
if (Array.isArray(value)) {
const wrapped: ArgoCDAppList = {
items: value as Array<ArgoCDAppDetails>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 6580746

Please sign in to comment.