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