Добавлено новое поле 'courses.statistics' в конфигурацию и обновлен компонент CoursesList для использования этой функции. Теперь статистика курсов отображается только при включенной функции.

This commit is contained in:
Primakov Alexandr Alexandrovich 2025-03-23 20:10:43 +03:00
parent 32b0e004ca
commit 57341c90bb
2 changed files with 11 additions and 1 deletions

View File

@ -39,6 +39,11 @@ module.exports = {
value: '',
key: 'course.statistics',
},
'courses.statistics': {
on: true,
value: '',
key: 'courses.statistics',
},
},
},
config: {

View File

@ -9,6 +9,7 @@ import {
} from '@chakra-ui/react'
import { AddIcon } from '@chakra-ui/icons'
import { useTranslation } from 'react-i18next'
import { getFeatures } from '@brojs/cli'
import { useAppSelector } from '../../__data__/store'
import { api } from '../../__data__/api/api'
@ -28,6 +29,10 @@ export const CoursesList = () => {
const { t } = useTranslation()
const { colorMode } = useColorMode()
// Получаем значения фичей
const features = getFeatures('journal')
const coursesStatistics = features?.['courses.statistics']
// Создаем API запросы для получения уроков
const [getLessons] = api.useLazyLessonListQuery()
@ -99,7 +104,7 @@ export const CoursesList = () => {
</Box>
)}
{!showForm && (
{!showForm && coursesStatistics && (
<CoursesOverview
courses={courses}
isLoading={isLoading}