mirror of
https://github.com/penpot/penpot.git
synced 2025-05-10 21:46:38 +02:00
Merge remote-tracking branch 'origin/staging' into develop
This commit is contained in:
commit
93fbb0655f
1 changed files with 13 additions and 3 deletions
|
@ -20,6 +20,7 @@
|
||||||
[app.util.router :as rt]
|
[app.util.router :as rt]
|
||||||
[app.util.timers :as tm]
|
[app.util.timers :as tm]
|
||||||
[cljs.spec.alpha :as s]
|
[cljs.spec.alpha :as s]
|
||||||
|
[cuerdas.core :as str]
|
||||||
[potok.core :as ptk]
|
[potok.core :as ptk]
|
||||||
[rumext.v2 :as mf]))
|
[rumext.v2 :as mf]))
|
||||||
|
|
||||||
|
@ -126,6 +127,9 @@
|
||||||
|
|
||||||
roles (mf/use-memo #(get-available-roles))
|
roles (mf/use-memo #(get-available-roles))
|
||||||
|
|
||||||
|
profile (mf/deref refs/profile)
|
||||||
|
email (-> profile :email str/lower)
|
||||||
|
|
||||||
on-success
|
on-success
|
||||||
(mf/use-callback
|
(mf/use-callback
|
||||||
(fn [_form response]
|
(fn [_form response]
|
||||||
|
@ -160,11 +164,17 @@
|
||||||
(fn [form _]
|
(fn [form _]
|
||||||
(let [mdata {:on-success (partial on-success form)
|
(let [mdata {:on-success (partial on-success form)
|
||||||
:on-error (partial on-error form)}
|
:on-error (partial on-error form)}
|
||||||
params (:clean-data @form)]
|
params (:clean-data @form)
|
||||||
(st/emit! (dd/create-team-with-invitations (with-meta params mdata))
|
emails (disj (:emails params) email)
|
||||||
|
params (assoc params :emails emails)]
|
||||||
|
|
||||||
|
(st/emit! (if (> (count emails) 0)
|
||||||
|
;; If the user is only inviting to itself we don't call to create-team-with-invitations
|
||||||
|
(dd/create-team-with-invitations (with-meta params mdata))
|
||||||
|
(dd/create-team (with-meta {:name name} mdata)))
|
||||||
(ptk/event ::ev/event {::ev/name "create-team-and-send-invitations"
|
(ptk/event ::ev/event {::ev/name "create-team-and-send-invitations"
|
||||||
::ev/origin "onboarding"
|
::ev/origin "onboarding"
|
||||||
:invites (count (:emails params))
|
:invites (count emails)
|
||||||
:role (:role params)
|
:role (:role params)
|
||||||
:name name
|
:name name
|
||||||
:step 2})))))]
|
:step 2})))))]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue