chore: code cleanup

This commit is contained in:
Ritvik Sardana
2026-06-28 14:18:25 +05:30
parent c9fdd600c1
commit 56d24f0faa
3 changed files with 22 additions and 16 deletions
@@ -19,7 +19,12 @@
{{ ticket.data.contact.name }}
</div>
</Tooltip>
<div class="flex gap-1.5" v-if="!ticket.data.feedback_rating">
<div
class="flex gap-1.5"
v-if="
!ticket.data.feedback_rating && ticket.data.status !== 'Closed'
"
>
<Tooltip :text="ticket.data.contact.email_id">
<Button class="h-7 w-7" @click="emit('open')">
<template #icon>
+1 -1
View File
@@ -78,7 +78,7 @@
:label="__('Send')"
theme="gray"
variant="solid"
:disabled="$refs.editor?.editor.isEmpty || send.loading"
:disabled="$refs.editor?.editor?.isEmpty || send.loading"
:loading="send.loading"
@click="sendEmail"
/>
+15 -14
View File
@@ -22,14 +22,16 @@
>
<template #default>
<div class="space-y-4 text-base text-ink-gray-7">
<div class="space-y-2">
<span> {{ __("Select a rating") }} </span>
<span class="text-ink-red-6"> * </span>
<StarRating
:static="false"
:rating="rating"
<div class="flex flex-col gap-2">
<div>
<span> {{ __("Select a rating") }} </span>
<span class="text-ink-red-6"> * </span>
</div>
<Rating
v-model="rating"
@update:model-value="rating = $event"
:max="5"
size="sm"
@update:model-value="onSelectRating"
/>
</div>
<div v-if="options.data?.length" class="space-y-2">
@@ -60,11 +62,10 @@
</template>
<script setup lang="ts">
import { StarRating } from "@/components";
import { createListResource, createResource } from "frappe-ui";
import { inject, ref, watch } from "vue";
import { ITicket } from "./symbols";
import { __ } from "@/translation";
import { createListResource, createResource, Rating } from "frappe-ui";
import { inject, ref } from "vue";
import { ITicket } from "./symbols";
interface P {
open: boolean;
@@ -101,15 +102,15 @@ const setValue = createResource({
ticket.reload();
},
});
watch(rating, (r) => {
function onSelectRating(r: number) {
preset.value = null;
text.value = "";
options.update({
filters: {
rating: r,
rating: r / 5,
disabled: 0,
},
});
options.reload();
});
}
</script>