Skip to content

Commit

Permalink
Merge branch 'master' into devs
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-henz committed Jun 24, 2021
2 parents bc07525 + 12b80ab commit 9b6c113
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 27 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 (<https://source-academy.github.io/>) 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 (<https://sourceacademy.org/>) 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
Expand Down
2 changes: 1 addition & 1 deletion src/commons/__tests__/__snapshots__/Markdown.tsx.snap
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Markdown page renders correctly 1`] = `
"<Memo(Markdown) content=\\"\\\\nWelcome to the Source Academy playground!\\\\n\\\\nThe language [_Source_](https://docs.sourceacademy.org/) is the official language of the textbook [_Structure and\\\\nInterpretation of Computer Programs, JavaScript Adaptation_](https://sourceacademy.org/interactive-sicp/). You have chosen the sublanguage [_Source §1_](https://docs.sourceacademy.org/source_1/).\\\\n\\\\nIn the editor on the left, you can use the [_Ace keyboard shortcuts_](https://github.com/ajaxorg/ace/wiki/Default-Keyboard-Shortcuts) \\\\nand also the [_Source Academy keyboard shortcuts_](https://github.com/source-academy/cadet-frontend/wiki/Source-Academy-Keyboard-Shortcuts).\\\\n\\\\n\\" openLinksInNewWindow={true}>
"<Memo(Markdown) content=\\"\\\\nWelcome to the Source Academy playground!\\\\n\\\\nThe language [_Source_](https://docs.sourceacademy.org/) is the official language of the textbook [_Structure and\\\\nInterpretation of Computer Programs, JavaScript Adaptation_](https://sourceacademy.org/sicpjs/). You have chosen the sublanguage [_Source §1_](https://docs.sourceacademy.org/source_1/).\\\\n\\\\nIn the editor on the left, you can use the [_Ace keyboard shortcuts_](https://github.com/ajaxorg/ace/wiki/Default-Keyboard-Shortcuts) \\\\nand also the [_Source Academy keyboard shortcuts_](https://github.com/source-academy/cadet-frontend/wiki/Source-Academy-Keyboard-Shortcuts).\\\\n\\\\n\\" openLinksInNewWindow={true}>
<div className=\\"md bp3-running-text\\" dangerouslySetInnerHTML={{...}} />
</Memo(Markdown)>"
`;
7 changes: 4 additions & 3 deletions src/commons/application/Application.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,9 @@ const Application: React.FC<ApplicationProps> = props => {
/>
)}
<Route path="/callback/github" component={GitHubCallback} />
<Route exact path="/interactive-sicp" render={redirectToSicp} />
<Route path="/interactive-sicp/:section" component={Sicp} />
<Redirect from="/interactive-sicp/:section?" to="/sicpjs/:section?" />
<Route exact path="/sicpjs" render={redirectToSicp} />
<Route path="/sicpjs/:section" component={Sicp} />
{fullPaths}
<Route
exact={true}
Expand All @@ -177,7 +178,7 @@ const Application: React.FC<ApplicationProps> = props => {
const redirectToPlayground = () => <Redirect to="/playground" />;
const redirectToAcademy = () => <Redirect to="/academy" />;
const redirectToLogin = () => <Redirect to="/login" />;
const redirectToSicp = () => <Redirect to="/interactive-sicp/index" />;
const redirectToSicp = () => <Redirect to="/sicpjs/index" />;

/**
* A user routes to /academy,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ exports[`Application renders correctly 1`] = `
<Route path=\\"/sourcecast/:sourcecastId?\\" component={[Function: C] { displayName: 'withRouter(Connect(Sourcecast))', WrappedComponent: [Function: Sourcecast], propTypes: { wrappedComponentRef: [Function: bound checkType] { isRequired: [Function: bound checkType] } } }} />
<Route path=\\"/githubassessments\\" component={[Function: component]} />
<Route path=\\"/callback/github\\" component={[Function: GitHubCallback]} />
<Route exact={true} path=\\"/interactive-sicp\\" render={[Function: redirectToSicp]} />
<Route path=\\"/interactive-sicp/:section\\" component={[Function: Sicp]} />
<Redirect from=\\"/interactive-sicp/:section?\\" to=\\"/sicpjs/:section?\\" />
<Route exact={true} path=\\"/sicpjs\\" render={[Function: redirectToSicp]} />
<Route path=\\"/sicpjs/:section\\" component={[Function: Sicp]} />
<Route path=\\"/academy\\" render={[Function: redirectToLogin]} />
<Route path=\\"/mission-control/:assessmentId(-?\\\\\\\\d+)?/:questionId(\\\\\\\\d+)?\\" render={[Function: toIncubator]} />
<Route path=\\"/login\\" render={[Function (anonymous)]} />
Expand Down
10 changes: 5 additions & 5 deletions src/commons/navigationBar/NavigationBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ const NavigationBar: React.FC<NavigationBarProps> = props => {
Classes.MINIMAL,
Classes.LARGE
)}
to="/interactive-sicp/index"
to="/sicpjs/index"
onClick={() => setMobileSideMenuOpen(false)}
>
<Icon icon={IconNames.BOOK} />
Expand Down Expand Up @@ -136,7 +136,7 @@ const NavigationBar: React.FC<NavigationBarProps> = props => {
<NavLink
activeClassName={Classes.ACTIVE}
className={classNames('NavigationBar__link__mobile', Classes.BUTTON, Classes.MINIMAL)}
to="/interactive-sicp/index"
to="/sicpjs/index"
>
<Icon icon={IconNames.BOOK} />
<div>SICP JS</div>
Expand All @@ -156,7 +156,7 @@ const NavigationBar: React.FC<NavigationBarProps> = props => {
<NavLink
activeClassName={Classes.ACTIVE}
className={classNames('NavigationBar__link__mobile', Classes.BUTTON, Classes.MINIMAL)}
to="/interactive-sicp/index"
to="/sicpjs/index"
>
<Icon icon={IconNames.BOOK} />
<div>SICP JS</div>
Expand Down Expand Up @@ -234,7 +234,7 @@ const NavigationBar: React.FC<NavigationBarProps> = props => {
<NavLink
activeClassName={Classes.ACTIVE}
className={classNames('NavigationBar__link', Classes.BUTTON, Classes.MINIMAL)}
to="/interactive-sicp/index"
to="/sicpjs/index"
>
<Icon icon={IconNames.BOOK} />
<div className="navbar-button-text">SICP JS</div>
Expand Down Expand Up @@ -301,7 +301,7 @@ const NavigationBar: React.FC<NavigationBarProps> = props => {
</Navbar>

<Switch>
<Route path="/interactive-sicp/:section?">
<Route path="/sicpjs/:section?">
<SicpNavigationBar />
</Route>
<Route>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ exports[`NavigationBar renders "Not logged in" correctly 1`] = `
Classroom
</div>
</NavLink>
<NavLink activeClassName=\\"bp3-active\\" className=\\"NavigationBar__link bp3-button bp3-minimal\\" to=\\"/interactive-sicp/index\\">
<NavLink activeClassName=\\"bp3-active\\" className=\\"NavigationBar__link bp3-button bp3-minimal\\" to=\\"/sicpjs/index\\">
<Blueprint3.Icon icon=\\"book\\" />
<div className=\\"navbar-button-text\\">
SICP JS
Expand All @@ -52,7 +52,7 @@ exports[`NavigationBar renders "Not logged in" correctly 1`] = `
</Blueprint3.NavbarGroup>
</Blueprint3.Navbar>
<Switch>
<Route path=\\"/interactive-sicp/:section?\\">
<Route path=\\"/sicpjs/:section?\\">
<SicpNavigationBar />
</Route>
<Route />
Expand Down Expand Up @@ -88,7 +88,7 @@ exports[`NavigationBar renders correctly with student role 1`] = `
Classroom
</div>
</NavLink>
<NavLink activeClassName=\\"bp3-active\\" className=\\"NavigationBar__link bp3-button bp3-minimal\\" to=\\"/interactive-sicp/index\\">
<NavLink activeClassName=\\"bp3-active\\" className=\\"NavigationBar__link bp3-button bp3-minimal\\" to=\\"/sicpjs/index\\">
<Blueprint3.Icon icon=\\"book\\" />
<div className=\\"navbar-button-text\\">
SICP JS
Expand Down Expand Up @@ -122,7 +122,7 @@ exports[`NavigationBar renders correctly with student role 1`] = `
</Blueprint3.NavbarGroup>
</Blueprint3.Navbar>
<Switch>
<Route path=\\"/interactive-sicp/:section?\\">
<Route path=\\"/sicpjs/:section?\\">
<SicpNavigationBar />
</Route>
<Route>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ const NavigationBarMobileSideMenu: React.FC<NavigationBarMobileSideMenuProps> =
Classes.MINIMAL,
Classes.LARGE
)}
to="/interactive-sicp/index"
to="/sicpjs/index"
onClick={props.onClose}
>
<Icon icon={IconNames.BOOK} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ exports[`NavigationBarMobileSideMenu renders "Not logged in" correctly 1`] = `
Classroom
</div>
</NavLink>
<NavLink activeClassName=\\"bp3-active\\" className=\\"NavigationBar__link_mobile bp3-button bp3-minimal bp3-large\\" to=\\"/interactive-sicp/index\\" onClick={[Function: onClose]}>
<NavLink activeClassName=\\"bp3-active\\" className=\\"NavigationBar__link_mobile bp3-button bp3-minimal bp3-large\\" to=\\"/sicpjs/index\\" onClick={[Function: onClose]}>
<Blueprint3.Icon icon=\\"book\\" />
<div className=\\"navbar-button-text\\">
SICP JS
Expand Down Expand Up @@ -83,7 +83,7 @@ exports[`NavigationBarMobileSideMenu renders correctly with student role 1`] = `
Classroom
</div>
</NavLink>
<NavLink activeClassName=\\"bp3-active\\" className=\\"NavigationBar__link_mobile bp3-button bp3-minimal bp3-large\\" to=\\"/interactive-sicp/index\\" onClick={[Function: onClose]}>
<NavLink activeClassName=\\"bp3-active\\" className=\\"NavigationBar__link_mobile bp3-button bp3-minimal bp3-large\\" to=\\"/sicpjs/index\\" onClick={[Function: onClose]}>
<Blueprint3.Icon icon=\\"book\\" />
<div className=\\"navbar-button-text\\">
SICP JS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ exports[`EnvVisualizer component renders correctly 1`] = `
<br />
The environment model diagram follows a notation introduced in
<a href=\\"https://sourceacademy.org/interactive-sicp/3.2\\" rel=\\"noopener noreferrer\\" target=\\"_blank\\">
<a href=\\"https://sourceacademy.org/sicpjs/3.2\\" rel=\\"noopener noreferrer\\" target=\\"_blank\\">
<i>
Structure and Interpretation of Computer Programs, JavaScript Adaptation, Chapter 3, Section 2
</i>
Expand Down
8 changes: 4 additions & 4 deletions src/commons/utils/Constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, { name: string; endpoint: string; isDefault: boolean }> =
new Map();
Expand Down Expand Up @@ -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',

Expand Down
2 changes: 1 addition & 1 deletion src/pages/sicp/Sicp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ const Sicp: React.FC<SicpProps> = props => {
dispatch(toggleUsingSubst(false, 'sicp'));
};
const handleNavigation = (sect: string | undefined) => {
history.push('/interactive-sicp/' + sect);
history.push('/sicpjs/' + sect);
};

const navigationButtons = (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/sicp/subcomponents/SicpToc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const SicpToc: React.FC<TocProps> = props => {
if (props.handleCloseToc) {
props.handleCloseToc();
}
history.push('/interactive-sicp/' + String(node.nodeData));
history.push('/sicpjs/' + String(node.nodeData));
},
[history, props]
);
Expand Down

0 comments on commit 9b6c113

Please sign in to comment.