Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
ac41982
feat: initializing the Redux store
Andrw-404 Dec 30, 2025
75ab88f
feat: add index.ts and hooks.ts
Andrw-404 Dec 30, 2025
fcc3772
feat: upd store
Andrw-404 Dec 31, 2025
37e0b77
feat: upd store
Andrw-404 Dec 31, 2025
21c7785
feat: connect the Redux Provider
Andrw-404 Jan 3, 2026
f4eb53a
refactor: replaced useState with useAppSelector/dispatch in Course.tsx
Andrw-404 Jan 4, 2026
8b6225a
feat: integrate Redux for Course/CourseExperimental
Andrw-404 Jan 4, 2026
e815458
feat: add courseFileSlice.ts and solutionSlice.ts with update index.ts
Andrw-404 Jan 4, 2026
8e6bc54
feat: solutionSlice and courseFileSlice integrate into Course.tsx
Andrw-404 Jan 4, 2026
c895c10
feat: upd slices in store
Andrw-404 Jan 4, 2026
940ddc8
refactor: add-on for Redux integration
Andrw-404 Jan 4, 2026
6990525
feat: upd index.ts
Andrw-404 Jan 4, 2026
3bc1dc6
refactor: integration Course.tsx and StudentStats.tsx
Andrw-404 Jan 4, 2026
7f833b1
feature: upd store
Andrw-404 Jan 7, 2026
7cce748
refactor: integrate MentorsList.tsx with Redux
Andrw-404 Jan 7, 2026
2f93a27
refactor: integrate LecturerStatistics.tsx with Redux
Andrw-404 Jan 7, 2026
5e26fce
refactor: integrate Course.tsx with Redux
Andrw-404 Jan 7, 2026
8d5c801
refactor: integrate CourseExperimental.tsx with Redux
Andrw-404 Jan 7, 2026
d908bef
refactor: integrate NewCourseStudents.tsx with Redux
Andrw-404 Jan 7, 2026
eb6e30b
refactor: integrate StudentStats.tsx with Redux
Andrw-404 Jan 7, 2026
4d07639
refactor: integrate CourseHomeworkExperimental.tsx with Redux
Andrw-404 Jan 7, 2026
7297a21
refactor: integrate CourseTaskExperimental.tsx with Redux
Andrw-404 Jan 7, 2026
0acbad3
Merge remote-tracking branch 'upstream/master' into feature/state-man…
Andrw-404 Jan 7, 2026
4ebee23
refactor: rename key in index.ts
Andrw-404 Jan 7, 2026
96683dd
Merge remote-tracking branch 'upstream/master' into feature/state-man…
Andrw-404 Mar 8, 2026
8d2e5b9
fix CourseExperimental.tsx
Andrw-404 Mar 8, 2026
01d7a76
refactor: changes in store and related to that
Andrw-404 Mar 9, 2026
d4ae7eb
rolling back changes
Andrw-404 Mar 9, 2026
1a82753
refactor: implement editing state hooks and selection
Andrw-404 Mar 10, 2026
30d8e3d
refactor: Course.tsx in accordance with state management through stores
Andrw-404 Mar 10, 2026
7f0581c
refactor: unlink CourseExperimental from props, connect to store
Andrw-404 Mar 10, 2026
8cf6b4a
Merge branch 'master' into feature/state-management
Andrw-404 Mar 10, 2026
687a5c2
refactor: improve merging of draft tasks in useMergedHomeworks
Andrw-404 Mar 10, 2026
85f68a5
refactor: editing logic is now in the editor component
Andrw-404 Mar 10, 2026
6836dba
refactor: simplify CourseExperimental, remove callbacks before compon…
Andrw-404 Mar 10, 2026
ad8f89c
refactor: move the homework editing logic to a component
Andrw-404 Mar 10, 2026
4e1638d
fix: editing icon
Andrw-404 Mar 10, 2026
27f2213
refactor: remove prop drilling from CourseExperimental
Andrw-404 Mar 10, 2026
9b4dec0
refactor: removed the excess
Andrw-404 Mar 10, 2026
d91e88b
store: added editing hooks
Andrw-404 Mar 10, 2026
5f93370
store: move the course loading logic to courseHooks and simplify cour…
Andrw-404 Mar 10, 2026
b95305e
store: delete editingHooks.ts
Andrw-404 Mar 10, 2026
7b787ac
refactor: migrating Course components and editing to store based mana…
Andrw-404 Mar 10, 2026
1ef48f9
refactor: replace dispatch with the useRefreshCourse hook
Andrw-404 Mar 10, 2026
d7ffc98
fix: fix saving homework with a task in multiple drafts mode
Andrw-404 Mar 10, 2026
4745f03
refactor: Rebuild the course's store hooks and simplify the work of h…
Andrw-404 Mar 12, 2026
fb5f085
fix: unnecessary updates when the deadline is auto-inserted
Andrw-404 Mar 12, 2026
72f45ab
style: returned to normal appearance
Andrw-404 Mar 12, 2026
737c36d
refactor: when you cancel editing a new task in the new homework, we …
Andrw-404 Mar 12, 2026
ba78167
style: another option is selected for the "Undo changes to homework/t…
Andrw-404 Mar 13, 2026
9f69a8f
refactor: undo changes
Andrw-404 Mar 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
177 changes: 128 additions & 49 deletions hwproj.front/package-lock.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions hwproj.front/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"@mui/lab": "^5.0.0-alpha.99",
"@mui/material": "^5.16.11",
"@mui/x-charts": "^8.2.0",
"@reduxjs/toolkit": "^2.11.2",
"@storybook/addon-knobs": "^6.3.0",
"@types/bluebird": "^3.5.36",
"@types/classnames": "^2.3.1",
Expand Down Expand Up @@ -48,6 +49,7 @@
"react-drag-drop-files": "^3.1.0",
"react-markdown": "^5.0.0",
"react-query": "^3.21.1",
"react-redux": "^9.2.0",
"react-router-dom": "^6.5.0",
"react-social-login-buttons": "^3.5.1",
"react-syntax-highlighter": "^15.5.0",
Expand Down
220 changes: 65 additions & 155 deletions hwproj.front/src/components/Courses/Course.tsx

