Skip to content

Commit 7ef87d8

Browse files
committed
Merge branch 'cse-uiux' of https://github.com/source-academy/frontend into cse-uiux
2 parents e8cc8cd + efa8c57 commit 7ef87d8

File tree

127 files changed

+3264
-3835
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+3264
-3835
lines changed

.husky/pre-push

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
41
bash scripts/test.sh

package.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,32 +23,32 @@
2323
"test-coveralls": "./scripts/test-coveralls.sh",
2424
"update-ui-snapshots": "jest --updateSnapshot",
2525
"eslint": "eslint --ext \".js,.jsx,.ts,.tsx\" src",
26-
"prepare": "husky install"
26+
"prepare": "husky"
2727
},
2828
"dependencies": {
2929
"@blueprintjs/core": "^4.20.1",
3030
"@blueprintjs/datetime": "^4.4.37",
3131
"@blueprintjs/icons": "^4.16.0",
3232
"@blueprintjs/popover2": "^1.14.11",
3333
"@blueprintjs/select": "^4.9.24",
34-
"@octokit/rest": "^19.0.11",
34+
"@octokit/rest": "^20.0.0",
3535
"@sentry/browser": "^7.57.0",
3636
"@sourceacademy/sharedb-ace": "^2.0.2",
3737
"@sourceacademy/sling-client": "^0.1.0",
38-
"@szhsin/react-menu": "^3.5.3",
38+
"@szhsin/react-menu": "^4.0.0",
3939
"@tanstack/react-table": "^8.9.3",
4040
"@tremor/react": "^1.8.2",
4141
"ace-builds": "^1.4.14",
4242
"acorn": "^8.9.0",
43-
"ag-grid-community": "^28.0.2",
44-
"ag-grid-react": "^28.0.0",
43+
"ag-grid-community": "^31.0.0",
44+
"ag-grid-react": "^31.0.0",
4545
"array-move": "^4.0.0",
4646
"browserfs": "^1.4.3",
4747
"classnames": "^2.3.2",
4848
"flexboxgrid": "^6.3.1",
4949
"flexboxgrid-helpers": "^1.1.3",
50-
"hastscript": "^8.0.0",
51-
"js-slang": "^1.0.37",
50+
"hastscript": "^9.0.0",
51+
"js-slang": "^1.0.39",
5252
"js-yaml": "^4.1.0",
5353
"konva": "^9.2.0",
5454
"lodash": "^4.17.21",
@@ -88,14 +88,15 @@
8888
"sourceror": "^0.8.5",
8989
"typesafe-actions": "^5.1.0",
9090
"unified": "^11.0.0",
91-
"uuid": "^8.3.2",
91+
"uuid": "^9.0.0",
9292
"xml2js": "^0.6.0",
9393
"yareco": "^0.1.5"
9494
},
9595
"devDependencies": {
96+
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
9697
"@craco/craco": "^7.1.0",
97-
"@svgr/webpack": "^6.3.1",
98-
"@testing-library/jest-dom": "^5.16.5",
98+
"@svgr/webpack": "^8.0.0",
99+
"@testing-library/jest-dom": "^6.0.0",
99100
"@testing-library/react": "^14.0.0",
100101
"@testing-library/user-event": "^14.4.3",
101102
"@types/acorn": "^6.0.0",
@@ -104,10 +105,9 @@
104105
"@types/gapi.client": "^1.0.5",
105106
"@types/gapi.client.drive": "^3.0.14",
106107
"@types/google.picker": "^0.0.39",
107-
"@types/jest": "^28.1.6",
108+
"@types/jest": "^29.0.0",
108109
"@types/js-yaml": "^4.0.5",
109110
"@types/lodash": "^4.14.195",
110-
"@types/lz-string": "^1.3.34",
111111
"@types/react": "^18.2.13",
112112
"@types/react-copy-to-clipboard": "^5.0.4",
113113
"@types/react-dom": "^18.2.6",
@@ -120,7 +120,7 @@
120120
"@types/react-textarea-autosize": "^8.0.0",
121121
"@types/redux-mock-store": "^1.0.3",
122122
"@types/showdown": "^2.0.1",
123-
"@types/uuid": "^8.3.4",
123+
"@types/uuid": "^9.0.0",
124124
"@types/xml2js": "^0.4.11",
125125
"babel-core": "6",
126126
"babel-runtime": "^6.26.0",
@@ -129,13 +129,13 @@
129129
"constants-browserify": "^1.0.0",
130130
"coveralls": "^3.1.1",
131131
"cross-env": "^7.0.3",
132-
"eslint-plugin-simple-import-sort": "^7.0.0",
132+
"eslint-plugin-simple-import-sort": "^10.0.0",
133133
"https-browserify": "^1.0.0",
134-
"husky": "^8.0.2",
135-
"npm-run-all": "^4.1.5",
134+
"husky": "^9.0.0",
135+
"npm-run-all2": "^5.0.0",
136136
"os-browserify": "^0.3.0",
137137
"path-browserify": "^1.0.1",
138-
"prettier": "^2.8.8",
138+
"prettier": "~3.0.0",
139139
"process": "^0.11.10",
140140
"react-error-overlay": "^6.0.11",
141141
"react-scripts": "^5.0.1",

public/externalLibs/inspector/inspector.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,22 @@
2929
}
3030
}
3131

