mirror of
https://github.com/penpot/penpot.git
synced 2025-05-30 22:06:12 +02:00
Merge pull request #6345 from penpot/niwinz-staging-add-interaction-cleaning
🐛 Add migration for decoding and cleaning shape interactions
This commit is contained in:
commit
f155042958
12 changed files with 129 additions and 46 deletions
|
@ -89,14 +89,16 @@
|
|||
|
||||
(mf/with-effect [file-id revn visible? thumbnail-id]
|
||||
(when (and visible? (not thumbnail-id))
|
||||
(->> (ask-for-thumbnail file-id revn)
|
||||
(rx/subs! (fn [thumbnail-id]
|
||||
(st/emit! (dd/set-file-thumbnail file-id thumbnail-id)))
|
||||
(fn [cause]
|
||||
(log/error :hint "unable to render thumbnail"
|
||||
:file-if file-id
|
||||
:revn revn
|
||||
:message (ex-message cause)))))))
|
||||
(let [subscription
|
||||
(->> (ask-for-thumbnail file-id revn)
|
||||
(rx/subs! (fn [thumbnail-id]
|
||||
(st/emit! (dd/set-file-thumbnail file-id thumbnail-id)))
|
||||
(fn [cause]
|
||||
(log/error :hint "unable to render thumbnail"
|
||||
:file-if file-id
|
||||
:revn revn
|
||||
:message (ex-message cause)))))]
|
||||
(partial rx/dispose! subscription))))
|
||||
|
||||
[:div {:class (stl/css :grid-item-th)
|
||||
:style {:background-color bg-color}
|
||||
|
|
|
@ -432,7 +432,7 @@
|
|||
(let [id (obj/get self "$id")
|
||||
value (mapv #(shadow-defaults (parser/parse-shadow %)) value)]
|
||||
(cond
|
||||
(not (sm/validate [:vector ::ctss/shadow] value))
|
||||
(not (sm/validate [:vector ctss/schema:shadow] value))
|
||||
(u/display-not-valid :shadows value)
|
||||
|
||||
(not (r/check-permission plugin-id "content:write"))
|
||||
|
|
|
@ -50,7 +50,8 @@
|
|||
[headers]
|
||||
(into {} (map vec) (seq (.entries ^js headers))))
|
||||
|
||||
(def default-headers
|
||||
(defn default-headers
|
||||
[]
|
||||
{"x-frontend-version" (:full cfg/version)})
|
||||
|
||||
(defn fetch
|
||||
|
@ -74,7 +75,7 @@
|
|||
|
||||
headers (cond-> headers
|
||||
(not omit-default-headers)
|
||||
(d/merge default-headers))
|
||||
(merge (default-headers)))
|
||||
|
||||
headers (-update-headers body headers)
|
||||
|
||||
|
|
|
@ -42,12 +42,11 @@
|
|||
:http-body body})))
|
||||
|
||||
(defn- request-data-for-thumbnail
|
||||
[file-id revn features]
|
||||
[file-id revn]
|
||||
(let [path "api/rpc/command/get-file-data-for-thumbnail"
|
||||
params {:file-id file-id
|
||||
:revn revn
|
||||
:strip-frames-with-thumbnails true
|
||||
:features features}
|
||||
:strip-frames-with-thumbnails true}
|
||||
request {:method :get
|
||||
:uri (u/join cf/public-uri path)
|
||||
:credentials "include"
|
||||
|
@ -86,6 +85,6 @@
|
|||
nil)))
|
||||
|
||||
(defmethod impl/handler :thumbnails/generate-for-file
|
||||
[{:keys [file-id revn features] :as message} _]
|
||||
(->> (request-data-for-thumbnail file-id revn features)
|
||||
[{:keys [file-id revn] :as message} _]
|
||||
(->> (request-data-for-thumbnail file-id revn)
|
||||
(rx/map render-thumbnail)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue