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