mirror of
https://github.com/penpot/penpot.git
synced 2025-05-05 09:55:54 +02:00
🐛 Fix some problems in plugins
This commit is contained in:
parent
62cea62356
commit
c66ff74f21
2 changed files with 19 additions and 19 deletions
|
@ -209,34 +209,34 @@
|
||||||
[:div {:class (stl/css :permissions-list-entry)}
|
[:div {:class (stl/css :permissions-list-entry)}
|
||||||
i/oauth-1
|
i/oauth-1
|
||||||
[:p {:class (stl/css :permissions-list-text)}
|
[:p {:class (stl/css :permissions-list-text)}
|
||||||
(tr "workspace.plugins.permissions.disclaimer")]])
|
(tr "workspace.plugins.permissions.content-read")]])
|
||||||
|
|
||||||
(when (contains? permissions "content:write")
|
(when (contains? permissions "content:write")
|
||||||
[:div {:class (stl/css :permissions-list-entry)}
|
[:div {:class (stl/css :permissions-list-entry)}
|
||||||
i/oauth-1
|
i/oauth-1
|
||||||
[:p {:class (stl/css :permissions-list-text)}
|
[:p {:class (stl/css :permissions-list-text)}
|
||||||
(tr "workspace.plugins.permissions.content-read")]])
|
(tr "workspace.plugins.permissions.content-write")]])
|
||||||
|
|
||||||
(when (contains? permissions "user:read")
|
(when (contains? permissions "user:read")
|
||||||
[:div {:class (stl/css :permissions-list-entry)}
|
[:div {:class (stl/css :permissions-list-entry)}
|
||||||
i/oauth-2
|
i/oauth-2
|
||||||
[:p {:class (stl/css :permissions-list-text)}
|
[:p {:class (stl/css :permissions-list-text)}
|
||||||
(tr "workspace.plugins.permissions.content-write")]])
|
(tr "workspace.plugins.permissions.user-read")]])
|
||||||
|
|
||||||
(when (contains? permissions "library:read")
|
(when (contains? permissions "library:read")
|
||||||
[:div {:class (stl/css :permissions-list-entry)}
|
[:div {:class (stl/css :permissions-list-entry)}
|
||||||
i/oauth-3
|
i/oauth-3
|
||||||
[:p {:class (stl/css :permissions-list-text)}
|
[:p {:class (stl/css :permissions-list-text)}
|
||||||
(tr "workspace.plugins.permissions.user-read")]])
|
(tr "workspace.plugins.permissions.library-read")]])
|
||||||
|
|
||||||
(when (contains? permissions "library:write")
|
(when (contains? permissions "library:write")
|
||||||
[:div {:class (stl/css :permissions-list-entry)}
|
[:div {:class (stl/css :permissions-list-entry)}
|
||||||
i/oauth-3
|
i/oauth-3
|
||||||
[:p {:class (stl/css :permissions-list-text)}
|
[:p {:class (stl/css :permissions-list-text)}
|
||||||
(tr "workspace.plugins.permissions.library-read")]])]
|
(tr "workspace.plugins.permissions.library-write")]])]
|
||||||
|
|
||||||
[:div {:class (stl/css :permissions-disclaimer)}
|
[:div {:class (stl/css :permissions-disclaimer)}
|
||||||
(tr "workspace.plugins.permissions.library-write")]]
|
(tr "workspace.plugins.permissions.disclaimer")]]
|
||||||
|
|
||||||
[:div {:class (stl/css :modal-footer)}
|
[:div {:class (stl/css :modal-footer)}
|
||||||
[:div {:class (stl/css :action-buttons)}
|
[:div {:class (stl/css :action-buttons)}
|
||||||
|
|
|
@ -105,7 +105,7 @@
|
||||||
(let [font (when (string? value) (fonts/get-font-data value))
|
(let [font (when (string? value) (fonts/get-font-data value))
|
||||||
variant (fonts/get-default-variant font)]
|
variant (fonts/get-default-variant font)]
|
||||||
(cond
|
(cond
|
||||||
(not (some? font))
|
(not font)
|
||||||
(u/display-not-valid :fontId value)
|
(u/display-not-valid :fontId value)
|
||||||
|
|
||||||
(not (r/check-permission plugin-id "content:write"))
|
(not (r/check-permission plugin-id "content:write"))
|
||||||
|
@ -121,7 +121,7 @@
|
||||||
|
|
||||||
:set
|
:set
|
||||||
(fn [_ value]
|
(fn [_ value]
|
||||||
(let [font (fonts/find-font-data {:font-family value})
|
(let [font (fonts/find-font-data {:family value})
|
||||||
variant (fonts/get-default-variant font)]
|
variant (fonts/get-default-variant font)]
|
||||||
(cond
|
(cond
|
||||||
(not (string? value))
|
(not (string? value))
|
||||||
|
@ -320,7 +320,7 @@
|
||||||
(st/emit! (dwt/update-text-range id start end {:fills value})))))})))
|
(st/emit! (dwt/update-text-range id start end {:fills value})))))})))
|
||||||
|
|
||||||
(defn add-text-props
|
(defn add-text-props
|
||||||
[plugin-id shape-proxy]
|
[shape-proxy plugin-id]
|
||||||
(crc/add-properties!
|
(crc/add-properties!
|
||||||
shape-proxy
|
shape-proxy
|
||||||
{:name "characters"
|
{:name "characters"
|
||||||
|
@ -374,7 +374,7 @@
|
||||||
font (when (string? value) (fonts/get-font-data value))
|
font (when (string? value) (fonts/get-font-data value))
|
||||||
variant (fonts/get-default-variant font)]
|
variant (fonts/get-default-variant font)]
|
||||||
(cond
|
(cond
|
||||||
(not (some? font))
|
(not font)
|
||||||
(u/display-not-valid :fontId value)
|
(u/display-not-valid :fontId value)
|
||||||
|
|
||||||
(not (r/check-permission plugin-id "content:write"))
|
(not (r/check-permission plugin-id "content:write"))
|
||||||
|
@ -388,10 +388,10 @@
|
||||||
:set
|
:set
|
||||||
(fn [self value]
|
(fn [self value]
|
||||||
(let [id (obj/get self "$id")
|
(let [id (obj/get self "$id")
|
||||||
font (fonts/find-font-data {:font-family value})
|
font (fonts/find-font-data {:family value})
|
||||||
variant (fonts/get-default-variant font)]
|
variant (fonts/get-default-variant font)]
|
||||||
(cond
|
(cond
|
||||||
(not (some? font))
|
(not font)
|
||||||
(u/display-not-valid :fontFamily value)
|
(u/display-not-valid :fontFamily value)
|
||||||
|
|
||||||
(not (r/check-permission plugin-id "content:write"))
|
(not (r/check-permission plugin-id "content:write"))
|
||||||
|
@ -408,7 +408,7 @@
|
||||||
font (fonts/get-font-data (obj/get self "fontId"))
|
font (fonts/get-font-data (obj/get self "fontId"))
|
||||||
variant (fonts/get-variant font value)]
|
variant (fonts/get-variant font value)]
|
||||||
(cond
|
(cond
|
||||||
(not (some? variant))
|
(not variant)
|
||||||
(u/display-not-valid :fontVariantId value)
|
(u/display-not-valid :fontVariantId value)
|
||||||
|
|
||||||
(not (r/check-permission plugin-id "content:write"))
|
(not (r/check-permission plugin-id "content:write"))
|
||||||
|
@ -490,7 +490,7 @@
|
||||||
(let [id (obj/get self "$id")
|
(let [id (obj/get self "$id")
|
||||||
value (str/trim (dm/str value))]
|
value (str/trim (dm/str value))]
|
||||||
(cond
|
(cond
|
||||||
(or (empty? value) (re-matches letter-spacing-re value))
|
(or (not (string? value)) (not (re-matches letter-spacing-re value)))
|
||||||
(u/display-not-valid :letterSpacing value)
|
(u/display-not-valid :letterSpacing value)
|
||||||
|
|
||||||
(not (r/check-permission plugin-id "content:write"))
|
(not (r/check-permission plugin-id "content:write"))
|
||||||
|
@ -505,7 +505,7 @@
|
||||||
(fn [self value]
|
(fn [self value]
|
||||||
(let [id (obj/get self "$id")]
|
(let [id (obj/get self "$id")]
|
||||||
(cond
|
(cond
|
||||||
(and (string? value) (re-matches text-transform-re value))
|
(or (not (string? value)) (not (re-matches text-transform-re value)))
|
||||||
(u/display-not-valid :textTransform value)
|
(u/display-not-valid :textTransform value)
|
||||||
|
|
||||||
(not (r/check-permission plugin-id "content:write"))
|
(not (r/check-permission plugin-id "content:write"))
|
||||||
|
@ -520,7 +520,7 @@
|
||||||
(fn [self value]
|
(fn [self value]
|
||||||
(let [id (obj/get self "$id")]
|
(let [id (obj/get self "$id")]
|
||||||
(cond
|
(cond
|
||||||
(and (string? value) (re-matches text-decoration-re value))
|
(or (not (string? value)) (not (re-matches text-decoration-re value)))
|
||||||
(u/display-not-valid :textDecoration value)
|
(u/display-not-valid :textDecoration value)
|
||||||
|
|
||||||
(not (r/check-permission plugin-id "content:write"))
|
(not (r/check-permission plugin-id "content:write"))
|
||||||
|
@ -535,7 +535,7 @@
|
||||||
(fn [self value]
|
(fn [self value]
|
||||||
(let [id (obj/get self "$id")]
|
(let [id (obj/get self "$id")]
|
||||||
(cond
|
(cond
|
||||||
(and (string? value) (re-matches text-direction-re value))
|
(or (not (string? value)) (not (re-matches text-direction-re value)))
|
||||||
(u/display-not-valid :textDirection value)
|
(u/display-not-valid :textDirection value)
|
||||||
|
|
||||||
(not (r/check-permission plugin-id "content:write"))
|
(not (r/check-permission plugin-id "content:write"))
|
||||||
|
@ -550,7 +550,7 @@
|
||||||
(fn [self value]
|
(fn [self value]
|
||||||
(let [id (obj/get self "$id")]
|
(let [id (obj/get self "$id")]
|
||||||
(cond
|
(cond
|
||||||
(and (string? value) (re-matches text-align-re value))
|
(or (not (string? value)) (not (re-matches text-align-re value)))
|
||||||
(u/display-not-valid :align value)
|
(u/display-not-valid :align value)
|
||||||
|
|
||||||
(not (r/check-permission plugin-id "content:write"))
|
(not (r/check-permission plugin-id "content:write"))
|
||||||
|
@ -565,7 +565,7 @@
|
||||||
(fn [self value]
|
(fn [self value]
|
||||||
(let [id (obj/get self "$id")]
|
(let [id (obj/get self "$id")]
|
||||||
(cond
|
(cond
|
||||||
(and (string? value) (re-matches vertical-align-re value))
|
(or (not (string? value)) (not (re-matches vertical-align-re value)))
|
||||||
(u/display-not-valid :verticalAlign value)
|
(u/display-not-valid :verticalAlign value)
|
||||||
|
|
||||||
(not (r/check-permission plugin-id "content:write"))
|
(not (r/check-permission plugin-id "content:write"))
|
||||||
|
|
Loading…
Add table
Reference in a new issue