fix: fix ref to filtered catalog table view when using aggregated relations

Instead of using the query parameters `&filters[owners][0]=foo&filters[owners][1]=bar`, etc.
the query parameters `&filters[owners]=foo&filters[owners]=bar` need to be used.

Closes: #10911
Signed-off-by: Patrick Jungermann <Patrick.Jungermann@gmail.com>
This commit is contained in:
Patrick Jungermann
2022-04-20 01:34:48 +02:00
parent 7ae5b50b7e
commit 8da4a207dd
3 changed files with 8 additions and 7 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-org': patch
---
Fix ref to filtered catalog table view when using aggregated relations.
@@ -246,7 +246,7 @@ describe('OwnershipCard', () => {
expect(getByText('OPENAPI').closest('a')).toHaveAttribute(
'href',
'/create/?filters%5Bkind%5D=API&filters%5Btype%5D=openapi&filters%5Bowners%5D%5B0%5D=my-team&filters%5Buser%5D=all',
'/create/?filters%5Bkind%5D=API&filters%5Btype%5D=openapi&filters%5Bowners%5D=my-team&filters%5Buser%5D=all',
);
});
@@ -288,7 +288,7 @@ describe('OwnershipCard', () => {
expect(getByText('OPENAPI').closest('a')).toHaveAttribute(
'href',
'/create/?filters%5Bkind%5D=API&filters%5Btype%5D=openapi&filters%5Bowners%5D%5B0%5D=the-user&filters%5Bowners%5D%5B1%5D=my-team&filters%5Buser%5D=all',
'/create/?filters%5Bkind%5D=API&filters%5Btype%5D=openapi&filters%5Bowners%5D=the-user&filters%5Bowners%5D=my-team&filters%5Buser%5D=all',
);
});
@@ -50,11 +50,7 @@ const getQueryParams = (
owners,
user: 'all',
};
const queryParams = qs.stringify({
filters,
});
return queryParams;
return qs.stringify({ filters }, { arrayFormat: 'repeat' });
};
const getOwnersEntityRef = (owner: Entity): string[] => {