Skip to content

Commit 4929cc1

Browse files
committed
fix: empty state of ticket list view
1 parent 1c23f29 commit 4929cc1

File tree

4 files changed

+29
-15
lines changed

4 files changed

+29
-15
lines changed

desk/src/components/EmptyState.vue

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@
1515
</div>
1616
</template>
1717

18-
<script setup>
19-
defineProps({
20-
title: {
21-
type: String,
22-
default: "No Data Found",
23-
},
24-
icon: {
25-
type: String || HTMLElement,
26-
default: "",
27-
},
18+
<script setup lang="ts">
19+
import { VNode } from "vue";
20+
interface Props {
21+
title: string;
22+
icon?: VNode | string;
23+
}
24+
25+
withDefaults(defineProps<Props>(), {
26+
title: "No Data Found",
27+
icon: "",
2828
});
2929
3030
const emit = defineEmits(["emptyStateAction"]);

desk/src/components/ListViewBuilder.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,13 @@
9090
<EmptyState
9191
v-else
9292
:title="emptyState.title"
93+
:icon="emptyState.icon"
9394
@emptyStateAction="emit('emptyStateAction')"
9495
/>
9596
</template>
9697

9798
<script setup lang="ts">
98-
import { reactive, provide, computed, h, ref } from "vue";
99+
import { reactive, provide, computed, h, ref, VNode } from "vue";
99100
import {
100101
createResource,
101102
ListView,
@@ -128,7 +129,8 @@ interface P {
128129
defaultFilters?: Record<string, any>;
129130
columnConfig?: Record<string, any>;
130131
emptyState?: {
131-
icon?: HTMLElement | string;
132+
// type of a h componnt
133+
icon?: string | VNode;
132134
title: string;
133135
};
134136
hideViewControls?: boolean;

desk/src/pages/ticket/Tickets2.vue

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@
1919
<ListViewBuilder
2020
ref="listViewRef"
2121
:options="options"
22+
@empty-state-action="
23+
() =>
24+
$router.push({
25+
name: isCustomerPortal ? 'TicketNew' : 'TicketAgentNew',
26+
})
27+
"
2228
@row-click="
2329
(row) =>
2430
$router.push({
@@ -29,7 +35,7 @@
2935
/>
3036
<ExportModal
3137
v-model="showExportModal"
32-
:rowCount="$refs.listViewRef?.list?.data?.total_count"
38+
:rowCount="$refs.listViewRef?.list?.data?.total_count ?? 0"
3339
@update="
3440
({ export_type, export_all }) => exportRows(export_type, export_all)
3541
"
@@ -47,6 +53,7 @@ import { useTicketStatusStore } from "@/stores/ticketStatus";
4753
import { dayjs } from "@/dayjs";
4854
import { createToast, isCustomerPortal } from "@/utils";
4955
import { capture } from "@/telemetry";
56+
import { TicketIcon } from "@/components/icons";
5057
5158
const listViewRef = ref(null);
5259
const showExportModal = ref(false);
@@ -134,6 +141,12 @@ const options = {
134141
isCustomerPortal: isCustomerPortal.value,
135142
showSelectBanner: true,
136143
selectBannerActions,
144+
emptyState: {
145+
title: "No Tickets Found",
146+
icon: h(TicketIcon, {
147+
class: "h-10 w-10",
148+
}),
149+
},
137150
};
138151
139152
function handle_response_by_field(row: any, item: string) {

helpdesk/helpdesk/doctype/hd_ticket/hd_ticket.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@
9494
"fieldname": "status",
9595
"fieldtype": "Select",
9696
"in_list_view": 1,
97-
"in_standard_filter": 1,
9897
"label": "Status",
9998
"no_copy": 1,
10099
"oldfieldname": "status",
@@ -409,7 +408,7 @@
409408
"icon": "fa fa-issue",
410409
"idx": 61,
411410
"links": [],
412-
"modified": "2025-01-30 18:07:29.036648",
411+
"modified": "2025-02-06 14:52:46.410772",
413412
"modified_by": "Administrator",
414413
"module": "Helpdesk",
415414
"name": "HD Ticket",

0 commit comments

Comments
 (0)