adding and removing transaction rules works.

This commit is contained in:
Bryce Covert
2019-05-09 10:21:59 -07:00
parent 8c50085fcc
commit 753949e063
4 changed files with 45 additions and 13 deletions

View File

@@ -1,5 +1,7 @@
(ns auto-ap.views.pages.admin.rules.table
(:require [auto-ap.subs :as subs]
[auto-ap.views.utils :refer [dispatch-event ->$]]
[auto-ap.views.pages.admin.rules.form :as form]
[auto-ap.views.components.paginator :refer [paginator]]
[auto-ap.views.components.sorter :refer [sorted-column]]
[re-frame.core :as re-frame]))
@@ -59,18 +61,22 @@
:sort-key "note"
:sort-by sort-by
:asc asc}
"Note"]]]
"Note"]
[:th {:style {:width "6em"}}
]]]
[:tbody
(if (:loading @status)
[:tr
[:td {:col-span 5}
[:i.fa.fa-spin.fa-spinner]]]
(for [{:keys [client bank-account description amount-lte amount-gte note] :as r} transaction-rules]
(for [{:keys [client bank-account description amount-lte amount-gte note id] :as r} transaction-rules]
^{:key id}
[:tr {:class (:class r)}
[:td (:name client)]
[:td (:name bank-account)]
[:td description]
[:td.has-text-right amount-gte ]
[:td.has-text-right amount-lte]
[:td note]]))]]]))))
[:td.has-text-right (some-> amount-gte ->$) ]
[:td.has-text-right (some-> amount-lte ->$)]
[:td note]
[:td
[:a.button {:on-click (dispatch-event [::form/editing r])} [:span.icon [:i.fa.fa-pencil]]]]]))]]]))))