showing matched rule.

This commit is contained in:
Bryce Covert
2019-05-16 08:34:12 -07:00
parent ac5ffd26fe
commit 8845ec9688
7 changed files with 37 additions and 17 deletions

View File

@@ -151,6 +151,12 @@
false
%))))
(re-frame/reg-sub
::is-admin?
:<- [::user]
(fn [user]
(= "admin" (:user/role user))))
(re-frame/reg-sub
::user
(fn [db]

View File

@@ -5,6 +5,7 @@
:amount
:location
:exclude-from-ledger
[:matched-rule [:note :id]]
[:vendor [:name :id]]
[:accounts [:id :amount :location [:account [:name :id :location :numeric-code]]]]
:date

View File

@@ -49,7 +49,8 @@
(-> which
(select-keys [:vendor :amount :payment :client :description-original
:yodlee-merchant :id :potential-payment-matches
:exclude-from-ledger :location :accounts :transaction-approval-status])
:exclude-from-ledger :location :accounts :transaction-approval-status
:matched-rule])
(assoc :potential-payment-matches potential-payment-matches)
(update :accounts expense-accounts-field/from-graphql (:amount which) locations))))))
@@ -114,7 +115,6 @@
(defn potential-payment-matches-box [{:keys [potential-payment-matches] :as params}]
(println potential-payment-matches)
[:div.box
[:div.columns
[:div.column
@@ -140,10 +140,18 @@
locations @(re-frame/subscribe [::subs/locations-for-client (:id (:client data))])
{:keys [form field raw-field error-notification submit-button ]} transaction-form]
[form {:title "Hello" :edit-completed edit-completed}
[field "Merchant"
[:input.input {:type "text"
:field [:yodlee-merchant :name]
:disabled "disabled"}]]
(when @(re-frame/subscribe [::subs/is-admin?])
[field "Merchant"
[:input.input {:type "text"
:field [:yodlee-merchant :name]
:disabled "disabled"}]])
(when @(re-frame/subscribe [::subs/is-admin?])
[field "Matched Rule"
[:input.input {:type "text"
:field [:matched-rule :note]
:disabled "disabled"}]])
[field "Amount"
[:input.input {:type "text"
:field [:amount]