🐛 Fix permission message and update ruler guide proxy name on plugins api (#8632)

- Updated the error message for missing content write permission in the removeRulerGuide function.
- Renamed the ruler guide proxy from "RuleGuideProxy" to "RulerGuideProxy" for consistency.
- Adjusted variable naming in the addRulerGuide function for clarity.

Signed-off-by: Stas Haas <stas@girafic.de>
This commit is contained in:
girafic
2026-03-17 15:05:26 +01:00
committed by GitHub
parent 7480be0bda
commit d6cc469027
3 changed files with 5 additions and 5 deletions

View File

@@ -331,7 +331,7 @@
(u/display-not-valid :removeRulerGuide "Guide not provided")
(not (r/check-permission plugin-id "content:write"))
(u/display-not-valid :removeRulerGuide "Plugin doesn't have 'comment:write' permission")
(u/display-not-valid :removeRulerGuide "Plugin doesn't have 'content:write' permission")
:else
(let [guide (u/proxy->ruler-guide value)]

View File

@@ -24,7 +24,7 @@
(defn ruler-guide-proxy
[plugin-id file-id page-id id]
(obj/reify {:name "RuleGuideProxy"}
(obj/reify {:name "RulerGuideProxy"}
:$plugin {:enumerable false :get (constantly plugin-id)}
:$file {:enumerable false :get (constantly file-id)}
:$page {:enumerable false :get (constantly page-id)}

View File

@@ -1267,7 +1267,7 @@
(u/display-not-valid :addRulerGuide "Plugin doesn't have 'content:write' permission")
:else
(let [id (uuid/next)
(let [ruler-id (uuid/next)
axis (parser/orientation->axis orientation)
objects (u/locate-objects file-id page-id)
frame (get objects id)
@@ -1275,11 +1275,11 @@
position (+ board-pos value)]
(st/emit!
(dwgu/update-guides
{:id id
{:id ruler-id
:axis axis
:position position
:frame-id id}))
(rg/ruler-guide-proxy plugin-id file-id page-id id)))))
(rg/ruler-guide-proxy plugin-id file-id page-id ruler-id)))))
:removeRulerGuide
(fn [_ value]