fixes
This commit is contained in:
@@ -41,7 +41,7 @@
|
||||
:seen-by-client? s})
|
||||
ors))))
|
||||
|
||||
(defn transaction-recommendations [identity selected-client & {:keys [after]}]
|
||||
(defn transaction-recommendations [identity clients & {:keys [after]}]
|
||||
(let [visible-clients (visible-clients identity)]
|
||||
(->>
|
||||
(dc/qseq {:query '[:find (pull ?t pull-expr)
|
||||
@@ -56,9 +56,8 @@
|
||||
|
||||
:args [(dc/db conn)
|
||||
(iol-ion.query/recent-date 120)
|
||||
(if selected-client
|
||||
[selected-client]
|
||||
visible-clients)
|
||||
(map :db/id clients)
|
||||
|
||||
pull-expr]})
|
||||
(map first)
|
||||
(drop-while (fn [x]
|
||||
@@ -273,8 +272,8 @@
|
||||
[:td (format "%.1f%%" (* 100 (double score)))]]))]]
|
||||
[:div])))))
|
||||
|
||||
(defn transaction-rows* [{:keys [selected-client identity after]}]
|
||||
(let [recommendations (transaction-recommendations identity selected-client :after after)]
|
||||
(defn transaction-rows* [{:keys [clients identity after]}]
|
||||
(let [recommendations (transaction-recommendations identity clients :after after)]
|
||||
(if (seq recommendations)
|
||||
(for [r recommendations
|
||||
:let [last? (= r (last recommendations))]]
|
||||
@@ -282,13 +281,13 @@
|
||||
[:tr [:td.has-text-centered.has-text-gray {:colspan 7 }
|
||||
[:i "That's the last of 'em!"]]])))
|
||||
|
||||
(defn transaction-rows [{:keys [session identity route-params]}]
|
||||
(html-response (transaction-rows* {:selected-client (-> session :client :db/id)
|
||||
(defn transaction-rows [{:keys [session identity route-params clients]}]
|
||||
(html-response (transaction-rows* {:clients clients
|
||||
:identity identity
|
||||
:after (:after route-params)})))
|
||||
|
||||
(defn insight-table* [{:keys [selected-client identity]}]
|
||||
(let [recommendations (transaction-recommendations identity selected-client)]
|
||||
(defn insight-table* [{:keys [clients identity]}]
|
||||
(let [recommendations (transaction-recommendations identity clients)]
|
||||
(com/data-grid-card {:id "insight-table"
|
||||
:title "Transaction Insights"
|
||||
:route :transaction-insight-table
|
||||
@@ -305,16 +304,16 @@
|
||||
(com/data-grid-header {:style {:width "8em"}} "Amount")
|
||||
(com/data-grid-header {})]})))
|
||||
|
||||
(defn insight-table [{:keys [session identity]}]
|
||||
(html-response (insight-table* {:selected-client
|
||||
(-> session :client :db/id)
|
||||
(defn insight-table [{:keys [session identity clients]}]
|
||||
(html-response (insight-table* {:clients clients
|
||||
:identity identity})))
|
||||
|
||||
(defn page [{:keys [identity matched-route session] :as request}]
|
||||
(base-page
|
||||
request
|
||||
(com/page {:nav (com/main-aside-nav)
|
||||
:active-client (:client (:session request))
|
||||
:client-selection (:client-selection (:session request))
|
||||
:client (:client request)
|
||||
:identity (:identity request)
|
||||
:app-params {:hx-get (bidi/path-for ssr-routes/only-routes
|
||||
:transaction-insights)
|
||||
|
||||
Reference in New Issue
Block a user