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(release): dev to main #2059

Merged
merged 28 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
613b164
fix: show video controls in agent side
RitvikSardana Nov 4, 2024
f633ff4
Merge pull request #2032 from RitvikSardana/video-controls-existing-t…
RitvikSardana Nov 4, 2024
3e7bbd8
fix(ui): minor UI changes
RitvikSardana Nov 5, 2024
3ae3cd3
chore: code cleanup
RitvikSardana Nov 5, 2024
d810e34
Merge pull request #2033 from RitvikSardana/ui-changes
RitvikSardana Nov 7, 2024
8be9bcb
refactor: hd team and assignment rules flow
RitvikSardana Nov 7, 2024
ef3d3e8
fix(patch): add patch for updating HD Team
RitvikSardana Nov 11, 2024
3de5672
fix: remove groups field from agent doctype
RitvikSardana Nov 11, 2024
6de7fdb
fix(patch): consider only active agents
RitvikSardana Nov 11, 2024
d9d992e
fix: add new patch path in patch file
RitvikSardana Nov 11, 2024
cb25266
refactor: remove unnecessary code from hd agent
RitvikSardana Nov 11, 2024
1f7e76f
fix: hd_agent doctype should not have track changes enabled
RitvikSardana Nov 11, 2024
4c5171d
refactor: remove agents if not in team
RitvikSardana Nov 13, 2024
b669151
refactor: patch
RitvikSardana Nov 13, 2024
fffedda
fix: remove assignment rule on deletion of team
RitvikSardana Nov 13, 2024
4647ac6
fix: semgrep ignore
RitvikSardana Nov 13, 2024
35a9f01
Merge pull request #2037 from RitvikSardana/refactor-agent-team
RitvikSardana Nov 13, 2024
3e1c5fe
fix: show frappe_mail_site field while creating Frappe Mail Account
RitvikSardana Nov 13, 2024
654d629
fix: Maintain order of custom fields.
Sampadakambagi Nov 20, 2024
fc4b8a0
Merge pull request #2043 from RitvikSardana/frappe-mail-field-frontend
RitvikSardana Nov 21, 2024
de03eae
Merge pull request #2047 from byteshores/maintain_fields_order
RitvikSardana Nov 21, 2024
a3df210
fix: dont create null communication
RitvikSardana Nov 22, 2024
0e10c60
Merge pull request #2049 from RitvikSardana/null-communication
RitvikSardana Nov 22, 2024
4d8828f
feat: setting to auto update status on reply
RitvikSardana Nov 22, 2024
68ccd8f
Merge pull request #2056 from RitvikSardana/auto-update-status-on-reply
RitvikSardana Nov 22, 2024
64e63aa
feat: setting to make feedback mandatory
RitvikSardana Nov 22, 2024
76fea07
chore: code cleanup
RitvikSardana Nov 22, 2024
b49c0c3
Merge pull request #2058 from RitvikSardana/close-customer-ticket
RitvikSardana Nov 22, 2024
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
7 changes: 4 additions & 3 deletions desk/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
<RouterView class="antialiased" />
<Toasts />
<KeymapDialog />
<Dialogs />
</template>

<script setup lang="ts">
import { provide, ref, onMounted, onUnmounted } from "vue";
import { onMounted, onUnmounted } from "vue";
import { Toasts } from "frappe-ui";
import { createToast } from "@/utils";
import { useConfigStore } from "@/stores/config";
import KeymapDialog from "@/pages/KeymapDialog.vue";
import { stopSession } from "@/telemetry";
import { init as initTelemetry } from "@/telemetry";
import { init as initTelemetry, stopSession } from "@/telemetry";
import { Dialogs } from "frappe-ui";
useConfigStore();

