0
Fork 0
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:
Andrey Antukh 2020-04-27 09:52:46 +02:00 committed by Alonso Torres
parent 285735e35f
commit f4f79008a4
7 changed files with 14 additions and 15 deletions

View file

@ -32,8 +32,9 @@
(ptk/reify ::logged-in
ptk/WatchEvent
(watch [this state stream]
(rx/of (du/profile-fetched data)
(rt/navigate :dashboard-team {:team-id "self"})))))
(let [team-id (:default-team-id data)]
(rx/of (du/profile-fetched data)
(rt/navigate :dashboard-team {:team-id team-id}))))))
;; --- Login

View file

@ -63,7 +63,6 @@
(defn- handle-response
[response]
;; (prn "handle-response1" response)
(cond
(http/success? response)
(rx/of (:body response))

View file

@ -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")

View file

@ -178,4 +178,4 @@
:selected-project-id project-id
:selected-section section
:profile profile
:team-id "self"}]]]))
:team-id (:default-team-id profile)}]]]))

View file

@ -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))]]))

View file

@ -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

View file

@ -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