3 Commits

Author SHA1 Message Date
Primakov Alexandr Alexandrovich
81533c3342 3.6.7 2025-01-08 18:33:10 +03:00
Primakov Alexandr Alexandrovich
462ba85fe8 check exam link to render 2025-01-08 18:33:02 +03:00
Primakov Alexandr Alexandrovich
d0f7dfb87d login required back
All checks were successful
platform/bro-js/journal.pl/pipeline/head This commit looks good
2025-01-07 18:09:54 +03:00
4 changed files with 11 additions and 11 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "journal.pl",
"version": "3.6.6",
"version": "3.6.7",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "journal.pl",
"version": "3.6.6",
"version": "3.6.7",
"license": "MIT",
"dependencies": {
"@brojs/cli": "^1.8.4",

View File

@@ -1,6 +1,6 @@
{
"name": "journal.pl",
"version": "3.6.6",
"version": "3.6.7",
"description": "bro-js platform journal ui repo",
"main": "./src/index.tsx",
"scripts": {

View File

@@ -17,7 +17,7 @@ let rootElement: ReactDOM.Root
export const mount = async (Component, element = document.getElementById('app')) => {
let user = null;
try {
await keycloak.init({ onLoad: 'check-sso' }) // 'login-required' });
await keycloak.init({ onLoad: 'login-required' })
const userInfo = await keycloak.loadUserInfo()
@@ -28,7 +28,7 @@ export const mount = async (Component, element = document.getElementById('app'))
}
} catch (error) {
console.error('Failed to initialize adapter:', error)
// keycloak.login()
keycloak.login()
}
const store = createStore({ user });

View File

@@ -1,7 +1,7 @@
import React from 'react'
import dayjs from 'dayjs'
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 { useAppSelector } from '../../__data__/store'
@@ -27,23 +27,23 @@ export const CourseDetails = ({ populatedCourse }: CourseDetailsProps) => {
{isTeacher(user) && (
<Heading as="h3" mt={4} mb={3} size="lg">
Экзамен: {exam?.name}{' '}
{exam && (
{exam && getNavigationValue('exam.main') && getNavigationValue('link.exam.details') && (
<Tooltip label="Начать экзамен" fontSize="12px" top="16px">
<Button
leftIcon={<LinkIcon />}
as={'a'}
colorScheme="blue"
href={
getNavigationsValue('exam.main') +
getNavigationsValue('link.exam.details')
getNavigationValue('exam.main') +
getNavigationValue('link.exam.details')
.replace(':courseId', populatedCourse.id)
.replace(':examId', exam.id)
}
onClick={(event) => {
event.preventDefault()
history.push(
getNavigationsValue('exam.main') +
getNavigationsValue('link.exam.details')
getNavigationValue('exam.main') +
getNavigationValue('link.exam.details')
.replace(':courseId', populatedCourse.id)
.replace(':examId', exam.id),
)