From 12b80abfe7ced861f9857da04ac6d94c0fb94122 Mon Sep 17 00:00:00 2001 From: Samuel Fang Date: Thu, 24 Jun 2021 12:50:04 +0800 Subject: [PATCH] Update routes from interactive-sicp to sicpjs (#1822) * Update routes from interactive-sicp to sicpjs * Fix linting errors * Update README.md --- README.md | 3 ++- src/commons/__tests__/__snapshots__/Markdown.tsx.snap | 2 +- src/commons/application/Application.tsx | 7 ++++--- .../__tests__/__snapshots__/Application.tsx.snap | 5 +++-- src/commons/navigationBar/NavigationBar.tsx | 10 +++++----- .../__tests__/__snapshots__/NavigationBar.tsx.snap | 8 ++++---- .../subcomponents/NavigationBarMobileSideMenu.tsx | 2 +- .../navigationBar/subcomponents/SicpNavigationBar.tsx | 2 +- .../__snapshots__/NavigationBarMobileSideMenu.tsx.snap | 4 ++-- .../__snapshots__/SideContentEnvVisualizer.tsx.snap | 2 +- src/commons/utils/Constants.ts | 8 ++++---- src/pages/sicp/Sicp.tsx | 2 +- src/pages/sicp/subcomponents/SicpToc.tsx | 2 +- 13 files changed, 30 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index f083bd3218..fd04fc7481 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,10 @@ [![Coverage Status](https://coveralls.io/repos/github/source-academy/cadet-frontend/badge.svg?branch=master)](https://coveralls.io/github/source-academy/cadet-frontend?branch=master) [![License](https://img.shields.io/github/license/source-academy/cadet-frontend)](https://github.com/source-academy/cadet-frontend/blob/master/LICENSE) -The Source Academy () is an immersive online experiential environment for learning programming. It is developed by a community of learners (also called "Source Academy") who use the book [Structure and Interpretation of Computer Programs, JavaScript Adaptation](https://source-academy.github.io/interactive-sicp) (SICP JS). This repository houses the sources for the frontend of the Source Academy, written in ReactJS with Redux. +The Source Academy () is an immersive online experiential environment for learning programming. It is developed by a community of learners (also called "Source Academy") who use the book [Structure and Interpretation of Computer Programs, JavaScript Adaptation](https://sourceacademy.org/sicpjs) (SICP JS). This repository houses the sources for the frontend of the Source Academy, written in ReactJS with Redux. ## Features + - Playground to write and test programs - Built-in Debugger and Visualizer to interact with your programs - Missions/Quests/Contests to solve challenging problems while learning about programming fundamentals diff --git a/src/commons/__tests__/__snapshots__/Markdown.tsx.snap b/src/commons/__tests__/__snapshots__/Markdown.tsx.snap index 794852d50a..94b2f32f71 100644 --- a/src/commons/__tests__/__snapshots__/Markdown.tsx.snap +++ b/src/commons/__tests__/__snapshots__/Markdown.tsx.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Markdown page renders correctly 1`] = ` -" +"
" `; diff --git a/src/commons/application/Application.tsx b/src/commons/application/Application.tsx index a27f747c7a..f3fdd74e06 100644 --- a/src/commons/application/Application.tsx +++ b/src/commons/application/Application.tsx @@ -158,8 +158,9 @@ const Application: React.FC = props => { /> )} - - + + + {fullPaths} = props => { const redirectToPlayground = () => ; const redirectToAcademy = () => ; const redirectToLogin = () => ; -const redirectToSicp = () => ; +const redirectToSicp = () => ; /** * A user routes to /academy, diff --git a/src/commons/application/__tests__/__snapshots__/Application.tsx.snap b/src/commons/application/__tests__/__snapshots__/Application.tsx.snap index 9f088128d6..822ba8dbd6 100644 --- a/src/commons/application/__tests__/__snapshots__/Application.tsx.snap +++ b/src/commons/application/__tests__/__snapshots__/Application.tsx.snap @@ -10,8 +10,9 @@ exports[`Application renders correctly 1`] = ` - - + + + diff --git a/src/commons/navigationBar/NavigationBar.tsx b/src/commons/navigationBar/NavigationBar.tsx index 95d048c0d7..edd3afa15e 100644 --- a/src/commons/navigationBar/NavigationBar.tsx +++ b/src/commons/navigationBar/NavigationBar.tsx @@ -106,7 +106,7 @@ const NavigationBar: React.FC = props => { Classes.MINIMAL, Classes.LARGE )} - to="/interactive-sicp/index" + to="/sicpjs/index" onClick={() => setMobileSideMenuOpen(false)} > @@ -136,7 +136,7 @@ const NavigationBar: React.FC = props => {
SICP JS
@@ -156,7 +156,7 @@ const NavigationBar: React.FC = props => {
SICP JS
@@ -234,7 +234,7 @@ const NavigationBar: React.FC = props => {
SICP JS
@@ -301,7 +301,7 @@ const NavigationBar: React.FC = props => { - + diff --git a/src/commons/navigationBar/__tests__/__snapshots__/NavigationBar.tsx.snap b/src/commons/navigationBar/__tests__/__snapshots__/NavigationBar.tsx.snap index ad54d31b24..6196e451eb 100644 --- a/src/commons/navigationBar/__tests__/__snapshots__/NavigationBar.tsx.snap +++ b/src/commons/navigationBar/__tests__/__snapshots__/NavigationBar.tsx.snap @@ -28,7 +28,7 @@ exports[`NavigationBar renders "Not logged in" correctly 1`] = ` Classroom
- +
SICP JS @@ -52,7 +52,7 @@ exports[`NavigationBar renders "Not logged in" correctly 1`] = ` - + @@ -88,7 +88,7 @@ exports[`NavigationBar renders correctly with student role 1`] = ` Classroom
- +
SICP JS @@ -122,7 +122,7 @@ exports[`NavigationBar renders correctly with student role 1`] = ` - + diff --git a/src/commons/navigationBar/subcomponents/NavigationBarMobileSideMenu.tsx b/src/commons/navigationBar/subcomponents/NavigationBarMobileSideMenu.tsx index 89f25a3842..bedd1cd180 100644 --- a/src/commons/navigationBar/subcomponents/NavigationBarMobileSideMenu.tsx +++ b/src/commons/navigationBar/subcomponents/NavigationBarMobileSideMenu.tsx @@ -180,7 +180,7 @@ const NavigationBarMobileSideMenu: React.FC = Classes.MINIMAL, Classes.LARGE )} - to="/interactive-sicp/index" + to="/sicpjs/index" onClick={props.onClose} > diff --git a/src/commons/navigationBar/subcomponents/SicpNavigationBar.tsx b/src/commons/navigationBar/subcomponents/SicpNavigationBar.tsx index 6dbc46bda3..f5922ef7ea 100644 --- a/src/commons/navigationBar/subcomponents/SicpNavigationBar.tsx +++ b/src/commons/navigationBar/subcomponents/SicpNavigationBar.tsx @@ -22,7 +22,7 @@ const SicpNavigationBar: React.FC = () => { const handleCloseToc = () => setIsTocOpen(false); const handleOpenToc = () => setIsTocOpen(true); const handleNavigation = (sect: string) => { - history.push('/interactive-sicp/' + sect); + history.push('/sicpjs/' + sect); }; // Button to open table of contents diff --git a/src/commons/navigationBar/subcomponents/__tests__/__snapshots__/NavigationBarMobileSideMenu.tsx.snap b/src/commons/navigationBar/subcomponents/__tests__/__snapshots__/NavigationBarMobileSideMenu.tsx.snap index 5c49725e0b..3d7291718f 100644 --- a/src/commons/navigationBar/subcomponents/__tests__/__snapshots__/NavigationBarMobileSideMenu.tsx.snap +++ b/src/commons/navigationBar/subcomponents/__tests__/__snapshots__/NavigationBarMobileSideMenu.tsx.snap @@ -20,7 +20,7 @@ exports[`NavigationBarMobileSideMenu renders "Not logged in" correctly 1`] = ` Classroom
- +
SICP JS @@ -83,7 +83,7 @@ exports[`NavigationBarMobileSideMenu renders correctly with student role 1`] = ` Classroom
- +
SICP JS diff --git a/src/commons/sideContent/__tests__/__snapshots__/SideContentEnvVisualizer.tsx.snap b/src/commons/sideContent/__tests__/__snapshots__/SideContentEnvVisualizer.tsx.snap index dd40ba535c..703e30075b 100644 --- a/src/commons/sideContent/__tests__/__snapshots__/SideContentEnvVisualizer.tsx.snap +++ b/src/commons/sideContent/__tests__/__snapshots__/SideContentEnvVisualizer.tsx.snap @@ -11,7 +11,7 @@ exports[`EnvVisualizer component renders correctly 1`] = `
The environment model diagram follows a notation introduced in - + Structure and Interpretation of Computer Programs, JavaScript Adaptation, Chapter 3, Section 2 diff --git a/src/commons/utils/Constants.ts b/src/commons/utils/Constants.ts index 7b1f2cfbcc..2d83f2011a 100644 --- a/src/commons/utils/Constants.ts +++ b/src/commons/utils/Constants.ts @@ -32,7 +32,7 @@ const googleAppId = process.env.REACT_APP_GOOGLE_APP_ID; const githubClientId = process.env.REACT_APP_GITHUB_CLIENT_ID || ''; const githubOAuthProxyUrl = process.env.REACT_APP_GITHUB_OAUTH_PROXY_URL || ''; const interactiveSicpDataUrl = - process.env.REACT_APP_INTERACTIVE_SICP_DATA_URL || 'https://sicp.sourceacademy.org/'; // data for interactive-sicp (images and json files) + process.env.REACT_APP_INTERACTIVE_SICP_DATA_URL || 'https://sicp.sourceacademy.org/'; // data for sicpjs (images and json files) const authProviders: Map = new Map(); @@ -80,10 +80,10 @@ export enum Links { sourceDocs = 'https://docs.sourceacademy.org/', techSVC = 'mailto:techsvc@comp.nus.edu.sg', techSVCNumber = '6516 2736', - textbook = 'https://sourceacademy.org/interactive-sicp/', + textbook = 'https://sourceacademy.org/sicpjs/', playground = 'https://sourceacademy.org/playground', - textbookChapter2_2 = 'https://sourceacademy.org/interactive-sicp/2.2', - textbookChapter3_2 = 'https://sourceacademy.org/interactive-sicp/3.2', + textbookChapter2_2 = 'https://sourceacademy.org/sicpjs/2.2', + textbookChapter3_2 = 'https://sourceacademy.org/sicpjs/3.2', aceHotkeys = 'https://github.com/ajaxorg/ace/wiki/Default-Keyboard-Shortcuts', sourceHotkeys = 'https://github.com/source-academy/cadet-frontend/wiki/Source-Academy-Keyboard-Shortcuts', diff --git a/src/pages/sicp/Sicp.tsx b/src/pages/sicp/Sicp.tsx index 0be777aa79..572cf6fee0 100644 --- a/src/pages/sicp/Sicp.tsx +++ b/src/pages/sicp/Sicp.tsx @@ -117,7 +117,7 @@ const Sicp: React.FC = props => { dispatch(toggleUsingSubst(false, 'sicp')); }; const handleNavigation = (sect: string | undefined) => { - history.push('/interactive-sicp/' + sect); + history.push('/sicpjs/' + sect); }; const navigationButtons = ( diff --git a/src/pages/sicp/subcomponents/SicpToc.tsx b/src/pages/sicp/subcomponents/SicpToc.tsx index ea21f81b07..ac1b8c9025 100644 --- a/src/pages/sicp/subcomponents/SicpToc.tsx +++ b/src/pages/sicp/subcomponents/SicpToc.tsx @@ -36,7 +36,7 @@ const SicpToc: React.FC = props => { if (props.handleCloseToc) { props.handleCloseToc(); } - history.push('/interactive-sicp/' + String(node.nodeData)); + history.push('/sicpjs/' + String(node.nodeData)); }, [history, props] );