updated names and added changeset

This commit is contained in:
Omer Farooq
2020-11-07 23:10:41 +13:00
parent f0b0029176
commit 59e2551801
5 changed files with 33 additions and 26 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-tech-radar': minor
---
Added tech radar blip history backend support and normalized the datastructure
+3 -3
View File
@@ -37,12 +37,12 @@ export interface RadarEntry {
quadrant: string;
title: string;
url: string;
history: Array<RadarEntryHistory>;
timeline: Array<RadarEntrySnapshot>;
}
export interface RadarEntryHistory {
export interface RadarEntrySnapshot {
date: Date;
ring: string;
ringId: string;
description?: string;
moved?: MovedState;
}
@@ -56,11 +56,13 @@ const RadarComponent = (props: TechRadarComponentProps): JSX.Element => {
id: entry.key,
quadrant: loaderResponse!.quadrants.find(q => q.id === entry.quadrant)!,
title: entry.title,
ring: loaderResponse!.rings.find(r => r.id === entry.history[0].ring)!,
history: entry.history.map(e => {
ring: loaderResponse!.rings.find(
r => r.id === entry.timeline[0].ringId,
)!,
history: entry.timeline.map(e => {
return {
date: e.date,
ring: loaderResponse!.rings.find(a => a.id === e.ring)!,
ring: loaderResponse!.rings.find(a => a.id === e.ringId)!,
description: e.description,
moved: e.moved,
};
+18 -18
View File
@@ -35,10 +35,10 @@ quadrants.push({ id: 'process', name: 'Process' });
const entries = new Array<RadarEntry>();
entries.push({
history: [
timeline: [
{
moved: 0,
ring: 'use',
ringId: 'use',
date: new Date('2020-08-06'),
description:
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua',
@@ -51,10 +51,10 @@ entries.push({
quadrant: 'languages',
});
entries.push({
history: [
timeline: [
{
moved: 0,
ring: 'use',
ringId: 'use',
date: new Date('2020-08-06'),
description:
'Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat',
@@ -67,10 +67,10 @@ entries.push({
quadrant: 'languages',
});
entries.push({
history: [
timeline: [
{
moved: 0,
ring: 'use',
ringId: 'use',
date: new Date('2020-08-06'),
},
],
@@ -81,10 +81,10 @@ entries.push({
quadrant: 'frameworks',
});
entries.push({
history: [
timeline: [
{
moved: 0,
ring: 'use',
ringId: 'use',
date: new Date('2020-08-06'),
},
],
@@ -95,10 +95,10 @@ entries.push({
quadrant: 'frameworks',
});
entries.push({
history: [
timeline: [
{
moved: 0,
ring: 'use',
ringId: 'use',
date: new Date('2020-08-06'),
},
],
@@ -109,10 +109,10 @@ entries.push({
quadrant: 'process',
});
entries.push({
history: [
timeline: [
{
moved: 0,
ring: 'assess',
ringId: 'assess',
date: new Date('2020-08-06'),
},
],
@@ -123,10 +123,10 @@ entries.push({
quadrant: 'process',
});
entries.push({
history: [
timeline: [
{
moved: 0,
ring: 'use',
ringId: 'use',
date: new Date('2020-08-06'),
},
],
@@ -137,9 +137,9 @@ entries.push({
quadrant: 'process',
});
entries.push({
history: [
timeline: [
{
ring: 'hold',
ringId: 'hold',
date: new Date('2020-08-06'),
},
],
@@ -150,9 +150,9 @@ entries.push({
quadrant: 'process',
});
entries.push({
history: [
timeline: [
{
ring: 'use',
ringId: 'use',
date: new Date('2020-08-06'),
},
],
+2 -2
View File
@@ -69,10 +69,10 @@ export type Entry = {
// How this entry has recently moved; -1 for "down", +1 for "up", 0 for not moved
moved?: MovedState;
active?: boolean;
history?: Array<EntryHistory>;
timeline?: Array<EntrySnapshot>;
};
export type EntryHistory = {
export type EntrySnapshot = {
date: Date;
ring: Ring;
description?: string;