mirror of
https://github.com/penpot/penpot.git
synced 2026-03-20 17:33:44 +00:00
🐛 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:
@@ -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)]
|
||||
|
||||
@@ -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)}
|
||||
|
||||
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user