vendors can be updated through datomic.

This commit is contained in:
Bryce Covert
2018-11-09 13:30:27 -08:00
parent de8563a60b
commit 8ea4ea0c73
12 changed files with 141 additions and 276 deletions

View File

@@ -8,10 +8,11 @@
[auto-ap.expense-accounts :refer [chooseable-expense-accounts]]
[clojure.spec.alpha :as s]
[auto-ap.entities.vendors :as entity]
[auto-ap.entities.contact :as contact]
[auto-ap.subs :as subs]))
(defn vendor-dialog [{:keys [vendor save-event change-event id] {:keys [name]} :vendor}]
(println (s/explain ::entity/vendor vendor) )
(let [companies-by-id @(re-frame/subscribe [::subs/companies-by-id])]
[action-modal {:id id
:title [:span (if (:id vendor)
@@ -82,7 +83,7 @@
[bind-field
[:input.input.is-expanded {:type "text"
:field [:primary-contact :name]
:spec ::entity/primary-contact
:spec ::contact/name
:event change-event
:subscription vendor}]]
[:span.icon.is-small.is-left
@@ -94,7 +95,7 @@
[bind-field
[:input.input {:type "email"
:field [:primary-contact :email]
:spec ::entity/primary-email
:spec ::contact/email
:event change-event
:subscription vendor}]]]
@@ -102,7 +103,7 @@
[bind-field
[:input.input {:type "phone"
:field [:primary-contact :phone]
:spec ::entity/primary-phone
:spec ::contact/phone
:event change-event
:subscription vendor}]]
[:span.icon.is-small.is-left
@@ -114,7 +115,7 @@
[bind-field
[:input.input.is-expanded {:type "text"
:field [:secondary-contact :name]
:spec ::entity/secondary-contact
:spec ::contact/name
:event change-event
:subscription vendor}]]
[:span.icon.is-small.is-left
@@ -125,14 +126,14 @@
[bind-field
[:input.input {:type "email"
:field [:secondary-contact :email]
:spec ::entity/secondary-email
:spec ::contact/email
:event change-event
:subscription vendor}]]]
[:div.control.has-icons-left
[bind-field
[:input.input {:type "phone"
:field [:secondary-contact :phone]
:spec ::entity/secondary-phone
:spec ::contact/phone
:event change-event
:subscription vendor}]]
[:span.icon.is-small.is-left