From 62dc7a2b1ad14516723816cab6549557f08a66b4 Mon Sep 17 00:00:00 2001 From: tperehinets Date: Mon, 31 Jul 2023 13:47:54 +0300 Subject: [PATCH 1/4] Added maxDepth to catalogGraphParams Signed-off-by: tperehinets --- .changeset/cuddly-colts-repeat.md | 5 +++++ .../src/components/CatalogGraphCard/CatalogGraphCard.tsx | 1 + 2 files changed, 6 insertions(+) create mode 100644 .changeset/cuddly-colts-repeat.md diff --git a/.changeset/cuddly-colts-repeat.md b/.changeset/cuddly-colts-repeat.md new file mode 100644 index 0000000000..ab2ed260af --- /dev/null +++ b/.changeset/cuddly-colts-repeat.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-graph': patch +--- + +Added maxDepth parameter to the catalogGraphParams in CatalogGraphCard. diff --git a/plugins/catalog-graph/src/components/CatalogGraphCard/CatalogGraphCard.tsx b/plugins/catalog-graph/src/components/CatalogGraphCard/CatalogGraphCard.tsx index ae4ad850a4..7976fa66bb 100644 --- a/plugins/catalog-graph/src/components/CatalogGraphCard/CatalogGraphCard.tsx +++ b/plugins/catalog-graph/src/components/CatalogGraphCard/CatalogGraphCard.tsx @@ -108,6 +108,7 @@ export const CatalogGraphCard = ( const catalogGraphParams = qs.stringify( { rootEntityRefs: [stringifyEntityRef(entity)], + maxDepth: maxDepth, unidirectional, mergeRelations, selectedKinds: kinds, From 55f7f954d8dddaeff9b933ac1e98eb992ac28f4f Mon Sep 17 00:00:00 2001 From: tperehinets <97943593+tperehinets@users.noreply.github.com> Date: Mon, 31 Jul 2023 14:31:10 +0300 Subject: [PATCH 2/4] Update cuddly-colts-repeat.md Signed-off-by: tperehinets <97943593+tperehinets@users.noreply.github.com> --- .changeset/cuddly-colts-repeat.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/cuddly-colts-repeat.md b/.changeset/cuddly-colts-repeat.md index ab2ed260af..8266eb7ff0 100644 --- a/.changeset/cuddly-colts-repeat.md +++ b/.changeset/cuddly-colts-repeat.md @@ -2,4 +2,4 @@ '@backstage/plugin-catalog-graph': patch --- -Added maxDepth parameter to the catalogGraphParams in CatalogGraphCard. +Added maximum depth parameter to the catalogGraphParams in CatalogGraphCard. From 6f71cdeb7ef3d557870aa43a242bd046d21bff16 Mon Sep 17 00:00:00 2001 From: tperehinets Date: Wed, 2 Aug 2023 19:52:09 +0300 Subject: [PATCH 3/4] Changed testcase Signed-off-by: tperehinets --- .../components/CatalogGraphCard/CatalogGraphCard.test.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/catalog-graph/src/components/CatalogGraphCard/CatalogGraphCard.test.tsx b/plugins/catalog-graph/src/components/CatalogGraphCard/CatalogGraphCard.test.tsx index adee03e298..ee400f1e56 100644 --- a/plugins/catalog-graph/src/components/CatalogGraphCard/CatalogGraphCard.test.tsx +++ b/plugins/catalog-graph/src/components/CatalogGraphCard/CatalogGraphCard.test.tsx @@ -133,7 +133,8 @@ describe('', () => { expect(button).toBeInTheDocument(); expect(button.closest('a')).toHaveAttribute( 'href', - '/catalog-graph?rootEntityRefs%5B%5D=b%3Ad%2Fc&unidirectional=true&mergeRelations=true&direction=LR', + // '/catalog-graph?rootEntityRefs%5B%5D=b%3Ad%2Fc&unidirectional=true&mergeRelations=true&direction=LR', + '/catalog-graph?rootEntityRefs%5B%5D=b%3Ad%2Fc&maxDepth=1&unidirectional=true&mergeRelations=true&direction=LR', ); }); @@ -157,7 +158,7 @@ describe('', () => { expect(button).toBeInTheDocument(); expect(button.closest('a')).toHaveAttribute( 'href', - '/catalog-graph?rootEntityRefs%5B%5D=b%3Ad%2Fc&unidirectional=true&mergeRelations=false&direction=LR', + '/catalog-graph?rootEntityRefs%5B%5D=b%3Ad%2Fc&maxDepth=2&unidirectional=true&mergeRelations=false&direction=LR', ); }); From 8b76f6b6456fa029eaf474e3367af9e10b4bd240 Mon Sep 17 00:00:00 2001 From: tperehinets <97943593+tperehinets@users.noreply.github.com> Date: Fri, 4 Aug 2023 14:18:09 +0300 Subject: [PATCH 4/4] Update CatalogGraphCard.test.tsx Signed-off-by: tperehinets <97943593+tperehinets@users.noreply.github.com> --- .../src/components/CatalogGraphCard/CatalogGraphCard.test.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/catalog-graph/src/components/CatalogGraphCard/CatalogGraphCard.test.tsx b/plugins/catalog-graph/src/components/CatalogGraphCard/CatalogGraphCard.test.tsx index ee400f1e56..cdd55e300f 100644 --- a/plugins/catalog-graph/src/components/CatalogGraphCard/CatalogGraphCard.test.tsx +++ b/plugins/catalog-graph/src/components/CatalogGraphCard/CatalogGraphCard.test.tsx @@ -133,7 +133,6 @@ describe('', () => { expect(button).toBeInTheDocument(); expect(button.closest('a')).toHaveAttribute( 'href', - // '/catalog-graph?rootEntityRefs%5B%5D=b%3Ad%2Fc&unidirectional=true&mergeRelations=true&direction=LR', '/catalog-graph?rootEntityRefs%5B%5D=b%3Ad%2Fc&maxDepth=1&unidirectional=true&mergeRelations=true&direction=LR', ); });