fix: removed doc & telegram link from user dropdown
This commit is contained in:
parent
a24283eb5e
commit
807eb4a7d9
@ -24,9 +24,15 @@ class FCRMSettings(Document):
|
|||||||
standard_old_items = [d.name1 for d in old_items if d.is_standard]
|
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)
|
deleted_standard_items = set(standard_old_items) - set(standard_new_items)
|
||||||
if deleted_standard_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)))
|
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():
|
def after_migrate():
|
||||||
sync_table("dropdown_items", "standard_dropdown_items")
|
sync_table("dropdown_items", "standard_dropdown_items")
|
||||||
|
|||||||
16
crm/hooks.py
16
crm/hooks.py
@ -264,22 +264,6 @@ standard_dropdown_items = [
|
|||||||
"route": "#",
|
"route": "#",
|
||||||
"is_standard": 1,
|
"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",
|
"name1": "toggle_theme",
|
||||||
"label": "Toggle theme",
|
"label": "Toggle theme",
|
||||||
|
|||||||
@ -131,20 +131,6 @@ function getStandardItem(item) {
|
|||||||
return {
|
return {
|
||||||
component: markRaw(Apps),
|
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':
|
case 'toggle_theme':
|
||||||
return {
|
return {
|
||||||
icon: theme.value === 'dark' ? 'sun' : item.icon,
|
icon: theme.value === 'dark' ? 'sun' : item.icon,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user