working on ui improvements.

This commit is contained in:
BC
2018-07-06 18:48:57 -07:00
parent bf7d0698d4
commit d87ebbbfe4
5 changed files with 108 additions and 102 deletions

View File

@@ -10,10 +10,8 @@
[auto-ap.entities.vendors :as entity]
[auto-ap.subs :as subs]))
(defn vendor-dialog [{:keys [vendor save-event change-event id] {:keys [name]} :vendor}]
(let [companies-by-id @(re-frame/subscribe [::subs/companies-by-id])]
[action-modal {:id id
:title [:span (if (:id vendor)
(str "Edit " (or name "<vendor>"))
@@ -22,13 +20,17 @@
[:span.icon.has-text-danger
[:i.fa.fa-exclamation-triangle]])]
:action-text "Save"
:save-event save-event}
:save-event save-event
:can-submit? (s/valid? ::entity/vendor vendor)}
(doto (s/explain ::entity/vendor vendor) println)
[horizontal-field
[:label.label "Name"]
[:div.control
[bind-field
[:input.input {:type "text"
:auto-focus true
:field :name
:spec ::entity/name
:event change-event
@@ -43,7 +45,16 @@
:spec ::entity/print-as
:event change-event
:subscription vendor}]]]]
[:h2.subtitle "Expense Accounts"]
[horizontal-field
[:label.label "Default"]
[bind-field
[typeahead {:matches (map (fn [[k v]] [k (:name v)]) chooseable-expense-accounts)
:type "typeahead"
:field [:default-expense-account]
:spec ::entity/default-expense-account
:event change-event
:subscription vendor}]]]
#_[horizontal-field
[:label.label "Code"]
[:div.control
@@ -151,16 +162,7 @@
:subscription vendor}]]
" Never"]]]
[:h2.subtitle "Expense Accounts"]
[horizontal-field
[:label.label "Default"]
[bind-field
[typeahead {:matches (map (fn [[k v]] [k (:name v)]) chooseable-expense-accounts)
:type "typeahead"
:field [:default-expense-account]
:spec ::entity/default-expense-account
:event change-event
:subscription vendor}]]]