diff --git a/src/main/frontend/components/property.cljs b/src/main/frontend/components/property.cljs index 90b504df8..5479758f2 100644 --- a/src/main/frontend/components/property.cljs +++ b/src/main/frontend/components/property.cljs @@ -132,7 +132,7 @@ (let [type (keyword (string/lower-case v))] (swap! *property-schema assoc :type type))))])] - (when (= :object (:type @*property-schema)) + (when (= :page (:type @*property-schema)) [:div.grid.grid-cols-4.gap-1.leading-8 [:label "Specify classes:"] (class-select *property-schema (:classes @*property-schema) opts)]) diff --git a/src/main/frontend/components/property/value.cljs b/src/main/frontend/components/property/value.cljs index ee5db62ed..7e00379fd 100644 --- a/src/main/frontend/components/property/value.cljs +++ b/src/main/frontend/components/property/value.cljs @@ -100,8 +100,8 @@ opts {:items options :dropdown? true :input-default-placeholder (if multiple-values? - (str "Choose " (if (= type :object) "objects" "pages")) - (str "Choose " (if (= type :object) "object" "page"))) + "Choose pages" + "Choose page") :on-chosen (fn [chosen] (let [page (string/trim (if (string? chosen) chosen (:value chosen))) id (:block/uuid (db/entity [:block/name (util/page-name-sanity-lc page)])) @@ -339,14 +339,11 @@ (list :number :url) [:div.h-6 (select block property select-opts)] - :object + :page [:div.h-6 (select-page block property (assoc select-opts :classes (:classes schema) :multiple? multiple-values?))] - :page - [:div.h-6 (select-page block property select-opts)] - :block nil @@ -361,7 +358,7 @@ :class class :style {:min-height 24} :on-click (fn [] - (let [ref? (contains? #{:page :block :object} type)] + (let [ref? (contains? #{:page :block} type)] (when (or (not ref?) (and (string/blank? value) ref?)) (when-not (and (= type :block) (string/blank? value)) @@ -374,16 +371,10 @@ (if (string/blank? value) [:div.opacity-70.text-sm (case type - :object - (if multiple-values? "Choose objects" "Choose object") :page (if multiple-values? "Choose pages" "Choose page") "Input something")] (case type - :object - (when-let [object (db/entity [:block/uuid value])] - (page-cp {:disable-preview? true} object)) - :page (when-let [page (db/entity [:block/uuid value])] (page-cp {:disable-preview? true} page)) @@ -472,7 +463,7 @@ type (:type schema) block? (= type :block) default? (= type :default) - row? (contains? #{:page :object} type) + row? (contains? #{:page} type) items (if (coll? v) v (when v [v]))] [:div.relative {:class (cond @@ -546,7 +537,7 @@ multiple-values? (multiple-values block property v opts dom-id schema editor-id editor-args) - (contains? #{:page :object} type) + (contains? #{:page} type) [:div.flex.flex-1.items-center.property-value-content (item-with-close block property v (merge diff --git a/src/main/frontend/handler/db_based/property.cljs b/src/main/frontend/handler/db_based/property.cljs index 822a5086c..ae74e5954 100644 --- a/src/main/frontend/handler/db_based/property.cljs +++ b/src/main/frontend/handler/db_based/property.cljs @@ -26,12 +26,6 @@ (and (uuid? id) (some? (db/entity [:block/uuid id])))) -(defn- logseq-object? - [id] - (and (uuid? id) - (when-let [e (db/entity [:block/uuid id])] - (seq (:block/tags e))))) - (def builtin-schema-types {:default string? ; refs/tags will not be extracted :number number? @@ -48,10 +42,6 @@ :block [:fn {:error/message "should be a block"} logseq-block?] - :object [:fn - {:error/message "should be an object"} - logseq-object?] - ;; internal usage :keyword keyword? :map map? @@ -60,7 +50,7 @@ :any some?}) (def internal-builtin-schema-types #{:keyword :map :coll :any}) -(def user-face-builtin-schema-types [:default :number :date :checkbox :url :page :block :object]) +(def user-face-builtin-schema-types [:default :number :date :checkbox :url :page :block]) ;; schema -> type, cardinality, object's class ;; min, max -> string length, number range, cardinality size limit @@ -71,7 +61,7 @@ (cond (parse-long v-str) :number (parse-double v-str) :number - (util/uuid-string? v-str) :object + (util/uuid-string? v-str) :page (gp-util/url? v-str) :url (contains? #{"true" "false"} (string/lower-case v-str)) :boolean :else :default) @@ -98,9 +88,6 @@ :block (uuid v-str) - :object - (uuid v-str) - :date v-str ; uuid )))