From b8981c249fad4b02275275d44878b70fabfadb69 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Wed, 25 Jun 2025 19:57:07 +0530 Subject: [PATCH] feat: livecode settings --- .github/helper/install_dependencies.sh | 2 +- frontend/src/components/Settings/Settings.vue | 6 +++ .../ProgrammingExerciseSubmission.vue | 53 ++++++++++++++----- .../ProgrammingExercises.vue | 46 ++++++++++------ frontend/src/stores/session.js | 11 ++++ frontend/src/utils/index.js | 9 ++-- 6 files changed, 92 insertions(+), 35 deletions(-) diff --git a/.github/helper/install_dependencies.sh b/.github/helper/install_dependencies.sh index beb0cd34..17786a03 100644 --- a/.github/helper/install_dependencies.sh +++ b/.github/helper/install_dependencies.sh @@ -5,7 +5,7 @@ echo "Setting Up System Dependencies..." sudo apt update sudo apt remove mysql-server mysql-client -sudo apt-get install libcups2-dev redis-server mariadb-client +sudo apt-get install libcups2-dev redis-server mariadb-client libmariadb-dev install_wkhtmltopdf() { wget -q https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb diff --git a/frontend/src/components/Settings/Settings.vue b/frontend/src/components/Settings/Settings.vue index e06e8755..c5f19408 100644 --- a/frontend/src/components/Settings/Settings.vue +++ b/frontend/src/components/Settings/Settings.vue @@ -166,6 +166,12 @@ const tabsStructure = computed(() => { doctype: 'Email Template', type: 'Link', }, + { + label: 'Livecode URL', + name: 'livecode_url', + doctype: 'Livecode URL', + type: 'text', + }, { label: 'Unsplash Access Key', name: 'unsplash_access_key', diff --git a/frontend/src/pages/ProgrammingExercises/ProgrammingExerciseSubmission.vue b/frontend/src/pages/ProgrammingExercises/ProgrammingExerciseSubmission.vue index 8c232371..e9434ee8 100644 --- a/frontend/src/pages/ProgrammingExercises/ProgrammingExerciseSubmission.vue +++ b/frontend/src/pages/ProgrammingExercises/ProgrammingExerciseSubmission.vue @@ -5,6 +5,20 @@ > +
+ + {{ falconError }} + + +
@@ -29,7 +43,9 @@ +
+ + + + +
@@ -89,7 +103,7 @@ import { createListResource, usePageMeta, } from 'frappe-ui' -import { Plus } from 'lucide-vue-next' +import { ClipboardList, Plus } from 'lucide-vue-next' import { sessionStore } from '@/stores/session' import { useRouter } from 'vue-router' import ProgrammingExerciseForm from '@/pages/ProgrammingExercises/ProgrammingExerciseForm.vue' diff --git a/frontend/src/stores/session.js b/frontend/src/stores/session.js index 487252e8..c78ae9af 100644 --- a/frontend/src/stores/session.js +++ b/frontend/src/stores/session.js @@ -60,6 +60,16 @@ export const sessionStore = defineStore('lms-session', () => { auto: false, }) + const livecodeURL = createResource({ + url: 'frappe.client.get_single_value', + params: { + doctype: 'LMS Settings', + field: 'livecode_url', + }, + cache: 'livecodeURL', + auto: true, + }) + return { user, isLoggedIn, @@ -68,5 +78,6 @@ export const sessionStore = defineStore('lms-session', () => { brand, branding, sidebarSettings, + livecodeURL, } }) diff --git a/frontend/src/utils/index.js b/frontend/src/utils/index.js index b40beaa9..bc15d7ef 100644 --- a/frontend/src/utils/index.js +++ b/frontend/src/utils/index.js @@ -578,16 +578,17 @@ export const enablePlyr = () => { }) } -export const openSettings = (category, close) => { +export const openSettings = (category, close = null) => { const settingsStore = useSettings() - close() + if (close) { + close() + } settingsStore.activeTab = category settingsStore.isSettingsOpen = true + console.log(settingsStore.activeTab, settingsStore.isSettingsOpen) } export const cleanError = (message) => { - // Remove HTML tags but keep the text within the tags - const cleanMessage = message.replace(/<[^>]+>/g, (match) => { return match.replace(/<\/?[^>]+(>|$)/g, '') })