0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-08 08:09:14 -05:00

Normalize default page data structure.

This commit is contained in:
Andrey Antukh 2020-01-14 15:37:40 +01:00
parent 422536d4a1
commit e61cdc500c
3 changed files with 10 additions and 10 deletions

View file

@ -14,6 +14,7 @@
[uxbox.db :as db]
[uxbox.common.exceptions :as ex]
[uxbox.common.spec :as us]
[uxbox.common.pages :as cp]
[uxbox.services.mutations :as sm]
[uxbox.services.mutations.projects :as proj]
[uxbox.services.util :as su]

View file

@ -135,6 +135,14 @@
(s/def ::change (s/multi-spec change-spec-impl :type))
(s/def ::changes (s/coll-of ::change))
(def default-page-data
"A reference value of the empty page data."
{:version 1
:shapes []
:canvas []
:options {}
:shapes-by-id {}})
;; --- Changes Processing Impl
(declare process-change)

View file

@ -350,15 +350,6 @@
(declare page-created)
(def default-page-data
{:version 1
:shapes []
:canvas []
:options {:grid-x 10
:grid-y 10
:grid-color "#cccccc"}
:shapes-by-id {}})
(def create-empty-page
(ptk/reify ::create-empty-page
ptk/WatchEvent
@ -369,7 +360,7 @@
params {:name name
:file-id file-id
:ordering ordering
:data default-page-data}]
:data cp/default-page-data}]
(->> (rp/mutation :create-project-page params)
(rx/map page-created))))))