Browse Source

enhance: add properties logseq.user/<xxx>

rcmerci 10 tháng trước cách đây
mục cha
commit
c75aad8bff

+ 16 - 1
deps/db/src/logseq/db/frontend/property.cljs

@@ -421,7 +421,22 @@
                                 :schema
                                 {:type :map
                                  :hide? false ; TODO: show for debug now, hide it later
-                                 :public? false}}))
+                                 :public? false}}
+   :logseq.user/name {:title "User Name"
+                      :schema
+                      {:type :string
+                       :hide? false
+                       :public? true}}
+   :logseq.user/email {:title "User Email"
+                       :schema
+                       {:type :string
+                        :hide? false
+                        :public? true}}
+   :logseq.user/avatar {:title "User Avatar"
+                        :schema
+                        {:type :string
+                         :hide? false
+                         :public? true}}))
 
 (def built-in-properties
   (->> built-in-properties*

+ 1 - 1
deps/db/src/logseq/db/frontend/schema.cljs

@@ -2,7 +2,7 @@
   "Main datascript schemas for the Logseq app"
   (:require [clojure.set :as set]))
 
-(def version 49)
+(def version 50)
 
 ;; A page is a special block, a page can corresponds to multiple files with the same ":block/name".
 (def ^:large-vars/data-var schema

+ 2 - 1
src/main/frontend/worker/db/migrate.cljs

@@ -494,7 +494,8 @@
                      :logseq.property.attribute/property-schema-classes :logseq.property.attribute/property-value-content]}]
    [47 {:fix replace-hidden-type-with-schema}]
    [48 {:properties [:logseq.property/default-value :logseq.property/scalar-default-value]}]
-   [49 {:fix replace-special-id-ref-with-id-ref}]])
+   [49 {:fix replace-special-id-ref-with-id-ref}]
+   [50 {:properties [:logseq.user/name :logseq.user/email :logseq.user/avatar]}]])
 
 (let [max-schema-version (apply max (map first schema-version->updates))]
   (assert (<= db-schema/version max-schema-version))