jey_layout/README.md

55 lines
2.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

### Jey Layout
Inline desk visibility editor for Frappe/ERPNext, companion to **jey_theme**.
Lets a System Manager configure, directly on `/desk`, how each workspace's cards
and links behave — without ever modifying the Workspace records in the database
(non-destructive, applied server-side at request time, survives migrations).
### What it does
In edit mode a floating **✎ Layout** button turns on inline controls:
- **👁 / 🚫 / 🔒** next to every link — *visible* / *hidden* (removed from the desk)
/ *blocked* (also unreachable via URL/API/permissions, for everyone incl. Admin).
- **👁 / 🚫** on each card title, **👁 / 🚫 / 🔒** on the workspace title.
- **** to add a DocType / Report / Page link into a card.
- **⠿** drag handle to reorder links within a card; **✕** to remove an added link.
The normal desk is the *applied* result (what users see); "Done editing" shows it.
**Export** copies the layout into `jey_theme`'s shipped snapshot for production.
### How it works
This app is the **editor only**. The runtime engine lives in **jey_theme**
(`desk_layout.py`, `desk_overrides.py`, `access_control.py`), which reads a JSON
config and filters/injects desk data server-side. This app provides:
- the inline editor JS/CSS (loaded dynamically by `jey_theme.js` in design mode —
intentionally **not** via `app_include`, see jey_theme/CLAUDE.md for why);
- the whitelisted API (`jey_layout/api.py`) that reads the live desk structure and
saves the working config.
Requires **jey_theme** (declared in `required_apps`).
### Design machine
The editor is enabled automatically wherever this app is installed (design mode
defaults to ON when `jey_layout` is present). Production sites that only have
`jey_theme` stay in "always enforce the shipped snapshot" mode.
To override on a specific site, set `"jey_design_mode"` in `site_config.json`
(`0` to force off, `1` to force on).
### Installation
```bash
cd $PATH_TO_YOUR_BENCH
bench get-app https://git.host.jeyerp.az/ali/jey_layout --branch version-16
bench install-app jey_layout
```
### License
mit