🐛 Restore empty value error on border radius token form

This commit is contained in:
Andrey Antukh
2025-11-27 12:12:27 +01:00
parent 972b23e6c0
commit 3c6c9894da

View File

@@ -32,6 +32,12 @@
[cuerdas.core :as str] [cuerdas.core :as str]
[rumext.v2 :as mf])) [rumext.v2 :as mf]))
(defn- token-value-error-fn
[{:keys [value]}]
(when (or (str/empty? value)
(str/blank? value))
(tr "workspace.tokens.empty-input")))
(defn- make-schema (defn- make-schema
[tokens-tree] [tokens-tree]
(sm/schema (sm/schema
@@ -44,7 +50,7 @@
[:fn {:error/fn #(tr "workspace.tokens.token-name-duplication-validation-error" (:value %))} [:fn {:error/fn #(tr "workspace.tokens.token-name-duplication-validation-error" (:value %))}
#(not (cft/token-name-path-exists? % tokens-tree))]]] #(not (cft/token-name-path-exists? % tokens-tree))]]]
[:value ::sm/text] [:value [::sm/text {:error/fn token-value-error-fn}]]
[:resolved-value ::sm/any] [:resolved-value ::sm/any]