mirror of https://github.com/logseq/logseq
fix: task status switch
parent
4b34ba98e9
commit
44b167ac14
|
@ -3636,10 +3636,7 @@
|
|||
(defn hidden-page->source-page
|
||||
[page]
|
||||
(or
|
||||
(when-let [page-uuid (get-in (db/entity (:db/id page))
|
||||
[:block/properties (:block/uuid (db/entity :logseq.property/source-page-id))])]
|
||||
(db/entity [:block/uuid page-uuid]))
|
||||
|
||||
(:logseq.property/source-page-id page)
|
||||
;; FIXME: what if the source page has been deleted?
|
||||
page))
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
has-viewable-properties? (db-property-handler/block-has-viewable-properties? page)
|
||||
has-class-properties? (seq (:class/schema.properties page))
|
||||
has-tags? (seq (:block/tags page))
|
||||
hide-properties? (get-in page [:block/properties (:block/uuid (db/entity :logseq.property/hide-properties?))])]
|
||||
hide-properties? (:logseq.property/hide-properties? page)]
|
||||
(when (or configure?
|
||||
(and
|
||||
(not hide-properties?)
|
||||
|
|
|
@ -643,8 +643,7 @@
|
|||
(defn db-based-cycle-todo!
|
||||
[block]
|
||||
(let [task (db/entity :logseq.class/task)
|
||||
status-id (:block/uuid (db/entity :logseq.property/status))
|
||||
status-value-id (get-in block [:block/properties status-id])
|
||||
status-value-id (:logseq.property/status block)
|
||||
status-value (when status-value-id (db/entity [:block/uuid status-value-id]))
|
||||
next-status (case (:db/ident status-value)
|
||||
:logseq.property/status.todo
|
||||
|
@ -653,14 +652,14 @@
|
|||
:logseq.property/status.done
|
||||
:logseq.property/status.done
|
||||
nil
|
||||
:logseq.property/status.todo)
|
||||
next-status-id (when next-status (:block/uuid (db/entity next-status)))
|
||||
properties (if next-status-id
|
||||
(assoc (:block/properties block) status-id next-status-id)
|
||||
(or (dissoc (:block/properties block) status-id) {}))]
|
||||
:logseq.property/status.todo)]
|
||||
(if next-status
|
||||
(outliner-op/save-block! {:db/id (:db/id block)
|
||||
:block/properties properties
|
||||
:block/tags #{{:db/id (:db/id task)}}})))
|
||||
:logseq.property/status (:block/uuid (db/entity next-status))
|
||||
:block/tags #{{:db/id (:db/id task)}}})
|
||||
(db/transact! (state/get-current-repo)
|
||||
[[:db/retract (:db/id block) :logseq.property/status]]
|
||||
{:outliner-op :save-block}))))
|
||||
|
||||
(defn cycle-todos!
|
||||
[]
|
||||
|
|
|
@ -430,7 +430,5 @@
|
|||
|
||||
(defn toggle-properties!
|
||||
[page-entity]
|
||||
(let [properties (:block/properties page-entity)
|
||||
pid (:block/uuid (db/entity :logseq.property/hide-properties?))]
|
||||
(db/transact! [{:db/id (:db/id page-entity)
|
||||
:block/properties (update properties pid not)}])))
|
||||
(db/transact! [[:db/add (:db/id page-entity) :logseq.property/hide-properties?
|
||||
(not (:logseq.property/hide-properties? page-entity))]]))
|
||||
|
|
Loading…
Reference in New Issue