Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c1311f351c | ||
|
|
c2fe846c5b | ||
|
|
81533c3342 | ||
|
|
462ba85fe8 | ||
|
|
d0f7dfb87d |
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "journal.pl",
|
"name": "journal.pl",
|
||||||
"version": "3.6.6",
|
"version": "3.6.8",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "journal.pl",
|
"name": "journal.pl",
|
||||||
"version": "3.6.6",
|
"version": "3.6.8",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@brojs/cli": "^1.8.4",
|
"@brojs/cli": "^1.8.4",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "journal.pl",
|
"name": "journal.pl",
|
||||||
"version": "3.6.6",
|
"version": "3.6.8",
|
||||||
"description": "bro-js platform journal ui repo",
|
"description": "bro-js platform journal ui repo",
|
||||||
"main": "./src/index.tsx",
|
"main": "./src/index.tsx",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ let rootElement: ReactDOM.Root
|
|||||||
export const mount = async (Component, element = document.getElementById('app')) => {
|
export const mount = async (Component, element = document.getElementById('app')) => {
|
||||||
let user = null;
|
let user = null;
|
||||||
try {
|
try {
|
||||||
await keycloak.init({ onLoad: 'check-sso' }) // 'login-required' });
|
await keycloak.init({ onLoad: 'login-required' })
|
||||||
|
|
||||||
const userInfo = await keycloak.loadUserInfo()
|
const userInfo = await keycloak.loadUserInfo()
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@ export const mount = async (Component, element = document.getElementById('app'))
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Failed to initialize adapter:', error)
|
console.error('Failed to initialize adapter:', error)
|
||||||
// keycloak.login()
|
keycloak.login()
|
||||||
}
|
}
|
||||||
const store = createStore({ user });
|
const store = createStore({ user });
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
import { Link as ConnectedLink } from 'react-router-dom'
|
import { Link as ConnectedLink } from 'react-router-dom'
|
||||||
import { getNavigationsValue, getHistory } from '@brojs/cli'
|
import { getNavigationValue, getHistory } from '@brojs/cli'
|
||||||
import { Stack, Heading, Link, Button, Tooltip, Box } from '@chakra-ui/react'
|
import { Stack, Heading, Link, Button, Tooltip, Box } from '@chakra-ui/react'
|
||||||
|
|
||||||
import { useAppSelector } from '../../__data__/store'
|
import { useAppSelector } from '../../__data__/store'
|
||||||
@@ -27,23 +27,23 @@ export const CourseDetails = ({ populatedCourse }: CourseDetailsProps) => {
|
|||||||
{isTeacher(user) && (
|
{isTeacher(user) && (
|
||||||
<Heading as="h3" mt={4} mb={3} size="lg">
|
<Heading as="h3" mt={4} mb={3} size="lg">
|
||||||
Экзамен: {exam?.name}{' '}
|
Экзамен: {exam?.name}{' '}
|
||||||
{exam && (
|
{exam && getNavigationValue('exam.main') && getNavigationValue('link.exam.details') && (
|
||||||
<Tooltip label="Начать экзамен" fontSize="12px" top="16px">
|
<Tooltip label="Начать экзамен" fontSize="12px" top="16px">
|
||||||
<Button
|
<Button
|
||||||
leftIcon={<LinkIcon />}
|
leftIcon={<LinkIcon />}
|
||||||
as={'a'}
|
as={'a'}
|
||||||
colorScheme="blue"
|
colorScheme="blue"
|
||||||
href={
|
href={
|
||||||
getNavigationsValue('exam.main') +
|
getNavigationValue('exam.main') +
|
||||||
getNavigationsValue('link.exam.details')
|
getNavigationValue('link.exam.details')
|
||||||
.replace(':courseId', populatedCourse.id)
|
.replace(':courseId', populatedCourse.id)
|
||||||
.replace(':examId', exam.id)
|
.replace(':examId', exam.id)
|
||||||
}
|
}
|
||||||
onClick={(event) => {
|
onClick={(event) => {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
history.push(
|
history.push(
|
||||||
getNavigationsValue('exam.main') +
|
getNavigationValue('exam.main') +
|
||||||
getNavigationsValue('link.exam.details')
|
getNavigationValue('link.exam.details')
|
||||||
.replace(':courseId', populatedCourse.id)
|
.replace(':courseId', populatedCourse.id)
|
||||||
.replace(':examId', exam.id),
|
.replace(':examId', exam.id),
|
||||||
)
|
)
|
||||||
@@ -95,7 +95,7 @@ export const CourseDetails = ({ populatedCourse }: CourseDetailsProps) => {
|
|||||||
key={lesson.id}
|
key={lesson.id}
|
||||||
to={
|
to={
|
||||||
isTeacher(user)
|
isTeacher(user)
|
||||||
? `${getNavigationsValue('journal.main')}/lesson/${populatedCourse.id}/${lesson.id}`
|
? `${getNavigationValue('journal.main')}/lesson/${populatedCourse.id}/${lesson.id}`
|
||||||
: ''
|
: ''
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user