mirror of
https://github.com/penpot/penpot.git
synced 2025-06-07 07:01:37 +02:00
🔥 Remove unused code.
This commit is contained in:
parent
f4a15e6db7
commit
eeb2f39ada
8 changed files with 14 additions and 48 deletions
|
@ -73,6 +73,7 @@
|
||||||
(rx/of (fetch-files (:project-id local))
|
(rx/of (fetch-files (:project-id local))
|
||||||
(fetch-projects (:team-id local)))))))
|
(fetch-projects (:team-id local)))))))
|
||||||
|
|
||||||
|
|
||||||
(defn initialize-team
|
(defn initialize-team
|
||||||
[team-id]
|
[team-id]
|
||||||
(us/verify ::us/uuid team-id)
|
(us/verify ::us/uuid team-id)
|
||||||
|
@ -86,8 +87,8 @@
|
||||||
ptk/WatchEvent
|
ptk/WatchEvent
|
||||||
(watch [_ state stream]
|
(watch [_ state stream]
|
||||||
(let [local (:dashboard-local state)]
|
(let [local (:dashboard-local state)]
|
||||||
;; TODO
|
(rx/of (fetch-projects (:team-id local)))))))
|
||||||
))))
|
|
||||||
|
|
||||||
(defn initialize-project
|
(defn initialize-project
|
||||||
[team-id project-id]
|
[team-id project-id]
|
||||||
|
|
|
@ -22,18 +22,14 @@
|
||||||
[uxbox.main.data.projects :as dp]
|
[uxbox.main.data.projects :as dp]
|
||||||
[uxbox.main.refs :as refs]
|
[uxbox.main.refs :as refs]
|
||||||
[uxbox.main.store :as st]
|
[uxbox.main.store :as st]
|
||||||
[uxbox.main.ui.login :refer [login-page]]
|
|
||||||
[uxbox.main.ui.profile.register :refer [profile-register-page]]
|
|
||||||
[uxbox.main.ui.profile.recovery-request :refer [profile-recovery-request-page]]
|
|
||||||
[uxbox.main.ui.profile.recovery :refer [profile-recovery-page]]
|
|
||||||
[uxbox.main.ui.dashboard :refer [dashboard]]
|
[uxbox.main.ui.dashboard :refer [dashboard]]
|
||||||
|
[uxbox.main.ui.login :refer [login-page]]
|
||||||
|
[uxbox.main.ui.profile.recovery :refer [profile-recovery-page]]
|
||||||
|
[uxbox.main.ui.profile.recovery-request :refer [profile-recovery-request-page]]
|
||||||
|
[uxbox.main.ui.profile.register :refer [profile-register-page]]
|
||||||
[uxbox.main.ui.settings :as settings]
|
[uxbox.main.ui.settings :as settings]
|
||||||
[uxbox.main.ui.shapes]
|
[uxbox.main.ui.shapes]
|
||||||
[uxbox.main.ui.workspace :as workspace]
|
[uxbox.main.ui.workspace :as workspace]
|
||||||
[uxbox.util.data :refer [parse-int uuid-str?]]
|
|
||||||
[uxbox.util.components :refer [wrap-catch]]
|
|
||||||
[uxbox.util.dom :as dom]
|
|
||||||
[uxbox.util.html.history :as html-history]
|
|
||||||
[uxbox.util.i18n :refer [tr]]
|
[uxbox.util.i18n :refer [tr]]
|
||||||
[uxbox.util.messages :as uum]
|
[uxbox.util.messages :as uum]
|
||||||
[uxbox.util.router :as rt]
|
[uxbox.util.router :as rt]
|
||||||
|
@ -86,15 +82,8 @@
|
||||||
:else (ex/raise :type :validation
|
:else (ex/raise :type :validation
|
||||||
:code :invalid-project-id))))
|
:code :invalid-project-id))))
|
||||||
|
|
||||||
(mf/defc app-error
|
|
||||||
[{:keys [error] :as props}]
|
|
||||||
(let [data (ex-data error)]
|
|
||||||
(case (:type data)
|
|
||||||
:not-found [:span "404"]
|
|
||||||
[:span "Internal application errror"])))
|
|
||||||
|
|
||||||
(mf/defc app
|
(mf/defc app
|
||||||
{:wrap [#(wrap-catch % app-error)]}
|
|
||||||
[props]
|
[props]
|
||||||
(let [route (mf/deref route-iref)]
|
(let [route (mf/deref route-iref)]
|
||||||
(case (get-in route [:data :name])
|
(case (get-in route [:data :name])
|
||||||
|
@ -118,11 +107,6 @@
|
||||||
:dashboard-project)
|
:dashboard-project)
|
||||||
(mf/element dashboard #js {:route route})
|
(mf/element dashboard #js {:route route})
|
||||||
|
|
||||||
(:dashboard-icons
|
|
||||||
:dashboard-images
|
|
||||||
:dashboard-colors)
|
|
||||||
(mf/element dashboard/dashboard-assets #js {:route route})
|
|
||||||
|
|
||||||
:workspace
|
:workspace
|
||||||
(let [file-id (uuid (get-in route [:params :path :file-id]))
|
(let [file-id (uuid (get-in route [:params :path :file-id]))
|
||||||
page-id (uuid (get-in route [:params :query :page-id]))]
|
page-id (uuid (get-in route [:params :query :page-id]))]
|
||||||
|
|
|
@ -13,14 +13,19 @@
|
||||||
[cuerdas.core :as str]
|
[cuerdas.core :as str]
|
||||||
[rumext.alpha :as mf]
|
[rumext.alpha :as mf]
|
||||||
[uxbox.common.exceptions :as ex]
|
[uxbox.common.exceptions :as ex]
|
||||||
|
[uxbox.common.spec :as us]
|
||||||
[uxbox.main.refs :as refs]
|
[uxbox.main.refs :as refs]
|
||||||
[uxbox.util.data :refer [uuid-str?]]
|
|
||||||
[uxbox.main.ui.dashboard.header :refer [header]]
|
[uxbox.main.ui.dashboard.header :refer [header]]
|
||||||
[uxbox.main.ui.dashboard.sidebar :refer [sidebar]]
|
[uxbox.main.ui.dashboard.sidebar :refer [sidebar]]
|
||||||
[uxbox.main.ui.dashboard.project :refer [project-page]]
|
[uxbox.main.ui.dashboard.project :refer [project-page]]
|
||||||
[uxbox.main.ui.dashboard.team :refer [team-page]]
|
[uxbox.main.ui.dashboard.team :refer [team-page]]
|
||||||
[uxbox.main.ui.messages :refer [messages-widget]]))
|
[uxbox.main.ui.messages :refer [messages-widget]]))
|
||||||
|
|
||||||
|
(defn- ^boolean uuid-str?
|
||||||
|
[s]
|
||||||
|
(and (string? s)
|
||||||
|
(boolean (re-seq us/uuid-rx s))))
|
||||||
|
|
||||||
(defn- parse-params
|
(defn- parse-params
|
||||||
[route profile]
|
[route profile]
|
||||||
(let [team-id (get-in route [:params :path :team-id])
|
(let [team-id (get-in route [:params :path :team-id])
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
[uxbox.main.ui.modal :as modal]
|
[uxbox.main.ui.modal :as modal]
|
||||||
[uxbox.main.ui.shapes.icon :as icon]
|
[uxbox.main.ui.shapes.icon :as icon]
|
||||||
[uxbox.util.components :refer [chunked-list]]
|
[uxbox.util.components :refer [chunked-list]]
|
||||||
[uxbox.util.data :refer [read-string jscoll->vec seek]]
|
[uxbox.util.data :refer [read-string seek]]
|
||||||
[uxbox.util.dom :as dom]
|
[uxbox.util.dom :as dom]
|
||||||
[uxbox.util.i18n :as i18n :refer [tr t]]
|
[uxbox.util.i18n :as i18n :refer [tr t]]
|
||||||
[uxbox.util.router :as rt]
|
[uxbox.util.router :as rt]
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
[uxbox.main.ui.dashboard.header :refer [header]]
|
[uxbox.main.ui.dashboard.header :refer [header]]
|
||||||
[uxbox.main.ui.dashboard.sidebar :refer [sidebar]]
|
[uxbox.main.ui.dashboard.sidebar :refer [sidebar]]
|
||||||
[uxbox.main.ui.messages :refer [messages-widget]]
|
[uxbox.main.ui.messages :refer [messages-widget]]
|
||||||
[uxbox.util.data :refer [uuid-str?]]
|
|
||||||
[uxbox.util.dom :as dom]
|
[uxbox.util.dom :as dom]
|
||||||
[uxbox.util.i18n :as i18n :refer [t tr]]
|
[uxbox.util.i18n :as i18n :refer [t tr]]
|
||||||
[uxbox.util.router :as rt]
|
[uxbox.util.router :as rt]
|
||||||
|
|
|
@ -26,7 +26,6 @@
|
||||||
[uxbox.main.ui.dashboard.common :as common]
|
[uxbox.main.ui.dashboard.common :as common]
|
||||||
[uxbox.main.ui.dashboard.header :refer [header]]
|
[uxbox.main.ui.dashboard.header :refer [header]]
|
||||||
[uxbox.main.ui.messages :refer [messages-widget]]
|
[uxbox.main.ui.messages :refer [messages-widget]]
|
||||||
[uxbox.util.data :refer [read-string parse-int uuid-str?]]
|
|
||||||
[uxbox.util.dom :as dom]
|
[uxbox.util.dom :as dom]
|
||||||
[uxbox.util.i18n :as i18n :refer [t tr]]
|
[uxbox.util.i18n :as i18n :refer [t tr]]
|
||||||
[uxbox.util.router :as rt]
|
[uxbox.util.router :as rt]
|
||||||
|
|
|
@ -9,9 +9,7 @@
|
||||||
;; Copyright (c) 2015-2020 Juan de la Cruz <delacruzgarciajuan@gmail.com>
|
;; Copyright (c) 2015-2020 Juan de la Cruz <delacruzgarciajuan@gmail.com>
|
||||||
|
|
||||||
(ns uxbox.main.ui.dashboard.team
|
(ns uxbox.main.ui.dashboard.team
|
||||||
(:refer-clojure :exclude [sort-by])
|
|
||||||
(:require
|
(:require
|
||||||
[cuerdas.core :as str]
|
|
||||||
[lentes.core :as l]
|
[lentes.core :as l]
|
||||||
[rumext.alpha :as mf]
|
[rumext.alpha :as mf]
|
||||||
[uxbox.builtins.icons :as i]
|
[uxbox.builtins.icons :as i]
|
||||||
|
|
|
@ -111,26 +111,6 @@
|
||||||
not-found))
|
not-found))
|
||||||
not-found coll)))
|
not-found coll)))
|
||||||
|
|
||||||
;; --- String utils
|
|
||||||
|
|
||||||
(def +uuid-re+
|
|
||||||
#"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$")
|
|
||||||
|
|
||||||
(defn uuid-str?
|
|
||||||
[v]
|
|
||||||
(and (string? v)
|
|
||||||
(re-seq +uuid-re+ v)))
|
|
||||||
|
|
||||||
;; --- Interop
|
|
||||||
|
|
||||||
(defn jscoll->vec
|
|
||||||
"Convert array like js object into vector."
|
|
||||||
[v]
|
|
||||||
(-> (clj->js [])
|
|
||||||
(.-slice)
|
|
||||||
(.call v)
|
|
||||||
(js->clj)))
|
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; Numbers Parsing
|
;; Numbers Parsing
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue