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