From c534ff931eadee8747cd87d698aaeba15bdfb82e Mon Sep 17 00:00:00 2001 From: Vibhav Katre Date: Mon, 20 Jul 2026 10:33:40 +0530 Subject: [PATCH] Frappe Draw: show in the Desk /apps launcher (add_to_apps_screen + logo) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enable the app-launcher entry so Frappe Draw appears on the Desk /apps screen, using the brand logomark (the violet 3-node hierarchy mark) as a served asset. - draw/public/logo.svg: the brand mark (same as the favicon), served at /assets/draw/logo.svg. - hooks.py: uncomment + wire add_to_apps_screen (name/logo/title/route + has_permission). - api/permission.py: has_app_permission(user) — any signed-in (non-Guest) user. Verified: logo serves (200 at /assets/draw/logo.svg); app loads + run-tests --app draw → 9 pass. Co-Authored-By: Claude Opus 4.8 (1M context) --- draw/api/permission.py | 6 ++++++ draw/hooks.py | 20 ++++++++++---------- draw/public/logo.svg | 7 +++++++ 3 files changed, 23 insertions(+), 10 deletions(-) create mode 100644 draw/public/logo.svg diff --git a/draw/api/permission.py b/draw/api/permission.py index 6fe4367..3674075 100644 --- a/draw/api/permission.py +++ b/draw/api/permission.py @@ -8,6 +8,12 @@ import frappe +def has_app_permission(user: str | None = None) -> bool: + """Whether to show Frappe Draw on the Desk /apps launcher — any signed-in + (non-Guest) user.""" + return (user or frappe.session.user) != "Guest" + + def query_conditions(user: str | None = None) -> str: """SQL clause limiting Draw Diagram list queries to what `user` may see: their own diagrams, ones shared with them, and public ones. System Managers diff --git a/draw/hooks.py b/draw/hooks.py index a1c6a58..548a7f8 100644 --- a/draw/hooks.py +++ b/draw/hooks.py @@ -15,16 +15,16 @@ # required_apps = [] -# Each item in the list will be shown as an app in the apps page -# add_to_apps_screen = [ -# { -# "name": "draw", -# "logo": "/assets/draw/logo.png", -# "title": "Frappe Draw", -# "route": "/draw", -# "has_permission": "draw.api.permission.has_app_permission" -# } -# ] +# Show Frappe Draw in the Desk /apps launcher (violet 3-node logomark). +add_to_apps_screen = [ + { + "name": "draw", + "logo": "/assets/draw/logo.svg", + "title": "Frappe Draw", + "route": "/draw", + "has_permission": "draw.api.permission.has_app_permission", + } +] # Includes in # ------------------ diff --git a/draw/public/logo.svg b/draw/public/logo.svg new file mode 100644 index 0000000..b2947ab --- /dev/null +++ b/draw/public/logo.svg @@ -0,0 +1,7 @@ + + + + + + +