minor fixes from kyle
This commit is contained in:
@@ -321,6 +321,7 @@
|
|||||||
only-uncoded? :only-uncoded?}]
|
only-uncoded? :only-uncoded?}]
|
||||||
(let [valid-clients (extract-client-ids clients
|
(let [valid-clients (extract-client-ids clients
|
||||||
client)
|
client)
|
||||||
|
bank-account (or (:db/id bank-account) bank-account)
|
||||||
|
|
||||||
query (cond-> {:query {:find ['(pull ?e read)]
|
query (cond-> {:query {:find ['(pull ?e read)]
|
||||||
:in ['$ 'read]
|
:in ['$ 'read]
|
||||||
@@ -495,7 +496,7 @@
|
|||||||
{:errors (fc/field-errors)}
|
{:errors (fc/field-errors)}
|
||||||
[:div {:hx-trigger "changed"
|
[:div {:hx-trigger "changed"
|
||||||
:hx-target "next div"
|
:hx-target "next div"
|
||||||
:hx-vals (format "js:{name: '%s', 'client-id': event.detail.clientId, value: event.detail.accountId}" account-name)
|
:hx-vals (format "js:{name: '%s', 'client-id': event.detail.clientId, value: event.detail.accountId || ''}" account-name)
|
||||||
:hx-get (str (bidi/path-for ssr-routes/only-routes ::route/account-typeahead))
|
:hx-get (str (bidi/path-for ssr-routes/only-routes ::route/account-typeahead))
|
||||||
:x-init "$watch('clientId', cid => $dispatch('changed', $data));"}]
|
:x-init "$watch('clientId', cid => $dispatch('changed', $data));"}]
|
||||||
(account-typeahead* {:value (fc/field-value)
|
(account-typeahead* {:value (fc/field-value)
|
||||||
@@ -511,7 +512,7 @@
|
|||||||
[:div {:hx-trigger "changed"
|
[:div {:hx-trigger "changed"
|
||||||
:hx-target "next *"
|
:hx-target "next *"
|
||||||
:hx-swap "outerHTML"
|
:hx-swap "outerHTML"
|
||||||
:hx-vals (format "js:{name: '%s', 'client-id': event.detail.clientId || '', 'account-id': event.detail.accountId || '', value: event.detail.location}" (fc/field-name) )
|
:hx-vals (format "js:{name: '%s', 'client-id': event.detail.clientId || '', 'account-id': event.detail.accountId || '', value: event.detail.location || ''}" (fc/field-name) )
|
||||||
:hx-get (bidi/path-for ssr-routes/only-routes ::route/location-select)
|
:hx-get (bidi/path-for ssr-routes/only-routes ::route/location-select)
|
||||||
:x-init "$watch('clientId', cid => $dispatch('changed', $data)); $watch('accountId', cid => $dispatch('changed', $data) )"}]
|
:x-init "$watch('clientId', cid => $dispatch('changed', $data)); $watch('accountId', cid => $dispatch('changed', $data) )"}]
|
||||||
(location-select* {:name (fc/field-name)
|
(location-select* {:name (fc/field-name)
|
||||||
@@ -686,7 +687,7 @@
|
|||||||
:hx-get (bidi/path-for ssr-routes/only-routes
|
:hx-get (bidi/path-for ssr-routes/only-routes
|
||||||
::route/new-account)
|
::route/new-account)
|
||||||
:index (count (fc/field-value))
|
:index (count (fc/field-value))
|
||||||
:tr-params (hx/bind-alpine-vals {} {:client-id "clientId"})}
|
:tr-params (hx/bind-alpine-vals {} {"client-id" "clientId"})}
|
||||||
"New account")))))
|
"New account")))))
|
||||||
|
|
||||||
(fc/with-field :transaction-rule/transaction-approval-status
|
(fc/with-field :transaction-rule/transaction-approval-status
|
||||||
@@ -722,7 +723,7 @@
|
|||||||
(transaction-rule-account-row*
|
(transaction-rule-account-row*
|
||||||
fc/*current*
|
fc/*current*
|
||||||
client-id
|
client-id
|
||||||
(some->> client-id (pull-attr (dc/db conn) :client/locations) client-id)))))
|
(some->> client-id (pull-attr (dc/db conn) :client/locations))))))
|
||||||
|
|
||||||
(defn all-ids-not-locked [all-ids]
|
(defn all-ids-not-locked [all-ids]
|
||||||
(->> all-ids
|
(->> all-ids
|
||||||
|
|||||||
@@ -9,21 +9,15 @@
|
|||||||
|
|
||||||
(defn search [{:keys [clients query-params identity]}]
|
(defn search [{:keys [clients query-params identity]}]
|
||||||
|
|
||||||
(doto (let [name-like-ids (when (not-empty (get query-params "q"))
|
(let [name-like-ids (when (not-empty (get query-params "q"))
|
||||||
(set (map (comp #(Long/parseLong %) :id)
|
(map (comp #(Long/parseLong %) :id)
|
||||||
(doto
|
(solr/query solr/impl "vendors"
|
||||||
(solr/query solr/impl "vendors"
|
{"query" (cond-> (format "name:(%s*)" (str/upper-case (solr/escape (get query-params "q"))))
|
||||||
(doto
|
(not (is-admin? identity)) (str " hidden:false"))
|
||||||
{"query" (cond-> (format "name:(%s*)" (str/upper-case (solr/escape (get query-params "q"))))
|
"fields" "id"
|
||||||
(not (is-admin? identity)) (str " hidden:false"))
|
"limit" 300})))
|
||||||
"fields" "id"
|
valid-clients (for [n name-like-ids]
|
||||||
"limit" 300}
|
{"value" n "label" (pull-attr (dc/db conn) :vendor/name n)})]
|
||||||
clojure.pprint/pprint))
|
{:body (take 10 valid-clients)}))
|
||||||
clojure.pprint/pprint))))
|
|
||||||
_ (clojure.pprint/pprint name-like-ids)
|
|
||||||
valid-clients (for [n name-like-ids]
|
|
||||||
{"value" n "label" (pull-attr (dc/db conn) :vendor/name n)})]
|
|
||||||
{:body (take 10 valid-clients)})
|
|
||||||
clojure.pprint/pprint))
|
|
||||||
|
|
||||||
(def search (wrap-json-response search))
|
(def search (wrap-json-response search))
|
||||||
|
|||||||
Reference in New Issue
Block a user