Don't include course.allow_edit_tool_visibility_in_session setting in home.json controller data - refs BT#21219

pull/5059/head
Angel Fernando Quiroz Campos 11 months ago
parent 7292c4e250
commit 5c4b50e054
  1. 5
      assets/vue/views/course/CourseHome.vue
  2. 3
      src/CoreBundle/Controller/CourseController.php
  3. 1
      src/CoreBundle/Controller/PlatformConfigurationController.php

@ -225,12 +225,15 @@ import { useCidReqStore } from "../../store/cidReq"
import {storeToRefs} from "pinia";
import courseService from "../../services/courseService";
import CourseIntroduction from "../../components/course/CourseIntroduction.vue";
import { usePlatformConfig } from "../../store/platformConfig"
const store = useStore()
const { t } = useI18n()
const cidReqStore = useCidReqStore()
const platformConfigStore = usePlatformConfig()
const { course, session } = storeToRefs(cidReqStore)
const { getSetting } = storeToRefs(platformConfigStore)
const tools = ref([])
const shortcuts = ref([])
@ -387,6 +390,6 @@ const allowEditToolVisibilityInSession = computed(() => {
return true;
}
return tools.value.some(tool => tool.isInASession && tool.allowEditToolVisibilityInSession);
return tools.value.some(tool => tool.isInASession && getSetting.value('course.allow_edit_tool_visibility_in_session'));
});
</script>

@ -134,7 +134,6 @@ class CourseController extends ToolBaseController
CShortcutRepository $shortcutRepository,
ToolChain $toolChain,
EntityManagerInterface $em,
SettingsManager $settingsManager
): Response {
$requestData = json_decode($request->getContent(), true);
// Sort behaviour
@ -218,7 +217,6 @@ class CourseController extends ToolBaseController
$isAdmin = ($user->hasRole('ROLE_SUPER_ADMIN') || $user->hasRole('ROLE_ADMIN'));
$isCourseTeacher = ($user->hasRole('ROLE_CURRENT_COURSE_TEACHER') || $user->hasRole('ROLE_CURRENT_COURSE_SESSION_TEACHER'));
$currentSessionId = (int) $sessionId;
$allowEditToolVisibilityInSession = ('true' === $settingsManager->getSetting('course.allow_edit_tool_visibility_in_session'));
/** @var CTool $item */
foreach ($result as $item) {
@ -266,7 +264,6 @@ class CourseController extends ToolBaseController
'tool' => $toolModel,
'url' => $this->generateToolUrl($toolModel),
'category' => $toolModel->getCategory(),
'allowEditToolVisibilityInSession' => $allowEditToolVisibilityInSession,
'isInASession' => $isInASession,
];
}

@ -69,6 +69,7 @@ class PlatformConfigurationController extends AbstractController
'course.course_validation',
'course.student_view_enabled',
'course.allow_edit_tool_visibility_in_session',
'session.limit_session_admin_role',
'session.allow_session_admin_read_careers',

Loading…
Cancel
Save