diff --git a/frontend/src/pages/Courses/CourseForm.vue b/frontend/src/pages/Courses/CourseForm.vue index 4c172e93..34041fad 100644 --- a/frontend/src/pages/Courses/CourseForm.vue +++ b/frontend/src/pages/Courses/CourseForm.vue @@ -136,11 +136,13 @@ :description="__('Highlight the course on the homepage.')" @change="makeFormDirty()" /> - @@ -338,6 +340,7 @@ import { toast, } from 'frappe-ui' import { + computed, inject, onMounted, onBeforeUnmount, @@ -374,6 +377,14 @@ const app = getCurrentInstance() const { $dialog } = app.appContext.config.globalProperties const isDirty = ref(false) const showMemberModal = ref(false) + +const selfEnrollment = computed({ + get: () => !courseResource.doc?.disable_self_learning, + set: (val) => { + courseResource.doc.disable_self_learning = !val + makeFormDirty() + }, +}) const evaluatorLinkRef = ref(null) const memberModalRoles = ref(['course_creator'])