Transactions are converted!
This commit is contained in:
@@ -20,14 +20,6 @@
|
||||
[auto-ap.status :as status]))
|
||||
|
||||
|
||||
(re-frame/reg-event-fx
|
||||
::manual-import-completed
|
||||
(fn [{:keys [db]} [_ {:keys [imported errors]}]]
|
||||
{:dispatch [::params-change @(re-frame/subscribe [::data-page/params ::page])]
|
||||
:db (-> db
|
||||
(assoc-in [::notification :message] (str "Successfully imported " imported " transactions"))
|
||||
(assoc-in [::notification :errors] errors))}))
|
||||
|
||||
|
||||
(defn data-params->query-params [params]
|
||||
{:start (:start params 0)
|
||||
@@ -87,9 +79,11 @@
|
||||
(re-frame/reg-event-fx
|
||||
::unmounted
|
||||
(fn [{:keys [db]} _]
|
||||
{:dispatch [::data-page/dispose ::page]
|
||||
{:dispatch-n [[::data-page/dispose ::page]
|
||||
[::status/dispose-single ::manual-import]]
|
||||
::track/dispose {:id ::params}
|
||||
::forward/dispose {:id ::updated}}))
|
||||
::forward/dispose [{:id ::updated}
|
||||
{:id ::manual-import}]}))
|
||||
|
||||
(re-frame/reg-event-fx
|
||||
::mounted
|
||||
@@ -98,26 +92,24 @@
|
||||
:subscription [::data-page/params ::page]
|
||||
:event-fn (fn [params]
|
||||
[::params-change params])}
|
||||
::forward/register {:id ::updated
|
||||
:events #{::edit/edited}
|
||||
:event-fn (fn [[_ edited-transaction]]
|
||||
[::data-page/updated-entity ::page edited-transaction])}}))
|
||||
::forward/register [{:id ::updated
|
||||
:events #{::edit/edited}
|
||||
:event-fn (fn [[_ edited-transaction]]
|
||||
[::data-page/updated-entity ::page edited-transaction])}
|
||||
{:id ::manual-import
|
||||
:events #{::manual/import-completed}
|
||||
:event-fn (fn [[_ {:keys [imported errors] :as result}]]
|
||||
[::status/info ::manual-import (str "Successfully imported " imported " transactions")])}]}))
|
||||
|
||||
|
||||
|
||||
|
||||
(re-frame/reg-sub
|
||||
::notification
|
||||
(fn [db]
|
||||
(-> db ::notification)))
|
||||
|
||||
(defn content []
|
||||
(let [notification (re-frame/subscribe [::notification])
|
||||
user @(re-frame/subscribe [::subs/user])
|
||||
params @(re-frame/subscribe [::data-page/params ::page])]
|
||||
[:div
|
||||
[:h1.title "Transactions"]
|
||||
[status/status-notification {:statuses [[::status/single ::unapprove-all]]}]
|
||||
[status/status-notification {:statuses [[::status/single ::unapprove-all]
|
||||
[::status/single ::manual-import]]}]
|
||||
(when (= "admin" (:user/role user))
|
||||
[:div
|
||||
(when (:message @notification)
|
||||
@@ -155,8 +147,6 @@
|
||||
{:side-bar [side-bar/side-bar {:data-page ::page}]
|
||||
:main [:div ^{:key approval-status}
|
||||
[content]]
|
||||
:bottom [:div
|
||||
[manual/modal {:import-completed [::manual-import-completed ]}]]
|
||||
:right-side-bar [appearing-side-bar
|
||||
{:visible? transaction-bar-active?}
|
||||
[edit/form]]}]))}))
|
||||
|
||||
Reference in New Issue
Block a user