mirror of
https://github.com/penpot/penpot.git
synced 2025-02-23 07:16:07 -05:00
🎉 Add audit log for new onboarding
This commit is contained in:
parent
5336db4456
commit
b4d5ff3452
1 changed files with 28 additions and 5 deletions
|
@ -9,6 +9,7 @@
|
||||||
[app.common.data :as d]
|
[app.common.data :as d]
|
||||||
[app.common.spec :as us]
|
[app.common.spec :as us]
|
||||||
[app.main.data.dashboard :as dd]
|
[app.main.data.dashboard :as dd]
|
||||||
|
[app.main.data.events :as ev]
|
||||||
[app.main.data.messages :as dm]
|
[app.main.data.messages :as dm]
|
||||||
[app.main.data.modal :as modal]
|
[app.main.data.modal :as modal]
|
||||||
[app.main.refs :as refs]
|
[app.main.refs :as refs]
|
||||||
|
@ -19,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]
|
||||||
|
[potok.core :as ptk]
|
||||||
[rumext.alpha :as mf]))
|
[rumext.alpha :as mf]))
|
||||||
|
|
||||||
(s/def ::name ::us/not-empty-string)
|
(s/def ::name ::us/not-empty-string)
|
||||||
|
@ -57,10 +59,17 @@
|
||||||
(mf/use-callback
|
(mf/use-callback
|
||||||
(fn [form _]
|
(fn [form _]
|
||||||
(let [tname (get-in @form [:clean-data :name])]
|
(let [tname (get-in @form [:clean-data :name])]
|
||||||
(st/emit! (modal/show {:type :onboarding-team-invitations :name tname})))))
|
(st/emit! (modal/show {:type :onboarding-team-invitations :name tname})
|
||||||
|
(ptk/event ::ev/event {::ev/name "choose-team-name"
|
||||||
|
::ev/origin "onboarding"
|
||||||
|
:name tname
|
||||||
|
:step 1})))))
|
||||||
on-skip
|
on-skip
|
||||||
(fn []
|
(fn []
|
||||||
(tm/schedule 400 #(st/emit! (modal/hide))))
|
(tm/schedule 400 #(st/emit! (modal/hide)
|
||||||
|
(ptk/event ::ev/event {::ev/name "create-team-later"
|
||||||
|
::ev/origin "onboarding"
|
||||||
|
:step 1}))))
|
||||||
|
|
||||||
teams (mf/deref refs/teams)]
|
teams (mf/deref refs/teams)]
|
||||||
(if (< (count teams) 2)
|
(if (< (count teams) 2)
|
||||||
|
@ -138,7 +147,11 @@
|
||||||
(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 {:name name}]
|
params {:name name}]
|
||||||
(st/emit! (dd/create-team (with-meta params mdata))))))
|
(st/emit! (dd/create-team (with-meta params mdata))
|
||||||
|
(ptk/event ::ev/event {::ev/name "create-team-and-invite-later"
|
||||||
|
::ev/origin "onboarding"
|
||||||
|
:name name
|
||||||
|
:step 2})))))
|
||||||
|
|
||||||
;; The SUBMIT branch creates the team with the invitations
|
;; The SUBMIT branch creates the team with the invitations
|
||||||
on-submit
|
on-submit
|
||||||
|
@ -147,7 +160,13 @@
|
||||||
(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))))))]
|
(st/emit! (dd/create-team-with-invitations (with-meta params mdata))
|
||||||
|
(ptk/event ::ev/event {::ev/name "create-team-and-send-invitations"
|
||||||
|
::ev/origin "onboarding"
|
||||||
|
:invites (count (:emails params))
|
||||||
|
:role (:role params)
|
||||||
|
:name name
|
||||||
|
:step 2})))))]
|
||||||
|
|
||||||
[:div.modal-overlay
|
[:div.modal-overlay
|
||||||
[:div.modal-container.onboarding-team-members
|
[:div.modal-container.onboarding-team-members
|
||||||
|
@ -171,7 +190,11 @@
|
||||||
|
|
||||||
[:div.buttons
|
[:div.buttons
|
||||||
[:button.btn-secondary.btn-large
|
[:button.btn-secondary.btn-large
|
||||||
{:on-click #(st/emit! (modal/show {:type :onboarding-team}))}
|
{:on-click #(st/emit! (modal/show {:type :onboarding-team})
|
||||||
|
(ptk/event ::ev/event {::ev/name "invite-members-back"
|
||||||
|
::ev/origin "onboarding"
|
||||||
|
:name name
|
||||||
|
:step 2}))}
|
||||||
(tr "labels.back")]
|
(tr "labels.back")]
|
||||||
[:& fm/submit-button
|
[:& fm/submit-button
|
||||||
{:label (tr "onboarding.choice.team-up.invite-members-submit")}]]
|
{:label (tr "onboarding.choice.team-up.invite-members-submit")}]]
|
||||||
|
|
Loading…
Add table
Reference in a new issue