onMounted(async () => {
Expand Down
2 changes: 2 additions & 0 deletions desk/src/components/CommentTextEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
:editable="editable"
:mentions="agents"
@change="editable ? (newComment = $event) : null"
:extensions="[PreserveVideoControls]"
>
<template #bottom>
<div v-if="editable" class="flex flex-col gap-2">
Expand Down Expand Up @@ -102,6 +103,7 @@ import { AttachmentIcon } from "@/components/icons/";
import { AttachmentItem } from "@/components/";
import { useAgentStore } from "@/stores/agent";
import { useStorage } from "@vueuse/core";
import { PreserveVideoControls } from "@/tiptap-extensions";

const { agents: agentsList } = useAgentStore();

Expand Down
2 changes: 2 additions & 0 deletions desk/src/components/EmailEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
:placeholder="placeholder"
:editable="editable"
@change="editable ? (newEmail = $event) : null"
:extensions="[PreserveVideoControls]"
>
<template #top>
<div class="mx-10 flex items-center gap-2 border-y py-2.5">
Expand Down Expand Up @@ -163,6 +164,7 @@ import {
CannedResponseSelectorModal,
} from "@/components";
import { AttachmentIcon, EmailIcon } from "@/components/icons";
import { PreserveVideoControls } from "@/tiptap-extensions";

const editorRef = ref(null);
const showCannedResponseSelectorModal = ref(false);
Expand Down
3 changes: 2 additions & 1 deletion desk/src/components/Settings/EmailAdd.vue
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ const state: Reactive<EmailAccount> = reactive({
password: "",
api_key: "",
api_secret: "",
frappe_mail_site: "",
enable_incoming: false,
enable_outgoing: false,
default_incoming: false,
Expand Down Expand Up @@ -157,7 +158,7 @@ const addEmailRes = createResource({
},
});

const error = ref("");
const error = ref<string | undefined>();
function createEmailAccount() {
error.value = validateInputs(state, selectedService.value.custom);
if (error.value) return;
Expand Down
6 changes: 4 additions & 2 deletions desk/src/components/Settings/EmailEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ const state = reactive({
api_key: props.accountData?.api_key || null,
api_secret: props.accountData?.api_secret || null,
password: props.accountData?.password || null,
frappe_mail_site: props.accountData?.frappe_mail_site || "",
enable_incoming: props.accountData.enable_incoming || false,
enable_outgoing: props.accountData.enable_outgoing || false,
default_outgoing: props.accountData.default_outgoing || false,
Expand All @@ -135,7 +136,7 @@ const fields = computed(() => {
return popularProviderFields;
});

const error = ref("");
const error = ref<string | undefined>();
const loading = ref(false);
async function updateAccount() {
error.value = validateInputs(state, isCustomService.value);
Expand Down Expand Up @@ -189,7 +190,8 @@ const isDirty = computed(() => {
state.enable_incoming !== props.accountData.enable_incoming ||
state.enable_outgoing !== props.accountData.enable_outgoing ||
state.default_outgoing !== props.accountData.default_outgoing ||
state.default_incoming !== props.accountData.default_incoming
state.default_incoming !== props.accountData.default_incoming ||
state.frappe_mail_site !== props.accountData.frappe_mail_site
);
});

Expand Down
6 changes: 6 additions & 0 deletions desk/src/components/Settings/emailConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ export const popularProviderFields = [

export const customProviderFields = [
...fixedFields,
{
label: "Frappe Mail Site",
name: "frappe_mail_site",
type: "text",
placeholder: "https://frappemail.com",
},
{
label: "API Key",
name: "api_key",
Expand Down
1 change: 0 additions & 1 deletion desk/src/components/ViewControls.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
</div>
</FadedScrollableDiv>
<div class="grow"></div>
<div class="-ml-2 h-[70%] border-l" />

<div class="flex items-center gap-2">
<Button :label="'Refresh'" @click="emit('event:reload')">
Expand Down
2 changes: 1 addition & 1 deletion desk/src/components/layouts/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<div class="mb-4" v-if="!isCustomerPortal">
<div
v-if="notificationStore.unread"
class="absolute z-20 h-1.5 w-1.5 translate-x-6 translate-y-1 rounded-full bg-blue-400"
class="absolute z-20 h-1.5 w-1.5 translate-x-6 translate-y-1 rounded-full bg-blue-400 left-1"
theme="gray"
variant="solid"
/>
Expand Down
35 changes: 21 additions & 14 deletions desk/src/pages/TicketCustomer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</template>
<template #right-header>
<Button
v-if="showResolveButton"
v-if="ticket.data.status !== 'Closed'"
label="Close"
theme="gray"
variant="solid"
Expand Down Expand Up @@ -70,6 +70,8 @@ import { createToast } from "@/utils";
import { LayoutHeader } from "@/components";
import TicketCustomerSidebar from "@/components/ticket/TicketCustomerSidebar.vue";
import { useScreenSize } from "@/composables/screen";
import { useConfigStore } from "@/stores/config";
import { confirmDialog } from "frappe-ui";
interface P {
ticketId: string;
}
Expand Down Expand Up @@ -126,10 +128,22 @@ function handleClose() {
if (showFeedback.value) {
showFeedbackDialog.value = true;
} else {
setValue.submit({ fieldname: "status", value: "Closed" });
showConfirmationDialog();
}
}

function showConfirmationDialog() {
confirmDialog({
title: "Close Ticket",
message: "Are you sure you want to close this ticket?",
onConfirm: ({ hideDialog }: { hideDialog: Function }) => {
ticket.data.status = "Closed";
setValue.submit({ fieldname: "status", value: "Closed" });
hideDialog();
},
});
}

const setValue = createResource({
url: "frappe.client.set_value",
debounce: 300,
Expand Down Expand Up @@ -157,21 +171,14 @@ const breadcrumbs = computed(() => {
return items;
});

const showReopenButton = computed(
() => ticket.data.status === "Resolved" && !ticket.data.feedback
);
const showResolveButton = computed(() =>
["Open", "Replied"].includes(ticket.data.status)
);

const showEditor = computed(() => ticket.data.status !== "Closed");

// this handles whether the ticket was raised and then was closed without any reply from the agent.
const { isFeedbackMandatory } = useConfigStore();
const showFeedback = computed(() => {
return ticket.data?.communications?.some((c) => {
if (c.sender !== ticket.data.raised_by) {
return true;
}
});
const hasAgentCommunication = ticket.data?.communications?.some(
(c) => c.sender !== ticket.data.raised_by
);
return hasAgentCommunication && isFeedbackMandatory;
});
</script>
17 changes: 11 additions & 6 deletions desk/src/pages/TicketNew.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,17 @@
</div>
<!-- existing fields -->
<div class="flex flex-col" :class="subject.length >= 2 && 'gap-5'">
<FormControl
v-model="subject"
type="text"
label="Subject*"
placeholder="A short description"
/>
<div class="flex flex-col gap-2">
<span class="block text-sm text-gray-700">
Subject
<span class="place-self-center text-red-500"> * </span>
</span>
<FormControl
v-model="subject"
type="text"
placeholder="A short description"
/>
</div>
<TicketNewArticles v-if="isCustomerPortal" :search="subject" />
<div v-if="isCustomerPortal">
<h4
Expand Down
4 changes: 4 additions & 0 deletions desk/src/stores/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ export const useConfigStore = defineStore("config", () => {
const preferKnowledgeBase = computed(
() => !!parseInt(config.value.prefer_knowledge_base)
);
const isFeedbackMandatory = computed(
() => !!parseInt(config.value.is_feedback_mandatory)
);

socket.on("helpdesk:settings-updated", () => configRes.reload());

Expand All @@ -29,5 +32,6 @@ export const useConfigStore = defineStore("config", () => {
preferKnowledgeBase,
isSetupComplete,
skipEmailWorkflow,
isFeedbackMandatory,
};
});
1 change: 1 addition & 0 deletions desk/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ export interface EmailAccount {
api_key?: string;
api_secret?: string;
password?: string;
frappe_mail_site?: string;
enable_outgoing?: boolean;
enable_incoming?: boolean;
default_outgoing?: boolean;
Expand Down
1 change: 1 addition & 0 deletions helpdesk/api/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ def get_config():
"prefer_knowledge_base",
"setup_complete",
"skip_email_workflow",
"is_feedback_mandatory",
]
res = frappe.get_value(doctype="HD Settings", fieldname=fields, as_dict=True)
return res
8 changes: 5 additions & 3 deletions helpdesk/api/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@ def create_email_account(data):
**service_config,
}
)
email_doc.append(
"imap_folder", {"append_to": "HD Ticket", "folder_name": "INBOX"}
)
if service == "Frappe Mail":
email_doc.api_key = data.get("api_key")
email_doc.api_secret = data.get("api_secret")
email_doc.frappe_mail_site = data.get("frappe_mail_site")
email_doc.append_to = "HD Ticket"
else:
email_doc.append(
"imap_folder", {"append_to": "HD Ticket", "folder_name": "INBOX"}
)
email_doc.password = data.get("password")
# validate whether the credentials are correct
email_doc.get_incoming_server()
Expand Down
14 changes: 3 additions & 11 deletions helpdesk/helpdesk/doctype/hd_agent/hd_agent.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"user",
"agent_name",
"user_image",
"is_active",
"groups"
"is_active"
],
"fields": [
{
Expand All @@ -35,12 +34,6 @@
"in_list_view": 1,
"label": "Is Active"
},
{
"fieldname": "groups",
"fieldtype": "Table",
"label": "Groups",
"options": "HD Team Item"
},
{
"fetch_from": "user.user_image",
"fieldname": "user_image",
Expand All @@ -51,7 +44,7 @@
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2023-07-24 22:31:23.178626",
"modified": "2024-11-11 17:30:22.859253",
"modified_by": "Administrator",
"module": "Helpdesk",
"name": "HD Agent",
Expand Down Expand Up @@ -95,6 +88,5 @@
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"title_field": "agent_name",
"track_changes": 1
"title_field": "agent_name"
}
Loading
Loading