From 58fc9eb402f365707f669a57f3306cdfca95d2a5 Mon Sep 17 00:00:00 2001 From: James Kachel Date: Fri, 26 Jul 2024 12:34:09 -0500 Subject: [PATCH 1/2] Remap topic icons according to what's in the topics listing This really requires a refactor to use the topics that are specified in the API - this is a quick fix so the topics code can be released sooner. --- .../components/RootTopicIcon/RootTopicIcon.tsx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/frontends/mit-open/src/components/RootTopicIcon/RootTopicIcon.tsx b/frontends/mit-open/src/components/RootTopicIcon/RootTopicIcon.tsx index 1a1c431a0d..0ac7b59afb 100644 --- a/frontends/mit-open/src/components/RootTopicIcon/RootTopicIcon.tsx +++ b/frontends/mit-open/src/components/RootTopicIcon/RootTopicIcon.tsx @@ -15,17 +15,18 @@ import React from "react" /* TODO Using any icons until we have a solution for specifying them */ export const ICON_MAP = { - Business: RiBriefcase3Line, - Energy: RiLightbulbFlashLine, - Engineering: RiRobot2Line, - "Fine Arts": RiPaletteLine, - "Health and Medicine": RiStethoscopeLine, + "Business & Management": RiBriefcase3Line, + "Energy, Climate & Sustainability": RiLightbulbFlashLine, + "Data Science, Analytics & Computer Technology": RiRobot2Line, + "Art, Design & Architecture": RiPaletteLine, + "Health & Medicine": RiStethoscopeLine, Humanities: RiQuillPenLine, Mathematics: RiInfinityLine, - Science: RiTestTubeLine, - "Social Science": RiUserSearchLine, + "Science & Math": RiTestTubeLine, + "Social Sciences": RiUserSearchLine, Society: RiEarthLine, - "Teaching and Education": RiShakeHandsLine, + "Education & Teaching": RiShakeHandsLine, + Engineering: RiRobot2Line, } type RootTopicIconProps = { name: string } From d49383433a390e8bf4cb08ac03594094226b239e Mon Sep 17 00:00:00 2001 From: James Kachel Date: Fri, 26 Jul 2024 12:44:23 -0500 Subject: [PATCH 2/2] fixing off-by-one error in test --- .../src/components/RootTopicIcon/RootTopicIcon.test.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontends/mit-open/src/components/RootTopicIcon/RootTopicIcon.test.tsx b/frontends/mit-open/src/components/RootTopicIcon/RootTopicIcon.test.tsx index a229a51b7a..131c718420 100644 --- a/frontends/mit-open/src/components/RootTopicIcon/RootTopicIcon.test.tsx +++ b/frontends/mit-open/src/components/RootTopicIcon/RootTopicIcon.test.tsx @@ -10,7 +10,7 @@ describe("TopicIcon", () => { * at least make sure we have an icon for each of them. */ test.each(rootTopicNames)("Root topics all have an icon", (name) => { - expect(rootTopicNames.length).toBe(11) + expect(rootTopicNames.length).toBe(12) render() const svg = document.querySelector("svg") expect(svg).toBeVisible()