Skip to content

Commit

Permalink
Merge pull request #2080 from RitvikSardana/minor-fixes
Browse files Browse the repository at this point in the history
fix: minor navigation and styling fixes
  • Loading branch information
RitvikSardana authored Dec 11, 2024
2 parents a8f1612 + 81b6580 commit a1336d2
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 25 deletions.
4 changes: 2 additions & 2 deletions desk/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<RouterView class="antialiased" />
<RouterView class="antialiased" :key="$route.fullPath" />
<Toasts />
<KeymapDialog />
<Dialogs />
Expand All @@ -11,7 +11,7 @@ import { Toasts } from "frappe-ui";
import { createToast } from "@/utils";
import { useConfigStore } from "@/stores/config";
import KeymapDialog from "@/pages/KeymapDialog.vue";
import { init as initTelemetry, stopSession } from "@/telemetry";
import { stopSession } from "@/telemetry";
import { Dialogs } from "frappe-ui";
useConfigStore();
Expand Down
33 changes: 33 additions & 0 deletions desk/src/components/EmptyState.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<template>
<div class="flex h-full items-center justify-center">
<div
class="flex flex-col items-center gap-3 text-xl font-medium text-ink-gray-4"
>
<!-- Icon -->
<component v-if="icon" :is="icon" class="h-10 w-10" />
<!-- title -->
<span>{{ title }}</span>
<!-- Button which emits Empty State Action -->
<Button label="Create" @click="emit('emptyStateAction')" variant="subtle">
<template #prefix><FeatherIcon name="plus" class="h-4" /></template>
</Button>
</div>
</div>
</template>

<script setup>
defineProps({
title: {
type: String,
default: "No Data Found",
},
icon: {
type: String || HTMLElement,
default: "",
},
});
const emit = defineEmits(["emptyStateAction"]);
</script>

<style lang="scss" scoped></style>
20 changes: 6 additions & 14 deletions desk/src/components/ListViewBuilder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,20 +91,11 @@
/>
</div>
<!-- Empty State -->
<div v-else class="flex h-full items-center justify-center">
<div
class="flex flex-col items-center gap-3 text-xl font-medium text-ink-gray-4"
>
<!-- Icon -->
<component :is="emptyState.icon" class="h-10 w-10" />
<!-- title -->
<span>{{ emptyState.title || "No Data Found" }}</span>
<!-- Button which emits Empty State Action -->
<Button label="Create" @click="emit('emptyStateAction')" variant="subtle">
<template #prefix><FeatherIcon name="plus" class="h-4" /></template>
</Button>
</div>
</div>
<EmptyState
v-else
:title="emptyState.title"
@emptyStateAction="emit('emptyStateAction')"
/>
</template>

<script setup lang="ts">
Expand All @@ -124,6 +115,7 @@ import { dayjs } from "@/dayjs";
import FadedScrollableDiv from "./FadedScrollableDiv.vue";
import Reload from "./view-controls/Reload.vue";
import { useScreenSize } from "@/composables/screen";
import EmptyState from "./EmptyState.vue";
interface P {
options: {
Expand Down
1 change: 1 addition & 0 deletions desk/src/components/layouts/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ const agentPortalDropdown = computed(() => [
label: "Settings",
icon: "settings",
onClick: () => (showSettingsModal.value = true),
condition: () => authStore.isAdmin,
},
{
label: "Log out",
Expand Down
4 changes: 2 additions & 2 deletions desk/src/components/ticket/TicketCustomerSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
v-for="field in ticketBasicInfo"
>
<span class="w-[126px] text-sm text-gray-600">{{ field.label }}</span>
<span class="text-base text-gray-800">
<span class="text-base text-gray-800 flex-1">
{{ field.value }}
</span>
</div>
Expand Down Expand Up @@ -67,7 +67,7 @@
v-for="field in ticketAdditionalInfo"
>
<span class="w-[126px] text-sm text-gray-600">{{ field.label }}</span>
<span class="text-base text-gray-800">
<span class="text-base text-gray-800 flex-1">
{{ field.value }}
</span>
</div>
Expand Down
2 changes: 1 addition & 1 deletion desk/src/components/ticket/TicketsListView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
{{ dayjs.tz(item).fromNow() }}
</Tooltip>
</div>
<div v-else-if="column.key === 'agent_group'">
<div v-else-if="column.key === 'agent_group'" class="truncate">
{{ item || "-" }}
</div>
<div v-else-if="column.key === 'resolution_by'">
Expand Down
8 changes: 7 additions & 1 deletion desk/src/pages/CannedResponses.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</LayoutHeader>
<div class="flex-1 overflow-y-auto p-2">
<div
v-if="!cannedResponses.loading"
v-if="cannedResponses.data?.length > 0"
class="grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4 px-5 pb-3"
>
<div
Expand Down Expand Up @@ -79,6 +79,11 @@
</div>
</div>
</div>
<EmptyState
v-else
title="No Canned Responses Found"
@emptyStateAction="showNewDialog = true"
/>
</div>
<CannedResponseModal
v-model="showNewDialog"
Expand Down Expand Up @@ -122,6 +127,7 @@ import { LayoutHeader } from "@/components";
import { useUserStore } from "@/stores/user";
import { dateFormat, dateTooltipFormat } from "@/utils";
import { dayjs } from "@/dayjs";
import EmptyState from "../components/EmptyState.vue";
const { getUser } = useUserStore();
Expand Down
4 changes: 4 additions & 0 deletions desk/src/pages/KnowledgeBaseArticle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,10 @@ const insertRes = createResource({
params: {
articleId: data.name,
},
query: {
category: categoryId.value,
subCategory: subCategoryId.value,
},
});
},
onError: useError({ title: "Error creating article" }),
Expand Down
9 changes: 4 additions & 5 deletions helpdesk/setup/welcome_ticket.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import frappe
from frappe.desk.form.assign_to import add as add_assign

AUTHOR_EMAIl = "[email protected]"
AUTHOR_NAME = "Ritvik Sardana"
AUTHOR_EMAIl = "[email protected]"
AUTHOR_NAME = "John Doe"
CONTENT = """
<p>
Hi 👋
Expand All @@ -13,8 +13,8 @@
You can get started right away by setting up a support email. This will help you see what
your support will look like with Helpdesk!
<br><br>
If you face any issues, please reach out to us via <a href="https://frappedesk.com/helpdesk">
https://frappedesk.com/helpdesk</a>
If you face any issues, please reach out to us via <a href="https://support.frappe.io/helpdesk">
https://support.frappe.io/helpdesk</a>
<br><br>
Best,
<br>
Expand All @@ -38,7 +38,6 @@ def create_ticket():
d.contact = AUTHOR_NAME
d.via_customer_portal = True
d.insert()
d.create_communication_via_contact(d.description)
add_assign(
{
"doctype": "HD Ticket",
Expand Down

0 comments on commit a1336d2

Please sign in to comment.