Compare commits
46 Commits
feature/ed
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
250feff2f4 | ||
|
efc359ce7e | ||
|
5911cdf8a8 | ||
|
a8195cd627 | ||
|
52b60ed1f5 | ||
|
bdf6c5e8a1 | ||
|
87c08e18bd | ||
|
2d98b55bbc | ||
|
ced1f85a7f | ||
|
e21b41f9ca | ||
|
cb3629bd43 | ||
|
65216843ac | ||
|
a76fce5506 | ||
|
c842befc8f | ||
|
fb267a11f9 | ||
|
a94acbf7d3 | ||
1cd1e26751 | |||
|
d7b521c2ec | ||
|
a669e2af81 | ||
|
f093c0f3ad | ||
61cfd689f8 | |||
82a54022b2 | |||
f28c644da5 | |||
50bf5b31b6 | |||
5670a96696 | |||
3a13b68a3d | |||
fc3366d52a | |||
99c95d0706 | |||
0bdae7fc23 | |||
814e089a67 | |||
8f08b5ca52 | |||
20aca51375 | |||
ff58ae2fe1 | |||
cf843f887d | |||
91ea7fddaf | |||
d084870c49 | |||
4d498662f8 | |||
1320a50af0 | |||
4504961fa0 | |||
3e54f0099b | |||
58342561ee | |||
927bf3929d | |||
177f1b3f5b | |||
3d7e7a1783 | |||
2087666991 | |||
1c08a70525 |
80
Jenkinsfile
vendored
80
Jenkinsfile
vendored
@ -1,37 +1,57 @@
|
|||||||
pipeline {
|
pipeline {
|
||||||
agent {
|
agent {
|
||||||
docker {
|
docker {
|
||||||
image 'node:18'
|
image 'node:20'
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
stages {
|
|
||||||
stage('install') {
|
|
||||||
steps {
|
|
||||||
sh 'node -v'
|
|
||||||
sh 'npm -v'
|
|
||||||
sh 'npm ci'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('eslint') {
|
stages {
|
||||||
steps {
|
stage('install') {
|
||||||
sh 'npm run eslint'
|
steps {
|
||||||
}
|
sh 'node -v'
|
||||||
}
|
sh 'npm -v'
|
||||||
|
script {
|
||||||
|
String tag = sh(returnStdout: true, script: 'git tag --contains').trim()
|
||||||
|
String branchName = sh(returnStdout: true, script: 'git rev-parse --abbrev-ref HEAD').trim()
|
||||||
|
String commit = sh(returnStdout: true, script: 'git log -1 --oneline').trim()
|
||||||
|
String commitMsg = commit.substring(commit.indexOf(' ')).trim()
|
||||||
|
|
||||||
stage('build') {
|
if (tag) {
|
||||||
steps {
|
currentBuild.displayName = "#${BUILD_NUMBER}, tag ${tag}"
|
||||||
sh 'npm run build'
|
} else {
|
||||||
}
|
currentBuild.displayName = "#${BUILD_NUMBER}, branch ${branchName}"
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('clean-all') {
|
String author = sh(returnStdout: true, script: "git log -1 --pretty=format:'%an'").trim()
|
||||||
steps {
|
currentBuild.description = "${author}<br />${commitMsg}"
|
||||||
sh 'rm -rf .[!.]*'
|
echo 'starting installing'
|
||||||
sh 'rm -rf ./*'
|
sh 'npm ci'
|
||||||
sh 'ls -a'
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('checks') {
|
||||||
|
parallel {
|
||||||
|
stage('eslint') {
|
||||||
|
steps {
|
||||||
|
sh 'npm run eslint'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('build') {
|
||||||
|
steps {
|
||||||
|
sh 'npm run build'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('clean-all') {
|
||||||
|
steps {
|
||||||
|
sh 'rm -rf .[!.]*'
|
||||||
|
sh 'rm -rf ./*'
|
||||||
|
sh 'ls -a'
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ npm install
|
|||||||
пропишите в hosts строку
|
пропишите в hosts строку
|
||||||
|
|
||||||
```
|
```
|
||||||
127.0.0.1 ift-b1.kc.inno-js.test
|
127.0.0.1 journal.test
|
||||||
```
|
```
|
||||||
|
|
||||||
## Запуск
|
## Запуск
|
||||||
@ -28,4 +28,4 @@ npm install
|
|||||||
npm start
|
npm start
|
||||||
```
|
```
|
||||||
|
|
||||||
откройте в браузере [проект](http://ift-b1.kc.inno-js.test)
|
откройте в браузере [проект](http://journal.test)
|
@ -1,22 +1,33 @@
|
|||||||
const pkg = require('./package')
|
const pkg = require('./package')
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
apiPath: 'stubs/api',
|
apiPath: 'stubs/api',
|
||||||
webpackConfig: {
|
webpackConfig: {
|
||||||
output: {
|
output: {
|
||||||
publicPath: `/static/${pkg.name}/${process.env.VERSION || pkg.version}/`
|
publicPath: `/static/${pkg.name}/${process.env.VERSION || pkg.version}/`,
|
||||||
}
|
|
||||||
},
|
},
|
||||||
navigations: {
|
},
|
||||||
'journal.main': '/journal.pl'
|
navigations: {
|
||||||
|
'journal.main': '/journal.pl',
|
||||||
|
'exam.main': '/exam',
|
||||||
|
'link.exam.details': '/details/:courseId/:examId'
|
||||||
|
},
|
||||||
|
features: {
|
||||||
|
journal: {
|
||||||
|
'lesson.bar': {
|
||||||
|
on: true,
|
||||||
|
value: '',
|
||||||
|
key: 'lesson.bar',
|
||||||
|
},
|
||||||
|
'group.by.date': {
|
||||||
|
on: true,
|
||||||
|
value: '',
|
||||||
|
key: 'group.by.date',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
features: {
|
},
|
||||||
'journal': {
|
config: {
|
||||||
// add your features here in the format [featureName]: { value: string }
|
'journal.back.url': '/api',
|
||||||
},
|
'journal.polling-interval': '10000',
|
||||||
},
|
},
|
||||||
config: {
|
|
||||||
"journal.back.url": "/api",
|
|
||||||
"journal.polling-interval": "10000"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
2
index.d.ts
vendored
2
index.d.ts
vendored
@ -2,3 +2,5 @@ declare module '*.svg' {
|
|||||||
const src: string;
|
const src: string;
|
||||||
export default src;
|
export default src;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
declare const __webpack_public_path__: string;
|
12
openapi-config.ts
Normal file
12
openapi-config.ts
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
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
|
9748
package-lock.json
generated
9748
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
26
package.json
26
package.json
@ -1,51 +1,55 @@
|
|||||||
{
|
{
|
||||||
"name": "journal.pl",
|
"name": "journal.pl",
|
||||||
"version": "2.0.0",
|
"version": "3.2.0",
|
||||||
"description": "inno-js platform journal ui repo",
|
"description": "bro-js platform journal ui repo",
|
||||||
"main": "./src/index.tsx",
|
"main": "./src/index.tsx",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "start chrome http://ift-b1.kc.inno-js.test/journal.pl && ijl-cli server --port=80",
|
"start": "brojs server --port=8099 --with-open-browser",
|
||||||
"build": "npm run clean && ijl-cli build --dev",
|
"build": "npm run clean && brojs build --dev",
|
||||||
"build:prod": "npm run clean && ijl-cli build",
|
"build:prod": "npm run clean && brojs build",
|
||||||
"clean": "rimraf dist",
|
"clean": "rimraf dist",
|
||||||
"test": "echo ok",
|
"test": "echo ok",
|
||||||
"eslint": "npx eslint ."
|
"eslint": "npx eslint ."
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "ssh://git@85.143.175.152:10022/omni-tech/journal.pl.git"
|
"url": "ssh://git@85.143.175.152:222/bro-js/journal.pl.git"
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"author": "",
|
"author": "",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@ijl/cli": "^5.0.3",
|
"@rtk-query/codegen-openapi": "^1.2.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^7.4.0",
|
"@typescript-eslint/eslint-plugin": "^7.4.0",
|
||||||
"@typescript-eslint/parser": "^7.4.0",
|
"@typescript-eslint/parser": "^7.4.0",
|
||||||
"eslint": "^8.57.0",
|
"eslint": "^8.57.0",
|
||||||
"eslint-plugin-react": "^7.34.1"
|
"eslint-plugin-react": "^7.34.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@brojs/cli": "^0.0.4-beta.0",
|
||||||
"@chakra-ui/icons": "^2.1.1",
|
"@chakra-ui/icons": "^2.1.1",
|
||||||
"@chakra-ui/react": "^2.8.2",
|
"@chakra-ui/react": "^2.8.2",
|
||||||
"@emotion/react": "^11.11.4",
|
"@emotion/react": "^11.11.4",
|
||||||
"@emotion/styled": "^11.11.0",
|
"@emotion/styled": "^11.11.0",
|
||||||
|
"@nivo/bar": "^0.85.1",
|
||||||
"@reduxjs/toolkit": "^2.2.1",
|
"@reduxjs/toolkit": "^2.2.1",
|
||||||
"@types/react": "^18.2.60",
|
"@types/react": "^18.2.60",
|
||||||
"@types/react-dom": "^18.2.19",
|
"@types/react-dom": "^18.2.19",
|
||||||
"dayjs": "^1.11.10",
|
"dayjs": "^1.11.10",
|
||||||
"express": "^4.18.2",
|
"express": "^4.19.2",
|
||||||
"js-sha256": "^0.11.0",
|
"js-sha256": "^0.11.0",
|
||||||
"keycloak-js": "^23.0.7",
|
"keycloak-js": "^23.0.7",
|
||||||
"prettier": "^3.2.5",
|
"prettier": "^3.2.5",
|
||||||
"qrcode": "^1.5.3",
|
"qrcode": "^1.5.3",
|
||||||
"react": "^18.2.0",
|
"react": "^18.3.1",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.3.1",
|
||||||
"react-helmet": "^6.1.0",
|
"react-helmet": "^6.1.0",
|
||||||
"react-hook-form": "^7.51.2",
|
"react-hook-form": "^7.51.2",
|
||||||
"react-redux": "^9.1.0",
|
"react-redux": "^9.1.0",
|
||||||
"react-router-dom": "^6.22.1",
|
"react-router-dom": "^6.22.1",
|
||||||
"redux": "^5.0.1",
|
"redux": "^5.0.1",
|
||||||
"typescript": "^5.3.3"
|
"ts-node": "^10.9.2",
|
||||||
|
"typescript": "^5.3.3",
|
||||||
|
"webpack-hot-middleware": "^2.26.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react'
|
import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react'
|
||||||
import { getConfigValue } from '@ijl/cli'
|
import { getConfigValue } from '@brojs/cli'
|
||||||
|
|
||||||
import { keycloak } from '../kc'
|
import { keycloak } from '../kc'
|
||||||
import {
|
import {
|
||||||
@ -7,6 +7,7 @@ import {
|
|||||||
BaseResponse,
|
BaseResponse,
|
||||||
Course,
|
Course,
|
||||||
Lesson,
|
Lesson,
|
||||||
|
PopulatedCourse,
|
||||||
User,
|
User,
|
||||||
UserData,
|
UserData,
|
||||||
} from '../model'
|
} from '../model'
|
||||||
@ -32,7 +33,7 @@ export const api = createApi({
|
|||||||
headers.set('Authorization', `Bearer ${keycloak.token}`)
|
headers.set('Authorization', `Bearer ${keycloak.token}`)
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
tagTypes: ['LessonList', 'CourseList'],
|
tagTypes: ['LessonList', 'CourseList', 'Course'],
|
||||||
endpoints: (builder) => ({
|
endpoints: (builder) => ({
|
||||||
coursesList: builder.query<BaseResponse<Course[]>, void>({
|
coursesList: builder.query<BaseResponse<Course[]>, void>({
|
||||||
query: () => '/course/list',
|
query: () => '/course/list',
|
||||||
@ -78,10 +79,10 @@ export const api = createApi({
|
|||||||
}),
|
}),
|
||||||
invalidatesTags: ['LessonList'],
|
invalidatesTags: ['LessonList'],
|
||||||
}),
|
}),
|
||||||
updateLesson: builder.mutation<BaseResponse<Lesson>, Partial<Lesson> & Pick<Lesson, '_id'>>({
|
updateLesson: builder.mutation<BaseResponse<Lesson>, Partial<Lesson> & Pick<Lesson, 'id'>>({
|
||||||
query: (data) => ({
|
query: (data) => ({
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
url: `/lesson/${data._id}`,
|
url: '/lesson',
|
||||||
body: data,
|
body: data,
|
||||||
}),
|
}),
|
||||||
invalidatesTags: ['LessonList'],
|
invalidatesTags: ['LessonList'],
|
||||||
@ -116,5 +117,18 @@ export const api = createApi({
|
|||||||
method: 'GET',
|
method: 'GET',
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
|
getCourseById: builder.query<PopulatedCourse, string>({
|
||||||
|
query: (courseId) => `/course/${courseId}`,
|
||||||
|
transformResponse: (response: BaseResponse<PopulatedCourse>) => response.body,
|
||||||
|
providesTags: ['Course'],
|
||||||
|
}),
|
||||||
|
toggleExamWithJury: builder.mutation<void, string>({
|
||||||
|
query: (courseId) => ({
|
||||||
|
url: `/course/toggle-exam-with-jury/${courseId}`,
|
||||||
|
method: 'POST',
|
||||||
|
body: {},
|
||||||
|
}),
|
||||||
|
invalidatesTags: ['Course']
|
||||||
|
})
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import Keycloak from 'keycloak-js';
|
import Keycloak from 'keycloak-js';
|
||||||
|
|
||||||
export const keycloak = new Keycloak({
|
export const keycloak = new Keycloak({
|
||||||
url: 'https://kc.inno-js.ru',
|
url: 'https://kc.bro-js.ru',
|
||||||
realm: 'inno-js',
|
realm: 'bro-js',
|
||||||
clientId: 'journal'
|
clientId: 'journal'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ export type BaseResponse<Data> = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export interface Lesson {
|
export interface Lesson {
|
||||||
_id: string;
|
id: string;
|
||||||
name: string;
|
name: string;
|
||||||
students: User[];
|
students: User[];
|
||||||
date: string;
|
date: string;
|
||||||
@ -74,14 +74,51 @@ export interface User {
|
|||||||
given_name: string;
|
given_name: string;
|
||||||
family_name: string;
|
family_name: string;
|
||||||
email: string;
|
email: string;
|
||||||
|
picture?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Course {
|
export interface Course {
|
||||||
_id: string;
|
_id: string;
|
||||||
|
id: string;
|
||||||
name: string;
|
name: string;
|
||||||
teachers: User[];
|
teachers: User[];
|
||||||
lessons: Lesson[];
|
lessons: string[];
|
||||||
creator: User;
|
creator: User;
|
||||||
startDt: string;
|
startDt: string;
|
||||||
|
examWithJury?: string;
|
||||||
created: string;
|
created: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface PopulatedCourse extends Omit<Course, 'examWithJury' | 'lessons'> {
|
||||||
|
examWithJury: ExamWithJury;
|
||||||
|
lessons: Lesson[];
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ExamWithJury {
|
||||||
|
name: string;
|
||||||
|
description: string;
|
||||||
|
jury: any[];
|
||||||
|
date: string;
|
||||||
|
created: string;
|
||||||
|
criterias: Criteria[][];
|
||||||
|
id: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Criteria {
|
||||||
|
title: string;
|
||||||
|
type?: string;
|
||||||
|
min?: number;
|
||||||
|
max?: number;
|
||||||
|
wight?: number;
|
||||||
|
subcriterias?: Subcriteria[];
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Subcriteria {
|
||||||
|
title: string;
|
||||||
|
type: string;
|
||||||
|
wight: number;
|
||||||
|
trueText?: string;
|
||||||
|
falseText?: string;
|
||||||
|
min?: number;
|
||||||
|
max?: number;
|
||||||
|
}
|
87
src/app.tsx
87
src/app.tsx
@ -1,87 +1,28 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Helmet } from 'react-helmet';
|
import { Helmet } from 'react-helmet';
|
||||||
import { Global, css } from '@emotion/react'
|
import { Global } from '@emotion/react'
|
||||||
import { BrowserRouter } from 'react-router-dom';
|
import { BrowserRouter } from 'react-router-dom';
|
||||||
import ruLocale from 'dayjs/locale/ru';
|
import ruLocale from 'dayjs/locale/ru';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import { ChakraProvider } from '@chakra-ui/react'
|
import { ChakraProvider } from '@chakra-ui/react'
|
||||||
|
|
||||||
import { Dashboard } from './dashboard';
|
import { Dashboard } from './dashboard';
|
||||||
|
import { globalStyles } from './global.styles';
|
||||||
|
|
||||||
dayjs.locale('ru', ruLocale);
|
dayjs.locale('ru', ruLocale);
|
||||||
|
|
||||||
const App = ({ store }) => {
|
const App = ({ store }) => (
|
||||||
return(
|
<ChakraProvider>
|
||||||
<ChakraProvider>
|
<BrowserRouter>
|
||||||
<BrowserRouter>
|
<Helmet>
|
||||||
<Helmet>
|
<meta name="viewport" content="width=device-width, user-scalable=no" />
|
||||||
<meta name="viewport" content="width=device-width, user-scalable=no" />
|
<title>Журнал</title>
|
||||||
<title>Журнал</title>
|
</Helmet>
|
||||||
</Helmet>
|
<Global styles={globalStyles} />
|
||||||
<Global
|
<Dashboard store={store} />
|
||||||
styles={css`
|
</BrowserRouter>
|
||||||
html {
|
</ChakraProvider>
|
||||||
height: 100%;
|
)
|
||||||
max-width: 100%;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
body {
|
|
||||||
color: #000;
|
|
||||||
/* background: radial-gradient(circle at top right, rgb(154 227 33), rgb(33 160 56)); */
|
|
||||||
background: radial-gradient(
|
|
||||||
farthest-side at bottom left,
|
|
||||||
rgba(35, 235, 4, 0.709),
|
|
||||||
rgba(255, 255, 255, 0) 65%
|
|
||||||
),
|
|
||||||
radial-gradient(
|
|
||||||
farthest-corner at bottom center,
|
|
||||||
rgba(244, 244, 8, 0.6),
|
|
||||||
rgba(255, 255, 255, 0) 40%
|
|
||||||
),
|
|
||||||
radial-gradient(
|
|
||||||
farthest-side at bottom right,
|
|
||||||
rgba(0, 195, 255, 0.648),
|
|
||||||
rgb(239 244 246) 65%
|
|
||||||
/* rgba(255, 255, 255, 0) 65% */
|
|
||||||
);
|
|
||||||
height: 100%;
|
|
||||||
font-family: KiyosunaSans, Montserrat, RFKrabuler, sans-serif;
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
#app {
|
|
||||||
height: 100%;
|
|
||||||
overflow-y: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
@font-face {
|
|
||||||
font-family: 'KiyosunaSans';
|
|
||||||
src: url('${__webpack_public_path__ + '/remote-assets/KiyosunaSans/KiyosunaSans-B.otf'}');
|
|
||||||
font-weight: normal;
|
|
||||||
font-style: normal;
|
|
||||||
}
|
|
||||||
@font-face {
|
|
||||||
font-family: 'KiyosunaSans';
|
|
||||||
src: url('${__webpack_public_path__ + '/remote-assets/KiyosunaSans/KiyosunaSans-L.otf'}');
|
|
||||||
font-weight: lighter;
|
|
||||||
font-style: normal;
|
|
||||||
}
|
|
||||||
@font-face {
|
|
||||||
font-family: 'RFKrabuler';
|
|
||||||
src: url('${__webpack_public_path__ + '/remote-assets/RF-Krabuler/WEB/RFKrabuler-Regular.eot'}');
|
|
||||||
src:
|
|
||||||
url('${__webpack_public_path__ + '/remote-assets/RF-Krabuler/WEB/RFKrabuler-Regular.woff2'}') format('woff2'),
|
|
||||||
url('${__webpack_public_path__ + '/remote-assets/RF-Krabuler/WEB/RFKrabuler-Regular.woff'}') format('woff'),
|
|
||||||
url('${__webpack_public_path__ + '/remote-assets/RF-Krabuler/TTF/RF-Krabuler-Regular.ttf'}') format('truetype');
|
|
||||||
font-weight: normal;
|
|
||||||
font-style: normal;
|
|
||||||
}
|
|
||||||
`}
|
|
||||||
/>
|
|
||||||
<Dashboard store={store} />
|
|
||||||
</BrowserRouter>
|
|
||||||
</ChakraProvider>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default App;
|
export default App;
|
||||||
|
|
||||||
|
20
src/components/page-loader/page-loader.tsx
Normal file
20
src/components/page-loader/page-loader.tsx
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import {
|
||||||
|
Spinner,
|
||||||
|
Container,
|
||||||
|
Center,
|
||||||
|
} from '@chakra-ui/react'
|
||||||
|
|
||||||
|
export const PageLoader = () => (
|
||||||
|
<Container maxW="container.xl">
|
||||||
|
<Center h="300px">
|
||||||
|
<Spinner
|
||||||
|
thickness="4px"
|
||||||
|
speed="0.65s"
|
||||||
|
emptyColor="gray.200"
|
||||||
|
color="blue.500"
|
||||||
|
size="xl"
|
||||||
|
/>
|
||||||
|
</Center>
|
||||||
|
</Container>
|
||||||
|
)
|
1
src/components/user-card/index.tsx
Normal file
1
src/components/user-card/index.tsx
Normal file
@ -0,0 +1 @@
|
|||||||
|
export { UserCard } from './user-card'
|
53
src/components/user-card/style.ts
Normal file
53
src/components/user-card/style.ts
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
import styled from '@emotion/styled'
|
||||||
|
import { css, keyframes } from '@emotion/react'
|
||||||
|
|
||||||
|
export const Avatar = styled.img`
|
||||||
|
width: 96px;
|
||||||
|
height: 96px;
|
||||||
|
margin: 0 auto;
|
||||||
|
border-radius: 6px;
|
||||||
|
`
|
||||||
|
|
||||||
|
export const Wrapper = styled.div<{ warn?: boolean; width?: string | number }>`
|
||||||
|
list-style: none;
|
||||||
|
background-color: #ffffff;
|
||||||
|
padding: 16px;
|
||||||
|
border-radius: 12px;
|
||||||
|
box-shadow: 2px 2px 6px #0000005c;
|
||||||
|
transition: all 0.5;
|
||||||
|
position: relative;
|
||||||
|
width: 180px;
|
||||||
|
min-height: 190px;
|
||||||
|
max-height: 200px;
|
||||||
|
margin-right: 12px;
|
||||||
|
padding-bottom: 22px;
|
||||||
|
${({ width }) =>
|
||||||
|
width
|
||||||
|
? css`
|
||||||
|
width: ${width};
|
||||||
|
`
|
||||||
|
: ''}
|
||||||
|
|
||||||
|
${(props) =>
|
||||||
|
props.warn
|
||||||
|
? css`
|
||||||
|
background-color: #000000;
|
||||||
|
opacity: 0.7;
|
||||||
|
color: #e4e4e4;
|
||||||
|
`
|
||||||
|
: ''}
|
||||||
|
`
|
||||||
|
|
||||||
|
export const AddMissedButton = styled.button`
|
||||||
|
position: absolute;
|
||||||
|
bottom: 8px;
|
||||||
|
right: 12px;
|
||||||
|
border: none;
|
||||||
|
background-color: #00000000;
|
||||||
|
opacity: 0.2;
|
||||||
|
|
||||||
|
:hover {
|
||||||
|
cursor: pointer;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
`
|
47
src/components/user-card/user-card.tsx
Normal file
47
src/components/user-card/user-card.tsx
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import { sha256 } from 'js-sha256'
|
||||||
|
|
||||||
|
import { User } from '../../__data__/model'
|
||||||
|
|
||||||
|
import { AddMissedButton, Avatar, Wrapper } from './style'
|
||||||
|
|
||||||
|
export function getGravatarURL(email, user) {
|
||||||
|
if (!email) return void 0
|
||||||
|
const address = String(email).trim().toLowerCase()
|
||||||
|
const hash = sha256(address)
|
||||||
|
|
||||||
|
return `https://www.gravatar.com/avatar/${hash}?d=robohash`
|
||||||
|
}
|
||||||
|
|
||||||
|
export const UserCard = ({
|
||||||
|
student,
|
||||||
|
present,
|
||||||
|
onAddUser,
|
||||||
|
wrapperAS,
|
||||||
|
width
|
||||||
|
}: {
|
||||||
|
student: User
|
||||||
|
present: boolean
|
||||||
|
width?: string | number
|
||||||
|
onAddUser?: (user: User) => void
|
||||||
|
wrapperAS?: React.ElementType<any, keyof React.JSX.IntrinsicElements>;
|
||||||
|
}) => {
|
||||||
|
return (
|
||||||
|
<Wrapper warn={!present} as={wrapperAS} width={width}>
|
||||||
|
<Avatar src={student.picture || getGravatarURL(student.email, null)} />
|
||||||
|
<p style={{ marginTop: 6 }}>
|
||||||
|
{student.name || student.preferred_username}{' '}
|
||||||
|
</p>
|
||||||
|
{onAddUser && !present && (
|
||||||
|
<AddMissedButton onClick={() => onAddUser(student)}>
|
||||||
|
add
|
||||||
|
</AddMissedButton>
|
||||||
|
)}
|
||||||
|
</Wrapper>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
UserCard.defaultProps = {
|
||||||
|
wrapperAS: 'div',
|
||||||
|
onAddUser: void 0,
|
||||||
|
}
|
1
src/components/xl-spinner/index.ts
Normal file
1
src/components/xl-spinner/index.ts
Normal file
@ -0,0 +1 @@
|
|||||||
|
export { XlSpinner } from './xl-spinner';
|
20
src/components/xl-spinner/xl-spinner.tsx
Normal file
20
src/components/xl-spinner/xl-spinner.tsx
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import {
|
||||||
|
Container,
|
||||||
|
Center,
|
||||||
|
Spinner,
|
||||||
|
} from '@chakra-ui/react'
|
||||||
|
|
||||||
|
export const XlSpinner = () => (
|
||||||
|
<Container maxW="container.xl">
|
||||||
|
<Center h="300px">
|
||||||
|
<Spinner
|
||||||
|
thickness="4px"
|
||||||
|
speed="0.65s"
|
||||||
|
emptyColor="gray.200"
|
||||||
|
color="blue.500"
|
||||||
|
size="xl"
|
||||||
|
/>
|
||||||
|
</Center>
|
||||||
|
</Container>
|
||||||
|
)
|
@ -1,6 +1,8 @@
|
|||||||
import React, { useEffect, Suspense } from 'react'
|
import React, { useEffect, Suspense } from 'react'
|
||||||
import { Routes, Route, useNavigate } from 'react-router-dom'
|
import { Routes, Route, useNavigate } from 'react-router-dom'
|
||||||
import { Provider } from 'react-redux'
|
import { Provider } from 'react-redux'
|
||||||
|
import { getNavigationsValue } from '@brojs/cli'
|
||||||
|
import { Box, Container, Spinner, VStack } from '@chakra-ui/react'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
CourseListPage,
|
CourseListPage,
|
||||||
@ -8,20 +10,8 @@ import {
|
|||||||
LessonListPage,
|
LessonListPage,
|
||||||
UserPage,
|
UserPage,
|
||||||
} from './pages'
|
} from './pages'
|
||||||
import { getNavigationsValue } from '@ijl/cli'
|
|
||||||
import { Box, Container, Spinner, VStack } from '@chakra-ui/react'
|
|
||||||
|
|
||||||
const Redirect = ({ path }) => {
|
const Wrapper = ({ children }: { children: React.ReactElement }) => (
|
||||||
const navigate = useNavigate()
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
navigate(path)
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
const Wrapper = ({ children }) => (
|
|
||||||
<Suspense
|
<Suspense
|
||||||
fallback={
|
fallback={
|
||||||
<Container>
|
<Container>
|
||||||
|
60
src/global.styles.ts
Normal file
60
src/global.styles.ts
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
import { css } from '@emotion/react'
|
||||||
|
|
||||||
|
export const globalStyles = css`
|
||||||
|
html {
|
||||||
|
height: 100%;
|
||||||
|
max-width: 100%;
|
||||||
|
min-width: 320px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
body {
|
||||||
|
color: #000;
|
||||||
|
/* background: radial-gradient(circle at top right, rgb(154 227 33), rgb(33 160 56)); */
|
||||||
|
background: radial-gradient(
|
||||||
|
farthest-side at bottom left,
|
||||||
|
rgba(35, 235, 4, 0.709),
|
||||||
|
rgba(255, 255, 255, 0) 65%
|
||||||
|
),
|
||||||
|
radial-gradient(
|
||||||
|
farthest-corner at bottom center,
|
||||||
|
rgba(244, 244, 8, 0.6),
|
||||||
|
rgba(255, 255, 255, 0) 40%
|
||||||
|
),
|
||||||
|
radial-gradient(
|
||||||
|
farthest-side at bottom right,
|
||||||
|
rgba(0, 195, 255, 0.648),
|
||||||
|
rgb(239 244 246) 65%
|
||||||
|
/* rgba(255, 255, 255, 0) 65% */
|
||||||
|
);
|
||||||
|
height: 100%;
|
||||||
|
/* font-family: KiyosunaSans, Montserrat, RFKrabuler, sans-serif; */
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
#app {
|
||||||
|
height: 100%;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'KiyosunaSans';
|
||||||
|
src: url('${__webpack_public_path__ + '/remote-assets/KiyosunaSans/KiyosunaSans-B.otf'}');
|
||||||
|
font-weight: normal;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'KiyosunaSans';
|
||||||
|
src: url('${__webpack_public_path__ + '/remote-assets/KiyosunaSans/KiyosunaSans-L.otf'}');
|
||||||
|
font-weight: lighter;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'RFKrabuler';
|
||||||
|
src: url('${__webpack_public_path__ + '/remote-assets/RF-Krabuler/WEB/RFKrabuler-Regular.eot'}');
|
||||||
|
src:
|
||||||
|
url('${__webpack_public_path__ + '/remote-assets/RF-Krabuler/WEB/RFKrabuler-Regular.woff2'}') format('woff2'),
|
||||||
|
url('${__webpack_public_path__ + '/remote-assets/RF-Krabuler/WEB/RFKrabuler-Regular.woff'}') format('woff'),
|
||||||
|
url('${__webpack_public_path__ + '/remote-assets/RF-Krabuler/TTF/RF-Krabuler-Regular.ttf'}') format('truetype');
|
||||||
|
font-weight: normal;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
`
|
@ -5,6 +5,10 @@ import App from './app';
|
|||||||
import { keycloak } from "./__data__/kc";
|
import { keycloak } from "./__data__/kc";
|
||||||
import { createStore } from "./__data__/store";
|
import { createStore } from "./__data__/store";
|
||||||
|
|
||||||
|
if(!module.hot) {
|
||||||
|
import('./ym');
|
||||||
|
}
|
||||||
|
|
||||||
export default (props) => <App {...props} />;
|
export default (props) => <App {...props} />;
|
||||||
|
|
||||||
let rootElement: ReactDOM.Root
|
let rootElement: ReactDOM.Root
|
||||||
@ -12,7 +16,7 @@ let rootElement: ReactDOM.Root
|
|||||||
export const mount = async (Сomponent, element = document.getElementById('app')) => {
|
export const mount = async (Сomponent, element = document.getElementById('app')) => {
|
||||||
let user = null;
|
let user = null;
|
||||||
try {
|
try {
|
||||||
await keycloak.init({ onLoad: "login-required" }); // 'login-required' });
|
await keycloak.init({ onLoad: "login-required" });
|
||||||
user = { ...(await keycloak.loadUserInfo()), ...keycloak.tokenParsed };
|
user = { ...(await keycloak.loadUserInfo()), ...keycloak.tokenParsed };
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Failed to initialize adapter:", error);
|
console.error("Failed to initialize adapter:", error);
|
||||||
|
93
src/pages/course-list/course-card.tsx
Normal file
93
src/pages/course-list/course-card.tsx
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
import React, { useCallback, useEffect, useState } from 'react'
|
||||||
|
import dayjs from 'dayjs'
|
||||||
|
import { Link as ConnectedLink } from 'react-router-dom'
|
||||||
|
import { getNavigationsValue } from '@brojs/cli'
|
||||||
|
import {
|
||||||
|
Box,
|
||||||
|
CardHeader,
|
||||||
|
CardBody,
|
||||||
|
CardFooter,
|
||||||
|
ButtonGroup,
|
||||||
|
Stack,
|
||||||
|
StackDivider,
|
||||||
|
Button,
|
||||||
|
Card,
|
||||||
|
Heading,
|
||||||
|
Tooltip,
|
||||||
|
Spinner,
|
||||||
|
} from '@chakra-ui/react'
|
||||||
|
|
||||||
|
import { api } from '../../__data__/api/api'
|
||||||
|
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])
|
||||||
|
|
||||||
|
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>
|
||||||
|
|
||||||
|
{populatedCourse.isFetching && <Spinner />}
|
||||||
|
{!populatedCourse.isFetching && populatedCourse.isSuccess && <CourseDetails populatedCourse={populatedCourse.data} />}
|
||||||
|
</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>
|
||||||
|
)
|
||||||
|
}
|
93
src/pages/course-list/course-details.tsx
Normal file
93
src/pages/course-list/course-details.tsx
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
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 { 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const CourseDetails = ({ populatedCourse }: CourseDetailsProps) => {
|
||||||
|
const user = useAppSelector((s) => s.user)
|
||||||
|
const exam = populatedCourse.examWithJury
|
||||||
|
const [toggleExamWithJury, examWithJuryRequest] = api.useToggleExamWithJuryMutation()
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Heading as="h3" mt={4} mb={3} size="lg">
|
||||||
|
Экзамен: {exam?.name} {exam && <Tooltip label="Начать экзамен" fontSize="12px" top="16px">
|
||||||
|
<Button
|
||||||
|
leftIcon={<LinkIcon />}
|
||||||
|
as={'a'}
|
||||||
|
colorScheme="blue"
|
||||||
|
href={getNavigationsValue('exam.main') + getNavigationsValue('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>
|
||||||
|
<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>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
@ -1,56 +1,44 @@
|
|||||||
import React, { useCallback, useEffect, useRef, useState } from 'react'
|
import React, { useEffect, useRef, useState } from 'react'
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
import { Link as ConnectedLink } from 'react-router-dom'
|
|
||||||
import { getNavigationsValue } from '@ijl/cli'
|
|
||||||
import {
|
import {
|
||||||
Box,
|
Box,
|
||||||
CardHeader,
|
CardHeader,
|
||||||
CardBody,
|
CardBody,
|
||||||
CardFooter,
|
|
||||||
ButtonGroup,
|
|
||||||
Stack,
|
|
||||||
StackDivider,
|
|
||||||
Button,
|
Button,
|
||||||
Card,
|
Card,
|
||||||
Heading,
|
Heading,
|
||||||
Tooltip,
|
|
||||||
Spinner,
|
|
||||||
Container,
|
Container,
|
||||||
VStack,
|
VStack,
|
||||||
Link,
|
|
||||||
Input,
|
Input,
|
||||||
CloseButton,
|
CloseButton,
|
||||||
FormControl,
|
FormControl,
|
||||||
FormLabel,
|
FormLabel,
|
||||||
FormHelperText,
|
FormHelperText,
|
||||||
Center,
|
|
||||||
FormErrorMessage,
|
FormErrorMessage,
|
||||||
useToast,
|
useToast,
|
||||||
} from '@chakra-ui/react'
|
} from '@chakra-ui/react'
|
||||||
import { useForm, Controller } from 'react-hook-form'
|
import { useForm, Controller } from 'react-hook-form'
|
||||||
|
|
||||||
import { ErrorSpan, MainWrapper } from './style'
|
import { ErrorSpan } from '../style'
|
||||||
|
|
||||||
import { useAppSelector } from '../__data__/store'
|
import { useAppSelector } from '../../__data__/store'
|
||||||
import { api } from '../__data__/api/api'
|
import { api } from '../../__data__/api/api'
|
||||||
import { isTeacher } from '../utils/user'
|
import { isTeacher } from '../../utils/user'
|
||||||
import { AddIcon, ArrowDownIcon, ArrowUpIcon, LinkIcon } from '@chakra-ui/icons'
|
import { AddIcon } from '@chakra-ui/icons'
|
||||||
import { Course } from '../__data__/model'
|
import { PageLoader } from '../../components/page-loader/page-loader'
|
||||||
|
import { CourseCard } from './course-card'
|
||||||
|
|
||||||
interface NewCourseForm {
|
interface NewCourseForm {
|
||||||
startDt: string
|
startDt: string
|
||||||
name: string
|
name: string
|
||||||
}
|
}
|
||||||
|
|
||||||
const CoursesList = () => {
|
export const CoursesList = () => {
|
||||||
const toast = useToast()
|
const toast = useToast()
|
||||||
const user = useAppSelector((s) => s.user)
|
const user = useAppSelector((s) => s.user)
|
||||||
const { data, isLoading } = api.useCoursesListQuery()
|
const { data, isLoading } = api.useCoursesListQuery()
|
||||||
const [createUpdateCourse, crucQuery] = api.useCreateUpdateCourseMutation()
|
const [createUpdateCourse, crucQuery] = api.useCreateUpdateCourseMutation()
|
||||||
const [showForm, setShowForm] = useState(false)
|
const [showForm, setShowForm] = useState(false)
|
||||||
const [courseDetailsOpenedId, setCourseDetailsOpenedId] = useState<
|
|
||||||
string | null
|
|
||||||
>(null)
|
|
||||||
const toastRef = useRef(null)
|
const toastRef = useRef(null)
|
||||||
|
|
||||||
const {
|
const {
|
||||||
@ -61,8 +49,8 @@ const CoursesList = () => {
|
|||||||
getValues,
|
getValues,
|
||||||
} = useForm<NewCourseForm>({
|
} = useForm<NewCourseForm>({
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
startDt: '',
|
startDt: dayjs().format('YYYY-MM-DD'),
|
||||||
name: '',
|
name: 'Название',
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -93,17 +81,7 @@ const CoursesList = () => {
|
|||||||
|
|
||||||
if (isLoading) {
|
if (isLoading) {
|
||||||
return (
|
return (
|
||||||
<Container maxW="container.xl">
|
<PageLoader />
|
||||||
<Center h="300px">
|
|
||||||
<Spinner
|
|
||||||
thickness="4px"
|
|
||||||
speed="0.65s"
|
|
||||||
emptyColor="gray.200"
|
|
||||||
color="blue.500"
|
|
||||||
size="xl"
|
|
||||||
/>
|
|
||||||
</Center>
|
|
||||||
</Container>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -212,109 +190,11 @@ const CoursesList = () => {
|
|||||||
<VStack as="ul" align="stretch">
|
<VStack as="ul" align="stretch">
|
||||||
{data?.body?.map((c) => (
|
{data?.body?.map((c) => (
|
||||||
<CourseCard
|
<CourseCard
|
||||||
isOpened={courseDetailsOpenedId === c._id}
|
key={c.id}
|
||||||
key={c._id}
|
|
||||||
course={c}
|
course={c}
|
||||||
openDetails={() =>
|
|
||||||
courseDetailsOpenedId === c._id
|
|
||||||
? setCourseDetailsOpenedId(null)
|
|
||||||
: setCourseDetailsOpenedId(c._id)
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</VStack>
|
</VStack>
|
||||||
</Container>
|
</Container>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const CourseCard = ({
|
|
||||||
course,
|
|
||||||
isOpened,
|
|
||||||
openDetails,
|
|
||||||
}: {
|
|
||||||
course: Course
|
|
||||||
isOpened: boolean
|
|
||||||
openDetails: () => void
|
|
||||||
}) => {
|
|
||||||
const [getLessonList, lessonList] = api.useLazyLessonListQuery()
|
|
||||||
useEffect(() => {
|
|
||||||
if (isOpened) {
|
|
||||||
getLessonList(course._id, true)
|
|
||||||
}
|
|
||||||
}, [isOpened])
|
|
||||||
const user = useAppSelector((s) => s.user)
|
|
||||||
|
|
||||||
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>
|
|
||||||
{lessonList.isFetching ? (
|
|
||||||
<Spinner />
|
|
||||||
) : (
|
|
||||||
<>
|
|
||||||
<Heading as="h3" mt={4} mb={3} size="lg">
|
|
||||||
Список занятий:
|
|
||||||
</Heading>
|
|
||||||
<Stack>
|
|
||||||
{lessonList.data?.body?.map((lesson) => (
|
|
||||||
<Link
|
|
||||||
as={ConnectedLink}
|
|
||||||
key={lesson._id}
|
|
||||||
to={
|
|
||||||
isTeacher(user)
|
|
||||||
? `${getNavigationsValue('journal.main')}/lesson/${course._id}/${lesson._id}`
|
|
||||||
: ''
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{lesson.name}
|
|
||||||
</Link>
|
|
||||||
))}
|
|
||||||
</Stack>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</Stack>
|
|
||||||
</CardBody>
|
|
||||||
)}
|
|
||||||
<CardFooter>
|
|
||||||
<ButtonGroup spacing="4" mt="16px">
|
|
||||||
<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"
|
|
||||||
variant="outline"
|
|
||||||
leftIcon={isOpened ? <ArrowUpIcon /> : <ArrowDownIcon />}
|
|
||||||
loadingText="Загрузка"
|
|
||||||
isLoading={lessonList.isFetching}
|
|
||||||
onClick={openDetails}
|
|
||||||
>
|
|
||||||
Просмотреть детали
|
|
||||||
</Button>
|
|
||||||
</Tooltip>
|
|
||||||
</ButtonGroup>
|
|
||||||
</CardFooter>
|
|
||||||
</Card>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default CoursesList
|
|
3
src/pages/course-list/index.ts
Normal file
3
src/pages/course-list/index.ts
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
import { CoursesList } from './course-list'
|
||||||
|
|
||||||
|
export default CoursesList
|
@ -1,8 +1,6 @@
|
|||||||
import { lazy } from 'react'
|
import { lazy } from 'react'
|
||||||
|
|
||||||
export const CourseListPage = lazy(/* chank-name="course-details" */() => import('./course-list'));
|
export const CourseListPage = lazy(() => import(/* webpackChunkName: "course-list" */ './course-list'));
|
||||||
|
export const LessonDetailsPage = lazy(() => import(/* webpackChunkName: "lesson-details" */ './lesson-details'));
|
||||||
export const LessonDetailsPage = lazy(/* chank-name="course-details" */() => import('./lesson-details'));
|
export const LessonListPage = lazy(() => import(/* webpackChunkName: "lesson-list" */ './lesson-list'));
|
||||||
export const LessonListPage = lazy(/* chank-name="course-details" */() => import('./lesson-list'));
|
export const UserPage = lazy(() => import(/* webpackChunkName: "user-page" */ './user-page'));
|
||||||
|
|
||||||
export const UserPage = lazy(/* chank-name="course-details" */() => import('./user-page'));
|
|
||||||
|
@ -2,39 +2,46 @@ import React, { useEffect, useState, useRef, useMemo } from 'react'
|
|||||||
import { useParams, Link } from 'react-router-dom'
|
import { useParams, Link } from 'react-router-dom'
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
import QRCode from 'qrcode'
|
import QRCode from 'qrcode'
|
||||||
import { getConfigValue, getNavigationsValue } from '@ijl/cli'
|
import { sha256 } from 'js-sha256'
|
||||||
|
import { getConfigValue, getNavigationsValue } from '@brojs/cli'
|
||||||
import {
|
import {
|
||||||
Box,
|
Box,
|
||||||
Breadcrumb,
|
Breadcrumb,
|
||||||
BreadcrumbItem,
|
BreadcrumbItem,
|
||||||
BreadcrumbLink,
|
BreadcrumbLink,
|
||||||
Container,
|
Container,
|
||||||
HStack,
|
|
||||||
VStack,
|
VStack,
|
||||||
Heading,
|
Heading,
|
||||||
|
Stack,
|
||||||
} from '@chakra-ui/react'
|
} from '@chakra-ui/react'
|
||||||
|
|
||||||
|
import { api } from '../__data__/api/api'
|
||||||
|
import { User } from '../__data__/model'
|
||||||
|
import { UserCard } from '../components/user-card'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
QRCanvas,
|
QRCanvas,
|
||||||
LessonItem,
|
StudentList,
|
||||||
Lessonname,
|
|
||||||
AddMissedButton,
|
|
||||||
UnorderList,
|
|
||||||
BreadcrumbsWrapper,
|
BreadcrumbsWrapper,
|
||||||
} from './style'
|
} from './style'
|
||||||
import { api } from '../__data__/api/api'
|
|
||||||
import { User } from '../__data__/model'
|
export function getGravatarURL(email, user) {
|
||||||
|
if (!email) return void 0
|
||||||
|
const address = String(email).trim().toLowerCase()
|
||||||
|
const hash = sha256(address)
|
||||||
|
|
||||||
|
// Grab the actual image URL
|
||||||
|
return `https://www.gravatar.com/avatar/${hash}?d=robohash`
|
||||||
|
}
|
||||||
|
|
||||||
const LessonDetail = () => {
|
const LessonDetail = () => {
|
||||||
const { lessonId, courseId } = useParams()
|
const { lessonId, courseId } = useParams()
|
||||||
const canvRef = useRef(null)
|
const canvRef = useRef(null)
|
||||||
const [lesson, setLesson] = useState(null)
|
|
||||||
const {
|
const {
|
||||||
isFetching,
|
isFetching,
|
||||||
isLoading,
|
|
||||||
data: accessCode,
|
data: accessCode,
|
||||||
error,
|
|
||||||
isSuccess,
|
isSuccess,
|
||||||
|
refetch,
|
||||||
} = api.useCreateAccessCodeQuery(
|
} = api.useCreateAccessCodeQuery(
|
||||||
{ lessonId },
|
{ lessonId },
|
||||||
{
|
{
|
||||||
@ -49,6 +56,13 @@ const LessonDetail = () => {
|
|||||||
() => `${location.origin}/journal/u/${lessonId}/${accessCode?.body?._id}`,
|
() => `${location.origin}/journal/u/${lessonId}/${accessCode?.body?._id}`,
|
||||||
[accessCode, lessonId],
|
[accessCode, lessonId],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (manualAddRqst.isSuccess) {
|
||||||
|
refetch()
|
||||||
|
}
|
||||||
|
}, [manualAddRqst.isSuccess])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!isFetching && isSuccess) {
|
if (!isFetching && isSuccess) {
|
||||||
QRCode.toCanvas(
|
QRCode.toCanvas(
|
||||||
@ -83,7 +97,7 @@ const LessonDetail = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return allStudents
|
return allStudents.sort((a, b) => (a.present ? -1 : 1))
|
||||||
}, [accessCode?.body, AllStudents.data])
|
}, [accessCode?.body, AllStudents.data])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -110,7 +124,7 @@ const LessonDetail = () => {
|
|||||||
</BreadcrumbItem>
|
</BreadcrumbItem>
|
||||||
</Breadcrumb>
|
</Breadcrumb>
|
||||||
</BreadcrumbsWrapper>
|
</BreadcrumbsWrapper>
|
||||||
<Container maxW="container.xl" centerContent px="200">
|
<Container maxW="2280px">
|
||||||
<VStack align="left">
|
<VStack align="left">
|
||||||
<Heading as="h3" mt="4" mb="3">
|
<Heading as="h3" mt="4" mb="3">
|
||||||
Тема занятия:
|
Тема занятия:
|
||||||
@ -125,27 +139,22 @@ const LessonDetail = () => {
|
|||||||
человек
|
человек
|
||||||
</Box>
|
</Box>
|
||||||
</VStack>
|
</VStack>
|
||||||
<HStack spacing="8">
|
<Stack spacing="8" sx={{ flexDirection: { sm: 'column', md: 'row' } }}>
|
||||||
<a href={userUrl}>
|
<a href={userUrl}>
|
||||||
<QRCanvas ref={canvRef} />
|
<QRCanvas ref={canvRef} />
|
||||||
</a>
|
</a>
|
||||||
<UnorderList>
|
<StudentList>
|
||||||
{studentsArr.map((student) => (
|
{studentsArr.map((student) => (
|
||||||
<LessonItem key={student.sub} warn={!student.present}>
|
<UserCard
|
||||||
<Lessonname>
|
wrapperAS="li"
|
||||||
{student.name || student.preferred_username}{' '}
|
key={student.sub}
|
||||||
{!student.present && (
|
student={student}
|
||||||
<AddMissedButton
|
present={student.present}
|
||||||
onClick={() => manualAdd({ lessonId, user: student })}
|
onAddUser={(user: User) => manualAdd({ lessonId, user })}
|
||||||
>
|
/>
|
||||||
add
|
|
||||||
</AddMissedButton>
|
|
||||||
)}
|
|
||||||
</Lessonname>
|
|
||||||
</LessonItem>
|
|
||||||
))}
|
))}
|
||||||
</UnorderList>
|
</StudentList>
|
||||||
</HStack>
|
</Stack>
|
||||||
</Container>
|
</Container>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
28
src/pages/lesson-list/components/bar.tsx
Normal file
28
src/pages/lesson-list/components/bar.tsx
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import { ResponsiveBar } from '@nivo/bar'
|
||||||
|
|
||||||
|
export const Bar = ({ data }) => (
|
||||||
|
<ResponsiveBar
|
||||||
|
data={data}
|
||||||
|
keys={['count']}
|
||||||
|
indexBy="lessonIndex"
|
||||||
|
margin={{ top: 50, right: 130, bottom: 50, left: 60 }}
|
||||||
|
padding={0.3}
|
||||||
|
valueScale={{ type: 'linear' }}
|
||||||
|
indexScale={{ type: 'band', round: true }}
|
||||||
|
colors={{ scheme: 'set3' }}
|
||||||
|
axisTop={null}
|
||||||
|
axisRight={null}
|
||||||
|
labelSkipWidth={12}
|
||||||
|
labelSkipHeight={12}
|
||||||
|
labelTextColor={{
|
||||||
|
from: 'color',
|
||||||
|
modifiers: [['brighter', 1.4]],
|
||||||
|
}}
|
||||||
|
role="application"
|
||||||
|
ariaLabel="График посещаемости лекций"
|
||||||
|
barAriaLabel={(e) =>
|
||||||
|
e.id + ': ' + e.formattedValue + ' on lection: ' + e.indexValue
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
)
|
137
src/pages/lesson-list/components/lessons-form.tsx
Normal file
137
src/pages/lesson-list/components/lessons-form.tsx
Normal file
@ -0,0 +1,137 @@
|
|||||||
|
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,
|
||||||
|
} from '@chakra-ui/react'
|
||||||
|
import { AddIcon } from '@chakra-ui/icons'
|
||||||
|
|
||||||
|
import { dateToCalendarFormat } from '../../../utils/time'
|
||||||
|
import { Lesson } from '../../../__data__/model'
|
||||||
|
import { ErrorSpan } from '../style'
|
||||||
|
|
||||||
|
interface NewLessonForm {
|
||||||
|
name: string;
|
||||||
|
date: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface LessonFormProps {
|
||||||
|
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,
|
||||||
|
}: 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">
|
||||||
|
<Heading as="h2" mt="0">
|
||||||
|
{title}
|
||||||
|
</Heading>
|
||||||
|
<CloseButton
|
||||||
|
ml="auto"
|
||||||
|
onClick={() => {
|
||||||
|
reset()
|
||||||
|
onCancel()
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</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"
|
||||||
|
/>
|
||||||
|
{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"
|
||||||
|
/>
|
||||||
|
{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>}
|
||||||
|
</form>
|
||||||
|
</CardBody>
|
||||||
|
</Card>
|
||||||
|
)
|
||||||
|
}
|
3
src/pages/lesson-list/index.ts
Normal file
3
src/pages/lesson-list/index.ts
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
import LessonsList from './lesson-list';
|
||||||
|
|
||||||
|
export default LessonsList;
|
@ -1,28 +1,21 @@
|
|||||||
import React, { useCallback, useEffect, useRef, useState } from 'react'
|
import React, {
|
||||||
|
useEffect,
|
||||||
|
useMemo,
|
||||||
|
useRef,
|
||||||
|
useState,
|
||||||
|
} from 'react'
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
import { Link, useParams } from 'react-router-dom'
|
import { Link, useParams } from 'react-router-dom'
|
||||||
import { getNavigationsValue } from '@ijl/cli'
|
import { getNavigationsValue, getFeatures } from '@brojs/cli'
|
||||||
import { useForm, Controller } from 'react-hook-form'
|
|
||||||
import {
|
import {
|
||||||
Breadcrumb,
|
Breadcrumb,
|
||||||
BreadcrumbItem,
|
BreadcrumbItem,
|
||||||
BreadcrumbLink,
|
BreadcrumbLink,
|
||||||
Container,
|
Container,
|
||||||
Box,
|
Box,
|
||||||
Card,
|
|
||||||
CardBody,
|
|
||||||
CardHeader,
|
|
||||||
Heading,
|
|
||||||
Button,
|
Button,
|
||||||
CloseButton,
|
|
||||||
useToast,
|
useToast,
|
||||||
VStack,
|
|
||||||
FormControl,
|
|
||||||
FormLabel,
|
|
||||||
Toast,
|
Toast,
|
||||||
FormHelperText,
|
|
||||||
FormErrorMessage,
|
|
||||||
Input,
|
|
||||||
TableContainer,
|
TableContainer,
|
||||||
Table,
|
Table,
|
||||||
Thead,
|
Thead,
|
||||||
@ -35,8 +28,6 @@ import {
|
|||||||
MenuItem,
|
MenuItem,
|
||||||
Text,
|
Text,
|
||||||
MenuList,
|
MenuList,
|
||||||
Center,
|
|
||||||
Spinner,
|
|
||||||
AlertDialog,
|
AlertDialog,
|
||||||
AlertDialogBody,
|
AlertDialogBody,
|
||||||
AlertDialogContent,
|
AlertDialogContent,
|
||||||
@ -46,129 +37,26 @@ import {
|
|||||||
} from '@chakra-ui/react'
|
} from '@chakra-ui/react'
|
||||||
import { AddIcon, EditIcon } from '@chakra-ui/icons'
|
import { AddIcon, EditIcon } from '@chakra-ui/icons'
|
||||||
|
|
||||||
import { useAppSelector } from '../__data__/store'
|
import { useAppSelector } from '../../__data__/store'
|
||||||
import { api } from '../__data__/api/api'
|
import { api } from '../../__data__/api/api'
|
||||||
import { isTeacher } from '../utils/user'
|
import { isTeacher } from '../../utils/user'
|
||||||
import { qrCode } from '../assets'
|
import { qrCode } from '../../assets'
|
||||||
import { Lesson } from '../__data__/model'
|
import { Lesson } from '../../__data__/model'
|
||||||
|
import { XlSpinner } from '../../components/xl-spinner'
|
||||||
|
|
||||||
import { ErrorSpan, BreadcrumbsWrapper } from './style'
|
import { LessonForm } from './components/lessons-form'
|
||||||
|
import { BreadcrumbsWrapper } from './style'
|
||||||
|
import { Bar } from './components/bar'
|
||||||
|
|
||||||
interface NewLessonForm {
|
const features = getFeatures('journal')
|
||||||
name: string
|
|
||||||
date: string
|
|
||||||
}
|
|
||||||
|
|
||||||
interface LessonFormProps {
|
const barFeature = features?.['lesson.bar']
|
||||||
lesson?: Partial<Lesson>
|
const groupByDate = features?.['group.by.date']
|
||||||
isLoading: boolean
|
|
||||||
onCancel: () => void
|
|
||||||
onSubmit: (lesson: Lesson) => void
|
|
||||||
error?: string
|
|
||||||
}
|
|
||||||
|
|
||||||
const LessonForm = ({
|
|
||||||
lesson,
|
|
||||||
isLoading,
|
|
||||||
onCancel,
|
|
||||||
onSubmit,
|
|
||||||
error,
|
|
||||||
}: LessonFormProps) => {
|
|
||||||
const {
|
|
||||||
control,
|
|
||||||
handleSubmit,
|
|
||||||
reset,
|
|
||||||
formState: { errors },
|
|
||||||
} = useForm<NewLessonForm>({
|
|
||||||
defaultValues: lesson || {
|
|
||||||
name: '',
|
|
||||||
date: '',
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Card align="left">
|
|
||||||
<CardHeader display="flex">
|
|
||||||
<Heading as="h2" mt="0">
|
|
||||||
Создание лекции
|
|
||||||
</Heading>
|
|
||||||
<CloseButton
|
|
||||||
ml="auto"
|
|
||||||
onClick={() => {
|
|
||||||
reset()
|
|
||||||
onCancel()
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</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"
|
|
||||||
/>
|
|
||||||
{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"
|
|
||||||
/>
|
|
||||||
{errors.name && (
|
|
||||||
<FormErrorMessage>{errors.name.message}</FormErrorMessage>
|
|
||||||
)}
|
|
||||||
</FormControl>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
<Box mt="10">
|
|
||||||
<Button
|
|
||||||
size="lg"
|
|
||||||
type="submit"
|
|
||||||
leftIcon={<AddIcon />}
|
|
||||||
colorScheme="blue"
|
|
||||||
isLoading={isLoading}
|
|
||||||
>
|
|
||||||
Создать
|
|
||||||
</Button>
|
|
||||||
</Box>
|
|
||||||
</VStack>
|
|
||||||
|
|
||||||
{error && <ErrorSpan>{error}</ErrorSpan>}
|
|
||||||
</form>
|
|
||||||
</CardBody>
|
|
||||||
</Card>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
const LessonList = () => {
|
const LessonList = () => {
|
||||||
const { courseId } = useParams()
|
const { courseId } = useParams()
|
||||||
const user = useAppSelector((s) => s.user)
|
const user = useAppSelector((s) => s.user)
|
||||||
const { data, isLoading, error } = api.useLessonListQuery(courseId)
|
const { data, isLoading, error, isSuccess } = api.useLessonListQuery(courseId)
|
||||||
const [createLesson, crLQuery] = api.useCreateLessonMutation()
|
const [createLesson, crLQuery] = api.useCreateLessonMutation()
|
||||||
const [deleteLesson, deletingRqst] = api.useDeleteLessonMutation()
|
const [deleteLesson, deletingRqst] = api.useDeleteLessonMutation()
|
||||||
const [updateLesson, updateLessonRqst] = api.useUpdateLessonMutation()
|
const [updateLesson, updateLessonRqst] = api.useUpdateLessonMutation()
|
||||||
@ -179,6 +67,36 @@ const LessonList = () => {
|
|||||||
const toastRef = useRef(null)
|
const toastRef = useRef(null)
|
||||||
const createdLessonRef = useRef(null)
|
const createdLessonRef = useRef(null)
|
||||||
const [editLesson, setEditLesson] = useState<Lesson>(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 lessonCalc = useMemo(() => {
|
||||||
|
if (!isSuccess) {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!groupByDate) {
|
||||||
|
return [{ date: '', data: sorted }]
|
||||||
|
}
|
||||||
|
|
||||||
|
const lessonsData = []
|
||||||
|
for (let i = 0; i < sorted.length; i++) {
|
||||||
|
const element = sorted[i]
|
||||||
|
const find = lessonsData.find(
|
||||||
|
(item) => dayjs(element.date).diff(dayjs(item.date), 'day') === 0,
|
||||||
|
)
|
||||||
|
|
||||||
|
if (find) {
|
||||||
|
find.data.push(element)
|
||||||
|
} else {
|
||||||
|
lessonsData.push({
|
||||||
|
date: element.date,
|
||||||
|
data: [element],
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return lessonsData.sort((a, b) => a.date < b.date? 1 : -1)
|
||||||
|
}, [groupByDate, isSuccess, sorted])
|
||||||
|
|
||||||
const onSubmit = (lessonData) => {
|
const onSubmit = (lessonData) => {
|
||||||
toastRef.current = toast({
|
toastRef.current = toast({
|
||||||
@ -262,19 +180,7 @@ const LessonList = () => {
|
|||||||
}, [updateLessonRqst.isSuccess])
|
}, [updateLessonRqst.isSuccess])
|
||||||
|
|
||||||
if (isLoading) {
|
if (isLoading) {
|
||||||
return (
|
return <XlSpinner />;
|
||||||
<Container maxW="container.xl">
|
|
||||||
<Center h="300px">
|
|
||||||
<Spinner
|
|
||||||
thickness="4px"
|
|
||||||
speed="0.65s"
|
|
||||||
emptyColor="gray.200"
|
|
||||||
color="blue.500"
|
|
||||||
size="xl"
|
|
||||||
/>
|
|
||||||
</Center>
|
|
||||||
</Container>
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -329,7 +235,7 @@ const LessonList = () => {
|
|||||||
</BreadcrumbItem>
|
</BreadcrumbItem>
|
||||||
</Breadcrumb>
|
</Breadcrumb>
|
||||||
</BreadcrumbsWrapper>
|
</BreadcrumbsWrapper>
|
||||||
<Container maxW="container.xl">
|
<Container maxW="container.xl" position="relative">
|
||||||
{isTeacher(user) && (
|
{isTeacher(user) && (
|
||||||
<Box mt="15" mb="15">
|
<Box mt="15" mb="15">
|
||||||
{showForm ? (
|
{showForm ? (
|
||||||
@ -343,6 +249,8 @@ const LessonList = () => {
|
|||||||
}}
|
}}
|
||||||
error={(crLQuery.error as any)?.error}
|
error={(crLQuery.error as any)?.error}
|
||||||
lesson={editLesson}
|
lesson={editLesson}
|
||||||
|
title={editLesson ? 'Редактирование лекции' : 'Создание лекции'}
|
||||||
|
nameButton={editLesson ? 'Редактировать' : 'Создать'}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<Box p="2" m="2">
|
<Box p="2" m="2">
|
||||||
@ -357,7 +265,17 @@ const LessonList = () => {
|
|||||||
)}
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
)}
|
)}
|
||||||
<TableContainer whiteSpace="wrap">
|
{barFeature && sorted?.length && (
|
||||||
|
<Box height="300">
|
||||||
|
<Bar
|
||||||
|
data={sorted.map((lesson, index) => ({
|
||||||
|
lessonIndex: `#${index + 1}`,
|
||||||
|
count: lesson.students.length,
|
||||||
|
}))}
|
||||||
|
/>
|
||||||
|
</Box>
|
||||||
|
)}
|
||||||
|
<TableContainer whiteSpace="wrap" pb={13}>
|
||||||
<Table variant="striped" colorScheme="cyan">
|
<Table variant="striped" colorScheme="cyan">
|
||||||
<Thead>
|
<Thead>
|
||||||
<Tr>
|
<Tr>
|
||||||
@ -370,53 +288,62 @@ const LessonList = () => {
|
|||||||
Дата
|
Дата
|
||||||
</Th>
|
</Th>
|
||||||
<Th>Название</Th>
|
<Th>Название</Th>
|
||||||
<Th>action</Th>
|
{isTeacher(user) && <Th>action</Th>}
|
||||||
<Th isNumeric>Отмечено</Th>
|
<Th isNumeric>Отмечено</Th>
|
||||||
</Tr>
|
</Tr>
|
||||||
</Thead>
|
</Thead>
|
||||||
<Tbody>
|
<Tbody>
|
||||||
{data?.body?.map((lesson) => (
|
{lessonCalc?.map(({ data: lessons, date }) => (
|
||||||
<Tr key={lesson._id}>
|
<React.Fragment key={date}>
|
||||||
{isTeacher(user) && (
|
{date && <Tr><Td colSpan={isTeacher(user) ? 5 : 3}>{dayjs(date).format('DD MMMM YYYY')}</Td></Tr>}
|
||||||
<Td>
|
{lessons.map((lesson) => (
|
||||||
<Link
|
<Tr key={lesson._id}>
|
||||||
to={`${getNavigationsValue('journal.main')}/lesson/${courseId}/${lesson._id}`}
|
{isTeacher(user) && (
|
||||||
style={{ display: 'flex' }}
|
<Td>
|
||||||
>
|
<Link
|
||||||
<img
|
to={`${getNavigationsValue('journal.main')}/lesson/${courseId}/${lesson._id}`}
|
||||||
width={24}
|
style={{ display: 'flex' }}
|
||||||
src={qrCode}
|
>
|
||||||
style={{ margin: '0 auto' }}
|
<img
|
||||||
/>
|
width={24}
|
||||||
</Link>
|
src={qrCode}
|
||||||
</Td>
|
style={{ margin: '0 auto' }}
|
||||||
)}
|
/>
|
||||||
<Td textAlign="center">
|
</Link>
|
||||||
{dayjs(lesson.date).format('H:mm DD.MM.YY')}
|
</Td>
|
||||||
</Td>
|
)}
|
||||||
<Td>{lesson.name}</Td>
|
<Td textAlign="center">
|
||||||
<Td>
|
{dayjs(lesson.date).format(groupByDate ? 'HH:mm' : 'HH:mm DD.MM.YY')}
|
||||||
<Menu>
|
</Td>
|
||||||
<MenuButton as={Button}>
|
<Td>{lesson.name}</Td>
|
||||||
<EditIcon />
|
{isTeacher(user) && (
|
||||||
</MenuButton>
|
<Td>
|
||||||
<MenuList>
|
<Menu>
|
||||||
<MenuItem
|
<MenuButton as={Button}>
|
||||||
onClick={() => {
|
<EditIcon />
|
||||||
setShowForm(true)
|
</MenuButton>
|
||||||
setEditLesson(lesson)
|
<MenuList>
|
||||||
}}
|
<MenuItem
|
||||||
>
|
onClick={() => {
|
||||||
Edit
|
setShowForm(true)
|
||||||
</MenuItem>
|
setEditLesson(lesson)
|
||||||
<MenuItem onClick={() => setlessonToDelete(lesson)}>
|
}}
|
||||||
Delete
|
>
|
||||||
</MenuItem>
|
Edit
|
||||||
</MenuList>
|
</MenuItem>
|
||||||
</Menu>
|
<MenuItem
|
||||||
</Td>
|
onClick={() => setlessonToDelete(lesson)}
|
||||||
<Td isNumeric>{lesson.students.length}</Td>
|
>
|
||||||
</Tr>
|
Delete
|
||||||
|
</MenuItem>
|
||||||
|
</MenuList>
|
||||||
|
</Menu>
|
||||||
|
</Td>
|
||||||
|
)}
|
||||||
|
<Td isNumeric>{lesson.students.length}</Td>
|
||||||
|
</Tr>
|
||||||
|
))}
|
||||||
|
</React.Fragment>
|
||||||
))}
|
))}
|
||||||
</Tbody>
|
</Tbody>
|
||||||
</Table>
|
</Table>
|
13
src/pages/lesson-list/style.ts
Normal file
13
src/pages/lesson-list/style.ts
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import styled from '@emotion/styled';
|
||||||
|
|
||||||
|
export const BreadcrumbsWrapper = styled.div`
|
||||||
|
padding: 12px;
|
||||||
|
`;
|
||||||
|
|
||||||
|
export const ErrorSpan = styled.span`
|
||||||
|
color: #f9e2e2;
|
||||||
|
display: block;
|
||||||
|
padding: 16px;
|
||||||
|
background-color: #d32f0b;
|
||||||
|
border-radius: 11px;
|
||||||
|
`
|
@ -1,63 +1,8 @@
|
|||||||
import styled from '@emotion/styled'
|
import styled from '@emotion/styled'
|
||||||
import { css, keyframes } from '@emotion/react'
|
import { keyframes } from '@emotion/react'
|
||||||
import {
|
|
||||||
Card
|
|
||||||
} from '@chakra-ui/react'
|
|
||||||
|
|
||||||
export const BreadcrumbsWrapper = styled.div`
|
export const BreadcrumbsWrapper = styled.div`
|
||||||
padding: 12px;
|
padding: 12px;
|
||||||
`;
|
|
||||||
|
|
||||||
export const MainWrapper = styled.main`
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
height: 100%;
|
|
||||||
`
|
|
||||||
|
|
||||||
export const InputWrapper = styled.div`
|
|
||||||
position: relative;
|
|
||||||
padding: 12px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
@media screen and (max-width: 600px) {
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
`
|
|
||||||
export const InputLabel = styled.label`
|
|
||||||
position: absolute;
|
|
||||||
top: -8px;
|
|
||||||
left: 24px;
|
|
||||||
z-index: 2;
|
|
||||||
`
|
|
||||||
export const InputElement = styled.input`
|
|
||||||
border: 1px solid #ccc;
|
|
||||||
padding: 12px;
|
|
||||||
font-size: 24px;
|
|
||||||
border-radius: 8px;
|
|
||||||
color: #117623;
|
|
||||||
max-width: 90vw;
|
|
||||||
box-shadow: inset 7px 8px 20px 8px #4990db12;
|
|
||||||
`
|
|
||||||
|
|
||||||
export const StyledCard = styled(Card)`
|
|
||||||
box-shadow: 2px 2px 6px #0000005c;
|
|
||||||
padding: 16px;
|
|
||||||
border-radius: 12px;
|
|
||||||
min-width: 400px;
|
|
||||||
`
|
|
||||||
|
|
||||||
export const ArrowImg = styled.img`
|
|
||||||
width: 48px;
|
|
||||||
height: 48px;
|
|
||||||
`
|
|
||||||
|
|
||||||
export const IconButton = styled.button`
|
|
||||||
border: none;
|
|
||||||
background-color: rgba(0, 0, 0, 0);
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
height: 100%;
|
|
||||||
`
|
`
|
||||||
|
|
||||||
const reveal = keyframes`
|
const reveal = keyframes`
|
||||||
@ -70,77 +15,15 @@ const reveal = keyframes`
|
|||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
export const StartWrapper = styled.div`
|
export const StudentList = styled.ul`
|
||||||
animation: ${reveal} 0.4s ease forwards;
|
|
||||||
height: calc(100vh - 300px);
|
|
||||||
position: relative;
|
|
||||||
`
|
|
||||||
|
|
||||||
export const Wrapper = styled.div`
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
gap: 20px;
|
|
||||||
width: auto;
|
|
||||||
`
|
|
||||||
|
|
||||||
export const UnorderList = styled.ul`
|
|
||||||
padding-left: 0px;
|
padding-left: 0px;
|
||||||
height: 600px;
|
height: 600px;
|
||||||
overflow: auto;
|
justify-content: space-evenly;
|
||||||
padding-right: 20px;
|
padding-right: 20px;
|
||||||
`
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
export const Svg = styled.svg`
|
flex-wrap: wrap;
|
||||||
position: absolute;
|
gap: 8px;
|
||||||
top: 50%;
|
|
||||||
left: 50%;
|
|
||||||
transform-origin: 50% 50%;
|
|
||||||
transform: translate(-50%, -50%);
|
|
||||||
`
|
|
||||||
|
|
||||||
export const Papper = styled.div`
|
|
||||||
position: relative;
|
|
||||||
background-color: #ffffff;
|
|
||||||
border-radius: 12px;
|
|
||||||
padding: 32px 16px 16px;
|
|
||||||
box-shadow: 2px 2px 6px #0000005c;
|
|
||||||
`
|
|
||||||
|
|
||||||
export const LessonItem = styled.li<{ warn?: boolean }>`
|
|
||||||
list-style: none;
|
|
||||||
background-color: #ffffff;
|
|
||||||
padding: 16px;
|
|
||||||
border-radius: 12px;
|
|
||||||
box-shadow: 2px 2px 6px #0000005c;
|
|
||||||
margin-bottom: 12px;
|
|
||||||
transition: all 0.5;
|
|
||||||
|
|
||||||
${(props) =>
|
|
||||||
props.warn
|
|
||||||
? css`
|
|
||||||
background-color: #fde3c5;
|
|
||||||
color: #919191;
|
|
||||||
box-shadow: inset 3px 2px 7px #c9b5a9;
|
|
||||||
`
|
|
||||||
: ''}
|
|
||||||
`
|
|
||||||
|
|
||||||
export const AddMissedButton = styled.button`
|
|
||||||
float: right;
|
|
||||||
border: none;
|
|
||||||
background-color: #00000000;
|
|
||||||
opacity: 0.1;
|
|
||||||
|
|
||||||
:hover {
|
|
||||||
cursor: pointer;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
`
|
|
||||||
|
|
||||||
export const Lessonname = styled.span`
|
|
||||||
display: inline-box;
|
|
||||||
margin-right: 12px;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
`
|
`
|
||||||
|
|
||||||
export const QRCanvas = styled.canvas`
|
export const QRCanvas = styled.canvas`
|
||||||
@ -154,29 +37,3 @@ export const ErrorSpan = styled.span`
|
|||||||
background-color: #d32f0b;
|
background-color: #d32f0b;
|
||||||
border-radius: 11px;
|
border-radius: 11px;
|
||||||
`
|
`
|
||||||
|
|
||||||
export const Cross = styled.button`
|
|
||||||
position: absolute;
|
|
||||||
right: 19px;
|
|
||||||
top: 14px;
|
|
||||||
font-size: 24px;
|
|
||||||
padding: 7px;
|
|
||||||
cursor: pointer;
|
|
||||||
background-color: #fff;
|
|
||||||
border: none;
|
|
||||||
|
|
||||||
:hover {
|
|
||||||
background-color: #d7181812;
|
|
||||||
border-radius: 20px;
|
|
||||||
}
|
|
||||||
`
|
|
||||||
|
|
||||||
export const AddButton = styled.button`
|
|
||||||
background-color: transparent;
|
|
||||||
border: none;
|
|
||||||
cursor: pointer;
|
|
||||||
|
|
||||||
:hover {
|
|
||||||
box-shadow: 3px 2px 5px #00000038;
|
|
||||||
}
|
|
||||||
`
|
|
||||||
|
@ -1,15 +1,18 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { useParams } from 'react-router-dom'
|
import { useParams } from 'react-router-dom'
|
||||||
|
|
||||||
import {
|
|
||||||
ErrorSpan,
|
|
||||||
LessonItem,
|
|
||||||
Lessonname,
|
|
||||||
MainWrapper,
|
|
||||||
StartWrapper,
|
|
||||||
} from './style'
|
|
||||||
import { api } from '../__data__/api/api'
|
import { api } from '../__data__/api/api'
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
|
import {
|
||||||
|
Alert,
|
||||||
|
AlertIcon,
|
||||||
|
Box,
|
||||||
|
Center,
|
||||||
|
Container,
|
||||||
|
Spinner,
|
||||||
|
Text,
|
||||||
|
} from '@chakra-ui/react'
|
||||||
|
import { UserCard } from '../components/user-card'
|
||||||
|
|
||||||
const UserPage = () => {
|
const UserPage = () => {
|
||||||
const { lessonId, accessId } = useParams()
|
const { lessonId, accessId } = useParams()
|
||||||
@ -20,38 +23,67 @@ const UserPage = () => {
|
|||||||
skipPollingIfUnfocused: true,
|
skipPollingIfUnfocused: true,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (acc.isLoading) {
|
||||||
|
return (
|
||||||
|
<Container maxW="container.xl">
|
||||||
|
<Center h="300px">
|
||||||
|
<Spinner
|
||||||
|
thickness="4px"
|
||||||
|
speed="0.65s"
|
||||||
|
emptyColor="gray.200"
|
||||||
|
color="blue.500"
|
||||||
|
size="xl"
|
||||||
|
/>
|
||||||
|
</Center>
|
||||||
|
</Container>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<MainWrapper>
|
<Container>
|
||||||
<StartWrapper>
|
{acc.isLoading && <h1>Отправляем запрос</h1>}
|
||||||
{acc.isLoading && <h1>Отправляем запрос</h1>}
|
{acc.isSuccess && <h1>Успешно</h1>}
|
||||||
{acc.isSuccess && <h1>Успешно</h1>}
|
|
||||||
|
{acc.error && (
|
||||||
|
<Box mb="6" mt="2">
|
||||||
|
<Alert status="warning">
|
||||||
|
<AlertIcon />
|
||||||
|
{(acc as any).error?.data?.body?.errorMessage ===
|
||||||
|
'Code is expired' ? (
|
||||||
|
'Не удалось активировать код доступа. Попробуйте отсканировать код ещё раз'
|
||||||
|
) : (
|
||||||
|
<pre>{JSON.stringify(acc.error, null, 4)}</pre>
|
||||||
|
)}
|
||||||
|
</Alert>
|
||||||
|
</Box>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<Box mb={6}>
|
||||||
|
<Text fontSize={18} fontWeight={600} as="h1" mt="4" mb="3">
|
||||||
|
Тема занятия: {ls.data?.body?.name}
|
||||||
|
</Text>
|
||||||
|
|
||||||
{acc.error && (
|
|
||||||
<div style={{ padding: 12, marginTop: 24, fontSize: 36 }}>
|
|
||||||
<ErrorSpan>
|
|
||||||
{(acc as any).error?.data?.body?.errorMessage ===
|
|
||||||
'Code is expired' ? (
|
|
||||||
'Не удалось активировать код доступа. Попробуйте отсканировать код ещё раз'
|
|
||||||
) : (
|
|
||||||
<pre>{JSON.stringify(acc.error, null, 4)}</pre>
|
|
||||||
)}
|
|
||||||
</ErrorSpan>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
<h1>Тема занятия - {ls.data?.body?.name}</h1>
|
|
||||||
<span>{dayjs(ls.data?.body?.date).format('DD MMMM YYYYг.')}</span>
|
<span>{dayjs(ls.data?.body?.date).format('DD MMMM YYYYг.')}</span>
|
||||||
|
</Box>
|
||||||
|
|
||||||
<ul style={{ paddingLeft: 0 }}>
|
<Box
|
||||||
{ls.data?.body?.students?.map((student, index) => (
|
as="ul"
|
||||||
<LessonItem key={index}>
|
display="flex"
|
||||||
<Lessonname>
|
flexWrap="wrap"
|
||||||
{student.name || student.preferred_username}
|
justifyContent="center"
|
||||||
</Lessonname>
|
gap={3}
|
||||||
</LessonItem>
|
>
|
||||||
))}
|
{ls.data?.body?.students?.map((student) => (
|
||||||
</ul>
|
<UserCard
|
||||||
</StartWrapper>
|
width="40%"
|
||||||
</MainWrapper>
|
wrapperAS="li"
|
||||||
|
key={student.sub}
|
||||||
|
student={student}
|
||||||
|
present
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</Box>
|
||||||
|
</Container>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
3
src/utils/time.ts
Normal file
3
src/utils/time.ts
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
import dayjs from "dayjs";
|
||||||
|
|
||||||
|
export const dateToCalendarFormat = (date?: string) => dayjs(date).format('YYYY-MM-DDTHH:mm')
|
17
src/ym.ts
Normal file
17
src/ym.ts
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
(function (m, e, t, r, i, k, a) {
|
||||||
|
m[i] = m[i] || function () { (m[i].a = m[i].a || []).push(arguments) };
|
||||||
|
// @ts-ignore
|
||||||
|
m[i].l = 1 * new Date();
|
||||||
|
for (var j = 0; j < document.scripts.length; j++) { if (document.scripts[j].src === r) { return; } }
|
||||||
|
k = e.createElement(t), a = e.getElementsByTagName(t)[0], k.async = 1, k.src = r, a.parentNode.insertBefore(k, a)
|
||||||
|
})(window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym");
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
|
ym(98045358, "init", {
|
||||||
|
clickmap: true,
|
||||||
|
trackLinks: true,
|
||||||
|
accurateTrackBounce: true,
|
||||||
|
webvisor: true
|
||||||
|
});
|
||||||
|
|
||||||
|
export const dummy = true;
|
@ -3,16 +3,31 @@ const fs = require('node:fs')
|
|||||||
const path = require('node:path')
|
const path = require('node:path')
|
||||||
|
|
||||||
const timer =
|
const timer =
|
||||||
(time = 1000) =>
|
(time = 1000) =>
|
||||||
(_req, _res, next) =>
|
(_req, _res, next) =>
|
||||||
setTimeout(next, time)
|
setTimeout(next, time)
|
||||||
|
|
||||||
router.use(timer())
|
router.use(timer())
|
||||||
|
|
||||||
|
const config = {
|
||||||
|
examCreated: false
|
||||||
|
}
|
||||||
|
|
||||||
router.get('/course/list', (req, res) => {
|
router.get('/course/list', (req, res) => {
|
||||||
res.send(require('../mocks/courses/list/success.json'))
|
res.send(require('../mocks/courses/list/success.json'))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
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'))
|
||||||
|
})
|
||||||
|
|
||||||
router.get('/course/students/:courseId', (req, res) => {
|
router.get('/course/students/:courseId', (req, res) => {
|
||||||
res.send(require('../mocks/courses/all-students/success.json'))
|
res.send(require('../mocks/courses/all-students/success.json'))
|
||||||
})
|
})
|
||||||
@ -21,6 +36,11 @@ router.post('/course', (req, res) => {
|
|||||||
res.send(require('../mocks/courses/create/success.json'))
|
res.send(require('../mocks/courses/create/success.json'))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
router.post('/course/toggle-exam-with-jury/:id', (req, res) => {
|
||||||
|
config.examCreated = true;
|
||||||
|
res.send({ success: true })
|
||||||
|
})
|
||||||
|
|
||||||
router.get('/lesson/list/:courseId', (req, res) => {
|
router.get('/lesson/list/:courseId', (req, res) => {
|
||||||
res.send(require('../mocks/lessons/list/success.json'))
|
res.send(require('../mocks/lessons/list/success.json'))
|
||||||
})
|
})
|
||||||
@ -49,7 +69,7 @@ router.delete('/lesson/:lessonId', (req, res) => {
|
|||||||
res.send({ success: true, body: { ok: true }})
|
res.send({ success: true, body: { ok: true }})
|
||||||
})
|
})
|
||||||
|
|
||||||
router.put('/lesson/:lessonId', (req, res) => {
|
router.put('/lesson', (req, res) => {
|
||||||
res.send({ success: true, body: req.body })
|
res.send({ success: true, body: req.body })
|
||||||
})
|
})
|
||||||
|
|
||||||
|
671
stubs/mocks/courses/by-id/success.json
Normal file
671
stubs/mocks/courses/by-id/success.json
Normal file
@ -0,0 +1,671 @@
|
|||||||
|
{
|
||||||
|
"success": true,
|
||||||
|
"body": {
|
||||||
|
"_id": "66cb6c8109bcc33fddd63ee3",
|
||||||
|
"name": "Курс по JS",
|
||||||
|
"teachers": [],
|
||||||
|
"lessons": [
|
||||||
|
{
|
||||||
|
"_id": "65e2e5fbec37fec650f28489",
|
||||||
|
"name": "ВВЕДЕНИЕ В ВЕБ-РАЗРАБОТКУ. ИНСТРУМЕНТАРИЙ, ОБЗОР ВЕБ-ТЕХНОЛОГИЙ",
|
||||||
|
"students": [
|
||||||
|
{
|
||||||
|
"sub": "fcde3f22-d9ba-412a-a572-c59e515a290f",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Мария Капитанова",
|
||||||
|
"preferred_username": "maryaKapitan@gmail.com",
|
||||||
|
"given_name": "Мария",
|
||||||
|
"family_name": "Капитанова",
|
||||||
|
"email": "maryaKapitan@gmail.com",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocJgIjjOFD2YUSyRF5kH4jaysE6X5p-kq0Cg0CFncfMi=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "5b072deb-33ee-443e-9718-3b5720a3dfb7",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Евгений Кореной",
|
||||||
|
"preferred_username": "koren@gmail.com",
|
||||||
|
"given_name": "Кореной",
|
||||||
|
"family_name": "Евгений",
|
||||||
|
"email": "koren@gmail.com",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocJpVhDeG-Rpjjm2Un6r8ACz_s_injuIFKpzXf3qmyCn3Cg=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "7adf0cd1-cf07-4079-88d8-1a5c9b8f42c2",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Ирина Игнатьева",
|
||||||
|
"preferred_username": "irign@gmailcom",
|
||||||
|
"given_name": "Ирина",
|
||||||
|
"family_name": "Игнатьева",
|
||||||
|
"email": "irign@gmailcom",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocL45E4Gt8D5oyIl3ipkcGsv4ShWGs3bdlwEMA_1rzGZ=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "95ccc005-95b9-4305-9447-364a32033911",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Иван Петров",
|
||||||
|
"preferred_username": "petrov@mail.ru",
|
||||||
|
"given_name": "Иван",
|
||||||
|
"family_name": "Петров",
|
||||||
|
"email": "petrov@mail.ru",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocIgQn5mfDAh2djx-3ofG9z1Em26ZyuUgVPd-6rDOl6z=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "ede1ef2c-6ecf-484a-8fb8-282a77e1caa1",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Константин Тимуров",
|
||||||
|
"preferred_username": "konstantK@gmail.com",
|
||||||
|
"given_name": "Константин",
|
||||||
|
"family_name": "Тимуров",
|
||||||
|
"email": "konstantK@gmail.com",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocJjnOfqaoAU_D4STrJPN9fPOeJ8tv60WbWVZu2ZWcHs=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "92cc6a15-805c-4439-b592-b23f32d6d208",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Александра Питерская",
|
||||||
|
"preferred_username": "piteralex@gmail.com",
|
||||||
|
"given_name": "Александра",
|
||||||
|
"family_name": "Питерская",
|
||||||
|
"email": "piteralex@gmail.com",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocKhbCbWvBBc_m7bjU5sLCE-dQ-KygBk-aUCSR8XaYtq=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "4a3ba8b8-4120-4877-a160-be9ba4d5b3e3",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Анастасия Светлых",
|
||||||
|
"preferred_username": "anastasya@gmail.ocm",
|
||||||
|
"given_name": "Анастасия",
|
||||||
|
"family_name": "Светлых",
|
||||||
|
"email": "anastasya@gmail.ocm",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocJnsM8UGhbH806yLVgWZ17g3-gJFVcG0Uz5kvqT7dvC=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "b4634921-00b3-4082-9284-8ac47f269394",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Эмилия Снежко",
|
||||||
|
"preferred_username": "emi@mail.ru",
|
||||||
|
"given_name": "Эмилия",
|
||||||
|
"family_name": "Снежко",
|
||||||
|
"email": "emi@mail.ru",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocI98dzSFQDPr2LXMPFEUX8KLY6bY2m08O_aAj2B5KVNKg=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "bf1a95aa-39a2-4528-9b8d-319409995df5",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Юлия Бобова",
|
||||||
|
"preferred_username": "bobova@gmail.com",
|
||||||
|
"given_name": "Юлия",
|
||||||
|
"family_name": "Бобова",
|
||||||
|
"email": "bobova@gmail.com",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocJ_Ud4iI-jgqcJ3QJcWpESbRLX_C1BnB8_7uTTC-4Dn=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "c273a3e3-f7ba-4057-8c57-a1f43b6174a5",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Анна Самоварова",
|
||||||
|
"preferred_username": "samovar@gmail.com",
|
||||||
|
"given_name": "Анна",
|
||||||
|
"family_name": "Самоварова",
|
||||||
|
"email": "samovar@gmail.com",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocJOhIMdQkXPd55wTMgTTkUCnqbsu4EncgEPm67iz_mK=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "8555885b-715c-4dee-a7c5-9563a6a05211",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Евгения Жужова",
|
||||||
|
"preferred_username": "zhuzhova@gmail.com",
|
||||||
|
"given_name": "Евгения",
|
||||||
|
"family_name": "Жужова",
|
||||||
|
"email": "zhuzhova@gmail.com",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocJUtJBAVBm642AxoGpMDDMV8CPu3MEoLjU3hmO7oisG=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "12dee54f-64e9-4be3-9cb0-02ff07ab24fe",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Эдгар Петренко",
|
||||||
|
"preferred_username": "petrenk@mail.ru",
|
||||||
|
"given_name": "Эдгар",
|
||||||
|
"family_name": "Петренко",
|
||||||
|
"email": "petrenk@mail.ru",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocLgKAZag32kpGVHMVbh_GsU-rX_MAtmeVIPoov0ZPBYIA=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "4082b72a-4730-4841-ad68-06a0e19263df",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Елена Вавилон",
|
||||||
|
"preferred_username": "elenvavil@mail.ru",
|
||||||
|
"given_name": "Елена",
|
||||||
|
"family_name": "Вавилон",
|
||||||
|
"email": "elenvavil@mail.ru",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocKXcmzcqRch2--j2Ge2m9e8MIOZ8y1MjsQ0cSEoXOmW=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "9e8a08d8-d76a-4f26-99c5-9a1d3c067104",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Ольга Шарова",
|
||||||
|
"preferred_username": "julyashap",
|
||||||
|
"given_name": "Ольга",
|
||||||
|
"family_name": "Шарова",
|
||||||
|
"email": "sharova@mail.ru"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"date": "2024-03-02T08:40:27.390Z",
|
||||||
|
"created": "2024-03-02T08:40:27.390Z",
|
||||||
|
"__v": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"_id": "65e301c4ec37fec650f2aafe",
|
||||||
|
"name": "НАСТРОЙКА ОКРУЖЕНИЯ (GIT + VSCODE + NODEJS)",
|
||||||
|
"students": [
|
||||||
|
{
|
||||||
|
"sub": "5b072deb-33ee-443e-9718-3b5720a3dfb7",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Евгений Кореной",
|
||||||
|
"preferred_username": "koren@gmail.com",
|
||||||
|
"given_name": "Кореной",
|
||||||
|
"family_name": "Евгений",
|
||||||
|
"email": "koren@gmail.com",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocJpVhDeG-Rpjjm2Un6r8ACz_s_injuIFKpzXf3qmyCn3Cg=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "7adf0cd1-cf07-4079-88d8-1a5c9b8f42c2",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Ирина Игнатьева",
|
||||||
|
"preferred_username": "irign@gmailcom",
|
||||||
|
"given_name": "Ирина",
|
||||||
|
"family_name": "Игнатьева",
|
||||||
|
"email": "irign@gmailcom",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocL45E4Gt8D5oyIl3ipkcGsv4ShWGs3bdlwEMA_1rzGZ=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "ede1ef2c-6ecf-484a-8fb8-282a77e1caa1",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Константин Тимуров",
|
||||||
|
"preferred_username": "konstantK@gmail.com",
|
||||||
|
"given_name": "Константин",
|
||||||
|
"family_name": "Тимуров",
|
||||||
|
"email": "konstantK@gmail.com",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocJjnOfqaoAU_D4STrJPN9fPOeJ8tv60WbWVZu2ZWcHs=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "92cc6a15-805c-4439-b592-b23f32d6d208",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Александра Питерская",
|
||||||
|
"preferred_username": "piteralex@gmail.com",
|
||||||
|
"given_name": "Александра",
|
||||||
|
"family_name": "Питерская",
|
||||||
|
"email": "piteralex@gmail.com",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocKhbCbWvBBc_m7bjU5sLCE-dQ-KygBk-aUCSR8XaYtq=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "b4634921-00b3-4082-9284-8ac47f269394",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Эмилия Снежко",
|
||||||
|
"preferred_username": "emi@mail.ru",
|
||||||
|
"given_name": "Эмилия",
|
||||||
|
"family_name": "Снежко",
|
||||||
|
"email": "emi@mail.ru",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocI98dzSFQDPr2LXMPFEUX8KLY6bY2m08O_aAj2B5KVNKg=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "bf1a95aa-39a2-4528-9b8d-319409995df5",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Юлия Бобова",
|
||||||
|
"preferred_username": "bobova@gmail.com",
|
||||||
|
"given_name": "Юлия",
|
||||||
|
"family_name": "Бобова",
|
||||||
|
"email": "bobova@gmail.com",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocJ_Ud4iI-jgqcJ3QJcWpESbRLX_C1BnB8_7uTTC-4Dn=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "c273a3e3-f7ba-4057-8c57-a1f43b6174a5",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Анна Самоварова",
|
||||||
|
"preferred_username": "samovar@gmail.com",
|
||||||
|
"given_name": "Анна",
|
||||||
|
"family_name": "Самоварова",
|
||||||
|
"email": "samovar@gmail.com",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocJOhIMdQkXPd55wTMgTTkUCnqbsu4EncgEPm67iz_mK=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "8555885b-715c-4dee-a7c5-9563a6a05211",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Евгения Жужова",
|
||||||
|
"preferred_username": "zhuzhova@gmail.com",
|
||||||
|
"given_name": "Евгения",
|
||||||
|
"family_name": "Жужова",
|
||||||
|
"email": "zhuzhova@gmail.com",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocJUtJBAVBm642AxoGpMDDMV8CPu3MEoLjU3hmO7oisG=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "4082b72a-4730-4841-ad68-06a0e19263df",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Елена Вавилон",
|
||||||
|
"preferred_username": "elenvavil@mail.ru",
|
||||||
|
"given_name": "Елена",
|
||||||
|
"family_name": "Вавилон",
|
||||||
|
"email": "elenvavil@mail.ru",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocKXcmzcqRch2--j2Ge2m9e8MIOZ8y1MjsQ0cSEoXOmW=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "9e8a08d8-d76a-4f26-99c5-9a1d3c067104",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Ольга Шарова",
|
||||||
|
"preferred_username": "julyashap",
|
||||||
|
"given_name": "Ольга",
|
||||||
|
"family_name": "Шарова",
|
||||||
|
"email": "sharova@mail.ru"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"date": "2024-03-02T10:39:00.718Z",
|
||||||
|
"created": "2024-03-02T10:39:00.718Z",
|
||||||
|
"__v": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"_id": "65e78bebced789d2f6791315",
|
||||||
|
"name": "ПРОЕКТИРОВАНИЕ ИНТЕРФЕЙСОВ (MIND MAP. FIGMA)",
|
||||||
|
"students": [
|
||||||
|
{
|
||||||
|
"sub": "fcde3f22-d9ba-412a-a572-c59e515a290f",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Мария Капитанова",
|
||||||
|
"preferred_username": "maryaKapitan@gmail.com",
|
||||||
|
"given_name": "Мария",
|
||||||
|
"family_name": "Капитанова",
|
||||||
|
"email": "maryaKapitan@gmail.com",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocJgIjjOFD2YUSyRF5kH4jaysE6X5p-kq0Cg0CFncfMi=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "5b072deb-33ee-443e-9718-3b5720a3dfb7",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Евгений Кореной",
|
||||||
|
"preferred_username": "koren@gmail.com",
|
||||||
|
"given_name": "Кореной",
|
||||||
|
"family_name": "Евгений",
|
||||||
|
"email": "koren@gmail.com",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocJpVhDeG-Rpjjm2Un6r8ACz_s_injuIFKpzXf3qmyCn3Cg=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "95ccc005-95b9-4305-9447-364a32033911",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Иван Петров",
|
||||||
|
"preferred_username": "petrov@mail.ru",
|
||||||
|
"given_name": "Иван",
|
||||||
|
"family_name": "Петров",
|
||||||
|
"email": "petrov@mail.ru",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocIgQn5mfDAh2djx-3ofG9z1Em26ZyuUgVPd-6rDOl6z=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "ede1ef2c-6ecf-484a-8fb8-282a77e1caa1",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Константин Тимуров",
|
||||||
|
"preferred_username": "konstantK@gmail.com",
|
||||||
|
"given_name": "Константин",
|
||||||
|
"family_name": "Тимуров",
|
||||||
|
"email": "konstantK@gmail.com",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocJjnOfqaoAU_D4STrJPN9fPOeJ8tv60WbWVZu2ZWcHs=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "92cc6a15-805c-4439-b592-b23f32d6d208",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Александра Питерская",
|
||||||
|
"preferred_username": "piteralex@gmail.com",
|
||||||
|
"given_name": "Александра",
|
||||||
|
"family_name": "Питерская",
|
||||||
|
"email": "piteralex@gmail.com",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocKhbCbWvBBc_m7bjU5sLCE-dQ-KygBk-aUCSR8XaYtq=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "b4634921-00b3-4082-9284-8ac47f269394",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Эмилия Снежко",
|
||||||
|
"preferred_username": "emi@mail.ru",
|
||||||
|
"given_name": "Эмилия",
|
||||||
|
"family_name": "Снежко",
|
||||||
|
"email": "emi@mail.ru",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocI98dzSFQDPr2LXMPFEUX8KLY6bY2m08O_aAj2B5KVNKg=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "bf1a95aa-39a2-4528-9b8d-319409995df5",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Юлия Бобова",
|
||||||
|
"preferred_username": "bobova@gmail.com",
|
||||||
|
"given_name": "Юлия",
|
||||||
|
"family_name": "Бобова",
|
||||||
|
"email": "bobova@gmail.com",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocJ_Ud4iI-jgqcJ3QJcWpESbRLX_C1BnB8_7uTTC-4Dn=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "c273a3e3-f7ba-4057-8c57-a1f43b6174a5",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Анна Самоварова",
|
||||||
|
"preferred_username": "samovar@gmail.com",
|
||||||
|
"given_name": "Анна",
|
||||||
|
"family_name": "Самоварова",
|
||||||
|
"email": "samovar@gmail.com",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocJOhIMdQkXPd55wTMgTTkUCnqbsu4EncgEPm67iz_mK=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "8555885b-715c-4dee-a7c5-9563a6a05211",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Евгения Жужова",
|
||||||
|
"preferred_username": "zhuzhova@gmail.com",
|
||||||
|
"given_name": "Евгения",
|
||||||
|
"family_name": "Жужова",
|
||||||
|
"email": "zhuzhova@gmail.com",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocJUtJBAVBm642AxoGpMDDMV8CPu3MEoLjU3hmO7oisG=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "12dee54f-64e9-4be3-9cb0-02ff07ab24fe",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Эдгар Петренко",
|
||||||
|
"preferred_username": "petrenk@mail.ru",
|
||||||
|
"given_name": "Эдгар",
|
||||||
|
"family_name": "Петренко",
|
||||||
|
"email": "petrenk@mail.ru",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocLgKAZag32kpGVHMVbh_GsU-rX_MAtmeVIPoov0ZPBYIA=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "4082b72a-4730-4841-ad68-06a0e19263df",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Елена Вавилон",
|
||||||
|
"preferred_username": "elenvavil@mail.ru",
|
||||||
|
"given_name": "Елена",
|
||||||
|
"family_name": "Вавилон",
|
||||||
|
"email": "elenvavil@mail.ru",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocKXcmzcqRch2--j2Ge2m9e8MIOZ8y1MjsQ0cSEoXOmW=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "9e8a08d8-d76a-4f26-99c5-9a1d3c067104",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Ольга Шарова",
|
||||||
|
"preferred_username": "julyashap",
|
||||||
|
"given_name": "Ольга",
|
||||||
|
"family_name": "Шарова",
|
||||||
|
"email": "sharova@mail.ru"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"date": "2024-03-08T21:17:31.401Z",
|
||||||
|
"created": "2024-03-05T21:17:31.401Z",
|
||||||
|
"__v": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"_id": "65e78c0fced789d2f679131b",
|
||||||
|
"name": "ТЕХНОЛОГИЯ HTML СТРУКТУРА ДОКУМЕНТА И ОСНОВНЫЕ ПОНЯТИЯ.",
|
||||||
|
"students": [
|
||||||
|
{
|
||||||
|
"sub": "fcde3f22-d9ba-412a-a572-c59e515a290f",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Мария Капитанова",
|
||||||
|
"preferred_username": "maryaKapitan@gmail.com",
|
||||||
|
"given_name": "Мария",
|
||||||
|
"family_name": "Капитанова",
|
||||||
|
"email": "maryaKapitan@gmail.com",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocJgIjjOFD2YUSyRF5kH4jaysE6X5p-kq0Cg0CFncfMi=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "b4634921-00b3-4082-9284-8ac47f269394",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Эмилия Снежко",
|
||||||
|
"preferred_username": "emi@mail.ru",
|
||||||
|
"given_name": "Эмилия",
|
||||||
|
"family_name": "Снежко",
|
||||||
|
"email": "emi@mail.ru",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocI98dzSFQDPr2LXMPFEUX8KLY6bY2m08O_aAj2B5KVNKg=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "bf1a95aa-39a2-4528-9b8d-319409995df5",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Юлия Бобова",
|
||||||
|
"preferred_username": "bobova@gmail.com",
|
||||||
|
"given_name": "Юлия",
|
||||||
|
"family_name": "Бобова",
|
||||||
|
"email": "bobova@gmail.com",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocJ_Ud4iI-jgqcJ3QJcWpESbRLX_C1BnB8_7uTTC-4Dn=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "c273a3e3-f7ba-4057-8c57-a1f43b6174a5",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Анна Самоварова",
|
||||||
|
"preferred_username": "samovar@gmail.com",
|
||||||
|
"given_name": "Анна",
|
||||||
|
"family_name": "Самоварова",
|
||||||
|
"email": "samovar@gmail.com",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocJOhIMdQkXPd55wTMgTTkUCnqbsu4EncgEPm67iz_mK=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "8555885b-715c-4dee-a7c5-9563a6a05211",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Евгения Жужова",
|
||||||
|
"preferred_username": "zhuzhova@gmail.com",
|
||||||
|
"given_name": "Евгения",
|
||||||
|
"family_name": "Жужова",
|
||||||
|
"email": "zhuzhova@gmail.com",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocJUtJBAVBm642AxoGpMDDMV8CPu3MEoLjU3hmO7oisG=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "12dee54f-64e9-4be3-9cb0-02ff07ab24fe",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Эдгар Петренко",
|
||||||
|
"preferred_username": "petrenk@mail.ru",
|
||||||
|
"given_name": "Эдгар",
|
||||||
|
"family_name": "Петренко",
|
||||||
|
"email": "petrenk@mail.ru",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocLgKAZag32kpGVHMVbh_GsU-rX_MAtmeVIPoov0ZPBYIA=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "4082b72a-4730-4841-ad68-06a0e19263df",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Елена Вавилон",
|
||||||
|
"preferred_username": "elenvavil@mail.ru",
|
||||||
|
"given_name": "Елена",
|
||||||
|
"family_name": "Вавилон",
|
||||||
|
"email": "elenvavil@mail.ru",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocKXcmzcqRch2--j2Ge2m9e8MIOZ8y1MjsQ0cSEoXOmW=s96-c"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"date": "2024-03-08T21:18:07.033Z",
|
||||||
|
"created": "2024-03-05T21:18:07.033Z",
|
||||||
|
"__v": 22
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"_id": "65e78c0fced789d2f6791tt5",
|
||||||
|
"name": "ВВОДНАЯ ПО JS.ПРИМЕНЕНИЕ И СПОСОБЫ ПОДКЛЮЧЕНИЯ НА СТРАНИЦЕ. LET, CONST. БАЗОВЫЕ ТИПЫ ДАННЫХ, ПРИВЕДЕНИЕ ТИПОВ. ПЕРЕМЕННЫЕ, ОБЛАСТЬ ВИДИМОСТИ ПЕРЕМЕННЫХ",
|
||||||
|
"students": [
|
||||||
|
{
|
||||||
|
"sub": "fcde3f22-d9ba-412a-a572-c59e515a290f",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Мария Капитанова",
|
||||||
|
"preferred_username": "maryaKapitan@gmail.com",
|
||||||
|
"given_name": "Мария",
|
||||||
|
"family_name": "Капитанова",
|
||||||
|
"email": "maryaKapitan@gmail.com",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocJgIjjOFD2YUSyRF5kH4jaysE6X5p-kq0Cg0CFncfMi=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "5b072deb-33ee-443e-9718-3b5720a3dfb7",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Евгений Кореной",
|
||||||
|
"preferred_username": "koren@gmail.com",
|
||||||
|
"given_name": "Кореной",
|
||||||
|
"family_name": "Евгений",
|
||||||
|
"email": "koren@gmail.com",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocJpVhDeG-Rpjjm2Un6r8ACz_s_injuIFKpzXf3qmyCn3Cg=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "7adf0cd1-cf07-4079-88d8-1a5c9b8f42c2",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Ирина Игнатьева",
|
||||||
|
"preferred_username": "irign@gmailcom",
|
||||||
|
"given_name": "Ирина",
|
||||||
|
"family_name": "Игнатьева",
|
||||||
|
"email": "irign@gmailcom",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocL45E4Gt8D5oyIl3ipkcGsv4ShWGs3bdlwEMA_1rzGZ=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "95ccc005-95b9-4305-9447-364a32033911",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Иван Петров",
|
||||||
|
"preferred_username": "petrov@mail.ru",
|
||||||
|
"given_name": "Иван",
|
||||||
|
"family_name": "Петров",
|
||||||
|
"email": "petrov@mail.ru",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocIgQn5mfDAh2djx-3ofG9z1Em26ZyuUgVPd-6rDOl6z=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "ede1ef2c-6ecf-484a-8fb8-282a77e1caa1",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Константин Тимуров",
|
||||||
|
"preferred_username": "konstantK@gmail.com",
|
||||||
|
"given_name": "Константин",
|
||||||
|
"family_name": "Тимуров",
|
||||||
|
"email": "konstantK@gmail.com",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocJjnOfqaoAU_D4STrJPN9fPOeJ8tv60WbWVZu2ZWcHs=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "92cc6a15-805c-4439-b592-b23f32d6d208",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Александра Питерская",
|
||||||
|
"preferred_username": "piteralex@gmail.com",
|
||||||
|
"given_name": "Александра",
|
||||||
|
"family_name": "Питерская",
|
||||||
|
"email": "piteralex@gmail.com",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocKhbCbWvBBc_m7bjU5sLCE-dQ-KygBk-aUCSR8XaYtq=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "4a3ba8b8-4120-4877-a160-be9ba4d5b3e3",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Анастасия Светлых",
|
||||||
|
"preferred_username": "anastasya@gmail.ocm",
|
||||||
|
"given_name": "Анастасия",
|
||||||
|
"family_name": "Светлых",
|
||||||
|
"email": "anastasya@gmail.ocm",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocJnsM8UGhbH806yLVgWZ17g3-gJFVcG0Uz5kvqT7dvC=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "b4634921-00b3-4082-9284-8ac47f269394",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Эмилия Снежко",
|
||||||
|
"preferred_username": "emi@mail.ru",
|
||||||
|
"given_name": "Эмилия",
|
||||||
|
"family_name": "Снежко",
|
||||||
|
"email": "emi@mail.ru",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocI98dzSFQDPr2LXMPFEUX8KLY6bY2m08O_aAj2B5KVNKg=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "bf1a95aa-39a2-4528-9b8d-319409995df5",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Юлия Бобова",
|
||||||
|
"preferred_username": "bobova@gmail.com",
|
||||||
|
"given_name": "Юлия",
|
||||||
|
"family_name": "Бобова",
|
||||||
|
"email": "bobova@gmail.com",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocJ_Ud4iI-jgqcJ3QJcWpESbRLX_C1BnB8_7uTTC-4Dn=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "4082b72a-4730-4841-ad68-06a0e19263df",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Елена Вавилон",
|
||||||
|
"preferred_username": "elenvavil@mail.ru",
|
||||||
|
"given_name": "Елена",
|
||||||
|
"family_name": "Вавилон",
|
||||||
|
"email": "elenvavil@mail.ru",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocKXcmzcqRch2--j2Ge2m9e8MIOZ8y1MjsQ0cSEoXOmW=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "9e8a08d8-d76a-4f26-99c5-9a1d3c067104",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Ольга Шарова",
|
||||||
|
"preferred_username": "julyashap",
|
||||||
|
"given_name": "Ольга",
|
||||||
|
"family_name": "Шарова",
|
||||||
|
"email": "sharova@mail.ru"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"date": "2024-03-08T21:18:07.033Z",
|
||||||
|
"created": "2024-03-05T21:18:07.033Z"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"creator": {
|
||||||
|
"sub": "developer",
|
||||||
|
"email": "email@email.ml"
|
||||||
|
},
|
||||||
|
"startDt": "2024-08-25T17:40:17.814Z",
|
||||||
|
"created": "2024-08-25T17:40:17.814Z",
|
||||||
|
"examWithJury2": {
|
||||||
|
"_id": "66cf3d3f4637d420d6271451",
|
||||||
|
"name": "Хакатон",
|
||||||
|
"description": "Сегодня командам предстоит Защитить свои проекты а жюри оценить по критериям",
|
||||||
|
"jury": [],
|
||||||
|
"date": "2024-08-28T15:07:43.927Z",
|
||||||
|
"created": "2024-08-28T15:07:43.927Z",
|
||||||
|
"criterias": [
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"title": "Соответствие решения поставленной задаче",
|
||||||
|
"type": "number",
|
||||||
|
"min": 0,
|
||||||
|
"max": 5,
|
||||||
|
"wight": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Оригинальность - использование нестандартных технических и проектных подходов к решению задачи",
|
||||||
|
"type": "number",
|
||||||
|
"min": 0,
|
||||||
|
"max": 5,
|
||||||
|
"wight": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Характеристики решения",
|
||||||
|
"subcriterias": [
|
||||||
|
{
|
||||||
|
"title": "Работоспособность решения",
|
||||||
|
"type": "boolean",
|
||||||
|
"wight": 1,
|
||||||
|
"trueText": "Работоспособно",
|
||||||
|
"falseText": "Не работоспособно"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Технологическая сложность решения",
|
||||||
|
"type": "number",
|
||||||
|
"wight": 1,
|
||||||
|
"min": 0,
|
||||||
|
"max": 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Объем функциональных возможностей решения (количество и качество реализации функций)",
|
||||||
|
"type": "number",
|
||||||
|
"wight": 1,
|
||||||
|
"min": 0,
|
||||||
|
"max": 2
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Аргументация способа выбранного решения",
|
||||||
|
"type": "number",
|
||||||
|
"min": 0,
|
||||||
|
"max": 5,
|
||||||
|
"wight": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Качество предоставления информации",
|
||||||
|
"type": "number",
|
||||||
|
"min": 0,
|
||||||
|
"max": 5,
|
||||||
|
"wight": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Наличие удобного UX/UI",
|
||||||
|
"type": "number",
|
||||||
|
"min": 0,
|
||||||
|
"max": 5,
|
||||||
|
"wight": 1
|
||||||
|
}
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"id": "66cf3d3f4637d420d6271451"
|
||||||
|
},
|
||||||
|
"id": "66cb6c8109bcc33fddd63ee3"
|
||||||
|
}
|
||||||
|
}
|
94
stubs/mocks/courses/by-id/with-exam.json
Normal file
94
stubs/mocks/courses/by-id/with-exam.json
Normal 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"
|
||||||
|
}
|
||||||
|
}
|
@ -2,7 +2,7 @@
|
|||||||
"success": true,
|
"success": true,
|
||||||
"body": [
|
"body": [
|
||||||
{
|
{
|
||||||
"_id": "65e73c21ced789d2f679128f",
|
"id": "65e73c21ced789d2f679128f",
|
||||||
"name": "KFU-24-1",
|
"name": "KFU-24-1",
|
||||||
"teachers": [],
|
"teachers": [],
|
||||||
"lessons": [
|
"lessons": [
|
||||||
@ -21,11 +21,11 @@
|
|||||||
"email": "primakovpro@gmail.com"
|
"email": "primakovpro@gmail.com"
|
||||||
},
|
},
|
||||||
"startDt": "2024-03-02T15:37:05.907Z",
|
"startDt": "2024-03-02T15:37:05.907Z",
|
||||||
"created": "2024-03-02T15:37:05.908Z",
|
"examWithJury": "66cf3d3f4637d420d6271451",
|
||||||
"__v": 2
|
"created": "2024-03-02T15:37:05.908Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"_id": "65e73c21ced789d2f679128z",
|
"id": "65e73c21ced789d2f679128z",
|
||||||
"name": "KFU-24-2",
|
"name": "KFU-24-2",
|
||||||
"teachers": [],
|
"teachers": [],
|
||||||
"lessons": [
|
"lessons": [
|
||||||
|
@ -17,7 +17,145 @@
|
|||||||
"given_name": "Александр",
|
"given_name": "Александр",
|
||||||
"family_name": "Примаков",
|
"family_name": "Примаков",
|
||||||
"email": "primakovpro@gmail.com"
|
"email": "primakovpro@gmail.com"
|
||||||
}
|
},{
|
||||||
|
"sub": "fcde3f22-d9ba-412a-a572-c59e515a290f",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Мария Капитанова",
|
||||||
|
"preferred_username": "maryaKapitan@gmail.com",
|
||||||
|
"given_name": "Мария",
|
||||||
|
"family_name": "Капитанова",
|
||||||
|
"email": "maryaKapitan@gmail.com",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocJgIjjOFD2YUSyRF5kH4jaysE6X5p-kq0Cg0CFncfMi=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "5b072deb-33ee-443e-9718-3b5720a3dfb7",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Евгений Кореной",
|
||||||
|
"preferred_username": "koren@gmail.com",
|
||||||
|
"given_name": "Кореной",
|
||||||
|
"family_name": "Евгений",
|
||||||
|
"email": "koren@gmail.com",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocJpVhDeG-Rpjjm2Un6r8ACz_s_injuIFKpzXf3qmyCn3Cg=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "7adf0cd1-cf07-4079-88d8-1a5c9b8f42c2",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Ирина Игнатьева",
|
||||||
|
"preferred_username": "irign@gmailcom",
|
||||||
|
"given_name": "Ирина",
|
||||||
|
"family_name": "Игнатьева",
|
||||||
|
"email": "irign@gmailcom",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocL45E4Gt8D5oyIl3ipkcGsv4ShWGs3bdlwEMA_1rzGZ=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "95ccc005-95b9-4305-9447-364a32033911",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Иван Петров",
|
||||||
|
"preferred_username": "petrov@mail.ru",
|
||||||
|
"given_name": "Иван",
|
||||||
|
"family_name": "Петров",
|
||||||
|
"email": "petrov@mail.ru",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocIgQn5mfDAh2djx-3ofG9z1Em26ZyuUgVPd-6rDOl6z=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "ede1ef2c-6ecf-484a-8fb8-282a77e1caa1",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Константин Тимуров",
|
||||||
|
"preferred_username": "konstantK@gmail.com",
|
||||||
|
"given_name": "Константин",
|
||||||
|
"family_name": "Тимуров",
|
||||||
|
"email": "konstantK@gmail.com",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocJjnOfqaoAU_D4STrJPN9fPOeJ8tv60WbWVZu2ZWcHs=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "92cc6a15-805c-4439-b592-b23f32d6d208",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Александра Питерская",
|
||||||
|
"preferred_username": "piteralex@gmail.com",
|
||||||
|
"given_name": "Александра",
|
||||||
|
"family_name": "Питерская",
|
||||||
|
"email": "piteralex@gmail.com",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocKhbCbWvBBc_m7bjU5sLCE-dQ-KygBk-aUCSR8XaYtq=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "4a3ba8b8-4120-4877-a160-be9ba4d5b3e3",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Анастасия Светлых",
|
||||||
|
"preferred_username": "anastasya@gmail.ocm",
|
||||||
|
"given_name": "Анастасия",
|
||||||
|
"family_name": "Светлых",
|
||||||
|
"email": "anastasya@gmail.ocm",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocJnsM8UGhbH806yLVgWZ17g3-gJFVcG0Uz5kvqT7dvC=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "b4634921-00b3-4082-9284-8ac47f269394",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Эмилия Снежко",
|
||||||
|
"preferred_username": "emi@mail.ru",
|
||||||
|
"given_name": "Эмилия",
|
||||||
|
"family_name": "Снежко",
|
||||||
|
"email": "emi@mail.ru",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocI98dzSFQDPr2LXMPFEUX8KLY6bY2m08O_aAj2B5KVNKg=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "bf1a95aa-39a2-4528-9b8d-319409995df5",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Юлия Бобова",
|
||||||
|
"preferred_username": "bobova@gmail.com",
|
||||||
|
"given_name": "Юлия",
|
||||||
|
"family_name": "Бобова",
|
||||||
|
"email": "bobova@gmail.com",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocJ_Ud4iI-jgqcJ3QJcWpESbRLX_C1BnB8_7uTTC-4Dn=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "c273a3e3-f7ba-4057-8c57-a1f43b6174a5",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Анна Самоварова",
|
||||||
|
"preferred_username": "samovar@gmail.com",
|
||||||
|
"given_name": "Анна",
|
||||||
|
"family_name": "Самоварова",
|
||||||
|
"email": "samovar@gmail.com",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocJOhIMdQkXPd55wTMgTTkUCnqbsu4EncgEPm67iz_mK=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "8555885b-715c-4dee-a7c5-9563a6a05211",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Евгения Жужова",
|
||||||
|
"preferred_username": "zhuzhova@gmail.com",
|
||||||
|
"given_name": "Евгения",
|
||||||
|
"family_name": "Жужова",
|
||||||
|
"email": "zhuzhova@gmail.com",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocJUtJBAVBm642AxoGpMDDMV8CPu3MEoLjU3hmO7oisG=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "12dee54f-64e9-4be3-9cb0-02ff07ab24fe",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Эдгар Петренко",
|
||||||
|
"preferred_username": "petrenk@mail.ru",
|
||||||
|
"given_name": "Эдгар",
|
||||||
|
"family_name": "Петренко",
|
||||||
|
"email": "petrenk@mail.ru",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocLgKAZag32kpGVHMVbh_GsU-rX_MAtmeVIPoov0ZPBYIA=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "4082b72a-4730-4841-ad68-06a0e19263df",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Елена Вавилон",
|
||||||
|
"preferred_username": "elenvavil@mail.ru",
|
||||||
|
"given_name": "Елена",
|
||||||
|
"family_name": "Вавилон",
|
||||||
|
"email": "elenvavil@mail.ru",
|
||||||
|
"picture": "https://lh3.googleusercontent.com/a/ACg8ocKXcmzcqRch2--j2Ge2m9e8MIOZ8y1MjsQ0cSEoXOmW=s96-c"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sub": "9e8a08d8-d76a-4f26-99c5-9a1d3c067104",
|
||||||
|
"email_verified": true,
|
||||||
|
"name": "Ольга Шарова",
|
||||||
|
"preferred_username": "julyashap",
|
||||||
|
"given_name": "Ольга",
|
||||||
|
"family_name": "Шарова",
|
||||||
|
"email": "sharova@mail.ru"
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"date": "2024-02-28T20:37:00.057Z",
|
"date": "2024-02-28T20:37:00.057Z",
|
||||||
"created": "2024-02-28T20:37:00.057Z",
|
"created": "2024-02-28T20:37:00.057Z",
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user