Добавлено новое поле 'courses.statistics' в конфигурацию и обновлен компонент CoursesList для использования этой функции. Теперь статистика курсов отображается только при включенной функции.
This commit is contained in:
parent
32b0e004ca
commit
57341c90bb
@ -39,6 +39,11 @@ module.exports = {
|
||||
value: '',
|
||||
key: 'course.statistics',
|
||||
},
|
||||
'courses.statistics': {
|
||||
on: true,
|
||||
value: '',
|
||||
key: 'courses.statistics',
|
||||
},
|
||||
},
|
||||
},
|
||||
config: {
|
||||
|
@ -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}
|
||||
|
Loading…
x
Reference in New Issue
Block a user