From b79fca113bf0fc187de0b961fb86dd186f47ba52 Mon Sep 17 00:00:00 2001 From: Bryce Covert Date: Wed, 17 Apr 2019 08:11:57 -0700 Subject: [PATCH] fixed warnings. --- src/cljs/auto_ap/views/pages/invoices/form.cljs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/cljs/auto_ap/views/pages/invoices/form.cljs b/src/cljs/auto_ap/views/pages/invoices/form.cljs index 39bf6697..39909ce2 100644 --- a/src/cljs/auto_ap/views/pages/invoices/form.cljs +++ b/src/cljs/auto_ap/views/pages/invoices/form.cljs @@ -316,8 +316,6 @@ [:p.buttons [:a.button {:on-click (dispatch-event [::add-expense-account])} "Add"]]]] - - (for [[index {:keys [account id location amount] :as expense-account}] (map vector (range) (:expense-accounts data)) :let [account (accounts-by-id (:id account))]] ^{:key id} @@ -337,7 +335,7 @@ [:p.help "Expense Account"] [:div.control.is-fullwidth [bind-field - [typeahead {:matches (map (fn [x] [(:id x) (str (:numeric-code x) " - " (:name x))]) @(re-frame/subscribe [::subs/chooseable-expense-accounts])) + [typeahead {:matches (map (fn [x] [(:id x) (str (:numeric-code x) " - " (:name x))]) chooseable-expense-accounts) :type "typeahead" :field [:expense-accounts index :account :id] :event [::change-expense-account-account] @@ -345,12 +343,15 @@ [:div.column.is-narrow [:p.help "Location"] [:div.control - (if-let [forced-location (:location @(re-frame/subscribe [::subs/account (get-in data [:expense-accounts index :account :id])]))] + (if-let [forced-location (:location account)] [:div.select [:select {:disabled "disabled" :style {:width "5em"} :value forced-location} [:option {:value forced-location} forced-location]]] [:div.select [bind-field [:select {:type "select" + :disabled (if (:location account) + "disabled" + "") :style {:width "5em"} :field [:expense-accounts index :location] :allow-nil? true