32-
function highlightCleanForAgenda() {
32+
function highlightCleanForControl() {
3333
var gutterCells = document.getElementsByClassName('ace_gutter-cell');
3434
var aceLines = document.getElementsByClassName('ace_line');
3535
if (gutterCells != undefined) {
3636
for (cell of gutterCells) {
37-
cell.classList.remove('ace_gutter-cell_hi_agenda');
37+
cell.classList.remove('ace_gutter-cell_hi_control');
3838
}
3939
}
4040
if (aceLines != undefined) {
4141
for (line of aceLines) {
42-
line.classList.remove('ace_line_hi_agenda');
42+
line.classList.remove('ace_line_hi_control');
4343
}
4444
}
4545
}
4646

47-
function highlightLineForAgenda(number) {
47+
function highlightLineForControl(number) {
4848
if (number == undefined) return;
4949
var gutterCells = document.getElementsByClassName('ace_gutter-cell');
5050
var aceLines = document.getElementsByClassName('ace_line');
@@ -61,16 +61,16 @@
6161
}
6262
}
6363

64-
gutterCells[number].classList.add('ace_gutter-cell_hi_agenda');
65-
aceLines[number].classList.add('ace_line_hi_agenda');
64+
gutterCells[number].classList.add('ace_gutter-cell_hi_control');
65+
aceLines[number].classList.add('ace_line_hi_control');
6666
}
6767
}
6868

6969
exports.Inspector = {
7070
highlightLine,
7171
highlightClean,
72-
highlightCleanForAgenda,
73-
highlightLineForAgenda
72+
highlightCleanForControl,
73+
highlightLineForControl
7474
};
7575
setTimeout(() => {}, 1000);
7676
})(window);

src/commons/ReactRouterPrompt.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* See: https://github.com/remix-run/react-router/issues/8139#issuecomment-1382428200
99
*/
1010
import * as React from 'react';
11-
import { unstable_useBlocker as useBlocker, useBeforeUnload } from 'react-router-dom';
11+
import { useBeforeUnload, useBlocker } from 'react-router-dom';
1212

1313
// You can abstract `useBlocker` to use the browser's `window.confirm` dialog to
1414
// determine whether or not the user should navigate within the current origin.

src/commons/achievement/AchievementCommentCard.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React, { useMemo } from 'react';
22
import { useNavigate } from 'react-router';
3+
import classes from 'src/styles/AchievementCommentCard.module.scss';
34

