42 Commits

Author SHA1 Message Date
Primakov Alexandr Alexandrovich
81533c3342 3.6.7 2025-01-08 18:33:10 +03:00
Primakov Alexandr Alexandrovich
462ba85fe8 check exam link to render 2025-01-08 18:33:02 +03:00
Primakov Alexandr Alexandrovich
d0f7dfb87d login required back
All checks were successful
platform/bro-js/journal.pl/pipeline/head This commit looks good
2025-01-07 18:09:54 +03:00
Primakov Alexandr Alexandrovich
a133cea95c 3.6.6 2025-01-07 18:04:01 +03:00
Primakov Alexandr Alexandrovich
4704b404f9 update ts config 2025-01-07 17:00:37 +03:00
Primakov Alexandr Alexandrovich
55d23f1e47 twik a bit 2025-01-07 16:57:37 +03:00
Primakov Alexandr Alexandrovich
6b07fef62f up kc js version 2025-01-07 16:49:55 +03:00
Primakov Alexandr Alexandrovich
3242576a12 check sso 2 debug 2025-01-07 16:42:04 +03:00
Primakov Alexandr Alexandrovich
a7168231a1 kc params from env 2025-01-07 16:20:20 +03:00
Primakov Alexandr Alexandrovich
cc7f3d3371 3.6.5
All checks were successful
platform/bro-js/journal.pl/pipeline/head This commit looks good
2024-12-21 16:19:32 +03:00
Primakov Alexandr Alexandrovich
d20cb7257b 3.6.4 2024-12-21 16:16:40 +03:00
Primakov Alexandr Alexandrovich
ab9e5f6d19 3.6.3
All checks were successful
platform/bro-js/journal.pl/pipeline/head This commit looks good
2024-12-15 20:35:48 +03:00
Primakov Alexandr Alexandrovich
71d2f59750 teachers in Attendance 2024-12-15 20:35:39 +03:00
Primakov Alexandr Alexandrovich
bdd53ca15b 3.6.2 2024-12-15 17:20:20 +03:00
Primakov Alexandr Alexandrovich
789d2ed6ca manual add for teacher only 2024-12-15 17:20:16 +03:00
Primakov Alexandr Alexandrovich
d4b7d0616e 3.6.1 2024-12-15 17:14:49 +03:00
Primakov Alexandr Alexandrovich
b5bd2e02d7 not create access token if not teacher 2024-12-15 17:03:14 +03:00
Primakov Alexandr Alexandrovich
428b06f920 3.6.0
All checks were successful
platform/bro-js/journal.pl/pipeline/head This commit looks good
2024-12-12 22:59:07 +03:00
Primakov Alexandr Alexandrovich
7d6f2a4ca0 no JSON stringify in attendance 2024-12-12 16:00:49 +03:00
Primakov Alexandr Alexandrovich
2fe7600ef3 fix 2024-12-12 15:20:55 +03:00
Primakov Alexandr Alexandrovich
985b8ef315 stringify 2024-12-12 12:30:56 +03:00
Primakov Alexandr Alexandrovich
956fdec7f5 unknown name if no name 2024-12-12 12:12:19 +03:00
Primakov Alexandr Alexandrovich
d44a511a3d try get student name even better 2024-12-12 12:09:25 +03:00
Primakov Alexandr Alexandrovich
0aebb87210 update get student name in attendance 2024-12-12 11:17:38 +03:00
Primakov Alexandr Alexandrovich
9509f12d73 3.5.1
All checks were successful
platform/bro-js/journal.pl/pipeline/head This commit looks good
2024-11-06 13:04:00 +03:00
Primakov Alexandr Alexandrovich
021031ced7 short lesson name 2024-11-06 13:03:55 +03:00
Primakov Alexandr Alexandrovich
22a9199d9d no attendance link if no nav element 2024-11-06 12:59:24 +03:00
Primakov Alexandr Alexandrovich
e56f0e4e5d 3.5.0 2024-11-06 12:52:36 +03:00
Primakov Alexandr Alexandrovich
5c13ca1cac no width limit in attendance 2024-11-06 12:52:29 +03:00
Primakov Alexandr Alexandrovich
56e07bc2ef attendance table 2024-11-06 12:35:55 +03:00
Primakov Alexandr Alexandrovich
923f7034dd 3.4.1
All checks were successful
platform/bro-js/journal.pl/pipeline/head This commit looks good
2024-10-30 14:44:17 +03:00
Primakov Alexandr Alexandrovich
fd422da06f fix update lesson 2024-10-30 14:44:12 +03:00
Primakov Alexandr Alexandrovich
0034704af6 3.4.0 2024-10-30 14:28:55 +03:00
Primakov Alexandr Alexandrovich
3dfd854a4c inline edit mode 2024-10-30 14:28:42 +03:00
Primakov Alexandr Alexandrovich
6b903b4d54 3.3.1 2024-10-22 17:52:44 +03:00
Primakov Alexandr Alexandrovich
c3de9692d8 fix unmount stuff 2024-10-22 16:56:19 +03:00
Primakov Alexandr Alexandrovich
b2898ef4b3 try open exam as spa 2024-10-22 16:39:32 +03:00
Primakov Alexandr Alexandrovich
26c8a477c3 3.3.0 2024-10-01 10:06:22 +03:00
Primakov Alexandr Alexandrovich
c9a64ccbef lessons list table размер названия лекции максимален 2024-10-01 10:05:56 +03:00
Primakov Alexandr Alexandrovich
250feff2f4 fix link to exam 2024-09-01 16:11:08 +03:00
Primakov Alexandr Alexandrovich
efc359ce7e fix exam url 2024-08-29 11:55:10 +03:00
Primakov Alexandr Alexandrovich
5911cdf8a8 link 2 exam 2024-08-29 09:55:05 +03:00
28 changed files with 2837 additions and 4171 deletions

24
@types/index.d.ts vendored Normal file
View File

@@ -0,0 +1,24 @@
declare const IS_PROD: string
declare const KC_URL: string
declare const KC_REALM: string
declare const KC_CLIENT_ID: string
declare module '*.svg' {
const value: string
export default value
}
declare module '*.jpg' {
const value: string
export default value
}
declare module '*.png' {
const value: string
export default value
}
declare const __webpack_public_path__: string

View File

