mirror of
https://github.com/penpot/penpot.git
synced 2025-02-26 08:45:34 -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/WatchEvent
|
||||
(watch [this state stream]
|
||||
(let [team-id (:default-team-id data)]
|
||||
(rx/of (du/profile-fetched data)
|
||||
(rt/navigate :dashboard-team {:team-id "self"})))))
|
||||
(rt/navigate :dashboard-team {:team-id team-id}))))))
|
||||
|
||||
;; --- Login
|
||||
|
||||
|
|
|
@ -63,7 +63,6 @@
|
|||
|
||||
(defn- handle-response
|
||||
[response]
|
||||
;; (prn "handle-response1" response)
|
||||
(cond
|
||||
(http/success? response)
|
||||
(rx/of (:body response))
|
||||
|
|
|
@ -41,14 +41,10 @@
|
|||
(uuid-str? team-id)
|
||||
(assoc :team-id (uuid team-id))
|
||||
|
||||
(= "self" team-id)
|
||||
(assoc :team-id (:default-team-id profile))
|
||||
|
||||
(uuid-str? project-id)
|
||||
(assoc :project-id (uuid project-id))
|
||||
|
||||
(and (= "drafts" project-id)
|
||||
(= "self" team-id))
|
||||
(= "drafts" project-id)
|
||||
(assoc :project-id (:default-project-id profile))
|
||||
|
||||
(str/starts-with? (name route-name) "dashboard-library")
|
||||
|
|
|
@ -178,4 +178,4 @@
|
|||
:selected-project-id project-id
|
||||
:selected-section section
|
||||
:profile profile
|
||||
:team-id "self"}]]]))
|
||||
:team-id (:default-team-id profile)}]]]))
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
[:main.settings-main
|
||||
[:& messages]
|
||||
[:div.settings-content
|
||||
[:& header {:section section}]
|
||||
[:& header {:section section :profile profile}]
|
||||
(case section
|
||||
:settings-profile (mf/element profile-page)
|
||||
:settings-password (mf/element password-page))]]))
|
||||
|
|
|
@ -15,12 +15,14 @@
|
|||
[uxbox.util.router :as rt]))
|
||||
|
||||
(mf/defc header
|
||||
[{:keys [section] :as props}]
|
||||
[{:keys [section profile] :as props}]
|
||||
(let [profile? (= section :settings-profile)
|
||||
password? (= section :settings-password)
|
||||
locale (i18n/use-locale)]
|
||||
locale (i18n/use-locale)
|
||||
team-id (:default-team-id profile)]
|
||||
[: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]
|
||||
[:section.main-bar
|
||||
[:nav
|
||||
|
|
|
@ -121,7 +121,8 @@
|
|||
(mf/defc header
|
||||
[{:keys [file layout project] :as props}]
|
||||
(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)
|
||||
page (mf/deref refs/workspace-page)
|
||||
locale (i18n/use-locale)
|
||||
|
@ -129,7 +130,7 @@
|
|||
view-url (rt/resolve router :viewer {:page-id (:id page)} {:index 0})]
|
||||
[:header.workspace-header
|
||||
[:div.main-icon
|
||||
[:a {:on-click go-to-dashboard} i/logo-icon]]
|
||||
[:a {:on-click go-back} i/logo-icon]]
|
||||
|
||||
[:& menu {:layout layout
|
||||
:project project
|
||||
|
|
Loading…
Add table
Reference in a new issue