mirror of
https://github.com/penpot/penpot.git
synced 2025-02-15 03:28:25 -05:00
✨ Improve onboarding initialization
This commit is contained in:
parent
273a5f7a0a
commit
93ac80f217
5 changed files with 26 additions and 17 deletions
|
@ -491,7 +491,6 @@
|
||||||
ptk/WatchEvent
|
ptk/WatchEvent
|
||||||
(watch [_ _ _]
|
(watch [_ _ _]
|
||||||
(let [props {:onboarding-questions-answered true
|
(let [props {:onboarding-questions-answered true
|
||||||
:onboarding-viewed true
|
|
||||||
:onboarding-questions onboarding-questions}]
|
:onboarding-questions onboarding-questions}]
|
||||||
(->> (rp/cmd! :update-profile-props {:props props})
|
(->> (rp/cmd! :update-profile-props {:props props})
|
||||||
(rx/map (constantly (fetch-profile))))))))
|
(rx/map (constantly (fetch-profile))))))))
|
||||||
|
|
|
@ -98,23 +98,29 @@
|
||||||
#_[:& app.main.ui.onboarding/onboarding-modal]
|
#_[:& app.main.ui.onboarding/onboarding-modal]
|
||||||
#_[:& app.main.ui.onboarding.team-choice/onboarding-team-modal]
|
#_[:& app.main.ui.onboarding.team-choice/onboarding-team-modal]
|
||||||
(when-let [props (get profile :props)]
|
(when-let [props (get profile :props)]
|
||||||
(let [show-question-modal? (and (not (:onboarding-viewed props))
|
(let [show-question-modal?
|
||||||
(contains? cf/flags :onboarding)
|
(and (contains? cf/flags :onboarding)
|
||||||
(not (:onboarding-questions-answered props))
|
(not (:onboarding-viewed props))
|
||||||
(contains? cf/flags :onboarding-questions))
|
(not (contains? props :onboarding-questions)))
|
||||||
|
|
||||||
show-newsletter-modal? (and (not (:onboarding-viewed props))
|
show-newsletter-modal?
|
||||||
(contains? cf/flags :onboarding)
|
(and (contains? cf/flags :onboarding)
|
||||||
(contains? cf/flags :onboarding-newsletter))
|
(not (:onboarding-viewed props))
|
||||||
|
(not (contains? props :newsletter-updates))
|
||||||
|
(contains? props :onboarding-questions))
|
||||||
|
|
||||||
show-team-modal? (and (not (:onboarding-viewed props))
|
show-team-modal?
|
||||||
(contains? cf/flags :onboarding)
|
(and (contains? cf/flags :onboarding)
|
||||||
(contains? cf/flags :onboarding-team))
|
(not (:onboarding-viewed props))
|
||||||
|
(not (contains? props :onboarding-team-id))
|
||||||
|
(contains? props :newsletter-updates))
|
||||||
|
|
||||||
|
show-release-modal?
|
||||||
|
(and (contains? cf/flags :onboarding)
|
||||||
|
(:onboarding-viewed props)
|
||||||
|
(not= (:release-notes-viewed props) (:main cf/version))
|
||||||
|
(not= "0.0" (:main cf/version)))]
|
||||||
|
|
||||||
show-release-modal? (and (contains? cf/flags :onboarding)
|
|
||||||
(:onboarding-viewed props)
|
|
||||||
(not= (:release-notes-viewed props) (:main cf/version))
|
|
||||||
(not= "0.0" (:main cf/version)))]
|
|
||||||
(cond
|
(cond
|
||||||
show-question-modal?
|
show-question-modal?
|
||||||
[:& questions-modal]
|
[:& questions-modal]
|
||||||
|
|
|
@ -298,7 +298,6 @@
|
||||||
:value value'
|
:value value'
|
||||||
:checked checked?}]]))]))
|
:checked checked?}]]))]))
|
||||||
|
|
||||||
|
|
||||||
(mf/defc image-radio-buttons
|
(mf/defc image-radio-buttons
|
||||||
{::mf/wrap-props false}
|
{::mf/wrap-props false}
|
||||||
[props]
|
[props]
|
||||||
|
@ -328,6 +327,7 @@
|
||||||
|
|
||||||
(when (fn? on-change)
|
(when (fn? on-change)
|
||||||
(on-change name value)))))]
|
(on-change name value)))))]
|
||||||
|
|
||||||
[:div {:class (if image
|
[:div {:class (if image
|
||||||
class
|
class
|
||||||
(dm/str class " " (stl/css :custom-radio)))}
|
(dm/str class " " (stl/css :custom-radio)))}
|
||||||
|
@ -336,6 +336,7 @@
|
||||||
value' (encode-fn value)
|
value' (encode-fn value)
|
||||||
checked? (= value current-value)
|
checked? (= value current-value)
|
||||||
key (str/ffmt "%-%" (d/name name) (d/name value'))]
|
key (str/ffmt "%-%" (d/name name) (d/name value'))]
|
||||||
|
|
||||||
[:label {:for key
|
[:label {:for key
|
||||||
:key key
|
:key key
|
||||||
:style {:grid-area area}
|
:style {:grid-area area}
|
||||||
|
|
|
@ -86,7 +86,8 @@
|
||||||
(mf/use-fn
|
(mf/use-fn
|
||||||
(fn [response]
|
(fn [response]
|
||||||
(let [team-id (:id response)]
|
(let [team-id (:id response)]
|
||||||
(st/emit! (du/update-profile-props {:onboarding-team-id team-id})
|
(st/emit! (du/update-profile-props {:onboarding-team-id team-id
|
||||||
|
:onboarding-viewed true})
|
||||||
(rt/nav :dashboard-projects {:team-id team-id})))))
|
(rt/nav :dashboard-projects {:team-id team-id})))))
|
||||||
|
|
||||||
on-error
|
on-error
|
||||||
|
|
|
@ -197,6 +197,8 @@ msgstr ""
|
||||||
"Al crear una nueva cuenta, aceptas nuestros [términos de servicio](%s) y "
|
"Al crear una nueva cuenta, aceptas nuestros [términos de servicio](%s) y "
|
||||||
"[política de privacidad](%s)."
|
"[política de privacidad](%s)."
|
||||||
|
|
||||||
|
#: src/app/main/ui/auth/register.cljs
|
||||||
|
#, markdown
|
||||||
msgid "auth.terms-and-privacy-agreement"
|
msgid "auth.terms-and-privacy-agreement"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Yo acepto los [términos de servicio](%s) y la [política de privacidad](%s)."
|
"Yo acepto los [términos de servicio](%s) y la [política de privacidad](%s)."
|
||||||
|
|
Loading…
Add table
Reference in a new issue