@@ -1,3 +1,5 @@
const webpack = require('webpack');
const pkg = require('./package')
module.exports = {
@@ -6,9 +8,19 @@ module.exports = {
output: {
publicPath: `/static/${pkg.name}/${process.env.VERSION || pkg.version}/`,
},
plugins: [
new webpack.DefinePlugin({
KC_URL: process.env.KC_URL || '"https://kc.bro-js.ru"',
KC_REALM: process.env.KC_REALM || '"bro-js"',
KC_CLIENT_ID: process.env.KC_CLIENT_ID || '"microfrontend-admin"',
}),
],
},
navigations: {
'journal.main': '/journal.pl',
'exam.main': '/exam',
'link.exam.details': '/details/:courseId/:examId',
'link.journal.attendance': '/attendance/:courseId',
},
features: {
journal: {

6
index.d.ts vendored
View File

@@ -1,6 +0,0 @@
declare module '*.svg' {
const src: string;
export default src;
}
declare const __webpack_public_path__: string;

View File

@@ -1,12 +0,0 @@
import type { ConfigFile } from '@rtk-query/codegen-openapi'
const config: ConfigFile = {
schemaFile: 'https://platform.bro-js.ru/jrnl-bh/documentation/json',
apiFile: './src/__data__/api/api.ts',
apiImport: 'api',
outputFile: './src/__data__/api/jrnl.ts',
exportName: 'jrnlApi',
hooks: true,
}
export default config

5650
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "journal.pl",
"version": "3.2.0",
"version": "3.6.7",
"description": "bro-js platform journal ui repo",
"main": "./src/index.tsx",
"scripts": {
@@ -19,14 +19,13 @@
"author": "",
"license": "MIT",
"devDependencies": {
"@rtk-query/codegen-openapi": "^1.2.0",
"@typescript-eslint/eslint-plugin": "^7.4.0",
"@typescript-eslint/parser": "^7.4.0",
"eslint": "^8.57.0",
"eslint-plugin-react": "^7.34.1"
},
"dependencies": {
"@brojs/cli": "^0.0.4-beta.0",
"@brojs/cli": "^1.8.4",
"@chakra-ui/icons": "^2.1.1",
"@chakra-ui/react": "^2.8.2",
"@emotion/react": "^11.11.4",
@@ -38,7 +37,7 @@
"dayjs": "^1.11.10",
"express": "^4.19.2",
"js-sha256": "^0.11.0",
"keycloak-js": "^23.0.7",
"keycloak-js": "^26.0.7",
"prettier": "^3.2.5",
"qrcode": "^1.5.3",
"react": "^18.3.1",

View File

@@ -21,9 +21,9 @@ export const api = createApi({
init?: RequestInit | undefined,
) => {
const response = await fetch(input, init)
if (response.status === 403) keycloak.login()
return response
},
headers: {
@@ -40,8 +40,8 @@ export const api = createApi({
providesTags: ['CourseList'],
}),
createUpdateCourse: builder.mutation<
BaseResponse<Course>,
Partial<Course> & Pick<Course, 'name'>
BaseResponse<Course>,
Partial<Course> & Pick<Course, 'name'>
>({
query: (course) => ({
url: '/course',
@@ -54,8 +54,8 @@ export const api = createApi({
query: (courseId) => `/course/students/${courseId}`,
}),
manualAddStudent: builder.mutation<
BaseResponse<void>,
{ lessonId: string; user: User }
BaseResponse<void>,
{ lessonId: string; user: User }
>({
query: ({ lessonId, user }) => ({
url: `/lesson/add-student/${lessonId}`,
@@ -63,14 +63,14 @@ export const api = createApi({
body: user,
}),
}),
lessonList: builder.query<BaseResponse<Lesson[]>, string>({
query: (courseId) => `/lesson/list/${courseId}`,
providesTags: ['LessonList'],
}),
createLesson: builder.mutation<
BaseResponse<Lesson>,
Partial<Lesson> & Pick<Lesson, 'name' | 'date'> & { courseId: string }
BaseResponse<Lesson>,
Partial<Lesson> & Pick<Lesson, 'name' | 'date'> & { courseId: string }
>({
query: (data) => ({
url: '/lesson',
@@ -97,10 +97,10 @@ export const api = createApi({
lessonById: builder.query<BaseResponse<Lesson>, string>({
query: (lessonId: string) => `/lesson/${lessonId}`,
}),
createAccessCode: builder.query<
BaseResponse<AccessCode>,
{ lessonId: string }
BaseResponse<AccessCode>,
{ lessonId: string }
>({
query: ({ lessonId }) => ({
url: '/lesson/access-code',
@@ -109,8 +109,8 @@ export const api = createApi({
}),
}),
getAccess: builder.query<
BaseResponse<{ user: UserData; accessCode: AccessCode }>,
{ accessCode: string }
BaseResponse<{ user: UserData; accessCode: AccessCode }>,
{ accessCode: string }
>({
query: ({ accessCode }) => ({
url: `/lesson/access-code/${accessCode}`,
@@ -126,6 +126,7 @@ export const api = createApi({
query: (courseId) => ({
url: `/course/toggle-exam-with-jury/${courseId}`,
method: 'POST',
body: {},
}),
invalidatesTags: ['Course']
})

View File

@@ -1,9 +1,9 @@
import Keycloak from 'keycloak-js';
import Keycloak from 'keycloak-js'
export const keycloak = new Keycloak({
url: 'https://kc.bro-js.ru',
realm: 'bro-js',
clientId: 'journal'
url: KC_URL,
realm: KC_REALM,
clientId: KC_CLIENT_ID,
});
window.keycloak = keycloak;
(window as any).kc = keycloak

View File

@@ -53,10 +53,17 @@ export interface Lesson {
id: string;
name: string;
students: User[];
teachers: Teacher[];
date: string;
created: string;
}
interface Teacher {
sub: string;
email_verified: boolean;
preferred_username: string;
}
export interface AccessCode {
expires: string;
lesson: Lesson;

View File

@@ -0,0 +1,26 @@
import { Alert } from '@chakra-ui/react'
import React from 'react'
export class ErrorBoundary extends React.Component<
React.PropsWithChildren,
{ hasError: boolean, error?: string }
> {
state = { hasError: false, error: null }
static getDerivedStateFromError(error: Error) {
return { hasError: true, error: error.message }
}
render() {
if (this.state.hasError) {
return (
<Alert status="error" title="Ошибка">
Что-то пошло не так<br />
{this.state.error && <span>{this.state.error}</span>}
</Alert>
)
}
return this.props.children
}
}

View File

@@ -9,23 +9,28 @@ import {
LessonDetailsPage,
LessonListPage,
UserPage,
AttendancePage,
} from './pages'
import { ErrorBoundary } from './components/error-boundary'
const Wrapper = ({ children }: { children: React.ReactElement }) => (
<Suspense
fallback={
<Container>
<VStack>
<Box mt="150">
<Spinner
thickness="4px"
speed="0.65s"
emptyColor="gray.200"
color="blue.500"
size="xl"
/></Box>
</VStack>
</Container>
<ErrorBoundary>
<Container>
<VStack>
<Box mt="150">
<Spinner
thickness="4px"
speed="0.65s"
emptyColor="gray.200"
color="blue.500"
size="xl"
/>
</Box>
</VStack>
</Container>
</ErrorBoundary>
}
>
{children}
@@ -67,6 +72,14 @@ export const Dashboard = ({ store }) => (
</Wrapper>
}
/>
<Route
path={`${getNavigationsValue('journal.main')}${getNavigationsValue('link.journal.attendance')}`}
element={
<Wrapper>
<AttendancePage />
</Wrapper>
}
/>
</Routes>
</Provider>
)

View File

@@ -1,3 +1,4 @@
/* eslint-disable react/display-name */
import React from 'react';
import ReactDOM from 'react-dom/client';
@@ -13,23 +14,30 @@ export default (props) => <App {...props} />;
let rootElement: ReactDOM.Root
export const mount = async (Сomponent, element = document.getElementById('app')) => {
export const mount = async (Component, element = document.getElementById('app')) => {
let user = null;
try {
await keycloak.init({ onLoad: "login-required" });
user = { ...(await keycloak.loadUserInfo()), ...keycloak.tokenParsed };
await keycloak.init({ onLoad: 'login-required' })
const userInfo = await keycloak.loadUserInfo()
if (userInfo && keycloak.tokenParsed) {
user = { ...userInfo, ...keycloak.tokenParsed }
} else {
console.error('No userInfo or tokenParsed', userInfo, keycloak.tokenParsed)
}
} catch (error) {
console.error("Failed to initialize adapter:", error);
keycloak.login();
console.error('Failed to initialize adapter:', error)
keycloak.login()
}
const store = createStore({ user });
const rootElement = ReactDOM.createRoot(element);
rootElement.render(<Сomponent store={store} />);
rootElement = ReactDOM.createRoot(element);
rootElement.render(<Component store={store} />);
if(module.hot) {
module.hot.accept('./app', ()=> {
rootElement.render(<Сomponent store={store} />);
rootElement.render(<Component store={store} />);
})
}
};

View File

@@ -0,0 +1,140 @@
import React, { useMemo } from 'react'
import { useParams } from 'react-router-dom'
import { Box, Heading, Tooltip, Text } from '@chakra-ui/react'
import dayjs from 'dayjs'
import { api } from '../../__data__/api/api'
import { PageLoader } from '../../components/page-loader/page-loader'
export const Attendance = () => {
const { courseId } = useParams()
const { data: attendance, isLoading } = api.useLessonListQuery(courseId, {
selectFromResult: ({ data, isLoading }) => ({
data: data?.body,
isLoading,
}),
})
const { data: courseInfo, isLoading: courseInfoIssLoading } =
api.useGetCourseByIdQuery(courseId)
const data = useMemo(() => {
if (!attendance) return null
const studentsMap = new Map()
const teachersMap = new Map()
attendance.forEach((lesson) => {
lesson.teachers?.map((teacher: any) => {
teachersMap.set(teacher.sub, { id: teacher.sub, ...teacher, value: teacher.value || (teacher.family_name && teacher.given_name
? `${teacher.family_name} ${teacher.given_name}`
: teacher.name || teacher.email || teacher.preferred_username || teacher.family_name || teacher.given_name), })
})
lesson.students.forEach((student) => {
const current = studentsMap.get(student.sub) || {}
studentsMap.set(student.sub, {
...student,
id: student.sub,
value: current.value || (student.family_name && student.given_name
? `${student.family_name} ${student.given_name}`
: student.name || student.email || student.preferred_username || student.family_name || student.given_name),
})
})
})
const compare = Intl.Collator('ru').compare
const students = [...studentsMap.values()]
const taechers = [...teachersMap.values()]
students.sort(({ family_name: name }, { family_name: nname }) =>
compare(name, nname),
)
return {
students,
taechers,
}
}, [attendance])
if (!data || isLoading || courseInfoIssLoading) {
return <PageLoader />
}
return (
<Box>
<Box mt={12} mb={12}>
<Heading>{courseInfo.name}</Heading>
</Box>
<Box>
<table>
<thead>
<tr>
{data.taechers.map(teacher => (
<th id={teacher.id} key={teacher.id}>{teacher.value}</th>
))}
<th>Дата</th>
<th>Название занятия</th>
{data.students.map((student) => (
<th id={student.id || student.sub} key={student.sub}>{student.name || student.value || 'Имя не определено'}</th>
))}
</tr>
</thead>
<tbody>
{attendance.map((lesson, index) => (
<tr key={lesson.name}>
{data?.taechers?.map((teacher) => {
const wasThere = Boolean(lesson.teachers) &&
lesson?.teachers?.findIndex((u) => u.sub === teacher.sub) !== -1
return (
<td
style={{
textAlign: 'center',
backgroundColor: wasThere ? '#8ef78a' : '#e09797',
}}
key={teacher.sub}
>
{wasThere ? '+' : '-'}
</td>
)
})}
<td>{dayjs(lesson.date).format('DD.MM.YYYY')}</td>
<td>{<ShortText text={lesson.name} />}</td>
{data.students.map((st) => {
const wasThere =
lesson.students.findIndex((u) => u.sub === st.sub) !== -1
return (
<td
style={{
textAlign: 'center',
backgroundColor: wasThere ? '#8ef78a' : '#e09797',
}}
key={st.sub}
>
{wasThere ? '+' : '-'}
</td>
)
})}
</tr>
))}
</tbody>
</table>
</Box>
</Box>
)
}
const ShortText = ({ text }: { text: string }) => {
const needShortText = text.length > 20
if (needShortText) {
return (
<Tooltip label="На страницу с лекциями" fontSize="12px" top="16px">
<Text>{text.slice(0, 20)}...</Text>
</Tooltip>
)
}
return text
}

View File

@@ -0,0 +1,3 @@
import { Attendance } from './attendance'
export default Attendance

View File

@@ -1,20 +1,20 @@
import React, { useCallback, useEffect, useState } from 'react'
import dayjs from 'dayjs'
import { Link as ConnectedLink } from 'react-router-dom'
import { Link as ConnectedLink, generatePath } from 'react-router-dom'
import { getNavigationsValue } from '@brojs/cli'
import {
Box,
CardHeader,
CardBody,
CardFooter,
ButtonGroup,
Stack,
StackDivider,
Button,
Card,
Heading,
Tooltip,
Spinner,
Box,
CardHeader,
CardBody,
CardFooter,
ButtonGroup,
Stack,
StackDivider,
Button,
Card,
Heading,
Tooltip,
Spinner,
} from '@chakra-ui/react'
import { api } from '../../__data__/api/api'
@@ -22,72 +22,100 @@ import { ArrowUpIcon, LinkIcon } from '@chakra-ui/icons'
import { Course } from '../../__data__/model'
import { CourseDetails } from './course-details'
export const CourseCard = ({
course,
}: {
course: Course
}) => {
const [getLessonList, populatedCourse] = api.useLazyGetCourseByIdQuery()
const [isOpened, setIsOpened] = useState(false)
useEffect(() => {
if (isOpened) {
getLessonList(course.id, true)
}
}, [isOpened])
export const CourseCard = ({ course }: { course: Course }) => {
const [getLessonList, populatedCourse] = api.useLazyGetCourseByIdQuery()
const [isOpened, setIsOpened] = useState(false)
useEffect(() => {
if (isOpened) {
getLessonList(course.id, true)
}
}, [isOpened])
const handleToggleOpene = useCallback(() => {
setIsOpened(opened => !opened)
}, [setIsOpened])
const handleToggleOpene = useCallback(() => {
setIsOpened((opened) => !opened)
}, [setIsOpened])
return (
<Card key={course._id} align="left">
<CardHeader>
<Heading as="h2" mt="0">
{course.name}
</Heading>
</CardHeader>
{isOpened && (
<CardBody mt="16px">
<Stack divider={<StackDivider />} spacing="8px">
<Box as="span" textAlign="left">
{`Дата начала курса - ${dayjs(course.startDt).format('DD MMMM YYYYг.')}`}
</Box>
<Box as="span" textAlign="left">
Количество занятий - {course.lessons.length}
</Box>
return (
<Card key={course._id} align="left">
<CardHeader>
<Heading as="h2" mt="0">
{course.name}
</Heading>
</CardHeader>
{isOpened && (
<CardBody mt="16px">
<Stack divider={<StackDivider />} spacing="8px">
<Box as="span" textAlign="left">
{`Дата начала курса - ${dayjs(course.startDt).format('DD MMMM YYYYг.')}`}
</Box>
<Box as="span" textAlign="left">
Количество занятий - {course.lessons.length}
</Box>
{populatedCourse.isFetching && <Spinner />}
{!populatedCourse.isFetching && populatedCourse.isSuccess && <CourseDetails populatedCourse={populatedCourse.data} />}
</Stack>
</CardBody>
{populatedCourse.isFetching && <Spinner />}
{!populatedCourse.isFetching && populatedCourse.isSuccess && (
<CourseDetails populatedCourse={populatedCourse.data} />
)}
<CardFooter>
<ButtonGroup spacing={[0, 4]} mt="16px" flexDirection={['column', 'row']}>
<Tooltip label="На страницу с лекциями" fontSize="12px" top="16px">
<Button
leftIcon={<LinkIcon />}
as={ConnectedLink}
colorScheme="blue"
to={`${getNavigationsValue('journal.main')}/lessons-list/${course._id}`}
>
Открыть
</Button>
</Tooltip>
<Tooltip label="Детали" fontSize="12px" top="16px">
<Button
colorScheme="blue"
mt={["16px", 0]}
variant="outline"
leftIcon={<ArrowUpIcon transform={isOpened ? 'rotate(0)' : 'rotate(180deg)'} />}
loadingText="Загрузка"
isLoading={populatedCourse.isFetching}
onClick={handleToggleOpene}
>
{isOpened ? 'Закрыть' : 'Просмотреть детали'}
</Button>
</Tooltip>
</ButtonGroup>
</CardFooter>
</Card>
)
{getNavigationsValue('link.journal.attendance') && (
<Tooltip
label="На страницу с лекциями"
fontSize="12px"
top="16px"
>
<Button
leftIcon={<LinkIcon />}
as={ConnectedLink}
variant="outline"
colorScheme="blue"
to={generatePath(
`${getNavigationsValue('journal.main')}${getNavigationsValue('link.journal.attendance')}`,
{ courseId: course.id },
)}
>
<Box mt={3}></Box>
Посещаемость
</Button>
</Tooltip>
)}
</Stack>
</CardBody>
)}
<CardFooter>
<ButtonGroup
spacing={[0, 4]}
mt="16px"
flexDirection={['column', 'row']}
>
<Tooltip label="На страницу с лекциями" fontSize="12px" top="16px">
<Button
leftIcon={<LinkIcon />}
as={ConnectedLink}
colorScheme="blue"
to={`${getNavigationsValue('journal.main')}/lessons-list/${course._id}`}
>
Открыть
</Button>
</Tooltip>
<Tooltip label="Детали" fontSize="12px" top="16px">
<Button
colorScheme="blue"
mt={['16px', 0]}
variant="outline"
leftIcon={
<ArrowUpIcon
transform={isOpened ? 'rotate(0)' : 'rotate(180deg)'}
/>
}
loadingText="Загрузка"
isLoading={populatedCourse.isFetching}
onClick={handleToggleOpene}
>
{isOpened ? 'Закрыть' : 'Просмотреть детали'}
</Button>
</Tooltip>
</ButtonGroup>
</CardFooter>
</Card>
)
}

View File

@@ -1,83 +1,108 @@
import React from 'react'
import dayjs from 'dayjs'
import { Link as ConnectedLink } from 'react-router-dom'
import { getNavigationsValue } from '@brojs/cli'
import {
Stack,
Heading,
Link,
Button,
Tooltip,
Box,
} from '@chakra-ui/react'
import { getNavigationValue, getHistory } from '@brojs/cli'
import { Stack, Heading, Link, Button, Tooltip, Box } from '@chakra-ui/react'
import { useAppSelector } from '../../__data__/store'
import { isTeacher } from '../../utils/user'
import { PopulatedCourse } from '../../__data__/model'
import { api } from '../../__data__/api/api'
import { LinkIcon } from '@chakra-ui/icons'
type CourseDetailsProps = {
populatedCourse: PopulatedCourse;
populatedCourse: PopulatedCourse
}
const history = getHistory()
export const CourseDetails = ({ populatedCourse }: CourseDetailsProps) => {
const user = useAppSelector((s) => s.user)
const exam = populatedCourse.examWithJury
const [toggleExamWithJury, examWithJuryRequest] = api.useToggleExamWithJuryMutation()
const user = useAppSelector((s) => s.user)
const exam = populatedCourse.examWithJury
const [toggleExamWithJury, examWithJuryRequest] =
api.useToggleExamWithJuryMutation()
return (
return (
<>
{isTeacher(user) && (
<Heading as="h3" mt={4} mb={3} size="lg">
Экзамен: {exam?.name}{' '}
{exam && getNavigationValue('exam.main') && getNavigationValue('link.exam.details') && (
<Tooltip label="Начать экзамен" fontSize="12px" top="16px">
<Button
leftIcon={<LinkIcon />}
as={'a'}
colorScheme="blue"
href={
getNavigationValue('exam.main') +
getNavigationValue('link.exam.details')
.replace(':courseId', populatedCourse.id)
.replace(':examId', exam.id)
}
onClick={(event) => {
event.preventDefault()
history.push(
getNavigationValue('exam.main') +
getNavigationValue('link.exam.details')
.replace(':courseId', populatedCourse.id)
.replace(':examId', exam.id),
)
}}
>
Открыть
</Button>
</Tooltip>
)}
</Heading>
)}
{!Boolean(exam) && (
<>
<Heading as="h3" mt={4} mb={3} size="lg">
Экзамен:
</Heading>
{!Boolean(exam) && (
<>
<Heading as="h3" mt={4} mb={3} size="lg">
Не задан
</Heading>
<Box mt={10}>
<Tooltip label="Детали" fontSize="12px" top="16px">
<Button
colorScheme="blue"
mt={["16px", 0]}
variant="outline"
isLoading={examWithJuryRequest.isLoading}
onClick={() => toggleExamWithJury(populatedCourse.id)}
>
Создать
</Button>
</Tooltip>
</Box>
</>
)}
{Boolean(exam) && (
<>
<Heading as="h3" mt={4} mb={3} size="lg">
Количество членов жюри:
</Heading>
<Heading as="h3" mt={4} mb={3} size="lg">
{populatedCourse.examWithJury.jury.length}
</Heading></>
)}
<Heading as="h3" mt={4} mb={3} size="lg">
Список занятий:
</Heading>
<Stack>
{populatedCourse?.lessons?.map((lesson) => (
<Link
as={ConnectedLink}
key={lesson.id}
to={
isTeacher(user)
? `${getNavigationsValue('journal.main')}/lesson/${populatedCourse.id}/${lesson.id}`
: ''
}
>
{lesson.name}
</Link>
))}
</Stack>
<Heading as="h3" mt={4} mb={3} size="lg">
Не задан
</Heading>
<Box mt={10}>
<Tooltip label="Создать экзамен с жюри" fontSize="12px" top="16px">
<Button
colorScheme="blue"
mt={['16px', 0]}
variant="outline"
isLoading={examWithJuryRequest.isLoading}
onClick={() => toggleExamWithJury(populatedCourse.id)}
>
Создать
</Button>
</Tooltip>
</Box>
</>
)
}
)}
{Boolean(exam) && (
<>
<Heading as="h3" mt={4} mb={3} size="lg">
Количество членов жюри:
</Heading>
<Heading as="h3" mt={4} mb={3} size="lg">
{populatedCourse.examWithJury.jury.length}
</Heading>
</>
)}
<Heading as="h3" mt={4} mb={3} size="lg">
Список занятий:
</Heading>
<Stack>
{populatedCourse?.lessons?.map((lesson) => (
<Link
as={ConnectedLink}
key={lesson.id}
to={
isTeacher(user)
? `${getNavigationsValue('journal.main')}/lesson/${populatedCourse.id}/${lesson.id}`
: ''
}
>
{lesson.name}
</Link>
))}
</Stack>
</>
)
}

View File

@@ -190,7 +190,7 @@ export const CoursesList = () => {
<VStack as="ul" align="stretch">
{data?.body?.map((c) => (
<CourseCard
key={c._id}
key={c.id}
course={c}
/>
))}

View File

@@ -4,3 +4,4 @@ export const CourseListPage = lazy(() => import(/* webpackChunkName: "course-lis
export const LessonDetailsPage = lazy(() => import(/* webpackChunkName: "lesson-details" */ './lesson-details'));
export const LessonListPage = lazy(() => import(/* webpackChunkName: "lesson-list" */ './lesson-list'));
export const UserPage = lazy(() => import(/* webpackChunkName: "user-page" */ './user-page'));
export const AttendancePage = lazy(() => import(/* webpackChunkName: "attendance-page" */ './attendance'));

View File

@@ -24,6 +24,8 @@ import {
StudentList,
BreadcrumbsWrapper,
} from './style'
import { useAppSelector } from '../__data__/store'
import { isTeacher } from '../utils/user'
export function getGravatarURL(email, user) {
if (!email) return void 0
@@ -37,6 +39,8 @@ export function getGravatarURL(email, user) {
const LessonDetail = () => {
const { lessonId, courseId } = useParams()
const canvRef = useRef(null)
const user = useAppSelector((s) => s.user)
const {
isFetching,
data: accessCode,
@@ -45,6 +49,7 @@ const LessonDetail = () => {
} = api.useCreateAccessCodeQuery(
{ lessonId },
{
skip: !isTeacher(user),
pollingInterval:
Number(getConfigValue('journal.polling-interval')) || 3000,
skipPollingIfUnfocused: true,
@@ -144,7 +149,7 @@ const LessonDetail = () => {
<QRCanvas ref={canvRef} />
</a>
<StudentList>
{studentsArr.map((student) => (
{isTeacher(user) && studentsArr.map((student) => (
<UserCard
wrapperAS="li"
key={student.sub}

View File

@@ -0,0 +1,144 @@
import React, { useEffect, useRef, useState } from 'react'
import dayjs from 'dayjs'
import { Link } from 'react-router-dom'
import { getNavigationsValue, getFeatures } from '@brojs/cli'
import {
Button,
Tr,
Td,
Menu,
MenuButton,
MenuItem,
MenuList,
useToast,
} from '@chakra-ui/react'
import { EditIcon } from '@chakra-ui/icons'
import { qrCode } from '../../../assets'
import { LessonForm } from './lessons-form'
import { api } from '../../../__data__/api/api'
const features = getFeatures('journal')
const groupByDate = features?.['group.by.date']
type ItemProps = {
id: string
date: string
name: string
isTeacher: boolean
courseId: string
setlessonToDelete(): void
students: unknown[]
}
export const Item: React.FC<ItemProps> = ({
id,
date,
name,
isTeacher,
courseId,
setlessonToDelete,
students,
}) => {
const [edit, setEdit] = useState(false)
const toastRef = useRef(null)
const toast = useToast()
const [updateLesson, updateLessonRqst] = api.useUpdateLessonMutation()
const createdLessonRef = useRef(null)
const onSubmit = (lessonData) => {
toastRef.current = toast({
title: 'Отправляем',
status: 'loading',
duration: 9000,
})
createdLessonRef.current = lessonData
if (navigator.onLine) {
updateLesson(lessonData)
} else {
toast.update(toastRef.current, {
title: 'Отсутствует интернет',
status: 'error',
duration: 3000
})
}
}
useEffect(() => {
if (updateLessonRqst.isSuccess) {
const toastProps = {
title: 'Лекция Обновлена',
description: `Лекция ${createdLessonRef.current?.name} успешно обновлена`,
status: 'success' as const,
duration: 9000,
isClosable: true,
}
if (toastRef.current) toast.update(toastRef.current, toastProps)
else toast(toastProps)
setEdit(false)
}
}, [updateLessonRqst.isSuccess])
if (edit && isTeacher) {
return (
<Tr>
<Td colSpan={5}>
<LessonForm
isLoading={updateLessonRqst.isLoading}
error={(updateLessonRqst.error as any)?.error}
onSubmit={onSubmit}
onCancel={() => {
setEdit(false)
}}
lesson={{ _id: id, id, name, date }}
title={'Редактирование лекции'}
nameButton={'Сохранить'}
/>
</Td>
</Tr>
)
}
return (
<Tr>
{isTeacher && (
<Td>
<Link
to={`${getNavigationsValue('journal.main')}/lesson/${courseId}/${id}`}
style={{ display: 'flex' }}
>
<img width={24} src={qrCode} style={{ margin: '0 auto' }} />
</Link>
</Td>
)}
<Td textAlign="center">
{dayjs(date).format(groupByDate ? 'HH:mm' : 'HH:mm DD.MM.YY')}
</Td>
<Td>{name}</Td>
{isTeacher && (
<Td>
{!edit && (
<Menu>
<MenuButton as={Button}>
<EditIcon />
</MenuButton>
<MenuList>
<MenuItem
onClick={() => {
setEdit(true)
}}
>
Edit
</MenuItem>
<MenuItem onClick={setlessonToDelete}>Delete</MenuItem>
</MenuList>
</Menu>
)}
{edit && <Button onClick={setlessonToDelete}>Сохранить</Button>}
</Td>
)}
<Td isNumeric>{students.length}</Td>
</Tr>
)
}

View File

@@ -0,0 +1,45 @@
import React from 'react'
import dayjs from 'dayjs'
import {
Tr,
Td,
} from '@chakra-ui/react'
import { Lesson } from '../../../__data__/model'
import { Item } from './item'
type LessonItemProps = {
date: string
lessons: Lesson[]
isTeacher: boolean
courseId: string
setlessonToDelete(lesson: Lesson): void
}
export const LessonItems: React.FC<LessonItemProps> = ({
date,
lessons,
isTeacher,
courseId,
setlessonToDelete,
}) => (
<>
{date && (
<Tr>
<Td colSpan={isTeacher ? 5 : 3}>
{dayjs(date).format('DD MMMM YYYY')}
</Td>
</Tr>
)}
{lessons.map((lesson) => (
<Item
key={lesson.id}
{...lesson}
setlessonToDelete={() => setlessonToDelete(lesson)}
courseId={courseId}
isTeacher={isTeacher}
/>
))}
</>
)

View File

@@ -1,19 +1,19 @@
import React from 'react'
import { useForm, Controller } from 'react-hook-form'
import {
Box,
Card,
CardBody,
CardHeader,
Heading,
Button,
CloseButton,
VStack,
FormControl,
FormLabel,
FormHelperText,
FormErrorMessage,
Input,
Box,
Card,
CardBody,
CardHeader,
Heading,
Button,
CloseButton,
VStack,
FormControl,
FormLabel,
FormHelperText,
FormErrorMessage,
Input,
} from '@chakra-ui/react'
import { AddIcon } from '@chakra-ui/icons'
@@ -22,116 +22,119 @@ import { Lesson } from '../../../__data__/model'
import { ErrorSpan } from '../style'
interface NewLessonForm {
name: string;
date: string;
name: string
date: string
}
interface LessonFormProps {
lesson?: Partial<Lesson>
isLoading: boolean
onCancel: () => void
onSubmit: (lesson: Lesson) => void
error?: string
title: string
nameButton: string
lesson?: Partial<Lesson>
isLoading: boolean
onCancel: () => void
onSubmit: (lesson: Lesson) => void
error?: string
title: string
nameButton: string
}
export const LessonForm = ({
lesson,
isLoading,
onCancel,
onSubmit,
error,
title,
nameButton,
lesson,
isLoading,
onCancel,
onSubmit,
error,
title,
nameButton,
}: LessonFormProps) => {
const {
control,
handleSubmit,
reset,
formState: { errors },
} = useForm<NewLessonForm>({
defaultValues: (lesson && { ...lesson, date: dateToCalendarFormat(lesson.date) }) || {
name: '',
date: dateToCalendarFormat(),
},
})
return (
<Card align="left">
<CardHeader display="flex">
const {
control,
handleSubmit,
reset,
formState: { errors },
} = useForm<NewLessonForm>({
defaultValues: (lesson && {
...lesson,
date: dateToCalendarFormat(lesson.date),
}) || {
name: '',
date: dateToCalendarFormat(),
},
})
return (
<Card align="left">
<CardHeader display="flex">
<Heading as="h2" mt="0">
{title}
{title}
</Heading>
<CloseButton
ml="auto"
onClick={() => {
ml="auto"
onClick={() => {
reset()
onCancel()
}}
}}
/>
</CardHeader>
<CardBody>
</CardHeader>
<CardBody>
<form onSubmit={handleSubmit(onSubmit)}>
<VStack spacing="10" align="left">
<Controller
control={control}
name="date"
rules={{ required: 'Обязательное поле' }}
render={({ field }) => (
<FormControl>
<FormLabel>Дата</FormLabel>
<Input
{...field}
required={false}
placeholder="Укажите дату лекции"
size="md"
type="datetime-local"
<VStack spacing="10" align="left">
<Controller
control={control}
name="date"
rules={{ required: 'Обязательное поле' }}
render={({ field }) => (
<FormControl>
<FormLabel>Дата</FormLabel>
<Input
{...field}
required={false}
placeholder="Укажите дату лекции"
size="md"
type="datetime-local"
/>
{errors.date ? (
<FormErrorMessage>{errors.date?.message}</FormErrorMessage>
) : (
<FormHelperText>Укажите дату и время лекции</FormHelperText>
)}
</FormControl>
)}
/>
{errors.date ? (
<FormErrorMessage>{errors.date?.message}</FormErrorMessage>
) : (
<FormHelperText>Укажите дату и время лекции</FormHelperText>
)}
</FormControl>
)}
/>
<Controller
control={control}
name="name"
rules={{ required: 'Обязательное поле' }}
render={({ field }) => (
<FormControl isRequired isInvalid={Boolean(errors.name)}>
<FormLabel>Название новой лекции:</FormLabel>
<Input
{...field}
required={false}
placeholder="Название лекции"
size="md"
<Controller
control={control}
name="name"
rules={{ required: 'Обязательное поле' }}
render={({ field }) => (
<FormControl isRequired isInvalid={Boolean(errors.name)}>
<FormLabel>Название новой лекции:</FormLabel>
<Input
{...field}
required={false}
placeholder="Название лекции"
size="md"
/>
{errors.name && (
<FormErrorMessage>{errors.name.message}</FormErrorMessage>
)}
</FormControl>
)}
/>
{errors.name && (
<FormErrorMessage>{errors.name.message}</FormErrorMessage>
)}
</FormControl>
)}
/>
<Box mt="10">
<Button
size="lg"
type="submit"
leftIcon={<AddIcon />}
colorScheme="blue"
isLoading={isLoading}
>
{nameButton}
</Button>
</Box>
</VStack>
{error && <ErrorSpan>{error}</ErrorSpan>}
<Box mt="10">
<Button
size="lg"
type="submit"
leftIcon={<AddIcon />}
colorScheme="blue"
isLoading={isLoading}
>
{nameButton}
</Button>
</Box>
</VStack>
{error && <ErrorSpan>{error}</ErrorSpan>}
</form>
</CardBody>
</Card>
)
</CardBody>
</Card>
)
}

View File

@@ -1,11 +1,6 @@
import React, {
useEffect,
useMemo,
useRef,
useState,
} from 'react'
import React, { useEffect, useMemo, useRef, useState } from 'react'
import dayjs from 'dayjs'
import { Link, useParams } from 'react-router-dom'
import { generatePath, Link, useParams } from 'react-router-dom'
import { getNavigationsValue, getFeatures } from '@brojs/cli'
import {
Breadcrumb,
@@ -22,12 +17,7 @@ import {
Tr,
Th,
Tbody,
Td,
Menu,
MenuButton,
MenuItem,
Text,
MenuList,
AlertDialog,
AlertDialogBody,
AlertDialogContent,
@@ -35,18 +25,18 @@ import {
AlertDialogHeader,
AlertDialogOverlay,
} from '@chakra-ui/react'
import { AddIcon, EditIcon } from '@chakra-ui/icons'
import { AddIcon } from '@chakra-ui/icons'
import { useAppSelector } from '../../__data__/store'
import { api } from '../../__data__/api/api'
import { isTeacher } from '../../utils/user'
import { qrCode } from '../../assets'
import { Lesson } from '../../__data__/model'
import { XlSpinner } from '../../components/xl-spinner'
import { LessonForm } from './components/lessons-form'
import { BreadcrumbsWrapper } from './style'
import { Bar } from './components/bar'
import { LessonItems } from './components/lesson-items'
import { BreadcrumbsWrapper } from './style'
const features = getFeatures('journal')
@@ -67,7 +57,10 @@ const LessonList = () => {
const toastRef = useRef(null)
const createdLessonRef = useRef(null)
const [editLesson, setEditLesson] = useState<Lesson>(null)
const sorted = useMemo(() => [...(data?.body || [])]?.sort((a, b) => a.date > b.date ? 1 : -1), [data, data?.body])
const sorted = useMemo(
() => [...(data?.body || [])]?.sort((a, b) => (a.date > b.date ? 1 : -1)),
[data, data?.body],
)
const lessonCalc = useMemo(() => {
if (!isSuccess) {
@@ -95,7 +88,7 @@ const LessonList = () => {
}
}
return lessonsData.sort((a, b) => a.date < b.date? 1 : -1)
return lessonsData.sort((a, b) => (a.date < b.date ? 1 : -1))
}, [groupByDate, isSuccess, sorted])
const onSubmit = (lessonData) => {
@@ -153,8 +146,8 @@ const LessonList = () => {
if (crLQuery.isSuccess) {
const toastProps = {
title: 'Лекция создана',
description: `Лекция ${createdLessonRef.current.name} успешно создана`,
status: 'success' as 'success',
description: `Лекция ${createdLessonRef.current?.name} успешно создана`,
status: 'success' as const,
duration: 9000,
isClosable: true,
}
@@ -168,8 +161,8 @@ const LessonList = () => {
if (updateLessonRqst.isSuccess) {
const toastProps = {
title: 'Лекция Обновлена',
description: `Лекция ${createdLessonRef.current.name} успешно обновлена`,
status: 'success' as 'success',
description: `Лекция ${createdLessonRef.current?.name} успешно обновлена`,
status: 'success' as const,
duration: 9000,
isClosable: true,
}
@@ -180,7 +173,7 @@ const LessonList = () => {
}, [updateLessonRqst.isSuccess])
if (isLoading) {
return <XlSpinner />;
return <XlSpinner />
}
return (
@@ -213,7 +206,7 @@ const LessonList = () => {
colorScheme="red"
loadingText=""
isLoading={deletingRqst.isLoading}
onClick={() => deleteLesson(lessonToDelete._id)}
onClick={() => deleteLesson(lessonToDelete.id)}
ml={3}
>
Delete
@@ -240,7 +233,7 @@ const LessonList = () => {
<Box mt="15" mb="15">
{showForm ? (
<LessonForm
key={editLesson?._id}
key={editLesson?.id}
isLoading={crLQuery.isLoading}
onSubmit={onSubmit}
onCancel={() => {
@@ -253,19 +246,17 @@ const LessonList = () => {
nameButton={editLesson ? 'Редактировать' : 'Создать'}
/>
) : (
<Box p="2" m="2">
<Button
leftIcon={<AddIcon />}
colorScheme="green"
onClick={() => setShowForm(true)}
>
Добавить
</Button>
</Box>
<Button
leftIcon={<AddIcon />}
colorScheme="green"
onClick={() => setShowForm(true)}
>
Добавить
</Button>
)}
</Box>
)}
{barFeature && sorted?.length && (
{barFeature && sorted?.length > 1 && (
<Box height="300">
<Bar
data={sorted.map((lesson, index) => ({
@@ -285,65 +276,23 @@ const LessonList = () => {
</Th>
)}
<Th textAlign="center" width={1}>
Дата
{groupByDate ? 'Время' : 'Дата'}
</Th>
<Th>Название</Th>
<Th width="100%">Название</Th>
{isTeacher(user) && <Th>action</Th>}
<Th isNumeric>Отмечено</Th>
</Tr>
</Thead>
<Tbody>
{lessonCalc?.map(({ data: lessons, date }) => (
<React.Fragment key={date}>
{date && <Tr><Td colSpan={isTeacher(user) ? 5 : 3}>{dayjs(date).format('DD MMMM YYYY')}</Td></Tr>}
{lessons.map((lesson) => (
<Tr key={lesson._id}>
{isTeacher(user) && (
<Td>
<Link
to={`${getNavigationsValue('journal.main')}/lesson/${courseId}/${lesson._id}`}
style={{ display: 'flex' }}
>
<img
width={24}
src={qrCode}
style={{ margin: '0 auto' }}
/>
</Link>
</Td>
)}
<Td textAlign="center">
{dayjs(lesson.date).format(groupByDate ? 'HH:mm' : 'HH:mm DD.MM.YY')}
</Td>
<Td>{lesson.name}</Td>
{isTeacher(user) && (
<Td>
<Menu>
<MenuButton as={Button}>
<EditIcon />
</MenuButton>
<MenuList>
<MenuItem
onClick={() => {
setShowForm(true)
setEditLesson(lesson)
}}
>
Edit
</MenuItem>
<MenuItem
onClick={() => setlessonToDelete(lesson)}
>
Delete
</MenuItem>
</MenuList>
</Menu>
</Td>
)}
<Td isNumeric>{lesson.students.length}</Td>
</Tr>
))}
</React.Fragment>
<LessonItems
courseId={courseId}
date={date}
isTeacher={isTeacher(user)}
lessons={lessons}
setlessonToDelete={setlessonToDelete}
key={date}
/>
))}
</Tbody>
</Table>

View File

@@ -9,11 +9,22 @@ const timer =
router.use(timer())
const config = {
examCreated: false
}
router.get('/course/list', (req, res) => {
res.send(require('../mocks/courses/list/success.json'))
})
router.get('/course/:id', (_req, res) => {
router.get('/course/:id', (req, res) => {
if(req.params.id === 'undefined')
return res.status(400).send({ success: false, error: 'Invalid course id' })
if (config.examCreated) {
config.examCreated = false
return res.send(require('../mocks/courses/by-id/with-exam.json'))
}
res.send(require('../mocks/courses/by-id/success.json'))
})
@@ -26,6 +37,7 @@ router.post('/course', (req, res) => {
})
router.post('/course/toggle-exam-with-jury/:id', (req, res) => {
config.examCreated = true;
res.send({ success: true })
})

View File

@@ -0,0 +1,94 @@
{
"success": true,
"body": {
"_id": "660b19fc865d7a5d914636c0",
"name": "Курс по JS",
"teachers": [],
"lessons": [
{
"_id": "661e7f4f69f40b0ebebcd5e4",
"name": "555",
"students": [
{
"sub": "f62905b1-e223-40ca-910f-c8d84c6137c1",
"email_verified": true,
"name": "Александр Примаков",
"preferred_username": "primakov",
"given_name": "Александр",
"family_name": "Примаков",
"email": "primakovpro@gmail.com"
}
],
"date": "2024-04-16T13:38:00.000Z",
"created": "2024-04-16T13:38:23.381Z",
"id": "661e7f4f69f40b0ebebcd5e4"
},
{
"_id": "66af1e60a0eef5a89f99aa94",
"name": "111",
"students": [
{
"sub": "f62905b1-e223-40ca-910f-c8d84c6137c1",
"email_verified": true,
"name": "Александр Примаков",
"preferred_username": "primakov",
"given_name": "Александр",
"family_name": "Примаков",
"email": "primakovpro@gmail.com"
}
],
"date": "2024-08-04T07:00:00.000Z",
"created": "2024-08-04T06:23:28.491Z",
"id": "66af1e60a0eef5a89f99aa94"
},
{
"_id": "66ba1a01a0eef5a89f99ab27",
"name": "11111",
"students": [
{
"sub": "f62905b1-e223-40ca-910f-c8d84c6137c1",
"email_verified": true,
"name": "Александр Примаков",
"preferred_username": "primakov",
"given_name": "Александр",
"family_name": "Примаков",
"email": "primakovpro@gmail.com"
}
],
"date": "2024-08-18T10:00:00.000Z",
"created": "2024-08-12T14:19:46.004Z",
"id": "66ba1a01a0eef5a89f99ab27"
},
{
"_id": "66ba1a0da0eef5a89f99ab2d",
"name": "2222",
"students": [],
"date": "2024-08-18T14:19:00.000Z",
"created": "2024-08-12T14:19:57.798Z",
"id": "66ba1a0da0eef5a89f99ab2d"
}
],
"startDt": "2024-06-01T00:00:00.000Z",
"creator": {
"sub": "f62905b1-e223-40ca-910f-c8d84c6137c1",
"email_verified": true,
"name": "Александр Примаков",
"preferred_username": "primakov",
"given_name": "Александр",
"family_name": "Примаков",
"email": "primakovpro@gmail.com"
},
"created": "2024-04-01T20:33:00.912Z",
"examWithJury": {
"_id": "66d01766ce794e1fdb2bf097",
"name": "Хакатон",
"description": "Сегодня командам предстоит Защитить свои проекты а жюри оценить по критериям",
"jury": [],
"criterias": [],
"date": "2024-08-29T06:38:30.678Z",
"created": "2024-08-29T06:38:30.678Z",
"id": "66d01766ce794e1fdb2bf097"
},
"id": "660b19fc865d7a5d914636c0"
}
}

View File

@@ -22,11 +22,10 @@
},
"startDt": "2024-03-02T15:37:05.907Z",
"examWithJury": "66cf3d3f4637d420d6271451",
"created": "2024-03-02T15:37:05.908Z",
"__v": 2
"created": "2024-03-02T15:37:05.908Z"
},
{
"_id": "65e73c21ced789d2f679128z",
"id": "65e73c21ced789d2f679128z",
"name": "KFU-24-2",
"teachers": [],
"lessons": [

View File

@@ -4,6 +4,13 @@
{
"_id": "65e2e5fbec37fec650f28489",
"name": "ВВЕДЕНИЕ В ВЕБ-РАЗРАБОТКУ. ИНСТРУМЕНТАРИЙ, ОБЗОР ВЕБ-ТЕХНОЛОГИЙ",
"teachers": [
{
"sub": "f62905b1-e223-40ca-910f-c8d84c6137c1",
"email_verified": true,
"preferred_username": "primakov"
}
],
"students": [
{
"sub": "fcde3f22-d9ba-412a-a572-c59e515a290f",

View File

@@ -1,25 +1,26 @@
{
"compilerOptions": {
"lib": [
"dom",
"es2017"
],
"lib": ["dom", "es2017"],
"outDir": "./dist/",
"sourceMap": true,
"esModuleInterop": true,
"noImplicitAny": false,
"module": "esnext",
"moduleResolution": "node",
"target": "es6",
"jsx": "react",
"typeRoots": ["node_modules/@types", "src/typings"],
"types" : ["webpack-env", "node"],
"resolveJsonModule": true
"typeRoots": ["node_modules/@types", "./@types"],
"types": ["webpack-env", "node"],
"resolveJsonModule": true,
"moduleResolution": "Bundler",
"skipLibCheck": true,
},
"types": [
"@types/*"
],
"exclude": [
"node_modules",
"**/*.test.ts",
"**/*.test.tsx",
"node_modules/@types/jest"
]
}
]
}