supports filtering down to just duplicates.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
(ns ^:figwheel-hooks auto-ap.reload)
|
||||
|
||||
(defn ^:after-load reload []
|
||||
(println "HERE")
|
||||
(println "RELOADING")
|
||||
(@(resolve 'auto-ap.core/mount-root)))
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
:amount-gte (:amount-gte (:amount-range params))
|
||||
:exact-match-id (some-> (:exact-match-id params) str)
|
||||
:unresolved (:unresolved params)
|
||||
:potential-duplicates (:potential-duplicates params)
|
||||
:location (:location params)
|
||||
:import-batch-id (some-> (:import-batch-id params) str)
|
||||
:amount-lte (:amount-lte (:amount-range params))
|
||||
@@ -92,7 +93,7 @@
|
||||
|
||||
(re-frame/reg-event-fx
|
||||
::delete-selected
|
||||
(fn [cofx [_ params]]
|
||||
(fn [cofx [_ params suppress]]
|
||||
(let [checked @(re-frame/subscribe [::data-page/checked ::page])
|
||||
checked-params (get checked "header")
|
||||
specific-transactions (map :id (vals (dissoc checked "header")))]
|
||||
@@ -106,7 +107,8 @@
|
||||
:venia/queries [{:query/data
|
||||
[:delete-transactions
|
||||
{:filters (some-> checked-params data-params->query-params)
|
||||
:ids specific-transactions}
|
||||
:ids specific-transactions
|
||||
:suppress suppress}
|
||||
[:message]]}]}
|
||||
:on-success (fn [result]
|
||||
[::params-change params])}
|
||||
@@ -192,7 +194,12 @@
|
||||
:disabled (or (status/disabled-for @(re-frame/subscribe [::status/single ::bulk-change-transaction-status]))
|
||||
(not (seq checked)))}
|
||||
"Client Review"]
|
||||
[:button.button.is-danger {:on-click (dispatch-event [::delete-selected params])
|
||||
[:button.button.is-danger {:on-click (dispatch-event [::delete-selected params false])
|
||||
:class (status/class-for @(re-frame/subscribe [::status/single ::delete-selected]))
|
||||
:disabled (or (status/disabled-for @(re-frame/subscribe [::status/single ::delete-selected]))
|
||||
(not (seq checked)))}
|
||||
"Delete selected"]
|
||||
[:button.button.is-danger {:on-click (dispatch-event [::delete-selected params true])
|
||||
:class (status/class-for @(re-frame/subscribe [::status/single ::delete-selected]))
|
||||
:disabled (or (status/disabled-for @(re-frame/subscribe [::status/single ::delete-selected]))
|
||||
(not (seq checked)))}
|
||||
|
||||
@@ -119,12 +119,7 @@
|
||||
|
||||
(when (= "admin" (:user/role user))
|
||||
[:<>
|
||||
(when-let [import-batch-id @(re-frame/subscribe [::data-page/filter data-page :import-batch-id])]
|
||||
[:div
|
||||
[:p.menu-label "Import Batch"]
|
||||
[:span.tag.is-medium import-batch-id " "
|
||||
[:button.delete.is-small {:on-click
|
||||
(dispatch-event [::data-page/filter-changed data-page :import-batch-id nil])}]]])
|
||||
|
||||
[:p.menu-label "Admin only"]
|
||||
[:div
|
||||
[switch-field {:id "unresolved-only"
|
||||
@@ -132,5 +127,20 @@
|
||||
:on-change (fn [e]
|
||||
(re-frame/dispatch [::data-page/filter-changed data-page :unresolved (.-checked (.-target e))]))
|
||||
:label "Unresolved only"
|
||||
:type "checkbox"}]]
|
||||
|
||||
(when-let [import-batch-id @(re-frame/subscribe [::data-page/filter data-page :import-batch-id])]
|
||||
[:div
|
||||
[:p.menu-label "Import Batch"]
|
||||
[:span.tag.is-medium import-batch-id " "
|
||||
[:button.delete.is-small {:on-click
|
||||
(dispatch-event [::data-page/filter-changed data-page :import-batch-id nil])}]]])
|
||||
|
||||
[:div
|
||||
[switch-field {:id "potentially-duplicate"
|
||||
:checked (boolean @(re-frame/subscribe [::data-page/filter data-page :potential-duplicates]))
|
||||
:on-change (fn [e]
|
||||
(re-frame/dispatch [::data-page/filter-changed data-page :potential-duplicates (.-checked (.-target e))]))
|
||||
:label "Same Amount + Date"
|
||||
:type "checkbox"}]]])]))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user