From f8bfe249aae93eb1b24c519021abfbd9e8f9c1bc Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 21 Mar 2024 10:17:43 +0100 Subject: [PATCH 1/4] :fire: Remove login illustration flag It is now a permament configuration --- common/src/app/common/flags.cljc | 1 - frontend/src/app/main/ui/auth.cljs | 53 +++++++++++++++--------------- frontend/src/app/main/ui/auth.scss | 5 --- 3 files changed, 26 insertions(+), 33 deletions(-) diff --git a/common/src/app/common/flags.cljc b/common/src/app/common/flags.cljc index ee86f729a..bd3afed23 100644 --- a/common/src/app/common/flags.cljc +++ b/common/src/app/common/flags.cljc @@ -13,7 +13,6 @@ "A common flags that affects both: backend and frontend." [:enable-registration :enable-login-with-password - :enable-login-illustration :enable-feature-styles-v2]) (defn parse diff --git a/frontend/src/app/main/ui/auth.cljs b/frontend/src/app/main/ui/auth.cljs index fe8473252..61fe0271b 100644 --- a/frontend/src/app/main/ui/auth.cljs +++ b/frontend/src/app/main/ui/auth.cljs @@ -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])]])) diff --git a/frontend/src/app/main/ui/auth.scss b/frontend/src/app/main/ui/auth.scss index 2e5d45fc7..f993d5b7f 100644 --- a/frontend/src/app/main/ui/auth.scss +++ b/frontend/src/app/main/ui/auth.scss @@ -17,11 +17,6 @@ width: 100%; overflow: auto; - &.no-illustration { - display: flex; - justify-content: center; - } - @media (max-width: 992px) { display: flex; justify-content: center; From 64dc58c2590c13f6e47b954d22328590115e4a35 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 21 Mar 2024 10:35:18 +0100 Subject: [PATCH 2/4] :bug: Set correctly the default features --- common/src/app/common/features.cljc | 4 +++- common/src/app/common/flags.cljc | 5 +---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/common/src/app/common/features.cljc b/common/src/app/common/features.cljc index f4751da8f..90b27587f 100644 --- a/common/src/app/common/features.cljc +++ b/common/src/app/common/features.cljc @@ -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 diff --git a/common/src/app/common/flags.cljc b/common/src/app/common/flags.cljc index bd3afed23..93b88f87e 100644 --- a/common/src/app/common/flags.cljc +++ b/common/src/app/common/flags.cljc @@ -12,8 +12,7 @@ (def default "A common flags that affects both: backend and frontend." [:enable-registration - :enable-login-with-password - :enable-feature-styles-v2]) + :enable-login-with-password]) (defn parse [& flags] @@ -34,5 +33,3 @@ :else (recur (rest flags) result))))))) - - From 9a0bb36a207f8c5ed5379b6d636488e669e6eb3e Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 21 Mar 2024 10:43:25 +0100 Subject: [PATCH 3/4] :sparkles: Set proper internal version number --- frontend/src/app/main/ui/releases.cljs | 2 +- frontend/src/app/main/ui/releases/v2_0.cljs | 4 ---- version.txt | 2 +- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/frontend/src/app/main/ui/releases.cljs b/frontend/src/app/main/ui/releases.cljs index 50f87648f..562c1eab2 100644 --- a/frontend/src/app/main/ui/releases.cljs +++ b/frontend/src/app/main/ui/releases.cljs @@ -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"))) diff --git a/frontend/src/app/main/ui/releases/v2_0.cljs b/frontend/src/app/main/ui/releases/v2_0.cljs index 116a4c172..0c3af3060 100644 --- a/frontend/src/app/main/ui/releases/v2_0.cljs +++ b/frontend/src/app/main/ui/releases/v2_0.cljs @@ -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]}] diff --git a/version.txt b/version.txt index 3500250a4..227cea215 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.21.0 +2.0.0 From f697f32707053765c253f3573750adfcbfd3dee2 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 21 Mar 2024 11:34:55 +0100 Subject: [PATCH 4/4] :bug: Add demo warning to login --- frontend/src/app/main/ui/auth/login.cljs | 11 ++++++++++ frontend/src/app/main/ui/auth/register.cljs | 24 ++++++++------------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/frontend/src/app/main/ui/auth/login.cljs b/frontend/src/app/main/ui/auth/login.cljs index b4d02fb11..cfd9d1d11 100644 --- a/frontend/src/app/main/ui/auth/login.cljs +++ b/frontend/src/app/main/ui/auth/login.cljs @@ -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}] diff --git a/frontend/src/app/main/ui/auth/register.cljs b/frontend/src/app/main/ui/auth/register.cljs index 6789b99dc..1143d5928 100644 --- a/frontend/src/app/main/ui/auth/register.cljs +++ b/frontend/src/app/main/ui/auth/register.cljs @@ -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")]