approach
This commit is contained in:
@@ -107,7 +107,6 @@
|
||||
[:> Consumer {}
|
||||
(fn [consume]
|
||||
(let [{:strs [on-params-change params] :as consume} (js->clj consume)]
|
||||
(println "PARAMS" params)
|
||||
(r/as-element (into
|
||||
[:div {:style {:margin-bottom "1rem"}}
|
||||
[:div.level
|
||||
@@ -139,7 +138,7 @@
|
||||
:class class}]
|
||||
(r/children (r/current-component))))
|
||||
|
||||
(defn row [{:keys [class id checkable?]}]
|
||||
(defn row [{:keys [class id checkable? entity] }]
|
||||
(let [children (r/children (r/current-component))]
|
||||
[:> Consumer {}
|
||||
(fn [consume]
|
||||
@@ -153,9 +152,15 @@
|
||||
"")
|
||||
:on-change (fn [x e]
|
||||
(let [checked (or checked #{})]
|
||||
(if (get checked id)
|
||||
(on-check-changed (disj checked id))
|
||||
(on-check-changed (conj checked id)))))}
|
||||
;; TODO only map once everything is moved over to data-page
|
||||
(if (map? checked)
|
||||
(if (get checked id)
|
||||
(on-check-changed (dissoc checked id))
|
||||
(on-check-changed (assoc checked id entity)))
|
||||
|
||||
(if (get checked id)
|
||||
(on-check-changed (disj checked id))
|
||||
(on-check-changed (conj checked id))))))}
|
||||
(boolean? checkable?) (assoc :disabled (not checkable?))) ]]))
|
||||
|
||||
(map r/as-element children))))]))
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
(let [{:keys [client payments expense-accounts invoice-number date due total outstanding-balance id vendor checkable?] :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?}
|
||||
[grid/row {:class (:class i) :id id :checkable? checkable? :entity invoice}
|
||||
(when-not selected-client
|
||||
[grid/cell {}
|
||||
(if-let [client-override (:client overrides)]
|
||||
|
||||
Reference in New Issue
Block a user