From ecc12d783a89b99baf1babd32e05d6ada6c7a1bf Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Thu, 9 Jan 2025 17:07:57 +0530 Subject: [PATCH] fix: list and table formatting in lesson --- frontend/src/pages/Batches.vue | 2 +- frontend/src/pages/Lesson.vue | 7 ++++++- frontend/src/pages/LessonForm.vue | 4 ++++ frontend/src/stores/settings.js | 6 ++++-- frontend/src/utils/index.js | 6 +++++- 5 files changed, 20 insertions(+), 5 deletions(-) diff --git a/frontend/src/pages/Batches.vue b/frontend/src/pages/Batches.vue index 335ae216..935ddbf0 100644 --- a/frontend/src/pages/Batches.vue +++ b/frontend/src/pages/Batches.vue @@ -163,7 +163,7 @@ onMounted(() => { const batches = createResource({ doctype: 'LMS Batch', url: 'lms.lms.utils.get_batches', - cache: ['batches', user.data?.email], + cache: ['batches', user.data?.email || ''], auto: true, }) diff --git a/frontend/src/pages/Lesson.vue b/frontend/src/pages/Lesson.vue index dfa3a578..5dd10149 100644 --- a/frontend/src/pages/Lesson.vue +++ b/frontend/src/pages/Lesson.vue @@ -475,7 +475,8 @@ updateDocumentTitle(pageMeta) font-weight: 500; } -.embed-tool__caption { +.embed-tool__caption, +.cdx-simple-image__caption { display: none; } @@ -585,4 +586,8 @@ iframe { border-top: 3px solid theme('colors.gray.700'); border-bottom: 3px solid theme('colors.gray.700'); } + +.tc-table { + border-left: 1px solid #e8e8eb; +} diff --git a/frontend/src/pages/LessonForm.vue b/frontend/src/pages/LessonForm.vue index 7ef014b9..f3f687fa 100644 --- a/frontend/src/pages/LessonForm.vue +++ b/frontend/src/pages/LessonForm.vue @@ -619,4 +619,8 @@ iframe { border-top: 3px solid theme('colors.gray.700'); border-bottom: 3px solid theme('colors.gray.700'); } + +.tc-table { + border-left: 1px solid #e8e8eb; +} diff --git a/frontend/src/stores/settings.js b/frontend/src/stores/settings.js index 9aea8476..18401057 100644 --- a/frontend/src/stores/settings.js +++ b/frontend/src/stores/settings.js @@ -1,8 +1,10 @@ import { defineStore } from 'pinia' import { ref } from 'vue' import { createResource } from 'frappe-ui' +import { sessionStore } from './session' export const useSettings = defineStore('settings', () => { + const { isLoggedIn } = sessionStore() const isSettingsOpen = ref(false) const activeTab = ref(null) const learningPaths = createResource({ @@ -13,13 +15,13 @@ export const useSettings = defineStore('settings', () => { field: 'enable_learning_paths', } }, - auto: true, + auto: isLoggedIn ? true : false, cache: ['learningPaths'], }) const onboardingDetails = createResource({ url: 'lms.lms.utils.is_onboarding_complete', - auto: true, + auto: isLoggedIn ? true : false, cache: ['onboardingDetails'], }) diff --git a/frontend/src/utils/index.js b/frontend/src/utils/index.js index 7e99aee1..9a006266 100644 --- a/frontend/src/utils/index.js +++ b/frontend/src/utils/index.js @@ -160,7 +160,10 @@ export function getEditorTools() { upload: Upload, markdown: Markdown, image: SimpleImage, - table: Table, + table: { + class: Table, + inlineToolbar: true, + }, paragraph: { class: Paragraph, inlineToolbar: true, @@ -179,6 +182,7 @@ export function getEditorTools() { }, list: { class: NestedList, + inlineToolbar: true, config: { defaultStyle: 'ordered', },