less janky experience

This commit is contained in:
2023-10-19 22:28:08 -07:00
parent da6167622f
commit 174c428405
2 changed files with 22 additions and 23 deletions

View File

@@ -364,7 +364,7 @@
(com/field-errors {:source account (com/field-errors {:source account
:key :transaction-rule-account/account})]) :key :transaction-rule-account/account})])
(com/data-grid-cell {} (com/data-grid-cell {}
[:div {:hx-trigger (hx/triggers [:div [:div {:hx-trigger (hx/triggers
(hx/trigger-field-change :name "transaction-rule/client" (hx/trigger-field-change :name "transaction-rule/client"
:from "#edit-form") :from "#edit-form")
(hx/trigger-field-change :name account-name (hx/trigger-field-change :name account-name
@@ -383,7 +383,7 @@
(nat-int? (:transaction-rule-account/account account)) (dc/pull (dc/db conn) (nat-int? (:transaction-rule-account/account account)) (dc/pull (dc/db conn)
'[:account/location]))) '[:account/location])))
:client-locations (:client/locations (:transaction-rule/client transaction-rule)) :client-locations (:client/locations (:transaction-rule/client transaction-rule))
:value (:transaction-rule-account/location account)}) :value (:transaction-rule-account/location account)})]
(com/field-errors {:source account (com/field-errors {:source account
:key :transaction-rule-account/location})]) :key :transaction-rule-account/location})])
(com/data-grid-cell (com/money-input {:name (format "transaction-rule/accounts[%s][transaction-rule-account/percentage]" (:db/id account)) (com/data-grid-cell (com/money-input {:name (format "transaction-rule/accounts[%s][transaction-rule-account/percentage]" (:db/id account))

View File

@@ -110,10 +110,9 @@ c.clearChoices();
(defn field-errors- [{:keys [source key]} & rest] (defn field-errors- [{:keys [source key]} & rest]
(if-let [errors (:errors (cond-> (meta source) (let [errors (:errors (cond-> (meta source)
key (get key)))] key (get key)))]
[:div.text-red-500 (str/join ", " errors)] [:p.mt-2.text-xs.text-red-600.dark:text-red-500.h-4 (str/join ", " errors)]))
[:p.mt-2.text-xs.text-red-600.dark:text-red-500]))
(defn field- [params & rest] (defn field- [params & rest]
[:div {:id (:id params)} [:div {:id (:id params)}