Makes navigation a little bit better.

This commit is contained in:
Bryce
2024-03-20 14:48:44 -07:00
parent f6f6dcc865
commit 8af5713ba2
29 changed files with 280 additions and 227 deletions

View File

@@ -90,7 +90,7 @@
(def grid-page
(helper/build
{:id "entity-table"
:nav (com/company-aside-nav)
:nav com/company-aside-nav
:id-fn (comp :db/id second)
:fetch-page fetch-page
:breadcrumbs [[:a {:href (bidi/path-for ssr-routes/only-routes
@@ -126,46 +126,46 @@
(-> vendor :vendor/legal-entity-last-name)))]]
(when-let [t99-type (some-> vendor :vendor/legal-entity-1099-type :db/ident name)]
(com/pill
{:class "text-xs font-medium"
:color :primary}
(str/capitalize t99-type))
{:class "text-xs font-medium"
:color :primary}
(str/capitalize t99-type))
)])}
{:key "tin"
:name "TIN"
:sort-key "tin"
:show-starting "md"
:render (fn [[_ vendor]]
[:div.flex.gap-4
(when-let [tin (-> vendor :vendor/legal-entity-tin)]
[:span {:class "text-xs font-medium py-0.5 "}
tin])
(when-let [tin-type (some-> vendor :vendor/legal-entity-tin-type :db/ident name)]
(com/pill {:class "text-xs font-medium"
:color :yellow}
(name tin-type)))]
)}
[:div.flex.gap-4
(when-let [tin (-> vendor :vendor/legal-entity-tin)]
[:span {:class "text-xs font-medium py-0.5 "}
tin])
(when-let [tin-type (some-> vendor :vendor/legal-entity-tin-type :db/ident name)]
(com/pill {:class "text-xs font-medium"
:color :yellow}
(name tin-type)))]
)}
{:key "address"
:name "Address"
:sort-key "address"
:show-starting "lg"
:render (fn [[_ vendor]]
(if (-> vendor :vendor/address :address/street1)
[:div
[:div (-> vendor :vendor/address :address/street1)] " "
[:div
(-> vendor :vendor/address :address/street2)] " "
[:div
(-> vendor :vendor/address :address/city) " "
(-> vendor :vendor/address :address/state) ","
(-> vendor :vendor/address :address/zip)]]
[:p.text-sm.italic.text-gray-400 "No address"]))}
(if (-> vendor :vendor/address :address/street1)
[:div
[:div (-> vendor :vendor/address :address/street1)] " "
[:div
(-> vendor :vendor/address :address/street2)] " "
[:div
(-> vendor :vendor/address :address/city) " "
(-> vendor :vendor/address :address/state) ","
(-> vendor :vendor/address :address/zip)]]
[:p.text-sm.italic.text-gray-400 "No address"]))}
{:key "paid"
:name "Paid"
:sort-key "paid"
:render (fn [[_ _ paid]]
(com/pill {:class "text-xs font-medium"
:color :primary}
"Paid $" (Math/round paid)))}]}))
"Paid $" (Math/round paid)))}]}))

View File

@@ -133,7 +133,7 @@
(def grid-page
(helper/build
{:id "plaid-table"
:nav (com/company-aside-nav)
:nav com/company-aside-nav
:fetch-page fetch-page
:breadcrumbs [[:a {:href (bidi/path-for ssr-routes/only-routes
:company)}
@@ -181,9 +181,9 @@
:name "Accounts"
:show-starting "md"
:render (fn [e]
[:ul
(for [a (:plaid-item/accounts e)]
[:li (:plaid-account/name a) " - " (:plaid-account/number a)])])}]}))
[:ul
(for [a (:plaid-item/accounts e)]
[:li (:plaid-account/name a) " - " (:plaid-account/number a)])])}]}))
(def page (helper/page-route grid-page))

View File

@@ -70,7 +70,7 @@
(def grid-page
(helper/build {:id "report-table"
:nav (com/company-aside-nav)
:nav com/company-aside-nav
:fetch-page fetch-page
:breadcrumbs [[:a {:href (bidi/path-for ssr-routes/only-routes
:company)}

View File

@@ -122,7 +122,7 @@ fastlink.open({fastLinkURL: '%s',
(def grid-page
(helper/build
{:id "yodlee-table"
:nav (com/company-aside-nav)
:nav com/company-aside-nav
:id-fn :db/id
:fetch-page fetch-page
:breadcrumbs [[:a {:href (bidi/path-for ssr-routes/only-routes
@@ -136,19 +136,19 @@ fastlink.open({fastLinkURL: '%s',
:route :company-yodlee-table
:action-buttons (fn [request]
[[:div.flex.flex-col.flex-shrink
[:div.flex-shrink
(com/button {:color :primary
:on-click "openFastlink()"
:disabled (if (:client request)
false
true)
:hx-get (bidi/path-for ssr-routes/only-routes
:company-yodlee-fastlink-dialog)
:hx-target "#modal-holder"}
(com/button-icon {} svg/refresh)
"Link new account")]
(when-not (:client request)
[:div.text-xs "Note: please select a specific customer to link a new account."])]])
[:div.flex-shrink
(com/button {:color :primary
:on-click "openFastlink()"
:disabled (if (:client request)
false
true)
:hx-get (bidi/path-for ssr-routes/only-routes
:company-yodlee-fastlink-dialog)
:hx-target "#modal-holder"}
(com/button-icon {} svg/refresh)
"Link new account")]
(when-not (:client request)
[:div.text-xs "Note: please select a specific customer to link a new account."])]])
:row-buttons (fn [request _]
[
(com/button {:hx-put (bidi/path-for ssr-routes/only-routes
@@ -194,9 +194,9 @@ fastlink.open({fastLinkURL: '%s',
:name "Accounts"
:show-starting "md"
:render (fn [e]
[:ul
(for [a (:yodlee-provider-account/accounts e)]
[:li (:yodlee-account/name a) " - " (:yodlee-account/number a)])])}]}))
[:ul
(for [a (:yodlee-provider-account/accounts e)]
[:li (:yodlee-account/name a) " - " (:yodlee-account/number a)])])}]}))
(def page (helper/page-route grid-page))
(def table (helper/table-route grid-page))