From 34e6bb40997b8c832815af6e2e9de262da497c69 Mon Sep 17 00:00:00 2001 From: Niall McCullagh Date: Tue, 16 Mar 2021 20:42:46 +0000 Subject: [PATCH] feat(plugin-tech-radar): map description in API RadarEntry to Entry The description in the Entry was mapped to the latest timeline entry, which is a changelog. This change maps the description in the API to the entry. To maintain backwards compatibility it will set the description to the last timeline entry if no description exists at the entry level. Signed-off-by: Niall McCullagh --- .changeset/clean-points-glow.md | 9 +++++++++ plugins/tech-radar/src/api.ts | 1 + plugins/tech-radar/src/components/RadarComponent.tsx | 2 +- plugins/tech-radar/src/sampleData.ts | 4 ++++ 4 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 .changeset/clean-points-glow.md diff --git a/.changeset/clean-points-glow.md b/.changeset/clean-points-glow.md new file mode 100644 index 0000000000..c47db85e7e --- /dev/null +++ b/.changeset/clean-points-glow.md @@ -0,0 +1,9 @@ +--- +'@backstage/plugin-tech-radar': minor +--- + +Map description in API RadarEntry to Entry + +The description in the Entry was mapped to the latest timeline entry, which is a changelog. This +change maps the description in the API to the entry. To maintain backwards compatibility it +will set the description to the last timeline entry if no description exists at the entry level. diff --git a/plugins/tech-radar/src/api.ts b/plugins/tech-radar/src/api.ts index 0c30c9374c..eca80420bf 100644 --- a/plugins/tech-radar/src/api.ts +++ b/plugins/tech-radar/src/api.ts @@ -38,6 +38,7 @@ export interface RadarEntry { title: string; url: string; timeline: Array; + description?: string; } export interface RadarEntrySnapshot { diff --git a/plugins/tech-radar/src/components/RadarComponent.tsx b/plugins/tech-radar/src/components/RadarComponent.tsx index bed45e63fc..a6e033a08e 100644 --- a/plugins/tech-radar/src/components/RadarComponent.tsx +++ b/plugins/tech-radar/src/components/RadarComponent.tsx @@ -68,7 +68,7 @@ const RadarComponent = (props: TechRadarComponentProps): JSX.Element => { }; }), moved: entry.timeline[0].moved, - description: entry.timeline[0].description, + description: entry.description || entry.timeline[0].description, url: entry.url, }; }); diff --git a/plugins/tech-radar/src/sampleData.ts b/plugins/tech-radar/src/sampleData.ts index 309c3f6b88..8457d1bc6d 100644 --- a/plugins/tech-radar/src/sampleData.ts +++ b/plugins/tech-radar/src/sampleData.ts @@ -49,6 +49,8 @@ entries.push({ id: 'javascript', title: 'JavaScript', quadrant: 'languages', + description: + 'Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum', }); entries.push({ timeline: [ @@ -65,6 +67,8 @@ entries.push({ id: 'typescript', title: 'TypeScript', quadrant: 'languages', + description: + 'Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat', }); entries.push({ timeline: [