diff --git a/frontend/package.json b/frontend/package.json index 50f57d68..0a45681d 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -27,7 +27,7 @@ "codemirror-editor-vue3": "^2.8.0", "dayjs": "^1.11.6", "feather-icons": "^4.28.0", - "frappe-ui": "^0.1.141", + "frappe-ui": "^0.1.143", "highlight.js": "^11.11.1", "lucide-vue-next": "^0.383.0", "markdown-it": "^14.0.0", diff --git a/frontend/src/components/Assignment.vue b/frontend/src/components/Assignment.vue index 38e3d4b5..4f78a9a2 100644 --- a/frontend/src/components/Assignment.vue +++ b/frontend/src/components/Assignment.vue @@ -191,10 +191,11 @@ import { FileUploader, FormControl, TextEditor, + toast, } from 'frappe-ui' import { computed, inject, onMounted, onBeforeUnmount, ref, watch } from 'vue' import { FileText, X } from 'lucide-vue-next' -import { showToast, getFileSize } from '@/utils' +import { getFileSize } from '@/utils' import { useRouter } from 'vue-router' const submissionFile = ref(null) @@ -284,7 +285,7 @@ const submissionResource = createDocumentResource({ doctype: 'LMS Assignment Submission', name: props.submissionName, onError(err) { - showToast(__('Error'), __(err.messages?.[0] || err), 'x') + toast.error(err.messages?.[0] || err) }, auto: false, cache: [user.data?.name, props.assignmentID], @@ -338,7 +339,7 @@ const submitAssignment = () => { }, { onSuccess(data) { - showToast(__('Success'), __('Changes saved successfully'), 'check') + toast.success(__('Changes saved successfully')) }, } ) @@ -352,7 +353,7 @@ const addNewSubmission = () => { {}, { onSuccess(data) { - showToast('Success', 'Assignment submitted successfully.', 'check') + toast.success(__('Assignment submitted successfully')) if (router.currentRoute.value.name == 'AssignmentSubmission') { router.push({ name: 'AssignmentSubmission', @@ -370,7 +371,7 @@ const addNewSubmission = () => { submissionResource.reload() }, onError(err) { - showToast('Error', err.messages?.[0] || err, 'x') + toast.error(err.messages?.[0] || err) }, } ) diff --git a/frontend/src/components/BatchCourses.vue b/frontend/src/components/BatchCourses.vue index 583acc1d..e988a16b 100644 --- a/frontend/src/components/BatchCourses.vue +++ b/frontend/src/components/BatchCourses.vue @@ -86,9 +86,9 @@ import { ListRows, ListView, ListRowItem, + toast, } from 'frappe-ui' import { Plus, Trash2 } from 'lucide-vue-next' -import { showToast } from '@/utils' const readOnlyMode = window.read_only_mode const showCourseModal = ref(false) @@ -152,7 +152,7 @@ const removeCourses = (selections, unselectAll) => { { onSuccess(data) { courses.reload() - showToast(__('Success'), __('Courses deleted successfully'), 'check') + toast.success(__('Courses deleted successfully')) unselectAll() }, } diff --git a/frontend/src/components/BatchOverlay.vue b/frontend/src/components/BatchOverlay.vue index b05b3fd4..5906a25b 100644 --- a/frontend/src/components/BatchOverlay.vue +++ b/frontend/src/components/BatchOverlay.vue @@ -122,9 +122,9 @@