mirror of
https://github.com/penpot/penpot.git
synced 2025-12-12 06:24:17 +01:00
🐛 Restore empty field error on dimension, text-case and color forms
This commit is contained in:
@@ -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]
|
||||||
|
|
||||||
|
|||||||
@@ -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]
|
||||||
|
|
||||||
|
|||||||
@@ -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]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user