fix: patch to add apps navbar item in default navbar items in navbar settings
This commit is contained in:
parent
9b3c46e700
commit
138fc02c3c
2 changed files with 31 additions and 0 deletions
|
|
@ -237,3 +237,4 @@ frappe.patches.v15_0.migrate_session_data
|
|||
frappe.custom.doctype.property_setter.patches.remove_invalid_fetch_from_expressions
|
||||
frappe.patches.v16_0.switch_default_sort_order
|
||||
frappe.integrations.doctype.oauth_client.patches.set_default_allowed_role_in_oauth_client
|
||||
frappe.patches.v16_0.add_app_launcher_in_navbar_settings
|
||||
|
|
|
|||
30
frappe/patches/v16_0/add_app_launcher_in_navbar_settings.py
Normal file
30
frappe/patches/v16_0/add_app_launcher_in_navbar_settings.py
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# MIT License. See license.txt
|
||||
|
||||
import frappe
|
||||
|
||||
|
||||
def execute():
|
||||
if frappe.db.exists("Navbar Item", {"item_label": "Apps"}):
|
||||
return
|
||||
|
||||
navbar_settings = frappe.get_single("Navbar Settings")
|
||||
settings_items = navbar_settings.as_dict().settings_dropdown
|
||||
|
||||
view_website_item_idx = -1
|
||||
for i, item in enumerate(navbar_settings.settings_dropdown):
|
||||
if item.get("item_label") == "View Website":
|
||||
view_website_item_idx = i
|
||||
|
||||
settings_items.insert(
|
||||
view_website_item_idx + 1,
|
||||
{
|
||||
"item_label": "Apps",
|
||||
"item_type": "Route",
|
||||
"route": "/apps",
|
||||
"is_standard": 1,
|
||||
},
|
||||
)
|
||||
|
||||
navbar_settings.set("settings_dropdown", settings_items)
|
||||
navbar_settings.save()
|
||||
Loading…
Add table
Reference in a new issue