Skip to content

Commit

Permalink
chore: ticket list: move empty message to table component (#1288)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssiyad authored Jun 28, 2023
1 parent 670d2c4 commit a22debc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion desk/src/components/HelpdeskTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="w-full overflow-hidden overflow-x-auto">
<div
v-if="isEmpty(data)"
class="flex h-full w-full items-center justify-center text-base text-gray-900"
class="flex h-full w-full items-center justify-center text-base text-gray-700"
>
{{ emptyMessage }}
</div>
Expand Down
5 changes: 4 additions & 1 deletion desk/src/pages/desk/ticket-list/MainTable.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<template>
<HelpdeskTable
v-model:selection="selection"
row-key="name"
:columns="columns"
:data="tickets.list.data"
row-key="name"
:empty-message="emptyMessage"
>
<template #subject="{ data }">
<TicketSummary
Expand Down Expand Up @@ -101,6 +102,8 @@ const ticketPriorityStore = useTicketPriorityStore();
const ticketStatusStore = useTicketStatusStore();
const { selection, tickets } = useTicketListStore();
const emptyMessage =
"🎉 Great news! There are currently no tickets to display. Keep up the good work!";
const dateFormat = "D/M/YYYY h:mm A";
const columns = [
{
Expand Down
10 changes: 1 addition & 9 deletions desk/src/pages/desk/ticket-list/TicketList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,7 @@
<TopSection class="mt-4" />
</template>
</PageTitle>
<MainTable v-if="tickets.totalCount" class="grow" />
<div
v-else
class="flex grow items-center justify-center text-sm text-gray-800"
>
{{ isEmptyMessage }}
</div>
<MainTable class="grow" />
<ListNavigation v-bind="tickets" class="p-2" />
<NewTicketDialog
v-model="isDialogVisible"
Expand All @@ -45,8 +39,6 @@ import IconPlus from "~icons/lucide/plus";
const { init, deinit, tickets } = useTicketListStore();
const isDialogVisible = ref(false);
const isEmptyMessage =
"🎉 Great news! There are currently no tickets to display. Keep up the good work!";
onMounted(init);
onUnmounted(deinit);
Expand Down

0 comments on commit a22debc

Please sign in to comment.