mirror of
https://github.com/logseq/logseq.git
synced 2026-06-01 19:01:22 +00:00
Loosen property name check for db graphs
properties don't need to be keywords for db graphs since property names aren't involved in property storage. This change allows for property names to have whitespace and be invalid edn. See #6753 for example bugs that db-validation-property-name? catches
This commit is contained in:
@@ -338,7 +338,7 @@
|
||||
(let [editor-id (str "ls-property-" blocks-container-id (:db/id entity) "-" (:db/id property))]
|
||||
(set-editing! property editor-id "" ""))))
|
||||
;; new property
|
||||
(if (gp-property/valid-property-name? (str ":" property-name))
|
||||
(if (gp-property/db-valid-property-name? property-name)
|
||||
(if (= "class" (:block/type entity))
|
||||
(add-property! entity property-name "" {:class-schema? class-schema?})
|
||||
(do
|
||||
@@ -346,7 +346,7 @@
|
||||
;; configure new property
|
||||
(when-let [property (get-property-from-db property-name)]
|
||||
(state/set-sub-modal! #(property-config repo property)))))
|
||||
(do (notification/show! "This is an invalid property name. A property name cannot start with non-alphanumeric characters e.g. '#' or '[['." :error)
|
||||
(do (notification/show! "This is an invalid property name. A property name cannot start with page reference characters '#' or '[['." :error)
|
||||
(exit-edit-property))))))
|
||||
|
||||
(rum/defcs property-input < rum/reactive
|
||||
|
||||
Reference in New Issue
Block a user