♻️ Move app.common.pages to app.common.files

This commit is contained in:
Andrey Antukh 2023-11-15 16:35:52 +01:00
parent 8345548a7a
commit 52fbc678f3
139 changed files with 1459 additions and 1510 deletions

View file

@ -8,8 +8,6 @@
(:require
[app.common.geom.point :as gpt]
[app.common.geom.shapes :as gsh]
[app.common.pages :as cp]
[app.common.pages.helpers :as cph]
[app.common.pprint :as pp]
[app.common.schema :as sm]
[app.common.uuid :as uuid]

View file

@ -6,7 +6,7 @@
(ns frontend-tests.helpers.libraries
(:require
[app.common.pages.helpers :as cph]
[app.common.files.helpers :as cfh]
[app.common.types.container :as ctn]
[app.common.types.file :as ctf]
[app.main.data.workspace.state-helpers :as wsh]
@ -82,7 +82,7 @@
verify that they are a well constructed instance tree."
[state root-id]
(let [page (thp/current-page state)
shapes (cph/get-children-with-self (:objects page)
shapes (cfh/get-children-with-self (:objects page)
root-id)]
(is-instance-root (first shapes))
(run! is-instance-inner (rest shapes))
@ -94,7 +94,7 @@
verify that they are not a component instance."
[state root-id]
(let [page (thp/current-page state)
shapes (cph/get-children-with-self (:objects page)
shapes (cfh/get-children-with-self (:objects page)
root-id)]
(run! is-noninstance shapes)
@ -115,7 +115,7 @@
component (ctf/find-component libs (:component-id root-inst))
library (ctf/get-component-library libs root-inst)
shapes-inst (cph/get-children-with-self (:objects page) root-inst-id)
shapes-inst (cfh/get-children-with-self (:objects page) root-inst-id)
shapes-main (ctf/get-component-shapes (:data library) component)
unique-refs (into #{} (map :shape-ref) shapes-inst)
@ -155,7 +155,7 @@
component (ctf/find-component libs (:component-id root-inst))
library (ctf/get-component-library libs root-inst)
shapes-inst (cph/get-children-with-self (:objects page) root-inst-id)
shapes-inst (cfh/get-children-with-self (:objects page) root-inst-id)
shapes-main (ctf/get-component-shapes (:data library) component)]
;; Validate that the instance tree is well constructed

View file

@ -7,14 +7,12 @@
(ns frontend-tests.helpers.pages
(:require
[app.common.data :as d]
[app.common.files.changes :as cp]
[app.common.files.changes-builder :as pcb]
[app.common.files.helpers :as cfh]
[app.common.files.libraries-helpers :as cflh]
[app.common.files.shapes-helpers :as cfsh]
[app.common.geom.point :as gpt]
[app.common.pages :as cp]
[app.common.pages.changes-builder :as pcb]
[app.common.files.libraries-helpers :as cflh]
[app.common.files.shapes-helpers :as cfsh]
[app.common.pages.helpers :as cph]
[app.common.types.shape :as cts]
[app.common.uuid :as uuid]
[app.main.data.workspace.groups :as dwg]
@ -62,7 +60,7 @@
(defn get-children
[state label]
(let [page (current-page state)]
(cph/get-children (:objects page) (id label))))
(cfh/get-children (:objects page) (id label))))
(defn sample-page
([state] (sample-page state {}))
@ -83,7 +81,7 @@
([state label type] (sample-shape state type {}))
([state label type props]
(let [page (current-page state)
frame (cph/get-frame (:objects page))
frame (cfh/get-frame (:objects page))
shape (cts/setup-shape (merge {:type type :x 0 :y 0 :width 1 :height 1} props))]
(swap! idmap assoc label (:id shape))
(update state :workspace-data

View file

@ -9,7 +9,6 @@
[app.common.colors :as clr]
[app.common.data :as d]
[app.common.geom.point :as gpt]
[app.common.pages.helpers :as cph]
[app.main.data.workspace.libraries :as dwl]
[beicon.core :as rx]
[cljs.pprint :refer [pprint]]

View file

@ -3,7 +3,6 @@
[app.common.colors :as clr]
[app.common.data :as d]
[app.common.geom.point :as gpt]
[app.common.pages.helpers :as cph]
[app.main.data.workspace.libraries :as dwl]
[app.test-helpers.events :as the]
[app.test-helpers.libraries :as thl]