tons of small fixes.

This commit is contained in:
Bryce Covert
2020-09-01 17:07:03 -07:00
parent 183c74f128
commit 9f46f85330
24 changed files with 520 additions and 221 deletions

View File

@@ -31,13 +31,16 @@
[typeahead-entity {:matches @(re-frame/subscribe [::subs/vendors])
:type "typeahead-entity"
:auto-focus true
:match->text :name
:match->text (fn [x]
(str (:name x) " (" (reduce + 0 (map :count (:usage x))) " usages)") )
:field [:from]}])
(field "To Vendor"
[typeahead-entity {:matches @(re-frame/subscribe [::subs/vendors])
:type "typeahead-entity"
:match->text :name
:match->text (fn [x]
(str (:name x) " (" (reduce + 0 (map :count (:usage x))) " usages)") )
:field [:to]}])])))
(re-frame/reg-event-fx

View File

@@ -40,7 +40,11 @@
(for [v (:data page)]
^{:key (str (:id v))}
[grid/row {:class (:class v) :id (:id v)}
[grid/cell {} (:name v)]
[grid/cell {} (:name v)
(let [total-usage (reduce + 0 (map :count (:usage v)))]
(if (> total-usage 0 )
[:div.mx-2.tag.is-info.is-light total-usage " usages, " (count (:usage v)) " clients" ]
[:div.mx-2.tag.is-warning.is-light "Unused"]))]
[grid/cell {} (:email (:primary-contact v))]
[grid/cell {} (-> v :default-account :id accounts :name)]
[grid/cell {}