chore: analytics
This commit is contained in:
@@ -236,6 +236,7 @@ import MultiSelect from '@/components/Controls/MultiSelect.vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { getFileSize, showToast } from '../utils'
|
||||
import { X, FileText } from 'lucide-vue-next'
|
||||
import { capture } from "@/telemetry"
|
||||
|
||||
const router = useRouter()
|
||||
const user = inject('$user')
|
||||
@@ -274,6 +275,8 @@ onMounted(() => {
|
||||
if (!user.data) window.location.href = '/login'
|
||||
if (props.batchName != 'new') {
|
||||
batchDetail.reload()
|
||||
} else {
|
||||
capture("batch_form_opened")
|
||||
}
|
||||
window.addEventListener('keydown', keyboardShortcut)
|
||||
})
|
||||
@@ -377,6 +380,7 @@ const createNewBatch = () => {
|
||||
{},
|
||||
{
|
||||
onSuccess(data) {
|
||||
capture("batch_created")
|
||||
router.push({
|
||||
name: 'BatchDetail',
|
||||
params: {
|
||||
@@ -447,7 +451,7 @@ const breadcrumbs = computed(() => {
|
||||
}
|
||||
crumbs.push({
|
||||
label: props.batchName == 'new' ? 'New Batch' : 'Edit Batch',
|
||||
route: { name: 'BatchCreation', params: { batchName: props.batchName } },
|
||||
route: { name: 'BatchForm', params: { batchName: props.batchName } },
|
||||
})
|
||||
return crumbs
|
||||
})
|
||||
@@ -19,7 +19,7 @@
|
||||
<router-link
|
||||
v-if="user.data?.is_moderator"
|
||||
:to="{
|
||||
name: 'BatchCreation',
|
||||
name: 'BatchForm',
|
||||
params: { batchName: 'new' },
|
||||
}"
|
||||
>
|
||||
|
||||
@@ -227,6 +227,7 @@ import { FileText, X } from 'lucide-vue-next'
|
||||
import { useRouter } from 'vue-router'
|
||||
import CourseOutline from '@/components/CourseOutline.vue'
|
||||
import MultiSelect from '@/components/Controls/MultiSelect.vue'
|
||||
import { capture } from "@/telemetry";
|
||||
|
||||
const user = inject('$user')
|
||||
const newTag = ref('')
|
||||
@@ -268,6 +269,8 @@ onMounted(() => {
|
||||
|
||||
if (props.courseName !== 'new') {
|
||||
courseResource.reload()
|
||||
} else {
|
||||
capture("course_form_opened")
|
||||
}
|
||||
window.addEventListener('keydown', keyboardShortcut)
|
||||
})
|
||||
@@ -388,9 +391,10 @@ const submitCourse = () => {
|
||||
} else {
|
||||
courseCreationResource.submit(course, {
|
||||
onSuccess(data) {
|
||||
capture("course_created")
|
||||
showToast('Success', 'Course created successfully', 'check')
|
||||
router.push({
|
||||
name: 'CreateCourse',
|
||||
name: 'CourseForm',
|
||||
params: { courseName: data.name },
|
||||
})
|
||||
},
|
||||
@@ -489,7 +493,7 @@ const breadcrumbs = computed(() => {
|
||||
}
|
||||
crumbs.push({
|
||||
label: props.courseName == 'new' ? 'New Course' : 'Edit Course',
|
||||
route: { name: 'CreateCourse', params: { courseName: props.courseName } },
|
||||
route: { name: 'CourseForm', params: { courseName: props.courseName } },
|
||||
})
|
||||
return crumbs
|
||||
})
|
||||
@@ -22,7 +22,7 @@
|
||||
</div>
|
||||
<router-link
|
||||
:to="{
|
||||
name: 'CreateCourse',
|
||||
name: 'CourseForm',
|
||||
params: {
|
||||
courseName: 'new',
|
||||
},
|
||||
|
||||
@@ -82,6 +82,7 @@ import EditorJS from '@editorjs/editorjs'
|
||||
import LessonPlugins from '@/components/LessonPlugins.vue'
|
||||
import { ChevronRight } from 'lucide-vue-next'
|
||||
import { updateDocumentTitle, createToast, getEditorTools } from '@/utils'
|
||||
import { capture } from '@/telemetry'
|
||||
|
||||
const editor = ref(null)
|
||||
const instructorEditor = ref(null)
|
||||
@@ -108,6 +109,7 @@ onMounted(() => {
|
||||
if (!user.data?.is_moderator && !user.data?.is_instructor) {
|
||||
window.location.href = '/login'
|
||||
}
|
||||
capture('lesson_form_opened')
|
||||
editor.value = renderEditor('content')
|
||||
instructorEditor.value = renderEditor('instructor-notes')
|
||||
})
|
||||
@@ -360,6 +362,7 @@ const createNewLesson = () => {
|
||||
{ lesson: data.name },
|
||||
{
|
||||
onSuccess() {
|
||||
capture('lesson_created')
|
||||
showToast('Success', 'Lesson created successfully', 'check')
|
||||
lessonDetails.reload()
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user