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 <niallmccullagh@users.noreply.github.com>
This commit is contained in:
Niall McCullagh
2021-03-16 20:42:46 +00:00
parent b2b670ad66
commit 34e6bb4099
4 changed files with 15 additions and 1 deletions
+9
View File
@@ -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.
+1
View File
@@ -38,6 +38,7 @@ export interface RadarEntry {
title: string;
url: string;
timeline: Array<RadarEntrySnapshot>;
description?: string;
}
export interface RadarEntrySnapshot {
@@ -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,
};
});
+4
View File
@@ -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: [