45
import { Assessment } from '../assessment/AssessmentTypes';
56
import { useTypedSelector } from '../utils/Hooks';
@@ -28,22 +29,25 @@ const AchievementCommentCard: React.FC<{
2829

2930
return (
3031
<div>
31-
<h1 className="assessment-feedback">Feedback</h1>
32-
<div className="feedback-list">
32+
<h1 className={classes['assessment-feedback']}>Feedback</h1>
33+
<div className={classes['feedback-list']}>
3334
{assessment &&
3435
assessment.questions.map((question, index) => (
35-
<div className="assessment-comments" key={index}>
36+
<div className={classes['assessment-comments']} key={index}>
3637
<span>
37-
<h2 className="question-header">{'Q' + (index + 1)}</h2>
38+
<h2 className={classes['question-header']}>{'Q' + (index + 1)}</h2>
3839
</span>
3940

40-
<div className="box-comment">
41+
<div className={classes['box-comment']}>
4142
<p>{question.comments === null ? 'No Comments' : question.comments}</p>
4243
<p className="xp">{'XP: ' + question.xp + '/' + question.maxXp}</p>
4344
</div>
4445

4546
{showToQuestion && (
46-
<button className="to-assessment-button" onClick={() => toMission(index)}>
47+
<button
48+
className={classes['to-assessment-button']}
49+
onClick={() => toMission(index)}
50+
>
4751
{'To Question'}
4852
</button>
4953
)}

src/commons/achievement/utils/AchievementBackender.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const frontendifyAchievementGoal = (goal: any) =>
3131
count: goal.count,
3232
targetCount: goal.targetCount,
3333
completed: goal.count >= goal.targetCount
34-
} as AchievementGoal);
34+
}) as AchievementGoal;
3535

3636
export const frontendifyAchievementItem = (achievement: any) =>
3737
({
@@ -51,7 +51,7 @@ export const frontendifyAchievementItem = (achievement: any) =>
5151
completionText: achievement.view.completionText || '',
5252
description: achievement.view.description || ''
5353
}
54-
} as AchievementItem);
54+
}) as AchievementItem;
5555

5656
export const backendifyAchievementItem = (achievement: AchievementItem) => ({
5757
...achievement,

src/commons/application/ApplicationReducer.ts

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/commons/application/ApplicationTypes.ts

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ export type OverallState = {
2626
readonly router: RouterState;
2727
readonly academy: AcademyState;
2828
readonly achievement: AchievementState;
29-
readonly application: ApplicationState;
3029
readonly playground: PlaygroundState;
3130
readonly session: SessionState;
3231
readonly stories: StoriesState;
@@ -35,10 +34,6 @@ export type OverallState = {
3534
readonly fileSystem: FileSystemState;
3635
};
3736

38-
export type ApplicationState = {
39-
readonly environment: ApplicationEnvironment;
40-
};
41-
4237
export type Story = {
4338
story: string;
4439
playStory: boolean;
@@ -95,12 +90,6 @@ export type ErrorOutput = {
9590

9691
export type InterpreterOutput = RunningOutput | CodeOutput | ResultOutput | ErrorOutput;
9792

98-
export enum ApplicationEnvironment {
99-
Development = 'development',
100-
Production = 'production',
101-
Test = 'test'
102-
}
103-
10493
export enum Role {
10594
Student = 'student',
10695
Staff = 'staff',
@@ -288,27 +277,12 @@ export const getLanguageConfig = (
288277
return languageConfig;
289278
};
290279

291-
const currentEnvironment = (): ApplicationEnvironment => {
292-
switch (process.env.NODE_ENV) {
293-
case 'development':
294-
return ApplicationEnvironment.Development;
295-
case 'production':
296-
return ApplicationEnvironment.Production;
297-
default:
298-
return ApplicationEnvironment.Test;
299-
}
300-
};
301-
302280
export const defaultRouter: RouterState = null;
303281

304282
export const defaultAcademy: AcademyState = {
305283
gameCanvas: undefined
306284
};
307285

308-
export const defaultApplication: ApplicationState = {
309-
environment: currentEnvironment()
310-
};
311-
312286
export const defaultDashboard: DashboardState = {
313287
gradingSummary: {
314288
cols: [],
@@ -550,7 +524,6 @@ export const defaultState: OverallState = {
550524
router: defaultRouter,
551525
academy: defaultAcademy,
552526
achievement: defaultAchievement,
553-
application: defaultApplication,
554527
dashboard: defaultDashboard,
555528
playground: defaultPlayground,
556529
session: defaultSession,

src/commons/application/__tests__/ApplicationReducer.ts

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/commons/application/__tests__/__snapshots__/ApplicationReducer.ts.snap

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)