feat: add Service Factory app icon to desk grid
- Added add_to_apps_screen hook in hooks.py with custom icon - Created service_factory SVG icon (blue rounded square) - Added permission check module (api/permission.py) - Assets symlink instruction in deploy README - Icon accessible at /assets/service_factory/icons/service_factory.svg
This commit is contained in:
parent
e24c3e2a72
commit
573765d51e
5 changed files with 40 additions and 9 deletions
|
|
@ -39,6 +39,14 @@ sudo systemctl enable frappe-bench.target
|
|||
sudo systemctl start frappe-bench.target
|
||||
```
|
||||
|
||||
### Assets Symlink
|
||||
|
||||
After installing the app, create the assets symlink for custom icons:
|
||||
|
||||
```bash
|
||||
sudo ln -sf /opt/erpnext/frappe-bench/apps/service_factory/service_factory/public /opt/erpnext/frappe-bench/sites/assets/service_factory
|
||||
```
|
||||
|
||||
### Credentials
|
||||
|
||||
Admin credentials are stored in `/root/erpnext-admin-credentials.txt`.
|
||||
|
|
|
|||
0
service_factory/api/__init__.py
Normal file
0
service_factory/api/__init__.py
Normal file
13
service_factory/api/permission.py
Normal file
13
service_factory/api/permission.py
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
# Copyright (c) 2026, cclohmar and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
|
||||
def has_app_permission():
|
||||
"""Check if the current user has permission to see the Service Factory app icon."""
|
||||
import frappe
|
||||
|
||||
# All authenticated users with at least one role can see the app icon
|
||||
if frappe.session.user == "Guest":
|
||||
return False
|
||||
|
||||
return True
|
||||
|
|
@ -11,15 +11,15 @@ app_license = "mit"
|
|||
# required_apps = []
|
||||
|
||||
# Each item in the list will be shown as an app in the apps page
|
||||
# add_to_apps_screen = [
|
||||
# {
|
||||
# "name": "service_factory",
|
||||
# "logo": "/assets/service_factory/logo.png",
|
||||
# "title": "Service Factory",
|
||||
# "route": "/service_factory",
|
||||
# "has_permission": "service_factory.api.permission.has_app_permission"
|
||||
# }
|
||||
# ]
|
||||
add_to_apps_screen = [
|
||||
{
|
||||
"name": "service_factory",
|
||||
"logo": "/assets/service_factory/icons/service_factory.svg",
|
||||
"title": "Service Factory",
|
||||
"route": "/app/engineer-workspace",
|
||||
"has_permission": "service_factory.api.permission.has_app_permission"
|
||||
}
|
||||
]
|
||||
|
||||
# Includes in <head>
|
||||
# ------------------
|
||||
|
|
|
|||
10
service_factory/public/icons/service_factory.svg
Normal file
10
service_factory/public/icons/service_factory.svg
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48">
|
||||
<rect width="48" height="48" rx="8" fill="#2490ef"/>
|
||||
<g fill="none" stroke="#fff" stroke-width="2" stroke-linecap="round">
|
||||
<path d="M10 16h28l-4 8H14l-4-8z"/>
|
||||
<path d="M14 24h20l-3 6H17l-3-6z"/>
|
||||
<path d="M18 30h12l-2 4H20l-2-4z"/>
|
||||
<circle cx="24" cy="12" r="2" fill="#fff" stroke="none"/>
|
||||
</g>
|
||||
<text x="24" y="42" text-anchor="middle" fill="#fff" font-size="6" font-family="sans-serif">SF</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 511 B |
Loading…
Reference in a new issue