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

chore: ticket list: move empty message to table component #1288

Merged
merged 1 commit into from
Jun 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading