pagination.
This commit is contained in:
@@ -34,9 +34,9 @@
|
||||
:previewTemplate "<div class='dz-hidden-preview'></div>"})))})))
|
||||
|
||||
(re-frame/reg-sub
|
||||
::invoices
|
||||
::invoice-page
|
||||
(fn [db]
|
||||
(-> db ::invoices)))
|
||||
(-> db ::invoice-page)))
|
||||
|
||||
(re-frame/reg-sub
|
||||
::params
|
||||
@@ -63,7 +63,7 @@
|
||||
::received
|
||||
(fn [db [_ data]]
|
||||
(-> db
|
||||
(assoc ::invoices (:invoice data))
|
||||
(assoc ::invoice-page (first (:invoice-page data)))
|
||||
(assoc-in [:status :loading] false))))
|
||||
|
||||
(re-frame/reg-event-fx
|
||||
@@ -91,7 +91,7 @@
|
||||
(def import-invoices-page
|
||||
(with-meta
|
||||
(fn []
|
||||
(let [invoices (re-frame/subscribe [::invoices])
|
||||
(let [invoice-page (re-frame/subscribe [::invoice-page])
|
||||
status (re-frame/subscribe [::subs/status])]
|
||||
[:div {:class "inbox-messages"}
|
||||
[:h1.title "Upload invoices"]
|
||||
@@ -105,15 +105,15 @@
|
||||
(if (:loading @status)
|
||||
[:h1.title
|
||||
[:i.fa.fa-spin.fa-spinner]]
|
||||
(if (seq @invoices)
|
||||
(if (seq (:invoices @invoice-page))
|
||||
[invoice-table {:id :approved
|
||||
:invoices invoices
|
||||
:invoice-page invoice-page
|
||||
:status (re-frame/subscribe [::subs/status])
|
||||
:params (re-frame/subscribe [::params])
|
||||
:on-params-change (fn [params]
|
||||
(re-frame/dispatch [::params-change params])) }]
|
||||
[:span "No pending invoices"]))]
|
||||
(if (and (seq @invoices) (not (:loading @status)))
|
||||
(if (and (seq (:invoices @invoice-page)) (not (:loading @status)))
|
||||
[:div.card-footer
|
||||
[:a.card-footer-item
|
||||
{:on-click (fn [e]
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
[auto-ap.events :as events]))
|
||||
|
||||
(re-frame/reg-sub
|
||||
::invoices
|
||||
::invoice-page
|
||||
(fn [db]
|
||||
(-> db ::invoices)))
|
||||
(-> db ::invoice-page)))
|
||||
|
||||
(re-frame/reg-sub
|
||||
::params
|
||||
@@ -31,7 +31,7 @@
|
||||
::received
|
||||
(fn [db [_ data]]
|
||||
(-> db
|
||||
(assoc ::invoices (:invoice data))
|
||||
(assoc ::invoice-page (first (:invoice-page data)))
|
||||
(assoc-in [:status :loading] false))))
|
||||
|
||||
(re-frame/reg-event-fx
|
||||
@@ -46,7 +46,7 @@
|
||||
[:h1.title "Unpaid invoices"]
|
||||
[invoice-table {:id :unpaid
|
||||
:params (re-frame/subscribe [::params])
|
||||
:invoices (re-frame/subscribe [::invoices])
|
||||
:invoice-page (re-frame/subscribe [::invoice-page])
|
||||
:status (re-frame/subscribe [::subs/status])
|
||||
:on-params-change (fn [params]
|
||||
(re-frame/dispatch [::params-change params])) }]])
|
||||
|
||||
Reference in New Issue
Block a user