Skip to content

Commit

Permalink
feat: add :breadcrumb-show? option for query result displaying
Browse files Browse the repository at this point in the history
  • Loading branch information
tiensonqin committed Jul 30, 2021
1 parent c68db4f commit c87258c
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/main/frontend/components/block.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -2178,7 +2178,7 @@
(state/remove-custom-query-component! query)
(db/remove-custom-query! (state/get-current-repo) query))
state)}
[state config {:keys [title query inputs view collapsed? children?] :as q}]
[state config {:keys [title query inputs view collapsed? children? breadcrumb-show?] :as q}]
(ui/catch-error
[:div.warning
[:p "Query failed: "]
Expand Down Expand Up @@ -2262,7 +2262,9 @@
(and (seq result) (or only-blocks? blocks-grouped-by-page?))
(->hiccup result (cond-> (assoc config
:custom-query? true
:breadcrumb-show? true
:breadcrumb-show? (if (some? breadcrumb-show?)
breadcrumb-show?
true)
:group-by-page? blocks-grouped-by-page?
:ref? true)
children?
Expand Down Expand Up @@ -2615,10 +2617,11 @@
(for [[parent blocks] parent-blocks]
(let [block (first blocks)]
[:div
[:div.my-2.opacity-70.ml-4.hover:opacity-100
(block-parents config (state/get-current-repo) (:block/uuid block)
(:block/format block)
false)]
(when (:breadcrumb-show? config)
[:div.my-2.opacity-70.ml-4.hover:opacity-100
(block-parents config (state/get-current-repo) (:block/uuid block)
(:block/format block)
false)])
(blocks-container blocks (assoc config :breadcrumb-show? false))])))])))]

(and (:group-by-page? config)
Expand Down

0 comments on commit c87258c

Please sign in to comment.