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

fix(ux): assign: use HD Agent instead of User #1302

Merged
merged 1 commit into from
Jul 11, 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
6 changes: 3 additions & 3 deletions desk/src/pages/desk/ticket-list/AssignedInfo.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template>
<Tooltip v-if="agent" :text="getTooltipLabel(user.doc?.full_name)">
<Tooltip v-if="agent" :text="getTooltipLabel(user.doc?.agent_name)">
<Avatar
size="sm"
:label="user.doc?.full_name"
:label="user.doc?.agent_name"
:image="user.doc?.user_image"
/>
</Tooltip>
Expand All @@ -24,7 +24,7 @@ const assign = toRef(props, "assign");
const assignJson = computed(() => JSON.parse(assign.value));
const agent = computed(() => [...assignJson.value].pop());
const user = createDocumentResource({
doctype: "User",
doctype: "HD Agent",
name: agent.value,
auto: true,
cache: ["User", agent.value],
Expand Down
13 changes: 8 additions & 5 deletions helpdesk/helpdesk/doctype/hd_agent/hd_agent.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@
"fetch_from": "user.full_name",
"fieldname": "agent_name",
"fieldtype": "Data",
"hidden": 1,
"in_global_search": 1,
"in_standard_filter": 1,
"label": "Agent Name"
"is_virtual": 1,
"label": "Full name",
"read_only": 1
},
{
"default": "1",
Expand All @@ -45,12 +46,14 @@
"fetch_from": "user.user_image",
"fieldname": "user_image",
"fieldtype": "Data",
"label": "User Image"
"is_virtual": 1,
"label": "Image",
"read_only": 1
}
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2023-03-26 23:16:09.421336",
"modified": "2023-07-11 15:44:27.134778",
"modified_by": "Administrator",
"module": "Helpdesk",
"name": "HD Agent",
Expand Down Expand Up @@ -96,4 +99,4 @@
"states": [],
"title_field": "agent_name",
"track_changes": 1
}
}
10 changes: 10 additions & 0 deletions helpdesk/helpdesk/doctype/hd_agent/hd_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,16 @@ def in_group(self, group):

return False

@property
def agent_name(self):
user = frappe.get_cached_doc("User", self.user)
return user.full_name

@property
def user_image(self):
user = frappe.get_cached_doc("User", self.user)
return user.user_image


@frappe.whitelist()
def create_hd_agent(first_name, last_name, email, signature, team):
Expand Down
Loading