fix: redirect to specific comment or tab on click
This commit is contained in:
parent
674bb28239
commit
cd4b87a067
@ -27,7 +27,7 @@ def get_notifications():
|
|||||||
"type": notification.type,
|
"type": notification.type,
|
||||||
"to_user": notification.to_user,
|
"to_user": notification.to_user,
|
||||||
"read": notification.read,
|
"read": notification.read,
|
||||||
"comment": notification.comment,
|
"hash": get_hash(notification),
|
||||||
"notification_text": notification.notification_text,
|
"notification_text": notification.notification_text,
|
||||||
"notification_type_doctype": notification.notification_type_doctype,
|
"notification_type_doctype": notification.notification_type_doctype,
|
||||||
"notification_type_doc": notification.notification_type_doc,
|
"notification_type_doc": notification.notification_type_doc,
|
||||||
@ -58,3 +58,17 @@ def mark_as_read(user=None, doc=None):
|
|||||||
d = frappe.get_doc("CRM Notification", n.name)
|
d = frappe.get_doc("CRM Notification", n.name)
|
||||||
d.read = True
|
d.read = True
|
||||||
d.save()
|
d.save()
|
||||||
|
|
||||||
|
def get_hash(notification):
|
||||||
|
_hash = ""
|
||||||
|
if notification.type == "Mention" and notification.notification_type_doc:
|
||||||
|
_hash = "#" + notification.notification_type_doc
|
||||||
|
|
||||||
|
if notification.type == "WhatsApp":
|
||||||
|
_hash = "#whatsapp"
|
||||||
|
|
||||||
|
if notification.type == "Assignment" and notification.notification_type_doctype == "CRM Task":
|
||||||
|
_hash = "#tasks"
|
||||||
|
if "has been removed by" in notification.message:
|
||||||
|
_hash = ""
|
||||||
|
return _hash
|
||||||
@ -147,10 +147,11 @@ function getRoute(notification) {
|
|||||||
dealId: notification.reference_name,
|
dealId: notification.reference_name,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
name: notification.route_name,
|
name: notification.route_name,
|
||||||
params: params,
|
params: params,
|
||||||
hash: '#' + notification.comment || notification.notification_type_doc,
|
hash: notification.hash,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user