Selaa lähdekoodia

Rename config to :rich-property-values?

Name should allow for additional functionality later
Gabriel Horner 3 vuotta sitten
vanhempi
sitoutus
55ccc2d17c

+ 1 - 1
deps/graph-parser/src/logseq/graph_parser/block.cljs

@@ -176,7 +176,7 @@
                             (and (string? v)
                                  (not (gp-mldoc/link? format v)))
                             (let [v (string/trim v)
-                                  result (if (:property-values-allow-links-and-text? user-config)
+                                  result (if (:rich-property-values? user-config)
                                            (if (gp-util/wrapped-by-quotes? v)
                                              []
                                              (text/extract-page-refs-and-tags v))

+ 1 - 1
deps/graph-parser/src/logseq/graph_parser/text.cljs

@@ -256,6 +256,6 @@
        :else
        (if-some [res (parse-non-string-property-value v)]
          res
-         (if (:property-values-allow-links-and-text? config-state)
+         (if (:rich-property-values? config-state)
            (extract-page-refs-and-tags v)
            (split-page-refs-without-brackets v)))))))

+ 4 - 4
deps/graph-parser/test/logseq/graph_parser_test.cljs

@@ -93,8 +93,8 @@
 (deftest quoted-property-values
   (testing "With default config"
     (quoted-property-values-test {}))
-  (testing "With :property-values-allow-links-and-text config"
-    (quoted-property-values-test {:property-values-allow-links-and-text? true})))
+  (testing "With :rich-property-values config"
+    (quoted-property-values-test {:rich-property-values? true})))
 
 (deftest page-properties-persistence
   (testing "Non-string property values"
@@ -197,11 +197,11 @@
         :comma-prop #{"one" "two" "three"}}
        {}))
 
-    (testing "With :property-values-allow-links-and-text config"
+    (testing "With :rich-property-values config"
       (property-relationships-test
        properties
        {:single-link #{"bar"}
         :multi-link #{"Logseq" "triples" "text editor"}
         :desc #{"link"}
         :comma-prop "one, two,three"}
-       {:property-values-allow-links-and-text? true}))))
+       {:rich-property-values? true}))))

+ 1 - 1
src/main/frontend/components/block.cljs

@@ -1809,7 +1809,7 @@
         user-config (state/get-config)
         ;; In this mode and when value is a set of refs, display full property text
         ;; because :block/properties value only contains refs but user wants to see text
-        v (if (and (:property-values-allow-links-and-text? user-config) (coll? value))
+        v (if (and (:rich-property-values? user-config) (coll? value))
             (gp-property/property-value-from-content (name k) (:block/content block))
             value)
         property-pages-enabled? (contains? #{true nil} (:property-pages/enabled? user-config))]

+ 4 - 4
src/test/frontend/db/query_dsl_test.cljs

@@ -120,8 +120,8 @@ prop-d:: nada"}])
 
   (test-helper/start-test-db!) ;; reset db
 
-  (testing "block property tests with property-values-allow-links-and-text? config"
-    (test-helper/with-config {:property-values-allow-links-and-text? true}
+  (testing "block property tests with rich-property-values? config"
+    (test-helper/with-config {:rich-property-values? true}
       (block-property-queries-test))))
 
 (defn- page-property-queries-test
@@ -191,8 +191,8 @@ prop-d:: nada"}])
 
   (test-helper/start-test-db!) ;; reset db
 
-  (testing "page property tests with property-values-allow-links-and-text? config"
-    (test-helper/with-config {:property-values-allow-links-and-text? true}
+  (testing "page property tests with rich-property-values? config"
+    (test-helper/with-config {:rich-property-values? true}
       (page-property-queries-test))))
 
 (deftest task-queries

+ 3 - 2
templates/config.edn

@@ -228,8 +228,9 @@
  ;; E.g.:property-pages/excludelist #{:duration :author}
  ;; :property-pages/excludelist
 
- ;; Allows property values to contain tags, page-refs and free-form text
- ;; :property-values-allow-links-and-text? true
+ ;; Enables property values to contain a mix of tags, page-refs, special
+ ;; punctuation and free-form text
+ ;; :rich-property-values? true
 
  ;; logbook setup
  ;; :logbook/settings