Makes it easy to tell which thing you selected

This commit is contained in:
2024-11-20 11:40:02 -08:00
parent c39b3d936e
commit e8b753a0bd
3 changed files with 23 additions and 16 deletions

View File

@@ -888,21 +888,26 @@
(fc/with-field :bank-account/plaid-account
(com/validated-field {:errors (fc/field-errors)
:label "Plaid account"
:class "w-[20em]"}
(com/select {:name (fc/field-name)
:allow-blank? true
:error? (fc/error?)
:class "w-full"
:value (fc/field-value)
:options
(when client-id
(dc/q '[:find ?pa ?pn
:in $ ?client
:where [?pi :plaid-item/client ?client]
[?pi :plaid-item/accounts ?pa]
[?pa :plaid-account/name ?pn]]
(dc/db conn)
client-id))}))))
:class "w-[20em]"
:x-data (hx/json {:plaidAccount (fc/field-value)})}
[:div.flex.gap-2.items-center
(com/select {:name (fc/field-name)
:allow-blank? true
:error? (fc/error?)
:class "w-full"
:value (fc/field-value)
:x-model "plaidAccount"
:options
(when client-id
(dc/q '[:find ?pa ?pn
:in $ ?client
:where [?pi :plaid-item/client ?client]
[?pi :plaid-item/accounts ?pa]
[?pa :plaid-account/name ?pn]]
(dc/db conn)
client-id))})
[:svg {":data-jdenticon-value" "plaidAccount" :width "24" :height "24"
:x-init "$watch('plaidAccount', () => jdenticon())"}]])))
(defn- yodlee-account-select [client-id]
(list

View File

@@ -226,7 +226,8 @@
:render (fn [e]
[:ul
(for [a (:plaid-item/accounts e)]
[:li (:plaid-account/name a) " - " (:plaid-account/number a)])])}]}))
[:li [:svg.inline {:data-jdenticon-value (:db/id a) :width "24" :height "24"}] (:plaid-account/name a) " - " (:plaid-account/number a) " - updated "
(atime/unparse-local (:plaid-account/last-synced a) atime/normal-date)])])}]}))
(def page (helper/page-route grid-page))

View File

@@ -59,6 +59,7 @@
[:script {:defer true :src "https://cdn.jsdelivr.net/npm/@alpinejs/focus@3.x.x/dist/cdn.min.js"}]
[:script {:defer true :src "https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"}]
[:script {:src "https://cdn.jsdelivr.net/npm/signature_pad@4.1.7/dist/signature_pad.umd.min.js"}]
[:script {:src "https://cdn.jsdelivr.net/npm/jdenticon@3.3.0/dist/jdenticon.min.js" :async true :defer true :integrity "sha384-LfouGM03m83ArVtne1JPk926e3SGD0Tz8XHtW2OKGsgeBU/UfR0Fa8eX+UlwSSAZ" :crossorigin "anonymous" }]
[:style
"