mirror of
https://github.com/penpot/penpot.git
synced 2025-12-11 22:14:05 +01:00
🎉 Add RPC command for clone builtin template
This commit is contained in:
@@ -604,3 +604,19 @@
|
||||
(t/is (= (:library-file-id item1) (:id file2))))
|
||||
|
||||
)))
|
||||
|
||||
(t/deftest clone-template
|
||||
(let [prof (th/create-profile* 1 {:is-active true})
|
||||
data {::th/type :clone-template
|
||||
:profile-id (:id prof)
|
||||
:project-id (:default-project-id prof)
|
||||
:template-id "test"}
|
||||
|
||||
out (th/command! data)]
|
||||
;; (th/print-result! out)
|
||||
|
||||
(t/is (nil? (:error out)))
|
||||
(let [result (:result out)]
|
||||
(t/is (set? result))
|
||||
(t/is (uuid? (first result)))
|
||||
(t/is (= 1 (count result))))))
|
||||
|
||||
BIN
backend/test/app/test_files/template.penpot
Normal file
BIN
backend/test/app/test_files/template.penpot
Normal file
Binary file not shown.
@@ -50,11 +50,18 @@
|
||||
|
||||
(defn state-init
|
||||
[next]
|
||||
(let [config (-> main/system-config
|
||||
(let [templates [{:id "test"
|
||||
:name "test"
|
||||
:file-uri "test"
|
||||
:thumbnail-uri "test"
|
||||
:path (-> "app/test_files/template.penpot" io/resource fs/path)}]
|
||||
|
||||
config (-> main/system-config
|
||||
(assoc-in [:app.msgbus/msgbus :redis-uri] (:redis-uri config))
|
||||
(assoc-in [:app.db/pool :uri] (:database-uri config))
|
||||
(assoc-in [:app.db/pool :username] (:database-username config))
|
||||
(assoc-in [:app.db/pool :password] (:database-password config))
|
||||
(assoc-in [:app.rpc/methods :templates] templates)
|
||||
(dissoc :app.srepl/server
|
||||
:app.http/server
|
||||
:app.http/router
|
||||
@@ -64,6 +71,7 @@
|
||||
:app.auth.oidc/gitlab-provider
|
||||
:app.auth.oidc/github-provider
|
||||
:app.auth.oidc/generic-provider
|
||||
:app.setup/builtin-templates
|
||||
:app.auth.oidc/routes
|
||||
;; :app.auth.ldap/provider
|
||||
:app.worker/executors-monitor
|
||||
|
||||
Reference in New Issue
Block a user