mirror of
https://github.com/penpot/penpot.git
synced 2025-02-26 16:56:11 -05:00
✨ Remove the use of "self" as default team id.
This commit is contained in:
parent
285735e35f
commit
f4f79008a4
7 changed files with 14 additions and 15 deletions
|
@ -32,8 +32,9 @@
|
||||||
(ptk/reify ::logged-in
|
(ptk/reify ::logged-in
|
||||||
ptk/WatchEvent
|
ptk/WatchEvent
|
||||||
(watch [this state stream]
|
(watch [this state stream]
|
||||||
|
(let [team-id (:default-team-id data)]
|
||||||
(rx/of (du/profile-fetched data)
|
(rx/of (du/profile-fetched data)
|
||||||
(rt/navigate :dashboard-team {:team-id "self"})))))
|
(rt/navigate :dashboard-team {:team-id team-id}))))))
|
||||||
|
|
||||||
;; --- Login
|
;; --- Login
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,6 @@
|
||||||
|
|
||||||
(defn- handle-response
|
(defn- handle-response
|
||||||
[response]
|
[response]
|
||||||
;; (prn "handle-response1" response)
|
|
||||||
(cond
|
(cond
|
||||||
(http/success? response)
|
(http/success? response)
|
||||||
(rx/of (:body response))
|
(rx/of (:body response))
|
||||||
|
|
|
@ -41,14 +41,10 @@
|
||||||
(uuid-str? team-id)
|
(uuid-str? team-id)
|
||||||
(assoc :team-id (uuid team-id))
|
(assoc :team-id (uuid team-id))
|
||||||
|
|
||||||
(= "self" team-id)
|
|
||||||
(assoc :team-id (:default-team-id profile))
|
|
||||||
|
|
||||||
(uuid-str? project-id)
|
(uuid-str? project-id)
|
||||||
(assoc :project-id (uuid project-id))
|
(assoc :project-id (uuid project-id))
|
||||||
|
|
||||||
(and (= "drafts" project-id)
|
(= "drafts" project-id)
|
||||||
(= "self" team-id))
|
|
||||||
(assoc :project-id (:default-project-id profile))
|
(assoc :project-id (:default-project-id profile))
|
||||||
|
|
||||||
(str/starts-with? (name route-name) "dashboard-library")
|
(str/starts-with? (name route-name) "dashboard-library")
|
||||||
|
|
|
@ -178,4 +178,4 @@
|
||||||
:selected-project-id project-id
|
:selected-project-id project-id
|
||||||
:selected-section section
|
:selected-section section
|
||||||
:profile profile
|
:profile profile
|
||||||
:team-id "self"}]]]))
|
:team-id (:default-team-id profile)}]]]))
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
[:main.settings-main
|
[:main.settings-main
|
||||||
[:& messages]
|
[:& messages]
|
||||||
[:div.settings-content
|
[:div.settings-content
|
||||||
[:& header {:section section}]
|
[:& header {:section section :profile profile}]
|
||||||
(case section
|
(case section
|
||||||
:settings-profile (mf/element profile-page)
|
:settings-profile (mf/element profile-page)
|
||||||
:settings-password (mf/element password-page))]]))
|
:settings-password (mf/element password-page))]]))
|
||||||
|
|
|
@ -15,12 +15,14 @@
|
||||||
[uxbox.util.router :as rt]))
|
[uxbox.util.router :as rt]))
|
||||||
|
|
||||||
(mf/defc header
|
(mf/defc header
|
||||||
[{:keys [section] :as props}]
|
[{:keys [section profile] :as props}]
|
||||||
(let [profile? (= section :settings-profile)
|
(let [profile? (= section :settings-profile)
|
||||||
password? (= section :settings-password)
|
password? (= section :settings-password)
|
||||||
locale (i18n/use-locale)]
|
locale (i18n/use-locale)
|
||||||
|
team-id (:default-team-id profile)]
|
||||||
[:header
|
[:header
|
||||||
[:div.main-logo {:on-click #(st/emit! (rt/nav :dashboard-team {:team-id "self"}))}
|
[:div.main-logo
|
||||||
|
{:on-click #(st/emit! (rt/nav :dashboard-team {:team-id team-id}))}
|
||||||
i/logo-icon]
|
i/logo-icon]
|
||||||
[:section.main-bar
|
[:section.main-bar
|
||||||
[:nav
|
[:nav
|
||||||
|
|
|
@ -121,7 +121,8 @@
|
||||||
(mf/defc header
|
(mf/defc header
|
||||||
[{:keys [file layout project] :as props}]
|
[{:keys [file layout project] :as props}]
|
||||||
(let [locale (i18n/use-locale)
|
(let [locale (i18n/use-locale)
|
||||||
go-to-dashboard #(st/emit! (rt/nav :dashboard-team {:team-id "self"}))
|
team-id (:team-id project)
|
||||||
|
go-back #(st/emit! (rt/nav :dashboard-team {:team-id team-id}))
|
||||||
zoom (mf/deref refs/selected-zoom)
|
zoom (mf/deref refs/selected-zoom)
|
||||||
page (mf/deref refs/workspace-page)
|
page (mf/deref refs/workspace-page)
|
||||||
locale (i18n/use-locale)
|
locale (i18n/use-locale)
|
||||||
|
@ -129,7 +130,7 @@
|
||||||
view-url (rt/resolve router :viewer {:page-id (:id page)} {:index 0})]
|
view-url (rt/resolve router :viewer {:page-id (:id page)} {:index 0})]
|
||||||
[:header.workspace-header
|
[:header.workspace-header
|
||||||
[:div.main-icon
|
[:div.main-icon
|
||||||
[:a {:on-click go-to-dashboard} i/logo-icon]]
|
[:a {:on-click go-back} i/logo-icon]]
|
||||||
|
|
||||||
[:& menu {:layout layout
|
[:& menu {:layout layout
|
||||||
:project project
|
:project project
|
||||||
|
|
Loading…
Add table
Reference in a new issue