From b6577133a9f815af046837c019b5e65d793044ad Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Mon, 14 Apr 2025 22:28:06 +0530 Subject: [PATCH] fix: misc issues --- .../src/components/Modals/ChapterModal.vue | 2 +- frontend/src/pages/BatchForm.vue | 204 ++++++++++-------- frontend/src/stores/session.js | 3 +- frontend/src/utils/index.js | 2 +- lms/hooks.py | 2 +- lms/lms/doctype/lms_batch/lms_batch.py | 7 +- lms/lms/doctype/lms_course/lms_course.py | 7 +- lms/lms/doctype/lms_settings/lms_settings.js | 9 +- 8 files changed, 130 insertions(+), 106 deletions(-) diff --git a/frontend/src/components/Modals/ChapterModal.vue b/frontend/src/components/Modals/ChapterModal.vue index 377248bc..7d3a340b 100644 --- a/frontend/src/components/Modals/ChapterModal.vue +++ b/frontend/src/components/Modals/ChapterModal.vue @@ -38,7 +38,7 @@
diff --git a/frontend/src/pages/BatchForm.vue b/frontend/src/pages/BatchForm.vue index 52471cb1..ec023752 100644 --- a/frontend/src/pages/BatchForm.vue +++ b/frontend/src/pages/BatchForm.vue @@ -8,98 +8,109 @@ {{ __('Save') }} -
+
{{ __('Details') }}
-
- -
+
+
- -
-
-
-
-
- {{ __('Meta Image') }} -
- - - -
-
- -
- -
- {{ - __( - 'Appears when the batch URL is shared on any online platform' - ) - }} -
-
-
{{ __('Date and Time') }}
-
+
-
+
+ +
@@ -147,7 +160,7 @@
{{ __('Settings') }}
-
+
-
+
+ +
@@ -198,17 +213,16 @@
{{ __('Payment') }}
-
- + +
{ }) }, onError(err) { - showToast('Error', err.messages?.[0] || err, 'x') + showToast('Message', err.messages?.[0] || err, 'alert-circle') }, } ) @@ -464,7 +478,7 @@ const editBatchDetails = () => { }) }, onError(err) { - showToast('Error', err.messages?.[0] || err, 'x') + showToast('Message', err.messages?.[0] || err, 'alert-circle') }, } ) diff --git a/frontend/src/stores/session.js b/frontend/src/stores/session.js index 46beff48..487252e8 100644 --- a/frontend/src/stores/session.js +++ b/frontend/src/stores/session.js @@ -50,8 +50,7 @@ export const sessionStore = defineStore('lms-session', () => { brand.name = data.app_name brand.logo = data.app_logo brand.favicon = - data.favicon?.file_url || - '/assets/lms/frontend/public/learning.svg' + data.favicon?.file_url || '/assets/lms/frontend/learning.svg' }, }) diff --git a/frontend/src/utils/index.js b/frontend/src/utils/index.js index f4dede57..edce83cb 100644 --- a/frontend/src/utils/index.js +++ b/frontend/src/utils/index.js @@ -109,7 +109,7 @@ export function showToast(title, text, icon, iconClasses = null) { icon: icon, iconClasses: iconClasses, position: icon == 'check' ? 'bottom-right' : 'top-center', - timeout: 5, + timeout: icon != 'check' ? 10 : 5, }) } diff --git a/lms/hooks.py b/lms/hooks.py index cc35c6de..c4017649 100644 --- a/lms/hooks.py +++ b/lms/hooks.py @@ -246,7 +246,7 @@ on_login = "lms.lms.user.on_login" add_to_apps_screen = [ { "name": "lms", - "logo": "/assets/lms/images/lms-logo.png", + "logo": "/assets/lms/frontend/learning.svg", "title": "Learning", "route": "/lms", "has_permission": "lms.lms.api.check_app_permission", diff --git a/lms/lms/doctype/lms_batch/lms_batch.py b/lms/lms/doctype/lms_batch/lms_batch.py index 10f7afa0..02c2b04b 100644 --- a/lms/lms/doctype/lms_batch/lms_batch.py +++ b/lms/lms/doctype/lms_batch/lms_batch.py @@ -53,7 +53,12 @@ class LMSBatch(Document): if self.paid_batch: installed_apps = frappe.get_installed_apps() if "payments" not in installed_apps: - frappe.throw(_("Please install the Payments app to create a paid batches.")) + documentation_link = "https://docs.frappe.io/learning/setting-up-payment-gateway" + frappe.throw( + _( + "Please install the Payments App to create a paid batches. Refer to the documentation for more details. {0}" + ).format(documentation_link) + ) def validate_amount_and_currency(self): if self.paid_batch and (not self.amount or not self.currency): diff --git a/lms/lms/doctype/lms_course/lms_course.py b/lms/lms/doctype/lms_course/lms_course.py index 73c796bb..b05f8e38 100644 --- a/lms/lms/doctype/lms_course/lms_course.py +++ b/lms/lms/doctype/lms_course/lms_course.py @@ -50,7 +50,12 @@ class LMSCourse(Document): if self.paid_course: installed_apps = frappe.get_installed_apps() if "payments" not in installed_apps: - frappe.throw(_("Please install the Payments app to create a paid courses.")) + documentation_link = "https://docs.frappe.io/learning/setting-up-payment-gateway" + frappe.throw( + _( + "Please install the Payments App to create a paid course. Refer to the documentation for more details. {0}" + ).format(documentation_link) + ) def validate_certification(self): if self.enable_certification and self.paid_certificate: diff --git a/lms/lms/doctype/lms_settings/lms_settings.js b/lms/lms/doctype/lms_settings/lms_settings.js index c0c9ac82..9f2f39da 100644 --- a/lms/lms/doctype/lms_settings/lms_settings.js +++ b/lms/lms/doctype/lms_settings/lms_settings.js @@ -20,10 +20,11 @@ frappe.ui.form.on("LMS Settings", { frm.get_field("payments_app_is_not_installed").html(`
Please install the - - Payments app - - to enable payment gateway. + Payments app + to enable payment gateway. Refer to the + Documentation + for more information. +
`); }, });