Skip to content

Commit

Permalink
Merge pull request #56 from yochannah/summary-fields-for-popovers
Browse files Browse the repository at this point in the history
Summary fields for popovers
  • Loading branch information
heralden authored Oct 17, 2019
2 parents 24e0724 + e850e5a commit b2131b2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 22 deletions.
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 9 additions & 16 deletions src/im_tables/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@
[m k]
(if (contains? m k) (dissoc m k) (assoc m k true)))


;;;; FILTERS


Expand Down Expand Up @@ -170,7 +169,6 @@
; (into [:div] (map (fn [s] [:span.label.label-default s]) columns-to-add))]
; :location loc}


(reg-event-fx
:filters/add-constraint
(sandbox)
Expand Down Expand Up @@ -282,7 +280,6 @@
(defn coll-contains? [needle haystack] (some? (some #{needle} haystack)))
(defn without [coll item] (filter (partial not= item) coll))


;;;;; Relationship Manager

; Copy the main query to our cache for editing
Expand Down Expand Up @@ -435,7 +432,6 @@
(into [:div.table-history-detail]
(map (fn [v]
[:div v]) current-selection))]}}

{:db db}))))

(reg-event-fx
Expand Down Expand Up @@ -494,7 +490,6 @@
:dispatch [:im-tables.main/run-query loc]})))



;;;;;; SUMMARY CACHING


Expand Down Expand Up @@ -523,17 +518,15 @@
(fn [{db :db} [_ loc {:keys [class id] :as item}]]
(cond-> {:db db}
(not (get-in db [:cache :item-details id]))
(assoc :im-tables/im-operation {:on-success
[:main/cache-item-summary loc]
:op
(partial fetch/records
(get db :service)
(summary-query
(assoc item :summary-fields
(into [] (keys (get-in db [:service :model :classes (keyword class) :attributes]))))))}))))



(assoc :im-tables/im-operation
{:on-success
[:main/cache-item-summary loc]
:op
(partial fetch/records
(get db :service)
(summary-query
(assoc item :summary-fields
(into [] (get-in db [:service :summary-fields (keyword class)])))))}))))

;;;;;;;;;;;;;;

Expand Down
9 changes: 3 additions & 6 deletions src/im_tables/views.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,11 @@
[reagent.dom.server :as server]
[oops.core :refer [ocall]]))

(def some-im-tables-config {:service {:root "beta.humanmine.org/beta"}
:query {:from "Gene"
(def some-im-tables-config {:service {:root "https://yeastmine.yeastgenome.org/yeastmine"}
:query {:from "Protein"
:select ["symbol"
"secondaryIdentifier"
"dataSets.description"
"primaryIdentifier"
"organism.name"
"dataSets.name"]}
"primaryIdentifier"]}
:settings {:pagination {:limit 10}
:links {:vocab {:mine "BananaMine"}
:url (fn [vocab] (str "#/reportpage/"
Expand Down

0 comments on commit b2131b2

Please sign in to comment.