Makes cursor-seq for lists

This commit is contained in:
2023-10-23 15:02:36 -07:00
parent be9d777a17
commit 84d6f455ff
4 changed files with 15 additions and 15 deletions

View File

@@ -376,11 +376,8 @@
(com/data-grid-header {} "Account name")
(com/data-grid-header {})]
:id "client-override-table"}
(when (fc/field-value)
(doall
(for [override fc/*current*]
(fc/with-cursor override
(client-override* override)))))
(fc/cursor-map
#(client-override* %))
(com/data-grid-row
{:class "new-row"}
(com/data-grid-cell {:colspan 3

View File

@@ -549,10 +549,7 @@
(com/data-grid-header {:class "w-16"} "%")
(com/data-grid-header {:class "w-16"})]
:id "transaction-rule-account-table"}
(when (fc/field-value)
(doall (for [tra fc/*current*]
(fc/with-cursor tra
(transaction-rule-account-row* entity tra)))))
(fc/cursor-map #(transaction-rule-account-row* entity %))
(com/data-grid-row
{:class "new-row"}
(com/data-grid-cell {:colspan 4

View File

@@ -45,3 +45,13 @@
(every? string? errors)))))
(defn cursor-map
([f] (cursor-map *current* f))
([cursor f]
(when (field-value)
(doall
(for [n cursor]
(with-cursor n
(f n)))))))

View File

@@ -322,9 +322,7 @@
(com/data-grid {:headers [(com/data-grid-header {} "Client")
(com/data-grid-header {} )]
:id "client-table"}
(doall (for [client fc/*current*]
(fc/with-cursor client
(client-row* client))))
(fc/cursor-map #(client-row* %))
(com/data-grid-row
{:class "new-row"}
(com/data-grid-cell {:colspan 2
@@ -337,9 +335,7 @@
:hx-vals (hiccup/raw "js:{index: countRows(\"#client-table\")}")
:hx-target "#edit-form .new-row"
:hx-swap "beforebegin"}
"New override")])))
))
[:div#form-errors [:span.error-content]]]
"New override")])))))]
[:div
[:div [:div#form-errors (when (:errors fc/*form-errors*)
[:span.error-content