From b89a4925d82e9bda928bde9c0157cd415b592a6b Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 6 Dec 2024 14:41:21 -0500 Subject: [PATCH] fix: Task descendant object added Task tag when Status added. Fixes https://test.logseq.com/#/page/675326b3-7e92-4cf0-b9d3-cc367049b920. Also fixes class-instance? not working for parent classes --- deps/db/src/logseq/db.cljs | 4 ++-- deps/outliner/src/logseq/outliner/property.cljs | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/deps/db/src/logseq/db.cljs b/deps/db/src/logseq/db.cljs index 71fba9f80d9..f7a2086ba38 100644 --- a/deps/db/src/logseq/db.cljs +++ b/deps/db/src/logseq/db.cljs @@ -576,8 +576,8 @@ tags-ids (set (map :db/id tags))] (or (contains? tags-ids (:db/id class)) - (let [class-parents (get-classes-parents tags)] - (contains? (set/union class-parents tags-ids) (:db/id class)))))) + (let [class-parent-ids (set (map :db/id (get-classes-parents tags)))] + (contains? (set/union class-parent-ids tags-ids) (:db/id class)))))) (defn get-all-pages-views [db] diff --git a/deps/outliner/src/logseq/outliner/property.cljs b/deps/outliner/src/logseq/outliner/property.cljs index c299e685f0b..84ee0774636 100644 --- a/deps/outliner/src/logseq/outliner/property.cljs +++ b/deps/outliner/src/logseq/outliner/property.cljs @@ -37,15 +37,15 @@ retract-multiple-values? (and multiple-values? (sequential? value)) multiple-values-empty? (and (sequential? old-value) (contains? (set (map :db/ident old-value)) :logseq.property/empty-placeholder)) - block (assoc (outliner-core/block-with-updated-at {:db/id (:db/id block)}) + block' (assoc (outliner-core/block-with-updated-at {:db/id (:db/id block)}) property-id value) - block-tx-data (cond-> block - status? + block-tx-data (cond-> block' + (and status? (not (ldb/class-instance? (d/entity @conn :logseq.class/Task) block))) (assoc :block/tags :logseq.class/Task))] [(when multiple-values-empty? - [:db/retract (:db/id block) property-id :logseq.property/empty-placeholder]) + [:db/retract (:db/id block') property-id :logseq.property/empty-placeholder]) (when retract-multiple-values? - [:db/retract (:db/id block) property-id]) + [:db/retract (:db/id block') property-id]) block-tx-data])))) (defn- get-property-value-schema