ux improvements for erros.

This commit is contained in:
Bryce Covert
2019-02-20 11:39:19 -08:00
parent 91d9ea346d
commit 985b5339af
12 changed files with 134 additions and 56 deletions

View File

@@ -79,7 +79,11 @@
(assoc-in [::params] params))
:graphql {:token (-> cofx :db :user)
:query-obj (invoice-table/query (-> params (assoc :import-status "imported") (dissoc :invoice-number-like-current)) )
:on-success [::received]}}))
:on-success [::received]
:on-error [::events/page-failed]}}))
(re-frame/reg-event-db
::unmount-invoices
(fn [db [_ data]]
@@ -805,15 +809,14 @@
(defn unpaid-invoices-content [{:keys [status]}]
(r/create-class {:display-name "unpaid-invoices-content"
:component-will-unmount (fn [this]
(re-frame/dispatch [::unmount-invoices])
)
(re-frame/dispatch [::unmount-invoices]))
:reagent-render (fn [{:keys [status]}]
(let [{:keys [checked print-checks-shown? print-checks-loading? advanced-print-shown? vendor-filter]} @(re-frame/subscribe [::invoice-page])
current-client @(re-frame/subscribe [::subs/client])
{check-results-shown? :shown? pdf-url :pdf-url} @(re-frame/subscribe [::check-results])]
[:div
[:h1.title (str (str/capitalize status) " invoices")]
(when (= status "unpaid")
[pay-button {:print-checks-shown? print-checks-shown? :checked-invoices checked :print-checks-loading? print-checks-loading?}])