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