From 456b53b6ecd526cb59f26ad08b9ef1eebff7c0b3 Mon Sep 17 00:00:00 2001 From: Kiss Miklos Date: Tue, 17 Jan 2023 02:15:56 +0100 Subject: [PATCH 1/3] do not show error when annotation is missing Signed-off-by: Kiss Miklos --- .../src/components/EntityAdrContent/EntityAdrContent.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/plugins/adr/src/components/EntityAdrContent/EntityAdrContent.tsx b/plugins/adr/src/components/EntityAdrContent/EntityAdrContent.tsx index a698cffd26..d1db286943 100644 --- a/plugins/adr/src/components/EntityAdrContent/EntityAdrContent.tsx +++ b/plugins/adr/src/components/EntityAdrContent/EntityAdrContent.tsx @@ -73,11 +73,10 @@ export const EntityAdrContent = (props: { const adrApi = useApi(adrApiRef); const entityHasAdrs = isAdrAvailable(entity); - const url = getAdrLocationUrl(entity, scmIntegrations); - const { value, loading, error } = useAsync( - async () => adrApi.listAdrs(url), - [url], - ); + const { value, loading, error } = useAsync(async () => { + const url = getAdrLocationUrl(entity, scmIntegrations); + return adrApi.listAdrs(url); + }, [entity, scmIntegrations]); const selectedAdr = adrList.find(adr => adr === searchParams.get('record')) ?? ''; From 496cf6aff0e9d049446a7439396e9a3b211c319e Mon Sep 17 00:00:00 2001 From: Kiss Miklos Date: Tue, 17 Jan 2023 02:17:38 +0100 Subject: [PATCH 2/3] add changeset Signed-off-by: Kiss Miklos --- .changeset/spotty-coats-clean.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/spotty-coats-clean.md diff --git a/.changeset/spotty-coats-clean.md b/.changeset/spotty-coats-clean.md new file mode 100644 index 0000000000..f0809f70de --- /dev/null +++ b/.changeset/spotty-coats-clean.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-adr': patch +--- + +Render the common `` componenet when the `backstage.io/adr-location` annotation is missing from the component From 6fdb56f1be2947f59653c8fb74aeda391a619411 Mon Sep 17 00:00:00 2001 From: Kiss Miklos Date: Tue, 17 Jan 2023 02:31:09 +0100 Subject: [PATCH 3/3] fix docs quality issue Signed-off-by: Kiss Miklos --- .changeset/spotty-coats-clean.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/spotty-coats-clean.md b/.changeset/spotty-coats-clean.md index f0809f70de..1a48da5688 100644 --- a/.changeset/spotty-coats-clean.md +++ b/.changeset/spotty-coats-clean.md @@ -2,4 +2,4 @@ '@backstage/plugin-adr': patch --- -Render the common `` componenet when the `backstage.io/adr-location` annotation is missing from the component +Render the common `` component when the `backstage.io/adr-location` annotation is missing from the component