enormous refactor but simplified much!

This commit is contained in:
Bryce Covert
2021-12-22 18:14:49 -08:00
parent a7c9d376bc
commit 7489426ccb
25 changed files with 1188 additions and 1258 deletions

View File

@@ -17,7 +17,8 @@
[re-frame.core :as re-frame]
[reagent.core :as reagent]
[vimsical.re-frame.fx.track :as track]
[auto-ap.status :as status]))
[auto-ap.status :as status]
[clojure.string :as str]))
@@ -134,12 +135,21 @@
{:id ::manual-import
:events #{::manual/import-completed}
:event-fn (fn [[_ {:keys [imported errors] :as result}]]
[::status/info ::manual-import (str "Successfully imported " imported " transactions"
(when (seq errors)
(str
", " (count errors) " errors. "
"Example: '" (str (:info (first (:errors (first errors))))) "'")))])}]}))
(println result)
[::status/info ::manual-import
(str "Successfully "
(str/join ", "
[(when-let [imported (:import-batch/imported result)]
(str "imported " imported))
(when-let [extant (:import-batch/extant result)]
(str "extant " extant))
(when-let [suppressed (:import-batch/suppressed result)]
(str "suppressed " suppressed))
(when-let [error (:validation-error result)]
(str "errored " error))])
" transactions."
(when (:sample-error result)
(str " Sample error: " (:info (:sample-error result)))))])}]}))
(defn content []