looks ok, everything works.
This commit is contained in:
@@ -366,7 +366,7 @@ nav.navbar .navbar-item.is-active {
|
||||
.table td.expandable {text-overflow: ellipsis; overflow: visible; white-space: nowrap; padding: 9px; height: 60px; vertical-align: middle; }
|
||||
.table th.expandable {text-overflow: ellipsis; overflow: visible; white-space: nowrap; padding: 9px; height: 60px; vertical-align: middle; }
|
||||
.table td.no-border { border: none; }
|
||||
.table.compact td {text-overflow: ellipsis; overflow: hidden; white-space: nowrap; padding: 9px; height: 40px; vertical-align: middle; }
|
||||
.table.compact td, .table.compact th {text-overflow: ellipsis; overflow: hidden; white-space: nowrap; padding: 9px; height: 40px; vertical-align: middle; }
|
||||
.table.compact td.expandable {text-overflow: ellipsis; overflow: visible; white-space: nowrap; padding: 9px; height: 40px; vertical-align: middle; }
|
||||
|
||||
.typeahead {
|
||||
|
||||
@@ -143,7 +143,7 @@
|
||||
(let [{:strs [on-params-change params check-boxes? on-check-changed checked] :as consume} (js->clj consume)]
|
||||
(apply r/create-element "tr" #js {:className class}
|
||||
(when check-boxes?
|
||||
(r/as-element [:th {:style {:width "22px"}}
|
||||
(r/as-element [:th {:style {:width "35px"}}
|
||||
[:input.checkbox (cond-> {:type "checkbox"
|
||||
:checked (if (get checked id)
|
||||
"checked"
|
||||
|
||||
@@ -137,7 +137,7 @@
|
||||
(-> db
|
||||
(assoc ::invoice-page (first (:invoice-page data)))
|
||||
(update-in [::invoice-page] (fn [ip]
|
||||
(assoc ip :checked (by :id (:invoices ip)))))
|
||||
(assoc ip :checked (set (map :id (:invoices ip))))))
|
||||
(assoc-in [:status :loading] false))))
|
||||
|
||||
(re-frame/reg-event-db
|
||||
@@ -156,7 +156,7 @@
|
||||
:operation/name "RejectInvoices"}
|
||||
|
||||
:venia/queries [[:reject-invoices
|
||||
{:invoices (keys invoices)}
|
||||
{:invoices (vec invoices)}
|
||||
[]]]}
|
||||
:on-success [::completed]}
|
||||
}))
|
||||
@@ -171,7 +171,7 @@
|
||||
:operation/name "ApproveInvoices"}
|
||||
|
||||
:venia/queries [[:approve-invoices
|
||||
{:invoices (keys invoices)}
|
||||
{:invoices (vec invoices)}
|
||||
[]]]}
|
||||
:on-success [::completed]}
|
||||
}))
|
||||
@@ -189,13 +189,8 @@
|
||||
|
||||
(re-frame/reg-event-db
|
||||
::toggle-check
|
||||
(fn [db [_ id invoice]]
|
||||
(-> db
|
||||
(update-in [::invoice-page :checked] (fn [x]
|
||||
(let [x (or x {})]
|
||||
(if (x id)
|
||||
(dissoc x id)
|
||||
(assoc x id invoice))))))))
|
||||
(fn [db [_ new]]
|
||||
(-> db (assoc-in [::invoice-page :checked] new))))
|
||||
|
||||
(defn approve-reject-button [checked]
|
||||
[:div.is-pulled-right
|
||||
@@ -261,8 +256,8 @@
|
||||
[:p [:i.is-size-7 (:client-identifier row)]]])}
|
||||
:check-boxes true
|
||||
:checked (:checked @invoice-page)
|
||||
:on-check-changed (fn [which invoice]
|
||||
(re-frame/dispatch [::toggle-check which invoice]))
|
||||
:on-check-changed (fn [which]
|
||||
(re-frame/dispatch [::toggle-check which]))
|
||||
:status @(re-frame/subscribe [::status/single ::page])}]
|
||||
[:span "No pending invoices"])]]]))
|
||||
{:component-did-mount (fn []
|
||||
|
||||
Reference in New Issue
Block a user