Merge pull request #1244 from pateljannat/issues-65
fix: removed delivery parameter from batch feedback
This commit is contained in:
@@ -17,23 +17,9 @@
|
||||
<div class="space-y-8">
|
||||
<div class="flex items-center justify-between">
|
||||
<Rating
|
||||
v-model="feedback.content"
|
||||
:label="__('Content')"
|
||||
:readonly="readOnly"
|
||||
/>
|
||||
<Rating
|
||||
v-model="feedback.delivery"
|
||||
:label="__('Delivery')"
|
||||
:readonly="readOnly"
|
||||
/>
|
||||
<Rating
|
||||
v-model="feedback.instructors"
|
||||
:label="__('Instructors')"
|
||||
:readonly="readOnly"
|
||||
/>
|
||||
<Rating
|
||||
v-model="feedback.value"
|
||||
:label="__('Value')"
|
||||
v-for="key in ratingKeys"
|
||||
v-model="feedback[key]"
|
||||
:label="__(convertToTitleCase(key))"
|
||||
:readonly="readOnly"
|
||||
/>
|
||||
</div>
|
||||
@@ -54,21 +40,11 @@
|
||||
|
||||
<div class="flex items-center justify-between mb-10">
|
||||
<Rating
|
||||
v-model="average.content"
|
||||
:label="__('Content')"
|
||||
v-for="key in ratingKeys"
|
||||
v-model="average[key]"
|
||||
:label="__(convertToTitleCase(key))"
|
||||
:readonly="true"
|
||||
/>
|
||||
<Rating
|
||||
v-model="average.delivery"
|
||||
:label="__('Delivery')"
|
||||
:readonly="true"
|
||||
/>
|
||||
<Rating
|
||||
v-model="average.instructors"
|
||||
:label="__('Instructors')"
|
||||
:readonly="true"
|
||||
/>
|
||||
<Rating v-model="average.value" :label="__('Value')" :readonly="true" />
|
||||
</div>
|
||||
|
||||
<div class="text-lg font-semibold mb-5">
|
||||
@@ -121,9 +97,13 @@
|
||||
</ListRows>
|
||||
</ListView>
|
||||
</div>
|
||||
<div v-else class="text-sm italic text-center text-gray-700 mt-5">
|
||||
{{ __('No feedback received yet.') }}
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { computed, inject, onMounted, reactive, ref, watch } from 'vue'
|
||||
import { convertToTitleCase } from '@/utils'
|
||||
import {
|
||||
Avatar,
|
||||
Button,
|
||||
@@ -139,7 +119,7 @@ import {
|
||||
} from 'frappe-ui'
|
||||
|
||||
const user = inject('$user')
|
||||
const ratingKeys = ['content', 'delivery', 'instructors', 'value']
|
||||
const ratingKeys = ['content', 'instructors', 'value']
|
||||
const readOnly = ref(false)
|
||||
const average = reactive({})
|
||||
const feedback = reactive({})
|
||||
@@ -171,7 +151,6 @@ const feedbackList = createListResource({
|
||||
},
|
||||
fields: [
|
||||
'content',
|
||||
'delivery',
|
||||
'instructors',
|
||||
'value',
|
||||
'feedback',
|
||||
@@ -243,22 +222,17 @@ const feedbackColumns = computed(() => {
|
||||
{
|
||||
label: 'Content',
|
||||
key: 'content',
|
||||
width: '10rem',
|
||||
},
|
||||
{
|
||||
label: 'Delivery',
|
||||
key: 'delivery',
|
||||
width: '10rem',
|
||||
width: '9rem',
|
||||
},
|
||||
{
|
||||
label: 'Instructors',
|
||||
key: 'instructors',
|
||||
width: '10rem',
|
||||
width: '9rem',
|
||||
},
|
||||
{
|
||||
label: 'Value',
|
||||
key: 'value',
|
||||
width: '10rem',
|
||||
width: '9rem',
|
||||
},
|
||||
]
|
||||
})
|
||||
|
||||
@@ -96,7 +96,7 @@ import {
|
||||
} from 'frappe-ui'
|
||||
import { reactive, watch, defineModel } from 'vue'
|
||||
import { FileText, X } from 'lucide-vue-next'
|
||||
import { getFileSize, showToast } from '@/utils'
|
||||
import { getFileSize, showToast, escapeHTML } from '@/utils'
|
||||
|
||||
const reloadProfile = defineModel('reloadProfile')
|
||||
|
||||
@@ -131,6 +131,7 @@ const imageResource = createResource({
|
||||
const updateProfile = createResource({
|
||||
url: 'frappe.client.set_value',
|
||||
makeParams(values) {
|
||||
profile.bio = escapeHTML(profile.bio)
|
||||
return {
|
||||
doctype: 'User',
|
||||
name: props.profile.data.name,
|
||||
|
||||
@@ -533,3 +533,21 @@ export const validateFile = (file) => {
|
||||
return __('Only image file is allowed.')
|
||||
}
|
||||
}
|
||||
|
||||
export const escapeHTML = (text) => {
|
||||
if (!text) return ''
|
||||
let escape_html_mapping = {
|
||||
'&': '&',
|
||||
'<': '<',
|
||||
'>': '>',
|
||||
'"': '"',
|
||||
"'": ''',
|
||||
'`': '`',
|
||||
'=': '=',
|
||||
}
|
||||
|
||||
return String(text).replace(
|
||||
/[&<>"'`=]/g,
|
||||
(char) => escape_html_mapping[char] || char
|
||||
)
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
"batch",
|
||||
"column_break_swst",
|
||||
"content",
|
||||
"delivery",
|
||||
"instructors",
|
||||
"value",
|
||||
"feedback"
|
||||
@@ -49,11 +48,6 @@
|
||||
"fieldtype": "Rating",
|
||||
"label": "Content"
|
||||
},
|
||||
{
|
||||
"fieldname": "delivery",
|
||||
"fieldtype": "Rating",
|
||||
"label": "Delivery"
|
||||
},
|
||||
{
|
||||
"fieldname": "instructors",
|
||||
"fieldtype": "Rating",
|
||||
@@ -81,7 +75,7 @@
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
"modified": "2025-01-10 19:39:04.143783",
|
||||
"modified": "2025-01-13 19:02:58.259908",
|
||||
"modified_by": "Administrator",
|
||||
"module": "LMS",
|
||||
"name": "LMS Batch Feedback",
|
||||
|
||||
Reference in New Issue
Block a user