Skip to content

Commit 620e8ff

Browse files
authored
Merge branch 'master' into master
2 parents a1b188a + 35209d7 commit 620e8ff

Some content is hidden

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

44 files changed

+1295
-1169
lines changed

package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,18 @@
3535
"@blueprintjs/datetime2": "^2.3.3",
3636
"@blueprintjs/icons": "^6.0.0",
3737
"@blueprintjs/select": "^5.1.3",
38+
"@convergencelabs/ace-collab-ext": "^0.6.0",
3839
"@mantine/hooks": "^7.11.2",
3940
"@octokit/rest": "^22.0.0",
4041
"@reduxjs/toolkit": "^1.9.7",
4142
"@sentry/browser": "^8.33.0",
4243
"@sourceacademy/c-slang": "^1.0.21",
43-
"@sourceacademy/sharedb-ace": "^2.0.3",
44+
"@sourceacademy/sharedb-ace": "^2.1.1",
4445
"@sourceacademy/sling-client": "^0.1.0",
4546
"@szhsin/react-menu": "^4.0.0",
4647
"@tanstack/react-table": "^8.9.3",
4748
"@tremor/react": "^1.8.2",
48-
"ace-builds": "^1.36.3",
49+
"ace-builds": "^1.42.1",
4950
"acorn": "^8.9.0",
5051
"ag-grid-community": "^32.3.1",
5152
"ag-grid-react": "^32.3.1",
@@ -60,6 +61,7 @@
6061
"hastscript": "^9.0.0",
6162
"i18next": "^25.0.0",
6263
"i18next-browser-languagedetector": "^8.0.0",
64+
"immer": "^9.0.21",
6365
"java-slang": "^1.0.13",
6466
"js-cookie": "^3.0.5",
6567
"js-slang": "^1.0.84",
@@ -115,7 +117,6 @@
115117
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
116118
"@babel/preset-typescript": "^7.24.1",
117119
"@babel/runtime": "^7.24.5",
118-
"@convergencelabs/ace-collab-ext": "^0.6.0",
119120
"@rsbuild/core": "^1.3.12",
120121
"@rsbuild/plugin-eslint": "^1.1.1",
121122
"@rsbuild/plugin-node-polyfill": "^1.3.0",
@@ -127,7 +128,7 @@
127128
"@testing-library/dom": "^10.4.0",
128129
"@testing-library/jest-dom": "^6.0.0",
129130
"@testing-library/react": "^16.0.0",
130-
"@testing-library/user-event": "^14.4.3",
131+
"@testing-library/user-event": "^14.6.0",
131132
"@types/estree": "^1.0.5",
132133
"@types/gapi": "^0.0.47",
133134
"@types/gapi.auth2": "^0.0.61",
@@ -154,7 +155,7 @@
154155
"canvas": "^3.1.0",
155156
"constants-browserify": "^1.0.0",
156157
"coveralls": "^3.1.1",
157-
"cross-env": "^7.0.3",
158+
"cross-env": "^10.0.0",
158159
"eslint": "^9.9.0",
159160
"eslint-plugin-react": "^7.35.0",
160161
"eslint-plugin-react-hooks": "^5.2.0",
@@ -163,7 +164,7 @@
163164
"https-browserify": "^1.0.0",
164165
"husky": "^9.0.0",
165166
"identity-obj-proxy": "^3.0.0",
166-
"jsdom": "^25.0.1",
167+
"jsdom": "^26.0.0",
167168
"npm-run-all2": "^8.0.0",
168169
"os-browserify": "^0.3.0",
169170
"path": "^0.12.7",

src/commons/application/ApplicationTypes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,6 @@ export const defaultAchievement: AchievementState = {
348348
};
349349

350350
export const defaultLeaderboard: LeaderboardState = {
351-
userXp: [],
352351
paginatedUserXp: { rows: [], userCount: 0 },
353352
contestScore: [],
354353
contestPopularVote: [],
@@ -430,7 +429,8 @@ export const createDefaultWorkspace = (workspaceLocation: WorkspaceLocation): Wo
430429
enableDebugging: true,
431430
debuggerContext: {} as DebuggerContext,
432431
lastDebuggerResult: undefined,
433-
files: {}
432+
files: {},
433+
updateUserRoleCallback: () => {}
434434
});
435435

436436
const defaultFileName = 'program.js';

src/commons/assessmentWorkspace/AssessmentWorkspace.tsx

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,7 @@ const AssessmentWorkspace: React.FC<AssessmentWorkspaceProps> = props => {
464464
const isTeamAssessment =
465465
assessmentOverview !== undefined ? assessmentOverview.maxTeamSize > 1 : false;
466466
const isContestVoting = question?.type === QuestionTypes.voting;
467+
const isPublished = assessmentOverview?.isPublished;
467468
const handleContestEntryClick = (_submissionId: number, answer: string) => {
468469
// TODO: Hardcoded to make use of the first editor tab. Refactoring is needed for this workspace to enable Folder mode.
469470
handleEditorValueChange(0, answer);
@@ -538,34 +539,38 @@ const AssessmentWorkspace: React.FC<AssessmentWorkspaceProps> = props => {
538539
/>
539540
),
540541
id: SideContentType.contestVoting
541-
},
542-
{
543-
label: 'Score Leaderboard',
544-
iconName: IconNames.CROWN,
545-
body: (
546-
<SideContentContestLeaderboard
547-
handleContestEntryClick={handleContestEntryClick}
548-
orderedContestEntries={(question as IContestVotingQuestion)?.scoreLeaderboard ?? []}
549-
leaderboardType={SideContentType.scoreLeaderboard}
550-
/>
551-
),
552-
id: SideContentType.scoreLeaderboard
553-
},
554-
{
555-
label: 'Popular Vote Leaderboard',
556-
iconName: IconNames.PEOPLE,
557-
body: (
558-
<SideContentContestLeaderboard
559-
handleContestEntryClick={handleContestEntryClick}
560-
orderedContestEntries={
561-
(question as IContestVotingQuestion)?.popularVoteLeaderboard ?? []
562-
}
563-
leaderboardType={SideContentType.popularVoteLeaderboard}
564-
/>
565-
),
566-
id: SideContentType.popularVoteLeaderboard
567542
}
568543
);
544+
if (isPublished) {
545+
tabs.push(
546+
{
547+
label: 'Score Leaderboard',
548+
iconName: IconNames.CROWN,
549+
body: (
550+
<SideContentContestLeaderboard
551+
handleContestEntryClick={handleContestEntryClick}
552+
orderedContestEntries={(question as IContestVotingQuestion)?.scoreLeaderboard ?? []}
553+
leaderboardType={SideContentType.scoreLeaderboard}
554+
/>
555+
),
556+
id: SideContentType.scoreLeaderboard
557+
},
558+
{
559+
label: 'Popular Vote Leaderboard',
560+
iconName: IconNames.PEOPLE,
561+
body: (
562+
<SideContentContestLeaderboard
563+
handleContestEntryClick={handleContestEntryClick}
564+
orderedContestEntries={
565+
(question as IContestVotingQuestion)?.popularVoteLeaderboard ?? []
566+
}
567+
leaderboardType={SideContentType.popularVoteLeaderboard}
568+
/>
569+
),
570+
id: SideContentType.popularVoteLeaderboard
571+
}
572+
);
573+
}
569574
} else {
570575
tabs.push(
571576
{

0 commit comments

Comments
 (0)