From 77433ebb7cea1aff7d999e08de4d2f56f5734557 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Wed, 12 Jun 2024 11:44:14 +0530 Subject: [PATCH] fix: better validation message on course creation --- frontend/src/components/Controls/IconPicker.vue | 7 +------ frontend/src/pages/CreateCourse.vue | 2 +- .../lms_certificate_request/lms_certificate_request.js | 2 +- lms/public/frontend/index.html | 6 +++--- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/frontend/src/components/Controls/IconPicker.vue b/frontend/src/components/Controls/IconPicker.vue index 6d1297c7..9efdc006 100644 --- a/frontend/src/components/Controls/IconPicker.vue +++ b/frontend/src/components/Controls/IconPicker.vue @@ -60,7 +60,7 @@ const iconQuery = ref('') const selectedIcon = ref('') const search = ref(null) const emit = defineEmits(['update:modelValue', 'change']) -console.log(icons) + const iconArray = ref( Object.keys(icons) .sort(() => 0.5 - Math.random()) @@ -84,7 +84,6 @@ const props = defineProps({ onMounted(() => { selectedIcon.value = props.modelValue - console.log(search.value) }) const setIcon = (icon, close) => { @@ -111,9 +110,5 @@ const filteredIcons = computed(() => { const openPopover = (togglePopover) => { togglePopover() - nextTick(() => { - /* search.value.focus() */ - console.log(search.value.children) - }) } diff --git a/frontend/src/pages/CreateCourse.vue b/frontend/src/pages/CreateCourse.vue index ae5caddb..d7cadc14 100644 --- a/frontend/src/pages/CreateCourse.vue +++ b/frontend/src/pages/CreateCourse.vue @@ -377,7 +377,7 @@ const submitCourse = () => { }) }, onError(err) { - showToast(err) + showToast('Error', err.messages?.[0] || err, 'x') }, }) } diff --git a/lms/lms/doctype/lms_certificate_request/lms_certificate_request.js b/lms/lms/doctype/lms_certificate_request/lms_certificate_request.js index 65ed42db..f221d0c0 100644 --- a/lms/lms/doctype/lms_certificate_request/lms_certificate_request.js +++ b/lms/lms/doctype/lms_certificate_request/lms_certificate_request.js @@ -14,7 +14,7 @@ frappe.ui.form.on("LMS Certificate Request", { } ); } - if (!frm.google_meet_link) { + if (!frm.doc.google_meet_link) { frm.add_custom_button(__("Generate Google Meet Link"), () => { frappe.call({ method: "lms.lms.doctype.lms_certificate_request.lms_certificate_request.setup_calendar_event", diff --git a/lms/public/frontend/index.html b/lms/public/frontend/index.html index 1385335c..752a899c 100644 --- a/lms/public/frontend/index.html +++ b/lms/public/frontend/index.html @@ -15,10 +15,10 @@ - - + + - +