Large diffs are not rendered by default.

1,208 changes: 540 additions & 668 deletions hwproj.front/src/components/Courses/CourseExperimental.tsx

Large diffs are not rendered by default.

31 changes: 14 additions & 17 deletions hwproj.front/src/components/Courses/NewCourseStudents.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,26 @@
import * as React from 'react';
import {AccountDataDto, CourseViewModel} from '../../api/';
import ApiSingleton from "../../api/ApiSingleton";
import {FC} from "react";
import {Card, CardContent, CardActions, Grid, Button, Typography, Alert, AlertTitle} from '@mui/material';
import {useCourseState} from "@/store/hooks";
import {useRefreshCourse} from "@/store/storeHooks/courseHooks";

interface INewCourseStudentsProps {
course: CourseViewModel,
students: AccountDataDto[],
onUpdate: () => void,
courseId: string,
}

const NewCourseStudents: FC<INewCourseStudentsProps> = (props) => {
const NewCourseStudents: FC = () => {
const course = useCourseState(state => state.course.currentCourseMeta);
const students = useCourseState(state => state.course.newStudents);
const refreshCourse = useRefreshCourse();

const acceptStudent = async (studentId: string) => {
await ApiSingleton.coursesApi.coursesAcceptStudent(props.course.id!, studentId)
props.onUpdate()
}
await ApiSingleton.coursesApi.coursesAcceptStudent(course?.id!, studentId);
refreshCourse(course?.id!);
};

const rejectStudent = async (studentId: string) => {
await ApiSingleton.coursesApi.coursesRejectStudent(props.course.id!, studentId)
props.onUpdate()
}
await ApiSingleton.coursesApi.coursesRejectStudent(course?.id!, studentId);
refreshCourse(course?.id!);
};

const studentsLength = props.students.length
const studentsLength = students.length

if (studentsLength === 0) {
return (
Expand All @@ -36,7 +33,7 @@ const NewCourseStudents: FC<INewCourseStudentsProps> = (props) => {
)
}
return <Grid item container spacing={1} direction={"row"} xs={"auto"}>
{props.students.map((cm, i) => (
{students.map((cm, i) => (
<Grid item>
<Card variant="elevation" style={{backgroundColor: "ghostwhite"}}>
<CardContent>
Expand Down
8 changes: 4 additions & 4 deletions hwproj.front/src/components/Courses/StudentStats.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, {useEffect, useState, useRef} from "react";
import {CourseViewModel, HomeworkViewModel, StatisticsCourseMatesModel} from "@/api";
import {HomeworkViewModel, StatisticsCourseMatesModel} from "@/api";
import {useNavigate, useParams} from 'react-router-dom';
import {LinearProgress, Table, TableBody, TableCell, TableContainer, TableHead, TableRow} from "@material-ui/core";
import StudentStatsCell from "../Tasks/StudentStatsCell";
Expand All @@ -9,12 +9,12 @@ import StudentStatsUtils from "../../services/StudentStatsUtils";
import ShowChartIcon from "@mui/icons-material/ShowChart";
import {BonusTag, DefaultTags, TestTag} from "../Common/HomeworkTags";
import Lodash from "lodash"
import ApiSingleton from "@/api/ApiSingleton";
import FullscreenIcon from '@mui/icons-material/Fullscreen';
import FullscreenExitIcon from '@mui/icons-material/FullscreenExit';
import {CurrentCourseMeta} from "@/store/slices/courseSlice";

interface IStudentStatsProps {
course: CourseViewModel;
course: CurrentCourseMeta;
homeworks: HomeworkViewModel[];
isMentor: boolean;
userId: string;
Expand Down Expand Up @@ -62,7 +62,7 @@ const StudentStats: React.FC<IStudentStatsProps> = (props) => {
}, [])

const {searched} = state
const isMentor = ApiSingleton.authService.isMentor()
const isMentor = props.isMentor

useEffect(() => {
const keyDownHandler = (event: KeyboardEvent) => {
Expand Down
Loading
Loading