From 87dfa8c7fcc60592cf72ba228f4d4c53c91e6ebc Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 23 Sep 2021 16:53:29 +0200 Subject: [PATCH 1/5] :paperclip: Don't redirect user to landing page on clicking on logo. --- frontend/src/app/main/ui/auth.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/app/main/ui/auth.cljs b/frontend/src/app/main/ui/auth.cljs index 5cf1a715b..9c79ed2dd 100644 --- a/frontend/src/app/main/ui/auth.cljs +++ b/frontend/src/app/main/ui/auth.cljs @@ -25,7 +25,7 @@ [:div.auth [:section.auth-sidebar - [:a.logo {:href "https://penpot.app"} i/logo] + [:a.logo {:href "#/"} i/logo] [:span.tagline (tr "auth.sidebar-tagline")]] [:section.auth-content From 45e501ce02dce5735f48a4c2f247168628f146d0 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 23 Sep 2021 16:54:06 +0200 Subject: [PATCH 2/5] :bug: Don't send incorrect flag values on register page. --- frontend/src/app/main/ui/auth/register.cljs | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/frontend/src/app/main/ui/auth/register.cljs b/frontend/src/app/main/ui/auth/register.cljs index e690b57d8..f10181e77 100644 --- a/frontend/src/app/main/ui/auth/register.cljs +++ b/frontend/src/app/main/ui/auth/register.cljs @@ -184,12 +184,8 @@ (mf/defc register-validate-form [{:keys [params] :as props}] - (let [initial (mf/use-memo - (mf/deps params) - (fn [] - (assoc params :accept-newsletter-subscription false))) - form (fm/use-form :spec ::register-validate-form - :initial initial) + (let [form (fm/use-form :spec ::register-validate-form + :initial params) submitted? (mf/use-state false) on-submit @@ -210,18 +206,19 @@ :tab-index "1" :label (tr "auth.fullname") :type "text"}]] + [:div.fields-row [:& fm/input {:name :accept-terms-and-privacy :class "check-primary" :label (tr "auth.terms-privacy-agreement") :type "checkbox"}]] - (when (contains? @cf/flags :newsletter-registration-check) - [:div.fields-row - [:& fm/input {:name :accept-newsletter-subscription - :class "check-primary" - :label (tr "auth.newsletter-subscription") - :type "checkbox"}]]) + ;; (when (contains? @cf/flags :newsletter-registration-check) + ;; [:div.fields-row + ;; [:& fm/input {:name :accept-newsletter-subscription + ;; :class "check-primary" + ;; :label (tr "auth.newsletter-subscription") + ;; :type "checkbox"}]]) [:& fm/submit-button {:label (tr "auth.register-submit") From 133c0312bed9770b7614fe95259a320345ad12dc Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Fri, 24 Sep 2021 10:46:39 +0200 Subject: [PATCH 3/5] :bug: Fix unexpected exception on audit log handler. --- backend/src/app/loggers/audit.clj | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/backend/src/app/loggers/audit.clj b/backend/src/app/loggers/audit.clj index e699963c6..d75fc1ce7 100644 --- a/backend/src/app/loggers/audit.clj +++ b/backend/src/app/loggers/audit.clj @@ -116,9 +116,10 @@ (db/inet ip-addr) (db/tjson (:props event)) (db/tjson (d/without-nils (:context event)))])) - events (us/conform ::events events) - rows (into [] prepare-xf events)] - (db/insert-multi! pool :audit-log columns rows)) + events (us/conform ::events events)] + (when (seq events) + (->> (into [] prepare-xf events) + (db/insert-multi! pool :audit-log columns)))) (catch Throwable e (let [xdata (ex-data e)] (if (= :spec-validation (:code xdata)) From 8dba55d5cb165f42256858bbf44f41cf4d360433 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 29 Sep 2021 10:46:31 +0200 Subject: [PATCH 4/5] :paperclip: Port some auditlog changes from develop. --- backend/src/app/loggers/audit.clj | 14 ++++++-------- backend/src/app/main.clj | 2 +- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/backend/src/app/loggers/audit.clj b/backend/src/app/loggers/audit.clj index d75fc1ce7..5f19403de 100644 --- a/backend/src/app/loggers/audit.clj +++ b/backend/src/app/loggers/audit.clj @@ -230,7 +230,7 @@ "select * from audit_log where archived_at is null order by created_at asc - limit 100 + limit 1000 for update skip locked;") (defn archive-events @@ -288,13 +288,11 @@ xform (comp (map decode-row) (map row->event)) events (into [] xform rows)] - (l/debug :action "archive-events" :uri uri :events (count events)) - (if (empty? events) - :empty - (do - (send events) - (mark-as-archived conn rows) - :continue)))))) + (when-not (empty? events) + (l/debug :action "archive-events" :uri uri :events (count events)) + (send events) + (mark-as-archived conn rows) + :continue))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; GC Task diff --git a/backend/src/app/main.clj b/backend/src/app/main.clj index bfa65c4d4..762474536 100644 --- a/backend/src/app/main.clj +++ b/backend/src/app/main.clj @@ -215,7 +215,7 @@ :task :audit-archive}) (when (cf/get :audit-archive-gc-enabled) - {:cron #app/cron "0 0 * * * ?" ;; every 1h + {:cron #app/cron "0 */3 * * * ?" ;; every 3m :task :audit-archive-gc}) (when (cf/get :telemetry-enabled) From 3fb3a92a8faca9189f036fd06369551792db77d3 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 29 Sep 2021 11:06:50 +0200 Subject: [PATCH 5/5] :paperclip: Minor changes to cron schedule. --- backend/src/app/main.clj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/app/main.clj b/backend/src/app/main.clj index 762474536..7e50c62ae 100644 --- a/backend/src/app/main.clj +++ b/backend/src/app/main.clj @@ -211,11 +211,11 @@ :task :file-offload}) (when (cf/get :audit-archive-enabled) - {:cron #app/cron "0 0 * * * ?" ;; every 1h + {:cron #app/cron "0 */3 * * * ?" ;; every 3m :task :audit-archive}) (when (cf/get :audit-archive-gc-enabled) - {:cron #app/cron "0 */3 * * * ?" ;; every 3m + {:cron #app/cron "0 0 0 * * ?" ;; daily :task :audit-archive-gc}) (when (cf/get :telemetry-enabled)