diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 58f9e185..916d3cf6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,9 +38,9 @@ jobs: - name: Set Branch run: | - export APPS_JSON='[{"url": "https://github.com/frappe/lms","branch": "main"}]' + export APPS_JSON='[{"url": "https://github.com/frappe/payments","branch": "version-15"},{"url": "https://github.com/frappe/lms","branch": "main"}]' echo "APPS_JSON_BASE64=$(echo $APPS_JSON | base64 -w 0)" >> $GITHUB_ENV - echo "FRAPPE_BRANCH=version-15" >> $GITHUB_ENV + echo "FRAPPE_BRANCH=version-16" >> $GITHUB_ENV - name: Set Image Tag run: | @@ -61,4 +61,4 @@ jobs: ghcr.io/${{ github.repository }}:${{ env.IMAGE_TAG }} build-args: | "FRAPPE_BRANCH=${{ env.FRAPPE_BRANCH }}" - "APPS_JSON_BASE64=${{ env.APPS_JSON_BASE64 }}" \ No newline at end of file + "APPS_JSON_BASE64=${{ env.APPS_JSON_BASE64 }}" diff --git a/codecov.yml b/codecov.yml index 4f6dfa59..fa61467a 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,2 +1,9 @@ +coverage: + status: + project: + default: + target: auto + threshold: 1% + ignore: - "**/test_helper.py" \ No newline at end of file diff --git a/cypress/e2e/course_creation.cy.js b/cypress/e2e/course_creation.cy.js index 8a8e0f2d..8d9f577c 100644 --- a/cypress/e2e/course_creation.cy.js +++ b/cypress/e2e/course_creation.cy.js @@ -176,7 +176,10 @@ describe("Course Creation", () => { cy.get("div").contains("Test Course").click(); cy.get("button").contains("Settings").click(); cy.get("header").within(() => { - cy.get("svg.lucide.lucide-trash2-icon").click(); + cy.get("svg.lucide.lucide-ellipsis-icon").click(); + }); + cy.get("div[role=menu]").within(() => { + cy.get("span").contains("Delete").click(); }); cy.get("span").contains("Delete").click(); cy.wait(500); diff --git a/docker/init.sh b/docker/init.sh index ed74f101..edba3170 100644 --- a/docker/init.sh +++ b/docker/init.sh @@ -24,6 +24,7 @@ bench set-redis-socketio-host redis://redis:6379 sed -i '/redis/d' ./Procfile sed -i '/watch/d' ./Procfile +bench get-app payments bench get-app lms bench new-site lms.localhost \ @@ -32,6 +33,7 @@ bench new-site lms.localhost \ --admin-password admin \ --no-mariadb-socket +bench --site lms.localhost install-app payments bench --site lms.localhost install-app lms bench --site lms.localhost set-config developer_mode 1 bench --site lms.localhost clear-cache diff --git a/frontend/index.html b/frontend/index.html index 8be6cd37..a2dabf7e 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -1,237 +1,231 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{ title }} - - - - - - - - - - - - -
-
-

{{ meta.title }}

-

{{ meta.description }}

- Know More -
-
- - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ title | e }} + + + + + + + + + + + + +
+
+

{{ meta.title | e }}

+

+ {{ meta.description | e }} +

+ Know More +
+
+ + + diff --git a/frontend/src/components/Assignment.vue b/frontend/src/components/Assignment.vue index b0be62e5..595e6898 100644 --- a/frontend/src/components/Assignment.vue +++ b/frontend/src/components/Assignment.vue @@ -17,7 +17,7 @@
- {{ __('Assignment Question') }} + {{ __('Assignment') }}: {{ assignment.data.title }}
{ } } -const addNewSubmission = () => { +const prepareSubmissionDoc = () => { let doc = { doctype: 'LMS Assignment Submission', assignment: props.assignmentID, @@ -311,24 +311,31 @@ const addNewSubmission = () => { } else { doc.assignment_attachment = attachment.value } + return doc +} + +const addNewSubmission = () => { + let doc = prepareSubmissionDoc() + if (!doc.assignment_attachment && !doc.answer) { + toast.error( + __('Please provide an answer or upload a file before submitting.') + ) + return + } call('frappe.client.insert', { doc: doc, }) .then((data) => { toast.success(__('Assignment submitted successfully')) - if (router.currentRoute.value.name == 'AssignmentSubmission') { - router.push({ - name: 'AssignmentSubmission', - params: { - assignmentID: props.assignmentID, - submissionName: data.name, - }, - query: { fromLesson: router.currentRoute.value.query.fromLesson }, - }) - } else { - markLessonProgress() - router.go() - } + router.push({ + name: 'AssignmentSubmission', + params: { + assignmentID: props.assignmentID, + submissionName: data.name, + }, + query: { fromLesson: router.currentRoute.value.query.fromLesson }, + }) + markLessonProgress() isDirty.value = false submissionResource.name = data.name submissionResource.reload() @@ -372,15 +379,17 @@ const saveSubmission = (file) => { } const markLessonProgress = () => { - if (router.currentRoute.value.name == 'Lesson') { - let courseName = router.currentRoute.value.params.courseName - let chapterNumber = router.currentRoute.value.params.chapterNumber - let lessonNumber = router.currentRoute.value.params.lessonNumber + let pathname = window.location.pathname.split('/') + if (!pathname.includes('courses')) + pathname = window.parent.location.pathname.split('/') + if (pathname[2] != 'courses') return + let lessonIndex = pathname.pop().split('-') + if (lessonIndex.length == 2) { call('lms.lms.api.mark_lesson_progress', { - course: courseName, - chapter_number: chapterNumber, - lesson_number: lessonNumber, + course: pathname[3], + chapter_number: lessonIndex[0], + lesson_number: lessonIndex[1], }) } } diff --git a/frontend/src/components/CourseCard.vue b/frontend/src/components/CourseCard.vue index b2d37b95..70499c04 100644 --- a/frontend/src/components/CourseCard.vue +++ b/frontend/src/components/CourseCard.vue @@ -1,7 +1,7 @@