mirror of
https://github.com/penpot/penpot.git
synced 2025-02-03 21:09:00 -05:00
🐛 Restore the ability to enable or disable onboarding modal with flags
This commit is contained in:
parent
a147009e81
commit
243ce3650f
5 changed files with 28 additions and 20 deletions
|
@ -59,7 +59,10 @@
|
||||||
:webworker))
|
:webworker))
|
||||||
|
|
||||||
(def default-flags
|
(def default-flags
|
||||||
[:enable-newsletter-subscription
|
[:enable-onboarding
|
||||||
|
:enable-onboarding-team
|
||||||
|
:enable-onboarding-questions
|
||||||
|
:enable-onboarding-newsletter
|
||||||
:enable-dashboard-templates-section
|
:enable-dashboard-templates-section
|
||||||
:enable-google-fonts-provider])
|
:enable-google-fonts-provider])
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
(declare fetch-team-members)
|
(declare fetch-team-members)
|
||||||
|
|
||||||
(defn initialize
|
(defn initialize
|
||||||
[{:keys [id] :as params}]
|
[{:keys [id]}]
|
||||||
(dm/assert! (uuid? id))
|
(dm/assert! (uuid? id))
|
||||||
(ptk/reify ::initialize
|
(ptk/reify ::initialize
|
||||||
ptk/UpdateEvent
|
ptk/UpdateEvent
|
||||||
|
|
|
@ -401,7 +401,6 @@
|
||||||
(->> (rp/cmd! :update-profile-props {:props props})
|
(->> (rp/cmd! :update-profile-props {:props props})
|
||||||
(rx/map (constantly (fetch-profile))))))))
|
(rx/map (constantly (fetch-profile))))))))
|
||||||
|
|
||||||
|
|
||||||
;; --- Update Photo
|
;; --- Update Photo
|
||||||
|
|
||||||
(defn update-photo
|
(defn update-photo
|
||||||
|
|
|
@ -87,21 +87,23 @@
|
||||||
:dashboard-team-settings)
|
:dashboard-team-settings)
|
||||||
|
|
||||||
[:*
|
[:*
|
||||||
#_[:div.modal-wrapper
|
|
||||||
#_[:& app.main.ui.releases/release-notes-modal {:version "1.19"}]
|
#_[:& app.main.ui.releases/release-notes-modal {:version "1.19"}]
|
||||||
#_[:& app.main.ui.onboarding/onboarding-templates-modal]
|
#_[:& app.main.ui.onboarding/onboarding-templates-modal]
|
||||||
#_[:& app.main.ui.onboarding/onboarding-modal]
|
#_[:& app.main.ui.onboarding/onboarding-modal]
|
||||||
#_[:& app.main.ui.onboarding/onboarding-team-modal]]
|
#_[:& app.main.ui.onboarding.team-choice/onboarding-team-modal]
|
||||||
(when-let [props (some-> profile (get :props {}))]
|
(when-let [props (get profile :props)]
|
||||||
(cond
|
(cond
|
||||||
(and (not (:onboarding-questions-answered props false))
|
(and (contains? cf/flags :onboarding-questions)
|
||||||
|
(not (:onboarding-questions-answered props false))
|
||||||
(not (:onboarding-viewed props false)))
|
(not (:onboarding-viewed props false)))
|
||||||
[:& app.main.ui.onboarding.questions/questions]
|
[:& app.main.ui.onboarding.questions/questions]
|
||||||
|
|
||||||
(not (:onboarding-viewed props))
|
(and (not (:onboarding-viewed props))
|
||||||
|
(contains? cf/flags :onboarding))
|
||||||
[:& app.main.ui.onboarding/onboarding-modal {}]
|
[:& app.main.ui.onboarding/onboarding-modal {}]
|
||||||
|
|
||||||
(and (:onboarding-viewed props)
|
(and (contains? cf/flags :onboarding)
|
||||||
|
(:onboarding-viewed props)
|
||||||
(not= (:release-notes-viewed props) (:main cf/version))
|
(not= (:release-notes-viewed props) (:main cf/version))
|
||||||
(not= "0.0" (:main cf/version)))
|
(not= "0.0" (:main cf/version)))
|
||||||
[:& app.main.ui.releases/release-notes-modal {:version (:main cf/version)}]))
|
[:& app.main.ui.releases/release-notes-modal {:version (:main cf/version)}]))
|
||||||
|
@ -110,7 +112,8 @@
|
||||||
|
|
||||||
:viewer
|
:viewer
|
||||||
(let [{:keys [query-params path-params]} route
|
(let [{:keys [query-params path-params]} route
|
||||||
{:keys [index share-id section page-id interactions-mode frame-id] :or {section :interactions interactions-mode :show-on-click}} query-params
|
{:keys [index share-id section page-id interactions-mode frame-id]
|
||||||
|
:or {section :interactions interactions-mode :show-on-click}} query-params
|
||||||
{:keys [file-id]} path-params]
|
{:keys [file-id]} path-params]
|
||||||
(if (:token query-params)
|
(if (:token query-params)
|
||||||
[:& viewer/breaking-change-notice]
|
[:& viewer/breaking-change-notice]
|
||||||
|
|
|
@ -212,11 +212,15 @@
|
||||||
|
|
||||||
skip
|
skip
|
||||||
(mf/use-fn
|
(mf/use-fn
|
||||||
#(st/emit! (modal/hide)
|
(fn []
|
||||||
(if (contains? cf/flags :newsletter-subscription)
|
(st/emit! (modal/hide)
|
||||||
(modal/show {:type :onboarding-newsletter-modal})
|
(du/mark-onboarding-as-viewed))
|
||||||
(modal/show {:type :onboarding-team}))
|
(cond
|
||||||
(du/mark-onboarding-as-viewed)))]
|
(contains? cf/flags :onboarding-newsletter)
|
||||||
|
(modal/show! {:type :onboarding-newsletter-modal})
|
||||||
|
|
||||||
|
(contains? cf/flags :onboarding-team)
|
||||||
|
(modal/show! {:type :onboarding-team}))))]
|
||||||
|
|
||||||
(mf/with-effect [@slide]
|
(mf/with-effect [@slide]
|
||||||
(when (not= :start @slide)
|
(when (not= :start @slide)
|
||||||
|
@ -225,6 +229,7 @@
|
||||||
(fn []
|
(fn []
|
||||||
(reset! klass nil)
|
(reset! klass nil)
|
||||||
(tm/dispose! sem))))
|
(tm/dispose! sem))))
|
||||||
|
|
||||||
(if new-css-system
|
(if new-css-system
|
||||||
[:div {:class (stl/css :modal-overlay)}
|
[:div {:class (stl/css :modal-overlay)}
|
||||||
[:div.animated {:class(dm/str @klass " " (stl/css :animated))}
|
[:div.animated {:class(dm/str @klass " " (stl/css :animated))}
|
||||||
|
@ -232,8 +237,6 @@
|
||||||
:start [:& onboarding-welcome {:next #(navigate :opensource)}]
|
:start [:& onboarding-welcome {:next #(navigate :opensource)}]
|
||||||
:opensource [:& onboarding-before-start {:next skip}])]]
|
:opensource [:& onboarding-before-start {:next skip}])]]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[:div.modal-overlay
|
[:div.modal-overlay
|
||||||
[:div.animated {:class @klass}
|
[:div.animated {:class @klass}
|
||||||
(case @slide
|
(case @slide
|
||||||
|
|
Loading…
Add table
Reference in a new issue