Pārlūkot izejas kodu

fix: class/properties bugs if selected within Tag properties

Class properties were moved to a property in #11494. If selected within
itself, the objects from this class have buggy behavior e.g. property
values don't get added correctly to it in an object. class/properties
shouldn't ever be in a property dropdown since the behavior is very
customized to our built-in classes
Gabriel Horner 1 gadu atpakaļ
vecāks
revīzija
2654ca9b6f

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

@@ -272,7 +272,7 @@
          [:type (apply vector :enum (into db-property-type/internal-built-in-property-types
                                           db-property-type/user-built-in-property-types))]
          [:public? {:optional true} :boolean]
-         [:view-context {:optional true} [:enum :page :block :class]]
+         [:view-context {:optional true} [:enum :page :block :class :never]]
          [:shortcut {:optional true} :string]]
         property-common-schema-attrs))]]
     property-attrs

+ 2 - 2
deps/db/src/logseq/db/frontend/property.cljs

@@ -18,7 +18,7 @@
      * :hide? - Boolean which hides property when set on a block or exported e.g. slides
      * :public? - Boolean which allows property to be used by user e.g. add and remove property to blocks/pages
      * :view-context - Keyword to indicate which view contexts a property can be
-       seen in when :public? is set. Valid values are :page, :block and :class. Property can
+       seen in when :public? is set. Valid values are :page, :block and :never. Property can
        be viewed in any context if not set
    * :title - Property's :block/title
    * :name - Property's :block/name as a keyword. If none given, one is derived from the db/ident
@@ -46,7 +46,7 @@
                                       :schema {:type :property
                                                :cardinality :many
                                                :public? true
-                                               :view-context :class}}
+                                               :view-context :never}}
    :logseq.property/page-tags {:title "pageTags"
                                :schema {:type :page
                                         :public? true

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

@@ -331,7 +331,7 @@
                                                  #{:page block-type}
                                                  #{block-type})]
                                (or (and (not page?) (contains? existing-tag-alias (:block/title m)))
-                                   ;; Filters out properties from being in wrong :view-context
+                                   ;; Filters out properties from being in wrong :view-context and :never view-contexts
                                    (and (not= view-context :all) (not (contains? block-types view-context))))))
         property (rum/react *property)
         property-key (rum/react *property-key)]