From d1db270f4eabb21ceb243d3cfa4d0fb9c0639390 Mon Sep 17 00:00:00 2001 From: BC Date: Thu, 25 Oct 2018 19:11:26 -0700 Subject: [PATCH] allowing saving after saving. --- src/cljc/auto_ap/entities/vendors.cljc | 17 ++++++++--------- .../auto_ap/views/components/vendor_dialog.cljs | 3 ++- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/cljc/auto_ap/entities/vendors.cljc b/src/cljc/auto_ap/entities/vendors.cljc index b0805117..bacdc4ab 100644 --- a/src/cljc/auto_ap/entities/vendors.cljc +++ b/src/cljc/auto_ap/entities/vendors.cljc @@ -5,8 +5,7 @@ (def email-regex #"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,63}$") (s/def ::id int) -(s/def ::identifier (s/nilable string?)) -(s/def ::required-identifier (s/and string? +(s/def ::identifier (s/nilable string?)) (s/def ::required-identifier (s/and string? #(not (str/blank? %)))) (s/def ::name ::required-identifier) @@ -17,14 +16,14 @@ (s/def ::phone (s/nilable string?)) (s/def ::invoice-reminder-schedule (s/nilable #{"Weekly" "Never" nil})) -(s/def ::primary-contact ::identifier) -(s/def ::primary-email ::email) -(s/def ::primary-phone ::phone) +(s/def ::primary-contact (s/nilable ::identifier)) +(s/def ::primary-email (s/nilable ::email)) +(s/def ::primary-phone (s/nilable ::phone)) -(s/def ::secondary-contact ::identifier) -(s/def ::secondary-email ::email) -(s/def ::secondary-phone ::phone) -(s/def ::address ::address/address) +(s/def ::secondary-contact (s/nilable ::identifier)) +(s/def ::secondary-email (s/nilable ::email)) +(s/def ::secondary-phone (s/nilable ::phone)) +(s/def ::address (s/nilable ::address/address)) (s/def ::default-expense-account int?) (s/def ::code (s/nilable string?)) diff --git a/src/cljs/auto_ap/views/components/vendor_dialog.cljs b/src/cljs/auto_ap/views/components/vendor_dialog.cljs index fea46601..5ca766e6 100644 --- a/src/cljs/auto_ap/views/components/vendor_dialog.cljs +++ b/src/cljs/auto_ap/views/components/vendor_dialog.cljs @@ -11,6 +11,7 @@ [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) @@ -23,7 +24,7 @@ :save-event save-event :can-submit? (s/valid? ::entity/vendor vendor)} - (doto (s/explain ::entity/vendor vendor) println) + [horizontal-field [:label.label "Name"]