mirror of
https://github.com/penpot/penpot.git
synced 2025-05-28 18:16:10 +02:00
Merge remote-tracking branch 'origin/staging' into develop
This commit is contained in:
commit
888ffa1bcd
13 changed files with 90 additions and 62 deletions
|
@ -61,6 +61,7 @@
|
|||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(declare fetch-projects)
|
||||
(declare fetch-team-members)
|
||||
|
||||
(defn initialize
|
||||
[{:keys [id] :as params}]
|
||||
|
@ -85,6 +86,7 @@
|
|||
(rx/merge
|
||||
(ptk/watch (df/load-team-fonts id) state stream)
|
||||
(ptk/watch (fetch-projects) state stream)
|
||||
(ptk/watch (fetch-team-members) state stream)
|
||||
(ptk/watch (du/fetch-teams) state stream)
|
||||
(ptk/watch (du/fetch-users {:team-id id}) state stream)))))
|
||||
|
||||
|
|
|
@ -145,7 +145,8 @@
|
|||
(rx/mapcat (fn [profile]
|
||||
(if (= uuid/zero (:id profile))
|
||||
(rx/empty)
|
||||
(rx/of (fetch-teams))))))))))
|
||||
(rx/of (fetch-teams)))))
|
||||
(rx/observe-on :async))))))
|
||||
|
||||
;; --- EVENT: login
|
||||
|
||||
|
@ -155,13 +156,8 @@
|
|||
accepting invitation, or third party auth signup or singin."
|
||||
[profile]
|
||||
(letfn [(get-redirect-event []
|
||||
(if-let [{:keys [data path-params query-params]} (::redirect-to @storage)]
|
||||
(do
|
||||
(swap! storage dissoc ::redirect-to)
|
||||
(rt/nav' (:name data) path-params query-params))
|
||||
(let [team-id (:default-team-id profile)]
|
||||
(rt/nav' :dashboard-projects {:team-id team-id}))))]
|
||||
|
||||
(let [team-id (:default-team-id profile)]
|
||||
(rt/nav' :dashboard-projects {:team-id team-id})))]
|
||||
(ptk/reify ::logged-in
|
||||
IDeref
|
||||
(-deref [_] profile)
|
||||
|
@ -254,17 +250,13 @@
|
|||
(with-meta profile
|
||||
{::ev/source "register"})))
|
||||
(rx/map logged-in)
|
||||
(rx/observe-on :async))))
|
||||
|
||||
ptk/EffectEvent
|
||||
(effect [_ _ _]
|
||||
(swap! storage dissoc ::redirect-to))))
|
||||
(rx/observe-on :async))))))
|
||||
|
||||
;; --- EVENT: logout
|
||||
|
||||
(defn logged-out
|
||||
([] (logged-out {}))
|
||||
([{:keys [capture-redirect?] :or {capture-redirect? false}}]
|
||||
([_params]
|
||||
(ptk/reify ::logged-out
|
||||
ptk/UpdateEvent
|
||||
(update [_ state]
|
||||
|
@ -278,10 +270,8 @@
|
|||
(rx/observe-on :async)))
|
||||
|
||||
ptk/EffectEvent
|
||||
(effect [_ state _]
|
||||
(when capture-redirect?
|
||||
(let [route (into {} (:route state))]
|
||||
(reset! storage {::redirect-to route})))
|
||||
(effect [_ _ _]
|
||||
(reset! storage {})
|
||||
(i18n/reset-locale)))))
|
||||
|
||||
(defn logout
|
||||
|
@ -391,7 +381,6 @@
|
|||
(rx/empty)))
|
||||
(rx/ignore))))))
|
||||
|
||||
|
||||
(defn mark-onboarding-as-viewed
|
||||
([] (mark-onboarding-as-viewed nil))
|
||||
([{:keys [version]}]
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
(defmethod ptk/handle-error :authentication
|
||||
[_]
|
||||
(let [msg (tr "errors.auth.unable-to-login")]
|
||||
(st/emit! (du/logout {:capture-redirect? true}))
|
||||
(st/emit! (du/logout {:capture-redirect true}))
|
||||
(ts/schedule 500 (st/emitf (dm/warn msg)))))
|
||||
|
||||
|
||||
|
|
|
@ -522,7 +522,7 @@
|
|||
[:li.feedback {:on-click (partial on-click :settings-feedback)}
|
||||
[:span.icon i/msg-info]
|
||||
[:span.text (tr "labels.give-feedback")]
|
||||
[:span.primary-badge "ALPHA"]])]]]
|
||||
[:span.primary-badge "BETA"]])]]]
|
||||
|
||||
(when (and team profile)
|
||||
[:& comments-section {:profile profile
|
||||
|
|
|
@ -19,10 +19,12 @@
|
|||
(letfn [(on-init []
|
||||
(when-let [container (mf/ref-val container-ref)]
|
||||
(-> (.embed js/ArenguForms form-id container)
|
||||
(p/then (fn [form] (.setHiddenField ^js form "email" email))))))
|
||||
(p/then (fn [form]
|
||||
(.setHiddenField ^js form "email" email))))))
|
||||
|
||||
(on-submit-success [_]
|
||||
(st/emit! (du/mark-questions-as-answered)))]
|
||||
(on-submit-success [_event]
|
||||
(st/emit! (du/mark-questions-as-answered)))
|
||||
]
|
||||
|
||||
(let [script (dom/create-element "script")
|
||||
head (unchecked-get js/document "head")
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
[app.main.ui.releases.v1-7]
|
||||
[app.main.ui.releases.v1-8]
|
||||
[app.main.ui.releases.v1-9]
|
||||
[app.main.ui.releases.v1-10]
|
||||
[app.util.object :as obj]
|
||||
[app.util.timers :as tm]
|
||||
[rumext.alpha :as mf]))
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
[props]
|
||||
(let [children (obj/get props "children")
|
||||
on-click (mf/use-callback #(set! (.-href globals/location) ""))]
|
||||
|
||||
[:section.exception-layout
|
||||
[:div.exception-header
|
||||
{:on-click on-click}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue