refactor(charts): unify on Chart.js, remove Chartist #10
@@ -186,9 +186,11 @@
|
||||
Caller must establish Alpine x-data with simpleAccountId in scope."
|
||||
[request]
|
||||
(let [snapshot (-> request :multi-form-state :snapshot)
|
||||
step-params (-> request :multi-form-state :step-params)
|
||||
client-id (or (-> request :entity :transaction/client :db/id)
|
||||
(:transaction/client snapshot))
|
||||
existing-row (first (:transaction/accounts snapshot))
|
||||
existing-row (first (or (seq (:transaction/accounts step-params))
|
||||
(seq (:transaction/accounts snapshot))))
|
||||
account-val (:transaction-account/account existing-row)
|
||||
location-val (or (:transaction-account/location existing-row) "Shared")
|
||||
account-id (when (nat-int? account-val)
|
||||
@@ -501,7 +503,10 @@
|
||||
Must be called within a fc/start-form + fc/with-field :step-params context."
|
||||
[mode request]
|
||||
(let [snapshot (-> request :multi-form-state :snapshot)
|
||||
row-count (count (:transaction/accounts snapshot))]
|
||||
step-params (-> request :multi-form-state :step-params)
|
||||
all-accounts (or (seq (:transaction/accounts step-params))
|
||||
(seq (:transaction/accounts snapshot)))
|
||||
row-count (count all-accounts)]
|
||||
[:div#manual-coding-section
|
||||
(com/hidden {:name "mode" :value (name mode)})
|
||||
[:div {:hx-trigger "change"
|
||||
@@ -522,7 +527,7 @@
|
||||
:content-fn (fn [c] (pull-attr (dc/db conn) :vendor/name c))})]))]
|
||||
(if (= mode :simple)
|
||||
[:div {:x-data (hx/json {:simpleAccountId
|
||||
(-> snapshot :transaction/accounts first
|
||||
(-> (first all-accounts)
|
||||
:transaction-account/account)})}
|
||||
(simple-mode-fields* request)]
|
||||
[:div
|
||||
|
||||
Reference in New Issue
Block a user