Merge pull request #802 from pateljannat/issues-7

fix: misc issues
This commit is contained in:
Jannat Patel
2024-05-06 16:44:28 +05:30
committed by GitHub
5 changed files with 25 additions and 4 deletions

View File

@@ -46,6 +46,12 @@
</span>
</Button>
</router-link>
<div
v-else-if="course.data.disable_self_learning"
class="bg-blue-100 text-blue-900 text-sm rounded-md py-1 px-3"
>
{{ __('Contact the Administrator to enroll for this course.') }}
</div>
<Button
v-else
@click="enrollStudent()"

View File

@@ -38,7 +38,8 @@
</template>
<script setup>
import { Dialog, Input, TextEditor, createResource } from 'frappe-ui'
import { reactive, defineModel } from 'vue'
import { reactive, defineModel, computed } from 'vue'
import { showToast } from '@/utils'
const topics = defineModel('reloadTopics')
@@ -93,6 +94,14 @@ const submitTopic = (close) => {
topicResource.submit(
{},
{
validate() {
if (!topic.title) {
return 'Title cannot be empty.'
}
if (!topic.reply) {
return 'Reply cannot be empty.'
}
},
onSuccess(data) {
replyResource.submit(
{
@@ -108,6 +117,9 @@ const submitTopic = (close) => {
}
)
},
onError(err) {
showToast('Error', err.message, 'x')
},
}
)
}

View File

@@ -244,7 +244,7 @@ const newBatch = createResource({
return {
doc: {
doctype: 'LMS Batch',
meta_image: batch.image.file_url,
meta_image: batch.image?.file_url,
...batch,
},
}
@@ -279,7 +279,7 @@ const editBatch = createResource({
doctype: 'LMS Batch',
name: props.batchName,
fieldname: {
meta_image: batch.image.file_url,
meta_image: batch.image?.file_url,
...batch,
},
}

View File

@@ -1208,6 +1208,7 @@ def get_course_details(course):
"short_introduction",
"published",
"upcoming",
"disable_self_learning",
"published_on",
"status",
"paid_course",

View File

@@ -2,5 +2,7 @@ import frappe
def execute():
if frappe.db.exists("Role", "Class Evaluator") and not frappe.db.exists("Role", "Batch Evaluator"):
if frappe.db.exists("Role", "Class Evaluator") and not frappe.db.exists(
"Role", "Batch Evaluator"
):
frappe.rename_doc("Role", "Class Evaluator", "Batch Evaluator")