mirror of
https://github.com/penpot/penpot.git
synced 2025-07-21 01:37:14 +02:00
🐛 Create default projects for teams in devenv fixtures
This commit is contained in:
parent
0cb816c16d
commit
ef901dbd5e
1 changed files with 12 additions and 4 deletions
|
@ -132,12 +132,18 @@
|
||||||
(range (:num-files-per-project opts))))
|
(range (:num-files-per-project opts))))
|
||||||
|
|
||||||
(create-project [conn team-id owner-id index]
|
(create-project [conn team-id owner-id index]
|
||||||
(let [id (mk-uuid "project" team-id index)
|
(let [id (if index
|
||||||
name (str "project " index)]
|
(mk-uuid "project" team-id index)
|
||||||
|
(mk-uuid "project" team-id))
|
||||||
|
name (if index
|
||||||
|
(str "project " index)
|
||||||
|
"Drafts")
|
||||||
|
is-default (nil? index)]
|
||||||
(log/info "create project" index id)
|
(log/info "create project" index id)
|
||||||
(db/insert! conn :project
|
(db/insert! conn :project
|
||||||
{:id id
|
{:id id
|
||||||
:team-id team-id
|
:team-id team-id
|
||||||
|
:is-default is-default
|
||||||
:name name})
|
:name name})
|
||||||
(db/insert! conn :project-profile-rel
|
(db/insert! conn :project-profile-rel
|
||||||
{:project-id id
|
{:project-id id
|
||||||
|
@ -150,8 +156,10 @@
|
||||||
(create-projects [conn team-id profile-ids]
|
(create-projects [conn team-id profile-ids]
|
||||||
(log/info "create projects")
|
(log/info "create projects")
|
||||||
(let [owner-id (rng-nth rng profile-ids)
|
(let [owner-id (rng-nth rng profile-ids)
|
||||||
project-ids (collect (partial create-project conn team-id owner-id)
|
project-ids (conj
|
||||||
(range (:num-projects-per-team opts)))]
|
(collect (partial create-project conn team-id owner-id)
|
||||||
|
(range (:num-projects-per-team opts)))
|
||||||
|
(create-project conn team-id owner-id nil))]
|
||||||
(run! (partial create-files conn owner-id) project-ids)))
|
(run! (partial create-files conn owner-id) project-ids)))
|
||||||
|
|
||||||
(assign-profile-to-team [conn team-id owner? profile-id]
|
(assign-profile-to-team [conn team-id owner? profile-id]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue