Merge remote-tracking branch 'origin/main' into develop

This commit is contained in:
Andrey Antukh 2021-05-06 19:53:21 +02:00
commit 1fd2b3fff8
8 changed files with 41 additions and 16 deletions

View file

@ -72,18 +72,26 @@
(rx/subs
(fn [tdata]
(handle-token tdata))
(fn [error]
(case (:code error)
:email-already-exists
(fn [{:keys [type code] :as error}]
(cond
(and (= :validation type)
(= :invalid-token code)
(= :token-expired (:reason error)))
(let [msg (tr "errors.token-expired")]
(ts/schedule 100 #(st/emit! (dm/error msg)))
(st/emit! (rt/nav :auth-login)))
(= :email-already-exists code)
(let [msg (tr "errors.email-already-exists")]
(ts/schedule 100 #(st/emit! (dm/error msg)))
(st/emit! (rt/nav :auth-login)))
:email-already-validated
(= :email-already-validated code)
(let [msg (tr "errors.email-already-validated")]
(ts/schedule 100 #(st/emit! (dm/warn msg)))
(st/emit! (rt/nav :auth-login)))
:else
(let [msg (tr "errors.generic")]
(ts/schedule 100 #(st/emit! (dm/error msg)))
(st/emit! (rt/nav :auth-login)))))))))

View file

@ -85,7 +85,8 @@
;; https://tree.taiga.io/project/uxboxproject/issue/1083
;; {:value "viewer" :label (tr "labels.viewer")}]
initial (mf/use-memo (mf/deps team) (constantly {:team-id (:id team)}))
initial (mf/use-memo (mf/deps team) (constantly {:team-id (:id team)
:role "editor"}))
form (fm/use-form :spec ::invite-member-form
:initial initial)
on-success

View file

@ -6,6 +6,7 @@
(ns app.main.ui.onboarding
(:require
[app.config :as cf]
[app.common.spec :as us]
[app.main.data.dashboard :as dd]
[app.main.data.messages :as dm]
@ -38,9 +39,9 @@
[:div.modal-right
[:div.modal-title
[:h2 "Welcome to Penpot!"]]
[:span.release "Alpha version 1.0"]
[:span.release "Alpha version " (:main @cf/version)]
[:div.modal-content
[:p "We are very happy to introduce you to the very first Alpha 1.0 release."]
[:p "We are very happy to introduce you to the very first Alpha release."]
[:p "Penpot is still at development stage and there will be constant updates. We hope you enjoy the first stable version."]]
[:div.modal-navigation
[:button.btn-secondary {:on-click next} "Continue"]]]