mirror of
https://github.com/penpot/penpot.git
synced 2025-07-18 22:37:23 +02:00
🐛 Fix allow team name to be all blank
This commit is contained in:
parent
4d4e9703cc
commit
02466d603c
4 changed files with 27 additions and 2 deletions
|
@ -26,7 +26,7 @@
|
||||||
- Fix asset color item was created from the selected layer [Taiga #5180](https://tree.taiga.io/project/penpot/issue/5180)
|
- Fix asset color item was created from the selected layer [Taiga #5180](https://tree.taiga.io/project/penpot/issue/5180)
|
||||||
- Fix unpublish more than one library at the same time [Taiga #5532](https://tree.taiga.io/project/penpot/issue/5532)
|
- Fix unpublish more than one library at the same time [Taiga #5532](https://tree.taiga.io/project/penpot/issue/5532)
|
||||||
- Fix drag projects on dahsboard [Taiga #5531](https://tree.taiga.io/project/penpot/issue/5531)
|
- Fix drag projects on dahsboard [Taiga #5531](https://tree.taiga.io/project/penpot/issue/5531)
|
||||||
|
- Fix allow team name to be all blank [Taiga #5527](https://tree.taiga.io/project/penpot/issue/5527)
|
||||||
|
|
||||||
### :arrow_up: Deps updates
|
### :arrow_up: Deps updates
|
||||||
|
|
||||||
|
|
|
@ -17,12 +17,20 @@
|
||||||
[app.util.router :as rt]
|
[app.util.router :as rt]
|
||||||
[beicon.core :as rx]
|
[beicon.core :as rx]
|
||||||
[cljs.spec.alpha :as s]
|
[cljs.spec.alpha :as s]
|
||||||
|
[cuerdas.core :as str]
|
||||||
[rumext.v2 :as mf]))
|
[rumext.v2 :as mf]))
|
||||||
|
|
||||||
(s/def ::name ::us/not-empty-string)
|
(s/def ::name ::us/not-empty-string)
|
||||||
(s/def ::team-form
|
(s/def ::team-form
|
||||||
(s/keys :req-un [::name]))
|
(s/keys :req-un [::name]))
|
||||||
|
|
||||||
|
(defn- validate-name
|
||||||
|
[errors data]
|
||||||
|
(let [name (-> data :name str/trim)]
|
||||||
|
(cond-> errors
|
||||||
|
(str/empty? name)
|
||||||
|
(assoc :name {:message (tr "dashboard.team-name.not-empty-name")}))))
|
||||||
|
|
||||||
(defn- on-create-success
|
(defn- on-create-success
|
||||||
[_form response]
|
[_form response]
|
||||||
(let [msg "Team created successfully"]
|
(let [msg "Team created successfully"]
|
||||||
|
@ -66,10 +74,11 @@
|
||||||
(on-create-submit form))))
|
(on-create-submit form))))
|
||||||
|
|
||||||
(mf/defc team-form-modal {::mf/register modal/components
|
(mf/defc team-form-modal {::mf/register modal/components
|
||||||
::mf/register-as :team-form}
|
::mf/register-as :team-form}
|
||||||
[{:keys [team] :as props}]
|
[{:keys [team] :as props}]
|
||||||
(let [initial (mf/use-memo (fn [] (or team {})))
|
(let [initial (mf/use-memo (fn [] (or team {})))
|
||||||
form (fm/use-form :spec ::team-form
|
form (fm/use-form :spec ::team-form
|
||||||
|
:validators [validate-name]
|
||||||
:initial initial)]
|
:initial initial)]
|
||||||
[:div.modal-overlay
|
[:div.modal-overlay
|
||||||
[:div.modal-container.team-form-modal
|
[:div.modal-container.team-form-modal
|
||||||
|
|
|
@ -113,6 +113,10 @@ msgstr "Password"
|
||||||
msgid "auth.password-length-hint"
|
msgid "auth.password-length-hint"
|
||||||
msgstr "At least 8 characters"
|
msgstr "At least 8 characters"
|
||||||
|
|
||||||
|
#: src/app/main/ui/auth/register.cljs
|
||||||
|
msgid "auth.password-not-empty"
|
||||||
|
msgstr "Password must contain some character other than space."
|
||||||
|
|
||||||
msgid "auth.privacy-policy"
|
msgid "auth.privacy-policy"
|
||||||
msgstr "Privacy policy"
|
msgstr "Privacy policy"
|
||||||
|
|
||||||
|
@ -371,6 +375,10 @@ msgstr "180 days"
|
||||||
msgid "dashboard.access-tokens.errors-required-name"
|
msgid "dashboard.access-tokens.errors-required-name"
|
||||||
msgstr "The name is required"
|
msgstr "The name is required"
|
||||||
|
|
||||||
|
#: src/app/main/ui/settings/team-form.cljs
|
||||||
|
msgid "dashboard.team-name.not-empty-name"
|
||||||
|
msgstr "The name must contain some character other than space."
|
||||||
|
|
||||||
#: src/app/main/ui/settings/access-tokens.cljs
|
#: src/app/main/ui/settings/access-tokens.cljs
|
||||||
msgid "dashboard.access-tokens.token-will-expire"
|
msgid "dashboard.access-tokens.token-will-expire"
|
||||||
msgstr "The token will expire on %s"
|
msgstr "The token will expire on %s"
|
||||||
|
|
|
@ -118,6 +118,10 @@ msgstr "Contraseña"
|
||||||
msgid "auth.password-length-hint"
|
msgid "auth.password-length-hint"
|
||||||
msgstr "8 caracteres como mínimo"
|
msgstr "8 caracteres como mínimo"
|
||||||
|
|
||||||
|
#: src/app/main/ui/auth/register.cljs
|
||||||
|
msgid "auth.password-not-empty"
|
||||||
|
msgstr "La contraseña debe contener algún caracter diferente de espacio"
|
||||||
|
|
||||||
msgid "auth.privacy-policy"
|
msgid "auth.privacy-policy"
|
||||||
msgstr "Política de privacidad"
|
msgstr "Política de privacidad"
|
||||||
|
|
||||||
|
@ -378,6 +382,10 @@ msgstr "180 días"
|
||||||
msgid "dashboard.access-tokens.errors-required-name"
|
msgid "dashboard.access-tokens.errors-required-name"
|
||||||
msgstr "El nombre es obligatorio"
|
msgstr "El nombre es obligatorio"
|
||||||
|
|
||||||
|
#: src/app/main/ui/settings/team-form.cljs
|
||||||
|
msgid "dashboard.team-name.not-empty-name"
|
||||||
|
msgstr "El nombre debe contener algún carácter diferente de espacio"
|
||||||
|
|
||||||
#: src/app/main/ui/settings/access-tokens.cljs
|
#: src/app/main/ui/settings/access-tokens.cljs
|
||||||
msgid "dashboard.access-tokens.token-will-expire"
|
msgid "dashboard.access-tokens.token-will-expire"
|
||||||
msgstr "El token expirará el %s"
|
msgstr "El token expirará el %s"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue