fix: removed doc & telegram link from user dropdown
(cherry picked from commit 807eb4a7d999729693ab79af2fab09efabf1c80e)
This commit is contained in:
parent
50c69c173f
commit
cc88d66de4
@ -24,9 +24,15 @@ class FCRMSettings(Document):
|
||||
standard_old_items = [d.name1 for d in old_items if d.is_standard]
|
||||
deleted_standard_items = set(standard_old_items) - set(standard_new_items)
|
||||
if deleted_standard_items:
|
||||
standard_dropdown_items = get_standard_dropdown_items()
|
||||
if not deleted_standard_items.intersection(standard_dropdown_items):
|
||||
return
|
||||
frappe.throw(_("Cannot delete standard items {0}").format(", ".join(deleted_standard_items)))
|
||||
|
||||
|
||||
def get_standard_dropdown_items():
|
||||
return [item.get("name1") for item in frappe.get_hooks("standard_dropdown_items")]
|
||||
|
||||
|
||||
def after_migrate():
|
||||
sync_table("dropdown_items", "standard_dropdown_items")
|
||||
|
||||
16
crm/hooks.py
16
crm/hooks.py
@ -264,22 +264,6 @@ standard_dropdown_items = [
|
||||
"route": "#",
|
||||
"is_standard": 1,
|
||||
},
|
||||
{
|
||||
"name1": "support_link",
|
||||
"label": "Support",
|
||||
"type": "Route",
|
||||
"icon": "life-buoy",
|
||||
"route": "https://t.me/frappecrm",
|
||||
"is_standard": 1,
|
||||
},
|
||||
{
|
||||
"name1": "docs_link",
|
||||
"label": "Docs",
|
||||
"type": "Route",
|
||||
"icon": "book-open",
|
||||
"route": "https://docs.frappe.io/crm",
|
||||
"is_standard": 1,
|
||||
},
|
||||
{
|
||||
"name1": "toggle_theme",
|
||||
"label": "Toggle theme",
|
||||
|
||||
@ -131,20 +131,6 @@ function getStandardItem(item) {
|
||||
return {
|
||||
component: markRaw(Apps),
|
||||
}
|
||||
case 'support_link':
|
||||
return {
|
||||
icon: item.icon,
|
||||
label: __(item.label),
|
||||
onClick: () =>
|
||||
window.open(item.route, item.open_in_new_window ? '_blank' : ''),
|
||||
}
|
||||
case 'docs_link':
|
||||
return {
|
||||
icon: item.icon,
|
||||
label: __(item.label),
|
||||
onClick: () =>
|
||||
window.open(item.route, item.open_in_new_window ? '_blank' : ''),
|
||||
}
|
||||
case 'toggle_theme':
|
||||
return {
|
||||
icon: theme.value === 'dark' ? 'sun' : item.icon,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user