mirror of
https://github.com/penpot/penpot.git
synced 2025-02-23 07:16:07 -05:00
Merge pull request #4305 from penpot/niwinz-staging-bugfix-1
🐛 Minor bugfixes
This commit is contained in:
commit
1d25115218
9 changed files with 52 additions and 59 deletions
|
@ -56,7 +56,9 @@
|
|||
;; migrations process, so all features referenced in migrations should
|
||||
;; be here.
|
||||
(def default-enabled-features
|
||||
#{"fdata/shape-data-type"})
|
||||
#{"fdata/shape-data-type"
|
||||
"styles/v2"
|
||||
"layout/grid"})
|
||||
|
||||
;; A set of features which only affects on frontend and can be enabled
|
||||
;; and disabled freely by the user any time. This features does not
|
||||
|
|
|
@ -12,9 +12,7 @@
|
|||
(def default
|
||||
"A common flags that affects both: backend and frontend."
|
||||
[:enable-registration
|
||||
:enable-login-with-password
|
||||
:enable-login-illustration
|
||||
:enable-feature-styles-v2])
|
||||
:enable-login-with-password])
|
||||
|
||||
(defn parse
|
||||
[& flags]
|
||||
|
@ -35,5 +33,3 @@
|
|||
|
||||
:else
|
||||
(recur (rest flags) result)))))))
|
||||
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
(ns app.main.ui.auth
|
||||
(:require-macros [app.main.style :as stl])
|
||||
(:require
|
||||
[app.common.data.macros :as dm]
|
||||
[app.config :as cf]
|
||||
[app.main.ui.auth.login :refer [login-page]]
|
||||
[app.main.ui.auth.recovery :refer [recovery-page]]
|
||||
|
@ -35,41 +36,39 @@
|
|||
[:a {:href cf/privacy-policy-uri :target "_blank"} (tr "auth.privacy-policy")])])))
|
||||
|
||||
(mf/defc auth
|
||||
[{:keys [route] :as props}]
|
||||
(let [section (get-in route [:data :name])
|
||||
params (:query-params route)
|
||||
show-illustration? (contains? cf/flags :login-illustration)]
|
||||
{::mf/props :obj}
|
||||
[{:keys [route]}]
|
||||
(let [section (dm/get-in route [:data :name])
|
||||
params (:query-params route)]
|
||||
|
||||
(mf/use-effect
|
||||
#(dom/set-html-title (tr "title.default")))
|
||||
(mf/with-effect []
|
||||
(dom/set-html-title (tr "title.default")))
|
||||
|
||||
[:main {:class (stl/css-case :auth-section true
|
||||
:no-illustration (not show-illustration?))}
|
||||
(when show-illustration?
|
||||
[:div {:class (stl/css :login-illustration)}
|
||||
i/login-illustration])
|
||||
[:main {:class (stl/css :auth-section)}
|
||||
[:div {:class (stl/css :login-illustration)}
|
||||
i/login-illustration]
|
||||
|
||||
[:section {:class (stl/css :auth-content)}
|
||||
[:*
|
||||
[:a {:href "#/" :class (stl/css :logo-btn)} i/logo]
|
||||
(case section
|
||||
:auth-register
|
||||
[:& register-page {:params params}]
|
||||
[:a {:href "#/" :class (stl/css :logo-btn)} i/logo]
|
||||
(case section
|
||||
:auth-register
|
||||
[:& register-page {:params params}]
|
||||
|
||||
:auth-register-validate
|
||||
[:& register-validate-page {:params params}]
|
||||
:auth-register-validate
|
||||
[:& register-validate-page {:params params}]
|
||||
|
||||
:auth-register-success
|
||||
[:& register-success-page {:params params}]
|
||||
:auth-register-success
|
||||
[:& register-success-page {:params params}]
|
||||
|
||||
:auth-login
|
||||
[:& login-page {:params params}]
|
||||
:auth-login
|
||||
[:& login-page {:params params}]
|
||||
|
||||
:auth-recovery-request
|
||||
[:& recovery-request-page]
|
||||
:auth-recovery-request
|
||||
[:& recovery-request-page]
|
||||
|
||||
:auth-recovery
|
||||
[:& recovery-page {:params params}])]
|
||||
:auth-recovery
|
||||
[:& recovery-page {:params params}])
|
||||
|
||||
(when (contains? #{:auth-login :auth-register} section)
|
||||
(when (or (= section :auth-login)
|
||||
(= section :auth-register))
|
||||
[:& terms-login])]]))
|
||||
|
|
|
@ -17,11 +17,6 @@
|
|||
width: 100%;
|
||||
overflow: auto;
|
||||
|
||||
&.no-illustration {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
@media (max-width: 992px) {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
|
|
@ -35,6 +35,14 @@
|
|||
:login-with-gitlab
|
||||
:login-with-oidc]))
|
||||
|
||||
(mf/defc demo-warning
|
||||
{::mf/props :obj}
|
||||
[]
|
||||
[:div {:class (stl/css :banner)}
|
||||
[:& context-notification
|
||||
{:type :warning
|
||||
:content (tr "auth.demo-warning")}]])
|
||||
|
||||
(defn- login-with-oidc
|
||||
[event provider params]
|
||||
(dom/prevent-default event)
|
||||
|
@ -284,6 +292,9 @@
|
|||
[:h1 {:class (stl/css :auth-title)
|
||||
:data-test "login-title"} (tr "auth.login-title")]
|
||||
|
||||
(when (contains? cf/flags :demo-warning)
|
||||
[:& demo-warning])
|
||||
|
||||
[:hr {:class (stl/css :separator)}]
|
||||
|
||||
[:& login-methods {:params params}]
|
||||
|
|
|
@ -18,20 +18,12 @@
|
|||
[app.main.ui.components.forms :as fm]
|
||||
[app.main.ui.components.link :as lk]
|
||||
[app.main.ui.icons :as i]
|
||||
[app.main.ui.notifications.context-notification :refer [context-notification]]
|
||||
[app.util.i18n :refer [tr tr-html]]
|
||||
[app.util.router :as rt]
|
||||
[beicon.v2.core :as rx]
|
||||
[cljs.spec.alpha :as s]
|
||||
[rumext.v2 :as mf]))
|
||||
|
||||
(mf/defc demo-warning
|
||||
[_]
|
||||
[:div {:class (stl/css :banner)}
|
||||
[:& context-notification
|
||||
{:type :warning
|
||||
:content (tr "auth.demo-warning")}]])
|
||||
|
||||
;; --- PAGE: Register
|
||||
|
||||
(defn- validate
|
||||
|
@ -86,7 +78,7 @@
|
|||
(st/emit! (rt/nav :auth-register-validate {} params)))
|
||||
|
||||
(mf/defc register-form
|
||||
[{:keys [params on-success-callback] :as props}]
|
||||
[{:keys [params on-success-callback]}]
|
||||
(let [initial (mf/use-memo (mf/deps params) (constantly params))
|
||||
form (fm/use-form :spec ::register-form
|
||||
:validators [validate
|
||||
|
@ -136,7 +128,8 @@
|
|||
|
||||
|
||||
(mf/defc register-methods
|
||||
[{:keys [params on-success-callback] :as props}]
|
||||
{::mf/props :obj}
|
||||
[{:keys [params on-success-callback]}]
|
||||
[:*
|
||||
(when login/show-alt-login-buttons?
|
||||
[:*
|
||||
|
@ -146,14 +139,15 @@
|
|||
[:& register-form {:params params :on-success-callback on-success-callback}]])
|
||||
|
||||
(mf/defc register-page
|
||||
[{:keys [params] :as props}]
|
||||
{::mf/props :obj}
|
||||
[{:keys [params]}]
|
||||
[:div {:class (stl/css :auth-form)}
|
||||
[:h1 {:class (stl/css :auth-title)
|
||||
:data-test "registration-title"} (tr "auth.register-title")]
|
||||
[:div {:class (stl/css :auth-subtitle)} (tr "auth.register-subtitle")]
|
||||
|
||||
(when (contains? cf/flags :demo-warning)
|
||||
[:& demo-warning])
|
||||
[:& login/demo-warning])
|
||||
|
||||
[:& register-methods {:params params}]
|
||||
|
||||
|
@ -212,7 +206,7 @@
|
|||
::accept-newsletter-subscription])))
|
||||
|
||||
(mf/defc register-validate-form
|
||||
[{:keys [params on-success-callback] :as props}]
|
||||
[{:keys [params on-success-callback]}]
|
||||
(let [form (fm/use-form :spec ::register-validate-form
|
||||
:validators [(fm/validate-not-empty :fullname (tr "auth.name.not-all-space"))
|
||||
(fm/validate-length :fullname fm/max-length-allowed (tr "auth.name.too-long"))]
|
||||
|
@ -263,7 +257,7 @@
|
|||
|
||||
|
||||
(mf/defc register-validate-page
|
||||
[{:keys [params] :as props}]
|
||||
[{:keys [params]}]
|
||||
[:div {:class (stl/css :auth-form)}
|
||||
[:h1 {:class (stl/css :auth-title)
|
||||
:data-test "register-title"} (tr "auth.register-title")]
|
||||
|
@ -279,7 +273,7 @@
|
|||
(tr "labels.go-back")]]]])
|
||||
|
||||
(mf/defc register-success-page
|
||||
[{:keys [params] :as props}]
|
||||
[{:keys [params]}]
|
||||
[:div {:class (stl/css :auth-form :register-success)}
|
||||
[:div {:class (stl/css :notification-icon)} i/icon-verify]
|
||||
[:div {:class (stl/css :notification-text)} (tr "auth.verification-email-sent")]
|
||||
|
|
|
@ -91,4 +91,4 @@
|
|||
|
||||
(defmethod rc/render-release-notes "0.0"
|
||||
[params]
|
||||
(rc/render-release-notes (assoc params :version "1.21")))
|
||||
(rc/render-release-notes (assoc params :version "2.0")))
|
||||
|
|
|
@ -11,10 +11,6 @@
|
|||
[app.main.ui.releases.common :as c]
|
||||
[rumext.v2 :as mf]))
|
||||
|
||||
(defmethod c/render-release-notes "1.21"
|
||||
[data]
|
||||
(c/render-release-notes (assoc data :version "2.0")))
|
||||
|
||||
;; TODO: Review all copies and alt text
|
||||
(defmethod c/render-release-notes "2.0"
|
||||
[{:keys [slide klass next finish navigate version]}]
|
||||
|
|
|
@ -1 +1 @@
|
|||
1.21.0
|
||||
2.0.0
|
||||
|
|
Loading…
Add table
Reference in a new issue