cleaned up how these are generated.
This commit is contained in:
@@ -6,7 +6,8 @@
|
||||
[re-frame.core :as re-frame]
|
||||
[auto-ap.views.pages.data-page :as data-page]
|
||||
[auto-ap.views.components.buttons :as buttons]
|
||||
[auto-ap.subs :as subs]))
|
||||
[auto-ap.subs :as subs]
|
||||
[react-dom :as react-dom]))
|
||||
(set! *warn-on-infer* true)
|
||||
|
||||
(defonce ^js/React.Context grid-context ( react/createContext "default"))
|
||||
@@ -116,7 +117,7 @@
|
||||
[:a.tag.is-medium.is-delete {:on-click (fn []
|
||||
(on-change {:sort (filter #(not= sort-key (:sort-key %)) sort)}))}]]])])
|
||||
|
||||
(defn controls [{:keys [start end count total per-page] :as para}]
|
||||
(defn controls [{:keys [start end count total per-page action-buttons] :as para}]
|
||||
(let [children (r/children (r/current-component))]
|
||||
[:> Consumer {}
|
||||
(fn [consume]
|
||||
@@ -134,7 +135,8 @@
|
||||
[sort-by-list {:sort (:sort params)
|
||||
:on-change on-params-change}]]]
|
||||
(mapv (fn [c]
|
||||
[:div.level-item c]) children))]]))))]))
|
||||
[:div.level-item c]) children))
|
||||
[:div.level-right action-buttons]]]))))]))
|
||||
|
||||
(defn table [{:keys [fullwidth class style]}]
|
||||
|
||||
|
||||
@@ -237,7 +237,7 @@
|
||||
:class (status/class-for (get unautopay-states (:id i)))
|
||||
:event [::unautopay i]}])]]]))
|
||||
|
||||
(defn invoice-table [{:keys [check-boxes overrides actions data-page checkable-fn]}]
|
||||
(defn invoice-table [{:keys [check-boxes overrides actions data-page checkable-fn action-buttons]}]
|
||||
(let [{:keys [data status params table-params]} @(re-frame/subscribe [::data-page/page data-page])
|
||||
selected-client @(re-frame/subscribe [::subs/client])
|
||||
is-loading? (= :loading (:state status))
|
||||
@@ -260,10 +260,11 @@
|
||||
[grid/grid {:data-page data-page
|
||||
:check-boxes? check-boxes
|
||||
:column-count (if selected-client 8 9)}
|
||||
[grid/controls data
|
||||
[grid/controls {:action-buttons action-buttons}
|
||||
[:div.level-item
|
||||
"Outstanding " (nf (:outstanding data))
|
||||
" Total " (nf (:total-amount data))]]
|
||||
[:div.tags
|
||||
[:div.tag.is-info.is-light "Outstanding " (nf (:outstanding data))]
|
||||
[:div.tag.is-info.is-light " Total " (nf (:total-amount data))]]]]
|
||||
(for [invoices invoice-groups]
|
||||
^{:key (or (:id (first invoices)) "init")}
|
||||
[grid/table {:fullwidth true}
|
||||
|
||||
Reference in New Issue
Block a user