progress on bugs

This commit is contained in:
Bryce Covert
2020-08-19 18:25:27 -07:00
parent 2716b6e2ba
commit a08c197159
8 changed files with 26 additions and 47 deletions

View File

@@ -121,11 +121,12 @@
(mapv (fn [c]
[:div.level-item c]) children))]]))))]))
(defn table [{:keys [fullwidth]}]
(defn table [{:keys [fullwidth class]}]
(into
[:table.table.compact.grid {:class (if fullwidth
["is-fullwidth"])}]
[:table.table.compact.grid {:class (cond-> []
fullwidth (conj "is-fullwidth")
class (into class))}]
(r/children (r/current-component))))
(defn header []
@@ -172,7 +173,7 @@
(map r/as-element (r/children (r/current-component)))))
(defn cell [params]
(apply r/create-element "td" #js {}
(apply r/create-element "td" #js {:className (:class params)}
(map r/as-element (r/children (r/current-component))))
)

View File

@@ -91,8 +91,8 @@
(fn [{:keys [db]} [_ invoice]]
{:db db}))
(defn row [{:keys [invoice check-boxes selected-client overrides expense-event actions]}]
(let [{:keys [client payments expense-accounts invoice-number date due total outstanding-balance id vendor checkable?] :as i} invoice
(defn row [{:keys [invoice check-boxes selected-client overrides checkable? expense-event actions]}]
(let [{:keys [client payments expense-accounts invoice-number date due total outstanding-balance id vendor] :as i} invoice
accounts-by-id @(re-frame/subscribe [::subs/accounts-by-id client])
account->name #(:name (accounts-by-id (:id %)))]
[grid/row {:class (:class i) :id id :checkable? checkable? :entity invoice}
@@ -179,7 +179,7 @@
[buttons/fa-icon {:icon "fa-undo"
:event [::unvoid-invoice i]}])]]]))
(defn invoice-table [{:keys [id check-boxes overrides actions data-page]}]
(defn invoice-table [{:keys [id check-boxes overrides actions data-page checkable-fn]}]
(let [selected-client @(re-frame/subscribe [::subs/client])
{:keys [data status table-params]} @(re-frame/subscribe [::data-page/page data-page])
@@ -235,5 +235,8 @@
^{:key id}
[row {:invoice i
:selected-client selected-client
:checkable? (if checkable-fn
(checkable-fn i)
true)
:actions actions
:overrides overrides}])]])]))