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 5c4b50e054
commit 76f645e08a
  1. 10
      assets/vue/components/course/CourseTool.vue
  2. 12
      assets/vue/views/course/CourseHome.vue
  3. 1
      src/CoreBundle/Controller/CourseController.php

@ -47,7 +47,7 @@
<div class="course-tool__options">
<button
v-if="(securityStore.isCourseAdmin) && !isSorting && !isCustomizing && (props.tool.isInASession ? props.tool.allowEditToolVisibilityInSession : true)"
v-if="(securityStore.isCourseAdmin) && !isSorting && !isCustomizing && (session?.id ? 'true' === getSetting('course.allow_edit_tool_visibility_in_session') : true)"
@click="changeVisibility(tool)"
>
<BaseIcon
@ -88,8 +88,16 @@
import { computed, inject } from "vue"
import BaseIcon from "../basecomponents/BaseIcon.vue"
import {useSecurityStore} from "../../store/securityStore";
import { usePlatformConfig } from "../../store/platformConfig"
import { storeToRefs } from "pinia"
import { useCidReqStore } from "../../store/cidReq"
const securityStore = useSecurityStore()
const platformConfigStore = usePlatformConfig()
const cidReqStore = useCidReqStore()
const { session } = storeToRefs(cidReqStore)
const { getSetting } = storeToRefs(platformConfigStore)
const isSorting = inject("isSorting")
const isCustomizing = inject("isCustomizing")

@ -384,12 +384,10 @@ const onStudentViewChanged = async () => {
}
const allowEditToolVisibilityInSession = computed(() => {
const isInASession = tools.value.some(tool => tool.isInASession);
const isInASession = session.value?.id
if (!isInASession) {
return true;
}
return tools.value.some(tool => tool.isInASession && getSetting.value('course.allow_edit_tool_visibility_in_session'));
});
return isInASession
? "true" === getSetting.value("course.allow_edit_tool_visibility_in_session")
: true
})
</script>

@ -264,7 +264,6 @@ class CourseController extends ToolBaseController
'tool' => $toolModel,
'url' => $this->generateToolUrl($toolModel),
'category' => $toolModel->getCategory(),
'isInASession' => $isInASession,
];
}
}

Loading…
Cancel
Save