diff --git a/CHANGES.md b/CHANGES.md index 119d895cf..5739dd035 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -94,6 +94,8 @@ - Fix dropdown width [Taiga #5541](https://tree.taiga.io/project/penpot/issue/5541) - Fix enable comment mode and insert image keeps on comment mode [Taiga #5678](https://tree.taiga.io/project/penpot/issue/5678) - Fix enable undo just after using pencil [Taiga #5674](https://tree.taiga.io/project/penpot/issue/5674) +- Fix 400 error when user changes password [Taiga #5643](https://tree.taiga.io/project/penpot/issue/5643) +- Fix cannot undo layer styles [Taiga #5676](https://tree.taiga.io/project/penpot/issue/5676) ### :arrow_up: Deps updates diff --git a/frontend/src/app/main/ui/components/forms.cljs b/frontend/src/app/main/ui/components/forms.cljs index deb8f6a46..9c415a4e5 100644 --- a/frontend/src/app/main/ui/components/forms.cljs +++ b/frontend/src/app/main/ui/components/forms.cljs @@ -439,3 +439,13 @@ (cond-> errors (all-spaces? (get data field)) (assoc field {:message error-msg})))) + +(defn validate-not-all-spaces + [field error-msg] + (fn [errors data] + (let [value (get data field)] + (cond-> errors + (and + (all-spaces? value) + (> (count value) 0)) + (assoc field {:message error-msg}))))) diff --git a/frontend/src/app/main/ui/settings/password.cljs b/frontend/src/app/main/ui/settings/password.cljs index 48f15b00b..a2f2c727b 100644 --- a/frontend/src/app/main/ui/settings/password.cljs +++ b/frontend/src/app/main/ui/settings/password.cljs @@ -71,7 +71,8 @@ [{:keys [locale] :as props}] (let [initial (mf/use-memo (constantly {:password-old nil})) form (fm/use-form :spec ::password-form - :validators [(fm/validate-not-empty :password-1 (tr "auth.password-not-empty")) + :validators [(fm/validate-not-all-spaces :password-old (tr "auth.password-not-empty")) + (fm/validate-not-empty :password-1 (tr "auth.password-not-empty")) (fm/validate-not-empty :password-2 (tr "auth.password-not-empty")) password-equality] :initial initial)]