accounts and transactions work the same way
This commit is contained in:
@@ -244,11 +244,12 @@
|
|||||||
;; goes with what, building index on the server side
|
;; goes with what, building index on the server side
|
||||||
;; not needing to pass index in
|
;; not needing to pass index in
|
||||||
|
|
||||||
|
;; TODO decide when cursors are used. other cases it's not, some are
|
||||||
(defn client-override* [override]
|
(defn client-override* [override]
|
||||||
[:div.flex.gap-2.mb-2.client-override (-> {"x-ref" "p"
|
[:div.flex.gap-2.mb-2.client-override (-> {:x-ref "p"
|
||||||
:data-key "show"
|
:data-key "show"
|
||||||
}
|
:x-data (hx/json {:show (boolean (not (:new? override)))})}
|
||||||
hx/alpine-mount-then-appear)
|
hx/alpine-mount-then-appear)
|
||||||
[:div.w-96
|
[:div.w-96
|
||||||
(fc/with-field :db/id
|
(fc/with-field :db/id
|
||||||
(com/hidden {:name (fc/field-name)
|
(com/hidden {:name (fc/field-name)
|
||||||
@@ -388,7 +389,8 @@
|
|||||||
(defn new-client-override [{ {:keys [index]} :query-params}]
|
(defn new-client-override [{ {:keys [index]} :query-params}]
|
||||||
(let [index (or index 0)
|
(let [index (or index 0)
|
||||||
account {:account/client-overrides (conj (into [] (repeat index {}))
|
account {:account/client-overrides (conj (into [] (repeat index {}))
|
||||||
{:db/id (str (java.util.UUID/randomUUID))})}] ;; TODO schema decode is not working
|
{:db/id (str (java.util.UUID/randomUUID))
|
||||||
|
:new? true})}] ;; TODO schema decode is not working
|
||||||
(html-response
|
(html-response
|
||||||
(fc/start-form account []
|
(fc/start-form account []
|
||||||
(fc/with-cursor (get-in fc/*current* [:account/client-overrides index])
|
(fc/with-cursor (get-in fc/*current* [:account/client-overrides index])
|
||||||
|
|||||||
@@ -342,8 +342,12 @@
|
|||||||
|
|
||||||
(defn- transaction-rule-account-row*
|
(defn- transaction-rule-account-row*
|
||||||
[transaction-rule account]
|
[transaction-rule account]
|
||||||
(com/data-grid-row {:x-data (hx/json {:accountId (or (:db/id (fc/field-value (:transaction-rule-account/account account)))
|
(com/data-grid-row (-> {:x-data (hx/json {:accountId (or (:db/id (fc/field-value (:transaction-rule-account/account account)))
|
||||||
(fc/field-value (:transaction-rule-account/account account)))})}
|
(fc/field-value (:transaction-rule-account/account account)))
|
||||||
|
:show (boolean (not (fc/field-value (:new? account))))})
|
||||||
|
:data-key "show"
|
||||||
|
:x-ref "p"}
|
||||||
|
hx/alpine-mount-then-appear)
|
||||||
(let [account-name (fc/field-name (:transaction-rule-account/account account))]
|
(let [account-name (fc/field-name (:transaction-rule-account/account account))]
|
||||||
(list
|
(list
|
||||||
|
|
||||||
@@ -394,10 +398,7 @@
|
|||||||
(* 100 )
|
(* 100 )
|
||||||
(long ))}))))))
|
(long ))}))))))
|
||||||
(com/data-grid-cell {:class "align-top"}
|
(com/data-grid-cell {:class "align-top"}
|
||||||
(com/a-icon-button
|
(com/a-icon-button {"@click.prevent.stop" "show=false; setTimeout(() => $refs.p.remove(), 500)"} svg/x))))
|
||||||
{"_" (hiccup/raw "on click halt the event then transition the closest <tr />'s opacity to 0 then remove closest <tr />")
|
|
||||||
:href "#"}
|
|
||||||
svg/x))))
|
|
||||||
|
|
||||||
;; TODO dialog is no longer closeable
|
;; TODO dialog is no longer closeable
|
||||||
(defn dialog* [& {:keys [entity form-params form-errors]}]
|
(defn dialog* [& {:keys [entity form-params form-errors]}]
|
||||||
@@ -600,7 +601,8 @@
|
|||||||
client-id)
|
client-id)
|
||||||
:transaction-rule/accounts (conj (into [] (repeat index {} ))
|
:transaction-rule/accounts (conj (into [] (repeat index {} ))
|
||||||
{:db/id (str (java.util.UUID/randomUUID))
|
{:db/id (str (java.util.UUID/randomUUID))
|
||||||
:transaction-rule-account/location "Shared"})}]
|
:transaction-rule-account/location "Shared"
|
||||||
|
:new? true})}]
|
||||||
(html-response
|
(html-response
|
||||||
(fc/start-form transaction-rule []
|
(fc/start-form transaction-rule []
|
||||||
(fc/with-cursor (get-in fc/*current* [:transaction-rule/accounts index])
|
(fc/with-cursor (get-in fc/*current* [:transaction-rule/accounts index])
|
||||||
|
|||||||
Reference in New Issue
Block a user