From 90c8f20b9ff0caaef0bcb3c9591a6b1fa137972c Mon Sep 17 00:00:00 2001 From: Niall McCullagh Date: Thu, 28 Jan 2021 14:19:24 +0000 Subject: [PATCH 1/2] fix(tech-radar): fix mapping of moved and url atrributes to fix display As part of the refactor to include entry history the moved and url attributes were no longer being mapped. This resulted in the radar not indicating if an entry had moved, and the bubble not being clickable. --- .changeset/shaggy-dingos-suffer.md | 5 +++++ plugins/tech-radar/src/components/RadarComponent.tsx | 4 +++- plugins/tech-radar/src/sampleData.ts | 6 +++--- 3 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 .changeset/shaggy-dingos-suffer.md diff --git a/.changeset/shaggy-dingos-suffer.md b/.changeset/shaggy-dingos-suffer.md new file mode 100644 index 0000000000..66c520bb3e --- /dev/null +++ b/.changeset/shaggy-dingos-suffer.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-tech-radar': patch +--- + +Fix mapping RadarEntry and Entry for moved and url attributes diff --git a/plugins/tech-radar/src/components/RadarComponent.tsx b/plugins/tech-radar/src/components/RadarComponent.tsx index 583a7c91e0..759fec62c3 100644 --- a/plugins/tech-radar/src/components/RadarComponent.tsx +++ b/plugins/tech-radar/src/components/RadarComponent.tsx @@ -59,7 +59,7 @@ const RadarComponent = (props: TechRadarComponentProps): JSX.Element => { ring: loaderResponse!.rings.find( r => r.id === entry.timeline[0].ringId, )!, - history: entry.timeline.map(e => { + timeline: entry.timeline.map(e => { return { date: e.date, ring: loaderResponse!.rings.find(a => a.id === e.ringId)!, @@ -67,6 +67,8 @@ const RadarComponent = (props: TechRadarComponentProps): JSX.Element => { moved: e.moved, }; }), + moved: entry.timeline[0].moved, + url: entry.url, }; }); }; diff --git a/plugins/tech-radar/src/sampleData.ts b/plugins/tech-radar/src/sampleData.ts index 914bc30931..613e7b3cdc 100644 --- a/plugins/tech-radar/src/sampleData.ts +++ b/plugins/tech-radar/src/sampleData.ts @@ -53,7 +53,7 @@ entries.push({ entries.push({ timeline: [ { - moved: 0, + moved: -1, ringId: 'use', date: new Date('2020-08-06'), description: @@ -69,7 +69,7 @@ entries.push({ entries.push({ timeline: [ { - moved: 0, + moved: 1, ringId: 'use', date: new Date('2020-08-06'), }, @@ -88,7 +88,7 @@ entries.push({ date: new Date('2020-08-06'), }, ], - url: '#', + url: 'https://reactjs.org/', key: 'react', id: 'react', title: 'React', From 9c7efe153567c0545190128e64d92428c9c21115 Mon Sep 17 00:00:00 2001 From: Niall McCullagh Date: Thu, 28 Jan 2021 16:59:05 +0000 Subject: [PATCH 2/2] fix(tech-radar): allow entries on radar legend to be clickable --- .changeset/shaggy-dingos-suffer.md | 1 + plugins/tech-radar/src/components/RadarLegend/RadarLegend.tsx | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.changeset/shaggy-dingos-suffer.md b/.changeset/shaggy-dingos-suffer.md index 66c520bb3e..c1e200b701 100644 --- a/.changeset/shaggy-dingos-suffer.md +++ b/.changeset/shaggy-dingos-suffer.md @@ -3,3 +3,4 @@ --- Fix mapping RadarEntry and Entry for moved and url attributes +Fix clicking of links in the radar legend diff --git a/plugins/tech-radar/src/components/RadarLegend/RadarLegend.tsx b/plugins/tech-radar/src/components/RadarLegend/RadarLegend.tsx index e319846d78..e10993b010 100644 --- a/plugins/tech-radar/src/components/RadarLegend/RadarLegend.tsx +++ b/plugins/tech-radar/src/components/RadarLegend/RadarLegend.tsx @@ -71,12 +71,12 @@ const useStyles = makeStyles(theme => ({ 'font-feature-settings': 'pnum', }, entry: { - pointerEvents: 'none', + pointerEvents: 'visiblePainted', userSelect: 'none', fontSize: '11px', }, entryLink: { - pointerEvents: 'none', + pointerEvents: 'visiblePainted', }, }));