diff --git a/.github/workflows/ui-tests.yml b/.github/workflows/ui-tests.yml index d59e5acc..b9aa4614 100644 --- a/.github/workflows/ui-tests.yml +++ b/.github/workflows/ui-tests.yml @@ -100,6 +100,11 @@ jobs: bench --site lms.test execute frappe.utils.install.complete_setup_wizard bench --site lms.test execute frappe.tests.ui_test_helpers.create_test_user + - name: cypress pre-requisites + run: | + cd ~/frappe-bench/apps/lms + yarn add cypress@^10 --no-lockfile + - name: UI Tests run: cd ~/frappe-bench/ && bench --site lms.test run-ui-tests lms --headless env: diff --git a/lms/public/css/style.css b/lms/public/css/style.css index ed90ef3f..ca8cacf0 100644 --- a/lms/public/css/style.css +++ b/lms/public/css/style.css @@ -819,7 +819,7 @@ input[type=checkbox] { } .lesson-pagination { - margin: 2rem 0; + margin: 2rem 0 5rem; } .lesson-video { diff --git a/lms/public/js/common_functions.js b/lms/public/js/common_functions.js index 62ad81f3..2eeb43ae 100644 --- a/lms/public/js/common_functions.js +++ b/lms/public/js/common_functions.js @@ -1,7 +1,6 @@ frappe.ready(() => { setup_file_size(); pin_header(); - setup_router(); $(".join-batch").click((e) => { join_course(e); @@ -43,14 +42,6 @@ frappe.ready(() => { }); }); -const setup_router = () => { - frappe.router = { - slug(name) { - return name.toLowerCase().replace(/ /g, "-"); - }, - }; -}; - const pin_header = () => { const el = document.querySelector(".sticky"); if (el) { diff --git a/lms/public/js/website.bundle.js b/lms/public/js/website.bundle.js index d5a2c398..1e86a794 100644 --- a/lms/public/js/website.bundle.js +++ b/lms/public/js/website.bundle.js @@ -2,3 +2,4 @@ import "./profile.js"; import "./common_functions.js"; import "../../../../frappe/frappe/public/js/frappe/ui/chart.js"; import "../../../../frappe/frappe/public/js/frappe/ui/keyboard.js"; +import "../../../../frappe/frappe/public/js/frappe/event_emitter.js"; diff --git a/lms/templates/lms_base.html b/lms/templates/lms_base.html index 73728239..311053d0 100644 --- a/lms/templates/lms_base.html +++ b/lms/templates/lms_base.html @@ -18,5 +18,14 @@ Object.assign(frappe.boot, telemetry_boot_info) {% endif %} - {{ include_script("telemetry.bundle.js") }} + + {{ include_script("telemetry.bundle.js") }} + {%- endblock -%} \ No newline at end of file diff --git a/lms/www/batch/edit.html b/lms/www/batch/edit.html index 44454396..6fa88e22 100644 --- a/lms/www/batch/edit.html +++ b/lms/www/batch/edit.html @@ -115,12 +115,6 @@ "can_select": ["LMS Quiz"], "can_read": ["LMS Quiz"] }; - - frappe.router = { - slug (name) { - return name.toLowerCase().replace(/ /g, "-"); - } - } {% endif %} {{ include_script('controls.bundle.js') }} diff --git a/lms/www/classes/class.html b/lms/www/classes/class.html index 75506e93..84b34ed1 100644 --- a/lms/www/classes/class.html +++ b/lms/www/classes/class.html @@ -486,11 +486,6 @@ frappe.boot.single_types = [] - frappe.router = { - slug (name) { - return name.toLowerCase().replace(/ /g, "-"); - } - } let class_info = {{ class_info | json }}; {% endif %} diff --git a/lms/www/classes/index.html b/lms/www/classes/index.html index fed9ac46..081c8b09 100644 --- a/lms/www/classes/index.html +++ b/lms/www/classes/index.html @@ -157,12 +157,6 @@ "can_select": ["LMS Category"], "can_read": ["LMS Category"] }; - - frappe.router = { - slug (name) { - return name.toLowerCase().replace(/ /g, "-"); - } - } let class_info = null; {% endif %} diff --git a/lms/www/classes/progress.py b/lms/www/classes/progress.py index eef9cbee..d273162c 100644 --- a/lms/www/classes/progress.py +++ b/lms/www/classes/progress.py @@ -36,7 +36,7 @@ def get_context(context): context.assessments = get_assessments(class_name, context.student.name) upcoming_evals = frappe.get_all( - "LMS certificate Request", + "LMS Certificate Request", { "member": context.student.name, "course": ["in", context.courses], diff --git a/package.json b/package.json index 7f3e41ff..efae27f8 100644 --- a/package.json +++ b/package.json @@ -14,17 +14,5 @@ "bugs": { "url": "https://github.com/frappe/lms/issues" }, - "homepage": "https://github.com/frappe/lms#readme", - "devDependencies": { - "cypress": "^10" - }, - "dependencies": { - "@4tw/cypress-drag-drop": "^2", - "@cypress/code-coverage": "^3", - "@editorjs/header": "^2.7.0", - "@editorjs/list": "^1.8.0", - "@testing-library/cypress": "^8", - "@testing-library/dom": "8.17.1", - "cypress-real-events": "^1.7.6" - } + "homepage": "https://github.com/frappe/lms#readme" }