Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: ticket list #1189

Merged
merged 13 commits into from
May 18, 2023
Prev Previous commit
chore: re-order columns
  • Loading branch information
ssiyad committed May 18, 2023
commit 92d59e122135007a3a4388a2e7354dab15798aea
30 changes: 16 additions & 14 deletions desk/src/pages/desk/ticket-list/MainTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
:value="allSelected"
:onchange="(e) => toggleAllSelected(e.target.checked)"
/>
<div class="w-20">Type</div>
<div ref="subjectCol" class="col-subject grow">Subject</div>
<div class="w-40">Assignee</div>
<div class="w-24">Status</div>
<div class="w-24">Priority</div>
<div class="w-20">Type</div>
<div class="w-40">Assignee</div>
<div v-if="columns['Due in']" class="w-24">Due in</div>
<div v-if="columns['Created on']" class="w-36">Created on</div>
<div v-if="columns['Last modified']" class="w-36">Last modified</div>
Expand All @@ -39,13 +39,7 @@
:value="selected.has(t.name)"
@click="() => toggleOne(t.name)"
/>
<div class="line-clamp-1 w-20 text-gray-700">
{{ t.ticket_type || "--" }}
</div>
<TicketSummary class="col-subject grow" :ticket-name="t.name" />
<div class="w-40">
<AssignedInfo :ticket-id="t.name" />
</div>
<div class="w-24">
<Dropdown :options="statusDropdownOptions(t.name, t.status)">
<template #default="{ open }">
Expand All @@ -61,15 +55,23 @@
</div>
<div class="w-24">
<Dropdown :options="priorityDropdownOptions(t.name, t.priority)">
<template #default>
<Badge
:color-map="ticketPriorityStore.colorMap"
:label="t.priority"
class="cursor-pointer"
/>
<template #default="{ open }">
<div
class="flex cursor-pointer select-none items-center gap-1 text-gray-700"
>
{{ t.priority }}
<IconCaretDown v-if="!open" class="h-3 w-3" />
<IconCaretUp v-if="open" class="h-3 w-3" />
</div>
</template>
</Dropdown>
</div>
<div class="line-clamp-1 w-20 text-gray-700">
{{ t.ticket_type || "--" }}
</div>
<div class="w-40">
<AssignedInfo :ticket-id="t.name" />
</div>
<div
v-if="columns['Due in']"
class="line-clamp-1 w-24 text-gray-700"
Expand Down
11 changes: 2 additions & 9 deletions desk/src/pages/desk/ticket-list/TicketSummary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
:class="{
'text-gray-700': isSeen,
'text-gray-900': !isSeen,
'font-medium': !isSeen,
}"
>
<div class="line-clamp-1">
Expand All @@ -24,14 +25,6 @@
{{ commentCount }}
</div>
</div>
<Tooltip v-if="!isSeen" text="New ticket">
<span class="relative flex h-3 w-3 items-center justify-center">
<span
class="absolute inline-flex h-full w-full animate-ping rounded-full bg-gray-500 opacity-75"
></span>
<div class="h-1.5 w-1.5 rounded-full bg-gray-800"></div>
</span>
</Tooltip>
<div class="flex items-center gap-1">
<IconHash class="h-3 w-3" />
{{ ticketName }}
Expand All @@ -42,7 +35,7 @@

<script setup lang="ts">
import { computed, toRefs } from "vue";
import { createDocumentResource, Tooltip } from "frappe-ui";
import { createDocumentResource } from "frappe-ui";
import IconHash from "~icons/espresso/hash";
import IconMail from "~icons/espresso/mail";
import IconComment from "~icons/espresso/comment";
Expand Down