Merge pull request #1460 from pateljannat/issues-95
fix: improved lesson locked state
This commit is contained in:
@@ -194,11 +194,6 @@ const userDropdownOptions = computed(() => {
|
|||||||
)
|
)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
group: '',
|
|
||||||
items: [
|
|
||||||
{
|
{
|
||||||
icon: LogOut,
|
icon: LogOut,
|
||||||
label: 'Log out',
|
label: 'Log out',
|
||||||
|
|||||||
@@ -171,17 +171,10 @@ const isPersonaCaptured = async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const identifyUserPersona = async () => {
|
const identifyUserPersona = async () => {
|
||||||
let personaCaptured = await isPersonaCaptured()
|
if (user.data?.is_system_manager && !user.data?.developer_mode) {
|
||||||
debugger
|
let personaCaptured = await isPersonaCaptured()
|
||||||
console.log('personaCaptured', personaCaptured)
|
if (personaCaptured) return
|
||||||
console.log('user.data?.is_system_manager', user.data?.is_system_manager)
|
|
||||||
console.log('user.data?.developer_mode', user.data?.developer_mode)
|
|
||||||
|
|
||||||
if (
|
|
||||||
user.data?.is_system_manager &&
|
|
||||||
!user.data?.developer_mode &&
|
|
||||||
!personaCaptured
|
|
||||||
) {
|
|
||||||
call('frappe.client.get_count', {
|
call('frappe.client.get_count', {
|
||||||
doctype: 'LMS Course',
|
doctype: 'LMS Course',
|
||||||
}).then((data) => {
|
}).then((data) => {
|
||||||
|
|||||||
@@ -7,24 +7,33 @@
|
|||||||
<CertificationLinks :courseName="courseName" />
|
<CertificationLinks :courseName="courseName" />
|
||||||
</header>
|
</header>
|
||||||
<div class="grid md:grid-cols-[70%,30%] h-screen">
|
<div class="grid md:grid-cols-[70%,30%] h-screen">
|
||||||
<div
|
<div v-if="lesson.data.no_preview" class="border-r">
|
||||||
v-if="lesson.data.no_preview"
|
<div class="shadow rounded-md w-3/4 mt-10 mx-auto text-center p-4">
|
||||||
class="border-r text-center pt-10 px-5 md:px-0 pb-10"
|
<div class="flex items-center justify-center mt-4 space-x-2">
|
||||||
>
|
<LockKeyholeIcon class="size-4 stroke-2 text-ink-gray-5" />
|
||||||
<p class="mb-4">
|
<div class="text-lg font-semibold text-ink-gray-7">
|
||||||
{{
|
{{ __('This lesson is locked') }}
|
||||||
__(
|
</div>
|
||||||
'This lesson is not available for preview. Please enroll in the course to access it.'
|
</div>
|
||||||
)
|
<div class="mt-1 mb-4 text-ink-gray-7">
|
||||||
}}
|
{{
|
||||||
</p>
|
__(
|
||||||
<Button v-if="user.data" @click="enrollStudent()" variant="solid">
|
'This lesson is not available for preview. Please enroll in the course to access it.'
|
||||||
{{ __('Start Learning') }}
|
)
|
||||||
</Button>
|
}}
|
||||||
<Button v-else @click="redirectToLogin()">
|
</div>
|
||||||
{{ __('Login') }}
|
<Button v-if="user.data" @click="enrollStudent()" variant="solid">
|
||||||
</Button>
|
{{ __('Start Learning') }}
|
||||||
|
</Button>
|
||||||
|
<Button v-else @click="redirectToLogin()">
|
||||||
|
<template #prefix>
|
||||||
|
<LogIn class="w-4 h-4 stroke-1" />
|
||||||
|
</template>
|
||||||
|
{{ __('Login') }}
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-else class="border-r container pt-5 pb-10 px-5">
|
<div v-else class="border-r container pt-5 pb-10 px-5">
|
||||||
<div class="flex flex-col md:flex-row md:items-center justify-between">
|
<div class="flex flex-col md:flex-row md:items-center justify-between">
|
||||||
<div class="text-3xl font-semibold text-ink-gray-9">
|
<div class="text-3xl font-semibold text-ink-gray-9">
|
||||||
@@ -198,7 +207,12 @@ import { computed, watch, inject, ref, onMounted, onBeforeUnmount } from 'vue'
|
|||||||
import CourseOutline from '@/components/CourseOutline.vue'
|
import CourseOutline from '@/components/CourseOutline.vue'
|
||||||
import UserAvatar from '@/components/UserAvatar.vue'
|
import UserAvatar from '@/components/UserAvatar.vue'
|
||||||
import { useRouter, useRoute } from 'vue-router'
|
import { useRouter, useRoute } from 'vue-router'
|
||||||
import { ChevronLeft, ChevronRight, GraduationCap } from 'lucide-vue-next'
|
import {
|
||||||
|
ChevronLeft,
|
||||||
|
ChevronRight,
|
||||||
|
LockKeyholeIcon,
|
||||||
|
LogIn,
|
||||||
|
} from 'lucide-vue-next'
|
||||||
import Discussions from '@/components/Discussions.vue'
|
import Discussions from '@/components/Discussions.vue'
|
||||||
import { getEditorTools } from '../utils'
|
import { getEditorTools } from '../utils'
|
||||||
import { sessionStore } from '@/stores/session'
|
import { sessionStore } from '@/stores/session'
|
||||||
|
|||||||
Reference in New Issue
Block a user