feat: batch feedback
This commit is contained in:
47
frontend/src/components/BatchFeedback.vue
Normal file
47
frontend/src/components/BatchFeedback.vue
Normal file
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<div v-if="feedbackList.data"></div>
|
||||
<div v-else class="space-y-8">
|
||||
<div class="grid grid-cols-4 gap-5">
|
||||
<Rating v-model="feedback.content" :label="__('Content')" />
|
||||
<Rating v-model="feedback.delivery" :label="__('Delivery')" />
|
||||
<Rating v-model="feedback.instructors" :label="__('Instructors')" />
|
||||
<Rating v-model="feedback.value" :label="__('Value')" />
|
||||
</div>
|
||||
<FormControl
|
||||
v-model="feedback.feedback"
|
||||
type="textarea"
|
||||
:label="__('Feedback')"
|
||||
rows="7"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { inject, reactive } from 'vue'
|
||||
import { createListResource, FormControl, Rating } from 'frappe-ui'
|
||||
|
||||
const user = inject('$user')
|
||||
const feedback = reactive({
|
||||
content: 0,
|
||||
delivery: 0,
|
||||
instructors: 0,
|
||||
value: 0,
|
||||
feedback: '',
|
||||
})
|
||||
|
||||
const props = defineProps({
|
||||
batch: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
})
|
||||
|
||||
const feedbackList = createListResource({
|
||||
doctype: 'LMS Batch Feedback',
|
||||
filters: {
|
||||
batch: props.batch,
|
||||
member: user.data?.name,
|
||||
},
|
||||
cache: ['feedbackList', props.batch, user.data?.name],
|
||||
auto: true,
|
||||
})
|
||||
</script>
|
||||
@@ -391,7 +391,7 @@ const getChartOptions = (categories) => {
|
||||
},
|
||||
rotate: 0,
|
||||
formatter: function (value) {
|
||||
return value.length > 20 ? `${value.substring(0, 20)}...` : value // Trim long labels
|
||||
return value.length > 20 ? `${value.substring(0, 20)}...` : value
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -77,10 +77,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <span class="mt-4">
|
||||
{{ student }}
|
||||
</span> -->
|
||||
</div>
|
||||
</template>
|
||||
</Dialog>
|
||||
|
||||
@@ -84,6 +84,9 @@
|
||||
:scrollToBottom="true"
|
||||
/>
|
||||
</div>
|
||||
<div v-else-if="tab.label == 'Feedback'">
|
||||
<BatchFeedback :batch="batch.data.name" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</Tabs>
|
||||
@@ -190,12 +193,11 @@ import {
|
||||
BookOpen,
|
||||
Laptop,
|
||||
BookOpenCheck,
|
||||
Contact2,
|
||||
Mail,
|
||||
SendIcon,
|
||||
MessageCircle,
|
||||
Globe,
|
||||
ShieldCheck,
|
||||
ClipboardPen,
|
||||
} from 'lucide-vue-next'
|
||||
import { formatTime, updateDocumentTitle } from '@/utils'
|
||||
import BatchDashboard from '@/components/BatchDashboard.vue'
|
||||
@@ -208,6 +210,7 @@ import AnnouncementModal from '@/components/Modals/AnnouncementModal.vue'
|
||||
import Discussions from '@/components/Discussions.vue'
|
||||
import DateRange from '@/components/Common/DateRange.vue'
|
||||
import BulkCertificates from '@/components/Modals/BulkCertificates.vue'
|
||||
import BatchFeedback from '@/components/BatchFeedback.vue'
|
||||
|
||||
const user = inject('$user')
|
||||
const showAnnouncementModal = ref(false)
|
||||
@@ -291,6 +294,13 @@ const tabs = computed(() => {
|
||||
label: 'Discussions',
|
||||
icon: MessageCircle,
|
||||
})
|
||||
|
||||
if (isStudent.value) {
|
||||
batchTabs.push({
|
||||
label: 'Feedback',
|
||||
icon: ClipboardPen,
|
||||
})
|
||||
}
|
||||
return batchTabs
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user