diff --git a/.gitignore b/.gitignore index 95242ce7..e6c74964 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,5 @@ node_modules package-lock.json lms/public/frontend lms/www/lms.html +lms/www/_lms.html frappe-ui \ No newline at end of file diff --git a/.releaserc b/.releaserc index 4f5437e0..6c6d1954 100644 --- a/.releaserc +++ b/.releaserc @@ -1,5 +1,5 @@ { - "branches": ["develop"], + "branches": ["main"], "plugins": [ "@semantic-release/commit-analyzer", { "preset": "angular" diff --git a/cypress/e2e/course_creation.cy.js b/cypress/e2e/course_creation.cy.js index 6d9fadb1..47a592d9 100644 --- a/cypress/e2e/course_creation.cy.js +++ b/cypress/e2e/course_creation.cy.js @@ -11,7 +11,6 @@ describe("Course Creation", () => { cy.get("button").contains("Create").click(); cy.get("span").contains("New Course").click(); cy.wait(500); - cy.url().should("include", "/courses/new/edit"); cy.get("label").contains("Title").type("Test Course"); cy.get("label") @@ -35,21 +34,6 @@ describe("Course Creation", () => { }); }); - cy.get("label") - .contains("Preview Video") - .type("https://www.youtube.com/embed/-LPmw2Znl2c"); - cy.get("[id=tags]").type("Learning{enter}Frappe{enter}ERPNext{enter}"); - cy.get("label") - .contains("Category") - .parent() - .within(() => { - cy.get("button").click(); - }); - cy.get("[id^=headlessui-combobox-option-") - .should("be.visible") - .first() - .click(); - /* Instructor */ cy.get("label") .contains("Instructors") @@ -69,13 +53,32 @@ describe("Course Creation", () => { }); }); + cy.button("Create").last().click(); + + // Edit Course Details + cy.wait(500); + cy.get("label") + .contains("Preview Video") + .type("https://www.youtube.com/embed/-LPmw2Znl2c"); + cy.get("[id=tags]").type("Learning{enter}Frappe{enter}ERPNext{enter}"); + cy.get("label") + .contains("Category") + .parent() + .within(() => { + cy.get("button").click(); + }); + cy.get("[id^=headlessui-combobox-option-") + .should("be.visible") + .first() + .click(); + cy.get("label").contains("Published").click(); cy.get("label").contains("Published On").type("2021-01-01"); cy.button("Save").click(); // Add Chapter cy.wait(1000); - cy.button("Add Chapter").click(); + cy.button("Add").click(); cy.wait(1000); cy.get("[data-dismissable-layer]") diff --git a/frontend/components.d.ts b/frontend/components.d.ts index 2b0e68e0..2ce38f23 100644 --- a/frontend/components.d.ts +++ b/frontend/components.d.ts @@ -54,7 +54,6 @@ declare module 'vue' { CourseCardOverlay: typeof import('./src/components/CourseCardOverlay.vue')['default'] CourseInstructors: typeof import('./src/components/CourseInstructors.vue')['default'] CourseOutline: typeof import('./src/components/CourseOutline.vue')['default'] - CourseProgressSummary: typeof import('./src/components/Modals/CourseProgressSummary.vue')['default'] CourseReviews: typeof import('./src/components/CourseReviews.vue')['default'] CreateOutline: typeof import('./src/components/CreateOutline.vue')['default'] DateRange: typeof import('./src/components/Common/DateRange.vue')['default'] @@ -94,6 +93,7 @@ declare module 'vue' { NoSidebarLayout: typeof import('./src/components/NoSidebarLayout.vue')['default'] Notes: typeof import('./src/components/Notes/Notes.vue')['default'] NotPermitted: typeof import('./src/components/NotPermitted.vue')['default'] + NumberChartGraph: typeof import('./src/components/NumberChartGraph.vue')['default'] PageModal: typeof import('./src/components/Modals/PageModal.vue')['default'] PaymentGatewayDetails: typeof import('./src/components/Settings/PaymentGatewayDetails.vue')['default'] PaymentGateways: typeof import('./src/components/Settings/PaymentGateways.vue')['default'] diff --git a/frontend/package.json b/frontend/package.json index bead43a6..c12ee444 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -7,7 +7,7 @@ "dev": "vite", "serve": "vite preview", "build": "vite build --base=/assets/lms/frontend/ && yarn copy-html-entry && yarn copy-colors-json", - "copy-html-entry": "cp ../lms/public/frontend/index.html ../lms/www/lms.html", + "copy-html-entry": "cp ../lms/public/frontend/index.html ../lms/www/_lms.html", "copy-colors-json": "cp node_modules/frappe-ui/tailwind/colors.json src/utils/frappe-ui-colors.json" }, "dependencies": { @@ -25,8 +25,7 @@ "@editorjs/paragraph": "2.11.3", "@editorjs/simple-image": "1.6.0", "@editorjs/table": "2.4.2", - "@vueuse/core": "10.4.1", - "@vueuse/router": "12.7.0", + "@vueuse/core": "^14.1.0", "ace-builds": "1.36.2", "apexcharts": "4.3.0", "chart.js": "4.4.1", @@ -34,7 +33,7 @@ "dayjs": "1.11.10", "dompurify": "3.2.6", "feather-icons": "4.28.0", - "frappe-ui": "^0.1.256", + "frappe-ui": "^0.1.261", "highlight.js": "11.11.1", "lucide-vue-next": "0.383.0", "markdown-it": "14.0.0", @@ -43,11 +42,11 @@ "socket.io-client": "4.7.2", "thememirror": "2.0.1", "typescript": "5.7.2", - "vue": "^3.5.0", + "vue": "^3.5.27", "vue-chartjs": "5.3.0", "vue-codemirror": "6.1.1", "vue-draggable-next": "2.2.1", - "vue-router": "4.2.2", + "vue-router": "^4.6.4", "vue3-apexcharts": "1.8.0", "vuedraggable": "4.1.0" }, diff --git a/frontend/src/components/AdminBatchDashboard.vue b/frontend/src/components/AdminBatchDashboard.vue index 135fe84c..4ed419d9 100644 --- a/frontend/src/components/AdminBatchDashboard.vue +++ b/frontend/src/components/AdminBatchDashboard.vue @@ -35,7 +35,7 @@ -
-
+
+
{{ __('Submission') }}
@@ -53,7 +53,7 @@ !['Pass', 'Fail'].includes(submissionResource.doc?.status) && submissionResource.doc?.owner == user.data?.name " - class="bg-surface-blue-2 text-ink-blue-2 p-3 rounded-md leading-5 text-sm mb-4" + class="bg-surface-blue-2 text-ink-blue-2 p-3 rounded-md leading-5 text-sm" > {{ __("You've successfully submitted the assignment.") }} {{ @@ -63,12 +63,17 @@ }} {{ __('Feel free to make edits to your submission if needed.') }}
-
-
- {{ __('Add your assignment as {0}').format(assignment.data.type) }} +
+
+ {{ __('Upload Assignment') }} +
+
+ {{ + __('You can only upload {0} files').format(assignment.data.type) + }}
-
- -
+
- - {{ submissionFile.file_name }} - - - {{ getFileSize(submissionFile.file_size) }} - +
+
+ +
+ + {{ + submissionResource.doc.assignment_attachment + .split('/') + .pop() + }} + +
-
- {{ __('Comments by Evaluator') }}: +
+ {{ __('Comments by Evaluator') }}
@@ -204,10 +212,8 @@ import { } from 'frappe-ui' import { computed, inject, onMounted, onBeforeUnmount, ref, watch } from 'vue' import { FileText, X } from 'lucide-vue-next' -import { getFileSize } from '@/utils' import { useRouter } from 'vue-router' -const submissionFile = ref(null) const answer = ref(null) const comments = ref(null) const router = useRouter() @@ -266,9 +272,7 @@ const newSubmission = createResource({ assignment: props.assignmentID, member: user.data?.name, } - if (showUploader()) { - doc.assignment_attachment = submissionFile.value.file_url - } else { + if (!showUploader()) { doc.answer = answer.value } return { @@ -277,19 +281,6 @@ const newSubmission = createResource({ }, }) -const imageResource = createResource({ - url: 'lms.lms.api.get_file_info', - makeParams(values) { - return { - file_url: values.image, - } - }, - auto: false, - onSuccess(data) { - submissionFile.value = data - }, -}) - const submissionResource = createDocumentResource({ doctype: 'LMS Assignment Submission', name: props.submissionName, @@ -302,11 +293,6 @@ const submissionResource = createDocumentResource({ watch(submissionResource, () => { if (submissionResource.doc) { - if (submissionResource.doc.assignment_attachment) { - imageResource.reload({ - image: submissionResource.doc.assignment_attachment, - }) - } if (submissionResource.doc.answer) { answer.value = submissionResource.doc.answer } @@ -315,7 +301,10 @@ watch(submissionResource, () => { } if (submissionResource.isDirty) { isDirty.value = true - } else if (showUploader() && !submissionFile.value) { + } else if ( + showUploader() && + !submissionResource.doc.assignment_attachment + ) { isDirty.value = true } else if (!showUploader() && !answer.value) { isDirty.value = true @@ -325,11 +314,17 @@ watch(submissionResource, () => { } }) -watch(submissionFile, () => { - if (props.submissionName == 'new' && submissionFile.value) { - isDirty.value = true +watch( + () => submissionResource.doc, + () => { + if ( + props.submissionName == 'new' && + submissionResource.doc?.assignment_attachment + ) { + isDirty.value = true + } } -}) +) const submitAssignment = () => { if (props.submissionName != 'new') { @@ -341,13 +336,13 @@ const submitAssignment = () => { submissionResource.setValue.submit( { ...submissionResource.doc, - assignment_attachment: submissionFile.value?.file_url, evaluator: evaluator, comments: comments.value, answer: answer.value, }, { onSuccess(data) { + isDirty.value = false toast.success(__('Changes saved successfully')) }, } @@ -388,7 +383,7 @@ const addNewSubmission = () => { const saveSubmission = (file) => { isDirty.value = true - submissionFile.value = file + submissionResource.doc.assignment_attachment = file.file_url } const markLessonProgress = () => { @@ -439,7 +434,7 @@ const validateFile = (file) => { const removeSubmission = () => { isDirty.value = true - submissionFile.value = null + submissionResource.doc.assignment_attachment = '' } const canGradeSubmission = computed(() => { diff --git a/frontend/src/components/BatchOverlay.vue b/frontend/src/components/BatchOverlay.vue index 82a4bcb3..9324d6a9 100644 --- a/frontend/src/components/BatchOverlay.vue +++ b/frontend/src/components/BatchOverlay.vue @@ -1,7 +1,7 @@ diff --git a/frontend/src/components/CourseOutline.vue b/frontend/src/components/CourseOutline.vue index 30df3aa5..ce4a07dc 100644 --- a/frontend/src/components/CourseOutline.vue +++ b/frontend/src/components/CourseOutline.vue @@ -15,7 +15,10 @@ {{ __(title) }}
{ close() router.push({ - name: 'CourseForm', - params: { - courseName: 'new', - }, + name: 'Courses', + query: { newCourse: '1' }, }) } " diff --git a/frontend/src/components/Modals/CourseProgressSummary.vue b/frontend/src/components/Modals/CourseProgressSummary.vue deleted file mode 100644 index fbc9b692..00000000 --- a/frontend/src/components/Modals/CourseProgressSummary.vue +++ /dev/null @@ -1,231 +0,0 @@ - - diff --git a/frontend/src/components/Modals/EditProfile.vue b/frontend/src/components/Modals/EditProfile.vue index 0cb3178c..e1c993b9 100644 --- a/frontend/src/components/Modals/EditProfile.vue +++ b/frontend/src/components/Modals/EditProfile.vue @@ -1,17 +1,25 @@ diff --git a/frontend/src/components/ProgressBar.vue b/frontend/src/components/ProgressBar.vue index eee0e487..dae0f1f5 100644 --- a/frontend/src/components/ProgressBar.vue +++ b/frontend/src/components/ProgressBar.vue @@ -1,6 +1,9 @@ diff --git a/frontend/src/components/Settings/Transactions/TransactionList.vue b/frontend/src/components/Settings/Transactions/TransactionList.vue index 40a2289e..305b24a8 100644 --- a/frontend/src/components/Settings/Transactions/TransactionList.vue +++ b/frontend/src/components/Settings/Transactions/TransactionList.vue @@ -1,12 +1,20 @@