Skip to content

Commit 76009c8

Browse files
Merge pull request #2325 from frappe/develop
chore(release): dev to main
2 parents ac565f1 + 4a1b980 commit 76009c8

90 files changed

Lines changed: 2000 additions & 1596 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module.exports = {
1+
export default {
22
env: {
33
browser: true,
44
es2021: true,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module.exports = {
1+
export default {
22
parserPreset: "conventional-changelog-conventionalcommits",
33
rules: {
44
"subject-empty": [2, "never"],

desk/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "helpdesk-ui",
33
"private": true,
44
"version": "0.0.0",
5+
"type":"module",
56
"scripts": {
67
"dev": "vite",
78
"build": "vite build",
@@ -22,7 +23,7 @@
2223
"autoprefixer": "^10.4.13",
2324
"dayjs": "^1.11.7",
2425
"echarts": "^5.4.1",
25-
"frappe-ui": "0.1.122",
26+
"frappe-ui": "0.1.150",
2627
"lodash": "^4.17.21",
2728
"lucide-static": "^0.276.0",
2829
"mime": "^3.0.0",
@@ -34,7 +35,7 @@
3435
"unplugin-icons": "^0.16.1",
3536
"unplugin-vue-components": "^0.25.2",
3637
"vee-validate": "^4.8.2",
37-
"vue": "^3.4.12",
38+
"vue": "^3.5.14",
3839
"vue-echarts": "^6.5.4",
3940
"vue-router": "^4.2.2",
4041
"vuedraggable": "^4.1.0",

desk/postcss.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module.exports = {
1+
export default {
22
plugins: {
33
tailwindcss: {},
44
autoprefixer: {},

desk/src/App.vue

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,55 @@
11
<template>
2-
<RouterView class="antialiased" />
3-
<Toasts />
2+
<FrappeUIProvider>
3+
<PortalRoot />
4+
</FrappeUIProvider>
45
<KeymapDialog />
56
<Dialogs />
67
</template>
78

89
<script setup lang="ts">
9-
import { onMounted, onUnmounted } from "vue";
10-
import { Toasts } from "frappe-ui";
11-
import { createToast } from "@/utils";
12-
import { useConfigStore } from "@/stores/config";
10+
import { Dialogs } from "@/components/dialogs";
1311
import KeymapDialog from "@/pages/KeymapDialog.vue";
12+
import { useConfigStore } from "@/stores/config";
1413
import { stopSession } from "@/telemetry";
15-
import { Dialogs } from "@/components/dialogs";
16-
14+
import { FrappeUIProvider, toast } from "frappe-ui";
15+
import { computed, defineAsyncComponent, h, onMounted, onUnmounted } from "vue";
16+
import Wifi from "~icons/lucide/wifi";
17+
import WifiOff from "~icons/lucide/wifi-off";
18+
import { useAuthStore } from "./stores/auth";
1719
useConfigStore();
1820
1921
onMounted(() => {
2022
window.addEventListener("online", () => {
21-
createToast({
22-
title: "You are now online",
23-
icon: "wifi",
24-
iconClasses: "stroke-green-600",
23+
toast.create({
24+
message: "You are now online",
25+
icon: h(Wifi),
2526
});
2627
});
2728
2829
window.addEventListener("offline", () => {
29-
createToast({
30-
title: "You are now offline",
31-
icon: "wifi-off",
32-
iconClasses: "stroke-red-600",
30+
toast.create({
31+
message: "You are now offline",
32+
icon: h(WifiOff),
3333
});
3434
});
3535
});
3636
37+
const AgentPortalRoot = defineAsyncComponent(
38+
() => import("@/pages/desk/AgentRoot.vue")
39+
);
40+
const CustomerPortalRoot = defineAsyncComponent(
41+
() => import("@/pages/CustomerPortalRoot.vue")
42+
);
43+
44+
const PortalRoot = computed(() => {
45+
const authStore = useAuthStore();
46+
if (authStore.hasDeskAccess && authStore.isAgent) {
47+
return AgentPortalRoot;
48+
} else {
49+
return CustomerPortalRoot;
50+
}
51+
});
52+
3753
onUnmounted(() => {
3854
stopSession();
3955
});

desk/src/components/BrandLogo.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
</template>
1010

1111
<script setup lang="ts">
12-
import { Avatar } from "frappe-ui";
1312
import HDLogo from "@/assets/logos/HDLogo.vue";
1413
1514
import { useConfigStore } from "@/stores/config";

desk/src/components/CommentBox.vue

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
<TextEditor
5454
ref="editorRef"
5555
:editor-class="[
56-
'prose-f shrink text-p-sm transition-all duration-300 ease-in-out block w-full content',
56+
'prose-f shrink text-p-sm transition-all duration-300 ease-in-out block w-full content',
5757
getFontFamily(_content),
5858
]"
5959
:content="_content"
@@ -102,7 +102,6 @@ import { updateRes as updateComment } from "@/stores/knowledgeBase";
102102
import { useUserStore } from "@/stores/user";
103103
import { CommentActivity } from "@/types";
104104
import {
105-
createToast,
106105
dateFormat,
107106
dateTooltipFormat,
108107
getFontFamily,
@@ -116,6 +115,7 @@ import {
116115
Dropdown,
117116
TextEditor,
118117
createResource,
118+
toast,
119119
} from "frappe-ui";
120120
import { PropType, computed, onMounted, ref } from "vue";
121121
const authStore = useAuthStore();
@@ -162,11 +162,7 @@ const deleteComment = createResource({
162162
}),
163163
onSuccess() {
164164
emit("update");
165-
createToast({
166-
title: "Comment deleted",
167-
icon: "check",
168-
iconClasses: "text-green-500",
169-
});
165+
toast.success("Comment deleted");
170166
},
171167
});
172168
@@ -176,11 +172,7 @@ function handleSaveComment() {
176172
return;
177173
}
178174
if (isContentEmpty(_content.value)) {
179-
createToast({
180-
title: "Comment cannot be empty",
181-
icon: "x",
182-
iconClasses: "text-red-600",
183-
});
175+
toast.error("Comment cannot be empty");
184176
return;
185177
}
186178
@@ -195,11 +187,7 @@ function handleSaveComment() {
195187
onSuccess: () => {
196188
editable.value = false;
197189
emit("update");
198-
createToast({
199-
title: "Comment updated",
200-
icon: "check",
201-
iconClasses: "text-green-500",
202-
});
190+
toast.success("Comment updated");
203191
},
204192
}
205193
);

desk/src/components/CommentTextEditor.vue

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
:editor-class="[
66
'prose-sm max-w-none',
77
editable &&
8-
'min-h-[7rem] mx-10 max-h-[50vh] overflow-y-auto border-t py-3',
8+
'min-h-[7rem] mx-6 md:ml-10 md:mr-9 max-h-[50vh] overflow-y-auto border-t py-3',
99
getFontFamily(newComment),
1010
]"
1111
:content="newComment"
@@ -17,9 +17,9 @@
1717
:extensions="[PreserveVideoControls]"
1818
>
1919
<template #bottom>
20-
<div v-if="editable" class="flex flex-col gap-2">
20+
<div v-if="editable" class="flex flex-col gap-2 px-6 md:pl-10 md:pr-9">
2121
<!-- Attachments -->
22-
<div class="flex flex-wrap gap-2 px-10">
22+
<div class="flex flex-wrap gap-2">
2323
<AttachmentItem
2424
v-for="a in attachments"
2525
:key="a.file_url"
@@ -35,10 +35,8 @@
3535
</AttachmentItem>
3636
</div>
3737
<!-- Fixed Menu -->
38-
<div
39-
class="flex justify-between gap-2 overflow-hidden border-t px-10 py-2.5"
40-
>
41-
<div class="flex items-center overflow-x-auto w-4/6">
38+
<div class="flex justify-between overflow-hidden border-t py-2.5">
39+
<div class="flex items-center overflow-x-auto w-[60%]">
4240
<TextEditorFixedMenu
4341
class="-ml-1"
4442
:buttons="textEditorMenuButtons"
@@ -67,9 +65,7 @@
6765
</template>
6866
</FileUploader>
6967
</div>
70-
<div
71-
class="mt-2 flex items-center justify-end space-x-2 sm:mt-0 w-2/6"
72-
>
68+
<div class="flex items-center justify-end space-x-2 w-[40%]">
7369
<Button
7470
label="Discard"
7571
@click="
@@ -161,6 +157,10 @@ const commentEmpty = computed(() => {
161157
});
162158
const loading = ref(false);
163159
160+
const label = computed(() => {
161+
return loading.value ? "Sending..." : props.label;
162+
});
163+
164164
const agents = computed(() => {
165165
return (
166166
agentsList.data?.map((agent) => ({

desk/src/components/CommunicationArea.vue

Lines changed: 38 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -28,54 +28,62 @@
2828
</div>
2929
</div>
3030
<div
31-
v-show="showCommentBox"
32-
@keydown.ctrl.enter.capture.stop="submitComment"
33-
@keydown.meta.enter.capture.stop="submitComment"
31+
v-show="showEmailBox"
32+
class="flex gap-1.5 flex-1"
33+
@keydown.ctrl.enter.capture.stop="submitEmail"
34+
@keydown.meta.enter.capture.stop="submitEmail"
3435
>
35-
<CommentTextEditor
36-
ref="commentTextEditorRef"
37-
:label="isMac ? 'Comment (⌘ + ⏎)' : 'Comment (Ctrl + ⏎)'"
36+
<EmailEditor
37+
ref="emailEditorRef"
38+
:label="
39+
isMobileView ? 'Send' : isMac ? 'Send (⌘ + ⏎)' : 'Send (Ctrl + ⏎)'
40+
"
3841
v-model="doc"
39-
:editable="showCommentBox"
40-
:doctype="doctype"
41-
placeholder="@John could you please look into this?"
42+
v-model:content="content"
43+
placeholder="Hi John, we are looking into this issue."
44+
:to-emails="toEmails"
45+
:cc-emails="ccEmails"
46+
:bcc-emails="bccEmails"
4247
@submit="
4348
() => {
44-
showCommentBox = false;
49+
showEmailBox = false;
4550
emit('update');
4651
}
4752
"
4853
@discard="
4954
() => {
50-
showCommentBox = false;
55+
showEmailBox = false;
5156
}
5257
"
5358
/>
5459
</div>
5560
<div
56-
v-show="showEmailBox"
57-
class="flex gap-1.5"
58-
@keydown.ctrl.enter.capture.stop="submitEmail"
59-
@keydown.meta.enter.capture.stop="submitEmail"
61+
v-show="showCommentBox"
62+
@keydown.ctrl.enter.capture.stop="submitComment"
63+
@keydown.meta.enter.capture.stop="submitComment"
6064
>
61-
<EmailEditor
62-
ref="emailEditorRef"
63-
:label="isMac ? 'Send (⌘ + ⏎)' : 'Send (Ctrl + ⏎)'"
65+
<CommentTextEditor
66+
ref="commentTextEditorRef"
67+
:label="
68+
isMobileView
69+
? 'Comment'
70+
: isMac
71+
? 'Comment (⌘ + ⏎)'
72+
: 'Comment (Ctrl + ⏎)'
73+
"
6474
v-model="doc"
65-
v-model:content="content"
66-
placeholder="Hi John, we are looking into this issue."
67-
:to-emails="toEmails"
68-
:cc-emails="ccEmails"
69-
:bcc-emails="bccEmails"
75+
:editable="showCommentBox"
76+
:doctype="doctype"
77+
placeholder="@John could you please look into this?"
7078
@submit="
7179
() => {
72-
showEmailBox = false;
80+
showCommentBox = false;
7381
emit('update');
7482
}
7583
"
7684
@discard="
7785
() => {
78-
showEmailBox = false;
86+
showCommentBox = false;
7987
}
8088
"
8189
/>
@@ -87,13 +95,15 @@
8795
import { CommentTextEditor, EmailEditor } from "@/components";
8896
import { CommentIcon, EmailIcon } from "@/components/icons/";
8997
import { useDevice } from "@/composables";
98+
import { useScreenSize } from "@/composables/screen";
9099
import { showCommentBox, showEmailBox } from "@/pages/ticket/modalStates";
91100
import { ref, watch } from "vue";
92101
93102
const emit = defineEmits(["update"]);
94103
const content = defineModel("content");
95104
const doc = defineModel();
96105
const { isMac } = useDevice();
106+
const { isMobileView } = useScreenSize();
97107
98108
const emailEditorRef = ref(null);
99109
const commentTextEditorRef = ref(null);
@@ -185,4 +195,7 @@ defineExpose({
185195
width: 100vw;
186196
}
187197
}
198+
.comm-area {
199+
width: 100%;
200+
}
188201
</style>

desk/src/components/EmailArea.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
</span>
9696
<span v-if="bcc">{{ bcc }}</span>
9797
</div>
98-
<div class="border-0 border-t mt-3 mb-1 border-outline-gray-modals" />
98+
<div class="border-0 border-t my-3 border-outline-gray-modals" />
9999
<EmailContent :content="content" />
100100
<div class="flex flex-wrap gap-2">
101101
<AttachmentItem

0 commit comments

Comments
 (0)