mirror of
https://github.com/penpot/penpot.git
synced 2025-05-30 21:46:12 +02:00
🐛 Fix validation
This commit is contained in:
parent
1ab690a408
commit
1fa8888bf3
2 changed files with 4 additions and 4 deletions
|
@ -133,7 +133,7 @@
|
||||||
(report-error :component-main-external
|
(report-error :component-main-external
|
||||||
(str/format "Main instance should refer to a component in the same file")
|
(str/format "Main instance should refer to a component in the same file")
|
||||||
shape file page))
|
shape file page))
|
||||||
(let [component (ctf/resolve-component shape file libraries {:include-deleted? true})]
|
(let [component (ctf/resolve-component shape file libraries :include-deleted? true)]
|
||||||
(if (nil? component)
|
(if (nil? component)
|
||||||
(report-error :component-not-found
|
(report-error :component-not-found
|
||||||
(str/format "Component %s not found in file" (:component-id shape) (:component-file shape))
|
(str/format "Component %s not found in file" (:component-id shape) (:component-file shape))
|
||||||
|
|
|
@ -126,10 +126,10 @@
|
||||||
|
|
||||||
(defn resolve-component
|
(defn resolve-component
|
||||||
"Retrieve the referenced component, from the local file or from a library"
|
"Retrieve the referenced component, from the local file or from a library"
|
||||||
[shape file libraries & params]
|
[shape file libraries & {:keys [include-deleted?] :or {include-deleted? false}}]
|
||||||
(if (= (:component-file shape) (:id file))
|
(if (= (:component-file shape) (:id file))
|
||||||
(ctkl/get-component (:data file) (:component-id shape) params)
|
(ctkl/get-component (:data file) (:component-id shape) include-deleted?)
|
||||||
(get-component libraries (:component-file shape) (:component-id shape) params)))
|
(get-component libraries (:component-file shape) (:component-id shape) :include-deleted? include-deleted?)))
|
||||||
|
|
||||||
(defn get-component-library
|
(defn get-component-library
|
||||||
"Retrieve the library the component belongs to."
|
"Retrieve the library the component belongs to."
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue